ryco-cli 0.1.23 → 0.1.24

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 (269) hide show
  1. package/dist/bin.cjs +228 -88
  2. package/dist/bin.mjs +230 -90
  3. package/dist/client/assets/AccountSettings-ApnDA1f-.js +1 -0
  4. package/dist/client/assets/AiFocusSettings-CNmGHEcA.js +1 -0
  5. package/dist/client/assets/{AnimatedHeight-D9bpLPqe.js → AnimatedHeight-i0YhvlGD.js} +1 -1
  6. package/dist/client/assets/AppearanceSettings-BG8W4DP0.js +1 -0
  7. package/dist/client/assets/BranchToolbar.logic-AgPy06Mx.js +1 -0
  8. package/dist/client/assets/BrowserPanel-BWztlNuL.js +1 -0
  9. package/dist/client/assets/ChatRightPanel-a6UOHNMm.js +194 -0
  10. package/dist/client/assets/ChatThreadRouteView-CWoBLzR_.js +1 -0
  11. package/dist/client/assets/CommandPaletteDialog-B2iKWCUi.js +1 -0
  12. package/dist/client/assets/CompositeRoot-C1G-Ejus.js +1 -0
  13. package/dist/client/assets/ComputerUseSettings-CPwWoHWj.js +1 -0
  14. package/dist/client/assets/ConnectionsSettings-CPMkuxza.js +7 -0
  15. package/dist/client/assets/ContextHandoffEndpointLabel-BildLLDY.js +4 -0
  16. package/dist/client/assets/DiagnosticsSettings-DvnNz2AZ.js +2 -0
  17. package/dist/client/assets/DialogHandle-8o3kfoiI.js +1 -0
  18. package/dist/client/assets/DialogPopup-CLw6NCkW.js +1 -0
  19. package/dist/client/assets/DialogRoot-SKkIuQHA.js +1 -0
  20. package/dist/client/assets/DialogTitle-DCHX74Tz.js +1 -0
  21. package/dist/client/assets/DialogTrigger-Bl_fcIV2.js +1 -0
  22. package/dist/client/assets/DialogViewport-DVDl03yd.js +1 -0
  23. package/dist/client/assets/DraftChatThreadRouteView-CEDYjbKq.js +1 -0
  24. package/dist/client/assets/{ExternalIdentityWeb.logic-pjD4pCDd.js → ExternalIdentityWeb.logic-arHvT6AX.js} +1 -1
  25. package/dist/client/assets/GlassSurface-GY6owikG.js +1 -0
  26. package/dist/client/assets/HostedConnectionControls-COUhSe9x.js +1 -0
  27. package/dist/client/assets/HostedHubRoot-BTWc0XoQ.js +2 -0
  28. package/dist/client/assets/HostedNativeAuthorizationRoute-DZhYxv--.js +2 -0
  29. package/dist/client/assets/HostedRelayTrustNotice-Bl6On0Yi.js +1 -0
  30. package/dist/client/assets/IntegrationsSettingsPanel-n9owMZf-.js +2 -0
  31. package/dist/client/assets/KeybindingsSettings-CPtXx-W2.js +7 -0
  32. package/dist/client/assets/LazyBrowserPanel-SUIBB7B4.js +2 -0
  33. package/dist/client/assets/McpServersSettings-BWIUud0Z.js +6 -0
  34. package/dist/client/assets/MobileSheet-NTayGHF6.js +1 -0
  35. package/dist/client/assets/NodeSecuritySettings-BFifrshE.js +1 -0
  36. package/dist/client/assets/OpinionatedPluginsSettings-D7WuuNWZ.js +1 -0
  37. package/dist/client/assets/PhoneGetAppInterstitial-R0cqI17q.js +1 -0
  38. package/dist/client/assets/PhoneHome-FqWvnJP_.js +1 -0
  39. package/dist/client/assets/PhoneSettingsSurface-w5PJnoBc.js +2 -0
  40. package/dist/client/assets/ProviderModelPicker-dwWhl7Uf.js +1 -0
  41. package/dist/client/assets/ProvidersSettingsPanel-Ww1ch3xA.js +1 -0
  42. package/dist/client/assets/QuitShortcutFeedback-CklL3jMd.js +1 -0
  43. package/dist/client/assets/RedactedSensitiveText-CLPBtvH1.js +1 -0
  44. package/dist/client/assets/RootAppShell-BdQCs2XJ.js +7 -0
  45. package/dist/client/assets/Separator-CpYBhf-I.js +1 -0
  46. package/dist/client/assets/SettingsDialog-DeMzEeCP.js +2 -0
  47. package/dist/client/assets/SettingsPanels-ZxNz9ZfL.js +3 -0
  48. package/dist/client/assets/SettingsPanels.editor-9pSZP875.js +1 -0
  49. package/dist/client/assets/SourceControlSettings-C1F3Brcn.js +1 -0
  50. package/dist/client/assets/StatisticsPage-C7v-6CTr.js +1 -0
  51. package/dist/client/assets/StatisticsPanel-CeIjiBm8.js +1 -0
  52. package/dist/client/assets/StatisticsSettingsLink-5s_violW.js +1 -0
  53. package/dist/client/assets/{ThreadTerminalDrawer-DcZk76Y9.js → ThreadTerminalDrawer-CHZ60lPI.js} +11 -11
  54. package/dist/client/assets/{ThreadWorkspacePanel-Shhau2BD.js → ThreadWorkspacePanel-Ct5kMcuY.js} +17 -17
  55. package/dist/client/assets/activity-BMBx2Fu0.js +1 -0
  56. package/dist/client/assets/alert-CXnC_RJc.js +1 -0
  57. package/dist/client/assets/{appChrome-CiOQzE1d.js → appChrome-BzM66lXM.js} +1 -1
  58. package/dist/client/assets/arrow-left-CymyVbCi.js +1 -0
  59. package/dist/client/assets/arrow-right-9wyq4YVq.js +1 -0
  60. package/dist/client/assets/arrow-up-right-mfU38K6p.js +1 -0
  61. package/dist/client/assets/authorization-CjOFkg7b.js +1 -0
  62. package/dist/client/assets/badge-Dg7mXiOh.js +1 -0
  63. package/dist/client/assets/bot-BR3RyOWP.js +1 -0
  64. package/dist/client/assets/{capabilities-BTd0MRtv.js → capabilities-C8sxDbKT.js} +1 -1
  65. package/dist/client/assets/chart-column-CcRi3pAd.js +1 -0
  66. package/dist/client/assets/chevron-right-CuUjBsQV.js +1 -0
  67. package/dist/client/assets/clipboard-copy-ezz8rnaT.js +1 -0
  68. package/dist/client/assets/data-list-ZLhzdlED.js +1 -0
  69. package/dist/client/assets/desktopWorkspace-P28r2lN2.js +1 -0
  70. package/dist/client/assets/download-BA9L9tK9.js +1 -0
  71. package/dist/client/assets/editorPreferences-DeKdSV3s.js +1 -0
  72. package/dist/client/assets/empty-3NpXLnAM.js +1 -0
  73. package/dist/client/assets/group-D5qBdsaB.js +1 -0
  74. package/dist/client/assets/hostedConnectionCoordinator-CLV-JD1S.js +1 -0
  75. package/dist/client/assets/{hostedPairing-PogXRAb7.js → hostedPairing-B_ylEEDa.js} +1 -1
  76. package/dist/client/assets/hubRoutes-EWJ3Gdod.js +1 -0
  77. package/dist/client/assets/{index-D5j6WG7w.js → index-DxCd1PgA.js} +2 -2
  78. package/dist/client/assets/input-DrOL1KPS.js +1 -0
  79. package/dist/client/assets/kbd-rWDjJnWX.js +1 -0
  80. package/dist/client/assets/key-round-D2DtQ7aS.js +1 -0
  81. package/dist/client/assets/layers-DtSJWmwy.js +1 -0
  82. package/dist/client/assets/log-out-YAp9fsOg.js +1 -0
  83. package/dist/client/assets/{logging-DfaR8ACp.js → logging-BuUPX1SP.js} +1 -1
  84. package/dist/client/assets/main-BbtLAX7M.js +9 -0
  85. package/dist/client/assets/{main-CRk9p9SC.css → main-D4CtFNPY.css} +1 -1
  86. package/dist/client/assets/monitor-OyD484tI.js +1 -0
  87. package/dist/client/assets/palette-D18VboLH.js +1 -0
  88. package/dist/client/assets/play-d3KUi4G6.js +1 -0
  89. package/dist/client/assets/primary-D_D7eLwT.js +2 -0
  90. package/dist/client/assets/{providerDriverMeta-Cl-ADdmZ.js → providerDriverMeta-DNTocCcU.js} +1 -1
  91. package/dist/client/assets/providerModels-bFbEIfL9.js +1 -0
  92. package/dist/client/assets/{qr-code-Bun4dpvz.js → qr-code-Bk1kdf_k.js} +1 -1
  93. package/dist/client/assets/qr-code-MAZkoKtL.js +1 -0
  94. package/dist/client/assets/radio-group-D-VCGinX.js +2 -0
  95. package/dist/client/assets/refresh-cw-DY3_Ph-S.js +1 -0
  96. package/dist/client/assets/runtime-Djy96GJd.js +17 -0
  97. package/dist/client/assets/save-ugJXuJRM.js +1 -0
  98. package/dist/client/assets/scroll-area-BMnGzd2a.js +1 -0
  99. package/dist/client/assets/scrollEdges-QLSFwGSQ.js +1 -0
  100. package/dist/client/assets/separator-BwUYkCkX.js +1 -0
  101. package/dist/client/assets/settingsLayout-C6SUmJVB.js +1 -0
  102. package/dist/client/assets/sheet-DLy4aeVa.js +1 -0
  103. package/dist/client/assets/shield-Zq_ygsnJ.js +1 -0
  104. package/dist/client/assets/shield-alert-DfUhTI4-.js +1 -0
  105. package/dist/client/assets/shield-check-CO4SMhAs.js +1 -0
  106. package/dist/client/assets/sidebar-DNnW-a2V.js +1 -0
  107. package/dist/client/assets/sidebarProjectFolders-ygpaKZM6.js +4 -0
  108. package/dist/client/assets/sidebarStatusText-CawrXnx0.js +1 -0
  109. package/dist/client/assets/skeleton-DRm4_OvB.js +1 -0
  110. package/dist/client/assets/smartphone-O2VACDhU.js +1 -0
  111. package/dist/client/assets/sparkles-isHutYWU.js +1 -0
  112. package/dist/client/assets/src-BSuAGqhK.js +14 -0
  113. package/dist/client/assets/star-7UHEnC3x.js +1 -0
  114. package/dist/client/assets/{switch-COrEGDkz.js → switch-DD1qVLgN.js} +9 -9
  115. package/dist/client/assets/toastHelpers-CSQRKo4F.js +1 -0
  116. package/dist/client/assets/toggle-CaKBNe6W.js +1 -0
  117. package/dist/client/assets/toggle-group-UeFeTI3u.js +1 -0
  118. package/dist/client/assets/tokenModePresentation-DV56ekA4.js +1 -0
  119. package/dist/client/assets/tooltip-DXvXxL37.js +1 -0
  120. package/dist/client/assets/unplug-DisTpujT.js +1 -0
  121. package/dist/client/assets/useAppSidebarCollapsed-CaAsLi1q.js +1 -0
  122. package/dist/client/assets/useBaseUiId-CJN4MvrU.js +1 -0
  123. package/dist/client/assets/useLabelableId-BsDFG9Oj.js +1 -0
  124. package/dist/client/assets/useNavigate-cLfxn_9L.js +1 -0
  125. package/dist/client/assets/usePhoneThreadActions-rekHL1Mi.js +1 -0
  126. package/dist/client/assets/usePopupViewport-kXU31P6l.js +1 -0
  127. package/dist/client/assets/useScrollLock-DjMxrUJe.js +1 -0
  128. package/dist/client/assets/{useStatistics-DfLU9_Qu.js → useStatistics-BYP-9CmW.js} +15 -15
  129. package/dist/client/assets/useTriggerFocusGuards-DuAm2B8C.js +1 -0
  130. package/dist/client/assets/useValueChanged-DreFjrMK.js +1 -0
  131. package/dist/client/assets/user-round-DctamWV6.js +1 -0
  132. package/dist/client/assets/{vscode-icons-Dgo7Sslf.js → vscode-icons-Dw-LGJAv.js} +1 -1
  133. package/dist/client/assets/{workspaceMetadataProjection-UiprkDbH.js → workspaceMetadataProjection-BL4sEIL2.js} +1 -1
  134. package/dist/client/assets/wrench-Ds8eZerZ.js +1 -0
  135. package/dist/client/index.html +1 -1
  136. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  137. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  138. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  139. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  140. package/package.json +1 -1
  141. package/dist/client/assets/AccountSettings-DGvZzAqN.js +0 -1
  142. package/dist/client/assets/AiFocusSettings-D8wZfNES.js +0 -1
  143. package/dist/client/assets/AppearanceSettings-BFo6g6_s.js +0 -1
  144. package/dist/client/assets/BranchToolbar.logic-CmO2U1U7.js +0 -1
  145. package/dist/client/assets/BrowserPanel-r6is5C3e.js +0 -1
  146. package/dist/client/assets/ChatRightPanel-BewXBRFZ.js +0 -194
  147. package/dist/client/assets/ChatThreadRouteView-CC_6FmHd.js +0 -1
  148. package/dist/client/assets/CommandPaletteDialog-ftA_Xg2G.js +0 -1
  149. package/dist/client/assets/CompositeRoot-arlgwzfX.js +0 -1
  150. package/dist/client/assets/ComputerUseSettings-V-oMtddy.js +0 -1
  151. package/dist/client/assets/ConnectionsSettings-BrFvrRjz.js +0 -7
  152. package/dist/client/assets/ContextHandoffEndpointLabel-CPeU4K5A.js +0 -4
  153. package/dist/client/assets/DiagnosticsSettings-Dk3JaIOU.js +0 -2
  154. package/dist/client/assets/DialogHandle-00ZXxxpz.js +0 -1
  155. package/dist/client/assets/DialogPopup-mazVJKyB.js +0 -1
  156. package/dist/client/assets/DialogRoot-CWlzx19Z.js +0 -1
  157. package/dist/client/assets/DialogTitle-CKaEtTky.js +0 -1
  158. package/dist/client/assets/DialogTrigger-CiElTNmo.js +0 -1
  159. package/dist/client/assets/DialogViewport-a5beR5bY.js +0 -1
  160. package/dist/client/assets/DraftChatThreadRouteView-DMwnSfgh.js +0 -1
  161. package/dist/client/assets/FloatingPortalLite-DWdtHKob.js +0 -1
  162. package/dist/client/assets/GlassSurface-BqfxDYiR.js +0 -1
  163. package/dist/client/assets/HostedConnectionControls-BmJd89CC.js +0 -1
  164. package/dist/client/assets/HostedHubRoot-CRIiJ67A.js +0 -2
  165. package/dist/client/assets/HostedNativeAuthorizationRoute-DcksCt9n.js +0 -2
  166. package/dist/client/assets/HostedRelayTrustNotice-C9pl5h2a.js +0 -1
  167. package/dist/client/assets/IntegrationsSettingsPanel-BnfjyLrM.js +0 -2
  168. package/dist/client/assets/KeybindingsSettings-CkW7lzvz.js +0 -7
  169. package/dist/client/assets/LazyBrowserPanel-C6uMUmoV.js +0 -2
  170. package/dist/client/assets/McpServersSettings-BdXgS-Pm.js +0 -6
  171. package/dist/client/assets/MobileSheet-D19YdeQ9.js +0 -1
  172. package/dist/client/assets/NodeSecuritySettings-BfcBgtEg.js +0 -1
  173. package/dist/client/assets/OpinionatedPluginsSettings-YY54IT7P.js +0 -1
  174. package/dist/client/assets/PhoneGetAppInterstitial-9r6NwJP8.js +0 -1
  175. package/dist/client/assets/PhoneHome-DnEJp0bU.js +0 -1
  176. package/dist/client/assets/PhoneSettingsSurface-NKJrLCxU.js +0 -2
  177. package/dist/client/assets/ProviderModelPicker-CYGv-4fE.js +0 -1
  178. package/dist/client/assets/ProvidersSettingsPanel-DsXHij4h.js +0 -1
  179. package/dist/client/assets/QuitShortcutFeedback-BVyYaNtd.js +0 -1
  180. package/dist/client/assets/RedactedSensitiveText-D8j7kpow.js +0 -1
  181. package/dist/client/assets/RootAppShell-D7c8sbA0.js +0 -7
  182. package/dist/client/assets/Separator-Bn8l1oSK.js +0 -1
  183. package/dist/client/assets/SettingsDialog-BlPX1mT8.js +0 -2
  184. package/dist/client/assets/SettingsPanels-CeuvwIV_.js +0 -3
  185. package/dist/client/assets/SettingsPanels.editor-CLJJeKLI.js +0 -1
  186. package/dist/client/assets/SourceControlSettings-D-GeZ6PW.js +0 -1
  187. package/dist/client/assets/StatisticsPage-poomFDoQ.js +0 -1
  188. package/dist/client/assets/StatisticsPanel-DbGgCCpZ.js +0 -1
  189. package/dist/client/assets/StatisticsSettingsLink-Brc9--O7.js +0 -1
  190. package/dist/client/assets/activity-Dy-wOS-S.js +0 -1
  191. package/dist/client/assets/alert-4WZo8oMe.js +0 -1
  192. package/dist/client/assets/arrow-left-gLRAasih.js +0 -1
  193. package/dist/client/assets/arrow-right-CAK2t4QL.js +0 -1
  194. package/dist/client/assets/arrow-up-right-DP0hmMEB.js +0 -1
  195. package/dist/client/assets/authorization-K_UCP_xh.js +0 -1
  196. package/dist/client/assets/badge-CYDyJZRJ.js +0 -1
  197. package/dist/client/assets/bot-CCrx5oCt.js +0 -1
  198. package/dist/client/assets/button-QrCU0tNP.js +0 -1
  199. package/dist/client/assets/chart-column-BvK6lSzG.js +0 -1
  200. package/dist/client/assets/chevron-down-yka18-iP.js +0 -1
  201. package/dist/client/assets/chevron-right-CHyIXx5W.js +0 -1
  202. package/dist/client/assets/clamp-D0kAXd-u.js +0 -1
  203. package/dist/client/assets/clipboard-copy-DfdkWOiT.js +0 -1
  204. package/dist/client/assets/copy-riIPLkKV.js +0 -1
  205. package/dist/client/assets/data-list-CsiYTho5.js +0 -1
  206. package/dist/client/assets/download-B0lbSdq5.js +0 -1
  207. package/dist/client/assets/editorPreferences-Cf2Smgu1.js +0 -1
  208. package/dist/client/assets/empty-CHk0OiOB.js +0 -1
  209. package/dist/client/assets/group-DfFZdj79.js +0 -1
  210. package/dist/client/assets/hostedConnectionCoordinator-DZh1yVqz.js +0 -1
  211. package/dist/client/assets/input-BAC5Cd3b.js +0 -1
  212. package/dist/client/assets/kbd-CMUW8K7b.js +0 -1
  213. package/dist/client/assets/key-round-Cm6itp2V.js +0 -1
  214. package/dist/client/assets/layers-DoDpJao_.js +0 -1
  215. package/dist/client/assets/loader-circle-D0CNb5GI.js +0 -1
  216. package/dist/client/assets/log-out-BuoOiS45.js +0 -1
  217. package/dist/client/assets/main-DaXSCt8g.js +0 -9
  218. package/dist/client/assets/monitor-Dyigmrl2.js +0 -1
  219. package/dist/client/assets/palette-kIM_geXk.js +0 -1
  220. package/dist/client/assets/play-Dh8XDMnw.js +0 -1
  221. package/dist/client/assets/primary-DjXNHNGV.js +0 -2
  222. package/dist/client/assets/providerModels-dpugJUmV.js +0 -1
  223. package/dist/client/assets/qr-code-CkI1p05P.js +0 -1
  224. package/dist/client/assets/radio-group-Hh0oQGyf.js +0 -2
  225. package/dist/client/assets/react-dom-x9LNwWQc.js +0 -1
  226. package/dist/client/assets/refresh-cw-MqmsC7V0.js +0 -1
  227. package/dist/client/assets/runtime-L56puJDA.js +0 -17
  228. package/dist/client/assets/save-BSB81i-r.js +0 -1
  229. package/dist/client/assets/scroll-area-DCGCzd6v.js +0 -1
  230. package/dist/client/assets/scrollEdges-DIzjkUJG.js +0 -1
  231. package/dist/client/assets/separator-YeH3P39x.js +0 -1
  232. package/dist/client/assets/settingsLayout-CmNqO2kB.js +0 -1
  233. package/dist/client/assets/settingsSections.logic-Bg960p_I.js +0 -1
  234. package/dist/client/assets/sheet-CTbjQ5Bv.js +0 -1
  235. package/dist/client/assets/shield-DlqCO-0N.js +0 -1
  236. package/dist/client/assets/shield-alert-BrZ-Rb8N.js +0 -1
  237. package/dist/client/assets/shield-check-DHxdM6te.js +0 -1
  238. package/dist/client/assets/sidebar-4cwEndEB.js +0 -1
  239. package/dist/client/assets/sidebarProjectFolders-C7WDwUYJ.js +0 -4
  240. package/dist/client/assets/sidebarStatusText-Cq_MMykN.js +0 -1
  241. package/dist/client/assets/skeleton-BlostfCS.js +0 -1
  242. package/dist/client/assets/smartphone-OaA-Xj_d.js +0 -1
  243. package/dist/client/assets/sparkles-BXwkPX2M.js +0 -1
  244. package/dist/client/assets/src-gDjuIvMO.js +0 -14
  245. package/dist/client/assets/star-BjaAYD-x.js +0 -1
  246. package/dist/client/assets/toast-C_F1LeME.js +0 -1
  247. package/dist/client/assets/toggle-BPNEBXg_.js +0 -1
  248. package/dist/client/assets/toggle-group-BC1zJ9xi.js +0 -1
  249. package/dist/client/assets/tokenModePresentation-DUJ8DMTy.js +0 -1
  250. package/dist/client/assets/tooltip-iy3_osu5.js +0 -1
  251. package/dist/client/assets/triangle-alert-YXqtFxD6.js +0 -1
  252. package/dist/client/assets/unplug-e3z4rXgY.js +0 -1
  253. package/dist/client/assets/useAppSidebarCollapsed-mtvJ7qbW.js +0 -1
  254. package/dist/client/assets/useLabelableId-NJQsKdL6.js +0 -1
  255. package/dist/client/assets/useNavigate-2tVq4iZ2.js +0 -1
  256. package/dist/client/assets/usePhoneThreadActions-97AsVVIR.js +0 -1
  257. package/dist/client/assets/usePopupViewport-8OM2irPK.js +0 -1
  258. package/dist/client/assets/usePositioner-0Kb-C4al.js +0 -1
  259. package/dist/client/assets/useRenderElement-D0HVF5g_.js +0 -1
  260. package/dist/client/assets/useRouter-CcIDS3PN.js +0 -1
  261. package/dist/client/assets/useScrollLock-AUqaSAkf.js +0 -1
  262. package/dist/client/assets/useSwipeDismiss-CcW-GPO_.js +0 -1
  263. package/dist/client/assets/useTriggerFocusGuards-ChBvppef.js +0 -1
  264. package/dist/client/assets/useValueChanged-CThCTn4h.js +0 -1
  265. package/dist/client/assets/user-round-evbX_eto.js +0 -1
  266. package/dist/client/assets/utils-5-6TOrS1.js +0 -1
  267. package/dist/client/assets/visuallyHidden-BRaogTVF.js +0 -1
  268. package/dist/client/assets/wrench-mA--bcId.js +0 -1
  269. package/dist/client/assets/x-_SjFRYll.js +0 -1
@@ -1 +1 @@
1
- import{Y as e,at as t,nt as n,st as r}from"./src-gDjuIvMO.js";import{Tn as i}from"./runtime-L56puJDA.js";function a(e){return typeof e==`object`&&!!e}function o(e){return typeof e==`string`&&e.length>0}function s(e,t){return a(e)&&e.environmentId===t}function c(e,t){if(!a(e)||e.schemaVersion!==1||!o(e.environmentId))return!1;let n=e.environmentId;if(t!==void 0&&n!==t||typeof e.capturedAt!=`number`||!Number.isFinite(e.capturedAt)||!Array.isArray(e.projects)||!Array.isArray(e.worktrees)||!Array.isArray(e.threads))return!1;let r=new Set;for(let t of e.projects){if(!s(t,n)||!o(t.id)||!o(t.name)||typeof t.cwd!=`string`||r.has(t.id))return!1;r.add(t.id)}let i=new Set;for(let t of e.worktrees){if(!s(t,n)||!o(t.id)||!o(t.projectId)||!r.has(t.projectId)||i.has(t.id))return!1;i.add(t.id)}let c=new Set;for(let t of e.threads){if(!s(t,n)||!o(t.id)||!o(t.projectId)||!r.has(t.projectId)||c.has(t.id)||t.worktreeId!=null&&!i.has(t.worktreeId))return!1;c.add(t.id)}return!0}function l(e){return new TextEncoder().encode(JSON.stringify(e)).byteLength}function u(e){return JSON.stringify([e.hubOrigin.replace(/\/+$/g,``).toLowerCase(),e.accountId,e.environmentId])}function d(e){let t=e.maxEntries??32,n=e.maxBytes??16777216;if(e.incoming.payloadBytes>n||t<1)return{accepted:!1,evict:[]};let r=u(e.incoming.namespace),i=e.existing.filter(e=>u(e.namespace)!==r).toSorted((e,t)=>e.updatedAt-t.updatedAt||u(e.namespace).localeCompare(u(t.namespace))),a=i.length+1,o=i.reduce((e,t)=>e+t.payloadBytes,0)+e.incoming.payloadBytes,s=[];for(let e of i){if(a<=t&&o<=n)break;s.push(e.namespace),--a,o-=e.payloadBytes}return{accepted:a<=t&&o<=n,evict:s}}function f(t,n=Date.now(),r=!1){let a=i.getState().environmentStateById[t];if(!a?.bootstrapComplete)return null;let o={schemaVersion:1,environmentId:t,capturedAt:n,projects:a.projectIds.flatMap(e=>{let n=a.projectById[e];return n?[{environmentId:t,id:n.id,name:n.name,cwd:n.cwd,repositoryIdentity:n.repositoryIdentity??null,createdAt:n.createdAt??null,updatedAt:n.updatedAt??null}]:[]}),worktrees:(a.worktreeIds??[]).flatMap(e=>{let n=a.worktreeById?.[e];return n?[{environmentId:t,id:n.id,projectId:n.projectId,title:n.title??null,branch:n.branch,worktreePath:n.worktreePath,workItemLabel:n.workItemKey??n.prTitle??n.issueTitle??null,pullRequestNumber:n.prNumber,archivedAt:n.archivedAt,updatedAt:n.updatedAt}]:[]}),threads:a.threadIds.flatMap(n=>{let i=a.sidebarThreadSummaryById[n];return i?[{environmentId:t,id:i.id,projectId:i.projectId,worktreeId:i.worktreeId?e.make(i.worktreeId):null,title:i.title,createdAt:i.createdAt,updatedAt:i.updatedAt??null,archivedAt:i.archivedAt,settledOverride:i.settledOverride??null,settledAt:i.settledAt??null,snoozedUntil:i.snoozedUntil??null,snoozedAt:i.snoozedAt??null,modelSelection:i.modelSelection??null,providerDriver:i.providerDriver??null,branch:i.branch,hasPendingApprovals:i.hasPendingApprovals,hasPendingUserInput:i.hasPendingUserInput,hasActionableProposedPlan:i.hasActionableProposedPlan,deliveryUnknown:r}]:[]})};return c(o,t)?o:null}function p(e,t){return e.environmentId===t?e:{...e,environmentId:t,projects:e.projects.map(e=>({...e,environmentId:t})),worktrees:e.worktrees.map(e=>({...e,environmentId:t})),threads:e.threads.map(e=>({...e,environmentId:t}))}}function m(e){return{capturedAt:e.capturedAt,projects:e.projects.map(e=>({id:e.id,environmentId:e.environmentId,name:e.name,cwd:e.cwd,repositoryIdentity:e.repositoryIdentity,defaultModelSelection:null,createdAt:e.createdAt??void 0,updatedAt:e.updatedAt??void 0,scripts:[]})),worktrees:e.worktrees.map(e=>({id:e.id,environmentId:e.environmentId,projectId:e.projectId,title:e.title,branch:e.branch,worktreePath:e.worktreePath,origin:`manual`,prNumber:e.pullRequestNumber,issueNumber:null,prTitle:e.workItemLabel,issueTitle:null,prState:null,prIsDraft:null,issueState:null,workItemProvider:null,workItemKey:null,workItemTitle:e.workItemLabel,workItemState:null,workItemStateName:null,workItemUrl:null,createdAt:e.updatedAt,updatedAt:e.updatedAt,archivedAt:e.archivedAt,manualPosition:0})),threads:e.threads.map(e=>{let i=e.providerDriver??t.make(`codex`),a=e.modelSelection??{instanceId:r(i),model:n[i]??`gpt-5.6-terra`};return{shell:{id:e.id,environmentId:e.environmentId,codexThreadId:null,projectId:e.projectId,title:e.title,modelSelection:a,runtimeMode:`full-access`,interactionMode:`default`,error:null,createdAt:e.createdAt,archivedAt:e.archivedAt,settledOverride:e.settledOverride??null,settledAt:e.settledAt??null,snoozedUntil:e.snoozedUntil??null,snoozedAt:e.snoozedAt??null,updatedAt:e.updatedAt??void 0,branch:e.branch,worktreePath:null,worktreeId:e.worktreeId},summary:{id:e.id,environmentId:e.environmentId,projectId:e.projectId,title:e.title,interactionMode:`default`,modelSelection:a,providerDriver:e.providerDriver,session:null,createdAt:e.createdAt,archivedAt:e.archivedAt,settledOverride:e.settledOverride??null,settledAt:e.settledAt??null,snoozedUntil:e.snoozedUntil??null,snoozedAt:e.snoozedAt??null,updatedAt:e.updatedAt??void 0,latestTurn:null,branch:e.branch,worktreePath:null,worktreeId:e.worktreeId,latestUserMessageAt:null,hasPendingApprovals:e.hasPendingApprovals,hasPendingUserInput:e.hasPendingUserInput,hasActionableProposedPlan:e.hasActionableProposedPlan}}})}}export{d as a,c as i,p as n,u as o,m as r,l as s,f as t};
1
+ import{Y as e,at as t,nt as n,st as r}from"./src-BSuAGqhK.js";import{Nn as i}from"./runtime-Djy96GJd.js";function a(e){return typeof e==`object`&&!!e}function o(e){return typeof e==`string`&&e.length>0}function s(e,t){return a(e)&&e.environmentId===t}function c(e,t){if(!a(e)||e.schemaVersion!==1||!o(e.environmentId))return!1;let n=e.environmentId;if(t!==void 0&&n!==t||typeof e.capturedAt!=`number`||!Number.isFinite(e.capturedAt)||!Array.isArray(e.projects)||!Array.isArray(e.worktrees)||!Array.isArray(e.threads))return!1;let r=new Set;for(let t of e.projects){if(!s(t,n)||!o(t.id)||!o(t.name)||typeof t.cwd!=`string`||r.has(t.id))return!1;r.add(t.id)}let i=new Set;for(let t of e.worktrees){if(!s(t,n)||!o(t.id)||!o(t.projectId)||!r.has(t.projectId)||i.has(t.id))return!1;i.add(t.id)}let c=new Set;for(let t of e.threads){if(!s(t,n)||!o(t.id)||!o(t.projectId)||!r.has(t.projectId)||c.has(t.id)||t.worktreeId!=null&&!i.has(t.worktreeId))return!1;c.add(t.id)}return!0}function l(e){return new TextEncoder().encode(JSON.stringify(e)).byteLength}function u(e){return JSON.stringify([e.hubOrigin.replace(/\/+$/g,``).toLowerCase(),e.accountId,e.environmentId])}function d(e){let t=e.maxEntries??32,n=e.maxBytes??16777216;if(e.incoming.payloadBytes>n||t<1)return{accepted:!1,evict:[]};let r=u(e.incoming.namespace),i=e.existing.filter(e=>u(e.namespace)!==r).toSorted((e,t)=>e.updatedAt-t.updatedAt||u(e.namespace).localeCompare(u(t.namespace))),a=i.length+1,o=i.reduce((e,t)=>e+t.payloadBytes,0)+e.incoming.payloadBytes,s=[];for(let e of i){if(a<=t&&o<=n)break;s.push(e.namespace),--a,o-=e.payloadBytes}return{accepted:a<=t&&o<=n,evict:s}}function f(t,n=Date.now(),r=!1){let a=i.getState().environmentStateById[t];if(!a?.bootstrapComplete)return null;let o={schemaVersion:1,environmentId:t,capturedAt:n,projects:a.projectIds.flatMap(e=>{let n=a.projectById[e];return n?[{environmentId:t,id:n.id,name:n.name,cwd:n.cwd,repositoryIdentity:n.repositoryIdentity??null,createdAt:n.createdAt??null,updatedAt:n.updatedAt??null}]:[]}),worktrees:(a.worktreeIds??[]).flatMap(e=>{let n=a.worktreeById?.[e];return n?[{environmentId:t,id:n.id,projectId:n.projectId,title:n.title??null,branch:n.branch,worktreePath:n.worktreePath,workItemLabel:n.workItemKey??n.prTitle??n.issueTitle??null,pullRequestNumber:n.prNumber,archivedAt:n.archivedAt,updatedAt:n.updatedAt}]:[]}),threads:a.threadIds.flatMap(n=>{let i=a.sidebarThreadSummaryById[n];return i?[{environmentId:t,id:i.id,projectId:i.projectId,worktreeId:i.worktreeId?e.make(i.worktreeId):null,title:i.title,createdAt:i.createdAt,updatedAt:i.updatedAt??null,archivedAt:i.archivedAt,settledOverride:i.settledOverride??null,settledAt:i.settledAt??null,snoozedUntil:i.snoozedUntil??null,snoozedAt:i.snoozedAt??null,modelSelection:i.modelSelection??null,providerDriver:i.providerDriver??null,branch:i.branch,hasPendingApprovals:i.hasPendingApprovals,hasPendingUserInput:i.hasPendingUserInput,hasActionableProposedPlan:i.hasActionableProposedPlan,deliveryUnknown:r}]:[]})};return c(o,t)?o:null}function p(e,t){return e.environmentId===t?e:{...e,environmentId:t,projects:e.projects.map(e=>({...e,environmentId:t})),worktrees:e.worktrees.map(e=>({...e,environmentId:t})),threads:e.threads.map(e=>({...e,environmentId:t}))}}function m(e){return{capturedAt:e.capturedAt,projects:e.projects.map(e=>({id:e.id,environmentId:e.environmentId,name:e.name,cwd:e.cwd,repositoryIdentity:e.repositoryIdentity,defaultModelSelection:null,createdAt:e.createdAt??void 0,updatedAt:e.updatedAt??void 0,scripts:[]})),worktrees:e.worktrees.map(e=>({id:e.id,environmentId:e.environmentId,projectId:e.projectId,title:e.title,branch:e.branch,worktreePath:e.worktreePath,origin:`manual`,prNumber:e.pullRequestNumber,issueNumber:null,prTitle:e.workItemLabel,issueTitle:null,prState:null,prIsDraft:null,issueState:null,workItemProvider:null,workItemKey:null,workItemTitle:e.workItemLabel,workItemState:null,workItemStateName:null,workItemUrl:null,createdAt:e.updatedAt,updatedAt:e.updatedAt,archivedAt:e.archivedAt,manualPosition:0})),threads:e.threads.map(e=>{let i=e.providerDriver??t.make(`codex`),a=e.modelSelection??{instanceId:r(i),model:n[i]??`gpt-5.6-terra`};return{shell:{id:e.id,environmentId:e.environmentId,codexThreadId:null,projectId:e.projectId,title:e.title,modelSelection:a,runtimeMode:`full-access`,interactionMode:`default`,error:null,createdAt:e.createdAt,archivedAt:e.archivedAt,settledOverride:e.settledOverride??null,settledAt:e.settledAt??null,snoozedUntil:e.snoozedUntil??null,snoozedAt:e.snoozedAt??null,updatedAt:e.updatedAt??void 0,branch:e.branch,worktreePath:null,worktreeId:e.worktreeId},summary:{id:e.id,environmentId:e.environmentId,projectId:e.projectId,title:e.title,interactionMode:`default`,modelSelection:a,providerDriver:e.providerDriver,session:null,createdAt:e.createdAt,archivedAt:e.archivedAt,settledOverride:e.settledOverride??null,settledAt:e.settledAt??null,snoozedUntil:e.snoozedUntil??null,snoozedAt:e.snoozedAt??null,updatedAt:e.updatedAt??void 0,latestTurn:null,branch:e.branch,worktreePath:null,worktreeId:e.worktreeId,latestUserMessageAt:null,hasPendingApprovals:e.hasPendingApprovals,hasPendingUserInput:e.hasPendingUserInput,hasActionableProposedPlan:e.hasActionableProposedPlan}}})}}export{d as a,c as i,p as n,u as o,m as r,l as s,f as t};
@@ -0,0 +1 @@
1
+ import{Na as e}from"./runtime-Djy96GJd.js";var t={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};t.node;var n=e(t);export{n as t};
@@ -92,7 +92,7 @@
92
92
  }
93
93
  </style>
94
94
  <title>Ryco (Alpha)</title>
95
- <script type="module" crossorigin src="/assets/index-D5j6WG7w.js"></script>
95
+ <script type="module" crossorigin src="/assets/index-DxCd1PgA.js"></script>
96
96
  </head>
97
97
  <body>
98
98
  <div id="root">
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "ryco-cli": "dist/bin.mjs"
11
11
  },
12
12
  "type": "module",
13
- "version": "0.1.23",
13
+ "version": "0.1.24",
14
14
  "engines": {
15
15
  "node": "^22.16 || ^23.11 || >=24.10"
16
16
  },
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import"./src-gDjuIvMO.js";import{I as n,N as r,P as i,ia as a}from"./runtime-L56puJDA.js";import{A as ee,F as o,Ft as s,I as c,It as l,M as u,Mt as te,N as d,Nt as f,P as p,Pt as m,an as h,ct as g,j as ne,jt as re,kt as ie,r as _}from"./switch-COrEGDkz.js";import{t as v}from"./compiler-runtime-qmuS0Svy.js";import{_ as y,o as b}from"./authorization-K_UCP_xh.js";import{f as x}from"./useRenderElement-D0HVF5g_.js";import{n as S}from"./loader-circle-D0CNb5GI.js";import{K as C}from"./ContextHandoffEndpointLabel-CPeU4K5A.js";import{t as w}from"./badge-CYDyJZRJ.js";import{o as T}from"./toast-C_F1LeME.js";import{t as E}from"./copy-riIPLkKV.js";import{t as D}from"./key-round-Cm6itp2V.js";import{t as O}from"./refresh-cw-MqmsC7V0.js";import{t as k}from"./shield-check-DHxdM6te.js";import{t as A}from"./triangle-alert-YXqtFxD6.js";import{t as ae}from"./user-round-evbX_eto.js";import{t as j}from"./button-QrCU0tNP.js";import{n as oe,t as se}from"./input-BAC5Cd3b.js";import{i as M,n as ce,r as N,t as P}from"./alert-4WZo8oMe.js";import{C as F,S as I,_ as L,a as le,b as R,c as ue,d as de,f as z,g as B,h as V,i as H,l as U,m as W,n as G,o as K,p as q,r as fe,s as J,t as pe,u as Y,v as X,x as Z,y as me}from"./ExternalIdentityWeb.logic-pjD4pCDd.js";import{i as he,n as ge,r as _e}from"./settingsLayout-CmNqO2kB.js";import{t as ve}from"./qr-code-Bun4dpvz.js";var ye={name:`monitor-smartphone`,size:24,node:[[`path`,{d:`M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8`,key:`10dyio`}],[`path`,{d:`M10 19v-3.96 3.15`,key:`1irgej`}],[`path`,{d:`M7 19h5`,key:`qswx4l`}],[`rect`,{width:`6`,height:`10`,x:`16`,y:`12`,rx:`2`,key:`1egngj`}]]};ye.node;var be=x(ye),Q=e(t(),1),xe=v(),Se=`Signed-in native apps use these device keys to establish encrypted connections automatically. The Hub authorizes account-trusted connections, so this does not protect against a malicious Hub; independent node verification remains the stronger option.`,Ce={darwin:`macOS`,linux:`Linux`,windows:`Windows`,ios:`iPhone or iPad`,android:`Android`},we={"secure-enclave":`Secure Enclave`,strongbox:`StrongBox`,tee:`Hardware-backed TEE`,tpm:`TPM`,"hardware-backed":`Hardware backed`,unavailable:`Unavailable`};function Te(e){return Ce[e.platform]}function Ee(e){return`${we[e.reportedKeyBacking]} · reported by device`}function De(e){switch(e.status){case`active`:return`Active`;case`revoked`:return`Revoked`;case`superseded`:return`Superseded`}}function Oe(e){let t=e.trim();return t.length>0&&t.length<=100?t:null}function ke(e,t){return[{label:`Enrollment`,value:e.enrollmentId},{label:`Identity fingerprint`,value:e.identityFingerprint,fingerprint:!0},{label:`Agreement fingerprint`,value:e.agreementFingerprint,fingerprint:!0},{label:`Key backing`,value:Ee(e)},{label:`First enrolled`,value:t(e.createdAt)},{label:`Last used`,value:e.lastUsedAt===null?`Not used yet`:t(e.lastUsedAt)},...e.revokedAt===null?[]:[{label:`Revoked`,value:t(e.revokedAt)}]]}var $=a(),Ae=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function je(e){return Ae.format(new Date(e))}function Me(){let e=(0,xe.c)(75),t=r(Re),n=r(Le),i=r(Ie),[a,h]=(0,Q.useState)(null),[v,y]=(0,Q.useState)(``),[x,S]=(0,Q.useState)(null),C=i!==`idle`,T=i===`renaming-e2ee-device`,E=i===`revoking-e2ee-device`,D;e[0]===v?D=e[1]:(D=Oe(v),e[0]=v,e[1]=D);let O=D,k;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(k=[],e[2]=k):k=e[2],(0,Q.useEffect)(Fe,k);let A;e[3]!==O||e[4]!==a?(A=async()=>{a&&O!==null&&(await b.renameE2eeDevice(a.enrollmentId,{expectedEnrollmentRevision:a.enrollmentRevision,deviceLabel:O})).status===`committed`&&(h(null),y(``))},e[3]=O,e[4]=a,e[5]=A):A=e[5];let ae=A,M;e[6]===x?M=e[7]:(M=async()=>{x&&(await b.revokeE2eeDevice(x.enrollmentId,{expectedEnrollmentRevision:x.enrollmentRevision,reasonCode:`owner_requested`})).status===`committed`&&S(null)},e[6]=x,e[7]=M);let ce=M,N;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,$.jsx)(be,{"aria-hidden":!0,className:`size-3.5`}),e[8]=N):N=e[8];let P=C||n===`loading`,F;e[9]===P?F=e[10]:(F=(0,$.jsx)(j,{size:`xs`,variant:`ghost`,disabled:P,onClick:Pe,children:`Refresh`}),e[9]=P,e[10]=F);let I;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(_e,{title:`Automatic native encryption`,description:Se,status:`A new signed-in Desktop or mobile app enrolls its own keys; private keys stay on that device.`}),e[11]=I):I=e[11];let L;e[12]!==C||e[13]!==t||e[14]!==n?(L=t.length===0?(0,$.jsx)(_e,{title:n===`loading`?`Loading devices…`:`No native devices yet`,description:`Sign in from Ryco Desktop or mobile to enroll that app automatically. Web sessions stay separate and do not join this native device trust set.`,status:n===`stale`?`The device directory is temporarily unavailable.`:null,control:n===`loading`?(0,$.jsx)(g,{className:`size-3.5`}):null}):t.map(e=>{let t=e.status===`active`;return(0,$.jsx)(_e,{title:(0,$.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[e.deviceLabel,(0,$.jsx)(w,{variant:t?`success`:`secondary`,children:De(e)})]}),description:`${Te(e)} · Ryco ${e.appVersion}`,status:n===`stale`?`Showing the last device directory Ryco read.`:null,control:t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(j,{size:`xs`,variant:`outline`,disabled:C,onClick:()=>{h(e),y(e.deviceLabel)},children:`Rename`}),(0,$.jsx)(j,{size:`xs`,variant:`destructive-outline`,disabled:C,onClick:()=>S(e),children:`Revoke`})]}):null,children:(0,$.jsx)(`dl`,{className:`mt-3 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 border-t border-border/60 py-3`,children:ke(e,je).map(Ne)})},`${e.enrollmentId}:${String(e.enrollmentRevision)}`)}),e[12]=C,e[13]=t,e[14]=n,e[15]=L):L=e[15];let le=a!==null,R;e[16]===T?R=e[17]:(R=e=>{e||T||(h(null),y(``))},e[16]=T,e[17]=R);let ue;e[18]===ae?ue=e[19]:(ue=e=>{e.preventDefault(),ae()},e[18]=ae,e[19]=ue);let de;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,$.jsxs)(f,{children:[(0,$.jsx)(l,{children:`Rename encrypted device`}),(0,$.jsx)(re,{children:`This label is account metadata. Renaming does not rotate or replace the device keys.`})]}),e[20]=de):de=e[20];let z;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(_,{htmlFor:`account-e2ee-device-label`,children:`Device name`}),e[21]=z):z=e[21];let B;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>y(e.target.value),e[22]=B):B=e[22];let V;e[23]!==v||e[24]!==T?(V=(0,$.jsxs)(m,{className:`space-y-2`,children:[z,(0,$.jsx)(se,{id:`account-e2ee-device-label`,value:v,maxLength:100,disabled:T,className:oe,onChange:B})]}),e[23]=v,e[24]=T,e[25]=V):V=e[25];let H;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>{h(null),y(``)},e[26]=H):H=e[26];let U;e[27]===T?U=e[28]:(U=(0,$.jsx)(j,{type:`button`,variant:`outline`,disabled:T,onClick:H,children:`Cancel`}),e[27]=T,e[28]=U);let W=T||O===null,G;e[29]===T?G=e[30]:(G=T?(0,$.jsx)(g,{className:`size-3.5`}):null,e[29]=T,e[30]=G);let K;e[31]!==W||e[32]!==G?(K=(0,$.jsxs)(j,{type:`submit`,disabled:W,children:[G,`Save name`]}),e[31]=W,e[32]=G,e[33]=K):K=e[33];let q;e[34]!==U||e[35]!==K?(q=(0,$.jsxs)(te,{children:[U,K]}),e[34]=U,e[35]=K,e[36]=q):q=e[36];let fe;e[37]!==ue||e[38]!==V||e[39]!==q?(fe=(0,$.jsx)(s,{className:`max-w-sm`,children:(0,$.jsxs)(`form`,{onSubmit:ue,children:[de,V,q]})}),e[37]=ue,e[38]=V,e[39]=q,e[40]=fe):fe=e[40];let J;e[41]!==R||e[42]!==fe||e[43]!==le?(J=(0,$.jsx)(ie,{open:le,onOpenChange:R,children:fe}),e[41]=R,e[42]=fe,e[43]=le,e[44]=J):J=e[44];let pe=x!==null,Y;e[45]===E?Y=e[46]:(Y=e=>{!e&&!E&&S(null)},e[45]=E,e[46]=Y);let X;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(c,{children:`Revoke this encrypted device?`}),e[47]=X):X=e[47];let Z=x?.deviceLabel??`This device`,me;e[48]===Z?me=e[49]:(me=(0,$.jsxs)(p,{children:[X,(0,$.jsxs)(u,{children:[Z,` will lose account-authorized native connections. Signing in again can enroll fresh keys, but this enrollment cannot be restored.`]})]}),e[48]=Z,e[49]=me);let ge;e[50]===E?ge=e[51]:(ge=(0,$.jsx)(ne,{render:(0,$.jsx)(j,{variant:`outline`,disabled:E}),children:`Cancel`}),e[50]=E,e[51]=ge);let ve;e[52]===ce?ve=e[53]:(ve=()=>void ce(),e[52]=ce,e[53]=ve);let ye;e[54]===E?ye=e[55]:(ye=E?(0,$.jsx)(g,{className:`size-3.5`}):null,e[54]=E,e[55]=ye);let Ce;e[56]!==E||e[57]!==ve||e[58]!==ye?(Ce=(0,$.jsxs)(j,{variant:`destructive`,disabled:E,onClick:ve,children:[ye,`Revoke device`]}),e[56]=E,e[57]=ve,e[58]=ye,e[59]=Ce):Ce=e[59];let we;e[60]!==ge||e[61]!==Ce?(we=(0,$.jsxs)(d,{children:[ge,Ce]}),e[60]=ge,e[61]=Ce,e[62]=we):we=e[62];let Ee;e[63]!==me||e[64]!==we?(Ee=(0,$.jsxs)(o,{children:[me,we]}),e[63]=me,e[64]=we,e[65]=Ee):Ee=e[65];let Ae;e[66]!==pe||e[67]!==Y||e[68]!==Ee?(Ae=(0,$.jsx)(ee,{open:pe,onOpenChange:Y,children:Ee}),e[66]=pe,e[67]=Y,e[68]=Ee,e[69]=Ae):Ae=e[69];let Me;return e[70]!==J||e[71]!==Ae||e[72]!==F||e[73]!==L?(Me=(0,$.jsxs)(he,{title:`Encrypted devices`,icon:N,headerAction:F,children:[I,L,J,Ae]}),e[70]=J,e[71]=Ae,e[72]=F,e[73]=L,e[74]=Me):Me=e[74],Me}function Ne(e){return(0,$.jsxs)(`div`,{className:`contents`,children:[(0,$.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e.label}),(0,$.jsx)(`dd`,{className:e.fingerprint?`min-w-0 font-mono text-xs break-all`:`min-w-0 text-xs break-all`,children:e.value})]},e.label)}function Pe(){b.refreshE2eeDevices({force:!0})}function Fe(){b.refreshE2eeDevices()}function Ie(e){return e.actionStatus}function Le(e){return e.e2eeDevicesStatus??`idle`}function Re(e){return e.e2eeDevices??[]}var ze=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Be(e){return e===null||!Number.isFinite(e)?null:ze.format(new Date(e))}function Ve(){let e=(0,xe.c)(15),[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(0),[a,ee]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(!1),c=(0,Q.useRef)(0),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{n(null),i(0),ee(``)},e[0]=l):l=e[0];let u=l,te;e[1]===t?.options?te=e[2]:(te=()=>{c.current+=1,b.cancelAccountAction(),t?.options?.onAbandoned?.(),s(!1),u()},e[1]=t?.options,e[2]=te);let d=te,f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=async(e,t,r)=>{let a=c.current+=1;s(!1);let o=await t({});if(c.current===a){if(z(o)){ee(``),i(0),n({action:e,run:t,options:r,inferred:o.inferredErrorCode===!0});return}o.status===`committed`&&r?.onCommitted?.()}},e[3]=f):f=e[3];let p=f,m;e[4]!==t||e[5]!==a||e[6]!==r?(m=async()=>{if(!t)return;let e=V(a);if(e.length===0)return;let n=c.current+=1,o=await t.run({totpCode:e});if(c.current===n){if(z(o)){let e=r+1;if(R(o,e)){i(e),ee(``);return}s(!0),t.options?.onAbandoned?.(),u();return}o.status===`committed`&&t.options?.onCommitted?.(),u()}},e[4]=t,e[5]=a,e[6]=r,e[7]=m):m=e[7];let h=m,g;return e[8]!==d||e[9]!==t||e[10]!==a||e[11]!==r||e[12]!==o||e[13]!==h?(g={run:p,cancel:d,stepUp:t,stepUpAttempts:r,stepUpCode:a,stepUpUnresolved:o,setStepUpCode:ee,submitStepUp:h},e[8]=d,e[9]=t,e[10]=a,e[11]=r,e[12]=o,e[13]=h,e[14]=g):g=e[14],g}function He(){let e=(0,xe.c)(1),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(Ue,t)}function Ue(){return b.leaseRecoveryCodeDisplay()}function We(e){let t=(0,xe.c)(3),{busy:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=n?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(g,{className:`size-3.5`}),r]}):(0,$.jsx)($.Fragment,{children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function Ge(){let e=(0,xe.c)(100),t=i(ut),a=i(lt),[ee,o]=(0,Q.useState)(!1),s=r(ct),c=r(st),l=r(ot),u=r(at),te=r(it),d=r(rt),f=r(nt),p=r(tt),m=i(et),h=i($e),[g,ne]=(0,Q.useState)(!1),[re,ie]=(0,Q.useState)(null),_=(0,Q.useRef)(!1),v=Ve(),b=v.run;He();let x=d!==`idle`,S;e[0]===te?S=e[1]:(S=fe(te),e[0]=te,e[1]=S);let C=S,w;e[2]===l?.externalIdentities?w=e[3]:(w=l?.externalIdentities.find(Qe)??null,e[2]=l?.externalIdentities,e[3]=w);let T=w,E;e[4]===g?E=e[5]:(E=async()=>{if(!g){ne(!0),ie(null);try{await pe({intent:`link`,returnTo:`/account/security`,start:Ze,navigate:Xe})}catch(e){let t=e;ie(t instanceof y?t.message:`GitHub connection is temporarily unavailable.`),ne(!1)}}},e[4]=g,e[5]=E);let D=E,O;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],e[6]=O):O=e[6],(0,Q.useEffect)(Ye,O);let oe,se;if(e[7]!==t||e[8]!==b?(oe=()=>{if(t!==`authenticated`||_.current)return;_.current=!0;let e=new AbortController;return n.getPendingExternalIdentity(e.signal).then(e=>{if(e.status===`link`)return b(`connect-github`,Je);e.status===`error`&&ie(G(e.code))}).catch(qe),()=>e.abort()},se=[t,b],e[7]=t,e[8]=b,e[9]=oe,e[10]=se):(oe=e[9],se=e[10]),(0,Q.useEffect)(oe,se),t!==`authenticated`){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ge,{children:(0,$.jsxs)(P,{variant:`warning`,children:[(0,$.jsx)(A,{"aria-hidden":!0}),(0,$.jsx)(M,{children:`Not signed in`}),(0,$.jsx)(N,{children:`Sign in to the Hub to manage passkeys, two-factor authentication, and recovery codes.`})]})}),e[11]=t):t=e[11],t}let F;e[12]!==v.stepUp||e[13]!==v.stepUpUnresolved||e[14]!==p||e[15]!==f?(F=v.stepUpUnresolved?H:U(f,p,v.stepUp!==null),e[12]=v.stepUp,e[13]=v.stepUpUnresolved,e[14]=p,e[15]=f,e[16]=F):F=e[16];let I=F,L;e[17]!==v.stepUpUnresolved||e[18]!==p?(L=!v.stepUpUnresolved&&de(p),e[17]=v.stepUpUnresolved,e[18]=p,e[19]=L):L=e[19];let R=L,ue;e[20]!==s||e[21]!==c?(ue=le(s,c),e[20]=s,e[21]=c,e[22]=ue):ue=e[22];let z=ue,B;e[23]!==I||e[24]!==R?(B=I?(0,$.jsxs)(P,{variant:R?`info`:`error`,"aria-live":`polite`,children:[(0,$.jsx)(A,{"aria-hidden":!0}),(0,$.jsx)(M,{children:R?`Passkey needed`:`That did not work`}),(0,$.jsx)(N,{children:I})]}):null,e[23]=I,e[24]=R,e[25]=B):B=e[25];let V;e[26]===re?V=e[27]:(V=re?(0,$.jsxs)(P,{variant:`warning`,"aria-live":`polite`,children:[(0,$.jsx)(A,{"aria-hidden":!0}),(0,$.jsx)(M,{children:`GitHub connection did not complete`}),(0,$.jsx)(N,{children:re})]}):null,e[26]=re,e[27]=V);let W;e[28]!==l||e[29]!==u?(W=l===null&&u!==`stale`?(0,$.jsxs)(P,{variant:`info`,"aria-live":`polite`,children:[(0,$.jsx)(k,{"aria-hidden":!0}),(0,$.jsx)(M,{children:`Checking account security`}),(0,$.jsx)(N,{children:`Reading which fallback sign-in methods are configured on this Hub.`})]}):null,e[28]=l,e[29]=u,e[30]=W):W=e[30];let K;e[31]!==x||e[32]!==l||e[33]!==u?(K=u===`stale`?(0,$.jsxs)(P,{variant:`warning`,"aria-live":`polite`,children:[(0,$.jsx)(A,{"aria-hidden":!0}),(0,$.jsx)(M,{children:l===null?`Account security unavailable`:`Account security may be outdated`}),(0,$.jsx)(N,{children:l===null?`Ryco could not read the current password, authenticator, and email state.`:`These controls use the last state Ryco successfully read from the Hub.`}),(0,$.jsx)(ce,{children:(0,$.jsx)(j,{size:`xs`,variant:`outline`,disabled:x,onClick:Ke,children:`Retry`})})]}):null,e[31]=x,e[32]=l,e[33]=u,e[34]=K):K=e[34];let q;e[35]!==x||e[36]!==z?(q=z?(0,$.jsxs)(P,{variant:z.variant,"aria-live":`polite`,children:[(0,$.jsx)(A,{"aria-hidden":!0}),(0,$.jsx)(M,{children:z.title}),(0,$.jsx)(N,{children:z.description}),(0,$.jsx)(ce,{children:(0,$.jsx)(j,{size:`xs`,variant:`outline`,disabled:x,onClick:()=>o(!0),children:z.actionLabel})})]}):null,e[35]=x,e[36]=z,e[37]=q):q=e[37];let J;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-3.5`}),e[38]=J):J=e[38];let Y=a?.displayName??`Signed in`,X;e[39]===a?X=e[40]:(X=a?`${a.role} · joined ${Be(a.createdAt)??`unknown`}`:null,e[39]=a,e[40]=X);let Z;e[41]!==Y||e[42]!==X?(Z=(0,$.jsx)(he,{title:`Account`,icon:J,children:(0,$.jsx)(_e,{title:Y,description:`The Hub account these credentials belong to.`,status:X})}),e[41]=Y,e[42]=X,e[43]=Z):Z=e[43];let me;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,$.jsx)(Me,{}),e[44]=me):me=e[44];let ve;e[45]!==d||e[46]!==x||e[47]!==g||e[48]!==T||e[49]!==C?.link||e[50]!==b||e[51]!==D?(ve=T||C?.link?(0,$.jsx)(dt,{identity:T,actionsAvailable:C?.link===!0,busy:x||g,actionStatus:d,onConnect:()=>void D(),run:b}):null,e[45]=d,e[46]=x,e[47]=g,e[48]=T,e[49]=C?.link,e[50]=b,e[51]=D,e[52]=ve):ve=e[52];let ye=c===`loading`,be=c===`stale`,Se;e[53]!==v.cancel||e[54]!==v.run||e[55]!==d||e[56]!==ee||e[57]!==x||e[58]!==s||e[59]!==ye||e[60]!==be?(Se=(0,$.jsx)(pt,{passkeys:s,loading:ye,stale:be,busy:x,actionStatus:d,addOpen:ee,setAddOpen:o,run:v.run,cancel:v.cancel}),e[53]=v.cancel,e[54]=v.run,e[55]=d,e[56]=ee,e[57]=x,e[58]=s,e[59]=ye,e[60]=be,e[61]=Se):Se=e[61];let Ce=l?.totpEnrolled??null,we;e[62]!==v.run||e[63]!==d||e[64]!==x||e[65]!==Ce||e[66]!==h?(we=(0,$.jsx)(mt,{busy:x,actionStatus:d,enrollment:h,enrolled:Ce,run:v.run}),e[62]=v.run,e[63]=d,e[64]=x,e[65]=Ce,e[66]=h,e[67]=we):we=e[67];let Te;e[68]!==v.run||e[69]!==d||e[70]!==x||e[71]!==m?(Te=(0,$.jsx)(bt,{busy:x,actionStatus:d,recoveryCodes:m,run:v.run}),e[68]=v.run,e[69]=d,e[70]=x,e[71]=m,e[72]=Te):Te=e[72];let Ee;e[73]!==v.cancel||e[74]!==v.run||e[75]!==d||e[76]!==x||e[77]!==l?(Ee=(0,$.jsx)(_t,{busy:x,actionStatus:d,security:l,run:v.run,cancel:v.cancel}),e[73]=v.cancel,e[74]=v.run,e[75]=d,e[76]=x,e[77]=l,e[78]=Ee):Ee=e[78];let De;e[79]!==v.cancel||e[80]!==v.setStepUpCode||e[81]!==v.stepUp||e[82]!==v.stepUpAttempts||e[83]!==v.stepUpCode||e[84]!==v.submitStepUp||e[85]!==x?(De=(0,$.jsx)(Tt,{pending:v.stepUp,attempts:v.stepUpAttempts,code:v.stepUpCode,onCodeChange:v.setStepUpCode,onSubmit:v.submitStepUp,onCancel:v.cancel,busy:x}),e[79]=v.cancel,e[80]=v.setStepUpCode,e[81]=v.stepUp,e[82]=v.stepUpAttempts,e[83]=v.stepUpCode,e[84]=v.submitStepUp,e[85]=x,e[86]=De):De=e[86];let Oe;return e[87]!==V||e[88]!==W||e[89]!==K||e[90]!==q||e[91]!==Z||e[92]!==ve||e[93]!==Se||e[94]!==we||e[95]!==Te||e[96]!==Ee||e[97]!==De||e[98]!==B?(Oe=(0,$.jsxs)(ge,{children:[B,V,W,K,q,Z,me,ve,Se,we,Te,Ee,De]}),e[87]=V,e[88]=W,e[89]=K,e[90]=q,e[91]=Z,e[92]=ve,e[93]=Se,e[94]=we,e[95]=Te,e[96]=Ee,e[97]=De,e[98]=B,e[99]=Oe):Oe=e[99],Oe}function Ke(){b.refreshAccountSecurity({force:!0})}function qe(){}function Je(e){return b.finishBrowserExternalIdentityConnection(`github`,e)}function Ye(){b.refreshPasskeys(),b.refreshAccountSecurity(),b.refreshExternalIdentityConfiguration()}function Xe(e){return window.location.assign(e)}function Ze(e){return n.startExternalIdentityAuthorization(e)}function Qe(e){return e.provider===`github`}function $e(e){return e.totpEnrollment??null}function et(e){return e.recoveryCodes}function tt(e){return e.errorCode??null}function nt(e){return e.errorMessage}function rt(e){return e.actionStatus}function it(e){return e.externalIdentityConfiguration}function at(e){return e.securityStatus}function ot(e){return e.security}function st(e){return e.passkeysStatus}function ct(e){return e.passkeys}function lt(e){return e.account}function ut(e){return e.accountStatus}function dt(e){let t=(0,xe.c)(33),{identity:n,actionsAvailable:r,busy:i,actionStatus:a,onConnect:s,run:l}=e,[te,f]=(0,Q.useState)(!1),m=a===`connecting-external-identity`,g=a===`disconnecting-external-identity`,re;t[0]===l?re=t[1]:(re=async()=>{await l(`disconnect-github`,ft,{onCommitted:()=>f(!1)})},t[0]=l,t[1]=re);let ie=re,_;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(h,{"aria-hidden":!0,className:`size-3.5`}),t[2]=_):_=t[2];let v=n?`GitHub · @${n.login}`:`GitHub`,y=n?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,b;t[3]===n?b=t[4]:(b=n?`Connected ${Be(n.connectedAt)??`at an unknown time`}${n.lastUsedAt===null?``:` · last used ${Be(n.lastUsedAt)??`at an unknown time`}`}`:null,t[3]=n,t[4]=b);let x;t[5]!==r||t[6]!==i||t[7]!==m||t[8]!==g||t[9]!==n||t[10]!==s?(x=r?n?(0,$.jsx)(j,{size:`sm`,variant:`outline`,disabled:i,onClick:()=>f(!0),children:(0,$.jsx)(We,{busy:g,children:`Disconnect`})}):(0,$.jsx)(j,{size:`sm`,variant:`outline`,disabled:i,onClick:s,children:(0,$.jsx)(We,{busy:m,children:`Connect GitHub`})}):null,t[5]=r,t[6]=i,t[7]=m,t[8]=g,t[9]=n,t[10]=s,t[11]=x):x=t[11];let S;t[12]!==v||t[13]!==y||t[14]!==b||t[15]!==x?(S=(0,$.jsx)(_e,{title:v,description:y,status:b,control:x}),t[12]=v,t[13]=y,t[14]=b,t[15]=x,t[16]=S):S=t[16];let C;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsxs)(p,{children:[(0,$.jsx)(c,{children:`Disconnect GitHub?`}),(0,$.jsx)(u,{children:`You will no longer be able to sign in with GitHub. Ryco refuses this change if GitHub is your only remaining sign-in method.`})]}),t[17]=C):C=t[17];let w;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(ne,{render:(0,$.jsx)(j,{variant:`outline`}),children:`Cancel`}),t[18]=w):w=t[18];let T;t[19]===ie?T=t[20]:(T=()=>void ie(),t[19]=ie,t[20]=T);let E;t[21]===g?E=t[22]:(E=(0,$.jsx)(We,{busy:g,children:`Disconnect GitHub`}),t[21]=g,t[22]=E);let D;t[23]!==i||t[24]!==T||t[25]!==E?(D=(0,$.jsxs)(o,{children:[C,(0,$.jsxs)(d,{children:[w,(0,$.jsx)(j,{disabled:i,onClick:T,children:E})]})]}),t[23]=i,t[24]=T,t[25]=E,t[26]=D):D=t[26];let O;t[27]!==te||t[28]!==D?(O=(0,$.jsx)(ee,{open:te,onOpenChange:f,children:D}),t[27]=te,t[28]=D,t[29]=O):O=t[29];let k;return t[30]!==O||t[31]!==S?(k=(0,$.jsxs)(he,{title:`Connected accounts`,icon:_,children:[S,O]}),t[30]=O,t[31]=S,t[32]=k):k=t[32],k}function ft(e){return b.disconnectExternalIdentity(`github`,e)}function pt({passkeys:e,loading:t,stale:n,busy:r,actionStatus:i,addOpen:a,setAddOpen:h,run:g,cancel:v}){let[y,x]=(0,Q.useState)(``),[S,T]=(0,Q.useState)(null),[E,O]=(0,Q.useState)(null),k=i===`adding-passkey`,A=i===`revoking-passkey`,ae=K(e),M=F(e),ce=B(e),N=(0,Q.useCallback)(()=>{x(``),h(!1)},[h]),P=async e=>{e.preventDefault();let t=W(y);await g(`add-passkey`,e=>b.addPasskey({passkeyLabel:t,...e}),{onCommitted:N,onAbandoned:N})},I=async()=>{let e=S;if(e){T(null),O(e.id);try{await b.revokePasskey(e.id)}finally{O(null)}}};return(0,$.jsxs)(he,{title:`Passkeys`,icon:(0,$.jsx)(D,{"aria-hidden":!0,className:`size-3.5`}),headerAction:(0,$.jsx)(j,{size:`xs`,variant:`outline`,disabled:r,onClick:()=>h(!0),children:`Add passkey`}),children:[(0,$.jsx)(_e,{title:`Passkeys on this account`,description:`A passkey is the strongest way in. Add one for every device you sign in from, and keep at least two so losing a device does not lock you out.`,status:n?`This list could not be refreshed and may be out of date.`:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:`${String(ae.length)} usable ${ae.length===1?`passkey`:`passkeys`}`}),M>0?(0,$.jsx)(`span`,{children:` · ${String(M)} synced to a password manager`}):null]})}),t&&e.length===0?(0,$.jsx)(_e,{title:`Loading passkeys…`,description:`Reading the credentials on file.`}):null,!t&&e.length===0?(0,$.jsx)(_e,{title:`No passkeys yet`,description:`Add one now — without a passkey you can only get back in through a fallback credential.`}):null,ce.map(e=>{let t=Y(e),n=L(e),i=Be(e.createdAt),a=Be(e.lastUsedAt);return(0,$.jsx)(_e,{title:(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[X(e),t?(0,$.jsx)(w,{variant:`error`,size:`sm`,children:`Revoked`}):null]}),description:t?`Revoked${e.revocationReasonCode?` — ${e.revocationReasonCode}`:``}. This credential can no longer sign in.`:n??`The Hub did not report whether this credential is backed up.`,status:[i?`Added ${i}`:null,a?`Last used ${a}`:`Never used`].filter(e=>e!==null).join(` · `),control:t?null:(0,$.jsx)(j,{size:`xs`,variant:`destructive-outline`,"aria-label":`Revoke ${X(e)}`,disabled:r,onClick:()=>T(e),children:(0,$.jsxs)(We,{busy:A&&E===e.id,children:[(0,$.jsx)(C,{"aria-hidden":!0}),`Revoke`]})})},e.id)}),(0,$.jsx)(ie,{open:a,onOpenChange:e=>{if(e){h(!0);return}r||N()},children:(0,$.jsx)(s,{className:`max-w-md`,children:(0,$.jsxs)(`form`,{onSubmit:e=>void P(e),children:[(0,$.jsxs)(f,{children:[(0,$.jsx)(l,{children:`Add a passkey`}),(0,$.jsx)(re,{children:`Your browser will ask you to create a passkey for this account. Adding one replaces the current Hub session with a fresh one.`})]}),(0,$.jsxs)(m,{className:`space-y-3`,children:[(0,$.jsx)(_,{htmlFor:`account-passkey-label`,children:`Name (optional)`}),(0,$.jsx)(se,{id:`account-passkey-label`,value:y,autoComplete:`off`,placeholder:`Work laptop`,disabled:k,className:oe,onChange:e=>x(e.target.value)})]}),(0,$.jsxs)(te,{children:[(0,$.jsx)(j,{variant:`outline`,onClick:()=>{v(),N()},children:`Cancel`}),(0,$.jsx)(j,{type:`submit`,disabled:r,children:(0,$.jsx)(We,{busy:k,children:`Create passkey`})})]})]})})}),(0,$.jsx)(ee,{open:S!==null,onOpenChange:e=>{r||e||T(null)},children:(0,$.jsxs)(o,{children:[(0,$.jsxs)(p,{children:[(0,$.jsx)(c,{children:`Revoke this passkey?`}),(0,$.jsxs)(u,{children:[ae.length===1?`This is the only usable passkey on this account. `:``,S?X(S):``,` will stop working immediately, on every device it is stored on. This cannot be undone — you would have to enrol the device again.`]})]}),(0,$.jsxs)(d,{children:[(0,$.jsx)(ne,{render:(0,$.jsx)(j,{variant:`outline`}),children:`Keep it`}),(0,$.jsx)(j,{variant:`destructive`,disabled:r,onClick:()=>void I(),children:`Revoke passkey`})]})]})})]})}function mt(e){let t=(0,xe.c)(61),{busy:n,actionStatus:r,enrollment:i,enrolled:a,run:h}=e,[g,v]=(0,Q.useState)(``),[y,x]=(0,Q.useState)(!1),S=r===`enrolling-totp`,C=r===`confirming-totp`,w=r===`revoking-totp`,T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{v(``),b.dismissTotpEnrollment()},t[0]=T):T=t[0];let E=T,D;t[1]===g?D=t[2]:(D=async e=>{e.preventDefault();let t=V(g);t.length!==0&&(await b.confirmTotpEnrollment({code:t}),v(``))},t[1]=g,t[2]=D);let O=D,A;t[3]===h?A=t[4]:(A=async()=>{x(!1),await h(`revoke-totp`,gt)},t[3]=h,t[4]=A);let ae=A,M;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(k,{"aria-hidden":!0,className:`size-3.5`}),t[5]=M):M=t[5];let ce=a===null?`Checking current state…`:a?`On`:`Off`,N;t[6]!==n||t[7]!==a||t[8]!==S||t[9]!==w?(N=a===null?null:a?(0,$.jsx)(j,{size:`xs`,variant:`destructive-outline`,"aria-label":`Turn off two-factor authentication`,disabled:n,onClick:()=>x(!0),children:(0,$.jsx)(We,{busy:w,children:`Turn off`})}):(0,$.jsx)(j,{size:`xs`,variant:`outline`,disabled:n,onClick:ht,children:(0,$.jsx)(We,{busy:S,children:`Set up`})}),t[6]=n,t[7]=a,t[8]=S,t[9]=w,t[10]=N):N=t[10];let P;t[11]!==ce||t[12]!==N?(P=(0,$.jsx)(_e,{title:`Authenticator app`,description:`A six-digit code from an authenticator app, required whenever you change credentials from a session that was not started with a passkey. Signing in with a passkey never asks for one.`,status:ce,control:N}),t[11]=ce,t[12]=N,t[13]=P):P=t[13];let F=i!==null,I;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>{e||E()},t[14]=I):I=t[14];let L;t[15]===O?L=t[16]:(L=e=>void O(e),t[15]=O,t[16]=L);let le;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,$.jsxs)(f,{children:[(0,$.jsx)(l,{children:`Set up two-factor authentication`}),(0,$.jsx)(re,{children:`Scan this with your authenticator app, then enter the code it shows. This is the only time the key is displayed.`})]}),t[17]=le):le=t[17];let R;t[18]===i?R=t[19]:(R=i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border bg-white p-4`,children:(0,$.jsx)(ve,{value:i.provisioningUri,size:168,level:`M`,marginSize:1,title:`Two-factor setup code`})}),(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Can't scan? Enter this key manually:`}),(0,$.jsx)(`p`,{"aria-label":`Two-factor setup key`,className:`rounded-lg border border-border bg-background px-3 py-2 font-mono text-sm break-all`,children:i.secretBase32})]})]}):null,t[18]=i,t[19]=R);let ue;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,$.jsx)(_,{htmlFor:`account-totp-confirm`,children:`Code from your app`}),t[20]=ue):ue=t[20];let de;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>v(V(e.target.value)),t[21]=de):de=t[21];let z;t[22]!==g||t[23]!==C?(z=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[ue,(0,$.jsx)(se,{id:`account-totp-confirm`,value:g,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:C,className:oe,onChange:de})]}),t[22]=g,t[23]=C,t[24]=z):z=t[24];let B;t[25]!==R||t[26]!==z?(B=(0,$.jsxs)(m,{className:`space-y-4`,children:[R,z]}),t[25]=R,t[26]=z,t[27]=B):B=t[27];let H;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(j,{variant:`outline`,onClick:E,children:`Cancel`}),t[28]=H):H=t[28];let U;t[29]!==n||t[30]!==g?(U=n||!q(g),t[29]=n,t[30]=g,t[31]=U):U=t[31];let W;t[32]===C?W=t[33]:(W=(0,$.jsx)(We,{busy:C,children:`Turn on`}),t[32]=C,t[33]=W);let G;t[34]!==U||t[35]!==W?(G=(0,$.jsxs)(te,{children:[H,(0,$.jsx)(j,{type:`submit`,disabled:U,children:W})]}),t[34]=U,t[35]=W,t[36]=G):G=t[36];let K;t[37]!==L||t[38]!==B||t[39]!==G?(K=(0,$.jsx)(s,{className:`max-w-md`,children:(0,$.jsxs)(`form`,{onSubmit:L,children:[le,B,G]})}),t[37]=L,t[38]=B,t[39]=G,t[40]=K):K=t[40];let fe;t[41]!==K||t[42]!==F?(fe=(0,$.jsx)(ie,{open:F,onOpenChange:I,children:K}),t[41]=K,t[42]=F,t[43]=fe):fe=t[43];let J;t[44]===n?J=t[45]:(J=e=>{n||x(e)},t[44]=n,t[45]=J);let pe;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,$.jsxs)(p,{children:[(0,$.jsx)(c,{children:`Remove two-factor authentication?`}),(0,$.jsx)(u,{children:`Password, recovery-code, and emailed-link sign-ins will no longer need a code from your authenticator app. You can set it up again at any time.`})]}),t[46]=pe):pe=t[46];let Y;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,$.jsx)(ne,{render:(0,$.jsx)(j,{variant:`outline`}),children:`Keep it on`}),t[47]=Y):Y=t[47];let X;t[48]===ae?X=t[49]:(X=()=>void ae(),t[48]=ae,t[49]=X);let Z;t[50]!==n||t[51]!==X?(Z=(0,$.jsxs)(o,{children:[pe,(0,$.jsxs)(d,{children:[Y,(0,$.jsx)(j,{variant:`destructive`,disabled:n,onClick:X,children:`Remove two-factor`})]})]}),t[50]=n,t[51]=X,t[52]=Z):Z=t[52];let me;t[53]!==y||t[54]!==J||t[55]!==Z?(me=(0,$.jsx)(ee,{open:y,onOpenChange:J,children:Z}),t[53]=y,t[54]=J,t[55]=Z,t[56]=me):me=t[56];let ge;return t[57]!==fe||t[58]!==me||t[59]!==P?(ge=(0,$.jsxs)(he,{title:`Two-factor authentication`,icon:M,children:[P,fe,me]}),t[57]=fe,t[58]=me,t[59]=P,t[60]=ge):ge=t[60],ge}function ht(){b.beginTotpEnrollment()}function gt(e){return b.revokeTotp(e)}function _t(e){let t=(0,xe.c)(86),{busy:n,actionStatus:r,security:i,run:a,cancel:h}=e,[g,v]=(0,Q.useState)(!1),[y,x]=(0,Q.useState)(``),[S,C]=(0,Q.useState)(``),[w,T]=(0,Q.useState)(!1),[E,O]=(0,Q.useState)(!1),k=r===`setting-password`,A=r===`removing-password`,ae;t[0]!==S||t[1]!==y?(ae=me(y,S),t[0]=S,t[1]=y,t[2]=ae):ae=t[2];let M=ae,ce;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>{x(``),C(``),T(!1)},t[3]=ce):ce=t[3];let N=ce,P;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{N(),v(!1)},t[4]=P):P=t[4];let F=P,I;t[5]===h?I=t[6]:(I=()=>{h(),F()},t[5]=h,t[6]=I);let L=I,le;t[7]!==M||t[8]!==y||t[9]!==a?(le=async e=>{e.preventDefault(),T(!0),!M&&await a(`set-password`,e=>b.setPassword({password:y,...e}),{onCommitted:F,onAbandoned:F})},t[7]=M,t[8]=y,t[9]=a,t[10]=le):le=t[10];let R=le,ue;t[11]===a?ue=t[12]:(ue=async()=>{O(!1),await a(`remove-password`,vt)},t[11]=a,t[12]=ue);let de=ue,z;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(D,{"aria-hidden":!0,className:`size-3.5`}),t[13]=z):z=t[13];let B=i===null?`Checking current state…`:i.passwordConfigured?`Set`:`Not set`,V;t[14]!==n||t[15]!==A||t[16]!==i||t[17]!==k?(V=i===null?null:(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(j,{size:`xs`,variant:`outline`,disabled:n,onClick:()=>v(!0),children:(0,$.jsx)(We,{busy:k,children:i.passwordConfigured?`Change`:`Set password`})}),i.passwordConfigured?(0,$.jsx)(j,{size:`xs`,variant:`destructive-outline`,"aria-label":`Delete the fallback password`,disabled:n,onClick:()=>O(!0),children:(0,$.jsx)(We,{busy:A,children:`Remove`})}):null]}),t[14]=n,t[15]=A,t[16]=i,t[17]=k,t[18]=V):V=t[18];let H;t[19]!==B||t[20]!==V?(H=(0,$.jsx)(_e,{title:`Fallback password`,description:`A password is a fallback, not an equal of a passkey: it can be phished and reused, and a session started with one has to prove itself again before changing credentials. Keep a passkey as your normal way in.`,status:B,control:V}),t[19]=B,t[20]=V,t[21]=H):H=t[21];let U=i===null?void 0:i.email,W=i?.emailDeliveryConfigured,G;t[22]!==r||t[23]!==n||t[24]!==a||t[25]!==U||t[26]!==W?(G=(0,$.jsx)(yt,{busy:n,actionStatus:r,email:U,deliveryConfigured:W,run:a}),t[22]=r,t[23]=n,t[24]=a,t[25]=U,t[26]=W,t[27]=G):G=t[27];let K;t[28]===L?K=t[29]:(K=e=>{if(e){v(!0);return}L()},t[28]=L,t[29]=K);let q;t[30]===R?q=t[31]:(q=e=>void R(e),t[30]=R,t[31]=q);let fe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,$.jsxs)(f,{children:[(0,$.jsx)(l,{children:`Set a fallback password`}),(0,$.jsx)(re,{children:`This replaces any password already on the account. The Hub rejects passwords that have appeared in a known breach.`})]}),t[32]=fe):fe=t[32];let J;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(J=(0,$.jsx)(_,{htmlFor:`account-password`,children:`New password`}),t[33]=J):J=t[33];let pe;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(pe=e=>x(e.target.value),t[34]=pe):pe=t[34];let Y;t[35]!==y||t[36]!==k?(Y=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[J,(0,$.jsx)(se,{id:`account-password`,type:`password`,value:y,autoComplete:`new-password`,maxLength:256,disabled:k,className:oe,onChange:pe})]}),t[35]=y,t[36]=k,t[37]=Y):Y=t[37];let X;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,$.jsx)(_,{htmlFor:`account-password-confirm`,children:`Confirm password`}),t[38]=X):X=t[38];let Z;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(Z=e=>C(e.target.value),t[39]=Z):Z=t[39];let ge;t[40]!==S||t[41]!==k?(ge=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[X,(0,$.jsx)(se,{id:`account-password-confirm`,type:`password`,value:S,autoComplete:`new-password`,maxLength:256,disabled:k,className:oe,onChange:Z})]}),t[40]=S,t[41]=k,t[42]=ge):ge=t[42];let ve;t[43]!==M||t[44]!==w?(ve=w&&M?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive-foreground`,children:M}):null,t[43]=M,t[44]=w,t[45]=ve):ve=t[45];let ye;t[46]!==Y||t[47]!==ge||t[48]!==ve?(ye=(0,$.jsxs)(m,{className:`space-y-3`,children:[Y,ge,ve]}),t[46]=Y,t[47]=ge,t[48]=ve,t[49]=ye):ye=t[49];let be;t[50]===L?be=t[51]:(be=(0,$.jsx)(j,{variant:`outline`,onClick:L,children:`Cancel`}),t[50]=L,t[51]=be);let Se;t[52]===k?Se=t[53]:(Se=(0,$.jsx)(We,{busy:k,children:`Save password`}),t[52]=k,t[53]=Se);let Ce;t[54]!==n||t[55]!==Se?(Ce=(0,$.jsx)(j,{type:`submit`,disabled:n,children:Se}),t[54]=n,t[55]=Se,t[56]=Ce):Ce=t[56];let we;t[57]!==be||t[58]!==Ce?(we=(0,$.jsxs)(te,{children:[be,Ce]}),t[57]=be,t[58]=Ce,t[59]=we):we=t[59];let Te;t[60]!==q||t[61]!==ye||t[62]!==we?(Te=(0,$.jsx)(s,{className:`max-w-md`,children:(0,$.jsxs)(`form`,{onSubmit:q,children:[fe,ye,we]})}),t[60]=q,t[61]=ye,t[62]=we,t[63]=Te):Te=t[63];let Ee;t[64]!==g||t[65]!==K||t[66]!==Te?(Ee=(0,$.jsx)(ie,{open:g,onOpenChange:K,children:Te}),t[64]=g,t[65]=K,t[66]=Te,t[67]=Ee):Ee=t[67];let De;t[68]===n?De=t[69]:(De=e=>{n||O(e)},t[68]=n,t[69]=De);let Oe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsxs)(p,{children:[(0,$.jsx)(c,{children:`Remove the password?`}),(0,$.jsx)(u,{children:`You will no longer be able to sign in with a password. Make sure you still have a passkey, or recovery codes you have saved.`})]}),t[70]=Oe):Oe=t[70];let ke;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,$.jsx)(ne,{render:(0,$.jsx)(j,{variant:`outline`}),children:`Keep it`}),t[71]=ke):ke=t[71];let Ae;t[72]===de?Ae=t[73]:(Ae=()=>void de(),t[72]=de,t[73]=Ae);let je;t[74]!==n||t[75]!==Ae?(je=(0,$.jsxs)(o,{children:[Oe,(0,$.jsxs)(d,{children:[ke,(0,$.jsx)(j,{variant:`destructive`,disabled:n,onClick:Ae,children:`Remove password`})]})]}),t[74]=n,t[75]=Ae,t[76]=je):je=t[76];let Me;t[77]!==E||t[78]!==De||t[79]!==je?(Me=(0,$.jsx)(ee,{open:E,onOpenChange:De,children:je}),t[77]=E,t[78]=De,t[79]=je,t[80]=Me):Me=t[80];let Ne;return t[81]!==H||t[82]!==G||t[83]!==Ee||t[84]!==Me?(Ne=(0,$.jsxs)(he,{title:`Fallback sign-in`,icon:z,children:[H,G,Ee,Me]}),t[81]=H,t[82]=G,t[83]=Ee,t[84]=Me,t[85]=Ne):Ne=t[85],Ne}function vt(e){return b.removePassword(e)}function yt(e){let t=(0,xe.c)(25),{busy:n,actionStatus:r,email:i,deliveryConfigured:a,run:ee}=e,[o,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(!1),[u,te]=(0,Q.useState)(!1),d=r===`requesting-email-verification`,f;t[0]===o?f=t[1]:(f=J(o),t[0]=o,t[1]=f);let p=f,m;t[2]!==o||t[3]!==p||t[4]!==ee?(m=async e=>{e.preventDefault(),l(!0),te(!1),!p&&await ee(`request-email-verification`,e=>b.requestEmailVerification({email:o.trim(),...e}),{onCommitted:()=>{te(!0),s(``),l(!1)}})},t[2]=o,t[3]=p,t[4]=ee,t[5]=m):m=t[5];let h=m,g;t[6]===a?g=t[7]:(g=a===!1?(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 pt-3.5 sm:px-5`,children:(0,$.jsxs)(P,{variant:`warning`,children:[(0,$.jsx)(A,{"aria-hidden":!0}),(0,$.jsx)(M,{children:`No mail will arrive yet`}),(0,$.jsx)(N,{children:`This Hub has no mail transport configured, so verification messages are generated and discarded. The request below will be accepted and nothing will be delivered until an operator wires one up. Do not rely on email as your way back into the account.`})]})}):null,t[6]=a,t[7]=g);let ne=a?`Used for account recovery after verification. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`:`Used for account recovery once mail delivery is switched on. The Hub answers the same way whether or not the address is already known, so this never confirms who owns it.`,re=i===void 0?`Checking current state…`:i===null?`Not set`:`${i.verified?`Verified`:`Verification pending`} · ${i.address}`,ie;t[8]!==u||t[9]!==n||t[10]!==i||t[11]!==a||t[12]!==o||t[13]!==p||t[14]!==d||t[15]!==h||t[16]!==c?(ie=i===void 0?null:(0,$.jsxs)(`form`,{className:`pt-3 pb-3.5`,onSubmit:e=>void h(e),children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row`,children:[(0,$.jsx)(se,{"aria-label":`Email address`,type:`email`,value:o,autoComplete:`email`,placeholder:`you@example.com`,maxLength:254,disabled:d,className:oe,onChange:e=>{s(e.target.value),te(!1)}}),(0,$.jsx)(j,{type:`submit`,size:`sm`,variant:`outline`,disabled:n,className:`shrink-0`,children:(0,$.jsx)(We,{busy:d,children:i===null?`Send verification`:i.verified?`Change email`:`Resend or change`})})]}),c&&p?(0,$.jsx)(`p`,{role:`alert`,className:`pt-2 text-xs text-destructive-foreground`,children:p}):null,u?(0,$.jsx)(`p`,{role:`status`,className:`pt-2 text-xs text-muted-foreground`,children:a?`Verification email requested. Check your inbox and spam folder; delivery may take a moment.`:`Request accepted by the Hub. No message will be delivered until a mail transport is configured.`}):null]}),t[8]=u,t[9]=n,t[10]=i,t[11]=a,t[12]=o,t[13]=p,t[14]=d,t[15]=h,t[16]=c,t[17]=ie):ie=t[17];let _;t[18]!==ne||t[19]!==re||t[20]!==ie?(_=(0,$.jsx)(_e,{title:`Recovery email`,description:ne,status:re,children:ie}),t[18]=ne,t[19]=re,t[20]=ie,t[21]=_):_=t[21];let v;return t[22]!==g||t[23]!==_?(v=(0,$.jsxs)($.Fragment,{children:[g,_]}),t[22]=g,t[23]=_,t[24]=v):v=t[24],v}function bt(e){let t=(0,xe.c)(52),{busy:n,actionStatus:r,recoveryCodes:i,run:a}=e,[h,g]=(0,Q.useState)(!1),_=r===`regenerating-recovery-codes`,{copyToClipboard:v,isCopied:y}=T(),b;t[0]===a?b=t[1]:(b=async()=>{g(!1),await a(`regenerate-recovery-codes`,wt)},t[0]=a,t[1]=b);let x=b,C;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(O,{"aria-hidden":!0,className:`size-3.5`}),t[2]=C):C=t[2];let w;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>g(!0),t[3]=w):w=t[3];let D;t[4]===_?D=t[5]:(D=(0,$.jsx)(We,{busy:_,children:`Generate new codes`}),t[4]=_,t[5]=D);let k;t[6]!==n||t[7]!==D?(k=(0,$.jsx)(_e,{title:`One-time recovery codes`,description:`Single-use codes that get you back in when you have lost every passkey. They are a last resort, not a substitute for one — anyone holding a code can sign in as you.`,status:`Ryco shows them once and never writes them to browser storage.`,control:(0,$.jsx)(j,{size:`xs`,variant:`destructive-outline`,disabled:n,onClick:w,children:D})}),t[6]=n,t[7]=D,t[8]=k):k=t[8];let A;t[9]===n?A=t[10]:(A=e=>{n||g(e)},t[9]=n,t[10]=A);let ae;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsxs)(p,{children:[(0,$.jsx)(c,{children:`Replace your recovery codes?`}),(0,$.jsx)(u,{children:`Every code you have already saved stops working immediately. You will get a new set, shown once — if you lose them you will have to generate another set from a session you can still sign in to.`})]}),t[11]=ae):ae=t[11];let oe;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(ne,{render:(0,$.jsx)(j,{variant:`outline`}),children:`Cancel`}),t[12]=oe):oe=t[12];let se;t[13]===x?se=t[14]:(se=()=>void x(),t[13]=x,t[14]=se);let M;t[15]!==n||t[16]!==se?(M=(0,$.jsxs)(o,{children:[ae,(0,$.jsxs)(d,{children:[oe,(0,$.jsx)(j,{variant:`destructive`,disabled:n,onClick:se,children:`Replace codes`})]})]}),t[15]=n,t[16]=se,t[17]=M):M=t[17];let ce;t[18]!==h||t[19]!==M||t[20]!==A?(ce=(0,$.jsx)(ee,{open:h,onOpenChange:A,children:M}),t[18]=h,t[19]=M,t[20]=A,t[21]=ce):ce=t[21];let N=i.length>0,P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,$.jsx)(l,{children:`Save your recovery codes`}),t[22]=P):P=t[22];let F=String(i.length),I;t[23]===F?I=t[24]:(I=(0,$.jsxs)(f,{children:[P,(0,$.jsxs)(re,{children:[`Save all `,F,` codes — they are shown once and cannot be retrieved later. Store them somewhere only you can reach — a password manager, or paper somewhere safe.`]})]}),t[23]=F,t[24]=I);let L;t[25]===i?L=t[26]:(L=i.map(St),t[25]=i,t[26]=L);let le;t[27]===L?le=t[28]:(le=(0,$.jsx)(m,{children:(0,$.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:L})}),t[27]=L,t[28]=le);let R;t[29]!==v||t[30]!==i?(R=()=>v(ue(i),void 0),t[29]=v,t[30]=i,t[31]=R):R=t[31];let de;t[32]===y?de=t[33]:(de=y?(0,$.jsx)(S,{"aria-hidden":!0}):(0,$.jsx)(E,{"aria-hidden":!0}),t[32]=y,t[33]=de);let z=y?`Copied`:`Copy codes`,B;t[34]!==R||t[35]!==de||t[36]!==z?(B=(0,$.jsxs)(j,{variant:`outline`,onClick:R,children:[de,z]}),t[34]=R,t[35]=de,t[36]=z,t[37]=B):B=t[37];let V;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(j,{onClick:xt,children:`I saved the codes`}),t[38]=V):V=t[38];let H;t[39]===B?H=t[40]:(H=(0,$.jsxs)(te,{children:[B,V]}),t[39]=B,t[40]=H);let U;t[41]!==I||t[42]!==le||t[43]!==H?(U=(0,$.jsxs)(s,{className:`max-w-md`,showCloseButton:!1,children:[I,le,H]}),t[41]=I,t[42]=le,t[43]=H,t[44]=U):U=t[44];let W;t[45]!==N||t[46]!==U?(W=(0,$.jsx)(ie,{open:N,disablePointerDismissal:!0,onOpenChange:Ct,children:U}),t[45]=N,t[46]=U,t[47]=W):W=t[47];let G;return t[48]!==ce||t[49]!==W||t[50]!==k?(G=(0,$.jsxs)(he,{title:`Recovery codes`,icon:C,children:[k,ce,W]}),t[48]=ce,t[49]=W,t[50]=k,t[51]=G):G=t[51],G}function xt(){return b.dismissRecoveryCodes()}function St(e){return(0,$.jsx)(`li`,{children:e},e)}function Ct(e,t){e||t.cancel()}function wt(e){return b.regenerateRecoveryCodes(e)}function Tt(e){let t=(0,xe.c)(45),{pending:n,attempts:r,code:i,onCodeChange:a,onSubmit:ee,onCancel:o,busy:c}=e,u=n!==null,d;t[0]===o?d=t[1]:(d=e=>{e||o()},t[0]=o,t[1]=d);let p;t[2]===ee?p=t[3]:(p=e=>{e.preventDefault(),ee()},t[2]=ee,t[3]=p);let h;t[4]===n?h=t[5]:(h=n?I(n.action):``,t[4]=n,t[5]=h);let g;t[6]===h?g=t[7]:(g=(0,$.jsx)(l,{children:h}),t[6]=h,t[7]=g);let ne=n?.inferred??!1,v;t[8]!==r||t[9]!==ne?(v=Z(r,ne),t[8]=r,t[9]=ne,t[10]=v):v=t[10];let y;t[11]===v?y=t[12]:(y=(0,$.jsx)(re,{children:v}),t[11]=v,t[12]=y);let b;t[13]!==g||t[14]!==y?(b=(0,$.jsxs)(f,{children:[g,y]}),t[13]=g,t[14]=y,t[15]=b):b=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(_,{htmlFor:`account-step-up-code`,children:`Authenticator code`}),t[16]=x):x=t[16];let S;t[17]===a?S=t[18]:(S=e=>a(V(e.target.value)),t[17]=a,t[18]=S);let C;t[19]!==c||t[20]!==i||t[21]!==S?(C=(0,$.jsxs)(m,{className:`space-y-2`,children:[x,(0,$.jsx)(se,{id:`account-step-up-code`,value:i,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,disabled:c,className:oe,onChange:S})]}),t[19]=c,t[20]=i,t[21]=S,t[22]=C):C=t[22];let w;t[23]===o?w=t[24]:(w=(0,$.jsx)(j,{variant:`outline`,onClick:o,children:`Cancel`}),t[23]=o,t[24]=w);let T;t[25]!==c||t[26]!==i?(T=c||!q(i),t[25]=c,t[26]=i,t[27]=T):T=t[27];let E;t[28]===c?E=t[29]:(E=(0,$.jsx)(We,{busy:c,children:`Confirm code`}),t[28]=c,t[29]=E);let D;t[30]!==T||t[31]!==E?(D=(0,$.jsx)(j,{type:`submit`,disabled:T,children:E}),t[30]=T,t[31]=E,t[32]=D):D=t[32];let O;t[33]!==w||t[34]!==D?(O=(0,$.jsxs)(te,{children:[w,D]}),t[33]=w,t[34]=D,t[35]=O):O=t[35];let k;t[36]!==C||t[37]!==O||t[38]!==p||t[39]!==b?(k=(0,$.jsx)(s,{className:`max-w-sm`,children:(0,$.jsxs)(`form`,{onSubmit:p,children:[b,C,O]})}),t[36]=C,t[37]=O,t[38]=p,t[39]=b,t[40]=k):k=t[40];let A;return t[41]!==u||t[42]!==k||t[43]!==d?(A=(0,$.jsx)(ie,{open:u,onOpenChange:d,children:k}),t[41]=u,t[42]=k,t[43]=d,t[44]=A):A=t[44],A}export{Ge as AccountSettingsPanel};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{Kt as n,n as r}from"./primary-DjXNHNGV.js";import{Qr as i,T as a,b as o}from"./src-gDjuIvMO.js";import{Gi as s,Ji as c,Ki as l,Kr as u,Lr as d,Ur as f,b as p,ia as m,p as h,sa as g,u as _,vi as ee,y as v,zr as y}from"./runtime-L56puJDA.js";import{t as te}from"./switch-COrEGDkz.js";import{t as b}from"./compiler-runtime-qmuS0Svy.js";import{r as ne,y as x}from"./RootAppShell-D7c8sbA0.js";import{a as S,c as C,n as w,o as re,s as T}from"./badge-CYDyJZRJ.js";import{a as E,i as D,s as ie}from"./toast-C_F1LeME.js";import{t as ae}from"./sparkles-BXwkPX2M.js";import{t as oe}from"./refresh-cw-MqmsC7V0.js";import{t as O}from"./button-QrCU0tNP.js";import{i as k,n as se,r as A}from"./settingsLayout-CmNqO2kB.js";import{t as j}from"./ProviderModelPicker-CYGv-4fE.js";var ce=[`Thread titles`,`Project or repository names`,`Branch names`,`Bucketed creation and activity age`,`Running, approval, input, queue, failure, and delivery state`,`Pull request or linked issue title and state`,`Up to 600 characters from the latest user request`],le=[{value:0,label:`Manual only`},{value:3e5,label:`Every 5 minutes`},{value:6e5,label:`Every 10 minutes`},{value:18e5,label:`Every 30 minutes`},{value:36e5,label:`Every hour`},{value:216e5,label:`Every 6 hours`},{value:864e5,label:`Every 24 hours`}];function ue(e){return{...e.enabled===void 0?{}:{aiFocusEnabled:e.enabled},...e.refreshIntervalMs===void 0?{}:{aiFocusRefreshIntervalMs:e.refreshIntervalMs}}}function de(e){return e.map(e=>{let t=e.serverConfig,n=t?.environment.capabilities.threadPriorityRanking===!0,r=t?.settings.inboxPriorityModelSelection??null,i=t?r??t.settings.textGenerationModelSelection:null,a=i===null?null:t?.providers.find(e=>e.instanceId===i.instanceId)??null;return{...e,supported:n,inherited:r===null,effectiveModelSelection:i,effectiveProvider:a}})}function M(e,t){let n=e.find(e=>e.instanceId===t);return!!(n&&n.enabled&&n.installed&&n.availability!==`unavailable`&&n.status!==`disabled`&&n.status!==`error`)}function N(e){if(e.selection!==null&&!M(e.serverConfig.providers,e.selection.instanceId))throw Error(`That provider instance is not available on this environment.`);return{inboxPriorityModelSelection:e.selection}}var P=b(),F=e(t(),1),I=m();function L(e){return e instanceof Error?e.message:`An unexpected error occurred.`}function fe(e){let t=(0,P.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,I.jsx)(x,{className:`size-3.5`}),t[0]=n):n=t[0];let r;t[1]===e.value?r=t[2]:(r=e.value?.toString()??`off`,t[1]=e.value,t[2]=r);let i;t[3]===e?i=t[4]:(i=t=>{let n=t===`off`?null:Number(t);(n===null||a.includes(n))&&e.onChange(n)},t[3]=e,t[4]=i);let o=e.value===null?`Off`:`After ${e.value} ${e.value===1?`day`:`days`}`,s;t[5]===o?s=t[6]:(s=(0,I.jsx)(T,{className:`w-48`,"aria-label":`Auto-settle inactive tasks`,children:(0,I.jsx)(C,{children:o})}),t[5]=o,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,I.jsxs)(re,{align:`end`,alignItemWithTrigger:!1,children:[(0,I.jsx)(S,{hideIndicator:!0,value:`off`,children:`Off`}),a.map(R)]}),t[7]=c):c=t[7];let l;return t[8]!==r||t[9]!==i||t[10]!==s?(l=(0,I.jsx)(k,{title:`Housekeeping`,icon:n,children:(0,I.jsx)(A,{title:`Auto-settle inactive tasks`,description:`Move inactive tasks to Settled after their last message or turn. Running work, queued messages, pending input, open pull requests, and tasks kept active are protected.`,control:(0,I.jsxs)(w,{value:r,onValueChange:i,children:[s,c]})})}),t[8]=r,t[9]=i,t[10]=s,t[11]=l):l=t[11],l}function R(e){return(0,I.jsxs)(S,{hideIndicator:!0,value:String(e),children:[`After `,e,` `,e===1?`day`:`days`]},e)}function pe(){let e=(0,P.c)(2),[t,n]=(0,F.useState)(z),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>v(()=>{n(_())}),i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,F.useEffect)(r,i),t}function z(){return _()}function B({row:e}){let[t,n]=(0,F.useState)(!1),r=e.serverConfig;if(!r||!e.effectiveModelSelection)return null;let i={...r.settings,...o},a=e.effectiveModelSelection,s=u(f(r.providers)),c=d(i,r.providers,a.instanceId,a.model),l=async t=>{n(!0);try{let n=N({serverConfig:r,selection:t});await p(e.environmentId,n)}catch(t){D.add(E({type:`error`,title:`Could not update ${e.label}`,description:L(t)}))}finally{n(!1)}};return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,I.jsx)(j,{activeInstanceId:a.instanceId,model:a.model,lockedProvider:null,instanceEntries:s,modelOptionsByInstance:c,compact:!0,disabled:t||!e.connected,...e.connected?{}:{disabledReason:`Connect this environment to change its model.`},onInstanceModelChange:(e,t)=>{l(y({...i,textGenerationModelSelection:g(e,t)},r.providers))}}),e.inherited?null:(0,I.jsx)(O,{size:`xs`,variant:`ghost`,disabled:t||!e.connected,onClick:()=>void l(null),children:`Use text model`})]})}function V(e){let t=(0,P.c)(6),{row:n}=e,r=n.effectiveProvider?.displayName??n.effectiveProvider?.driver??null,i=n.connected?n.supported?n.inherited?`Inherits the text-generation model${r?` (${r})`:``}.`:`Uses a separate model for Inbox ranking.`:`This node version does not support AI Focus ranking. Other supported nodes still work.`:`Offline — ranking waits for an existing connection.`,a;t[0]===n?a=t[1]:(a=n.supported?(0,I.jsx)(B,{row:n}):void 0,t[0]=n,t[1]=a);let o;return t[2]!==n.label||t[3]!==i||t[4]!==a?(o=(0,I.jsx)(A,{title:n.label,description:i,control:a}),t[2]=n.label,t[3]=i,t[4]=a,t[5]=o):o=t[5],o}function H(){let e=(0,P.c)(54),t=s(),{updateSettings:n}=l(),a=c(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=r(),e[0]=o):o=e[0];let u=o,d=ee(ve),f=pe(),[p,m]=(0,F.useState)(!1);u?.environmentId,u?.label;let h;if(e[1]!==f||e[2]!==a||e[3]!==d){let t=new Map;u?.environmentId&&t.set(u.environmentId,{label:u.label,config:a});for(let e of f){if(t.has(e.environmentId))continue;let n=d[e.environmentId];t.set(e.environmentId,{label:n?.descriptor?.label??e.knownEnvironment.label,config:n?.serverConfig??null})}for(let[e,n]of Object.entries(d)){let r=i.make(e);t.has(r)||t.set(r,{label:n.descriptor?.label??`Saved environment`,config:n.serverConfig})}h=de([...t].map(_e)),e[1]=f,e[2]=a,e[3]=d,e[4]=h}else h=e[4];let g=h,_;e[5]===g?_=e[6]:(_=async()=>{m(!0);let e=await ne(),t=e.failures;t.length>0?D.add(E({type:`error`,title:`AI Focus refresh failed`,description:t.map(e=>{let{environmentId:t,error:n}=e;return`${g.find(e=>e.environmentId===t)?.label??`Environment`}: ${L(n)}`}).join(` · `)})):D.add(E({type:`success`,title:e.attempted.length>0?`AI Focus refreshed`:`No connected supported nodes`,description:e.attempted.length>0?`Updated ${e.succeeded.length} environment${e.succeeded.length===1?``:`s`}.`:`Connect a supported node to rank its Inbox.`})),m(!1)},e[5]=g,e[6]=_);let v=_,y;e[7]===n?y=e[8]:(y=e=>n({sidebarAutoSettleAfterDays:e}),e[7]=n,e[8]=y);let b;e[9]!==t.sidebarAutoSettleAfterDays||e[10]!==y?(b=(0,I.jsx)(fe,{value:t.sidebarAutoSettleAfterDays,onChange:y}),e[9]=t.sidebarAutoSettleAfterDays,e[10]=y,e[11]=b):b=e[11];let x;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,I.jsx)(ae,{className:`size-3.5`}),e[12]=x):x=e[12];let S;e[13]===n?S=e[14]:(S=e=>n(ue({enabled:e})),e[13]=n,e[14]=S);let j;e[15]!==t.aiFocusEnabled||e[16]!==S?(j=(0,I.jsx)(A,{title:`Prioritize the Inbox`,description:`Create a Focus section from pinned, actionable, and model-ranked threads. Focused threads are removed from Active, never duplicated.`,control:(0,I.jsx)(te,{"aria-label":`Enable AI Focus`,checked:t.aiFocusEnabled,onCheckedChange:S})}),e[15]=t.aiFocusEnabled,e[16]=S,e[17]=j):j=e[17];let M=String(t.aiFocusRefreshIntervalMs),N;e[18]===n?N=e[19]:(N=e=>{let t=Number(e);n(ue({refreshIntervalMs:t}))},e[18]=n,e[19]=N);let R;e[20]===t.aiFocusRefreshIntervalMs?R=e[21]:(R=le.find(e=>e.value===t.aiFocusRefreshIntervalMs)?.label??`Every 10 minutes`,e[20]=t.aiFocusRefreshIntervalMs,e[21]=R);let z;e[22]===R?z=e[23]:(z=(0,I.jsx)(T,{className:`w-48`,"aria-label":`AI Focus refresh interval`,children:(0,I.jsx)(C,{children:R})}),e[22]=R,e[23]=z);let B;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,I.jsx)(re,{align:`end`,alignItemWithTrigger:!1,children:le.map(ge)}),e[24]=B):B=e[24];let V;e[25]!==z||e[26]!==M||e[27]!==N?(V=(0,I.jsxs)(w,{value:M,onValueChange:N,children:[z,B]}),e[25]=z,e[26]=M,e[27]=N,e[28]=V):V=e[28];let H;e[29]===v?H=e[30]:(H=()=>void v(),e[29]=v,e[30]=H);let U=p?`size-4 animate-spin`:`size-4`,W;e[31]===U?W=e[32]:(W=(0,I.jsx)(oe,{className:U}),e[31]=U,e[32]=W);let G;e[33]!==p||e[34]!==H||e[35]!==W?(G=(0,I.jsx)(O,{size:`icon-sm`,variant:`outline`,"aria-label":`Refresh AI Focus now`,disabled:p,onClick:H,children:W}),e[33]=p,e[34]=H,e[35]=W,e[36]=G):G=e[36];let K;e[37]!==V||e[38]!==G?(K=(0,I.jsx)(A,{title:`Refresh rankings`,description:`Automatic checks use only nodes that are already connected. Manual-only never starts a connection.`,control:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[V,G]})}),e[37]=V,e[38]=G,e[39]=K):K=e[39];let q;e[40]!==K||e[41]!==j?(q=(0,I.jsxs)(k,{title:`AI Focus`,icon:x,children:[j,K]}),e[40]=K,e[41]=j,e[42]=q):q=e[42];let J;e[43]===g?J=e[44]:(J=g.length>0?g.map(he):(0,I.jsx)(A,{title:`No environments available`,description:`Connect a node to configure its Inbox ranking model.`}),e[43]=g,e[44]=J);let Y;e[45]===J?Y=e[46]:(Y=(0,I.jsx)(k,{title:`Models`,children:J}),e[45]=J,e[46]=Y);let X;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(X=(0,I.jsx)(ie,{className:`size-3.5`}),e[47]=X):X=e[47];let Z;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(Z=(0,I.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`Ranking sends only this bounded metadata from each environment. It does not send full chat history, file contents, or message responses.`}),e[48]=Z):Z=e[48];let Q;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,I.jsx)(k,{title:`Data sent to the selected model`,icon:X,children:(0,I.jsxs)(`div`,{className:`px-5 py-4`,children:[Z,(0,I.jsx)(`ul`,{className:`grid gap-1.5 text-xs text-foreground/80 sm:grid-cols-2`,children:ce.map(me)})]})}),e[49]=Q):Q=e[49];let $;return e[50]!==q||e[51]!==Y||e[52]!==b?($=(0,I.jsxs)(se,{children:[b,q,Y,Q]}),e[50]=q,e[51]=Y,e[52]=b,e[53]=$):$=e[53],$}function me(e){return(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":!0,className:`text-muted-foreground`,children:`•`}),(0,I.jsx)(`span`,{children:e})]},e)}function he(e){return(0,I.jsx)(V,{row:e},e.environmentId)}function ge(e){return(0,I.jsx)(S,{hideIndicator:!0,value:String(e.value),children:e.label},e.value)}function _e(e){let[t,r]=e;return{environmentId:t,label:r.label,connected:h(t)!==null&&n(t).phase===`connected`,serverConfig:r.config}}function ve(e){return e.byId}export{H as AiFocusSettings};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{ia as n}from"./runtime-L56puJDA.js";import{A as r,Dt as i,F as a,I as o,Jn as s,M as c,N as l,P as u,dt as d,ht as f,j as p,lt as m,st as h,t as g,ut as _,vt as v,yt as y}from"./switch-COrEGDkz.js";import{t as b}from"./compiler-runtime-qmuS0Svy.js";import{f as x}from"./useRenderElement-D0HVF5g_.js";import{n as S}from"./loader-circle-D0CNb5GI.js";import{K as C,X as w}from"./ContextHandoffEndpointLabel-CPeU4K5A.js";import{t as T}from"./badge-CYDyJZRJ.js";import{i as E}from"./toast-C_F1LeME.js";import{t as D}from"./clipboard-copy-DfdkWOiT.js";import{t as O}from"./copy-riIPLkKV.js";import{t as k}from"./download-B0lbSdq5.js";import{t as A}from"./palette-kIM_geXk.js";import{t as j}from"./x-_SjFRYll.js";import{t as M}from"./button-QrCU0tNP.js";import{t as N}from"./utils-5-6TOrS1.js";import{t as P}from"./input-BAC5Cd3b.js";import{_ as F,a as I,b as L,f as ee,i as te,l as R,m as z,o as ne,p as re,u as ie,y as ae}from"./appearancePreferences-nFx4MHoI.js";import{C as oe,S as se,_ as B,a as ce,b as le,c as ue,d as de,f as fe,g as V,h as pe,i as me,l as he,m as H,o as ge,p as _e,r as U,s as W,t as ve,u as ye,v as be,x as G,y as xe}from"./useTheme-CVNauCtz.js";import{n as Se,r as Ce,t as we}from"./toggle-group-BC1zJ9xi.js";import{i as K,n as q,r as J,t as Y}from"./settingsLayout-CmNqO2kB.js";import{Gt as Te}from"./main-DaXSCt8g.js";var X={name:`baseline`,size:24,node:[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]};X.node;var Ee=x(X),De={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};De.node;var Oe=x(De),ke={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};ke.node;var Ae=x(ke),je={name:`radius`,size:24,node:[[`path`,{d:`M20.34 17.52a10 10 0 1 0-2.82 2.82`,key:`fydyku`}],[`circle`,{cx:`19`,cy:`19`,r:`2`,key:`17f5cg`}],[`path`,{d:`m13.41 13.41 4.18 4.18`,key:`1gqbwc`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};je.node;var Me=x(je),Ne={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};Ne.node;var Pe=x(Ne),Fe={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};Fe.node;var Ie=x(Fe),Z=e(t(),1),Q=b(),Le=`.rycotheme.json`,Re=/[^a-z0-9-_]+/gi;function ze(e){let t=(e.name||e.id).trim().replace(Re,`-`).replace(/^-+|-+$/g,``);return`${t.length>0?t:e.id||`theme`}${Le}`}function Be(e){let t={id:e.id,name:e.name};return e.description&&(t.description=e.description),e.light&&(t.light={...e.light}),e.dark&&(t.dark={...e.dark}),JSON.stringify(t,null,2)}function Ve(e){let t;try{t=JSON.parse(e)}catch(e){throw Error(`Could not parse theme JSON: ${e instanceof Error?e.message:`invalid JSON`}`,{cause:e})}if(!_e(t))throw Error(`Theme JSON does not match the schema (need string id/name and string-only light/dark tokens).`);let n={id:t.id,name:t.name,builtIn:!1};return t.description&&(n.description=t.description),t.light&&(n.light={...t.light}),t.dark&&(n.dark={...t.dark}),n}function He(e,t=`rename`){let n=Ve(e);if(!ye().find(e=>e.id===n.id))return me(n),{theme:n,action:`added`};if(de(n.id)||t===`rename`){let e={...n,id:he(n.id)};return me(e),{theme:e,action:`renamed`}}return le(n.id,n),{theme:n,action:`replaced`}}typeof TextEncoder>`u`||new TextEncoder,typeof TextDecoder>`u`||new TextDecoder;async function Ue(e){let t=Be(e);if(typeof navigator>`u`||!navigator.clipboard)throw Error(`Clipboard API not available in this environment.`);await navigator.clipboard.writeText(t)}function We(e){if(typeof document>`u`||typeof URL>`u`||typeof Blob>`u`)throw Error(`Download not supported in this environment.`);let t=new Blob([Be(e)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=ze(e),r.rel=`noopener`,document.body.append(r),r.click(),r.remove(),URL.revokeObjectURL(n)}async function Ge(e,t={}){let n=He(await e.text(),t.collision??`rename`);return t.activate&&(xe(n.theme.id),ce(n.theme)),n}var $=n();function Ke(e,t,n){return e<t?t:e>n?n:e}function qe(e){let t=e.trim().replace(/^#/,``),n;if(t.length===3)n=t.split(``).map(e=>`${e}${e}`).join(``);else if(t.length===6)n=t;else return null;return/^[0-9a-fA-F]{6}$/.test(n)?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null}function Je({r:e,g:t,b:n}){let r=e=>Ke(Math.round(e),0,255).toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`}function Ye({r:e,g:t,b:n}){let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=o-Math.min(r,i,a),c=0;s!==0&&(c=o===r?60*((i-a)/s%6):o===i?60*((a-r)/s+2):60*((r-i)/s+4)),c<0&&(c+=360);let l=o===0?0:s/o;return{h:c,s:l,v:o}}function Xe({h:e,s:t,v:n}){let r=n*t,i=(e%360+360)%360/60,a=r*(1-Math.abs(i%2-1)),o=0,s=0,c=0;i<1?[o,s,c]=[r,a,0]:i<2?[o,s,c]=[a,r,0]:i<3?[o,s,c]=[0,r,a]:i<4?[o,s,c]=[0,a,r]:i<5?[o,s,c]=[a,0,r]:[o,s,c]=[r,0,a];let l=n-r;return{r:(o+l)*255,g:(s+l)*255,b:(c+l)*255}}function Ze(e){let t=(0,Q.c)(71),{value:n,onChange:r,children:i,side:a,align:o,ariaLabel:s,triggerClassName:c}=e,l=a===void 0?`bottom`:a,u=o===void 0?`start`:o,f;t[0]===n?f=t[1]:(f=()=>{let e=qe(n);return e?Ye(e):{h:0,s:0,v:0}},t[0]=n,t[1]=f);let[p,h]=(0,Z.useState)(f),[g,v]=(0,Z.useState)(n),[y,b]=(0,Z.useState)(!1),x=(0,Z.useRef)(null),S=(0,Z.useRef)(null),C=(0,Z.useRef)(r),w=(0,Z.useRef)(p.h),T;t[2]===r?T=t[3]:(T=()=>{C.current=r},t[2]=r,t[3]=T),(0,Z.useEffect)(T);let E,D;t[4]===p.h?(E=t[5],D=t[6]):(E=()=>{w.current=p.h},D=[p.h],t[4]=p.h,t[5]=E,t[6]=D),(0,Z.useEffect)(E,D);let O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>{if(x.current=null,S.current===null)return;let e=S.current;S.current=null,C.current(e)},t[7]=O):O=t[7];let k=O,A;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{S.current=e,x.current===null&&(x.current=requestAnimationFrame(k))},t[8]=A):A=t[8];let j=A,M,F;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>()=>{if(x.current!==null&&(cancelAnimationFrame(x.current),x.current=null),S.current!==null){let e=S.current;S.current=null,C.current(e)}},M=[],t[9]=M,t[10]=F):(M=t[9],F=t[10]),(0,Z.useEffect)(F,M);let I;t[11]===p?I=t[12]:(I=Je(Xe(p)),t[11]=p,t[12]=I);let L=I,ee,te;t[13]!==L||t[14]!==n?(ee=()=>{if(n.toLowerCase()===L.toLowerCase())return;let e=qe(n);if(!e)return;let t=Ye(e);h(e=>({h:t.s===0?e.h:t.h,s:t.s,v:t.v})),v(n)},te=[n,L],t[13]=L,t[14]=n,t[15]=ee,t[16]=te):(ee=t[15],te=t[16]),(0,Z.useEffect)(ee,te);let R=(0,Z.useRef)(null),z;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{let t=R.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=Ke(e.clientY-n.top,0,n.height),a=n.width===0?0:r/n.width,o=n.height===0?0:1-i/n.height;h(e=>{let t={h:e.h,s:a,v:o},n=Je(Xe(t));return v(n),S.current=n,x.current===null&&(x.current=requestAnimationFrame(k)),t})},t[17]=z):z=t[17];let ne=z,re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ne(e)},t[18]=re):re=t[18];let ie=re,ae;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ne(e)},t[19]=ae):ae=t[19];let oe=ae,se=(0,Z.useRef)(null),B;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{let t=se.current;if(!t)return;let n=t.getBoundingClientRect(),r=Ke(e.clientX-n.left,0,n.width),i=n.width===0?0:r/n.width*360;h(e=>{let t={h:i,s:e.s,v:e.v},n=Je(Xe(t));return v(n),S.current=n,x.current===null&&(x.current=requestAnimationFrame(k)),t})},t[20]=B):B=t[20];let ce=B,le;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),ce(e)},t[21]=le):le=t[21];let ue=le,de;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&ce(e)},t[22]=de):de=t[22];let fe=de,V;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>{v(e);let t=qe(e.startsWith(`#`)?e:`#${e}`);if(!t)return;let n=Ye(t),r={h:n.s===0?w.current:n.h,s:n.s,v:n.v};h(r),j(Je(t))},t[23]=V):V=t[23];let pe=V,me=`${p.h/360*100}%`,he=`${p.s*100}%`,H=`${(1-p.v)*100}%`,ge=`hsl(${p.h} 100% 50%)`,_e;t[24]===c?_e=t[25]:(_e=N(`relative size-5 shrink-0 cursor-pointer overflow-hidden rounded-sm border border-border/80 outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,c),t[24]=c,t[25]=_e);let U;t[26]!==s||t[27]!==i||t[28]!==_e?(U=(0,$.jsx)(d,{"aria-label":s,className:_e,children:i}),t[26]=s,t[27]=i,t[28]=_e,t[29]=U):U=t[29];let W;t[30]===p.s?W=t[31]:(W=Math.round(p.s*100),t[30]=p.s,t[31]=W);let ve;t[32]===ge?ve=t[33]:(ve={backgroundColor:ge},t[32]=ge,t[33]=ve);let ye;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to right, rgba(255,255,255,1), rgba(255,255,255,0))`}}),t[34]=ye):ye=t[34];let be;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,style:{background:`linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0))`}}),t[35]=be):be=t[35];let G;t[36]!==he||t[37]!==H?(G=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:he,top:H}}),t[36]=he,t[37]=H,t[38]=G):G=t[38];let xe;t[39]!==W||t[40]!==ve||t[41]!==G?(xe=(0,$.jsxs)(`div`,{ref:R,role:`slider`,"aria-label":`Saturation and value`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":W,tabIndex:0,className:`relative h-36 w-full cursor-crosshair touch-none select-none overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:ve,onPointerDown:ie,onPointerMove:oe,children:[ye,be,G]}),t[39]=W,t[40]=ve,t[41]=G,t[42]=xe):xe=t[42];let Se;t[43]===p.h?Se=t[44]:(Se=Math.round(p.h),t[43]=p.h,t[44]=Se);let Ce;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Ce={background:`linear-gradient(to right, hsl(0 100% 50%), hsl(60 100% 50%), hsl(120 100% 50%), hsl(180 100% 50%), hsl(240 100% 50%), hsl(300 100% 50%), hsl(360 100% 50%))`},t[45]=Ce):Ce=t[45];let we;t[46]===me?we=t[47]:(we=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white shadow-[0_0_0_1px_rgba(0,0,0,0.4)]`,style:{left:me}}),t[46]=me,t[47]=we);let K;t[48]!==Se||t[49]!==we?(K=(0,$.jsx)(`div`,{ref:se,role:`slider`,"aria-label":`Hue`,"aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":Se,tabIndex:0,className:`relative h-3 w-full cursor-ew-resize touch-none select-none overflow-hidden rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,style:Ce,onPointerDown:ue,onPointerMove:fe,children:we}),t[48]=Se,t[49]=we,t[50]=K):K=t[50];let q;t[51]===L?q=t[52]:(q=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-7 shrink-0 rounded-md border border-border/60`,style:{backgroundColor:L}}),t[51]=L,t[52]=q);let J;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(J=e=>pe(e.currentTarget.value),t[53]=J):J=t[53];let Y;t[54]===g?Y=t[55]:(Y=(0,$.jsx)(P,{value:g,size:`sm`,nativeInput:!0,onChange:J,spellCheck:!1,className:`font-mono text-xs`,"aria-label":`Hex value`}),t[54]=g,t[55]=Y);let Te;t[56]!==q||t[57]!==Y?(Te=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[q,Y]}),t[56]=q,t[57]=Y,t[58]=Te):Te=t[58];let X;t[59]!==xe||t[60]!==K||t[61]!==Te?(X=(0,$.jsxs)(`div`,{className:`space-y-3`,children:[xe,K,Te]}),t[59]=xe,t[60]=K,t[61]=Te,t[62]=X):X=t[62];let Ee;t[63]!==u||t[64]!==l||t[65]!==X?(Ee=(0,$.jsx)(_,{side:l,align:u,className:`w-64`,children:X}),t[63]=u,t[64]=l,t[65]=X,t[66]=Ee):Ee=t[66];let De;return t[67]!==y||t[68]!==U||t[69]!==Ee?(De=(0,$.jsxs)(m,{open:y,onOpenChange:b,children:[U,Ee]}),t[67]=y,t[68]=U,t[69]=Ee,t[70]=De):De=t[70],De}var Qe=[{value:`stacked`,label:`Unified`,description:`Removed and added lines together in one column.`},{value:`split`,label:`Split`,description:`Compare the original and updated code side by side.`}];function $e(e){let t=(0,Q.c)(16),{number:n,kind:r,children:i}=e,a;t[0]===r?a=t[1]:(a=r?{backgroundColor:`color-mix(in srgb, var(--background) 92%, var(--${r===`added`?`success`:`destructive`}))`}:void 0,t[0]=r,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,$.jsx)(`span`,{className:`w-7 shrink-0 select-none text-center text-muted-foreground/60`,children:n}),t[2]=n,t[3]=o);let s=r===`added`?`var(--success)`:`var(--destructive)`,c;t[4]===s?c=t[5]:(c={color:s},t[4]=s,t[5]=c);let l=r===`added`?`+`:r===`removed`?`−`:` `,u;t[6]!==c||t[7]!==l?(u=(0,$.jsx)(`span`,{className:`w-4 shrink-0`,style:c,children:l}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===i?d=t[10]:(d=(0,$.jsx)(`span`,{children:i}),t[9]=i,t[10]=d);let f;return t[11]!==a||t[12]!==o||t[13]!==u||t[14]!==d?(f=(0,$.jsxs)(`div`,{className:`flex whitespace-pre leading-6`,style:a,children:[o,u,d]}),t[11]=a,t[12]=o,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}function et(e){let t=(0,Q.c)(10),{layout:n}=e,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`span`,{children:`greeting.ts`}),i=(0,$.jsx)(`span`,{className:`text-success`,children:`+1`}),t[0]=r,t[1]=i):(r=t[0],i=t[1]);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsxs)(`div`,{className:`flex justify-between border-b border-border bg-muted/30 px-3 py-2`,children:[r,(0,$.jsxs)(`span`,{children:[i,` `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`−1`})]})]}),t[2]=a):a=t[2];let o=n===`split`&&`grid grid-cols-2 divide-x divide-border`,s;t[3]===o?s=t[4]:(s=N(`min-h-32 py-3`,o),t[3]=o,t[4]=s);let c;t[5]===n?c=t[6]:(c=n===`split`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:3,children:``})]}),(0,$.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)($e,{number:1,children:`// Greeting`}),(0,$.jsx)($e,{number:2,kind:`removed`,children:`hello("world");`}),(0,$.jsx)($e,{number:2,kind:`added`,children:`hello("Ryco");`}),(0,$.jsx)($e,{number:3,children:``})]}),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==c?(l=(0,$.jsxs)(`div`,{"aria-hidden":`true`,className:`overflow-hidden rounded-lg border border-border bg-background text-left font-mono text-[10px] text-foreground`,children:[a,(0,$.jsx)(`div`,{className:s,children:c})]}),t[7]=s,t[8]=c,t[9]=l):l=t[9],l}function tt(){let e=(0,Q.c)(6),[t,n]=Ce(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`p`,{className:`px-4 pt-4 text-xs text-muted-foreground`,children:`Choose how code changes appear in the diff viewer. You can also switch from its toolbar.`}),e[0]=r):r=e[0];let i;e[1]!==t||e[2]!==n?(i=Qe.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.value,"aria-label":`${e.label} diff style`,onClick:()=>n(e.value),className:N(`min-w-0 rounded-xl border p-3 text-left transition-colors focus-visible:outline-2 focus-visible:outline-ring`,t===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/20`),children:[(0,$.jsx)(et,{layout:e.value}),(0,$.jsxs)(`span`,{className:`mt-3 flex items-center justify-between text-sm font-medium`,children:[e.label,t===e.value&&(0,$.jsx)(S,{"aria-hidden":`true`,className:`size-4`})]}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:e.description})]},e.value)),e[1]=t,e[2]=n,e[3]=i):i=e[3];let a;return e[4]===i?a=e[5]:(a=(0,$.jsxs)(K,{title:`Diff style`,children:[r,(0,$.jsx)(`div`,{role:`group`,"aria-label":`Diff style`,className:`grid gap-4 p-4 lg:grid-cols-2`,children:i})]}),e[4]=i,e[5]=a),a}function nt(e){let t=(0,Q.c)(22),{theme:n,variant:r,compact:i}=e,a=i!==void 0&&i,o;t[0]!==n||t[1]!==r?(o=Object.fromEntries(Object.entries(V(be(n,r))).map(it)),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(`div`,{className:`flex w-[26%] flex-col gap-2 border-r border-[var(--sidebar-border)] bg-[var(--sidebar)] p-[4%]`,children:[(0,$.jsx)(`span`,{className:`font-semibold`,children:`Ryco`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),(0,$.jsx)(`span`,{className:`h-3 rounded bg-[var(--sidebar-accent)]`}),(0,$.jsx)(`span`,{className:`h-1.5 w-3/4 rounded bg-[var(--muted-foreground)] opacity-25`}),(0,$.jsx)(`span`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-25`})]}),t[3]=c):c=t[3];let l;t[4]===a?l=t[5]:(l=a?(0,$.jsx)(`div`,{className:`h-3 w-2/3 shrink-0 self-end rounded bg-[var(--secondary)]`}):(0,$.jsx)(`div`,{className:`self-end rounded bg-[var(--secondary)] px-2 py-1`,children:`Build something great`}),t[4]=a,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{className:`h-1.5 w-4/5 rounded bg-[var(--muted-foreground)] opacity-40`}),t[6]=u):u=t[6];let d;t[7]===a?d=t[8]:(d=a?(0,$.jsx)(`div`,{className:`h-1.5 w-2/3 rounded bg-[var(--muted-foreground)] opacity-25`}):(0,$.jsxs)(`div`,{className:`rounded border border-[var(--border)] bg-[var(--card)] p-2 font-mono`,children:[(0,$.jsx)(`span`,{style:{color:`var(--info)`},children:`const `}),`theme =`,` `,(0,$.jsx)(`span`,{style:{color:`var(--success)`},children:`"ryco"`}),`;`,(0,$.jsx)(`br`,{}),(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`// Make it yours`})]}),t[7]=a,t[8]=d);let f;t[9]===a?f=t[10]:(f=a?(0,$.jsx)(`span`,{className:`h-1 w-1/2 rounded bg-[var(--muted-foreground)] opacity-30`}):(0,$.jsx)(`span`,{style:{color:`var(--muted-foreground)`},children:`Ask anything…`}),t[9]=a,t[10]=f);let p;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`size-3 rounded-full bg-[var(--primary)]`}),t[11]=p):p=t[11];let m;t[12]===f?m=t[13]:(m=(0,$.jsxs)(`div`,{className:`mt-auto flex items-center justify-between rounded-md border border-[var(--input)] px-2 py-1.5`,children:[f,p]}),t[12]=f,t[13]=m);let h;t[14]!==l||t[15]!==d||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`flex aspect-[16/9] text-[9px] leading-relaxed`,children:[c,(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 p-[4%]`,children:[l,u,d,m]})]}),t[14]=l,t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`flex h-2`,children:[`sidebar`,`background`,`primary`,`info`,`success`,`warning`,`destructive`].map(rt)}),t[18]=g):g=t[18];let _;return t[19]!==s||t[20]!==h?(_=(0,$.jsxs)(`div`,{"aria-hidden":`true`,style:s,className:`w-full overflow-hidden rounded-lg border border-[var(--border)] bg-[var(--background)] text-[var(--foreground)]`,children:[h,g]}),t[19]=s,t[20]=h,t[21]=_):_=t[21],_}function rt(e){return(0,$.jsx)(`span`,{className:`flex-1`,style:{backgroundColor:`var(--${e})`}},e)}function it(e){let[t,n]=e;return[`--${t}`,n]}var at=[{title:`Surfaces`,tokens:[`background`,`app-chrome-background`,`foreground`,`card`,`card-foreground`,`popover`,`popover-foreground`]},{title:`Brand & focus`,tokens:[`primary`,`primary-foreground`,`ring`]},{title:`Neutrals`,tokens:[`secondary`,`secondary-foreground`,`muted`,`muted-foreground`,`accent`,`accent-foreground`]},{title:`Status`,tokens:[`destructive`,`destructive-foreground`,`info`,`info-foreground`,`success`,`success-foreground`,`warning`,`warning-foreground`]},{title:`Borders & inputs`,tokens:[`border`,`input`]},{title:`Scrollbars`,tokens:[`scrollbar-thumb`,`scrollbar-thumb-hover`,`scrollbar-thumb-thin`,`scrollbar-thumb-thin-hover`]}],ot=new Set(G),st=null,ct=null;function lt(e){if(typeof document>`u`||document.body===void 0||!e)return`#000000`;st||(st=document.createElement(`div`),st.style.position=`absolute`,st.style.visibility=`hidden`,st.style.pointerEvents=`none`,document.body.append(st)),st.style.color=``,st.style.color=e;let t=getComputedStyle(st).color;ct||=document.createElement(`canvas`),ct.width=1,ct.height=1;let n=ct.getContext(`2d`,{willReadFrequently:!0});if(!n)return`#000000`;n.clearRect(0,0,1,1);try{n.fillStyle=t}catch{return`#000000`}n.fillRect(0,0,1,1);let r=n.getImageData(0,0,1,1).data;return`#${[r[0],r[1],r[2]].map(e=>(e??0).toString(16).padStart(2,`0`)).join(``)}`}function ut(e,t,n,r){let i={...e[t]};return r.length===0?delete i[n]:i[n]=r,t===`light`?{...e,light:i}:{...e,dark:i}}function dt(e,t){return{...e,name:t}}function ft(e,t){let n={...e};return t.length===0?delete n.description:n.description=t,n}function pt(e){return U.includes(e)}function mt(e){let t=(0,Q.c)(124),{source:n,draft:i,onDraftChange:s,onSave:d,onCancel:f,resolvedVariant:m}=e,[g,_]=(0,Z.useState)(`form`),[v,y]=(0,Z.useState)(m),b;t[0]===i?b=t[1]:(b=()=>JSON.stringify(i,null,2),t[0]=i,t[1]=b);let[x,S]=(0,Z.useState)(b),[C,w]=(0,Z.useState)(null),[T,E]=(0,Z.useState)(!1),D;t[2]===n?D=t[3]:(D=JSON.stringify(n),t[2]=n,t[3]=D);let O;t[4]===i?O=t[5]:(O=JSON.stringify(i),t[4]=i,t[5]=O);let k=D!==O,A;t[6]===i?A=t[7]:(A=()=>{ce(i)},t[6]=i,t[7]=A);let j;t[8]!==i||t[9]!==m?(j=[i,m],t[8]=i,t[9]=m,t[10]=j):j=t[10],(0,Z.useEffect)(A,j);let N,F;t[11]!==i||t[12]!==g?(N=()=>{g===`form`&&S(JSON.stringify(i,null,2))},F=[i,g],t[11]=i,t[12]=g,t[13]=N,t[14]=F):(N=t[13],F=t[14]),(0,Z.useEffect)(N,F);let I;t[15]!==i||t[16]!==s?(I=e=>{s(dt(i,e))},t[15]=i,t[16]=s,t[17]=I):I=t[17];let L=I,ee;t[18]!==i||t[19]!==s?(ee=e=>{s(ft(i,e))},t[18]=i,t[19]=s,t[20]=ee):ee=t[20];let te=ee,R;t[21]!==i||t[22]!==s||t[23]!==v?(R=(e,t)=>{s(ut(i,v,e,t))},t[21]=i,t[22]=s,t[23]=v,t[24]=R):R=t[24];let z=R,ne;t[25]===s?ne=t[26]:(ne=e=>{S(e);let t;try{t=JSON.parse(e)}catch(e){let t=e;w(t instanceof Error?t.message:`Invalid JSON`);return}if(!_e(t)){w(`Invalid theme schema. Need string id/name and string-only light/dark tokens.`);return}w(null),s(t)},t[25]=s,t[26]=ne);let re=ne,ie;t[27]!==k||t[28]!==f?(ie=()=>{if(k){E(!0);return}f()},t[27]=k,t[28]=f,t[29]=ie):ie=t[29];let ae=ie,B,le,ue;if(t[30]!==i.dark||t[31]!==i.light||t[32]!==v){ue=(v===`dark`?i.dark:i.light)??{};let e;t[36]===v?e=t[37]:(e=(v===`dark`?oe.dark:oe.light)??{},t[36]=v,t[37]=e),B=e,le=Object.entries(ue).filter(_t),t[30]=i.dark,t[31]=i.light,t[32]=v,t[33]=B,t[34]=le,t[35]=ue}else B=t[33],le=t[34],ue=t[35];let de=le,fe=ht,V=fe(i.light)||fe(i.dark),pe;t[38]!==i.name||t[39]!==V||t[40]!==C?(pe=C!==null||i.name.trim().length===0||V,t[38]=i.name,t[39]=V,t[40]=C,t[41]=pe):pe=t[41];let me=pe,he;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,$.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Editing`}),t[42]=he):he=t[42];let H=i.name||`Untitled`,ge;t[43]!==i.name||t[44]!==H?(ge=(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:i.name,children:H}),t[43]=i.name,t[44]=H,t[45]=ge):ge=t[45];let U;t[46]===k?U=t[47]:(U=k?(0,$.jsx)(`span`,{className:`rounded-sm bg-warning/16 px-1.5 py-0.5 text-[10px] font-medium text-warning-foreground`,children:`Unsaved`}):null,t[46]=k,t[47]=U);let W;t[48]===ae?W=t[49]:(W=(0,$.jsx)(M,{size:`sm`,variant:`outline`,onClick:ae,children:`Cancel`}),t[48]=ae,t[49]=W);let ve;t[50]!==d||t[51]!==me?(ve=(0,$.jsx)(M,{size:`sm`,onClick:d,disabled:me,children:`Save`}),t[50]=d,t[51]=me,t[52]=ve):ve=t[52];let ye;t[53]!==W||t[54]!==ve?(ye=(0,$.jsxs)(`div`,{className:`ms-auto flex items-center gap-2`,children:[W,ve]}),t[53]=W,t[54]=ve,t[55]=ye):ye=t[55];let be;t[56]!==ge||t[57]!==U||t[58]!==ye?(be=(0,$.jsxs)(`div`,{className:`sticky top-0 z-10 flex flex-wrap items-center gap-2 border-b border-border/60 bg-muted/72 px-4 py-2 backdrop-blur-sm sm:px-5`,children:[he,ge,U,ye]}),t[56]=ge,t[57]=U,t[58]=ye,t[59]=be):be=t[59];let G;t[60]===g?G=t[61]:(G=[g],t[60]=g,t[61]=G);let xe,Ce,K;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(xe=e=>{let t=e[0];(t===`form`||t===`json`)&&_(t)},Ce=(0,$.jsx)(we,{value:`form`,"aria-label":`Form editor`,className:`px-3 sm:px-3`,children:`Form`}),K=(0,$.jsx)(we,{value:`json`,"aria-label":`JSON editor`,className:`px-3 sm:px-3`,children:`JSON`}),t[62]=xe,t[63]=Ce,t[64]=K):(xe=t[62],Ce=t[63],K=t[64]);let q;t[65]===G?q=t[66]:(q=(0,$.jsxs)(Se,{value:G,variant:`outline`,size:`sm`,onValueChange:xe,children:[Ce,K]}),t[65]=G,t[66]=q);let J;t[67]===v?J=t[68]:(J=[v],t[67]=v,t[68]=J);let Y,Te,X;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(Y=e=>{let t=e[0];(t===`light`||t===`dark`)&&y(t)},Te=(0,$.jsx)(we,{value:`light`,"aria-label":`Light variant`,className:`px-3 sm:px-3`,children:`Light`}),X=(0,$.jsx)(we,{value:`dark`,"aria-label":`Dark variant`,className:`px-3 sm:px-3`,children:`Dark`}),t[69]=Y,t[70]=Te,t[71]=X):(Y=t[69],Te=t[70],X=t[71]);let Ee;t[72]===J?Ee=t[73]:(Ee=(0,$.jsxs)(Se,{value:J,variant:`outline`,size:`sm`,onValueChange:Y,children:[Te,X]}),t[72]=J,t[73]=Ee);let De;t[74]!==q||t[75]!==Ee?(De=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[q,Ee]}),t[74]=q,t[75]=Ee,t[76]=De):De=t[76];let Oe;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Name`}),t[77]=Oe):Oe=t[77];let ke;t[78]===L?ke=t[79]:(ke=e=>L(e.currentTarget.value),t[78]=L,t[79]=ke);let Ae;t[80]===i.name?Ae=t[81]:(Ae=i.name.trim().length===0||void 0,t[80]=i.name,t[81]=Ae);let je;t[82]!==i.name||t[83]!==ke||t[84]!==Ae?(je=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Oe,(0,$.jsx)(P,{value:i.name,nativeInput:!0,onChange:ke,"aria-invalid":Ae})]}),t[82]=i.name,t[83]=ke,t[84]=Ae,t[85]=je):je=t[85];let Me;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Description`}),t[86]=Me):Me=t[86];let Ne=i.description??``,Pe;t[87]===te?Pe=t[88]:(Pe=e=>te(e.currentTarget.value),t[87]=te,t[88]=Pe);let Fe;t[89]!==Ne||t[90]!==Pe?(Fe=(0,$.jsxs)(`label`,{className:`space-y-1.5`,children:[Me,(0,$.jsx)(P,{value:Ne,nativeInput:!0,onChange:Pe,placeholder:`Optional, shown under the picker.`})]}),t[89]=Ne,t[90]=Pe,t[91]=Fe):Fe=t[91];let Ie;t[92]!==je||t[93]!==Fe?(Ie=(0,$.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[je,Fe]}),t[92]=je,t[93]=Fe,t[94]=Ie):Ie=t[94];let Le;t[95]!==re||t[96]!==z||t[97]!==B||t[98]!==C||t[99]!==x||t[100]!==g||t[101]!==de||t[102]!==ue?(Le=g===`form`?(0,$.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[at.map(e=>(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h4`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:e.title}),(0,$.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.tokens.map(e=>{let t=ue[e]??``,n=B[e]??``,r=se(e);return r?(0,$.jsx)(vt,{token:e,kind:r,value:t,inherited:n,onChange:t=>z(e,t)},e):null})})]},e.title)),de.length>0?(0,$.jsxs)(`p`,{className:`text-xs text-warning-foreground`,children:[de.length,` token`,de.length===1?``:`s`,` not in the allow-list will be ignored on save.`]}):null]}):(0,$.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[(0,$.jsx)(h,{value:x,size:`sm`,className:`font-mono text-xs`,spellCheck:!1,rows:18,onChange:e=>re(e.currentTarget.value),"aria-invalid":C!==null||void 0}),C?(0,$.jsx)(`p`,{className:`text-xs text-destructive-foreground`,children:C}):(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/80`,children:`Edit the JSON directly. Save is disabled while the schema is invalid.`})]}),t[95]=re,t[96]=z,t[97]=B,t[98]=C,t[99]=x,t[100]=g,t[101]=de,t[102]=ue,t[103]=Le):Le=t[103];let Re;t[104]!==De||t[105]!==Ie||t[106]!==Le?(Re=(0,$.jsxs)(`div`,{className:`px-4 py-4 sm:px-5`,children:[De,Ie,Le]}),t[104]=De,t[105]=Ie,t[106]=Le,t[107]=Re):Re=t[107];let ze;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,$.jsx)(o,{children:`Discard your changes?`}),t[108]=ze):ze=t[108];let Be;t[109]===n.name?Be=t[110]:(Be=(0,$.jsxs)(u,{children:[ze,(0,$.jsxs)(c,{children:[`You have unsaved edits to `,n.name,`. Discarding will revert any token changes you made.`]})]}),t[109]=n.name,t[110]=Be);let Ve;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(p,{render:(0,$.jsx)(M,{variant:`outline`}),children:`Keep editing`}),t[111]=Ve):Ve=t[111];let He;t[112]===f?He=t[113]:(He=(0,$.jsxs)(l,{children:[Ve,(0,$.jsx)(M,{variant:`destructive`,onClick:()=>{E(!1),f()},children:`Discard changes`})]}),t[112]=f,t[113]=He);let Ue;t[114]!==Be||t[115]!==He?(Ue=(0,$.jsxs)(a,{children:[Be,He]}),t[114]=Be,t[115]=He,t[116]=Ue):Ue=t[116];let We;t[117]!==T||t[118]!==Ue?(We=(0,$.jsx)(r,{open:T,onOpenChange:E,children:Ue}),t[117]=T,t[118]=Ue,t[119]=We):We=t[119];let Ge;return t[120]!==be||t[121]!==Re||t[122]!==We?(Ge=(0,$.jsxs)(`div`,{className:`border-t border-border/60 bg-muted/24`,children:[be,Re,We]}),t[120]=be,t[121]=Re,t[122]=We,t[123]=Ge):Ge=t[123],Ge}function ht(e){return Object.entries(e??{}).some(gt)}function gt(e){let[t,n]=e;if(typeof n!=`string`||n.length===0)return!1;let r=se(t);return r?!H(r,n):!1}function _t(e){let[t]=e;return!ot.has(t)}function vt(e){let t=(0,Q.c)(12),{token:n,kind:r,value:i,inherited:a,onChange:o}=e,s=i.length>0,c=r===`font-family`&&`sm:col-span-2`,l;t[0]===c?l=t[1]:(l=N(`rounded-md border border-border/60 bg-background px-2 py-1.5`,c),t[0]=c,t[1]=l);let u;t[2]!==a||t[3]!==r||t[4]!==o||t[5]!==s||t[6]!==n||t[7]!==i?(u=r===`color`?(0,$.jsx)(xt,{token:n,value:i,inherited:a,overridden:s,onChange:o}):r===`opacity`?(0,$.jsx)(St,{token:n,value:i,inherited:a,overridden:s,onChange:o}):r===`length`?(0,$.jsx)(Ct,{token:n,value:i,inherited:a,overridden:s,onChange:o}):(0,$.jsx)(Tt,{token:n,value:i,inherited:a,overridden:s,onChange:o}),t[2]=a,t[3]=r,t[4]=o,t[5]=s,t[6]=n,t[7]=i,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsx)(`div`,{className:l,children:u}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}function yt(e){let t=(0,Q.c)(6),{token:n,onChange:r}=e,i=`Reset --${n}`,a;t[0]===r?a=t[1]:(a=()=>r(``),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(j,{className:`size-3.5`,"aria-hidden":!0}),t[2]=o):o=t[2];let s;return t[3]!==i||t[4]!==a?(s=(0,$.jsx)(M,{size:`icon-xs`,variant:`ghost`,"aria-label":i,onClick:a,className:`text-muted-foreground`,children:o}),t[3]=i,t[4]=a,t[5]=s):s=t[5],s}function bt(e){let t=(0,Q.c)(6),{token:n,overridden:r}=e,i=r?`text-foreground`:`text-muted-foreground/70`,a;t[0]===i?a=t[1]:(a=N(`truncate font-mono text-[11px]`,i),t[0]=i,t[1]=a);let o=`--${n}`,s;return t[2]!==a||t[3]!==o||t[4]!==n?(s=(0,$.jsxs)(`span`,{className:a,title:o,children:[`--`,n]}),t[2]=a,t[3]=o,t[4]=n,t[5]=s):s=t[5],s}function xt(e){let t=(0,Q.c)(41),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c,l,u,d,f;if(t[0]!==s||t[1]!==r){u=pe(s);let e;t[7]===r?e=t[8]:(e=r.length>0&&!fe(r),t[7]=r,t[8]=e),l=e,f=`flex items-center gap-2`,c=Ze,d=lt(u),t[0]=s,t[1]=r,t[2]=c,t[3]=l,t[4]=u,t[5]=d,t[6]=f}else c=t[2],l=t[3],u=t[4],d=t[5],f=t[6];let p;t[9]===o?p=t[10]:(p=e=>o(e),t[9]=o,t[10]=p);let m=`Pick a color for --${n}`,h=l?`transparent`:u||`transparent`,g;t[11]===h?g=t[12]:(g=(0,$.jsx)(`span`,{className:`pointer-events-none absolute inset-0`,style:{backgroundColor:h},"aria-hidden":!0}),t[11]=h,t[12]=g);let _;t[13]!==c||t[14]!==d||t[15]!==p||t[16]!==m||t[17]!==g?(_=(0,$.jsx)(c,{value:d,onChange:p,ariaLabel:m,children:g}),t[13]=c,t[14]=d,t[15]=p,t[16]=m,t[17]=g,t[18]=_):_=t[18];let v;t[19]!==a||t[20]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[19]=a,t[20]=n,t[21]=v):v=t[21];let y=i||`inherit default`,b=l||void 0,x;t[22]===o?x=t[23]:(x=e=>o(e.currentTarget.value),t[22]=o,t[23]=x);let S;t[24]!==b||t[25]!==x||t[26]!==y||t[27]!==r?(S=(0,$.jsx)(P,{value:r,nativeInput:!0,unstyled:!0,size:`sm`,className:`border-0 bg-transparent p-0 shadow-none focus-within:shadow-none`,placeholder:y,"aria-invalid":b,onChange:x}),t[24]=b,t[25]=x,t[26]=y,t[27]=r,t[28]=S):S=t[28];let C;t[29]!==S||t[30]!==v?(C=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[v,S]}),t[29]=S,t[30]=v,t[31]=C):C=t[31];let w;t[32]!==o||t[33]!==a||t[34]!==n?(w=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[32]=o,t[33]=a,t[34]=n,t[35]=w):w=t[35];let T;return t[36]!==C||t[37]!==w||t[38]!==f||t[39]!==_?(T=(0,$.jsxs)(`div`,{className:f,children:[_,C,w]}),t[36]=C,t[37]=w,t[38]=f,t[39]=_,t[40]=T):T=t[40],T}function St(e){let t=(0,Q.c)(31),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=Number(r||i),c;t[0]===s?c=t[1]:(c=Number.isFinite(s)?Math.min(1,Math.max(0,s)):0,t[0]=s,t[1]=c);let l=c,u;t[2]===r?u=t[3]:(u=r.length>0&&!H(`opacity`,r),t[2]=r,t[3]=u);let d=u,f;t[4]!==a||t[5]!==n?(f=(0,$.jsx)(bt,{token:n,overridden:a}),t[4]=a,t[5]=n,t[6]=f):f=t[6];let p;t[7]===o?p=t[8]:(p=e=>o(e.currentTarget.value),t[7]=o,t[8]=p);let m=`--${n} value`,h;t[9]!==l||t[10]!==p||t[11]!==m?(h=(0,$.jsx)(`input`,{type:`range`,min:0,max:1,step:.005,value:l,onChange:p,"aria-label":m,className:`h-7.5 flex-1 accent-primary cursor-pointer`}),t[9]=l,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=i||`0`,_=d||void 0,v;t[13]===o?v=t[14]:(v=e=>o(e.currentTarget.value),t[13]=o,t[14]=v);let y;t[15]!==g||t[16]!==_||t[17]!==v||t[18]!==r?(y=(0,$.jsx)(`div`,{className:`w-20 shrink-0`,children:(0,$.jsx)(P,{value:r,nativeInput:!0,type:`number`,min:0,max:1,step:.005,size:`sm`,placeholder:g,"aria-invalid":_,onChange:v})}),t[15]=g,t[16]=_,t[17]=v,t[18]=r,t[19]=y):y=t[19];let b;t[20]!==o||t[21]!==a||t[22]!==n?(b=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[20]=o,t[21]=a,t[22]=n,t[23]=b):b=t[23];let x;t[24]!==y||t[25]!==b||t[26]!==h?(x=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[h,y,b]}),t[24]=y,t[25]=b,t[26]=h,t[27]=x):x=t[27];let S;return t[28]!==x||t[29]!==f?(S=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[f,x]}),t[28]=x,t[29]=f,t[30]=S):S=t[30],S}function Ct(e){let t=(0,Q.c)(67),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s,c,l,u,d;if(t[0]!==i||t[1]!==o||t[2]!==a||t[3]!==n||t[4]!==r){d=Symbol.for(`react.early_return_sentinel`);bb0:{l=B(r),c=B(i);let e=c?pt(c.unit):!1,f=l?pt(l.unit):!1;if(r.length>0&&!f||r.length===0&&i.length>0&&!e){let e;t[10]===r?e=t[11]:(e=r.length>0&&!H(`length`,r),t[10]=r,t[11]=e);let s=e,c;t[12]!==a||t[13]!==n?(c=(0,$.jsx)(bt,{token:n,overridden:a}),t[12]=a,t[13]=n,t[14]=c):c=t[14];let l=i||`e.g. 1rem`,u=s||void 0,f;t[15]===o?f=t[16]:(f=e=>o(e.currentTarget.value),t[15]=o,t[16]=f);let p;t[17]!==l||t[18]!==u||t[19]!==f||t[20]!==r?(p=(0,$.jsx)(P,{value:r,nativeInput:!0,size:`sm`,placeholder:l,"aria-invalid":u,onChange:f}),t[17]=l,t[18]=u,t[19]=f,t[20]=r,t[21]=p):p=t[21];let m;t[22]!==o||t[23]!==a||t[24]!==n?(m=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[22]=o,t[23]=a,t[24]=n,t[25]=m):m=t[25];let h;t[26]!==p||t[27]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p,m]}),t[26]=p,t[27]=m,t[28]=h):h=t[28];let g;t[29]!==h||t[30]!==c?(g=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[c,h]}),t[29]=h,t[30]=c,t[31]=g):g=t[31],d=g;break bb0}s=l?String(l.number):``,u=l&&pt(l.unit)?l.unit:c&&pt(c.unit)?c.unit:`rem`}t[0]=i,t[1]=o,t[2]=a,t[3]=n,t[4]=r,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];if(d!==Symbol.for(`react.early_return_sentinel`))return d;let f=u,p=c?String(c.number):``,m;t[32]!==o||t[33]!==f?(m=e=>{let t=e.trim();if(t.length===0){o(``);return}let n=Number(t);Number.isFinite(n)&&o(`${n}${f}`)},t[32]=o,t[33]=f,t[34]=m):m=t[34];let h=m,g;t[35]!==o||t[36]!==c||t[37]!==l?(g=e=>{if(l){o(`${l.number}${e}`);return}c&&o(`${c.number}${e}`)},t[35]=o,t[36]=c,t[37]=l,t[38]=g):g=t[38];let _=g,v;t[39]!==a||t[40]!==n?(v=(0,$.jsx)(bt,{token:n,overridden:a}),t[39]=a,t[40]=n,t[41]=v):v=t[41];let y=n===`font-size-base`?1:.05,b;t[42]===h?b=t[43]:(b=e=>h(e.currentTarget.value),t[42]=h,t[43]=b);let x;t[44]!==p||t[45]!==s||t[46]!==y||t[47]!==b?(x=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(P,{value:s,nativeInput:!0,type:`number`,step:y,size:`sm`,placeholder:p,onChange:b})}),t[44]=p,t[45]=s,t[46]=y,t[47]=b,t[48]=x):x=t[48];let S;t[49]===_?S=t[50]:(S=e=>_(e.currentTarget.value),t[49]=_,t[50]=S);let C=`--${n} unit`,w;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(w=U.map(wt),t[51]=w):w=t[51];let T;t[52]!==C||t[53]!==S||t[54]!==f?(T=(0,$.jsx)(`select`,{value:f,onChange:S,"aria-label":C,className:`h-7.5 rounded-md border border-input bg-background px-2 text-sm outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/24 sm:h-6.5 sm:text-xs`,children:w}),t[52]=C,t[53]=S,t[54]=f,t[55]=T):T=t[55];let E;t[56]!==o||t[57]!==a||t[58]!==n?(E=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[56]=o,t[57]=a,t[58]=n,t[59]=E):E=t[59];let D;t[60]!==T||t[61]!==E||t[62]!==x?(D=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x,T,E]}),t[60]=T,t[61]=E,t[62]=x,t[63]=D):D=t[63];let O;return t[64]!==D||t[65]!==v?(O=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[v,D]}),t[64]=D,t[65]=v,t[66]=O):O=t[66],O}function wt(e){return(0,$.jsx)(`option`,{value:e,children:e},e)}function Tt(e){let t=(0,Q.c)(25),{token:n,value:r,inherited:i,overridden:a,onChange:o}=e,s=r||i,c;t[0]===r?c=t[1]:(c=r.length>0&&!H(`font-family`,r),t[0]=r,t[1]=c);let l=c,u;t[2]!==a||t[3]!==n?(u=(0,$.jsx)(bt,{token:n,overridden:a}),t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=i||`system-ui, sans-serif`,f=s||void 0,p;t[5]===f?p=t[6]:(p={fontFamily:f},t[5]=f,t[6]=p);let m=l||void 0,h;t[7]===o?h=t[8]:(h=e=>o(e.currentTarget.value),t[7]=o,t[8]=h);let g;t[9]!==d||t[10]!==p||t[11]!==m||t[12]!==h||t[13]!==r?(g=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,$.jsx)(P,{value:r,nativeInput:!0,size:`sm`,placeholder:d,style:p,"aria-invalid":m,onChange:h})}),t[9]=d,t[10]=p,t[11]=m,t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]!==o||t[16]!==a||t[17]!==n?(_=a?(0,$.jsx)(yt,{token:n,onChange:o}):null,t[15]=o,t[16]=a,t[17]=n,t[18]=_):_=t[18];let v;t[19]!==g||t[20]!==_?(v=(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[g,_]}),t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;return t[22]!==v||t[23]!==u?(y=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[u,v]}),t[22]=v,t[23]=u,t[24]=y):y=t[24],y}var Et=[{value:`system`,label:`System`},{value:`light`,label:`Light`},{value:`dark`,label:`Dark`}],Dt={default:1,light:.92,medium:.84,high:.78,glass:.72};function Ot({surface:e=`node`}={}){let t=e===`hub`,{theme:n,setTheme:d,resolvedTheme:m,activeThemeId:h,setActiveTheme:g}=ve(),[_,b]=(0,Z.useState)(null),[x,S]=(0,Z.useState)(null),[A,j]=(0,Z.useState)(null),[P,R]=(0,Z.useState)(()=>z()),[oe,se]=(0,Z.useState)(0),B=(0,Z.useRef)(null),fe=ye(),V=(0,Z.useMemo)(()=>_!==null&&x!==null?{source:ue(_),draft:x}:null,[x,_,oe]),pe=A?ue(A):null,H=(0,Z.useCallback)(()=>se(e=>e+1),[]);(0,Z.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`ryco:appearance-preferences`&&R(z())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let _e=(0,Z.useCallback)((e,t)=>{L(e,t),re(),R(z())},[]),U=(0,Z.useCallback)(e=>{ae(e),re(),R(z())},[]),be=(0,Z.useCallback)(()=>{ae(`primaryColorMode`),ae(`primaryColor`),re(),R(z())},[]),G=(0,Z.useCallback)(e=>{L(`primaryColorMode`,e?`custom`:`theme`),re(),R(z())},[]),Se=(0,Z.useCallback)(e=>{L(`primaryColor`,e),L(`primaryColorMode`,`custom`),re(),R(z())},[]),Ce=(0,Z.useCallback)(e=>{if(de(e.id)){let t=W(e);me(t),xe(t.id),g(t.id),b(t.id),S(t),H();return}g(e.id),b(e.id),S(e)},[H,g]),we=(0,Z.useCallback)(e=>{let t=W(e);me(t),g(t.id),b(t.id),S(t),H()},[H,g]),X=(0,Z.useCallback)(()=>{let e={id:he(`new`),name:`New theme`,builtIn:!1};me(e),g(e.id),b(e.id),S(e),H()},[H,g]),De=(0,Z.useCallback)(()=>{V&&(le(V.source.id,V.draft),V.source.id===V.draft.id?ce(V.draft):g(V.draft.id),b(null),S(null),H())},[V,H,g]),ke=(0,Z.useCallback)(()=>{V&&ce(V.source),b(null),S(null)},[V]),je=(0,Z.useCallback)(()=>{A&&(_===A&&(b(null),S(null)),ge(A),j(null),H())},[_,A,H]),Ne=(0,Z.useCallback)(e=>{try{We(e)}catch(e){E.add({type:`error`,title:`Could not export theme`,description:e instanceof Error?e.message:`Download failed.`})}},[]),Fe=(0,Z.useCallback)(async e=>{try{await Ue(e),E.add({type:`success`,title:`Copied theme JSON`,description:`${e.name} is ready to paste.`})}catch(e){E.add({type:`error`,title:`Could not copy theme`,description:e instanceof Error?e.message:`Clipboard write failed.`})}},[]),Q=(0,Z.useCallback)(()=>{B.current?.click()},[]),Le=(0,Z.useCallback)(async e=>{let t=e.target.files?.[0];if(e.target.value=``,t)try{let e=await Ge(t,{collision:`rename`,activate:!0});g(e.theme.id),H(),E.add({type:`success`,title:`Imported "${e.theme.name}"`,description:e.action===`renamed`?`An existing theme used the same id, so it was imported as "${e.theme.id}".`:`Theme imported and activated.`})}catch(e){E.add({type:`error`,title:`Could not import theme`,description:e instanceof Error?e.message:`Invalid theme file.`})}},[H,g]);return(0,$.jsxs)(q,{children:[(0,$.jsx)(K,{title:`Color mode`,children:(0,$.jsx)(`div`,{className:`grid grid-cols-3 gap-3 p-4`,role:`group`,"aria-label":`Color mode`,children:Et.map(e=>(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":n===e.value,onClick:()=>d(e.value),className:N(`min-w-0 rounded-xl border p-2 text-sm transition-colors focus-visible:outline-2 focus-visible:outline-ring`,n===e.value?`border-primary bg-muted/40`:`border-border hover:bg-muted/30`),children:[(0,$.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg`,children:[(0,$.jsx)(nt,{compact:!0,theme:ue(h),variant:e.value===`dark`?`dark`:`light`}),e.value===`system`&&(0,$.jsx)(`div`,{className:`absolute inset-0 [clip-path:inset(0_0_0_50%)]`,children:(0,$.jsx)(nt,{compact:!0,theme:ue(h),variant:`dark`})})]}),(0,$.jsx)(`span`,{className:`mt-2 block font-medium`,children:e.label})]},e.value))})}),(0,$.jsx)(K,{title:`Theme palette`,headerAction:(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,$.jsx)(`input`,{ref:B,type:`file`,accept:`.json,application/json`,className:`sr-only`,onChange:Le,"aria-hidden":!0,tabIndex:-1}),(0,$.jsxs)(M,{size:`xs`,variant:`ghost`,onClick:X,"aria-label":`Create a new theme`,title:`Create a new theme`,className:`text-muted-foreground`,children:[(0,$.jsx)(Te,{className:`size-3.5`}),`New`]}),(0,$.jsxs)(M,{size:`xs`,variant:`ghost`,onClick:Q,"aria-label":`Import a theme from file`,title:`Import a theme from disk`,className:`text-muted-foreground`,children:[(0,$.jsx)(Ie,{className:`size-3.5`}),`Import`]})]}),children:(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":`Theme palette`,className:`grid grid-cols-2 gap-4 p-4`,children:fe.map(e=>{let t=e.id===h,n=_===e.id;return(0,$.jsxs)(Z.Fragment,{children:[(0,$.jsxs)(`div`,{role:`radio`,"aria-checked":t,tabIndex:t?0:-1,onClick:()=>g(e.id),onKeyDown:t=>{let n=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(n){t.preventDefault();let r=(fe.findIndex(t=>t.id===e.id)+n+fe.length)%fe.length;g(fe[r].id),(t.currentTarget.parentElement?.querySelectorAll(`[role="radio"]`))?.item(r).focus()}(t.key===` `||t.key===`Enter`)&&(t.preventDefault(),g(e.id))},className:N(`flex cursor-pointer flex-wrap items-center gap-3 rounded-xl border p-3 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,t?`border-primary`:`border-border`,t?`bg-muted/40`:`hover:bg-muted/24`),children:[(0,$.jsx)(nt,{theme:e,variant:m}),(0,$.jsx)(`span`,{"aria-hidden":!0,className:N(`relative flex size-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors`,t?`border-primary`:`border-muted-foreground/40`),children:t?(0,$.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,"aria-hidden":!0}):null}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,$.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:e.name,children:e.name}),(0,$.jsx)(T,{variant:`outline`,size:`sm`,children:e.builtIn?`Built-in`:`Custom`})]}),e.description?(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground/80`,title:e.description,children:e.description}):null]}),(0,$.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:(0,$.jsxs)(f,{children:[(0,$.jsx)(i,{render:(0,$.jsx)(M,{size:`icon-xs`,variant:`ghost`,"aria-label":`Theme actions for ${e.name}`,children:(0,$.jsx)(w,{className:`size-4`})})}),(0,$.jsxs)(y,{align:`end`,children:[!e.builtIn&&(0,$.jsxs)(v,{onClick:()=>Ce(e),children:[(0,$.jsx)(s,{}),` Edit`]}),(0,$.jsxs)(v,{onClick:()=>we(e),children:[(0,$.jsx)(O,{}),` Duplicate`]}),(0,$.jsxs)(v,{onClick:()=>Ne(e),children:[(0,$.jsx)(k,{}),` Export`]}),(0,$.jsxs)(v,{onClick:()=>void Fe(e),children:[(0,$.jsx)(D,{}),` Copy JSON`]}),!e.builtIn&&(0,$.jsxs)(v,{onClick:()=>j(e.id),children:[(0,$.jsx)(C,{}),` Delete`]})]})]})})]}),n&&V?(0,$.jsx)(`div`,{className:`col-span-full`,children:(0,$.jsx)(mt,{source:V.source,draft:V.draft,onDraftChange:e=>S(e),onSave:De,onCancel:ke,resolvedVariant:m})}):null]},e.id)})})}),!t&&(0,$.jsx)(tt,{}),(0,$.jsxs)(K,{title:`Typography`,children:[(0,$.jsx)(J,{title:`Interface font`,description:`Normal app text, navigation, dialogs, and controls.`,resetAction:F(`fontFamilySans`)?(0,$.jsx)(Y,{label:`interface font`,onClick:()=>U(`fontFamilySans`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Interface font`,icon:(0,$.jsx)(Pe,{className:`size-3.5`}),options:I,value:P.fontFamilySans,sample:`The quick brown fox`,onChange:e=>_e(`fontFamilySans`,e)})}),t?null:(0,$.jsx)(J,{title:`Code font`,description:`Code blocks, diffs, file paths, and terminal surfaces.`,resetAction:F(`fontFamilyMono`)?(0,$.jsx)(Y,{label:`code font`,onClick:()=>U(`fontFamilyMono`)}):null,control:(0,$.jsx)(kt,{ariaLabel:`Code font`,icon:(0,$.jsx)(Oe,{className:`size-3.5`}),options:te,value:P.fontFamilyMono,sample:`const answer = 42`,onChange:e=>_e(`fontFamilyMono`,e)})}),(0,$.jsx)(J,{title:`Text size`,description:`Scale the interface independently from the active theme.`,resetAction:F(`fontSizeBase`)?(0,$.jsx)(Y,{label:`text size`,onClick:()=>U(`fontSizeBase`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Text size`,icon:(0,$.jsx)(Ee,{className:`size-3.5`}),options:ne,value:P.fontSizeBase,onChange:e=>_e(`fontSizeBase`,e),preview:(0,$.jsx)(`span`,{className:`flex h-9 min-w-14 items-center justify-center rounded-md border border-border/70 bg-background px-2 font-semibold text-foreground shadow-xs/5`,children:(0,$.jsx)(`span`,{style:{fontSize:P.fontSizeBase},children:`Aa`})})})})]}),(0,$.jsxs)(K,{title:`Interface`,children:[t?null:(0,$.jsx)(J,{title:`Corner radius`,description:`Adjust rounding for panels, buttons, inputs, and menus globally.`,resetAction:F(`radius`)?(0,$.jsx)(Y,{label:`corner radius`,onClick:()=>U(`radius`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Corner radius`,icon:(0,$.jsx)(Me,{className:`size-3.5`}),options:ie,value:P.radius,onChange:e=>_e(`radius`,e),preview:(0,$.jsxs)(`span`,{className:`grid h-9 min-w-14 grid-cols-2 gap-1 rounded-md border border-border/70 bg-background p-1.5 shadow-xs/5`,children:[(0,$.jsx)(`span`,{className:`border border-primary/55 bg-primary/15`,style:{borderRadius:P.radius}}),(0,$.jsx)(`span`,{className:`border border-muted-foreground/30 bg-muted`,style:{borderRadius:P.radius}})]})})}),(0,$.jsx)(J,{title:`Primary color`,description:`Theme palettes control buttons by default; enable a custom color to pin one app accent.`,resetAction:F(`primaryColorMode`)||F(`primaryColor`)?(0,$.jsx)(Y,{label:`primary color`,onClick:be}):null,control:(0,$.jsx)(At,{mode:P.primaryColorMode,value:P.primaryColor,onModeChange:G,onColorChange:Se})}),(0,$.jsx)(J,{title:`Transparency`,description:`Adjust glass and floating surfaces like dialogs, menus, popups, and toasts.`,resetAction:F(`surfaceTransparency`)?(0,$.jsx)(Y,{label:`transparency`,onClick:()=>U(`surfaceTransparency`)}):null,control:(0,$.jsx)(jt,{ariaLabel:`Transparency`,icon:(0,$.jsx)(Ae,{className:`size-3.5`}),options:ee,value:P.surfaceTransparency,onChange:e=>_e(`surfaceTransparency`,e),preview:(0,$.jsx)(`span`,{className:`relative h-9 min-w-14 overflow-hidden rounded-md border border-border/70 bg-[linear-gradient(135deg,var(--color-sky-500)_0_20%,var(--color-emerald-500)_20%_40%,var(--color-amber-500)_40%_60%,var(--color-fuchsia-500)_60%_80%,var(--color-slate-500)_80%_100%)] p-1.5 shadow-xs/5`,children:(0,$.jsx)(`span`,{className:`block h-full rounded border border-border/70 bg-popover`,style:{opacity:Dt[P.surfaceTransparency]??Dt.default}})})})})]}),(0,$.jsx)(r,{open:A!==null,onOpenChange:e=>{e||j(null)},children:(0,$.jsxs)(a,{children:[(0,$.jsxs)(u,{children:[(0,$.jsx)(o,{children:`Delete custom theme?`}),(0,$.jsx)(c,{children:pe?`"${pe.name}" will be removed permanently. This action cannot be undone.`:`This action cannot be undone.`})]}),(0,$.jsxs)(l,{children:[(0,$.jsx)(p,{render:(0,$.jsx)(M,{variant:`outline`}),children:`Cancel`}),(0,$.jsx)(M,{variant:`destructive`,onClick:je,children:`Delete theme`})]})]})})]})}function kt(e){let t=(0,Q.c)(43),{ariaLabel:n,icon:r,options:i,value:a,sample:o,onChange:s}=e,c;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>e.value===a,t[3]=a,t[4]=e),c=i.findIndex(e),t[0]=i,t[1]=a,t[2]=c}else c=t[2];let l=Math.max(0,c),u=i[l]??i[0],d;t[5]===r?d=t[6]:(d=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=d);let f=u?.value??a,p;t[7]===f?p=t[8]:(p={fontFamily:f},t[7]=f,t[8]=p);let m=u?.label??a,h;t[9]!==p||t[10]!==m?(h=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,style:p,children:m}),t[9]=p,t[10]=m,t[11]=h):h=t[11];let g=u?.description??`Custom`,_;t[12]===g?_=t[13]:(_=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:g}),t[12]=g,t[13]=_);let v;t[14]!==h||t[15]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[h,_]}),t[14]=h,t[15]=_,t[16]=v):v=t[16];let y;t[17]!==d||t[18]!==v?(y=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[d,v]}),t[17]=d,t[18]=v,t[19]=y):y=t[19];let b=u?.value??a,x;t[20]===b?x=t[21]:(x={fontFamily:b},t[20]=b,t[21]=x);let S;t[22]!==o||t[23]!==x?(S=(0,$.jsx)(`span`,{className:`flex h-9 min-w-30 max-w-44 items-center justify-start truncate rounded-md border border-border/70 bg-background px-2 text-xs text-foreground shadow-xs/5`,style:x,title:o,children:o}),t[22]=o,t[23]=x,t[24]=S):S=t[24];let C;t[25]!==y||t[26]!==S?(C=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[y,S]}),t[25]=y,t[26]=S,t[27]=C):C=t[27];let w;if(t[28]!==n||t[29]!==s||t[30]!==i||t[31]!==l){let e;t[33]!==n||t[34]!==s||t[35]!==l?(e=(e,t)=>{let r=t===l;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":r,"aria-label":`Use ${e.label} for ${n.toLowerCase()}`,title:`${e.label} (${e.description})`,onClick:()=>s(e.value),className:N(`min-h-12 min-w-0 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`),children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,style:{fontFamily:e.value},children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]},e.value)},t[33]=n,t[34]=s,t[35]=l,t[36]=e):e=t[36],w=i.map(e),t[28]=n,t[29]=s,t[30]=i,t[31]=l,t[32]=w}else w=t[32];let T;t[37]!==n||t[38]!==w?(T=(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":n,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-3`,children:w}),t[37]=n,t[38]=w,t[39]=T):T=t[39];let E;return t[40]!==C||t[41]!==T?(E=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[C,T]}),t[40]=C,t[41]=T,t[42]=E):E=t[42],E}function At(e){let t=(0,Q.c)(48),{mode:n,value:r,onModeChange:i,onColorChange:a}=e,o=n===`custom`,s;t[0]===r?s=t[1]:(s=/^#[0-9a-f]{6}$/i.test(r)?r.toLowerCase():R[0].value,t[0]=r,t[1]=s);let c=s,l;t[2]===c?l=t[3]:(l=R.find(e=>e.value===c),t[2]=c,t[3]=l);let u=l,d=o&&!u?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,f=!o&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`,p;t[4]!==d||t[5]!==f?(p=N(`h-12 w-full rounded-md border px-2 py-1.5 text-left shadow-none`,d,f),t[4]=d,t[5]=f,t[6]=p):p=t[6];let m=p,h;t[7]===c?h=t[8]:(h=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:c}}),t[7]=c,t[8]=h);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:`Custom`}),t[9]=_):_=t[9];let v;t[10]===c?v=t[11]:(v=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[_,(0,$.jsx)(`span`,{className:`block truncate font-mono text-[10px] leading-3 opacity-75`,children:c})]}),t[10]=c,t[11]=v);let y;t[12]!==h||t[13]!==v?(y=(0,$.jsxs)(`span`,{className:`flex size-full min-w-0 items-center gap-2`,children:[h,v]}),t[12]=h,t[13]=v,t[14]=y):y=t[14];let b=y,x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:(0,$.jsx)(A,{className:`size-3.5`})}),t[15]=x):x=t[15];let S=o?u?.label??`Custom`:`Theme color`,C;t[16]===S?C=t[17]:(C=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:S}),t[16]=S,t[17]=C);let w=o?c:`Active palette`,T;t[18]===w?T=t[19]:(T=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:w}),t[18]=w,t[19]=T);let E;t[20]!==C||t[21]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[x,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[C,T]})]}),t[20]=C,t[21]=T,t[22]=E):E=t[22];let D;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(`span`,{children:`Use theme`}),t[23]=D):D=t[23];let O=!o,k;t[24]===i?k=t[25]:(k=e=>i(!e),t[24]=i,t[25]=k);let j;t[26]!==O||t[27]!==k?(j=(0,$.jsxs)(`label`,{className:`flex h-9 shrink-0 items-center gap-2 rounded-md border border-border/70 bg-background px-2 text-xs text-muted-foreground shadow-xs/5`,children:[D,(0,$.jsx)(g,{checked:O,onCheckedChange:k,"aria-label":`Use theme primary color`})]}),t[26]=O,t[27]=k,t[28]=j):j=t[28];let M;t[29]!==E||t[30]!==j?(M=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[E,j]}),t[29]=E,t[30]=j,t[31]=M):M=t[31];let P;t[32]!==o||t[33]!==c||t[34]!==a?(P=R.map(e=>{let t=c===e.value;return(0,$.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":o&&t,"aria-label":`Use ${e.label} as primary color`,title:`${e.label} (${e.value})`,onClick:()=>a(e.value),disabled:!o,className:N(`flex min-h-12 min-w-0 items-center gap-2 rounded-md border px-2 py-1.5 text-left outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,o&&t?`border-primary bg-primary/8 text-foreground ring-1 ring-primary/35`:`border-border/70 text-muted-foreground hover:border-foreground/25 hover:bg-muted/45`,!o&&`cursor-not-allowed opacity-55 hover:border-border/70 hover:bg-transparent`),children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`size-5 shrink-0 rounded-full border border-black/10 shadow-xs dark:border-white/20`,style:{backgroundColor:e.value}}),(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block truncate text-[12px] font-semibold leading-4`,children:e.label}),(0,$.jsx)(`span`,{className:`block truncate text-[10px] leading-3 opacity-75`,children:e.description})]})]},e.value)}),t[32]=o,t[33]=c,t[34]=a,t[35]=P):P=t[35];let F;t[36]!==o||t[37]!==m||t[38]!==b||t[39]!==c||t[40]!==a?(F=o?(0,$.jsx)(Ze,{value:c,onChange:a,ariaLabel:`Pick custom primary color`,triggerClassName:m,children:b}):(0,$.jsx)(`button`,{type:`button`,disabled:!0,"aria-label":`Pick custom primary color`,className:m,children:b}),t[36]=o,t[37]=m,t[38]=b,t[39]=c,t[40]=a,t[41]=F):F=t[41];let I;t[42]!==P||t[43]!==F?(I=(0,$.jsxs)(`div`,{role:`radiogroup`,"aria-label":`Primary color`,className:`grid grid-cols-2 gap-1.5 sm:grid-cols-4`,children:[P,F]}),t[42]=P,t[43]=F,t[44]=I):I=t[44];let L;return t[45]!==M||t[46]!==I?(L=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[M,I]}),t[45]=M,t[46]=I,t[47]=L):L=t[47],L}function jt(e){let t=(0,Q.c)(50),{ariaLabel:n,icon:r,options:i,value:a,onChange:o,preview:s}=e,c;if(t[0]!==i||t[1]!==a){let e;t[3]===a?e=t[4]:(e=e=>e.value===a,t[3]=a,t[4]=e),c=i.findIndex(e),t[0]=i,t[1]=a,t[2]=c}else c=t[2];let l=Math.max(0,c),u=i[l]??i[0],d=i.length>1?l/(i.length-1)*100:0,f;t[5]===r?f=t[6]:(f=(0,$.jsx)(`span`,{className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/60 text-muted-foreground`,children:r}),t[5]=r,t[6]=f);let p=u?.label??a,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(`span`,{className:`block truncate text-sm font-semibold text-foreground`,children:p}),t[7]=p,t[8]=m);let h=u?.description??a,g;t[9]===h?g=t[10]:(g=(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:h}),t[9]=h,t[10]=g);let _;t[11]!==m||t[12]!==g?(_=(0,$.jsxs)(`span`,{className:`min-w-0`,children:[m,g]}),t[11]=m,t[12]=g,t[13]=_):_=t[13];let v;t[14]!==f||t[15]!==_?(v=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f,_]}),t[14]=f,t[15]=_,t[16]=v):v=t[16];let y;t[17]!==s||t[18]!==v?(y=(0,$.jsxs)(`div`,{className:`mb-2 flex min-h-9 items-center justify-between gap-3`,children:[v,s]}),t[17]=s,t[18]=v,t[19]=y):y=t[19];let b;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(b=N(`h-5 w-full cursor-pointer appearance-none bg-transparent outline-none`,`[&::-webkit-slider-runnable-track]:h-1.5 [&::-webkit-slider-runnable-track]:rounded-full`,`[&::-webkit-slider-thumb]:mt-[-5px] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-background [&::-webkit-slider-thumb]:bg-primary [&::-webkit-slider-thumb]:shadow-sm`,`[&::-moz-range-track]:h-1.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:border-0`,`[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-background [&::-moz-range-thumb]:bg-primary [&::-moz-range-thumb]:shadow-sm`,`focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-ring focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-ring`),t[20]=b):b=t[20];let x=Math.max(0,i.length-1),S=`linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) ${d}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) ${d}%, color-mix(in srgb, var(--color-muted-foreground) 18%, transparent) 100%)`,C;t[21]===S?C=t[22]:(C={background:S,borderRadius:`999px`},t[21]=S,t[22]=C);let w;t[23]!==o||t[24]!==i?(w=e=>{let t=i[Number(e.currentTarget.value)];t&&o(t.value)},t[23]=o,t[24]=i,t[25]=w):w=t[25];let T;t[26]!==n||t[27]!==l||t[28]!==x||t[29]!==C||t[30]!==w?(T=(0,$.jsx)(`input`,{"aria-label":n,className:b,max:x,min:0,step:1,type:`range`,value:l,style:C,onChange:w}),t[26]=n,t[27]=l,t[28]=x,t[29]=C,t[30]=w,t[31]=T):T=t[31];let E=`repeat(${i.length}, minmax(0, 1fr))`,D;t[32]===E?D=t[33]:(D={gridTemplateColumns:E},t[32]=E,t[33]=D);let O;if(t[34]!==n||t[35]!==o||t[36]!==i||t[37]!==l){let e;t[39]!==n||t[40]!==o||t[41]!==l?(e=(e,t)=>{let r=t===l;return(0,$.jsxs)(`button`,{type:`button`,"aria-label":`Set ${n.toLowerCase()} to ${e.label}`,title:`${e.label} (${e.description})`,onClick:()=>o(e.value),className:N(`flex min-h-7 min-w-0 flex-col items-center justify-start gap-1 rounded-md px-1 py-1 text-center outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring`,r?`text-foreground`:`text-muted-foreground hover:bg-muted/50`),children:[(0,$.jsx)(`span`,{className:N(`size-1.5 rounded-full`,r?`bg-primary`:`bg-muted-foreground/35`),"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`max-w-full truncate text-[10px] leading-none`,children:e.label})]},e.value)},t[39]=n,t[40]=o,t[41]=l,t[42]=e):e=t[42],O=i.map(e),t[34]=n,t[35]=o,t[36]=i,t[37]=l,t[38]=O}else O=t[38];let k;t[43]!==D||t[44]!==O?(k=(0,$.jsx)(`div`,{className:`mt-1.5 grid gap-1`,style:D,children:O}),t[43]=D,t[44]=O,t[45]=k):k=t[45];let A;return t[46]!==T||t[47]!==k||t[48]!==y?(A=(0,$.jsxs)(`div`,{className:`w-full sm:w-96`,children:[y,T,k]}),t[46]=T,t[47]=k,t[48]=y,t[49]=A):A=t[49],A}export{Ot as AppearanceSettingsPanel};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import"./primary-DjXNHNGV.js";import{Gi as n}from"./src-gDjuIvMO.js";import{Bn as r,Fn as i,Hn as a,In as o,Kn as s,Nn as c,Pn as l,Rn as u,Un as d,Vn as f,p,va as m,y as h,zn as g}from"./runtime-L56puJDA.js";import{Sn as _,xn as v}from"./switch-COrEGDkz.js";import{t as y}from"./compiler-runtime-qmuS0Svy.js";var b=y(),x=e(t(),1);function S(e){let t=(0,b.c)(13),n=f(e),{environmentId:r,cwd:i,query:s,enabled:c,limit:d,staleTime:p}=e,h,_;t[0]!==i||t[1]!==r||t[2]!==d?(h=()=>{if(r===null||i===null)return;let e={environmentId:r,cwd:i,...d===void 0?{}:{limit:d}};return a(e),()=>u(e)},_=[r,i,d],t[0]=i,t[1]=r,t[2]=d,t[3]=h,t[4]=_):(h=t[3],_=t[4]),(0,x.useEffect)(h,_);let v,y;t[5]!==i||t[6]!==c||t[7]!==r||t[8]!==d||t[9]!==s||t[10]!==p?(v=()=>{g({environmentId:r,cwd:i,query:s,...c===void 0?{}:{enabled:c},...d===void 0?{}:{limit:d},...p===void 0?{}:{staleTime:p}})},y=[r,i,s,c,d,p],t[5]=i,t[6]=c,t[7]=r,t[8]=d,t[9]=s,t[10]=p,t[11]=v,t[12]=y):(v=t[11],y=t[12]),(0,x.useEffect)(v,y);let S=m(o(n));return n===null?l:S}function C(e){let t=r(e),n=(0,x.useSyncExternalStore)(h,()=>e.environmentId===null?null:p(e.environmentId),()=>null),a=(0,x.useRef)(e);a.current=e,(0,x.useEffect)(()=>{let e=a.current,t=e.environmentId===null?void 0:s(e.environmentId,n?.client??null);return d(e,t??null)},[t,n]);let o=m(i(t));return t===null?c:o}function w(e){let t=e.trim().replace(/\.git$/i,``).replace(/\/+$/,``);if(!t||/^[a-z]:[\\/]/i.test(t)||t.startsWith(`\\\\`))return null;if(!t.includes(`://`)){let e=/^(?:[^@/]+@)?([^:/]+):(.+)$/.exec(t);return e?.[1]&&e[2]?`https://${e[1]}/${e[2].replace(/^\/+/,``)}`:null}try{let e=new URL(t.replace(/^(ssh|git|http):\/\//i,`https://`).replace(/^ssh:/i,`https:`));return!e.hostname||e.pathname===`/`||e.pathname===``?null:`https://${e.hostname}${e.pathname}`}catch{return null}}function T(e){if(!e)return null;let t=[e.locator?.remoteUrl,...(e.remotes??[]).map(e=>e.url)];for(let e of t){if(!e)continue;let t=w(e);if(t)return t}return null}n([`local`,`worktree`]);function E(e){let t=_(e.runtimeLabel),n=_(e.savedLabel);return e.isPrimary?[t,n].find(e=>e?!v(e):!1)??`This device`:t??n??e.environmentId}function D(e){let{activeWorktreePath:t,hasServerThread:n,draftThreadEnvMode:r}=e;return n?t?`worktree`:`local`:t?`local`:r===`worktree`?`worktree`:`local`}function O(e){let{nextWorktreePath:t,currentWorktreePath:n,effectiveEnvMode:r}=e;return t||r===`worktree`&&!n?`worktree`:`local`}function k(e){let{envMode:t,activeWorktreePath:n,activeThreadBranch:r,currentGitBranch:i}=e;return t===`worktree`&&!n?r??i:i??r}function A(e){let{activeProjectCwd:t,activeWorktreePath:n,refName:r}=e;if(r.worktreePath)return{checkoutCwd:r.worktreePath,nextWorktreePath:r.worktreePath===t?null:r.worktreePath,reuseExistingWorktree:!0};let i=n!==null&&r.isDefault?null:n;return{checkoutCwd:i??t,nextWorktreePath:i,reuseExistingWorktree:!1}}function j(e){let{itemValue:t,normalizedQuery:n,createBranchItemValue:r,checkoutPullRequestItemValue:i}=e;if(n.length===0||r&&t===r||i&&t===i)return!0;let a=e.searchTextByItemValue?.get(t);return a===void 0?t.toLowerCase().includes(n):a.toLowerCase().includes(n)}export{D as a,C as c,O as i,S as l,A as n,E as o,k as r,j as s,T as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{Ut as n}from"./primary-DjXNHNGV.js";import{ia as r,mi as i}from"./runtime-L56puJDA.js";import{Zn as a,cr as o,qn as s}from"./switch-COrEGDkz.js";import{t as c}from"./compiler-runtime-qmuS0Svy.js";import{t as l}from"./arrow-left-gLRAasih.js";import{t as u}from"./arrow-right-CAK2t4QL.js";import{t as d}from"./loader-circle-D0CNb5GI.js";import{t as f}from"./star-BjaAYD-x.js";import{t as p}from"./x-_SjFRYll.js";import{t as m}from"./button-QrCU0tNP.js";import{Gt as h}from"./main-DaXSCt8g.js";var g=c(),_=e(t(),1),v=r();function y(e){let t=(0,g.c)(14),{tab:n,width:r}=e,i=(0,_.useRef)(null),[a,o]=(0,_.useState)(null),s=window.desktopBridge?.browser,c=n.presentation===`window`,l,u;t[0]!==c||t[1]!==n.id?(l=()=>{if(!s||!i.current||c)return;let e=crypto.randomUUID(),t=0,r=!1,a=``,l=0,u=()=>{if(t=0,r||!i.current)return;let c=i.current.getBoundingClientRect(),d=![...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [data-slot="popover-popup"], [role="menu"]`)].some(e=>!e.contains(i.current))&&document.visibilityState===`visible`&&c.width>=1&&c.height>=1&&c.left>=0&&c.top>=0&&c.left<innerWidth&&c.top<innerHeight&&!i.current.closest(`[inert], [aria-hidden="true"]`),f={owner:e,tab:d?n.id:null,x:Math.max(0,c.left),y:Math.max(0,c.top),width:Math.max(1,Math.min(c.width,innerWidth-c.left)),height:Math.max(1,Math.min(c.height,innerHeight-c.top))},p=JSON.stringify(f);p!==a&&(a=p,s.surface(f).catch(e=>{r||o(e instanceof Error?e.message:`Browser surface unavailable.`)})),performance.now()<l&&(t=requestAnimationFrame(u))},d=()=>{!t&&!r&&(t=requestAnimationFrame(u))},f=()=>{l=performance.now()+500,d()},p=new ResizeObserver(d);p.observe(i.current);let m=new MutationObserver(d);return m.observe(document.body,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`inert`,`aria-hidden`,`data-state`]}),window.addEventListener(`resize`,f),document.addEventListener(`scroll`,d,!0),document.addEventListener(`visibilitychange`,d),document.addEventListener(`transitionrun`,f,!0),f(),()=>{r=!0,cancelAnimationFrame(t),p.disconnect(),m.disconnect(),window.removeEventListener(`resize`,f),document.removeEventListener(`scroll`,d,!0),document.removeEventListener(`visibilitychange`,d),document.removeEventListener(`transitionrun`,f,!0),s.surface({owner:e,tab:null,x:0,y:0,width:1,height:1}).catch(b)}},u=[s,n.id,c],t[0]=c,t[1]=n.id,t[2]=l,t[3]=u):(l=t[2],u=t[3]),(0,_.useEffect)(l,u);let d=r??`100%`,f;t[4]===d?f=t[5]:(f={width:d,maxWidth:`100%`,height:`100%`},t[4]=d,t[5]=f);let p;t[6]!==a||t[7]!==n.id||t[8]!==n.title||t[9]!==n.url?(p=s?a?(0,v.jsx)(`p`,{role:`alert`,className:`p-4 text-sm text-destructive`,children:a}):null:(0,v.jsx)(`iframe`,{title:n.title||`Browser preview`,src:n.url,sandbox:`allow-scripts allow-forms`,referrerPolicy:`no-referrer`,className:`size-full border-0`},n.id+n.url),t[6]=a,t[7]=n.id,t[8]=n.title,t[9]=n.url,t[10]=p):p=t[10];let m;return t[11]!==f||t[12]!==p?(m=(0,v.jsx)(`div`,{className:`flex min-h-0 flex-1 justify-center overflow-hidden bg-muted/30`,children:(0,v.jsx)(`div`,{ref:i,className:`relative min-h-0 bg-white`,style:f,children:p})}),t[11]=f,t[12]=p,t[13]=m):m=t[13],m}function b(){}var x=n(e=>({native:{tabs:[]},fallback:[],selected:{},setNative:t=>e({native:t}),select:(t,n)=>e(e=>({selected:{...e.selected,[t]:n}})),openFallback:(t,n)=>{let r=crypto.randomUUID();return e(e=>({fallback:[...e.fallback,{id:r,project:n,url:t,title:new URL(t).host,loading:!1,canGoBack:!1,canGoForward:!1,zoom:1,presentation:`panel`,error:null}],selected:{...e.selected,[n]:r}})),r},closeFallback:t=>e(e=>({fallback:e.fallback.filter(e=>e.id!==t)})),navigateFallback:(t,n)=>e(e=>({fallback:e.fallback.map(e=>e.id===t?{...e,url:n,title:new URL(n).host}:e)}))})),S=0,C,w=0;function T(e){let t=window.desktopBridge?.browser;(0,_.useEffect)(()=>{if(t){if(S++===0){let e=++w,n=!1;C=t.onState(e=>{n=!0,x.getState().setNative(e)}),t.getState().then(t=>{!n&&S&&e===w&&x.getState().setNative(t)}).catch(()=>{})}return()=>{--S===0&&(w++,C?.(),C=void 0)}}},[t]);let n=x(e=>t?e.native.tabs:e.fallback),r=x(t=>t.selected[e]),i=n.filter(t=>t.project===e||t.project===``);return{tabs:i,selected:i.find(e=>e.id===r)??i[0]??null,api:t}}function E(e,t){return JSON.stringify([e,t])}function D(e){let t=e.trim(),n=new URL(/^[a-z][a-z\d+.-]*:\/\//iu.test(t)?t:`http://${t}`);if(![`http:`,`https:`].includes(n.protocol)||n.username||n.password||!n.hostname)throw Error(`Enter an HTTP(S) URL without embedded credentials.`);return n.href}function O({environmentId:e,cwd:t}){let n=E(e,t),{tabs:r,selected:c,api:g}=T(n),b=(0,_.useRef)(null),[S,C]=(0,_.useState)(``),[w,O]=(0,_.useState)(null),[k,A]=(0,_.useState)(!1),[j,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)(null),F;try{let n=window.desktopBridge?.getLocalEnvironmentBootstrap()?.httpBaseUrl,r=e?i(e):null;n&&r&&new URL(n).origin===new URL(r).origin&&(F=t??void 0)}catch{}let[I,L]=(0,_.useState)([]),[R,z]=(0,_.useState)(!1),B=(0,_.useRef)({generation:0}).current,[V,H]=(0,_.useState)([]),U=j?null:c,W=U===null;(0,_.useEffect)(()=>g?.onFocusAddress(e=>{e===U?.id&&(b.current?.focus(),b.current?.select())}),[g,U?.id]),(0,_.useEffect)(()=>{C(U?.url??``)},[U?.id,U?.url]),(0,_.useEffect)(()=>{M(!1);try{let e=JSON.parse(localStorage.getItem(`ryco:browser-sites:${n}`)??`[]`);H(Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,20):[])}catch{H([])}},[n]);let G=async e=>{O(null);try{await e()}catch(e){O(e instanceof Error?e.message:`Browser request failed.`)}},K=(0,_.useCallback)(async()=>{if(!g)return;let e=++B.generation;z(!0);try{let t=await g.discover(F);e===B.generation&&L(t)}catch(t){e===B.generation&&O(t instanceof Error?t.message:`Discovery failed.`)}finally{e===B.generation&&z(!1)}},[g,F,B]);(0,_.useEffect)(()=>(L([]),W&&g&&K(),()=>{B.generation++}),[W,g,K,B,n]);let q=async e=>{let t=D(e);A(!0);try{if(g){let e=await g.open({url:t,project:n});x.getState().select(n,e)}else x.getState().openFallback(t,n);M(!1)}finally{A(!1)}},J=(e,t={})=>{g&&U&&G(()=>g.command({...t,action:e,tab:U.id}))};return(0,v.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,"aria-label":`Project browser`,children:[(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b p-1`,role:`tablist`,"aria-label":`Browser tabs`,children:[r.map(e=>(0,v.jsxs)(`div`,{className:`flex min-w-0 max-w-44 shrink-0 items-center rounded bg-muted/40`,children:[(0,v.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":U?.id===e.id,className:`flex min-w-0 items-center gap-1.5 px-2 py-1.5 text-xs`,onClick:()=>{x.getState().select(n,e.id),M(!1)},children:[e.loading?(0,v.jsx)(d,{className:`size-3 shrink-0 animate-spin`}):(0,v.jsx)(a,{className:`size-3 shrink-0`}),(0,v.jsx)(`span`,{className:`truncate`,children:e.title||e.url||`Loading…`})]}),(0,v.jsx)(`button`,{type:`button`,"aria-label":`Close ${e.title||`browser tab`}`,className:`p-1 text-muted-foreground hover:text-foreground`,onClick:()=>void G(()=>g?g.command({action:`close`,tab:e.id}):Promise.resolve(x.getState().closeFallback(e.id))),children:(0,v.jsx)(p,{className:`size-3`})})]},e.id)),(0,v.jsx)(m,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"aria-label":`New browser tab`,onClick:()=>{M(!0),C(``)},children:(0,v.jsx)(h,{className:`size-3.5`})})]}),(0,v.jsxs)(`form`,{className:`flex shrink-0 items-center gap-1 border-b p-2`,onSubmit:e=>{e.preventDefault(),G(async()=>{if(U){let e=D(S);g?await g.command({action:`navigate`,tab:U.id,url:e}):x.getState().navigateFallback(U.id,e)}else await q(S)})},children:[(0,v.jsx)(m,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Back`,disabled:!g||!U?.canGoBack,onClick:()=>J(`back`),children:(0,v.jsx)(l,{className:`size-3.5`})}),(0,v.jsx)(m,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Forward`,disabled:!g||!U?.canGoForward,onClick:()=>J(`forward`),children:(0,v.jsx)(u,{className:`size-3.5`})}),(0,v.jsx)(m,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":U?.loading?`Stop loading`:`Reload`,disabled:!g||!U,onClick:()=>J(U?.loading?`stop`:`reload`),children:U?.loading?(0,v.jsx)(p,{className:`size-3.5`}):(0,v.jsx)(s,{className:`size-3.5`})}),(0,v.jsx)(`input`,{ref:b,"aria-label":`Browser address`,className:`h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-xs`,placeholder:`Enter a URL or localhost:3000`,value:S,onChange:e=>C(e.target.value),onFocus:e=>e.currentTarget.select()}),(0,v.jsx)(m,{type:`submit`,size:`sm`,variant:`outline`,disabled:k,children:`Go`}),(0,v.jsx)(m,{type:`button`,size:`icon`,variant:`ghost`,className:`size-7`,disabled:!U?.url,"aria-label":`Save project URL`,"aria-pressed":!!(U&&V.includes(U.url)),onClick:()=>{if(!U?.url)return;let e=V.includes(U.url)?V.filter(e=>e!==U.url):[U.url,...V].slice(0,20);try{localStorage.setItem(`ryco:browser-sites:${n}`,JSON.stringify(e)),H(e)}catch{O(`Could not save this URL.`)}},children:(0,v.jsx)(f,{className:`size-3.5`})})]}),U?(0,v.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b px-2 py-1 text-[11px] text-muted-foreground`,children:[(0,v.jsxs)(`select`,{"aria-label":`Browser viewport`,className:`bg-background`,value:N??`auto`,onChange:e=>P(e.target.value===`auto`?null:Number(e.target.value)),children:[(0,v.jsx)(`option`,{value:`auto`,children:`Responsive`}),(0,v.jsx)(`option`,{value:`390`,children:`Phone · 390px`}),(0,v.jsx)(`option`,{value:`768`,children:`Tablet · 768px`}),(0,v.jsx)(`option`,{value:`1280`,children:`Desktop · 1280px`})]}),g?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`select`,{"aria-label":`Browser zoom`,className:`bg-background`,value:U.zoom,onChange:e=>J(`zoom`,{zoom:Number(e.target.value)}),children:[.5,.75,1,1.25,1.5,2].map(e=>(0,v.jsxs)(`option`,{value:e,children:[e*100,`%`]},e))}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`devtools`),children:`DevTools`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>J(`popout`),children:`Pop out`}),(0,v.jsx)(`button`,{type:`button`,onClick:()=>void G(()=>window.desktopBridge?.computerUse?.stop()??Promise.resolve()),children:`Stop agent`})]}):(0,v.jsx)(`span`,{children:`Web preview · sites may restrict embedding`}),(0,v.jsxs)(`a`,{href:U.url,target:`_blank`,rel:`noreferrer`,className:`ml-auto inline-flex items-center gap-1`,"aria-label":`Open in external browser`,children:[(0,v.jsx)(o,{className:`size-3`}),`External`]})]}):null,w||U?.error?(0,v.jsx)(`p`,{role:`alert`,className:`border-b p-2 text-xs text-destructive`,children:w??U?.error}):null,U?U.presentation===`window`?(0,v.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 text-sm`,children:[(0,v.jsx)(`p`,{children:`This tab is open in a separate window.`}),(0,v.jsx)(m,{variant:`outline`,onClick:()=>J(`dock`),children:`Bring back into Ryco`})]}):(0,v.jsx)(y,{tab:U,width:N}):(0,v.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-5`,children:[(0,v.jsx)(a,{className:`mb-3 size-7 text-muted-foreground`}),(0,v.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Your project, live`}),(0,v.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Enter an address above, or choose a site below. Agents can use these same tabs through Ryco Browser.`}),(0,v.jsx)(`p`,{className:`mt-2 truncate text-[11px] text-muted-foreground`,title:t??void 0,children:t??`No project selected`}),V.length?(0,v.jsxs)(`div`,{className:`mt-5`,children:[(0,v.jsx)(`h4`,{className:`mb-2 text-xs font-medium`,children:`Saved for this project`}),V.map(e=>(0,v.jsx)(`button`,{type:`button`,className:`block w-full truncate rounded px-2 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e)),children:e},e))]}):null,(0,v.jsxs)(`div`,{className:`mt-5 flex items-center justify-between`,children:[(0,v.jsx)(`h4`,{className:`text-xs font-medium`,children:`Services on this computer`}),(0,v.jsx)(m,{variant:`ghost`,size:`sm`,disabled:!g||R,onClick:()=>void K(),children:R?`Finding…`:`Refresh`})]}),g?!I.length&&!R?(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`No local HTTP services found. Start your project’s dev server, then refresh.`}):I.map(e=>(0,v.jsxs)(`button`,{type:`button`,disabled:k,className:`mt-1 flex w-full items-center justify-between rounded border border-border/60 px-3 py-2 text-left text-xs hover:bg-accent`,onClick:()=>void G(()=>q(e.url)),children:[(0,v.jsx)(`span`,{children:e.url}),(0,v.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.projectMatch?`This project · `:``,e.process]})]},e.url)):(0,v.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:`Local port discovery is available in Ryco desktop. For remote projects, enter a reachable or forwarded URL.`}),k?(0,v.jsx)(`p`,{role:`status`,className:`mt-3 text-xs`,children:`Opening page…`}):null]})]})}export{O as BrowserPanel};