ryco-cli 0.1.30 → 0.1.31

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 (493) hide show
  1. package/dist/{AcpAdapter-DjP0IHpH.cjs → AcpAdapter-ByUp9-wk.cjs} +71 -51
  2. package/dist/{AcpAdapter-CKWzfB3Q.mjs → AcpAdapter-CY_ANTKu.mjs} +73 -53
  3. package/dist/{AcpNativeLogging-Do0LktDb.mjs → AcpNativeLogging-C7PC6imv.mjs} +30 -4
  4. package/dist/{AcpNativeLogging-5gTPK9Fq.cjs → AcpNativeLogging-OQeAya9d.cjs} +33 -1
  5. package/dist/{AcpRegistryDriver-BblCFfev.cjs → AcpRegistryDriver-CD9GN7rI.cjs} +3 -3
  6. package/dist/{AcpRegistryDriver-BzohT-PC.mjs → AcpRegistryDriver-DMZ5VBWJ.mjs} +4 -4
  7. package/dist/AzureDevOpsSourceControlProvider-5giVYoNi.mjs +2053 -0
  8. package/dist/AzureDevOpsSourceControlProvider-BKMXEUaN.cjs +2055 -0
  9. package/dist/{BitbucketSourceControlProvider-D5UVAc9z.mjs → BitbucketSourceControlProvider-BVUBsEUF.mjs} +63 -23
  10. package/dist/{BitbucketSourceControlProvider-Bvl_q1o2.cjs → BitbucketSourceControlProvider-BWnnrbch.cjs} +62 -22
  11. package/dist/{BunPTY-Dcl1Lp62.mjs → BunPTY-CMbDQ1Xb.mjs} +1 -1
  12. package/dist/{ClaudeDriver-DZkz0QPr.cjs → ClaudeDriver-DCrqouOR.cjs} +1373 -191
  13. package/dist/{ClaudeDriver-BuQ_azDw.mjs → ClaudeDriver-DVOss8cC.mjs} +1375 -193
  14. package/dist/{CodexDriver-6Ph2cjAW.cjs → CodexDriver-CBQPHJqU.cjs} +258 -28
  15. package/dist/{CodexDriver-Bi49RIL4.mjs → CodexDriver-DJoTky7Z.mjs} +261 -31
  16. package/dist/{CodexTextGeneration-C5TIspJA.mjs → CodexTextGeneration-BSgNgfZv.mjs} +6 -6
  17. package/dist/{CodexTextGeneration-sXPR9eld.cjs → CodexTextGeneration-C9MDQmZm.cjs} +7 -7
  18. package/dist/{CopilotDriver-Bcdpz6U_.mjs → CopilotDriver-CUkdPXcH.mjs} +78 -20
  19. package/dist/{CopilotDriver-D6P0xgRX.cjs → CopilotDriver-DbaMDH16.cjs} +76 -18
  20. package/dist/{CursorDriver-CRnDGwEv.mjs → CursorDriver-B-ZilXJB.mjs} +114 -97
  21. package/dist/{CursorDriver-DMJ7sGSx.cjs → CursorDriver-DKQqPbKH.cjs} +114 -97
  22. package/dist/{ForgejoSourceControlProvider-D4jGdaJX.cjs → ForgejoSourceControlProvider-CgpjFECj.cjs} +94 -60
  23. package/dist/{ForgejoSourceControlProvider-Dl_Fk3RY.mjs → ForgejoSourceControlProvider-DemMYUye.mjs} +95 -61
  24. package/dist/{GitHubSourceControlProvider-QMe-zymI.cjs → GitHubSourceControlProvider-C4un6hOK.cjs} +218 -119
  25. package/dist/{GitHubSourceControlProvider-DnwKf0ap.mjs → GitHubSourceControlProvider-CRSDYcjc.mjs} +206 -108
  26. package/dist/GitLabSourceControlProvider-D8W1ZLPh.cjs +2260 -0
  27. package/dist/GitLabSourceControlProvider-DpWkJ0M3.mjs +2258 -0
  28. package/dist/{GrokDriver-jy8JIvYY.cjs → GrokDriver-BQ6G_7ZZ.cjs} +6 -7
  29. package/dist/{GrokDriver-Bvq1jP3S.mjs → GrokDriver-Buvas9-q.mjs} +5 -6
  30. package/dist/{Metrics-CnmjpbWk.mjs → Metrics-C3vLS9rz.mjs} +123 -13
  31. package/dist/{Metrics-C0LSU8s7.cjs → Metrics-DjRPLE98.cjs} +170 -12
  32. package/dist/{NodePTY-D7tFWuQe.mjs → NodePTY-DgnuBruq.mjs} +1 -1
  33. package/dist/{OpenCodeDriver-DhyVaBMT.mjs → OpenCodeDriver-BWEZD841.mjs} +183 -49
  34. package/dist/{OpenCodeDriver-Bu5D19tl.cjs → OpenCodeDriver-qUiX0RLH.cjs} +183 -49
  35. package/dist/{SideQuestionIsolation-B-aE6aBz.mjs → SideQuestionIsolation-B1T-DsR0.mjs} +1 -1
  36. package/dist/{SideQuestionIsolation-CtJ4wX83.cjs → SideQuestionIsolation-BPC-Bxsz.cjs} +1 -1
  37. package/dist/bin.cjs +37021 -10253
  38. package/dist/bin.mjs +36892 -10178
  39. package/dist/client/assets/AccountSettings-B88Q_w9Y.js +1 -0
  40. package/dist/client/assets/AiFocusSettings-Bb0TrCPn.js +1 -0
  41. package/dist/client/assets/{AnimatedHeight-UXn4-nUd.js → AnimatedHeight-epXOsgdm.js} +1 -1
  42. package/dist/client/assets/AppearanceSettings-XS9WRVPU.js +1 -0
  43. package/dist/client/assets/AutomationsDialog-bZckh4Y3.js +1 -0
  44. package/dist/client/assets/AutomationsSummary-wPFZCF49.js +1 -0
  45. package/dist/client/assets/BranchToolbar.logic-DjzLKbbB.js +3 -0
  46. package/dist/client/assets/BrowserPanel-CdBLnnfz.js +1 -0
  47. package/dist/client/assets/ChatRightPanel-BCINd0vP.js +34 -0
  48. package/dist/client/assets/ChatThreadRouteView-BFZ0Si-l.js +1 -0
  49. package/dist/client/assets/ColorSwatchPicker-CGyo99o0.js +1 -0
  50. package/dist/client/assets/CommandPalette.logic-BIOMtnEQ.js +1 -0
  51. package/dist/client/assets/CommandPaletteDialog-Db4LH--z.js +2 -0
  52. package/dist/client/assets/CompositeRoot-DtnwMJKj.js +1 -0
  53. package/dist/client/assets/ComputerUseSettings-CkqCqDsU.js +1 -0
  54. package/dist/client/assets/ConnectionsSettings-B9mxExdG.js +7 -0
  55. package/dist/client/assets/CreatePullRequestDialog-CJ7pNCue.js +1 -0
  56. package/dist/client/assets/CreatePullRequestDialogHost-n4ZjdSr4.js +1 -0
  57. package/dist/client/assets/DiagnosticsSettings-f9rFG9re.js +2 -0
  58. package/dist/client/assets/DiagnosticsSettings.logic-Byf-Bu4S.js +1 -0
  59. package/dist/client/assets/DialogHandle-C0c_rK3I.js +1 -0
  60. package/dist/client/assets/{DialogPopup-NfwDyR5c.js → DialogPopup-BKW1PEEa.js} +1 -1
  61. package/dist/client/assets/DialogRoot-BIubqrv0.js +1 -0
  62. package/dist/client/assets/DialogTitle-BAX_FLoG.js +1 -0
  63. package/dist/client/assets/{DialogViewport-B6w_ROOE.js → DialogViewport-C2iOUx0O.js} +1 -1
  64. package/dist/client/assets/DiffPanel-BkqDt_SS.js +25 -0
  65. package/dist/client/assets/DisclosureRegion-B8556yU0.js +1 -0
  66. package/dist/client/assets/DraftChatThreadRouteView-BKgRKJ2w.js +1 -0
  67. package/dist/client/assets/{ExternalIdentityWeb.logic-BlKX8J9h.js → ExternalIdentityWeb.logic-Cu6suNrN.js} +1 -1
  68. package/dist/client/assets/GlassSurface-DLYYzRdP.js +1 -0
  69. package/dist/client/assets/HostedConnectionControls-CoVqtnrK.js +1 -0
  70. package/dist/client/assets/HostedHubRoot-CM2CwPUr.js +2 -0
  71. package/dist/client/assets/{HostedNativeAuthorizationRoute-j7oSlakZ.js → HostedNativeAuthorizationRoute-Bizmqrh_.js} +2 -2
  72. package/dist/client/assets/HostedNodeRenameDialog-SXWMsTO0.js +1 -0
  73. package/dist/client/assets/HostedRelayTrustNotice-BfTyrBi5.js +1 -0
  74. package/dist/client/assets/InboxStatusGlyph-BPTqzp7l.js +1 -0
  75. package/dist/client/assets/IntegrationsSettingsPanel-DAPvkV4i.js +1 -0
  76. package/dist/client/assets/KeybindingsSettings-B8g-YI2O.js +1 -0
  77. package/dist/client/assets/LazyBrowserPanel-Ds9cdOC_.js +2 -0
  78. package/dist/client/assets/McpServersSettings-Dw6G3ff3.js +6 -0
  79. package/dist/client/assets/MobileSheet-DfgXNWbd.js +1 -0
  80. package/dist/client/assets/ModelTuningDial-DQBAbuNL.js +1 -0
  81. package/dist/client/assets/NewWorktreeDialog-CDZAJmK6.js +4 -0
  82. package/dist/client/assets/NodeSecuritySettings-3MELA9ru.js +1 -0
  83. package/dist/client/assets/NullStore-gT_6_xZE.js +1 -0
  84. package/dist/client/assets/OnboardingDialog-CAAtNnJf.js +1 -0
  85. package/dist/client/assets/OpinionatedPluginsSettings-AiDB0Vl4.js +1 -0
  86. package/dist/client/assets/{PdfAttachmentPreview-C8-hT8KQ.js → PdfAttachmentPreview-BFNW2wjN.js} +2 -2
  87. package/dist/client/assets/{PhoneGetAppInterstitial-Zh0zpBgT.js → PhoneGetAppInterstitial-D8fwZ8E9.js} +1 -1
  88. package/dist/client/assets/PhoneHome-YHgHljA0.js +1 -0
  89. package/dist/client/assets/PhoneSettingsSurface-BVxJppvK.js +2 -0
  90. package/dist/client/assets/PreviewPanel-BYcEnkv9.js +643 -0
  91. package/dist/client/assets/ProjectScriptDialog-K34K2Kzm.js +1 -0
  92. package/dist/client/assets/ProjectsPage-DXnMYLjb.js +1 -0
  93. package/dist/client/assets/PromoteChatDialog-CAY7_wJ-.js +1 -0
  94. package/dist/client/assets/ProviderLimitWindow-CK04BSkM.js +1 -0
  95. package/dist/client/assets/ProviderUpdateLaunchNotification.logic-BMBrDDOC.js +1 -0
  96. package/dist/client/assets/ProvidersSettingsPanel-C85PX9Es.js +1 -0
  97. package/dist/client/assets/PullRequestsPage-C0rgfGwB.js +1 -0
  98. package/dist/client/assets/{QuitShortcutFeedback-Qs9XsuZ4.js → QuitShortcutFeedback-DSkKqETs.js} +1 -1
  99. package/dist/client/assets/RedactedSensitiveText-DQ0YveQd.js +1 -0
  100. package/dist/client/assets/RollingText-BzvpP5fa.js +1 -0
  101. package/dist/client/assets/RootAppShell-BYQ-eGNT.js +6 -0
  102. package/dist/client/assets/{Separator-B6Esv57Y.js → Separator-DpiW19Vw.js} +1 -1
  103. package/dist/client/assets/SettingsPage-BCFN7Ju2.js +2 -0
  104. package/dist/client/assets/SettingsPanels-CP6z2b1x.js +3 -0
  105. package/dist/client/assets/SettingsPanels.editor-D8U-TWWG.js +1 -0
  106. package/dist/client/assets/SettingsSelect-DEhNaz3E.js +1 -0
  107. package/dist/client/assets/Sidebar.logic-D_ODfSpl.js +1 -0
  108. package/dist/client/assets/SimulatorPanel-DCT6fZ0X.js +1 -0
  109. package/dist/client/assets/SourceControlSettings-DxUtvPMK.js +1 -0
  110. package/dist/client/assets/StatisticsPage-C9SrwtM4.js +1 -0
  111. package/dist/client/assets/StatisticsPanel-BMYLETs0.js +1 -0
  112. package/dist/client/assets/ThreadLinkList-BN5z5EpS.js +169 -0
  113. package/dist/client/assets/ThreadTerminalDrawer-CgIFOlR-.js +18 -0
  114. package/dist/client/assets/ThreadWorkspacePanel-DvXoqQPF.js +3 -0
  115. package/dist/client/assets/ToolbarRootContext-8FsV9Cpj.js +1 -0
  116. package/dist/client/assets/TraitsPicker-DcrpJahy.js +1 -0
  117. package/dist/client/assets/Virtualizer-CwXeUPla.js +1345 -0
  118. package/dist/client/assets/WorkspacePullRequestPanel-3mlcJn9G.js +1 -0
  119. package/dist/client/assets/WorkspaceReview-UGbCgXeK.js +2 -0
  120. package/dist/client/assets/{abnfDiagram-N423BO3Z-ByEe3mC0.js → abnfDiagram-N423BO3Z-DVEM6Scc.js} +1 -1
  121. package/dist/client/assets/{activity-CwTUF6lv.js → activity-DVCuAejY.js} +1 -1
  122. package/dist/client/assets/{alert-DQEkrtUJ.js → alert-FV7ZIit_.js} +1 -1
  123. package/dist/client/assets/alert-dialog-CgXR9tED.js +1 -0
  124. package/dist/client/assets/app-window-3xtwqZgI.js +1 -0
  125. package/dist/client/assets/appChrome-COCz-T7w.js +1 -0
  126. package/dist/client/assets/{appearancePreferences-nFx4MHoI.js → appearancePreferences-NnsvXwBe.js} +1 -1
  127. package/dist/client/assets/architecture-7GRP2DOG-DXXb_0_g.js +1 -0
  128. package/dist/client/assets/{architectureDiagram-T3A2C74G-Bd-yxaTr.js → architectureDiagram-T3A2C74G-B6pcKiCj.js} +1 -1
  129. package/dist/client/assets/{arrow-left-DUOpzEbP.js → arrow-left-Blu3LSE2.js} +1 -1
  130. package/dist/client/assets/{arrow-right-HOYJnPKw.js → arrow-right-CO3CH0ne.js} +1 -1
  131. package/dist/client/assets/arrow-up-B69gV2Bq.js +1 -0
  132. package/dist/client/assets/{arrow-up-right-DHnMKuVA.js → arrow-up-right-BbPGFOLA.js} +1 -1
  133. package/dist/client/assets/authorization-Ob6YwWiI.js +1 -0
  134. package/dist/client/assets/autocomplete-RVpjsrDv.js +1 -0
  135. package/dist/client/assets/ban-BIm2PVkE.js +1 -0
  136. package/dist/client/assets/{blockDiagram-VBNYF7ZC-CPDBonMC.js → blockDiagram-VBNYF7ZC-WNerGp9V.js} +1 -1
  137. package/dist/client/assets/{bot-DxjPA7Bw.js → bot-C9nWtaWq.js} +1 -1
  138. package/dist/client/assets/browserState-jt47YsqD.js +1 -0
  139. package/dist/client/assets/{c4Diagram-5PPSVZJV-BM6pAiqT.js → c4Diagram-5PPSVZJV-wp1ioOoM.js} +1 -1
  140. package/dist/client/assets/camera-C13VoW3c.js +1 -0
  141. package/dist/client/assets/capabilities-CfOhq009.js +1 -0
  142. package/dist/client/assets/channel-56r2qL2v.js +1 -0
  143. package/dist/client/assets/{chart-column-Cg7d41tb.js → chart-column-DRv0YtL_.js} +1 -1
  144. package/dist/client/assets/checkbox-CIIIY9FA.js +1 -0
  145. package/dist/client/assets/checks-Dw022Bvy.js +1 -0
  146. package/dist/client/assets/{chunk-2GRJ4B5K-DVKozJ41.js → chunk-2GRJ4B5K-DRl3ILpc.js} +1 -1
  147. package/dist/client/assets/{chunk-4I5QYGJK-BRoMwPkW.js → chunk-4I5QYGJK-CYTRl4bo.js} +1 -1
  148. package/dist/client/assets/{chunk-5RXB4S5H-DFMKyoqP.js → chunk-5RXB4S5H-VCNwRsOa.js} +1 -1
  149. package/dist/client/assets/{chunk-6Q2QTUOP-Ba6UENe9.js → chunk-6Q2QTUOP-DnSeKGPG.js} +1 -1
  150. package/dist/client/assets/{chunk-7Z6QIM7H-B87gYLWH.js → chunk-7Z6QIM7H-Cjilh9TF.js} +1 -1
  151. package/dist/client/assets/{chunk-GF5L2VYU-DZ840GRQ.js → chunk-GF5L2VYU-CGR7AW0t.js} +1 -1
  152. package/dist/client/assets/{chunk-I66GZJ75-BO6p4Aqg.js → chunk-I66GZJ75-CXSn8dDu.js} +1 -1
  153. package/dist/client/assets/{chunk-JQJVKLGR-5dTfVinz.js → chunk-JQJVKLGR-Dro-75lU.js} +1 -1
  154. package/dist/client/assets/{chunk-KBJHAD2P-BeWfBZdP.js → chunk-KBJHAD2P-BDqN2kVf.js} +1 -1
  155. package/dist/client/assets/{chunk-NSK5VX7P-DuRkdn5k.js → chunk-NSK5VX7P-DGo5UczH.js} +1 -1
  156. package/dist/client/assets/{chunk-QR6OTTB3-Duz4Y_uE.js → chunk-QR6OTTB3-RWuyWnBI.js} +1 -1
  157. package/dist/client/assets/{chunk-UBXNYLIW-D-z8URgN.js → chunk-UBXNYLIW-BPRzeB0w.js} +1 -1
  158. package/dist/client/assets/{chunk-W5SLKNZC-AGjFjjoJ.js → chunk-W5SLKNZC-DYWocTFi.js} +1 -1
  159. package/dist/client/assets/{chunk-WRU74C26-BgY3UiXB.js → chunk-WRU74C26-ChbB1jY3.js} +1 -1
  160. package/dist/client/assets/circle-stop-D8B4hRpY.js +1 -0
  161. package/dist/client/assets/circle-x-CNLfrTqR.js +1 -0
  162. package/dist/client/assets/classDiagram-JCYQIIEL-DGvmFev3.js +1 -0
  163. package/dist/client/assets/classDiagram-v2-OCEON4UE-DGvmFev3.js +1 -0
  164. package/dist/client/assets/{clipboard-copy-BWf3JuTE.js → clipboard-copy-DGi8FKNO.js} +1 -1
  165. package/dist/client/assets/clock-3-DmJ4_XPI.js +1 -0
  166. package/dist/client/assets/clock-DZIuPtNG.js +1 -0
  167. package/dist/client/assets/color-picker-BdBXje-a.js +1 -0
  168. package/dist/client/assets/columns-2-CWlMOClK.js +1 -0
  169. package/dist/client/assets/combobox-Dtjtf7AB.js +1 -0
  170. package/dist/client/assets/{cynefin-OW5HDTMX-BuOAGqlK.js → cynefin-OW5HDTMX-TuShvMuM.js} +1 -1
  171. package/dist/client/assets/{cynefinDiagram-MW4NZA55-DqV0Aokp.js → cynefinDiagram-MW4NZA55-B0Edt2Em.js} +1 -1
  172. package/dist/client/assets/{dagre-VZM6K2ZE-D_GFquDW.js → dagre-VZM6K2ZE-D-eiuqHx.js} +1 -1
  173. package/dist/client/assets/{data-list-BJCq3CVP.js → data-list-BAx6jBY1.js} +1 -1
  174. package/dist/client/assets/desktopUpdateAtoms-BjrLa3tl.js +1 -0
  175. package/dist/client/assets/desktopWorkspace-C2wXVBhc.js +1 -0
  176. package/dist/client/assets/{deviceName-C2N8ZRX3.js → deviceName-B4youG0v.js} +1 -1
  177. package/dist/client/assets/{diagram-7IWD3JNH-B1wlsNg2.js → diagram-7IWD3JNH-DgM6lMlR.js} +1 -1
  178. package/dist/client/assets/{diagram-B4RE2ZJO-D-CYoym7.js → diagram-B4RE2ZJO-CyHNDjzV.js} +1 -1
  179. package/dist/client/assets/{diagram-LBJQPF4R-DqJ9NCqt.js → diagram-LBJQPF4R-DDzuLIN5.js} +1 -1
  180. package/dist/client/assets/{diagram-Q27KOJAE-3yp1D2u4.js → diagram-Q27KOJAE-BaBvK9QB.js} +1 -1
  181. package/dist/client/assets/{diagram-UB23O5K3-Byp25nGC.js → diagram-UB23O5K3-CzZ2ewuZ.js} +1 -1
  182. package/dist/client/assets/dialogWords-Cg0YkJVg.js +1 -0
  183. package/dist/client/assets/diffRouteSearch-D2MKN_ah.js +1 -0
  184. package/dist/client/assets/disclosureMotion-cbMJn5-z.js +1 -0
  185. package/dist/client/assets/{download-DsYNYJeu.js → download-TvtXS4hE.js} +1 -1
  186. package/dist/client/assets/{ebnfDiagram-BXEA7PRR-B_IM1l6o.js → ebnfDiagram-BXEA7PRR-CL1vdOKi.js} +1 -1
  187. package/dist/client/assets/editorPreferences-DqKyA-2Z.js +1 -0
  188. package/dist/client/assets/ellipsis-CDK1dNFZ.js +1 -0
  189. package/dist/client/assets/ellipsis-vertical-CwzEUTwV.js +1 -0
  190. package/dist/client/assets/{empty-BbJHvskr.js → empty-BovKoxbn.js} +1 -1
  191. package/dist/client/assets/{erDiagram-JOGREHBK--OtcrCRJ.js → erDiagram-JOGREHBK-DmQR2if6.js} +1 -1
  192. package/dist/client/assets/eventmodeling-NTZA5JFV-D272GIcY.js +1 -0
  193. package/dist/client/assets/external-link-CJeVJZ7s.js +1 -0
  194. package/dist/client/assets/eye-BUmrXqzg.js +1 -0
  195. package/dist/client/assets/file-diff-BWc3mYsz.js +1 -0
  196. package/dist/client/assets/flowDiagram-UKHOOZJN-DLyS38Mm.js +1 -0
  197. package/dist/client/assets/folder-git-2-CPxg5wKP.js +1 -0
  198. package/dist/client/assets/folder-open-DcMymvp1.js +1 -0
  199. package/dist/client/assets/formatCount-B4KLI651.js +1 -0
  200. package/dist/client/assets/{ganttDiagram-PKOTCBZU-w0seBi3Q.js → ganttDiagram-PKOTCBZU-1q2nUL92.js} +1 -1
  201. package/dist/client/assets/git-pull-request-BFPwpm3c.js +1 -0
  202. package/dist/client/assets/{gitGraph-4MIJSDKK-BOJ0lcSW.js → gitGraph-4MIJSDKK-COtwmv2S.js} +1 -1
  203. package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-BMfOCCYn.js → gitGraphDiagram-DS77QQ5N-ChsvaxX4.js} +1 -1
  204. package/dist/client/assets/{group-tVMKGp7Q.js → group-DWWn0dTx.js} +1 -1
  205. package/dist/client/assets/hammer-BXo-EU88.js +1 -0
  206. package/dist/client/assets/hostedConnectionCoordinator-BkAE-RhA.js +1 -0
  207. package/dist/client/assets/{index-BqZvnGNr.js → index-DARIYokI.js} +2 -2
  208. package/dist/client/assets/{info-A6RAGUB7-acjBTQ5o.js → info-A6RAGUB7-CI2qZ9wW.js} +1 -1
  209. package/dist/client/assets/{infoDiagram-6WML65LV-DB01Nc2m.js → infoDiagram-6WML65LV-BPmgcTPH.js} +1 -1
  210. package/dist/client/assets/{input-BDWSVClC.js → input-CCie4mm1.js} +1 -1
  211. package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-KhZTvm-J.js → ishikawaDiagram-WSZJBQD7-LyS9p3Yg.js} +1 -1
  212. package/dist/client/assets/{journeyDiagram-NVQOT4AX-C3JCYk-2.js → journeyDiagram-NVQOT4AX-BYaAmN65.js} +1 -1
  213. package/dist/client/assets/{kanban-definition-27J2QSJJ-Dbo0C1s6.js → kanban-definition-27J2QSJJ-D-pwzqFt.js} +1 -1
  214. package/dist/client/assets/{key-round-CETZqe3h.js → key-round-BlrUTfxB.js} +1 -1
  215. package/dist/client/assets/keyboard-DlBdq6sz.js +1 -0
  216. package/dist/client/assets/label-ChtVI9lp.js +1 -0
  217. package/dist/client/assets/layers-BB-ruGvd.js +1 -0
  218. package/dist/client/assets/lifecycleSuggestionPolicy-0ERe_O53.js +1 -0
  219. package/dist/client/assets/list-checks-BkM_ZRsj.js +1 -0
  220. package/dist/client/assets/loader-3vQnfqIT.js +1 -0
  221. package/dist/client/assets/{log-out-D5-aSBAz.js → log-out-CKq9YiLY.js} +1 -1
  222. package/dist/client/assets/{logging-B_qXVrk6.js → logging-CCg76rgn.js} +1 -1
  223. package/dist/client/assets/main-Ch0bwS-M.js +9 -0
  224. package/dist/client/assets/main-Di0isH9D.css +2 -0
  225. package/dist/client/assets/{mermaid-parser.core-B6Q-3x_q.js → mermaid-parser.core-RK9ah5RM.js} +2 -2
  226. package/dist/client/assets/{mermaidEngine-DksLcesB.js → mermaidEngine-Dr8UsPhH.js} +3 -3
  227. package/dist/client/assets/message-circle-dashed-BrjwqS7-.js +1 -0
  228. package/dist/client/assets/messageQueueDrain-B7R7Qmq6.js +1 -0
  229. package/dist/client/assets/messages-square-cDTkDJv_.js +1 -0
  230. package/dist/client/assets/{mindmap-definition-FAOFIHXS-LaMzRxqw.js → mindmap-definition-FAOFIHXS-DVudWasx.js} +1 -1
  231. package/dist/client/assets/{packet-AYTQ26CC-BHhg59Si.js → packet-AYTQ26CC-DnkTsVhD.js} +1 -1
  232. package/dist/client/assets/panels-top-left-B7jZiLth.js +1 -0
  233. package/dist/client/assets/path-text-3Rfu6lt8.js +1 -0
  234. package/dist/client/assets/{pegDiagram-VL7TDLO6-s7l7UD9d.js → pegDiagram-VL7TDLO6-Do5PIp8B.js} +1 -1
  235. package/dist/client/assets/pencil-Bzg-nc6d.js +1 -0
  236. package/dist/client/assets/{pie-WAS4IAKB-DygX31Z9.js → pie-WAS4IAKB-B_nNQOzn.js} +1 -1
  237. package/dist/client/assets/{pieDiagram-7S7Q4E2Y-bb6I9TtZ.js → pieDiagram-7S7Q4E2Y-D_IG4xwA.js} +1 -1
  238. package/dist/client/assets/{play-DUvOxTpL.js → play-DpXXQ1qB.js} +1 -1
  239. package/dist/client/assets/popover-OWEv6cQz.js +48 -0
  240. package/dist/client/assets/presentationTier-DPVAxTK4.js +1 -0
  241. package/dist/client/assets/previewRouteSearch-BjZdTuSf.js +1 -0
  242. package/dist/client/assets/primary-Cf-xJExj.js +4 -0
  243. package/dist/client/assets/primitives-CxTBN7D4.js +1 -0
  244. package/dist/client/assets/projectCheckouts.logic-DUT4AxXr.js +1 -0
  245. package/dist/client/assets/projectPaths-B8aVmOZX.js +1 -0
  246. package/dist/client/assets/projectPreferences-CzWBItFj.js +1 -0
  247. package/dist/client/assets/providerCapabilities-B2YOPsLN.js +1 -0
  248. package/dist/client/assets/providerDriverMeta-BHHL9uw0.js +1 -0
  249. package/dist/client/assets/providerModels-v9PYbzRE.js +1 -0
  250. package/dist/client/assets/providerStatus-CDPaqb0S.js +1 -0
  251. package/dist/client/assets/pullRequestsModel.logic-Dv_om_C4.js +1 -0
  252. package/dist/client/assets/{qr-code-dbkTo07n.js → qr-code-BlbiBIwH.js} +1 -1
  253. package/dist/client/assets/{qr-code-D4CtBq2F.js → qr-code-DywzVgQC.js} +1 -1
  254. package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-Cj1Y68ZF.js → quadrantDiagram-CIZ2JOQS-DY6fJyrM.js} +1 -1
  255. package/dist/client/assets/{radar-RG4KPBEZ-FHM3ftPp.js → radar-RG4KPBEZ-D9689I5m.js} +1 -1
  256. package/dist/client/assets/radio-group-DVwD6Cuy.js +1 -0
  257. package/dist/client/assets/{railroad-74A4TZTK-CPMn18Cm.js → railroad-74A4TZTK-DVzWbQnl.js} +1 -1
  258. package/dist/client/assets/railroad-abnf-HS5TGJTU-C_2P6umA.js +1 -0
  259. package/dist/client/assets/railroad-ebnf-LZEXJU2U-aGlR3R3z.js +1 -0
  260. package/dist/client/assets/railroad-peg-WCYAUIDC-DCB9oE8y.js +1 -0
  261. package/dist/client/assets/{railroadDiagram-AXF67PYL-DyV3SuDj.js → railroadDiagram-AXF67PYL-D1oJ6Jtl.js} +1 -1
  262. package/dist/client/assets/readCache-B7cDPz2O.js +1 -0
  263. package/dist/client/assets/{refresh-cw-CgDa2Ok_.js → refresh-cw-CRUTivd6.js} +1 -1
  264. package/dist/client/assets/{requirementDiagram-LRYGKXZP-_xEAGWaH.js → requirementDiagram-LRYGKXZP-7RM8iREp.js} +1 -1
  265. package/dist/client/assets/rotate-ccw-BE2ZCwL6.js +1 -0
  266. package/dist/client/assets/roving-radio-group-NMPWrDqe.js +1 -0
  267. package/dist/client/assets/rows-2-DDS4dGTX.js +1 -0
  268. package/dist/client/assets/runtime-DjjjAcTE.js +18 -0
  269. package/dist/client/assets/safePolygon-C1AzMRS4.js +1 -0
  270. package/dist/client/assets/{sankeyDiagram-W5VNT64P-Clf6oTLi.js → sankeyDiagram-W5VNT64P-C1tKAPGN.js} +1 -1
  271. package/dist/client/assets/{save-C8h0AMdl.js → save-OZdkPs_y.js} +1 -1
  272. package/dist/client/assets/scroll-area-80P7vbjw.js +1 -0
  273. package/dist/client/assets/{scrollEdges-BXYnwntN.js → scrollEdges-C0Oc-5qi.js} +1 -1
  274. package/dist/client/assets/select-Cb9FUPHD.js +1 -0
  275. package/dist/client/assets/separator-CO8bC7Wc.js +1 -0
  276. package/dist/client/assets/{sequenceDiagram-SI44F4Z6-CcYtQLSe.js → sequenceDiagram-SI44F4Z6-DGVpb7jL.js} +1 -1
  277. package/dist/client/assets/settings-2-PrRDu6Lc.js +1 -0
  278. package/dist/client/assets/settingsLayout-CRFNCk_D.js +1 -0
  279. package/dist/client/assets/sheet-C5DW7qVO.js +1 -0
  280. package/dist/client/assets/{shield-DPC4oHTi.js → shield-CBHYqlkR.js} +1 -1
  281. package/dist/client/assets/{shield-alert-CwH36qZb.js → shield-alert-Dc2cGwyR.js} +1 -1
  282. package/dist/client/assets/{shield-check-CGD7sEeF.js → shield-check-_wl7R4Js.js} +1 -1
  283. package/dist/client/assets/sidebar-0BBaFNm3.js +1 -0
  284. package/dist/client/assets/sidebarProjectFolders-BjWzbt8C.js +3 -0
  285. package/dist/client/assets/sidebarProjectGrouping-nQRStWrZ.js +1 -0
  286. package/dist/client/assets/sidebarStatusText-BBKuNies.js +1 -0
  287. package/dist/client/assets/sidebarUndo-Dfq1lvyF.js +1 -0
  288. package/dist/client/assets/{skeleton-rS3IgBob.js → skeleton-DfUe6VV_.js} +1 -1
  289. package/dist/client/assets/sliders-horizontal-BGXkwvKv.js +1 -0
  290. package/dist/client/assets/sliding-tabs-BnDSjRU3.js +39 -0
  291. package/dist/client/assets/{smartphone-DgVJfbv3.js → smartphone-OEAQOTdv.js} +1 -1
  292. package/dist/client/assets/spinner-lHRJWsym.js +1 -0
  293. package/dist/client/assets/square-B05NKv3e.js +1 -0
  294. package/dist/client/assets/{star-Cqay-Cae.js → star-C8mHmfZu.js} +1 -1
  295. package/dist/client/assets/{stateDiagram-OKZ733FA-DEKURpRP.js → stateDiagram-OKZ733FA-CCOAegCG.js} +1 -1
  296. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-D60qqBed.js +1 -0
  297. package/dist/client/assets/storeSelectors-BichCKDC.js +1 -0
  298. package/dist/client/assets/surfaceMorph-BTRijmlU.js +1 -0
  299. package/dist/client/assets/{swimlanes-SLNWSIFB-DrR6sbi6.js → swimlanes-SLNWSIFB-CFsLYT4h.js} +1 -1
  300. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-D0SaJgSn.js +8 -0
  301. package/dist/client/assets/switch-oQc7Ifbl.js +1 -0
  302. package/dist/client/assets/text-wrap-DSRdSfDm.js +1 -0
  303. package/dist/client/assets/textarea-VyiIZ0wQ.js +1 -0
  304. package/dist/client/assets/threadPriorityRefreshRuntime-H656C1J_.js +1 -0
  305. package/dist/client/assets/ticker-CPutfhZ4.js +1 -0
  306. package/dist/client/assets/{timeline-definition-Z64GVDOM-bQJvmJx5.js → timeline-definition-Z64GVDOM-B4agmO7R.js} +1 -1
  307. package/dist/client/assets/toggle-DFqtCPt-.js +1 -0
  308. package/dist/client/assets/toggle-group-C5ICmqkI.js +1 -0
  309. package/dist/client/assets/{tokenModePresentation-BkS-mry_.js → tokenModePresentation-umDRm4k1.js} +1 -1
  310. package/dist/client/assets/tooltip-DbqhseXd.js +1 -0
  311. package/dist/client/assets/{treeView-Q6P3EWNA-D4Ex5QTp.js → treeView-Q6P3EWNA-C_S3udFB.js} +1 -1
  312. package/dist/client/assets/{treemap-WGGIJYW6-C4B6Y6qM.js → treemap-WGGIJYW6-B-kUSAkE.js} +1 -1
  313. package/dist/client/assets/undo-2-lyluTGMW.js +1 -0
  314. package/dist/client/assets/{unplug-B1dczi-t.js → unplug-D6iu-qlh.js} +1 -1
  315. package/dist/client/assets/usage-ClF-eUmy.js +1 -0
  316. package/dist/client/assets/useActiveIndicator-R5NWu8Fg.js +1 -0
  317. package/dist/client/assets/useAppSidebarCollapsed-BbMxfio5.js +1 -0
  318. package/dist/client/assets/useAppearancePreference-Ix13pMKy.js +1 -0
  319. package/dist/client/assets/useAtlassian-BYDCc9lv.js +0 -0
  320. package/dist/client/assets/useCheckoutResolution-CR-oOp5-.js +1 -0
  321. package/dist/client/assets/useDesktopRelaunchGuard-Jmh615iZ.js +1 -0
  322. package/dist/client/assets/useDiffFileNavigation-DeuzdD5E.js +15 -0
  323. package/dist/client/assets/useDiffLayout-DhcXwhBL.js +1 -0
  324. package/dist/client/assets/useEnvironmentSettingsTarget-DM6BRDT7.js +1 -0
  325. package/dist/client/assets/useFocus-CV0KIZwg.js +1 -0
  326. package/dist/client/assets/useGit-CUcs7h5_.js +1 -0
  327. package/dist/client/assets/useGitBranchSearch-CeKFtnCL.js +1 -0
  328. package/dist/client/assets/useHostedDraftExecutionTarget-DvQU5UOq.js +1 -0
  329. package/dist/client/assets/useLabelableId-CEgCRi6q.js +1 -0
  330. package/dist/client/assets/useLandingFlash-BfOOlFtW.js +1 -0
  331. package/dist/client/assets/useLogicalProjectSnapshots-CRNZke74.js +1 -0
  332. package/dist/client/assets/useNavigate-sQZthdyT.js +1 -0
  333. package/dist/client/assets/usePageLeadingInsetClass-Bf4nUvx4.js +1 -0
  334. package/dist/client/assets/usePhoneThreadActions-VaQ-mZex.js +1 -0
  335. package/dist/client/assets/usePopupHandleStore-DimKo2Yy.js +1 -0
  336. package/dist/client/assets/usePopupViewport-YeqX_UM3.js +1 -0
  337. package/dist/client/assets/usePresentationTier-B9kCQ4YH.js +1 -0
  338. package/dist/client/assets/useProject-Kt74Z12J.js +1 -0
  339. package/dist/client/assets/useProviderOptionsUpdater-CTzNh2B7.js +2 -0
  340. package/dist/client/assets/usePullRequestFilesViewed-D5Snmzys.js +1 -0
  341. package/dist/client/assets/usePullRequestsModel-DJL5HHbP.js +40 -0
  342. package/dist/client/assets/useScrollLock-CLZ31xsK.js +1 -0
  343. package/dist/client/assets/useSidebarThreadActions-n6EkLATf.js +6 -0
  344. package/dist/client/assets/{useStatistics-B76_r68I.js → useStatistics-DD0mYS4J.js} +14 -14
  345. package/dist/client/assets/{useTheme-B441xg4F.js → useTheme-Bdy-BDs-.js} +1 -1
  346. package/dist/client/assets/useValueChanged-DoumqMnV.js +1 -0
  347. package/dist/client/assets/{user-round-CLy1Qy1Y.js → user-round-BPDXr8Gq.js} +1 -1
  348. package/dist/client/assets/{vennDiagram-T6HMQDX7-8iiroXim.js → vennDiagram-T6HMQDX7-B1UEn_j_.js} +1 -1
  349. package/dist/client/assets/{vscode-icons-CJBVQtq5.js → vscode-icons-Ccy-gzFN.js} +1 -1
  350. package/dist/client/assets/{wardley-WFR3VGLG-DpyNUbTc.js → wardley-WFR3VGLG-gPdyDc-7.js} +1 -1
  351. package/dist/client/assets/{wardleyDiagram-T6FBY63Y-CI7is3QO.js → wardleyDiagram-T6FBY63Y-2aDcwOA4.js} +1 -1
  352. package/dist/client/assets/workspaceLifecycle-OJ1aKksw.js +3 -0
  353. package/dist/client/assets/workspaceMetadataProjection-CyEyJhUa.js +1 -0
  354. package/dist/client/assets/workspaceRouteSearch-CCavUdbH.js +1 -0
  355. package/dist/client/assets/{wrench-7pbbxqrZ.js → wrench-CPUCA_rn.js} +1 -1
  356. package/dist/client/assets/wsTransport-C88seBPA.js +15 -0
  357. package/dist/client/assets/{xychartDiagram-ELKLHX3M-BTEX3m2y.js → xychartDiagram-ELKLHX3M-C1_7Q-1i.js} +1 -1
  358. package/dist/client/favicon.svg +1 -1
  359. package/dist/client/index.html +1 -1
  360. package/dist/collectUint8StreamText-BsLSgI8i.mjs +710 -0
  361. package/dist/collectUint8StreamText-D5olwfpM.cjs +757 -0
  362. package/dist/{deviceHostWorker-L8C9wy38.mjs → deviceHostWorker-B-Dn-6An.mjs} +1 -1
  363. package/dist/{makeManagedServerProvider-CF776SAO.cjs → makeManagedServerProvider-B5tP7tvg.cjs} +1 -1
  364. package/dist/{makeManagedServerProvider-B90UKjnv.mjs → makeManagedServerProvider-B65ipCxM.mjs} +2 -2
  365. package/dist/resource-monitor/linux-arm64/ryco-resource-monitor +0 -0
  366. package/dist/resource-monitor/ryco-resource-monitor +0 -0
  367. package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
  368. package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
  369. package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
  370. package/dist/{runtimeSession-V3RIy8Ao.mjs → runtimeSession-D_BZ-wRH.mjs} +1 -1
  371. package/dist/{src-CARHuYkT.cjs → src-FmeCeBJ9.cjs} +2291 -72
  372. package/dist/{src-CtsgPPhb.mjs → src-VTj60bUm.mjs} +1974 -61
  373. package/package.json +1 -1
  374. package/dist/AzureDevOpsSourceControlProvider-CKSvfuDS.cjs +0 -190
  375. package/dist/AzureDevOpsSourceControlProvider-DRWSXTml.mjs +0 -188
  376. package/dist/GitLabSourceControlProvider-Cj07OTBD.mjs +0 -186
  377. package/dist/GitLabSourceControlProvider-CvvN5pHt.cjs +0 -188
  378. package/dist/client/assets/AccountSettings-v6-r6gYl.js +0 -1
  379. package/dist/client/assets/AiFocusSettings-BVdLON0q.js +0 -1
  380. package/dist/client/assets/AppearanceSettings-DRChsQnN.js +0 -1
  381. package/dist/client/assets/BranchToolbar.logic-YN3KjVr9.js +0 -3
  382. package/dist/client/assets/BrowserPanel-Dxw3stFP.js +0 -1
  383. package/dist/client/assets/ChatRightPanel-CygpcJiF.js +0 -201
  384. package/dist/client/assets/ChatThreadRouteView-DYLZFHu0.js +0 -1
  385. package/dist/client/assets/CommandPaletteDialog-BRvBzP1R.js +0 -1
  386. package/dist/client/assets/CompositeRoot-BeEGGWwn.js +0 -1
  387. package/dist/client/assets/ComputerUseSettings-Cq8Pi0ZU.js +0 -1
  388. package/dist/client/assets/ConnectionsSettings-RSYtexxd.js +0 -7
  389. package/dist/client/assets/ContextHandoffEndpointLabel-CeGDLNA4.js +0 -4
  390. package/dist/client/assets/DiagnosticsSettings-CDa6MVx4.js +0 -2
  391. package/dist/client/assets/DialogHandle-BE7egDQQ.js +0 -1
  392. package/dist/client/assets/DialogRoot-C4mtzigX.js +0 -1
  393. package/dist/client/assets/DialogTitle-B_Q4DykI.js +0 -1
  394. package/dist/client/assets/DialogTrigger-BSqd4Crj.js +0 -1
  395. package/dist/client/assets/DraftChatThreadRouteView-JW_bXVrM.js +0 -1
  396. package/dist/client/assets/GlassSurface-DDG4eTlj.js +0 -1
  397. package/dist/client/assets/HostedConnectionControls-CscV6hm1.js +0 -1
  398. package/dist/client/assets/HostedHubRoot-gp7-ClBP.js +0 -2
  399. package/dist/client/assets/HostedNodeRenameDialog-D1DSiTpx.js +0 -1
  400. package/dist/client/assets/HostedRelayTrustNotice-B9jp4SRh.js +0 -1
  401. package/dist/client/assets/IntegrationsSettingsPanel-DH7SfWtV.js +0 -2
  402. package/dist/client/assets/KeybindingsSettings-DkgYYSHS.js +0 -7
  403. package/dist/client/assets/LazyBrowserPanel-D4e76vc_.js +0 -2
  404. package/dist/client/assets/McpServersSettings-Dc1kPa-X.js +0 -6
  405. package/dist/client/assets/MobileSheet-lT--mLEz.js +0 -1
  406. package/dist/client/assets/NodeSecuritySettings-DcfSx4KT.js +0 -1
  407. package/dist/client/assets/NullStore-8d2s-Re3.js +0 -1
  408. package/dist/client/assets/OnboardingDialog-CnLjwM6Z.js +0 -1
  409. package/dist/client/assets/OpinionatedPluginsSettings-BTJyS3rN.js +0 -1
  410. package/dist/client/assets/PhoneHome-CIMkuDJF.js +0 -1
  411. package/dist/client/assets/PhoneSettingsSurface-CfZQxJNI.js +0 -2
  412. package/dist/client/assets/ProvidersSettingsPanel-DAVSiwE1.js +0 -1
  413. package/dist/client/assets/RedactedSensitiveText-BHGbQJwB.js +0 -1
  414. package/dist/client/assets/RootAppShell-T056pByH.js +0 -7
  415. package/dist/client/assets/SettingsDialog-BERU2Qg7.js +0 -2
  416. package/dist/client/assets/SettingsPanels-De_XZOQF.js +0 -3
  417. package/dist/client/assets/SettingsPanels.editor-Dkva9gX_.js +0 -2
  418. package/dist/client/assets/SourceControlSettings-B4HS17cB.js +0 -1
  419. package/dist/client/assets/StatisticsPage-Bj2ftFdH.js +0 -1
  420. package/dist/client/assets/StatisticsPanel-Dw7GBBmd.js +0 -1
  421. package/dist/client/assets/StatisticsSettingsLink-_XL3ABoI.js +0 -1
  422. package/dist/client/assets/ThreadTerminalDrawer-CPPzQSXN.js +0 -18
  423. package/dist/client/assets/ThreadWorkspacePanel-DWKU7Omm.js +0 -2073
  424. package/dist/client/assets/appChrome-TkWLAGxk.js +0 -1
  425. package/dist/client/assets/architecture-7GRP2DOG-HS59zfrk.js +0 -1
  426. package/dist/client/assets/authorization-D8dOcEYq.js +0 -1
  427. package/dist/client/assets/badge-2AZ3HfVS.js +0 -1
  428. package/dist/client/assets/capabilities-CsHjxjab.js +0 -1
  429. package/dist/client/assets/channel-Dn3_cOkm.js +0 -1
  430. package/dist/client/assets/chevron-right-Dsw16yGn.js +0 -1
  431. package/dist/client/assets/classDiagram-JCYQIIEL-ZQvrS8No.js +0 -1
  432. package/dist/client/assets/classDiagram-v2-OCEON4UE-ZQvrS8No.js +0 -1
  433. package/dist/client/assets/compiler-runtime-C4g8XhC5.js +0 -1
  434. package/dist/client/assets/desktopWorkspace-_iM6B9Kf.js +0 -1
  435. package/dist/client/assets/editorPreferences-D8q1ItMW.js +0 -1
  436. package/dist/client/assets/eventmodeling-NTZA5JFV-Dj71kuPV.js +0 -1
  437. package/dist/client/assets/flowDiagram-UKHOOZJN-BaAiwuvL.js +0 -1
  438. package/dist/client/assets/hostedConnectionCoordinator-BuRWCvUG.js +0 -1
  439. package/dist/client/assets/hubRoutes-jcMPIFy3.js +0 -1
  440. package/dist/client/assets/kbd-Dxm5Elqj.js +0 -1
  441. package/dist/client/assets/layers-Dqez1Uq8.js +0 -1
  442. package/dist/client/assets/liquidGlass-CA2o_Cq0.js +0 -1
  443. package/dist/client/assets/liquidGlass.worker-icvLJKHf.js +0 -1
  444. package/dist/client/assets/main-BqSANuAs.css +0 -2
  445. package/dist/client/assets/main-DAbEANjY.js +0 -9
  446. package/dist/client/assets/motion-BdscFixQ.js +0 -1
  447. package/dist/client/assets/palette-92ylWqeC.js +0 -1
  448. package/dist/client/assets/perfInstrumentation-BT27w4tn.js +0 -1
  449. package/dist/client/assets/presentationTier-xlIjcFab.js +0 -1
  450. package/dist/client/assets/primary-DZjgHvyf.js +0 -5
  451. package/dist/client/assets/providerDriverMeta-T2YbXzuS.js +0 -1
  452. package/dist/client/assets/providerStatus-DBGvvkyF.js +0 -1
  453. package/dist/client/assets/radio-group-CRnHYWa8.js +0 -1
  454. package/dist/client/assets/railroad-abnf-HS5TGJTU-DxU7Mt1k.js +0 -1
  455. package/dist/client/assets/railroad-ebnf-LZEXJU2U-BYAPVjRd.js +0 -1
  456. package/dist/client/assets/railroad-peg-WCYAUIDC-BOqgR_X7.js +0 -1
  457. package/dist/client/assets/runtime-BwHA1GUS.js +0 -18
  458. package/dist/client/assets/scroll-area-7n2X_RLQ.js +0 -1
  459. package/dist/client/assets/separator-CL1qjMqJ.js +0 -1
  460. package/dist/client/assets/settingsLayout-DxsFwhF0.js +0 -1
  461. package/dist/client/assets/sheet-CGiaw8-i.js +0 -1
  462. package/dist/client/assets/sidebar-Cc6ANbOP.js +0 -1
  463. package/dist/client/assets/sidebarProjectFolders-DO2Uv84F.js +0 -4
  464. package/dist/client/assets/sidebarStatusText-B4AtFXZo.js +0 -1
  465. package/dist/client/assets/sidebarUndo-gdSrfa4O.js +0 -1
  466. package/dist/client/assets/square-Cr9X8U6y.js +0 -1
  467. package/dist/client/assets/src-C3Y_imaX.js +0 -14
  468. package/dist/client/assets/stateDiagram-v2-UEYNNEHI-CWtHILqh.js +0 -1
  469. package/dist/client/assets/storeSelectors-CTDWheMy.js +0 -1
  470. package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-DuaPce9O.js +0 -8
  471. package/dist/client/assets/switch-DnpJB2xv.js +0 -48
  472. package/dist/client/assets/toggle-D10FsFoE.js +0 -1
  473. package/dist/client/assets/toggle-group-BhzbQPEQ.js +0 -1
  474. package/dist/client/assets/tooltip-BlweKBxc.js +0 -1
  475. package/dist/client/assets/usage-BBwaxMif.js +0 -1
  476. package/dist/client/assets/useAppSidebarCollapsed-CFy476E3.js +0 -1
  477. package/dist/client/assets/useAppearancePreference-Dlh9P8iu.js +0 -1
  478. package/dist/client/assets/useBaseUiId-DKOjzmu3.js +0 -1
  479. package/dist/client/assets/useLabelableId-DQbY2GG1.js +0 -1
  480. package/dist/client/assets/useNavigate-B8oXtF30.js +0 -1
  481. package/dist/client/assets/usePhoneThreadActions-6DCLiyJ5.js +0 -1
  482. package/dist/client/assets/usePopupViewport-CNWcP7Od.js +0 -1
  483. package/dist/client/assets/usePresentationTier-hxB7Yv_Q.js +0 -1
  484. package/dist/client/assets/useScrollLock-BbKeKZdj.js +0 -1
  485. package/dist/client/assets/useTriggerFocusGuards-BC4Wb3GI.js +0 -1
  486. package/dist/client/assets/useValueChanged-BkTbyZdO.js +0 -1
  487. package/dist/client/assets/workspaceMetadataProjection-aqZEXDrQ.js +0 -1
  488. package/dist/collectUint8StreamText-BAUF-vzz.mjs +0 -37
  489. package/dist/collectUint8StreamText-vagpNUMJ.cjs +0 -42
  490. package/dist/git-9xWsJYIH.mjs +0 -132
  491. package/dist/git-xIkXFy_l.cjs +0 -218
  492. package/dist/sourceControl-B0D1Op29.cjs +0 -253
  493. package/dist/sourceControl-BiEBxN01.mjs +0 -224
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-Di0isH9D.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-DARIYokI.js";import"./wsTransport-C88seBPA.js";import{$i as n,Cs as r,F as i,Hi as a,I as o,N as s,P as c,Ss as l,Ui as u,Xi as d,Zi as f,ad as p,gs as m,hs as h,vs as g,wr as _,ws as v,yr as y,ys as b}from"./runtime-DjjjAcTE.js";import{t as x}from"./react-CwJFpaho.js";import{A as S,D as C,M as w,N as T,P as E,et as D,j as O,k}from"./popover-OWEv6cQz.js";import{c as A,n as j,s as M}from"./hostedConnectionCoordinator-BkAE-RhA.js";import{i as N}from"./presentationTier-DPVAxTK4.js";import{t as P}from"./useNavigate-sQZthdyT.js";import{t as F}from"./RootAppShell-BYQ-eGNT.js";import{t as I}from"./arrow-left-Blu3LSE2.js";import{_ as L,a as R,c as z,d as B,f as V,g as H,h as U,i as W,l as ee,m as te,o as ne,p as re,t as ie,u as ae,v as oe}from"./HostedConnectionControls-CoVqtnrK.js";import{t as se}from"./checkbox-CIIIY9FA.js";import{I as G,V as ce,x as le}from"./workspaceLifecycle-OJ1aKksw.js";import{t as ue}from"./key-round-BlrUTfxB.js";import{t as de}from"./log-out-CKq9YiLY.js";import{n as fe,t as pe}from"./HostedNodeRenameDialog-SXWMsTO0.js";import{t as me}from"./refresh-cw-CRUTivd6.js";import{t as he}from"./shield-check-_wl7R4Js.js";import{t as ge}from"./user-round-BPDXr8Gq.js";import{A as _e,N as ve,St as ye,i as be,o as K}from"./authorization-Ob6YwWiI.js";import{t as xe}from"./usePresentationTier-B9kCQ4YH.js";import{a as Se,s as Ce,t as we}from"./readCache-B7cDPz2O.js";import{n as q,t as J}from"./input-CCie4mm1.js";import{t as Te}from"./skeleton-DfUe6VV_.js";import{i as Ee,r as De,t as Oe}from"./alert-FV7ZIit_.js";import{a as ke,i as Ae,n as je,o as Me,r as Ne,s as Pe,t as Fe}from"./sheet-C5DW7qVO.js";import{t as Y}from"./label-ChtVI9lp.js";import{a as Ie,i as Le,n as Re,o as ze,r as Be,t as Ve}from"./MobileSheet-DfgXNWbd.js";import{r as He,t as Ue}from"./useHostedDraftExecutionTarget-DvQU5UOq.js";import{a as We,i as Ge,n as Ke,o as qe,r as Je,t as Ye}from"./empty-BovKoxbn.js";import{c as Xe,n as Ze,r as Qe,t as $e}from"./ExternalIdentityWeb.logic-Cu6suNrN.js";import{p as et}from"./settingsLayout-CRFNCk_D.js";import{t as tt}from"./HostedRelayTrustNotice-BfTyrBi5.js";import{n as X,t as nt}from"./data-list-BAx6jBY1.js";import{d as rt,f as it,p as at,v as ot}from"./main-Ch0bwS-M.js";var st={name:`life-buoy`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]};st.node;var ct=v(st),lt={name:`mail`,size:24,node:[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]};lt.node;var ut=v(lt),Z=e(x(),1),Q=N(),dt=/^[A-Za-z0-9_-]{43}$/u,ft=/^signup_[A-Za-z0-9_-]{22,43}$/u;function pt(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&&ft.test(n)&&r!==null&&dt.test(r)&&i!==null&&dt.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&&dt.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&&dt.test(t)?{kind:`email-verification`,token:t}:{kind:`invalid-email-verification`}}return null}function mt(e){let t=new URL(e.href),n=pt(t);return n===null?null:(e.replaceState(e.historyState,``,`${t.pathname}${t.search}`),n)}function ht(e){let t=!1,n=0,r=()=>{if(t||!e.isVisible()||!e.isOnline())return;let r=++n;e.recover().then(()=>{if(!t&&r===n&&e.isVisible()&&e.isOnline())return e.setBackgrounded(!1)})},i=t=>{n++,e.suspend(t),e.setBackgrounded(!0)},a=()=>{e.isVisible()&&r()},o=()=>i(`offline`),s=()=>i(`hidden`);return e.document.addEventListener(`visibilitychange`,a),e.document.addEventListener(`freeze`,s),e.document.addEventListener(`resume`,r),e.window.addEventListener(`offline`,o),e.window.addEventListener(`online`,r),e.window.addEventListener(`pagehide`,s),e.window.addEventListener(`pageshow`,r),e.isOnline()||o(),()=>{t=!0,n++,e.document.removeEventListener(`visibilitychange`,a),e.document.removeEventListener(`freeze`,s),e.document.removeEventListener(`resume`,r),e.window.removeEventListener(`offline`,o),e.window.removeEventListener(`online`,r),e.window.removeEventListener(`pagehide`,s),e.window.removeEventListener(`pageshow`,r)}}function gt(){let e=(0,Q.c)(3),t=c(xt),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{if(be(t))return ht({document,window,isVisible:bt,isOnline:yt,suspend:vt,recover:_t,setBackgrounded:M})},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function _t(){return K.recoverAfterConnectivity()}function vt(e){return K.suspendBrowser(e)}function yt(){return navigator.onLine}function bt(){return document.visibilityState===`visible`}function xt(e){return e.accountStatus}var St=`owner_revoked`,Ct=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.`})]),wt=`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 Tt(e){return{title:`Revoke ${e.label}?`,consequences:Ct,subjectPrompt:wt,subjectId:e.id,confirmLabel:`Revoke this node`,pendingLabel:`Revoking…`,cancelLabel:`Cancel`,dismissLabel:`Back to the list`}}var Et=`Revoke`;function Dt(e){return`${e} was revoked. It is gone from this Hub's directory for every account, and this cannot be undone.`}function Ot(e){return e===null||e.outcome===`unchanged`}var kt=e=>Object.freeze(e),At=Object.freeze([kt({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`})}),kt({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`})}),kt({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`})}),kt({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`})}),kt({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`})}),kt({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`})}),kt({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`})}),kt({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`})}),kt({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`})})]),jt=Object.freeze({message:`This node could not be revoked. Nothing was changed. Try again in a moment.`,outcome:`unchanged`});function Mt(e){let t=Nt(e),n=Pt(e);for(let e of At)if(e.selects(t,n))return e.failure;return jt}function Nt(e){if(typeof e!=`object`||!e)return null;let{status:t}=e;return typeof t==`number`&&Number.isFinite(t)?t:null}function Pt(e){if(typeof e!=`object`||!e)return null;let{code:t}=e;return typeof t==`string`?t:null}var Ft=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function It(e){return e===null||!Number.isFinite(e)?null:Ft.format(new Date(e))}function Lt(e){switch(e){case`darwin`:return`macOS`;case`linux`:return`Linux`;case`windows`:return`Windows`;case`unknown`:return`Unknown platform`}}function Rt(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function zt(e){return Rt(e)}function Bt(e,t){if(!Number.isFinite(e))return`unknown`;let n=t-e;if(n<0)return It(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`:It(e)??`unknown`}function Vt(e,t){return e.presence.online?null:e.presence.lastHeartbeatAt===null?e.lastAuthenticatedAt===null?`No connection recorded`:`Last authenticated ${Bt(e.lastAuthenticatedAt,t)}`:`Last seen ${Bt(e.presence.lastHeartbeatAt,t)}`}function Ht(e){let t=`${Lt(e.platformOs)} · ${e.platformArch}`;return e.revokedAt===null?`${t} · ${zt(e.effectiveRole)}`:e.revocationReasonCode?`${t} · Access revoked — ${e.revocationReasonCode}`:`${t} · Access revoked`}function Ut(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 Wt(e){return e.filter(e=>e.revokedAt===null).length}function Gt(e){return e.filter(e=>e.revokedAt===null&&e.presence.online).length}function Kt(e){let t=Wt(e),n=Gt(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 qt(e){return e.directoryStatus!==`ready`||e.browserStatus!==`current`||e.node.revokedAt!==null||e.node.capabilities?.nativeClientRequired===!0}function Jt(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.`}var $=p();function Yt({node:e,open:t,onOpenChange:n,onRevoke:r}){let[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(null),c=Tt(e),l=Ot(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(Mt(e)),a(!1)}}};return(0,$.jsx)(C,{open:t,onOpenChange:e=>{(e||!i)&&n(e)},disablePointerDismissal:i,children:(0,$.jsxs)(T,{className:`max-w-md`,showCloseButton:!i,children:[(0,$.jsxs)(O,{children:[(0,$.jsx)(E,{children:c.title}),(0,$.jsx)(k,{children:c.subjectPrompt})]}),(0,$.jsxs)(w,{className:`space-y-4`,children:[(0,$.jsxs)(nt,{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:`${Lt(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)(h,{"aria-hidden":!0,className:`mt-0.5 size-4 shrink-0`}),o.message]}):null]}),(0,$.jsxs)(S,{children:[(0,$.jsx)(f,{variant:`outline`,disabled:i,onClick:()=>n(!1),children:l?c.cancelLabel:c.dismissLabel}),l?(0,$.jsx)(f,{variant:`destructive`,disabled:i,onClick:()=>void u(),children:i?c.pendingLabel:c.confirmLabel}):null]})]})})}function Xt(e){let t=(0,Q.c)(57),{node:n}=e,i=et(6e4),{copyToClipboard:a,isCopied:o}=d(),s;t[0]===n.createdAt?s=t[1]:(s=It(n.createdAt),t[0]=n.createdAt,t[1]=s);let c=s,l;t[2]===n.lastAuthenticatedAt?l=t[3]:(l=It(n.lastAuthenticatedAt),t[2]=n.lastAuthenticatedAt,t[3]=l);let u=l,p;t[4]===n.revokedAt?p=t[5]:(p=It(n.revokedAt),t[4]=n.revokedAt,t[5]=p);let m=p,h=n.grant.role!==n.effectiveRole,_;t[6]===n?_=t[7]:(_=(0,$.jsx)(X,{term:`Status`,children:(0,$.jsx)(W,{node:n})}),t[6]=n,t[7]=_);let v;t[8]!==n.presence.lastHeartbeatAt||t[9]!==i?(v=n.presence.lastHeartbeatAt===null?`Not reported`:(0,$.jsx)(`span`,{title:It(n.presence.lastHeartbeatAt)??void 0,children:Bt(n.presence.lastHeartbeatAt,i)}),t[8]=n.presence.lastHeartbeatAt,t[9]=i,t[10]=v):v=t[10];let y;t[11]===v?y=t[12]:(y=(0,$.jsx)(X,{term:`Last heartbeat`,children:v}),t[11]=v,t[12]=y);let b=u??`Never`,x;t[13]===b?x=t[14]:(x=(0,$.jsx)(X,{term:`Last connected`,children:b}),t[13]=b,t[14]=x);let S;t[15]===n.platformOs?S=t[16]:(S=Lt(n.platformOs),t[15]=n.platformOs,t[16]=S);let C=`${S} · ${n.platformArch}`,w;t[17]===C?w=t[18]:(w=(0,$.jsx)(X,{term:`Platform`,children:C}),t[17]=C,t[18]=w);let T;t[19]===n.clientVersion?T=t[20]:(T=(0,$.jsx)(X,{term:`Client version`,mono:!0,children:n.clientVersion}),t[19]=n.clientVersion,t[20]=T);let E;t[21]===n.effectiveRole?E=t[22]:(E=zt(n.effectiveRole),t[21]=n.effectiveRole,t[22]=E);let D;t[23]===E?D=t[24]:(D=(0,$.jsx)(X,{term:`Your role`,children:E}),t[23]=E,t[24]=D);let O;t[25]!==h||t[26]!==n.grant.role?(O=h?(0,$.jsxs)(X,{term:`Granted role`,children:[zt(n.grant.role),(0,$.jsx)(`span`,{className:`mt-1 block text-muted-foreground`,children:`The role on your grant differs from the role in effect.`})]}):null,t[25]=h,t[26]=n.grant.role,t[27]=O):O=t[27];let k=c??`Not reported`,A;t[28]===k?A=t[29]:(A=(0,$.jsx)(X,{term:`Enrolled`,children:k}),t[28]=k,t[29]=A);let j;t[30]!==n.revocationReasonCode||t[31]!==n.revokedAt||t[32]!==m?(j=n.revokedAt===null?null:(0,$.jsx)(X,{term:`Revoked`,children:`${m??`Not reported`}${n.revocationReasonCode?` — ${n.revocationReasonCode}`:``}`}),t[30]=n.revocationReasonCode,t[31]=n.revokedAt,t[32]=m,t[33]=j):j=t[33];let M=o?`Copied`:`Copy node ID`,N;t[34]!==a||t[35]!==n.id?(N=()=>a(n.id,void 0),t[34]=a,t[35]=n.id,t[36]=N):N=t[36];let P;t[37]===o?P=t[38]:(P=o?(0,$.jsx)(r,{"aria-hidden":!0}):(0,$.jsx)(g,{"aria-hidden":!0}),t[37]=o,t[38]=P);let F;t[39]!==M||t[40]!==N||t[41]!==P?(F=(0,$.jsx)(f,{size:`icon-xs`,variant:`ghost`,"aria-label":M,onClick:N,children:P}),t[39]=M,t[40]=N,t[41]=P,t[42]=F):F=t[42];let I;t[43]!==n.id||t[44]!==F?(I=(0,$.jsx)(X,{term:`Node ID`,mono:!0,action:F,children:n.id}),t[43]=n.id,t[44]=F,t[45]=I):I=t[45];let L;return t[46]!==w||t[47]!==T||t[48]!==D||t[49]!==O||t[50]!==A||t[51]!==j||t[52]!==I||t[53]!==_||t[54]!==y||t[55]!==x?(L=(0,$.jsxs)(nt,{children:[_,y,x,w,T,D,O,A,j,I]}),t[46]=w,t[47]=T,t[48]=D,t[49]=O,t[50]=A,t[51]=j,t[52]=I,t[53]=_,t[54]=y,t[55]=x,t[56]=L):L=t[56],L}function Zt(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=xe()===`phone`,[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(null),_=n!==null;if(!n)return null;let v;t[0]!==i||t[1]!==r||t[2]!==n?(v=qt({directoryStatus:r,browserStatus:i,node:n}),t[0]=i,t[1]=r,t[2]=n,t[3]=v):v=t[3];let y=v,b;t[4]!==i||t[5]!==r||t[6]!==n?(b=Jt({directoryStatus:r,browserStatus:i,node:n}),t[4]=i,t[5]=r,t[6]=n,t[7]=b):b=t[7];let x=b,S;t[8]!==n||t[9]!==c||t[10]!==s?(S=()=>{s(!1),c(n)},t[8]=n,t[9]=c,t[10]=s,t[11]=S):S=t[11];let C=S,w=y&&x?x:null;if(d){let e=`Node details: ${n.label}`,r;t[12]===n.label?r=t[13]:(r=(0,$.jsx)(ze,{children:n.label}),t[12]=n.label,t[13]=r);let i;t[14]===n?i=t[15]:(i=Ht(n),t[14]=n,t[15]=i);let a;t[16]===i?a=t[17]:(a=(0,$.jsx)(Re,{children:i}),t[16]=i,t[17]=a);let o;t[18]!==r||t[19]!==a?(o=(0,$.jsxs)(Le,{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)(Xt,{node:n}),t[21]=n,t[22]=c);let l;t[23]===w?l=t[24]:(l=w?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:w}):null,t[23]=w,t[24]=l);let u;t[25]!==l||t[26]!==c?(u=(0,$.jsxs)(Ie,{children:[c,l]}),t[25]=l,t[26]=c,t[27]=u):u=t[27];let d;t[28]!==y||t[29]!==C?(d=(0,$.jsx)(Be,{children:(0,$.jsx)(f,{className:`min-h-11`,disabled:y,onClick:C,children:`Connect`})}),t[28]=y,t[29]=C,t[30]=d):d=t[30];let p;return t[31]!==s||t[32]!==_||t[33]!==u||t[34]!==d||t[35]!==e||t[36]!==o?(p=(0,$.jsxs)(Ve,{open:_,onOpenChange:s,label:e,children:[o,u,d]}),t[31]=s,t[32]=_,t[33]=u,t[34]=d,t[35]=e,t[36]=o,t[37]=p):p=t[37],p}let T=o&&n.revokedAt===null,E;t[38]!==s||t[39]!==p||t[40]!==h?(E=e=>{(e||h===null&&p===null)&&(e||(m(null),g(null)),s(e))},t[38]=s,t[39]=p,t[40]=h,t[41]=E):E=t[41];let D;t[42]===n.label?D=t[43]:(D=(0,$.jsx)(Pe,{className:`truncate`,children:n.label}),t[42]=n.label,t[43]=D);let O;t[44]===n?O=t[45]:(O=Ht(n),t[44]=n,t[45]=O);let k;t[46]===O?k=t[47]:(k=(0,$.jsx)(je,{children:O}),t[46]=O,t[47]=k);let A;t[48]!==D||t[49]!==k?(A=(0,$.jsxs)(Ae,{children:[D,k]}),t[48]=D,t[49]=k,t[50]=A):A=t[50];let j;t[51]===n?j=t[52]:(j=(0,$.jsx)(Xt,{node:n}),t[51]=n,t[52]=j);let M;t[53]===w?M=t[54]:(M=w?(0,$.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:w}):null,t[53]=w,t[54]=M);let N;t[55]!==M||t[56]!==j?(N=(0,$.jsxs)(ke,{children:[j,M]}),t[55]=M,t[56]=j,t[57]=N):N=t[57];let P;t[58]!==n.id||t[59]!==T?(P=T?(0,$.jsx)(f,{variant:`destructive-outline`,className:`sm:mr-auto`,onClick:()=>g(n.id),children:Et}):null,t[58]=n.id,t[59]=T,t[60]=P):P=t[60];let F;t[61]!==a||t[62]!==n.id?(F=a?(0,$.jsx)(f,{variant:`outline`,onClick:()=>m(n.id),children:`Rename`}):null,t[61]=a,t[62]=n.id,t[63]=F):F=t[63];let I;t[64]!==y||t[65]!==C?(I=(0,$.jsx)(f,{disabled:y,onClick:C,children:`Connect`}),t[64]=y,t[65]=C,t[66]=I):I=t[66];let L;t[67]!==P||t[68]!==F||t[69]!==I?(L=(0,$.jsxs)(Ne,{children:[P,F,I]}),t[67]=P,t[68]=F,t[69]=I,t[70]=L):L=t[70];let R;t[71]!==N||t[72]!==L||t[73]!==A?(R=(0,$.jsxs)(Me,{side:`right`,className:`w-full sm:max-w-md`,children:[A,N,L]}),t[71]=N,t[72]=L,t[73]=A,t[74]=R):R=t[74];let z;t[75]!==_||t[76]!==R||t[77]!==E?(z=(0,$.jsx)(Fe,{open:_,onOpenChange:E,children:R}),t[75]=_,t[76]=R,t[77]=E,t[78]=z):z=t[78];let B;t[79]!==a||t[80]!==n||t[81]!==l||t[82]!==p?(B=a?(0,$.jsx)(pe,{node:n,open:p===n.id,onOpenChange:e=>m(e?n.id:null),onRename:e=>l(n,e)}):null,t[79]=a,t[80]=n,t[81]=l,t[82]=p,t[83]=B):B=t[83];let V;t[84]!==n||t[85]!==u||t[86]!==T||t[87]!==h?(V=T?(0,$.jsx)(Yt,{node:n,open:h===n.id,onOpenChange:e=>g(e?n.id:null),onRevoke:()=>u(n)}):null,t[84]=n,t[85]=u,t[86]=T,t[87]=h,t[88]=V):V=t[88];let H;return t[89]!==z||t[90]!==B||t[91]!==V?(H=(0,$.jsxs)($.Fragment,{children:[z,B,V]}),t[89]=z,t[90]=B,t[91]=V,t[92]=H):H=t[92],H}function Qt(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 $t(e){let t=(0,Q.c)(12),{children:r,className:i,title:a,description:o,actions:s}=e,c;t[0]===i?c=t[1]:(c=n(`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%)]`,i),t[0]=i,t[1]=c);let l;t[2]!==s||t[3]!==o||t[4]!==a?(l=a===void 0&&s===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:[a===void 0?null:(0,$.jsx)(`h2`,{className:`font-medium text-base`,children:a}),o===void 0?null:(0,$.jsx)(`p`,{className:`mt-1 text-muted-foreground text-sm leading-relaxed`,children:o})]}),s===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:s})]}),t[2]=s,t[3]=o,t[4]=a,t[5]=l):l=t[5];let u;t[6]===r?u=t[7]:(u=r===void 0?null:(0,$.jsx)(`div`,{className:`px-5 py-4`,children:r}),t[6]=r,t[7]=u);let d;return t[8]!==c||t[9]!==l||t[10]!==u?(d=(0,$.jsxs)(`section`,{className:c,children:[l,u]}),t[8]=c,t[9]=l,t[10]=u,t[11]=d):d=t[11],d}function en(e){let t=(0,Q.c)(8),{className:r,size:i}=e,a=i===void 0?`default`:i,o=a===`lg`?`gap-2.5 text-lg`:`gap-2 text-sm`,s;t[0]!==r||t[1]!==o?(s=n(`inline-flex items-center font-semibold text-foreground`,o,r),t[0]=r,t[1]=o,t[2]=s):s=t[2];let c=a===`lg`?`h-6`:`h-4.5`,l;t[3]===c?l=t[4]:(l=(0,$.jsx)(ot,{className:c}),t[3]=c,t[4]=l);let u;return t[5]!==s||t[6]!==l?(u=(0,$.jsxs)(`span`,{className:s,children:[l,it]}),t[5]=s,t[6]=l,t[7]=u):u=t[7],u}var tn=`h-dvh overflow-x-hidden overflow-y-auto overscroll-contain text-foreground`,nn=`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))]`,rn=`flex min-h-full flex-col`,an={form:`max-w-[28rem]`,content:`max-w-3xl`,page:`max-w-5xl`};function on(e){let t=(0,Q.c)(13),{nav:r,trailing:i}=e,a,o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=n(`app-chrome-glass shrink-0 border-border/60 border-b`,`pt-[env(safe-area-inset-top)]`),o=n(`mx-auto flex h-14 w-full items-center gap-3 px-4 sm:px-6`,an.page),s=(0,$.jsx)(en,{}),t[0]=a,t[1]=o,t[2]=s):(a=t[0],o=t[1],s=t[2]);let c;t[3]===r?c=t[4]:(c=r===void 0?null:(0,$.jsx)(`nav`,{"aria-label":`Hub`,className:`min-w-0 flex-1`,children:r}),t[3]=r,t[4]=c);let l;t[5]===r?l=t[6]:(l=r===void 0?(0,$.jsx)(`div`,{className:`flex-1`}):null,t[5]=r,t[6]=l);let u;t[7]===i?u=t[8]:(u=i===void 0?null:(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:i}),t[7]=i,t[8]=u);let d;return t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,$.jsx)(`header`,{className:a,children:(0,$.jsxs)(`div`,{className:o,children:[s,c,l,u]})}),t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function sn(e){let t=(0,Q.c)(16),{children:r,nav:i,trailing:o,scrollRef:s,measure:c}=e,l=c===void 0?`page`:c,d=xe()===`phone`,f;t[0]!==d||t[1]!==i||t[2]!==o?(f=d?null:(0,$.jsx)(on,{nav:i,trailing:o}),t[0]=d,t[1]=i,t[2]=o,t[3]=f):f=t[3];let p=d?`min-h-full py-10`:`pt-8 pb-16`,m=an[l],h;t[4]!==p||t[5]!==m?(h=n(`mx-auto flex w-full flex-col`,p,nn,m),t[4]=p,t[5]=m,t[6]=h):h=t[6];let g;t[7]!==r||t[8]!==h?(g=(0,$.jsx)(`section`,{className:h,children:r}),t[7]=r,t[8]=h,t[9]=g):g=t[9];let _;t[10]!==s||t[11]!==g?(_=(0,$.jsx)(`main`,{ref:s,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain`,children:g}),t[10]=s,t[11]=g,t[12]=_):_=t[12];let v;return t[13]!==f||t[14]!==_?(v=(0,$.jsx)(u,{children:(0,$.jsx)(a,{children:(0,$.jsxs)(`div`,{className:`hub-ambient flex h-dvh flex-col text-foreground`,children:[f,_]})})}),t[13]=f,t[14]=_,t[15]=v):v=t[15],v}var cn=(0,Z.lazy)(()=>t(()=>import(`./AccountSettings-B88Q_w9Y.js`).then(e=>({default:e.AccountSettingsPanel})),__vite__mapDeps([0]))),ln=(0,Z.lazy)(()=>t(()=>import(`./AppearanceSettings-XS9WRVPU.js`).then(e=>({default:e.AppearanceSettingsPanel})),__vite__mapDeps([0]))),un=[{id:`overview`,label:`Overview`,icon:ge},{id:`security`,label:`Security`,icon:he},{id:`appearance`,label:`Appearance`,icon:fe}];function dn(e){let t=(0,Q.c)(17),{section:n}=e,r=c(pn),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsxs)(f,{variant:`ghost`,onClick:fn,children:[(0,$.jsx)(I,{"aria-hidden":!0}),` Nodes`]}),t[0]=i):i=t[0];let a=n===`appearance`?`Browser appearance`:`Account`,o;t[1]!==r||t[2]!==n?(o=n===`appearance`?`Saved in this browser. Your other apps and devices keep their own appearance.`:r===null?void 0:`${r.displayName} · ${r.role.charAt(0).toUpperCase()}${r.role.slice(1)}`,t[1]=r,t[2]=n,t[3]=o):o=t[3];let s;t[4]===n?s=t[5]:(s=un.map(e=>{let t=e.id===n;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(f,{variant:t?`secondary`:`ghost`,"aria-current":t?`page`:void 0,className:`w-full justify-start`,onClick:()=>H({kind:`account`,section:e.id}),children:[(0,$.jsx)(e.icon,{"aria-hidden":!0}),e.label]})},e.id)}),t[4]=n,t[5]=s);let l;t[6]===s?l=t[7]:(l=(0,$.jsx)(`nav`,{"aria-label":`Account`,className:`shrink-0 sm:w-48`,children:(0,$.jsx)(`ul`,{className:`flex gap-1 overflow-x-auto sm:flex-col sm:overflow-visible`,children:s})}),t[6]=s,t[7]=l);let u;t[8]===n?u=t[9]:(u=(0,$.jsx)(`div`,{className:`min-w-0 flex-1`,children:n===`overview`?(0,$.jsxs)(`div`,{className:`space-y-6`,children:[(0,$.jsx)(gn,{}),(0,$.jsx)(mn,{})]}):(0,$.jsx)(Z.Suspense,{fallback:(0,$.jsx)(Te,{className:`h-64 w-full rounded-2xl`}),children:n===`security`?(0,$.jsx)(cn,{}):(0,$.jsx)(ln,{surface:`hub`})})}),t[8]=n,t[9]=u);let d;t[10]!==l||t[11]!==u?(d=(0,$.jsxs)(`div`,{className:`flex flex-col gap-6 sm:flex-row sm:gap-8`,children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12];let p;return t[13]!==a||t[14]!==o||t[15]!==d?(p=(0,$.jsx)(sn,{measure:`page`,trailing:i,children:(0,$.jsx)(Qt,{title:a,description:o,children:d})}),t[13]=a,t[14]=o,t[15]=d,t[16]=p):p=t[16],p}function fn(){return H({kind:`nodes`})}function pn(e){return e.account}function mn(){let e=(0,Q.c)(6),t=Ce(),n;e[0]===t.enabled?n=e[1]:(n=(0,$.jsxs)(`label`,{className:`flex items-center gap-3 text-sm`,children:[(0,$.jsx)(se,{checked:t.enabled,onCheckedChange:hn}),`Remember this browser`]}),e[0]=t.enabled,e[1]=n);let r,i;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Cloud history stores recent conversation text on the Hub for quick access across devices. This setting adds a separate offline copy in this browser.`}),i=(0,$.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:`Only text is saved; draft attachments need to be added again. Anyone with access to this browser profile can read the saved copy, including offline. Sending work still requires a fresh connection. Turning this off or signing out removes the browser copy.`}),e[2]=r,e[3]=i):(r=e[2],i=e[3]);let a;return e[4]===n?a=e[5]:(a=(0,$.jsxs)($t,{title:`Instant reopening`,description:`Keep recent conversations and text drafts in this browser so you can read and type while your devices reconnect.`,children:[n,r,i]}),e[4]=n,e[5]=a),a}function hn(e){Se(e===!0)}function gn(){let e=(0,Q.c)(11),t=c(_n),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Display name`}),e[0]=n):n=e[0];let r=t?.displayName??`—`,i;e[1]===r?i=e[2]:(i=(0,$.jsxs)(`div`,{children:[n,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:r})]}),e[1]=r,e[2]=i);let a;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(`dt`,{className:`text-muted-foreground text-xs`,children:`Role`}),e[3]=a):a=e[3];let o;e[4]===t?o=e[5]:(o=t===null?`—`:`${t.role.charAt(0).toUpperCase()}${t.role.slice(1)}`,e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,$.jsxs)(`div`,{children:[a,(0,$.jsx)(`dd`,{className:`mt-0.5 text-sm`,children:o})]}),e[6]=o,e[7]=s);let l;return e[8]!==i||e[9]!==s?(l=(0,$.jsx)($t,{title:`Your account`,description:`Identity this Hub knows you by.`,children:(0,$.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-4 sm:grid-cols-2`,children:[i,s]})}),e[8]=i,e[9]=s,e[10]=l):l=e[10],l}function _n(e){return e.account}function vn(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(yn)}),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 yn(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 bn(e){let t=(0,Q.c)(25),{children:r,title:i,description:a,actions:o,trailing:s,scrollRef:c,titleRef:l,measure:u}=e,d=u===void 0?`form`:u,f,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=n(tn,`hub-ambient`),p=n(rn,nn,`py-10`),t[0]=f,t[1]=p):(f=t[0],p=t[1]);let m=an[d],h;t[2]===m?h=t[3]:(h=n(`my-auto w-full self-center phone:my-0 phone:flex phone:max-w-none phone:flex-1 phone:flex-col`,m),t[2]=m,t[3]=h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,$.jsx)(`div`,{className:`mb-8 flex justify-center phone:mb-6 phone:justify-start`,children:(0,$.jsx)(en,{size:`lg`})}),t[4]=g):g=t[4];let _;t[5]!==i||t[6]!==l?(_=(0,$.jsx)(`h1`,{ref:l,tabIndex:-1,className:`font-semibold text-2xl tracking-tight outline-none`,children:i}),t[5]=i,t[6]=l,t[7]=_):_=t[7];let v;t[8]===a?v=t[9]:(v=a===void 0?null:(0,$.jsx)(`p`,{className:`mt-2 text-muted-foreground text-sm leading-relaxed`,children:a}),t[8]=a,t[9]=v);let y;t[10]===r?y=t[11]:(y=(0,$.jsx)(`div`,{className:`mt-6 phone:flex phone:flex-1 phone:flex-col`,children:r}),t[10]=r,t[11]=y);let b;t[12]!==o||t[13]!==_||t[14]!==v||t[15]!==y||t[16]!==s?(b=(0,$.jsxs)(`section`,{className:`hub-gateway-panel app-surface relative rounded-2xl border p-6 not-dark:bg-clip-padding shadow-lg/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] sm:p-8 phone:flex phone:flex-1 phone:flex-col phone:rounded-none phone:border-0 phone:p-0 phone:shadow-none phone:before:hidden dark:before:shadow-[0_-1px_--theme(--color-white/6%)]`,children:[_,v,y,o,s]}),t[12]=o,t[13]=_,t[14]=v,t[15]=y,t[16]=s,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(vn,{}),t[18]=x):x=t[18];let S;t[19]!==b||t[20]!==h?(S=(0,$.jsx)(`div`,{className:p,children:(0,$.jsxs)(`div`,{className:h,children:[g,b,x]})}),t[19]=b,t[20]=h,t[21]=S):S=t[21];let C;return t[22]!==c||t[23]!==S?(C=(0,$.jsx)(`main`,{ref:c,className:f,children:S}),t[22]=c,t[23]=S,t[24]=C):C=t[24],C}function xn({onClose:e}){let[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(null),[a,s]=(0,Z.useState)(`input`),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),p=(0,Z.useRef)(``),m=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>{m.current?.abort(),m.current=null,p.current=``},[]);let g=()=>{m.current?.abort();let e=new AbortController;return m.current=e,l(!0),d(null),e},_=e=>{m.current===e&&(m.current=null,l(!1))},v=async(e,t)=>{if(!(e instanceof DOMException&&e.name===`AbortError`)){if(e instanceof _e&&e.status===401){p.current=``,n(``),i(null),await K.expireSession();return}d(t??(e instanceof _e?e.message:`Hub is temporarily unavailable.`))}},y=async e=>{e.preventDefault();let r=t.trim();n(``),p.current=``;let a=g();try{let e=await o.lookupNodeEnrollment(r,a.signal);if(a.signal.aborted)return;p.current=r,i(e),s(`review`)}catch(e){await v(e)}finally{_(a)}},x=async()=>{let e=p.current;if(!e||!r)return;let t=g();try{if(await o.approveNodeEnrollment(e,t.signal),t.signal.aborted)return;p.current=``,i(null),s(`approved`),await K.refreshDirectory()}catch(e){p.current=``,i(null),s(`input`),await v(e,`The approval result is unknown. Enter the device code again to verify its current state.`)}finally{_(t)}},S=async()=>{let e=p.current;if(!e||!r)return;let t=g();try{if(await o.denyNodeEnrollment(e,t.signal),t.signal.aborted)return;p.current=``,i(null),s(`denied`)}catch(e){await v(e)}finally{_(t)}},C=()=>{m.current?.abort(),p.current=``,n(``),i(null),e()};return a===`approved`||a===`denied`?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(b,{"aria-hidden":!0,className:`size-8 text-primary`}),(0,$.jsx)(`h1`,{className:`mt-4 text-2xl font-semibold`,children:a===`approved`?`Node approved`:`Enrollment denied`}),(0,$.jsx)(`p`,{role:`status`,className:`mt-2 text-sm text-muted-foreground`,children:a===`approved`?`The node can now finish enrollment and connect. Online presence may take a few seconds.`:`This ceremony cannot be reused. Start a new enrollment on the node if needed.`}),(0,$.jsx)(f,{className:`mt-5`,onClick:C,children:`Back to nodes`})]}):r?(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ce,{"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)(nt,{className:`mt-5 rounded-xl border border-border bg-background p-4`,children:[(0,$.jsx)(X,{term:`Label`,children:(0,$.jsx)(`span`,{className:`font-medium break-words`,children:r.label})}),(0,$.jsx)(X,{term:`Platform`,children:`${r.platformOs} · ${r.platformArch}`}),(0,$.jsx)(X,{term:`Version`,mono:!0,children:r.clientVersion}),(0,$.jsx)(X,{term:`Algorithm`,children:r.algorithm}),(0,$.jsx)(X,{term:`Fingerprint`,mono:!0,children:r.fingerprint}),(0,$.jsx)(X,{term:`Expires`,children:new Date(r.expiresAt).toLocaleString()})]}),u?(0,$.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-destructive`,children:u}):null,a===`confirm-denial`?(0,$.jsxs)(`div`,{className:`mt-4 rounded-lg border border-destructive/30 bg-destructive/5 p-3`,children:[(0,$.jsxs)(`p`,{className:`flex gap-2 text-sm`,children:[(0,$.jsx)(h,{"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)(f,{variant:`destructive`,disabled:c,onClick:()=>void S(),children:`Confirm denial`}),(0,$.jsx)(f,{variant:`outline`,disabled:c,onClick:()=>s(`review`),children:`Keep reviewing`})]})]}):(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,$.jsx)(f,{disabled:c,onClick:()=>void x(),children:c?`Approving…`:`Approve node`}),(0,$.jsx)(f,{variant:`outline`,disabled:c,onClick:()=>s(`confirm-denial`),children:`Deny`}),(0,$.jsx)(f,{variant:`ghost`,disabled:c,onClick:C,children:`Cancel`})]})]}):(0,$.jsxs)(`div`,{children:[(0,$.jsx)(ce,{"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)(J,{id:`hub-node-device-code`,required:!0,autoFocus:!0,maxLength:16,value:t,className:`font-mono uppercase ${q}`,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(f,{type:`submit`,disabled:c,children:c?`Looking up…`:`Review node`}),(0,$.jsx)(f,{type:`button`,variant:`outline`,onClick:C,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`,wn=null;function Tn(){return window.turnstile?Promise.resolve(window.turnstile):wn||(wn=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 wn=null,e}),wn)}function En(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),Tn().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 Dn(e,t){return e instanceof _e?e.message:t}function On(){let e=new Uint8Array(32);return crypto.getRandomValues(e),ye(e)}function kn(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(!0),a,s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=new AbortController;return o.getPublicSignupConfiguration(e.signal).then(n).catch(()=>n({status:`disabled`})).finally(()=>{e.signal.aborted||i(!1)}),()=>e.abort()},s=[],e[0]=a,e[1]=s):(a=e[0],s=e[1]),(0,Z.useEffect)(a,s);let c;return e[2]!==t||e[3]!==r?(c={config:t,loading:r},e[2]=t,e[3]=r,e[4]=c):c=e[4],c}function An(e){return e!==null&&`activationSecret`in e}function jn({config:e,initialLink:t,onConsumeLink:n,onCancel:r}){let[i,a]=(0,Z.useState)(t?.kind===`signup-verification`||t?.kind===`invalid-signup-verification`?`verifying`:`details`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,p]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(``),[y,b]=(0,Z.useState)(null),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(null),T=(0,Z.useRef)(null),E=(0,Z.useRef)(!1);(0,Z.useEffect)(()=>{if(E.current||t===null)return;if(E.current=!0,t.kind!==`signup-verification`){t.kind===`invalid-signup-verification`&&(w(`This verification link is incomplete or expired. Start signup again.`),a(`details`));return}let e=new AbortController;return S(!0),o.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`link_token`,token:t.token}},e.signal).then(e=>{T.current=e,a(`credential`)}).catch(e=>w(Dn(e,`This verification link could not be confirmed.`))).finally(()=>{n(),e.signal.aborted||S(!1)}),()=>e.abort()},[t,n]);let D=async t=>{if(t.preventDefault(),x||e===null)return;let n=e.antiBot.provider===`bypass`?`development`:y??``;if(!n){w(`Complete the anti-bot check before continuing.`);return}S(!0),w(null);try{let e=await o.startPublicSignup({username:s.trim().toLowerCase(),email:l.trim().toLowerCase(),antiBotAssertion:n});T.current=e,a(`check-email`)}catch(e){w(Dn(e,`Account creation is temporarily unavailable.`))}finally{S(!1)}},O=async e=>{e.preventDefault();let t=T.current;if(!x&&t!==null&&`attemptSecret`in t){S(!0),w(null);try{let e=await o.verifyPublicSignup({attemptId:t.attemptId,attemptSecret:t.attemptSecret,proof:{kind:`email_code`,code:d.trim()}});p(``),T.current=e,a(`credential`)}catch(e){w(Dn(e,`That email code could not be verified.`))}finally{S(!1)}}},k=async e=>{let t=T.current;if(x||!An(t))return;if(e===`password`&&h!==_){w(`The passwords do not match.`);return}S(!0),w(null);let n=h;g(``),v(``);try{let r=e===`passkey`?await o.finishPublicSignupWithPasskey({attemptId:t.attemptId,activationSecret:t.activationSecret,idempotencyKey:On()}):await o.finishPublicSignupWithPassword({attemptId:t.attemptId,activationSecret:t.activationSecret,password:n,idempotencyKey:On()});T.current=null,await K.adoptPublicBrowserIdentity(r.identity,r.recoveryCodes)}catch(e){w(Dn(e,`Account creation did not complete.`))}finally{S(!1)}},A=i===`details`?1:i===`check-email`||i===`verifying`?2:3;return(0,$.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,$.jsx)(Sn,{step:A,total:3,label:A===1?`Your details`:A===2?`Verify your email`:`Choose how you sign in`}),i===`details`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void D(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-username`,children:`Username`}),(0,$.jsx)(J,{id:`hub-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:s,className:q,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)(J,{id:`hub-signup-email`,type:`email`,autoCapitalize:`none`,autoComplete:`email`,maxLength:254,required:!0,value:l,className:q,onChange:e=>u(e.currentTarget.value)})]}),e?.antiBot.provider===`turnstile`?(0,$.jsx)(En,{siteKey:e.antiBot.siteKey,action:`public_signup`,onToken:b}):null,(0,$.jsx)(In,{value:C}),(0,$.jsx)(Ln,{onCancel:r,pending:x,submitLabel:`Send verification email`,submitDisabled:e===null})]}):i===`check-email`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>void O(e),children:[(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(ut,{"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)(J,{id:`hub-signup-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,pattern:`[0-9]{6}`,required:!0,value:d,className:q,onChange:e=>p(e.currentTarget.value)})]}),(0,$.jsx)(In,{value:C}),(0,$.jsx)(Ln,{onCancel:r,pending:x,submitLabel:`Verify email`})]}):i===`password`?(0,$.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),k(`password`)},children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-signup-password`,children:`Password`}),(0,$.jsx)(J,{id:`hub-signup-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:h,className:q,onChange:e=>g(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)(J,{id:`hub-signup-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:_,className:q,onChange:e=>v(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)(In,{value:C}),(0,$.jsx)(Ln,{onCancel:()=>a(`credential`),pending:x,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)(he,{"aria-hidden":!0,className:`size-5 text-primary`}),(0,$.jsx)(`p`,{className:`mt-2 text-sm font-medium`,children:i===`verifying`?`Verifying your email…`:`Choose how you sign in`}),(0,$.jsx)(`p`,{className:`mt-1 text-sm leading-relaxed text-muted-foreground`,children:`A passkey is the strongest and easiest option. A password always requires a second factor on future sign-ins.`})]}),(0,$.jsx)(In,{value:C}),(0,$.jsxs)(`div`,{className:`space-y-3 phone:mt-auto ${rt}`,children:[(0,$.jsxs)(f,{type:`button`,size:`lg`,className:`min-h-11 w-full`,disabled:x||i===`verifying`,onClick:()=>void k(`passkey`),children:[x?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(ue,{"aria-hidden":!0}),x?`Creating passkey…`:`Create a passkey`]}),(0,$.jsx)(f,{type:`button`,variant:`outline`,className:`min-h-11 w-full`,disabled:x||i===`verifying`,onClick:()=>a(`password`),children:`Use a password instead`}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,className:`min-h-11 w-full`,onClick:r,children:`Cancel`})]})]})]})}function Mn({pendingSignup:e,config:t,onCancel:n}){let[r,i]=(0,Z.useState)(e.suggestedUsername??``),[a,s]=(0,Z.useState)(null),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(null),f=async e=>{if(e.preventDefault(),c||t===null)return;let n=t.antiBot.provider===`bypass`?`development`:a??``;if(!n){d(`Complete the anti-bot check before continuing.`);return}l(!0),d(null);try{let e=await o.finishExternalIdentitySignup({provider:`github`,username:r.trim().toLowerCase(),antiBotAssertion:n,idempotencyKey:On()});await K.adoptPublicBrowserIdentity(e.identity,e.recoveryCodes)}catch(e){d(Dn(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)(he,{"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)(J,{id:`hub-external-signup-username`,autoCapitalize:`none`,autoComplete:`username`,maxLength:32,pattern:`[A-Za-z0-9_]+`,required:!0,value:r,className:q,onChange:e=>i(e.currentTarget.value.toLowerCase())}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`GitHub suggested this name. You can change it before creating the account.`})]}),t?.antiBot.provider===`turnstile`?(0,$.jsx)(En,{siteKey:t.antiBot.siteKey,action:`external_signup`,onToken:s}):null,(0,$.jsx)(In,{value:u}),(0,$.jsx)(Ln,{onCancel:n,pending:c,submitLabel:`Create account with GitHub`,submitDisabled:t===null})]})}function Nn({onCancel:e,onUseRecoveryCode:t,onResetPassword:n}){let[r,i]=(0,Z.useState)(``),[a,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(!1),[h,g]=(0,Z.useState)(null),_=async e=>{if(e.preventDefault(),!p){m(!0),g(null);try{if(u===null){let e=await o.startPasswordLogin({identifier:r.trim().toLowerCase(),password:a});s(``),d(e)}else{let e=await o.finishPasswordLogin({attemptId:u.attemptId,attemptSecret:u.attemptSecret,factor:u.factor,code:c.trim()});l(``),await K.adoptPublicBrowserIdentity(e)}}catch(e){g(Dn(e,`Password sign-in did not complete.`))}finally{m(!1)}}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void _(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)(J,{id:`hub-login-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:r,className:q,onChange:e=>i(e.currentTarget.value)})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-password`,children:`Password`}),(0,$.jsx)(J,{id:`hub-login-password`,type:`password`,autoComplete:`current-password`,required:!0,maxLength:256,value:a,className:q,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)(J,{id:`hub-login-second-factor`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:c,className:q,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)(In,{value:h}),u===null?(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,onClick:t,children:`Use recovery code`}),(0,$.jsx)(f,{type:`button`,variant:`ghost`,size:`sm`,onClick:n,children:`Forgot password?`})]}):null,(0,$.jsx)(Ln,{onCancel:u===null?e:()=>d(null),pending:p,submitLabel:u===null?`Continue`:`Sign in`})]})}function Pn({initialLink:e,onConsumeLink:t,onCancel:n}){let[r,i]=(0,Z.useState)(e?.kind===`password-reset`||e?.kind===`invalid-password-reset`?`verifying`:`request`),[a,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(null),x=(0,Z.useRef)(null),S=(0,Z.useRef)(!1),C=async(e,t)=>{let n=await o.verifyPasswordReset({token:e},t);x.current=n,l(``),i(`password`)};(0,Z.useEffect)(()=>{if(S.current||e===null)return;if(S.current=!0,e.kind!==`password-reset`){e.kind===`invalid-password-reset`&&(b(`This reset link is incomplete or expired. Request a new one.`),i(`request`));return}let n=new AbortController;return v(!0),C(e.token,n.signal).catch(e=>b(Dn(e,`This reset link could not be verified.`))).finally(()=>{t(),n.signal.aborted||v(!1)}),()=>n.abort()},[e,t]);let w=async e=>{if(e.preventDefault(),!_){v(!0),b(null);try{if(r===`request`)await o.requestPasswordReset({identifier:a.trim().toLowerCase()}),i(`check-email`);else if(r===`check-email`)await C(c.trim());else if(r===`password`){let e=x.current;if(e===null)return;if(u!==p){b(`The passwords do not match.`);return}let t=u;d(``),m(``),await o.finishPasswordReset({attemptId:e.attemptId,attemptSecret:e.attemptSecret,password:t,factor:e.requiresTotp?{kind:`totp`,code:h.trim()}:{kind:`none`}}),g(``),x.current=null,i(`complete`)}}catch(e){b(Dn(e,`Password reset did not complete.`))}finally{v(!1)}}},T=r===`request`?1:r===`check-email`||r===`verifying`?2:3;return(0,$.jsxs)(`form`,{className:`flex flex-1 flex-col space-y-4`,onSubmit:e=>void w(e),children:[r===`complete`?null:(0,$.jsx)(Sn,{step:T,total:3,label:T===1?`Find your account`:T===2?`Check your email`:`Set a new password`}),r===`request`?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-identifier`,children:`Username or verified email`}),(0,$.jsx)(J,{id:`hub-reset-identifier`,autoCapitalize:`none`,autoComplete:`username`,required:!0,value:a,className:q,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)(ut,{"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)(J,{id:`hub-reset-token`,type:`password`,autoComplete:`one-time-code`,maxLength:64,required:!0,value:c,className:q,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)(J,{id:`hub-reset-password`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:u,className:q,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)(J,{id:`hub-reset-password-confirmation`,type:`password`,autoComplete:`new-password`,minLength:12,maxLength:256,required:!0,value:p,className:q,onChange:e=>m(e.currentTarget.value)})]}),x.current?.requiresTotp?(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-reset-totp`,children:`Authenticator code`}),(0,$.jsx)(J,{id:`hub-reset-totp`,inputMode:`numeric`,autoComplete:`one-time-code`,pattern:`[0-9]{6}`,maxLength:6,required:!0,value:h,className:q,onChange:e=>g(e.currentTarget.value)})]}):null]}):r===`complete`?(0,$.jsxs)(`div`,{className:`rounded-xl border border-border bg-background/60 p-4`,children:[(0,$.jsx)(he,{"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)(In,{value:y}),r===`complete`?(0,$.jsx)(`div`,{className:`phone:mt-auto ${rt}`,children:(0,$.jsx)(f,{type:`button`,className:`min-h-11 w-full`,onClick:n,children:`Back to sign in`})}):(0,$.jsx)(Ln,{onCancel:n,pending:_,submitLabel:r===`request`?`Send reset email`:r===`check-email`?`Verify reset token`:r===`password`?`Change password`:`Verifying…`,submitDisabled:r===`verifying`})]})}function Fn({onCancel:e}){let[t,n]=(0,Z.useState)(``),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),s=async e=>{if(e.preventDefault(),r)return;i(!0),o(null);let a=t;n(``);try{await K.signInWithRecoveryCode(a)}catch(e){o(Dn(e,`That recovery code could not be used.`))}finally{i(!1)}};return(0,$.jsxs)(`form`,{className:`mt-6 flex flex-1 flex-col space-y-4`,onSubmit:e=>void s(e),children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsx)(Y,{htmlFor:`hub-login-recovery-code`,children:`Recovery code`}),(0,$.jsx)(J,{id:`hub-login-recovery-code`,type:`password`,autoComplete:`one-time-code`,required:!0,maxLength:128,value:t,className:q,onChange:e=>n(e.currentTarget.value)})]}),(0,$.jsx)(In,{value:a}),(0,$.jsx)(Ln,{onCancel:e,pending:r,submitLabel:`Use recovery code`})]})}function In(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 Ln(e){let t=(0,Q.c)(12),{onCancel:n,pending:r,submitLabel:i,submitDisabled:a}=e,o=r||a!==void 0&&a,s;t[0]===r?s=t[1]:(s=r?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):null,t[0]=r,t[1]=s);let c=r?`Working…`:i,l;t[2]!==o||t[3]!==s||t[4]!==c?(l=(0,$.jsxs)(f,{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)(f,{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 ${rt}`,children:[l,u]}),t[9]=l,t[10]=u,t[11]=d):d=t[11],d}var Rn;function zn(){if(window.location.pathname!==`/email-verification`)return null;if(Rn!==void 0)return Rn;let e=mt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)});return Rn=e?.kind===`email-verification`||e?.kind===`invalid-email-verification`?e:null,Rn}function Bn(){let e=(0,Q.c)(3),t=oe(),n,r;e[0]===t?(n=e[1],r=e[2]):(n=()=>{document.title=at(t===null?void 0:U(t))},r=[t],e[0]=t,e[1]=n,e[2]=r),(0,Z.useEffect)(n,r)}function Vn(){let e=(0,Q.c)(34),t=Ce(),n=c($n),r=c(Qn),a=c(Zn),[o,s]=(0,Z.useState)(zn),l=c(Xn),u=c(Yn),d=c(Jn),f=c(qn),p=c(Kn),m=c(Gn),h=i(Wn),g=re(),v=He(),b;e[0]===g.logicalPathname?b=e[1]:(b=ee(g.logicalPathname),e[0]=g.logicalPathname,e[1]=b);let x=b,S;e[2]===x?S=e[3]:(S=e=>y(e,x),e[2]=x,e[3]=S);let C=_(S),w=B();V();let T;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],e[4]=T):T=e[4],(0,Z.useEffect)(Hn,T),gt(),Bn();let E=oe(),D;e[5]!==l||e[6]!==E?.kind?(D=()=>{l===`authenticated`&&E?.kind===`sign-up`&&L(`/`,{replace:!0})},e[5]=l,e[6]=E?.kind,e[7]=D):D=e[7];let O;if(e[8]!==l||e[9]!==E?(O=[l,E],e[8]=l,e[9]=E,e[10]=O):O=e[10],(0,Z.useEffect)(D,O),o?.kind===`email-verification`||o?.kind===`invalid-email-verification`){let t;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=()=>{window.history.replaceState(window.history.state,``,`/`),s(null)},e[11]=t):t=e[11];let n;return e[12]===o?n=e[13]:(n=(0,$.jsx)(er,{link:o,onContinue:t}),e[12]=o,e[13]=n),n}let k=x!==null&&(u?.id!==g.nodeId||a!==`revoked`&&a!==`authorization-removed`&&a!==`incompatible`)&&(n.some(e=>e.id===g.nodeId&&e.environmentId===x.environmentId&&e.revokedAt===null&&!e.capabilities?.nativeClientRequired)||r!==`ready`&&we()&&t.nodes.some(e=>e.nodeId===g.nodeId&&e.environmentId===x.environmentId)),A=C&&k,j=v!==null&&g.logicalPathname===`/draft/${encodeURIComponent(v.draftId)}`&&n.some(e=>e.id===g.nodeId&&e.environmentId===v.environmentId&&e.revokedAt===null&&!e.capabilities?.nativeClientRequired);if(l!==`authenticated`){if(we()&&!E&&(A||g.nodeId===null)){let t;return e[14]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(F,{authGateState:{status:`hosted-cached`}}),e[14]=t):t=e[14],t}let t;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ur,{}),e[15]=t):t=e[15],t}if(d.length>0&&!h){let t;return e[16]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(pr,{}),e[16]=t):t=e[16],t}if(E?.kind===`account`){let t;return e[17]===E.section?t=e[18]:(t=(0,$.jsx)(dn,{section:E.section}),e[17]=E.section,e[18]=t),t}if(E?.kind===`nodes`||E?.kind===`nodes-enroll`){let t;return e[19]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(vr,{}),e[19]=t):t=e[19],t}if(g.nodeId===null){if(w||g.malformed){let t;return e[20]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(vr,{}),e[20]=t):t=e[20],t}if(u&&p){let t;return e[21]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(F,{authGateState:{status:`hosted-hub`}}),e[21]=t):t=e[21],t}let t;return e[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(F,{authGateState:{status:`hosted-cached`}}),e[22]=t):t=e[22],t}if(j){let t;return e[23]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(F,{authGateState:{status:`hosted-cached`}}),e[23]=t):t=e[23],t}if(!u||u.id!==g.nodeId){if(A){let t;return e[24]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(F,{authGateState:{status:`hosted-cached`}}),e[24]=t):t=e[24],t}let t;return e[25]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(or,{}),e[25]=t):t=e[25],t}if(f===`terminal-failure`){if(A){let t;return e[26]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(F,{authGateState:{status:`hosted-cached`}}),e[26]=t):t=e[26],t}let t;return e[27]!==m||e[28]!==u?(t=(0,$.jsx)(rr,{node:u,message:m}),e[27]=m,e[28]=u,e[29]=t):t=e[29],t}if(!p){if(C){let t;return e[30]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(F,{authGateState:{status:`hosted-cached`}}),e[30]=t):t=e[30],t}let t;return e[31]===u?t=e[32]:(t=(0,$.jsx)(sr,{node:u}),e[31]=u,e[32]=t),t}let M;return e[33]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(F,{authGateState:{status:`hosted-hub`}}),e[33]=M):M=e[33],M}function Hn(){return A({canDiscoverHome:Un})}function Un(){return z()===null}function Wn(e){return e.leased}function Gn(e){return e.errorMessage}function Kn(e){return e.sessionEstablished}function qn(e){return e.transportStatus}function Jn(e){return e.recoveryCodes}function Yn(e){return e.selectedNode}function Xn(e){return e.accountStatus}function Zn(e){return e.selectionStatus}function Qn(e){return e.directoryStatus}function $n(e){return e.nodes}function er(e){let t=(0,Q.c)(15),{link:n,onContinue:r}=e,[i,a]=(0,Z.useState)(n.kind===`email-verification`?`verifying`:`invalid`),s;t[0]!==n.kind||t[1]!==n.token?(s=()=>{if(n.kind!==`email-verification`)return;let e=new AbortController;return o.confirmEmailVerification(n.token,e.signal).then(()=>a(`verified`)).catch(()=>{e.signal.aborted||a(`invalid`)}).finally(tr),()=>e.abort()},t[0]=n.kind,t[1]=n.token,t[2]=s):s=t[2];let c;t[3]===n?c=t[4]:(c=[n],t[3]=n,t[4]=c),(0,Z.useEffect)(s,c);let l=i===`verifying`?`Verifying your email`:i===`verified`?`Email verified`:`This verification link is unavailable`,u=i===`verifying`?`This will only take a moment.`:i===`verified`?`Your address is now available for account recovery.`:`The link is incomplete, expired, or has already been used. Request a new one from Account settings.`,d;t[5]!==r||t[6]!==i?(d=i===`verifying`?void 0:(0,$.jsx)(f,{size:`cta`,className:`mt-6 w-full`,onClick:r,children:`Continue`}),t[5]=r,t[6]=i,t[7]=d):d=t[7];let p;t[8]===i?p=t[9]:(p=i===`verifying`?(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(nr,{}),`Confirming the link…`]}):null,t[8]=i,t[9]=p);let m;return t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==p?(m=(0,$.jsx)(bn,{title:l,description:u,actions:d,children:p}),t[10]=l,t[11]=u,t[12]=d,t[13]=p,t[14]=m):m=t[14],m}function tr(){Rn=void 0}function nr(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(m,{"aria-hidden":!0,className:`mr-2 inline size-4 animate-spin align-[-0.15em] motion-reduce:animate-none`}),e[0]=t):t=e[0],t}function rr(e){let t=(0,Q.c)(11),{node:n,message:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ie,{}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(h,{"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)(f,{className:`mt-5`,onClick:ir,children:[(0,$.jsx)(me,{"aria-hidden":!0}),` Retry`]}):null,t[4]=r,t[5]=l);let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,$.jsx)(Fr,{}),t[6]=u):u=t[6];let d;return t[7]!==o||t[8]!==c||t[9]!==l?(d=(0,$.jsx)(sn,{measure:`content`,trailing:i,children:(0,$.jsxs)(ar,{tone:`destructive`,icon:a,title:o,children:[c,l,u]})}),t[7]=o,t[8]=c,t[9]=l,t[10]=d):d=t[10],d}function ir(){K.retrySelectedNode()}function ar(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 or(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(ce,{"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)(sn,{measure:`content`,children:(0,$.jsxs)(ar,{icon:t,title:`Restoring your node`,children:[(0,$.jsxs)(`p`,{role:`status`,"aria-live":`polite`,className:`text-muted-foreground text-sm`,children:[(0,$.jsx)(nr,{}),`Checking your access before reconnecting…`]}),(0,$.jsx)(Fr,{})]})}),e[1]=n):n=e[1],n}function sr(e){let t=(0,Q.c)(8),{node:n}=e,{returnToAllNodes:r}=R(),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(ce,{"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)(nr,{}),`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)(f,{variant:`outline`,className:`mt-5 phone:min-h-11`,onClick:()=>void r(),children:`Back to nodes`}),t[2]=r,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(Fr,{}),t[4]=c):c=t[4];let l;return t[5]!==a||t[6]!==s?(l=(0,$.jsx)(sn,{measure:`content`,children:(0,$.jsxs)(ar,{icon:i,title:a,children:[o,s,c]})}),t[5]=a,t[6]=s,t[7]=l):l=t[7],l}function cr(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(lr),t[0]=s):s=t[0];let c=`transition-transform ${i?`rotate-180`:``}`,u;t[1]===c?u=t[2]:(u=(0,$.jsx)(l,{"aria-hidden":!0,className:c}),t[1]=c,t[2]=u);let d;t[3]!==i||t[4]!==o||t[5]!==u?(d=(0,$.jsxs)(f,{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?`,u]}),t[3]=i,t[4]=o,t[5]=u,t[6]=d):d=t[6];let p;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==r?(p=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]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,$.jsxs)(`div`,{className:`mt-4`,children:[d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m}function lr(e){return!e}function ur({context:e=`hub`,autoExternalProvider:t=null}={}){let n=c(e=>e.accountStatus),r=c(e=>e.errorMessage),i=c(e=>e.errorReason??null),a=c(e=>e.bootstrapAvailable),[l,u]=(0,Z.useState)(()=>mt({href:window.location.href,historyState:window.history.state,replaceState:(e,t,n)=>window.history.replaceState(e,t,n)})),d=(0,Z.useCallback)(()=>u(null),[]),{config:p}=kn(),g=s(e=>e.externalIdentityConfiguration),_=Qe(g),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),S=(0,Z.useRef)(!1),[C,w]=(0,Z.useState)(void 0),T=oe(),E=T?.kind===`sign-up`||T?.kind===`sign-up-verify`?`public`:T?.kind===`invitation`?`invitation`:T?.kind===`setup`?`bootstrap`:null,D=T?.kind===`sign-in-password`?`password`:T?.kind===`sign-in-recovery-code`?`recovery-code`:T?.kind===`reset-password`?`password-reset`:null,O=e=>{H(e===`public`?{kind:`sign-up`}:e===`invitation`?{kind:`invitation`}:e===`bootstrap`?{kind:`setup`}:{kind:`sign-in`})},k=e=>{H(e===`password`?{kind:`sign-in-password`}:e===`recovery-code`?{kind:`sign-in-recovery-code`}:e===`password-reset`?{kind:`reset-password`}:{kind:`sign-in`})},A=(0,Z.useRef)(null),j=(0,Z.useRef)(null),M=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{K.refreshExternalIdentityConfiguration()},[]),(0,Z.useEffect)(()=>{if(E!==`public`&&e!==`native-authorization`){w(void 0);return}let t=new AbortController;return w(void 0),o.getPendingExternalIdentity(t.signal).then(e=>{t.signal.aborted||w(e)}).catch(()=>{t.signal.aborted||w({status:`none`})}),()=>t.abort()},[e,E]);let N=(0,Z.useCallback)(async()=>{if(!v){y(!0),x(null);try{await $e({intent:`authenticate`,returnTo:e===`native-authorization`?window.location.pathname:te({kind:`sign-up`}),start:e=>o.startExternalIdentityAuthorization(e),navigate:e=>window.location.assign(e)})}catch(e){x(e instanceof _e?e.message:`GitHub sign-in is temporarily unavailable.`),y(!1)}}},[e,v]);(0,Z.useEffect)(()=>{e!==`native-authorization`||t!==`github`||n!==`signed-out`||_?.login!==!0||C?.status!==`none`||S.current||(S.current=!0,N())},[t,e,C?.status,_?.login,N,n]),(0,Z.useEffect)(()=>{E===`invitation`||E===`bootstrap`?j.current?.focus({preventScroll:!0}):A.current?.focus({preventScroll:!0})},[D,E]),(0,Z.useEffect)(()=>{M.current?.scrollTo({top:0,left:0})},[D,E]);let P=E===`invitation`||E===`bootstrap`?(0,$.jsxs)(`div`,{className:`mt-6 flex flex-wrap gap-2 phone:mt-auto ${rt}`,children:[(0,$.jsx)(f,{type:`submit`,form:dr,className:`phone:min-h-11`,disabled:n===`authenticating`,children:E===`invitation`?`Create account and passkey`:`Create owner and passkey`}),(0,$.jsx)(f,{type:`button`,variant:`outline`,className:`phone:min-h-11`,onClick:n===`authenticating`?()=>K.cancelAuthentication():()=>O(null),children:n===`authenticating`?`Cancel`:`Back`})]}):null,F=E||D?null:(0,$.jsx)(`div`,{className:`phone:mt-auto ${rt}`,children:(0,$.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3`,children:[_?.login?(0,$.jsxs)(f,{size:`lg`,className:`phone:min-h-11`,disabled:v||n===`authenticating`||n===`signing-out`,onClick:()=>void N(),children:[v?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin`}):(0,$.jsx)(le,{"aria-hidden":!0}),v?`Opening GitHub…`:`Continue with GitHub`]}):null,(0,$.jsxs)(f,{size:`lg`,className:`phone:min-h-11`,disabled:n===`authenticating`||n===`signing-out`,onClick:()=>void K.signIn(),children:[(0,$.jsx)(ue,{"aria-hidden":!0}),n===`authenticating`?`Waiting for passkey…`:`Sign in with passkey`]}),n===`authenticating`?(0,$.jsx)(f,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>K.cancelAuthentication(),children:`Cancel`}):(0,$.jsxs)($.Fragment,{children:[p?.status===`enabled`?(0,$.jsx)(f,{variant:`outline`,size:`lg`,className:`phone:min-h-11`,onClick:()=>O(`public`),children:`Create account`}):null,(0,$.jsx)(f,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>O(`invitation`),children:`Redeem invitation`}),a?(0,$.jsx)(f,{variant:`ghost`,size:`lg`,className:`phone:min-h-11`,onClick:()=>O(`bootstrap`),children:`Set up first owner`}):null]})]})}),I=(0,$.jsxs)($.Fragment,{children:[n===`unavailable`?(0,$.jsxs)(f,{className:`mt-3 phone:min-h-11`,variant:`ghost`,onClick:()=>void K.bootstrap(),children:[(0,$.jsx)(me,{"aria-hidden":!0}),` Retry Hub`]}):null,(0,$.jsx)(`p`,{className:`sr-only`,"aria-live":`polite`,children:n===`authenticating`?`Passkey authentication is in progress.`:``})]}),L=i?ve(i):null,R=b??r??L?.message,z=b===null&&L!==null?L.title:`Sign-in did not complete`,B=R?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Oe,{variant:`error`,children:[(0,$.jsx)(h,{"aria-hidden":!0}),(0,$.jsx)(Ee,{children:z}),(0,$.jsx)(De,{children:R})]})}):null,V=C?.status===`signup`?C:null,U=C?.status===`error`?C:null,W=e===`native-authorization`&&E!==`public`;if(E===`public`||W&&(V!==null||U!==null)){let e=()=>{W?w({status:`none`}):O(null)};return(0,$.jsxs)(bn,{title:`Create your account`,description:W?`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:I,scrollRef:M,titleRef:A,children:[B,C===void 0?(0,$.jsx)(Te,{className:`h-64 w-full rounded-2xl`}):V?(0,$.jsx)(Mn,{pendingSignup:V,config:p?.status===`enabled`?p:null,onCancel:e}):U?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(Oe,{variant:`warning`,children:[(0,$.jsx)(h,{"aria-hidden":!0}),(0,$.jsx)(Ee,{children:`GitHub signup did not continue`}),(0,$.jsx)(De,{children:Ze(U.code)})]}),(0,$.jsx)(f,{variant:`outline`,onClick:e,children:`Back to sign in`})]}):(0,$.jsx)(jn,{config:p?.status===`enabled`?p:null,initialLink:l,onConsumeLink:d,onCancel:()=>{d(),O(null)}})]})}if(E===`invitation`||E===`bootstrap`)return(0,$.jsxs)(bn,{title:E===`invitation`?`Redeem your invitation`:`Claim this Hub`,description:E===`invitation`?`Enter the invitation code an owner sent you. Your browser creates a passkey at the same time.`:`No owner exists yet. The bootstrap credential from whoever deployed this Hub makes you its first owner.`,actions:P,trailing:I,scrollRef:M,titleRef:A,children:[B,(0,$.jsx)(fr,{mode:E,credentialRef:j})]});if(D!==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.`}}[D];return(0,$.jsxs)(bn,{title:e.title,description:e.description,trailing:I,scrollRef:M,titleRef:A,children:[B,D===`password`?(0,$.jsx)(Nn,{onCancel:()=>k(null),onUseRecoveryCode:()=>k(`recovery-code`),onResetPassword:()=>k(`password-reset`)}):D===`recovery-code`?(0,$.jsx)(Fn,{onCancel:()=>k(null)}):(0,$.jsx)(Pn,{initialLink:l,onConsumeLink:d,onCancel:()=>{d(),k(null)}})]})}return(0,$.jsxs)(bn,{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:F,trailing:I,scrollRef:M,titleRef:A,children:[(0,$.jsx)(tt,{}),(0,$.jsx)(cr,{bootstrapAvailable:a,publicSignupEnabled:p?.status===`enabled`}),n===`authenticating`?null:(0,$.jsxs)(f,{variant:`ghost`,size:`sm`,className:`-ml-2 mt-2 h-auto min-h-8 whitespace-normal phone:min-h-11`,onClick:()=>k(`password`),children:[(0,$.jsx)(ct,{"aria-hidden":!0}),`Password, recovery code, or reset`]}),(0,$.jsx)(ne,{}),B]})}var dr=`hub-registration-form`;function fr(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 K.redeemInvitation({secret:t,...r}):await K.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)(J,{ref:r,id:`hub-registration-credential`,type:`password`,required:!0,maxLength:128,value:i,className:q,onChange:h}),t[10]=i,t[11]=r,t[12]=g):g=t[12];let _;t[13]!==m||t[14]!==g?(_=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[m,g]}),t[13]=m,t[14]=g,t[15]=_):_=t[15];let v;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,$.jsx)(Y,{htmlFor:`hub-display-name`,children:`Display name`}),t[16]=v):v=t[16];let y;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>s(e.currentTarget.value),t[17]=y):y=t[17];let b;t[18]===o?b=t[19]:(b=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[v,(0,$.jsx)(J,{id:`hub-display-name`,required:!0,maxLength:200,value:o,className:q,onChange:y})]}),t[18]=o,t[19]=b);let x;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsxs)(Y,{htmlFor:`hub-passkey-label`,children:[`Passkey label `,(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:`(optional)`})]}),t[20]=x):x=t[20];let S;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>l(e.currentTarget.value),t[21]=S):S=t[21];let C;t[22]===c?C=t[23]:(C=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[x,(0,$.jsx)(J,{id:`hub-passkey-label`,maxLength:100,value:c,className:q,onChange:S})]}),t[22]=c,t[23]=C);let w;return t[24]!==b||t[25]!==C||t[26]!==f||t[27]!==_?(w=(0,$.jsxs)(`form`,{id:dr,className:`mt-6 space-y-4`,onSubmit:f,autoComplete:`off`,children:[_,b,C]}),t[24]=b,t[25]=C,t[26]=f,t[27]=_,t[28]=w):w=t[28],w}function pr(){let e=(0,Q.c)(20),t=c(gr),{copyToClipboard:n,isCopied:i}=d(),a=`Save all ${String(t.length)} codes — they are shown once and cannot be retrieved later. Ryco does not save them in browser storage.`,o;e[0]!==n||e[1]!==t?(o=()=>n(Xe(t),void 0),e[0]=n,e[1]=t,e[2]=o):o=e[2];let s;e[3]===i?s=e[4]:(s=i?(0,$.jsx)(r,{"aria-hidden":!0}):(0,$.jsx)(g,{"aria-hidden":!0}),e[3]=i,e[4]=s);let l=i?`Copied`:`Copy codes`,u;e[5]!==o||e[6]!==s||e[7]!==l?(u=(0,$.jsxs)(f,{variant:`outline`,className:`mt-5 w-full phone:min-h-11`,onClick:o,children:[s,l]}),e[5]=o,e[6]=s,e[7]=l,e[8]=u):u=e[8];let p;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(f,{size:`cta`,className:`mt-3 w-full`,onClick:hr,children:`I saved the codes`}),e[9]=p):p=e[9];let m;e[10]===u?m=e[11]:(m=(0,$.jsxs)(`div`,{className:`phone:mt-auto ${rt}`,children:[u,p]}),e[10]=u,e[11]=m);let h;e[12]===t?h=e[13]:(h=t.map(mr),e[12]=t,e[13]=h);let _;e[14]===h?_=e[15]:(_=(0,$.jsx)(`ul`,{"aria-label":`Recovery codes`,className:`grid gap-2 rounded-xl border border-border bg-background p-4 font-mono text-sm break-all sm:grid-cols-2`,children:h}),e[14]=h,e[15]=_);let v;return e[16]!==a||e[17]!==m||e[18]!==_?(v=(0,$.jsx)(bn,{title:`Save your recovery codes`,description:a,actions:m,children:_}),e[16]=a,e[17]=m,e[18]=_,e[19]=v):v=e[19],v}function mr(e){return(0,$.jsx)(`li`,{children:e},e)}function hr(){return K.dismissRecoveryCodes()}function gr(e){return e.recoveryCodes}function _r(e){let t=(0,Q.c)(42),{node:n,nowMs:r,disabled:i,onConnect:a,onOpenDetail:o}=e,s;t[0]!==n||t[1]!==r?(s=Vt(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=j(n),t[3]=n,t[4]=l);let u=l,d=i||u,f;t[5]!==n.environmentId||t[6]!==n.label||t[7]!==n.platformOs?(f=(0,$.jsx)(`span`,{className:`flex size-[36px] shrink-0 items-center justify-center rounded-lg bg-muted`,children:(0,$.jsx)(G,{environmentId:n.environmentId,label:n.label,platformOs:n.platformOs,className:`size-4`})}),t[5]=n.environmentId,t[6]=n.label,t[7]=n.platformOs,t[8]=f):f=t[8];let p;t[9]===n.label?p=t[10]:(p=(0,$.jsx)(`span`,{className:`block truncate font-medium`,children:n.label}),t[9]=n.label,t[10]=p);let m;t[11]===n?m=t[12]:(m=Ht(n),t[11]=n,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,$.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:m}),t[13]=m,t[14]=h);let g;t[15]===u?g=t[16]:(g=u?(0,$.jsx)(`span`,{className:`block truncate text-xs font-medium text-muted-foreground`,children:`Open in Desktop/Mobile`}):null,t[15]=u,t[16]=g);let _;t[17]!==p||t[18]!==h||t[19]!==g?(_=(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[p,h,g]}),t[17]=p,t[18]=h,t[19]=g,t[20]=_):_=t[20];let v;t[21]===n?v=t[22]:(v=(0,$.jsx)(W,{node:n}),t[21]=n,t[22]=v);let y;t[23]===c?y=t[24]:(y=c?(0,$.jsx)(`span`,{className:`whitespace-nowrap text-[11px] text-muted-foreground max-sm:hidden phone:hidden`,children:c}):null,t[23]=c,t[24]=y);let b;t[25]!==v||t[26]!==y?(b=(0,$.jsxs)(`span`,{className:`flex shrink-0 flex-col items-end gap-0.5`,children:[v,y]}),t[25]=v,t[26]=y,t[27]=b):b=t[27];let x;t[28]!==a||t[29]!==b||t[30]!==d||t[31]!==f||t[32]!==_?(x=(0,$.jsxs)(`button`,{type:`button`,disabled:d,onClick:a,className:`flex min-h-16 min-w-0 flex-1 flex-wrap items-center gap-3 px-4 py-3 text-left outline-none hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset disabled:opacity-60 disabled:hover:bg-transparent phone:min-h-18`,children:[f,_,b]}),t[28]=a,t[29]=b,t[30]=d,t[31]=f,t[32]=_,t[33]=x):x=t[33];let S;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsx)(`span`,{"aria-hidden":!0,className:`w-px shrink-0 bg-border/60`}),t[34]=S):S=t[34];let C=`Node details: ${n.label}`,w;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(D,{"aria-hidden":!0,className:`size-4`}),t[35]=w):w=t[35];let T;t[36]!==o||t[37]!==C?(T=(0,$.jsx)(`button`,{type:`button`,"aria-label":C,onClick:o,className:`flex w-[44px] shrink-0 items-center justify-center text-muted-foreground outline-none hover:bg-accent/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset`,children:w}),t[36]=o,t[37]=C,t[38]=T):T=t[38];let E;return t[39]!==x||t[40]!==T?(E=(0,$.jsxs)(`li`,{className:`flex items-stretch overflow-hidden rounded-xl border border-border bg-background`,children:[x,S,T]}),t[39]=x,t[40]=T,t[41]=E):E=t[41],E}function vr(){let e=(0,Q.c)(110),t=c(Mr),n=c(jr),r=c(Ar),i=c(kr),a=c(Or),s=c(Dr),l=B(),u=P(),d=xe()===`phone`,p=oe()?.kind===`nodes-enroll`,g=Er,[_,v]=(0,Z.useState)(null),[y,b]=(0,Z.useState)(null),x=(0,Z.useRef)(null),S=et(6e4),C,w;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{x.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=>{ae(e.id)||(await u({to:`/`,replace:!0}),await K.selectNode(e.id))},e[2]=u,e[3]=T);let E=T;if(p){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(sn,{measure:`content`,children:(0,$.jsx)(xn,{onClose:()=>g(!1)})}),e[4]=t):t=e[4],t}let D,O,k,A,j,M,N,F,I,L,R,z,V,H,U,W,ee,te;if(e[5]!==a||e[6]!==r||e[7]!==_||e[8]!==i||e[9]!==d||e[10]!==t||e[11]!==S||e[12]!==y||e[13]!==l||e[14]!==E||e[15]!==s||e[16]!==n){let o=Ut(t),c;e[35]!==_||e[36]!==t?(c=_===null?null:t.find(e=>e.id===_)??null,e[35]=_,e[36]=t,e[37]=c):c=e[37],A=c,N=a?.role===`owner`;let u=n===`ready`&&t.length===0;M=N&&!u;let p;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsxs)(f,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:Tr,children:[(0,$.jsx)(ge,{"aria-hidden":!0}),` Account`]}),e[38]=p):p=e[38],k=p;let b;e[39]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,$.jsxs)(f,{variant:`ghost`,className:`min-h-11 flex-1`,onClick:wr,children:[(0,$.jsx)(de,{"aria-hidden":!0}),` Sign out`]}),e[39]=b):b=e[39],I=b;let C=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,w,T;e[40]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>g(!0),T=(0,$.jsx)(ce,{"aria-hidden":!0}),e[40]=w,e[41]=T):(w=e[40],T=e[41]);let P;e[42]===C?P=e[43]:(P=(0,$.jsxs)(f,{className:C,onClick:w,children:[T,` Enroll node`]}),e[42]=C,e[43]=P),j=P;let B=d?`mt-3 phone:min-h-11 phone:w-full`:void 0,ne=n===`loading`,re;e[44]===n?re=e[45]:(re=n===`loading`?(0,$.jsx)(m,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,$.jsx)(me,{"aria-hidden":!0}),e[44]=n,e[45]=re);let ie;e[46]!==B||e[47]!==ne||e[48]!==re?(ie=(0,$.jsxs)(f,{className:B,variant:`outline`,disabled:ne,onClick:Cr,children:[re,`Refresh nodes`]}),e[46]=B,e[47]=ne,e[48]=re,e[49]=ie):ie=e[49],F=ie,O=sn;let ae;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,$.jsx)(f,{size:`icon`,variant:`ghost`,"aria-label":`Account settings`,onClick:Sr,children:(0,$.jsx)(ge,{"aria-hidden":!0})}),e[50]=ae):ae=e[50],e[51]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsxs)($.Fragment,{children:[ae,(0,$.jsx)(f,{size:`icon`,variant:`ghost`,"aria-label":`Sign out`,onClick:xr,children:(0,$.jsx)(de,{"aria-hidden":!0})})]}),e[51]=R):R=e[51],D=Qt,z=x,V=t.length===1?`Your node`:`Your nodes`;let oe=a?.displayName??`Hub account`,se;e[52]===a?se=e[53]:(se=a?` · ${a.role.charAt(0).toUpperCase()}${a.role.slice(1)}`:``,e[52]=a,e[53]=se);let G;e[54]!==oe||e[55]!==se?(G=(0,$.jsxs)(`p`,{className:`truncate`,children:[`Signed in as `,oe,se]}),e[54]=oe,e[55]=se,e[56]=G):G=e[56];let le;e[57]===t?le=e[58]:(le=t.length>1?(0,$.jsx)(`p`,{className:`mt-0.5 truncate text-xs`,children:Kt(t)}):null,e[57]=t,e[58]=le),e[59]!==G||e[60]!==le?(H=(0,$.jsxs)($.Fragment,{children:[G,le]}),e[59]=G,e[60]=le,e[61]=H):H=e[61],e[62]!==j||e[63]!==M||e[64]!==d||e[65]!==F?(U=d?void 0:(0,$.jsxs)($.Fragment,{children:[F,M?j:null]}),e[62]=j,e[63]=M,e[64]=d,e[65]=F,e[66]=U):U=e[66],e[67]===n?W=e[68]:(W=n===`stale`?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Oe,{variant:`warning`,role:`status`,children:[(0,$.jsx)(h,{"aria-hidden":!0}),(0,$.jsx)(De,{children:`Directory data is stale. Connecting is unavailable until it refreshes.`})]})}):null,e[67]=n,e[68]=W),e[69]===y?ee=e[70]:(ee=y?(0,$.jsx)(`div`,{className:`mt-4`,children:(0,$.jsxs)(Oe,{variant:`warning`,role:`status`,children:[(0,$.jsx)(h,{"aria-hidden":!0}),(0,$.jsx)(De,{children:y})]})}):null,e[69]=y,e[70]=ee);let ue=n===`stale`?null:i;e[71]!==l||e[72]!==s||e[73]!==ue?(te=(0,$.jsx)(Nr,{selection:s,routeNotice:l,error:ue}),e[71]=l,e[72]=s,e[73]=ue,e[74]=te):te=e[74],L=u?(0,$.jsx)(Pr,{isOwner:N,onEnroll:()=>g(!0)}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`ul`,{role:`list`,className:`mt-5 space-y-2`,"aria-busy":n===`loading`,children:[o.map(e=>(0,$.jsx)(_r,{node:e,nowMs:S,disabled:qt({directoryStatus:n,browserStatus:r,node:e}),onConnect:()=>void E(e),onOpenDetail:()=>v(e.id)},`${e.id}:${e.environmentId}`)),n===`loading`&&t.length===0?(0,$.jsx)($.Fragment,{children:[0,1,2].map(br)}):null]}),n===`loading`&&t.length===0?(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:`Loading authorized nodes…`}):null,t.length>0?(0,$.jsx)(`p`,{className:`mt-2 px-1 text-[11px] text-muted-foreground`,children:`Presence refreshes about every 20 seconds.`}):null]}),e[5]=a,e[6]=r,e[7]=_,e[8]=i,e[9]=d,e[10]=t,e[11]=S,e[12]=y,e[13]=l,e[14]=E,e[15]=s,e[16]=n,e[17]=D,e[18]=O,e[19]=k,e[20]=A,e[21]=j,e[22]=M,e[23]=N,e[24]=F,e[25]=I,e[26]=L,e[27]=R,e[28]=z,e[29]=V,e[30]=H,e[31]=U,e[32]=W,e[33]=ee,e[34]=te}else D=e[17],O=e[18],k=e[19],A=e[20],j=e[21],M=e[22],N=e[23],F=e[24],I=e[25],L=e[26],R=e[27],z=e[28],V=e[29],H=e[30],U=e[31],W=e[32],ee=e[33],te=e[34];let re,ie;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,$.jsx)(`div`,{className:`mt-5`,children:(0,$.jsx)(tt,{})}),ie=(0,$.jsx)(ne,{}),e[75]=re,e[76]=ie):(re=e[75],ie=e[76]);let se;e[77]===Symbol.for(`react.memo_cache_sentinel`)?(se=e=>{e||v(null)},e[77]=se):se=e[77];let G;e[78]===E?G=e[79]:(G=e=>void E(e),e[78]=E,e[79]=G);let le;e[80]===Symbol.for(`react.memo_cache_sentinel`)?(le=async e=>{await o.revokeNode(e.id,St),b(Dt(e.label)),await K.refreshDirectory(),v(null)},e[80]=le):le=e[80];let ue;e[81]!==r||e[82]!==A||e[83]!==N||e[84]!==n||e[85]!==G?(ue=(0,$.jsx)(Zt,{node:A,directoryStatus:n,browserStatus:r,canRename:N,canRevoke:N,onOpenChange:se,onConnect:G,onRename:yr,onRevoke:le}),e[81]=r,e[82]=A,e[83]=N,e[84]=n,e[85]=G,e[86]=ue):ue=e[86];let fe;e[87]!==D||e[88]!==L||e[89]!==ue||e[90]!==z||e[91]!==V||e[92]!==H||e[93]!==U||e[94]!==W||e[95]!==ee||e[96]!==te?(fe=(0,$.jsxs)(D,{titleRef:z,title:V,description:H,actions:U,children:[W,ee,te,L,re,ie,ue]}),e[87]=D,e[88]=L,e[89]=ue,e[90]=z,e[91]=V,e[92]=H,e[93]=U,e[94]=W,e[95]=ee,e[96]=te,e[97]=fe):fe=e[97];let pe;e[98]!==k||e[99]!==j||e[100]!==M||e[101]!==d||e[102]!==F||e[103]!==I?(pe=d?(0,$.jsxs)(`div`,{className:`mt-auto ${rt}`,children:[(0,$.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[k,I]}),M?j:null,F]}):null,e[98]=k,e[99]=j,e[100]=M,e[101]=d,e[102]=F,e[103]=I,e[104]=pe):pe=e[104];let he;return e[105]!==O||e[106]!==R||e[107]!==fe||e[108]!==pe?(he=(0,$.jsxs)(O,{trailing:R,children:[fe,pe]}),e[105]=O,e[106]=R,e[107]=fe,e[108]=pe,e[109]=he):he=e[109],he}async function yr(e,t){await o.renameNode(e.id,t),await K.refreshDirectory()}function br(e){return(0,$.jsx)(`li`,{children:(0,$.jsx)(Te,{className:`h-16 w-full rounded-xl`})},e)}function xr(){K.signOut()}function Sr(){H({kind:`account`,section:`security`})}function Cr(){K.refreshDirectory()}function wr(){K.signOut()}function Tr(){H({kind:`account`,section:`security`})}function Er(e){return H(e?{kind:`nodes-enroll`}:{kind:`nodes`})}function Dr(e){return e.selectionStatus}function Or(e){return e.account}function kr(e){return e.errorMessage}function Ar(e){return e.browserStatus}function jr(e){return e.directoryStatus}function Mr(e){return e.nodes}function Nr(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)(h,{"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)(Oe,{variant:`error`,children:[o,(0,$.jsx)(De,{children:a})]})}),t[1]=a,t[2]=s),s}function Pr(e){let t=(0,Q.c)(14),{isOwner:n,onEnroll:r}=e,i;t[0]===n?i=t[1]:(i=(0,$.jsx)(We,{variant:`icon`,children:n?(0,$.jsx)(ce,{"aria-hidden":!0}):(0,$.jsx)(he,{"aria-hidden":!0})}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(qe,{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)(Je,{children:o}),t[3]=o,t[4]=s);let c;t[5]!==i||t[6]!==s?(c=(0,$.jsxs)(Ge,{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)(Ke,{children:(0,$.jsxs)(f,{className:`phone:min-h-11`,onClick:r,children:[(0,$.jsx)(ce,{"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)(Ye,{className:`min-h-64`,children:[c,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function Fr(){let e=(0,Q.c)(1);if(!He())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(f,{variant:`ghost`,className:`mt-3`,onClick:Ir,children:`Cancel device switch`}),e[0]=t):t=e[0],t}function Ir(){return Ue.cancel()}export{ur as HostedAuthenticationSurface,Vn as HostedHubRoot};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-BqSANuAs.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-BqZvnGNr.js";import{$l as n,Dr as r,I as i,P as a,Qr as o,ao as s,mo as c,oo as l,so as u}from"./runtime-BwHA1GUS.js";import{t as d}from"./react-CwJFpaho.js";import{t as f}from"./log-out-D5-aSBAz.js";import{t as p}from"./shield-check-CGD7sEeF.js";import{t as m}from"./smartphone-DgVJfbv3.js";import{_ as h,o as g}from"./authorization-D8dOcEYq.js";import{i as _,r as v,t as y}from"./alert-DQEkrtUJ.js";var b=e(d(),1),x=n(),S=(0,b.lazy)(()=>t(()=>import(`./HostedHubRoot-gp7-ClBP.js`).then(e=>({default:e.HostedAuthenticationSurface})),__vite__mapDeps([0])));function C(e){window.location.assign(e)}function w({handoffId:e,navigate:t=C}){let n=a(e=>e.accountStatus),d=a(e=>e.account),[w,T]=(0,b.useState)(null),[E,D]=(0,b.useState)(!0),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(null),[M,N]=(0,b.useState)(null),P=(0,b.useRef)(null);if((0,b.useEffect)(()=>{let t=new AbortController;return D(!0),N(null),i.getNativeHandoffPresentation(e,t.signal).then(e=>T(e)).catch(e=>{t.signal.aborted||N(e instanceof h?e.message:`This device authorization is unavailable or has expired.`)}).finally(()=>{t.signal.aborted||D(!1)}),()=>t.abort()},[e]),(0,b.useEffect)(()=>{!E&&n===`authenticated`&&P.current?.focus({preventScroll:!0})},[n,E]),n!==`authenticated`||!d)return(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(S,{context:`native-authorization`,autoExternalProvider:w?.providerHint??null})});let F=async n=>{if(O===null){k(n),N(null);try{if(n===`switch-account`){await g.signOut();return}let r=n===`approve`?await i.approveNativeHandoff(e):await i.cancelNativeHandoff(e);n===`approve`&&(j({redirectUri:r.redirectUri,deviceLabel:w?.deviceLabel??`your device`}),await new Promise(e=>requestAnimationFrame(()=>e()))),t(r.redirectUri)}catch(e){n===`approve`&&j(null),N(e instanceof h?e.message:`The device authorization could not be completed.`)}finally{k(null)}}};return A===null?(0,x.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center overflow-x-hidden bg-background px-4 py-10 text-foreground sm:px-6`,children:(0,x.jsxs)(`section`,{className:`w-full max-w-md rounded-[1.5rem] border border-border bg-card p-5 shadow-2xl shadow-black/10 sm:p-7`,children:[(0,x.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,x.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl border border-border bg-background text-primary`,children:(0,x.jsx)(p,{"aria-hidden":!0,className:`size-5`})}),(0,x.jsxs)(`p`,{className:`pt-1 text-[11px] font-semibold tracking-[0.16em] text-muted-foreground uppercase`,children:[r,` Hub`]})]}),(0,x.jsx)(`h1`,{ref:P,tabIndex:-1,className:`mt-6 text-2xl font-semibold tracking-tight outline-none`,children:`Continue on this device?`}),(0,x.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`Only continue if you started this connection from the Ryco app. The app receives a one-time code, never this browser session.`}),(0,x.jsxs)(`div`,{className:`mt-6 overflow-hidden rounded-2xl border border-border bg-background/65`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3.5`,children:[(0,x.jsx)(m,{"aria-hidden":!0,className:`size-5 text-muted-foreground`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Requesting device`}),(0,x.jsx)(`p`,{className:`truncate text-sm font-medium`,children:E?`Checking request…`:w?.deviceLabel??`Unknown device`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,x.jsx)(`div`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/12 text-xs font-semibold text-primary`,children:d.displayName.trim().slice(0,1).toLocaleUpperCase()||`R`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Signed in as`}),(0,x.jsx)(`p`,{className:`truncate text-sm font-medium`,children:d.displayName})]})]})]}),M?(0,x.jsxs)(y,{variant:`error`,className:`mt-4`,children:[(0,x.jsx)(l,{"aria-hidden":!0}),(0,x.jsx)(_,{children:`Authorization did not complete`}),(0,x.jsx)(v,{children:M})]}):null,(0,x.jsxs)(`div`,{className:`mt-6 space-y-2.5`,children:[(0,x.jsxs)(o,{size:`lg`,className:`min-h-11 w-full`,disabled:E||!w||O!==null,onClick:()=>void F(`approve`),children:[O===`approve`?(0,x.jsx)(u,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(c,{"aria-hidden":!0}),`Continue as `,d.displayName]}),(0,x.jsxs)(o,{size:`lg`,variant:`outline`,className:`min-h-11 w-full`,disabled:O!==null,onClick:()=>void F(`switch-account`),children:[O===`switch-account`?(0,x.jsx)(u,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(f,{"aria-hidden":!0}),`Use another account`]}),(0,x.jsxs)(o,{size:`lg`,variant:`ghost`,className:`min-h-11 w-full`,disabled:E||!w||O!==null,onClick:()=>void F(`cancel`),children:[O===`cancel`?(0,x.jsx)(u,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(s,{"aria-hidden":!0}),`Cancel`]})]}),(0,x.jsx)(`p`,{className:`mt-5 text-center text-xs leading-relaxed text-muted-foreground`,children:`Access remains limited to the nodes and permissions assigned to this Hub account.`})]})}):(0,x.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center overflow-hidden bg-background px-4 py-10 text-foreground sm:px-6`,children:(0,x.jsxs)(`section`,{role:`status`,"aria-live":`polite`,className:`w-full max-w-md rounded-[1.5rem] border border-border bg-card p-6 text-center shadow-2xl shadow-black/10 sm:p-8`,children:[(0,x.jsxs)(`div`,{className:`relative mx-auto flex size-24 items-center justify-center`,children:[(0,x.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-2 rounded-full bg-success/20 motion-safe:animate-ping`}),(0,x.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 rounded-full border border-success/25 motion-safe:animate-pulse`}),(0,x.jsx)(`span`,{className:`relative flex size-16 items-center justify-center rounded-full bg-success text-success-foreground shadow-lg shadow-success/20`,children:(0,x.jsx)(c,{"aria-hidden":!0,className:`size-8`,strokeWidth:2.5})})]}),(0,x.jsx)(`p`,{className:`mt-7 text-[11px] font-semibold tracking-[0.16em] text-success uppercase`,children:`Sign-in approved`}),(0,x.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Ryco is opening`}),(0,x.jsxs)(`p`,{className:`mt-3 text-sm leading-relaxed text-muted-foreground`,children:[`Ryco is securely finishing account and node setup on `,A.deviceLabel,`. This tab can be closed when the app shows setup complete.`]}),(0,x.jsx)(`div`,{className:`mt-7 rounded-2xl border border-border bg-background/65 p-4`,children:(0,x.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-sm font-medium`,children:[(0,x.jsx)(m,{"aria-hidden":!0,className:`size-4 text-primary`}),`Waiting for the Ryco app`,(0,x.jsxs)(`span`,{className:`flex gap-1`,"aria-hidden":!0,children:[(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse`}),(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse [animation-delay:150ms]`}),(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse [animation-delay:300ms]`})]})]})}),(0,x.jsx)(o,{size:`lg`,variant:`outline`,className:`mt-5 min-h-11 w-full`,onClick:()=>t(A.redirectUri),children:`Open Ryco again`})]})})}export{w as HostedNativeAuthorizationRoute};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-Di0isH9D.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-DARIYokI.js";import{Cs as n,I as r,P as i,Zi as a,ad as o,gs as s,hs as c,ms as l,wi as u}from"./runtime-DjjjAcTE.js";import{t as d}from"./react-CwJFpaho.js";import{t as f}from"./log-out-CKq9YiLY.js";import{t as p}from"./shield-check-_wl7R4Js.js";import{t as m}from"./smartphone-OEAQOTdv.js";import{A as h,o as g}from"./authorization-Ob6YwWiI.js";import{i as _,r as v,t as y}from"./alert-FV7ZIit_.js";var b=e(d(),1),x=o(),S=(0,b.lazy)(()=>t(()=>import(`./HostedHubRoot-CM2CwPUr.js`).then(e=>({default:e.HostedAuthenticationSurface})),__vite__mapDeps([0])));function C(e){window.location.assign(e)}function w({handoffId:e,navigate:t=C}){let o=i(e=>e.accountStatus),d=i(e=>e.account),[w,T]=(0,b.useState)(null),[E,D]=(0,b.useState)(!0),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(null),[M,N]=(0,b.useState)(null),P=(0,b.useRef)(null);if((0,b.useEffect)(()=>{let t=new AbortController;return D(!0),N(null),r.getNativeHandoffPresentation(e,t.signal).then(e=>T(e)).catch(e=>{t.signal.aborted||N(e instanceof h?e.message:`This device authorization is unavailable or has expired.`)}).finally(()=>{t.signal.aborted||D(!1)}),()=>t.abort()},[e]),(0,b.useEffect)(()=>{!E&&o===`authenticated`&&P.current?.focus({preventScroll:!0})},[o,E]),o!==`authenticated`||!d)return(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(S,{context:`native-authorization`,autoExternalProvider:w?.providerHint??null})});let F=async n=>{if(O===null){k(n),N(null);try{if(n===`switch-account`){await g.signOut();return}let i=n===`approve`?await r.approveNativeHandoff(e):await r.cancelNativeHandoff(e);n===`approve`&&(j({redirectUri:i.redirectUri,deviceLabel:w?.deviceLabel??`your device`}),await new Promise(e=>requestAnimationFrame(()=>e()))),t(i.redirectUri)}catch(e){n===`approve`&&j(null),N(e instanceof h?e.message:`The device authorization could not be completed.`)}finally{k(null)}}};return A===null?(0,x.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center overflow-x-hidden bg-background px-4 py-10 text-foreground sm:px-6`,children:(0,x.jsxs)(`section`,{className:`w-full max-w-md rounded-[1.5rem] border border-border bg-card p-5 shadow-2xl shadow-black/10 sm:p-7`,children:[(0,x.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,x.jsx)(`div`,{className:`flex size-11 shrink-0 items-center justify-center rounded-xl border border-border bg-background text-primary`,children:(0,x.jsx)(p,{"aria-hidden":!0,className:`size-5`})}),(0,x.jsxs)(`p`,{className:`pt-1 text-[11px] font-semibold tracking-[0.16em] text-muted-foreground uppercase`,children:[u,` Hub`]})]}),(0,x.jsx)(`h1`,{ref:P,tabIndex:-1,className:`mt-6 text-2xl font-semibold tracking-tight outline-none`,children:`Continue on this device?`}),(0,x.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-muted-foreground`,children:`Only continue if you started this connection from the Ryco app. The app receives a one-time code, never this browser session.`}),(0,x.jsxs)(`div`,{className:`mt-6 overflow-hidden rounded-2xl border border-border bg-background/65`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border px-4 py-3.5`,children:[(0,x.jsx)(m,{"aria-hidden":!0,className:`size-5 text-muted-foreground`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Requesting device`}),(0,x.jsx)(`p`,{className:`truncate text-sm font-medium`,children:E?`Checking request…`:w?.deviceLabel??`Unknown device`})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3.5`,children:[(0,x.jsx)(`div`,{"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/12 text-xs font-semibold text-primary`,children:d.displayName.trim().slice(0,1).toLocaleUpperCase()||`R`}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Signed in as`}),(0,x.jsx)(`p`,{className:`truncate text-sm font-medium`,children:d.displayName})]})]})]}),M?(0,x.jsxs)(y,{variant:`error`,className:`mt-4`,children:[(0,x.jsx)(c,{"aria-hidden":!0}),(0,x.jsx)(_,{children:`Authorization did not complete`}),(0,x.jsx)(v,{children:M})]}):null,(0,x.jsxs)(`div`,{className:`mt-6 space-y-2.5`,children:[(0,x.jsxs)(a,{size:`lg`,className:`min-h-11 w-full`,disabled:E||!w||O!==null,onClick:()=>void F(`approve`),children:[O===`approve`?(0,x.jsx)(s,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(n,{"aria-hidden":!0}),`Continue as `,d.displayName]}),(0,x.jsxs)(a,{size:`lg`,variant:`outline`,className:`min-h-11 w-full`,disabled:O!==null,onClick:()=>void F(`switch-account`),children:[O===`switch-account`?(0,x.jsx)(s,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(f,{"aria-hidden":!0}),`Use another account`]}),(0,x.jsxs)(a,{size:`lg`,variant:`ghost`,className:`min-h-11 w-full`,disabled:E||!w||O!==null,onClick:()=>void F(`cancel`),children:[O===`cancel`?(0,x.jsx)(s,{"aria-hidden":!0,className:`animate-spin motion-reduce:animate-none`}):(0,x.jsx)(l,{"aria-hidden":!0}),`Cancel`]})]}),(0,x.jsx)(`p`,{className:`mt-5 text-center text-xs leading-relaxed text-muted-foreground`,children:`Access remains limited to the nodes and permissions assigned to this Hub account.`})]})}):(0,x.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center overflow-hidden bg-background px-4 py-10 text-foreground sm:px-6`,children:(0,x.jsxs)(`section`,{role:`status`,"aria-live":`polite`,className:`w-full max-w-md rounded-[1.5rem] border border-border bg-card p-6 text-center shadow-2xl shadow-black/10 sm:p-8`,children:[(0,x.jsxs)(`div`,{className:`relative mx-auto flex size-24 items-center justify-center`,children:[(0,x.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-2 rounded-full bg-success/20 motion-safe:animate-ping`}),(0,x.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-0 rounded-full border border-success/25 motion-safe:animate-pulse`}),(0,x.jsx)(`span`,{className:`relative flex size-16 items-center justify-center rounded-full bg-success text-success-foreground shadow-lg shadow-success/20`,children:(0,x.jsx)(n,{"aria-hidden":!0,className:`size-8`,strokeWidth:2.5})})]}),(0,x.jsx)(`p`,{className:`mt-7 text-[11px] font-semibold tracking-[0.16em] text-success uppercase`,children:`Sign-in approved`}),(0,x.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Ryco is opening`}),(0,x.jsxs)(`p`,{className:`mt-3 text-sm leading-relaxed text-muted-foreground`,children:[`Ryco is securely finishing account and node setup on `,A.deviceLabel,`. This tab can be closed when the app shows setup complete.`]}),(0,x.jsx)(`div`,{className:`mt-7 rounded-2xl border border-border bg-background/65 p-4`,children:(0,x.jsxs)(`div`,{className:`flex items-center justify-center gap-2 text-sm font-medium`,children:[(0,x.jsx)(m,{"aria-hidden":!0,className:`size-4 text-primary`}),`Waiting for the Ryco app`,(0,x.jsxs)(`span`,{className:`flex gap-1`,"aria-hidden":!0,children:[(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse`}),(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse [animation-delay:150ms]`}),(0,x.jsx)(`span`,{className:`size-1 rounded-full bg-primary motion-safe:animate-pulse [animation-delay:300ms]`})]})]})}),(0,x.jsx)(a,{size:`lg`,variant:`outline`,className:`mt-5 min-h-11 w-full`,onClick:()=>t(A.redirectUri),children:`Open Ryco again`})]})})}export{w as HostedNativeAuthorizationRoute};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Zi as t,ad as n,ws as r}from"./runtime-DjjjAcTE.js";import{t as i}from"./react-CwJFpaho.js";import{A as a,D as o,M as s,N as c,P as l,j as u,k as d}from"./popover-OWEv6cQz.js";import{i as f}from"./presentationTier-DPVAxTK4.js";import{t as p}from"./input-CCie4mm1.js";var m={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};m.node;var h=r(m),g=f(),_=e(i(),1),v=n(),y=100;function b(e){let n=(0,g.c)(55),{node:r,open:i,onOpenChange:f,onRename:m}=e,[h,b]=(0,_.useState)(r.label),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(null),T,E;n[0]!==r.label||n[1]!==i?(T=()=>{i&&(b(r.label),S(!1),w(null))},E=[r.label,i],n[0]=r.label,n[1]=i,n[2]=T,n[3]=E):(T=n[2],E=n[3]),(0,_.useEffect)(T,E);let D;n[4]===h?D=n[5]:(D=h.trim(),n[4]=h,n[5]=D);let O=D,k=O.length===0?`Enter a device name.`:O.length>y?`Use 100 characters or fewer.`:null,A=k===null&&O!==r.label&&!x,j;n[6]!==A||n[7]!==O||n[8]!==f||n[9]!==m?(j=async()=>{if(A){S(!0),w(null);try{await m(O),f(!1)}catch(e){let t=e;w(t instanceof Error?t.message:`Unable to rename this device.`),S(!1)}}},n[6]=A,n[7]=O,n[8]=f,n[9]=m,n[10]=j):j=n[10];let M=j,N;n[11]!==f||n[12]!==x?(N=e=>{x||f(e)},n[11]=f,n[12]=x,n[13]=N):N=n[13];let P=!x,F;n[14]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,v.jsxs)(u,{children:[(0,v.jsx)(l,{children:`Rename device`}),(0,v.jsx)(d,{children:`This is the canonical name shown to everyone authorized to use this device.`})]}),n[14]=F):F=n[14];let I;n[15]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,v.jsx)(`label`,{htmlFor:`hosted-node-name`,className:`text-sm font-medium`,children:`Device name`}),n[15]=I):I=n[15];let L=k!==null||C!==null,R;n[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{b(e.currentTarget.value),w(null)},n[16]=R):R=n[16];let z;n[17]!==A||n[18]!==M?(z=e=>{e.key===`Enter`&&A&&M()},n[17]=A,n[18]=M,n[19]=z):z=n[19];let B;n[20]!==h||n[21]!==x||n[22]!==z||n[23]!==L?(B=(0,v.jsx)(p,{id:`hosted-node-name`,value:h,autoFocus:!0,disabled:x,"aria-invalid":L,onChange:R,onKeyDown:z}),n[20]=h,n[21]=x,n[22]=z,n[23]=L,n[24]=B):B=n[24];let V;n[25]===k?V=n[26]:(V=k?(0,v.jsx)(`p`,{className:`text-xs text-destructive`,children:k}):null,n[25]=k,n[26]=V);let H;n[27]===C?H=n[28]:(H=C?(0,v.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:C}):null,n[27]=C,n[28]=H);let U;n[29]!==B||n[30]!==V||n[31]!==H?(U=(0,v.jsxs)(s,{className:`space-y-2`,children:[I,B,V,H]}),n[29]=B,n[30]=V,n[31]=H,n[32]=U):U=n[32];let W;n[33]===f?W=n[34]:(W=()=>f(!1),n[33]=f,n[34]=W);let G;n[35]!==x||n[36]!==W?(G=(0,v.jsx)(t,{variant:`outline`,disabled:x,onClick:W,children:`Cancel`}),n[35]=x,n[36]=W,n[37]=G):G=n[37];let K=!A,q;n[38]===M?q=n[39]:(q=()=>void M(),n[38]=M,n[39]=q);let J=x?`Saving…`:`Save`,Y;n[40]!==K||n[41]!==q||n[42]!==J?(Y=(0,v.jsx)(t,{disabled:K,onClick:q,children:J}),n[40]=K,n[41]=q,n[42]=J,n[43]=Y):Y=n[43];let X;n[44]!==G||n[45]!==Y?(X=(0,v.jsxs)(a,{children:[G,Y]}),n[44]=G,n[45]=Y,n[46]=X):X=n[46];let Z;n[47]!==U||n[48]!==X||n[49]!==P?(Z=(0,v.jsxs)(c,{className:`max-w-md`,showCloseButton:P,children:[F,U,X]}),n[47]=U,n[48]=X,n[49]=P,n[50]=Z):Z=n[50];let Q;return n[51]!==i||n[52]!==Z||n[53]!==N?(Q=(0,v.jsx)(o,{open:i,onOpenChange:N,children:Z}),n[51]=i,n[52]=Z,n[53]=N,n[54]=Q):Q=n[54],Q}export{h as n,b as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Nt as t,Pt as n,ad as r}from"./runtime-DjjjAcTE.js";import{t as i}from"./react-CwJFpaho.js";import{i as a}from"./presentationTier-DPVAxTK4.js";import{t as o}from"./shield-alert-Dc2cGwyR.js";import{t as s}from"./shield-CBHYqlkR.js";import{$ as c,n as l,nt as u,t as d}from"./authorization-Ob6YwWiI.js";function f(e){return l(e)}function p(e){return d(e)}var m=a(),h=e(i(),1),g=()=>n().status;function _(){return(0,h.useSyncExternalStore)(t,g,g)}var v=()=>n().verificationCode;function y(){return(0,h.useSyncExternalStore)(t,v,v)}function b(e){let t=e.split(u.separator);if(t.length!==u.groups)return[];for(let e of t){if(e.length!==u.charsPerGroup)return[];for(let t of e)if(!`0123456789ABCDEFGHJKMNPQRSTVWXYZ`.includes(t))return[]}return t}u.chars*Math.log2(c.length);var x=`Compare this code with the one your node's CLI shows for this session. A match catches accidental wrong-node routing and some network interposition while the loaded code is honest; it cannot protect against the Hub operator, who serves this page, and it does not rule out someone sitting in the middle.`,S=`Settings → Security explains what else this tab cannot check.`,C=`Compare this code with the one your node's CLI shows for this session. A match catches accidental wrong-node routing and some network interposition while the loaded code is honest. This tab pins no node identity, so that comparison is the only thing that speaks to whether the far end is your machine or the Hub standing in for it — and it cannot protect against the Hub operator, who serves this page and could serve code that completes the same handshake and displays this same code anyway. A match does not rule out someone sitting in the middle.`,w="Run `ryco e2ee sessions` on the machine running the node to read its end of the comparison.",T=`No session code is available for this channel, so there is nothing here to compare against your node's CLI.`;function E(e){return e?`inline`:`settings`}var D={inline:{advisory:x,more:S},settings:{advisory:C,more:w}};Object.keys(D);function O(e,t){if(e===null)return null;let n=b(e);if(n.length===0)return null;let{advisory:r,more:i}=D[t];return{groups:n,display:n.join(u.separator),advisory:r,more:i}}var k={unavailable:{tone:`caution`,body:`Hosted connections reach your nodes through the Ryco Hub over WSS. No node channel is open in this tab, so the Hub still forwards what you send in a form it can read, and it is expected not to log or keep it.`},negotiating:{tone:`caution`,body:`This tab is still agreeing a channel with your node and has released nothing to it yet. Until that settles, treat this connection as one the Hub can read.`},"web-unsigned":{tone:`advisory`,body:`This tab and the node it was routed to agreed a browser channel, so while the code this page is running is honest the Hub relays ciphertext instead of readable payload. It is weaker than the channel the Ryco mobile app gets, in two ways this tab cannot close. This tab pins no node identity, so it cannot tell whether the far end of that channel is your machine or the Hub standing in for it. And it cannot protect against the Hub operator, who serves every byte of this page's JavaScript and could serve code that completes the same handshake and copies your data anyway. Its downgrade check is held in memory only — empty again in every new tab and after every reload, and worth nothing against that operator. Only your node can close the plaintext path for browsers.`},legacy:{tone:`caution`,body:`This channel fell back to legacy plaintext. This tab cannot tell whether your node offered no encrypted channel or something on the path removed the offer, so treat everything sent over it as readable by the Hub, which is expected not to log or keep it. Only your node can refuse plaintext for browsers.`}};function A(e){return k[e]}Object.keys(k);var j=r();function M(e){let t=(0,m.c)(16),{compact:n}=e,r=n!==void 0&&n,i=_(),a;t[0]===i?a=t[1]:(a=A(i),t[0]=i,t[1]=a);let{tone:c,body:l}=a,u=c===`advisory`?s:o,d=c===`advisory`?`text-sky-600`:`text-amber-600`,f=r?`flex gap-2 text-xs leading-relaxed text-muted-foreground`:`flex gap-2 rounded-lg border px-3 py-2.5 text-xs leading-relaxed text-muted-foreground ${c===`advisory`?`border-sky-500/25 bg-sky-500/5`:`border-amber-500/25 bg-amber-500/5`}`,p=`mt-0.5 size-4 shrink-0 ${d}`,h;t[2]!==u||t[3]!==p?(h=(0,j.jsx)(u,{"aria-hidden":!0,className:p}),t[2]=u,t[3]=p,t[4]=h):h=t[4];let g;t[5]===l?g=t[6]:(g=(0,j.jsx)(`p`,{children:l}),t[5]=l,t[6]=g);let v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,j.jsx)(`p`,{children:`Cloud history keeps a readable copy of recent conversation text on the Hub so threads can open before a device connects. This copy is separate from the live node channel.`}),t[7]=v):v=t[7];let y;t[8]===g?y=t[9]:(y=(0,j.jsxs)(`div`,{className:`space-y-2`,children:[g,v]}),t[8]=g,t[9]=y);let b;return t[10]!==i||t[11]!==f||t[12]!==h||t[13]!==y||t[14]!==c?(b=(0,j.jsxs)(`div`,{className:f,"data-hosted-relay-trust-notice":`true`,"data-e2ee-status":i,"data-tone":c,children:[h,y]}),t[10]=i,t[11]=f,t[12]=h,t[13]=y,t[14]=c,t[15]=b):b=t[15],b}export{_ as a,f as c,O as i,T as n,y as o,E as r,p as s,M as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{cn as t,on as n}from"./primary-Cf-xJExj.js";import{Lt as r,lt as i,ro as a}from"./wsTransport-C88seBPA.js";import{$i as o,Dn as s,Dr as c,Gi as l,ad as u,an as d,cn as f,in as p,is as m,ln as h,ls as g,ns as _,rn as v,sn as y,ud as b,ws as x}from"./runtime-DjjjAcTE.js";import{t as S}from"./react-CwJFpaho.js";import{K as C,q as w}from"./popover-OWEv6cQz.js";import{i as T}from"./presentationTier-DPVAxTK4.js";import"./combobox-Dtjtf7AB.js";import{A as E}from"./main-Ch0bwS-M.js";var D={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};D.node;var O=x(D);function k(e,t){return t===`claudeAgent`?e.replace(/^Claude\s+/i,``):e}var ee=a(i);function te(e){let t=e.toSorted((e,t)=>(t.sequence??0)-(e.sequence??0)||t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id));for(let e of t){if(e.kind!==`context-handoff`)continue;let t=ee(e.payload);if(t._tag===`Some`&&t.value.status===`consumed`&&!s(t.value))return t.value}return null}function A(e){return{...e,...e.modelDisplayName?{modelDisplayName:k(e.modelDisplayName,e.driverKind)}:{}}}async function ne(e,t,n,r){if(!e.orchestration.getThreadWindow)return null;let i=await e.orchestration.getThreadWindow({threadId:t,limits:{messages:1,proposedPlans:1,activities:100,checkpoints:1}}),a=i.thread.activities,o=i.history.activities;for(;!r();){let r=te(a);if(r){if(r.targetSelection.instanceId!==n.instanceId||r.targetSelection.model!==n.model)return null;let e=r.sources.find(e=>e.providerInstanceId===r.sourceSelection.instanceId&&e.modelSlug===r.sourceSelection.model);return e?{source:A(e),target:A(r.target)}:null}if(!o.hasMoreBefore||!o.oldestCursor||!e.orchestration.getThreadHistoryPage)return null;let i=o.oldestCursor,s=await e.orchestration.getThreadHistoryPage({threadId:t,collection:`activities`,mode:{kind:`before`,cursor:i},limit:100});if(s.collection!==`activities`||(a=s.items,o=s.page,o.oldestCursor===i&&o.hasMoreBefore))return null}return null}function re(e){return y(e)}function ie(e){let t=e.connectionState===`error`?`reconnecting`:e.connectionState,n=e.hydratedFromCache||t===`offline`;return{environmentId:e.environmentId,label:e.label,connectionState:t,stale:n,...n?{staleDetail:`Offline · last known`}:{},role:`owner`,trust:`not-required`,deliveryUnknown:!1,threadSettlementSupported:e.threadSettlementSupported,threadSnoozeSupported:e.threadSnoozeSupported,mutationReady:t===`connected`&&!n,shellCurrent:!n}}function ae(e){let t=e.runtime,n=t?.authState===`requires-auth`,r=n?`disconnected`:t?.connectionState??`disconnected`,i=e.hydratedFromCache||r!==`connected`;return{environmentId:e.environmentId,label:e.label,connectionState:r===`connected`?`connected`:r===`connecting`?`connecting`:r===`error`?`reconnecting`:`offline`,stale:i,...n?{staleDetail:`Needs re-pair`}:i?{staleDetail:`Offline · last known`}:{},role:t?.role??null,trust:`unknown`,deliveryUnknown:!1,threadSnoozeSupported:t?.descriptor?.capabilities.threadSnooze??!1,threadSettlementSupported:t?.descriptor?.capabilities.threadSettlement??!1,mutationReady:r===`connected`&&(t?.role===`owner`||t?.role===`client`)&&!i,shellCurrent:!i}}var j={"delivery-unknown":0,error:1,limited:1,working:2,connecting:3,reconnecting:4};function oe(e){let t=e.session?.provider??e.providerDriver??null;if(t)return t;let n=e.modelSelection?.instanceId;return n?h.find(e=>r(e.value)===n)?.value??null:null}function se(e,r,i,a){if(r?.stale||r?.connectionState===`offline`)return`offline`;let o=f(e);return o===`approval`||o===`input`||o===`plan-ready`?`needs-input`:r?.deliveryUnknown||i.has(t(n(e.environmentId,e.id)))?`delivery-unknown`:o===`working`?`working`:o===`connecting`||r?.connectionState===`connecting`?`connecting`:v(e,a)===null?e.session?.status===`error`||e.latestTurn?.state===`error`?`error`:r?.connectionState===`reconnecting`?`reconnecting`:`idle`:`limited`}function ce(e){let t=f(e);return t===`approval`?`approval`:t===`plan-ready`?`plan`:`input`}function le(e){let t=e.latestTurn;return t?.state===`running`?t.startedAt??t.requestedAt:null}function ue(e,t,n){switch(e){case`limited`:return n?.label??`Limited`;case`needs-input`:return`Needs input`;case`delivery-unknown`:return`Check delivery`;case`working`:return`Working`;case`connecting`:return`Connecting`;case`error`:return`Error`;case`reconnecting`:return`Reconnecting`;case`offline`:return t?.staleDetail??`Offline`;case`idle`:return`Idle`}}function de(e){let t=Date.now(),n=se(e,void 0,new Set,t);return{state:n,statusLabel:ue(n,void 0,n===`limited`?v(e,t):null),attention:n===`needs-input`?ce(e):null}}function M(e){return e===`needs-input`?`needs-input`:e===`idle`||e===`offline`?`recent`:`active`}var fe=[],N=`Unknown project`;function pe(e,r){let i=new Map(r.map(e=>[t(n(e.environmentId,e.id)),e.lineage])),a=e.map(e=>({key:e.key,environmentId:e.environmentId,threadId:e.threadId,lineage:e.lineage,pinned:e.pinned,focused:e.focus!==null,urgency:e.snoozedUntil?`snoozed`:e.settled?`settled`:M(e.state)})),o=c(a,{lineageByKey:i});if(o.hostByChildKey.size===0)return[...e];let s=new Map(e.map(e=>[e.key,e]));return e.flatMap(e=>{if(o.hostByChildKey.has(e.key))return[];let t=o.childKeysByHostKey.get(e.key);if(t===void 0)return[e];let n=t.flatMap(e=>{let t=s.get(e);return t?[t]:[]}).toSorted(P);return[{...e,delegatedChildren:n}]})}function me(e){if(e.latestCompletedTurnAt!==void 0)return e.latestCompletedTurnAt??e.createdAt;let t=e.latestTurn,n=e.session?.activeTurnId===t?.turnId||e.session?.orchestrationStatus===`running`||e.session?.orchestrationStatus===`starting`;return t?.state===`completed`&&!n?t.completedAt??e.createdAt:e.createdAt}function P(e,t){if(e.pinned!==t.pinned)return e.pinned?-1:1;let n=Date.parse(t.updatedAt)-Date.parse(e.updatedAt);return Number.isFinite(n)&&n!==0?n:e.key.localeCompare(t.key)}function he(e,t){return e.pinned===t.pinned?(j[e.state]??0)-(j[t.state]??0)||P(e,t):e.pinned?-1:1}function ge(e){switch(e.mutationBlocker){case`client-draft`:return`Drafts cannot be settled yet.`;case`unsupported`:return`Update this machine to use Settle.`;case`disconnected`:return`Reconnect this machine to change settlement.`;case`read-only`:return`Your role cannot change this thread.`;case`shell-stale`:return`Wait for current thread data before changing settlement.`}switch(e.lifecycle.settlementBlocker){case`pending-approval`:return`Resolve the pending approval first.`;case`pending-user-input`:return`Answer the pending request first.`;case`session-starting`:case`session-running`:return`Wait for the running work to finish.`;case`queued-turn`:case`local-queue`:return`Wait for queued work to be delivered.`;case`delivery-unknown`:return`Confirm message delivery before settling.`;case`thread-archived`:case`thread-deleted`:case`worktree-archived`:return`Archived work cannot be settled.`;case`unsupported`:return`Update this machine to use Settle.`;case null:return null}return null}function F(e,t){if(!e)return null;let n=t?.providers?.find(t=>t.instanceId===e.instanceId),r=n?.models.find(t=>t.slug===e.model||t.aliases?.includes(e.model));return r?k(b(r),n.driver):null}function _e(e){let r=e.nowMs??Date.now(),i=new Map(e.environments.map(e=>[e.environmentId,e])),a=e.deliveryUnknownThreadKeys??new Set,o=d({projects:e.projects,worktrees:e.worktrees,threads:e.threads,environments:e.environments.map(e=>({environmentId:e.environmentId,label:e.label,threadSettlementSupported:e.threadSettlementSupported,threadSnoozeSupported:e.threadSnoozeSupported,connected:e.connectionState===`connected`,mutationReady:e.mutationReady,shellCurrent:e.shellCurrent})),localQueuedThreadKeys:e.localQueuedThreadKeys,deliveryUnknownThreadKeys:a,pinnedThreadKeys:e.pinnedThreadKeys,filters:{...e.filters.environmentId?{environmentIds:[e.filters.environmentId]}:{},text:e.filters.query},currentThreadKey:e.activeThreadKey,aiFocusEnabled:e.aiFocusEnabled,autoSettleAfterDays:e.autoSettleAfterDays,nowMs:r}),s=new Set(e.threads.map(e=>e.environmentId)).size<=1,c=new Map(e.projects.map(e=>[`${e.environmentId}:${e.id}`,m(e,N)])),l=new Set(e.threads.map(e=>c.get(`${e.environmentId}:${e.projectId}`)??null)).size<=1,u=[];for(let c of[...o.focus,...o.active,...o.settled,...o.snoozed]){let o=c.thread;if(!o)continue;let d=i.get(o.environmentId),f=c.project,p=c.worktree,y=d?.label??`Unknown machine`,b=g(f),x=m(f,N),S=b?_:p?.title??p?.branch??o.branch??`Local workspace`,C=`${y} · ${x} · ${S}`,w=se(o,d,a,r),T=w===`limited`?v(o,r):null,E=c.lifecycle.classification===`settled`,D=c.lifecycle.classification===`snoozed`,O=c.pinned?`pinned`:D?`snoozed`:E?`settled`:c.focus?`focus`:M(w);if(e.filters.status!==`all`&&e.filters.status!==O)continue;let k=oe(o);u.push({key:t(n(o.environmentId,o.id)),environmentId:o.environmentId,threadId:o.id,title:o.title||`Untitled task`,pinned:c.pinned,gitCwd:o.worktreePath??p?.worktreePath??f?.cwd??null,sourceControlEnabled:!(d?.connectionState!==`connected`||!d.shellCurrent||d.stale),mutationEnabled:!!(d?.mutationReady&&d.shellCurrent&&d.connectionState===`connected`),pullRequest:p?.prNumber==null?null:{number:p.prNumber,state:p.prState,isDraft:p.prIsDraft===!0},machineLabel:y,projectLabel:x,project:f??null,isChat:b,isWorktree:!!(p?.worktreePath??o.worktreePath),rankingModelLabel:F(c.focus?.ranking?.modelSelection,d),workspaceLabel:S,contextLabel:C,state:w,statusLabel:ue(w,d,T),attention:w===`needs-input`?ce(o):null,errorDetail:w===`error`&&o.session?.lastError?.trim()||null,usageLimit:T?{phase:T.phase,resetAt:T.resetAt}:null,runningSince:w===`working`?le(o):null,latestTurnCompletedAt:o.latestTurn?.completedAt??null,showProject:!l,showMachine:!s&&(e.primaryEnvironmentId==null||o.environmentId!==e.primaryEnvironmentId),updatedAt:me(o),providerDriver:k,providerLabel:h.find(e=>e.value===k)?.label??k??null,modelLabel:F(o.modelSelection,d),modelSelection:o.modelSelection??null,branchLabel:o.branch??p?.branch??null,changeRequestLabel:p?.prNumber==null?p?.issueNumber==null?p?.workItemKey??null:`#${p.issueNumber}`:`#${p.prNumber}`,changeRequestStateLabel:p?.prState??p?.issueState??p?.workItemStateName??p?.workItemState??null,trustLabel:d?.trust===`unverified`?`Not verified`:d?.trust===`account-trusted`?`Encrypted · Account trusted`:d?.trust===`identity-conflict`?`Identity conflict`:null,roleLabel:d?.role===`viewer`?`Viewer`:null,settled:E,snoozedUntil:D?o.snoozedUntil??null:null,canSnooze:c.canSnooze,canUnsnooze:d?.threadSnoozeSupported===!0&&d.mutationReady&&d.shellCurrent&&d.connectionState===`connected`,settlementActionEnabled:c.mutationEnabled&&(E||c.lifecycle.eligibility.canSettle),settlementDisabledReason:ge(c),effectiveSettlementTimestamp:c.lifecycle.effectiveSettlementTimestamp,focus:c.focus,lineage:o.lineage??null,delegatedChildren:fe})}let f=e.nestDelegated!==!1&&e.filters.query.trim()===``?pe(u,e.threads):u,p=f.filter(e=>e.pinned).toSorted(P),y=f.filter(e=>!e.pinned),b=y.filter(e=>!e.settled&&!e.snoozedUntil),x=b.filter(e=>e.focus!==null),S=b.filter(e=>e.focus===null&&M(e.state)===`active`).toSorted(he),C=b.filter(e=>e.focus===null&&!e.settled&&M(e.state)===`needs-input`).toSorted(P),w=b.filter(e=>e.focus===null&&M(e.state)===`recent`).toSorted(P),T=y.filter(e=>e.settled).toSorted((e,t)=>(t.effectiveSettlementTimestamp??t.updatedAt).localeCompare(e.effectiveSettlementTimestamp??e.updatedAt));return{sections:[...p.length>0?[{key:`pinned`,title:`Pinned`,rows:p}]:[],...x.length>0?[{key:`focus`,title:`Focus`,rows:x}]:[],...S.length>0?[{key:`active`,title:`Active now`,rows:S}]:[],...C.length>0?[{key:`needs-input`,title:`Needs input`,rows:C}]:[],...w.length>0?[{key:`recent`,title:`Recent`,rows:w}]:[],...y.some(e=>e.snoozedUntil)?[{key:`snoozed`,title:`Snoozed`,rows:y.filter(e=>e.snoozedUntil)}]:[],...T.length>0?[{key:`settled`,title:`Settled`,rows:T}]:[]],nextSettlementEvaluationAtMs:o.nextSettlementEvaluationAtMs}}function ve(e,t){return t?{...e,threadSnoozeSupported:t.environment.capabilities.threadSnooze??!1,threadSettlementSupported:t.environment.capabilities.threadSettlement,providers:t.providers}:e}function ye(e){e?.status===`skipped`&&e.mode===`none`&&l.add({type:`info`,title:`Worktree created`,description:e.reason})}function be(e,t){switch(e.state){case`needs-input`:return`needs-input`;case`working`:return`working`;case`connecting`:case`reconnecting`:return`connecting`;case`limited`:return`limited`;case`error`:case`delivery-unknown`:return`error`;case`offline`:return`offline`;case`idle`:return t?`completed`:`idle`}}var I={approval:`Needs approval`,input:`Needs your answer`,plan:`Plan ready`};function L(e,t){return e.state===`needs-input`?I[e.attention??`input`]:e.state===`idle`?t?`Completed`:`Idle`:e.statusLabel}var xe={approval:`Waiting for your approval to continue.`,input:`Waiting for your answer to continue.`,plan:`A plan is ready for your review.`};function Se(e){return xe[e.attention??`input`]}var R=`The last turn failed`;function z(e){let t=e.usageLimit??null;return t?.phase===`reset`?`Limit reset · resume to continue`:t?.resetAt?`Resets ${p(t.resetAt)}`:`Reset time unknown`}function Ce(e){switch(e.state){case`needs-input`:return{kind:`attention`,text:I[e.attention??`input`]};case`limited`:return{kind:`status`,text:z(e)};case`error`:return{kind:`error`,text:e.errorDetail??R};case`delivery-unknown`:return{kind:`error`,text:`Check message delivery`};case`connecting`:case`reconnecting`:case`offline`:return{kind:`status`,text:e.statusLabel};case`working`:case`idle`:return{kind:`workspace`}}}function we(e){let{value:t}=C(e);return t===`just now`?`now`:t}function B(e){return new Date(e).toLocaleString(void 0,{weekday:`short`,hour:`numeric`,minute:`2-digit`})}function Te(e,t){let n=L(e,t);switch(e.state){case`limited`:return`${n} · ${z(e)}`;case`needs-input`:return`${n} · open the thread to respond`;case`working`:return e.runningSince?`${n} · started ${B(e.runningSince)}`:n;case`error`:return`${n} · ${e.errorDetail??R}`;case`idle`:return t&&e.latestTurnCompletedAt?`${n} ${w(e.latestTurnCompletedAt)} · not opened yet`:`${n} · nothing running`;default:return n}}function Ee(e,t){return e.runningSince?`Running since ${B(e.runningSince)}`:e.snoozedUntil?`Snoozed until ${B(e.snoozedUntil)}`:e.settled?`Settled ${B(t)}`:`Last activity ${B(t)}`}var V=T(),H=e(S(),1),U=`data-inbox-row-key`,W=`inbox:row-leaving`,G=`cubic-bezier(0.22, 1, 0.36, 1)`;function K(){return E(`--app-motion-duration-stack`,260)}var q=(0,H.createContext)(null);function J(e,t){let n=(0,H.useContext)(q),r=(0,H.useRef)(null);return(0,H.useLayoutEffect)(()=>{let i=r.current;i&&n?.current.ready&&n.current.enabled&&K()!==0&&i.animate(e,t)},[]),r}function De(e){let t=(0,V.c)(12),n=(0,H.useRef)(null),r=(0,H.useRef)(null),i=(0,H.useRef)(null),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=new Map,t[0]=a):a=t[0];let o=(0,H.useRef)(a),s=(0,H.useRef)(null),c;t[1]===e.enabled?c=t[2]:(c={ready:!1,enabled:e.enabled},t[1]=e.enabled,t[2]=c);let l=(0,H.useRef)(c),u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{let e=r.current;if(!e)return;let t=i.current;if(!t||!t.isConnected||t.dataset.settling!==void 0){e.dataset.visible=`false`;return}let n=e.dataset.visible===`true`;n||(e.style.transition=`none`),e.style.transform=`translateY(${t.offsetTop}px)`,e.style.height=`${t.offsetHeight}px`,n||(e.style.transition=``),e.dataset.visible=`true`},t[3]=u):u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=e.target.closest(`[${U}]`);t!==i.current&&(i.current=t,d())},t[4]=f):f=t[4];let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{i.current=null,d()},t[5]=m):m=t[5];let h=m,g,_;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=n.current;if(!e)return;let t=()=>d();return e.addEventListener(W,t),()=>e.removeEventListener(W,t)},_=[d],t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,H.useEffect)(g,_);let v;t[8]!==e.enabled||t[9]!==e.orderSignature?(v=()=>{let t=n.current;if(!t)return;if(!e.enabled||t.getClientRects().length===0){o.current=new Map,s.current=null,l.current.ready=!0,l.current.enabled=!1;return}let r=s.current!==null&&s.current!==e.orderSignature?K():0,i=o.current,a=new Map;for(let e of t.querySelectorAll(`[${U}]`)){let t=e.getAttribute(U),n=e.offsetTop;if(a.set(t,n),r===0)continue;let o=i.get(t);o===void 0?e.animate([{opacity:0,transform:`translateY(-4px)`},{opacity:1,transform:`none`}],{duration:r,easing:G}):Math.abs(o-n)>.5&&e.animate([{transform:`translateY(${o-n}px)`},{transform:`translateY(0)`}],{duration:r*1.6,easing:G})}o.current=a,s.current=e.orderSignature,l.current.ready=!0,l.current.enabled=e.enabled,d()},t[8]=e.enabled,t[9]=e.orderSignature,t[10]=v):v=t[10],(0,H.useLayoutEffect)(v);let y;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y={listRef:n,highlightRef:r,gateRef:l,onPointerMove:p,onPointerLeave:h},t[11]=y):y=t[11],y}var Y=new Set,X=null,Z=Date.now();function Oe(e){return Y.add(e),X===null&&(Z=Date.now(),X=setInterval(()=>{Z=Date.now();for(let e of Y)e()},1e3)),()=>{Y.delete(e),Y.size===0&&X!==null&&(clearInterval(X),X=null)}}var Q=()=>(X===null&&(Z=Math.floor(Date.now()/1e3)*1e3),Z);function ke(){return(0,H.useSyncExternalStore)(Oe,Q,Q)}var $=u(),Ae=[{opacity:0,transform:`scale(0.3) rotate(-90deg)`},{opacity:1,transform:`none`}],je={duration:460,easing:`cubic-bezier(0.3, 1.36, 0.44, 1)`},Me=[{strokeDashoffset:1},{strokeDashoffset:0}],Ne={duration:380,delay:60,easing:`cubic-bezier(0.22, 1, 0.36, 1)`,fill:`backwards`};function Pe(){let e=(0,V.c)(3),t=J(Me,Ne),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`circle`,{cx:`7`,cy:`7`,r:`6.2`,className:`fill-success`}),e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r=(0,$.jsxs)(`svg`,{viewBox:`0 0 14 14`,className:`size-[13px]`,"aria-hidden":!0,children:[n,(0,$.jsx)(`path`,{ref:t,d:`M4.3 7.3l1.8 1.8 3.7-3.9`,pathLength:1,strokeDasharray:1,className:`fill-none stroke-white dark:stroke-black/85`,strokeWidth:1.7,strokeLinecap:`round`,strokeLinejoin:`round`})]}),e[1]=t,e[2]=r),r}function Fe(e){let t=(0,V.c)(12),n=J(Ae,je),r;t[0]===e.label?r=t[1]:(r=e.label?{role:`img`,"aria-label":e.label}:{"aria-hidden":!0},t[0]=e.label,t[1]=r);let i=e.kind,a;t[2]===e.className?a=t[3]:(a=o(`relative inline-flex size-3.5 shrink-0 items-center justify-center`,e.className),t[2]=e.className,t[3]=a);let s;t[4]===e.kind?s=t[5]:(s=(0,$.jsx)(Ie,{kind:e.kind}),t[4]=e.kind,t[5]=s);let c;return t[6]!==e.kind||t[7]!==n||t[8]!==r||t[9]!==a||t[10]!==s?(c=(0,$.jsx)(`span`,{ref:n,...r,"data-inbox-glyph":i,className:a,children:s}),t[6]=e.kind,t[7]=n,t[8]=r,t[9]=a,t[10]=s,t[11]=c):c=t[11],c}function Ie(e){let t=(0,V.c)(8),{kind:n}=e;switch(n){case`needs-input`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{className:`status-activity-signal size-2 text-warning`,children:(0,$.jsx)(`span`,{className:`size-full rounded-full bg-warning`})}),t[0]=e):e=t[0],e}case`working`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{className:`inbox-glyph-spin size-[11px] rounded-full border-[1.5px] border-sky-500/20 border-t-sky-500 dark:border-sky-400/25 dark:border-t-sky-400`}),t[1]=e):e=t[1],e}case`connecting`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{className:`inbox-glyph-spin-slow size-[11px] rounded-full border-[1.5px] border-dashed border-muted-foreground/60`}),t[2]=e):e=t[2],e}case`completed`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(Pe,{}),t[3]=e):e=t[3],e}case`limited`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`svg`,{viewBox:`0 0 14 14`,className:`size-[13px] text-warning`,"aria-hidden":!0,children:[(0,$.jsx)(`path`,{d:`M2.2 9.6a5 5 0 1 1 9.6 0`,className:`fill-none stroke-current`,strokeWidth:1.6,strokeLinecap:`round`}),(0,$.jsx)(`path`,{d:`M7 8.4l2.9-2.4`,className:`fill-none stroke-current`,strokeWidth:1.6,strokeLinecap:`round`}),(0,$.jsx)(`circle`,{cx:`7`,cy:`8.6`,r:`1.1`,className:`fill-current`})]}),t[4]=e):e=t[4],e}case`error`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(`svg`,{viewBox:`0 0 14 14`,className:`size-[13px]`,"aria-hidden":!0,children:[(0,$.jsx)(`circle`,{cx:`7`,cy:`7`,r:`6.2`,className:`fill-destructive`}),(0,$.jsx)(`path`,{d:`M7 3.9v3.6`,className:`stroke-white`,strokeWidth:1.7,strokeLinecap:`round`}),(0,$.jsx)(`circle`,{cx:`7`,cy:`10`,r:`1`,className:`fill-white`})]}),t[5]=e):e=t[5],e}case`offline`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{className:`size-[9px] rounded-full border-[1.5px] border-muted-foreground/45`}),t[6]=e):e=t[6],e}case`idle`:{let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsx)(`span`,{className:`size-[5px] rounded-full bg-muted-foreground/35`}),t[7]=e):e=t[7],e}}}export{de as C,re as S,O as T,ye as _,K as a,ie as b,De as c,Se as d,Te as f,Ce as g,be as h,q as i,we as l,Ee as m,U as n,ke as o,L as p,W as r,J as s,Fe as t,B as u,ve as v,ne as w,ae as x,_e as y};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-DARIYokI.js";import{K as n,a as r,q as i}from"./primary-Cf-xJExj.js";import{Ri as a,l as o,y as s}from"./wsTransport-C88seBPA.js";import{$i as c,Bi as l,Cs as u,Gi as d,Ss as f,Vi as p,Zi as m,Zr as h,ad as g,id as _,jo as v,rd as y,ws as b,ys as x}from"./runtime-DjjjAcTE.js";import{t as S}from"./react-CwJFpaho.js";import{i as C}from"./presentationTier-DPVAxTK4.js";import{a as w,r as T,t as E}from"./tooltip-DbqhseXd.js";import{t as D}from"./bot-C9nWtaWq.js";import{t as O}from"./checkbox-CIIIY9FA.js";import{t as k}from"./key-round-BlrUTfxB.js";import{t as A}from"./loader-3vQnfqIT.js";import{t as j}from"./refresh-cw-CRUTivd6.js";import{t as M}from"./save-OZdkPs_y.js";import{r as N}from"./capabilities-CfOhq009.js";import{V as P}from"./combobox-Dtjtf7AB.js";import{t as F}from"./unplug-D6iu-qlh.js";import{t as I}from"./wrench-CPUCA_rn.js";import{t as L}from"./toastHelpers-CSQRKo4F.js";import{n as ee,t as te}from"./radio-group-DVwD6Cuy.js";import{t as R}from"./input-CCie4mm1.js";import"./providerModels-v9PYbzRE.js";import{c as z}from"./select-Cb9FUPHD.js";import{t as ne}from"./switch-oQc7Ifbl.js";import{a as re,c as B,d as V,i as H,l as ie,o as U,u as W}from"./settingsLayout-CRFNCk_D.js";import{i as G}from"./providerDriverMeta-BHHL9uw0.js";import{t as ae}from"./SettingsSelect-DEhNaz3E.js";import{Ut as oe}from"./main-Ch0bwS-M.js";var se=()=>({integrations:[],topology:{available:!1,reason:`Not loaded.`},pairingCodes:{}}),ce=(e,t)=>({integrations:t.integrations,topology:t.topology,pairingCodes:{}}),le=(e,t)=>({...e,integrations:[...e.integrations.filter(e=>e.integration.integrationId!==t.detail.integration.integrationId),t.detail],pairingCodes:{...e.pairingCodes,[t.detail.integration.integrationId]:t.pairingCode}}),ue=(e,t)=>{let n={...e.pairingCodes};return delete n[t],{...e,integrations:e.integrations.filter(e=>e.integration.integrationId!==t),pairingCodes:n}},de=()=>({installations:[]}),fe=e=>[...e].toSorted((e,t)=>e.driver.localeCompare(t.driver)||e.createdAt.localeCompare(t.createdAt)||e.installationId.localeCompare(t.installationId)),pe=(e,t)=>({installations:fe(t.installations)}),me=(e,t)=>{let n=e.installations.find(e=>e.installationId===t.installation.installationId);return n&&n.revision>t.installation.revision?e:{installations:fe([...e.installations.filter(e=>e.installationId!==t.installation.installationId),t.installation])}},he={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};he.node;var K=b(he),ge={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};ge.node;var _e=b(ge),q=e(S(),1),J=C(),ve=[50,100,200,400],ye=e=>e instanceof Error&&e.message.trim()===`Agent Control is disabled.`,be=e=>new Promise(t=>window.setTimeout(t,e));async function xe(e,t=be){for(let n of ve)try{return await e()}catch(e){if(!ye(e))throw e;await t(n)}return e()}var Y=g(),Se={codex:`Codex`,"claude-code":`Claude Code`,"claude-desktop":`Claude Desktop`,"generic-mcp":`Generic MCP`},Ce=[{capability:s.externalListProjects,label:`List allowed projects`,description:`Discover only projects inside this integration's scope.`},{capability:s.externalCreateTask,label:`Request tasks`,description:`Submit one task to Ryco's normal approval queue.`},{capability:s.externalReadTask,label:`Read own tasks`,description:`Read or wait only for tasks created by this integration.`},{capability:s.externalReadAutomations,label:`Read automations`,description:`Read bounded schedules and run outcomes inside the selected project scope.`},{capability:s.externalManageAutomations,label:`Request automations`,description:`Propose schedule changes; each due run still requires separate approval.`},{capability:s.externalReadActivity,label:`Read activity`,description:`Read bounded payload-free project and provider event summaries.`},{capability:s.externalReadDiagnostics,label:`Read diagnostics`,description:`Read redacted count-only health summaries for allowed projects.`},{capability:s.externalReadThreads,label:`Read threads`,description:`List, search, read, wait on, and inspect threads in allowed projects. Terminal output stays private.`},{capability:s.externalReadReviews,label:`Read reviews`,description:`Read checkpoint diffs and review history for threads in allowed projects.`},{capability:s.externalReadFiles,label:`Read workspace files`,description:`Read any text file in a thread's workspace or worktree, including local configuration.`},{capability:s.externalReadWorkspaces,label:`Read projects and workspaces`,description:`Read project preferences, workspace paths, and Git status without changing them.`},{capability:s.externalControlThreads,label:`Request thread control`,description:`Propose messages, interrupts, and thread updates in allowed projects; each request needs approval.`},{capability:s.externalManageWorkspaces,label:`Request workspace changes`,description:`Propose archiving, restoring, or deleting workspaces in allowed projects; each request needs approval.`},{capability:s.externalSharedCheckout,label:`Request shared checkout`,description:`May request the local checkout; each request still needs approval.`},{capability:s.externalFullAccess,label:`Request full access`,description:`May request a full-access runtime; each request still needs approval.`}],X=()=>({displayName:``,clientKind:`codex`,scopeKind:`all`,projectIds:``,capabilities:[s.externalListProjects,s.externalCreateTask,s.externalReadTask],expiresAt:``,rateLimitPerMinute:`60`,activeTaskLimit:`1`});function Z(e,t){d.add(L({type:`error`,title:e,description:t instanceof Error?t.message:`The request failed.`}))}function we(e,t){return[e,...t.map(e=>JSON.stringify(e))].join(` `)}function Te(e){return e===null?`Never`:new Date(e).toLocaleString()}function Ee(e){let t=e.integration;return t.revokedAt===null?t.expiresAt!==null&&Date.parse(t.expiresAt)<=Date.now()?{label:`Expired`,variant:`error`}:t.pairingState===`paired`?{label:`Paired`,variant:`success`}:t.pairingState===`pending`?{label:`Pairing`,variant:`warning`}:{label:`Unpaired`,variant:`outline`}:{label:`Revoked`,variant:`error`}}function De(e){let t=e.integration;return{displayName:t.displayName,clientKind:t.clientKind,scopeKind:t.projectScope.kind,projectIds:t.projectScope.kind===`selected`?t.projectScope.projectIds.join(`, `):``,capabilities:t.capabilities,expiresAt:t.expiresAt===null?``:new Date(t.expiresAt).toISOString().slice(0,16),rateLimitPerMinute:String(t.rateLimitPerMinute),activeTaskLimit:String(t.activeTaskLimit)}}function Oe(e){let t=e.projectIds.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>a.make(e)),n=e.scopeKind===`all`?{kind:`all`}:{kind:`selected`,projectIds:t},r=Number(e.rateLimitPerMinute),i=Number(e.activeTaskLimit);if(!e.displayName.trim())throw Error(`A display name is required.`);if(e.scopeKind===`selected`&&t.length===0)throw Error(`Enter at least one project ID for selected-project scope.`);if(!Number.isInteger(r)||r<1)throw Error(`Rate limit must be a positive whole number.`);if(!Number.isInteger(i)||i<1)throw Error(`Active-task limit must be a positive whole number.`);return{displayName:e.displayName.trim(),clientKind:e.clientKind,projectScope:n,capabilities:e.capabilities,expiresAt:e.expiresAt?new Date(e.expiresAt).toISOString():null,rateLimitPerMinute:r,activeTaskLimit:i}}function ke(e){let t=(0,J.c)(74),{form:n,onChange:r,clientLocked:i}=e,a=i!==void 0&&i,o;t[0]!==n||t[1]!==r?(o=e=>r({...n,displayName:e.target.value}),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s;t[3]!==n.displayName||t[4]!==o?(s=(0,Y.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-foreground`,children:[`Display name`,(0,Y.jsx)(R,{value:n.displayName,placeholder:`Local Codex`,onChange:o})]}),t[3]=n.displayName,t[4]=o,t[5]=s):s=t[5];let c=n.clientKind,l;t[6]!==n||t[7]!==r?(l=e=>r({...n,clientKind:e}),t[6]=n,t[7]=r,t[8]=l):l=t[8];let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=Object.entries(Se).map(Ae),t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n.clientKind||t[12]!==l?(d=(0,Y.jsxs)(`div`,{className:`grid gap-1.5 text-xs font-medium text-foreground`,children:[`Client`,(0,Y.jsx)(ae,{ariaLabel:`Client`,width:`full`,value:c,disabled:a,onValueChange:l,options:u})]}),t[10]=a,t[11]=n.clientKind,t[12]=l,t[13]=d):d=t[13];let f;t[14]!==s||t[15]!==d?(f=(0,Y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[s,d]}),t[14]=s,t[15]=d,t[16]=f):f=t[16];let p;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Y.jsx)(`legend`,{className:`mb-2 text-xs font-medium text-foreground`,children:`Project scope`}),t[17]=p):p=t[17];let m;t[18]!==n||t[19]!==r?(m=e=>r({...n,scopeKind:e===`selected`?`selected`:`all`}),t[18]=n,t[19]=r,t[20]=m):m=t[20];let h;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Y.jsx)(te,{value:`all`,className:`mt-0.5`}),t[21]=h):h=t[21];let g;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2.5 text-[13px] text-foreground`,children:[h,(0,Y.jsxs)(`span`,{children:[`All current and future projects`,(0,Y.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`The client can discover every project on this local Ryco instance.`})]})]}),t[22]=g):g=t[22];let _;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Y.jsx)(te,{value:`selected`,className:`mt-0.5`}),t[23]=_):_=t[23];let v=n.scopeKind!==`selected`,y;t[24]!==n||t[25]!==r?(y=e=>r({...n,projectIds:e.target.value}),t[24]=n,t[25]=r,t[26]=y):y=t[26];let b;t[27]!==n.projectIds||t[28]!==v||t[29]!==y?(b=(0,Y.jsx)(R,{className:`mt-1.5`,value:n.projectIds,disabled:v,placeholder:`project-id-1, project-id-2`,"aria-label":`Selected project IDs`,onChange:y}),t[27]=n.projectIds,t[28]=v,t[29]=y,t[30]=b):b=t[30];let x;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Y.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:`Comma-separated stable project IDs. Unknown IDs remain inaccessible.`}),t[31]=x):x=t[31];let S;t[32]===b?S=t[33]:(S=(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2.5 text-[13px] text-foreground`,children:[_,(0,Y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`Selected projects`,b,x]})]}),t[32]=b,t[33]=S);let C;t[34]!==n.scopeKind||t[35]!==m||t[36]!==S?(C=(0,Y.jsxs)(`fieldset`,{className:`grid gap-2`,children:[p,(0,Y.jsxs)(ee,{value:n.scopeKind,onValueChange:m,className:`gap-3`,children:[g,S]})]}),t[34]=n.scopeKind,t[35]=m,t[36]=S,t[37]=C):C=t[37];let w;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Y.jsx)(`legend`,{className:`mb-2 text-xs font-medium text-foreground`,children:`Capability grants`}),t[38]=w):w=t[38];let T;t[39]!==n||t[40]!==r?(T=Ce.map(e=>(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2.5 text-[13px] text-foreground`,children:[(0,Y.jsx)(O,{className:`mt-0.5`,checked:n.capabilities.includes(e.capability),onCheckedChange:t=>r({...n,capabilities:t===!0?[...n.capabilities,e.capability]:n.capabilities.filter(t=>t!==e.capability)})}),(0,Y.jsxs)(`span`,{children:[e.label,(0,Y.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:e.description})]})]},e.capability)),t[39]=n,t[40]=r,t[41]=T):T=t[41];let E;t[42]===T?E=t[43]:(E=(0,Y.jsxs)(`fieldset`,{className:`grid gap-3`,children:[w,T]}),t[42]=T,t[43]=E);let D;t[44]!==n||t[45]!==r?(D=e=>r({...n,expiresAt:e.target.value}),t[44]=n,t[45]=r,t[46]=D):D=t[46];let k;t[47]!==n.expiresAt||t[48]!==D?(k=(0,Y.jsx)(R,{type:`datetime-local`,value:n.expiresAt,onChange:D}),t[47]=n.expiresAt,t[48]=D,t[49]=k):k=t[49];let A;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Y.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:`Empty means no expiry.`}),t[50]=A):A=t[50];let j;t[51]===k?j=t[52]:(j=(0,Y.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-foreground`,children:[`Expires`,k,A]}),t[51]=k,t[52]=j);let M;t[53]!==n||t[54]!==r?(M=e=>r({...n,rateLimitPerMinute:e.target.value}),t[53]=n,t[54]=r,t[55]=M):M=t[55];let N;t[56]!==n.rateLimitPerMinute||t[57]!==M?(N=(0,Y.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-foreground`,children:[`Requests per minute`,(0,Y.jsx)(R,{type:`number`,min:1,max:600,value:n.rateLimitPerMinute,onChange:M})]}),t[56]=n.rateLimitPerMinute,t[57]=M,t[58]=N):N=t[58];let P;t[59]!==n||t[60]!==r?(P=e=>r({...n,activeTaskLimit:e.target.value}),t[59]=n,t[60]=r,t[61]=P):P=t[61];let F;t[62]!==n.activeTaskLimit||t[63]!==P?(F=(0,Y.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-foreground`,children:[`Concurrent active tasks`,(0,Y.jsx)(R,{type:`number`,min:1,max:32,value:n.activeTaskLimit,onChange:P})]}),t[62]=n.activeTaskLimit,t[63]=P,t[64]=F):F=t[64];let I;t[65]!==j||t[66]!==N||t[67]!==F?(I=(0,Y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[j,N,F]}),t[65]=j,t[66]=N,t[67]=F,t[68]=I):I=t[68];let L;return t[69]!==C||t[70]!==E||t[71]!==I||t[72]!==f?(L=(0,Y.jsxs)(`div`,{className:`grid gap-5`,children:[f,C,E,I]}),t[69]=C,t[70]=E,t[71]=I,t[72]=f,t[73]=L):L=t[73],L}function Ae(e){let[t,n]=e;return{value:t,label:n}}function je(e){let t=(0,J.c)(8),{copied:n,onClick:r,label:i,iconOnly:a}=e,o=a!==void 0&&a,s=o?`icon-xs`:`xs`,c=o?i:void 0,l;t[0]===n?l=t[1]:(l=n?(0,Y.jsx)(u,{}):(0,Y.jsx)(_e,{}),t[0]=n,t[1]=l);let d=o?null:i,f;return t[2]!==r||t[3]!==s||t[4]!==c||t[5]!==l||t[6]!==d?(f=(0,Y.jsxs)(m,{size:s,variant:`outline`,"aria-label":c,onClick:r,children:[l,d]}),t[2]=r,t[3]=s,t[4]=c,t[5]=l,t[6]=d,t[7]=f):f=t[7],f}function Me(){let e=_(),t=r(),n=e?.environmentId??t,[i,a]=(0,q.useState)(se),[o,s]=(0,q.useState)(X),[c,l]=(0,q.useState)(!1),[u,d]=(0,q.useState)(null),[f,p]=(0,q.useState)(null),[g,v]=(0,q.useState)(null),y=(0,q.useMemo)(()=>n===null?void 0:h(n)?.agentControl,[n]),b=(0,q.useCallback)(async()=>{if(y)try{let e=await xe(()=>y.listIntegrations());a(t=>ce(t,e))}catch(e){Z(`Failed to load external integrations`,e)}},[y]);(0,q.useEffect)(()=>{b()},[b]);let x=(0,q.useCallback)(async(e,t)=>{await navigator.clipboard.writeText(t),v(e),window.setTimeout(()=>v(t=>t===e?null:t),1500)},[]),S=async()=>{if(y)try{p(`new`);let e=await y.createIntegration(Oe(o));a(t=>le(t,e)),s(X()),l(!1)}catch(e){Z(`Failed to create integration`,e)}finally{p(null)}},C=async e=>{if(y)try{p(e.integration.integrationId);let t=Oe(o);await y.updateIntegration({integrationId:e.integration.integrationId,...t}),d(null),await b()}catch(e){Z(`Failed to update integration`,e)}finally{p(null)}},D=async e=>{if(!y)return;let t=e.integration.integrationId;try{p(t);let e=await y.resumeIntegrationPairing({integrationId:t});a(t=>le(t,e))}catch(e){Z(`Failed to resume pairing`,e)}finally{p(null)}},O=async e=>{if(!y)return;let t=e.integration.integrationId;try{p(t),await y.revokeIntegration({integrationId:t}),await b()}catch(e){Z(`Failed to revoke integration`,e)}finally{p(null)}},A=async e=>{if(!y)return;let t=e.integration.integrationId;if(window.confirm(`Delete ${e.integration.displayName}? This cannot be undone.`))try{p(t),(await y.deleteIntegration({integrationId:t})).deleted&&a(e=>ue(e,t))}catch(e){Z(`Failed to delete integration`,e)}finally{p(null)}};return(0,Y.jsxs)(V,{"data-testid":`external-integrations`,title:`External integrations`,description:`Pair a local MCP client with a revocable identity. Every task request waits in Ryco for explicit user approval before a thread is created.`,headerAction:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(E,{children:[(0,Y.jsx)(w,{render:(0,Y.jsx)(m,{size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground hover:text-foreground`,"aria-label":`Refresh integrations`,onClick:()=>void b(),children:(0,Y.jsx)(j,{})})}),(0,Y.jsx)(T,{children:`Refresh`})]}),(0,Y.jsxs)(m,{size:`xs`,disabled:!y||!i.topology.available,onClick:()=>{d(null),s(X()),l(e=>!e)},children:[(0,Y.jsx)(oe,{}),`New integration`]})]}),children:[i.topology.available?null:(0,Y.jsx)(H,{children:(0,Y.jsxs)(B,{tone:`warning`,title:`Local pairing is unavailable`,children:[i.topology.reason??`Ryco could not prove a direct loopback-only topology.`,` `,`External setup fails closed while Ryco is remotely exposed or Hub-connected.`]})}),c?(0,Y.jsxs)(H,{className:`settings-subsections-enter bg-muted/30`,children:[(0,Y.jsx)(ke,{form:o,onChange:s}),(0,Y.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,Y.jsx)(m,{size:`sm`,variant:`ghost`,onClick:()=>l(!1),children:`Cancel`}),(0,Y.jsxs)(m,{size:`sm`,disabled:f===`new`,onClick:()=>void S(),children:[(0,Y.jsx)(k,{}),`Create and pair`]})]})]}):null,i.integrations.length===0&&!c?(0,Y.jsx)(U,{icon:(0,Y.jsx)(k,{}),title:`No external integrations`,description:`Create one to pair an MCP client Ryco can't detect on its own.`,className:`py-8`}):null,i.integrations.map(e=>{let t=e.integration,n=Ee(e),r=i.pairingCodes[t.integrationId],a=we(e.setup.pairCommand.command,e.setup.pairCommand.args),c=u===t.integrationId;return(0,Y.jsx)(W,{title:(0,Y.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate`,children:t.displayName}),(0,Y.jsx)(z,{size:`sm`,variant:n.variant,children:n.label}),(0,Y.jsx)(z,{size:`sm`,variant:`outline`,children:Se[t.clientKind]})]}),description:(0,Y.jsx)(`span`,{className:`break-all font-mono text-[11px]`,children:t.integrationId}),control:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{size:`xs`,variant:`ghost`,onClick:()=>{d(c?null:t.integrationId),s(De(e))},children:c?`Close editor`:`Edit`}),(0,Y.jsxs)(m,{size:`xs`,variant:`outline`,disabled:!i.topology.available||f===t.integrationId||t.revokedAt!==null,onClick:()=>void D(e),children:[(0,Y.jsx)(k,{}),`Pair again`]}),(0,Y.jsx)(m,{size:`xs`,variant:`outline`,disabled:f===t.integrationId||t.revokedAt!==null,onClick:()=>void O(e),children:`Revoke`}),(0,Y.jsx)(m,{size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground hover:text-destructive-foreground`,"aria-label":`Delete ${t.displayName}`,disabled:f===t.integrationId,onClick:()=>void A(e),children:(0,Y.jsx)(P,{})})]}),children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[c?(0,Y.jsxs)(`div`,{className:`settings-subsections-enter grid gap-5 rounded-[min(var(--radius-lg),0.625rem)] bg-muted/40 p-4`,children:[(0,Y.jsx)(ke,{form:o,onChange:s}),(0,Y.jsx)(`div`,{className:`flex justify-end`,children:(0,Y.jsxs)(m,{size:`sm`,disabled:f===t.integrationId,onClick:()=>void C(e),children:[(0,Y.jsx)(M,{}),`Save changes`]})})]}):(0,Y.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-2.5 text-xs sm:grid-cols-2`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Project scope`}),(0,Y.jsx)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:t.projectScope.kind===`all`?`All current and future projects`:t.projectScope.projectIds.join(`, `)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Limits`}),(0,Y.jsxs)(`dd`,{className:`mt-0.5 text-foreground tabular-nums`,children:[t.rateLimitPerMinute,`/minute · `,t.activeTaskCount,`/`,t.activeTaskLimit,` active`]})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Expiry`}),(0,Y.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:Te(t.expiresAt)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Last used`}),(0,Y.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:Te(t.lastUsedAt)})]}),(0,Y.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground`,children:`Capabilities`}),(0,Y.jsx)(`dd`,{className:`mt-1 flex flex-wrap gap-1`,children:t.capabilities.map(e=>(0,Y.jsx)(z,{size:`sm`,variant:`outline`,children:e},e))})]})]}),t.pairingState===`pending`?(0,Y.jsxs)(`div`,{className:`grid min-w-0 gap-4 rounded-[min(var(--radius-lg),0.625rem)] bg-muted/40 p-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`text-[13px] font-medium text-foreground`,children:`Finish pairing locally`}),(0,Y.jsxs)(`p`,{className:`mt-0.5 text-xs text-muted-foreground`,children:[`Pairing code expires `,Te(t.pairingCodeExpiresAt),`. The code is shown only for this ceremony; the generated MCP configuration never contains it.`]})]}),r?(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Y.jsx)(`code`,{"data-testid":`external-pairing-code`,className:`rounded-[min(var(--radius-md),0.5rem)] bg-background px-3 py-1.5 font-mono text-sm tracking-[0.18em] text-foreground`,children:r}),(0,Y.jsx)(je,{label:`Copy code`,copied:g===`code-${t.integrationId}`,onClick:()=>void x(`code-${t.integrationId}`,r)})]}):(0,Y.jsx)(`p`,{className:`text-xs text-warning-foreground`,children:`The pairing code is no longer displayed. Choose Pair again to generate a new one.`}),(0,Y.jsxs)(`div`,{className:`grid min-w-0 gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Run this bridge command, then enter the code`}),(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Y.jsx)(`code`,{className:`min-w-0 flex-1 break-all rounded-[min(var(--radius-md),0.5rem)] bg-background px-2.5 py-2 font-mono text-[11px] text-foreground`,children:a}),(0,Y.jsx)(je,{iconOnly:!0,label:`Copy pairing command`,copied:g===`pair-${t.integrationId}`,onClick:()=>void x(`pair-${t.integrationId}`,a)})]})]}),(0,Y.jsxs)(`div`,{className:`grid min-w-0 gap-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`MCP configuration`}),(0,Y.jsx)(je,{label:`Copy configuration`,copied:g===`config-${t.integrationId}`,onClick:()=>void x(`config-${t.integrationId}`,e.setup.configuration)})]}),(0,Y.jsx)(`pre`,{"data-testid":`external-mcp-configuration`,className:`max-h-48 min-w-0 overflow-auto rounded-[min(var(--radius-md),0.5rem)] bg-background p-3 font-mono text-[11px] leading-relaxed text-foreground`,children:e.setup.configuration})]})]}):null]})},t.integrationId)})]})}var Ne=[],Pe=[];function Fe(e){return e.displayName??G(e.driver)?.label??v(e.driver)}function Q(e){return e.providerDisplayName??G(e.driver)?.label??v(e.driver)}function Ie(e){return e.driver===`codex`?`codex`:e.driver===`claudeAgent`?`claude-code`:`generic-mcp`}function Le(e){return{...X(),displayName:`${Q(e)} Agent Control`,clientKind:Ie(e)}}function Re(e,t){return e.filter(e=>e.workspaceId===t).toSorted((e,t)=>t.updatedAt.localeCompare(e.updatedAt))[0]}function ze(e){if(!e)return{label:`Not connected`,variant:`outline`};switch(e.state){case`connected`:return{label:`Connected`,variant:`success`};case`repair-needed`:return{label:`Needs repair`,variant:`error`};case`disconnected`:case`revoked`:return{label:`Disconnected`,variant:`outline`};case`disconnecting`:return{label:`Disconnecting`,variant:`warning`};case`planned`:case`credential-written`:case`provider-written`:case`verifying`:return{label:`Connecting`,variant:`warning`}}}function Be(e,t){d.add(L({type:`success`,title:e,description:t}))}function $(e,t){d.add(L({type:`error`,title:e,description:t instanceof Error?t.message:`The request failed.`}))}function Ve(){let e=_(),t=r(),n=e?.environmentId??t,[i,a]=(0,q.useState)(Ne),[o,s]=(0,q.useState)(Pe),[l,u]=(0,q.useState)(de),[d,f]=(0,q.useState)(null),[p,g]=(0,q.useState)(!0),[v,y]=(0,q.useState)(null),[b,S]=(0,q.useState)(null),[C,O]=(0,q.useState)(X),k=(0,q.useMemo)(()=>n===null?void 0:h(n),[n]),M=k?.agentControl,N=k?.mcp,P=(0,q.useCallback)(async()=>{if(!M||!N){g(!1);return}try{let[e,t,n]=await xe(()=>Promise.all([N.listWorkspaces(),M.listMcpInstallations(),M.listIntegrations()]));a(e.providers),s(e.workspaces),u(e=>pe(e,t)),f(n.topology)}catch(e){$(`Failed to load Agent Control providers`,e)}finally{g(!1)}},[M,N]);(0,q.useEffect)(()=>{P()},[P]);let L=async(e,t)=>{if(M)try{y(e.id);let n=t?(()=>{let{clientKind:t,...n}=Oe(C);return{workspaceId:e.id,...n}})():{workspaceId:e.id},r=await M.connectMcpInstallation(n);u(e=>me(e,r)),S(null),Be(`${Q(e)} connected`,`The credential was stored locally and was not shown to the browser.`)}catch(t){$(`Failed to connect ${Q(e)}`,t),await P()}finally{y(null)}},ee=async(e,t)=>{if(M)try{y(e.id);let n=await M.repairMcpInstallation({installationId:t.installationId});u(e=>me(e,n)),Be(`${Q(e)} repaired`)}catch(t){$(`Failed to repair ${Q(e)}`,t),await P()}finally{y(null)}},te=async(e,t)=>{if(M&&window.confirm(`Disconnect Agent Control from ${Q(e)}?`))try{y(e.id);let n=await M.disconnectMcpInstallation({installationId:t.installationId});u(e=>me(e,n)),Be(`${Q(e)} disconnected`)}catch(t){$(`Failed to disconnect ${Q(e)}`,t),await P()}finally{y(null)}},R=o.filter(e=>e.capabilities.externalAgentControl===`available`);return(0,Y.jsxs)(`div`,{"data-testid":`agent-control-mcp-installations`,className:`contents`,children:[(0,Y.jsx)(V,{title:`Automatic inside Ryco`,description:`Supported sessions started by Ryco receive Agent Control automatically. There is nothing to install in those provider profiles.`,children:p?(0,Y.jsxs)(H,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,Y.jsx)(A,{className:`size-3.5 animate-spin`}),` Loading providers…`]}):i.length===0?(0,Y.jsx)(U,{icon:(0,Y.jsx)(D,{}),title:`No provider instances`,description:`No configured provider instances were found.`,className:`py-8`}):i.map(e=>{let t=G(e.driver)?.icon??D,n=e.enabled&&e.capabilities.automaticAgentControl===`available`;return(0,Y.jsx)(W,{title:(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(t,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`truncate`,children:Fe(e)}),(0,Y.jsx)(`span`,{className:`truncate font-mono text-[11px] font-normal text-muted-foreground/70`,children:e.instanceId})]}),description:n?`Available in every new Ryco-managed session.`:e.enabled?`This provider does not expose automatic Agent Control yet.`:`This provider instance is disabled.`,control:(0,Y.jsx)(z,{size:`sm`,variant:n?`success`:`outline`,children:n?`Automatic`:e.enabled?`Unavailable`:`Disabled`})},e.instanceId)})}),(0,Y.jsxs)(V,{title:`Connect an installed provider`,description:`Ryco detects local provider profiles and writes their native MCP configuration. The default grants project listing and task request/read access, limited to 60 requests per minute and one active task. Every task still requires approval.`,headerAction:(0,Y.jsxs)(E,{children:[(0,Y.jsx)(w,{render:(0,Y.jsx)(m,{size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground hover:text-foreground`,"aria-label":`Refresh Agent Control providers`,disabled:p,onClick:()=>void P(),children:(0,Y.jsx)(j,{className:c(p&&`animate-spin`)})})}),(0,Y.jsx)(T,{children:`Refresh`})]}),children:[d&&!d.available?(0,Y.jsx)(H,{children:(0,Y.jsx)(B,{tone:`warning`,title:`Local installation is unavailable`,children:d.reason??`Ryco could not prove a direct loopback-only topology.`})}):null,!p&&(!M||!N)?(0,Y.jsx)(U,{icon:(0,Y.jsx)(K,{}),title:`Not available here`,description:`This Ryco environment does not expose provider MCP installation yet.`,className:`py-8`}):!p&&R.length===0?(0,Y.jsx)(U,{icon:(0,Y.jsx)(K,{}),title:`No installable profiles`,description:`Configure a supported provider instance first, then refresh.`,className:`py-8`}):R.map(e=>{let t=Re(l.installations,e.id),n=ze(t),r=t?.state===`connected`,i=t?.state===`repair-needed`,a=v===e.id,o=b===e.id,s=G(e.driver)?.icon??K,c=!!t?.lastError||!!t?.preservedUserChanges||o;return(0,Y.jsx)(W,{title:(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(s,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`truncate`,children:Q(e)}),(0,Y.jsx)(z,{size:`sm`,variant:n.variant,children:n.label})]}),description:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`block truncate font-mono text-[11px]`,title:e.displayPath,children:e.displayPath}),(0,Y.jsxs)(`span`,{className:`block`,children:[e.providerInstances.length,` configured provider`,e.providerInstances.length===1?` instance`:` instances`,t?` · MCP name ${t.serverName}`:``]})]}),control:i&&t?(0,Y.jsxs)(m,{size:`xs`,disabled:a||d?.available===!1,onClick:()=>void ee(e,t),children:[a?(0,Y.jsx)(A,{className:`animate-spin`}):(0,Y.jsx)(I,{}),`Repair`]}):r&&t?(0,Y.jsxs)(m,{size:`xs`,variant:`outline`,disabled:a,onClick:()=>void te(e,t),children:[a?(0,Y.jsx)(A,{className:`animate-spin`}):(0,Y.jsx)(F,{}),`Disconnect`]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(m,{size:`xs`,variant:`ghost`,disabled:a||d?.available===!1,onClick:()=>{o?S(null):(O(Le(e)),S(e.id))},children:o?`Close`:`Customize`}),(0,Y.jsxs)(m,{size:`xs`,disabled:a||d?.available===!1,onClick:()=>void L(e,!1),children:[a?(0,Y.jsx)(A,{className:`animate-spin`}):(0,Y.jsx)(x,{}),`Connect`]})]}),children:c?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t?.lastError?(0,Y.jsx)(B,{tone:`error`,children:t.lastError}):null,t?.preservedUserChanges?(0,Y.jsx)(B,{tone:`warning`,children:`Ryco left this provider's MCP entry untouched because it had been edited after installation.`}):null,o?(0,Y.jsxs)(`div`,{className:`settings-subsections-enter grid gap-4 rounded-[min(var(--radius-lg),0.625rem)] bg-muted/40 p-4`,children:[(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Customize the credential scope and limits before Ryco installs it. The provider profile is fixed to this detected workspace.`}),(0,Y.jsx)(ke,{form:C,onChange:O,clientLocked:!0}),(0,Y.jsx)(`div`,{className:`flex justify-end`,children:(0,Y.jsxs)(m,{size:`sm`,disabled:a||d?.available===!1,onClick:()=>void L(e,!0),children:[a?(0,Y.jsx)(A,{className:`animate-spin`}):(0,Y.jsx)(K,{}),`Connect with these permissions`]})})]}):null]}):null},e.id)})]})]})}var He=(0,q.lazy)(()=>t(()=>import(`./ComputerUseSettings-CkqCqDsU.js`).then(e=>({default:e.ComputerUseSettings})),[]));function Ue(){let e=(0,J.c)(14),t=y(),r=_(),a;e[0]===r?.primary?a=e[1]:(a=n&&!i()&&r?.primary===!0,e[0]=r?.primary,e[1]=a);let o=a,s=!!window.desktopBridge?.computerUse&&(t!==`node`||o),c;e[2]===t?c=e[3]:(c=t!==`client`&&(0,Y.jsx)(We,{}),e[2]=t,e[3]=c);let l;e[4]!==o||e[5]!==t||e[6]!==r?(l=t===`node`&&r&&!o&&(0,Y.jsx)(V,{title:`Device permissions`,description:`To enable screen recording, accessibility, or computer use on ${r.nodeLabel}, open Ryco on ${r.nodeLabel} and use Settings → Integrations. Operating system permissions must be approved on that device.`,bare:!0,children:null}),e[4]=o,e[5]=t,e[6]=r,e[7]=l):l=e[7];let u;e[8]===s?u=e[9]:(u=s&&(0,Y.jsx)(q.Suspense,{fallback:(0,Y.jsx)(V,{title:`Computer Use`,children:(0,Y.jsx)(H,{className:`text-xs text-muted-foreground`,children:`Loading device integrations…`})}),children:(0,Y.jsx)(He,{})}),e[8]=s,e[9]=u);let d;return e[10]!==c||e[11]!==l||e[12]!==u?(d=(0,Y.jsxs)(ie,{children:[c,l,u]}),e[10]=c,e[11]=l,e[12]=u,e[13]=d):d=e[13],d}function We(){let e=(0,J.c)(19),t=l(Ke),{updateSettings:n}=p(),r=N(o.serverUpdateSettings),[i,a]=(0,q.useState)(!1),s=t?`New Ryco-managed sessions receive Agent Control without changing the provider's global MCP configuration.`:`Agent Control is unavailable to Ryco sessions and external clients.`,u;e[0]!==r.allowed||e[1]!==r.reason?(u=!r.allowed&&r.reason?(0,Y.jsx)(`span`,{className:`text-destructive-foreground`,children:r.reason}):void 0,e[0]=r.allowed,e[1]=r.reason,e[2]=u):u=e[2];let d=!r.allowed,h;e[3]===n?h=e[4]:(h=e=>n({agentControl:{enabled:!!e}}),e[3]=n,e[4]=h);let g;e[5]!==t||e[6]!==d||e[7]!==h?(g=(0,Y.jsx)(ne,{checked:t,disabled:d,onCheckedChange:h,"aria-label":`Enable Agent Control`}),e[5]=t,e[6]=d,e[7]=h,e[8]=g):g=e[8];let _;e[9]!==s||e[10]!==u||e[11]!==g?(_=(0,Y.jsx)(V,{title:`Agent Control`,description:`Private tools for every agent, including visual replies (inline HTML pages). Ryco sessions receive the tools automatically. Connect supported standalone provider profiles with one click. Routine private-session actions run directly; destructive and security-sensitive changes require approval.`,children:(0,Y.jsx)(W,{title:`Enable Agent Control`,description:s,status:u,control:g})}),e[9]=s,e[10]=u,e[11]=g,e[12]=_):_=e[12];let v;e[13]!==t||e[14]!==i?(v=t?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ve,{}),(0,Y.jsx)(re,{children:(0,Y.jsx)(W,{title:(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(k,{className:`size-3.5 text-muted-foreground`}),`Advanced manual setup`]}),description:`Create a revocable pairing for another MCP client or a profile Ryco cannot detect.`,control:(0,Y.jsxs)(m,{size:`xs`,variant:`ghost`,"aria-expanded":i,onClick:()=>a(Ge),children:[i?`Hide`:`Show`,(0,Y.jsx)(f,{className:c(`transition-transform duration-(--app-motion-duration-chip)`,i&&`rotate-180`)})]})})}),i?(0,Y.jsx)(`div`,{className:`settings-panel-enter`,children:(0,Y.jsx)(Me,{})}):null]}):null,e[13]=t,e[14]=i,e[15]=v):v=e[15];let y;return e[16]!==_||e[17]!==v?(y=(0,Y.jsxs)(Y.Fragment,{children:[_,v]}),e[16]=_,e[17]=v,e[18]=y):y=e[18],y}function Ge(e){return!e}function Ke(e){return e.agentControl.enabled}export{Ue as IntegrationsSettingsPanel};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Bt as t,Rt as n,_t as r,bt as i,zt as a}from"./primary-Cf-xJExj.js";import{Q as o,io as s,tt as c}from"./wsTransport-C88seBPA.js";import{$i as l,Gi as u,Zi as d,ad as f,ea as p,fs as m,hs as h,lr as g,ms as _,wr as v}from"./runtime-DjjjAcTE.js";import{t as y}from"./react-CwJFpaho.js";import{S as b,Z as x,l as S,m as C,p as w}from"./popover-OWEv6cQz.js";import{i as T}from"./presentationTier-DPVAxTK4.js";import{a as E,r as D,t as O}from"./tooltip-DbqhseXd.js";import{t as k}from"./undo-2-lyluTGMW.js";import{t as A}from"./toastHelpers-CSQRKo4F.js";import{t as ee}from"./shallow-B--PNURq.js";import{t as j}from"./input-CCie4mm1.js";import{c as M}from"./select-Cb9FUPHD.js";import"./textarea-VyiIZ0wQ.js";import{c as N,d as P,l as F,o as I,u as L}from"./settingsLayout-CRFNCk_D.js";import{Bt as R,Ft as z,Ht as te,It as ne,Lt as re,Rt as ie,Ut as B}from"./main-Ch0bwS-M.js";var V=e(y(),1),H=T(),U={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},pane:{id:`pane`,label:`Split view`,sortWeight:105},pullRequests:{id:`pullRequests`,label:`Pull requests`,sortWeight:107},projects:{id:`projects`,label:`Projects`,sortWeight:108},script:{id:`script`,label:`Project scripts`,sortWeight:110}},ae={"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},"chat.newWithoutProject":{title:`New chat without a project`,sortWeight:3},"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.pinToggle":{title:`Pin or unpin current thread`,sortWeight:2},"thread.previous":{title:`Previous thread`,sortWeight:3},"thread.next":{title:`Next thread`,sortWeight:4},"thread.jump.1":{title:`Jump to thread 1`,sortWeight:5},"thread.jump.2":{title:`Jump to thread 2`,sortWeight:6},"thread.jump.3":{title:`Jump to thread 3`,sortWeight:7},"thread.jump.4":{title:`Jump to thread 4`,sortWeight:8},"thread.jump.5":{title:`Jump to thread 5`,sortWeight:9},"thread.jump.6":{title:`Jump to thread 6`,sortWeight:10},"thread.jump.7":{title:`Jump to thread 7`,sortWeight:11},"thread.jump.8":{title:`Jump to thread 8`,sortWeight:12},"thread.jump.9":{title:`Jump to thread 9`,sortWeight:13},"pane.split":{title:`Open a thread in split view`,sortWeight:1},"pane.close":{title:`Close focused pane`,sortWeight:2},"pane.focusNext":{title:`Focus next pane`,sortWeight:3},"pane.focusPrevious":{title:`Focus previous pane`,sortWeight:4},"pullRequests.open":{title:`Open pull requests`,sortWeight:1},"projects.open":{title:`Open projects page`,sortWeight:1}};function oe(e){let t=e.indexOf(`.`),n=t===-1?e:e.slice(0,t);return n===`script`?U.script:U[n]??U.script}function se(e,t){let n=oe(e),r=ae[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 W=[{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`}],G=new Map(W.map(e=>[e.value,e])),ce=new Map(W.map(e=>[e.value===void 0?void 0:e.value.replace(/\s+/g,``),e]));function K(e){return e===void 0?G.get(void 0):G.get(e)||ce.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 le(e,t){return(e===void 0?``:e.replace(/\s+/g,``))===(t===void 0?``:t.replace(/\s+/g,``))}function ue(e,t){let n=e[t];if(!n)return[];let i=[];return e.forEach((e,a)=>{a!==t&&e.command!==n.command&&r(e.command,n.command)&&e.key===n.key&&le(e.when,n.when)&&i.push({key:n.key,otherCommand:e.command,otherWhen:e.when})}),i}function de(e){let t=new Map;return e.forEach((n,r)=>{let i=ue(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 fe(e){return/mac|iphone|ipad|ipod/i.test(e)}var Y=new Set([`control`,`shift`,`alt`,`altgraph`,`meta`,`os`,`hyper`,`super`,`fn`,`capslock`,`numlock`,`scrolllock`]),pe=new Set([`escape`,`tab`,`enter`]);function me(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 he(e,t){let n=e.key.toLowerCase();if(Y.has(n))return null;let r=fe(t?.platform??(typeof navigator<`u`?navigator.platform:``)),i=r?e.metaKey:e.ctrlKey;if(!(i||e.shiftKey||e.altKey||(r?e.ctrlKey:e.metaKey))&&pe.has(n))return null;let a=me(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 ge={mod:`⌘`,meta:`⌘`,cmd:`⌘`,ctrl:`⌃`,control:`⌃`,shift:`⇧`,alt:`⌥`,option:`⌥`},_e={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 ve(e,t){let n=fe(t?.platform??(typeof navigator<`u`?navigator.platform:``))?ge:_e,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 ye(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();function be(e){let t=(0,H.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`relative inline-flex w-full min-w-0 items-center rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)] has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--radius-md)-1px)]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{className:i,"data-slot":`input-group`,role:`group`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var xe=m(`[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80`,{defaultVariants:{align:`inline-start`},variants:{align:{"block-end":`order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"block-start":`order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"inline-end":`has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]`,"inline-start":`has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]`}}});function Se(e){let t=(0,H.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=l(xe({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{className:o,"data-align":a,"data-slot":`input-group-addon`,onMouseDown:Ce,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function Ce(e){if(e.target.closest(`button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']`))return;e.preventDefault();let t=e.currentTarget.parentElement,n=t?.querySelector(`input, textarea`);n&&!t?.querySelector(`input:focus, textarea:focus`)&&n.focus()}function we(e){let t=(0,H.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,Z.jsx)(j,{className:n,unstyled:!0,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}var Te=(()=>{let e=new Map;for(let t of n){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([...n.map(e=>e.command),...c]);function Ee(e,t){return`${e.command}|${e.key}|${e.when??``}|${t}`}function De(e){return{key:ye(e.shortcut),command:e.command,when:J(e.whenAst)}}function $(e){return e.map((e,t)=>({...De(e),__id:Ee(e,t)}))}function Oe(e){return e.map(({__id:e,...t})=>t)}function ke(e){return n.filter(t=>t.command===e).map(e=>Object.assign({},e))}function Ae(e,t){if(!Q.has(e))return`custom`;let n=Te.get(e);if(!n)return t.length===0?`default`:`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 je(e,t,n){return!n||[t.toLowerCase(),e.command.toLowerCase(),e.key.toLowerCase(),q(e.when).toLowerCase()].some(e=>e.includes(n))}function Me(){return Math.random().toString(36).slice(2)}function Ne(){let{hydrated:e,error:t}=te(),n=R(),r=typeof navigator<`u`?navigator.platform:``,c=p(r),[l,f]=(0,V.useState)(null),[m,h]=(0,V.useState)(null),[_,y]=(0,V.useState)(``),[b,S]=(0,V.useState)(!1),C=v(ee(g)),w=(0,V.useMemo)(()=>{let e=new Set,t=new Map;for(let n of C)for(let r of n.scripts){let a=i({environmentId:n.environmentId,projectId:n.id},r.id);e.add(a),t.has(a)||t.set(a,`Run: ${r.name} · ${n.name} · ${n.environmentId}`)}return{commandList:Array.from(e),titles:t}},[C]),[T,E]=(0,V.useState)(()=>$(n)),[D,O]=(0,V.useState)(()=>JSON.stringify(Oe($(n)))),j=(0,V.useRef)(!1),[M,B]=(0,V.useState)(!1);(0,V.useEffect)(()=>{let e=JSON.stringify(Oe($(n)));e!==D&&(O(e),j.current||E($(n)))},[n,D]);let H=(0,V.useCallback)(async e=>{if(!j.current){j.current=!0,B(!0);try{await ne(Oe(e).filter(e=>e.key.length>0))}catch(e){u.add(A({type:`error`,title:`Could not save keybindings`,description:e instanceof Error?e.message:`An unknown error occurred.`})),E($(n))}finally{j.current=!1,B(!1)}}},[n]),ae=(0,V.useCallback)((e,t)=>{j.current||E(n=>{let r=n.slice(),i=r[e];if(!i)return n;let a=ye(t);return a===i.key?n:(r[e]={...i,key:a,__id:i.__id},H(r),r)})},[H]),oe=(0,V.useCallback)(e=>{j.current||E(t=>{let n={command:e,key:``,when:void 0,__id:`placeholder-${Me()}`},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)]})},[]),W=(0,V.useCallback)(e=>{j.current||E(t=>{let n=t.slice();return n.splice(e,1),H(n),n})},[H]),G=(0,V.useCallback)((e,t)=>{j.current||E(n=>{let r=n.slice(),i=r[e];return!i||(i.when??void 0)===t?n:(r[e]={...i,when:t,__id:i.__id},H(r),r)})},[H]),ce=(0,V.useCallback)(e=>{j.current||E(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),H(n),n}let i=ke(r),a=t.filter(e=>e.command!==r);for(let e of i)a.push({...e,__id:`default-${r}-${Me()}`});return H(a),a})},[H]),K=(0,V.useCallback)(e=>{j.current||E(t=>{let n=t.filter(t=>t.command!==e);if(Q.has(e))for(let t of ke(e))n.push({...t,__id:`default-${e}-${Me()}`});return H(n),n})},[H]),q=(0,V.useCallback)(async()=>{if(!j.current){j.current=!0,B(!0);try{await re(),E($(a))}catch(e){u.add(A({type:`error`,title:`Could not restore default keybindings`,description:e instanceof Error?e.message:`An unknown error occurred.`})),E($(n))}finally{j.current=!1,B(!1)}}},[n]),J=(0,V.useRef)(new Map),le=(0,V.useCallback)(e=>{let t=J.current.get(e);t&&(t.scrollIntoView({behavior:`smooth`,block:`center`}),t.dataset.flash=`true`,window.setTimeout(()=>{delete t.dataset.flash},1100))},[]),[ue,fe]=(0,V.useState)(``),Y=(0,V.useDeferredValue)(ue.trim().toLowerCase()),pe=(0,V.useMemo)(()=>de(T),[T]),me=(0,V.useMemo)(()=>{let e=new Map;T.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,...w.commandList]),n=new Map;for(let r of t){let t=e.get(r)??[],i=t.map(e=>T[e]).filter(Boolean),a=se(r,w.titles.get(r)),o=Ae(r,i),s={key:``,command:r,when:void 0};if(!(Y.length===0||je(s,a.title,Y)||i.some(e=>je(e,a.title,Y))))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(U).toSorted((e,t)=>e.sortWeight-t.sortWeight)){let t=n.get(e.id);t&&t.length!==0&&(t.sort((e,t)=>{let n=se(e.command,w.titles.get(e.command)),r=se(t.command,w.titles.get(t.command));return n.sortWeight-r.sortWeight}),r.push({category:e,rows:t}))}return r},[T,Y,w]),he=me.reduce((e,t)=>e+t.rows.length,0),ge=(0,V.useMemo)(()=>({platform:r,draft:T,conflictsByCommand:pe,onRebind:ae,onAddBinding:oe,onRemoveBinding:W,onChangeWhen:G,onResetBinding:ce,onResetCommand:K,scrollToCommand:le,rowRefs:J}),[r,T,pe,ae,oe,W,G,ce,K,le]),_e=l?.some(e=>e.command.startsWith(`script.`))??!1,X=C.find(e=>JSON.stringify([e.environmentId,e.id])===_),ve=l!==null&&(!_e||X!==void 0),xe=async e=>{h(null),f(null);try{if(e.size>1048576)throw Error(`Keybindings files must be smaller than 1 MiB.`);let t=s(o)(JSON.parse(await e.text()));f(t)}catch(e){h(e instanceof Error?e.message:`Invalid keybindings file.`)}},Ce=async()=>{if(l&&ve){S(!0),h(null);try{let e=l.map(e=>{if(!e.command.startsWith(`script.`))return e;let t=e.command.slice(7,-4);if(!X?.scripts.some(e=>e.id===t))throw Error(`Script ${t} does not exist in the selected project. Choose the correct project or assign its shortcut from Actions.`);return{...e,command:i({environmentId:X.environmentId,projectId:X.id},t)}});await z(e),f(null)}catch(e){h(e instanceof Error?e.message:`Could not import keybindings.`)}finally{S(!1)}}};return(0,Z.jsxs)(F,{children:[t?(0,Z.jsxs)(N,{tone:`warning`,title:`Local keybindings need attention`,children:[(0,Z.jsx)(`p`,{children:t}),(0,Z.jsx)(`p`,{children:`Retry loading, or deliberately replace the local document with defaults.`}),(0,Z.jsx)(d,{size:`xs`,variant:`ghost`,onClick:()=>void ie().catch(()=>void 0),children:`Retry loading`}),(0,Z.jsx)(d,{size:`xs`,variant:`ghost`,disabled:M,onClick:()=>void q(),children:`Replace local bindings with defaults`})]}):null,(0,Z.jsxs)(`fieldset`,{disabled:!e||M||b,className:`contents`,children:[(0,Z.jsx)(P,{title:`App shortcuts`,headerAction:(0,Z.jsxs)(d,{variant:`ghost`,size:`xs`,onClick:()=>void q(),disabled:!e,children:[(0,Z.jsx)(k,{}),` Restore defaults`]}),children:(0,Z.jsx)(L,{title:`Saved in this app`,description:`Shortcuts belong to this desktop installation or browser profile and apply across connected nodes.`})}),(0,Z.jsxs)(P,{title:`Import legacy bindings`,children:[(0,Z.jsx)(L,{title:`Import keybindings.json`,description:`Select an existing node's keybindings.json. Review before importing; locally configured and disabled commands are preserved.`,status:(0,Z.jsx)(`input`,{type:`file`,accept:`.json,application/json`,"aria-label":`Import legacy keybindings file`,disabled:!e||b,onChange:e=>{let t=e.target.files?.[0];t&&xe(t),e.target.value=``}})}),l?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[l.length,` rules selected. Existing local commands take precedence.`]}),(0,Z.jsx)(`ul`,{className:`max-h-48 overflow-y-auto text-xs font-mono`,children:l.map((e,t)=>(0,Z.jsxs)(`li`,{children:[e.command,`: `,e.key,e.when?` · ${e.when}`:``]},Ee(e,t)))}),_e?(0,Z.jsxs)(`label`,{className:`text-xs`,children:[`Assign legacy script shortcuts to a project`,(0,Z.jsxs)(`select`,{"aria-label":`Import script project`,value:_,onChange:e=>y(e.target.value),children:[(0,Z.jsx)(`option`,{value:``,children:`Choose project and node`}),C.map(e=>(0,Z.jsxs)(`option`,{value:JSON.stringify([e.environmentId,e.id]),children:[e.name,` · `,e.environmentId]},JSON.stringify([e.environmentId,e.id])))]})]}):null,(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Z.jsx)(d,{size:`xs`,disabled:!ve||b,onClick:()=>void Ce(),children:`Import reviewed bindings`}),(0,Z.jsx)(d,{size:`xs`,variant:`ghost`,disabled:b,onClick:()=>f(null),children:`Cancel`})]})]}):null,m?(0,Z.jsx)(N,{tone:`warning`,title:`Could not import bindings`,children:m}):null]}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsxs)(be,{children:[(0,Z.jsx)(Se,{children:(0,Z.jsx)(x,{})}),(0,Z.jsx)(we,{type:`search`,"aria-label":`Search keybindings`,placeholder:`Search by command, shortcut, or when…`,value:ue,onChange:e=>fe(e.target.value)})]}),(0,Z.jsx)(`p`,{className:`px-0.5 text-xs text-muted-foreground`,children:`Click a shortcut and press a new combination to rebind. Esc cancels, Backspace clears.`})]}),he===0?(0,Z.jsx)(I,{icon:(0,Z.jsx)(x,{}),title:`No commands match your search`,description:`Try a command name, a key like ⌘K, or a context such as terminal.`}):me.map(e=>(0,Z.jsx)(P,{title:e.category.label,children:e.rows.map(e=>(0,Z.jsx)(Pe,{row:e,context:ge,isMac:c,scriptTitle:w.titles.get(e.command)},e.command))},e.category.id))]})]})}var Pe=(0,V.memo)(function(e){let t=(0,H.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),u=n.command,d;t[9]!==r.rowRefs.current||t[10]!==n.command?(d=e=>{r.rowRefs.current.set(n.command,e)},t[9]=r.rowRefs.current,t[10]=n.command,t[11]=d):d=t[11];let f;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(f=l(`group flex flex-col gap-2 border-t border-border/60 px-4 py-3.5 first:border-t-0 transition-colors duration-300 data-[flash=true]:bg-primary/8 sm:px-5`),t[12]=f):f=t[12];let p;t[13]===n.title?p=t[14]:(p=(0,Z.jsx)(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:n.title}),t[13]=n.title,t[14]=p);let m;t[15]===n.status?m=t[16]:(m=(0,Z.jsx)(Fe,{status:n.status}),t[15]=n.status,t[16]=m);let h;t[17]!==p||t[18]!==m?(h=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[p,m]}),t[17]=p,t[18]=m,t[19]=h):h=t[19];let g;t[20]===n.command?g=t[21]:(g=(0,Z.jsx)(`code`,{className:`mt-0.5 block truncate font-mono text-[11px] text-muted-foreground`,children:n.command}),t[20]=n.command,t[21]=g);let _;t[22]!==h||t[23]!==g?(_=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[h,g]}),t[22]=h,t[23]=g,t[24]=_):_=t[24];let v=o.length===0?(0,Z.jsx)(Le,{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)(Le,{draftIndex:n,rule:a,context:r,isMac:i,isPrimary:t===0,isPlaceholder:a.key.length===0},`${n}-${a.__id}`)}),y;t[25]!==r||t[26]!==n.command||t[27]!==n.title||t[28]!==o?(y=o.length>0?(0,Z.jsxs)(O,{children:[(0,Z.jsx)(E,{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)(B,{className:`size-3.5`})})}),(0,Z.jsx)(D,{side:`top`,children:`Add another shortcut`})]}):null,t[25]=r,t[26]=n.command,t[27]=n.title,t[28]=o,t[29]=y):y=t[29];let b;t[30]!==r||t[31]!==n.command||t[32]!==n.status||t[33]!==n.title?(b=n.status!=="default"&&Q.has(n.command)?(0,Z.jsxs)(O,{children:[(0,Z.jsx)(E,{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)(k,{className:`size-3.5`})})}),(0,Z.jsx)(D,{side:`top`,children:`Reset to default`})]}):null,t[30]=r,t[31]=n.command,t[32]=n.status,t[33]=n.title,t[34]=b):b=t[34];let x;t[35]!==v||t[36]!==y||t[37]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 sm:justify-end`,children:[v,y,b]}),t[35]=v,t[36]=y,t[37]=b,t[38]=x):x=t[38];let S;t[39]!==_||t[40]!==x?(S=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-4`,children:[_,x]}),t[39]=_,t[40]=x,t[41]=S):S=t[41],a=(0,Z.jsxs)(`div`,{"data-keybinding-command":u,ref:d,className:f,children:[S,c.length>0?(0,Z.jsxs)(`div`,{className:`settings-subsections-enter flex flex-col gap-1 rounded-[min(var(--radius-md),0.5rem)] border border-destructive/28 bg-destructive/6 px-2.5 py-1.5 text-[11px] text-destructive-foreground`,children:[c.map(e=>(0,Z.jsx)(Ie,{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 Fe(e){let t=(0,H.c)(3),{status:n}=e;if(n==="default")return null;let r=n===`modified`?`warning`:`info`,i=n===`modified`?`Modified`:`Custom`,a;return t[0]!==r||t[1]!==i?(a=(0,Z.jsx)(M,{size:`sm`,variant:r,children:i}),t[0]=r,t[1]=i,t[2]=a):a=t[2],a}function Ie(e){let n=(0,H.c)(27),{conflict:r,platform:i,isMac:a,onSelect:o}=e,s;n[0]===r.otherCommand?s=n[1]:(s=se(r.otherCommand),n[0]=r.otherCommand,n[1]=s);let c=s,l,u,d,f;if(n[2]!==r.key||n[3]!==a||n[4]!==i){let e=t(r.key),o=e?ve(e,{platform:i}):[r.key];d=`flex flex-wrap items-center gap-1.5`,n[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(h,{className:`size-3 shrink-0 text-destructive`}),n[9]=f):f=n[9],l=`inline-flex items-center gap-0.5 font-mono`;let s;n[10]===a?s=n[11]:(s=e=>(0,Z.jsx)(Be,{token:e,isMac:a},e),n[10]=a,n[11]=s),u=o.map(s),n[2]=r.key,n[3]=a,n[4]=i,n[5]=l,n[6]=u,n[7]=d,n[8]=f}else l=n[5],u=n[6],d=n[7],f=n[8];let p;n[12]!==l||n[13]!==u?(p=(0,Z.jsx)(`span`,{className:l,children:u}),n[12]=l,n[13]=u,n[14]=p):p=n[14];let m;n[15]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`span`,{children:`also bound to`}),n[15]=m):m=n[15];let g;n[16]!==c.title||n[17]!==o?(g=(0,Z.jsx)(`button`,{type:`button`,onClick:o,className:`rounded bg-destructive/20 px-1.5 py-0.5 font-medium text-destructive-foreground hover:bg-destructive/30`,children:c.title}),n[16]=c.title,n[17]=o,n[18]=g):g=n[18];let _;n[19]===r.otherWhen?_=n[20]:(_=r.otherWhen===void 0?null:(0,Z.jsxs)(`span`,{className:`opacity-70`,children:[`when `,(0,Z.jsx)(`code`,{className:`font-mono`,children:q(r.otherWhen)})]}),n[19]=r.otherWhen,n[20]=_);let v;return n[21]!==d||n[22]!==f||n[23]!==p||n[24]!==g||n[25]!==_?(v=(0,Z.jsxs)(`div`,{className:d,children:[f,p,m,g,_]}),n[21]=d,n[22]=f,n[23]=p,n[24]=g,n[25]=_,n[26]=v):v=n[26],v}function Le(e){let n=(0,H.c)(55),{draftIndex:r,rule:i,context:a,isMac:o,isPlaceholder:s,onAddPlaceholder:c}=e,[u,d]=(0,V.useState)(!1),[f,p]=(0,V.useState)(!1),m=(0,V.useRef)(null),h;bb0:{if(i.key.length===0){h=null;break bb0}let e;n[0]===i.key?e=n[1]:(e=t(i.key),n[0]=i.key,n[1]=e),h=e}let g=h,v=g?ve(g,{platform:a.platform}):[],y;n[2]!==r||n[3]!==s||n[4]!==c?(y=()=>{if(s&&r===-1&&c){c(),setTimeout(Re,50);return}d(!0)},n[2]=r,n[3]=s,n[4]=c,n[5]=y):y=n[5];let b=y,x,S;n[6]!==a||n[7]!==r||n[8]!==u?(x=()=>{if(!u)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`&&!He(e)){d(!1);return}if(e.key===`Tab`&&!He(e)){d(!1);return}if(e.key===`Backspace`&&!He(e)){r>=0&&a.onRemoveBinding(r),d(!1);return}let t=he(e,{platform:a.platform});t&&(r>=0&&a.onRebind(r,t),p(!0),d(!1),setTimeout(()=>p(!1),220))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},S=[u,r,a],n[6]=a,n[7]=r,n[8]=u,n[9]=x,n[10]=S):(x=n[9],S=n[10]),(0,V.useEffect)(x,S);let C,w;n[11]===u?(C=n[12],w=n[13]):(C=()=>{u&&m.current?.focus()},w=[u],n[11]=u,n[12]=C,n[13]=w),(0,V.useEffect)(C,w);let T;n[14]!==u||n[15]!==b?(T=e=>{u||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),b())},n[14]=u,n[15]=b,n[16]=T):T=n[16];let E=T,D;n[17]!==a||n[18]!==r?(D=()=>{r>=0&&a.onRemoveBinding(r)},n[17]=a,n[18]=r,n[19]=D):D=n[19];let O=D;if(s&&r===-1&&v.length===0){let e;n[20]===c?e=n[21]:(e=()=>c?.(),n[20]=c,n[21]=e);let t;n[22]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(B,{className:`size-3`}),n[22]=t):t=n[22];let r;return n[23]!==E||n[24]!==e?(r=(0,Z.jsxs)(`button`,{ref:m,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:[t,` No shortcut — click to set`]}),n[23]=E,n[24]=e,n[25]=r):r=n[25],r}let k=`Edit shortcut for ${i.command}`,A=v.length===0&&r>=0?`true`:void 0,ee=u?`keybinding-chip-recording border-primary/60 bg-primary/10 text-foreground`:f?`border-success/50 bg-success/12 text-foreground`:`border-border bg-muted/60 text-foreground hover:bg-muted`,j;n[26]===ee?j=n[27]:(j=l(`inline-flex h-6 items-center gap-1 rounded-[min(var(--radius-md),0.4rem)] border px-2 font-mono text-[11px] transition-[background-color,border-color,color] duration-150`,ee),n[26]=ee,n[27]=j);let M=u?(0,Z.jsx)(`span`,{className:`text-[11px] tracking-[0.04em]`,children:`Press shortcut…`}):v.length===0?(0,Z.jsx)(`span`,{className:`text-muted-foreground/60`,children:`Click to set`}):v.map(e=>(0,Z.jsx)(Be,{token:e,isMac:o},e)),N;n[28]!==u||n[29]!==i.when?(N=!u&&i.when!==void 0?(0,Z.jsx)(`span`,{className:`ml-1 hidden sm:inline`,children:`·`}):null,n[28]=u,n[29]=i.when,n[30]=N):N=n[30];let P;n[31]!==u||n[32]!==E||n[33]!==b||n[34]!==k||n[35]!==A||n[36]!==j||n[37]!==M||n[38]!==N?(P=(0,Z.jsxs)(`button`,{ref:m,type:`button`,"aria-pressed":u,"aria-label":k,"data-chip-pending-record":A,onClick:b,onKeyDown:E,className:j,children:[M,N]}),n[31]=u,n[32]=E,n[33]=b,n[34]=k,n[35]=A,n[36]=j,n[37]=M,n[38]=N,n[39]=P):P=n[39];let F;n[40]!==a||n[41]!==r?(F=e=>a.onChangeWhen(r,e),n[40]=a,n[41]=r,n[42]=F):F=n[42];let I=r<0||u,L;n[43]!==i.when||n[44]!==F||n[45]!==I?(L=(0,Z.jsx)(Ve,{currentWhen:i.when,onChange:F,disabled:I}),n[43]=i.when,n[44]=F,n[45]=I,n[46]=L):L=n[46];let R;n[47]!==r||n[48]!==O||n[49]!==u?(R=r>=0&&!u?(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)(_,{className:`size-3 text-muted-foreground/60 hover:text-destructive`})}):null,n[47]=r,n[48]=O,n[49]=u,n[50]=R):R=n[50];let z;return n[51]!==P||n[52]!==L||n[53]!==R?(z=(0,Z.jsxs)(`span`,{className:`relative inline-flex items-center gap-1`,children:[P,L,R]}),n[51]=P,n[52]=L,n[53]=R,n[54]=z):z=n[54],z}function Re(){document.querySelectorAll(`[data-chip-pending-record="true"]`).forEach(ze)}function ze(e){e.click()}function Be(e){let t=(0,H.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=l(`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 Ve(e){let t=(0,H.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,u,d,f,p,m;if(t[2]!==n||t[3]!==i){let e=q(n);c=S,s=b,u=`button`,d=i;let r=n===void 0&&`italic opacity-70`;t[11]===r?f=t[12]:(f=l(`inline-flex h-5 items-center gap-1 rounded-[min(var(--radius-sm),0.3rem)] bg-muted/50 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]=f),p=`When: ${e}`,m=n===void 0?`always`:e.toLowerCase(),t[2]=n,t[3]=i,t[4]=s,t[5]=c,t[6]=u,t[7]=d,t[8]=f,t[9]=p,t[10]=m}else s=t[4],c=t[5],u=t[6],d=t[7],f=t[8],p=t[9],m=t[10];let h;t[13]!==u||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(h=(0,Z.jsx)(`button`,{type:u,disabled:d,className:f,"aria-label":p,children:m}),t[13]=u,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=h):h=t[18];let g;t[19]!==s||t[20]!==h?(g=(0,Z.jsx)(s,{render:h}),t[19]=s,t[20]=h,t[21]=g):g=t[21];let _;t[22]!==n||t[23]!==o?(_=!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]=_):_=t[24];let v;t[25]!==n||t[26]!==r?(v=W.map(e=>(0,Z.jsxs)(w,{onClick:()=>r(e.value),className:l(`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]=v):v=t[27];let y;t[28]!==v||t[29]!==_?(y=(0,Z.jsxs)(C,{side:`bottom`,align:`end`,className:`min-w-[220px]`,children:[_,v]}),t[28]=v,t[29]=_,t[30]=y):y=t[30];let x;return t[31]!==c||t[32]!==y||t[33]!==g?(x=(0,Z.jsxs)(c,{children:[g,y]}),t[31]=c,t[32]=y,t[33]=g,t[34]=x):x=t[34],x}function He(e){return e.metaKey||e.ctrlKey||e.altKey||e.shiftKey}export{Ne as KeybindingsSettingsPanel};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-Di0isH9D.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./index-DARIYokI.js";import{ad as n}from"./runtime-DjjjAcTE.js";import{t as r}from"./react-CwJFpaho.js";import{i}from"./presentationTier-DPVAxTK4.js";var a=i(),o=e(r(),1),s=n(),c=(0,o.lazy)(()=>t(()=>import(`./BrowserPanel-CdBLnnfz.js`).then(e=>({default:e.BrowserPanel})),__vite__mapDeps([0])));function l(e){let t=(0,a.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,s.jsx)(`p`,{role:`status`,className:`p-4 text-sm text-muted-foreground`,children:`Loading browser…`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,s.jsx)(o.Suspense,{fallback:n,children:(0,s.jsx)(c,{...e})}),t[1]=e,t[2]=r),r}export{l as t};