ryco-cli 0.1.24 → 0.1.25

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 (200) hide show
  1. package/dist/{AcpNativeLogging-COepku4a.cjs → AcpNativeLogging-CA6XYzIS.cjs} +1 -1
  2. package/dist/{AcpNativeLogging-D7e1dn7s.mjs → AcpNativeLogging-D4-VoHrq.mjs} +1 -1
  3. package/dist/{AzureDevOpsSourceControlProvider-BNGEg1R8.mjs → AzureDevOpsSourceControlProvider-B_E0XXfD.mjs} +2 -2
  4. package/dist/{AzureDevOpsSourceControlProvider-CrvgKNf2.cjs → AzureDevOpsSourceControlProvider-COmd21c-.cjs} +2 -2
  5. package/dist/{BitbucketSourceControlProvider-BzhsQwH-.cjs → BitbucketSourceControlProvider-CD8IvXQK.cjs} +2 -2
  6. package/dist/{BitbucketSourceControlProvider-Bt21jw68.mjs → BitbucketSourceControlProvider-pUKsNXcg.mjs} +2 -2
  7. package/dist/{ClaudeDriver-C4yu7Jit.mjs → ClaudeDriver-CGifBixr.mjs} +2 -2
  8. package/dist/{ClaudeDriver-B7mbf51W.cjs → ClaudeDriver-Dry5uJfX.cjs} +2 -2
  9. package/dist/{CodexDriver-CR0S17Lb.cjs → CodexDriver-BzR8gA8w.cjs} +3 -3
  10. package/dist/{CodexDriver-DnnqkGoY.mjs → CodexDriver-V4CL9APE.mjs} +3 -3
  11. package/dist/{CodexTextGeneration-tlfe1S5W.cjs → CodexTextGeneration-DTrSzY-I.cjs} +1 -1
  12. package/dist/{CodexTextGeneration-Cw-FZbSS.mjs → CodexTextGeneration-DoCidwvI.mjs} +1 -1
  13. package/dist/{CopilotDriver-GxKLX5pL.mjs → CopilotDriver-Dt13X60f.mjs} +3 -3
  14. package/dist/{CopilotDriver-IBd27Ji2.cjs → CopilotDriver-rLcA8PSN.cjs} +3 -3
  15. package/dist/{CursorDriver-C4Enoe9N.cjs → CursorDriver-C3s-8s9F.cjs} +3 -3
  16. package/dist/{CursorDriver-CNo9Uzo8.mjs → CursorDriver-HIPUs7cz.mjs} +3 -3
  17. package/dist/{ForgejoSourceControlProvider-BGXysSX6.mjs → ForgejoSourceControlProvider-CmvOAzEG.mjs} +2 -2
  18. package/dist/{ForgejoSourceControlProvider-Dh6DOoc8.cjs → ForgejoSourceControlProvider-JgiyrMqp.cjs} +2 -2
  19. package/dist/{GitHubSourceControlProvider-CPCYV8Xo.mjs → GitHubSourceControlProvider-BYuvbcBf.mjs} +2 -2
  20. package/dist/{GitHubSourceControlProvider-8hsv_kCE.cjs → GitHubSourceControlProvider-CItCpOcC.cjs} +2 -2
  21. package/dist/{GitLabSourceControlProvider-B0ZbF9Zx.cjs → GitLabSourceControlProvider-CMce22nU.cjs} +2 -2
  22. package/dist/{GitLabSourceControlProvider-Bvknpaon.mjs → GitLabSourceControlProvider-DZzEaVSi.mjs} +2 -2
  23. package/dist/{GrokDriver-DSPEmiwq.mjs → GrokDriver-CduUwiOH.mjs} +3 -3
  24. package/dist/{GrokDriver-RyyFeh_q.cjs → GrokDriver-D0jraOC_.cjs} +3 -3
  25. package/dist/{OpenCodeDriver-0q44rSQX.mjs → OpenCodeDriver-Bz_uJdMA.mjs} +2 -2
  26. package/dist/{OpenCodeDriver-CDcvPT9v.cjs → OpenCodeDriver-DxGpgtDS.cjs} +2 -2
  27. package/dist/{SourceControlProviderDiscoveryCatalog-DreaAH1H.cjs → SourceControlProviderDiscoveryCatalog-Dm_lhrhv.cjs} +1 -1
  28. package/dist/{SourceControlProviderDiscoveryCatalog-B37RHe2u.mjs → SourceControlProviderDiscoveryCatalog-ZtwPWoxE.mjs} +1 -1
  29. package/dist/bin.cjs +291 -176
  30. package/dist/bin.mjs +291 -176
  31. package/dist/client/assets/AccountSettings-Bv57-JYy.js +1 -0
  32. package/dist/client/assets/{AiFocusSettings-CNmGHEcA.js → AiFocusSettings-DCPHmJpA.js} +1 -1
  33. package/dist/client/assets/{AnimatedHeight-i0YhvlGD.js → AnimatedHeight-DPqb09B0.js} +1 -1
  34. package/dist/client/assets/{AppearanceSettings-BG8W4DP0.js → AppearanceSettings-EmTrtb_U.js} +1 -1
  35. package/dist/client/assets/{BranchToolbar.logic-AgPy06Mx.js → BranchToolbar.logic-CHRK3hDt.js} +1 -1
  36. package/dist/client/assets/{BrowserPanel-BWztlNuL.js → BrowserPanel-2Xu08il5.js} +1 -1
  37. package/dist/client/assets/ChatRightPanel-C1VD6GCV.js +194 -0
  38. package/dist/client/assets/{ChatThreadRouteView-CWoBLzR_.js → ChatThreadRouteView-CNww3i2J.js} +1 -1
  39. package/dist/client/assets/CommandPaletteDialog-B_f3fKp7.js +1 -0
  40. package/dist/client/assets/{CompositeRoot-C1G-Ejus.js → CompositeRoot-B40iitmH.js} +1 -1
  41. package/dist/client/assets/ComputerUseSettings-BJs7jqR0.js +1 -0
  42. package/dist/client/assets/ConnectionsSettings-B9nfvgLG.js +7 -0
  43. package/dist/client/assets/ContextHandoffEndpointLabel-BSQOArMR.js +4 -0
  44. package/dist/client/assets/{DiagnosticsSettings-DvnNz2AZ.js → DiagnosticsSettings-BmrqOKMe.js} +1 -1
  45. package/dist/client/assets/{DialogHandle-8o3kfoiI.js → DialogHandle-pelzaaiH.js} +1 -1
  46. package/dist/client/assets/{DialogPopup-CLw6NCkW.js → DialogPopup-BLM0vN4N.js} +1 -1
  47. package/dist/client/assets/DialogRoot-CY6ZzEUS.js +1 -0
  48. package/dist/client/assets/{DialogTitle-DCHX74Tz.js → DialogTitle-BvIjMtMm.js} +1 -1
  49. package/dist/client/assets/{DialogTrigger-Bl_fcIV2.js → DialogTrigger-CIeVAA-a.js} +1 -1
  50. package/dist/client/assets/{DialogViewport-DVDl03yd.js → DialogViewport-Cz0OadGI.js} +1 -1
  51. package/dist/client/assets/{DraftChatThreadRouteView-CEDYjbKq.js → DraftChatThreadRouteView-DMIGMESb.js} +1 -1
  52. package/dist/client/assets/{ExternalIdentityWeb.logic-arHvT6AX.js → ExternalIdentityWeb.logic-3rlDV7lT.js} +1 -1
  53. package/dist/client/assets/{GlassSurface-GY6owikG.js → GlassSurface-CEVIdyfP.js} +1 -1
  54. package/dist/client/assets/{HostedConnectionControls-COUhSe9x.js → HostedConnectionControls-r9cyZPyF.js} +1 -1
  55. package/dist/client/assets/HostedHubRoot-BkfafJ5x.js +2 -0
  56. package/dist/client/assets/{HostedNativeAuthorizationRoute-DZhYxv--.js → HostedNativeAuthorizationRoute-CqHuW853.js} +2 -2
  57. package/dist/client/assets/HostedNodeRenameDialog-C7m-nvTj.js +1 -0
  58. package/dist/client/assets/{HostedRelayTrustNotice-Bl6On0Yi.js → HostedRelayTrustNotice-DNZQyAX0.js} +1 -1
  59. package/dist/client/assets/IntegrationsSettingsPanel-hul3ysgL.js +2 -0
  60. package/dist/client/assets/{KeybindingsSettings-CPtXx-W2.js → KeybindingsSettings-Cme6omBM.js} +1 -1
  61. package/dist/client/assets/{LazyBrowserPanel-SUIBB7B4.js → LazyBrowserPanel-COJFwNK7.js} +2 -2
  62. package/dist/client/assets/{McpServersSettings-BWIUud0Z.js → McpServersSettings-CPeNF8_u.js} +4 -4
  63. package/dist/client/assets/{MobileSheet-NTayGHF6.js → MobileSheet-BZo-RAfm.js} +1 -1
  64. package/dist/client/assets/{NodeSecuritySettings-BFifrshE.js → NodeSecuritySettings-CwT5nEW9.js} +1 -1
  65. package/dist/client/assets/{OpinionatedPluginsSettings-D7WuuNWZ.js → OpinionatedPluginsSettings-D8A1CbMG.js} +1 -1
  66. package/dist/client/assets/{PhoneGetAppInterstitial-R0cqI17q.js → PhoneGetAppInterstitial-BBnGXVkR.js} +1 -1
  67. package/dist/client/assets/PhoneHome-BTKOPVjw.js +1 -0
  68. package/dist/client/assets/PhoneSettingsSurface-DdVCndyt.js +2 -0
  69. package/dist/client/assets/{ProviderModelPicker-dwWhl7Uf.js → ProviderModelPicker-DoYEUZrn.js} +1 -1
  70. package/dist/client/assets/ProvidersSettingsPanel-ldDCPVIY.js +1 -0
  71. package/dist/client/assets/{QuitShortcutFeedback-CklL3jMd.js → QuitShortcutFeedback-mF7X0WMD.js} +1 -1
  72. package/dist/client/assets/{RedactedSensitiveText-CLPBtvH1.js → RedactedSensitiveText-DovqFcmM.js} +1 -1
  73. package/dist/client/assets/RootAppShell-CzmEWO9w.js +7 -0
  74. package/dist/client/assets/{Separator-CpYBhf-I.js → Separator-BhAVTIOc.js} +1 -1
  75. package/dist/client/assets/SettingsDialog-ByXgBN0U.js +2 -0
  76. package/dist/client/assets/SettingsPanels-Bgf4vkrJ.js +3 -0
  77. package/dist/client/assets/{SettingsPanels.editor-9pSZP875.js → SettingsPanels.editor-d-rVlbeN.js} +1 -1
  78. package/dist/client/assets/SourceControlSettings-dKw0FaN1.js +1 -0
  79. package/dist/client/assets/{StatisticsPage-C7v-6CTr.js → StatisticsPage-C2RuqDIK.js} +1 -1
  80. package/dist/client/assets/{StatisticsPanel-CeIjiBm8.js → StatisticsPanel-DqoXnrhQ.js} +1 -1
  81. package/dist/client/assets/{StatisticsSettingsLink-5s_violW.js → StatisticsSettingsLink-C_f31sb4.js} +1 -1
  82. package/dist/client/assets/{ThreadTerminalDrawer-CHZ60lPI.js → ThreadTerminalDrawer-DaLrSTn9.js} +11 -11
  83. package/dist/client/assets/{ThreadWorkspacePanel-Ct5kMcuY.js → ThreadWorkspacePanel-BvRZIxZQ.js} +17 -17
  84. package/dist/client/assets/{activity-BMBx2Fu0.js → activity-bn_fBQGf.js} +1 -1
  85. package/dist/client/assets/{alert-CXnC_RJc.js → alert-BmLJh6DH.js} +1 -1
  86. package/dist/client/assets/{appChrome-BzM66lXM.js → appChrome-Dy57Ve9N.js} +1 -1
  87. package/dist/client/assets/{arrow-left-CymyVbCi.js → arrow-left-pzj1cbX3.js} +1 -1
  88. package/dist/client/assets/{arrow-right-9wyq4YVq.js → arrow-right-BW5jU-vo.js} +1 -1
  89. package/dist/client/assets/{arrow-up-right-mfU38K6p.js → arrow-up-right-AfC5AaSO.js} +1 -1
  90. package/dist/client/assets/authorization-7xVVtCBu.js +1 -0
  91. package/dist/client/assets/{badge-Dg7mXiOh.js → badge-DnBuGHGL.js} +1 -1
  92. package/dist/client/assets/{bot-BR3RyOWP.js → bot-CsKkSRlb.js} +1 -1
  93. package/dist/client/assets/{capabilities-C8sxDbKT.js → capabilities-DskyVNd2.js} +1 -1
  94. package/dist/client/assets/{chart-column-CcRi3pAd.js → chart-column-DhvWXIiH.js} +1 -1
  95. package/dist/client/assets/chevron-right-CITtTwME.js +1 -0
  96. package/dist/client/assets/{clipboard-copy-ezz8rnaT.js → clipboard-copy-fJnfdl4H.js} +1 -1
  97. package/dist/client/assets/{data-list-ZLhzdlED.js → data-list-_E-Al1sf.js} +1 -1
  98. package/dist/client/assets/{desktopWorkspace-P28r2lN2.js → desktopWorkspace-DycXKuMm.js} +1 -1
  99. package/dist/client/assets/{download-BA9L9tK9.js → download-CLQzE1di.js} +1 -1
  100. package/dist/client/assets/{editorPreferences-DeKdSV3s.js → editorPreferences-Bg624RVT.js} +1 -1
  101. package/dist/client/assets/{empty-3NpXLnAM.js → empty-YXFtCUDN.js} +1 -1
  102. package/dist/client/assets/{group-D5qBdsaB.js → group-DOCkUmuY.js} +1 -1
  103. package/dist/client/assets/{hostedConnectionCoordinator-CLV-JD1S.js → hostedConnectionCoordinator-JZ1dLx4v.js} +1 -1
  104. package/dist/client/assets/{hubRoutes-EWJ3Gdod.js → hubRoutes-C2S5of9_.js} +1 -1
  105. package/dist/client/assets/{index-DxCd1PgA.js → index-CvRFRkBK.js} +2 -2
  106. package/dist/client/assets/{input-DrOL1KPS.js → input-C2xv8mMt.js} +1 -1
  107. package/dist/client/assets/{kbd-rWDjJnWX.js → kbd-4-4mGdIa.js} +1 -1
  108. package/dist/client/assets/{key-round-D2DtQ7aS.js → key-round-CYcb9lAa.js} +1 -1
  109. package/dist/client/assets/{layers-DtSJWmwy.js → layers-CGlOWYxu.js} +1 -1
  110. package/dist/client/assets/{log-out-YAp9fsOg.js → log-out-CZW2EpNJ.js} +1 -1
  111. package/dist/client/assets/{logging-BuUPX1SP.js → logging-BpmZOfmu.js} +1 -1
  112. package/dist/client/assets/main-CC-U8LrA.css +2 -0
  113. package/dist/client/assets/main-CzDOnLFw.js +9 -0
  114. package/dist/client/assets/{palette-D18VboLH.js → palette-CQOuNfSO.js} +1 -1
  115. package/dist/client/assets/{play-d3KUi4G6.js → play-CPVy9wwV.js} +1 -1
  116. package/dist/client/assets/primary-CjhRI8fe.js +2 -0
  117. package/dist/client/assets/providerDriverMeta-BVHpFupf.js +1 -0
  118. package/dist/client/assets/providerModels-BsybzP4P.js +1 -0
  119. package/dist/client/assets/{qr-code-Bk1kdf_k.js → qr-code-BPqDlVMn.js} +1 -1
  120. package/dist/client/assets/{qr-code-MAZkoKtL.js → qr-code-C6BVTc4V.js} +1 -1
  121. package/dist/client/assets/{radio-group-D-VCGinX.js → radio-group-C8qudOQH.js} +2 -2
  122. package/dist/client/assets/{refresh-cw-DY3_Ph-S.js → refresh-cw-B5Cz1z3e.js} +1 -1
  123. package/dist/client/assets/runtime-Bxg7k81u.js +17 -0
  124. package/dist/client/assets/{save-ugJXuJRM.js → save-C7zM6ey6.js} +1 -1
  125. package/dist/client/assets/{scroll-area-BMnGzd2a.js → scroll-area-5OU_pvTW.js} +1 -1
  126. package/dist/client/assets/{scrollEdges-QLSFwGSQ.js → scrollEdges-qnEXfIOg.js} +1 -1
  127. package/dist/client/assets/{separator-BwUYkCkX.js → separator-B5HfRiaO.js} +1 -1
  128. package/dist/client/assets/{settingsLayout-C6SUmJVB.js → settingsLayout-CfKq88KD.js} +1 -1
  129. package/dist/client/assets/{sheet-DLy4aeVa.js → sheet-B9gQDy_I.js} +1 -1
  130. package/dist/client/assets/{shield-alert-DfUhTI4-.js → shield-alert-7yBlEyOs.js} +1 -1
  131. package/dist/client/assets/{shield-check-CO4SMhAs.js → shield-check-CnKgVJ0F.js} +1 -1
  132. package/dist/client/assets/{shield-Zq_ygsnJ.js → shield-rdjnBE2Q.js} +1 -1
  133. package/dist/client/assets/{sidebar-DNnW-a2V.js → sidebar-BdvL1Pbj.js} +1 -1
  134. package/dist/client/assets/sidebarProjectFolders-BH8XBqNe.js +4 -0
  135. package/dist/client/assets/{sidebarStatusText-CawrXnx0.js → sidebarStatusText-CZKsUFBD.js} +1 -1
  136. package/dist/client/assets/{skeleton-DRm4_OvB.js → skeleton-CoyLqyaB.js} +1 -1
  137. package/dist/client/assets/{smartphone-O2VACDhU.js → smartphone-CBgpMHXR.js} +1 -1
  138. package/dist/client/assets/{sparkles-isHutYWU.js → sparkles-w-UZXQx1.js} +1 -1
  139. package/dist/client/assets/src-Bi-5Nw9C.js +14 -0
  140. package/dist/client/assets/{star-7UHEnC3x.js → star-BZ-RtSFD.js} +1 -1
  141. package/dist/client/assets/switch-CEJEmLe7.js +48 -0
  142. package/dist/client/assets/{toggle-CaKBNe6W.js → toggle-DVGrNHjq.js} +1 -1
  143. package/dist/client/assets/{toggle-group-UeFeTI3u.js → toggle-group-CNDOfNhH.js} +1 -1
  144. package/dist/client/assets/{tokenModePresentation-DV56ekA4.js → tokenModePresentation-CQNdC9CW.js} +1 -1
  145. package/dist/client/assets/{tooltip-DXvXxL37.js → tooltip-B7Z4qomY.js} +1 -1
  146. package/dist/client/assets/{unplug-DisTpujT.js → unplug-CRUwFNFw.js} +1 -1
  147. package/dist/client/assets/useAppSidebarCollapsed-wq6czkNJ.js +1 -0
  148. package/dist/client/assets/useBaseUiId-OYaGjnkh.js +1 -0
  149. package/dist/client/assets/{useLabelableId-BsDFG9Oj.js → useLabelableId-VMc-yITe.js} +1 -1
  150. package/dist/client/assets/{useNavigate-cLfxn_9L.js → useNavigate-DVi0rBlf.js} +1 -1
  151. package/dist/client/assets/{usePhoneThreadActions-rekHL1Mi.js → usePhoneThreadActions-CwwHikjB.js} +1 -1
  152. package/dist/client/assets/{usePopupViewport-kXU31P6l.js → usePopupViewport-BcSIK_ph.js} +1 -1
  153. package/dist/client/assets/{useScrollLock-DjMxrUJe.js → useScrollLock-BQf9VYJT.js} +1 -1
  154. package/dist/client/assets/{useStatistics-BYP-9CmW.js → useStatistics-DczKdEfy.js} +1 -1
  155. package/dist/client/assets/{useTriggerFocusGuards-DuAm2B8C.js → useTriggerFocusGuards-DjP-D0_a.js} +1 -1
  156. package/dist/client/assets/{useValueChanged-DreFjrMK.js → useValueChanged-CRwCkFdy.js} +1 -1
  157. package/dist/client/assets/{user-round-DctamWV6.js → user-round-DStbWN3z.js} +1 -1
  158. package/dist/client/assets/{vscode-icons-Dw-LGJAv.js → vscode-icons-BihBo3tb.js} +1 -1
  159. package/dist/client/assets/{workspaceMetadataProjection-BL4sEIL2.js → workspaceMetadataProjection-j3BGlVOB.js} +1 -1
  160. package/dist/client/assets/{wrench-Ds8eZerZ.js → wrench-BBIgGxy9.js} +1 -1
  161. package/dist/client/index.html +1 -1
  162. package/dist/{collectUint8StreamText-C_VNyArd.mjs → collectUint8StreamText-CE1Re5Ij.mjs} +41 -3
  163. package/dist/{collectUint8StreamText-DStwNTTK.cjs → collectUint8StreamText-whblCEfg.cjs} +52 -2
  164. package/dist/{makeManagedServerProvider-GZcpSLrW.mjs → makeManagedServerProvider-CwYhl_P-.mjs} +1 -1
  165. package/dist/{makeManagedServerProvider-VzxWN-04.cjs → makeManagedServerProvider-Dy2Ny9tk.cjs} +1 -1
  166. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  167. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  168. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  169. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  170. package/package.json +1 -1
  171. package/dist/client/assets/AccountSettings-ApnDA1f-.js +0 -1
  172. package/dist/client/assets/ChatRightPanel-a6UOHNMm.js +0 -194
  173. package/dist/client/assets/CommandPaletteDialog-B2iKWCUi.js +0 -1
  174. package/dist/client/assets/ComputerUseSettings-CPwWoHWj.js +0 -1
  175. package/dist/client/assets/ConnectionsSettings-CPMkuxza.js +0 -7
  176. package/dist/client/assets/ContextHandoffEndpointLabel-BildLLDY.js +0 -4
  177. package/dist/client/assets/DialogRoot-SKkIuQHA.js +0 -1
  178. package/dist/client/assets/HostedHubRoot-BTWc0XoQ.js +0 -2
  179. package/dist/client/assets/IntegrationsSettingsPanel-n9owMZf-.js +0 -2
  180. package/dist/client/assets/PhoneHome-FqWvnJP_.js +0 -1
  181. package/dist/client/assets/PhoneSettingsSurface-w5PJnoBc.js +0 -2
  182. package/dist/client/assets/ProvidersSettingsPanel-Ww1ch3xA.js +0 -1
  183. package/dist/client/assets/RootAppShell-BdQCs2XJ.js +0 -7
  184. package/dist/client/assets/SettingsDialog-DeMzEeCP.js +0 -2
  185. package/dist/client/assets/SettingsPanels-ZxNz9ZfL.js +0 -3
  186. package/dist/client/assets/SourceControlSettings-C1F3Brcn.js +0 -1
  187. package/dist/client/assets/authorization-CjOFkg7b.js +0 -1
  188. package/dist/client/assets/chevron-right-CuUjBsQV.js +0 -1
  189. package/dist/client/assets/main-BbtLAX7M.js +0 -9
  190. package/dist/client/assets/main-D4CtFNPY.css +0 -2
  191. package/dist/client/assets/monitor-OyD484tI.js +0 -1
  192. package/dist/client/assets/primary-D_D7eLwT.js +0 -2
  193. package/dist/client/assets/providerDriverMeta-DNTocCcU.js +0 -1
  194. package/dist/client/assets/providerModels-bFbEIfL9.js +0 -1
  195. package/dist/client/assets/runtime-Djy96GJd.js +0 -17
  196. package/dist/client/assets/sidebarProjectFolders-ygpaKZM6.js +0 -4
  197. package/dist/client/assets/src-BSuAGqhK.js +0 -14
  198. package/dist/client/assets/switch-DD1qVLgN.js +0 -48
  199. package/dist/client/assets/useAppSidebarCollapsed-CaAsLi1q.js +0 -1
  200. package/dist/client/assets/useBaseUiId-CJN4MvrU.js +0 -1
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-D4CtFNPY.css"])))=>i.map(i=>d[i]);
2
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-DxCd1PgA.js";import"./src-BSuAGqhK.js";import{Ar as r,Da as i,F as a,I as o,Ma as s,N as c,Na as l,Nn as u,Oa as d,P as f,Rr as p,Ta as m,Vr as h,_l as g,ja as _,jr as v,kn as y,wa as b,zr as x}from"./runtime-Djy96GJd.js";import{Ft as S,It as C,Mt as w,Nt as T,Pt as E,an as D,jt as O,kt as k,r as A}from"./switch-DD1qVLgN.js";import{t as j}from"./compiler-runtime-qmuS0Svy.js";import{a as M,n as N,o as P}from"./hostedConnectionCoordinator-CLV-JD1S.js";import{t as F}from"./useNavigate-cLfxn_9L.js";import{h as I,t as L}from"./RootAppShell-BdQCs2XJ.js";import{t as R}from"./arrow-left-CymyVbCi.js";import{a as z,c as B,d as V,f as H,i as U,l as ee,o as te,t as W,u as ne}from"./HostedConnectionControls-COUhSe9x.js";import{t as re}from"./chevron-right-CuUjBsQV.js";import{t as ie}from"./key-round-D2DtQ7aS.js";import{t as ae}from"./log-out-YAp9fsOg.js";import{t as oe}from"./palette-D18VboLH.js";import{t as se}from"./refresh-cw-DY3_Ph-S.js";import{t as G}from"./shield-check-CO4SMhAs.js";import{t as ce}from"./user-round-DctamWV6.js";import{_ as le,b as K,ht as ue,o as q}from"./authorization-CjOFkg7b.js";import{n as J,t as Y}from"./input-DrOL1KPS.js";import{a as de,i as fe,n as pe,o as me,r as he,s as ge,t as _e}from"./sheet-DLy4aeVa.js";import{t as ve}from"./skeleton-DRm4_OvB.js";import{t as ye}from"./usePresentationTier-B_SCFvN7.js";import{i as be,r as xe,t as Se}from"./alert-CXnC_RJc.js";import{a as Ce,i as we,n as Te,o as Ee,r as De,t as Oe}from"./MobileSheet-NTayGHF6.js";import{a as ke,i as Ae,n as je,o as Me,r as Ne,t as Pe}from"./empty-3NpXLnAM.js";import{c as Fe,n as Ie,r as Le,t as Re}from"./ExternalIdentityWeb.logic-arHvT6AX.js";import{a as ze}from"./settingsLayout-C6SUmJVB.js";import{a as Be,i as Ve,n as He,o as Ue,r as We}from"./hubRoutes-EWJ3Gdod.js";import{t as Ge}from"./HostedRelayTrustNotice-Bl6On0Yi.js";import{n as X,t as Ke}from"./data-list-ZLhzdlED.js";import{C as qe,a as Je,o as Ye,s as Xe}from"./main-BbtLAX7M.js";var Ze={name:`life-buoy`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]};Ze.node;var Qe=l(Ze),$e={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};$e.node;var et=l($e),Z=e(t(),1),Q=j(),tt=/^[A-Za-z0-9_-]{43}$/u,nt=/^signup_[A-Za-z0-9_-]{22,43}$/u;function rt(e){if(e.pathname===`/public-signup/verify`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash),n=t.get(`attempt`),r=t.get(`attempt_secret`),i=t.get(`token`);return n!==null&&nt.test(n)&&r!==null&&tt.test(r)&&i!==null&&tt.test(i)?{kind:`signup-verification`,attemptId:n,attemptSecret:r,token:i}:{kind:`invalid-signup-verification`}}if(e.pathname===`/password-reset`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&tt.test(t)?{kind:`password-reset`,token:t}:{kind:`invalid-password-reset`}}if(e.pathname===`/email-verification`){let t=new URLSearchParams(e.hash.startsWith(`#`)?e.hash.slice(1):e.hash).get(`token`);return t!==null&&tt.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function it(e){let t=new URL(e.href),n=rt(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function at(){let e=(0,Q.c)(3),t=f(lt),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(t!==`authenticated`)return;let e=st,n=()=>{document.visibilityState===`hidden`?(M(!0),q.suspendBrowser(`hidden`)):e()},r=ot,i=()=>e(),a=()=>e();return document.addEventListener(`visibilitychange`,n),window.addEventListener(`offline`,r),window.addEventListener(`online`,i),window.addEventListener(`pageshow`,a),navigator.onLine||r(),()=>{document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`offline`,r),window.removeEventListener(`online`,i),window.removeEventListener(`pageshow`,a)}},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function ot(){M(!0),q.suspendBrowser(`offline`)}function st(){document.visibilityState===`visible`&&navigator.onLine&&q.resumeBrowser().then(ct)}function ct(){return M(!1)}function lt(e){return e.accountStatus}var $=g(),ut=100;function dt(e){let t=(0,Q.c)(52),{node:n,open:r,onOpenChange:i,onRename:a}=e,[o,s]=(0,Z.useState)(n.label),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f,p;t[0]!==n.label||t[1]!==r?(f=()=>{r&&(s(n.label),l(!1),d(null))},p=[n.label,r],t[0]=n.label,t[1]=r,t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Z.useEffect)(f,p);let m;t[4]===o?m=t[5]:(m=o.trim(),t[4]=o,t[5]=m);let h=m,g=h.length===0?`Enter a node name.`:h.length>ut?`Use 100 characters or fewer.`:null,_=g===null&&h!==n.label&&!c,v;t[6]!==_||t[7]!==h||t[8]!==i||t[9]!==a?(v=async()=>{if(_){l(!0),d(null);try{await a(h),i(!1)}catch(e){let t=e;d(t instanceof Error?t.message:`Unable to rename this node.`),l(!1)}}},t[6]=_,t[7]=h,t[8]=i,t[9]=a,t[10]=v):v=t[10];let y=v,b=!c,D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsxs)(T,{children:[(0,$.jsx)(C,{children:`Rename node`}),(0,$.jsx)(O,{children:`This is the canonical name shown to everyone authorized to use this node.`})]}),t[11]=D):D=t[11];let A;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,$.jsx)(`label`,{htmlFor:`hosted-node-name`,className:`text-sm font-medium`,children:`Node name`}),t[12]=A):A=t[12];let j=g!==null||u!==null,M;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{s(e.currentTarget.value),d(null)},t[13]=M):M=t[13];let N;t[14]!==_||t[15]!==y?(N=e=>{e.key===`Enter`&&_&&y()},t[14]=_,t[15]=y,t[16]=N):N=t[16];let P;t[17]!==o||t[18]!==c||t[19]!==N||t[20]!==j?(P=(0,$.jsx)(Y,{id:`hosted-node-name`,value:o,autoFocus:!0,disabled:c,"aria-invalid":j,onChange:M,onKeyDown:N}),t[17]=o,t[18]=c,t[19]=N,t[20]=j,t[21]=P):P=t[21];let F;t[22]===g?F=t[23]:(F=g?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:g}):null,t[22]=g,t[23]=F);let I;t[24]===u?I=t[25]:(I=u?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u}):null,t[24]=u,t[25]=I);let L;t[26]!==P||t[27]!==F||t[28]!==I?(L=(0,$.jsxs)(E,{className:`space-y-2`,children:[A,P,F,I]}),t[26]=P,t[27]=F,t[28]=I,t[29]=L):L=t[29];let R;t[30]===i?R=t[31]:(R=()=>i(!1),t[30]=i,t[31]=R);let z;t[32]!==c||t[33]!==R?(z=(0,$.jsx)(x,{variant:`outline`,disabled:c,onClick:R,children:`Cancel`}),t[32]=c,t[33]=R,t[34]=z):z=t[34];let B=!_,V;t[35]===y?V=t[36]:(V=()=>void y(),t[35]=y,t[36]=V);let H=c?`Saving…`:`Save`,U;t[37]!==B||t[38]!==V||t[39]!==H?(U=(0,$.jsx)(x,{disabled:B,onClick:V,children:H}),t[37]=B,t[38]=V,t[39]=H,t[40]=U):U=t[40];let ee;t[41]!==z||t[42]!==U?(ee=(0,$.jsxs)(w,{children:[z,U]}),t[41]=z,t[42]=U,t[43]=ee):ee=t[43];let te;t[44]!==L||t[45]!==ee||t[46]!==b?(te=(0,$.jsxs)(S,{className:`max-w-md`,showCloseButton:b,children:[D,L,ee]}),t[44]=L,t[45]=ee,t[46]=b,t[47]=te):te=t[47];let W;return t[48]!==i||t[49]!==r||t[50]!==te?(W=(0,$.jsx)(k,{open:r,onOpenChange:i,children:te}),t[48]=i,t[49]=r,t[50]=te,t[51]=W):W=t[51],W}var ft=`owner_revoked`,pt=Object.freeze([Object.freeze({id:`access`,text:`Every Hub grant on this node stops working immediately, for everyone authorized through this Hub — not only for you — and any relay channel it has open right now closes.`}),Object.freeze({id:`direct`,text:`Clients paired directly with that machine are separate and keep working. Those are managed on the machine itself, with the ryco auth command.`}),Object.freeze({id:`directory`,text:`It leaves the directory for every account on this Hub, not only yours, and stays gone. There is no undo here and no state it can return to.`}),Object.freeze({id:`return`,text:`Putting that machine back starts on the machine itself: use “Leave this Hub” there, then enroll it again with a new device code and your approval. It is a new enrollment, not a reconnection.`}),Object.freeze({id:`reach`,text:`All of that is recorded here, on the Hub. A node that is offline, unreachable, or long gone is revoked in exactly the same way — which is the point of doing it from here.`})]),mt=`Check the identifier below against the machine you meant. Two nodes can carry the same name, and this is the only value that tells them apart.`;function ht(e){return{title:`Revoke ${e.label}?`,consequences:pt,subjectPrompt:mt,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var gt=`Revoke`;function _t(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function vt(e){return e===null||e.outcome===`unchanged`}var yt=e=>Object.freeze(e),bt=Object.freeze([yt({id:`invalidResponse`,probe:Object.freeze({code:`invalid_response`,status:502}),selects:(e,t)=>t===`invalid_response`,failure:Object.freeze({message:`The Hub accepted the request and its answer could not be read, so whether this node was revoked is not known here. Refresh the list and check before trying again.`,outcome:`unknown`})}),yt({id:`transport`,probe:Object.freeze({code:`unavailable`,status:0}),selects:(e,t)=>e===0||t===`timeout`||t===`unavailable`,failure:Object.freeze({message:`The request left this browser and no answer came back, so whether this node was revoked is not known here. Check your connection, then refresh the list and look before trying again.`,outcome:`unknown`})}),yt({id:`csrf`,probe:Object.freeze({code:`csrf_rejected`,status:403}),selects:(e,t)=>t===`csrf_rejected`,failure:Object.freeze({message:`This request could not be verified, so nothing was changed. Refresh the page and try again.`,outcome:`unchanged`})}),yt({id:`unauthorized`,probe:Object.freeze({code:`session_invalid`,status:401}),selects:(e,t)=>e===401||t===`session_invalid`,failure:Object.freeze({message:`Your Hub session is no longer valid, so nothing was changed. Sign in and try again.`,outcome:`unchanged`})}),yt({id:`forbidden`,probe:Object.freeze({code:`forbidden`,status:403}),selects:e=>e===403,failure:Object.freeze({message:`Only an owner of this Hub can revoke a node. Nothing was changed.`,outcome:`unchanged`})}),yt({id:`notFound`,probe:Object.freeze({code:`not_found`,status:404}),selects:e=>e===404,failure:Object.freeze({message:`The Hub has no active node under this identifier: it was already revoked, or it is not this Hub's. Either way there is nothing here left to revoke.`,outcome:`already-gone`})}),yt({id:`conflict`,probe:Object.freeze({code:`conflict`,status:409}),selects:e=>e===409,failure:Object.freeze({message:`The Hub reported a conflicting change on this node, so nothing was changed. Refresh and look at it again before retrying.`,outcome:`unchanged`})}),yt({id:`rateLimited`,probe:Object.freeze({code:`node_rate_limited`,status:429}),selects:e=>e===429,failure:Object.freeze({message:`The Hub is refusing further owner changes for now, so nothing was changed. Wait a little and try again.`,outcome:`unchanged`})}),yt({id:`badRequest`,probe:Object.freeze({code:`invalid_request`,status:400}),selects:(e,t)=>e===400||t===`invalid_request`,failure:Object.freeze({message:`The Hub refused this request, so nothing was changed.`,outcome:`unchanged`})})]),xt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function St(e){let t=Ct(e),n=wt(e);for(let e of bt)if(e.selects(t,n))return e.failure;return xt}function Ct(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function wt(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var Tt=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Et(e){return e===null||!Number.isFinite(e)?null:Tt.format(new Date(e))}function Dt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Ot(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function kt(e){return Ot(e)}function At(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return Et(e)??`unknown`;let r=Math.floor(n/6e4);if(r<2)return`just now`;if(r<60)return`${String(r)} min ago`;let i=Math.floor(r/60);return i<24?`${String(i)} h ago`:Et(e)??`unknown`}function jt(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${At(e.lastAuthenticatedAt,t)}`:`Last seen ${At(e.presence.lastHeartbeatAt,t)}`}function Mt(e){let t=`${Dt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${kt(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function Nt(e){return e.toSorted((e,t)=>{let n=e.revokedAt===null?0:1,r=t.revokedAt===null?0:1;return n===r?e.label.localeCompare(t.label,void 0,{numeric:!0,sensitivity:`base`}):n-r})}function Pt(e){return e.filter(e=>e.revokedAt===null).length}function Ft(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function It(e){let t=Pt(e),n=Ft(e),r=e.length-t,i=`${String(t)} authorized · ${n===0?`none online`:`${String(n)} online`}`;return r===0?i:`${i} · ${String(r)} revoked`}function Lt(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function Rt(e){return e.node.capabilities?.nativeClientRequired===!0?`Open this node in Desktop/Mobile.`:e.node.revokedAt===null?e.directoryStatus!==`ready`||e.browserStatus!==`current`?`Node switching is unavailable until the directory and this browser are current.`:null:`Access to this node was revoked.`}function zt({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=ht(e),l=vt(o);(0,Z.useEffect)(()=>{t&&!i&&(a(!1),s(null))},[e.id,t]);let u=async()=>{if(!i){a(!0),s(null);try{await r(),n(!1)}catch(e){s(St(e)),a(!1)}}};return(0,$.jsx)(k,{open:t,onOpenChange:e=>{(e||!i)&&n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(S,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(T,{children:[(0,$.jsx)(C,{children:c.title}),(0,$.jsx)(O,{children:c.subjectPrompt})]}),(0,$.jsxs)(E,{className:`space-y-4`,children:[(0,$.jsxs)(Ke,{children:[(0,$.jsx)(X,{term:`Node`,children:e.label}),(0,$.jsx)(X,{term:`Node ID`,mono:!0,children:c.subjectId}),(0,$.jsx)(X,{term:`Platform`,children:`${Dt(e.platformOs)} · ${e.platformArch}`})]}),(0,$.jsx)(`ul`,{className:`space-y-2 text-xs leading-relaxed text-muted-foreground`,children:c.consequences.map(e=>(0,$.jsx)(`li`,{children:e.text},e.id))}),o?(0,$.jsxs)(`p`,{role:`alert`,className:`flex items-start gap-2 text-xs leading-relaxed text-destructive`,children:[(0,$.jsx)(b,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),o.message]}):null]}),(0,$.jsxs)(w,{children:[(0,$.jsx)(x,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(x,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Bt(e){let t=(0,Q.c)(57),{node:n}=e,r=ze(6e4),{copyToClipboard:a,isCopied:o}=p(),c;t[0]===n.createdAt?c=t[1]:(c=Et(n.createdAt),t[0]=n.createdAt,t[1]=c);let l=c,u;t[2]===n.lastAuthenticatedAt?u=t[3]:(u=Et(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=u);let d=u,f;t[4]===n.revokedAt?f=t[5]:(f=Et(n.revokedAt),t[4]=n.revokedAt,t[5]=f);let m=f,h=n.grant.role!==n.effectiveRole,g;t[6]===n?g=t[7]:(g=(0,$.jsx)(X,{term:`Status`,children:(0,$.jsx)(U,{node:n})}),t[6]=n,t[7]=g);let _;t[8]!==n.presence.lastHeartbeatAt||t[9]!==r?(_=n.presence.lastHeartbeatAt===null?`Not reported`:(0,$.jsx)(`span`,{title:Et(n.presence.lastHeartbeatAt)??void 0,children:At(n.presence.lastHeartbeatAt,r)}),t[8]=n.presence.lastHeartbeatAt,t[9]=r,t[10]=_):_=t[10];let v;t[11]===_?v=t[12]:(v=(0,$.jsx)(X,{term:`Last heartbeat`,children:_}),t[11]=_,t[12]=v);let y=d??`Never`,b;t[13]===y?b=t[14]:(b=(0,$.jsx)(X,{term:`Last connected`,children:y}),t[13]=y,t[14]=b);let S;t[15]===n.platformOs?S=t[16]:(S=Dt(n.platformOs),t[15]=n.platformOs,t[16]=S);let C=`${S} · ${n.platformArch}`,w;t[17]===C?w=t[18]:(w=(0,$.jsx)(X,{term:`Platform`,children:C}),t[17]=C,t[18]=w);let T;t[19]===n.clientVersion?T=t[20]:(T=(0,$.jsx)(X,{term:`Client version`,mono:!0,children:n.clientVersion}),t[19]=n.clientVersion,t[20]=T);let E;t[21]===n.effectiveRole?E=t[22]:(E=kt(n.effectiveRole),t[21]=n.effectiveRole,t[22]=E);let D;t[23]===E?D=t[24]:(D=(0,$.jsx)(X,{term:`Your role`,children:E}),t[23]=E,t[24]=D);let O;t[25]!==h||t[26]!==n.grant.role?(O=h?(0,$.jsxs)(X,{term:`Granted role`,children:[kt(n.grant.role),(0,$.jsx)(`span`,{className:`mt-1 block text-muted-foreground`,children:`The role on your grant differs from the role in effect.`})]}):null,t[25]=h,t[26]=n.grant.role,t[27]=O):O=t[27];let k=l??`Not reported`,A;t[28]===k?A=t[29]:(A=(0,$.jsx)(X,{term:`Enrolled`,children:k}),t[28]=k,t[29]=A);let j;t[30]!==n.revocationReasonCode||t[31]!==n.revokedAt||t[32]!==m?(j=n.revokedAt===null?null:(0,$.jsx)(X,{term:`Revoked`,children:`${m??`Not reported`}${n.revocationReasonCode?` — ${n.revocationReasonCode}`:``}`}),t[30]=n.revocationReasonCode,t[31]=n.revokedAt,t[32]=m,t[33]=j):j=t[33];let M=o?`Copied`:`Copy node ID`,N;t[34]!==a||t[35]!==n.id?(N=()=>a(n.id,void 0),t[34]=a,t[35]=n.id,t[36]=N):N=t[36];let P;t[37]===o?P=t[38]:(P=o?(0,$.jsx)(s,{"aria-hidden":!0}):(0,$.jsx)(i,{"aria-hidden":!0}),t[37]=o,t[38]=P);let F;t[39]!==M||t[40]!==N||t[41]!==P?(F=(0,$.jsx)(x,{size:`icon-xs`,variant:`ghost`,"aria-label":M,onClick:N,children:P}),t[39]=M,t[40]=N,t[41]=P,t[42]=F):F=t[42];let I;t[43]!==n.id||t[44]!==F?(I=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:F,children:n.id}),t[43]=n.id,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==w||t[47]!==T||t[48]!==D||t[49]!==O||t[50]!==A||t[51]!==j||t[52]!==I||t[53]!==g||t[54]!==v||t[55]!==b?(L=(0,$.jsxs)(Ke,{children:[g,v,b,w,T,D,O,A,j,I]}),t[46]=w,t[47]=T,t[48]=D,t[49]=O,t[50]=A,t[51]=j,t[52]=I,t[53]=g,t[54]=v,t[55]=b,t[56]=L):L=t[56],L}function Vt(e){let t=(0,Q.c)(93),{node:n,directoryStatus:r,browserStatus:i,canRename:a,canRevoke:o,onOpenChange:s,onConnect:c,onRename:l,onRevoke:u}=e,d=ye()===`phone`,[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(null),g=n!==null;if(!n)return null;let _;t[0]!==i||t[1]!==r||t[2]!==n?(_=Lt({directoryStatus:r,browserStatus:i,node:n}),t[0]=i,t[1]=r,t[2]=n,t[3]=_):_=t[3];let v=_,y;t[4]!==i||t[5]!==r||t[6]!==n?(y=Rt({directoryStatus:r,browserStatus:i,node:n}),t[4]=i,t[5]=r,t[6]=n,t[7]=y):y=t[7];let b=y,S;t[8]!==n||t[9]!==c||t[10]!==s?(S=()=>{s(!1),c(n)},t[8]=n,t[9]=c,t[10]=s,t[11]=S):S=t[11];let C=S,w=v&&b?b:null;if(d){let e=`Node details: ${n.label}`,r;t[12]===n.label?r=t[13]:(r=(0,$.jsx)(Ee,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=Mt(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(Te,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(we,{children:[r,a]}),t[18]=r,t[19]=a,t[20]=o):o=t[20];let c;t[21]===n?c=t[22]:(c=(0,$.jsx)(Bt,{node:n}),t[21]=n,t[22]=c);let l;t[23]===w?l=t[24]:(l=w?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:w}):null,t[23]=w,t[24]=l);let u;t[25]!==l||t[26]!==c?(u=(0,$.jsxs)(Ce,{children:[c,l]}),t[25]=l,t[26]=c,t[27]=u):u=t[27];let d;t[28]!==v||t[29]!==C?(d=(0,$.jsx)(De,{children:(0,$.jsx)(x,{className:`min-h-11`,disabled:v,onClick:C,children:`Connect`})}),t[28]=v,t[29]=C,t[30]=d):d=t[30];let f;return t[31]!==s||t[32]!==g||t[33]!==u||t[34]!==d||t[35]!==e||t[36]!==o?(f=(0,$.jsxs)(Oe,{open:g,onOpenChange:s,label:e,children:[o,u,d]}),t[31]=s,t[32]=g,t[33]=u,t[34]=d,t[35]=e,t[36]=o,t[37]=f):f=t[37],f}let T=o&&n.revokedAt===null,E;t[38]!==s||t[39]!==f||t[40]!==m?(E=e=>{(e||m===null&&f===null)&&(e||(p(null),h(null)),s(e))},t[38]=s,t[39]=f,t[40]=m,t[41]=E):E=t[41];let D;t[42]===n.label?D=t[43]:(D=(0,$.jsx)(ge,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=D);let O;t[44]===n?O=t[45]:(O=Mt(n),t[44]=n,t[45]=O);let k;t[46]===O?k=t[47]:(k=(0,$.jsx)(pe,{children:O}),t[46]=O,t[47]=k);let A;t[48]!==D||t[49]!==k?(A=(0,$.jsxs)(fe,{children:[D,k]}),t[48]=D,t[49]=k,t[50]=A):A=t[50];let j;t[51]===n?j=t[52]:(j=(0,$.jsx)(Bt,{node:n}),t[51]=n,t[52]=j);let M;t[53]===w?M=t[54]:(M=w?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:w}):null,t[53]=w,t[54]=M);let N;t[55]!==M||t[56]!==j?(N=(0,$.jsxs)(de,{children:[j,M]}),t[55]=M,t[56]=j,t[57]=N):N=t[57];let P;t[58]!==n.id||t[59]!==T?(P=T?(0,$.jsx)(x,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>h(n.id),children:gt}):null,t[58]=n.id,t[59]=T,t[60]=P):P=t[60];let F;t[61]!==a||t[62]!==n.id?(F=a?(0,$.jsx)(x,{variant:`outline`,onClick:()=>p(n.id),children:`Rename`}):null,t[61]=a,t[62]=n.id,t[63]=F):F=t[63];let I;t[64]!==v||t[65]!==C?(I=(0,$.jsx)(x,{disabled:v,onClick:C,children:`Connect`}),t[64]=v,t[65]=C,t[66]=I):I=t[66];let L;t[67]!==P||t[68]!==F||t[69]!==I?(L=(0,$.jsxs)(he,{children:[P,F,I]}),t[67]=P,t[68]=F,t[69]=I,t[70]=L):L=t[70];let R;t[71]!==N||t[72]!==L||t[73]!==A?(R=(0,$.jsxs)(me,{side:`right`,className:`w-full sm:max-w-md`,children:[A,N,L]}),t[71]=N,t[72]=L,t[73]=A,t[74]=R):R=t[74];let z;t[75]!==g||t[76]!==R||t[77]!==E?(z=(0,$.jsx)(_e,{open:g,onOpenChange:E,children:R}),t[75]=g,t[76]=R,t[77]=E,t[78]=z):z=t[78];let B;t[79]!==a||t[80]!==n||t[81]!==l||t[82]!==f?(B=a?(0,$.jsx)(dt,{node:n,open:f===n.id,onOpenChange:e=>p(e?n.id:null),onRename:e=>l(n,e)}):null,t[79]=a,t[80]=n,t[81]=l,t[82]=f,t[83]=B):B=t[83];let V;t[84]!==n||t[85]!==u||t[86]!==T||t[87]!==m?(V=T?(0,$.jsx)(zt,{node:n,open:m===n.id,onOpenChange:e=>h(e?n.id:null),onRevoke:()=>u(n)}):null,t[84]=n,t[85]=u,t[86]=T,t[87]=m,t[88]=V):V=t[88];let H;return t[89]!==z||t[90]!==B||t[91]!==V?(H=(0,$.jsxs)($.Fragment,{children:[z,B,V]}),t[89]=z,t[90]=B,t[91]=V,t[92]=H):H=t[92],H}function Ht(e){let t=(0,Q.c)(18),{children:n,title:r,description:i,actions:a,titleRef:o}=e,s;t[0]!==r||t[1]!==o?(s=(0,$.jsx)(`h1`,{ref:o,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[0]=r,t[1]=o,t[2]=s):s=t[2];let c;t[3]===i?c=t[4]:(c=i===void 0?null:(0,$.jsx)(`div`,{className:`mt-1.5 text-muted-foreground text-sm`,children:i}),t[3]=i,t[4]=c);let l;t[5]!==s||t[6]!==c?(l=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]===a?u=t[9]:(u=a===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:a}),t[8]=a,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-3`,children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n?f=t[14]:(f=(0,$.jsx)(`div`,{className:`mt-8`,children:n}),t[13]=n,t[14]=f);let p;return t[15]!==d||t[16]!==f?(p=(0,$.jsxs)($.Fragment,{children:[d,f]}),t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function Ut(e){let t=(0,Q.c)(12),{children:n,className:r,title:i,description:a,actions:o}=e,s;t[0]===r?s=t[1]:(s=h(`app-surface relative rounded-2xl border not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,r),t[0]=r,t[1]=s);let c;t[2]!==o||t[3]!==a||t[4]!==i?(c=i===void 0&&o===void 0?null:(0,$.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-x-4 gap-y-2 border-border/60 border-b px-5 py-4`,children:[(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[i===void 0?null:(0,$.jsx)(`h2`,{className:`font-medium text-base`,children:i}),a===void 0?null:(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-sm leading-relaxed`,children:a})]}),o===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:o})]}),t[2]=o,t[3]=a,t[4]=i,t[5]=c):c=t[5];let l;t[6]===n?l=t[7]:(l=n===void 0?null:(0,$.jsx)(`div`,{className:`px-5 py-4`,children:n}),t[6]=n,t[7]=l);let u;return t[8]!==s||t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`section`,{className:s,children:[c,l]}),t[8]=s,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function Wt(e){let t=(0,Q.c)(8),{className:n,size:r}=e,i=r===void 0?`default`:r,a=i===`lg`?`gap-2.5 text-lg`:`gap-2 text-sm`,o;t[0]!==n||t[1]!==a?(o=h(`inline-flex items-center font-semibold text-foreground`,a,n),t[0]=n,t[1]=a,t[2]=o):o=t[2];let s=i===`lg`?`h-6`:`h-4.5`,c;t[3]===s?c=t[4]:(c=(0,$.jsx)(qe,{className:s}),t[3]=s,t[4]=c);let l;return t[5]!==o||t[6]!==c?(l=(0,$.jsxs)(`span`,{className:o,children:[c,Ye]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}var Gt=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,Kt=`px-4 sm:px-6 phone:px-[max(1rem,env(safe-area-inset-left),env(safe-area-inset-right))] phone:pt-[max(2.5rem,calc(env(safe-area-inset-top)+1rem))] phone:pb-[max(2.5rem,calc(env(safe-area-inset-bottom)+1rem))]`,qt=`flex min-h-full flex-col`,Jt={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function Yt(e){let t=(0,Q.c)(13),{nav:n,trailing:r}=e,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=h(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),a=h(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,Jt.page),o=(0,$.jsx)(Wt,{}),t[0]=i,t[1]=a,t[2]=o):(i=t[0],a=t[1],o=t[2]);let s;t[3]===n?s=t[4]:(s=n===void 0?null:(0,$.jsx)(`nav`,{"aria-label":`Hub`,className:`min-w-0 flex-1`,children:n}),t[3]=n,t[4]=s);let c;t[5]===n?c=t[6]:(c=n===void 0?(0,$.jsx)(`div`,{className:`flex-1`}):null,t[5]=n,t[6]=c);let l;t[7]===r?l=t[8]:(l=r===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:r}),t[7]=r,t[8]=l);let u;return t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,$.jsx)(`header`,{className:i,children:(0,$.jsxs)(`div`,{className:a,children:[o,s,c,l]})}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u}function Xt(e){let t=(0,Q.c)(16),{children:n,nav:i,trailing:a,scrollRef:o,measure:s}=e,c=s===void 0?`page`:s,l=ye()===`phone`,u;t[0]!==l||t[1]!==i||t[2]!==a?(u=l?null:(0,$.jsx)(Yt,{nav:i,trailing:a}),t[0]=l,t[1]=i,t[2]=a,t[3]=u):u=t[3];let d=l?`min-h-full py-10`:`pt-8 pb-16`,f=Jt[c],p;t[4]!==d||t[5]!==f?(p=h(`mx-auto flex w-full flex-col`,d,Kt,f),t[4]=d,t[5]=f,t[6]=p):p=t[6];let m;t[7]!==n||t[8]!==p?(m=(0,$.jsx)(`section`,{className:p,children:n}),t[7]=n,t[8]=p,t[9]=m):m=t[9];let g;t[10]!==o||t[11]!==m?(g=(0,$.jsx)(`main`,{ref:o,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:m}),t[10]=o,t[11]=m,t[12]=g):g=t[12];let _;return t[13]!==u||t[14]!==g?(_=(0,$.jsx)(v,{children:(0,$.jsx)(r,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[u,g]})})}),t[13]=u,t[14]=g,t[15]=_):_=t[15],_}var Zt=(0,Z.lazy)(()=>n(()=>import(`./AccountSettings-ApnDA1f-.js`).then(e=>({default:e.AccountSettingsPanel})),__vite__mapDeps([0]))),Qt=(0,Z.lazy)(()=>n(()=>import(`./AppearanceSettings-BG8W4DP0.js`).then(e=>({default:e.AppearanceSettingsPanel})),__vite__mapDeps([0]))),$t=[{id:`overview`,label:`Overview`,icon:ce},{id:`security`,label:`Security`,icon:G},{id:`appearance`,label:`Appearance`,icon:oe}];function en(e){let t=(0,Q.c)(17),{section:n}=e,r=f(nn),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(x,{variant:`ghost`,onClick:tn,children:[(0,$.jsx)(R,{"aria-hidden":!0}),` Nodes`]}),t[0]=i):i=t[0];let a=n===`appearance`?`Browser appearance`:`Account`,o;t[1]!==r||t[2]!==n?(o=n===`appearance`?`Saved in this browser. Your other apps and devices keep their own appearance.`:r===null?void 0:`${r.displayName} · ${r.role.charAt(0).toUpperCase()}${r.role.slice(1)}`,t[1]=r,t[2]=n,t[3]=o):o=t[3];let s;t[4]===n?s=t[5]:(s=$t.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(x,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>Ve({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[4]=n,t[5]=s);let c;t[6]===s?c=t[7]:(c=(0,$.jsx)(`nav`,{"aria-label":`Account`,className:`shrink-0 sm:w-48`,children:(0,$.jsx)(`ul`,{className:`flex gap-1 overflow-x-auto sm:flex-col sm:overflow-visible`,children:s})}),t[6]=s,t[7]=c);let l;t[8]===n?l=t[9]:(l=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsx)(rn,{}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(ve,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(Zt,{}):(0,$.jsx)(Qt,{surface:`hub`})})}),t[8]=n,t[9]=l);let u;t[10]!==c||t[11]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[c,l]}),t[10]=c,t[11]=l,t[12]=u):u=t[12];let d;return t[13]!==a||t[14]!==o||t[15]!==u?(d=(0,$.jsx)(Xt,{measure:`page`,trailing:i,children:(0,$.jsx)(Ht,{title:a,description:o,children:u})}),t[13]=a,t[14]=o,t[15]=u,t[16]=d):d=t[16],d}function tn(){return Ve({kind:`nodes`})}function nn(e){return e.account}function rn(){let e=(0,Q.c)(11),t=f(an),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Display name`}),e[0]=n):n=e[0];let r=t?.displayName??`—`,i;e[1]===r?i=e[2]:(i=(0,$.jsxs)(`div`,{children:[n,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:r})]}),e[1]=r,e[2]=i);let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Role`}),e[3]=a):a=e[3];let o;e[4]===t?o=e[5]:(o=t===null?`—`:`${t.role.charAt(0).toUpperCase()}${t.role.slice(1)}`,e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,$.jsxs)(`div`,{children:[a,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:o})]}),e[6]=o,e[7]=s);let c;return e[8]!==i||e[9]!==s?(c=(0,$.jsx)(Ut,{title:`Your account`,description:`Identity this Hub knows you by.`,children:(0,$.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-4 sm:grid-cols-2`,children:[i,s]})}),e[8]=i,e[9]=s,e[10]=c):c=e[10],c}function an(e){return e.account}function on(e){let t=(0,Q.c)(7),{links:n}=e,r;t[0]===n?r=t[1]:(r=n===void 0?[]:n,t[0]=n,t[1]=r);let i=r,a=typeof window>`u`?null:window.location.host,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=a===null?null:(0,$.jsxs)(`p`,{children:[`Signing in to `,(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:a})]}),t[2]=o):o=t[2];let s;t[3]===i?s=t[4]:(s=i.length===0?null:(0,$.jsx)(`ul`,{className:`flex flex-wrap items-center justify-center gap-x-4 gap-y-1`,children:i.map(sn)}),t[3]=i,t[4]=s);let c;return t[5]===s?c=t[6]:(c=(0,$.jsxs)(`footer`,{className:`mt-10 flex flex-col items-center gap-2 text-center text-muted-foreground text-xs`,children:[o,s]}),t[5]=s,t[6]=c),c}function sn(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(`a`,{className:`rounded-sm underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring`,href:e.href,rel:`noreferrer`,target:`_blank`,children:e.label})},e.href)}function cn(e){let t=(0,Q.c)(25),{children:n,title:r,description:i,actions:a,trailing:o,scrollRef:s,titleRef:c,measure:l}=e,u=l===void 0?`form`:l,d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=h(Gt,`hub-ambient`),f=h(qt,Kt,`py-10`),t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p=Jt[u],m;t[2]===p?m=t[3]:(m=h(`my-auto w-full self-center phone:my-0 phone:flex phone:max-w-none phone:flex-1 phone:flex-col`,p),t[2]=p,t[3]=m);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(Wt,{size:`lg`})}),t[4]=g):g=t[4];let _;t[5]!==r||t[6]!==c?(_=(0,$.jsx)(`h1`,{ref:c,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:r}),t[5]=r,t[6]=c,t[7]=_):_=t[7];let v;t[8]===i?v=t[9]:(v=i===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:i}),t[8]=i,t[9]=v);let y;t[10]===n?y=t[11]:(y=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:n}),t[10]=n,t[11]=y);let b;t[12]!==a||t[13]!==_||t[14]!==v||t[15]!==y||t[16]!==o?(b=(0,$.jsxs)(`section`,{className:`hub-gateway-panel app-surface relative rounded-2xl border p-6 not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] sm:p-8 phone:flex phone:flex-1 phone:flex-col phone:rounded-none phone:border-0 phone:p-0 phone:shadow-none phone:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:[_,v,y,a,o]}),t[12]=a,t[13]=_,t[14]=v,t[15]=y,t[16]=o,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(on,{}),t[18]=x):x=t[18];let S;t[19]!==b||t[20]!==m?(S=(0,$.jsx)(`div`,{className:f,children:(0,$.jsxs)(`div`,{className:m,children:[g,b,x]})}),t[19]=b,t[20]=m,t[21]=S):S=t[21];let C;return t[22]!==s||t[23]!==S?(C=(0,$.jsx)(`main`,{ref:s,className:d,children:S}),t[22]=s,t[23]=S,t[24]=C):C=t[24],C}function ln({onClose:e}){let[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(null),[a,s]=(0,Z.useState)(`input`),[c,l]=(0,Z.useState)(!1),[u,f]=(0,Z.useState)(null),p=(0,Z.useRef)(``),m=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{m.current?.abort(),m.current=null,p.current=``},[]);let h=()=>{m.current?.abort();let e=new AbortController;return m.current=e,l(!0),f(null),e},g=e=>{m.current===e&&(m.current=null,l(!1))},_=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof le&&e.status===401){p.current=``,n(``),i(null),await q.expireSession();return}f(t??(e instanceof le?e.message:`Hub is temporarily unavailable.`))}},v=async e=>{e.preventDefault();let r=t.trim();n(``),p.current=``;let a=h();try{let e=await o.lookupNodeEnrollment(r,a.signal);if(a.signal.aborted)return;p.current=r,i(e),s(`review`)}catch(e){await _(e)}finally{g(a)}},y=async()=>{let e=p.current;if(!e||!r)return;let t=h();try{if(await o.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;p.current=``,i(null),s(`approved`),await q.refreshDirectory()}catch(e){p.current=``,i(null),s(`input`),await _(e,`The approval result is unknown. Enter the device code again to verify its current state.`)}finally{g(t)}},S=async()=>{let e=p.current;if(!e||!r)return;let t=h();try{if(await o.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;p.current=``,i(null),s(`denied`)}catch(e){await _(e)}finally{g(t)}},C=()=>{m.current?.abort(),p.current=``,n(``),i(null),e()};return a===`approved`||a===`denied`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(d,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:a===`approved`?`Node approved`:`Enrollment denied`}),(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-sm text-muted-foreground`,children:a===`approved`?`The node can now finish enrollment and connect. Online presence may take a few seconds.`:`This ceremony cannot be reused. Start a new enrollment on the node if needed.`}),(0,$.jsx)(x,{className:`mt-5`,onClick:C,children:`Back to nodes`})]}):r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Review node enrollment`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Compare every field, especially the fingerprint, with the node or a trusted operator channel before approving.`}),(0,$.jsxs)(Ke,{className:`mt-5 rounded-xl border border-border bg-background p-4`,children:[(0,$.jsx)(X,{term:`Label`,children:(0,$.jsx)(`span`,{className:`font-medium break-words`,children:r.label})}),(0,$.jsx)(X,{term:`Platform`,children:`${r.platformOs} · ${r.platformArch}`}),(0,$.jsx)(X,{term:`Version`,mono:!0,children:r.clientVersion}),(0,$.jsx)(X,{term:`Algorithm`,children:r.algorithm}),(0,$.jsx)(X,{term:`Fingerprint`,mono:!0,children:r.fingerprint}),(0,$.jsx)(X,{term:`Expires`,children:new Date(r.expiresAt).toLocaleString()})]}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,a===`confirm-denial`?(0,$.jsxs)(`div`,{className:`mt-4 rounded-lg border border-destructive/30 bg-destructive/5 p-3`,children:[(0,$.jsxs)(`p`,{className:`flex gap-2 text-sm`,children:[(0,$.jsx)(b,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),` Denial is permanent for this device code.`]}),(0,$.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{variant:`destructive`,disabled:c,onClick:()=>void S(),children:`Confirm denial`}),(0,$.jsx)(x,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{disabled:c,onClick:()=>void y(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(x,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(x,{variant:`ghost`,disabled:c,onClick:C,children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:`Enroll a Ryco node`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Start enrollment on the node, then enter the short device code shown there. Codes expire after ten minutes.`}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,(0,$.jsxs)(`form`,{className:`mt-5 space-y-4`,autoComplete:`off`,onSubmit:e=>void v(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-node-device-code`,children:`Device code`}),(0,$.jsx)(Y,{id:`hub-node-device-code`,required:!0,autoFocus:!0,maxLength:16,value:t,className:`font-mono uppercase ${J}`,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(x,{type:`button`,variant:`outline`,onClick:C,children:`Cancel`})]})]})]})}function un(e){let t=(0,Q.c)(14),{step:n,total:r,label:i}=e,a=Math.min(Math.max(n,1),r),o;t[0]===i?o=t[1]:(o=i===void 0?null:(0,$.jsxs)(`span`,{className:`sr-only`,children:[`: `,i]}),t[0]=i,t[1]=o);let s;t[2]!==a||t[3]!==o||t[4]!==r?(s=(0,$.jsxs)(`p`,{className:`font-medium text-muted-foreground text-xs`,children:[`Step `,a,` of `,r,o]}),t[2]=a,t[3]=o,t[4]=r,t[5]=s):s=t[5];let c;if(t[6]!==a||t[7]!==r){let e;t[9]===a?e=t[10]:(e=(e,t)=>(0,$.jsx)(`span`,{className:`h-1 flex-1 rounded-full transition-colors ${t<a?`bg-primary`:`bg-border`}`},t),t[9]=a,t[10]=e),c=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`flex flex-1 items-center gap-1.5`,children:Array.from({length:r},e)}),t[6]=a,t[7]=r,t[8]=c}else c=t[8];let l;return t[11]!==s||t[12]!==c?(l=(0,$.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}var dn=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,fn=null;function pn(){return window.turnstile?Promise.resolve(window.turnstile):fn||(fn=new Promise((e,t)=>{let n=document.querySelector(`script[src="${dn}"]`),r=n??document.createElement(`script`);r.addEventListener(`load`,()=>{window.turnstile?e(window.turnstile):t(Error(`Turnstile did not initialize`))},{once:!0}),r.addEventListener(`error`,()=>t(Error(`Turnstile could not be loaded`)),{once:!0}),n||(r.src=dn,r.async=!0,r.defer=!0,document.head.append(r))}).catch(e=>{throw fn=null,e}),fn)}function mn(e){let t=(0,Q.c)(10),{siteKey:n,action:r,onToken:i}=e,a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(!1),c,l;t[0]!==r||t[1]!==i||t[2]!==n?(c=()=>{let e=!1,t=null;return i(null),s(!1),pn().then(o=>{e||a.current===null||(t={api:o,id:o.render(a.current,{sitekey:n,action:r,theme:document.documentElement.classList.contains(`dark`)?`dark`:`light`,callback:t=>{e||i(t)},"expired-callback":()=>{e||i(null)},"error-callback":()=>{e||(i(null),s(!0))}})})}).catch(()=>{e||s(!0)}),()=>{e=!0,i(null),t&&t.api.remove(t.id)}},l=[r,i,n],t[0]=r,t[1]=i,t[2]=n,t[3]=c,t[4]=l):(c=t[3],l=t[4]),(0,Z.useEffect)(c,l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(`div`,{ref:a,"aria-label":`Anti-bot verification`,className:`min-h-[65px]`}),t[5]=u):u=t[5];let d;t[6]===o?d=t[7]:(d=o?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:`Verification could not load. Check your connection and try again.`}):null,t[6]=o,t[7]=d);let f;return t[8]===d?f=t[9]:(f=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[u,d]}),t[8]=d,t[9]=f),f}function hn(e,t){return e instanceof le?e.message:t}function gn(){let e=new Uint8Array(32);return crypto.getRandomValues(e),ue(e)}function _n(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(!0),a,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=new AbortController;return o.getPublicSignupConfiguration(e.signal).then(n).catch(()=>n({status:`disabled`})).finally(()=>{e.signal.aborted||i(!1)}),()=>e.abort()},s=[],e[0]=a,e[1]=s):(a=e[0],s=e[1]),(0,Z.useEffect)(a,s);let c;return e[2]!==t||e[3]!==r?(c={config:t,loading:r},e[2]=t,e[3]=r,e[4]=c):c=e[4],c}function vn(e){return e!==null&&`activationSecret`in e}function yn({config:e,initialLink:t,onConsumeLink:n,onCancel:r}){let[i,a]=(0,Z.useState)(t?.kind===`signup-verification`||t?.kind===`invalid-signup-verification`?`verifying`:`details`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(``),[p,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(null),[b,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),T=(0,Z.useRef)(null),E=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(E.current||t===null)return;if(E.current=!0,t.kind!==`signup-verification`){t.kind===`invalid-signup-verification`&&(w(`This verification link is incomplete or expired. Start signup again.`),a(`details`));return}let e=new AbortController;return S(!0),o.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`link_token`,token:t.token}},e.signal).then(e=>{T.current=e,a(`credential`)}).catch(e=>w(hn(e,`This verification link could not be confirmed.`))).finally(()=>{n(),e.signal.aborted||S(!1)}),()=>e.abort()},[t,n]);let D=async t=>{if(t.preventDefault(),b||e===null)return;let n=e.antiBot.provider===`bypass`?`development`:v??``;if(!n){w(`Complete the anti-bot check before continuing.`);return}S(!0),w(null);try{let e=await o.startPublicSignup({username:s.trim().toLowerCase(),email:l.trim().toLowerCase(),antiBotAssertion:n});T.current=e,a(`check-email`)}catch(e){w(hn(e,`Account creation is temporarily unavailable.`))}finally{S(!1)}},O=async e=>{e.preventDefault();let t=T.current;if(!b&&t!==null&&`attemptSecret`in t){S(!0),w(null);try{let e=await o.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`email_code`,code:d.trim()}});f(``),T.current=e,a(`credential`)}catch(e){w(hn(e,`That email code could not be verified.`))}finally{S(!1)}}},k=async e=>{let t=T.current;if(b||!vn(t))return;if(e===`password`&&p!==g){w(`The passwords do not match.`);return}S(!0),w(null);let n=p;h(``),_(``);try{let r=e===`passkey`?await o.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:gn()}):await o.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:gn()});T.current=null,await q.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(hn(e,`Account creation did not complete.`))}finally{S(!1)}},j=i===`details`?1:i===`check-email`||i===`verifying`?2:3;return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,$.jsx)(un,{step:j,total:3,label:j===1?`Your details`:j===2?`Verify your email`:`Choose how you sign in`}),i===`details`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void D(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-username`,children:`Username`}),(0,$.jsx)(Y,{id:`hub-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:s,className:J,onChange:e=>c(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase letters, numbers, and underscores.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-email`,children:`Email`}),(0,$.jsx)(Y,{id:`hub-signup-email`,type:`email`,autoCapitalize:`none`,autoComplete:`email`,maxLength:254,required:!0,value:l,className:J,onChange:e=>u(e.currentTarget.value)})]}),e?.antiBot.provider===`turnstile`?(0,$.jsx)(mn,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:y}):null,(0,$.jsx)(wn,{value:C}),(0,$.jsx)(Tn,{onCancel:r,pending:b,submitLabel:`Send verification email`,submitDisabled:e===null})]}):i===`check-email`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void O(e),children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(et,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Enter the six-digit code, or open the verification link on this device.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-code`,children:`Verification code`}),(0,$.jsx)(Y,{id:`hub-signup-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,pattern:`[0-9]{6}`,required:!0,value:d,className:J,onChange:e=>f(e.currentTarget.value)})]}),(0,$.jsx)(wn,{value:C}),(0,$.jsx)(Tn,{onCancel:r,pending:b,submitLabel:`Verify email`})]}):i===`password`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),k(`password`)},children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-password`,children:`Password`}),(0,$.jsx)(Y,{id:`hub-signup-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:p,className:J,onChange:e=>h(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-signup-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(Y,{id:`hub-signup-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:g,className:J,onChange:e=>_(e.currentTarget.value)})]}),(0,$.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`At least `,12,` characters. Password sign-in always asks for an email or authenticator code too.`]}),(0,$.jsx)(wn,{value:C}),(0,$.jsx)(Tn,{onCancel:()=>a(`credential`),pending:b,submitLabel:`Create account`})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(G,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:i===`verifying`?`Verifying your email…`:`Choose how you sign in`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`A passkey is the strongest and easiest option. A password always requires a second factor on future sign-ins.`})]}),(0,$.jsx)(wn,{value:C}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${Je}`,children:[(0,$.jsxs)(x,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:b||i===`verifying`,onClick:()=>void k(`passkey`),children:[b?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(ie,{"aria-hidden":!0}),b?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(x,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:b||i===`verifying`,onClick:()=>a(`password`),children:`Use a password instead`}),(0,$.jsx)(x,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function bn({pendingSignup:e,config:t,onCancel:n}){let[r,i]=(0,Z.useState)(e.suggestedUsername??``),[a,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=async e=>{if(e.preventDefault(),c||t===null)return;let n=t.antiBot.provider===`bypass`?`development`:a??``;if(!n){d(`Complete the anti-bot check before continuing.`);return}l(!0),d(null);try{let e=await o.finishExternalIdentitySignup({provider:`github`,username:r.trim().toLowerCase(),antiBotAssertion:n,idempotencyKey:gn()});await q.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(hn(e,`GitHub signup did not complete.`))}finally{l(!1)}};return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void f(e),children:[(0,$.jsx)(un,{step:1,total:1,label:`Confirm your Ryco username`}),(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(G,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`GitHub verified`}),(0,$.jsxs)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:[e.displayName?`${e.displayName} authorized Ryco through GitHub. `:`GitHub authorized this account. `,`Choose the public username Ryco should use. Nothing is created until you confirm.`]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-external-signup-username`,children:`Username`}),(0,$.jsx)(Y,{id:`hub-external-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:r,className:J,onChange:e=>i(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`GitHub suggested this name. You can change it before creating the account.`})]}),t?.antiBot.provider===`turnstile`?(0,$.jsx)(mn,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(wn,{value:u}),(0,$.jsx)(Tn,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function xn({onCancel:e,onUseRecoveryCode:t,onResetPassword:n}){let[r,i]=(0,Z.useState)(``),[a,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(null),[f,p]=(0,Z.useState)(!1),[m,h]=(0,Z.useState)(null),g=async e=>{if(e.preventDefault(),!f){p(!0),h(null);try{if(u===null){let e=await o.startPasswordLogin({identifier:r.trim().toLowerCase(),password:a});s(``),d(e)}else{let e=await o.finishPasswordLogin({attemptId:u.attemptId,attemptSecret:u.attemptSecret,factor:u.factor,code:c.trim()});l(``),await q.adoptPublicBrowserIdentity(e)}}catch(e){h(hn(e,`Password sign-in did not complete.`))}finally{p(!1)}}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void g(e),children:[u===null?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-identifier`,children:`Username or verified email`}),(0,$.jsx)(Y,{id:`hub-login-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:r,className:J,onChange:e=>i(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-password`,children:`Password`}),(0,$.jsx)(Y,{id:`hub-login-password`,type:`password`,autoComplete:`current-password`,required:!0,maxLength:256,value:a,className:J,onChange:e=>s(e.currentTarget.value)})]})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-second-factor`,children:u.factor===`totp`?`Authenticator code`:`Email code`}),(0,$.jsx)(Y,{id:`hub-login-second-factor`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:c,className:J,onChange:e=>l(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:u.factor===`totp`?`Enter the current code from your authenticator app.`:`We sent a six-digit code to your verified email address.`})]}),(0,$.jsx)(wn,{value:m}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(x,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(x,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Tn,{onCancel:u===null?e:()=>d(null),pending:f,submitLabel:u===null?`Continue`:`Sign in`})]})}function Sn({initialLink:e,onConsumeLink:t,onCancel:n}){let[r,i]=(0,Z.useState)(e?.kind===`password-reset`||e?.kind===`invalid-password-reset`?`verifying`:`request`),[a,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(``),[m,h]=(0,Z.useState)(``),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),S=(0,Z.useRef)(!1),C=async(e,t)=>{let n=await o.verifyPasswordReset({token:e},t);b.current=n,l(``),i(`password`)};(0,Z.useEffect)(()=>{if(S.current||e===null)return;if(S.current=!0,e.kind!==`password-reset`){e.kind===`invalid-password-reset`&&(y(`This reset link is incomplete or expired. Request a new one.`),i(`request`));return}let n=new AbortController;return _(!0),C(e.token,n.signal).catch(e=>y(hn(e,`This reset link could not be verified.`))).finally(()=>{t(),n.signal.aborted||_(!1)}),()=>n.abort()},[e,t]);let w=async e=>{if(e.preventDefault(),!g){_(!0),y(null);try{if(r===`request`)await o.requestPasswordReset({identifier:a.trim().toLowerCase()}),i(`check-email`);else if(r===`check-email`)await C(c.trim());else if(r===`password`){let e=b.current;if(e===null)return;if(u!==f){y(`The passwords do not match.`);return}let t=u;d(``),p(``),await o.finishPasswordReset({attemptId:e.attemptId,attemptSecret:e.attemptSecret,password:t,factor:e.requiresTotp?{kind:`totp`,code:m.trim()}:{kind:`none`}}),h(``),b.current=null,i(`complete`)}}catch(e){y(hn(e,`Password reset did not complete.`))}finally{_(!1)}}},T=r===`request`?1:r===`check-email`||r===`verifying`?2:3;return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void w(e),children:[r===`complete`?null:(0,$.jsx)(un,{step:T,total:3,label:T===1?`Find your account`:T===2?`Check your email`:`Set a new password`}),r===`request`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-identifier`,children:`Username or verified email`}),(0,$.jsx)(Y,{id:`hub-reset-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:a,className:J,onChange:e=>s(e.currentTarget.value)}),(0,$.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`If the account is eligible, its verified address receives a single-use reset link.`})]}):r===`check-email`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(et,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Check your email`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Open the reset link, or paste its token below.`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-token`,children:`Reset token`}),(0,$.jsx)(Y,{id:`hub-reset-token`,type:`password`,autoComplete:`one-time-code`,maxLength:64,required:!0,value:c,className:J,onChange:e=>l(e.currentTarget.value)})]})]}):r===`password`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-password`,children:`New password`}),(0,$.jsx)(Y,{id:`hub-reset-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:u,className:J,onChange:e=>d(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(Y,{id:`hub-reset-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:f,className:J,onChange:e=>p(e.currentTarget.value)})]}),b.current?.requiresTotp?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-reset-totp`,children:`Authenticator code`}),(0,$.jsx)(Y,{id:`hub-reset-totp`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:m,className:J,onChange:e=>h(e.currentTarget.value)})]}):null]}):r===`complete`?(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(G,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:`Password changed`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`Every previous session was revoked. Sign in again with the new password and its normal second factor.`})]}):(0,$.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:`Verifying your reset link…`}),(0,$.jsx)(wn,{value:v}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${Je}`,children:(0,$.jsx)(x,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Tn,{onCancel:n,pending:g,submitLabel:r===`request`?`Send reset email`:r===`check-email`?`Verify reset token`:r===`password`?`Change password`:`Verifying…`,submitDisabled:r===`verifying`})]})}function Cn({onCancel:e}){let[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(!1),[a,s]=(0,Z.useState)(null),c=async e=>{if(e.preventDefault(),r)return;i(!0),s(null);let a=t;n(``);try{await o.signInWithRecoveryCode(a),await q.bootstrap()}catch(e){s(hn(e,`That recovery code could not be used.`))}finally{i(!1)}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void c(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(A,{htmlFor:`hub-login-recovery-code`,children:`Recovery code`}),(0,$.jsx)(Y,{id:`hub-login-recovery-code`,type:`password`,autoComplete:`one-time-code`,required:!0,maxLength:128,value:t,className:J,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsx)(wn,{value:a}),(0,$.jsx)(Tn,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function wn(e){let t=(0,Q.c)(2),{value:n}=e,r;return t[0]===n?r=t[1]:(r=n?(0,$.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,t[0]=n,t[1]=r),r}function Tn(e){let t=(0,Q.c)(12),{onCancel:n,pending:r,submitLabel:i,submitDisabled:a}=e,o=r||a!==void 0&&a,s;t[0]===r?s=t[1]:(s=r?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):null,t[0]=r,t[1]=s);let c=r?`Working…`:i,l;t[2]!==o||t[3]!==s||t[4]!==c?(l=(0,$.jsxs)(x,{type:`submit`,size:`lg`,className:`min-h-11 w-full`,disabled:o,children:[s,c]}),t[2]=o,t[3]=s,t[4]=c,t[5]=l):l=t[5];let u;t[6]!==n||t[7]!==r?(u=(0,$.jsx)(x,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,disabled:r,onClick:n,children:`Back`}),t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;return t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${Je}`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}var En;function Dn(){if(window.location.pathname!==`/email-verification`)return null;if(En!==void 0)return En;let e=it({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return En=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,En}function On(){let e=(0,Q.c)(3),t=Ue(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=Xe(t===null?void 0:We(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function kn(){let e=(0,Q.c)(30),[t,n]=(0,Z.useState)(Dn),r=f(Ln),i=f(In),o=f(Fn),s=f(Pn),c=f(Nn),l=f(Mn),d=a(jn),p=H(),m;e[0]===p.logicalPathname?m=e[1]:(m=B(p.logicalPathname),e[0]=p.logicalPathname,e[1]=m);let h=m,g;e[2]===h?g=e[3]:(g=e=>y(e,h),e[2]=h,e[3]=g);let _=u(g),v=ne();V();let b;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],e[4]=b):b=e[4],(0,Z.useEffect)(An,b),at(),On();let x=Ue(),S;e[5]!==r||e[6]!==x?.kind?(S=()=>{r===`authenticated`&&x?.kind===`sign-up`&&Be(`/`,{replace:!0})},e[5]=r,e[6]=x?.kind,e[7]=S):S=e[7];let C;if(e[8]!==r||e[9]!==x?(C=[r,x],e[8]=r,e[9]=x,e[10]=C):C=e[10],(0,Z.useEffect)(S,C),t?.kind===`email-verification`||t?.kind===`invalid-email-verification`){let r;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{window.history.replaceState(window.history.state,``,`/`),n(null)},e[11]=r):r=e[11];let i;return e[12]===t?i=e[13]:(i=(0,$.jsx)(Rn,{link:t,onContinue:r}),e[12]=t,e[13]=i),i}if(r!==`authenticated`){let t;return e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Jn,{}),e[14]=t):t=e[14],t}if(o.length>0&&!d){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Zn,{}),e[15]=t):t=e[15],t}if(x?.kind===`account`){let t;return e[16]===x.section?t=e[17]:(t=(0,$.jsx)(en,{section:x.section}),e[16]=x.section,e[17]=t),t}if(x?.kind===`nodes`||x?.kind===`nodes-enroll`){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(nr,{}),e[18]=t):t=e[18],t}if(p.nodeId===null){if(v||p.malformed){let t;return e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(nr,{}),e[19]=t):t=e[19],t}if(i&&c){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(L,{authGateState:{status:`hosted-hub`}}),e[20]=t):t=e[20],t}let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(L,{authGateState:{status:`hosted-cached`}}),e[21]=t):t=e[21],t}if(!i||i.id!==p.nodeId){let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Wn,{}),e[22]=t):t=e[22],t}if(s===`terminal-failure`){let t;return e[23]!==l||e[24]!==i?(t=(0,$.jsx)(Vn,{node:i,message:l}),e[23]=l,e[24]=i,e[25]=t):t=e[25],t}if(!c){if(_){let t;return e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(L,{authGateState:{status:`hosted-cached`}}),e[26]=t):t=e[26],t}let t;return e[27]===i?t=e[28]:(t=(0,$.jsx)(Gn,{node:i}),e[27]=i,e[28]=t),t}let w;return e[29]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(L,{authGateState:{status:`hosted-hub`}}),e[29]=w):w=e[29],w}function An(){return P()}function jn(e){return e.leased}function Mn(e){return e.errorMessage}function Nn(e){return e.sessionEstablished}function Pn(e){return e.transportStatus}function Fn(e){return e.recoveryCodes}function In(e){return e.selectedNode}function Ln(e){return e.accountStatus}function Rn(e){let t=(0,Q.c)(15),{link:n,onContinue:r}=e,[i,a]=(0,Z.useState)(n.kind===`email-verification`?`verifying`:`invalid`),s;t[0]!==n.kind||t[1]!==n.token?(s=()=>{if(n.kind!==`email-verification`)return;let e=new AbortController;return o.confirmEmailVerification(n.token,e.signal).then(()=>a(`verified`)).catch(()=>{e.signal.aborted||a(`invalid`)}).finally(zn),()=>e.abort()},t[0]=n.kind,t[1]=n.token,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=[n],t[3]=n,t[4]=c),(0,Z.useEffect)(s,c);let l=i===`verifying`?`Verifying your email`:i===`verified`?`Email verified`:`This verification link is unavailable`,u=i===`verifying`?`This will only take a moment.`:i===`verified`?`Your address is now available for account recovery.`:`The link is incomplete, expired, or has already been used. Request a new one from Account settings.`,d;t[5]!==r||t[6]!==i?(d=i===`verifying`?void 0:(0,$.jsx)(x,{size:`cta`,className:`mt-6 w-full`,onClick:r,children:`Continue`}),t[5]=r,t[6]=i,t[7]=d):d=t[7];let f;t[8]===i?f=t[9]:(f=i===`verifying`?(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Bn,{}),`Confirming the link…`]}):null,t[8]=i,t[9]=f);let p;return t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,$.jsx)(cn,{title:l,description:u,actions:d,children:f}),t[10]=l,t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14],p}function zn(){En=void 0}function Bn(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{"aria-hidden":!0,className:`mr-2 inline size-4 animate-spin align-[-0.15em] motion-reduce:animate-none`}),e[0]=t):t=e[0],t}function Vn(e){let t=(0,Q.c)(10),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(W,{}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(b,{"aria-hidden":!0,className:`size-8 text-destructive`}),t[1]=a):a=t[1];let o=`Unable to connect to ${n.label}`,s=r??`The relay session could not be established. Choose another node or retry.`,c;t[2]===s?c=t[3]:(c=(0,$.jsx)(`p`,{role:`alert`,className:`text-muted-foreground text-sm`,children:s}),t[2]=s,t[3]=c);let l;t[4]===r?l=t[5]:(l=r===`Ryco state could not be synchronized.`?(0,$.jsxs)(x,{className:`mt-5`,onClick:Hn,children:[(0,$.jsx)(se,{"aria-hidden":!0}),` Retry`]}):null,t[4]=r,t[5]=l);let u;return t[6]!==o||t[7]!==c||t[8]!==l?(u=(0,$.jsx)(Xt,{measure:`content`,trailing:i,children:(0,$.jsxs)(Un,{tone:`destructive`,icon:a,title:o,children:[c,l]})}),t[6]=o,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function Hn(){q.retrySelectedNode()}function Un(e){let t=(0,Q.c)(9),{children:n,icon:r,title:i,tone:a}=e,o=`mt-4 font-semibold text-2xl tracking-tight ${(a===void 0?`default`:a)===`destructive`?`text-foreground`:``}`,s;t[0]!==o||t[1]!==i?(s=(0,$.jsx)(`h1`,{className:o,children:i}),t[0]=o,t[1]=i,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=(0,$.jsx)(`div`,{className:`mt-2`,children:n}),t[3]=n,t[4]=c);let l;return t[5]!==r||t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`mx-auto flex max-w-lg flex-col items-center pt-10 text-center`,children:[r,s,c]}),t[5]=r,t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function Wn(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(Xt,{measure:`content`,children:(0,$.jsx)(Un,{icon:t,title:`Restoring your node`,children:(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Bn,{}),`Checking your access before reconnecting…`]})})}),e[1]=n):n=e[1],n}function Gn(e){let t=(0,Q.c)(7),{node:n}=e,{returnToAllNodes:r}=z(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(I,{"aria-hidden":!0,className:`size-8 text-primary`}),t[0]=i):i=t[0];let a=`Connecting to ${n.label}`,o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Bn,{}),`Preparing a private relay session and synchronizing Ryco state…`]}),t[1]=o):o=t[1];let s;t[2]===r?s=t[3]:(s=(0,$.jsx)(x,{variant:`outline`,className:`mt-5 phone:min-h-11`,onClick:()=>void r(),children:`Back to nodes`}),t[2]=r,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,$.jsx)(Xt,{measure:`content`,children:(0,$.jsxs)(Un,{icon:i,title:a,children:[o,s]})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function Kn(e){let t=(0,Q.c)(15),{bootstrapAvailable:n,publicSignupEnabled:r}=e,[i,a]=(0,Z.useState)(!1),o=(0,Z.useId)(),s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>a(qn),t[0]=s):s=t[0];let c=`transition-transform ${i?`rotate-180`:``}`,l;t[1]===c?l=t[2]:(l=(0,$.jsx)(_,{"aria-hidden":!0,className:c}),t[1]=c,t[2]=l);let u;t[3]!==i||t[4]!==o||t[5]!==l?(u=(0,$.jsxs)(x,{variant:`ghost`,size:`sm`,"aria-expanded":i,"aria-controls":o,className:`-mx-2 h-auto min-h-8 max-w-full whitespace-normal py-1.5 text-left phone:min-h-11`,onClick:s,children:[`New to this Hub?`,l]}),t[3]=i,t[4]=o,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==r?(d=i?(0,$.jsxs)(`div`,{id:o,className:`mt-2 space-y-2 text-xs leading-relaxed text-muted-foreground`,children:[(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`Getting access.`}),` Accounts are`,r?` open to signup on this Hub. Verify your email, then choose a passkey or password.`:` created by invitation. An owner sends you an invitation code; redeem it below to create your account.`]}),(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`What a passkey is here.`}),` The passkey is created by your browser or password manager and never leaves it. It is the only credential this Hub treats as strong.`]}),n?(0,$.jsxs)(`p`,{children:[(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:`If this Hub is brand new.`}),` No owner exists yet. “Set up first owner” claims this Hub with a bootstrap credential from whoever deployed it.`]}):null]}):null,t[7]=n,t[8]=i,t[9]=o,t[10]=r,t[11]=d):d=t[11];let f;return t[12]!==u||t[13]!==d?(f=(0,$.jsxs)(`div`,{className:`mt-4`,children:[u,d]}),t[12]=u,t[13]=d,t[14]=f):f=t[14],f}function qn(e){return!e}function Jn({context:e=`hub`,autoExternalProvider:t=null}={}){let n=f(e=>e.accountStatus),r=f(e=>e.errorMessage),i=f(e=>e.errorReason??null),a=f(e=>e.bootstrapAvailable),[s,l]=(0,Z.useState)(()=>it({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)})),u=(0,Z.useCallback)(()=>l(null),[]),{config:d}=_n(),p=c(e=>e.externalIdentityConfiguration),h=Le(p),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),S=(0,Z.useRef)(!1),[C,w]=(0,Z.useState)(void 0),T=Ue(),E=T?.kind===`sign-up`||T?.kind===`sign-up-verify`?`public`:T?.kind===`invitation`?`invitation`:T?.kind===`setup`?`bootstrap`:null,O=T?.kind===`sign-in-password`?`password`:T?.kind===`sign-in-recovery-code`?`recovery-code`:T?.kind===`reset-password`?`password-reset`:null,k=e=>{Ve(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},A=e=>{Ve(e===`password`?{kind:`sign-in-password`}:e===`recovery-code`?{kind:`sign-in-recovery-code`}:e===`password-reset`?{kind:`reset-password`}:{kind:`sign-in`})},j=(0,Z.useRef)(null),M=(0,Z.useRef)(null),N=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{q.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(E!==`public`&&e!==`native-authorization`){w(void 0);return}let t=new AbortController;return w(void 0),o.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||w(e)}).catch(()=>{t.signal.aborted||w({status:`none`})}),()=>t.abort()},[e,E]);let P=(0,Z.useCallback)(async()=>{if(!g){_(!0),y(null);try{await Re({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:He({kind:`sign-up`}),start:e=>o.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){y(e instanceof le?e.message:`GitHub sign-in is temporarily unavailable.`),_(!1)}}},[e,g]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||h?.login!==!0||C?.status!==`none`||S.current||(S.current=!0,P())},[t,e,C?.status,h?.login,P,n]),(0,Z.useEffect)(()=>{E===`invitation`||E===`bootstrap`?M.current?.focus({preventScroll:!0}):j.current?.focus({preventScroll:!0})},[O,E]),(0,Z.useEffect)(()=>{N.current?.scrollTo({top:0,left:0})},[O,E]);let F=E===`invitation`||E===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${Je}`,children:[(0,$.jsx)(x,{type:`submit`,form:Yn,className:`phone:min-h-11`,disabled:n===`authenticating`,children:E===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(x,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>q.cancelAuthentication():()=>k(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,I=E||O?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${Je}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[h?.login?(0,$.jsxs)(x,{size:`lg`,className:`phone:min-h-11`,disabled:g||n===`authenticating`||n===`signing-out`,onClick:()=>void P(),children:[g?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(D,{"aria-hidden":!0}),g?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(x,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void q.signIn(),children:[(0,$.jsx)(ie,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(x,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>q.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[d?.status===`enabled`?(0,$.jsx)(x,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`public`),children:`Create account`}):null,(0,$.jsx)(x,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(x,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>k(`bootstrap`),children:`Set up first owner`}):null]})]})}),L=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(x,{className:`mt-3 phone:min-h-11`,variant:`ghost`,onClick:()=>void q.bootstrap(),children:[(0,$.jsx)(se,{"aria-hidden":!0}),` Retry Hub`]}):null,(0,$.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:n===`authenticating`?`Passkey authentication is in progress.`:``})]}),R=i?K(i):null,z=v??r??R?.message,B=v===null&&R!==null?R.title:`Sign-in did not complete`,V=z?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`error`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(be,{children:B}),(0,$.jsx)(xe,{children:z})]})}):null,H=C?.status===`signup`?C:null,U=C?.status===`error`?C:null,ee=e===`native-authorization`&&E!==`public`;if(E===`public`||ee&&(H!==null||U!==null)){let e=()=>{ee?w({status:`none`}):k(null)};return(0,$.jsxs)(cn,{title:`Create your account`,description:ee?`Choose your Ryco username, then return to approving this device.`:`Pick a username and confirm your email. You choose a passkey or a password at the end.`,trailing:L,scrollRef:N,titleRef:j,children:[V,C===void 0?(0,$.jsx)(ve,{className:`h-64 w-full rounded-2xl`}):H?(0,$.jsx)(bn,{pendingSignup:H,config:d?.status===`enabled`?d:null,onCancel:e}):U?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(Se,{variant:`warning`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(be,{children:`GitHub signup did not continue`}),(0,$.jsx)(xe,{children:Ie(U.code)})]}),(0,$.jsx)(x,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(yn,{config:d?.status===`enabled`?d:null,initialLink:s,onConsumeLink:u,onCancel:()=>{u(),k(null)}})]})}if(E===`invitation`||E===`bootstrap`)return(0,$.jsxs)(cn,{title:E===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:E===`invitation`?`Enter the invitation code an owner sent you. Your browser creates a passkey at the same time.`:`No owner exists yet. The bootstrap credential from whoever deployed this Hub makes you its first owner.`,actions:F,trailing:L,scrollRef:N,titleRef:j,children:[V,(0,$.jsx)(Xn,{mode:E,credentialRef:M})]});if(O!==null){let e={password:{title:`Sign in with a password`,description:`Password sign-in always asks for a second factor — an authenticator code, or a code sent to your verified email.`},"recovery-code":{title:`Use a recovery code`,description:`One of the single-use codes you saved when your account was created. Each code works once.`},"password-reset":{title:`Reset your password`,description:`We email a single-use link. Setting a new password signs out every device, including this one.`}}[O];return(0,$.jsxs)(cn,{title:e.title,description:e.description,trailing:L,scrollRef:N,titleRef:j,children:[V,O===`password`?(0,$.jsx)(xn,{onCancel:()=>A(null),onUseRecoveryCode:()=>A(`recovery-code`),onResetPassword:()=>A(`password-reset`)}):O===`recovery-code`?(0,$.jsx)(Cn,{onCancel:()=>A(null)}):(0,$.jsx)(Sn,{initialLink:s,onConsumeLink:u,onCancel:()=>{u(),A(null)}})]})}return(0,$.jsxs)(cn,{title:e===`native-authorization`?`Sign in to continue on your device`:n===`session-expired`?`Your session expired`:`Connect to your Ryco nodes`,description:e===`native-authorization`?`Authenticate in this browser first. Ryco will ask again before it authorizes the mobile app.`:`Ryco Hub reaches the developer machines an owner has authorized for your account. Your session lives in an HttpOnly cookie — nothing about it is readable by this page.`,actions:I,trailing:L,scrollRef:N,titleRef:j,children:[(0,$.jsx)(Ge,{}),(0,$.jsx)(Kn,{bootstrapAvailable:a,publicSignupEnabled:d?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(x,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>A(`password`),children:[(0,$.jsx)(Qe,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(te,{}),V]})}var Yn=`hub-registration-form`;function Xn(e){let t=(0,Q.c)(29),{mode:n,credentialRef:r}=e,[i,a]=(0,Z.useState)(``),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),u;t[0]!==i||t[1]!==o||t[2]!==n||t[3]!==c?(u=async e=>{e.preventDefault();let t=i;a(``);let r={displayName:o.trim(),passkeyLabel:c.trim()||null};n===`invitation`?await q.redeemInvitation({secret:t,...r}):await q.bootstrapOwner({credential:t,...r})},t[0]=i,t[1]=o,t[2]=n,t[3]=c,t[4]=u):u=t[4];let d=u,f;t[5]===d?f=t[6]:(f=e=>void d(e),t[5]=d,t[6]=f);let p=n===`invitation`?`Invitation code`:`Bootstrap credential`,m;t[7]===p?m=t[8]:(m=(0,$.jsx)(A,{htmlFor:`hub-registration-credential`,children:p}),t[7]=p,t[8]=m);let h;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>a(e.currentTarget.value),t[9]=h):h=t[9];let g;t[10]!==i||t[11]!==r?(g=(0,$.jsx)(Y,{ref:r,id:`hub-registration-credential`,type:`password`,required:!0,maxLength:128,value:i,className:J,onChange:h}),t[10]=i,t[11]=r,t[12]=g):g=t[12];let _;t[13]!==m||t[14]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[m,g]}),t[13]=m,t[14]=g,t[15]=_):_=t[15];let v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(A,{htmlFor:`hub-display-name`,children:`Display name`}),t[16]=v):v=t[16];let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>s(e.currentTarget.value),t[17]=y):y=t[17];let b;t[18]===o?b=t[19]:(b=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[v,(0,$.jsx)(Y,{id:`hub-display-name`,required:!0,maxLength:200,value:o,className:J,onChange:y})]}),t[18]=o,t[19]=b);let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(A,{htmlFor:`hub-passkey-label`,children:[`Passkey label `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),t[20]=x):x=t[20];let S;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>l(e.currentTarget.value),t[21]=S):S=t[21];let C;t[22]===c?C=t[23]:(C=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[x,(0,$.jsx)(Y,{id:`hub-passkey-label`,maxLength:100,value:c,className:J,onChange:S})]}),t[22]=c,t[23]=C);let w;return t[24]!==b||t[25]!==C||t[26]!==f||t[27]!==_?(w=(0,$.jsxs)(`form`,{id:Yn,className:`mt-6 space-y-4`,onSubmit:f,autoComplete:`off`,children:[_,b,C]}),t[24]=b,t[25]=C,t[26]=f,t[27]=_,t[28]=w):w=t[28],w}function Zn(){let e=(0,Q.c)(20),t=f(er),{copyToClipboard:n,isCopied:r}=p(),a=`Save all ${String(t.length)} codes — they are shown once and cannot be retrieved later. Ryco does not save them in browser storage.`,o;e[0]!==n||e[1]!==t?(o=()=>n(Fe(t),void 0),e[0]=n,e[1]=t,e[2]=o):o=e[2];let c;e[3]===r?c=e[4]:(c=r?(0,$.jsx)(s,{"aria-hidden":!0}):(0,$.jsx)(i,{"aria-hidden":!0}),e[3]=r,e[4]=c);let l=r?`Copied`:`Copy codes`,u;e[5]!==o||e[6]!==c||e[7]!==l?(u=(0,$.jsxs)(x,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:o,children:[c,l]}),e[5]=o,e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(x,{size:`cta`,className:`mt-3 w-full`,onClick:$n,children:`I saved the codes`}),e[9]=d):d=e[9];let m;e[10]===u?m=e[11]:(m=(0,$.jsxs)(`div`,{className:`phone:mt-auto ${Je}`,children:[u,d]}),e[10]=u,e[11]=m);let h;e[12]===t?h=e[13]:(h=t.map(Qn),e[12]=t,e[13]=h);let g;e[14]===h?g=e[15]:(g=(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:h}),e[14]=h,e[15]=g);let _;return e[16]!==a||e[17]!==m||e[18]!==g?(_=(0,$.jsx)(cn,{title:`Save your recovery codes`,description:a,actions:m,children:g}),e[16]=a,e[17]=m,e[18]=g,e[19]=_):_=e[19],_}function Qn(e){return(0,$.jsx)(`li`,{children:e},e)}function $n(){return q.dismissRecoveryCodes()}function er(e){return e.recoveryCodes}function tr(e){let t=(0,Q.c)(38),{node:n,nowMs:r,disabled:i,onConnect:a,onOpenDetail:o}=e,s;t[0]!==n||t[1]!==r?(s=jt(n,r),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]===n?l=t[4]:(l=N(n),t[3]=n,t[4]=l);let u=l,d=i||u,f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(I,{"aria-hidden":!0,className:`size-4`})}),t[5]=f):f=t[5];let p;t[6]===n.label?p=t[7]:(p=(0,$.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),t[6]=n.label,t[7]=p);let m;t[8]===n?m=t[9]:(m=Mt(n),t[8]=n,t[9]=m);let h;t[10]===m?h=t[11]:(h=(0,$.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:m}),t[10]=m,t[11]=h);let g;t[12]===u?g=t[13]:(g=u?(0,$.jsx)(`span`,{className:`block truncate text-xs font-medium text-muted-foreground`,children:`Open in Desktop/Mobile`}):null,t[12]=u,t[13]=g);let _;t[14]!==p||t[15]!==h||t[16]!==g?(_=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[p,h,g]}),t[14]=p,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]===n?v=t[19]:(v=(0,$.jsx)(U,{node:n}),t[18]=n,t[19]=v);let y;t[20]===c?y=t[21]:(y=c?(0,$.jsx)(`span`,{className:`whitespace-nowrap text-[11px] text-muted-foreground max-sm:hidden phone:hidden`,children:c}):null,t[20]=c,t[21]=y);let b;t[22]!==v||t[23]!==y?(b=(0,$.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[v,y]}),t[22]=v,t[23]=y,t[24]=b):b=t[24];let x;t[25]!==a||t[26]!==b||t[27]!==d||t[28]!==_?(x=(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:a,className:`flex min-h-16 min-w-0 flex-1 flex-wrap items-center gap-3 px-4 py-3 text-left outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:opacity-60 disabled:hover:bg-transparent phone:min-h-18`,children:[f,_,b]}),t[25]=a,t[26]=b,t[27]=d,t[28]=_,t[29]=x):x=t[29];let S;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`w-px shrink-0 bg-border/60`}),t[30]=S):S=t[30];let C=`Node details: ${n.label}`,w;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(re,{"aria-hidden":!0,className:`size-4`}),t[31]=w):w=t[31];let T;t[32]!==o||t[33]!==C?(T=(0,$.jsx)(`button`,{type:`button`,"aria-label":C,onClick:o,className:`flex w-[44px] shrink-0 items-center justify-center text-muted-foreground outline-none hover:bg-accent/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:w}),t[32]=o,t[33]=C,t[34]=T):T=t[34];let E;return t[35]!==x||t[36]!==T?(E=(0,$.jsxs)(`li`,{className:`flex items-stretch overflow-hidden rounded-xl border border-border bg-background`,children:[x,S,T]}),t[35]=x,t[36]=T,t[37]=E):E=t[37],E}function nr(){let e=(0,Q.c)(110),t=f(gr),n=f(hr),r=f(mr),i=f(pr),a=f(fr),s=f(dr),c=ne(),l=F(),u=ye()===`phone`,d=Ue()?.kind===`nodes-enroll`,p=ur,[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(null),y=(0,Z.useRef)(null),S=ze(6e4),C,w;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{y.current?.focus({preventScroll:!0})},w=[],e[0]=C,e[1]=w):(C=e[0],w=e[1]),(0,Z.useEffect)(C,w);let T;e[2]===l?T=e[3]:(T=async e=>{ee(e.id)||(await l({to:`/`,replace:!0}),await q.selectNode(e.id))},e[2]=l,e[3]=T);let E=T;if(d){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Xt,{measure:`content`,children:(0,$.jsx)(ln,{onClose:()=>p(!1)})}),e[4]=t):t=e[4],t}let D,O,k,A,j,M,N,P,L,R,z,B,V,H,U,W,re,ie;if(e[5]!==a||e[6]!==r||e[7]!==h||e[8]!==i||e[9]!==u||e[10]!==t||e[11]!==S||e[12]!==_||e[13]!==c||e[14]!==E||e[15]!==s||e[16]!==n){let o=Nt(t),l;e[35]!==h||e[36]!==t?(l=h===null?null:t.find(e=>e.id===h)??null,e[35]=h,e[36]=t,e[37]=l):l=e[37],A=l,N=a?.role===`owner`;let d=n===`ready`&&t.length===0;M=N&&!d;let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(x,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:lr,children:[(0,$.jsx)(ce,{"aria-hidden":!0}),` Account`]}),e[38]=f):f=e[38],k=f;let v;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsxs)(x,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:cr,children:[(0,$.jsx)(ae,{"aria-hidden":!0}),` Sign out`]}),e[39]=v):v=e[39],L=v;let C=u?`mt-3 phone:min-h-11 phone:w-full`:void 0,w,T;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>p(!0),T=(0,$.jsx)(I,{"aria-hidden":!0}),e[40]=w,e[41]=T):(w=e[40],T=e[41]);let F;e[42]===C?F=e[43]:(F=(0,$.jsxs)(x,{className:C,onClick:w,children:[T,` Enroll node`]}),e[42]=C,e[43]=F),j=F;let ee=u?`mt-3 phone:min-h-11 phone:w-full`:void 0,te=n===`loading`,ne;e[44]===n?ne=e[45]:(ne=n===`loading`?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,$.jsx)(se,{"aria-hidden":!0}),e[44]=n,e[45]=ne);let oe;e[46]!==ee||e[47]!==te||e[48]!==ne?(oe=(0,$.jsxs)(x,{className:ee,variant:`outline`,disabled:te,onClick:sr,children:[ne,`Refresh nodes`]}),e[46]=ee,e[47]=te,e[48]=ne,e[49]=oe):oe=e[49],P=oe,O=Xt;let G;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(x,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:or,children:(0,$.jsx)(ce,{"aria-hidden":!0})}),e[50]=G):G=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsxs)($.Fragment,{children:[G,(0,$.jsx)(x,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:ar,children:(0,$.jsx)(ae,{"aria-hidden":!0})})]}),e[51]=z):z=e[51],D=Ht,B=y,V=t.length===1?`Your node`:`Your nodes`;let le=a?.displayName??`Hub account`,K;e[52]===a?K=e[53]:(K=a?` · ${a.role.charAt(0).toUpperCase()}${a.role.slice(1)}`:``,e[52]=a,e[53]=K);let ue;e[54]!==le||e[55]!==K?(ue=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,le,K]}),e[54]=le,e[55]=K,e[56]=ue):ue=e[56];let q;e[57]===t?q=e[58]:(q=t.length>1?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:It(t)}):null,e[57]=t,e[58]=q),e[59]!==ue||e[60]!==q?(H=(0,$.jsxs)($.Fragment,{children:[ue,q]}),e[59]=ue,e[60]=q,e[61]=H):H=e[61],e[62]!==j||e[63]!==M||e[64]!==u||e[65]!==P?(U=u?void 0:(0,$.jsxs)($.Fragment,{children:[P,M?j:null]}),e[62]=j,e[63]=M,e[64]=u,e[65]=P,e[66]=U):U=e[66],e[67]===n?W=e[68]:(W=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`warning`,role:`status`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(xe,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=W),e[69]===_?re=e[70]:(re=_?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`warning`,role:`status`,children:[(0,$.jsx)(b,{"aria-hidden":!0}),(0,$.jsx)(xe,{children:_})]})}):null,e[69]=_,e[70]=re);let J=n===`stale`?null:i;e[71]!==c||e[72]!==s||e[73]!==J?(ie=(0,$.jsx)(_r,{selection:s,routeNotice:c,error:J}),e[71]=c,e[72]=s,e[73]=J,e[74]=ie):ie=e[74],R=d?(0,$.jsx)(vr,{isOwner:N,onEnroll:()=>p(!0)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`ul`,{role:`list`,className:`mt-5 space-y-2`,"aria-busy":n===`loading`,children:[o.map(e=>(0,$.jsx)(tr,{node:e,nowMs:S,disabled:Lt({directoryStatus:n,browserStatus:r,node:e}),onConnect:()=>void E(e),onOpenDetail:()=>g(e.id)},`${e.id}:${e.environmentId}`)),n===`loading`&&t.length===0?(0,$.jsx)($.Fragment,{children:[0,1,2].map(ir)}):null]}),n===`loading`&&t.length===0?(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:`Loading authorized nodes…`}):null,t.length>0?(0,$.jsx)(`p`,{className:`mt-2 px-1 text-[11px] text-muted-foreground`,children:`Presence refreshes about every 20 seconds.`}):null]}),e[5]=a,e[6]=r,e[7]=h,e[8]=i,e[9]=u,e[10]=t,e[11]=S,e[12]=_,e[13]=c,e[14]=E,e[15]=s,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=A,e[21]=j,e[22]=M,e[23]=N,e[24]=P,e[25]=L,e[26]=R,e[27]=z,e[28]=B,e[29]=V,e[30]=H,e[31]=U,e[32]=W,e[33]=re,e[34]=ie}else D=e[17],O=e[18],k=e[19],A=e[20],j=e[21],M=e[22],N=e[23],P=e[24],L=e[25],R=e[26],z=e[27],B=e[28],V=e[29],H=e[30],U=e[31],W=e[32],re=e[33],ie=e[34];let oe,G;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Ge,{})}),G=(0,$.jsx)(te,{}),e[75]=oe,e[76]=G):(oe=e[75],G=e[76]);let le;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{e||g(null)},e[77]=le):le=e[77];let K;e[78]===E?K=e[79]:(K=e=>void E(e),e[78]=E,e[79]=K);let ue;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(ue=async e=>{await o.revokeNode(e.id,ft),v(_t(e.label)),await q.refreshDirectory(),g(null)},e[80]=ue):ue=e[80];let J;e[81]!==r||e[82]!==A||e[83]!==N||e[84]!==n||e[85]!==K?(J=(0,$.jsx)(Vt,{node:A,directoryStatus:n,browserStatus:r,canRename:N,canRevoke:N,onOpenChange:le,onConnect:K,onRename:rr,onRevoke:ue}),e[81]=r,e[82]=A,e[83]=N,e[84]=n,e[85]=K,e[86]=J):J=e[86];let Y;e[87]!==D||e[88]!==R||e[89]!==J||e[90]!==B||e[91]!==V||e[92]!==H||e[93]!==U||e[94]!==W||e[95]!==re||e[96]!==ie?(Y=(0,$.jsxs)(D,{titleRef:B,title:V,description:H,actions:U,children:[W,re,ie,R,oe,G,J]}),e[87]=D,e[88]=R,e[89]=J,e[90]=B,e[91]=V,e[92]=H,e[93]=U,e[94]=W,e[95]=re,e[96]=ie,e[97]=Y):Y=e[97];let de;e[98]!==k||e[99]!==j||e[100]!==M||e[101]!==u||e[102]!==P||e[103]!==L?(de=u?(0,$.jsxs)(`div`,{className:`mt-auto ${Je}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,L]}),M?j:null,P]}):null,e[98]=k,e[99]=j,e[100]=M,e[101]=u,e[102]=P,e[103]=L,e[104]=de):de=e[104];let fe;return e[105]!==O||e[106]!==z||e[107]!==Y||e[108]!==de?(fe=(0,$.jsxs)(O,{trailing:z,children:[Y,de]}),e[105]=O,e[106]=z,e[107]=Y,e[108]=de,e[109]=fe):fe=e[109],fe}async function rr(e,t){await o.renameNode(e.id,t),await q.refreshDirectory()}function ir(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(ve,{className:`h-16 w-full rounded-xl`})},e)}function ar(){q.signOut()}function or(){Ve({kind:`account`,section:`security`})}function sr(){q.refreshDirectory()}function cr(){q.signOut()}function lr(){Ve({kind:`account`,section:`security`})}function ur(e){return Ve(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function dr(e){return e.selectionStatus}function fr(e){return e.account}function pr(e){return e.errorMessage}function mr(e){return e.browserStatus}function hr(e){return e.directoryStatus}function gr(e){return e.nodes}function _r(e){let t=(0,Q.c)(3),{selection:n,routeNotice:r,error:i}=e,a=(n===`authorization-removed`?`Authorization for the previous node was removed.`:n===`revoked`?`The previous node or grant was revoked.`:n===`incompatible`?`The previous node uses an incompatible relay version.`:null)??r??i;if(!a)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,$.jsx)(b,{"aria-hidden":!0}),t[0]=o):o=t[0];let s;return t[1]===a?s=t[2]:(s=(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Se,{variant:`error`,children:[o,(0,$.jsx)(xe,{children:a})]})}),t[1]=a,t[2]=s),s}function vr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(ke,{variant:`icon`,children:n?(0,$.jsx)(I,{"aria-hidden":!0}):(0,$.jsx)(G,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Me,{children:`No nodes yet`}),t[2]=a):a=t[2];let o=n?`A node appears here once the Ryco client on that machine has been enrolled. Start enrollment on the node, then enter the short device code it shows — codes expire after ten minutes.`:`A node appears here once an owner of this Hub authorizes your account for it.`,s;t[3]===o?s=t[4]:(s=(0,$.jsx)(Ne,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Ae,{children:[i,a,s]}),t[5]=i,t[6]=s,t[7]=c):c=t[7];let l;t[8]!==n||t[9]!==r?(l=n?(0,$.jsx)(je,{children:(0,$.jsxs)(x,{className:`phone:min-h-11`,onClick:r,children:[(0,$.jsx)(I,{"aria-hidden":!0}),` Enroll node`]})}):null,t[8]=n,t[9]=r,t[10]=l):l=t[10];let u;return t[11]!==c||t[12]!==l?(u=(0,$.jsxs)(Pe,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}export{Jn as HostedAuthenticationSurface,kn as HostedHubRoot};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-D4CtFNPY.css"])))=>i.map(i=>d[i]);
2
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-DxCd1PgA.js";import{a as r}from"./primary-D_D7eLwT.js";import{c as i,t as a,ti as o}from"./src-BSuAGqhK.js";import{$n as s,Ma as c,Na as l,Nr as u,Oa as d,Or as f,_l as p,ea as m,gl as h,hl as g,kr as _,wa as v,zr as y}from"./runtime-Djy96GJd.js";import{t as b}from"./switch-DD1qVLgN.js";import{t as x}from"./compiler-runtime-qmuS0Svy.js";import{t as S}from"./badge-Dg7mXiOh.js";import{t as C}from"./bot-BR3RyOWP.js";import{K as w,Y as T}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as E}from"./chevron-right-CuUjBsQV.js";import{t as D}from"./key-round-D2DtQ7aS.js";import{t as O}from"./refresh-cw-DY3_Ph-S.js";import{t as k}from"./save-ugJXuJRM.js";import{t as A}from"./shield-check-CO4SMhAs.js";import{t as j}from"./unplug-DisTpujT.js";import{t as M}from"./wrench-Ds8eZerZ.js";import{t as N}from"./toastHelpers-CSQRKo4F.js";import{t as P}from"./input-DrOL1KPS.js";import{t as F}from"./capabilities-C8sxDbKT.js";import"./providerModels-bFbEIfL9.js";import{r as I}from"./providerDriverMeta-DNTocCcU.js";import{It as L}from"./main-BbtLAX7M.js";var R={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};R.node;var z=l(R),B={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};B.node;var V=l(B),H={name:`link-2-off`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]};H.node;var ee=l(H),te=()=>({integrations:[],topology:{available:!1,reason:`Not loaded.`},pairingCodes:{}}),ne=(e,t)=>({integrations:t.integrations,topology:t.topology,pairingCodes:{}}),re=(e,t)=>({...e,integrations:[...e.integrations.filter(e=>e.integration.integrationId!==t.detail.integration.integrationId),t.detail],pairingCodes:{...e.pairingCodes,[t.detail.integration.integrationId]:t.pairingCode}}),ie=(e,t)=>{let n={...e.pairingCodes};return delete n[t],{...e,integrations:e.integrations.filter(e=>e.integration.integrationId!==t),pairingCodes:n}},ae=()=>({installations:[]}),oe=e=>[...e].toSorted((e,t)=>e.driver.localeCompare(t.driver)||e.createdAt.localeCompare(t.createdAt)||e.installationId.localeCompare(t.installationId)),se=(e,t)=>({installations:oe(t.installations)}),U=(e,t)=>{let n=e.installations.find(e=>e.installationId===t.installation.installationId);return n&&n.revision>t.installation.revision?e:{installations:oe([...e.installations.filter(e=>e.installationId!==t.installation.installationId),t.installation])}},W=e(t(),1),G=x(),ce=[50,100,200,400],le=e=>e instanceof Error&&e.message.trim()===`Agent Control is disabled.`,ue=e=>new Promise(t=>window.setTimeout(t,e));async function de(e,t=ue){for(let n of ce)try{return await e()}catch(e){if(!le(e))throw e;await t(n)}return e()}var K=p(),fe={codex:`Codex`,"claude-code":`Claude Code`,"claude-desktop":`Claude Desktop`,"generic-mcp":`Generic MCP`},pe=[{capability:i.externalListProjects,label:`List allowed projects`,description:`Discover only projects inside this integration's scope.`},{capability:i.externalCreateTask,label:`Request tasks`,description:`Submit one task to Ryco's normal approval queue.`},{capability:i.externalReadTask,label:`Read own tasks`,description:`Read or wait only for tasks created by this integration.`},{capability:i.externalReadAutomations,label:`Read automations`,description:`Read bounded schedules and run outcomes inside the selected project scope.`},{capability:i.externalManageAutomations,label:`Request automations`,description:`Propose schedule changes; each due run still requires separate approval.`},{capability:i.externalReadActivity,label:`Read activity`,description:`Read bounded payload-free project and provider event summaries.`},{capability:i.externalReadDiagnostics,label:`Read diagnostics`,description:`Read redacted count-only health summaries for allowed projects.`},{capability:i.externalSharedCheckout,label:`Request shared checkout`,description:`May request the local checkout; each request still needs approval.`},{capability:i.externalFullAccess,label:`Request full access`,description:`May request a full-access runtime; each request still needs approval.`}],q=()=>({displayName:``,clientKind:`codex`,scopeKind:`all`,projectIds:``,capabilities:[i.externalListProjects,i.externalCreateTask,i.externalReadTask],expiresAt:``,rateLimitPerMinute:`60`,activeTaskLimit:`1`});function J(e,t){u.add(N({type:`error`,title:e,description:t instanceof Error?t.message:`The request failed.`}))}function me(e,t){return[e,...t.map(e=>JSON.stringify(e))].join(` `)}function Y(e){return e===null?`Never`:new Date(e).toLocaleString()}function he(e){let t=e.integration;return t.revokedAt===null?t.expiresAt!==null&&Date.parse(t.expiresAt)<=Date.now()?{label:`Expired`,variant:`error`}:t.pairingState===`paired`?{label:`Paired`,variant:`success`}:t.pairingState===`pending`?{label:`Pairing`,variant:`warning`}:{label:`Unpaired`,variant:`outline`}:{label:`Revoked`,variant:`error`}}function ge(e){let t=e.integration;return{displayName:t.displayName,clientKind:t.clientKind,scopeKind:t.projectScope.kind,projectIds:t.projectScope.kind===`selected`?t.projectScope.projectIds.join(`, `):``,capabilities:t.capabilities,expiresAt:t.expiresAt===null?``:new Date(t.expiresAt).toISOString().slice(0,16),rateLimitPerMinute:String(t.rateLimitPerMinute),activeTaskLimit:String(t.activeTaskLimit)}}function X(e){let t=e.projectIds.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>o.make(e)),n=e.scopeKind===`all`?{kind:`all`}:{kind:`selected`,projectIds:t},r=Number(e.rateLimitPerMinute),i=Number(e.activeTaskLimit);if(!e.displayName.trim())throw Error(`A display name is required.`);if(e.scopeKind===`selected`&&t.length===0)throw Error(`Enter at least one project ID for selected-project scope.`);if(!Number.isInteger(r)||r<1)throw Error(`Rate limit must be a positive whole number.`);if(!Number.isInteger(i)||i<1)throw Error(`Active-task limit must be a positive whole number.`);return{displayName:e.displayName.trim(),clientKind:e.clientKind,projectScope:n,capabilities:e.capabilities,expiresAt:e.expiresAt?new Date(e.expiresAt).toISOString():null,rateLimitPerMinute:r,activeTaskLimit:i}}function Z(e){let t=(0,G.c)(85),{form:n,onChange:r,clientLocked:i}=e,a=i!==void 0&&i,o;t[0]!==n||t[1]!==r?(o=e=>r({...n,displayName:e.target.value}),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s;t[3]!==n.displayName||t[4]!==o?(s=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Display name`,(0,K.jsx)(P,{value:n.displayName,placeholder:`Local Codex`,onChange:o})]}),t[3]=n.displayName,t[4]=o,t[5]=s):s=t[5];let c=n.clientKind,l;t[6]!==n||t[7]!==r?(l=e=>r({...n,clientKind:e.target.value}),t[6]=n,t[7]=r,t[8]=l):l=t[8];let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.entries(fe).map(_e),t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n.clientKind||t[12]!==l?(d=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Client`,(0,K.jsx)(`select`,{className:`h-9 rounded-lg border border-input bg-background px-3 text-sm`,value:c,disabled:a,onChange:l,children:u})]}),t[10]=a,t[11]=n.clientKind,t[12]=l,t[13]=d):d=t[13];let f;t[14]!==s||t[15]!==d?(f=(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[s,d]}),t[14]=s,t[15]=d,t[16]=f):f=t[16];let p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,K.jsx)(`legend`,{className:`text-xs font-medium`,children:`Project scope`}),t[17]=p):p=t[17];let m=n.scopeKind===`all`,h;t[18]!==n||t[19]!==r?(h=()=>r({...n,scopeKind:`all`}),t[18]=n,t[19]=r,t[20]=h):h=t[20];let g;t[21]!==m||t[22]!==h?(g=(0,K.jsx)(`input`,{type:`radio`,checked:m,onChange:h}),t[21]=m,t[22]=h,t[23]=g):g=t[23];let _;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsxs)(`span`,{children:[`All current and future projects`,(0,K.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`The client can discover every project on this local Ryco instance.`})]}),t[24]=_):_=t[24];let v;t[25]===g?v=t[26]:(v=(0,K.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[g,_]}),t[25]=g,t[26]=v);let y=n.scopeKind===`selected`,b;t[27]!==n||t[28]!==r?(b=()=>r({...n,scopeKind:`selected`}),t[27]=n,t[28]=r,t[29]=b):b=t[29];let x;t[30]!==y||t[31]!==b?(x=(0,K.jsx)(`input`,{type:`radio`,checked:y,onChange:b}),t[30]=y,t[31]=b,t[32]=x):x=t[32];let S=n.scopeKind!==`selected`,C;t[33]!==n||t[34]!==r?(C=e=>r({...n,projectIds:e.target.value}),t[33]=n,t[34]=r,t[35]=C):C=t[35];let w;t[36]!==n.projectIds||t[37]!==S||t[38]!==C?(w=(0,K.jsx)(P,{className:`mt-1.5`,value:n.projectIds,disabled:S,placeholder:`project-id-1, project-id-2`,"aria-label":`Selected project IDs`,onChange:C}),t[36]=n.projectIds,t[37]=S,t[38]=C,t[39]=w):w=t[39];let T;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,K.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`Comma-separated stable project IDs. Unknown IDs remain inaccessible.`}),t[40]=T):T=t[40];let E;t[41]===w?E=t[42]:(E=(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Selected projects`,w,T]}),t[41]=w,t[42]=E);let D;t[43]!==x||t[44]!==E?(D=(0,K.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[x,E]}),t[43]=x,t[44]=E,t[45]=D):D=t[45];let O;t[46]!==v||t[47]!==D?(O=(0,K.jsxs)(`fieldset`,{className:`grid gap-2`,children:[p,v,D]}),t[46]=v,t[47]=D,t[48]=O):O=t[48];let k;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,K.jsx)(`legend`,{className:`text-xs font-medium`,children:`Capability grants`}),t[49]=k):k=t[49];let A;t[50]!==n||t[51]!==r?(A=pe.map(e=>(0,K.jsxs)(`label`,{className:`flex items-start gap-2 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:n.capabilities.includes(e.capability),onChange:t=>r({...n,capabilities:t.target.checked?[...n.capabilities,e.capability]:n.capabilities.filter(t=>t!==e.capability)})}),(0,K.jsxs)(`span`,{children:[e.label,(0,K.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description})]})]},e.capability)),t[50]=n,t[51]=r,t[52]=A):A=t[52];let j;t[53]===A?j=t[54]:(j=(0,K.jsxs)(`fieldset`,{className:`grid gap-2`,children:[k,A]}),t[53]=A,t[54]=j);let M;t[55]!==n||t[56]!==r?(M=e=>r({...n,expiresAt:e.target.value}),t[55]=n,t[56]=r,t[57]=M):M=t[57];let N;t[58]!==n.expiresAt||t[59]!==M?(N=(0,K.jsx)(P,{type:`datetime-local`,value:n.expiresAt,onChange:M}),t[58]=n.expiresAt,t[59]=M,t[60]=N):N=t[60];let F;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,K.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Empty means no expiry.`}),t[61]=F):F=t[61];let I;t[62]===N?I=t[63]:(I=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Expires`,N,F]}),t[62]=N,t[63]=I);let L;t[64]!==n||t[65]!==r?(L=e=>r({...n,rateLimitPerMinute:e.target.value}),t[64]=n,t[65]=r,t[66]=L):L=t[66];let R;t[67]!==n.rateLimitPerMinute||t[68]!==L?(R=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Requests per minute`,(0,K.jsx)(P,{type:`number`,min:1,max:600,value:n.rateLimitPerMinute,onChange:L})]}),t[67]=n.rateLimitPerMinute,t[68]=L,t[69]=R):R=t[69];let z;t[70]!==n||t[71]!==r?(z=e=>r({...n,activeTaskLimit:e.target.value}),t[70]=n,t[71]=r,t[72]=z):z=t[72];let B;t[73]!==n.activeTaskLimit||t[74]!==z?(B=(0,K.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium`,children:[`Concurrent active tasks`,(0,K.jsx)(P,{type:`number`,min:1,max:32,value:n.activeTaskLimit,onChange:z})]}),t[73]=n.activeTaskLimit,t[74]=z,t[75]=B):B=t[75];let V;t[76]!==I||t[77]!==R||t[78]!==B?(V=(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[I,R,B]}),t[76]=I,t[77]=R,t[78]=B,t[79]=V):V=t[79];let H;return t[80]!==O||t[81]!==j||t[82]!==V||t[83]!==f?(H=(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[f,O,j,V]}),t[80]=O,t[81]=j,t[82]=V,t[83]=f,t[84]=H):H=t[84],H}function _e(e){let[t,n]=e;return(0,K.jsx)(`option`,{value:t,children:n},t)}function ve(){let e=h(),t=r(),n=e?.environmentId??t,[i,a]=(0,W.useState)(te),[o,l]=(0,W.useState)(q),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(null),[m,g]=(0,W.useState)(null),[_,v]=(0,W.useState)(null),b=(0,W.useMemo)(()=>n===null?void 0:s(n)?.agentControl,[n]),x=(0,W.useCallback)(async()=>{if(b)try{let e=await de(()=>b.listIntegrations());a(t=>ne(t,e))}catch(e){J(`Failed to load external integrations`,e)}},[b]);(0,W.useEffect)(()=>{x()},[x]);let C=(0,W.useCallback)(async(e,t)=>{await navigator.clipboard.writeText(t),v(e),window.setTimeout(()=>v(t=>t===e?null:t),1500)},[]),T=async()=>{if(b)try{g(`new`);let e=await b.createIntegration(X(o));a(t=>re(t,e)),l(q()),d(!1)}catch(e){J(`Failed to create integration`,e)}finally{g(null)}},E=async e=>{if(b)try{g(e.integration.integrationId);let t=X(o);await b.updateIntegration({integrationId:e.integration.integrationId,...t}),p(null),await x()}catch(e){J(`Failed to update integration`,e)}finally{g(null)}},j=async e=>{if(!b)return;let t=e.integration.integrationId;try{g(t);let e=await b.resumeIntegrationPairing({integrationId:t});a(t=>re(t,e))}catch(e){J(`Failed to resume pairing`,e)}finally{g(null)}},M=async e=>{if(!b)return;let t=e.integration.integrationId;try{g(t),await b.revokeIntegration({integrationId:t}),await x()}catch(e){J(`Failed to revoke integration`,e)}finally{g(null)}},N=async e=>{if(!b)return;let t=e.integration.integrationId;if(window.confirm(`Delete ${e.integration.displayName}? This cannot be undone.`))try{g(t),(await b.deleteIntegration({integrationId:t})).deleted&&a(e=>ie(e,t))}catch(e){J(`Failed to delete integration`,e)}finally{g(null)}};return(0,K.jsx)(`section`,{"data-testid":`external-integrations`,className:`border-b bg-muted/10 p-6 sm:p-8`,children:(0,K.jsxs)(`div`,{className:`mx-auto grid w-full max-w-4xl gap-5`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,K.jsx)(A,{className:`size-3.5`}),`Agent Control`]}),(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`External integrations`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Pair a local MCP client with a revocable identity. Every task request waits in Ryco for explicit user approval before a thread is created.`})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(y,{size:`icon`,variant:`outline`,"aria-label":`Refresh integrations`,onClick:()=>void x(),children:(0,K.jsx)(O,{})}),(0,K.jsxs)(y,{disabled:!b||!i.topology.available,onClick:()=>{p(null),l(q()),d(e=>!e)},children:[(0,K.jsx)(L,{}),`New integration`]})]})]}),i.topology.available?null:(0,K.jsxs)(`div`,{className:`flex gap-3 rounded-xl border border-warning/30 bg-warning/8 p-4 text-sm`,children:[(0,K.jsx)(ee,{className:`mt-0.5 size-4 shrink-0 text-warning-foreground`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-medium`,children:`Local pairing is unavailable`}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[i.topology.reason??`Ryco could not prove a direct loopback-only topology.`,` `,`External setup fails closed while Ryco is remotely exposed or Hub-connected.`]})]})]}),u?(0,K.jsxs)(`div`,{className:`grid gap-4 rounded-xl border bg-card p-4`,children:[(0,K.jsx)(Z,{form:o,onChange:l}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,K.jsx)(y,{variant:`ghost`,onClick:()=>d(!1),children:`Cancel`}),(0,K.jsxs)(y,{disabled:m===`new`,onClick:()=>void T(),children:[(0,K.jsx)(D,{}),`Create and pair`]})]})]}):null,i.integrations.length===0&&!u?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-6 text-center text-sm text-muted-foreground`,children:`No external integrations are configured.`}):null,i.integrations.map(e=>{let t=e.integration,n=he(e),r=i.pairingCodes[t.integrationId],a=me(e.setup.pairCommand.command,e.setup.pairCommand.args),s=f===t.integrationId;return(0,K.jsxs)(`article`,{className:`grid gap-4 rounded-xl border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h3`,{className:`font-semibold`,children:t.displayName}),(0,K.jsx)(S,{variant:n.variant,children:n.label}),(0,K.jsx)(S,{variant:`outline`,children:fe[t.clientKind]})]}),(0,K.jsx)(`p`,{className:`mt-1 font-mono text-[11px] text-muted-foreground`,children:t.integrationId})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(y,{size:`sm`,variant:`outline`,onClick:()=>{p(s?null:t.integrationId),l(ge(e))},children:s?`Close editor`:`Edit`}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,disabled:!i.topology.available||m===t.integrationId||t.revokedAt!==null,onClick:()=>void j(e),children:[(0,K.jsx)(D,{}),`Pair again`]}),(0,K.jsx)(y,{size:`sm`,variant:`outline`,disabled:m===t.integrationId||t.revokedAt!==null,onClick:()=>void M(e),children:`Revoke`}),(0,K.jsx)(y,{size:`icon-sm`,variant:`ghost`,"aria-label":`Delete ${t.displayName}`,disabled:m===t.integrationId,onClick:()=>void N(e),children:(0,K.jsx)(w,{})})]})]}),s?(0,K.jsxs)(`div`,{className:`grid gap-4 border-t pt-4`,children:[(0,K.jsx)(Z,{form:o,onChange:l}),(0,K.jsx)(`div`,{className:`flex justify-end`,children:(0,K.jsxs)(y,{disabled:m===t.integrationId,onClick:()=>void E(e),children:[(0,K.jsx)(k,{}),`Save changes`]})})]}):(0,K.jsxs)(`div`,{className:`grid gap-3 text-xs sm:grid-cols-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Project scope`}),(0,K.jsx)(`p`,{className:`mt-0.5 break-words font-medium`,children:t.projectScope.kind===`all`?`All current and future projects`:t.projectScope.projectIds.join(`, `)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Limits`}),(0,K.jsxs)(`p`,{className:`mt-0.5 font-medium`,children:[t.rateLimitPerMinute,`/minute · `,t.activeTaskCount,`/`,t.activeTaskLimit,` active`]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Expiry`}),(0,K.jsx)(`p`,{className:`mt-0.5 font-medium`,children:Y(t.expiresAt)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Last used`}),(0,K.jsx)(`p`,{className:`mt-0.5 font-medium`,children:Y(t.lastUsedAt)})]}),(0,K.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,K.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:t.capabilities.map(e=>(0,K.jsx)(S,{variant:`outline`,children:e},e))})]})]}),t.pairingState===`pending`?(0,K.jsxs)(`div`,{className:`grid gap-3 rounded-lg border bg-muted/20 p-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:`Finish pairing locally`}),(0,K.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pairing code expires `,Y(t.pairingCodeExpiresAt),`. The code is shown only for this ceremony; the generated MCP configuration never contains it.`]})]}),r?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`code`,{"data-testid":`external-pairing-code`,className:`rounded bg-background px-3 py-2 font-mono text-sm tracking-[0.18em]`,children:r}),(0,K.jsxs)(y,{size:`sm`,variant:`outline`,onClick:()=>void C(`code-${t.integrationId}`,r),children:[_===`code-${t.integrationId}`?(0,K.jsx)(c,{}):(0,K.jsx)(V,{}),`Copy code`]})]}):(0,K.jsx)(`p`,{className:`text-xs text-warning-foreground`,children:`The pairing code is no longer displayed. Choose Pair again to generate a new one.`}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:`Run this bridge command, then enter the code`}),(0,K.jsxs)(`div`,{className:`flex min-w-0 gap-2`,children:[(0,K.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto rounded bg-background p-2 text-[11px]`,children:a}),(0,K.jsx)(y,{size:`icon-sm`,variant:`outline`,"aria-label":`Copy pairing command`,onClick:()=>void C(`pair-${t.integrationId}`,a),children:_===`pair-${t.integrationId}`?(0,K.jsx)(c,{}):(0,K.jsx)(V,{})})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,K.jsx)(`span`,{className:`text-xs font-medium`,children:`MCP configuration`}),(0,K.jsx)(`pre`,{"data-testid":`external-mcp-configuration`,className:`max-h-48 overflow-auto rounded bg-background p-3 text-[11px] leading-relaxed`,children:e.setup.configuration}),(0,K.jsxs)(y,{className:`justify-self-start`,size:`sm`,variant:`outline`,onClick:()=>void C(`config-${t.integrationId}`,e.setup.configuration),children:[_===`config-${t.integrationId}`?(0,K.jsx)(c,{}):(0,K.jsx)(V,{}),`Copy configuration`]})]})]}):null]},t.integrationId)})]})})}var ye=[],be=[];function xe(e){return e.displayName??I(e.driver)?.label??m(e.driver)}function Q(e){return e.providerDisplayName??I(e.driver)?.label??m(e.driver)}function Se(e){return e.driver===`codex`?`codex`:e.driver===`claudeAgent`?`claude-code`:`generic-mcp`}function Ce(e){return{...q(),displayName:`${Q(e)} Agent Control`,clientKind:Se(e)}}function we(e,t){return e.filter(e=>e.workspaceId===t).toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt))[0]}function Te(e){if(!e)return{label:`Not connected`,variant:`outline`};switch(e.state){case`connected`:return{label:`Connected`,variant:`success`};case`repair-needed`:return{label:`Needs repair`,variant:`error`};case`disconnected`:case`revoked`:return{label:`Disconnected`,variant:`outline`};case`disconnecting`:return{label:`Disconnecting`,variant:`warning`};case`planned`:case`credential-written`:case`provider-written`:case`verifying`:return{label:`Connecting`,variant:`warning`}}}function Ee(e,t){u.add(N({type:`success`,title:e,description:t}))}function $(e,t){u.add(N({type:`error`,title:e,description:t instanceof Error?t.message:`The request failed.`}))}function De(){let e=h(),t=r(),n=e?.environmentId??t,[i,a]=(0,W.useState)(ye),[o,c]=(0,W.useState)(be),[l,u]=(0,W.useState)(ae),[f,p]=(0,W.useState)(null),[m,g]=(0,W.useState)(!0),[_,b]=(0,W.useState)(null),[x,w]=(0,W.useState)(null),[E,D]=(0,W.useState)(q),k=(0,W.useMemo)(()=>n===null?void 0:s(n),[n]),A=k?.agentControl,N=k?.mcp,P=(0,W.useCallback)(async()=>{if(!A||!N){g(!1);return}try{let[e,t,n]=await de(()=>Promise.all([N.listWorkspaces(),A.listMcpInstallations(),A.listIntegrations()]));a(e.providers),c(e.workspaces),u(e=>se(e,t)),p(n.topology)}catch(e){$(`Failed to load Agent Control providers`,e)}finally{g(!1)}},[A,N]);(0,W.useEffect)(()=>{P()},[P]);let F=async(e,t)=>{if(A)try{b(e.id);let n=t?(()=>{let{clientKind:t,...n}=X(E);return{workspaceId:e.id,...n}})():{workspaceId:e.id},r=await A.connectMcpInstallation(n);u(e=>U(e,r)),w(null),Ee(`${Q(e)} connected`,`The credential was stored locally and was not shown to the browser.`)}catch(t){$(`Failed to connect ${Q(e)}`,t),await P()}finally{b(null)}},L=async(e,t)=>{if(A)try{b(e.id);let n=await A.repairMcpInstallation({installationId:t.installationId});u(e=>U(e,n)),Ee(`${Q(e)} repaired`)}catch(t){$(`Failed to repair ${Q(e)}`,t),await P()}finally{b(null)}},R=async(e,t)=>{if(A&&window.confirm(`Disconnect Agent Control from ${Q(e)}?`))try{b(e.id);let n=await A.disconnectMcpInstallation({installationId:t.installationId});u(e=>U(e,n)),Ee(`${Q(e)} disconnected`)}catch(t){$(`Failed to disconnect ${Q(e)}`,t),await P()}finally{b(null)}},B=o.filter(e=>e.capabilities.externalAgentControl===`available`);return(0,K.jsx)(`section`,{"data-testid":`agent-control-mcp-installations`,className:`border-b bg-muted/10 p-6 sm:p-8`,children:(0,K.jsxs)(`div`,{className:`mx-auto grid w-full max-w-4xl gap-8`,children:[(0,K.jsxs)(`section`,{className:`grid gap-4`,children:[(0,K.jsxs)(`header`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,K.jsx)(C,{className:`size-3.5`}),`Ryco sessions`]}),(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`Automatic inside Ryco`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Supported sessions started by Ryco receive Agent Control automatically. There is nothing to install in those provider profiles.`})]}),m?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl border p-4 text-sm text-muted-foreground`,children:[(0,K.jsx)(T,{className:`size-4 animate-spin`}),` Loading providers…`]}):i.length===0?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-4 text-sm text-muted-foreground`,children:`No configured provider instances were found.`}):(0,K.jsx)(`div`,{className:`divide-y overflow-hidden rounded-xl border bg-card`,children:i.map(e=>{let t=I(e.driver)?.icon??C,n=e.enabled&&e.capabilities.automaticAgentControl===`available`;return(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg border bg-background`,children:(0,K.jsx)(t,{className:`size-4 text-muted-foreground`})}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`p`,{className:`text-sm font-medium`,children:xe(e)}),(0,K.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] text-muted-foreground`,children:e.instanceId}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:n?`Available in every new Ryco-managed session.`:e.enabled?`This provider does not expose automatic Agent Control yet.`:`This provider instance is disabled.`})]})]}),(0,K.jsx)(S,{variant:n?`success`:`outline`,children:n?`Automatic`:e.enabled?`Unavailable`:`Disabled`})]},e.instanceId)})})]}),(0,K.jsxs)(`section`,{className:`grid gap-4`,children:[(0,K.jsxs)(`header`,{className:`flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:[(0,K.jsx)(z,{className:`size-3.5`}),`External agents`]}),(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`Connect an installed provider`}),(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Ryco detects local provider profiles and writes their native MCP configuration. The default grants project listing and task request/read access, limited to 60 requests per minute and one active task. Every task still requires approval.`})]}),(0,K.jsx)(y,{size:`icon`,variant:`outline`,"aria-label":`Refresh Agent Control providers`,disabled:m,onClick:()=>void P(),children:(0,K.jsx)(O,{})})]}),f&&!f.available?(0,K.jsxs)(`div`,{className:`flex gap-3 rounded-xl border border-warning/30 bg-warning/8 p-4 text-sm`,children:[(0,K.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-warning-foreground`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-medium`,children:`Local installation is unavailable`}),(0,K.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:f.reason??`Ryco could not prove a direct loopback-only topology.`})]})]}):null,!m&&(!A||!N)?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-4 text-sm text-muted-foreground`,children:`This Ryco environment does not expose provider MCP installation yet.`}):!m&&B.length===0?(0,K.jsx)(`div`,{className:`rounded-xl border border-dashed p-4 text-sm text-muted-foreground`,children:`No installable provider profiles were detected. Configure a supported provider instance first, then refresh.`}):(0,K.jsx)(`div`,{className:`grid gap-3`,children:B.map(e=>{let t=we(l.installations,e.id),n=Te(t),r=t?.state===`connected`,i=t?.state===`repair-needed`,a=_===e.id,o=x===e.id,s=I(e.driver)?.icon??z;return(0,K.jsxs)(`article`,{className:`grid gap-4 rounded-xl border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(`div`,{className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-lg border bg-background`,children:(0,K.jsx)(s,{className:`size-4 text-muted-foreground`})}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold`,children:Q(e)}),(0,K.jsx)(S,{variant:n.variant,children:n.label})]}),(0,K.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,children:e.displayPath}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.providerInstances.length,` configured provider`,e.providerInstances.length===1?` instance`:` instances`,t?` · MCP name ${t.serverName}`:``]})]})]}),(0,K.jsx)(`div`,{className:`flex shrink-0 flex-wrap gap-2 sm:justify-end`,children:i&&t?(0,K.jsxs)(y,{size:`sm`,disabled:a||f?.available===!1,onClick:()=>void L(e,t),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(M,{}),`Repair`]}):r&&t?(0,K.jsxs)(y,{size:`sm`,variant:`outline`,disabled:a,onClick:()=>void R(e,t),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(j,{}),`Disconnect`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(y,{size:`sm`,variant:`outline`,disabled:a||f?.available===!1,onClick:()=>{o?w(null):(D(Ce(e)),w(e.id))},children:o?`Close`:`Customize`}),(0,K.jsxs)(y,{size:`sm`,disabled:a||f?.available===!1,onClick:()=>void F(e,!1),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(d,{}),`Connect`]})]})})]}),t?.lastError?(0,K.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive`,children:t.lastError}):null,t?.preservedUserChanges?(0,K.jsx)(`div`,{className:`rounded-lg border border-warning/30 bg-warning/8 p-3 text-xs text-warning-foreground`,children:`Ryco left this provider's MCP entry untouched because it had been edited after installation.`}):null,o?(0,K.jsxs)(`div`,{className:`grid gap-4 border-t pt-4`,children:[(0,K.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Customize the credential scope and limits before Ryco installs it. The provider profile is fixed to this detected workspace.`}),(0,K.jsx)(Z,{form:E,onChange:D,clientLocked:!0}),(0,K.jsx)(`div`,{className:`flex justify-end`,children:(0,K.jsxs)(y,{disabled:a||f?.available===!1,onClick:()=>void F(e,!0),children:[a?(0,K.jsx)(T,{className:`animate-spin`}):(0,K.jsx)(z,{}),`Connect with these permissions`]})})]}):null]},e.id)})})]})]})})}var Oe=(0,W.lazy)(()=>n(()=>import(`./ComputerUseSettings-CPwWoHWj.js`).then(e=>({default:e.ComputerUseSettings})),__vite__mapDeps([0])));function ke(){let e=(0,G.c)(7),t=g(),n;e[0]===t?n=e[1]:(n=t!==`client`&&(0,K.jsx)(Ae,{}),e[0]=t,e[1]=n);let r;e[2]===t?r=e[3]:(r=t!==`node`&&window.desktopBridge?.computerUse&&(0,K.jsx)(W.Suspense,{fallback:(0,K.jsx)(`p`,{className:`p-6`,children:`Loading device integrations…`}),children:(0,K.jsx)(Oe,{})}),e[2]=t,e[3]=r);let i;return e[4]!==n||e[5]!==r?(i=(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[n,r]}),e[4]=n,e[5]=r,e[6]=i):i=e[6],i}function Ae(){let e=(0,G.c)(25),t=f(je),{updateSettings:n}=_(),r=F(a.serverUpdateSettings),i,o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,K.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-[0.08em] text-muted-foreground`,children:`Private Agent Control`}),o=(0,K.jsx)(`h2`,{className:`mt-1 text-lg font-semibold tracking-[-0.01em]`,children:`Private tools for every agent`}),s=(0,K.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground/80`,children:`Ryco sessions receive the tools automatically. Connect supported standalone provider profiles with one click. Every requested change still waits for explicit approval.`}),e[0]=i,e[1]=o,e[2]=s):(i=e[0],o=e[1],s=e[2]);let c=t?`Enabled. New Ryco-managed sessions receive Agent Control without changing the provider's global MCP configuration.`:`Disabled. Agent Control is unavailable to Ryco sessions and external clients.`,l;e[3]===c?l=e[4]:(l=(0,K.jsx)(`p`,{className:`mt-2 max-w-2xl text-xs leading-relaxed text-muted-foreground`,children:c}),e[3]=c,e[4]=l);let u;e[5]!==r.allowed||e[6]!==r.reason?(u=!r.allowed&&r.reason?(0,K.jsx)(`p`,{className:`mt-2 max-w-2xl text-xs leading-relaxed text-destructive`,children:r.reason}):null,e[5]=r.allowed,e[6]=r.reason,e[7]=u):u=e[7];let d;e[8]!==l||e[9]!==u?(d=(0,K.jsxs)(`div`,{children:[i,o,s,l,u]}),e[8]=l,e[9]=u,e[10]=d):d=e[10];let p=!r.allowed,m;e[11]===n?m=e[12]:(m=e=>n({agentControl:{enabled:!!e}}),e[11]=n,e[12]=m);let h;e[13]!==t||e[14]!==p||e[15]!==m?(h=(0,K.jsx)(b,{checked:t,disabled:p,onCheckedChange:m,"aria-label":`Enable Agent Control`}),e[13]=t,e[14]=p,e[15]=m,e[16]=h):h=e[16];let g;e[17]!==d||e[18]!==h?(g=(0,K.jsx)(`section`,{"data-settings-section":`Private Agent Control`,className:`scroll-mt-6 border-b bg-muted/10 p-6 sm:p-8`,children:(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-4 sm:flex-row sm:items-start sm:justify-between`,children:[d,h]})}),e[17]=d,e[18]=h,e[19]=g):g=e[19];let v;e[20]===t?v=e[21]:(v=t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(De,{}),(0,K.jsxs)(`details`,{className:`group border-b bg-muted/5`,children:[(0,K.jsxs)(`summary`,{className:`mx-auto flex w-full max-w-4xl cursor-pointer list-none items-center gap-3 px-6 py-5 sm:px-8 [&::-webkit-details-marker]:hidden`,children:[(0,K.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-lg border bg-background`,children:(0,K.jsx)(D,{className:`size-4 text-muted-foreground`})}),(0,K.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block text-sm font-semibold`,children:`Advanced manual setup`}),(0,K.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Create a revocable pairing for another MCP client or a profile Ryco cannot detect.`})]}),(0,K.jsx)(E,{className:`size-4 text-muted-foreground transition-transform group-open:rotate-90`})]}),(0,K.jsx)(ve,{})]})]}):null,e[20]=t,e[21]=v);let y;return e[22]!==g||e[23]!==v?(y=(0,K.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[g,v]}),e[22]=g,e[23]=v,e[24]=y):y=e[24],y}function je(e){return e.agentControl.enabled}export{ke as IntegrationsSettingsPanel};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{Bt as n,Ht as r,Rt as i,Vt as a,a as o,zt as s}from"./primary-D_D7eLwT.js";import{C as c,Ct as l,Dn as u,K as d,Na as f,Nn as p,Or as m,Sn as h,V as g,Vr as _,Zr as v,_l as y,ar as ee,bn as b,ir as te,ja as ne,kr as x,wn as re}from"./runtime-Djy96GJd.js";import{Bt as S,Dn as C,Kn as w,Vt as ie,f as ae,ir as T,qn as oe,rr as E,zt as se}from"./switch-DD1qVLgN.js";import{t as D}from"./compiler-runtime-qmuS0Svy.js";import{n as ce}from"./HostedConnectionControls-COUhSe9x.js";import{t as le}from"./chevron-right-CuUjBsQV.js";import{C as ue,S as O,a as de,b as k,c as A,d as fe,f as j,i as pe,l as M,n as me,o as he,r as ge,s as N,t as _e,u as P,x as ve,z as F}from"./sidebarProjectFolders-ygpaKZM6.js";import{o as ye}from"./sidebar-DNnW-a2V.js";import{a as be,i as xe,n as I,o as L,s as R,t as Se}from"./MobileSheet-NTayGHF6.js";import{t as z}from"./GlassSurface-GY6owikG.js";import{t as B}from"./useLongPress-DG1W7YqV.js";import{i as Ce,o as we,r as Te,t as Ee}from"./empty-3NpXLnAM.js";import{n as V,r as H,t as De}from"./usePhoneThreadActions-rekHL1Mi.js";import{Ft as Oe,It as ke,Mt as Ae,Nt as U,ht as je,it as Me,vt as Ne}from"./main-BbtLAX7M.js";var W={name:`ellipsis-vertical`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]],aliases:[`more-vertical`]};W.node;var Pe=f(W),G=e(t(),1),Fe=D(),K=y();function Ie(e){let t=(0,Fe.c)(14),{label:n,actions:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=_(`pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center px-3 pb-[var(--app-dock-inset)] pl-safe pr-safe`,a),t[0]=a,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=_(z(`dock`),`pointer-events-auto flex min-w-0 max-w-full flex-col gap-2 rounded-[22px] border border-border/60 p-[var(--app-dock-padding)] text-foreground shadow-lg/10`),t[2]=s):s=t[2];let c;t[3]===r?c=t[4]:(c=r.map(q),t[3]=r,t[4]=c);let l;t[5]!==n||t[6]!==c?(l=(0,K.jsx)(`div`,{role:`group`,"aria-label":n,className:`flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,"data-slot":`mobile-dock-actions`,children:c}),t[5]=n,t[6]=c,t[7]=l):l=t[7];let u;t[8]!==i||t[9]!==l?(u=(0,K.jsxs)(`div`,{className:s,"data-slot":`mobile-dock`,children:[i,l]}),t[8]=i,t[9]=l,t[10]=u):u=t[10];let d;return t[11]!==o||t[12]!==u?(d=(0,K.jsx)(`div`,{className:o,"data-slot":`mobile-dock-layer`,children:u}),t[11]=o,t[12]=u,t[13]=d):d=t[13],d}function q(e){return(0,K.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled??!1,className:_(`flex min-h-[var(--app-dock-control-size)] min-w-[var(--app-dock-control-size)] shrink-0 items-center justify-center gap-1 rounded-full px-2 text-[11px] font-medium`,`transition-colors duration-[var(--app-motion-duration-chip)] ease-[var(--app-motion-ease)] motion-reduce:transition-none`,`hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:pointer-events-none disabled:text-muted-foreground/60`,e.pressed===!0&&`bg-accent`),"data-slot":`mobile-dock-action`,onClick:e.onSelect,children:[e.icon,(0,K.jsx)(`span`,{className:`truncate`,children:e.shortLabel??e.label})]},e.id)}var J=new Map;function Le(){let e=(0,Fe.c)(74),t=p(Oe(b)),n=p(Oe(h)),r=g($e),i=g(Qe),u=g(Ze),f=g(Xe),_=g(Ye),v=m(Je),y=m(qe),x=m(Ke),re=o(),S=te(Ge),C=ee(We),ie=d(Ue),ae=l(He),{handleNewThread:E}=Me(),[se,D]=(0,G.useState)(!1),ue;e[0]!==r||e[1]!==t?(ue=je({items:t,preferredIds:r,getId:c}),e[0]=r,e[1]=t,e[2]=ue):ue=e[2];let O=ue,de;e[3]!==O||e[4]!==x?(de=me({projects:O,settings:x}),e[3]=O,e[4]=x,e[5]=de):de=e[5];let k=de,A;e[6]!==S||e[7]!==C?(A=e=>{let t=C[e],n=S[e];return t?.descriptor?.label??n?.label??null},e[6]=S,e[7]=C,e[8]=A):A=e[8];let fe;e[9]!==O||e[10]!==re||e[11]!==x||e[12]!==A?(fe=ge({projects:O,settings:x,primaryEnvironmentId:re,resolveEnvironmentLabel:A}),e[9]=O,e[10]=re,e[11]=x,e[12]=A,e[13]=fe):fe=e[13];let j=fe,pe;e[14]===j?pe=e[15]:(pe=new Map(j.map(Ve)),e[14]=j,e[15]=pe);let M=pe,he;if(e[16]!==k||e[17]!==M||e[18]!==v||e[19]!==j||e[20]!==n){let t=j.map(Be),r;e[22]===k?r=e[23]:(r=e=>{let t=a(s(e.environmentId,e.projectId));return Object.assign({},e,{projectId:k.get(t)??t})},e[22]=k,e[23]=r);let i=n.filter(ze).map(r),o;e[24]===M?o=e[25]:(o=e=>{let t=M.get(e.id);return t?[t]:[]},e[24]=M,e[25]=o),he=Ae(t,i,v).flatMap(o),e[16]=k,e[17]=M,e[18]=v,e[19]=j,e[20]=n,e[21]=he}else he=e[21];let N=he,P;e[26]!==u||e[27]!==i||e[28]!==f||e[29]!==v||e[30]!==N?(P=_e({projects:N,projectFoldersById:i,projectFolderOrder:u,projectTreeOrder:f,projectSortOrder:v}),e[26]=u,e[27]=i,e[28]=f,e[29]=v,e[30]=N,e[31]=P):P=e[31];let ve=P,F;e[32]!==y||e[33]!==E?(F=e=>{let t=e.memberProjects[0];t&&(D(!1),E(s(t.environmentId,t.id),{envMode:Ne({defaultEnvMode:y})}))},e[32]=y,e[33]=E,e[34]=F):F=e[34];let z=F,B;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,K.jsxs)(`header`,{className:`flex items-center gap-1.5 border-b border-border pr-[calc(env(safe-area-inset-right)+0.5rem)] pb-2 pl-[calc(env(safe-area-inset-left)+0.75rem)] pt-[calc(env(safe-area-inset-top)+0.5rem)]`,children:[(0,K.jsx)(`h1`,{className:`min-w-0 flex-1 truncate text-base font-semibold`,children:`Threads`}),(0,K.jsx)(ce,{})]}),e[35]=B):B=e[35];let V;e[36]!==ve||e[37]!==_?(V=ve.length===0?(0,K.jsx)(Ee,{className:`flex-1`,children:(0,K.jsxs)(Ce,{children:[(0,K.jsx)(we,{className:`text-base`,children:`No projects yet`}),(0,K.jsx)(Te,{className:`mt-1 text-sm`,children:`Projects opened on this node appear here with their threads.`})]})}):ve.map(e=>e.kind===`project`?(0,K.jsx)(et,{project:e.project},e.itemId):(0,K.jsxs)(`section`,{"aria-label":e.folder.name,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm font-medium text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,"aria-expanded":e.folder.expanded,onClick:()=>_(e.folder.id,!e.folder.expanded),children:[e.folder.expanded?(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(T,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.folder.name})]}),e.folder.expanded?e.projects.map(Re):null]},e.itemId)),e[36]=ve,e[37]=_,e[38]=V):V=e[38];let H;e[39]===V?H=e[40]:(H=(0,K.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[B,(0,K.jsx)(`div`,{"data-testid":`phone-home-list`,className:`app-dock-scroll-clearance flex min-h-0 flex-1 flex-col overflow-y-auto`,children:V})]}),e[39]=V,e[40]=H);let De;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[41]=De):De=e[41];let U;e[42]===ae?U=e[43]:(U={id:`search`,label:`Search threads`,shortLabel:`Search`,icon:De,onSelect:()=>ae(!0)},e[42]=ae,e[43]=U);let W;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,K.jsx)(ke,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[44]=W):W=e[44];let Pe=N.length===0,q;e[45]!==N[0]||e[46]!==N.length||e[47]!==z?(q=()=>{if(N.length===1&&N[0]){z(N[0]);return}D(!0)},e[45]=N[0],e[46]=N.length,e[47]=z,e[48]=q):q=e[48];let J;e[49]!==Pe||e[50]!==q?(J={id:`new-thread`,label:`New thread`,icon:W,disabled:Pe,onSelect:q},e[49]=Pe,e[50]=q,e[51]=J):J=e[51];let Le;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,K.jsx)(w,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[52]=Le):Le=e[52];let Y;e[53]===ie?Y=e[54]:(Y={id:`settings`,label:`Open settings`,shortLabel:`Settings`,icon:Le,onSelect:()=>ie()},e[53]=ie,e[54]=Y);let X;e[55]!==U||e[56]!==J||e[57]!==Y?(X=(0,K.jsx)(Ie,{label:`Home actions`,actions:[U,J,Y]}),e[55]=U,e[56]=J,e[57]=Y,e[58]=X):X=e[58];let tt;e[59]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,K.jsxs)(xe,{children:[(0,K.jsx)(L,{children:`New thread`}),(0,K.jsx)(I,{children:`Choose a project for the new thread.`})]}),e[59]=tt):tt=e[59];let Z;if(e[60]!==N||e[61]!==z){let t;e[63]===z?t=e[64]:(t=e=>(0,K.jsx)(R,{label:e.displayName,onClick:()=>z(e)},e.projectKey),e[63]=z,e[64]=t),Z=N.map(t),e[60]=N,e[61]=z,e[62]=Z}else Z=e[62];let Q;e[65]===Z?Q=e[66]:(Q=(0,K.jsx)(be,{children:(0,K.jsx)(`div`,{role:`group`,"aria-label":`Projects`,className:`space-y-0.5`,children:Z})}),e[65]=Z,e[66]=Q);let $;e[67]!==se||e[68]!==Q?($=(0,K.jsxs)(Se,{open:se,onOpenChange:D,label:`New thread`,children:[tt,Q]}),e[67]=se,e[68]=Q,e[69]=$):$=e[69];let nt;return e[70]!==H||e[71]!==X||e[72]!==$?(nt=(0,K.jsxs)(ye,{className:`h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground`,children:[H,X,$]}),e[70]=H,e[71]=X,e[72]=$,e[73]=nt):nt=e[73],nt}function Re(e){return(0,K.jsx)(et,{project:e,nested:!0},e.projectKey)}function ze(e){return e.archivedAt===null}function Be(e){return Object.assign({},e,{id:e.projectKey})}function Ve(e){return[e.projectKey,e]}function He(e){return e.setOpen}function Ue(e){return e.openSettings}function We(e){return e.byId}function Ge(e){return e.byId}function Ke(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function qe(e){return e.defaultThreadEnvMode}function Je(e){return e.sidebarProjectSortOrder}function Ye(e){return e.setProjectFolderExpanded}function Xe(e){return e.projectTreeOrder}function Ze(e){return e.projectFolderOrder}function Qe(e){return e.projectFoldersById}function $e(e){return e.projectOrder}function et({project:e,nested:t=!1}){let o=p(Oe((0,G.useMemo)(()=>t=>re(t,e.memberProjectRefs),[e.memberProjectRefs]))),c=v((0,G.useMemo)(()=>O(e),[e])),l=m(e=>e.sidebarThreadSortOrder),d=g(e=>e.pinnedThreadKeys),f=g(t=>t.projectExpandedById[e.projectKey]??!0),h=g(e=>e.toggleProject),y=(0,G.useMemo)(()=>new Set(Object.entries(d).flatMap(([e,t])=>t?[e]:[])),[d]),ee=(0,G.useMemo)(()=>ue(o,c).filter(e=>e.archivedAt===null),[c,o]),b=(0,G.useMemo)(()=>U({threads:ee,sortOrder:l,pinnedThreadKeys:y,getThreadKey:e=>r(n(e.environmentId,e.id))}),[y,l,ee]),te=(0,G.useMemo)(()=>new Map(b.map(e=>[r(n(e.environmentId,e.id)),e])),[b]),S=(0,G.useRef)(te);S.current=te;let C=(0,G.useMemo)(()=>new Map(e.memberProjects.map(e=>[a(s(e.environmentId,e.id)),e])),[e.memberProjects]),w=De({sidebarThreadByKeyRef:S,memberProjectByScopedKey:C,projectCwd:e.cwd??null}),[T,oe]=(0,G.useState)(null),E=T?te.get(T)??null:null,se=w.renamingThreadKey?te.get(w.renamingThreadKey)??null:null,D=p(Oe((0,G.useMemo)(()=>t=>u(t,e.memberProjectRefs),[e.memberProjectRefs]))),ce=(0,G.useMemo)(()=>ve({project:e,threads:b,worktrees:D}),[e,b,D]),me=k({projects:[ce.project],threads:ce.threads,worktrees:ce.worktrees}).projects[0]??null,ge=me&&me.isGitRepo&&me.worktrees.length>1?me.worktrees:null,{updateSettings:_e}=x(),F=m(e=>({sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides})),{copyPathToClipboard:ye}=ae(),[be,xe]=(0,G.useState)(!1),I=pe(),L=de(),R=he({projectGroupingSettings:F,updateSettings:_e}),Se=(0,G.useMemo)(()=>{let t=new Map(e.memberProjects.map(e=>[e.physicalProjectKey,0]));for(let e of o){let n=C.get(a(s(e.environmentId,e.projectId)));n&&t.set(n.physicalProjectKey,(t.get(n.physicalProjectKey)??0)+1)}return t},[C,e.memberProjects,o]),{openProjectRemoteLink:z,openProjectJiraLink:Ce,handleRemoveProject:we}=j({memberThreadCountByPhysicalKey:Se,jiraProjectOpenUrlByProjectKey:J}),Te=(0,G.useRef)(!1),Ee=(0,G.useCallback)(()=>{xe(!0)},[]),{openProjectMenu:ke}=fe({project:e,jiraProjectOpenUrlByProjectKey:J,suppressProjectClickForContextMenuRef:Te,onOpenOverview:Ee,openProjectSettingsDialog:I.openProjectSettingsDialog,openProjectRemoteLink:z,openProjectJiraLink:Ce,openProjectRenameDialog:L.openProjectRenameDialog,openProjectGroupingDialog:R.openProjectGroupingDialog,copyPathToClipboard:ye,handleRemoveProject:we}),Ae=B(e=>ke(e)),je=e=>{let t=r(n(e.environmentId,e.id));return(0,K.jsx)(tt,{thread:e,pinned:y.has(t),onOpen:()=>{let t=n(e.environmentId,e.id);if(e.draftId){w.navigateToDraft(e.draftId,t);return}w.navigateToThread(t)},onMenu:()=>oe(t)},t)};return(0,K.jsxs)(`section`,{"aria-label":e.displayName,className:_(t&&`pl-3`),children:[(0,K.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 px-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring hover:bg-accent/40`,"aria-expanded":f,onClick:()=>h(e.projectKey),...Ae,children:[f?(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}):(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:e.displayName}),(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:b.length})]}),(0,K.jsx)(`button`,{type:`button`,"aria-label":`Project actions for ${e.displayName}`,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:e=>ke({x:e.clientX,y:e.clientY}),children:(0,K.jsx)(Pe,{"aria-hidden":!0,className:`size-4`})})]}),f?ge?(0,K.jsx)(`div`,{className:`pl-3`,children:ge.map(e=>(0,K.jsx)(Y,{worktreeNode:e,renderThreadRow:je},e.worktree.worktreeId))}):(0,K.jsx)(`div`,{role:`list`,"aria-label":`Threads in ${e.displayName}`,children:b.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No threads yet.`}):b.map(e=>je(e))}):null,(0,K.jsx)(V,{open:E!==null,onOpenChange:e=>{e||oe(null)},title:E?.title??`Thread`,items:T?w.listThreadMenuActions(T):[],leadingSections:E?(0,K.jsx)(ie,{thread:E}):void 0,onAction:e=>{let t=T?i(T):null;oe(null),t&&w.performThreadMenuAction(t,e)}}),(0,K.jsx)(H,{renamingThreadKey:w.renamingThreadKey,originalTitle:se?.title??``,renamingTitle:w.renamingTitle,setRenamingTitle:w.setRenamingTitle,commitRename:w.commitRename,cancelRename:w.cancelRename}),(0,K.jsx)(P,{open:be,projectName:e.displayName,memberProjects:e.memberProjects,initialTab:`overview`,onOpenChange:xe}),(0,K.jsx)(M,{open:I.projectSettingsOpen,target:I.projectSettingsTarget,title:I.projectSettingsTitle,customAvatarContentHash:I.projectSettingsCustomAvatarContentHash,projectAvatarUploadUnavailableReason:I.projectAvatarUploadUnavailableReason,preferredRemoteName:I.projectSettingsPreferredRemoteName,workspaceRoot:I.projectSettingsWorkspaceRoot,customSystemPrompt:I.projectSettingsCustomSystemPrompt,defaultModelSelection:I.projectSettingsDefaultModelSelection,saving:I.projectSettingsSaving,onClose:I.closeProjectSettingsDialog,onSave:()=>void I.submitProjectSettings(),onTitleChange:I.setProjectSettingsTitle,onWorkspaceRootChange:I.setProjectSettingsWorkspaceRoot,onCustomSystemPromptChange:I.setProjectSettingsCustomSystemPrompt,onDefaultModelSelectionChange:I.setProjectSettingsDefaultModelSelection,onPreferredRemoteChange:I.setProjectSettingsPreferredRemoteName,onPickWorkspaceRoot:()=>void I.pickProjectSettingsWorkspaceRoot(),onOpenRemote:I.openProjectRemoteByName,onUploadAvatar:I.uploadProjectAvatar,onRemoveAvatar:I.removeProjectAvatar}),(0,K.jsx)(N,{target:L.projectRenameTarget,title:L.projectRenameTitle,onTitleChange:L.setProjectRenameTitle,onClose:L.closeProjectRenameDialog,onSubmit:()=>void L.submitProjectRename()}),(0,K.jsx)(A,{target:R.projectGroupingTarget,selection:R.projectGroupingSelection,globalGroupingMode:F.sidebarProjectGroupingMode,onSelectionChange:R.setProjectGroupingSelection,onClose:R.closeProjectGroupingDialog,onSave:R.saveProjectGroupingPreference})]})}function Y(e){let t=(0,Fe.c)(23),{worktreeNode:n,renderThreadRow:r}=e,[i,a]=(0,G.useState)(!0),o=n.worktree.title??n.worktree.branch,s=!i,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>a(X),l=e=>{if(e.key===`ArrowLeft`){e.preventDefault(),a(!0);return}e.key===`ArrowRight`&&(e.preventDefault(),a(!1))},t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=i?(0,K.jsx)(le,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(ne,{"aria-hidden":!0,className:`size-4 shrink-0`}),t[2]=i,t[3]=u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,K.jsx)(E,{"aria-hidden":!0,className:`size-3.5 shrink-0`}),t[4]=d):d=t[4];let f;t[5]===o?f=t[6]:(f=(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),t[5]=o,t[6]=f);let p;t[7]===n.sessions.length?p=t[8]:(p=(0,K.jsx)(`span`,{className:`shrink-0 text-xs`,children:n.sessions.length}),t[7]=n.sessions.length,t[8]=p);let m;t[9]!==s||t[10]!==u||t[11]!==f||t[12]!==p?(m=(0,K.jsxs)(`button`,{type:`button`,"aria-expanded":s,className:`flex min-h-11 w-full items-center gap-2 px-3 text-left text-sm text-muted-foreground hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:c,onKeyDown:l,children:[u,d,f,p]}),t[9]=s,t[10]=u,t[11]=f,t[12]=p,t[13]=m):m=t[13];let h;t[14]!==i||t[15]!==r||t[16]!==o||t[17]!==n.sessions?(h=i?null:(0,K.jsx)(`div`,{role:`list`,"aria-label":`Sessions in ${o}`,children:n.sessions.length===0?(0,K.jsx)(`p`,{className:`px-3 pb-3 text-sm text-muted-foreground`,children:`No sessions yet.`}):n.sessions.map(e=>r(e))}),t[14]=i,t[15]=r,t[16]=o,t[17]=n.sessions,t[18]=h):h=t[18];let g;return t[19]!==m||t[20]!==h||t[21]!==o?(g=(0,K.jsxs)(`section`,{"aria-label":o,children:[m,h]}),t[19]=m,t[20]=h,t[21]=o,t[22]=g):g=t[22],g}function X(e){return!e}function tt(e){let t=(0,Fe.c)(28),{thread:n,pinned:r,onOpen:i,onMenu:a}=e,o=n.latestTurn?.completedAt??n.latestUserMessageAt??n.createdAt,s;t[0]===a?s=t[1]:(s=()=>a(),t[0]=a,t[1]=s);let c=B(s),l;t[2]===r?l=t[3]:(l=r?(0,K.jsx)(F,{"aria-label":`Pinned`,role:`img`,className:`size-3 shrink-0 text-muted-foreground`}):null,t[2]=r,t[3]=l);let u;t[4]===n.title?u=t[5]:(u=(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:n.title}),t[4]=n.title,t[5]=u);let d;t[6]!==l||t[7]!==u?(d=(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-sm`,children:[l,u]}),t[6]=l,t[7]=u,t[8]=d):d=t[8];let f;t[9]===n?f=t[10]:(f=(0,K.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(se,{thread:n,alwaysShowStatusLabel:!0}),(0,K.jsx)(S,{thread:n})]}),t[9]=n,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]===o?m=t[15]:(m=o?(0,K.jsx)(`span`,{className:`shrink-0 pr-1 text-[10px] text-muted-foreground`,children:C(o)}):null,t[14]=o,t[15]=m);let h;t[16]!==c||t[17]!==i||t[18]!==p||t[19]!==m?(h=(0,K.jsxs)(`button`,{type:`button`,className:`flex min-h-11 min-w-0 flex-1 items-center gap-2 py-1 pl-3 text-left hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:i,...c,children:[p,m]}),t[16]=c,t[17]=i,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g=`Thread actions for ${n.title}`,_;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,K.jsx)(Pe,{"aria-hidden":!0,className:`size-4`}),t[21]=_):_=t[21];let v;t[22]!==a||t[23]!==g?(v=(0,K.jsx)(`button`,{type:`button`,"aria-label":g,className:`flex w-11 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,onClick:a,children:_}),t[22]=a,t[23]=g,t[24]=v):v=t[24];let y;return t[25]!==v||t[26]!==h?(y=(0,K.jsxs)(`div`,{role:`listitem`,className:`flex items-stretch`,children:[h,v]}),t[25]=v,t[26]=h,t[27]=y):y=t[27],y}export{Le as PhoneHome};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-D4CtFNPY.css"])))=>i.map(i=>d[i]);
2
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-DxCd1PgA.js";import{K as r}from"./primary-D_D7eLwT.js";import{$ as i,Ca as a,J as o,K as s,Ma as c,P as l,_l as u,ja as d,zr as f}from"./runtime-Djy96GJd.js";import{rr as p}from"./switch-DD1qVLgN.js";import{t as m}from"./compiler-runtime-qmuS0Svy.js";import{t as h}from"./activity-BMBx2Fu0.js";import{d as g,f as _,l as v,n as y,r as b,t as x,u as S}from"./SettingsPanels-ZxNz9ZfL.js";import{h as C,y as w}from"./RootAppShell-BdQCs2XJ.js";import{t as T}from"./arrow-left-CymyVbCi.js";import{t as E}from"./chart-column-CcRi3pAd.js";import{q as D}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as ee}from"./chevron-right-CuUjBsQV.js";import{t as O}from"./sparkles-isHutYWU.js";import{t as k}from"./palette-D18VboLH.js";import{R as A}from"./sidebarProjectFolders-ygpaKZM6.js";import{t as j}from"./shield-Zq_ygsnJ.js";import{t as te}from"./user-round-DctamWV6.js";import{t as ne}from"./scroll-area-BMnGzd2a.js";import{o as re,t as ie}from"./sheet-DLy4aeVa.js";import{a as M,i as N,n as P,o as F,s as I,t as L}from"./MobileSheet-NTayGHF6.js";import{b as ae,c as oe,f as R,o as z,p as B,r as V,s as H}from"./appearancePreferences-nFx4MHoI.js";import{n as se,t as ce}from"./useAppearancePreference-BteoFdGa.js";var U=m(),W=e(t(),1),G=u(),K=`System reduce transparency is on, showing ${R.find(e=>e.value==="default")?.label??`Solid`}`,q=[{key:`surfaceTransparency`,label:`Material`,description:`How much of the content behind a surface shows through.`,options:oe,scale:R},{key:`fontSizeBase`,label:`Text size`,description:`The base type size for the whole interface.`,options:z,scale:z},{key:`dockDensity`,label:`Dock density`,description:`How much padding the dock capsule carries around its controls.`,options:V,scale:V},{key:`motion`,label:`Motion`,description:`Reduce sheet and stack animation beyond the system setting.`,options:H,scale:H}];function le(e){let t=(0,U.c)(42),{control:n}=e,[r,i]=(0,W.useState)(!1),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={effective:!0},t[0]=a):a=t[0];let o=ce(n.key,a),s=se(),l=n.key===`surfaceTransparency`&&s?K:null,u;t[1]!==n.options||t[2]!==o?(u=n.options.find(e=>e.value===o)??null,t[1]=n.options,t[2]=o,t[3]=u):u=t[3];let d=u,f;t[4]!==n.scale||t[5]!==d||t[6]!==o?(f=d??n.scale.find(e=>e.value===o)??null,t[4]=n.scale,t[5]=d,t[6]=o,t[7]=f):f=t[7];let p=f,m=d!==null,h;t[8]===n.key?h=t[9]:(h=e=>{ae(n.key,e),B(),i(!1)},t[8]=n.key,t[9]=h);let g=h,_=l&&p?`${p.label} · ${l}`:p?.label??null,v,y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground/60`}),y=()=>i(!0),t[10]=v,t[11]=y):(v=t[10],y=t[11]);let b;t[12]!==n.label||t[13]!==_?(b=(0,G.jsx)(I,{label:n.label,secondaryText:_,trailing:v,onClick:y}),t[12]=n.label,t[13]=_,t[14]=b):b=t[14];let x=n.label,S;t[15]===n.label?S=t[16]:(S=(0,G.jsx)(F,{children:n.label}),t[15]=n.label,t[16]=S);let C=!m&&p?` Currently ${p.label}.`:null,w=l?` ${l}.`:null,T;t[17]!==n.description||t[18]!==C||t[19]!==w?(T=(0,G.jsxs)(P,{children:[n.description,C,w]}),t[17]=n.description,t[18]=C,t[19]=w,t[20]=T):T=t[20];let E;t[21]!==S||t[22]!==T?(E=(0,G.jsxs)(N,{children:[S,T]}),t[21]=S,t[22]=T,t[23]=E):E=t[23];let D=n.label,O;if(t[24]!==n.options||t[25]!==g||t[26]!==o){let e;t[28]!==g||t[29]!==o?(e=e=>(0,G.jsx)(I,{label:e.label,secondaryText:e.description,selected:e.value===o,trailing:e.value===o?(0,G.jsx)(c,{"aria-hidden":!0,className:`size-4`}):null,onClick:()=>g(e.value)},e.value),t[28]=g,t[29]=o,t[30]=e):e=t[30],O=n.options.map(e),t[24]=n.options,t[25]=g,t[26]=o,t[27]=O}else O=t[27];let k;t[31]!==n.label||t[32]!==O?(k=(0,G.jsx)(M,{children:(0,G.jsx)(`div`,{role:`group`,"aria-label":D,className:`flex flex-col`,children:O})}),t[31]=n.label,t[32]=O,t[33]=k):k=t[33];let A;t[34]!==n.label||t[35]!==r||t[36]!==E||t[37]!==k?(A=(0,G.jsxs)(L,{open:r,onOpenChange:i,label:x,detent:`medium`,children:[E,k]}),t[34]=n.label,t[35]=r,t[36]=E,t[37]=k,t[38]=A):A=t[38];let j;return t[39]!==A||t[40]!==b?(j=(0,G.jsxs)(G.Fragment,{children:[b,A]}),t[39]=A,t[40]=b,t[41]=j):j=t[41],j}function ue(){let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(`div`,{role:`group`,"aria-label":`Phone appearance`,className:`flex flex-col`,children:q.map(de)}),e[0]=t):t=e[0],t}function de(e){return(0,G.jsx)(le,{control:e},e.key)}var fe=[{id:`account`,label:`Account`,icon:te},{id:`general`,label:`General`,icon:A},{id:`inbox`,label:`Inbox`,icon:O},{id:`providers`,label:`Providers`,icon:_},{id:`opinionated-plugins`,label:`Plugins`,icon:v},{id:`mcp-servers`,label:`MCP Servers`,icon:C},{id:`appearance`,label:`Appearance`,icon:k},{id:`keybindings`,label:`Keybindings`,icon:g},{id:`source-control`,label:`Source Control`,icon:p},{id:`connections`,label:`Connections`,icon:S},{id:`security`,label:`Security`,icon:j},{id:`statistics`,label:`Statistics`,icon:E},{id:`archived`,label:`Archive`,icon:w}],pe=[{id:`diagnostics`,label:`Diagnostics`,icon:h}],me=[...fe,...pe];me.map(e=>e.id),fe.map(e=>e.label);var he=new Set([`general`,`providers`,`appearance`]),J=`general`,Y=(0,W.lazy)(()=>n(()=>import(`./AccountSettings-ApnDA1f-.js`).then(e=>({default:e.AccountSettingsPanel})),__vite__mapDeps([0]))),ge=(0,W.lazy)(()=>n(()=>import(`./ProvidersSettingsPanel-Ww1ch3xA.js`).then(e=>({default:e.ProvidersSettingsPanel})),__vite__mapDeps([0]))),X=(0,W.lazy)(()=>n(()=>import(`./AiFocusSettings-CNmGHEcA.js`).then(e=>({default:e.AiFocusSettings})),__vite__mapDeps([0]))),_e=(0,W.lazy)(()=>n(()=>import(`./OpinionatedPluginsSettings-D7WuuNWZ.js`).then(e=>({default:e.OpinionatedPluginsSettingsPanel})),__vite__mapDeps([0]))),ve=(0,W.lazy)(()=>n(()=>import(`./McpServersSettings-BWIUud0Z.js`).then(e=>({default:e.McpServersSettings})),__vite__mapDeps([0]))),Z=(0,W.lazy)(()=>n(()=>import(`./AppearanceSettings-BG8W4DP0.js`).then(e=>({default:e.AppearanceSettingsPanel})),__vite__mapDeps([0]))),ye=(0,W.lazy)(()=>n(()=>import(`./KeybindingsSettings-CPtXx-W2.js`).then(e=>({default:e.KeybindingsSettingsPanel})),__vite__mapDeps([0]))),be=(0,W.lazy)(()=>n(()=>import(`./SourceControlSettings-C1F3Brcn.js`).then(e=>({default:e.SourceControlSettingsPanel})),__vite__mapDeps([0]))),xe=(0,W.lazy)(()=>n(()=>import(`./ConnectionsSettings-CPMkuxza.js`).then(e=>({default:e.ConnectionsSettings})),__vite__mapDeps([0]))),Q=(0,W.lazy)(()=>n(()=>import(`./NodeSecuritySettings-BFifrshE.js`).then(e=>({default:e.NodeSecuritySettings})),__vite__mapDeps([0]))),$=(0,W.lazy)(()=>n(()=>import(`./DiagnosticsSettings-DvnNz2AZ.js`).then(e=>({default:e.DiagnosticsSettings})),[])),Se=(0,W.lazy)(()=>n(()=>import(`./StatisticsPanel-CeIjiBm8.js`).then(e=>({default:e.StatisticsPanel})),__vite__mapDeps([0])));function Ce(e){let t=(0,U.c)(44),{section:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`div`,{className:`flex min-h-80 items-center justify-center text-muted-foreground text-sm`,children:`Loading settings...`}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=n===`account`?(0,G.jsx)(Y,{}):null,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=n===`general`?(0,G.jsx)(y,{}):null,t[3]=n,t[4]=a);let o;t[5]===n?o=t[6]:(o=n===`inbox`?(0,G.jsx)(X,{}):null,t[5]=n,t[6]=o);let s;t[7]===n?s=t[8]:(s=n===`providers`?(0,G.jsx)(ge,{}):null,t[7]=n,t[8]=s);let c;t[9]===n?c=t[10]:(c=n===`opinionated-plugins`?(0,G.jsx)(_e,{}):null,t[9]=n,t[10]=c);let l;t[11]===n?l=t[12]:(l=n===`mcp-servers`?(0,G.jsx)(ve,{}):null,t[11]=n,t[12]=l);let u;t[13]===n?u=t[14]:(u=n===`appearance`?(0,G.jsx)(Z,{}):null,t[13]=n,t[14]=u);let d;t[15]===n?d=t[16]:(d=n===`keybindings`?(0,G.jsx)(ye,{}):null,t[15]=n,t[16]=d);let f;t[17]===n?f=t[18]:(f=n===`source-control`?(0,G.jsx)(be,{}):null,t[17]=n,t[18]=f);let p;t[19]===n?p=t[20]:(p=n===`connections`?(0,G.jsx)(xe,{}):null,t[19]=n,t[20]=p);let m;t[21]===n?m=t[22]:(m=n===`security`?(0,G.jsx)(Q,{}):null,t[21]=n,t[22]=m);let h;t[23]===n?h=t[24]:(h=n===`diagnostics`?(0,G.jsx)($,{presentation:`phone-legacy`}):null,t[23]=n,t[24]=h);let g;t[25]===n?g=t[26]:(g=n===`statistics`?(0,G.jsx)(Se,{}):null,t[25]=n,t[26]=g);let _;t[27]===n?_=t[28]:(_=n===`archived`?(0,G.jsx)(x,{}):null,t[27]=n,t[28]=_);let v;return t[29]!==f||t[30]!==p||t[31]!==m||t[32]!==h||t[33]!==g||t[34]!==_||t[35]!==i||t[36]!==a||t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==l||t[41]!==u||t[42]!==d?(v=(0,G.jsxs)(W.Suspense,{fallback:r,children:[i,a,o,s,c,l,u,d,f,p,m,h,g,_]}),t[29]=f,t[30]=p,t[31]=m,t[32]=h,t[33]=g,t[34]=_,t[35]=i,t[36]=a,t[37]=o,t[38]=s,t[39]=c,t[40]=l,t[41]=u,t[42]=d,t[43]=v):v=t[43],v}function we(e){let t=(0,U.c)(6),{onRestored:n}=e,{changedSettingLabels:r,restoreDefaults:i}=b(n),a=r.length===0,o;t[0]===i?o=t[1]:(o=()=>void i(),t[0]=i,t[1]=o);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(D,{className:`size-3.5`}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,G.jsxs)(f,{size:`sm`,variant:`outline`,className:`min-h-11 shrink-0`,disabled:a,onClick:o,children:[s,`Restore defaults`]}),t[3]=a,t[4]=o,t[5]=c):c=t[5],c}var Te=`w-full min-w-0 max-w-none border-s-0 p-0 pt-safe pl-safe pr-safe pb-[max(env(safe-area-inset-bottom),var(--app-keyboard-inset,0px))] wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]`;function Ee(){let e=(0,U.c)(39),t=s(Fe),n=s(Pe),c=s(Ne),u=s(Me),p=l(je),m=l(Ae),h=l(ke),g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=r(),e[0]=g):g=e[0];let _=g,v;e[1]!==m||e[2]!==p||e[3]!==h?(v=o(p,m,h),e[1]=m,e[2]=p,e[3]=h,e[4]=v):v=e[4];let y=v,b;e[5]===y?b=e[6]:(b=e=>i(e,{hosted:_,role:y}),e[5]=y,e[6]=b);let x=b,S;e[7]===x?S=e[8]:(S=e=>x(e.id),e[7]=x,e[8]=S);let C=fe.filter(S),w;e[9]===x?w=e[10]:(w=e=>x(e.id),e[9]=x,e[10]=w);let E=pe.filter(w),[D,O]=(0,W.useState)(null),[k,A]=(0,W.useState)(!1),[j,te]=(0,W.useState)(!1);t!==j&&(te(t),t&&(O(n===J?null:n),A(!1)));let M=(0,W.useRef)(n),N,P;e[11]!==t||e[12]!==n?(N=()=>{let e=M.current;M.current=n,t&&n!==e&&O(n)},P=[t,n],e[11]=t,e[12]=n,e[13]=N,e[14]=P):(N=e[13],P=e[14]),(0,W.useEffect)(N,P);let F,I;e[15]!==t||e[16]!==u?(F=()=>{t||s.getState().section!==J&&(u(J),M.current=J)},I=[t,u],e[15]=t,e[16]=u,e[17]=F,e[18]=I):(F=e[17],I=e[18]),(0,W.useEffect)(F,I);let L=(0,W.useRef)(null),ae=(0,W.useRef)(new Map),oe=(0,W.useRef)(null),R=(0,W.useRef)(null),z;e[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{R.current!==null&&window.cancelAnimationFrame(R.current);let t=0,n=0,r=()=>{R.current=null;let i=e();if(i&&i.isConnected){if(document.activeElement===i){if(n+=1,n>=2)return}else if(n=0,i.focus(),t+=1,t>=6)return;R.current=window.requestAnimationFrame(r)}};R.current=window.requestAnimationFrame(r)},e[19]=z):z=e[19];let B=z,V,H;e[20]===Symbol.for(`react.memo_cache_sentinel`)?(V=()=>()=>{R.current!==null&&window.cancelAnimationFrame(R.current)},H=[],e[20]=V,e[21]=H):(V=e[20],H=e[21]),(0,W.useEffect)(V,H);let se=e=>{u(e),O(e),B(()=>L.current)},ce=()=>{let e=oe.current;O(null),M.current=J,u(J),B(()=>e?ae.current.get(e)??null:null)},K;e[22]===D?K=e[23]:(K=[D],e[22]=D,e[23]=K),(0,W.useEffect)(()=>{D!==null&&(oe.current=D)},K);let q;e[24]!==t||e[25]!==D?(q=[t,D,B],e[24]=t,e[25]=D,e[26]=q):q=e[26],(0,W.useEffect)(()=>{t&&D!==null&&B(()=>L.current)},q);let[le,de]=(0,W.useState)(0),Y;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>{de(Oe)},e[27]=Y):Y=e[27];let ge=Y,X=D!==null&&x(D)?me.find(e=>e.id===D)??null:null,_e=e=>{let t=e.icon;return(0,G.jsxs)(`button`,{type:`button`,ref:t=>{t?ae.current.set(e.id,t):ae.current.delete(e.id)},className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>se(e.id),children:[(0,G.jsx)(t,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground/60`})]},e.id)},ve=ie,Z;e[28]===c?Z=e[29]:(Z=e=>{e||c()},e[28]=c,e[29]=Z);let ye=re,be=Te,xe=X?(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(f,{size:`icon`,variant:`ghost`,"aria-label":`Back to settings`,className:`shrink-0`,onClick:ce,children:(0,G.jsx)(T,{})}),(0,G.jsx)(`h1`,{ref:L,tabIndex:-1,className:`min-w-0 flex-1 truncate text-sm font-medium outline-none`,children:X.label}),he.has(X.id)?(0,G.jsx)(we,{onRestored:ge}):null]}),(0,G.jsx)(ne,{className:`min-h-0 min-w-0 flex-1`,children:(0,G.jsx)(`div`,{className:`flex flex-col`,children:(0,G.jsx)(Ce,{section:X.id})},le)})]}):(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 w-full min-w-0 flex-col bg-background`,children:[(0,G.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center gap-1.5 border-b border-border bg-card/40 px-2`,children:[(0,G.jsx)(`h1`,{className:`min-w-0 flex-1 truncate px-2 text-base font-semibold`,children:`Settings`}),(0,G.jsx)(f,{size:`icon`,variant:`ghost`,"aria-label":`Close settings`,className:`shrink-0`,onClick:c,children:(0,G.jsx)(a,{})})]}),(0,G.jsxs)(`nav`,{"aria-label":`Settings sections`,className:`min-h-0 flex-1 overflow-y-auto p-2`,children:[(0,G.jsx)(`div`,{role:`group`,"aria-label":`Settings sections`,className:`space-y-0.5`,children:C.map(e=>_e(e))}),E.length>0?(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":k,className:`flex min-h-11 w-full items-center gap-2.5 rounded-md px-2 text-left text-sm font-medium text-muted-foreground hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>A(De),children:[k?(0,G.jsx)(d,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:`Advanced`})]}),k?(0,G.jsx)(`div`,{role:`group`,"aria-label":`Advanced sections`,className:`space-y-0.5`,children:E.map(e=>_e(e))}):null]}):null,(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsx)(`h2`,{className:`px-2 py-1 font-medium text-muted-foreground text-xs`,children:`Phone appearance`}),(0,G.jsx)(ue,{})]})]})]}),Q;e[30]!==ye||e[31]!==be||e[32]!==xe?(Q=(0,G.jsx)(ye,{side:`right`,showCloseButton:!1,"aria-label":`Settings`,"data-testid":`phone-settings-surface`,className:be,children:xe}),e[30]=ye,e[31]=be,e[32]=xe,e[33]=Q):Q=e[33];let $;return e[34]!==ve||e[35]!==t||e[36]!==Z||e[37]!==Q?($=(0,G.jsx)(ve,{open:t,onOpenChange:Z,children:Q}),e[34]=ve,e[35]=t,e[36]=Z,e[37]=Q,e[38]=$):$=e[38],$}function De(e){return!e}function Oe(e){return e+1}function ke(e){return e.transportStatus}function Ae(e){return e.directoryStatus}function je(e){return e.effectiveRole}function Me(e){return e.setSection}function Ne(e){return e.closeSettings}function Pe(e){return e.section}function Fe(e){return e.open}export{Ee as PhoneSettingsSurface};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{rt as n}from"./primary-D_D7eLwT.js";import{Bl as r,S as i,Ta as a,at as o,ct as s,da as c,ot as l,st as u,t as d,wa as f}from"./src-BSuAGqhK.js";import{$i as p,$n as m,Ca as h,Da as g,Ea as _,Ji as v,Ki as y,Ma as b,Na as x,Nr as S,Ol as C,Or as w,Rr as T,Vr as E,Wi as D,Xi as O,Zi as ee,_l as k,ar as A,bl as te,gl as j,kr as ne,or as M,ul as N,zr as P}from"./runtime-Djy96GJd.js";import{A as F,En as I,F as re,Ft as L,I as R,It as z,M as B,Mt as ie,N as V,Nt as H,P as ae,Xt as U,cr as oe,dt as se,gr as ce,hr as W,in as G,j as le,jt as K,kt as q,lt as ue,mn as de,st as fe,t as pe,ut as me}from"./switch-DD1qVLgN.js";import{t as he}from"./compiler-runtime-qmuS0Svy.js";import{i as ge,n as _e,t as ve}from"./tooltip-DXvXxL37.js";import{t as ye}from"./badge-Dg7mXiOh.js";import{a as be}from"./SettingsPanels-ZxNz9ZfL.js";import{a as xe,i as Se,o as Ce}from"./RootAppShell-BdQCs2XJ.js";import{K as we,Y as Te,r as Ee}from"./ContextHandoffEndpointLabel-BildLLDY.js";import{t as De}from"./download-BA9L9tK9.js";import{t as Oe}from"./refresh-cw-DY3_Ph-S.js";import{t as J}from"./star-7UHEnC3x.js";import{t as ke}from"./toastHelpers-CSQRKo4F.js";import{c as Ae,d as Y,i as je,l as Me,n as X,t as Ne,u as Pe}from"./radio-group-D-VCGinX.js";import{t as Fe}from"./input-DrOL1KPS.js";import{t as Ie}from"./capabilities-C8sxDbKT.js";import{a as Le,i as Re,n as ze,r as Be,t as Ve}from"./settingsLayout-C6SUmJVB.js";import{t as He}from"./ProviderModelPicker-dwWhl7Uf.js";import{t as Ue}from"./AnimatedHeight-i0YhvlGD.js";import{n as We,r as Ge,t as Z}from"./providerDriverMeta-DNTocCcU.js";import{t as Ke}from"./RedactedSensitiveText-CLPBtvH1.js";import{It as qe}from"./main-BbtLAX7M.js";var Je={name:`circle-arrow-up`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]],aliases:[`arrow-up-circle`]};Je.node;var Ye=x(Je),Xe={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Xe.node;var Ze=x(Xe),Q=e(t(),1),Qe=he(),$=k();function $e(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[-_]+/g,` `).replace(/^./,e=>e.toUpperCase())}function et(e){return a(e)??f(e)}function tt(e,t){let n=et(e)?.[t];return typeof n==`string`?n:void 0}function nt(e){return et(e)?.providerSettingsForm??{}}function rt(e){return f(e.settingsSchema)?.providerSettingsFormSchema??{}}function it(e){try{let t=c(e)(void 0);return typeof t==`boolean`?t:void 0}catch{return}}function at(e){let t=rt(e),n=new Map((t.order??[]).map((e,t)=>[e,t])),r=n.size;return Object.keys(e.settingsSchema.fields).map((e,t)=>({key:e,index:t})).toSorted((e,t)=>(n.get(e.key)??r+e.index)-(n.get(t.key)??r+t.index)).flatMap(({key:t})=>{let n=e.settingsSchema.fields[t],r=nt(n);if(r.hidden)return[];let i=tt(n,`title`),a=tt(n,`description`);return[{key:t,control:r.control??`text`,label:i??$e(t),...a===void 0?{}:{description:a},...r.placeholder===void 0?{}:{placeholder:r.placeholder},clearWhenEmpty:r.clearWhenEmpty??`omit`,...r.control===`switch`?{defaultBooleanValue:it(n)}:{}}]})}function ot(e,t){if(typeof e!=`object`||!e)return``;let n=e[t];return typeof n==`string`?n:``}function st(e,t,n=!1){if(typeof e!=`object`||!e)return n;let r=e[t];return typeof r==`boolean`?r:n}function ct(e,t,n){let r=typeof e==`object`&&e?{...e}:{};if(typeof n==`boolean`){let e=t.defaultBooleanValue??!1;return t.clearWhenEmpty===`omit`&&n===e?delete r[t.key]:r[t.key]=n,Object.keys(r).length>0?r:void 0}let i=n.trim();return t.clearWhenEmpty===`omit`&&i.length===0?delete r[t.key]:r[t.key]=n,Object.keys(r).length>0?r:void 0}function lt(e){let t=(0,Qe.c)(4);if(e.variant===`card`){let n;return t[0]===e.children?n=t[1]:(n=(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:e.children}),t[0]=e.children,t[1]=n),n}let n;return t[2]===e.children?n=t[3]:(n=(0,$.jsx)(`div`,{className:`grid gap-1.5`,children:e.children}),t[2]=e.children,t[3]=n),n}function ut(e){let t=(0,Qe.c)(70),{field:n,value:r,idPrefix:i,variant:a,onChange:o}=e,s=`${i}-${n.key}`,c=a===`card`?`mt-1 block text-xs text-muted-foreground`:`text-[11px] text-muted-foreground`,l;t[0]===n.label?l=t[1]:(l=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:n.label}),t[0]=n.label,t[1]=l);let u=l,d;t[2]!==c||t[3]!==n.description?(d=n.description?(0,$.jsx)(`span`,{className:c,children:n.description}):null,t[2]=c,t[3]=n.description,t[4]=d):d=t[4];let f=d;if(n.control===`switch`){let e;t[5]!==f||t[6]!==u?(e=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[u,f]}),t[5]=f,t[6]=u,t[7]=e):e=t[7];let i;t[8]!==n.defaultBooleanValue||t[9]!==n.key||t[10]!==r?(i=st(r,n.key,n.defaultBooleanValue),t[8]=n.defaultBooleanValue,t[9]=n.key,t[10]=r,t[11]=i):i=t[11];let s;t[12]!==n||t[13]!==o||t[14]!==r?(s=e=>o(ct(r,n,!!e)),t[12]=n,t[13]=o,t[14]=r,t[15]=s):s=t[15];let c;t[16]!==n.label||t[17]!==i||t[18]!==s?(c=(0,$.jsx)(pe,{checked:i,onCheckedChange:s,"aria-label":n.label}),t[16]=n.label,t[17]=i,t[18]=s,t[19]=c):c=t[19];let l;t[20]!==e||t[21]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[e,c]}),t[20]=e,t[21]=c,t[22]=l):l=t[22];let d;return t[23]!==l||t[24]!==a?(d=(0,$.jsx)(lt,{variant:a,children:l}),t[23]=l,t[24]=a,t[25]=d):d=t[25],d}if(n.control===`textarea`){let e=a===`card`&&`block`,i;t[26]===e?i=t[27]:(i=E(e),t[26]=e,t[27]=i);let c=a===`card`&&`mt-1.5`,l;t[28]===c?l=t[29]:(l=E(c),t[28]=c,t[29]=l);let d;t[30]!==n.key||t[31]!==r?(d=ot(r,n.key),t[30]=n.key,t[31]=r,t[32]=d):d=t[32];let p;t[33]!==n||t[34]!==o||t[35]!==r?(p=e=>o(ct(r,n,e.target.value)),t[33]=n,t[34]=o,t[35]=r,t[36]=p):p=t[36];let m;t[37]!==n.placeholder||t[38]!==s||t[39]!==l||t[40]!==d||t[41]!==p?(m=(0,$.jsx)(fe,{id:s,className:l,value:d,onChange:p,placeholder:n.placeholder,spellCheck:!1}),t[37]=n.placeholder,t[38]=s,t[39]=l,t[40]=d,t[41]=p,t[42]=m):m=t[42];let h;t[43]!==f||t[44]!==s||t[45]!==u||t[46]!==i||t[47]!==m?(h=(0,$.jsxs)(`label`,{htmlFor:s,className:i,children:[u,m,f]}),t[43]=f,t[44]=s,t[45]=u,t[46]=i,t[47]=m,t[48]=h):h=t[48];let g;return t[49]!==h||t[50]!==a?(g=(0,$.jsx)(lt,{variant:a,children:h}),t[49]=h,t[50]=a,t[51]=g):g=t[51],g}let p=n.control===`password`?`password`:void 0,m=a===`card`&&`block`,h;t[52]===m?h=t[53]:(h=E(m),t[52]=m,t[53]=h);let g;t[54]!==n||t[55]!==s||t[56]!==o||t[57]!==p||t[58]!==r||t[59]!==a?(g=a===`card`?(0,$.jsx)(be,{id:s,className:`mt-1.5`,type:p,autoComplete:n.control===`password`?`off`:void 0,value:ot(r,n.key),onCommit:e=>o(ct(r,n,e)),placeholder:n.placeholder,spellCheck:!1}):(0,$.jsx)(Fe,{id:s,className:`bg-background`,type:p,autoComplete:n.control===`password`?`off`:void 0,value:ot(r,n.key),onChange:e=>o(ct(r,n,e.target.value)),placeholder:n.placeholder,spellCheck:!1}),t[54]=n,t[55]=s,t[56]=o,t[57]=p,t[58]=r,t[59]=a,t[60]=g):g=t[60];let _;t[61]!==f||t[62]!==s||t[63]!==u||t[64]!==h||t[65]!==g?(_=(0,$.jsxs)(`label`,{htmlFor:s,className:h,children:[u,g,f]}),t[61]=f,t[62]=s,t[63]=u,t[64]=h,t[65]=g,t[66]=_):_=t[66];let v;return t[67]!==_||t[68]!==a?(v=(0,$.jsx)(lt,{variant:a,children:_}),t[67]=_,t[68]=a,t[69]=v):v=t[69],v}function dt(e){let t=(0,Qe.c)(15),{definition:n,value:r,idPrefix:i,variant:a,onChange:o}=e,s;t[0]===n?s=t[1]:(s=at(n),t[0]=n,t[1]=s);let c=s;if(c.length===0)return null;let l;if(t[2]!==c||t[3]!==i||t[4]!==o||t[5]!==r||t[6]!==a){let e;t[8]!==i||t[9]!==o||t[10]!==r||t[11]!==a?(e=e=>(0,$.jsx)(ut,{field:e,value:r,idPrefix:i,variant:a,onChange:o},e.key),t[8]=i,t[9]=o,t[10]=r,t[11]=a,t[12]=e):e=t[12],l=c.map(e),t[2]=c,t[3]=i,t[4]=o,t[5]=r,t[6]=a,t[7]=l}else l=t[7];let u;return t[13]===l?u=t[14]:(u=(0,$.jsx)($.Fragment,{children:l}),t[13]=l,t[14]=u),u}var ft=[`#2563eb`,`#16a34a`,`#ea580c`,`#dc2626`,`#7c3aed`,`#0891b2`];function pt(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,`_`).replace(/^_+|_+$/g,``).slice(0,48)}function mt(e,t){let n=pt(t);return n?`${e}_${n}`:``}var ht=/^[a-zA-Z][a-zA-Z0-9_-]*$/,gt=o.make(`codex`),_t=Z[0],vt={},yt=[{value:o.make(`gemini`),label:`Gemini`,icon:G},{value:o.make(`acpRegistry`),label:`ACP Registry`,icon:U},{value:o.make(`piAgent`),label:`Pi Agent`,icon:de}];function bt(e,t){return e.length===0?`Instance ID is required.`:e.length>64?`Instance ID must be 64 characters or fewer.`:ht.test(e)?t.has(e)?`An instance named '${e}' already exists.`:null:`Instance ID must start with a letter and use only letters, digits, '-', or '_'.`}function xt({open:e,onOpenChange:t,onCreated:n}){let r=w(),{updateSettings:i}=ne(),[a,s]=(0,Q.useState)(0),[c,u]=(0,Q.useState)(gt),[d,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(``),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(!1),[y,x]=(0,Q.useState)({}),[C,T]=(0,Q.useState)(!1),D=(0,Q.useMemo)(()=>new Set(Object.keys(r.providerInstances??{})),[r.providerInstances]);(0,Q.useEffect)(()=>{e&&(u(gt),f(``),m(``),g(``),s(0),v(!1),x({}),T(!1))},[e]),(0,Q.useEffect)(()=>{_||g(mt(c,d))},[c,d,_]);let O=We[c]??_t,k=(0,Q.useMemo)(()=>at(O),[O]),A=bt(h,D),te=C&&A!==null,j=d.trim()||`${O.label} Workspace`,M=[`Driver`,`Identity`,`Config`],N=[O.label,j,null],F=y[c]??vt,I=(0,Q.useCallback)(e=>{x(t=>{let n={...t};return e===void 0||Object.keys(e).length===0?delete n[c]:n[c]=e,n})},[c]),re=(0,Q.useCallback)(()=>{if(T(!0),A!==null)return;let e=y[c]??{},a=Object.keys(e).length>0,o=ee(p),s={driver:c,enabled:!0,...d.trim().length>0?{displayName:d.trim()}:{},...o?{accentColor:o}:{},...a?{config:e}:{}},u=l.make(h),f={...r.providerInstances,[u]:s};try{i({providerInstances:f}),n?.(u),S.add({type:`success`,title:`Provider instance added`,description:`${O.label} instance '${h}' was added.`}),t(!1)}catch(e){S.add({type:`error`,title:`Could not add provider instance`,description:e instanceof Error?e.message:`Update failed.`})}},[c,O,y,h,A,d,p,t,n,r.providerInstances,i]);return(0,$.jsx)(q,{open:e,onOpenChange:t,children:(0,$.jsx)(L,{className:`max-w-xl overflow-hidden`,children:(0,$.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden border-foreground/10 bg-background shadow-2xl`,children:[(0,$.jsxs)(H,{className:`border-b border-border/70 bg-background`,children:[(0,$.jsx)(z,{children:`Add provider instance`}),(0,$.jsx)(K,{children:`Configure an additional provider instance — for example, a second Codex install pointed at a different workspace.`}),(0,$.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:M.map((e,t)=>(0,$.jsxs)(`button`,{type:`button`,className:E(`grid min-w-0 grid-cols-[1rem_minmax(0,1fr)] gap-x-2 rounded-lg border px-3 py-2 text-left`,t===a?`border-primary bg-primary/10 ring-1 ring-primary/25`:t<a?`border-border bg-background`:`border-border bg-muted/40`),onClick:()=>s(t),children:[(0,$.jsx)(`span`,{className:E(`row-span-2 mt-0.5 grid size-4 place-items-center rounded-full border`,t<a?`border-primary bg-primary text-primary-foreground`:t===a?`border-primary bg-background`:`border-muted-foreground/35 bg-background`),"aria-hidden":!0,children:t<a?(0,$.jsx)(b,{className:`size-3`}):null}),(0,$.jsxs)(`span`,{className:`text-[10px] font-medium uppercase text-muted-foreground`,children:[`Step `,t+1]}),(0,$.jsxs)(`span`,{className:`truncate text-xs font-semibold text-foreground`,children:[e,t<a&&N[t]?`: ${N[t]}`:``]})]},e))})]}),(0,$.jsx)(`div`,{"data-slot":`dialog-panel`,className:`space-y-4 border-b border-border/70 bg-muted/20 px-6 py-5`,children:(0,$.jsxs)(Ue,{children:[(0,$.jsxs)(`div`,{className:E(`grid gap-2`,a!==0&&`hidden`),children:[(0,$.jsx)(`span`,{id:`add-instance-driver-label`,className:`text-xs font-medium text-foreground`,children:`Driver`}),(0,$.jsxs)(Ne,{value:c,onValueChange:e=>u(o.make(e)),"aria-labelledby":`add-instance-driver-label`,className:`grid grid-cols-2 gap-2.5`,children:[Z.map(e=>{let t=e.icon,n=e.value===c;return(0,$.jsxs)(X,{value:e.value,className:E(`relative flex cursor-pointer items-center gap-3 rounded-lg border px-3 py-3 text-left outline-none transition-[background-color,border-color,box-shadow]`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,n?`border-primary bg-background shadow-sm ring-2 ring-primary/35`:`border-border bg-background hover:border-foreground/20 hover:bg-muted/50`),children:[(0,$.jsx)(t,{className:`size-5 shrink-0`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:e.label}),e.badgeLabel?(0,$.jsx)(ye,{variant:`warning`,size:`sm`,children:e.badgeLabel}):null]},e.value)}),yt.map(e=>{let t=e.icon;return(0,$.jsxs)(X,{value:e.value,disabled:!0,className:E(`relative flex cursor-not-allowed items-center gap-3 rounded-lg border border-border bg-background px-3 py-3 text-left opacity-55 outline-none`),children:[(0,$.jsx)(t,{className:`size-5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:e.label}),(0,$.jsx)(ye,{variant:`warning`,size:`sm`,children:`Coming Soon`})]},e.value)})]})]}),(0,$.jsxs)(`label`,{className:E(`grid gap-2`,a!==1&&`hidden`),children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Label`}),(0,$.jsx)(Fe,{className:`bg-background`,placeholder:`e.g. Work`,value:d,onChange:e=>f(e.target.value)}),(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Shown in the provider list. Optional.`})]}),(0,$.jsxs)(`label`,{className:E(`grid gap-2`,a!==1&&`hidden`),children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Instance ID`}),(0,$.jsx)(Fe,{className:`bg-background`,placeholder:`${c}_work`,value:h,onChange:e=>{v(!0),g(e.target.value)},"aria-invalid":te}),te?(0,$.jsx)(`span`,{className:`text-[11px] text-destructive`,children:A}):(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Routing key used by threads and sessions. Letters, digits, '-', or '_'.`})]}),(0,$.jsxs)(`div`,{className:E(`grid gap-2`,a!==1&&`hidden`),children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Accent color`}),(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`color`,value:ee(p)??ft[0],onChange:e=>m(e.target.value),"aria-label":`Provider instance accent color`,className:`h-8 w-10 cursor-pointer rounded-xl border border-input bg-background p-0.5`}),(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:ft.map(e=>{let t=p.toLowerCase()===e;return(0,$.jsx)(`button`,{type:`button`,className:E(`size-6 cursor-pointer rounded-full border transition`,t?`scale-110 border-foreground ring-2 ring-ring ring-offset-1 ring-offset-background`:`border-black/10 hover:scale-105 dark:border-white/20`),style:{backgroundColor:e},onClick:()=>m(e),"aria-label":`Use ${e} accent`},e)})}),p?(0,$.jsx)(P,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs text-muted-foreground`,onClick:()=>m(``),children:`Clear`}):null]}),(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Optional marker shown in the picker.`})]}),k.length>0?(0,$.jsx)(`div`,{className:E(`grid gap-4`,a!==2&&`hidden`),children:(0,$.jsx)(dt,{definition:O,value:F,idPrefix:`add-provider-${c}`,variant:`dialog`,onChange:I})}):a===2?(0,$.jsx)(`div`,{className:`grid gap-2`,children:(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This driver has no required configuration. You can add the instance now.`})}):null]})}),(0,$.jsxs)(ie,{className:`border-t bg-background`,children:[(0,$.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>{if(a===0){t(!1);return}s(e=>Math.max(0,e-1))},children:a===0?`Cancel`:`Back`}),a<M.length-1?(0,$.jsx)(P,{size:`sm`,onClick:()=>s(e=>Math.min(2,e+1)),children:`Next`}):(0,$.jsx)(P,{size:`sm`,onClick:re,children:`Add instance`})]})]})})})}var St={[o.make(`codex`)]:`gpt-6.7-codex-ultra-preview`,[o.make(`claudeAgent`)]:`claude-sonnet-5-0`,[o.make(`cursor`)]:`claude-sonnet-4-6`,[o.make(`grok`)]:`grok-build`,[o.make(`opencode`)]:`openai/gpt-5`};function Ct(e){let t=(0,Qe.c)(70),{instanceId:n,driverKind:r,models:i,customModels:a,hiddenModels:o,favoriteModels:s,modelOrder:c,onChange:l,onHiddenModelsChange:u,onFavoriteModelsChange:d,onModelOrderChange:f}=e,[p,m]=(0,Q.useState)(``),[g,y]=(0,Q.useState)(null),b=(0,Q.useRef)(null),x;t[0]===o?x=t[1]:(x=new Set(o),t[0]=o,t[1]=x);let S=x,w;t[2]===s?w=t[3]:(w=new Set(s),t[2]=s,t[3]=w);let T=w,D;t[4]!==T||t[5]!==c||t[6]!==i?(D=v(i,{favoriteModels:T,groupFavorites:!0,modelOrder:c}),t[4]=T,t[5]=c,t[6]=i,t[7]=D):D=t[7];let O=D,ee;t[8]!==a||t[9]!==r||t[10]!==p||t[11]!==i||t[12]!==l?(ee=()=>{let e=r?C(p,r):p.trim()||null;if(!e){y(`Enter a model slug.`);return}if(i.some(t=>!t.isCustom&&t.slug===e)){y(`That model is already built in.`);return}if(e.length>256){y(`Model slugs must be 256 characters or less.`);return}if(a.includes(e)){y(`That custom model is already saved.`);return}l([...a,e]),m(``),y(null);let t=b.current;if(!t)return;let n=()=>t.scrollTo({top:t.scrollHeight,behavior:`smooth`});requestAnimationFrame(n);let o=new MutationObserver(()=>{n(),o.disconnect()});o.observe(t,{childList:!0,subtree:!0}),setTimeout(()=>o.disconnect(),2e3)},t[8]=a,t[9]=r,t[10]=p,t[11]=i,t[12]=l,t[13]=ee):ee=t[13];let k=ee,A;t[14]!==a||t[15]!==s||t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(A=e=>{l(a.filter(t=>t!==e)),f(c.filter(t=>t!==e)),d(s.filter(t=>t!==e)),y(null)},t[14]=a,t[15]=s,t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=A):A=t[20];let te=A,j;t[21]!==S||t[22]!==o||t[23]!==u?(j=e=>{if(S.has(e)){u(o.filter(t=>t!==e));return}u([...o,e])},t[21]=S,t[22]=o,t[23]=u,t[24]=j):j=t[24];let ne=j,M;t[25]!==T||t[26]!==s||t[27]!==d?(M=e=>{if(T.has(e)){d(s.filter(t=>t!==e));return}d([...s,e])},t[25]=T,t[26]=s,t[27]=d,t[28]=M):M=t[28];let N=M,F;t[29]!==f||t[30]!==O?(F=(e,t)=>{let n=O.map(Ot),r=n.indexOf(e),i=r+t;if(r<0||i<0||i>=n.length)return;let a=[...n],[o,s]=[a[i],a[r]];a[r]=o,a[i]=s,f(a)},t[29]=f,t[30]=O,t[31]=F):F=t[31];let I=F,re;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:`Models`}),t[32]=re):re=t[32];let L=i.length===1?``:`s`,R;t[33]!==i.length||t[34]!==L?(R=(0,$.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:[i.length,` model`,L,` available.`]}),t[33]=i.length,t[34]=L,t[35]=R):R=t[35];let z;t[36]!==T||t[37]!==I||t[38]!==te||t[39]!==N||t[40]!==ne||t[41]!==S||t[42]!==n||t[43]!==O?(z=O.map((e,t)=>{let r=e.capabilities,i=[],a=!e.isCustom&&S.has(e.slug),o=T.has(e.slug),s=O[t-1],c=O[t+1],l=s!==void 0&&T.has(s.slug)===o,u=c!==void 0&&T.has(c.slug)===o,d=r?.optionDescriptors??[];d.some(Dt)&&i.push(`Fast mode`),d.some(Et)&&i.push(`Thinking`),d.some(Tt)&&i.push(`Reasoning`);let f=i.length>0||e.name!==e.slug;return(0,$.jsxs)(`div`,{className:E(`grid min-h-7 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 py-1`,a&&`text-muted-foreground`),children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,$.jsx)(`span`,{className:E(`min-w-0 truncate text-xs`,a?`text-muted-foreground line-through`:`text-foreground/90`),children:e.name}),f?(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(P,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground/60 hover:text-muted-foreground`,"aria-label":`Details for ${e.name}`}),children:(0,$.jsx)(_,{className:`size-3`})}),(0,$.jsx)(_e,{side:`top`,className:`max-w-56`,children:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`code`,{className:`block text-[11px] text-foreground`,children:e.slug}),i.length>0?(0,$.jsx)(`div`,{className:`flex flex-wrap gap-x-2 gap-y-0.5`,children:i.map(wt)}):null]})})]}):null,a?(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`hidden`}):null,e.isCustom?(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:`custom`}):null]}),(0,$.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(P,{size:`icon-xs`,variant:`ghost`,className:E(`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,o&&`text-yellow-500 hover:text-yellow-600`),onClick:()=>N(e.slug),"aria-label":`${o?`Remove`:`Add`} ${e.name} ${o?`from`:`to`} favorites`}),children:(0,$.jsx)(J,{className:E(`size-3`,o&&`fill-current`)})}),(0,$.jsx)(_e,{side:`top`,children:o?`Remove from favorites`:`Add to favorites`})]}),(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(P,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:!l,onClick:()=>I(e.slug,-1),"aria-label":`Move ${e.name} up`}),children:(0,$.jsx)(W,{className:`size-3`})}),(0,$.jsx)(_e,{side:`top`,children:`Move up`})]}),(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(P,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:!u,onClick:()=>I(e.slug,1),"aria-label":`Move ${e.name} down`}),children:(0,$.jsx)(ce,{className:`size-3`})}),(0,$.jsx)(_e,{side:`top`,children:`Move down`})]}),e.isCustom?null:(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(P,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,onClick:()=>ne(e.slug),"aria-label":`${a?`Show`:`Hide`} ${e.name}`}),children:a?(0,$.jsx)(oe,{className:`size-3`}):(0,$.jsx)(Ze,{className:`size-3`})}),(0,$.jsx)(_e,{side:`top`,children:a?`Show in picker`:`Hide from picker`})]}),e.isCustom?(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(P,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,"aria-label":`Remove ${e.slug}`,onClick:()=>te(e.slug)}),children:(0,$.jsx)(h,{className:`size-3`})}),(0,$.jsx)(_e,{side:`top`,children:`Remove custom model`})]}):null]})]},`${n}:${e.slug}`)}),t[36]=T,t[37]=I,t[38]=te,t[39]=N,t[40]=ne,t[41]=S,t[42]=n,t[43]=O,t[44]=z):z=t[44];let B;t[45]===z?B=t[46]:(B=(0,$.jsx)(`div`,{ref:b,className:`mt-2 max-h-40 overflow-y-auto pb-1`,children:z}),t[45]=z,t[46]=B);let ie=`provider-instance-${n}-custom-model`,V;t[47]===g?V=t[48]:(V=e=>{m(e.target.value),g&&y(null)},t[47]=g,t[48]=V);let H;t[49]===k?H=t[50]:(H=e=>{e.key===`Enter`&&(e.preventDefault(),k())},t[49]=k,t[50]=H);let ae=r?St[r]:`model-slug`,U;t[51]!==p||t[52]!==ie||t[53]!==V||t[54]!==H||t[55]!==ae?(U=(0,$.jsx)(Fe,{id:ie,value:p,onChange:V,onKeyDown:H,placeholder:ae,spellCheck:!1}),t[51]=p,t[52]=ie,t[53]=V,t[54]=H,t[55]=ae,t[56]=U):U=t[56];let se;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(qe,{className:`size-3.5`}),t[57]=se):se=t[57];let G;t[58]===k?G=t[59]:(G=(0,$.jsxs)(P,{className:`shrink-0`,variant:`outline`,onClick:k,children:[se,`Add`]}),t[58]=k,t[59]=G);let le;t[60]!==U||t[61]!==G?(le=(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 sm:flex-row`,children:[U,G]}),t[60]=U,t[61]=G,t[62]=le):le=t[62];let K;t[63]===g?K=t[64]:(K=g?(0,$.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:g}):null,t[63]=g,t[64]=K);let q;return t[65]!==R||t[66]!==B||t[67]!==le||t[68]!==K?(q=(0,$.jsxs)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:[re,R,B,le,K]}),t[65]=R,t[66]=B,t[67]=le,t[68]=K,t[69]=q):q=t[69],q}function wt(e){return(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e},e)}function Tt(e){return e.type===`select`&&(e.id===`reasoningEffort`||e.id===`effort`||e.id===`reasoning`||e.id===`variant`)}function Et(e){return e.id===`thinking`}function Dt(e){return e.id===`fastMode`}function Ot(e){return e.slug}var kt={disabled:{dot:`bg-amber-400`},error:{dot:`bg-destructive`},ready:{dot:`bg-success`},warning:{dot:`bg-warning`}};function At(e){if(!e)return{headline:`Checking provider status`,detail:`Waiting for the server to report installation and authentication details.`};if(!e.enabled)return{headline:`Disabled`,detail:e.message??`This provider is installed but disabled for new sessions in Ryco.`};if(!e.installed)return{headline:`Not found`,detail:e.message??`CLI not detected on PATH.`};if(e.auth.status===`authenticated`){let t=e.auth.label??e.auth.type;return{headline:t?`Authenticated · ${t}`:`Authenticated`,detail:e.message??null}}return e.auth.status===`unauthenticated`?{headline:`Not authenticated`,detail:e.message??null}:e.status===`warning`?{headline:`Needs attention`,detail:e.message??`The provider is installed, but the server could not fully verify it.`}:e.status===`error`?{headline:`Unavailable`,detail:e.message??`The provider failed its startup checks.`}:{headline:`Available`,detail:e.message??`Installed and ready, but authentication could not be verified.`}}function jt(e){return e?e.startsWith(`v`)?e:`v${e}`:null}function Mt(e){if(!e||e.status===`current`||e.status===`unknown`)return null;let t=`Update available`,n=e.latestVersion,r=jt(n);return{detail:e.message??(r?`${t}: install ${r}.`:`${t}: install the latest provider version.`),updateCommand:e.updateCommand,emphasis:`normal`}}function Nt(e){let t=e.instance.enabled??!0;return{enabled:t,statusKey:e.liveProvider?.status??(t?`warning`:`disabled`),displayName:e.instance.displayName?.trim()||e.driverOption?.label||String(e.instance.driver),driverKind:s(e.instance.driver)?e.instance.driver:null,accentColor:ee(e.instance.accentColor),summary:At(e.liveProvider)}}var Pt=[`#2563eb`,`#16a34a`,`#ea580c`,`#dc2626`,`#7c3aed`,`#0891b2`],Ft=/^[a-zA-Z_][a-zA-Z0-9_]*$/,It=0,Lt=()=>`provider-env-${It++}`;function Rt(e,t){return{id:`${t}:${e.name}`,name:e.name,value:e.value,sensitive:e.sensitive,...e.valueRedacted===void 0?{}:{valueRedacted:e.valueRedacted}}}function zt(e,t){if(typeof e!=`object`||!e)return[];let n=e[t];return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}function Bt(e,t,n){let r=typeof e==`object`&&e?{...e}:{};return r[t]=n,r}function Vt(e){let t=new Map((e.liveModels??[]).filter(e=>e.isCustom).map(e=>[e.slug,e])),n=e.liveModels?.filter(e=>!e.isCustom)??[],r=e.customModels.map(e=>t.get(e)??{slug:e,name:e,isCustom:!0,capabilities:null});return[...n,...r]}function Ht(e){let t=(0,Qe.c)(12),n;t[0]===e.email?n=t[1]:(n=e.email?.trim(),t[0]=e.email,t[1]=n);let r=n;if(!r)return null;let i;t[2]===e.separator?i=t[3]:(i=e.separator?(0,$.jsx)(`span`,{"aria-hidden":!0,children:`·`}):null,t[2]=e.separator,t[3]=i);let a;t[4]===e.prefix?a=t[5]:(a=e.prefix?(0,$.jsx)(`span`,{className:`text-muted-foreground/80`,children:e.prefix}):null,t[4]=e.prefix,t[5]=a);let o;t[6]===r?o=t[7]:(o=(0,$.jsx)(Ke,{value:r,ariaLabel:`Toggle account email visibility`,revealTooltip:`Click to reveal email`,hideTooltip:`Click to hide email`}),t[6]=r,t[7]=o);let s;return t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[i,a,o]}),t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function Ut(e){let t=(0,Qe.c)(34),[n,r]=(0,Q.useState)(e.value??``),[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=ee(n),t[0]=n,t[1]=o);let s=o,c,l;t[2]!==i||t[3]!==e.value?(c=()=>{i||r(e.value??``)},l=[i,e.value],t[2]=i,t[3]=e.value,t[4]=c,t[5]=l):(c=t[4],l=t[5]),(0,Q.useEffect)(c,l);let u;t[6]!==s||t[7]!==e?(u=()=>{a(!1),e.onCommit(s??``)},t[6]=s,t[7]=e,t[8]=u):u=t[8];let d=u,f;t[9]===e?f=t[10]:(f=t=>{a(!1),r(t),e.onCommit(t)},t[9]=e,t[10]=f);let p=f,m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Accent color`}),t[11]=m):m=t[11];let h=s??Pt[0],g,_,v;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>a(!0),_=e=>{a(!0),r(e.currentTarget.value)},v=e=>{a(!0),r(e.currentTarget.value)},t[12]=g,t[13]=_,t[14]=v):(g=t[12],_=t[13],v=t[14]);let y=`Accent color for ${e.displayName}`,b;t[15]!==d||t[16]!==y||t[17]!==h?(b=(0,$.jsx)(`input`,{type:`color`,value:h,onFocus:g,onInput:_,onChange:v,onBlur:d,"aria-label":y,className:`h-8 w-10 cursor-pointer rounded border border-input bg-background p-0.5`}),t[15]=d,t[16]=y,t[17]=h,t[18]=b):b=t[18];let x;t[19]!==p||t[20]!==s?(x=Pt.map(e=>{let t=s?.toLowerCase()===e;return(0,$.jsx)(`button`,{type:`button`,className:E(`size-6 cursor-pointer rounded-full border transition`,t?`border-foreground ring-2 ring-ring ring-offset-1 ring-offset-background`:`border-black/10 hover:scale-105 dark:border-white/20`),style:{backgroundColor:e},onClick:()=>p(e),"aria-label":`Use ${e} accent`},e)}),t[19]=p,t[20]=s,t[21]=x):x=t[21];let S;t[22]===x?S=t[23]:(S=(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:x}),t[22]=x,t[23]=S);let C;t[24]!==s||t[25]!==e?(C=s?(0,$.jsx)(P,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7 px-2 text-xs text-muted-foreground`,onClick:()=>{a(!1),r(``),e.onCommit(``)},children:`Clear`}):null,t[24]=s,t[25]=e,t[26]=C):C=t[26];let w;t[27]!==b||t[28]!==S||t[29]!==C?(w=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[b,S,C]}),t[27]=b,t[28]=S,t[29]=C,t[30]=w):w=t[30];let T;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Used to distinguish this instance in picker rails and model lists.`}),t[31]=T):T=t[31];let D;return t[32]===w?D=t[33]:(D=(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[m,w,T]}),t[32]=w,t[33]=D),D}function Wt(e){let t=(0,Qe.c)(35),n;t[0]===e.window?n=t[1]:(n=Pe(e.window),t[0]=e.window,t[1]=n);let r=n,i=e.window.windowDurationMins===void 0?e.fallbackLabel:r.label,a=Me(e.window.usedPercent),o;t[2]===e.window.usedPercent?o=t[3]:(o=Ae(e.window.usedPercent),t[2]=e.window.usedPercent,t[3]=o);let s=o,c;t[4]===e.window.resetsAt?c=t[5]:(c=Y(e.window.resetsAt),t[4]=e.window.resetsAt,t[5]=c);let l=c,u=a>=75,d=u?`${a}% used`:`${s}% available`,f=u?`${s}% available`:`${a}% used`,p;t[6]===i?p=t[7]:(p=(0,$.jsx)(`span`,{className:`font-medium text-foreground`,children:i}),t[6]=i,t[7]=p);let m;t[8]===d?m=t[9]:(m=(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:d}),t[8]=d,t[9]=m);let h;t[10]!==p||t[11]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-xs`,children:[p,m]}),t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=`${i} window usage`,_=u?`bg-warning`:`bg-foreground/70`,v;t[13]===_?v=t[14]:(v=E(`h-full rounded-full transition-[width]`,_),t[13]=_,t[14]=v);let y=`${a}%`,b;t[15]===y?b=t[16]:(b={width:y},t[15]=y,t[16]=b);let x;t[17]!==b||t[18]!==v?(x=(0,$.jsx)(`div`,{className:v,style:b}),t[17]=b,t[18]=v,t[19]=x):x=t[19];let S;t[20]!==x||t[21]!==g||t[22]!==a?(S=(0,$.jsx)(`div`,{className:`h-1.5 overflow-hidden rounded-full bg-muted`,role:`progressbar`,"aria-label":g,"aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,children:x}),t[20]=x,t[21]=g,t[22]=a,t[23]=S):S=t[23];let C;t[24]===f?C=t[25]:(C=(0,$.jsx)(`span`,{children:f}),t[24]=f,t[25]=C);let w;t[26]===l?w=t[27]:(w=l?(0,$.jsx)(`span`,{className:`first-letter:uppercase`,children:l}):null,t[26]=l,t[27]=w);let T;t[28]!==C||t[29]!==w?(T=(0,$.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 text-[11px] text-muted-foreground`,children:[C,w]}),t[28]=C,t[29]=w,t[30]=T):T=t[30];let D;return t[31]!==S||t[32]!==T||t[33]!==h?(D=(0,$.jsxs)(`div`,{className:`grid gap-1.5`,children:[h,S,T]}),t[31]=S,t[32]=T,t[33]=h,t[34]=D):D=t[34],D}function Gt(e){let t=(0,Qe.c)(11),{primary:n,secondary:r,tertiary:i}=e.rateLimits;if(!n&&!r&&!i)return null;let a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Usage limits`}),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=n?(0,$.jsx)(Wt,{window:n,fallbackLabel:`Short window`}):null,t[1]=n,t[2]=o);let s;t[3]===r?s=t[4]:(s=r?(0,$.jsx)(Wt,{window:r,fallbackLabel:`Weekly`}):null,t[3]=r,t[4]=s);let c;t[5]===i?c=t[6]:(c=i?(0,$.jsx)(Wt,{window:i,fallbackLabel:`Monthly`}):null,t[5]=i,t[6]=c);let l;return t[7]!==o||t[8]!==s||t[9]!==c?(l=(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,$.jsxs)(`div`,{className:`grid gap-2.5`,children:[a,(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[o,s,c]})]})}),t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10],l}function Kt(e){let t=(0,Qe.c)(27),n;t[0]===e.environment?n=t[1]:(n=()=>e.environment.map(Rt),t[0]=e.environment,t[1]=n);let[r,i]=(0,Q.useState)(n),a,o;t[2]===e.environment?(a=t[3],o=t[4]):(a=()=>{i(e.environment.map(Rt))},o=[e.environment],t[2]=e.environment,t[3]=a,t[4]=o),(0,Q.useEffect)(a,o);let s;t[5]===e?s=t[6]:(s=t=>{let n=[];for(let e of t){let t=e.name.trim();if(!Ft.test(t)){if(t.length>0||e.value.length>0||e.sensitive!==!0||e.valueRedacted!==void 0)return;continue}let{id:r,...i}=e;n.push({...i,name:t})}e.onChange(n)},t[5]=e,t[6]=s);let c=s,l;t[7]!==c||t[8]!==r?(l=(e,t)=>{let n=r.map(n=>n.id===e?{...n,...t,...t.value===void 0?{}:{valueRedacted:!1}}:n);i(n),c(n)},t[7]=c,t[8]=r,t[9]=l):l=t[9];let u=l,d;t[10]!==c||t[11]!==r?(d=e=>{let t=r.filter(t=>t.id!==e);i(t),c(t)},t[10]=c,t[11]=r,t[12]=d):d=t[12];let f=d,p;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Environment variables`}),t[13]=p):p=t[13];let m;t[14]===r?m=t[15]:(m=()=>i([...r,{id:Lt(),name:``,value:``,sensitive:!0}]),t[14]=r,t[15]=m);let g;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(qe,{className:`size-3`}),t[16]=g):g=t[16];let _;t[17]===m?_=t[18]:(_=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[p,(0,$.jsxs)(P,{type:`button`,size:`sm`,variant:`outline`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:m,children:[g,`Add`]})]}),t[17]=m,t[18]=_);let v;t[19]!==f||t[20]!==r||t[21]!==u?(v=r.length===0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add variables to pass API keys, base URLs, or other per-instance CLI settings.`}):(0,$.jsx)(`div`,{className:`grid gap-2`,children:r.map((e,t)=>(0,$.jsxs)(`div`,{className:`grid gap-2 rounded-md border border-border/70 bg-muted/20 p-2 sm:grid-cols-[minmax(0,1fr)_minmax(0,1.4fr)_auto_auto] sm:items-center`,children:[(0,$.jsx)(be,{value:e.name,onCommit:t=>u(e.id,{name:t.trim()}),placeholder:`VARIABLE_NAME`,spellCheck:!1,"aria-label":`Environment variable name ${t+1}`}),(0,$.jsx)(be,{value:e.valueRedacted?``:e.value,onCommit:t=>u(e.id,{value:t}),type:e.sensitive?`password`:void 0,autoComplete:`off`,placeholder:e.valueRedacted?`Stored secret - enter a new value to replace`:`Value`,spellCheck:!1,"aria-label":`Environment variable value ${t+1}`}),(0,$.jsxs)(`label`,{className:`inline-flex h-8 items-center gap-2 text-xs text-muted-foreground`,children:[(0,$.jsx)(`input`,{type:`checkbox`,className:`size-3.5`,checked:e.sensitive,onChange:t=>{let n=t.currentTarget.checked;u(e.id,{sensitive:n,...n&&e.valueRedacted===void 0?{}:{valueRedacted:n?e.valueRedacted:!1}})}}),`Sensitive`]}),(0,$.jsx)(P,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`size-8 justify-self-start text-muted-foreground hover:text-destructive sm:justify-self-end`,onClick:()=>f(e.id),"aria-label":`Remove environment variable ${e.name||t+1}`,children:(0,$.jsx)(h,{className:`size-3.5`})})]},e.id))}),t[19]=f,t[20]=r,t[21]=u,t[22]=v):v=t[22];let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Sensitive values are stored separately and are not returned to the app after saving.`}),t[23]=y):y=t[23];let b;return t[24]!==v||t[25]!==_?(b=(0,$.jsxs)(`div`,{className:`grid gap-2`,children:[_,v,y]}),t[24]=v,t[25]=_,t[26]=b):b=t[26],b}function qt(e){let t=(0,Qe.c)(147),{instanceId:n,instance:r,driverOption:i,liveProvider:a,isDefault:o,onUpdate:s,onDelete:c,headerAction:l,hiddenModels:u,favoriteModels:d,modelOrder:f,onHiddenModelsChange:p,onFavoriteModelsChange:m,onModelOrderChange:h,onRunUpdate:_,isUpdating:v}=e,y=v!==void 0&&v,b;t[0]!==i||t[1]!==r||t[2]!==a?(b=Nt({instance:r,driverOption:i,liveProvider:a}),t[0]=i,t[1]=r,t[2]=a,t[3]=b):b=t[3];let{enabled:x,displayName:S,driverKind:C,accentColor:w,summary:D,statusKey:O}=b,k=kt[O],A=a?.auth.email,te;t[4]!==A||t[5]!==a?.auth.status?(te=a?.auth.status===`authenticated`&&!!A?.trim(),t[4]=A,t[5]=a?.auth.status,t[6]=te):te=t[6];let j=te,ne=j?a?.auth.label??a?.auth.type??null:null,M=a?.version,N;t[7]===M?N=t[8]:(N=jt(M),t[7]=M,t[8]=N);let F=N,I=a?.versionAdvisory,re;t[9]===I?re=t[10]:(re=Mt(I),t[9]=I,t[10]=re);let L=re,R=L?.updateCommand??null,z=i?.icon,B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B={onCopy:Xt,onError:Yt},t[11]=B):B=t[11];let{copyToClipboard:ie}=T(B),V,H;t[12]!==r.config||t[13]!==a?.models?(V=zt(r.config,`customModels`),H=Vt({liveModels:a?.models,customModels:V}),t[12]=r.config,t[13]=a?.models,t[14]=V,t[15]=H):(V=t[14],H=t[15]);let ae=H,U;t[16]!==r||t[17]!==s?(U=e=>{let t=e.trim(),{displayName:n,...i}=r;s(t.length>0?{...i,displayName:t}:i)},t[16]=r,t[17]=s,t[18]=U):U=t[18];let oe=U,ce;t[19]!==r||t[20]!==s?(ce=e=>{s({...r,enabled:e})},t[19]=r,t[20]=s,t[21]=ce):ce=t[21];let W=ce,G;t[22]!==r||t[23]!==s?(G=e=>{let t=ee(e),{accentColor:n,...i}=r;s(t?{...i,accentColor:t}:i)},t[22]=r,t[23]=s,t[24]=G):G=t[24];let le=G,K;t[25]!==r||t[26]!==s?(K=e=>{let{config:t,...n}=r;s(e===void 0?n:{...n,config:e})},t[25]=r,t[26]=s,t[27]=K):K=t[27];let q=K,de;t[28]!==r||t[29]!==s?(de=e=>{let t=Bt(r.config,`customModels`,[...e]),{config:n,...i}=r;s({...i,config:t})},t[28]=r,t[29]=s,t[30]=de):de=t[30];let fe=de,he;t[31]!==r||t[32]!==s?(he=e=>{let t=e.filter(Jt),{environment:n,...i}=r;s(t.length>0?{...i,environment:t}:i)},t[31]=r,t[32]=s,t[33]=he):he=t[33];let xe=he,Se;t[34]!==z||t[35]!==w||t[36]!==S||t[37]!==C||t[38]!==k.dot?(Se=C?(0,$.jsx)(Ee,{driverKind:C,displayName:S,accentColor:w,showBadge:!!w,statusDotClassName:k.dot,className:`size-5`,iconClassName:`size-4 text-foreground/80`,badgeClassName:`right-[-0.125rem] bottom-[-0.125rem] h-3 min-w-3 text-[7px]`}):z?(0,$.jsxs)(`span`,{className:`relative inline-flex size-5 shrink-0 items-center justify-center`,children:[(0,$.jsx)(z,{className:`size-4 text-foreground/80`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:E(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,k.dot),"aria-hidden":!0})]}):(0,$.jsx)(`span`,{className:E(`size-2 shrink-0 rounded-full`,k.dot)}),t[34]=z,t[35]=w,t[36]=S,t[37]=C,t[38]=k.dot,t[39]=Se):Se=t[39];let Ce=Se,Oe;t[40]===S?Oe=t[41]:(Oe=(0,$.jsx)(`h3`,{className:`truncate text-[13px] font-semibold tracking-[-0.01em] text-foreground`,children:S}),t[40]=S,t[41]=Oe);let J;t[42]!==r.driver||t[43]!==n?(J=String(n)===String(r.driver)?null:(0,$.jsx)(`code`,{className:`truncate rounded bg-muted/60 px-1 py-0.5 text-[10px] text-muted-foreground`,children:n}),t[42]=r.driver,t[43]=n,t[44]=J):J=t[44];let ke=o?`Default`:`Custom`,Ae;t[45]===ke?Ae=t[46]:(Ae=(0,$.jsx)(ye,{variant:`outline`,size:`sm`,className:`shrink-0`,children:ke}),t[45]=ke,t[46]=Ae);let Y;t[47]===i?Y=t[48]:(Y=i?.badgeLabel?(0,$.jsx)(ye,{variant:`warning`,size:`sm`,className:`shrink-0`,children:i.badgeLabel}):null,t[47]=i,t[48]=Y);let je;t[49]!==Oe||t[50]!==J||t[51]!==Ae||t[52]!==Y||t[53]!==Ce?(je=(0,$.jsxs)($.Fragment,{children:[Ce,Oe,J,Ae,Y]}),t[49]=Oe,t[50]=J,t[51]=Ae,t[52]=Y,t[53]=Ce,t[54]=je):je=t[54];let Me=je,X;t[55]!==n||t[56]!==c?(X=c?(0,$.jsxs)(P,{size:`xs`,variant:`ghost`,className:`h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-destructive`,onClick:c,"aria-label":`Delete provider instance ${n}`,children:[(0,$.jsx)(we,{className:`size-3`}),`Delete`]}):null,t[55]=n,t[56]=c,t[57]=X):X=t[57];let Ne;t[58]!==l||t[59]!==X?(Ne=(0,$.jsxs)($.Fragment,{children:[l,X]}),t[58]=l,t[59]=X,t[60]=Ne):Ne=t[60];let Pe=Ne,Fe;t[61]!==A||t[62]!==ne||t[63]!==j||t[64]!==D.headline?(Fe=j?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:`Authenticated as`}),(0,$.jsx)(Ht,{email:A}),ne?(0,$.jsxs)(`span`,{children:[`· `,ne]}):null]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{children:D.headline}),(0,$.jsx)(Ht,{email:A,separator:!0,prefix:`Email`})]}),t[61]=A,t[62]=ne,t[63]=j,t[64]=D.headline,t[65]=Fe):Fe=t[65];let Ie;t[66]===D.detail?Ie=t[67]:(Ie=D.detail?(0,$.jsxs)(`span`,{children:[`- `,D.detail]}):null,t[66]=D.detail,t[67]=Ie);let Le;t[68]!==Fe||t[69]!==Ie?(Le=(0,$.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-x-1 text-xs text-muted-foreground`,children:[Fe,Ie]}),t[68]=Fe,t[69]=Ie,t[70]=Le):Le=t[70];let Re=Le,ze;t[71]===F?ze=t[72]:(ze=F?(0,$.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:F}):null,t[71]=F,t[72]=ze);let Be=ze,Ve;t[73]!==ie||t[74]!==S||t[75]!==y||t[76]!==_||t[77]!==R||t[78]!==L?(Ve=L?(0,$.jsxs)(ue,{children:[(0,$.jsx)(se,{render:(0,$.jsx)(P,{type:`button`,size:`icon-xs`,variant:`ghost`,className:E(`size-5 rounded-sm p-0`,L.emphasis===`strong`?`text-warning hover:text-warning`:`text-primary hover:text-primary`),"aria-label":`Update available — view details`,children:(0,$.jsx)(Ye,{className:`size-3.5 [animation:bounce_2.4s_ease-in-out_infinite] motion-reduce:animate-none`})})}),(0,$.jsx)(me,{side:`bottom`,align:`start`,className:`w-84`,children:(0,$.jsxs)(`div`,{className:`grid gap-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-0.5`,children:[(0,$.jsx)(`p`,{className:`text-[13px] font-semibold leading-tight text-foreground`,children:`Update available`}),(0,$.jsx)(`p`,{className:E(`text-xs leading-snug`,L.emphasis===`strong`?`text-warning`:`text-muted-foreground`),children:L.detail})]}),_?(0,$.jsxs)(P,{type:`button`,size:`xs`,variant:`default`,className:`w-full`,disabled:y,onClick:_,children:[y?(0,$.jsx)(Te,{className:`animate-spin`}):(0,$.jsx)(De,{}),y?`Updating`:`Update now`]}):null,_&&R?(0,$.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`}),`or, update manually using`,(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-px flex-1 bg-border`})]}):null,R?(0,$.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border/70 bg-muted/40 py-0.5 pr-0.5 pl-2`,children:[(0,$.jsx)(`code`,{className:`min-w-0 flex-1 overflow-x-auto whitespace-nowrap font-mono text-[11px] text-foreground [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:R}),(0,$.jsxs)(ve,{children:[(0,$.jsx)(ge,{render:(0,$.jsx)(P,{type:`button`,size:`icon-xs`,variant:`ghost`,className:`size-6 shrink-0 rounded-sm p-0 text-muted-foreground hover:text-foreground`,onClick:()=>ie(R,{providerName:S}),"aria-label":`Copy update command`,children:(0,$.jsx)(g,{className:`size-3`})})}),(0,$.jsx)(_e,{side:`top`,children:`Copy command`})]})]}):null]})})]}):null,t[73]=ie,t[74]=S,t[75]=y,t[76]=_,t[77]=R,t[78]=L,t[79]=Ve):Ve=t[79];let He;t[80]!==Ve||t[81]!==Me||t[82]!==Pe||t[83]!==Be?(He=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[Me,Be,Ve,Pe]}),t[80]=Ve,t[81]=Me,t[82]=Pe,t[83]=Be,t[84]=He):He=t[84];let Ue;t[85]!==Re||t[86]!==He?(Ue=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[He,Re]}),t[85]=Re,t[86]=He,t[87]=Ue):Ue=t[87];let We;t[88]===W?We=t[89]:(We=e=>W(!!e),t[88]=W,t[89]=We);let Ge=`Enable ${S}`,Z;t[90]!==x||t[91]!==We||t[92]!==Ge?(Z=(0,$.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:(0,$.jsx)(pe,{checked:x,onCheckedChange:We,"aria-label":Ge})}),t[90]=x,t[91]=We,t[92]=Ge,t[93]=Z):Z=t[93];let Ke;t[94]!==Ue||t[95]!==Z?(Ke=(0,$.jsx)(`div`,{className:`px-4 py-3.5 sm:px-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[Ue,Z]})}),t[94]=Ue,t[95]=Z,t[96]=Ke):Ke=t[96];let qe;t[97]===a?qe=t[98]:(qe=a?.rateLimits?(0,$.jsx)(Gt,{rateLimits:a.rateLimits}):null,t[97]=a,t[98]=qe);let Je=`provider-instance-${n}-display-name`,Xe;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,$.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Display name`}),t[99]=Xe):Xe=t[99];let Ze=`provider-instance-${n}-display-name`,Q=r.displayName??``,$e=i?.label??`Instance label`,et;t[100]!==Ze||t[101]!==Q||t[102]!==$e||t[103]!==oe?(et=(0,$.jsx)(be,{id:Ze,className:`mt-1.5`,value:Q,onCommit:oe,placeholder:$e,spellCheck:!1}),t[100]=Ze,t[101]=Q,t[102]=$e,t[103]=oe,t[104]=et):et=t[104];let tt;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`Optional label shown in the provider list.`}),t[105]=tt):tt=t[105];let nt;t[106]!==Je||t[107]!==et?(nt=(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,$.jsxs)(`label`,{htmlFor:Je,className:`block`,children:[Xe,et,tt]})}),t[106]=Je,t[107]=et,t[108]=nt):nt=t[108];let rt;t[109]!==w||t[110]!==S||t[111]!==le?(rt=(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,$.jsx)(Ut,{displayName:S,value:w,onCommit:le})}),t[109]=w,t[110]=S,t[111]=le,t[112]=rt):rt=t[112];let it;t[113]===r.environment?it=t[114]:(it=r.environment??[],t[113]=r.environment,t[114]=it);let at;t[115]!==it||t[116]!==xe?(at=(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,$.jsx)(Kt,{environment:it,onChange:xe})}),t[115]=it,t[116]=xe,t[117]=at):at=t[117];let ot;t[118]!==i||t[119]!==r.config||t[120]!==n||t[121]!==q?(ot=i?(0,$.jsx)(dt,{definition:i,value:r.config,idPrefix:`provider-instance-${n}`,variant:`card`,onChange:q}):null,t[118]=i,t[119]=r.config,t[120]=n,t[121]=q,t[122]=ot):ot=t[122];let st;t[123]!==V||t[124]!==C||t[125]!==i||t[126]!==d||t[127]!==u||t[128]!==r.driver||t[129]!==n||t[130]!==f||t[131]!==ae||t[132]!==m||t[133]!==p||t[134]!==h||t[135]!==fe?(st=i===void 0?(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 sm:px-5`,children:(0,$.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`This instance uses a driver (`,(0,$.jsx)(`code`,{className:`text-foreground`,children:String(r.driver)}),`) that is not shipped with the current build. Configuration values are preserved but cannot be edited from this surface.`]})}):(0,$.jsx)(Ct,{instanceId:n,driverKind:C,models:ae,customModels:V,hiddenModels:u,favoriteModels:d,modelOrder:f,onChange:fe,onHiddenModelsChange:p,onFavoriteModelsChange:m,onModelOrderChange:h}),t[123]=V,t[124]=C,t[125]=i,t[126]=d,t[127]=u,t[128]=r.driver,t[129]=n,t[130]=f,t[131]=ae,t[132]=m,t[133]=p,t[134]=h,t[135]=fe,t[136]=st):st=t[136];let ct;t[137]!==qe||t[138]!==nt||t[139]!==rt||t[140]!==at||t[141]!==ot||t[142]!==st?(ct=(0,$.jsxs)(`div`,{className:`space-y-0`,children:[qe,nt,rt,at,ot,st]}),t[137]=qe,t[138]=nt,t[139]=rt,t[140]=at,t[141]=ot,t[142]=st,t[143]=ct):ct=t[143];let lt;return t[144]!==Ke||t[145]!==ct?(lt=(0,$.jsxs)(`div`,{children:[Ke,ct]}),t[144]=Ke,t[145]=ct,t[146]=lt):lt=t[146],lt}function Jt(e){return e.name.trim().length>0}function Yt(e,t){let{providerName:n}=t;S.add(ke({type:`error`,title:`Could not copy ${n} update command`,description:e.message}))}function Xt(e){let{providerName:t}=e;S.add({type:`success`,title:`${t} update command copied`,description:`Run it in a terminal when you are ready to update.`})}function Zt(e){let t=(0,Qe.c)(38),n;t[0]===e?n=t[1]:(n=Nt(e),t[0]=e,t[1]=n);let r=n,i=kt[r.statusKey],a=e.driverOption?.icon,o=e.isDefault?`Default`:`Custom`,s=r.displayName,c=e.selected?`true`:void 0,l=e.editorId,u=r.displayName,d;t[2]===o?d=t[3]:(d=o.toLowerCase(),t[2]=o,t[3]=d);let f=`Edit ${u} ${d} provider instance`,p=e.selected?`border-foreground/20 bg-background shadow-sm`:`border-transparent hover:border-border/80 hover:bg-background/70`,m;t[4]===p?m=t[5]:(m=E(`group flex w-full min-w-0 cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 text-left outline-none transition-[background-color,border-color,box-shadow]`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background`,p),t[4]=p,t[5]=m);let h;t[6]!==a||t[7]!==r.accentColor||t[8]!==r.displayName||t[9]!==r.driverKind||t[10]!==i.dot?(h=r.driverKind?(0,$.jsx)(Ee,{driverKind:r.driverKind,displayName:r.displayName,accentColor:r.accentColor,showBadge:!!r.accentColor,statusDotClassName:i.dot,className:`mt-0.5 size-7`,iconClassName:`size-5 text-foreground/80`}):a?(0,$.jsxs)(`span`,{className:`relative mt-0.5 inline-flex size-7 shrink-0 items-center justify-center`,children:[(0,$.jsx)(a,{className:`size-5 text-foreground/80`,"aria-hidden":!0}),(0,$.jsx)(`span`,{className:E(`pointer-events-none absolute -left-0.5 -top-0.5 size-2 rounded-full ring-2 ring-background`,i.dot),"aria-hidden":!0})]}):(0,$.jsx)(`span`,{className:E(`mt-2 size-2 shrink-0 rounded-full`,i.dot)}),t[6]=a,t[7]=r.accentColor,t[8]=r.displayName,t[9]=r.driverKind,t[10]=i.dot,t[11]=h):h=t[11];let g;t[12]===r.displayName?g=t[13]:(g=(0,$.jsx)(`span`,{className:`truncate text-[13px] font-semibold tracking-[-0.01em] text-foreground`,children:r.displayName}),t[12]=r.displayName,t[13]=g);let _;t[14]===o?_=t[15]:(_=(0,$.jsx)(ye,{variant:`outline`,size:`sm`,className:`shrink-0 bg-background/60`,children:o}),t[14]=o,t[15]=_);let v;t[16]!==g||t[17]!==_?(v=(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[g,_]}),t[16]=g,t[17]=_,t[18]=v):v=t[18];let y;t[19]===r.summary.headline?y=t[20]:(y=(0,$.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:r.summary.headline}),t[19]=r.summary.headline,t[20]=y);let b;t[21]!==e.instanceId||t[22]!==e.isDefault?(b=e.isDefault?null:(0,$.jsx)(`code`,{className:`mt-0.5 block truncate text-[10px] text-muted-foreground/70`,children:e.instanceId}),t[21]=e.instanceId,t[22]=e.isDefault,t[23]=b):b=t[23];let x;t[24]!==v||t[25]!==y||t[26]!==b?(x=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[v,y,b]}),t[24]=v,t[25]=y,t[26]=b,t[27]=x):x=t[27];let S;return t[28]!==r.displayName||t[29]!==e.editorId||t[30]!==e.onKeyDown||t[31]!==e.onSelect||t[32]!==x||t[33]!==c||t[34]!==f||t[35]!==m||t[36]!==h?(S=(0,$.jsxs)(`button`,{type:`button`,"data-settings-section":s,"data-settings-action":!0,"data-provider-instance-row":!0,"aria-current":c,"aria-controls":l,"aria-label":f,className:m,onClick:e.onSelect,onKeyDown:e.onKeyDown,children:[h,x]}),t[28]=r.displayName,t[29]=e.editorId,t[30]=e.onKeyDown,t[31]=e.onSelect,t[32]=x,t[33]=c,t[34]=f,t[35]=m,t[36]=h,t[37]=S):S=t[37],S}function Qt(e,t){let n=e.providers,a=i.providers,o=u(t),s=e.providerInstances?.[o],c=n[t],l=a[t];return{instance:s??{driver:t,enabled:c.enabled,config:c},isDirty:s!==void 0||!r(c,l)}}function $t(e,t){let n=Z.map(e=>e.value).filter(e=>e!==`cursor`||t.some(t=>t.instanceId===u(e))),r=new Set(n),i=new Map;for(let[t,n]of Object.entries(e.providerInstances??{})){let e=i.get(n.driver)??[];e.push([t,n]),i.set(n.driver,e)}let a=[];for(let t of n){let n=u(t),r=Qt(e,t);a.push({instanceId:n,instance:r.instance,driver:t,isDefault:!0,isDirty:r.isDirty});for(let[e,r]of i.get(t)??[])e!==n&&a.push({instanceId:e,instance:r,driver:r.driver,isDefault:!1,isDirty:!0})}for(let[e,t]of i)if(!r.has(e))for(let[n,r]of t)a.push({instanceId:n,instance:r,driver:e,isDefault:n===u(e),isDirty:!0});return a}function en(e,t){return e.find(e=>e.instanceId===t)??e.at(0)??null}function tn(e,t,n){return n<=0||e<0||e>=n?null:t===`Home`?0:t===`End`?n-1:t===`ArrowDown`?(e+1)%n:(e-1+n)%n}function nn(e){let t=i.providers,n=e.isDefault?t[e.driver]:void 0;return{...n===void 0?{}:{providers:{...e.settings.providers,[e.driver]:n}},providerInstances:{...e.settings.providerInstances,[e.instanceId]:e.instance},...e.textGenerationModelSelection===void 0?{}:{textGenerationModelSelection:e.textGenerationModelSelection}}}var rn=o.make(`codex`);function an(e,t){let n={...e};return delete n[t],n}function on(e,t){return e.filter(e=>e.provider!==t)}function sn(e){let t=(0,Qe.c)(5),{lastCheckedAt:n}=e;Le();let r;t[0]===n?r=t[1]:(r=n?I(n):null,t[0]=n,t[1]=r);let i=r;if(!i)return null;let a;return t[2]!==i.suffix||t[3]!==i.value?(a=(0,$.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:i.suffix?(0,$.jsxs)($.Fragment,{children:[`Checked `,(0,$.jsx)(`span`,{className:`font-mono tabular-nums`,children:i.value}),` `,i.suffix]}):(0,$.jsxs)($.Fragment,{children:[`Checked `,i.value]})}),t[2]=i.suffix,t[3]=i.value,t[4]=a):a=t[4],a}function cn(){let e=(0,Qe.c)(225),t=w(),{updateSettings:a}=ne(),o=j(),s=Ie(d.serverUpdateSettings),c=!s.allowed,l=s.reason,f=N(),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(!1),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(null),T;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=new Set,e[0]=T):T=e[0];let[E,ee]=(0,Q.useState)(T),k=(0,Q.useRef)(!1),I;e[1]===o?I=e[2]:(I=e=>{if(!o||o.primary){n({providers:e});return}let t=A.getState().byId[o.environmentId]?.serverConfig;t&&A.getState().patch(o.environmentId,{serverConfig:{...t,providers:e}})},e[1]=o,e[2]=I);let L=I,z;e[3]===o?z=e[4]:(z=()=>{if(!o)return M().server;let e=m(o.environmentId)?.server;if(!e)throw Error(`Provider settings are unavailable on ${o.nodeLabel}.`);return e},e[3]=o,e[4]=z);let ie=z,H;e[5]!==L||e[6]!==ie?(H=()=>{k.current||(k.current=!0,g(!0),ie().refreshProviders().then(e=>L(e.providers)).catch(vn).finally(()=>{k.current=!1,g(!1)}))},e[5]=L,e[6]=ie,e[7]=H):H=e[7];let U=H,oe,se,ce,W,G,K,q;if(e[8]!==f||e[9]!==t){let n=y(t,f);W=n.instanceId,G=n.model,K=n.options,oe=p(O(f)),ce=oe.find(e=>e.instanceId===W),q=ce?.driverKind??rn,se=D(t,f,W,G),e[8]=f,e[9]=t,e[10]=oe,e[11]=se,e[12]=ce,e[13]=W,e[14]=G,e[15]=K,e[16]=q}else oe=e[10],se=e[11],ce=e[12],W=e[13],G=e[14],K=e[15],q=e[16];let ue=se,de;e[17]===t.textGenerationModelSelection?de=e[18]:(de=r(t.textGenerationModelSelection??null,i.textGenerationModelSelection??null),e[17]=t.textGenerationModelSelection,e[18]=de);let fe=!de,pe;e[19]===f?pe=e[20]:(pe=f.length>0?f.reduce(_n,f[0].checkedAt):null,e[19]=f,e[20]=pe);let me=pe,he,ye,be,we,Ee,De,J,ke,Ae,Y,Me,X,Ne,Pe,Fe,Le,Ue,We,Z,Ke,Je,Ye,Xe,Ze,$e,et;if(e[21]!==L||e[22]!==oe||e[23]!==ue||e[24]!==fe||e[25]!==h||e[26]!==me||e[27]!==S||e[28]!==ie||e[29]!==U||e[30]!==b||e[31]!==f||e[32]!==t||e[33]!==c||e[34]!==l||e[35]!==ce?.models||e[36]!==W||e[37]!==G||e[38]!==K||e[39]!==q||e[40]!==a||e[41]!==E){let n=$t(t,f);X=en(n,b);let r=X?.instanceId??null,o;e[68]!==t||e[69]!==a?(o=(e,n,r)=>{a(nn({settings:t,instanceId:e.instanceId,instance:n,driver:e.driver,isDefault:e.isDefault,textGenerationModelSelection:r?.textGenerationModelSelection}))},e[68]=t,e[69]=a,e[70]=o):o=e[70],$e=o;let s;e[71]!==t.favorites||e[72]!==t.providerInstances||e[73]!==t.providerModelPreferences||e[74]!==W||e[75]!==a?(s=e=>{a({providerInstances:an(t.providerInstances,e),providerModelPreferences:an(t.providerModelPreferences,e),favorites:on(t.favorites??[],e),...W===e?{textGenerationModelSelection:i.textGenerationModelSelection}:{}})},e[71]=t.favorites,e[72]=t.providerInstances,e[73]=t.providerModelPreferences,e[74]=W,e[75]=a,e[76]=s):s=e[76];let d=s,p;e[77]!==t.providerModelPreferences||e[78]!==a?(p=(e,n)=>{let r=[...new Set(n.hiddenModels.filter(gn))],i=[...new Set(n.modelOrder.filter(hn))],o=an(t.providerModelPreferences,e);a({providerModelPreferences:r.length===0&&i.length===0?o:{...o,[e]:{hiddenModels:r,modelOrder:i}}})},e[77]=t.providerModelPreferences,e[78]=a,e[79]=p):p=e[79],et=p;let m;e[80]!==t.favorites||e[81]!==a?(m=(e,n)=>{let r=[...new Set(n.map(mn).filter(pn))];a({favorites:[...on(t.favorites??[],e),...r.map(t=>({provider:e,model:t}))]})},e[80]=t.favorites,e[81]=a,e[82]=m):m=e[82],Ze=m;let g;e[83]!==L||e[84]!==ie?(g=e=>{ee(t=>new Set(t).add(e.instanceId)),ie().updateProvider({provider:e.driver,instanceId:e.instanceId}).then(e=>{L(e.providers)}).catch(fn).finally(()=>{ee(t=>{let n=new Set(t);return n.delete(e.instanceId),n})})},e[83]=L,e[84]=ie,e[85]=g):g=e[85],De=g;let _;e[86]!==t.favorites||e[87]!==t.providerInstances||e[88]!==t.providerModelPreferences||e[89]!==t.providers||e[90]!==W||e[91]!==a?(_=e=>{let n=i.providers,r=u(e),o=n[e];o!==void 0&&a({providers:{...t.providers,[e]:o},providerInstances:an(t.providerInstances,r),providerModelPreferences:an(t.providerModelPreferences,r),favorites:on(t.favorites??[],r),...W===r?{textGenerationModelSelection:i.textGenerationModelSelection}:{}})},e[86]=t.favorites,e[87]=t.providerInstances,e[88]=t.providerModelPreferences,e[89]=t.providers,e[90]=W,e[91]=a,e[92]=_):_=e[92];let w=_,T=new Map(f.map(dn));ke=X?Ge(X.driver):void 0,Y=X?T.get(X.instanceId):void 0,J=X?X.instance.displayName?.trim()||ke?.label||String(X.driver):null,Ne=Y&&Ce(Y)?Y:null,be=Ne!==null&&Se(Ne,f),Ee=!!(Y&&xe(Y))||(X?E.has(X.instanceId):!1),Me=X?t.providerModelPreferences?.[X.instanceId]??{hiddenModels:[],modelOrder:[]}:{hiddenModels:[],modelOrder:[]},Ae=X?(t.favorites??[]).filter(e=>e.provider===X.instanceId).map(un):[];let D=(e,t)=>{let r=e.key;if(r!==`ArrowDown`&&r!==`ArrowUp`&&r!==`Home`&&r!==`End`)return;let i=tn(t,r,n.length);if(i===null)return;e.preventDefault();let a=n[i];a&&(x(a.instanceId),(e.currentTarget.closest(`[data-provider-instance-list]`)?.querySelectorAll(`[data-provider-instance-row]`))?.[i]?.focus())},O;e[93]!==d||e[94]!==S||e[95]!==w?(O=()=>{let e=S;if(e){if(C(null),e.kind===`delete`){d(e.instanceId);return}w(e.driver)}},e[93]=d,e[94]=S,e[95]=w,e[96]=O):O=e[96],we=O,ye=ze;let k;e[97]!==fe||e[98]!==a?(k=fe?(0,$.jsx)(Ve,{label:`text generation model`,onClick:()=>a({textGenerationModelSelection:i.textGenerationModelSelection})}):null,e[97]=fe,e[98]=a,e[99]=k):k=e[99];let A;e[100]===l?A=e[101]:(A=l?{disabledReason:l}:{},e[100]=l,e[101]=A);let j;e[102]!==f||e[103]!==t||e[104]!==a?(j=(e,n)=>{a({textGenerationModelSelection:y({...t,textGenerationModelSelection:te(e,n)},f)})},e[102]=f,e[103]=t,e[104]=a,e[105]=j):j=e[105];let ne;e[106]!==oe||e[107]!==ue||e[108]!==c||e[109]!==A||e[110]!==j||e[111]!==W||e[112]!==G?(ne=(0,$.jsx)(He,{activeInstanceId:W,model:G,lockedProvider:null,instanceEntries:oe,modelOptionsByInstance:ue,triggerVariant:`outline`,triggerClassName:`min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground`,disabled:c,...A,onInstanceModelChange:j}),e[106]=oe,e[107]=ue,e[108]=c,e[109]=A,e[110]=j,e[111]=W,e[112]=G,e[113]=ne):ne=e[113];let M;e[114]===ce?.models?M=e[115]:(M=ce?.models??[],e[114]=ce?.models,e[115]=M);let N;e[116]===l?N=e[117]:(N=l?{disabledReason:l}:{},e[116]=l,e[117]=N);let F;e[118]!==f||e[119]!==t||e[120]!==W||e[121]!==G||e[122]!==a?(F=e=>{a({textGenerationModelSelection:y({...t,textGenerationModelSelection:te(W,G,e)},f)})},e[118]=f,e[119]=t,e[120]=W,e[121]=G,e[122]=a,e[123]=F):F=e[123];let I;e[124]!==c||e[125]!==M||e[126]!==N||e[127]!==F||e[128]!==G||e[129]!==K||e[130]!==q?(I=(0,$.jsx)(je,{provider:q,models:M,model:G,prompt:``,onPromptChange:ln,modelOptions:K,allowPromptInjectedEffort:!1,triggerVariant:`outline`,triggerClassName:`min-w-0 max-w-none shrink-0 text-foreground/90 hover:text-foreground`,disabled:c,...N,onModelOptionsChange:F}),e[124]=c,e[125]=M,e[126]=N,e[127]=F,e[128]=G,e[129]=K,e[130]=q,e[131]=I):I=e[131];let re;e[132]!==ne||e[133]!==I?(re=(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[ne,I]}),e[132]=ne,e[133]=I,e[134]=re):re=e[134],e[135]!==k||e[136]!==re?(Ke=(0,$.jsx)(Re,{title:`Text generation`,children:(0,$.jsx)(Be,{title:`Text generation model`,description:`Configure the model used for generated commit messages, PR titles, and similar Git text.`,resetAction:k,control:re})}),e[135]=k,e[136]=re,e[137]=Ke):Ke=e[137],he=Re,We=`Providers`;let R;e[138]===me?R=e[139]:(R=(0,$.jsx)(sn,{lastCheckedAt:me}),e[138]=me,e[139]=R);let z;e[140]===U?z=e[141]:(z=()=>void U(),e[140]=U,e[141]=z);let B;e[142]===h?B=e[143]:(B=h?(0,$.jsx)(Te,{className:`size-3 animate-spin`}):(0,$.jsx)(Oe,{className:`size-3`}),e[142]=h,e[143]=B);let V;e[144]!==h||e[145]!==z||e[146]!==B?(V=(0,$.jsx)(ge,{render:(0,$.jsx)(P,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:h,onClick:z,"aria-label":`Refresh provider status`,children:B})}),e[144]=h,e[145]=z,e[146]=B,e[147]=V):V=e[147];let H;e[148]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,$.jsx)(_e,{side:`top`,children:`Refresh provider status`}),e[148]=H):H=e[148];let ae;e[149]===V?ae=e[150]:(ae=(0,$.jsxs)(ve,{children:[V,H]}),e[149]=V,e[150]=ae),e[151]!==R||e[152]!==ae?(Z=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[R,ae]}),e[151]=R,e[152]=ae,e[153]=Z):Z=e[153],Ue=`grid min-h-[34rem] md:grid-cols-[minmax(13.5rem,0.75fr)_minmax(0,1.55fr)]`,Fe=`app-muted-surface min-w-0 border-b border-border/70 md:border-r md:border-b-0`;let se;e[154]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(`h3`,{className:`text-[13px] font-semibold tracking-[-0.01em] text-foreground`,children:`Instances`}),e[154]=se):se=e[154];let le=(0,$.jsxs)(`div`,{className:`min-w-0`,children:[se,(0,$.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[n.length,` configured`]})]}),de;e[155]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>v(!0),e[155]=de):de=e[155];let pe;e[156]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,$.jsxs)(P,{size:`xs`,variant:`outline`,className:`h-7 shrink-0 gap-1.5 px-2 text-xs`,onClick:de,"aria-label":`Add provider instance`,children:[(0,$.jsx)(qe,{className:`size-3`}),`Add`]}),e[156]=pe):pe=e[156],e[157]===le?Le=e[158]:(Le=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border/70 px-3 py-3`,children:[le,pe]}),e[157]=le,e[158]=Le),Je=`Provider instances`,Ye=!0,Xe=`grid max-h-64 gap-1 overflow-y-auto p-2 md:max-h-[min(44rem,calc(100dvh-15rem))]`,Pe=n.map((e,t)=>(0,$.jsx)(Zt,{instanceId:e.instanceId,instance:e.instance,driverOption:Ge(e.driver),liveProvider:T.get(e.instanceId),isDefault:e.isDefault,selected:e.instanceId===r,editorId:`provider-instance-editor`,onSelect:()=>x(e.instanceId),onKeyDown:e=>D(e,t)},e.instanceId)),e[21]=L,e[22]=oe,e[23]=ue,e[24]=fe,e[25]=h,e[26]=me,e[27]=S,e[28]=ie,e[29]=U,e[30]=b,e[31]=f,e[32]=t,e[33]=c,e[34]=l,e[35]=ce?.models,e[36]=W,e[37]=G,e[38]=K,e[39]=q,e[40]=a,e[41]=E,e[42]=he,e[43]=ye,e[44]=be,e[45]=we,e[46]=Ee,e[47]=De,e[48]=J,e[49]=ke,e[50]=Ae,e[51]=Y,e[52]=Me,e[53]=X,e[54]=Ne,e[55]=Pe,e[56]=Fe,e[57]=Le,e[58]=Ue,e[59]=We,e[60]=Z,e[61]=Ke,e[62]=Je,e[63]=Ye,e[64]=Xe,e[65]=Ze,e[66]=$e,e[67]=et}else he=e[42],ye=e[43],be=e[44],we=e[45],Ee=e[46],De=e[47],J=e[48],ke=e[49],Ae=e[50],Y=e[51],Me=e[52],X=e[53],Ne=e[54],Pe=e[55],Fe=e[56],Le=e[57],Ue=e[58],We=e[59],Z=e[60],Ke=e[61],Je=e[62],Ye=e[63],Xe=e[64],Ze=e[65],$e=e[66],et=e[67];let tt;e[159]!==Pe||e[160]!==Je||e[161]!==Ye||e[162]!==Xe?(tt=(0,$.jsx)(`nav`,{"aria-label":Je,"data-provider-instance-list":Ye,className:Xe,children:Pe}),e[159]=Pe,e[160]=Je,e[161]=Ye,e[162]=Xe,e[163]=tt):tt=e[163];let nt;e[164]!==Fe||e[165]!==Le||e[166]!==tt?(nt=(0,$.jsxs)(`aside`,{className:Fe,children:[Le,tt]}),e[164]=Fe,e[165]=Le,e[166]=tt,e[167]=nt):nt=e[167];let rt=J?`Edit ${J}`:`Provider editor`,it;e[168]!==be||e[169]!==Ee||e[170]!==De||e[171]!==J||e[172]!==ke||e[173]!==Ae||e[174]!==Y||e[175]!==Me||e[176]!==X||e[177]!==Ne||e[178]!==W||e[179]!==Ze||e[180]!==$e||e[181]!==et?(it=X?(0,$.jsx)(qt,{instanceId:X.instanceId,instance:X.instance,driverOption:ke,liveProvider:Y,isDefault:X.isDefault,onUpdate:e=>{let t=X.instance.enabled??!0;e.enabled===!1&&t&&W===X.instanceId?$e(X,e,{textGenerationModelSelection:i.textGenerationModelSelection}):$e(X,e)},onDelete:X.isDefault?void 0:()=>C({kind:`delete`,instanceId:X.instanceId,displayName:J??String(X.instanceId)}),headerAction:X.isDefault&&X.isDirty?(0,$.jsx)(Ve,{label:`${J??String(X.driver)} provider settings`,onClick:()=>C({kind:`reset`,driver:X.driver,displayName:J??String(X.driver)})}):null,hiddenModels:Me.hiddenModels,favoriteModels:Ae,modelOrder:Me.modelOrder,onHiddenModelsChange:e=>et(X.instanceId,{...Me,hiddenModels:e}),onFavoriteModelsChange:e=>Ze(X.instanceId,e),onModelOrderChange:e=>et(X.instanceId,{...Me,modelOrder:e}),onRunUpdate:be?()=>De(Ne):void 0,isUpdating:Ee},X.instanceId):(0,$.jsx)(`div`,{className:`grid min-h-64 place-items-center px-6 py-12 text-center`,children:(0,$.jsxs)(`div`,{className:`max-w-xs space-y-1`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`No provider instances`}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Add an instance to configure a provider for this environment.`})]})}),e[168]=be,e[169]=Ee,e[170]=De,e[171]=J,e[172]=ke,e[173]=Ae,e[174]=Y,e[175]=Me,e[176]=X,e[177]=Ne,e[178]=W,e[179]=Ze,e[180]=$e,e[181]=et,e[182]=it):it=e[182];let at;e[183]!==rt||e[184]!==it?(at=(0,$.jsx)(`section`,{id:`provider-instance-editor`,"aria-label":rt,className:`min-w-0 bg-card`,children:it}),e[183]=rt,e[184]=it,e[185]=at):at=e[185];let ot;e[186]!==Ue||e[187]!==nt||e[188]!==at?(ot=(0,$.jsxs)(`div`,{className:Ue,children:[nt,at]}),e[186]=Ue,e[187]=nt,e[188]=at,e[189]=ot):ot=e[189];let st;e[190]!==he||e[191]!==We||e[192]!==Z||e[193]!==ot?(st=(0,$.jsx)(he,{title:We,headerAction:Z,children:ot}),e[190]=he,e[191]=We,e[192]=Z,e[193]=ot,e[194]=st):st=e[194];let ct;e[195]===_?ct=e[196]:(ct=(0,$.jsx)(xt,{open:_,onOpenChange:v,onCreated:x}),e[195]=_,e[196]=ct);let lt=S!==null,ut;e[197]===Symbol.for(`react.memo_cache_sentinel`)?(ut=e=>!e&&C(null),e[197]=ut):ut=e[197];let dt=S?.kind===`delete`?`Delete ${S.displayName}?`:`Reset ${S?.displayName??`provider`}?`,ft;e[198]===dt?ft=e[199]:(ft=(0,$.jsx)(R,{children:dt}),e[198]=dt,e[199]=ft);let pt=S?.kind===`delete`?`This removes the instance, its model preferences, and its favorites. Existing threads that reference it may no longer start; text generation returns to its default if needed.`:`This restores the built-in instance configuration, removes its model preferences and favorites, and resets text generation if it uses this instance.`,mt;e[200]===pt?mt=e[201]:(mt=(0,$.jsx)(B,{children:pt}),e[200]=pt,e[201]=mt);let ht;e[202]!==ft||e[203]!==mt?(ht=(0,$.jsxs)(ae,{children:[ft,mt]}),e[202]=ft,e[203]=mt,e[204]=ht):ht=e[204];let gt;e[205]===S?gt=e[206]:(gt=S?.kind===`delete`?(0,$.jsx)(`div`,{className:`px-6 pb-4`,children:(0,$.jsx)(`code`,{className:`block rounded-md border border-border/70 bg-muted/40 px-3 py-2 text-xs text-foreground`,children:S.instanceId})}):null,e[205]=S,e[206]=gt);let _t;e[207]===Symbol.for(`react.memo_cache_sentinel`)?(_t=(0,$.jsx)(le,{render:(0,$.jsx)(P,{variant:`outline`}),children:`Cancel`}),e[207]=_t):_t=e[207];let vt=S?.kind===`delete`?`destructive`:`default`,yt=S?.kind===`delete`?`Delete instance`:`Reset settings`,bt;e[208]!==we||e[209]!==vt||e[210]!==yt?(bt=(0,$.jsxs)(V,{children:[_t,(0,$.jsx)(P,{variant:vt,onClick:we,children:yt})]}),e[208]=we,e[209]=vt,e[210]=yt,e[211]=bt):bt=e[211];let St;e[212]!==ht||e[213]!==gt||e[214]!==bt?(St=(0,$.jsxs)(re,{children:[ht,gt,bt]}),e[212]=ht,e[213]=gt,e[214]=bt,e[215]=St):St=e[215];let Ct;e[216]!==lt||e[217]!==St?(Ct=(0,$.jsx)(F,{open:lt,onOpenChange:ut,children:St}),e[216]=lt,e[217]=St,e[218]=Ct):Ct=e[218];let wt;return e[219]!==ye||e[220]!==Ke||e[221]!==st||e[222]!==ct||e[223]!==Ct?(wt=(0,$.jsxs)(ye,{children:[Ke,st,ct,Ct]}),e[219]=ye,e[220]=Ke,e[221]=st,e[222]=ct,e[223]=Ct,e[224]=wt):wt=e[224],wt}function ln(){}function un(e){return e.model}function dn(e){return[e.instanceId,e]}function fn(e){S.add(ke({type:`error`,title:`Provider update failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function pn(e){return e.length>0}function mn(e){return e.trim()}function hn(e){return e.trim().length>0}function gn(e){return e.trim().length>0}function _n(e,t){return t.checkedAt>e?t.checkedAt:e}function vn(e){S.add(ke({type:`error`,title:`Failed to refresh providers`,description:e instanceof Error?e.message:`An error occurred.`}))}export{cn as ProvidersSettingsPanel};