ryco-cli 0.1.12 → 0.1.14

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 (215) hide show
  1. package/dist/{AcpNativeLogging-Ba9Nn9Re.mjs → AcpNativeLogging-D3fe64a6.mjs} +1 -1
  2. package/dist/{AcpNativeLogging-Be1KGJfF.cjs → AcpNativeLogging-vLtnq5f1.cjs} +1 -1
  3. package/dist/{AzureDevOpsSourceControlProvider-CVj-F-pW.cjs → AzureDevOpsSourceControlProvider-BtezW57t.cjs} +2 -2
  4. package/dist/{AzureDevOpsSourceControlProvider-CGlK6M0b.mjs → AzureDevOpsSourceControlProvider-WNUDtsur.mjs} +2 -2
  5. package/dist/{BitbucketSourceControlProvider-CEZEd4PX.cjs → BitbucketSourceControlProvider-BWzNM0jW.cjs} +2 -2
  6. package/dist/{BitbucketSourceControlProvider-BV6iRDi7.mjs → BitbucketSourceControlProvider-tbbUFKz3.mjs} +2 -2
  7. package/dist/{ClaudeDriver-lBU7EyUX.cjs → ClaudeDriver-BTvdJvam.cjs} +170 -7
  8. package/dist/{ClaudeDriver-rooMNrJz.mjs → ClaudeDriver-CG5ngU5z.mjs} +171 -8
  9. package/dist/{CodexDriver-DBz2rPXb.mjs → CodexDriver-49o7TA-C.mjs} +4 -4
  10. package/dist/{CodexDriver-CZCIJSLV.cjs → CodexDriver-CFxwJNXx.cjs} +3 -3
  11. package/dist/{CodexTextGeneration-BeG7ymPC.mjs → CodexTextGeneration-C0t4xcPO.mjs} +2 -2
  12. package/dist/{CodexTextGeneration-BvIcyD1P.cjs → CodexTextGeneration-CedcXf9a.cjs} +1 -1
  13. package/dist/{CopilotDriver-CX5zhEdZ.cjs → CopilotDriver-B8J_ovCX.cjs} +20 -16
  14. package/dist/{CopilotDriver-D36vbGbn.mjs → CopilotDriver-Cu1B1skB.mjs} +21 -17
  15. package/dist/{CursorDriver-DWuuOSkJ.mjs → CursorDriver-P_A8uQki.mjs} +4 -4
  16. package/dist/{CursorDriver-CPBVeesr.cjs → CursorDriver-zlKHPy1_.cjs} +3 -3
  17. package/dist/{ForgejoSourceControlProvider-CeN7Snfr.mjs → ForgejoSourceControlProvider-DLhJZtq9.mjs} +2 -2
  18. package/dist/{ForgejoSourceControlProvider-CzmmcAZO.cjs → ForgejoSourceControlProvider-szJ-dvsD.cjs} +2 -2
  19. package/dist/{GitHubSourceControlProvider-DfFR9O2o.cjs → GitHubSourceControlProvider-3ofb6HsF.cjs} +2 -2
  20. package/dist/{GitHubSourceControlProvider-Dmz1LJct.mjs → GitHubSourceControlProvider-D5MQQPCJ.mjs} +2 -2
  21. package/dist/{GitLabSourceControlProvider-C21lwphV.mjs → GitLabSourceControlProvider-DLkxeob5.mjs} +2 -2
  22. package/dist/{GitLabSourceControlProvider-DGoelNmL.cjs → GitLabSourceControlProvider-DkupZH5G.cjs} +2 -2
  23. package/dist/{GrokDriver-CIXj_4ry.cjs → GrokDriver-CTUNclwp.cjs} +3 -3
  24. package/dist/{GrokDriver-qKX1a63G.mjs → GrokDriver-D8KoMY76.mjs} +4 -4
  25. package/dist/{OpenCodeDriver-CbdswhqU.mjs → OpenCodeDriver-B7htxutj.mjs} +92 -27
  26. package/dist/{OpenCodeDriver-DDEuwtXl.cjs → OpenCodeDriver-pXM8bSct.cjs} +91 -26
  27. package/dist/{SourceControlProviderDiscoveryCatalog-DJWDCoup.cjs → SourceControlProviderDiscoveryCatalog-Bj_sZfmB.cjs} +1 -1
  28. package/dist/{SourceControlProviderDiscoveryCatalog-4_4yahsa.mjs → SourceControlProviderDiscoveryCatalog-C6Fn7rZE.mjs} +1 -1
  29. package/dist/bin.cjs +1113 -312
  30. package/dist/bin.mjs +1115 -315
  31. package/dist/client/assets/{AccountSettings-C3v2klAG.js → AccountSettings-CinnQaX-.js} +1 -1
  32. package/dist/client/assets/{AiFocusSettings-BquKjnWf.js → AiFocusSettings-UbXOywZg.js} +1 -1
  33. package/dist/client/assets/{AnimatedHeight-BIsV_Z3J.js → AnimatedHeight-DCad8EQ2.js} +1 -1
  34. package/dist/client/assets/AppearanceSettings-CTh8Z8nz.js +1 -0
  35. package/dist/client/assets/{BranchToolbar.logic-CmvD76Cw.js → BranchToolbar.logic-37EnknDD.js} +1 -1
  36. package/dist/client/assets/ChatRightPanel-DUwLYKbp.js +27 -0
  37. package/dist/client/assets/{ChatThreadRouteView-DlgAAOCp.js → ChatThreadRouteView-C43W0PEz.js} +1 -1
  38. package/dist/client/assets/CommandPaletteDialog-IHOe0hOG.js +1 -0
  39. package/dist/client/assets/{CompositeItem-F3NGn6aG.js → CompositeItem-ClLCuzeJ.js} +1 -1
  40. package/dist/client/assets/{CompositeRoot-CmJGfRtc.js → CompositeRoot-Bdsr9eHn.js} +1 -1
  41. package/dist/client/assets/{ConnectionsSettings-Ccn8q4fG.js → ConnectionsSettings-tmBjGOPj.js} +2 -2
  42. package/dist/client/assets/{DiagnosticsSettings-QXpjXOrH.js → DiagnosticsSettings-CbCEgaau.js} +1 -1
  43. package/dist/client/assets/{DialogHandle-C4uSr9wX.js → DialogHandle-CitVLvYq.js} +1 -1
  44. package/dist/client/assets/{DialogPopup-Dck8r8Hn.js → DialogPopup-CfaEr9jv.js} +1 -1
  45. package/dist/client/assets/DialogRoot-CyEOjgGH.js +1 -0
  46. package/dist/client/assets/{DialogTitle-CCedPAjV.js → DialogTitle-BUkU0qXf.js} +1 -1
  47. package/dist/client/assets/{DialogTrigger-CYJ7_YcV.js → DialogTrigger-CEjWue7M.js} +1 -1
  48. package/dist/client/assets/{DialogViewport-D-CrTM-P.js → DialogViewport-Cyc_ye5w.js} +1 -1
  49. package/dist/client/assets/{DraftChatThreadRouteView-DFMY6O91.js → DraftChatThreadRouteView-BSA67nKa.js} +1 -1
  50. package/dist/client/assets/{ExternalIdentityWeb.logic-D64j70NH.js → ExternalIdentityWeb.logic-BqdBjAua.js} +1 -1
  51. package/dist/client/assets/GlassSurface-B3cq28tB.js +1 -0
  52. package/dist/client/assets/{HostedConnectionControls-BC4kVWTa.js → HostedConnectionControls-S2Wr9fiZ.js} +1 -1
  53. package/dist/client/assets/HostedHubRoot-DK9zP4tJ.js +1 -0
  54. package/dist/client/assets/{HostedNativeAuthorizationRoute-Df0oSrLR.js → HostedNativeAuthorizationRoute-CKnLbCOH.js} +1 -1
  55. package/dist/client/assets/{HostedRelayTrustNotice-ffS_O2AX.js → HostedRelayTrustNotice-CbF_SOpf.js} +1 -1
  56. package/dist/client/assets/{Icons-CT3nd2MA.js → Icons-DZpTOLIb.js} +1 -1
  57. package/dist/client/assets/{IntegrationsSettingsPanel-BHyy-VM0.js → IntegrationsSettingsPanel-BdBEGIyL.js} +1 -1
  58. package/dist/client/assets/KeybindingsSettings-Bye1H9Sx.js +7 -0
  59. package/dist/client/assets/{McpServersSettings-UthT1T80.js → McpServersSettings-D0U0g2q7.js} +1 -1
  60. package/dist/client/assets/{MobileSheet-CkeG6_SP.js → MobileSheet-BPvuTPR6.js} +1 -1
  61. package/dist/client/assets/{NewWorktreeDialog-DTZnArOC.js → NewWorktreeDialog-C_xJCZWF.js} +1 -1
  62. package/dist/client/assets/{NoActiveThreadState-jcEAWu7N.js → NoActiveThreadState-Cfn_Wwnf.js} +1 -1
  63. package/dist/client/assets/{NodeSecuritySettings-DPqjRphc.js → NodeSecuritySettings-DUQNZJqJ.js} +1 -1
  64. package/dist/client/assets/{OpinionatedPluginsSettings-BSy3F4v6.js → OpinionatedPluginsSettings-D44efcv7.js} +1 -1
  65. package/dist/client/assets/{PhoneGetAppInterstitial-B2mrJtgM.js → PhoneGetAppInterstitial-CzduFI4-.js} +1 -1
  66. package/dist/client/assets/{PhoneGetAppInterstitialBackdrop-B8vfJdZd.js → PhoneGetAppInterstitialBackdrop-CJ44QRCp.js} +1 -1
  67. package/dist/client/assets/PhoneHome-BLEJm5TG.js +1 -0
  68. package/dist/client/assets/PhoneSettingsSurface-CqetLTIm.js +1 -0
  69. package/dist/client/assets/{ProjectFavicon-BhQnkxbx.js → ProjectFavicon-DrBXI2cH.js} +1 -1
  70. package/dist/client/assets/{ProviderModelPicker-COg6CGM4.js → ProviderModelPicker-CyID3P1C.js} +1 -1
  71. package/dist/client/assets/{ProviderUpdateLaunchNotification.logic-BkoRegCn.js → ProviderUpdateLaunchNotification.logic-C6VoLD-w.js} +1 -1
  72. package/dist/client/assets/ProvidersSettingsPanel-BHmpXUIM.js +1 -0
  73. package/dist/client/assets/{RedactedSensitiveText-CxtaUiKH.js → RedactedSensitiveText-CZwFEoNn.js} +1 -1
  74. package/dist/client/assets/RootAppShell-BVXRShhe.js +6 -0
  75. package/dist/client/assets/{RycoLetterMark-Bk0kvGJ_.js → RycoLetterMark-C-fvI9UB.js} +1 -1
  76. package/dist/client/assets/SettingsDialog-CnETTu23.js +1 -0
  77. package/dist/client/assets/{SettingsPanels-D8Xy3pPC.js → SettingsPanels-C3HDrmQq.js} +3 -3
  78. package/dist/client/assets/{SettingsPanels.editor-B2x4U4rW.js → SettingsPanels.editor-DI8Z5rsl.js} +1 -1
  79. package/dist/client/assets/SourceControlSettings-BG4tsvql.js +1 -0
  80. package/dist/client/assets/{StatisticsPage-C38pI2_b.js → StatisticsPage-dy_aYqvS.js} +1 -1
  81. package/dist/client/assets/{StatisticsPanel-6sINT28-.js → StatisticsPanel-CeRJBu65.js} +1 -1
  82. package/dist/client/assets/{StatisticsSettingsLink-Cx43bOeo.js → StatisticsSettingsLink-ChlwCDG0.js} +1 -1
  83. package/dist/client/assets/ThreadStatusIndicators-D-ioX09X.js +0 -0
  84. package/dist/client/assets/{ThreadTerminalDrawer-C4NJu8Qs.js → ThreadTerminalDrawer-BvGaRxBP.js} +1 -1
  85. package/dist/client/assets/{ThreadWorkspacePanel-D9qlHXCA.js → ThreadWorkspacePanel-BAWm7mGl.js} +2 -2
  86. package/dist/client/assets/{ToolbarRootContext-BgqqXVly.js → ToolbarRootContext-k-_m5nCN.js} +1 -1
  87. package/dist/client/assets/{WorkItemsTab-BDAeQe4D.js → WorkItemsTab-Q2V2EuvK.js} +12 -12
  88. package/dist/client/assets/{alert-LqMhbdE9.js → alert-BymbRVPf.js} +1 -1
  89. package/dist/client/assets/{alert-dialog-DxoA6ky8.js → alert-dialog-Gym8_p4Q.js} +1 -1
  90. package/dist/client/assets/appearancePreferences-BhNRCg6W.js +1 -0
  91. package/dist/client/assets/authorization-BwQZHweJ.js +1 -0
  92. package/dist/client/assets/{badge-CXw6fWrB.js → badge-BQI7J3Sg.js} +1 -1
  93. package/dist/client/assets/{branding-DeKsIp6g.js → branding-DqHDcyzW.js} +1 -1
  94. package/dist/client/assets/{button-BAbJxRzt.js → button-Wf_1nfeu.js} +1 -1
  95. package/dist/client/assets/{capabilities-BkVqeGLQ.js → capabilities-BrllgEYz.js} +1 -1
  96. package/dist/client/assets/{chatThreadActions-DQ8aOQ1g.js → chatThreadActions-BGkJmj6T.js} +1 -1
  97. package/dist/client/assets/{collapsible-dxy6kc2k.js → collapsible-GOpRckDq.js} +1 -1
  98. package/dist/client/assets/{command-CGNKG_Oe.js → command-Dx5YM54H.js} +1 -1
  99. package/dist/client/assets/composerDraftStore-DC2r8dcu.js +11 -0
  100. package/dist/client/assets/{data-list-CYKBxN62.js → data-list-BSiCZBKn.js} +1 -1
  101. package/dist/client/assets/{desktopUpdateAtoms-B9iJXSdW.js → desktopUpdateAtoms-DkmoIGr0.js} +1 -1
  102. package/dist/client/assets/{desktopWorkspace-B-cSBe8H.js → desktopWorkspace-Ddm531g5.js} +1 -1
  103. package/dist/client/assets/{device-DfIh5pQV.js → device-B0aqBYM1.js} +1 -1
  104. package/dist/client/assets/{dialog-DQsYchqu.js → dialog-CUxw5AxI.js} +1 -1
  105. package/dist/client/assets/{draft-input-CkzOk8BY.js → draft-input-CpfrGQ1h.js} +1 -1
  106. package/dist/client/assets/editorPreferences-SOMXdQpi.js +1 -0
  107. package/dist/client/assets/{empty-DwzqNgCP.js → empty-D420OZA9.js} +1 -1
  108. package/dist/client/assets/{env-B4arEvJg.js → env-Bf33qXdb.js} +1 -1
  109. package/dist/client/assets/{getPseudoElementBounds-X62ElHN8.js → getPseudoElementBounds-nDGTWECG.js} +1 -1
  110. package/dist/client/assets/{group-D9ER9giz.js → group-Cq4Llttm.js} +1 -1
  111. package/dist/client/assets/{index-Bntnmu6O.js → index-BL8_ra0g.js} +2 -2
  112. package/dist/client/assets/{input-CHEwW3oH.js → input-Dl4N9ZfE.js} +1 -1
  113. package/dist/client/assets/{kbd-DCGQZk18.js → kbd-CqoZVQfv.js} +1 -1
  114. package/dist/client/assets/{keybindings-CWJ7E9ZI.js → keybindings-DQzcPjMv.js} +1 -1
  115. package/dist/client/assets/{label-CVFHsLFO.js → label-x5DgpBI_.js} +1 -1
  116. package/dist/client/assets/{lib-qiiNMGgU.js → lib-BXIqHSZx.js} +1 -1
  117. package/dist/client/assets/{liquidGlass-CPsvmaF0.js → liquidGlass-yFkZrRk5.js} +1 -1
  118. package/dist/client/assets/{logging-M8H3z7rQ.js → logging-CZlHfeu2.js} +1 -1
  119. package/dist/client/assets/main-B7T7on1T.css +2 -0
  120. package/dist/client/assets/main-J4YlUJad.js +9 -0
  121. package/dist/client/assets/{menu-Dvxh8sD5.js → menu-BuDpxm_Q.js} +1 -1
  122. package/dist/client/assets/{popover-CuH9Yrj3.js → popover-DuprDUaB.js} +1 -1
  123. package/dist/client/assets/primary-CJx2nSkc.js +2 -0
  124. package/dist/client/assets/projectPaths-DrelgodZ.js +1 -0
  125. package/dist/client/assets/{providerDriverMeta-I0TSo-QI.js → providerDriverMeta-D27Koh7Q.js} +1 -1
  126. package/dist/client/assets/{providerIconUtils-CzSa_16f.js → providerIconUtils-CtOHwjWL.js} +1 -1
  127. package/dist/client/assets/providerInstances-BPwEwwpF.js +1 -0
  128. package/dist/client/assets/providerModels-BPwEwwpF.js +1 -0
  129. package/dist/client/assets/{qr-code-Bddq6K7S.js → qr-code-BVfzPOP3.js} +1 -1
  130. package/dist/client/assets/{radio-group-CBZFr4C8.js → radio-group-rgmJqPI7.js} +1 -1
  131. package/dist/client/assets/{resolveAriaLabelledBy-CD_ugzhJ.js → resolveAriaLabelledBy-l4SuqStl.js} +1 -1
  132. package/dist/client/assets/{rightPanelRouteSearch-DB5gQGHK.js → rightPanelRouteSearch-DmpObL1z.js} +1 -1
  133. package/dist/client/assets/runtime-DYzjhL5M.js +1 -0
  134. package/dist/client/assets/{scroll-area-Drsa8bNB.js → scroll-area-DMs8l4bb.js} +1 -1
  135. package/dist/client/assets/{scrollEdges-B-cqxY4l.js → scrollEdges-DWTOweRb.js} +1 -1
  136. package/dist/client/assets/{select-BYbVr-yg.js → select-Djwp8HDm.js} +1 -1
  137. package/dist/client/assets/{separator-CdS5bi4Z.js → separator-rjtf5Q3V.js} +1 -1
  138. package/dist/client/assets/{session-logic-wxhvMgEN.js → session-logic-DLEAZb3K.js} +2 -2
  139. package/dist/client/assets/{settingsDialogStore-ygYoScKe.js → settingsDialogStore-Dbykwvfs.js} +1 -1
  140. package/dist/client/assets/{settingsLayout-D8glO7f1.js → settingsLayout-C7bl9Xi4.js} +1 -1
  141. package/dist/client/assets/{sheet-BO78gIKZ.js → sheet-CQIQYfOM.js} +1 -1
  142. package/dist/client/assets/{sidebar-Dm6l2GA6.js → sidebar-BdDOvXe8.js} +1 -1
  143. package/dist/client/assets/sidebarProjectFolders-D_Me0oJ8.js +4 -0
  144. package/dist/client/assets/{sidebarStatusText-D0HT0fek.js → sidebarStatusText-BF6odB03.js} +1 -1
  145. package/dist/client/assets/{skeleton-CvQSeJbw.js → skeleton-Mgh4Gx9x.js} +1 -1
  146. package/dist/client/assets/{spinner-ClF0jOcX.js → spinner-CzzUdFeE.js} +1 -1
  147. package/dist/client/assets/{src-Vf4LVnMX.js → src-Ca7Gag3m.js} +1 -1
  148. package/dist/client/assets/storeSelectors-D7HbqO4E.js +1 -0
  149. package/dist/client/assets/{switch-BTGo9Yip.js → switch-CntUxI1A.js} +1 -1
  150. package/dist/client/assets/{terminal-links-CZ3c9AbA.js → terminal-links-CUFISn8U.js} +1 -1
  151. package/dist/client/assets/{textarea-RFPODxWW.js → textarea-C8QxddDb.js} +1 -1
  152. package/dist/client/assets/threadPinning-BIV4KXZU.js +1 -0
  153. package/dist/client/assets/{threadPriorityRefreshRuntime-tRDgvBzr.js → threadPriorityRefreshRuntime-B-pVYK_y.js} +1 -1
  154. package/dist/client/assets/{toast-CcSCAm4B.js → toast-Cw7bXJzg.js} +1 -1
  155. package/dist/client/assets/{toggle-I6h33Cu5.js → toggle-Bi9uP4Hb.js} +1 -1
  156. package/dist/client/assets/{toggle-group-mLIkiJtU.js → toggle-group-LcgyMgj5.js} +1 -1
  157. package/dist/client/assets/{tooltip-C8sAONBj.js → tooltip-t3Nrleyq.js} +1 -1
  158. package/dist/client/assets/types-D7HbqO4E.js +1 -0
  159. package/dist/client/assets/{uiStateStore-B6pjzSjj.js → uiStateStore-BW2WnK4k.js} +1 -1
  160. package/dist/client/assets/useAtlassian-a-MaAd0k.js +0 -0
  161. package/dist/client/assets/{useButton-D__1LqCF.js → useButton-DUuWgIMw.js} +1 -1
  162. package/dist/client/assets/{useCompositeListItem-Cmr_nuuG.js → useCompositeListItem-CL5mJqCb.js} +1 -1
  163. package/dist/client/assets/{useDebouncedValue-DHjoudTq.js → useDebouncedValue-jDDWNjgt.js} +1 -1
  164. package/dist/client/assets/{useFloatingRootContext-D5EZmrCa.js → useFloatingRootContext-C4I8IxtL.js} +1 -1
  165. package/dist/client/assets/{useHandleNewThread-Bvz-DKgn.js → useHandleNewThread-820pBJCC.js} +1 -1
  166. package/dist/client/assets/{useLabelableId-DnQJ7amm.js → useLabelableId-KX33mhBC.js} +1 -1
  167. package/dist/client/assets/{useLocation-CDeYzWW6.js → useLocation-B4QlXdMt.js} +1 -1
  168. package/dist/client/assets/{useOpenInteractionType-CjtpACKR.js → useOpenInteractionType-DjM9MBY7.js} +1 -1
  169. package/dist/client/assets/{usePhoneThreadActions-CAgIq9aZ.js → usePhoneThreadActions-DxxWMYgC.js} +1 -1
  170. package/dist/client/assets/{usePopupViewport-BuhsNdVy.js → usePopupViewport-CAMlnyaP.js} +1 -1
  171. package/dist/client/assets/{useScrollLock-D3tMGsRk.js → useScrollLock-CAPfesBT.js} +1 -1
  172. package/dist/client/assets/{useStatistics-CiLROMJP.js → useStatistics-CWasDzsV.js} +2 -2
  173. package/dist/client/assets/{useSwipeDismiss-CbgDJvw1.js → useSwipeDismiss-BZsYSBgq.js} +1 -1
  174. package/dist/client/assets/{useTheme-DiC-5xCb.js → useTheme-By1kfyiU.js} +1 -1
  175. package/dist/client/assets/{useThreadActions-Vew3ScxG.js → useThreadActions-MOjDrEnS.js} +1 -1
  176. package/dist/client/assets/{useTriggerFocusGuards-CrugmkhX.js → useTriggerFocusGuards-D5z439rn.js} +1 -1
  177. package/dist/client/assets/{useValueChanged-MQtIzPIU.js → useValueChanged-D0CHQQwP.js} +1 -1
  178. package/dist/client/assets/{utils-BofFIn5Y.js → utils-B76_2Yk7.js} +1 -1
  179. package/dist/client/index.html +1 -1
  180. package/dist/{collectUint8StreamText-Bb52hlpd.cjs → collectUint8StreamText-B9B7bGv9.cjs} +46 -10
  181. package/dist/{collectUint8StreamText-EDg4F0TU.mjs → collectUint8StreamText-RzKEq2NY.mjs} +35 -11
  182. package/dist/{makeManagedServerProvider-itynW7xv.cjs → makeManagedServerProvider-BF1eBatf.cjs} +1 -1
  183. package/dist/{makeManagedServerProvider-Cf8bNWwc.mjs → makeManagedServerProvider-BuG2fLP8.mjs} +1 -1
  184. package/package.json +1 -1
  185. package/dist/client/assets/AppearanceSettings-CYbSApl4.js +0 -1
  186. package/dist/client/assets/ChatRightPanel-DVxRdZWT.js +0 -27
  187. package/dist/client/assets/CommandPaletteDialog-BnJURcy7.js +0 -1
  188. package/dist/client/assets/DialogRoot-BpIvUdm7.js +0 -1
  189. package/dist/client/assets/GlassSurface-C3IIWMu9.js +0 -1
  190. package/dist/client/assets/HostedHubRoot-pBGVub10.js +0 -1
  191. package/dist/client/assets/KeybindingsSettings-BfkONqmZ.js +0 -7
  192. package/dist/client/assets/PhoneHome-C-ttaKuE.js +0 -1
  193. package/dist/client/assets/PhoneSettingsSurface-CJddundi.js +0 -1
  194. package/dist/client/assets/ProvidersSettingsPanel-C3aPyCrN.js +0 -1
  195. package/dist/client/assets/RootAppShell-3T2sBtpP.js +0 -6
  196. package/dist/client/assets/SettingsDialog-krsStFrf.js +0 -1
  197. package/dist/client/assets/SourceControlSettings-KIx9EfEZ.js +0 -1
  198. package/dist/client/assets/ThreadStatusIndicators-CL0KGLlj.js +0 -0
  199. package/dist/client/assets/appearancePreferences-COvj0WMT.js +0 -1
  200. package/dist/client/assets/authorization-mIJKV2yp.js +0 -1
  201. package/dist/client/assets/composerDraftStore-CdJJZe42.js +0 -11
  202. package/dist/client/assets/editorPreferences-0DWMgcci.js +0 -1
  203. package/dist/client/assets/main-BjVnVob0.js +0 -9
  204. package/dist/client/assets/main-DaYHZt-J.css +0 -2
  205. package/dist/client/assets/panel-right-BodNpkM9.js +0 -1
  206. package/dist/client/assets/primary-OskAInOO.js +0 -2
  207. package/dist/client/assets/projectPaths-SSsIvt0g.js +0 -1
  208. package/dist/client/assets/providerInstances-BJcfB_9E.js +0 -1
  209. package/dist/client/assets/providerModels-BJcfB_9E.js +0 -1
  210. package/dist/client/assets/runtime-DfGHeCnR.js +0 -1
  211. package/dist/client/assets/sidebarProjectFolders-CGVDJ0ZT.js +0 -4
  212. package/dist/client/assets/storeSelectors-Bpr2pdhU.js +0 -1
  213. package/dist/client/assets/types-Bpr2pdhU.js +0 -1
  214. package/dist/client/assets/useAppearancePreference-BlLlxQl7.js +0 -1
  215. package/dist/client/assets/useAtlassian-DC0XOw4u.js +0 -0
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i}from"./env-B4arEvJg.js";import{Kc as a,V as o,at as s,et as c,t as l}from"./src-Vf4LVnMX.js";import{D as u,Ft as d,Jt as f,L as ee,Lt as te,Mn as ne,Nn as re,Rn as ie,Sn as ae,Un as oe,Vn as se,b as ce,bn as le,hn as ue,jt as p,kt as de,pt as fe,sn as pe,yn as me}from"./runtime-DfGHeCnR.js";import{a as he,r as ge}from"./primary-OskAInOO.js";import{t as _e}from"./useDebouncedValue-DHjoudTq.js";import{It as ve}from"./composerDraftStore-CdJJZe42.js";import{c as ye}from"./useSwipeDismiss-CbgDJvw1.js";import{t as be}from"./useHandleNewThread-Bvz-DKgn.js";import{t as xe}from"./useNavigate-2tVq4iZ2.js";import{L as Se,h as Ce,m as we,n as Te,t as Ee}from"./ThreadStatusIndicators-CL0KGLlj.js";import{t as De}from"./presentationTier-xlIjcFab.js";import{t as Oe}from"./settingsDialogStore-ygYoScKe.js";import{i as ke}from"./uiStateStore-B6pjzSjj.js";import{c as Ae,o as je}from"./BranchToolbar.logic-CmvD76Cw.js";import{f as Me}from"./useRenderElement-DchFnsR8.js";import{n as Ne,t as Pe}from"./arrow-up-CTcWIlqV.js";import{t as Fe}from"./arrow-left-Dtj9PfsA.js";import{t as Ie}from"./chart-column-Dw6ACmXM.js";import{t as Le}from"./chevron-right-BWYGybX9.js";import{n as m,t as h}from"./kbd-DCGQZk18.js";import{t as Re}from"./circle-alert-BWvs6IOn.js";import{i as g}from"./toast-CcSCAm4B.js";import{i as _,n as ze,r as Be,t as Ve}from"./square-pen-Bj3p_Q8E.js";import{t as He}from"./folder-DtsQoI9_.js";import{i as v,n as Ue,r as We}from"./chatThreadActions-DQ8aOQ1g.js";import{t as Ge}from"./shallow-DWZCFNun.js";import{i as Ke,n as qe,r as y,s as Je,t as b}from"./utils-BofFIn5Y.js";import{a as Ye,c as Xe,d as Ze,f as Qe,h as $e,i as et,l as tt,m as nt,n as rt,o as it,r as at,s as ot,t as st,u as ct}from"./projectPaths-SSsIvt0g.js";import{i as x}from"./timestampFormat-8uPXS812.js";import{_ as lt}from"./keybindings-CWJ7E9ZI.js";import{i as ut,n as dt,t as ft}from"./tooltip-C8sAONBj.js";import{c as S,d as C,f as pt,i as mt,l as ht,m as w,n as gt,o as _t,s as T,t as vt,u as E}from"./command-CGNKG_Oe.js";import{a as yt,c as D,f as O,i as k,u as bt}from"./Icons-CT3nd2MA.js";import{t as xt}from"./ProjectFavicon-BhQnkxbx.js";import{t as St}from"./button-BAbJxRzt.js";import{t as A}from"./toastHelpers-CSQRKo4F.js";import{n as Ct}from"./composerHandleContext-BrQ6d8r9.js";import{t as wt}from"./capabilities-BkVqeGLQ.js";var Tt=Me(`corner-left-up`,[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),Et=Me(`folder-symlink`,[[`path`,{d:`M2 9.35V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7`,key:`y8kt7d`}],[`path`,{d:`m8 16 3-3-3-3`,key:`rlqrt1`}]]),j=e(t(),1),M=n(),N=`size-4 text-muted-foreground/80`,P=`size-4`;function Dt(e){return e.isAlias?`browse:alias:${e.name}:${e.fullPath}`:`browse:${e.fullPath}`}function Ot(e){let t=e.browseFilterQuery.toLowerCase(),n=e.browseFilterQuery.startsWith(`.`),r=e.browseEntries.filter(e=>e.name.toLowerCase().startsWith(t)&&(n||!e.name.startsWith(`.`))),i=null,a=e.highlightedItemValue;a&&a.startsWith(`browse:`)&&(i=r.find(e=>Dt(e)===a)??null);let o=e.browseFilterQuery.length>0?r.find(t=>t.name===e.browseFilterQuery)??null:null;return{filteredEntries:r,highlightedEntry:i,exactEntry:o}}function F(e){return e.trim().toLowerCase().replace(/\s+/g,` `)}function kt(e){return e.projects.map(t=>({kind:`action`,value:`${e.valuePrefix}:${t.environmentId}:${t.id}`,searchTerms:[t.name,t.cwd],title:t.name,description:t.cwd,icon:e.icon(t),run:async()=>{await e.runProject(t)}}))}function At(e){let t=p(e.threads.filter(e=>e.archivedAt===null),e.sortOrder);return(e.limit===void 0?t:t.slice(0,e.limit)).map(t=>{let n=e.projectTitleById.get(t.projectId),r=[];n&&r.push(n),t.branch&&r.push(`#${t.branch}`),t.id===e.activeThreadId&&r.push(`Current thread`);let i=e.renderLeadingContent?.(t),a=e.renderTrailingContent?.(t);return Object.assign({kind:`action`,value:`thread:${t.id}`,searchTerms:[t.title,n??``,t.branch??``],title:t.title,description:r.join(` · `),timestamp:x(t.latestUserMessageAt??t.updatedAt??t.createdAt),icon:e.icon},i?{titleLeadingContent:i}:{},a?{titleTrailingContent:a}:{},{run:async()=>{await e.runThread(t)}})})}function jt(e,t){let n=F(e);return n.length===0||!n.includes(t)?-1/0:n===t?3:n.startsWith(t)?2:1}function Mt(e,t){let n=e.searchTerms.filter(e=>e.length>0);if(n.length===0)return 0;for(let[e,r]of n.entries()){let n=jt(r,t);if(n!==-1/0)return 1e3-e*100+n}return 0}function Nt(e){return e.searchResults.map(t=>{let n=e.threadTitleById.get(t.threadId)??`Thread`,r=e.projectTitleByThreadId.get(t.threadId),i=[n,r].filter(Boolean).join(` · `);return{kind:`action`,value:`message:${t.environmentId}:${t.threadId}:${t.messageId}`,searchTerms:[t.snippet,n,r??``],title:t.snippet,description:i,timestamp:x(t.timestamp),icon:e.icon,run:async()=>{await e.runMessage(t)}}})}function Pt(e){let t=e.query.startsWith(`>`),n=F(t?e.query.slice(1):e.query);if(n.length===0)return t?e.activeGroups.filter(e=>e.value===`actions`):[...e.activeGroups];let r=[...e.activeGroups];t?r=r.filter(e=>e.value===`actions`):e.isInSubmenu||(r=r.filter(e=>e.value!==`recent-threads`));let i=[...r];return!e.isInSubmenu&&!t&&(e.projectSearchItems.length>0&&i.push({value:`projects-search`,label:`Projects`,items:e.projectSearchItems}),e.threadSearchItems.length>0&&i.push({value:`threads-search`,label:`Threads`,items:e.threadSearchItems}),e.messageSearchItems&&e.messageSearchItems.length>0&&i.push({value:`messages-search`,label:`Messages`,items:e.messageSearchItems})),i.flatMap(e=>{let t=e.items.map((e,t)=>F(e.searchTerms.join(` `)).includes(n)?{item:e,index:t,rank:Mt(e,n)}:null).filter(e=>e!==null).toSorted((e,t)=>t.rank-e.rank||e.index-t.index).map(e=>e.item);return t.length===0?[]:[{value:e.value,label:e.label,items:t}]})}function Ft(e){let t=[];e.canBrowseUp&&t.push({kind:`action`,value:`browse:up`,searchTerms:[e.browseQuery,`..`],title:`..`,icon:e.upIcon,keepOpen:!0,run:async()=>{e.browseUp()}});for(let n of e.browseEntries)t.push({kind:`action`,value:Dt(n),searchTerms:[e.browseQuery,n.fullPath,n.name],title:n.name,icon:n.isSymlink?e.symlinkIcon:e.directoryIcon,keepOpen:!0,run:async()=>{n.isAlias?e.browseToPath(n.fullPath):e.browseTo(n.name)}});return[{value:`directories`,label:`Directories`,items:t}]}function It(e){return e.currentView?e.isBrowsing?`submenu-browse`:`submenu`:e.isBrowsing?`root-browse`:`root`}function Lt(e){let t=[];return e.actionItems.length>0&&t.push({value:`actions`,label:`Actions`,items:e.actionItems}),e.recentThreadItems.length>0&&t.push({value:`recent-threads`,label:`Recent Threads`,items:e.recentThreadItems}),t}function Rt(e){switch(e){case`root`:return`Search commands, projects, and threads...`;case`root-browse`:return`Enter project path (e.g. ~/projects/my-app)`;case`submenu`:return`Search...`;case`submenu-browse`:return`Enter path (e.g. ~/projects/my-app)`}}var I=ve();function zt(e){let t=(0,M.c)(13);if(e.groups.length===0){let n=e.emptyStateMessage??(e.isActionsOnly?`No matching actions.`:`No matching commands, projects, or threads.`),r;return t[0]===n?r=t[1]:(r=(0,I.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:n}),t[0]=n,t[1]=r),r}let n;if(t[2]!==e.groups||t[3]!==e.highlightedItemValue||t[4]!==e.keybindings||t[5]!==e.onExecuteItem){let r;t[7]!==e.highlightedItemValue||t[8]!==e.keybindings||t[9]!==e.onExecuteItem?(r=t=>(0,I.jsxs)(T,{items:t.items,children:[(0,I.jsx)(S,{children:t.label}),(0,I.jsx)(gt,{children:t=>t.disabled?(0,I.jsx)(Bt,{item:t},t.value):(0,I.jsx)(Vt,{item:t,keybindings:e.keybindings,isActive:e.highlightedItemValue===t.value,onExecuteItem:e.onExecuteItem},t.value)})]},t.value),t[7]=e.highlightedItemValue,t[8]=e.keybindings,t[9]=e.onExecuteItem,t[10]=r):r=t[10],n=e.groups.map(r),t[2]=e.groups,t[3]=e.highlightedItemValue,t[4]=e.keybindings,t[5]=e.onExecuteItem,t[6]=n}else n=t[6];let r;return t[11]===n?r=t[12]:(r=(0,I.jsx)(C,{children:n}),t[11]=n,t[12]=r),r}function Bt(e){let t=(0,M.c)(8),n;t[0]!==e.item.description||t[1]!==e.item.title||t[2]!==e.item.titleLeadingContent?(n=e.item.description?(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,I.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),(0,I.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:e.item.description})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,I.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),t[0]=e.item.description,t[1]=e.item.title,t[2]=e.item.titleLeadingContent,t[3]=n):n=t[3];let r;return t[4]!==e.item.icon||t[5]!==e.item.titleTrailingContent||t[6]!==n?(r=(0,I.jsxs)(`div`,{className:`flex min-h-8 select-none items-center gap-2 rounded-sm px-2 py-1.5 text-base opacity-64 sm:min-h-7 sm:text-sm`,children:[e.item.icon,n,e.item.titleTrailingContent]}),t[4]=e.item.icon,t[5]=e.item.titleTrailingContent,t[6]=n,t[7]=r):r=t[7],r}function Vt(e){let t=(0,M.c)(27),n;t[0]!==e.item.shortcutCommand||t[1]!==e.keybindings?(n=e.item.shortcutCommand?lt(e.keybindings,e.item.shortcutCommand):null,t[0]=e.item.shortcutCommand,t[1]=e.keybindings,t[2]=n):n=t[2];let r=n,i=e.item.value,a=e.isActive&&`bg-accent! text-accent-foreground!`,o;t[3]===a?o=t[4]:(o=b(`cursor-pointer gap-2 hover:bg-transparent hover:text-inherit data-highlighted:bg-transparent data-highlighted:text-inherit data-selected:bg-transparent data-selected:text-inherit [&[data-highlighted][data-selected]]:bg-transparent [&[data-highlighted][data-selected]]:text-inherit`,a),t[3]=a,t[4]=o);let s;t[5]===e?s=t[6]:(s=()=>{e.onExecuteItem(e.item)},t[5]=e,t[6]=s);let c;t[7]!==e.item.description||t[8]!==e.item.title||t[9]!==e.item.titleLeadingContent?(c=e.item.description?(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,I.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),(0,I.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:e.item.description})]}):(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,I.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),t[7]=e.item.description,t[8]=e.item.title,t[9]=e.item.titleLeadingContent,t[10]=c):c=t[10];let l;t[11]===e.item.timestamp?l=t[12]:(l=e.item.timestamp?(0,I.jsx)(`span`,{className:`min-w-12 shrink-0 text-right text-[10px] tabular-nums text-muted-foreground/70`,children:e.item.timestamp}):null,t[11]=e.item.timestamp,t[12]=l);let u;t[13]===r?u=t[14]:(u=r?(0,I.jsx)(w,{children:r}):null,t[13]=r,t[14]=u);let d;t[15]===e.item.kind?d=t[16]:(d=e.item.kind===`submenu`?(0,I.jsx)(Le,{className:`ml-auto size-4 shrink-0 text-muted-foreground/50`}):null,t[15]=e.item.kind,t[16]=d);let f;return t[17]!==e.item.icon||t[18]!==e.item.titleTrailingContent||t[19]!==e.item.value||t[20]!==o||t[21]!==s||t[22]!==c||t[23]!==l||t[24]!==u||t[25]!==d?(f=(0,I.jsxs)(E,{value:i,className:o,onMouseDown:Ht,onClick:s,children:[e.item.icon,c,e.item.titleTrailingContent,l,u,d]}),t[17]=e.item.icon,t[18]=e.item.titleTrailingContent,t[19]=e.item.value,t[20]=o,t[21]=s,t[22]=c,t[23]=l,t[24]=u,t[25]=d,t[26]=f):f=t[26],f}function Ht(e){e.preventDefault()}var Ut=[],Wt=3e4,Gt=2,Kt=20;function qt(e){return qe(e)?`Finder`:y(e)?`Explorer`:`Files`}function Jt(e){return e===`windows`?`Win32`:e===`darwin`?`MacIntel`:e===`linux`?`Linux`:typeof navigator>`u`?``:navigator.platform}var Yt=[`url`,`github`,`gitlab`,`forgejo`,`bitbucket`,`azure-devops`],Xt=[`github`,`gitlab`,`forgejo`,`bitbucket`,`azure-devops`];function Zt(e){switch(e){case`github`:return`GitHub`;case`gitlab`:return`GitLab`;case`forgejo`:return`Forgejo`;case`bitbucket`:return`Bitbucket`;case`azure-devops`:return`Azure DevOps`;case`url`:return`Git URL`}}function Qt(e){switch(e){case`github`:return`owner/repo`;case`gitlab`:return`group/project`;case`forgejo`:return`owner/repo`;case`bitbucket`:return`workspace/repository`;case`azure-devops`:return`project/repository`;case`url`:return`URL`}}function $t(e){return e===`url`?null:e}function L(e,t){switch(e){case`github`:return(0,I.jsx)(bt,{className:t});case`gitlab`:return(0,I.jsx)(O,{className:t});case`forgejo`:return(0,I.jsx)(D,{className:t});case`bitbucket`:return(0,I.jsx)(yt,{className:t});case`azure-devops`:return(0,I.jsx)(k,{className:t});case`url`:return(0,I.jsx)(v,{className:t})}}function en(e){return!e||e.step===`confirm`?null:e.source===`url`?`Enter Git clone URL`:`Enter ${Zt(e.source)} repository (${Qt(e.source)})`}function tn(e){return e.split(`/`).at(-1)?.trim()??e}function nn(e){return`remote-repository:${e.provider}:${encodeURIComponent(e.nameWithOwner)}`}function rn(e,t){return e===`bitbucket`?t.url:t.sshUrl}function an(e){return!e.includes(`/`)&&!e.includes(`:`)}function R(e){return e===`url`?null:e}function on(e){return Xt.toSorted((t,n)=>{let r=e[t].ready;return r===e[n].ready?Zt(t).localeCompare(Zt(n)):r?-1:1})}function sn(e){let t={ready:!1,hint:`Provider status unavailable. Open Settings -> Source Control and rescan.`},n={url:{ready:!0,hint:null},github:t,gitlab:t,forgejo:t,bitbucket:t,"azure-devops":t};if(!e)return n;let r=new Map(e.sourceControlProviders.map(e=>[e.kind,e])),i={...n};for(let e of Yt){let n=R(e);if(!n)continue;let o=r.get(n);if(!o){i[e]=t;continue}if(o.status!==`available`){i[e]={ready:!1,hint:o.installHint};continue}if(o.auth.status===`unauthenticated`){i[e]={ready:!1,hint:a(o.auth.detail)??`${o.label} is not authenticated. Open Settings -> Source Control for setup guidance.`};continue}i[e]={ready:!0,hint:null}}return i}function cn(e){return e instanceof Error&&e.message.trim().length>0?e.message:`An error occurred.`}function z(){let e=(0,M.c)(5),t=fe(un),n=fe(ln),r,i;e[0]===n?(r=e[1],i=e[2]):(r=()=>()=>{n(!1)},i=[n],e[0]=n,e[1]=r,e[2]=i),(0,j.useEffect)(r,i);let a;return e[3]===t?a=e[4]:(a=t?(0,I.jsx)(dn,{}):null,e[3]=t,e[4]=a),a}function ln(e){return e.setOpen}function un(e){return e.open}function dn(){let e=wt(o.dispatchCommand),t=wt(l.projectsAdd),n=wt(l.serverGetStatistics),a=xe(),p=fe(e=>e.setOpen),ve=fe(e=>e.openIntent),Me=fe(e=>e.clearOpenIntent),Le=Ct(),[v,y]=(0,j.useState)(``),x=(0,j.useDeferredValue)(v),lt=x.startsWith(`>`),[S,C]=(0,j.useState)(null),w=ie(),gt=se(),{activeDraftThread:T,activeThread:E,defaultProjectRef:yt,handleNewThread:D}=be(),O=f(Ge(d)),k=f(Ge(te)),bt=oe(),[M,Dt]=(0,j.useState)([]),F=M.at(-1)??null,jt=F===null,[Mt,Bt]=(0,j.useState)(0),[Vt,Ht]=(0,j.useState)(null),[Yt,Xt]=(0,j.useState)(!1),[R,z]=(0,j.useState)(null),[ln,un]=(0,j.useState)(!1),[dn,fn]=(0,j.useState)(!1),[pn,mn]=(0,j.useState)([]),B=he(),hn=ge()?.label??null,gn=me(e=>e.byId),V=le(e=>e.byId),_n=(0,j.useMemo)(()=>{let e=[],t=new Set;B&&(t.add(B),e.push({environmentId:B,label:je({isPrimary:!0,environmentId:B,runtimeLabel:hn}),isPrimary:!0}));for(let n of Object.values(gn)){if(t.has(n.environmentId))continue;let r=V[n.environmentId];e.push({environmentId:n.environmentId,label:je({isPrimary:!1,environmentId:n.environmentId,runtimeLabel:r?.descriptor?.label??null,savedLabel:n.label}),isPrimary:!1})}return e.sort((e,t)=>e.isPrimary===t.isPrimary?e.label.localeCompare(t.label):e.isPrimary?-1:1),e},[B,hn,gn,V]),vn=_n[0]?.environmentId??null,H=Vt??vn,yn=(0,j.useMemo)(()=>Jt(H&&B&&H===B?ge()?.platform.os??null:H?V[H]?.descriptor?.platform.os??V[H]?.serverConfig?.environment.platform.os??null:null),[H,B,V]),bn=R!==null,xn=R?.step===`repository`,U=xn&&R?$t(R.source):null,Sn=xn?x.trim():``,W=Se({environmentId:R?.step===`repository`?R.environmentId:null,provider:U,query:Sn,limit:25,enabled:R?.step===`repository`&&R.source!==`url`&&U===`bitbucket`}),G=!xn&&ct(v,yn),Cn=It({currentView:F,isBrowsing:G}),wn=jt&&!lt&&!G&&!bn,Tn=wn?x.trim():``,[En]=_e(Tn,{wait:200}),Dn=(0,j.useMemo)(()=>{let e=new Set,t=[];for(let n of k)e.has(n.environmentId)||(e.add(n.environmentId),t.push(n.environmentId));for(let n of O)e.has(n.environmentId)||(e.add(n.environmentId),t.push(n.environmentId));return t},[O,k]);(0,j.useEffect)(()=>{let e=En.trim();if(!wn||e.length<Gt||Dn.length===0){mn([]);return}let t=!1,n=Dn.map(async t=>{let n=ue(t);if(!n)return[];try{return(await n.orchestration.searchThreadMessages({query:e,limit:Kt})).map(e=>Object.assign({environmentId:t},e))}catch{return[]}});return Promise.all(n).then(e=>{t||mn(e.flat().toSorted((e,t)=>t.timestamp.localeCompare(e.timestamp)).slice(0,Kt))}),()=>{t=!0}},[wn,En,Dn]);let On=(0,j.useCallback)(e=>{let t=e&&B&&e===B?gt:e?V[e]?.serverConfig:null,n=e&&B&&e===B?w:e?V[e]?.serverConfig?.settings:null;return nt({workspaceAccessRoot:t?.workspaceAccessRoot,configuredBaseDirectory:n?.addProjectBaseDirectory})},[B,gt,V,w]),kn=(0,j.useMemo)(()=>new Map(O.map(e=>[e.id,e.cwd])),[O]),An=(0,j.useMemo)(()=>new Map(O.map(e=>[e.id,e.name])),[O]),jn=(0,j.useMemo)(()=>new Map(k.map(e=>[e.id,e.title])),[k]),Mn=(0,j.useMemo)(()=>new Map(k.map(e=>[e.id,An.get(e.projectId)??``])),[An,k]),Nn=(0,j.useCallback)(async e=>{await a({to:`/$environmentId/$threadId`,params:ye(r(e.environmentId,e.threadId)),search:t=>({...t,messageId:e.messageId})})},[a]),Pn=(0,j.useMemo)(()=>Nt({searchResults:pn,threadTitleById:jn,projectTitleByThreadId:Mn,icon:(0,I.jsx)(Ce,{className:N}),runMessage:Nn}),[pn,Nn,Mn,jn]),Fn=E?.id,In=E?.environmentId??T?.environmentId??null,Ln=E?.projectId??T?.projectId??null,Rn=Ln?kn.get(Ln)??null:null,K=H&&In===H?Rn:null,q=u(v.trim())&&K===null,zn=G?Ye(v):``,Bn=G&&!Xe(v)?it(v):``,Vn=Ae({environmentId:H,partialPath:zn,cwd:K,staleTime:Wt,enabled:G&&zn.length>0&&H!==null&&!q}),J=Vn.data,Hn=Vn.isPending,Un=J?.entries??Ut,Wn=J?.workspaceAccessRoot!==void 0&&Ze(J.parentPath,J.workspaceAccessRoot),Gn=G&&!q&&!Wn&&rt(zn),{filteredEntries:Kn,exactEntry:qn}=(0,j.useMemo)(()=>Ot({browseEntries:Un,browseFilterQuery:Bn,highlightedItemValue:S}),[Un,Bn,S]),Jn=(0,j.useCallback)(e=>{pe({environmentId:H,partialPath:e,cwd:K,staleTime:Wt})},[H,K]);(0,j.useEffect)(()=>{G&&Gn&&Jn(ot(v))},[Gn,G,Jn,v]);let Yn=(0,j.useMemo)(()=>async e=>{ke.getState().setProjectExpanded(ce(e,w),!0);let t=de(k.filter(t=>t.environmentId===e.environmentId),e.id,w.sidebarThreadSortOrder);if(t){await a({to:`/$environmentId/$threadId`,params:ye(r(t.environmentId,t.id))});return}await D(i(e.environmentId,e.id),{envMode:w.defaultThreadEnvMode})},[D,a,w,k]),Xn=(0,j.useMemo)(()=>kt({projects:O,valuePrefix:`project`,icon:e=>(0,I.jsx)(xt,{environmentId:e.environmentId,cwd:e.cwd,projectId:e.id,customAvatarContentHash:e.customAvatarContentHash??null,className:N}),runProject:Yn}),[Yn,O]),Zn=(0,j.useMemo)(()=>kt({projects:O,valuePrefix:`new-thread-in`,icon:e=>(0,I.jsx)(xt,{environmentId:e.environmentId,cwd:e.cwd,projectId:e.id,customAvatarContentHash:e.customAvatarContentHash??null,className:N}),runProject:async e=>{await We({activeDraftThread:T,activeThread:E,defaultProjectRef:yt,defaultThreadEnvMode:w.defaultThreadEnvMode,handleNewThread:D},i(e.environmentId,e.id))}}),[T,E,yt,D,O,w.defaultThreadEnvMode]),Qn=(0,j.useMemo)(()=>At({threads:k,...Fn?{activeThreadId:Fn}:{},projectTitleById:An,sortOrder:w.sidebarThreadSortOrder,icon:(0,I.jsx)(Ce,{className:N}),renderLeadingContent:e=>(0,I.jsx)(Ee,{thread:e}),renderTrailingContent:e=>(0,I.jsx)(Te,{thread:e}),runThread:async e=>{await a({to:`/$environmentId/$threadId`,params:ye(r(e.environmentId,e.id))})}}),[Fn,a,An,w.sidebarThreadSortOrder,k]),$n=Qn.slice(0,12);function er(e){Dt(t=>[...t,{addonIcon:e.addonIcon,groups:e.groups,...e.initialQuery?{initialQuery:e.initialQuery}:{}}]),C(null),y(e.initialQuery??``)}function tr(e){er({addonIcon:e.addonIcon,groups:e.groups,...e.initialQuery?{initialQuery:e.initialQuery}:{}})}function nr(){z(null),M.length<=1&&Ht(null),Dt(e=>e.slice(0,-1)),C(null),y(``)}function rr(e){C(null),y(e),e===``&&F?.initialQuery&&nr()}let ir=(0,j.useCallback)(e=>{Ht(e),z(null),er({addonIcon:(0,I.jsx)(_,{className:P}),groups:[],initialQuery:On(e)})},[On]),ar=(0,j.useCallback)((e,t)=>{Ht(e),z({step:`repository`,environmentId:e,source:t}),er({addonIcon:L(t,P),groups:[],initialQuery:``})},[]),or=Oe(e=>e.openSettings),sr=(0,j.useCallback)(()=>{p(!1),or(`source-control`)},[or,p]),cr=(0,j.useCallback)((e,t)=>{let n=[{kind:`action`,value:`action:add-project:${e}:local`,searchTerms:[`local`,`folder`,`directory`,`browse`],title:`Local folder`,description:`Browse a folder on disk`,icon:(0,I.jsx)(_,{className:N}),keepOpen:!0,run:async()=>{ir(e)}}],r=[`url`,...on(t)];for(let i of r){let r=Zt(i),a=i===`url`?`Git URL`:`${r} repository`,o=i===`url`?`Clone from a remote URL`:`Clone ${r} ${Qt(i)}`,s=t[i],c=s.hint,l=s.ready?void 0:(0,I.jsx)(`span`,{className:`ml-auto`,children:(0,I.jsxs)(ft,{children:[(0,I.jsx)(ut,{render:(0,I.jsx)(St,{variant:`outline`,size:`xs`,className:`h-5 rounded-sm px-1.5 text-[10px] text-warning-foreground`,onClick:()=>{sr()},children:`Setup Required`})}),(0,I.jsx)(dt,{align:`end`,side:`left`,children:c??`Open Settings -> Source Control to configure this provider.`})]})});if(!s.ready){n.push({kind:`action`,value:`action:add-project:${e}:${i}:not-ready`,searchTerms:[`clone`,`remote`,`repository`,`repo`,`git`,r,`setup required`],title:a,description:o,disabled:!0,icon:L(i,N),...l?{titleTrailingContent:l}:{},run:async()=>{}});continue}n.push({kind:`action`,value:`action:add-project:${e}:${i}`,searchTerms:[`clone`,`remote`,`repository`,`repo`,`git`,r],title:a,description:o,icon:L(i,N),...l?{titleTrailingContent:l}:{},keepOpen:!0,run:async()=>{ar(e,i)}})}return[{value:`sources:${e}`,label:`Sources`,items:n}]},[sr,ir,ar]),lr=(0,j.useCallback)(e=>{Ht(e),z(null);let t={environmentId:e},n=ne(t).data;er({addonIcon:(0,I.jsx)(_,{className:P}),groups:cr(e,sn(n))}),re(t).then(t=>{Dt(n=>n.at(-1)?.groups[0]?.value===`sources:${e}`?[...n.slice(0,-1),{addonIcon:(0,I.jsx)(_,{className:P}),groups:cr(e,sn(t))}]:n)})},[cr]),ur=_n.map(e=>({kind:`action`,value:`action:add-project:environment:${e.environmentId}`,searchTerms:[e.label,e.environmentId,e.isPrimary?`this device`:``],title:e.label,description:e.isPrimary?`This device`:e.environmentId,icon:(0,I.jsx)(_,{className:N}),keepOpen:!0,run:async()=>{lr(e.environmentId)}})),dr=(0,j.useMemo)(()=>[{value:`environments`,label:`Environments`,items:ur}],[ur]),fr=(0,j.useCallback)(()=>{if(!t.allowed){g.add(A({type:`error`,title:`Unable to add project`,description:t.reason??`This action is unavailable.`}));return}if(_n.length>1){er({addonIcon:(0,I.jsx)(_,{className:P}),groups:dr});return}let e=vn;if(!e){g.add(A({type:`error`,title:`Unable to browse projects`,description:`No environment is available.`}));return}lr(e)},[t.allowed,t.reason,dr,_n.length,vn,lr]);(0,j.useLayoutEffect)(()=>{ve?.kind===`add-project`&&(Me(),fr())},[Me,fr,ve]);let Y=[];if(Y.push({kind:`action`,value:`action:show-inbox-sidebar`,searchTerms:[`sidebar`,`inbox`,`tasks`,`activity`],title:`Show Inbox sidebar`,icon:(0,I.jsx)(ze,{className:N}),shortcutCommand:`sidebar.showInbox`,run:async()=>{ee.getState().clearSelection(),ke.getState().setSidebarMode(`inbox`),p(!1)}},{kind:`action`,value:`action:show-projects-sidebar`,searchTerms:[`sidebar`,`projects`,`tree`,`folders`],title:`Show Projects sidebar`,icon:(0,I.jsx)(Be,{className:N}),shortcutCommand:`sidebar.showProjects`,run:async()=>{ee.getState().clearSelection(),ke.getState().setSidebarMode(`projects`),p(!1)}}),O.length>0){let t=Ln?An.get(Ln)??null:null;t&&Y.push({kind:`action`,value:`action:new-thread`,searchTerms:[`new thread`,`chat`,`create`,`draft`],title:(0,I.jsxs)(I.Fragment,{children:[`New thread in `,(0,I.jsx)(`span`,{className:`font-semibold`,children:t})]}),icon:(0,I.jsx)(Ve,{className:N}),shortcutCommand:`chat.new`,...e.reason?{description:e.reason}:{},disabled:!e.allowed,run:async()=>{await Ue({activeDraftThread:T,activeThread:E,defaultProjectRef:yt,defaultThreadEnvMode:w.defaultThreadEnvMode,handleNewThread:D})}}),Y.push({kind:`submenu`,value:`action:new-thread-in`,searchTerms:[`new thread`,`project`,`pick`,`choose`,`select`],title:`New thread in...`,icon:(0,I.jsx)(Ve,{className:N}),addonIcon:(0,I.jsx)(Ve,{className:P}),groups:[{value:`projects`,label:`Projects`,items:Zn}],...e.reason?{description:e.reason}:{},disabled:!e.allowed})}Y.push({kind:`action`,value:`action:add-project`,searchTerms:[`add project`,`folder`,`directory`,`browse`,`clone`,`remote`,`repository`,`repo`,`git`,`github`,`gitlab`,`forgejo`,`codeberg`,`bitbucket`,`azure`,`devops`,`url`,`environment`],title:`Add project`,...t.reason?{description:t.reason}:{},disabled:!t.allowed,icon:(0,I.jsx)(_,{className:N}),keepOpen:!0,run:async()=>{fr()}}),De()!==`phone`&&Y.push({kind:`action`,value:`action:statistics`,searchTerms:[`statistics`,`usage`,`activity`,`tokens`,`cost`,`history`],title:`Open statistics`,...n.reason?{description:n.reason}:{},disabled:!n.allowed,icon:(0,I.jsx)(Ie,{className:N}),run:async()=>{p(!1),await a({to:`/statistics`})}}),Y.push({kind:`action`,value:`action:settings`,searchTerms:[`settings`,`preferences`,`configuration`,`keybindings`],title:`Open settings`,icon:(0,I.jsx)(we,{className:N}),run:async()=>{p(!1),or()}});let pr=Lt({actionItems:Y,recentThreadItems:$n}),mr=Pt({activeGroups:F?F.groups:pr,query:x,isInSubmenu:F!==null,projectSearchItems:Xn,threadSearchItems:Qn,messageSearchItems:Pn}),hr=(0,j.useCallback)(async(e,t)=>{let n=t?.environmentId??H;if(!n){g.add(A({type:`error`,title:`Failed to add project`,description:`Choose an environment and try again.`}));return}let o=t?.api??ue(n);if(!o){g.add(A({type:`error`,title:`Failed to add project`,description:`The environment is still reconnecting. Try again shortly.`}));return}if(Qe(e.trim(),yn)){g.add(A({type:`error`,title:`Failed to add project`,description:`Windows-style paths are only supported on Windows.`}));return}if(u(e.trim())&&!K){g.add(A({type:`error`,title:`Failed to add project`,description:`Relative paths require an active project.`}));return}let l=$e(e,K);if(l.length===0)return;let d=et(O.filter(e=>e.environmentId===n),l);if(d){ke.getState().setProjectExpanded(ce(d,w),!0);let e=de(k.filter(e=>e.environmentId===d.environmentId),d.id,w.sidebarThreadSortOrder);e?await a({to:`/$environmentId/$threadId`,params:ye(r(e.environmentId,e.id))}):await D(i(d.environmentId,d.id),{envMode:w.defaultThreadEnvMode}).catch(()=>void 0),p(!1);return}try{let e=Je();await o.orchestration.dispatchCommand({type:`project.create`,commandId:Ke(),projectId:e,title:tt(l),workspaceRoot:l,projectMetadataDir:`.ryco`,createWorkspaceRootIfMissing:!0,defaultModelSelection:{instanceId:s.make(`codex`),model:c},createdAt:new Date().toISOString()}),await D(i(n,e),{envMode:w.defaultThreadEnvMode}).catch(()=>void 0),p(!1)}catch(e){g.add(A({type:`error`,title:`Failed to add project`,description:e instanceof Error?e.message:`An error occurred.`}))}},[H,yn,K,D,a,O,p,w,k]),gr=(0,j.useCallback)(e=>On(e),[On]),X=(0,j.useCallback)(e=>{let t=gr(e.flow.environmentId);z({step:`confirm`,environmentId:e.flow.environmentId,source:e.flow.source,repositoryInput:e.repositoryInput,repository:e.repository,remoteUrl:e.remoteUrl}),C(null),y(t),Bt(e=>e+1)},[gr]);async function _r(e){if(!R)return;let t=ue(R.environmentId);if(!t){g.add(A({type:`error`,title:`Unable to clone project`,description:`Environment API is not available.`}));return}if(R.step===`repository`){let e=v.trim();if(e.length===0||ln)return;let n=$t(R.source);if(!n){X({flow:R,repositoryInput:e,repository:null,remoteUrl:e});return}let r=W.data?.repositories??[];if(an(e)&&Sn===e&&r.length===1){let e=r[0];X({flow:R,repositoryInput:e.nameWithOwner,repository:e,remoteUrl:rn(R.source,e)});return}un(!0);try{let r=await t.sourceControl.lookupRepository({provider:n,repository:e});X({flow:R,repositoryInput:e,repository:r,remoteUrl:rn(R.source,r)})}catch(e){g.add(A({type:`error`,title:`Repository lookup failed`,description:cn(e)}))}finally{un(!1)}return}let n=(e??v).trim();if(n.length===0||dn)return;if(Qe(n,yn)){g.add(A({type:`error`,title:`Clone failed`,description:`Windows-style paths are only supported on Windows.`}));return}if(u(n)&&!K){g.add(A({type:`error`,title:`Clone failed`,description:`Relative paths require an active project.`}));return}let r=$e(n,K);if(r.length!==0){fn(!0);try{let e=$t(R.source),n=await t.sourceControl.cloneRepository({...e&&R.repository?{provider:e,repository:R.repository.nameWithOwner,remoteUrl:R.remoteUrl,...R.source===`bitbucket`?{protocol:`https`}:{}}:{remoteUrl:R.remoteUrl},destinationPath:r});await hr(n.cwd,{environmentId:R.environmentId,api:t})}catch(e){g.add(A({type:`error`,title:`Clone failed`,description:cn(e)}))}finally{fn(!1)}}}function vr(e){let t=st(v,e);C(null),y(t),Bt(e=>e+1)}function yr(e){let t=at(e);C(null),y(t),Bt(e=>e+1)}function br(){if(!Gn)return;let e=ot(v);e!==null&&(C(null),y(e),Bt(e=>e+1))}let xr=Xe(v)?J?.parentPath??v.trim():qn?.fullPath??v.trim(),Sr=[...Vn.error?[{value:`browse-status`,label:`Filesystem`,items:[{kind:`action`,value:`browse-status:error`,searchTerms:[`filesystem`,`unavailable`,`error`],title:`Unable to browse folders`,description:cn(Vn.error),icon:(0,I.jsx)(Re,{className:N}),disabled:!0,run:async()=>{}}]}]:[],...Ft({browseEntries:Kn,browseQuery:v,canBrowseUp:Gn,upIcon:(0,I.jsx)(Tt,{className:N}),directoryIcon:(0,I.jsx)(He,{className:N}),symlinkIcon:(0,I.jsx)(Et,{className:N}),browseUp:br,browseTo:vr,browseToPath:yr})],Cr=Sr.map(e=>e.value===`directories`?{...e,label:`Select where to clone`}:e),wr=(0,j.useMemo)(()=>R?.step===`confirm`?{title:R.repository?.nameWithOwner??R.repositoryInput,description:R.repository?.url??R.remoteUrl,icon:L(R.source,N)}:null,[R]),Tr=(0,j.useMemo)(()=>{if(R?.step!==`repository`||R.source===`url`||U!==`bitbucket`)return[];let e=W.data?.repositories??[];return e.length>0?[{value:`remote-repositories:${R.environmentId}:${U}`,label:Sn.length>0?`Matching repositories`:`Available repositories`,items:e.map(e=>({kind:`action`,value:nn(e),searchTerms:[e.nameWithOwner,tn(e.nameWithOwner),e.url,e.sshUrl],title:e.nameWithOwner,description:e.url,icon:L(R.source,N),keepOpen:!0,run:async()=>{X({flow:R,repositoryInput:e.nameWithOwner,repository:e,remoteUrl:rn(R.source,e)})}}))}]:W.isFetching?[{value:`remote-repositories:${R.environmentId}:${U}:loading`,label:`Repositories`,items:[{kind:`action`,value:`remote-repositories:loading`,searchTerms:[`loading`,`repository`,`repo`],title:`Loading repositories`,description:`Reading available Bitbucket workspaces`,icon:L(R.source,N),disabled:!0,run:async()=>{}}]}]:W.error===null?[]:[{value:`remote-repositories:${R.environmentId}:${U}:error`,label:`Repositories`,items:[{kind:`action`,value:`remote-repositories:error`,searchTerms:[`error`,`repository`,`repo`],title:`Unable to load repositories`,description:cn(W.error),icon:L(R.source,N),disabled:!0,run:async()=>{}}]}]},[R,X,U,Sn,W.data?.repositories,W.error,W.isFetching]),Er=R?.step===`repository`&&R.source===`bitbucket`?Sn.length===0?`No repositories found. Enter workspace/repository manually.`:`No matching repositories. Enter workspace/repository manually.`:null,Dr=mr;R?.step===`repository`?Dr=Tr:R?.step===`confirm`?Dr=q?[]:Cr:G&&(Dr=q?[]:Sr);let Or=en(R)??Rt(Cn),Z=Cn===`submenu`||Cn===`submenu-browse`,Q=S?.startsWith(`browse:`)??!1,kr=G&&!q,Ar=kr&&!Hn&&v.trim().length>0&&!Q&&(Xe(v)?!J:qn===null),jr=qe(navigator.platform),Mr=jr?`⌘`:`Ctrl`,Nr=R?.step===`confirm`,Pr=Nr?Ar?`Create & Clone`:`Clone`:Ar?`Create & Add`:`Add`,Fr=Q?`${Mr} Enter`:`Enter`,Ir=R?R.source===`url`?`Continue`:`Lookup`:null,Lr=ln||dn,Rr=R?.step===`repository`&&v.trim().length>0&&!Lr,zr=qt(navigator.platform),$=G&&H!==null&&B!==null&&H===B&&typeof window<`u`&&window.desktopBridge!==void 0,Br=(0,j.useMemo)(()=>{if(!$)return;let e=v.trim();if(e.length===0)return;let t=Xe(v)?J?.parentPath??e:zn||e,n=$e(t,K);return n.length>0?n:void 0},[zn,J?.parentPath,$,K,v]);function Vr(e){return jr?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Hr(e){if(R?.step===`repository`&&e.key===`Enter`){e.preventDefault();let t=W.data?.repositories.find(e=>nn(e)===S);if(t){X({flow:R,repositoryInput:t.nameWithOwner,repository:t,remoteUrl:rn(R.source,t)});return}_r();return}if(kr&&e.key===`Enter`&&(!Q||Vr(e))){e.preventDefault(),Nr?_r(xr):hr(xr);return}e.key===`Backspace`&&v===``&&Z&&(e.preventDefault(),nr())}function Ur(e){if(!e.disabled){if(e.kind===`submenu`){tr(e);return}e.keepOpen||p(!1),e.run().catch(e=>{g.add(A({type:`error`,title:`Unable to run command`,description:e instanceof Error?e.message:`An unexpected error occurred.`}))})}}let Wr=(0,j.useCallback)(async()=>{if(!$||Yt)return;let e=ae();if(!e)return;Xt(!0);let t=null;try{t=await e.dialogs.pickFolder(Br?{initialPath:Br}:void 0)}catch{Xt(!1);return}Xt(!1),t&&await hr(t)},[$,Br,hr,Yt]);return(0,I.jsx)(mt,{"aria-label":`Command palette`,className:`project-glass-surface overflow-hidden p-0`,"data-testid":`command-palette`,surface:`glass`,finalFocus:()=>(Le?.current?.focusAtEnd(),!1),onBackdropPointerDown:()=>{p(!1)},children:(0,I.jsxs)(vt,{"aria-label":`Command palette`,autoHighlight:G||bn?!1:`always`,mode:`none`,onItemHighlighted:e=>{C(typeof e==`string`?e:null)},onValueChange:rr,value:v,children:[(0,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(ht,{className:R?.step===`repository`?`pe-32`:G?Ar?`pe-36`:`pe-16`:void 0,placeholder:Or,wrapperClassName:Z?`[&_[data-slot=autocomplete-start-addon]]:pointer-events-auto`:void 0,...Z?{startAddon:(0,I.jsx)(`button`,{type:`button`,className:`flex cursor-pointer items-center`,"aria-label":`Back`,onClick:nr,children:(0,I.jsx)(Fe,{})})}:G&&!Z?{startAddon:(0,I.jsx)(_,{})}:{},onKeyDown:Hr}),R?.step===`repository`?(0,I.jsxs)(St,{variant:`outline`,size:`xs`,tabIndex:-1,className:`absolute inset-e-2.5 top-1/2 gap-1.5 pe-1 ps-2 -translate-y-1/2`,"aria-label":`${Ir??`Continue`} (Enter)`,disabled:!Rr,onMouseDown:e=>{e.preventDefault()},onClick:()=>{_r()},title:`${Ir??`Continue`} (Enter)`,children:[(0,I.jsx)(`span`,{children:Lr?`Working`:Ir}),(0,I.jsx)(m,{className:`pointer-events-none -me-0.5 items-center gap-1 pointer-coarse:hidden`,children:(0,I.jsx)(h,{children:`Enter`})})]}):G?(0,I.jsxs)(St,{variant:`outline`,size:`xs`,tabIndex:-1,className:b(`absolute inset-e-2.5 top-1/2 pe-1 ps-2 -translate-y-1/2`,Q?`gap-1`:`gap-1.5`),"aria-label":`${Pr} (${Fr})`,disabled:q||Nr&&Lr,onMouseDown:e=>{e.preventDefault()},onClick:()=>{q||(Nr?_r(xr):hr(xr))},title:`${Pr} (${Fr})`,children:[(0,I.jsx)(`span`,{children:Nr&&Lr?`Cloning`:Pr}),(0,I.jsx)(m,{className:`pointer-events-none -me-0.5 items-center gap-1 pointer-coarse:hidden`,children:(0,I.jsx)(h,{children:Q?`${Mr} Enter`:`Enter`})})]}):null]}),(0,I.jsxs)(pt,{className:`max-h-[min(28rem,70vh)] bg-transparent`,children:[wr?(0,I.jsxs)(`div`,{className:`p-2 pb-0`,children:[(0,I.jsx)(`div`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:`Repository`}),(0,I.jsxs)(`div`,{className:`flex min-h-8 items-center gap-2 rounded-sm px-2 py-1.5`,children:[wr.icon,(0,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,I.jsx)(`span`,{className:`truncate text-foreground text-sm`,children:wr.title}),(0,I.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:wr.description})]})]})]}):null,(0,I.jsx)(zt,{groups:Dr,highlightedItemValue:S,isActionsOnly:lt,keybindings:bt,onExecuteItem:Ur,...R?.step===`repository`?{emptyStateMessage:R.source===`url`?`Enter a Git clone URL and press Enter to continue.`:Er??`Enter a repository path and press Enter to look it up.`}:R?.step===`confirm`?{emptyStateMessage:`Choose a destination path and press Enter to clone.`}:q?{emptyStateMessage:`Relative paths require an active project.`}:Ar?{emptyStateMessage:`Press Enter to create this folder and add it as a project.`}:{}})]}),(0,I.jsxs)(_t,{className:`gap-3 max-sm:flex-col max-sm:items-start`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-3 pointer-coarse:hidden`,children:[(0,I.jsxs)(m,{className:`items-center gap-1.5`,children:[(0,I.jsx)(h,{children:(0,I.jsx)(Pe,{})}),(0,I.jsx)(h,{children:(0,I.jsx)(Ne,{})}),(0,I.jsx)(`span`,{className:b(`text-muted-foreground/80`),children:`Navigate`})]}),R?.step===`repository`?(0,I.jsxs)(m,{className:`items-center gap-1.5`,children:[(0,I.jsx)(h,{children:`Enter`}),(0,I.jsx)(`span`,{className:b(`text-muted-foreground/80`),children:Ir??`Continue`})]}):!kr||Q?(0,I.jsxs)(m,{className:`items-center gap-1.5`,children:[(0,I.jsx)(h,{children:`Enter`}),(0,I.jsx)(`span`,{className:b(`text-muted-foreground/80`),children:`Select`})]}):null,Z?(0,I.jsxs)(m,{className:`items-center gap-1.5`,children:[(0,I.jsx)(h,{children:`Backspace`}),(0,I.jsx)(`span`,{className:b(`text-muted-foreground/80`),children:`Back`})]}):null,(0,I.jsxs)(m,{className:`items-center gap-1.5`,children:[(0,I.jsx)(h,{children:`Esc`}),(0,I.jsx)(`span`,{className:b(`text-muted-foreground/80`),children:`Close`})]})]}),$?(0,I.jsx)(St,{variant:`ghost`,size:`xs`,className:`h-auto px-2 text-xs text-muted-foreground/80 hover:bg-transparent hover:text-foreground`,disabled:Yt,onClick:()=>{Wr()},children:`Open in ${zr}`}):null]})]},`${M.length}-${Mt}-${G}-${R?.step??`none`}`)})}export{z as CommandPaletteDialog};
@@ -1 +0,0 @@
1
- import{n as e}from"./DialogViewport-D-CrTM-P.js";function t(t){return e(`dialog`,t)}export{t};
@@ -1 +0,0 @@
1
- import{t as e}from"./utils-BofFIn5Y.js";import"./appearancePreferences-COvj0WMT.js";var t={sheet:`app-glass-surface-sheet`,chip:`app-glass-surface-chip`,dock:`app-glass-surface-dock`};function n(n){return e(`app-glass-surface`,t[n])}export{n as t};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-Bntnmu6O.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import"./src-Vf4LVnMX.js";import{F as i,Jt as a,M as o,N as s,P as c,Wt as l}from"./runtime-DfGHeCnR.js";import{It as u}from"./composerDraftStore-CdJJZe42.js";import{a as d,i as f,o as p}from"./useHandleNewThread-Bvz-DKgn.js";import{t as m}from"./useNavigate-2tVq4iZ2.js";import{Gt as h,_ as g,o as _}from"./authorization-mIJKV2yp.js";import{t as v}from"./RootAppShell-3T2sBtpP.js";import{f as y}from"./useRenderElement-DchFnsR8.js";import{t as b}from"./arrow-left-Dtj9PfsA.js";import{n as x,t as S}from"./loader-circle-CrtHFAvM.js";import{t as C}from"./chevron-down-B7C6FKzM.js";import{t as w}from"./chevron-right-BWYGybX9.js";import{n as T,o as E,t as D}from"./toast-CcSCAm4B.js";import{t as O}from"./copy-UQjKGt7t.js";import{t as k}from"./key-round-CacMputS.js";import{_ as A,a as j,c as M,d as N,f as P,g as F,h as I,i as L,l as R,m as z,o as B,p as ee,t as te,u as ne}from"./HostedConnectionControls-BC4kVWTa.js";import{t as re}from"./log-out-tMJm0Gk6.js";import{t as V}from"./palette-BSD_aJZg.js";import{t as ie}from"./refresh-cw-DopCMrtR.js";import{t as ae}from"./server-JApJpgLa.js";import{t as H}from"./shield-check-dQ-4cMKk.js";import{t as oe}from"./triangle-alert-RL_T3KLo.js";import{t as se}from"./user-round-Cpzx8pSw.js";import{t as U}from"./utils-BofFIn5Y.js";import{n as W,t as G}from"./input-CHEwW3oH.js";import{u as ce}from"./Icons-CT3nd2MA.js";import{t as K}from"./button-BAbJxRzt.js";import{t as q}from"./useCopyToClipboard-BTpWxumf.js";import{a as le,i as J,n as ue,o as de,r as fe,s as pe,t as me}from"./sheet-BO78gIKZ.js";import{t as he}from"./skeleton-CvQSeJbw.js";import{t as ge}from"./usePresentationTier-B_SCFvN7.js";import{i as _e,r as ve,t as ye}from"./alert-LqMhbdE9.js";import{a as be,c as xe,i as Se,o as Ce,r as we,s as Te,t as Ee}from"./dialog-DQsYchqu.js";import{t as Y}from"./label-CVFHsLFO.js";import{t as De}from"./RycoLetterMark-Bk0kvGJ_.js";import{a as Oe,i as ke,n as Ae,o as je,r as Me,t as Ne}from"./MobileSheet-CkeG6_SP.js";import{a as Pe,i as Fe,n as Ie,o as Le,r as Re,t as ze}from"./empty-DwzqNgCP.js";import{c as Be,n as Ve,r as He,t as Ue}from"./ExternalIdentityWeb.logic-D64j70NH.js";import{a as We}from"./settingsLayout-D8glO7f1.js";import{n as Ge,r as Ke,t as qe}from"./phoneAnchoredActions-CtpkI3yG.js";import{t as Je}from"./HostedRelayTrustNotice-ffS_O2AX.js";import{n as X,t as Ye}from"./data-list-CYKBxN62.js";var Xe=y(`life-buoy`,[[`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=y(`mail`,[[`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`}]]),Z=e(t(),1),Q=r(),Qe=/^[A-Za-z0-9_-]{43}$/u,$e=/^signup_[A-Za-z0-9_-]{22,43}$/u;function et(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&&$e.test(n)&&r!==null&&Qe.test(r)&&i!==null&&Qe.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&&Qe.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&&Qe.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function tt(e){let t=new URL(e.href),n=et(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function nt(){let e=(0,Q.c)(3),t=s(ot),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(t!==`authenticated`)return;let e=it,n=()=>{document.visibilityState===`hidden`?(d(!0),_.suspendBrowser(`hidden`)):e()},r=rt,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 rt(){d(!0),_.suspendBrowser(`offline`)}function it(){document.visibilityState===`visible`&&navigator.onLine&&_.resumeBrowser().then(at)}function at(){return d(!1)}function ot(e){return e.accountStatus}var $=u(),st=100;function ct(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>st?`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,x;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(be,{children:[(0,$.jsx)(xe,{children:`Rename node`}),(0,$.jsx)(we,{children:`This is the canonical name shown to everyone authorized to use this node.`})]}),t[11]=x):x=t[11];let S;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`label`,{htmlFor:`hosted-node-name`,className:`text-sm font-medium`,children:`Node name`}),t[12]=S):S=t[12];let C=g!==null||u!==null,w;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{s(e.currentTarget.value),d(null)},t[13]=w):w=t[13];let T;t[14]!==_||t[15]!==y?(T=e=>{e.key===`Enter`&&_&&y()},t[14]=_,t[15]=y,t[16]=T):T=t[16];let E;t[17]!==o||t[18]!==c||t[19]!==T||t[20]!==C?(E=(0,$.jsx)(G,{id:`hosted-node-name`,value:o,autoFocus:!0,disabled:c,"aria-invalid":C,onChange:w,onKeyDown:T}),t[17]=o,t[18]=c,t[19]=T,t[20]=C,t[21]=E):E=t[21];let D;t[22]===g?D=t[23]:(D=g?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:g}):null,t[22]=g,t[23]=D);let O;t[24]===u?O=t[25]:(O=u?(0,$.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:u}):null,t[24]=u,t[25]=O);let k;t[26]!==E||t[27]!==D||t[28]!==O?(k=(0,$.jsxs)(Ce,{className:`space-y-2`,children:[S,E,D,O]}),t[26]=E,t[27]=D,t[28]=O,t[29]=k):k=t[29];let A;t[30]===i?A=t[31]:(A=()=>i(!1),t[30]=i,t[31]=A);let j;t[32]!==c||t[33]!==A?(j=(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:A,children:`Cancel`}),t[32]=c,t[33]=A,t[34]=j):j=t[34];let M=!_,N;t[35]===y?N=t[36]:(N=()=>void y(),t[35]=y,t[36]=N);let P=c?`Saving…`:`Save`,F;t[37]!==M||t[38]!==N||t[39]!==P?(F=(0,$.jsx)(K,{disabled:M,onClick:N,children:P}),t[37]=M,t[38]=N,t[39]=P,t[40]=F):F=t[40];let I;t[41]!==j||t[42]!==F?(I=(0,$.jsxs)(Se,{children:[j,F]}),t[41]=j,t[42]=F,t[43]=I):I=t[43];let L;t[44]!==k||t[45]!==I||t[46]!==b?(L=(0,$.jsxs)(Te,{className:`max-w-md`,showCloseButton:b,children:[x,k,I]}),t[44]=k,t[45]=I,t[46]=b,t[47]=L):L=t[47];let R;return t[48]!==i||t[49]!==r||t[50]!==L?(R=(0,$.jsx)(Ee,{open:r,onOpenChange:i,children:L}),t[48]=i,t[49]=r,t[50]=L,t[51]=R):R=t[51],R}var lt=`owner_revoked`,ut=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.`})]),dt=`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 ft(e){return{title:`Revoke ${e.label}?`,consequences:ut,subjectPrompt:dt,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var pt=`Revoke`;function mt(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function ht(e){return e===null||e.outcome===`unchanged`}var gt=e=>Object.freeze(e),_t=Object.freeze([gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})}),gt({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`})})]),vt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function yt(e){let t=bt(e),n=xt(e);for(let e of _t)if(e.selects(t,n))return e.failure;return vt}function bt(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function xt(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var St=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function Ct(e){return e===null||!Number.isFinite(e)?null:St.format(new Date(e))}function wt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Tt(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Et(e){return Tt(e)}function Dt(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return Ct(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`:Ct(e)??`unknown`}function Ot(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${Dt(e.lastAuthenticatedAt,t)}`:`Last seen ${Dt(e.presence.lastHeartbeatAt,t)}`}function kt(e){let t=`${wt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${Et(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function At(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 jt(e){return e.filter(e=>e.revokedAt===null).length}function Mt(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function Nt(e){let t=jt(e),n=Mt(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 Pt(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function Ft(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 It({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=ft(e),l=ht(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(yt(e)),a(!1)}}};return(0,$.jsx)(Ee,{open:t,onOpenChange:e=>{!e&&i||n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(Te,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(be,{children:[(0,$.jsx)(xe,{children:c.title}),(0,$.jsx)(we,{children:c.subjectPrompt})]}),(0,$.jsxs)(Ce,{className:`space-y-4`,children:[(0,$.jsxs)(Ye,{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:`${wt(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)(oe,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),o.message]}):null]}),(0,$.jsxs)(Se,{children:[(0,$.jsx)(K,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(K,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Lt(e){let t=(0,Q.c)(57),{node:n}=e,r=We(6e4),{copyToClipboard:i,isCopied:a}=q(),o;t[0]===n.createdAt?o=t[1]:(o=Ct(n.createdAt),t[0]=n.createdAt,t[1]=o);let s=o,c;t[2]===n.lastAuthenticatedAt?c=t[3]:(c=Ct(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=c);let l=c,u;t[4]===n.revokedAt?u=t[5]:(u=Ct(n.revokedAt),t[4]=n.revokedAt,t[5]=u);let d=u,f=n.grant.role!==n.effectiveRole,p;t[6]===n?p=t[7]:(p=(0,$.jsx)(X,{term:`Status`,children:(0,$.jsx)(L,{node:n})}),t[6]=n,t[7]=p);let m;t[8]!==n.presence.lastHeartbeatAt||t[9]!==r?(m=n.presence.lastHeartbeatAt===null?`Not reported`:(0,$.jsx)(`span`,{title:Ct(n.presence.lastHeartbeatAt)??void 0,children:Dt(n.presence.lastHeartbeatAt,r)}),t[8]=n.presence.lastHeartbeatAt,t[9]=r,t[10]=m):m=t[10];let h;t[11]===m?h=t[12]:(h=(0,$.jsx)(X,{term:`Last heartbeat`,children:m}),t[11]=m,t[12]=h);let g=l??`Never`,_;t[13]===g?_=t[14]:(_=(0,$.jsx)(X,{term:`Last connected`,children:g}),t[13]=g,t[14]=_);let v;t[15]===n.platformOs?v=t[16]:(v=wt(n.platformOs),t[15]=n.platformOs,t[16]=v);let y=`${v} · ${n.platformArch}`,b;t[17]===y?b=t[18]:(b=(0,$.jsx)(X,{term:`Platform`,children:y}),t[17]=y,t[18]=b);let S;t[19]===n.clientVersion?S=t[20]:(S=(0,$.jsx)(X,{term:`Client version`,mono:!0,children:n.clientVersion}),t[19]=n.clientVersion,t[20]=S);let C;t[21]===n.effectiveRole?C=t[22]:(C=Et(n.effectiveRole),t[21]=n.effectiveRole,t[22]=C);let w;t[23]===C?w=t[24]:(w=(0,$.jsx)(X,{term:`Your role`,children:C}),t[23]=C,t[24]=w);let T;t[25]!==f||t[26]!==n.grant.role?(T=f?(0,$.jsxs)(X,{term:`Granted role`,children:[Et(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]=f,t[26]=n.grant.role,t[27]=T):T=t[27];let E=s??`Not reported`,D;t[28]===E?D=t[29]:(D=(0,$.jsx)(X,{term:`Enrolled`,children:E}),t[28]=E,t[29]=D);let k;t[30]!==n.revocationReasonCode||t[31]!==n.revokedAt||t[32]!==d?(k=n.revokedAt===null?null:(0,$.jsx)(X,{term:`Revoked`,children:`${d??`Not reported`}${n.revocationReasonCode?` — ${n.revocationReasonCode}`:``}`}),t[30]=n.revocationReasonCode,t[31]=n.revokedAt,t[32]=d,t[33]=k):k=t[33];let A=a?`Copied`:`Copy node ID`,j;t[34]!==i||t[35]!==n.id?(j=()=>i(n.id,void 0),t[34]=i,t[35]=n.id,t[36]=j):j=t[36];let M;t[37]===a?M=t[38]:(M=a?(0,$.jsx)(x,{"aria-hidden":!0}):(0,$.jsx)(O,{"aria-hidden":!0}),t[37]=a,t[38]=M);let N;t[39]!==A||t[40]!==j||t[41]!==M?(N=(0,$.jsx)(K,{size:`icon-xs`,variant:`ghost`,"aria-label":A,onClick:j,children:M}),t[39]=A,t[40]=j,t[41]=M,t[42]=N):N=t[42];let P;t[43]!==n.id||t[44]!==N?(P=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:N,children:n.id}),t[43]=n.id,t[44]=N,t[45]=P):P=t[45];let F;return t[46]!==b||t[47]!==S||t[48]!==w||t[49]!==T||t[50]!==D||t[51]!==k||t[52]!==P||t[53]!==p||t[54]!==h||t[55]!==_?(F=(0,$.jsxs)(Ye,{children:[p,h,_,b,S,w,T,D,k,P]}),t[46]=b,t[47]=S,t[48]=w,t[49]=T,t[50]=D,t[51]=k,t[52]=P,t[53]=p,t[54]=h,t[55]=_,t[56]=F):F=t[56],F}function Rt(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=ge()===`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?(_=Pt({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=Ft({directoryStatus:r,browserStatus:i,node:n}),t[4]=i,t[5]=r,t[6]=n,t[7]=y):y=t[7];let b=y,x;t[8]!==n||t[9]!==c||t[10]!==s?(x=()=>{s(!1),c(n)},t[8]=n,t[9]=c,t[10]=s,t[11]=x):x=t[11];let S=x,C=v&&b?b:null;if(d){let e=`Node details: ${n.label}`,r;t[12]===n.label?r=t[13]:(r=(0,$.jsx)(je,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=kt(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(Ae,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(ke,{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)(Lt,{node:n}),t[21]=n,t[22]=c);let l;t[23]===C?l=t[24]:(l=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[23]=C,t[24]=l);let u;t[25]!==l||t[26]!==c?(u=(0,$.jsxs)(Oe,{children:[c,l]}),t[25]=l,t[26]=c,t[27]=u):u=t[27];let d;t[28]!==v||t[29]!==S?(d=(0,$.jsx)(Me,{children:(0,$.jsx)(K,{className:`min-h-11`,disabled:v,onClick:S,children:`Connect`})}),t[28]=v,t[29]=S,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)(Ne,{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 w=o&&n.revokedAt===null,T;t[38]!==s||t[39]!==f||t[40]!==m?(T=e=>{!e&&(m!==null||f!==null)||(e||(p(null),h(null)),s(e))},t[38]=s,t[39]=f,t[40]=m,t[41]=T):T=t[41];let E;t[42]===n.label?E=t[43]:(E=(0,$.jsx)(pe,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=E);let D;t[44]===n?D=t[45]:(D=kt(n),t[44]=n,t[45]=D);let O;t[46]===D?O=t[47]:(O=(0,$.jsx)(ue,{children:D}),t[46]=D,t[47]=O);let k;t[48]!==E||t[49]!==O?(k=(0,$.jsxs)(J,{children:[E,O]}),t[48]=E,t[49]=O,t[50]=k):k=t[50];let A;t[51]===n?A=t[52]:(A=(0,$.jsx)(Lt,{node:n}),t[51]=n,t[52]=A);let j;t[53]===C?j=t[54]:(j=C?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:C}):null,t[53]=C,t[54]=j);let M;t[55]!==j||t[56]!==A?(M=(0,$.jsxs)(le,{children:[A,j]}),t[55]=j,t[56]=A,t[57]=M):M=t[57];let N;t[58]!==n.id||t[59]!==w?(N=w?(0,$.jsx)(K,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>h(n.id),children:pt}):null,t[58]=n.id,t[59]=w,t[60]=N):N=t[60];let P;t[61]!==a||t[62]!==n.id?(P=a?(0,$.jsx)(K,{variant:`outline`,onClick:()=>p(n.id),children:`Rename`}):null,t[61]=a,t[62]=n.id,t[63]=P):P=t[63];let F;t[64]!==v||t[65]!==S?(F=(0,$.jsx)(K,{disabled:v,onClick:S,children:`Connect`}),t[64]=v,t[65]=S,t[66]=F):F=t[66];let I;t[67]!==N||t[68]!==P||t[69]!==F?(I=(0,$.jsxs)(fe,{children:[N,P,F]}),t[67]=N,t[68]=P,t[69]=F,t[70]=I):I=t[70];let L;t[71]!==M||t[72]!==I||t[73]!==k?(L=(0,$.jsxs)(de,{side:`right`,className:`w-full sm:max-w-md`,children:[k,M,I]}),t[71]=M,t[72]=I,t[73]=k,t[74]=L):L=t[74];let R;t[75]!==g||t[76]!==L||t[77]!==T?(R=(0,$.jsx)(me,{open:g,onOpenChange:T,children:L}),t[75]=g,t[76]=L,t[77]=T,t[78]=R):R=t[78];let z;t[79]!==a||t[80]!==n||t[81]!==l||t[82]!==f?(z=a?(0,$.jsx)(ct,{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]=z):z=t[83];let B;t[84]!==n||t[85]!==u||t[86]!==w||t[87]!==m?(B=w?(0,$.jsx)(It,{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]=w,t[87]=m,t[88]=B):B=t[88];let ee;return t[89]!==R||t[90]!==z||t[91]!==B?(ee=(0,$.jsxs)($.Fragment,{children:[R,z,B]}),t[89]=R,t[90]=z,t[91]=B,t[92]=ee):ee=t[92],ee}function zt(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 Bt(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=U(`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 Vt(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=U(`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)(De,{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,Ge]}),t[5]=o,t[6]=c,t[7]=l):l=t[7],l}var Ht=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,Ut=`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))]`,Wt=`flex min-h-full flex-col`,Gt={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function Kt(e){let t=(0,Q.c)(13),{nav:n,trailing:r}=e,i,a,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=U(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),a=U(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,Gt.page),o=(0,$.jsx)(Vt,{}),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 qt(e){let t=(0,Q.c)(16),{children:n,nav:r,trailing:i,scrollRef:a,measure:o}=e,s=o===void 0?`page`:o,c=ge()===`phone`,l;t[0]!==c||t[1]!==r||t[2]!==i?(l=c?null:(0,$.jsx)(Kt,{nav:r,trailing:i}),t[0]=c,t[1]=r,t[2]=i,t[3]=l):l=t[3];let u=c?`min-h-full py-10`:`pt-8 pb-16`,d=Gt[s],f;t[4]!==u||t[5]!==d?(f=U(`mx-auto flex w-full flex-col`,u,Ut,d),t[4]=u,t[5]=d,t[6]=f):f=t[6];let p;t[7]!==n||t[8]!==f?(p=(0,$.jsx)(`section`,{className:f,children:n}),t[7]=n,t[8]=f,t[9]=p):p=t[9];let m;t[10]!==a||t[11]!==p?(m=(0,$.jsx)(`main`,{ref:a,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:p}),t[10]=a,t[11]=p,t[12]=m):m=t[12];let h;return t[13]!==l||t[14]!==m?(h=(0,$.jsx)(T,{children:(0,$.jsx)(D,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[l,m]})})}),t[13]=l,t[14]=m,t[15]=h):h=t[15],h}var Jt=(0,Z.lazy)(()=>n(()=>import(`./AccountSettings-C3v2klAG.js`).then(e=>({default:e.AccountSettingsPanel})),[])),Yt=(0,Z.lazy)(()=>n(()=>import(`./AppearanceSettings-CYbSApl4.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),Xt=[{id:`overview`,label:`Overview`,icon:se},{id:`security`,label:`Security`,icon:H},{id:`appearance`,label:`Appearance`,icon:V}];function Zt(e){let t=(0,Q.c)(15),{section:n}=e,r=s($t),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(K,{variant:`ghost`,onClick:Qt,children:[(0,$.jsx)(b,{"aria-hidden":!0}),` Nodes`]}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=r===null?void 0:`${r.displayName} · ${r.role.charAt(0).toUpperCase()}${r.role.slice(1)}`,t[1]=r,t[2]=a);let o;t[3]===n?o=t[4]:(o=Xt.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(K,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>I({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[3]=n,t[4]=o);let c;t[5]===o?c=t[6]:(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:o})}),t[5]=o,t[6]=c);let l;t[7]===n?l=t[8]:(l=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsx)(en,{}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(Jt,{}):(0,$.jsx)(Yt,{surface:`hub`})})}),t[7]=n,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;return t[12]!==a||t[13]!==u?(d=(0,$.jsx)(qt,{measure:`page`,trailing:i,children:(0,$.jsx)(zt,{title:`Account`,description:a,children:u})}),t[12]=a,t[13]=u,t[14]=d):d=t[14],d}function Qt(){return I({kind:`nodes`})}function $t(e){return e.account}function en(){let e=(0,Q.c)(11),t=s(tn),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 c;e[6]===o?c=e[7]:(c=(0,$.jsxs)(`div`,{children:[a,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:o})]}),e[6]=o,e[7]=c);let l;return e[8]!==i||e[9]!==c?(l=(0,$.jsx)(Bt,{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,c]})}),e[8]=i,e[9]=c,e[10]=l):l=e[10],l}function tn(e){return e.account}function nn(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(rn)}),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 rn(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 an(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=U(Ht,`hub-ambient`),f=U(Wt,Ut,`py-10`),t[0]=d,t[1]=f):(d=t[0],f=t[1]);let p=Gt[u],m;t[2]===p?m=t[3]:(m=U(`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 h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(Vt,{size:`lg`})}),t[4]=h):h=t[4];let g;t[5]!==r||t[6]!==c?(g=(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]=g):g=t[7];let _;t[8]===i?_=t[9]:(_=i===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:i}),t[8]=i,t[9]=_);let v;t[10]===n?v=t[11]:(v=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:n}),t[10]=n,t[11]=v);let y;t[12]!==a||t[13]!==g||t[14]!==_||t[15]!==v||t[16]!==o?(y=(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:[g,_,v,a,o]}),t[12]=a,t[13]=g,t[14]=_,t[15]=v,t[16]=o,t[17]=y):y=t[17];let b;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsx)(nn,{}),t[18]=b):b=t[18];let x;t[19]!==y||t[20]!==m?(x=(0,$.jsx)(`div`,{className:f,children:(0,$.jsxs)(`div`,{className:m,children:[h,y,b]})}),t[19]=y,t[20]=m,t[21]=x):x=t[21];let S;return t[22]!==s||t[23]!==x?(S=(0,$.jsx)(`main`,{ref:s,className:d,children:x}),t[22]=s,t[23]=x,t[24]=S):S=t[24],S}function on({onClose:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(`input`),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=(0,Z.useRef)(``),p=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{p.current?.abort(),p.current=null,f.current=``},[]);let m=()=>{p.current?.abort();let e=new AbortController;return p.current=e,l(!0),d(null),e},h=e=>{p.current===e&&(p.current=null,l(!1))},v=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof g&&e.status===401){f.current=``,n(``),a(null),await _.expireSession();return}d(t??(e instanceof g?e.message:`Hub is temporarily unavailable.`))}},y=async e=>{e.preventDefault();let r=t.trim();n(``),f.current=``;let o=m();try{let e=await i.lookupNodeEnrollment(r,o.signal);if(o.signal.aborted)return;f.current=r,a(e),s(`review`)}catch(e){await v(e)}finally{h(o)}},b=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await i.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`approved`),await _.refreshDirectory()}catch(e){f.current=``,a(null),s(`input`),await v(e,`The approval result is unknown. Enter the device code again to verify its current state.`)}finally{h(t)}},x=async()=>{let e=f.current;if(!e||!r)return;let t=m();try{if(await i.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;f.current=``,a(null),s(`denied`)}catch(e){await v(e)}finally{h(t)}},S=()=>{p.current?.abort(),f.current=``,n(``),a(null),e()};return o===`approved`||o===`denied`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(E,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:o===`approved`?`Node approved`:`Enrollment denied`}),(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-sm text-muted-foreground`,children:o===`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)(K,{className:`mt-5`,onClick:S,children:`Back to nodes`})]}):r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ae,{"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)(Ye,{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,o===`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)(oe,{"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)(K,{variant:`destructive`,disabled:c,onClick:()=>void x(),children:`Confirm denial`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{disabled:c,onClick:()=>void b(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(K,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(K,{variant:`ghost`,disabled:c,onClick:S,children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ae,{"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 y(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-node-device-code`,children:`Device code`}),(0,$.jsx)(G,{id:`hub-node-device-code`,required:!0,autoFocus:!0,maxLength:16,value:t,className:`font-mono uppercase ${W}`,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,onClick:S,children:`Cancel`})]})]})]})}function sn(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 cn=`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`,ln=null;function un(){return window.turnstile?Promise.resolve(window.turnstile):ln||(ln=new Promise((e,t)=>{let n=document.querySelector(`script[src="${cn}"]`),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=cn,r.async=!0,r.defer=!0,document.head.append(r))}).catch(e=>{throw ln=null,e}),ln)}function dn(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),un().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 fn(e,t){return e instanceof g?e.message:t}function pn(){let e=new Uint8Array(32);return crypto.getRandomValues(e),h(e)}function mn(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(null),[r,a]=(0,Z.useState)(!0),o,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=new AbortController;return i.getPublicSignupConfiguration(e.signal).then(n).catch(()=>n({status:`disabled`})).finally(()=>{e.signal.aborted||a(!1)}),()=>e.abort()},s=[],e[0]=o,e[1]=s):(o=e[0],s=e[1]),(0,Z.useEffect)(o,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 hn(e){return e!==null&&`activationSecret`in e}function gn({config:e,initialLink:t,onConsumeLink:n,onCancel:r}){let[a,o]=(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,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),[v,y]=(0,Z.useState)(null),[b,x]=(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.`),o(`details`));return}let e=new AbortController;return x(!0),i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`link_token`,token:t.token}},e.signal).then(e=>{T.current=e,o(`credential`)}).catch(e=>w(fn(e,`This verification link could not be confirmed.`))).finally(()=>{n(),e.signal.aborted||x(!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}x(!0),w(null);try{let e=await i.startPublicSignup({username:s.trim().toLowerCase(),email:l.trim().toLowerCase(),antiBotAssertion:n});T.current=e,o(`check-email`)}catch(e){w(fn(e,`Account creation is temporarily unavailable.`))}finally{x(!1)}},O=async e=>{e.preventDefault();let t=T.current;if(!(b||t===null||!(`attemptSecret`in t))){x(!0),w(null);try{let e=await i.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`email_code`,code:d.trim()}});f(``),T.current=e,o(`credential`)}catch(e){w(fn(e,`That email code could not be verified.`))}finally{x(!1)}}},A=async e=>{let t=T.current;if(b||!hn(t))return;if(e===`password`&&p!==h){w(`The passwords do not match.`);return}x(!0),w(null);let n=p;m(``),g(``);try{let r=e===`passkey`?await i.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:pn()}):await i.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:pn()});T.current=null,await _.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(fn(e,`Account creation did not complete.`))}finally{x(!1)}},j=a===`details`?1:a===`check-email`||a===`verifying`?2:3;return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,$.jsx)(sn,{step:j,total:3,label:j===1?`Your details`:j===2?`Verify your email`:`Choose how you sign in`}),a===`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)(Y,{htmlFor:`hub-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:s,className:W,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)(Y,{htmlFor:`hub-signup-email`,children:`Email`}),(0,$.jsx)(G,{id:`hub-signup-email`,type:`email`,autoCapitalize:`none`,autoComplete:`email`,maxLength:254,required:!0,value:l,className:W,onChange:e=>u(e.currentTarget.value)})]}),e?.antiBot.provider===`turnstile`?(0,$.jsx)(dn,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:y}):null,(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Send verification email`,submitDisabled:e===null})]}):a===`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)(Ze,{"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)(Y,{htmlFor:`hub-signup-code`,children:`Verification code`}),(0,$.jsx)(G,{id:`hub-signup-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,pattern:`[0-9]{6}`,required:!0,value:d,className:W,onChange:e=>f(e.currentTarget.value)})]}),(0,$.jsx)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:r,pending:b,submitLabel:`Verify email`})]}):a===`password`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),A(`password`)},children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-signup-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:p,className:W,onChange:e=>m(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-signup-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:h,className:W,onChange:e=>g(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)(xn,{value:C}),(0,$.jsx)(Sn,{onCancel:()=>o(`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)(H,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:a===`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)(xn,{value:C}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${qe}`,children:[(0,$.jsxs)(K,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>void A(`passkey`),children:[b?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(k,{"aria-hidden":!0}),b?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:b||a===`verifying`,onClick:()=>o(`password`),children:`Use a password instead`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function _n({pendingSignup:e,config:t,onCancel:n}){let[r,a]=(0,Z.useState)(e.suggestedUsername??``),[o,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`:o??``;if(!n){d(`Complete the anti-bot check before continuing.`);return}l(!0),d(null);try{let e=await i.finishExternalIdentitySignup({provider:`github`,username:r.trim().toLowerCase(),antiBotAssertion:n,idempotencyKey:pn()});await _.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(fn(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)(sn,{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)(H,{"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)(Y,{htmlFor:`hub-external-signup-username`,children:`Username`}),(0,$.jsx)(G,{id:`hub-external-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:r,className:W,onChange:e=>a(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)(dn,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(xn,{value:u}),(0,$.jsx)(Sn,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function vn({onCancel:e,onUseRecoveryCode:t,onResetPassword:n}){let[r,a]=(0,Z.useState)(``),[o,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 i.startPasswordLogin({identifier:r.trim().toLowerCase(),password:o});s(``),d(e)}else{let e=await i.finishPasswordLogin({attemptId:u.attemptId,attemptSecret:u.attemptSecret,factor:u.factor,code:c.trim()});l(``),await _.adoptPublicBrowserIdentity(e)}}catch(e){h(fn(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)(Y,{htmlFor:`hub-login-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-login-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:r,className:W,onChange:e=>a(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-password`,children:`Password`}),(0,$.jsx)(G,{id:`hub-login-password`,type:`password`,autoComplete:`current-password`,required:!0,maxLength:256,value:o,className:W,onChange:e=>s(e.currentTarget.value)})]})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-second-factor`,children:u.factor===`totp`?`Authenticator code`:`Email code`}),(0,$.jsx)(G,{id:`hub-login-second-factor`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:c,className:W,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)(xn,{value:m}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(K,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Sn,{onCancel:u===null?e:()=>d(null),pending:f,submitLabel:u===null?`Continue`:`Sign in`})]})}function yn({initialLink:e,onConsumeLink:t,onCancel:n}){let[r,a]=(0,Z.useState)(e?.kind===`password-reset`||e?.kind===`invalid-password-reset`?`verifying`:`request`),[o,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),x=(0,Z.useRef)(!1),S=async(e,t)=>{let n=await i.verifyPasswordReset({token:e},t);b.current=n,l(``),a(`password`)};(0,Z.useEffect)(()=>{if(x.current||e===null)return;if(x.current=!0,e.kind!==`password-reset`){e.kind===`invalid-password-reset`&&(y(`This reset link is incomplete or expired. Request a new one.`),a(`request`));return}let n=new AbortController;return _(!0),S(e.token,n.signal).catch(e=>y(fn(e,`This reset link could not be verified.`))).finally(()=>{t(),n.signal.aborted||_(!1)}),()=>n.abort()},[e,t]);let C=async e=>{if(e.preventDefault(),!g){_(!0),y(null);try{if(r===`request`)await i.requestPasswordReset({identifier:o.trim().toLowerCase()}),a(`check-email`);else if(r===`check-email`)await S(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 i.finishPasswordReset({attemptId:e.attemptId,attemptSecret:e.attemptSecret,password:t,factor:e.requiresTotp?{kind:`totp`,code:m.trim()}:{kind:`none`}}),h(``),b.current=null,a(`complete`)}}catch(e){y(fn(e,`Password reset did not complete.`))}finally{_(!1)}}},w=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 C(e),children:[r===`complete`?null:(0,$.jsx)(sn,{step:w,total:3,label:w===1?`Find your account`:w===2?`Check your email`:`Set a new password`}),r===`request`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-identifier`,children:`Username or verified email`}),(0,$.jsx)(G,{id:`hub-reset-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:o,className:W,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)(Ze,{"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)(Y,{htmlFor:`hub-reset-token`,children:`Reset token`}),(0,$.jsx)(G,{id:`hub-reset-token`,type:`password`,autoComplete:`one-time-code`,maxLength:64,required:!0,value:c,className:W,onChange:e=>l(e.currentTarget.value)})]})]}):r===`password`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password`,children:`New password`}),(0,$.jsx)(G,{id:`hub-reset-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:u,className:W,onChange:e=>d(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-password-confirmation`,children:`Repeat password`}),(0,$.jsx)(G,{id:`hub-reset-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:f,className:W,onChange:e=>p(e.currentTarget.value)})]}),b.current?.requiresTotp?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-totp`,children:`Authenticator code`}),(0,$.jsx)(G,{id:`hub-reset-totp`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:m,className:W,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)(H,{"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)(xn,{value:v}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsx)(K,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Sn,{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 bn({onCancel:e}){let[t,n]=(0,Z.useState)(``),[r,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=async e=>{if(e.preventDefault(),r)return;a(!0),s(null);let o=t;n(``);try{await i.signInWithRecoveryCode(o),await _.bootstrap()}catch(e){s(fn(e,`That recovery code could not be used.`))}finally{a(!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)(Y,{htmlFor:`hub-login-recovery-code`,children:`Recovery code`}),(0,$.jsx)(G,{id:`hub-login-recovery-code`,type:`password`,autoComplete:`one-time-code`,required:!0,maxLength:128,value:t,className:W,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsx)(xn,{value:o}),(0,$.jsx)(Sn,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function xn(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 Sn(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)(S,{"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)(K,{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)(K,{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 ${qe}`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}var Cn;function wn(){if(window.location.pathname!==`/email-verification`)return null;if(Cn!==void 0)return Cn;let e=tt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return Cn=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,Cn}function Tn(){let e=(0,Q.c)(3),t=A(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=Ke(t===null?void 0:z(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function En(){let e=(0,Q.c)(30),[t,n]=(0,Z.useState)(wn),r=s(Pn),i=s(Nn),o=s(Mn),u=s(jn),d=s(An),f=s(kn),p=c(On),m=P(),h;e[0]===m.logicalPathname?h=e[1]:(h=M(m.logicalPathname),e[0]=m.logicalPathname,e[1]=h);let g=h,_;e[2]===g?_=e[3]:(_=e=>l(e,g),e[2]=g,e[3]=_);let y=a(_),b=ne();N();let x;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],e[4]=x):x=e[4],(0,Z.useEffect)(Dn,x),nt(),Tn();let S=A(),C;e[5]!==r||e[6]!==S?.kind?(C=()=>{r===`authenticated`&&S?.kind===`sign-up`&&F(`/`,{replace:!0})},e[5]=r,e[6]=S?.kind,e[7]=C):C=e[7];let w;if(e[8]!==r||e[9]!==S?(w=[r,S],e[8]=r,e[9]=S,e[10]=w):w=e[10],(0,Z.useEffect)(C,w),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)(Fn,{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)(Gn,{}),e[14]=t):t=e[14],t}if(o.length>0&&!p){let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Jn,{}),e[15]=t):t=e[15],t}if(S?.kind===`account`){let t;return e[16]===S.section?t=e[17]:(t=(0,$.jsx)(Zt,{section:S.section}),e[16]=S.section,e[17]=t),t}if(S?.kind===`nodes`||S?.kind===`nodes-enroll`){let t;return e[18]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)($n,{}),e[18]=t):t=e[18],t}if(m.nodeId===null){if(b||m.malformed){let t;return e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)($n,{}),e[19]=t):t=e[19],t}if(i&&d){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{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)(v,{authGateState:{status:`hosted-cached`}}),e[21]=t):t=e[21],t}if(!i||i.id!==m.nodeId){let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(Vn,{}),e[22]=t):t=e[22],t}if(u===`terminal-failure`){let t;return e[23]!==f||e[24]!==i?(t=(0,$.jsx)(Rn,{node:i,message:f}),e[23]=f,e[24]=i,e[25]=t):t=e[25],t}if(!d){if(y){let t;return e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(v,{authGateState:{status:`hosted-cached`}}),e[26]=t):t=e[26],t}let t;return e[27]===i?t=e[28]:(t=(0,$.jsx)(Hn,{node:i}),e[27]=i,e[28]=t),t}let T;return e[29]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(v,{authGateState:{status:`hosted-hub`}}),e[29]=T):T=e[29],T}function Dn(){return p()}function On(e){return e.leased}function kn(e){return e.errorMessage}function An(e){return e.sessionEstablished}function jn(e){return e.transportStatus}function Mn(e){return e.recoveryCodes}function Nn(e){return e.selectedNode}function Pn(e){return e.accountStatus}function Fn(e){let t=(0,Q.c)(15),{link:n,onContinue:r}=e,[a,o]=(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 i.confirmEmailVerification(n.token,e.signal).then(()=>o(`verified`)).catch(()=>{e.signal.aborted||o(`invalid`)}).finally(In),()=>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=a===`verifying`?`Verifying your email`:a===`verified`?`Email verified`:`This verification link is unavailable`,u=a===`verifying`?`This will only take a moment.`:a===`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]!==a?(d=a===`verifying`?void 0:(0,$.jsx)(K,{size:`cta`,className:`mt-6 w-full`,onClick:r,children:`Continue`}),t[5]=r,t[6]=a,t[7]=d):d=t[7];let f;t[8]===a?f=t[9]:(f=a===`verifying`?(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Confirming the link…`]}):null,t[8]=a,t[9]=f);let p;return t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,$.jsx)(an,{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 In(){Cn=void 0}function Ln(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(S,{"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 Rn(e){let t=(0,Q.c)(10),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(te,{}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(oe,{"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)(K,{className:`mt-5`,onClick:zn,children:[(0,$.jsx)(ie,{"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)(qt,{measure:`content`,trailing:i,children:(0,$.jsxs)(Bn,{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 zn(){_.retrySelectedNode()}function Bn(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 Vn(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ae,{"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)(qt,{measure:`content`,children:(0,$.jsx)(Bn,{icon:t,title:`Restoring your node`,children:(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(Ln,{}),`Checking your access before reconnecting…`]})})}),e[1]=n):n=e[1],n}function Hn(e){let t=(0,Q.c)(7),{node:n}=e,{returnToAllNodes:r}=j(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ae,{"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)(Ln,{}),`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)(K,{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)(qt,{measure:`content`,children:(0,$.jsxs)(Bn,{icon:i,title:a,children:[o,s]})}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function Un(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(Wn),t[0]=s):s=t[0];let c=`transition-transform ${i?`rotate-180`:``}`,l;t[1]===c?l=t[2]:(l=(0,$.jsx)(C,{"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)(K,{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 Wn(e){return!e}function Gn({context:e=`hub`,autoExternalProvider:t=null}={}){let n=s(e=>e.accountStatus),r=s(e=>e.errorMessage),a=s(e=>e.bootstrapAvailable),[c,l]=(0,Z.useState)(()=>tt({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}=mn(),f=o(e=>e.externalIdentityConfiguration),p=He(f),[m,h]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(!1),[x,C]=(0,Z.useState)(void 0),w=A(),T=w?.kind===`sign-up`||w?.kind===`sign-up-verify`?`public`:w?.kind===`invitation`?`invitation`:w?.kind===`setup`?`bootstrap`:null,E=w?.kind===`sign-in-password`?`password`:w?.kind===`sign-in-recovery-code`?`recovery-code`:w?.kind===`reset-password`?`password-reset`:null,D=e=>{I(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},O=e=>{I(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)(()=>{_.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(T!==`public`&&e!==`native-authorization`){C(void 0);return}let t=new AbortController;return C(void 0),i.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||C(e)}).catch(()=>{t.signal.aborted||C({status:`none`})}),()=>t.abort()},[e,T]);let P=(0,Z.useCallback)(async()=>{if(!m){h(!0),y(null);try{await Ue({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:ee({kind:`sign-up`}),start:e=>i.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){y(e instanceof g?e.message:`GitHub sign-in is temporarily unavailable.`),h(!1)}}},[e,m]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||p?.login!==!0||x?.status!==`none`||b.current||(b.current=!0,P())},[t,e,x?.status,p?.login,P,n]),(0,Z.useEffect)(()=>{T===`invitation`||T===`bootstrap`?M.current?.focus({preventScroll:!0}):j.current?.focus({preventScroll:!0})},[E,T]),(0,Z.useEffect)(()=>{N.current?.scrollTo({top:0,left:0})},[E,T]);let F=T===`invitation`||T===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${qe}`,children:[(0,$.jsx)(K,{type:`submit`,form:Kn,className:`phone:min-h-11`,disabled:n===`authenticating`,children:T===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(K,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>_.cancelAuthentication():()=>D(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,L=T||E?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${qe}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[p?.login?(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:m||n===`authenticating`||n===`signing-out`,onClick:()=>void P(),children:[m?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(ce,{"aria-hidden":!0}),m?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(K,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void _.signIn(),children:[(0,$.jsx)(k,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>_.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[d?.status===`enabled`?(0,$.jsx)(K,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`public`),children:`Create account`}):null,(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(K,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>D(`bootstrap`),children:`Set up first owner`}):null]})]})}),R=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(K,{className:`mt-3 phone:min-h-11`,variant:`ghost`,onClick:()=>void _.bootstrap(),children:[(0,$.jsx)(ie,{"aria-hidden":!0}),` Retry Hub`]}):null,(0,$.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:n===`authenticating`?`Passkey authentication is in progress.`:``})]}),z=v??r,te=z?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`error`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`Sign-in did not complete`}),(0,$.jsx)(ve,{children:z})]})}):null,ne=x?.status===`signup`?x:null,re=x?.status===`error`?x:null,V=e===`native-authorization`&&T!==`public`;if(T===`public`||V&&(ne!==null||re!==null)){let e=()=>{V?C({status:`none`}):D(null)};return(0,$.jsxs)(an,{title:`Create your account`,description:V?`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:R,scrollRef:N,titleRef:j,children:[te,x===void 0?(0,$.jsx)(he,{className:`h-64 w-full rounded-2xl`}):ne?(0,$.jsx)(_n,{pendingSignup:ne,config:d?.status===`enabled`?d:null,onCancel:e}):re?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(ye,{variant:`warning`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(_e,{children:`GitHub signup did not continue`}),(0,$.jsx)(ve,{children:Ve(re.code)})]}),(0,$.jsx)(K,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(gn,{config:d?.status===`enabled`?d:null,initialLink:c,onConsumeLink:u,onCancel:()=>{u(),D(null)}})]})}if(T===`invitation`||T===`bootstrap`)return(0,$.jsxs)(an,{title:T===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:T===`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:R,scrollRef:N,titleRef:j,children:[te,(0,$.jsx)(qn,{mode:T,credentialRef:M})]});if(E!==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.`}}[E];return(0,$.jsxs)(an,{title:e.title,description:e.description,trailing:R,scrollRef:N,titleRef:j,children:[te,E===`password`?(0,$.jsx)(vn,{onCancel:()=>O(null),onUseRecoveryCode:()=>O(`recovery-code`),onResetPassword:()=>O(`password-reset`)}):E===`recovery-code`?(0,$.jsx)(bn,{onCancel:()=>O(null)}):(0,$.jsx)(yn,{initialLink:c,onConsumeLink:u,onCancel:()=>{u(),O(null)}})]})}return(0,$.jsxs)(an,{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:L,trailing:R,scrollRef:N,titleRef:j,children:[(0,$.jsx)(Je,{}),(0,$.jsx)(Un,{bootstrapAvailable:a,publicSignupEnabled:d?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(K,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>O(`password`),children:[(0,$.jsx)(Xe,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(B,{}),te]})}var Kn=`hub-registration-form`;function qn(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 _.redeemInvitation({secret:t,...r}):await _.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)(Y,{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)(G,{ref:r,id:`hub-registration-credential`,type:`password`,required:!0,maxLength:128,value:i,className:W,onChange:h}),t[10]=i,t[11]=r,t[12]=g):g=t[12];let v;t[13]!==m||t[14]!==g?(v=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[m,g]}),t[13]=m,t[14]=g,t[15]=v):v=t[15];let y;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,$.jsx)(Y,{htmlFor:`hub-display-name`,children:`Display name`}),t[16]=y):y=t[16];let b;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>s(e.currentTarget.value),t[17]=b):b=t[17];let x;t[18]===o?x=t[19]:(x=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[y,(0,$.jsx)(G,{id:`hub-display-name`,required:!0,maxLength:200,value:o,className:W,onChange:b})]}),t[18]=o,t[19]=x);let S;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsxs)(Y,{htmlFor:`hub-passkey-label`,children:[`Passkey label `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),t[20]=S):S=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>l(e.currentTarget.value),t[21]=C):C=t[21];let w;t[22]===c?w=t[23]:(w=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[S,(0,$.jsx)(G,{id:`hub-passkey-label`,maxLength:100,value:c,className:W,onChange:C})]}),t[22]=c,t[23]=w);let T;return t[24]!==x||t[25]!==w||t[26]!==f||t[27]!==v?(T=(0,$.jsxs)(`form`,{id:Kn,className:`mt-6 space-y-4`,onSubmit:f,autoComplete:`off`,children:[v,x,w]}),t[24]=x,t[25]=w,t[26]=f,t[27]=v,t[28]=T):T=t[28],T}function Jn(){let e=(0,Q.c)(20),t=s(Zn),{copyToClipboard:n,isCopied:r}=q(),i=`Save all ${String(t.length)} codes — they are shown once and cannot be retrieved later. Ryco does not save them in browser storage.`,a;e[0]!==n||e[1]!==t?(a=()=>n(Be(t),void 0),e[0]=n,e[1]=t,e[2]=a):a=e[2];let o;e[3]===r?o=e[4]:(o=r?(0,$.jsx)(x,{"aria-hidden":!0}):(0,$.jsx)(O,{"aria-hidden":!0}),e[3]=r,e[4]=o);let c=r?`Copied`:`Copy codes`,l;e[5]!==a||e[6]!==o||e[7]!==c?(l=(0,$.jsxs)(K,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:a,children:[o,c]}),e[5]=a,e[6]=o,e[7]=c,e[8]=l):l=e[8];let u;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(K,{size:`cta`,className:`mt-3 w-full`,onClick:Xn,children:`I saved the codes`}),e[9]=u):u=e[9];let d;e[10]===l?d=e[11]:(d=(0,$.jsxs)(`div`,{className:`phone:mt-auto ${qe}`,children:[l,u]}),e[10]=l,e[11]=d);let f;e[12]===t?f=e[13]:(f=t.map(Yn),e[12]=t,e[13]=f);let p;e[14]===f?p=e[15]:(p=(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:f}),e[14]=f,e[15]=p);let m;return e[16]!==i||e[17]!==d||e[18]!==p?(m=(0,$.jsx)(an,{title:`Save your recovery codes`,description:i,actions:d,children:p}),e[16]=i,e[17]=d,e[18]=p,e[19]=m):m=e[19],m}function Yn(e){return(0,$.jsx)(`li`,{children:e},e)}function Xn(){return _.dismissRecoveryCodes()}function Zn(e){return e.recoveryCodes}function Qn(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=Ot(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=f(n),t[3]=n,t[4]=l);let u=l,d=i||u,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(ae,{"aria-hidden":!0,className:`size-4`})}),t[5]=p):p=t[5];let m;t[6]===n.label?m=t[7]:(m=(0,$.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),t[6]=n.label,t[7]=m);let h;t[8]===n?h=t[9]:(h=kt(n),t[8]=n,t[9]=h);let g;t[10]===h?g=t[11]:(g=(0,$.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:h}),t[10]=h,t[11]=g);let _;t[12]===u?_=t[13]:(_=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]=_);let v;t[14]!==m||t[15]!==g||t[16]!==_?(v=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[m,g,_]}),t[14]=m,t[15]=g,t[16]=_,t[17]=v):v=t[17];let y;t[18]===n?y=t[19]:(y=(0,$.jsx)(L,{node:n}),t[18]=n,t[19]=y);let b;t[20]===c?b=t[21]:(b=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]=b);let x;t[22]!==y||t[23]!==b?(x=(0,$.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[y,b]}),t[22]=y,t[23]=b,t[24]=x):x=t[24];let S;t[25]!==a||t[26]!==x||t[27]!==d||t[28]!==v?(S=(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:[p,v,x]}),t[25]=a,t[26]=x,t[27]=d,t[28]=v,t[29]=S):S=t[29];let C;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`w-px shrink-0 bg-border/60`}),t[30]=C):C=t[30];let T=`Node details: ${n.label}`,E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(w,{"aria-hidden":!0,className:`size-4`}),t[31]=E):E=t[31];let D;t[32]!==o||t[33]!==T?(D=(0,$.jsx)(`button`,{type:`button`,"aria-label":T,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:E}),t[32]=o,t[33]=T,t[34]=D):D=t[34];let O;return t[35]!==S||t[36]!==D?(O=(0,$.jsxs)(`li`,{className:`flex items-stretch overflow-hidden rounded-xl border border-border bg-background`,children:[S,C,D]}),t[35]=S,t[36]=D,t[37]=O):O=t[37],O}function $n(){let e=(0,Q.c)(110),t=s(pr),n=s(fr),r=s(dr),a=s(ur),o=s(lr),c=s(cr),l=ne(),u=m(),d=ge()===`phone`,f=A()?.kind===`nodes-enroll`,p=sr,[h,g]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(null),b=(0,Z.useRef)(null),x=We(6e4),C,w;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{b.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]===u?T=e[3]:(T=async e=>{R(e.id)||(await u({to:`/`,replace:!0}),await _.selectNode(e.id))},e[2]=u,e[3]=T);let E=T;if(f){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(qt,{measure:`content`,children:(0,$.jsx)(on,{onClose:()=>p(!1)})}),e[4]=t):t=e[4],t}let D,O,k,j,M,N,P,F,I,L,z,ee,te,V,H,U,W,G;if(e[5]!==o||e[6]!==r||e[7]!==h||e[8]!==a||e[9]!==d||e[10]!==t||e[11]!==x||e[12]!==v||e[13]!==l||e[14]!==E||e[15]!==c||e[16]!==n){let i=At(t),s;e[35]!==h||e[36]!==t?(s=h===null?null:t.find(e=>e.id===h)??null,e[35]=h,e[36]=t,e[37]=s):s=e[37],j=s,P=o?.role===`owner`;let u=n===`ready`&&t.length===0;N=P&&!u;let f;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:or,children:[(0,$.jsx)(se,{"aria-hidden":!0}),` Account`]}),e[38]=f):f=e[38],k=f;let m;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsxs)(K,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:ar,children:[(0,$.jsx)(re,{"aria-hidden":!0}),` Sign out`]}),e[39]=m):m=e[39],I=m;let _=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,y,C;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>p(!0),C=(0,$.jsx)(ae,{"aria-hidden":!0}),e[40]=y,e[41]=C):(y=e[40],C=e[41]);let w;e[42]===_?w=e[43]:(w=(0,$.jsxs)(K,{className:_,onClick:y,children:[C,` Enroll node`]}),e[42]=_,e[43]=w),M=w;let T=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,A=n===`loading`,R;e[44]===n?R=e[45]:(R=n===`loading`?(0,$.jsx)(S,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,$.jsx)(ie,{"aria-hidden":!0}),e[44]=n,e[45]=R);let B;e[46]!==T||e[47]!==A||e[48]!==R?(B=(0,$.jsxs)(K,{className:T,variant:`outline`,disabled:A,onClick:ir,children:[R,`Refresh nodes`]}),e[46]=T,e[47]=A,e[48]=R,e[49]=B):B=e[49],F=B,O=qt;let ne;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:rr,children:(0,$.jsx)(se,{"aria-hidden":!0})}),e[50]=ne):ne=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsxs)($.Fragment,{children:[ne,(0,$.jsx)(K,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:nr,children:(0,$.jsx)(re,{"aria-hidden":!0})})]}),e[51]=z):z=e[51],D=zt,ee=b,te=t.length===1?`Your node`:`Your nodes`;let ce=o?.displayName??`Hub account`,q;e[52]===o?q=e[53]:(q=o?` · ${o.role.charAt(0).toUpperCase()}${o.role.slice(1)}`:``,e[52]=o,e[53]=q);let le;e[54]!==ce||e[55]!==q?(le=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,ce,q]}),e[54]=ce,e[55]=q,e[56]=le):le=e[56];let J;e[57]===t?J=e[58]:(J=t.length>1?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:Nt(t)}):null,e[57]=t,e[58]=J),e[59]!==le||e[60]!==J?(V=(0,$.jsxs)($.Fragment,{children:[le,J]}),e[59]=le,e[60]=J,e[61]=V):V=e[61],e[62]!==M||e[63]!==N||e[64]!==d||e[65]!==F?(H=d?void 0:(0,$.jsxs)($.Fragment,{children:[F,N?M:null]}),e[62]=M,e[63]=N,e[64]=d,e[65]=F,e[66]=H):H=e[66],e[67]===n?U=e[68]:(U=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=U),e[69]===v?W=e[70]:(W=v?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(ye,{variant:`warning`,role:`status`,children:[(0,$.jsx)(oe,{"aria-hidden":!0}),(0,$.jsx)(ve,{children:v})]})}):null,e[69]=v,e[70]=W);let ue=n===`stale`?null:a;e[71]!==l||e[72]!==c||e[73]!==ue?(G=(0,$.jsx)(mr,{selection:c,routeNotice:l,error:ue}),e[71]=l,e[72]=c,e[73]=ue,e[74]=G):G=e[74],L=u?(0,$.jsx)(hr,{isOwner:P,onEnroll:()=>p(!0)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`ul`,{role:`list`,className:`mt-5 space-y-2`,"aria-busy":n===`loading`,children:[i.map(e=>(0,$.jsx)(Qn,{node:e,nowMs:x,disabled:Pt({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(tr)}):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]=o,e[6]=r,e[7]=h,e[8]=a,e[9]=d,e[10]=t,e[11]=x,e[12]=v,e[13]=l,e[14]=E,e[15]=c,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=j,e[21]=M,e[22]=N,e[23]=P,e[24]=F,e[25]=I,e[26]=L,e[27]=z,e[28]=ee,e[29]=te,e[30]=V,e[31]=H,e[32]=U,e[33]=W,e[34]=G}else D=e[17],O=e[18],k=e[19],j=e[20],M=e[21],N=e[22],P=e[23],F=e[24],I=e[25],L=e[26],z=e[27],ee=e[28],te=e[29],V=e[30],H=e[31],U=e[32],W=e[33],G=e[34];let ce,q;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(Je,{})}),q=(0,$.jsx)(B,{}),e[75]=ce,e[76]=q):(ce=e[75],q=e[76]);let le;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(le=e=>{e||g(null)},e[77]=le):le=e[77];let J;e[78]===E?J=e[79]:(J=e=>void E(e),e[78]=E,e[79]=J);let ue;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(ue=async e=>{await i.revokeNode(e.id,lt),y(mt(e.label)),await _.refreshDirectory(),g(null)},e[80]=ue):ue=e[80];let de;e[81]!==r||e[82]!==j||e[83]!==P||e[84]!==n||e[85]!==J?(de=(0,$.jsx)(Rt,{node:j,directoryStatus:n,browserStatus:r,canRename:P,canRevoke:P,onOpenChange:le,onConnect:J,onRename:er,onRevoke:ue}),e[81]=r,e[82]=j,e[83]=P,e[84]=n,e[85]=J,e[86]=de):de=e[86];let fe;e[87]!==D||e[88]!==L||e[89]!==de||e[90]!==ee||e[91]!==te||e[92]!==V||e[93]!==H||e[94]!==U||e[95]!==W||e[96]!==G?(fe=(0,$.jsxs)(D,{titleRef:ee,title:te,description:V,actions:H,children:[U,W,G,L,ce,q,de]}),e[87]=D,e[88]=L,e[89]=de,e[90]=ee,e[91]=te,e[92]=V,e[93]=H,e[94]=U,e[95]=W,e[96]=G,e[97]=fe):fe=e[97];let pe;e[98]!==k||e[99]!==M||e[100]!==N||e[101]!==d||e[102]!==F||e[103]!==I?(pe=d?(0,$.jsxs)(`div`,{className:`mt-auto ${qe}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,I]}),N?M:null,F]}):null,e[98]=k,e[99]=M,e[100]=N,e[101]=d,e[102]=F,e[103]=I,e[104]=pe):pe=e[104];let me;return e[105]!==O||e[106]!==z||e[107]!==fe||e[108]!==pe?(me=(0,$.jsxs)(O,{trailing:z,children:[fe,pe]}),e[105]=O,e[106]=z,e[107]=fe,e[108]=pe,e[109]=me):me=e[109],me}async function er(e,t){await i.renameNode(e.id,t),await _.refreshDirectory()}function tr(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(he,{className:`h-16 w-full rounded-xl`})},e)}function nr(){_.signOut()}function rr(){I({kind:`account`,section:`security`})}function ir(){_.refreshDirectory()}function ar(){_.signOut()}function or(){I({kind:`account`,section:`security`})}function sr(e){return I(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function cr(e){return e.selectionStatus}function lr(e){return e.account}function ur(e){return e.errorMessage}function dr(e){return e.browserStatus}function fr(e){return e.directoryStatus}function pr(e){return e.nodes}function mr(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)(oe,{"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)(ye,{variant:`error`,children:[o,(0,$.jsx)(ve,{children:a})]})}),t[1]=a,t[2]=s),s}function hr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(Pe,{variant:`icon`,children:n?(0,$.jsx)(ae,{"aria-hidden":!0}):(0,$.jsx)(H,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(Le,{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)(Re,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Fe,{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)(Ie,{children:(0,$.jsxs)(K,{className:`phone:min-h-11`,onClick:r,children:[(0,$.jsx)(ae,{"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)(ze,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}export{Gn as HostedAuthenticationSurface,En as HostedHubRoot};
@@ -1,7 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{Bn as r,Ft as i,Jt as a,Vn as o,Wn as s,Xn as c,hn as l,xn as u}from"./runtime-DfGHeCnR.js";import{dt as d}from"./primary-OskAInOO.js";import{It as f}from"./composerDraftStore-CdJJZe42.js";import{i as p}from"./toast-CcSCAm4B.js";import{t as m}from"./keyboard-BqeRMHfL.js";import{t as h}from"./plus-B2h-VEqh.js";import{t as g}from"./search-BGQsenCM.js";import{t as _}from"./triangle-alert-RL_T3KLo.js";import{t as v}from"./undo-2-x37tfI3V.js";import{t as y}from"./x-C1Cemsov.js";import{t as b}from"./shallow-DWZCFNun.js";import{n as x,t as S}from"./utils-BofFIn5Y.js";import{i as C,n as w,t as T}from"./tooltip-C8sAONBj.js";import{t as E}from"./input-CHEwW3oH.js";import{t as D}from"./button-BAbJxRzt.js";import{t as O}from"./toastHelpers-CSQRKo4F.js";import{c as k,i as A,p as j,s as M}from"./menu-Dvxh8sD5.js";import{r as N}from"./editorPreferences-0DWMgcci.js";import{i as P,n as F,r as I}from"./settingsLayout-D8glO7f1.js";var L=e(t(),1),R=n(),z={terminal:{id:`terminal`,label:`Terminal`,sortWeight:10},workspace:{id:`workspace`,label:`Workspace`,sortWeight:20},diff:{id:`diff`,label:`Diff`,sortWeight:30},commandPalette:{id:`commandPalette`,label:`Command palette`,sortWeight:40},sidebar:{id:`sidebar`,label:`Sidebar`,sortWeight:50},chat:{id:`chat`,label:`Chat`,sortWeight:60},composer:{id:`composer`,label:`Composer`,sortWeight:70},editor:{id:`editor`,label:`Editor`,sortWeight:80},modelPicker:{id:`modelPicker`,label:`Model picker`,sortWeight:90},thread:{id:`thread`,label:`Threads`,sortWeight:100},script:{id:`script`,label:`Project scripts`,sortWeight:110}},B={"terminal.toggle":{title:`Toggle terminal drawer`,sortWeight:1},"terminal.split":{title:`Split terminal`,sortWeight:2},"terminal.new":{title:`New terminal`,sortWeight:3},"terminal.close":{title:`Close terminal`,sortWeight:4},"workspace.files":{title:`Open workspace files`,sortWeight:1},"workspace.review":{title:`Open workspace review`,sortWeight:2},"workspace.terminal":{title:`Open workspace terminal`,sortWeight:3},"workspace.simulator":{title:`Open iOS Simulator workspace`,sortWeight:4},"diff.toggle":{title:`Toggle diff view`,sortWeight:1},"commandPalette.toggle":{title:`Open command palette`,sortWeight:1},"sidebar.showInbox":{title:`Show Inbox sidebar`,sortWeight:1},"sidebar.showProjects":{title:`Show Projects sidebar`,sortWeight:2},"chat.new":{title:`New chat`,sortWeight:1},"chat.newLocal":{title:`New chat (local environment)`,sortWeight:2},"composer.stash":{title:`Stash prompt or open stash`,sortWeight:1},"editor.openFavorite":{title:`Open in preferred editor`,sortWeight:1},"modelPicker.toggle":{title:`Toggle model picker`,sortWeight:1},"modelPicker.jump.1":{title:`Pick model 1`,sortWeight:2},"modelPicker.jump.2":{title:`Pick model 2`,sortWeight:3},"modelPicker.jump.3":{title:`Pick model 3`,sortWeight:4},"modelPicker.jump.4":{title:`Pick model 4`,sortWeight:5},"modelPicker.jump.5":{title:`Pick model 5`,sortWeight:6},"modelPicker.jump.6":{title:`Pick model 6`,sortWeight:7},"modelPicker.jump.7":{title:`Pick model 7`,sortWeight:8},"modelPicker.jump.8":{title:`Pick model 8`,sortWeight:9},"modelPicker.jump.9":{title:`Pick model 9`,sortWeight:10},"thread.find":{title:`Find in current thread`,sortWeight:1},"thread.previous":{title:`Previous thread`,sortWeight:2},"thread.next":{title:`Next thread`,sortWeight:3},"thread.jump.1":{title:`Jump to thread 1`,sortWeight:4},"thread.jump.2":{title:`Jump to thread 2`,sortWeight:5},"thread.jump.3":{title:`Jump to thread 3`,sortWeight:6},"thread.jump.4":{title:`Jump to thread 4`,sortWeight:7},"thread.jump.5":{title:`Jump to thread 5`,sortWeight:8},"thread.jump.6":{title:`Jump to thread 6`,sortWeight:9},"thread.jump.7":{title:`Jump to thread 7`,sortWeight:10},"thread.jump.8":{title:`Jump to thread 8`,sortWeight:11},"thread.jump.9":{title:`Jump to thread 9`,sortWeight:12}};function V(e){let t=e.indexOf(`.`),n=t===-1?e:e.slice(0,t);return n===`script`?z.script:z[n]??z.script}function H(e,t){let n=V(e),r=B[e];if(r)return{category:n,title:r.title,sortWeight:r.sortWeight};let i=e.match(/^script\.([a-z0-9][a-z0-9-]*)\.run$/)?.[1]??e;return{category:n,title:t??`Run: ${i}`,sortWeight:100}}var U=[{id:`always`,label:`Always`,value:void 0},{id:`terminalFocus`,label:`Terminal focused`,value:`terminalFocus`},{id:`notTerminalFocus`,label:`Not in terminal`,value:`!terminalFocus`},{id:`terminalOpen`,label:`Terminal open`,value:`terminalOpen`},{id:`notTerminalOpen`,label:`Terminal not open`,value:`!terminalOpen`},{id:`modelPickerOpen`,label:`Model picker open`,value:`modelPickerOpen`},{id:`commandPaletteOpen`,label:`Command palette open`,value:`commandPaletteOpen`},{id:`composerFocus`,label:`Composer focused`,value:`composerFocus`},{id:`notComposerFocus`,label:`Not in composer`,value:`!composerFocus`}],W=new Map(U.map(e=>[e.value,e])),G=new Map(U.map(e=>[e.value===void 0?void 0:e.value.replace(/\s+/g,``),e]));function K(e){return e===void 0?W.get(void 0):W.get(e)||G.get(e.replace(/\s+/g,``))}function q(e){let t=K(e);return t?t.label:e??`Always`}function J(e){if(e)switch(e.type){case`identifier`:return e.name;case`not`:return`!${J(e.node)}`;case`and`:return`(${J(e.left)} && ${J(e.right)})`;case`or`:return`(${J(e.left)} || ${J(e.right)})`}}function ee(e,t){return(e===void 0?``:e.replace(/\s+/g,``))===(t===void 0?``:t.replace(/\s+/g,``))}function te(e,t){let n=e[t];if(!n)return[];let r=[];return e.forEach((e,i)=>{i!==t&&e.command!==n.command&&e.key===n.key&&ee(e.when,n.when)&&r.push({key:n.key,otherCommand:e.command,otherWhen:e.when})}),r}function ne(e){let t=new Map;return e.forEach((n,r)=>{let i=te(e,r);if(i.length===0)return;let a=e[r].command,o=t.get(a)??[];o.push(...i),t.set(a,o)}),t}function Y(e){return/mac|iphone|ipad|ipod/i.test(e)}var re=new Set([`control`,`shift`,`alt`,`altgraph`,`meta`,`os`,`hyper`,`super`,`fn`,`capslock`,`numlock`,`scrolllock`]),ie=new Set([`escape`,`tab`,`enter`]);function ae(e,t){let n=e.toLowerCase();if(n===` `||n===`spacebar`)return`space`;if(n===`esc`)return`escape`;if(n===`arrowup`)return`up`;if(n===`arrowdown`)return`down`;if(n===`arrowleft`)return`left`;if(n===`arrowright`)return`right`;if(t){let e=t.match(/^Digit(\d)$/);if(e)return e[1];if(t===`BracketLeft`)return`[`;if(t===`BracketRight`)return`]`}return n}function oe(e,t){let n=e.key.toLowerCase();if(re.has(n))return null;let r=Y(t?.platform??(typeof navigator<`u`?navigator.platform:``)),i=r?e.metaKey:e.ctrlKey;if(!(i||e.shiftKey||e.altKey||(r?e.ctrlKey:e.metaKey))&&ie.has(n))return null;let a=ae(e.key,e.code);return a.length===0?null:{key:a,modKey:i,metaKey:!r&&e.metaKey,ctrlKey:r&&e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey}}var se={mod:`⌘`,meta:`⌘`,cmd:`⌘`,ctrl:`⌃`,control:`⌃`,shift:`⇧`,alt:`⌥`,option:`⌥`},ce={mod:`Ctrl`,meta:`Meta`,cmd:`Meta`,ctrl:`Ctrl`,control:`Ctrl`,shift:`Shift`,alt:`Alt`,option:`Alt`},X={space:`Space`,enter:`Enter`,escape:`Esc`,up:`↑`,down:`↓`,left:`←`,right:`→`,tab:`Tab`,backspace:`⌫`,delete:`Del`};function le(e,t){let n=Y(t?.platform??(typeof navigator<`u`?navigator.platform:``))?se:ce,r=[];e.modKey&&r.push(n.mod),e.metaKey&&r.push(n.meta),e.ctrlKey&&r.push(n.ctrl),e.altKey&&r.push(n.alt),e.shiftKey&&r.push(n.shift);let i=X[e.key]??(e.key.length===1?e.key.toUpperCase():e.key);return r.push(i),r}function ue(e){let t=[];e.modKey&&t.push(`mod`),e.metaKey&&t.push(`meta`),e.ctrlKey&&t.push(`ctrl`),e.altKey&&t.push(`alt`),e.shiftKey&&t.push(`shift`);let n=e.key===` `?`space`:e.key;return t.push(n),t.join(`+`)}var Z=f(),de=[],fe=(()=>{let e=new Map;for(let t of d){let n=`${t.key}|${t.when??``}`,r=e.get(t.command)??new Set;r.add(n),e.set(t.command,r)}return e})(),Q=new Set(d.map(e=>e.command));function pe(e,t){return`${e.command}|${e.key}|${e.when??``}|${t}`}function me(e){return{key:ue(e.shortcut),command:e.command,when:J(e.whenAst)}}function $(e){return e.map((e,t)=>({...me(e),__id:pe(e,t)}))}function he(e){return e.map(({__id:e,...t})=>t)}function ge(e){return d.filter(t=>t.command===e).map(e=>Object.assign({},e))}function _e(e,t){if(!Q.has(e))return`custom`;let n=fe.get(e);if(!n)return`custom`;if(t.length!==n.size)return`modified`;for(let e of t){let t=`${e.key}|${e.when??``}`;if(!n.has(t))return`modified`}return`default`}function ve(e,t,n){return!n||[t.toLowerCase(),e.command.toLowerCase(),e.key.toLowerCase(),q(e.when).toLowerCase()].some(e=>e.includes(n))}function ye(){return Math.random().toString(36).slice(2)}function be(){let e=c(),t=o(),n=s(),d=r(),f=typeof navigator<`u`?navigator.platform:``,h=x(f),[y,S]=(0,L.useState)(!1),[C,w]=(0,L.useState)(null),T=!e||e.primary,k=e?l(e.environmentId)?.keybindings:u().keybindings,A=(0,L.useCallback)(()=>{if(!n)return;if(!T){w(`This file lives on ${e?.nodeLabel??`the selected node`} and cannot be opened in a local editor.`);return}w(null),S(!0);let t=N(d??[]);if(!t){w(`No available editors found.`),S(!1);return}u().shell.openInEditor(n,t).catch(e=>{w(e instanceof Error?e.message:`Unable to open keybindings file.`)}).finally(()=>{S(!1)})},[d,T,n,e?.nodeLabel]),j=a(b(i)),M=(0,L.useMemo)(()=>{let e=new Set,t=new Map;for(let n of j)for(let r of n.scripts){let n=`script.${r.id}.run`;e.add(n),t.has(n)||t.set(n,`Run: ${r.name}`)}return{commandList:Array.from(e),titles:t}},[j]),R=t?.keybindings??de,[B,V]=(0,L.useState)(()=>$(R)),[U,W]=(0,L.useState)(()=>JSON.stringify(he($(R)))),G=(0,L.useRef)(!1);(0,L.useEffect)(()=>{let e=JSON.stringify(he($(R)));e!==U&&(W(e),G.current||V($(R)))},[R,U]);let K=(0,L.useCallback)(async e=>{G.current=!0;try{if(!k)throw Error(`Keybinding settings are unavailable on this node.`);await k.replaceCustom({rules:he(e)})}catch(e){p.add(O({type:`error`,title:`Could not save keybindings`,description:e instanceof Error?e.message:`An unknown error occurred.`})),V($(R))}finally{G.current=!1}},[k,R]),q=(0,L.useCallback)((e,t)=>{V(n=>{let r=n.slice(),i=r[e];if(!i)return n;let a=ue(t);return a===i.key?n:(r[e]={...i,key:a,__id:i.__id},K(r),r)})},[K]),J=(0,L.useCallback)(e=>{V(t=>{let n={command:e,key:``,when:void 0,__id:`placeholder-${ye()}`},r=(()=>{let n=-1;return t.forEach((t,r)=>{t.command===e&&(n=r)}),n})();return r===-1?[...t,n]:[...t.slice(0,r+1),n,...t.slice(r+1)]})},[]),ee=(0,L.useCallback)(e=>{V(t=>{let n=t.slice();return n.splice(e,1),K(n),n})},[K]),te=(0,L.useCallback)((e,t)=>{V(n=>{let r=n.slice(),i=r[e];return!i||(i.when??void 0)===t?n:(r[e]={...i,when:t,__id:i.__id},K(r),r)})},[K]),Y=(0,L.useCallback)(e=>{V(t=>{let n=t[e];if(!n)return t;let r=n.command;if(!Q.has(r)){let n=t.slice();return n.splice(e,1),K(n),n}let i=ge(r),a=t.filter(e=>e.command!==r);for(let e of i)a.push({...e,__id:`default-${r}-${ye()}`});return K(a),a})},[K]),re=(0,L.useCallback)(e=>{V(t=>{let n=t.filter(t=>t.command!==e);if(Q.has(e))for(let t of ge(e))n.push({...t,__id:`default-${e}-${ye()}`});return K(n),n})},[K]),ie=(0,L.useCallback)(async()=>{V([]);try{if(!k)throw Error(`Keybinding settings are unavailable on this node.`);await k.replaceCustom({rules:[]})}catch(e){p.add(O({type:`error`,title:`Could not restore default keybindings`,description:e instanceof Error?e.message:`An unknown error occurred.`})),V($(R))}},[k,R]),ae=(0,L.useRef)(new Map),oe=(0,L.useCallback)(e=>{let t=ae.current.get(e);t&&(t.scrollIntoView({behavior:`smooth`,block:`center`}),t.dataset.flash=`true`,window.setTimeout(()=>{delete t.dataset.flash},1100))},[]),[se,ce]=(0,L.useState)(``),X=(0,L.useDeferredValue)(se.trim().toLowerCase()),le=(0,L.useMemo)(()=>ne(B),[B]),fe=(0,L.useMemo)(()=>{let e=new Map;B.forEach((t,n)=>{let r=e.get(t.command);r?r.push(n):e.set(t.command,[n])});let t=new Set([...e.keys(),...Q,...M.commandList]),n=new Map;for(let r of t){let t=e.get(r)??[],i=t.map(e=>B[e]).filter(Boolean),a=H(r,M.titles.get(r)),o=_e(r,i),s={key:``,command:r,when:void 0};if(!(X.length===0||ve(s,a.title,X)||i.some(e=>ve(e,a.title,X))))continue;let c={command:r,title:a.title,indicesInDraft:t,status:o},l=n.get(a.category.id);l?l.push(c):n.set(a.category.id,[c])}let r=[];for(let e of Object.values(z).toSorted((e,t)=>e.sortWeight-t.sortWeight)){let t=n.get(e.id);!t||t.length===0||(t.sort((e,t)=>{let n=H(e.command,M.titles.get(e.command)),r=H(t.command,M.titles.get(t.command));return n.sortWeight-r.sortWeight}),r.push({category:e,rows:t}))}return r},[B,X,M]),pe=fe.reduce((e,t)=>e+t.rows.length,0),me=(0,L.useMemo)(()=>({platform:f,draft:B,conflictsByCommand:le,onRebind:q,onAddBinding:J,onRemoveBinding:ee,onChangeWhen:te,onResetBinding:Y,onResetCommand:re,scrollToCommand:oe,rowRefs:ae}),[f,B,le,q,J,ee,te,Y,re,oe]),be=t?.issues.filter(e=>e.kind.startsWith(`keybindings.`))??[],Se=(d??[]).length>0;return(0,Z.jsxs)(F,{children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(`span`,{className:`grid size-9 place-items-center rounded-lg bg-accent text-foreground/70`,children:(0,Z.jsx)(m,{className:`size-4`})}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Keybindings`}),(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Click any shortcut and press a new combination to rebind. Press Esc to cancel, Backspace to clear.`})]})]}),(0,Z.jsxs)(D,{variant:`outline`,size:`xs`,onClick:()=>void ie(),disabled:B.length===0,children:[(0,Z.jsx)(v,{className:`size-3.5`}),`Restore defaults`]})]}),(0,Z.jsx)(P,{title:`Configuration file`,children:(0,Z.jsx)(I,{title:`Keybindings file`,description:"Open the persisted `keybindings.json` file to edit advanced bindings directly.",status:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`block break-all font-mono text-[11px] text-foreground`,children:n??`Resolving keybindings path...`}),C?(0,Z.jsx)(`span`,{className:`mt-1 block text-destructive`,children:C}):(0,Z.jsx)(`span`,{className:`mt-1 block`,children:T?Se?`Opens in your preferred editor.`:`No available editors found.`:`Stored on ${e?.nodeLabel??`the selected node`}; use an editor on that machine.`})]}),control:(0,Z.jsx)(D,{size:`xs`,variant:`outline`,disabled:!T||!n||!Se||y,onClick:A,children:y?`Opening...`:`Open file`})})}),be.length>0?(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-200`,children:[(0,Z.jsx)(_,{className:`mt-0.5 size-4 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-0.5`,children:[be.map(e=>(0,Z.jsx)(`p`,{children:e.message},`${e.kind}-${e.message}`)),n?(0,Z.jsxs)(`p`,{className:`opacity-70`,children:[`Edit `,(0,Z.jsx)(`code`,{className:`rounded bg-amber-500/20 px-1`,children:n}),` `,`to resolve.`]}):null]})]}):null,(0,Z.jsxs)(`div`,{className:`relative`,children:[(0,Z.jsx)(g,{className:`absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground/60`}),(0,Z.jsx)(E,{type:`search`,placeholder:`Search by command, shortcut, or when…`,className:`pl-9`,value:se,onChange:e=>ce(e.target.value)})]}),pe===0?(0,Z.jsx)(`div`,{className:`rounded-lg border border-dashed border-border/60 px-6 py-12 text-center text-sm text-muted-foreground`,children:`No commands match your search.`}):fe.map(e=>(0,Z.jsx)(P,{title:e.category.label,children:e.rows.map(e=>(0,Z.jsx)(xe,{row:e,context:me,isMac:h,scriptTitle:M.titles.get(e.command)},e.command))},e.category.id))]})}var xe=(0,L.memo)(function(e){let t=(0,R.c)(42),{row:n,context:r,isMac:i}=e,a;if(t[0]!==r||t[1]!==i||t[2]!==n.command||t[3]!==n.indicesInDraft||t[4]!==n.status||t[5]!==n.title){let e;t[7]===r.draft?e=t[8]:(e=e=>({index:e,rule:r.draft[e]}),t[7]=r.draft,t[8]=e);let o=n.indicesInDraft.map(e),s=r.conflictsByCommand.get(n.command)??[],c=s.slice(0,3),l=n.command,u;t[9]!==r.rowRefs.current||t[10]!==n.command?(u=e=>{r.rowRefs.current.set(n.command,e)},t[9]=r.rowRefs.current,t[10]=n.command,t[11]=u):u=t[11];let d;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(d=S(`group flex flex-col gap-2 border-t border-border/60 px-4 py-3 first:border-t-0 transition-colors data-[flash=true]:bg-amber-500/10 sm:px-5`),t[12]=d):d=t[12];let f;t[13]===n.title?f=t[14]:(f=(0,Z.jsx)(`span`,{className:`truncate text-[13px] font-medium tracking-tight text-foreground`,children:n.title}),t[13]=n.title,t[14]=f);let p;t[15]===n.status?p=t[16]:(p=(0,Z.jsx)(Se,{status:n.status}),t[15]=n.status,t[16]=p);let m;t[17]!==f||t[18]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f,p]}),t[17]=f,t[18]=p,t[19]=m):m=t[19];let g;t[20]===n.command?g=t[21]:(g=(0,Z.jsx)(`code`,{className:`block truncate text-[10px] text-muted-foreground/60`,children:n.command}),t[20]=n.command,t[21]=g);let _;t[22]!==m||t[23]!==g?(_=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[m,g]}),t[22]=m,t[23]=g,t[24]=_):_=t[24];let y=o.length===0?(0,Z.jsx)(we,{draftIndex:-1,rule:{command:n.command,key:``,when:void 0},context:r,isMac:i,isPrimary:!0,isPlaceholder:!0,onAddPlaceholder:()=>r.onAddBinding(n.command)},`placeholder`):o.map((e,t)=>{let{index:n,rule:a}=e;return(0,Z.jsx)(we,{draftIndex:n,rule:a,context:r,isMac:i,isPrimary:t===0,isPlaceholder:a.key.length===0},`${n}-${a.__id}`)}),b;t[25]!==r||t[26]!==n.command||t[27]!==n.title||t[28]!==o?(b=o.length>0?(0,Z.jsxs)(T,{children:[(0,Z.jsx)(C,{render:(0,Z.jsx)(`button`,{type:`button`,onClick:()=>r.onAddBinding(n.command),className:`inline-flex size-6 items-center justify-center rounded-md border border-dashed border-border/60 text-muted-foreground/60 transition-colors hover:border-border hover:text-foreground`,"aria-label":`Add another shortcut for ${n.title}`,children:(0,Z.jsx)(h,{className:`size-3.5`})})}),(0,Z.jsx)(w,{side:`top`,children:`Add another shortcut`})]}):null,t[25]=r,t[26]=n.command,t[27]=n.title,t[28]=o,t[29]=b):b=t[29];let x;t[30]!==r||t[31]!==n.command||t[32]!==n.status||t[33]!==n.title?(x=n.status!=="default"&&Q.has(n.command)?(0,Z.jsxs)(T,{children:[(0,Z.jsx)(C,{render:(0,Z.jsx)(`button`,{type:`button`,onClick:()=>r.onResetCommand(n.command),className:`inline-flex size-6 items-center justify-center rounded-md text-muted-foreground/50 transition-colors hover:text-foreground`,"aria-label":`Reset ${n.title} to default`,children:(0,Z.jsx)(v,{className:`size-3.5`})})}),(0,Z.jsx)(w,{side:`top`,children:`Reset to default`})]}):null,t[30]=r,t[31]=n.command,t[32]=n.status,t[33]=n.title,t[34]=x):x=t[34];let E;t[35]!==y||t[36]!==b||t[37]!==x?(E=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1.5`,children:[y,b,x]}),t[35]=y,t[36]=b,t[37]=x,t[38]=E):E=t[38];let D;t[39]!==_||t[40]!==E?(D=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[_,E]}),t[39]=_,t[40]=E,t[41]=D):D=t[41],a=(0,Z.jsxs)(`div`,{"data-keybinding-command":l,ref:u,className:d,children:[D,c.length>0?(0,Z.jsxs)(`div`,{className:`animate-in fade-in slide-in-from-top-1 flex flex-col gap-1 rounded-md border border-destructive/30 bg-destructive/10 px-2.5 py-1.5 text-[11px] text-destructive-foreground/90`,children:[c.map(e=>(0,Z.jsx)(Ce,{conflict:e,isMac:i,platform:r.platform,onSelect:()=>r.scrollToCommand(e.otherCommand)},`${e.key}-${e.otherCommand}`)),s.length>c.length?(0,Z.jsxs)(`span`,{className:`opacity-70`,children:[`+ `,s.length-c.length,` more`]}):null]}):null]}),t[0]=r,t[1]=i,t[2]=n.command,t[3]=n.indicesInDraft,t[4]=n.status,t[5]=n.title,t[6]=a}else a=t[6];return a});function Se(e){let t=(0,R.c)(5),{status:n}=e;if(n==="default")return null;let r=n===`modified`?`bg-amber-500/15 text-amber-300`:`bg-indigo-500/15 text-indigo-300`,i;t[0]===r?i=t[1]:(i=S(`rounded px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-[0.06em]`,r),t[0]=r,t[1]=i);let a=n===`modified`?`Modified`:`Custom`,o;return t[2]!==i||t[3]!==a?(o=(0,Z.jsx)(`span`,{className:i,children:a}),t[2]=i,t[3]=a,t[4]=o):o=t[4],o}function Ce(e){let t=(0,R.c)(27),{conflict:n,platform:r,isMac:i,onSelect:a}=e,o;t[0]===n.otherCommand?o=t[1]:(o=H(n.otherCommand),t[0]=n.otherCommand,t[1]=o);let s=o,c,l,u,d;if(t[2]!==n.key||t[3]!==i||t[4]!==r){let e=je(n.key),a=e?le(e,{platform:r}):[n.key];u=`flex flex-wrap items-center gap-1.5`,t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(_,{className:`size-3 shrink-0 text-destructive`}),t[9]=d):d=t[9],c=`inline-flex items-center gap-0.5 font-mono`;let o;t[10]===i?o=t[11]:(o=e=>(0,Z.jsx)(De,{token:e,isMac:i},e),t[10]=i,t[11]=o),l=a.map(o),t[2]=n.key,t[3]=i,t[4]=r,t[5]=c,t[6]=l,t[7]=u,t[8]=d}else c=t[5],l=t[6],u=t[7],d=t[8];let f;t[12]!==c||t[13]!==l?(f=(0,Z.jsx)(`span`,{className:c,children:l}),t[12]=c,t[13]=l,t[14]=f):f=t[14];let p;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`span`,{children:`also bound to`}),t[15]=p):p=t[15];let m;t[16]!==s.title||t[17]!==a?(m=(0,Z.jsx)(`button`,{type:`button`,onClick:a,className:`rounded bg-destructive/20 px-1.5 py-0.5 font-medium text-destructive-foreground hover:bg-destructive/30`,children:s.title}),t[16]=s.title,t[17]=a,t[18]=m):m=t[18];let h;t[19]===n.otherWhen?h=t[20]:(h=n.otherWhen===void 0?null:(0,Z.jsxs)(`span`,{className:`opacity-70`,children:[`when `,(0,Z.jsx)(`code`,{className:`font-mono`,children:q(n.otherWhen)})]}),t[19]=n.otherWhen,t[20]=h);let g;return t[21]!==u||t[22]!==d||t[23]!==f||t[24]!==m||t[25]!==h?(g=(0,Z.jsxs)(`div`,{className:u,children:[d,f,p,m,h]}),t[21]=u,t[22]=d,t[23]=f,t[24]=m,t[25]=h,t[26]=g):g=t[26],g}function we(e){let t=(0,R.c)(59),{draftIndex:n,rule:r,context:i,isMac:a,isPlaceholder:o,onAddPlaceholder:s}=e,[c,l]=(0,L.useState)(!1),[u,d]=(0,L.useState)(!1),f=(0,L.useRef)(null),p;bb0:{if(r.key.length===0){p=null;break bb0}let e;t[0]===r.key?e=t[1]:(e=je(r.key),t[0]=r.key,t[1]=e),p=e}let m=p,g=m?le(m,{platform:i.platform}):[],_;t[2]!==n||t[3]!==o||t[4]!==s?(_=()=>{if(o&&n===-1&&s){s(),setTimeout(Te,50);return}l(!0)},t[2]=n,t[3]=o,t[4]=s,t[5]=_):_=t[5];let v=_,b,x;t[6]!==i||t[7]!==n||t[8]!==c?(b=()=>{if(!c)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`&&!Ae(e)){l(!1);return}if(e.key===`Tab`&&!Ae(e)){l(!1);return}if(e.key===`Backspace`&&!Ae(e)){n>=0&&i.onRemoveBinding(n),l(!1);return}let t=oe(e,{platform:i.platform});t&&(n>=0&&i.onRebind(n,t),d(!0),l(!1),setTimeout(()=>d(!1),220))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},x=[c,n,i],t[6]=i,t[7]=n,t[8]=c,t[9]=b,t[10]=x):(b=t[9],x=t[10]),(0,L.useEffect)(b,x);let C,w;t[11]===c?(C=t[12],w=t[13]):(C=()=>{c&&f.current?.focus()},w=[c],t[11]=c,t[12]=C,t[13]=w),(0,L.useEffect)(C,w);let T;t[14]!==c||t[15]!==v?(T=e=>{c||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v())},t[14]=c,t[15]=v,t[16]=T):T=t[16];let E=T,D;t[17]!==i||t[18]!==n?(D=()=>{n>=0&&i.onRemoveBinding(n)},t[17]=i,t[18]=n,t[19]=D):D=t[19];let O=D;if(o&&n===-1&&g.length===0){let e;t[20]===s?e=t[21]:(e=()=>s?.(),t[20]=s,t[21]=e);let n;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(h,{className:`size-3`}),t[22]=n):n=t[22];let r;return t[23]!==E||t[24]!==e?(r=(0,Z.jsxs)(`button`,{ref:f,type:`button`,onClick:e,onKeyDown:E,className:`inline-flex h-6 items-center gap-1 rounded-md border border-dashed border-border/60 bg-transparent px-2 text-[11px] text-muted-foreground/70 transition-colors hover:border-border hover:text-foreground`,children:[n,` No shortcut — click to set`]}),t[23]=E,t[24]=e,t[25]=r):r=t[25],r}let k=`Edit shortcut for ${r.command}`,A=g.length===0&&n>=0?`true`:void 0,j=c?`kb-chip-recording border-indigo-500/60 bg-indigo-500/15 text-indigo-100 shadow-[0_0_0_4px_rgba(99,102,241,0.18)]`:u?`border-emerald-500/50 bg-emerald-500/15 text-emerald-100`:`border-border bg-muted/60 text-foreground hover:bg-muted`,M;t[26]===j?M=t[27]:(M=S(`inline-flex h-6 items-center gap-1 rounded-md border px-2 font-mono text-[11px] transition-all duration-150`,j),t[26]=j,t[27]=M);let N;t[28]===c?N=t[29]:(N=c?{animation:`keybindings-pulse 1.4s ease-in-out infinite`}:{},t[28]=c,t[29]=N);let P=c?(0,Z.jsx)(`span`,{className:`text-[11px] tracking-[0.04em]`,children:`Press shortcut…`}):g.length===0?(0,Z.jsx)(`span`,{className:`text-muted-foreground/60`,children:`Click to set`}):g.map(e=>(0,Z.jsx)(De,{token:e,isMac:a},e)),F;t[30]!==c||t[31]!==r.when?(F=!c&&r.when!==void 0?(0,Z.jsx)(`span`,{className:`ml-1 hidden sm:inline`,children:`·`}):null,t[30]=c,t[31]=r.when,t[32]=F):F=t[32];let I;t[33]!==c||t[34]!==E||t[35]!==v||t[36]!==k||t[37]!==A||t[38]!==M||t[39]!==N||t[40]!==P||t[41]!==F?(I=(0,Z.jsxs)(`button`,{ref:f,type:`button`,"aria-pressed":c,"aria-label":k,"data-chip-pending-record":A,onClick:v,onKeyDown:E,className:M,style:N,children:[P,F]}),t[33]=c,t[34]=E,t[35]=v,t[36]=k,t[37]=A,t[38]=M,t[39]=N,t[40]=P,t[41]=F,t[42]=I):I=t[42];let z;t[43]!==i||t[44]!==n?(z=e=>i.onChangeWhen(n,e),t[43]=i,t[44]=n,t[45]=z):z=t[45];let B=n<0||c,V;t[46]!==r.when||t[47]!==z||t[48]!==B?(V=(0,Z.jsx)(Oe,{currentWhen:r.when,onChange:z,disabled:B}),t[46]=r.when,t[47]=z,t[48]=B,t[49]=V):V=t[49];let H;t[50]!==n||t[51]!==O||t[52]!==c?(H=n>=0&&!c?(0,Z.jsx)(`button`,{type:`button`,onClick:O,"aria-label":`Remove this shortcut`,className:`opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100`,children:(0,Z.jsx)(y,{className:`size-3 text-muted-foreground/60 hover:text-destructive`})}):null,t[50]=n,t[51]=O,t[52]=c,t[53]=H):H=t[53];let U;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(ke,{}),t[54]=U):U=t[54];let W;return t[55]!==I||t[56]!==V||t[57]!==H?(W=(0,Z.jsxs)(`span`,{className:`relative inline-flex items-center gap-1`,children:[I,V,H,U]}),t[55]=I,t[56]=V,t[57]=H,t[58]=W):W=t[58],W}function Te(){document.querySelectorAll(`[data-chip-pending-record="true"]`).forEach(Ee)}function Ee(e){e.click()}function De(e){let t=(0,R.c)(5),{token:n,isMac:r}=e,i=r&&n.length===1&&/[⌀-⏿←-⇿]/.test(n)?`bg-transparent`:`bg-foreground/10`,a;t[0]===i?a=t[1]:(a=S(`rounded px-1 leading-none`,i),t[0]=i,t[1]=a);let o;return t[2]!==a||t[3]!==n?(o=(0,Z.jsx)(`span`,{className:a,children:n}),t[2]=a,t[3]=n,t[4]=o):o=t[4],o}function Oe(e){let t=(0,R.c)(35),{currentWhen:n,onChange:r,disabled:i}=e,a;t[0]===n?a=t[1]:(a=K(n),t[0]=n,t[1]=a);let o=a,s,c,l,u,d,f,p;if(t[2]!==n||t[3]!==i){let e=q(n);c=A,s=j,l=`button`,u=i;let r=n===void 0&&`italic opacity-70`;t[11]===r?d=t[12]:(d=S(`inline-flex h-5 items-center gap-1 rounded bg-muted/40 px-1.5 text-[10px] text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50`,r),t[11]=r,t[12]=d),f=`When: ${e}`,p=n===void 0?`always`:e.toLowerCase(),t[2]=n,t[3]=i,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p}else s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10];let m;t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==p?(m=(0,Z.jsx)(`button`,{type:l,disabled:u,className:d,"aria-label":f,children:p}),t[13]=l,t[14]=u,t[15]=d,t[16]=f,t[17]=p,t[18]=m):m=t[18];let h;t[19]!==s||t[20]!==m?(h=(0,Z.jsx)(s,{render:m}),t[19]=s,t[20]=m,t[21]=h):h=t[21];let g;t[22]!==n||t[23]!==o?(g=!o&&n!==void 0?(0,Z.jsxs)(`div`,{className:`px-2 py-1.5 text-[10px] text-muted-foreground`,children:[`Current: `,(0,Z.jsx)(`code`,{className:`font-mono`,children:n})]}):null,t[22]=n,t[23]=o,t[24]=g):g=t[24];let _;t[25]!==n||t[26]!==r?(_=U.map(e=>(0,Z.jsxs)(M,{onClick:()=>r(e.value),className:S(`flex items-center justify-between text-[12px]`,e.value===n&&`font-semibold text-foreground`),children:[(0,Z.jsx)(`span`,{children:e.label}),e.value===void 0?(0,Z.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:`no condition`}):(0,Z.jsx)(`code`,{className:`text-[10px] font-mono text-muted-foreground/60`,children:e.value})]},e.id)),t[25]=n,t[26]=r,t[27]=_):_=t[27];let v;t[28]!==_||t[29]!==g?(v=(0,Z.jsxs)(k,{side:`bottom`,align:`end`,className:`min-w-[220px]`,children:[g,_]}),t[28]=_,t[29]=g,t[30]=v):v=t[30];let y;return t[31]!==c||t[32]!==v||t[33]!==h?(y=(0,Z.jsxs)(c,{children:[h,v]}),t[31]=c,t[32]=v,t[33]=h,t[34]=y):y=t[34],y}function ke(){let e=(0,R.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`style`,{children:`@keyframes keybindings-pulse {
2
- 0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15); }
3
- 50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.30); }
4
- }
5
- @media (prefers-reduced-motion: reduce) {
6
- .kb-chip-recording { animation: none !important; }
7
- }`}),e[0]=t):t=e[0],t}function Ae(e){return e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}function je(e){let t=e.toLowerCase().split(`+`),n=null,r=!1,i=!1,a=!1,o=!1,s=!1;for(let e of t)switch(e){case`cmd`:case`meta`:r=!0;break;case`ctrl`:case`control`:i=!0;break;case`alt`:case`option`:a=!0;break;case`shift`:o=!0;break;case`mod`:s=!0;break;default:if(n!==null)return null;n=e===`space`?` `:e}return n===null?null:{key:n,metaKey:r,ctrlKey:i,altKey:a,shiftKey:o,modKey:s}}export{be as KeybindingsSettingsPanel};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./compiler-runtime-qmuS0Svy.js";import{_ as r,g as i,h as a,v as o,y as s}from"./env-B4arEvJg.js";import{Ft as c,Ht as l,Jt as u,Lt as d,Rn as f,S as p,bn as m,pt as h,yn as g,zn as _,zt as v}from"./runtime-DfGHeCnR.js";import{a as y}from"./primary-OskAInOO.js";import{It as b,i as x}from"./composerDraftStore-CdJJZe42.js";import{G as ee,M as te,O as ne,W as re,n as S}from"./useHandleNewThread-Bvz-DKgn.js";import{m as C,n as w,r as ie,t as T}from"./ThreadStatusIndicators-CL0KGLlj.js";import{t as ae}from"./settingsDialogStore-ygYoScKe.js";import{i as E}from"./uiStateStore-B6pjzSjj.js";import{f as D}from"./useRenderElement-DchFnsR8.js";import{t as oe}from"./chevron-down-B7C6FKzM.js";import{t as se}from"./chevron-right-BWYGybX9.js";import{l as ce}from"./WorkItemsTab-BDAeQe4D.js";import{t as le}from"./folder-DtsQoI9_.js";import{t as O}from"./git-branch-BKr-Ij4u.js";import{n as ue}from"./HostedConnectionControls-BC4kVWTa.js";import{C as de,S as fe,a as k,b as pe,c as A,d as j,f as me,i as M,l as he,n as ge,o as N,r as _e,s as P,t as ve,u as F,x as ye,y as be}from"./sidebarProjectFolders-CGVDJ0ZT.js";import{t as xe}from"./plus-B2h-VEqh.js";import{t as I}from"./search-BGQsenCM.js";import{t as Se}from"./shallow-DWZCFNun.js";import{t as L}from"./utils-BofFIn5Y.js";import{i as R}from"./timestampFormat-8uPXS812.js";import{o as z}from"./sidebar-Dm6l2GA6.js";import{a as Ce,i as we,n as Te,o as Ee,s as De,t as Oe}from"./MobileSheet-CkeG6_SP.js";import{t as B}from"./GlassSurface-C3IIWMu9.js";import{t as V}from"./useLongPress-OGlhYKlH.js";import{i as ke,o as Ae,r as je,t as Me}from"./empty-DwzqNgCP.js";import{n as H,r as Ne,t as U}from"./usePhoneThreadActions-CAgIq9aZ.js";var W=D(`ellipsis-vertical`,[[`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`}]]),G=e(t(),1),Pe=n(),K=b();function Fe(e){let t=(0,Pe.c)(14),{label:n,actions:r,children:i,className:a}=e,o;t[0]===a?o=t[1]:(o=L(`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=L(B(`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(Ie),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 Ie(e){return(0,K.jsxs)(`button`,{type:`button`,"aria-label":e.label,"aria-pressed":e.pressed,disabled:e.disabled??!1,className:L(`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 q=new Map;function J(){let e=(0,Pe.c)(74),t=u(Se(c)),n=u(Se(d)),r=E(Qe),a=E(Ze),s=E(Xe),l=E(Ye),_=E(Je),v=f(qe),b=f(Ke),x=f(Ge),ee=y(),w=g(We),ie=m(Ue),T=ae(He),D=h(Ve),{handleNewThread:ce}=S(),[O,de]=(0,G.useState)(!1),fe;e[0]!==r||e[1]!==t?(fe=ne({items:t,preferredIds:r,getId:p}),e[0]=r,e[1]=t,e[2]=fe):fe=e[2];let k=fe,pe;e[3]!==k||e[4]!==x?(pe=ge({projects:k,settings:x}),e[3]=k,e[4]=x,e[5]=pe):pe=e[5];let A=pe,j;e[6]!==w||e[7]!==ie?(j=e=>{let t=ie[e],n=w[e];return t?.descriptor?.label??n?.label??null},e[6]=w,e[7]=ie,e[8]=j):j=e[8];let me;e[9]!==k||e[10]!==ee||e[11]!==x||e[12]!==j?(me=_e({projects:k,settings:x,primaryEnvironmentId:ee,resolveEnvironmentLabel:j}),e[9]=k,e[10]=ee,e[11]=x,e[12]=j,e[13]=me):me=e[13];let M=me,he;e[14]===M?he=e[15]:(he=new Map(M.map(Be)),e[14]=M,e[15]=he);let N=he,P;if(e[16]!==A||e[17]!==N||e[18]!==v||e[19]!==M||e[20]!==n){let t=M.map(ze),r;e[22]===A?r=e[23]:(r=e=>{let t=o(i(e.environmentId,e.projectId));return Object.assign({},e,{projectId:A.get(t)??t})},e[22]=A,e[23]=r);let a=n.filter(Re).map(r),s;e[24]===N?s=e[25]:(s=e=>{let t=N.get(e.id);return t?[t]:[]},e[24]=N,e[25]=s),P=re(t,a,v).flatMap(s),e[16]=A,e[17]=N,e[18]=v,e[19]=M,e[20]=n,e[21]=P}else P=e[21];let F=P,ye;e[26]!==s||e[27]!==a||e[28]!==l||e[29]!==v||e[30]!==F?(ye=ve({projects:F,projectFoldersById:a,projectFolderOrder:s,projectTreeOrder:l,projectSortOrder:v}),e[26]=s,e[27]=a,e[28]=l,e[29]=v,e[30]=F,e[31]=ye):ye=e[31];let be=ye,L;e[32]!==b||e[33]!==ce?(L=e=>{let t=e.memberProjects[0];t&&(de(!1),ce(i(t.environmentId,t.id),{envMode:te({defaultEnvMode:b})}))},e[32]=b,e[33]=ce,e[34]=L):L=e[34];let R=L,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)(ue,{})]}),e[35]=B):B=e[35];let V;e[36]!==be||e[37]!==_?(V=be.length===0?(0,K.jsx)(Me,{className:`flex-1`,children:(0,K.jsxs)(ke,{children:[(0,K.jsx)(Ae,{className:`text-base`,children:`No projects yet`}),(0,K.jsx)(je,{className:`mt-1 text-sm`,children:`Projects opened on this node appear here with their threads.`})]})}):be.map(e=>e.kind===`project`?(0,K.jsx)($e,{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)(oe,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}),(0,K.jsx)(le,{"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(Le):null]},e.itemId)),e[36]=be,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 Ne;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,K.jsx)(I,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[41]=Ne):Ne=e[41];let U;e[42]===D?U=e[43]:(U={id:`search`,label:`Search threads`,shortLabel:`Search`,icon:Ne,onSelect:()=>D(!0)},e[42]=D,e[43]=U);let W;e[44]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,K.jsx)(xe,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[44]=W):W=e[44];let Ie=F.length===0,q;e[45]!==F[0]||e[46]!==F.length||e[47]!==R?(q=()=>{if(F.length===1&&F[0]){R(F[0]);return}de(!0)},e[45]=F[0],e[46]=F.length,e[47]=R,e[48]=q):q=e[48];let J;e[49]!==Ie||e[50]!==q?(J={id:`new-thread`,label:`New thread`,icon:W,disabled:Ie,onSelect:q},e[49]=Ie,e[50]=q,e[51]=J):J=e[51];let et;e[52]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,K.jsx)(C,{"aria-hidden":!0,className:`size-4 shrink-0`}),e[52]=et):et=e[52];let Y;e[53]===T?Y=e[54]:(Y={id:`settings`,label:`Open settings`,shortLabel:`Settings`,icon:et,onSelect:()=>T()},e[53]=T,e[54]=Y);let X;e[55]!==U||e[56]!==J||e[57]!==Y?(X=(0,K.jsx)(Fe,{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)(we,{children:[(0,K.jsx)(Ee,{children:`New thread`}),(0,K.jsx)(Te,{children:`Choose a project for the new thread.`})]}),e[59]=tt):tt=e[59];let Z;if(e[60]!==F||e[61]!==R){let t;e[63]===R?t=e[64]:(t=e=>(0,K.jsx)(De,{label:e.displayName,onClick:()=>R(e)},e.projectKey),e[63]=R,e[64]=t),Z=F.map(t),e[60]=F,e[61]=R,e[62]=Z}else Z=e[62];let Q;e[65]===Z?Q=e[66]:(Q=(0,K.jsx)(Ce,{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]!==O||e[68]!==Q?($=(0,K.jsxs)(Oe,{open:O,onOpenChange:de,label:`New thread`,children:[tt,Q]}),e[67]=O,e[68]=Q,e[69]=$):$=e[69];let nt;return e[70]!==H||e[71]!==X||e[72]!==$?(nt=(0,K.jsxs)(z,{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 Le(e){return(0,K.jsx)($e,{project:e,nested:!0},e.projectKey)}function Re(e){return e.archivedAt===null}function ze(e){return Object.assign({},e,{id:e.projectKey})}function Be(e){return[e.projectKey,e]}function Ve(e){return e.setOpen}function He(e){return e.openSettings}function Ue(e){return e.byId}function We(e){return e.byId}function Ge(e){return{sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides}}function Ke(e){return e.defaultThreadEnvMode}function qe(e){return e.sidebarProjectSortOrder}function Je(e){return e.setProjectFolderExpanded}function Ye(e){return e.projectTreeOrder}function Xe(e){return e.projectFolderOrder}function Ze(e){return e.projectFoldersById}function Qe(e){return e.projectOrder}function $e({project:e,nested:t=!1}){let n=u(Se((0,G.useMemo)(()=>t=>v(t,e.memberProjectRefs),[e.memberProjectRefs]))),c=x((0,G.useMemo)(()=>ye(e),[e])),d=f(e=>e.sidebarThreadSortOrder),p=E(e=>e.pinnedThreadKeys),m=E(t=>t.projectExpandedById[e.projectKey]??!0),h=E(e=>e.toggleProject),g=(0,G.useMemo)(()=>new Set(Object.entries(p).flatMap(([e,t])=>t?[e]:[])),[p]),y=(0,G.useMemo)(()=>fe(n,c).filter(e=>e.archivedAt===null),[c,n]),b=(0,G.useMemo)(()=>ee({threads:y,sortOrder:d,pinnedThreadKeys:g,getThreadKey:e=>s(r(e.environmentId,e.id))}),[g,d,y]),te=(0,G.useMemo)(()=>new Map(b.map(e=>[s(r(e.environmentId,e.id)),e])),[b]),ne=(0,G.useRef)(te);ne.current=te;let re=(0,G.useMemo)(()=>new Map(e.memberProjects.map(e=>[o(i(e.environmentId,e.id)),e])),[e.memberProjects]),S=U({sidebarThreadByKeyRef:ne,memberProjectByScopedKey:re,projectCwd:e.cwd??null}),[C,w]=(0,G.useState)(null),T=C?te.get(C)??null:null,ae=S.renamingThreadKey?te.get(S.renamingThreadKey)??null:null,D=u(Se((0,G.useMemo)(()=>t=>l(t,e.memberProjectRefs),[e.memberProjectRefs]))),le=(0,G.useMemo)(()=>pe({project:e,threads:b,worktrees:D}),[e,b,D]),O=be({projects:[le.project],threads:le.threads,worktrees:le.worktrees}).projects[0]??null,ue=O&&O.isGitRepo&&O.worktrees.length>1?O.worktrees:null,{updateSettings:de}=_(),ge=f(e=>({sidebarProjectGroupingMode:e.sidebarProjectGroupingMode,sidebarProjectGroupingOverrides:e.sidebarProjectGroupingOverrides})),{copyPathToClipboard:_e}=ce(),[ve,xe]=(0,G.useState)(!1),I=M(),R=k(),z=N({projectGroupingSettings:ge,updateSettings:de}),Ce=(0,G.useMemo)(()=>{let t=new Map(e.memberProjects.map(e=>[e.physicalProjectKey,0]));for(let e of n){let n=re.get(o(i(e.environmentId,e.projectId)));n&&t.set(n.physicalProjectKey,(t.get(n.physicalProjectKey)??0)+1)}return t},[re,e.memberProjects,n]),{openProjectRemoteLink:we,openProjectJiraLink:Te,handleRemoveProject:Ee}=me({memberThreadCountByPhysicalKey:Ce,jiraProjectOpenUrlByProjectKey:q}),De=(0,G.useRef)(!1),Oe=(0,G.useCallback)(()=>{xe(!0)},[]),{openProjectMenu:B}=j({project:e,jiraProjectOpenUrlByProjectKey:q,suppressProjectClickForContextMenuRef:De,onOpenOverview:Oe,openProjectSettingsDialog:I.openProjectSettingsDialog,openProjectRemoteLink:we,openProjectJiraLink:Te,openProjectRenameDialog:R.openProjectRenameDialog,openProjectGroupingDialog:z.openProjectGroupingDialog,copyPathToClipboard:_e,handleRemoveProject:Ee}),ke=V(e=>B(e)),Ae=e=>{let t=s(r(e.environmentId,e.id));return(0,K.jsx)(X,{thread:e,pinned:g.has(t),onOpen:()=>{let t=r(e.environmentId,e.id);if(e.draftId){S.navigateToDraft(e.draftId,t);return}S.navigateToThread(t)},onMenu:()=>w(t)},t)};return(0,K.jsxs)(`section`,{"aria-label":e.displayName,className:L(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":m,onClick:()=>h(e.projectKey),...ke,children:[m?(0,K.jsx)(oe,{"aria-hidden":!0,className:`size-4 shrink-0 text-muted-foreground`}):(0,K.jsx)(se,{"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=>B({x:e.clientX,y:e.clientY}),children:(0,K.jsx)(W,{"aria-hidden":!0,className:`size-4`})})]}),m?ue?(0,K.jsx)(`div`,{className:`pl-3`,children:ue.map(e=>(0,K.jsx)(et,{worktreeNode:e,renderThreadRow:Ae},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=>Ae(e))}):null,(0,K.jsx)(H,{open:T!==null,onOpenChange:e=>{e||w(null)},title:T?.title??`Thread`,items:C?S.listThreadMenuActions(C):[],leadingSections:T?(0,K.jsx)(ie,{thread:T}):void 0,onAction:e=>{let t=C?a(C):null;w(null),t&&S.performThreadMenuAction(t,e)}}),(0,K.jsx)(Ne,{renamingThreadKey:S.renamingThreadKey,originalTitle:ae?.title??``,renamingTitle:S.renamingTitle,setRenamingTitle:S.setRenamingTitle,commitRename:S.commitRename,cancelRename:S.cancelRename}),(0,K.jsx)(F,{open:ve,projectName:e.displayName,memberProjects:e.memberProjects,initialTab:`overview`,onOpenChange:xe}),(0,K.jsx)(he,{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)(P,{target:R.projectRenameTarget,title:R.projectRenameTitle,onTitleChange:R.setProjectRenameTitle,onClose:R.closeProjectRenameDialog,onSubmit:()=>void R.submitProjectRename()}),(0,K.jsx)(A,{target:z.projectGroupingTarget,selection:z.projectGroupingSelection,globalGroupingMode:ge.sidebarProjectGroupingMode,onSelectionChange:z.setProjectGroupingSelection,onClose:z.closeProjectGroupingDialog,onSave:z.saveProjectGroupingPreference})]})}function et(e){let t=(0,Pe.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(Y),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)(se,{"aria-hidden":!0,className:`size-4 shrink-0`}):(0,K.jsx)(oe,{"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)(O,{"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 Y(e){return!e}function X(e){let t=(0,Pe.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=V(s),l;t[2]===r?l=t[3]:(l=r?(0,K.jsx)(de,{"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)(T,{thread:n,alwaysShowStatusLabel:!0}),(0,K.jsx)(w,{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:R(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)(W,{"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{J as PhoneHome};
@@ -1 +0,0 @@
1
- import{i as e,t}from"./react-SIfiwpqq.js";import{t as n}from"./index-Bntnmu6O.js";import{t as r}from"./compiler-runtime-qmuS0Svy.js";import{n as i}from"./env-B4arEvJg.js";import{N as a}from"./runtime-DfGHeCnR.js";import{It as o}from"./composerDraftStore-CdJJZe42.js";import{t as s}from"./settingsDialogStore-ygYoScKe.js";import{t as c}from"./activity-1CkdQG5u.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./SettingsPanels-D8Xy3pPC.js";import{m as h,p as g}from"./desktopUpdateAtoms-B9iJXSdW.js";import{t as _}from"./arrow-left-Dtj9PfsA.js";import{t as v}from"./chart-column-Dw6ACmXM.js";import{n as y}from"./loader-circle-CrtHFAvM.js";import{t as b}from"./chevron-down-B7C6FKzM.js";import{t as ee}from"./chevron-right-BWYGybX9.js";import{t as x}from"./git-branch-BKr-Ij4u.js";import{t as S}from"./keyboard-BqeRMHfL.js";import{t as C}from"./palette-BSD_aJZg.js";import{t as w}from"./settings-2-CZQg_KUQ.js";import{t as T}from"./server-JApJpgLa.js";import{t as E}from"./shield-IZEIJ8r7.js";import{t as te}from"./sparkles-CAf3oJ5S.js";import{t as D}from"./user-round-Cpzx8pSw.js";import{t as O}from"./x-C1Cemsov.js";import{t as k}from"./scroll-area-Drsa8bNB.js";import{t as A}from"./button-BAbJxRzt.js";import{o as ne,t as re}from"./sheet-BO78gIKZ.js";import{a as j,i as M,n as N,o as P,s as F,t as I}from"./MobileSheet-CkeG6_SP.js";import{l as L,m as ie,o as R,p as z,r as B,s as V,x as H}from"./appearancePreferences-COvj0WMT.js";import{n as ae,o as oe}from"./settingsSections.logic-F8RXVmAq.js";import{n as se,t as ce}from"./useAppearancePreference-BlLlxQl7.js";var U=r(),W=e(t(),1),G=o(),K=`System reduce transparency is on, showing ${z.find(e=>e.value==="default")?.label??`Solid`}`,q=[{key:`surfaceTransparency`,label:`Material`,description:`How much of the content behind a surface shows through.`,options:L,scale:z},{key:`fontSizeBase`,label:`Text size`,description:`The base type size for the whole interface.`,options:R,scale:R},{key:`dockDensity`,label:`Dock density`,description:`How much padding the dock capsule carries around its controls.`,options:B,scale:B},{key:`motion`,label:`Motion`,description:`Reduce sheet and stack animation beyond the system setting.`,options:V,scale:V}];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(),c=n.key===`surfaceTransparency`&&s?K:null,l;t[1]!==n.options||t[2]!==o?(l=n.options.find(e=>e.value===o)??null,t[1]=n.options,t[2]=o,t[3]=l):l=t[3];let u=l,d;t[4]!==n.scale||t[5]!==u||t[6]!==o?(d=u??n.scale.find(e=>e.value===o)??null,t[4]=n.scale,t[5]=u,t[6]=o,t[7]=d):d=t[7];let f=d,p=u!==null,m;t[8]===n.key?m=t[9]:(m=e=>{H(n.key,e),ie(),i(!1)},t[8]=n.key,t[9]=m);let h=m,g=c&&f?`${f.label} · ${c}`:f?.label??null,_,v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,G.jsx)(ee,{"aria-hidden":!0,className:`size-4 text-muted-foreground/60`}),v=()=>i(!0),t[10]=_,t[11]=v):(_=t[10],v=t[11]);let b;t[12]!==n.label||t[13]!==g?(b=(0,G.jsx)(F,{label:n.label,secondaryText:g,trailing:_,onClick:v}),t[12]=n.label,t[13]=g,t[14]=b):b=t[14];let x=n.label,S;t[15]===n.label?S=t[16]:(S=(0,G.jsx)(P,{children:n.label}),t[15]=n.label,t[16]=S);let C=!p&&f?` Currently ${f.label}.`:null,w=c?` ${c}.`:null,T;t[17]!==n.description||t[18]!==C||t[19]!==w?(T=(0,G.jsxs)(N,{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)(M,{children:[S,T]}),t[21]=S,t[22]=T,t[23]=E):E=t[23];let te=n.label,D;if(t[24]!==n.options||t[25]!==h||t[26]!==o){let e;t[28]!==h||t[29]!==o?(e=e=>(0,G.jsx)(F,{label:e.label,secondaryText:e.description,selected:e.value===o,trailing:e.value===o?(0,G.jsx)(y,{"aria-hidden":!0,className:`size-4`}):null,onClick:()=>h(e.value)},e.value),t[28]=h,t[29]=o,t[30]=e):e=t[30],D=n.options.map(e),t[24]=n.options,t[25]=h,t[26]=o,t[27]=D}else D=t[27];let O;t[31]!==n.label||t[32]!==D?(O=(0,G.jsx)(j,{children:(0,G.jsx)(`div`,{role:`group`,"aria-label":te,className:`flex flex-col`,children:D})}),t[31]=n.label,t[32]=D,t[33]=O):O=t[33];let k;t[34]!==n.label||t[35]!==r||t[36]!==E||t[37]!==O?(k=(0,G.jsxs)(I,{open:r,onOpenChange:i,label:x,detent:`medium`,children:[E,O]}),t[34]=n.label,t[35]=r,t[36]=E,t[37]=O,t[38]=k):k=t[38];let A;return t[39]!==k||t[40]!==b?(A=(0,G.jsxs)(G.Fragment,{children:[b,k]}),t[39]=k,t[40]=b,t[41]=A):A=t[41],A}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:D},{id:`general`,label:`General`,icon:w},{id:`inbox`,label:`Inbox`,icon:te},{id:`providers`,label:`Providers`,icon:f},{id:`opinionated-plugins`,label:`Plugins`,icon:u},{id:`mcp-servers`,label:`MCP Servers`,icon:T},{id:`appearance`,label:`Appearance`,icon:C},{id:`keybindings`,label:`Keybindings`,icon:S},{id:`source-control`,label:`Source Control`,icon:x},{id:`connections`,label:`Connections`,icon:l},{id:`security`,label:`Security`,icon:E},{id:`statistics`,label:`Statistics`,icon:v},{id:`archived`,label:`Archive`,icon:h}],pe=[{id:`diagnostics`,label:`Diagnostics`,icon:c}],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-C3v2klAG.js`).then(e=>({default:e.AccountSettingsPanel})),[])),ge=(0,W.lazy)(()=>n(()=>import(`./ProvidersSettingsPanel-C3aPyCrN.js`).then(e=>({default:e.ProvidersSettingsPanel})),[])),X=(0,W.lazy)(()=>n(()=>import(`./AiFocusSettings-BquKjnWf.js`).then(e=>({default:e.AiFocusSettings})),[])),_e=(0,W.lazy)(()=>n(()=>import(`./OpinionatedPluginsSettings-BSy3F4v6.js`).then(e=>({default:e.OpinionatedPluginsSettingsPanel})),[])),ve=(0,W.lazy)(()=>n(()=>import(`./McpServersSettings-UthT1T80.js`).then(e=>({default:e.McpServersSettings})),[])),Z=(0,W.lazy)(()=>n(()=>import(`./AppearanceSettings-CYbSApl4.js`).then(e=>({default:e.AppearanceSettingsPanel})),[])),ye=(0,W.lazy)(()=>n(()=>import(`./KeybindingsSettings-BfkONqmZ.js`).then(e=>({default:e.KeybindingsSettingsPanel})),[])),be=(0,W.lazy)(()=>n(()=>import(`./SourceControlSettings-KIx9EfEZ.js`).then(e=>({default:e.SourceControlSettingsPanel})),[])),xe=(0,W.lazy)(()=>n(()=>import(`./ConnectionsSettings-Ccn8q4fG.js`).then(e=>({default:e.ConnectionsSettings})),[])),Q=(0,W.lazy)(()=>n(()=>import(`./NodeSecuritySettings-DPqjRphc.js`).then(e=>({default:e.NodeSecuritySettings})),[])),$=(0,W.lazy)(()=>n(()=>import(`./DiagnosticsSettings-QXpjXOrH.js`).then(e=>({default:e.DiagnosticsSettings})),[])),Se=(0,W.lazy)(()=>n(()=>import(`./StatisticsPanel-6sINT28-.js`).then(e=>({default:e.StatisticsPanel})),[]));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)(d,{}):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 f;t[15]===n?f=t[16]:(f=n===`keybindings`?(0,G.jsx)(ye,{}):null,t[15]=n,t[16]=f);let p;t[17]===n?p=t[18]:(p=n===`source-control`?(0,G.jsx)(be,{}):null,t[17]=n,t[18]=p);let h;t[19]===n?h=t[20]:(h=n===`connections`?(0,G.jsx)(xe,{}):null,t[19]=n,t[20]=h);let g;t[21]===n?g=t[22]:(g=n===`security`?(0,G.jsx)(Q,{}):null,t[21]=n,t[22]=g);let _;t[23]===n?_=t[24]:(_=n===`diagnostics`?(0,G.jsx)($,{presentation:`phone-legacy`}):null,t[23]=n,t[24]=_);let v;t[25]===n?v=t[26]:(v=n===`statistics`?(0,G.jsx)(Se,{}):null,t[25]=n,t[26]=v);let y;t[27]===n?y=t[28]:(y=n===`archived`?(0,G.jsx)(m,{}):null,t[27]=n,t[28]=y);let b;return t[29]!==p||t[30]!==h||t[31]!==g||t[32]!==_||t[33]!==v||t[34]!==y||t[35]!==i||t[36]!==a||t[37]!==o||t[38]!==s||t[39]!==c||t[40]!==l||t[41]!==u||t[42]!==f?(b=(0,G.jsxs)(W.Suspense,{fallback:r,children:[i,a,o,s,c,l,u,f,p,h,g,_,v,y]}),t[29]=p,t[30]=h,t[31]=g,t[32]=_,t[33]=v,t[34]=y,t[35]=i,t[36]=a,t[37]=o,t[38]=s,t[39]=c,t[40]=l,t[41]=u,t[42]=f,t[43]=b):b=t[43],b}function we(e){let t=(0,U.c)(6),{onRestored:n}=e,{changedSettingLabels:r,restoreDefaults:i}=p(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)(g,{className:`size-3.5`}),t[2]=s):s=t[2];let c;return t[3]!==a||t[4]!==o?(c=(0,G.jsxs)(A,{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),r=s(Ne),o=s(Me),c=a(je),l=a(Ae),u=a(ke),d;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=i(),e[0]=d):d=e[0];let f=d,p;e[1]!==l||e[2]!==c||e[3]!==u?(p=ae(c,l,u),e[1]=l,e[2]=c,e[3]=u,e[4]=p):p=e[4];let m=p,h;e[5]===m?h=e[6]:(h=e=>oe(e,{hosted:f,role:m}),e[5]=m,e[6]=h);let g=h,v;e[7]===g?v=e[8]:(v=e=>g(e.id),e[7]=g,e[8]=v);let y=fe.filter(v),x;e[9]===g?x=e[10]:(x=e=>g(e.id),e[9]=g,e[10]=x);let S=pe.filter(x),[C,w]=(0,W.useState)(null),[T,E]=(0,W.useState)(!1),[te,D]=(0,W.useState)(!1);t!==te&&(D(t),t&&(w(n===J?null:n),E(!1)));let j=(0,W.useRef)(n),M,N;e[11]!==t||e[12]!==n?(M=()=>{let e=j.current;j.current=n,t&&n!==e&&w(n)},N=[t,n],e[11]=t,e[12]=n,e[13]=M,e[14]=N):(M=e[13],N=e[14]),(0,W.useEffect)(M,N);let P,F;e[15]!==t||e[16]!==o?(P=()=>{t||s.getState().section!==J&&(o(J),j.current=J)},F=[t,o],e[15]=t,e[16]=o,e[17]=P,e[18]=F):(P=e[17],F=e[18]),(0,W.useEffect)(P,F);let I=(0,W.useRef)(null),L=(0,W.useRef)(new Map),ie=(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=>{o(e),w(e),B(()=>I.current)},ce=()=>{let e=ie.current;w(null),j.current=J,o(J),B(()=>e?L.current.get(e)??null:null)},K;e[22]===C?K=e[23]:(K=[C],e[22]=C,e[23]=K),(0,W.useEffect)(()=>{C!==null&&(ie.current=C)},K);let q;e[24]!==t||e[25]!==C?(q=[t,C,B],e[24]=t,e[25]=C,e[26]=q):q=e[26],(0,W.useEffect)(()=>{t&&C!==null&&B(()=>I.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=C!==null&&g(C)?me.find(e=>e.id===C)??null:null,_e=e=>{let t=e.icon;return(0,G.jsxs)(`button`,{type:`button`,ref:t=>{t?L.current.set(e.id,t):L.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=re,Z;e[28]===r?Z=e[29]:(Z=e=>{e||r()},e[28]=r,e[29]=Z);let ye=ne,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)(A,{size:`icon`,variant:`ghost`,"aria-label":`Back to settings`,className:`shrink-0`,onClick:ce,children:(0,G.jsx)(_,{})}),(0,G.jsx)(`h1`,{ref:I,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)(k,{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)(A,{size:`icon`,variant:`ghost`,"aria-label":`Close settings`,className:`shrink-0`,onClick:r,children:(0,G.jsx)(O,{})})]}),(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:y.map(e=>_e(e))}),S.length>0?(0,G.jsxs)(`div`,{className:`mt-2 border-t border-border pt-2`,children:[(0,G.jsxs)(`button`,{type:`button`,"aria-expanded":T,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:()=>E(De),children:[T?(0,G.jsx)(b,{"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`})]}),T?(0,G.jsx)(`div`,{role:`group`,"aria-label":`Advanced sections`,className:`space-y-0.5`,children:S.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};