ryco-cli 0.1.23 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +228 -88
- package/dist/bin.mjs +230 -90
- package/dist/client/assets/AccountSettings-ApnDA1f-.js +1 -0
- package/dist/client/assets/AiFocusSettings-CNmGHEcA.js +1 -0
- package/dist/client/assets/{AnimatedHeight-D9bpLPqe.js → AnimatedHeight-i0YhvlGD.js} +1 -1
- package/dist/client/assets/AppearanceSettings-BG8W4DP0.js +1 -0
- package/dist/client/assets/BranchToolbar.logic-AgPy06Mx.js +1 -0
- package/dist/client/assets/BrowserPanel-BWztlNuL.js +1 -0
- package/dist/client/assets/ChatRightPanel-a6UOHNMm.js +194 -0
- package/dist/client/assets/ChatThreadRouteView-CWoBLzR_.js +1 -0
- package/dist/client/assets/CommandPaletteDialog-B2iKWCUi.js +1 -0
- package/dist/client/assets/CompositeRoot-C1G-Ejus.js +1 -0
- package/dist/client/assets/ComputerUseSettings-CPwWoHWj.js +1 -0
- package/dist/client/assets/ConnectionsSettings-CPMkuxza.js +7 -0
- package/dist/client/assets/ContextHandoffEndpointLabel-BildLLDY.js +4 -0
- package/dist/client/assets/DiagnosticsSettings-DvnNz2AZ.js +2 -0
- package/dist/client/assets/DialogHandle-8o3kfoiI.js +1 -0
- package/dist/client/assets/DialogPopup-CLw6NCkW.js +1 -0
- package/dist/client/assets/DialogRoot-SKkIuQHA.js +1 -0
- package/dist/client/assets/DialogTitle-DCHX74Tz.js +1 -0
- package/dist/client/assets/DialogTrigger-Bl_fcIV2.js +1 -0
- package/dist/client/assets/DialogViewport-DVDl03yd.js +1 -0
- package/dist/client/assets/DraftChatThreadRouteView-CEDYjbKq.js +1 -0
- package/dist/client/assets/{ExternalIdentityWeb.logic-pjD4pCDd.js → ExternalIdentityWeb.logic-arHvT6AX.js} +1 -1
- package/dist/client/assets/GlassSurface-GY6owikG.js +1 -0
- package/dist/client/assets/HostedConnectionControls-COUhSe9x.js +1 -0
- package/dist/client/assets/HostedHubRoot-BTWc0XoQ.js +2 -0
- package/dist/client/assets/HostedNativeAuthorizationRoute-DZhYxv--.js +2 -0
- package/dist/client/assets/HostedRelayTrustNotice-Bl6On0Yi.js +1 -0
- package/dist/client/assets/IntegrationsSettingsPanel-n9owMZf-.js +2 -0
- package/dist/client/assets/KeybindingsSettings-CPtXx-W2.js +7 -0
- package/dist/client/assets/LazyBrowserPanel-SUIBB7B4.js +2 -0
- package/dist/client/assets/McpServersSettings-BWIUud0Z.js +6 -0
- package/dist/client/assets/MobileSheet-NTayGHF6.js +1 -0
- package/dist/client/assets/NodeSecuritySettings-BFifrshE.js +1 -0
- package/dist/client/assets/OpinionatedPluginsSettings-D7WuuNWZ.js +1 -0
- package/dist/client/assets/PhoneGetAppInterstitial-R0cqI17q.js +1 -0
- package/dist/client/assets/PhoneHome-FqWvnJP_.js +1 -0
- package/dist/client/assets/PhoneSettingsSurface-w5PJnoBc.js +2 -0
- package/dist/client/assets/ProviderModelPicker-dwWhl7Uf.js +1 -0
- package/dist/client/assets/ProvidersSettingsPanel-Ww1ch3xA.js +1 -0
- package/dist/client/assets/QuitShortcutFeedback-CklL3jMd.js +1 -0
- package/dist/client/assets/RedactedSensitiveText-CLPBtvH1.js +1 -0
- package/dist/client/assets/RootAppShell-BdQCs2XJ.js +7 -0
- package/dist/client/assets/Separator-CpYBhf-I.js +1 -0
- package/dist/client/assets/SettingsDialog-DeMzEeCP.js +2 -0
- package/dist/client/assets/SettingsPanels-ZxNz9ZfL.js +3 -0
- package/dist/client/assets/SettingsPanels.editor-9pSZP875.js +1 -0
- package/dist/client/assets/SourceControlSettings-C1F3Brcn.js +1 -0
- package/dist/client/assets/StatisticsPage-C7v-6CTr.js +1 -0
- package/dist/client/assets/StatisticsPanel-CeIjiBm8.js +1 -0
- package/dist/client/assets/StatisticsSettingsLink-5s_violW.js +1 -0
- package/dist/client/assets/{ThreadTerminalDrawer-DcZk76Y9.js → ThreadTerminalDrawer-CHZ60lPI.js} +11 -11
- package/dist/client/assets/{ThreadWorkspacePanel-Shhau2BD.js → ThreadWorkspacePanel-Ct5kMcuY.js} +17 -17
- package/dist/client/assets/activity-BMBx2Fu0.js +1 -0
- package/dist/client/assets/alert-CXnC_RJc.js +1 -0
- package/dist/client/assets/{appChrome-CiOQzE1d.js → appChrome-BzM66lXM.js} +1 -1
- package/dist/client/assets/arrow-left-CymyVbCi.js +1 -0
- package/dist/client/assets/arrow-right-9wyq4YVq.js +1 -0
- package/dist/client/assets/arrow-up-right-mfU38K6p.js +1 -0
- package/dist/client/assets/authorization-CjOFkg7b.js +1 -0
- package/dist/client/assets/badge-Dg7mXiOh.js +1 -0
- package/dist/client/assets/bot-BR3RyOWP.js +1 -0
- package/dist/client/assets/{capabilities-BTd0MRtv.js → capabilities-C8sxDbKT.js} +1 -1
- package/dist/client/assets/chart-column-CcRi3pAd.js +1 -0
- package/dist/client/assets/chevron-right-CuUjBsQV.js +1 -0
- package/dist/client/assets/clipboard-copy-ezz8rnaT.js +1 -0
- package/dist/client/assets/data-list-ZLhzdlED.js +1 -0
- package/dist/client/assets/desktopWorkspace-P28r2lN2.js +1 -0
- package/dist/client/assets/download-BA9L9tK9.js +1 -0
- package/dist/client/assets/editorPreferences-DeKdSV3s.js +1 -0
- package/dist/client/assets/empty-3NpXLnAM.js +1 -0
- package/dist/client/assets/group-D5qBdsaB.js +1 -0
- package/dist/client/assets/hostedConnectionCoordinator-CLV-JD1S.js +1 -0
- package/dist/client/assets/{hostedPairing-PogXRAb7.js → hostedPairing-B_ylEEDa.js} +1 -1
- package/dist/client/assets/hubRoutes-EWJ3Gdod.js +1 -0
- package/dist/client/assets/{index-D5j6WG7w.js → index-DxCd1PgA.js} +2 -2
- package/dist/client/assets/input-DrOL1KPS.js +1 -0
- package/dist/client/assets/kbd-rWDjJnWX.js +1 -0
- package/dist/client/assets/key-round-D2DtQ7aS.js +1 -0
- package/dist/client/assets/layers-DtSJWmwy.js +1 -0
- package/dist/client/assets/log-out-YAp9fsOg.js +1 -0
- package/dist/client/assets/{logging-DfaR8ACp.js → logging-BuUPX1SP.js} +1 -1
- package/dist/client/assets/main-BbtLAX7M.js +9 -0
- package/dist/client/assets/{main-CRk9p9SC.css → main-D4CtFNPY.css} +1 -1
- package/dist/client/assets/monitor-OyD484tI.js +1 -0
- package/dist/client/assets/palette-D18VboLH.js +1 -0
- package/dist/client/assets/play-d3KUi4G6.js +1 -0
- package/dist/client/assets/primary-D_D7eLwT.js +2 -0
- package/dist/client/assets/{providerDriverMeta-Cl-ADdmZ.js → providerDriverMeta-DNTocCcU.js} +1 -1
- package/dist/client/assets/providerModels-bFbEIfL9.js +1 -0
- package/dist/client/assets/{qr-code-Bun4dpvz.js → qr-code-Bk1kdf_k.js} +1 -1
- package/dist/client/assets/qr-code-MAZkoKtL.js +1 -0
- package/dist/client/assets/radio-group-D-VCGinX.js +2 -0
- package/dist/client/assets/refresh-cw-DY3_Ph-S.js +1 -0
- package/dist/client/assets/runtime-Djy96GJd.js +17 -0
- package/dist/client/assets/save-ugJXuJRM.js +1 -0
- package/dist/client/assets/scroll-area-BMnGzd2a.js +1 -0
- package/dist/client/assets/scrollEdges-QLSFwGSQ.js +1 -0
- package/dist/client/assets/separator-BwUYkCkX.js +1 -0
- package/dist/client/assets/settingsLayout-C6SUmJVB.js +1 -0
- package/dist/client/assets/sheet-DLy4aeVa.js +1 -0
- package/dist/client/assets/shield-Zq_ygsnJ.js +1 -0
- package/dist/client/assets/shield-alert-DfUhTI4-.js +1 -0
- package/dist/client/assets/shield-check-CO4SMhAs.js +1 -0
- package/dist/client/assets/sidebar-DNnW-a2V.js +1 -0
- package/dist/client/assets/sidebarProjectFolders-ygpaKZM6.js +4 -0
- package/dist/client/assets/sidebarStatusText-CawrXnx0.js +1 -0
- package/dist/client/assets/skeleton-DRm4_OvB.js +1 -0
- package/dist/client/assets/smartphone-O2VACDhU.js +1 -0
- package/dist/client/assets/sparkles-isHutYWU.js +1 -0
- package/dist/client/assets/src-BSuAGqhK.js +14 -0
- package/dist/client/assets/star-7UHEnC3x.js +1 -0
- package/dist/client/assets/{switch-COrEGDkz.js → switch-DD1qVLgN.js} +9 -9
- package/dist/client/assets/toastHelpers-CSQRKo4F.js +1 -0
- package/dist/client/assets/toggle-CaKBNe6W.js +1 -0
- package/dist/client/assets/toggle-group-UeFeTI3u.js +1 -0
- package/dist/client/assets/tokenModePresentation-DV56ekA4.js +1 -0
- package/dist/client/assets/tooltip-DXvXxL37.js +1 -0
- package/dist/client/assets/unplug-DisTpujT.js +1 -0
- package/dist/client/assets/useAppSidebarCollapsed-CaAsLi1q.js +1 -0
- package/dist/client/assets/useBaseUiId-CJN4MvrU.js +1 -0
- package/dist/client/assets/useLabelableId-BsDFG9Oj.js +1 -0
- package/dist/client/assets/useNavigate-cLfxn_9L.js +1 -0
- package/dist/client/assets/usePhoneThreadActions-rekHL1Mi.js +1 -0
- package/dist/client/assets/usePopupViewport-kXU31P6l.js +1 -0
- package/dist/client/assets/useScrollLock-DjMxrUJe.js +1 -0
- package/dist/client/assets/{useStatistics-DfLU9_Qu.js → useStatistics-BYP-9CmW.js} +15 -15
- package/dist/client/assets/useTriggerFocusGuards-DuAm2B8C.js +1 -0
- package/dist/client/assets/useValueChanged-DreFjrMK.js +1 -0
- package/dist/client/assets/user-round-DctamWV6.js +1 -0
- package/dist/client/assets/{vscode-icons-Dgo7Sslf.js → vscode-icons-Dw-LGJAv.js} +1 -1
- package/dist/client/assets/{workspaceMetadataProjection-UiprkDbH.js → workspaceMetadataProjection-BL4sEIL2.js} +1 -1
- package/dist/client/assets/wrench-Ds8eZerZ.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/resource-monitor/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
- package/package.json +1 -1
- package/dist/client/assets/AccountSettings-DGvZzAqN.js +0 -1
- package/dist/client/assets/AiFocusSettings-D8wZfNES.js +0 -1
- package/dist/client/assets/AppearanceSettings-BFo6g6_s.js +0 -1
- package/dist/client/assets/BranchToolbar.logic-CmO2U1U7.js +0 -1
- package/dist/client/assets/BrowserPanel-r6is5C3e.js +0 -1
- package/dist/client/assets/ChatRightPanel-BewXBRFZ.js +0 -194
- package/dist/client/assets/ChatThreadRouteView-CC_6FmHd.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-ftA_Xg2G.js +0 -1
- package/dist/client/assets/CompositeRoot-arlgwzfX.js +0 -1
- package/dist/client/assets/ComputerUseSettings-V-oMtddy.js +0 -1
- package/dist/client/assets/ConnectionsSettings-BrFvrRjz.js +0 -7
- package/dist/client/assets/ContextHandoffEndpointLabel-CPeU4K5A.js +0 -4
- package/dist/client/assets/DiagnosticsSettings-Dk3JaIOU.js +0 -2
- package/dist/client/assets/DialogHandle-00ZXxxpz.js +0 -1
- package/dist/client/assets/DialogPopup-mazVJKyB.js +0 -1
- package/dist/client/assets/DialogRoot-CWlzx19Z.js +0 -1
- package/dist/client/assets/DialogTitle-CKaEtTky.js +0 -1
- package/dist/client/assets/DialogTrigger-CiElTNmo.js +0 -1
- package/dist/client/assets/DialogViewport-a5beR5bY.js +0 -1
- package/dist/client/assets/DraftChatThreadRouteView-DMwnSfgh.js +0 -1
- package/dist/client/assets/FloatingPortalLite-DWdtHKob.js +0 -1
- package/dist/client/assets/GlassSurface-BqfxDYiR.js +0 -1
- package/dist/client/assets/HostedConnectionControls-BmJd89CC.js +0 -1
- package/dist/client/assets/HostedHubRoot-CRIiJ67A.js +0 -2
- package/dist/client/assets/HostedNativeAuthorizationRoute-DcksCt9n.js +0 -2
- package/dist/client/assets/HostedRelayTrustNotice-C9pl5h2a.js +0 -1
- package/dist/client/assets/IntegrationsSettingsPanel-BnfjyLrM.js +0 -2
- package/dist/client/assets/KeybindingsSettings-CkW7lzvz.js +0 -7
- package/dist/client/assets/LazyBrowserPanel-C6uMUmoV.js +0 -2
- package/dist/client/assets/McpServersSettings-BdXgS-Pm.js +0 -6
- package/dist/client/assets/MobileSheet-D19YdeQ9.js +0 -1
- package/dist/client/assets/NodeSecuritySettings-BfcBgtEg.js +0 -1
- package/dist/client/assets/OpinionatedPluginsSettings-YY54IT7P.js +0 -1
- package/dist/client/assets/PhoneGetAppInterstitial-9r6NwJP8.js +0 -1
- package/dist/client/assets/PhoneHome-DnEJp0bU.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-NKJrLCxU.js +0 -2
- package/dist/client/assets/ProviderModelPicker-CYGv-4fE.js +0 -1
- package/dist/client/assets/ProvidersSettingsPanel-DsXHij4h.js +0 -1
- package/dist/client/assets/QuitShortcutFeedback-BVyYaNtd.js +0 -1
- package/dist/client/assets/RedactedSensitiveText-D8j7kpow.js +0 -1
- package/dist/client/assets/RootAppShell-D7c8sbA0.js +0 -7
- package/dist/client/assets/Separator-Bn8l1oSK.js +0 -1
- package/dist/client/assets/SettingsDialog-BlPX1mT8.js +0 -2
- package/dist/client/assets/SettingsPanels-CeuvwIV_.js +0 -3
- package/dist/client/assets/SettingsPanels.editor-CLJJeKLI.js +0 -1
- package/dist/client/assets/SourceControlSettings-D-GeZ6PW.js +0 -1
- package/dist/client/assets/StatisticsPage-poomFDoQ.js +0 -1
- package/dist/client/assets/StatisticsPanel-DbGgCCpZ.js +0 -1
- package/dist/client/assets/StatisticsSettingsLink-Brc9--O7.js +0 -1
- package/dist/client/assets/activity-Dy-wOS-S.js +0 -1
- package/dist/client/assets/alert-4WZo8oMe.js +0 -1
- package/dist/client/assets/arrow-left-gLRAasih.js +0 -1
- package/dist/client/assets/arrow-right-CAK2t4QL.js +0 -1
- package/dist/client/assets/arrow-up-right-DP0hmMEB.js +0 -1
- package/dist/client/assets/authorization-K_UCP_xh.js +0 -1
- package/dist/client/assets/badge-CYDyJZRJ.js +0 -1
- package/dist/client/assets/bot-CCrx5oCt.js +0 -1
- package/dist/client/assets/button-QrCU0tNP.js +0 -1
- package/dist/client/assets/chart-column-BvK6lSzG.js +0 -1
- package/dist/client/assets/chevron-down-yka18-iP.js +0 -1
- package/dist/client/assets/chevron-right-CHyIXx5W.js +0 -1
- package/dist/client/assets/clamp-D0kAXd-u.js +0 -1
- package/dist/client/assets/clipboard-copy-DfdkWOiT.js +0 -1
- package/dist/client/assets/copy-riIPLkKV.js +0 -1
- package/dist/client/assets/data-list-CsiYTho5.js +0 -1
- package/dist/client/assets/download-B0lbSdq5.js +0 -1
- package/dist/client/assets/editorPreferences-Cf2Smgu1.js +0 -1
- package/dist/client/assets/empty-CHk0OiOB.js +0 -1
- package/dist/client/assets/group-DfFZdj79.js +0 -1
- package/dist/client/assets/hostedConnectionCoordinator-DZh1yVqz.js +0 -1
- package/dist/client/assets/input-BAC5Cd3b.js +0 -1
- package/dist/client/assets/kbd-CMUW8K7b.js +0 -1
- package/dist/client/assets/key-round-Cm6itp2V.js +0 -1
- package/dist/client/assets/layers-DoDpJao_.js +0 -1
- package/dist/client/assets/loader-circle-D0CNb5GI.js +0 -1
- package/dist/client/assets/log-out-BuoOiS45.js +0 -1
- package/dist/client/assets/main-DaXSCt8g.js +0 -9
- package/dist/client/assets/monitor-Dyigmrl2.js +0 -1
- package/dist/client/assets/palette-kIM_geXk.js +0 -1
- package/dist/client/assets/play-Dh8XDMnw.js +0 -1
- package/dist/client/assets/primary-DjXNHNGV.js +0 -2
- package/dist/client/assets/providerModels-dpugJUmV.js +0 -1
- package/dist/client/assets/qr-code-CkI1p05P.js +0 -1
- package/dist/client/assets/radio-group-Hh0oQGyf.js +0 -2
- package/dist/client/assets/react-dom-x9LNwWQc.js +0 -1
- package/dist/client/assets/refresh-cw-MqmsC7V0.js +0 -1
- package/dist/client/assets/runtime-L56puJDA.js +0 -17
- package/dist/client/assets/save-BSB81i-r.js +0 -1
- package/dist/client/assets/scroll-area-DCGCzd6v.js +0 -1
- package/dist/client/assets/scrollEdges-DIzjkUJG.js +0 -1
- package/dist/client/assets/separator-YeH3P39x.js +0 -1
- package/dist/client/assets/settingsLayout-CmNqO2kB.js +0 -1
- package/dist/client/assets/settingsSections.logic-Bg960p_I.js +0 -1
- package/dist/client/assets/sheet-CTbjQ5Bv.js +0 -1
- package/dist/client/assets/shield-DlqCO-0N.js +0 -1
- package/dist/client/assets/shield-alert-BrZ-Rb8N.js +0 -1
- package/dist/client/assets/shield-check-DHxdM6te.js +0 -1
- package/dist/client/assets/sidebar-4cwEndEB.js +0 -1
- package/dist/client/assets/sidebarProjectFolders-C7WDwUYJ.js +0 -4
- package/dist/client/assets/sidebarStatusText-Cq_MMykN.js +0 -1
- package/dist/client/assets/skeleton-BlostfCS.js +0 -1
- package/dist/client/assets/smartphone-OaA-Xj_d.js +0 -1
- package/dist/client/assets/sparkles-BXwkPX2M.js +0 -1
- package/dist/client/assets/src-gDjuIvMO.js +0 -14
- package/dist/client/assets/star-BjaAYD-x.js +0 -1
- package/dist/client/assets/toast-C_F1LeME.js +0 -1
- package/dist/client/assets/toggle-BPNEBXg_.js +0 -1
- package/dist/client/assets/toggle-group-BC1zJ9xi.js +0 -1
- package/dist/client/assets/tokenModePresentation-DUJ8DMTy.js +0 -1
- package/dist/client/assets/tooltip-iy3_osu5.js +0 -1
- package/dist/client/assets/triangle-alert-YXqtFxD6.js +0 -1
- package/dist/client/assets/unplug-e3z4rXgY.js +0 -1
- package/dist/client/assets/useAppSidebarCollapsed-mtvJ7qbW.js +0 -1
- package/dist/client/assets/useLabelableId-NJQsKdL6.js +0 -1
- package/dist/client/assets/useNavigate-2tVq4iZ2.js +0 -1
- package/dist/client/assets/usePhoneThreadActions-97AsVVIR.js +0 -1
- package/dist/client/assets/usePopupViewport-8OM2irPK.js +0 -1
- package/dist/client/assets/usePositioner-0Kb-C4al.js +0 -1
- package/dist/client/assets/useRenderElement-D0HVF5g_.js +0 -1
- package/dist/client/assets/useRouter-CcIDS3PN.js +0 -1
- package/dist/client/assets/useScrollLock-AUqaSAkf.js +0 -1
- package/dist/client/assets/useSwipeDismiss-CcW-GPO_.js +0 -1
- package/dist/client/assets/useTriggerFocusGuards-ChBvppef.js +0 -1
- package/dist/client/assets/useValueChanged-CThCTn4h.js +0 -1
- package/dist/client/assets/user-round-evbX_eto.js +0 -1
- package/dist/client/assets/utils-5-6TOrS1.js +0 -1
- package/dist/client/assets/visuallyHidden-BRaogTVF.js +0 -1
- package/dist/client/assets/wrench-mA--bcId.js +0 -1
- package/dist/client/assets/x-_SjFRYll.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{It as n}from"./primary-DjXNHNGV.js";import{Gi as r,Tn as i,an as a,ia as o,nn as s,qn as c,un as l,xn as u}from"./runtime-L56puJDA.js";import{t as d}from"./compiler-runtime-qmuS0Svy.js";import{_ as f,a as ee,c as te,d as ne,g as re,h as ie,i as ae,n as oe,o as se,p as ce,r as p,t as le,u as ue}from"./ChatRightPanel-BewXBRFZ.js";import{O as de,k as fe}from"./ContextHandoffEndpointLabel-CPeU4K5A.js";import{t as pe}from"./utils-5-6TOrS1.js";import{c as m}from"./useSwipeDismiss-CcW-GPO_.js";import{t as me}from"./useNavigate-2tVq4iZ2.js";import{t as he}from"./usePresentationTier-B_SCFvN7.js";import{o as ge}from"./sidebar-4cwEndEB.js";import{t as _e}from"./useAppSidebarCollapsed-mtvJ7qbW.js";import{_ as ve,c as ye,d as be,f as xe,g as Se,h as Ce,m as we,p as Te,s as Ee,st as De,u as Oe}from"./main-DaXSCt8g.js";var ke=d(),h=e(t(),1),g=o();function _(e){let t=(0,ke.c)(226),{threadRef:o,search:d}=e;de(`ChatThreadRouteView`);let p=me(),_=o?`${o.environmentId}:${o.threadId}`:null,v=o?.environmentId??null,Pe=o?.threadId??null,Fe;t[0]!==p||t[1]!==o?(Fe=e=>{o&&p({to:`/$environmentId/$threadId`,params:m(o),replace:!0,search:e})},t[0]=p,t[1]=o,t[2]=Fe):Fe=t[2];let Ie=Fe,Le;t[3]!==_||t[4]!==Ie||t[5]!==d?(Le={threadKey:_,search:d,replaceSearch:Ie},t[3]=_,t[4]=Ie,t[5]=d,t[6]=Le):Le=t[6];let y=ne(Le),Re;t[7]===o?.environmentId?Re=t[8]:(Re=e=>l(e,o?.environmentId??null).bootstrapComplete,t[7]=o?.environmentId,t[8]=Re);let ze=i(Re),Be;t[9]===o?Be=t[10]:(Be=a(o),t[9]=o,t[10]=Be);let Ve=i(Be),He;t[11]===o?He=t[12]:(He=e=>u(e,o),t[11]=o,t[12]=He);let Ue=i(He),We;t[13]===o?.environmentId?We=t[14]:(We=e=>l(e,o?.environmentId??null).threadIds.length>0,t[13]=o?.environmentId,t[14]=We);let Ge=i(We),Ke=r(Ne),b;t[15]!==Ke||t[16]!==o?.environmentId?(b=()=>s(o?.environmentId??null,Ke),t[15]=Ke,t[16]=o?.environmentId,t[17]=b):b=t[17],o?.environmentId;let qe;t[18]===b?qe=t[19]:(qe=b(),t[18]=b,t[19]=qe);let Je=i(qe),Ye=re(o),Xe=ie(o),Ze=f(o?.environmentId),Qe=Ue||Ye,$e;t[20]===Ve?$e=t[21]:($e=te(Ve),t[20]=Ve,t[21]=$e);let x=$e,et=Ge||Ze,tt=Qe&&(ze||Ve!==void 0),S=y.diff===`1`,C=y.preview===`1`,nt;t[22]===y?nt=t[23]:(nt=Ee(y),t[22]=y,t[23]=nt);let w=nt,rt;t[24]===y?rt=t[25]:(rt=ye(y),t[24]=y,t[25]=rt);let T=rt,E=y.workspaceTab===`agent`&&y.workspaceAgentKey?y.workspaceAgentKey:null,it=fe(ue),D=he(),at;t[26]===_?at=t[27]:(at=e=>_?e.pendingOpenByThreadKey[_]:void 0,t[26]=_,t[27]=at);let ot=n(at),st=n(Me),ct=_e(),lt=!it&&D!==`phone`,ut;t[28]!==_||t[29]!==T||t[30]!==lt?(ut={threadKey:_,open:T,canMaximize:lt},t[28]=_,t[29]=T,t[30]=lt,t[31]=ut):ut=t[31];let{maximized:O,toggleMaximized:dt}=ce(ut),ft;t[32]!==E||t[33]!==_||t[34]!==S||t[35]!==C||t[36]!==w?(ft=()=>({threadKey:_,hasOpenedDiff:S,hasOpenedPreview:C,hasOpenedTerminal:w===`terminal`,hasOpenedSimulator:w===`simulator`,hasOpenedBrowser:w===`browser`,hasOpenedAgents:w===`agents`,openedAgentKeys:E?[E]:[]}),t[32]=E,t[33]=_,t[34]=S,t[35]=C,t[36]=w,t[37]=ft):ft=t[37];let[k,pt]=(0,h.useState)(ft),mt,ht;t[38]!==v||t[39]!==Pe?(mt=()=>{if(v&&Pe)return De(v,Pe)},ht=[v,Pe],t[38]=v,t[39]=Pe,t[40]=mt,t[41]=ht):(mt=t[40],ht=t[41]),(0,h.useEffect)(mt,ht);let gt,_t;t[42]!==st||t[43]!==p||t[44]!==ot||t[45]!==D||t[46]!==o?(gt=()=>{o&&ot&&D!==`phone`&&(st(o.environmentId,o.threadId),p({to:`/$environmentId/$threadId`,params:m(o),search:je}))},_t=[st,p,ot,D,o],t[42]=st,t[43]=p,t[44]=ot,t[45]=D,t[46]=o,t[47]=gt,t[48]=_t):(gt=t[47],_t=t[48]),(0,h.useEffect)(gt,_t);let A=k.threadKey===_?k.hasOpenedDiff:S,j=k.threadKey===_?k.hasOpenedPreview:C,M=k.threadKey===_?k.hasOpenedTerminal:w===`terminal`,N=k.threadKey===_?k.hasOpenedSimulator:w===`simulator`,P=k.threadKey===_?k.hasOpenedBrowser:w===`browser`,F=k.threadKey===_?k.hasOpenedAgents:w===`agents`,vt;t[49]!==E||t[50]!==_||t[51]!==k.openedAgentKeys||t[52]!==k.threadKey?(vt=k.threadKey===_?k.openedAgentKeys:E?[E]:[],t[49]=E,t[50]=_,t[51]=k.openedAgentKeys,t[52]=k.threadKey,t[53]=vt):vt=t[53];let yt=vt,bt;t[54]!==E||t[55]!==yt?(bt=E&&!yt.includes(E)?[...yt,E]:yt,t[54]=E,t[55]=yt,t[56]=bt):bt=t[56];let I=bt,xt;t[57]===w?xt=t[58]:(xt=()=>w??`review`,t[57]=w,t[58]=xt);let[L,St]=(0,h.useState)(xt),R;t[59]!==F||t[60]!==P||t[61]!==A||t[62]!==j||t[63]!==N||t[64]!==M||t[65]!==w?(R=[],(j||w===`files`)&&R.push(`files`),(A||w===`review`)&&R.push(`review`),(M||w===`terminal`)&&R.push(`terminal`),(N||w===`simulator`)&&R.push(`simulator`),(P||w===`browser`)&&R.push(`browser`),(F||w===`agents`)&&R.push(`agents`),t[59]=F,t[60]=P,t[61]=A,t[62]=j,t[63]=N,t[64]=M,t[65]=w,t[66]=R):R=t[66];let z=R,Ct;t[67]!==_||t[68]!==S||t[69]!==I||t[70]!==C||t[71]!==w?(Ct=e=>{St(e),pt(t=>{let n={threadKey:_,hasOpenedDiff:(t.threadKey===_?t.hasOpenedDiff:S)||e===`review`,hasOpenedPreview:(t.threadKey===_?t.hasOpenedPreview:C)||e===`files`,hasOpenedTerminal:(t.threadKey===_?t.hasOpenedTerminal:w===`terminal`)||e===`terminal`,hasOpenedSimulator:(t.threadKey===_?t.hasOpenedSimulator:w===`simulator`)||e===`simulator`,hasOpenedBrowser:(t.threadKey===_?t.hasOpenedBrowser:w===`browser`)||e===`browser`,hasOpenedAgents:(t.threadKey===_?t.hasOpenedAgents:w===`agents`)||e===`agents`,openedAgentKeys:t.threadKey===_?t.openedAgentKeys:I};return t.threadKey===n.threadKey&&t.hasOpenedDiff===n.hasOpenedDiff&&t.hasOpenedPreview===n.hasOpenedPreview&&t.hasOpenedTerminal===n.hasOpenedTerminal&&t.hasOpenedSimulator===n.hasOpenedSimulator&&t.hasOpenedBrowser===n.hasOpenedBrowser&&t.hasOpenedAgents===n.hasOpenedAgents&&t.openedAgentKeys===n.openedAgentKeys?t:n})},t[67]=_,t[68]=S,t[69]=I,t[70]=C,t[71]=w,t[72]=Ct):Ct=t[72];let B=Ct,wt;t[73]!==p||t[74]!==o?(wt=()=>{o&&p({to:`/$environmentId/$threadId`,params:m(o),search:Ae})},t[73]=p,t[74]=o,t[75]=wt):wt=t[75];let V=wt,Tt;t[76]!==F||t[77]!==P||t[78]!==A||t[79]!==j||t[80]!==N||t[81]!==M||t[82]!==L||t[83]!==p||t[84]!==I||t[85]!==o?(Tt=()=>{o&&p({to:`/$environmentId/$threadId`,params:m(o),search:e=>{let t=I[I.length-1];return L===`agent`&&t?Oe(e,t):L===`files`&&j?Te(e):L===`review`&&A?we(e):L===`terminal`&&M?Se(e):L===`simulator`&&N?Ce(e):L===`browser`&&P?xe(e):L===`agents`&&F?be(e):j?Te(e):A?we(e):M?Se(e):N?Ce(e):P?xe(e):F?be(e):t?Oe(e,t):ve(e)}})},t[76]=F,t[77]=P,t[78]=A,t[79]=j,t[80]=N,t[81]=M,t[82]=L,t[83]=p,t[84]=I,t[85]=o,t[86]=Tt):Tt=t[86];let H=Tt,Et;t[87]!==V||t[88]!==H||t[89]!==T?(Et=()=>{if(T){V();return}H()},t[87]=V,t[88]=H,t[89]=T,t[90]=Et):Et=t[90];let U=Et,Dt;t[91]!==E||t[92]!==_||t[93]!==F||t[94]!==P||t[95]!==A||t[96]!==j||t[97]!==N||t[98]!==M||t[99]!==p||t[100]!==I||t[101]!==w||t[102]!==o?(Dt=e=>{if(!o)return;if(e.mode===`agent`){let t=I.filter(t=>t!==e.agentKey);pt(e=>({threadKey:_,hasOpenedDiff:e.threadKey===_?e.hasOpenedDiff:A,hasOpenedPreview:e.threadKey===_?e.hasOpenedPreview:j,hasOpenedTerminal:e.threadKey===_?e.hasOpenedTerminal:M,hasOpenedSimulator:e.threadKey===_?e.hasOpenedSimulator:N,hasOpenedBrowser:e.threadKey===_?e.hasOpenedBrowser:P,hasOpenedAgents:e.threadKey===_?e.hasOpenedAgents:F,openedAgentKeys:t})),w===`agent`&&E===e.agentKey&&p({to:`/$environmentId/$threadId`,params:m(o),search:e=>{let n=t[t.length-1];return n?Oe(e,n):j?Te(e):A?we(e):M?Se(e):N?Ce(e):P?xe(e):F?be(e):ve(e)}});return}let t=e.mode===`review`?!1:A||w===`review`,n=e.mode===`files`?!1:j||w===`files`,r=e.mode===`terminal`?!1:M||w===`terminal`,i=e.mode===`simulator`?!1:N||w===`simulator`,a=e.mode===`browser`?!1:P||w===`browser`,s=e.mode===`agents`?!1:F||w===`agents`;pt(e=>{let o={threadKey:_,hasOpenedDiff:t,hasOpenedPreview:n,hasOpenedTerminal:r,hasOpenedSimulator:i,hasOpenedBrowser:a,hasOpenedAgents:s,openedAgentKeys:e.threadKey===_?e.openedAgentKeys:I};return e.threadKey===o.threadKey&&e.hasOpenedDiff===o.hasOpenedDiff&&e.hasOpenedPreview===o.hasOpenedPreview&&e.hasOpenedTerminal===o.hasOpenedTerminal&&e.hasOpenedSimulator===o.hasOpenedSimulator&&e.hasOpenedBrowser===o.hasOpenedBrowser&&e.hasOpenedAgents===o.hasOpenedAgents&&e.openedAgentKeys===o.openedAgentKeys?e:o}),w===e.mode&&p({to:`/$environmentId/$threadId`,params:m(o),search:o=>e.mode!==`files`&&n?Te(o):e.mode!==`review`&&t?we(o):e.mode!==`terminal`&&r?Se(o):e.mode!==`simulator`&&i?Ce(o):e.mode!==`browser`&&a?xe(o):e.mode!==`agents`&&s?be(o):ve(o)})},t[91]=E,t[92]=_,t[93]=F,t[94]=P,t[95]=A,t[96]=j,t[97]=N,t[98]=M,t[99]=p,t[100]=I,t[101]=w,t[102]=o,t[103]=Dt):Dt=t[103];let W=Dt,Ot,kt;t[104]!==B||t[105]!==w?(Ot=()=>{w!==null&&(St(w),B(w))},kt=[B,w],t[104]=B,t[105]=w,t[106]=Ot,t[107]=kt):(Ot=t[106],kt=t[107]),(0,h.useEffect)(Ot,kt);let At,jt;t[108]!==E||t[109]!==_||t[110]!==S||t[111]!==F||t[112]!==P||t[113]!==A||t[114]!==j||t[115]!==N||t[116]!==M||t[117]!==C||t[118]!==w?(At=()=>{_&&E&&pt(e=>{let t=e.threadKey===_?e.openedAgentKeys:[];return t.includes(E)?e.threadKey===_?e:{threadKey:_,hasOpenedDiff:A,hasOpenedPreview:j,hasOpenedTerminal:M,hasOpenedSimulator:N,hasOpenedBrowser:P,hasOpenedAgents:F,openedAgentKeys:t}:{threadKey:_,hasOpenedDiff:e.threadKey===_?e.hasOpenedDiff:S,hasOpenedPreview:e.threadKey===_?e.hasOpenedPreview:C,hasOpenedTerminal:e.threadKey===_?e.hasOpenedTerminal:w===`terminal`,hasOpenedSimulator:e.threadKey===_?e.hasOpenedSimulator:w===`simulator`,hasOpenedBrowser:e.threadKey===_?e.hasOpenedBrowser:w===`browser`,hasOpenedAgents:e.threadKey===_?e.hasOpenedAgents:w===`agents`,openedAgentKeys:[...t,E]}})},jt=[E,_,S,F,A,j,N,P,M,C,w],t[108]=E,t[109]=_,t[110]=S,t[111]=F,t[112]=P,t[113]=A,t[114]=j,t[115]=N,t[116]=M,t[117]=C,t[118]=w,t[119]=At,t[120]=jt):(At=t[119],jt=t[120]),(0,h.useEffect)(At,jt);let Mt,Nt;t[121]!==ze||t[122]!==et||t[123]!==Je||t[124]!==p||t[125]!==Qe||t[126]!==o?(Mt=()=>{o&&ze&&!Qe&&et&&p(Je?{to:`/$environmentId/$threadId`,params:m(Je),replace:!0}:{to:`/`,replace:!0})},Nt=[ze,et,Je,p,Qe,o],t[121]=ze,t[122]=et,t[123]=Je,t[124]=p,t[125]=Qe,t[126]=o,t[127]=Mt,t[128]=Nt):(Mt=t[127],Nt=t[128]),(0,h.useEffect)(Mt,Nt);let Pt;t[129]!==Xe?.promotedTo||t[130]!==x||t[131]!==o?(Pt=()=>{o&&x&&Xe?.promotedTo&&c(o)},t[129]=Xe?.promotedTo,t[130]=x,t[131]=o,t[132]=Pt):Pt=t[132];let Ft=Xe?.promotedTo,It;if(t[133]!==x||t[134]!==Ft||t[135]!==o?(It=[Ft,x,o],t[133]=x,t[134]=Ft,t[135]=o,t[136]=It):It=t[136],(0,h.useEffect)(Pt,It),!o||!tt)return null;let G=T||w===`review`||A||w===`files`||j||w===`terminal`||M||w===`simulator`||N||w===`browser`||P||w===`agents`||F||w===`agent`||I.length>0,Lt=T||w===`review`||A||w===`files`||j||w===`terminal`||M||w===`agent`||I.length>0,K=T?w:L;if(D===`phone`){let e,n,r,i;t[137]===B?(e=t[138],n=t[139],r=t[140],i=t[141]):(e=()=>B(`review`),n=()=>B(`files`),r=()=>B(`terminal`),i=()=>B(`agent`),t[137]=B,t[138]=e,t[139]=n,t[140]=r,t[141]=i);let a;t[142]!==T||t[143]!==e||t[144]!==n||t[145]!==r||t[146]!==i||t[147]!==o.environmentId||t[148]!==o.threadId||t[149]!==U?(a=(0,g.jsx)(ge,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,g.jsx)(ae,{environmentId:o.environmentId,threadId:o.threadId,onDiffPanelOpen:e,onPreviewPanelOpen:n,onTerminalPanelOpen:r,onAgentPanelOpen:i,workspacePanelOpen:T,onToggleWorkspacePanel:U,routeKind:`server`})}),t[142]=T,t[143]=e,t[144]=n,t[145]=r,t[146]=i,t[147]=o.environmentId,t[148]=o.threadId,t[149]=U,t[150]=a):a=t[150];let s;t[151]!==W||t[152]!==K||t[153]!==I||t[154]!==z||t[155]!==Lt?(s=Lt?(0,g.jsx)(le,{mode:`phone`,panelMode:K,openedPanelModes:z,openedAgentKeys:I,onClosePanelTab:W}):null,t[151]=W,t[152]=K,t[153]=I,t[154]=z,t[155]=Lt,t[156]=s):s=t[156];let c;t[157]!==V||t[158]!==T||t[159]!==s?(c=(0,g.jsx)(se,{label:`Workspace`,open:T,onClose:V,children:s}),t[157]=V,t[158]=T,t[159]=s,t[160]=c):c=t[160];let l;return t[161]!==a||t[162]!==c?(l=(0,g.jsxs)(g.Fragment,{children:[a,c]}),t[161]=a,t[162]=c,t[163]=l):l=t[163],l}if(!it){let e=O&&`w-0 flex-none`,n;t[164]===e?n=t[165]:(n=pe(`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,e),t[164]=e,t[165]=n);let r=O?!0:void 0,i,a,s,c;t[166]===B?(i=t[167],a=t[168],s=t[169],c=t[170]):(i=()=>B(`review`),a=()=>B(`files`),s=()=>B(`terminal`),c=()=>B(`agent`),t[166]=B,t[167]=i,t[168]=a,t[169]=s,t[170]=c);let l;t[171]!==T||t[172]!==i||t[173]!==a||t[174]!==s||t[175]!==c||t[176]!==o.environmentId||t[177]!==o.threadId||t[178]!==U?(l=(0,g.jsx)(ae,{environmentId:o.environmentId,threadId:o.threadId,onDiffPanelOpen:i,onPreviewPanelOpen:a,onTerminalPanelOpen:s,onAgentPanelOpen:c,workspacePanelOpen:T,onToggleWorkspacePanel:U,routeKind:`server`}),t[171]=T,t[172]=i,t[173]=a,t[174]=s,t[175]=c,t[176]=o.environmentId,t[177]=o.threadId,t[178]=U,t[179]=l):l=t[179];let u;t[180]!==n||t[181]!==r||t[182]!==l?(u=(0,g.jsx)(ge,{className:n,inert:r,children:l}),t[180]=n,t[181]=r,t[182]=l,t[183]=u):u=t[183];let d=O&&ct,f;t[184]!==W||t[185]!==V||t[186]!==K||t[187]!==H||t[188]!==I||t[189]!==z||t[190]!==O||t[191]!==T||t[192]!==G||t[193]!==d||t[194]!==dt?(f=(0,g.jsx)(oe,{open:T,panelMode:K,openedPanelModes:z,openedAgentKeys:I,onClosePanelTab:W,onClose:V,onOpen:H,renderContent:G,maximized:O,onToggleMaximized:dt,reserveChromeInset:d}),t[184]=W,t[185]=V,t[186]=K,t[187]=H,t[188]=I,t[189]=z,t[190]=O,t[191]=T,t[192]=G,t[193]=d,t[194]=dt,t[195]=f):f=t[195];let ee;return t[196]!==u||t[197]!==f?(ee=(0,g.jsxs)(g.Fragment,{children:[u,f]}),t[196]=u,t[197]=f,t[198]=ee):ee=t[198],ee}let q,J,Y,X;t[199]===B?(q=t[200],J=t[201],Y=t[202],X=t[203]):(q=()=>B(`review`),J=()=>B(`files`),Y=()=>B(`terminal`),X=()=>B(`agent`),t[199]=B,t[200]=q,t[201]=J,t[202]=Y,t[203]=X);let Z;t[204]!==T||t[205]!==q||t[206]!==J||t[207]!==Y||t[208]!==X||t[209]!==o.environmentId||t[210]!==o.threadId||t[211]!==U?(Z=(0,g.jsx)(ge,{className:`h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh`,children:(0,g.jsx)(ae,{environmentId:o.environmentId,threadId:o.threadId,onDiffPanelOpen:q,onPreviewPanelOpen:J,onTerminalPanelOpen:Y,onAgentPanelOpen:X,workspacePanelOpen:T,onToggleWorkspacePanel:U,routeKind:`server`})}),t[204]=T,t[205]=q,t[206]=J,t[207]=Y,t[208]=X,t[209]=o.environmentId,t[210]=o.threadId,t[211]=U,t[212]=Z):Z=t[212];let Q;t[213]!==W||t[214]!==K||t[215]!==I||t[216]!==z||t[217]!==G?(Q=G?(0,g.jsx)(le,{mode:`sheet`,panelMode:K,openedPanelModes:z,openedAgentKeys:I,onClosePanelTab:W}):null,t[213]=W,t[214]=K,t[215]=I,t[216]=z,t[217]=G,t[218]=Q):Q=t[218];let $;t[219]!==V||t[220]!==T||t[221]!==Q?($=(0,g.jsx)(ee,{open:T,onClose:V,children:Q}),t[219]=V,t[220]=T,t[221]=Q,t[222]=$):$=t[222];let Rt;return t[223]!==Z||t[224]!==$?(Rt=(0,g.jsxs)(g.Fragment,{children:[Z,$]}),t[223]=Z,t[224]=$,t[225]=Rt):Rt=t[225],Rt}function Ae(e){return p(e)}function je(e){return Ce(e)}function Me(e){return e.consumeOpenRequest}function Ne(e){return e.sidebarThreadSortOrder}export{_ as ChatThreadRouteView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{Bt as n,Ht as r,a as i,r as a,zt as o}from"./primary-DjXNHNGV.js";import{B as s,ot as c,pl as l,t as u,tt as d}from"./src-gDjuIvMO.js";import{Bi as ee,Gi as te,Gn as ne,H as re,Ji as ie,K as ae,Ln as oe,O as se,Tn as ce,V as le,Xi as ue,_i as de,bi as fe,cn as f,fn as pe,ht as me,ia as p,mn as he,on as ge,vi as _e,x as ve,zi as ye}from"./runtime-L56puJDA.js";import{$t as be,Bt as xe,Dn as Se,Gn as Ce,In as we,Yn as Te,Yt as Ee,an as De,en as m,gr as Oe,hr as ke,mr as Ae,rn as h,rr as je,sn as Me,zt as Ne}from"./switch-COrEGDkz.js";import{t as Pe}from"./compiler-runtime-qmuS0Svy.js";import{t as Fe}from"./presentationTier-xlIjcFab.js";import{_ as Ie,g as Le,m as Re,v as g}from"./RootAppShell-D7c8sbA0.js";import{f as _}from"./useRenderElement-D0HVF5g_.js";import{t as ze}from"./arrow-left-gLRAasih.js";import{t as Be}from"./chart-column-BvK6lSzG.js";import{B as Ve,F as He,G as v,H as y,L as Ue,M as We,N as Ge,R as Ke,U as qe,V as b,j as Je,z as x}from"./ContextHandoffEndpointLabel-CPeU4K5A.js";import{t as Ye}from"./chevron-right-CHyIXx5W.js";import{L as Xe}from"./badge-CYDyJZRJ.js";import{n as S,t as C}from"./kbd-CMUW8K7b.js";import{a as w,i as T}from"./toast-C_F1LeME.js";import{A as Ze,D as Qe,E as $e,F as et,I as tt,L as nt,M as rt,N as it,O as at,P as ot,T as st,j as ct,k as lt,w as ut,z as dt}from"./sidebarProjectFolders-C7WDwUYJ.js";import{t as ft}from"./button-QrCU0tNP.js";import{i as pt,n as mt,r as E,s as ht,t as D}from"./utils-5-6TOrS1.js";import{c as gt}from"./useSwipeDismiss-CcW-GPO_.js";import{t as _t}from"./useNavigate-2tVq4iZ2.js";import{c as vt,o as yt}from"./BranchToolbar.logic-CmO2U1U7.js";import{i as bt,n as xt,t as St}from"./tooltip-iy3_osu5.js";import{t as Ct}from"./capabilities-BTd0MRtv.js";import{Bt as wt,K as O,Kt as k,O as Tt,et as Et,k as Dt,nt as Ot,tt as kt}from"./main-DaXSCt8g.js";var At={name:`corner-left-up`,size:24,node:[[`path`,{d:`M14 9 9 4 4 9`,key:`1af5af`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]};At.node;var jt=_(At),Mt={name:`folder-symlink`,size:24,node:[[`path`,{d:`M2 9.35V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h7`,key:`y8kt7d`}],[`path`,{d:`m8 16 3-3-3-3`,key:`rlqrt1`}]]};Mt.node;var Nt=_(Mt),Pt={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};Pt.node;var Ft=_(Pt),A=e(t(),1),j=Pe(),M=`size-4 text-muted-foreground/80`,N=`size-4`;function It(e){return e.isAlias?`browse:alias:${e.name}:${e.fullPath}`:`browse:${e.fullPath}`}function Lt(e){let t=e.browseFilterQuery.toLowerCase(),n=e.browseFilterQuery.startsWith(`.`),r=e.browseEntries.filter(e=>e.name.toLowerCase().startsWith(t)&&(n||!e.name.startsWith(`.`))),i=null,a=e.highlightedItemValue;a&&a.startsWith(`browse:`)&&(i=r.find(e=>It(e)===a)??null);let o=e.browseFilterQuery.length>0?r.find(t=>t.name===e.browseFilterQuery)??null:null;return{filteredEntries:r,highlightedEntry:i,exactEntry:o}}function Rt(e){return e.trim().toLowerCase().replace(/\s+/g,` `)}function zt(e){return e.projects.map(t=>({kind:`action`,value:`${e.valuePrefix}:${t.environmentId}:${t.id}`,searchTerms:[t.name,t.cwd],title:t.name,description:t.cwd,icon:e.icon(t),run:async()=>{await e.runProject(t)}}))}function Bt(e){let t=f(e.threads.filter(e=>e.archivedAt===null),e.sortOrder);return(e.limit===void 0?t:t.slice(0,e.limit)).map(t=>{let n=e.projectTitleById.get(t.projectId),r=[];n&&r.push(n),t.branch&&r.push(`#${t.branch}`),t.id===e.activeThreadId&&r.push(`Current thread`);let i=e.renderLeadingContent?.(t),a=e.renderTrailingContent?.(t);return Object.assign({kind:`action`,value:`thread:${t.id}`,searchTerms:[t.title,n??``,t.branch??``],title:t.title,description:r.join(` · `),timestamp:Se(t.latestUserMessageAt??t.updatedAt??t.createdAt),icon:e.icon},i?{titleLeadingContent:i}:{},a?{titleTrailingContent:a}:{},{run:async()=>{await e.runThread(t)}})})}function P(e,t){let n=Rt(e);return n.length===0||!n.includes(t)?-1/0:n===t?3:n.startsWith(t)?2:1}function Vt(e,t){let n=e.searchTerms.filter(e=>e.length>0);if(n.length===0)return 0;for(let[e,r]of n.entries()){let n=P(r,t);if(n!==-1/0)return 1e3-e*100+n}return 0}function Ht(e){return e.searchResults.map(t=>{let n=e.threadTitleById.get(t.threadId)??`Thread`,r=e.projectTitleByThreadId.get(t.threadId),i=[n,r].filter(Boolean).join(` · `);return{kind:`action`,value:`message:${t.environmentId}:${t.threadId}:${t.messageId}`,searchTerms:[t.snippet,n,r??``],title:t.snippet,description:i,timestamp:Se(t.timestamp),icon:e.icon,run:async()=>{await e.runMessage(t)}}})}function Ut(e){let t=e.query.startsWith(`>`),n=Rt(t?e.query.slice(1):e.query);if(n.length===0)return t?e.activeGroups.filter(e=>e.value===`actions`):[...e.activeGroups];let r=[...e.activeGroups];t?r=r.filter(e=>e.value===`actions`):e.isInSubmenu||(r=r.filter(e=>e.value!==`recent-threads`));let i=[...r];return!e.isInSubmenu&&!t&&(e.projectSearchItems.length>0&&i.push({value:`projects-search`,label:`Projects`,items:e.projectSearchItems}),e.threadSearchItems.length>0&&i.push({value:`threads-search`,label:`Threads`,items:e.threadSearchItems}),e.messageSearchItems&&e.messageSearchItems.length>0&&i.push({value:`messages-search`,label:`Messages`,items:e.messageSearchItems})),i.flatMap(e=>{let t=e.items.map((e,t)=>Rt(e.searchTerms.join(` `)).includes(n)?{item:e,index:t,rank:Vt(e,n)}:null).filter(e=>e!==null).toSorted((e,t)=>t.rank-e.rank||e.index-t.index).map(e=>e.item);return t.length===0?[]:[{value:e.value,label:e.label,items:t}]})}function Wt(e){let t=[];e.canBrowseUp&&t.push({kind:`action`,value:`browse:up`,searchTerms:[e.browseQuery,`..`],title:`..`,icon:e.upIcon,keepOpen:!0,run:async()=>{e.browseUp()}});for(let n of e.browseEntries)t.push({kind:`action`,value:It(n),searchTerms:[e.browseQuery,n.fullPath,n.name],title:n.name,icon:n.isSymlink?e.symlinkIcon:e.directoryIcon,keepOpen:!0,run:async()=>{n.isAlias?e.browseToPath(n.fullPath):e.browseTo(n.name)}});return[{value:`directories`,label:`Directories`,items:t}]}function Gt(e){return e.currentView?e.isBrowsing?`submenu-browse`:`submenu`:e.isBrowsing?`root-browse`:`root`}function Kt(e){let t=[];return e.actionItems.length>0&&t.push({value:`actions`,label:`Actions`,items:e.actionItems}),e.recentThreadItems.length>0&&t.push({value:`recent-threads`,label:`Recent Threads`,items:e.recentThreadItems}),t}function qt(e){switch(e){case`root`:return`Search commands, projects, and threads...`;case`root-browse`:return`Enter project path (e.g. ~/projects/my-app)`;case`submenu`:return`Search...`;case`submenu-browse`:return`Enter path (e.g. ~/projects/my-app)`}}var F=p();function Jt(e){let t=(0,j.c)(13);if(e.groups.length===0){let n=e.emptyStateMessage??(e.isActionsOnly?`No matching actions.`:`No matching commands, projects, or threads.`),r;return t[0]===n?r=t[1]:(r=(0,F.jsx)(`div`,{className:`py-10 text-center text-sm text-muted-foreground`,children:n}),t[0]=n,t[1]=r),r}let n;if(t[2]!==e.groups||t[3]!==e.highlightedItemValue||t[4]!==e.keybindings||t[5]!==e.onExecuteItem){let r;t[7]!==e.highlightedItemValue||t[8]!==e.keybindings||t[9]!==e.onExecuteItem?(r=t=>(0,F.jsxs)(Ke,{items:t.items,children:[(0,F.jsx)(x,{children:t.label}),(0,F.jsx)(Ge,{children:t=>t.disabled?(0,F.jsx)(Yt,{item:t},t.value):(0,F.jsx)(Xt,{item:t,keybindings:e.keybindings,isActive:e.highlightedItemValue===t.value,onExecuteItem:e.onExecuteItem},t.value)})]},t.value),t[7]=e.highlightedItemValue,t[8]=e.keybindings,t[9]=e.onExecuteItem,t[10]=r):r=t[10],n=e.groups.map(r),t[2]=e.groups,t[3]=e.highlightedItemValue,t[4]=e.keybindings,t[5]=e.onExecuteItem,t[6]=n}else n=t[6];let r;return t[11]===n?r=t[12]:(r=(0,F.jsx)(y,{children:n}),t[11]=n,t[12]=r),r}function Yt(e){let t=(0,j.c)(8),n;t[0]!==e.item.description||t[1]!==e.item.title||t[2]!==e.item.titleLeadingContent?(n=e.item.description?(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,F.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),(0,F.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:e.item.description})]}):(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,F.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),t[0]=e.item.description,t[1]=e.item.title,t[2]=e.item.titleLeadingContent,t[3]=n):n=t[3];let r;return t[4]!==e.item.icon||t[5]!==e.item.titleTrailingContent||t[6]!==n?(r=(0,F.jsxs)(`div`,{className:`flex min-h-8 select-none items-center gap-2 rounded-sm px-2 py-1.5 text-base opacity-64 sm:min-h-7 sm:text-sm`,children:[e.item.icon,n,e.item.titleTrailingContent]}),t[4]=e.item.icon,t[5]=e.item.titleTrailingContent,t[6]=n,t[7]=r):r=t[7],r}function Xt(e){let t=(0,j.c)(27),n;t[0]!==e.item.shortcutCommand||t[1]!==e.keybindings?(n=e.item.shortcutCommand?O(e.keybindings,e.item.shortcutCommand):null,t[0]=e.item.shortcutCommand,t[1]=e.keybindings,t[2]=n):n=t[2];let r=n,i=e.item.value,a=e.isActive&&`bg-accent! text-accent-foreground!`,o;t[3]===a?o=t[4]:(o=D(`cursor-pointer gap-2 hover:bg-transparent hover:text-inherit data-highlighted:bg-transparent data-highlighted:text-inherit data-selected:bg-transparent data-selected:text-inherit [&[data-highlighted][data-selected]]:bg-transparent [&[data-highlighted][data-selected]]:text-inherit`,a),t[3]=a,t[4]=o);let s;t[5]===e?s=t[6]:(s=()=>{e.onExecuteItem(e.item)},t[5]=e,t[6]=s);let c;t[7]!==e.item.description||t[8]!==e.item.title||t[9]!==e.item.titleLeadingContent?(c=e.item.description?(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,F.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),(0,F.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:e.item.description})]}):(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-1.5 text-sm text-foreground`,children:[e.item.titleLeadingContent,(0,F.jsx)(`span`,{className:`truncate`,children:e.item.title})]}),t[7]=e.item.description,t[8]=e.item.title,t[9]=e.item.titleLeadingContent,t[10]=c):c=t[10];let l;t[11]===e.item.timestamp?l=t[12]:(l=e.item.timestamp?(0,F.jsx)(`span`,{className:`min-w-12 shrink-0 text-right text-[10px] tabular-nums text-muted-foreground/70`,children:e.item.timestamp}):null,t[11]=e.item.timestamp,t[12]=l);let u;t[13]===r?u=t[14]:(u=r?(0,F.jsx)(v,{children:r}):null,t[13]=r,t[14]=u);let d;t[15]===e.item.kind?d=t[16]:(d=e.item.kind===`submenu`?(0,F.jsx)(Ye,{className:`ml-auto size-4 shrink-0 text-muted-foreground/50`}):null,t[15]=e.item.kind,t[16]=d);let ee;return t[17]!==e.item.icon||t[18]!==e.item.titleTrailingContent||t[19]!==e.item.value||t[20]!==o||t[21]!==s||t[22]!==c||t[23]!==l||t[24]!==u||t[25]!==d?(ee=(0,F.jsxs)(b,{value:i,className:o,onMouseDown:Zt,onClick:s,children:[e.item.icon,c,e.item.titleTrailingContent,l,u,d]}),t[17]=e.item.icon,t[18]=e.item.titleTrailingContent,t[19]=e.item.value,t[20]=o,t[21]=s,t[22]=c,t[23]=l,t[24]=u,t[25]=d,t[26]=ee):ee=t[26],ee}function Zt(e){e.preventDefault()}var Qt=[],$t=3e4,en=2,tn=20;function nn(e){return mt(e)?`Finder`:E(e)?`Explorer`:`Files`}function rn(e){return e===`windows`?`Win32`:e===`darwin`?`MacIntel`:e===`linux`?`Linux`:typeof navigator>`u`?``:navigator.platform}var I=[`url`,`github`,`gitlab`,`forgejo`,`bitbucket`,`azure-devops`],L=[`github`,`gitlab`,`forgejo`,`bitbucket`,`azure-devops`];function an(e){switch(e){case`github`:return`GitHub`;case`gitlab`:return`GitLab`;case`forgejo`:return`Forgejo`;case`bitbucket`:return`Bitbucket`;case`azure-devops`:return`Azure DevOps`;case`url`:return`Git URL`}}function on(e){switch(e){case`github`:return`owner/repo`;case`gitlab`:return`group/project`;case`forgejo`:return`owner/repo`;case`bitbucket`:return`workspace/repository`;case`azure-devops`:return`project/repository`;case`url`:return`URL`}}function sn(e){return e===`url`?null:e}function R(e,t){switch(e){case`github`:return(0,F.jsx)(De,{className:t});case`gitlab`:return(0,F.jsx)(Me,{className:t});case`forgejo`:return(0,F.jsx)(h,{className:t});case`bitbucket`:return(0,F.jsx)(m,{className:t});case`azure-devops`:return(0,F.jsx)(be,{className:t});case`url`:return(0,F.jsx)(k,{className:t})}}function cn(e){return!e||e.step===`confirm`?null:e.source===`url`?`Enter Git clone URL`:`Enter ${an(e.source)} repository (${on(e.source)})`}function ln(e){return e.split(`/`).at(-1)?.trim()??e}function un(e){return`remote-repository:${e.provider}:${encodeURIComponent(e.nameWithOwner)}`}function dn(e,t){return e===`bitbucket`?t.url:t.sshUrl}function fn(e){return!e.includes(`/`)&&!e.includes(`:`)}function pn(e){return e===`url`?null:e}function mn(e){return L.toSorted((t,n)=>{let r=e[t].ready;return r===e[n].ready?an(t).localeCompare(an(n)):r?-1:1})}function hn(e){let t={ready:!1,hint:`Provider status unavailable. Open Settings -> Source Control and rescan.`},n={url:{ready:!0,hint:null},github:t,gitlab:t,forgejo:t,bitbucket:t,"azure-devops":t};if(!e)return n;let r=new Map(e.sourceControlProviders.map(e=>[e.kind,e])),i={...n};for(let e of I){let n=pn(e);if(!n)continue;let a=r.get(n);if(!a){i[e]=t;continue}if(a.status!==`available`){i[e]={ready:!1,hint:a.installHint};continue}if(a.auth.status===`unauthenticated`){i[e]={ready:!1,hint:l(a.auth.detail)??`${a.label} is not authenticated. Open Settings -> Source Control for setup guidance.`};continue}i[e]={ready:!0,hint:null}}return i}function gn(e){return e instanceof Error&&e.message.trim().length>0?e.message:`An error occurred.`}function _n(){let e=(0,j.c)(5),t=me(yn),n=me(vn),r,i;e[0]===n?(r=e[1],i=e[2]):(r=()=>()=>{n(!1)},i=[n],e[0]=n,e[1]=r,e[2]=i),(0,A.useEffect)(r,i);let a;return e[3]===t?a=e[4]:(a=t?(0,F.jsx)(bn,{}):null,e[3]=t,e[4]=a),a}function vn(e){return e.setOpen}function yn(e){return e.open}function bn(){let e=Ct(s.dispatchCommand),t=Ct(u.projectsAdd),l=Ct(u.serverGetStatistics),f=_t(),p=me(e=>e.setOpen),be=me(e=>e.openIntent),Se=me(e=>e.clearOpenIntent),De=Je(),[m,h]=(0,A.useState)(``),Me=(0,A.useDeferredValue)(m),Pe=Me.startsWith(`>`),[_,v]=(0,A.useState)(null),y=te(),Ge=le(e=>e.pinnedThreadKeys),Ke=ie(),{activeDraftThread:b,activeThread:x,defaultProjectRef:Ye,handleNewThread:E}=Ot(),O=ce(wt(pe)),k=ce(wt(he)),At=ue(),[Mt,Pt]=(0,A.useState)([]),j=Mt.at(-1)??null,It=j===null,[Rt,P]=(0,A.useState)(0),[Vt,Yt]=(0,A.useState)(null),[Xt,Zt]=(0,A.useState)(!1),[I,L]=(0,A.useState)(null),[pn,_n]=(0,A.useState)(!1),[vn,yn]=(0,A.useState)(!1),[bn,xn]=(0,A.useState)([]),z=i(),Sn=a()?.label??null,Cn=de(e=>e.byId),B=_e(e=>e.byId),wn=(0,A.useMemo)(()=>{let e=[],t=new Set;z&&(t.add(z),e.push({environmentId:z,label:yt({isPrimary:!0,environmentId:z,runtimeLabel:Sn}),isPrimary:!0}));for(let n of Object.values(Cn)){if(t.has(n.environmentId))continue;let r=B[n.environmentId];e.push({environmentId:n.environmentId,label:yt({isPrimary:!1,environmentId:n.environmentId,runtimeLabel:r?.descriptor?.label??null,savedLabel:n.label}),isPrimary:!1})}return e.sort((e,t)=>e.isPrimary===t.isPrimary?e.label.localeCompare(t.label):e.isPrimary?-1:1),e},[z,Sn,Cn,B]),Tn=wn[0]?.environmentId??null,V=Vt??Tn,En=(0,A.useMemo)(()=>rn(V&&z&&V===z?a()?.platform.os??null:V?B[V]?.descriptor?.platform.os??B[V]?.serverConfig?.environment.platform.os??null:null),[V,z,B]),Dn=I!==null,On=I?.step===`repository`,H=On&&I?sn(I.source):null,kn=On?Me.trim():``,U=we({environmentId:I?.step===`repository`?I.environmentId:null,provider:H,query:kn,limit:25,enabled:I?.step===`repository`&&I.source!==`url`&&H===`bitbucket`}),W=!On&&it(m,En),An=Gt({currentView:j,isBrowsing:W}),jn=It&&!Pe&&!W&&!Dn,Mn=jn?Me.trim():``,[Nn]=Oe(Mn,{wait:200}),Pn=(0,A.useMemo)(()=>{let e=new Set,t=[];for(let n of k)e.has(n.environmentId)||(e.add(n.environmentId),t.push(n.environmentId));for(let n of O)e.has(n.environmentId)||(e.add(n.environmentId),t.push(n.environmentId));return t},[O,k]);(0,A.useEffect)(()=>{let e=Nn.trim();if(!jn||e.length<en||Pn.length===0){xn([]);return}let t=!1,n=Pn.map(async t=>{let n=ne(t);if(!n)return[];try{return(await n.orchestration.searchThreadMessages({query:e,limit:tn})).map(e=>Object.assign({environmentId:t},e))}catch{return[]}});return Promise.all(n).then(e=>{t||xn(e.flat().toSorted((e,t)=>t.timestamp.localeCompare(e.timestamp)).slice(0,tn))}),()=>{t=!0}},[jn,Nn,Pn]);let Fn=(0,A.useCallback)(e=>{let t=e&&z&&e===z?Ke:e?B[e]?.serverConfig:null,n=e&&z&&e===z?y:e?B[e]?.serverConfig?.settings:null;return tt({workspaceAccessRoot:t?.workspaceAccessRoot,configuredBaseDirectory:n?.addProjectBaseDirectory})},[z,Ke,B,y]),In=(0,A.useMemo)(()=>new Map(O.map(e=>[e.id,e.cwd])),[O]),G=(0,A.useMemo)(()=>new Map(O.map(e=>[e.id,e.name])),[O]),Ln=(0,A.useMemo)(()=>new Map(k.map(e=>[e.id,e.title])),[k]),Rn=(0,A.useMemo)(()=>new Map(k.map(e=>[e.id,G.get(e.projectId)??``])),[G,k]),zn=(0,A.useCallback)(async e=>{await f({to:`/$environmentId/$threadId`,params:gt(n(e.environmentId,e.threadId)),search:t=>({...t,messageId:e.messageId})})},[f]),Bn=(0,A.useMemo)(()=>Ht({searchResults:bn,threadTitleById:Ln,projectTitleByThreadId:Rn,icon:(0,F.jsx)(Te,{className:M}),runMessage:zn}),[bn,zn,Rn,Ln]),Vn=x?.id,K=x?r(n(x.environmentId,x.id)):null,Hn=Tt({threadKey:K,pinned:K?Ge[K]===!0:!1}),Un=x?.environmentId??b?.environmentId??null,Wn=x?.projectId??b?.projectId??null,Gn=Wn?In.get(Wn)??null:null,q=V&&Un===V?Gn:null,J=se(m.trim())&&q===null,Kn=W?at(m):``,qn=W&&!ct(m)?lt(m):``,Jn=vt({environmentId:V,partialPath:Kn,cwd:q,staleTime:$t,enabled:W&&Kn.length>0&&V!==null&&!J}),Y=Jn.data,Yn=Jn.isPending,Xn=Y?.entries??Qt,Zn=Y?.workspaceAccessRoot!==void 0&&ot(Y.parentPath,Y.workspaceAccessRoot),Qn=W&&!J&&!Zn&&st(Kn),{filteredEntries:$n,exactEntry:er}=(0,A.useMemo)(()=>Lt({browseEntries:Xn,browseFilterQuery:qn,highlightedItemValue:_}),[Xn,qn,_]),tr=(0,A.useCallback)(e=>{oe({environmentId:V,partialPath:e,cwd:q,staleTime:$t})},[V,q]);(0,A.useEffect)(()=>{W&&Qn&&tr(Ze(m))},[Qn,W,tr,m]);let nr=(0,A.useMemo)(()=>async e=>{le.getState().setProjectExpanded(ve(e,y),!0);let t=ge(k.filter(t=>t.environmentId===e.environmentId),e.id,y.sidebarThreadSortOrder);if(t){await f({to:`/$environmentId/$threadId`,params:gt(n(t.environmentId,t.id))});return}await E(o(e.environmentId,e.id),{envMode:y.defaultThreadEnvMode})},[E,f,y,k]),rr=(0,A.useMemo)(()=>zt({projects:O,valuePrefix:`project`,icon:e=>(0,F.jsx)(Ee,{environmentId:e.environmentId,cwd:e.cwd,projectId:e.id,customAvatarContentHash:e.customAvatarContentHash??null,className:M}),runProject:nr}),[nr,O]),ir=(0,A.useMemo)(()=>zt({projects:O,valuePrefix:`new-thread-in`,icon:e=>(0,F.jsx)(Ee,{environmentId:e.environmentId,cwd:e.cwd,projectId:e.id,customAvatarContentHash:e.customAvatarContentHash??null,className:M}),runProject:async e=>{await kt({activeDraftThread:b,activeThread:x,defaultProjectRef:Ye,defaultThreadEnvMode:y.defaultThreadEnvMode,handleNewThread:E},o(e.environmentId,e.id))}}),[b,x,Ye,E,O,y.defaultThreadEnvMode]),ar=(0,A.useMemo)(()=>Bt({threads:k,...Vn?{activeThreadId:Vn}:{},projectTitleById:G,sortOrder:y.sidebarThreadSortOrder,icon:(0,F.jsx)(Te,{className:M}),renderLeadingContent:e=>(0,F.jsx)(Ne,{thread:e}),renderTrailingContent:e=>(0,F.jsx)(xe,{thread:e}),runThread:async e=>{await f({to:`/$environmentId/$threadId`,params:gt(n(e.environmentId,e.id))})}}),[Vn,f,G,y.sidebarThreadSortOrder,k]),or=ar.slice(0,12);function X(e){Pt(t=>[...t,{addonIcon:e.addonIcon,groups:e.groups,...e.initialQuery?{initialQuery:e.initialQuery}:{}}]),v(null),h(e.initialQuery??``)}function sr(e){X({addonIcon:e.addonIcon,groups:e.groups,...e.initialQuery?{initialQuery:e.initialQuery}:{}})}function cr(){L(null),Mt.length<=1&&Yt(null),Pt(e=>e.slice(0,-1)),v(null),h(``)}function lr(e){v(null),h(e),e===``&&j?.initialQuery&&cr()}let ur=(0,A.useCallback)(e=>{Yt(e),L(null),X({addonIcon:(0,F.jsx)(g,{className:N}),groups:[],initialQuery:Fn(e)})},[Fn]),dr=(0,A.useCallback)((e,t)=>{Yt(e),L({step:`repository`,environmentId:e,source:t}),X({addonIcon:R(t,N),groups:[],initialQuery:``})},[]),fr=ae(e=>e.openSettings),pr=(0,A.useCallback)(()=>{p(!1),fr(`source-control`)},[fr,p]),mr=(0,A.useCallback)((e,t)=>{let n=[{kind:`action`,value:`action:add-project:${e}:local`,searchTerms:[`local`,`folder`,`directory`,`browse`],title:`Local folder`,description:`Browse a folder on disk`,icon:(0,F.jsx)(g,{className:M}),keepOpen:!0,run:async()=>{ur(e)}}],r=[`url`,...mn(t)];for(let i of r){let r=an(i),a=i===`url`?`Git URL`:`${r} repository`,o=i===`url`?`Clone from a remote URL`:`Clone ${r} ${on(i)}`,s=t[i],c=s.hint,l=s.ready?void 0:(0,F.jsx)(`span`,{className:`ml-auto`,children:(0,F.jsxs)(St,{children:[(0,F.jsx)(bt,{render:(0,F.jsx)(ft,{variant:`outline`,size:`xs`,className:`h-5 rounded-sm px-1.5 text-[10px] text-warning-foreground`,onClick:()=>{pr()},children:`Setup Required`})}),(0,F.jsx)(xt,{align:`end`,side:`left`,children:c??`Open Settings -> Source Control to configure this provider.`})]})});if(!s.ready){n.push({kind:`action`,value:`action:add-project:${e}:${i}:not-ready`,searchTerms:[`clone`,`remote`,`repository`,`repo`,`git`,r,`setup required`],title:a,description:o,disabled:!0,icon:R(i,M),...l?{titleTrailingContent:l}:{},run:async()=>{}});continue}n.push({kind:`action`,value:`action:add-project:${e}:${i}`,searchTerms:[`clone`,`remote`,`repository`,`repo`,`git`,r],title:a,description:o,icon:R(i,M),...l?{titleTrailingContent:l}:{},keepOpen:!0,run:async()=>{dr(e,i)}})}return[{value:`sources:${e}`,label:`Sources`,items:n}]},[pr,ur,dr]),hr=(0,A.useCallback)(e=>{Yt(e),L(null);let t={environmentId:e},n=ye(t).data;X({addonIcon:(0,F.jsx)(g,{className:N}),groups:mr(e,hn(n))}),ee(t).then(t=>{Pt(n=>n.at(-1)?.groups[0]?.value===`sources:${e}`?[...n.slice(0,-1),{addonIcon:(0,F.jsx)(g,{className:N}),groups:mr(e,hn(t))}]:n)})},[mr]),gr=wn.map(e=>({kind:`action`,value:`action:add-project:environment:${e.environmentId}`,searchTerms:[e.label,e.environmentId,e.isPrimary?`this device`:``],title:e.label,description:e.isPrimary?`This device`:e.environmentId,icon:(0,F.jsx)(g,{className:M}),keepOpen:!0,run:async()=>{hr(e.environmentId)}})),_r=(0,A.useMemo)(()=>[{value:`environments`,label:`Environments`,items:gr}],[gr]),vr=(0,A.useCallback)(()=>{if(!t.allowed){T.add(w({type:`error`,title:`Unable to add project`,description:t.reason??`This action is unavailable.`}));return}if(wn.length>1){X({addonIcon:(0,F.jsx)(g,{className:N}),groups:_r});return}let e=Tn;if(!e){T.add(w({type:`error`,title:`Unable to browse projects`,description:`No environment is available.`}));return}hr(e)},[t.allowed,t.reason,_r,wn.length,Tn,hr]);(0,A.useLayoutEffect)(()=>{be?.kind===`add-project`&&(Se(),vr())},[Se,vr,be]);let Z=[];if(Z.push({kind:`action`,value:`action:show-inbox-sidebar`,searchTerms:[`sidebar`,`inbox`,`tasks`,`activity`],title:`Show Inbox sidebar`,icon:(0,F.jsx)(Le,{className:M}),shortcutCommand:`sidebar.showInbox`,run:async()=>{re.getState().clearSelection(),le.getState().setSidebarMode(`inbox`),p(!1)}},{kind:`action`,value:`action:show-projects-sidebar`,searchTerms:[`sidebar`,`projects`,`tree`,`folders`],title:`Show Projects sidebar`,icon:(0,F.jsx)(Ie,{className:M}),shortcutCommand:`sidebar.showProjects`,run:async()=>{re.getState().clearSelection(),le.getState().setSidebarMode(`projects`),p(!1)}}),Z.push({kind:`action`,value:`action:toggle-current-thread-pin`,searchTerms:[`pin`,`unpin`,`thread`,`favorite`,`keep at top`],title:Hn.title,...Hn.description?{description:Hn.description}:{},disabled:Hn.disabled,icon:Hn.pinned?(0,F.jsx)(Ft,{className:M}):(0,F.jsx)(dt,{className:M}),shortcutCommand:`thread.pinToggle`,run:async()=>{x&&K&&await Dt({threadKey:K,threadTitle:x.title,confirmUnpin:y.confirmThreadUnpin})}}),O.length>0){let t=Wn?G.get(Wn)??null:null;t&&Z.push({kind:`action`,value:`action:new-thread`,searchTerms:[`new thread`,`chat`,`create`,`draft`],title:(0,F.jsxs)(F.Fragment,{children:[`New thread in `,(0,F.jsx)(`span`,{className:`font-semibold`,children:t})]}),icon:(0,F.jsx)(Re,{className:M}),shortcutCommand:`chat.new`,...e.reason?{description:e.reason}:{},disabled:!e.allowed,run:async()=>{await Et({activeDraftThread:b,activeThread:x,defaultProjectRef:Ye,defaultThreadEnvMode:y.defaultThreadEnvMode,handleNewThread:E})}}),Z.push({kind:`submenu`,value:`action:new-thread-in`,searchTerms:[`new thread`,`project`,`pick`,`choose`,`select`],title:`New thread in...`,icon:(0,F.jsx)(Re,{className:M}),addonIcon:(0,F.jsx)(Re,{className:N}),groups:[{value:`projects`,label:`Projects`,items:ir}],...e.reason?{description:e.reason}:{},disabled:!e.allowed})}Z.push({kind:`action`,value:`action:add-project`,searchTerms:[`add project`,`folder`,`directory`,`browse`,`clone`,`remote`,`repository`,`repo`,`git`,`github`,`gitlab`,`forgejo`,`codeberg`,`bitbucket`,`azure`,`devops`,`url`,`environment`],title:`Add project`,...t.reason?{description:t.reason}:{},disabled:!t.allowed,icon:(0,F.jsx)(g,{className:M}),keepOpen:!0,run:async()=>{vr()}}),Fe()!==`phone`&&Z.push({kind:`action`,value:`action:statistics`,searchTerms:[`statistics`,`usage`,`activity`,`tokens`,`cost`,`history`],title:`Open statistics`,...l.reason?{description:l.reason}:{},disabled:!l.allowed,icon:(0,F.jsx)(Be,{className:M}),run:async()=>{p(!1),await f({to:`/statistics`})}}),Z.push({kind:`action`,value:`action:settings`,searchTerms:[`settings`,`preferences`,`configuration`,`keybindings`],title:`Open settings`,icon:(0,F.jsx)(Ce,{className:M}),run:async()=>{p(!1),fr()}});let yr=Kt({actionItems:Z,recentThreadItems:or}),br=Ut({activeGroups:j?j.groups:yr,query:Me,isInSubmenu:j!==null,projectSearchItems:rr,threadSearchItems:ar,messageSearchItems:Bn}),xr=(0,A.useCallback)(async(e,t)=>{let r=t?.environmentId??V;if(!r){T.add(w({type:`error`,title:`Failed to add project`,description:`Choose an environment and try again.`}));return}let i=t?.api??ne(r);if(!i){T.add(w({type:`error`,title:`Failed to add project`,description:`The environment is still reconnecting. Try again shortly.`}));return}if(et(e.trim(),En)){T.add(w({type:`error`,title:`Failed to add project`,description:`Windows-style paths are only supported on Windows.`}));return}if(se(e.trim())&&!q){T.add(w({type:`error`,title:`Failed to add project`,description:`Relative paths require an active project.`}));return}let a=nt(e,q);if(a.length===0)return;let s=Qe(O.filter(e=>e.environmentId===r),a);if(s){le.getState().setProjectExpanded(ve(s,y),!0);let e=ge(k.filter(e=>e.environmentId===s.environmentId),s.id,y.sidebarThreadSortOrder);e?await f({to:`/$environmentId/$threadId`,params:gt(n(e.environmentId,e.id))}):await E(o(s.environmentId,s.id),{envMode:y.defaultThreadEnvMode}).catch(()=>void 0),p(!1);return}try{let e=ht();await i.orchestration.dispatchCommand({type:`project.create`,commandId:pt(),projectId:e,title:rt(a),workspaceRoot:a,projectMetadataDir:`.ryco`,createWorkspaceRootIfMissing:!0,defaultModelSelection:{instanceId:c.make(`codex`),model:d},createdAt:new Date().toISOString()}),await E(o(r,e),{envMode:y.defaultThreadEnvMode}).catch(()=>void 0),p(!1)}catch(e){T.add(w({type:`error`,title:`Failed to add project`,description:e instanceof Error?e.message:`An error occurred.`}))}},[V,En,q,E,f,O,p,y,k]),Sr=(0,A.useCallback)(e=>Fn(e),[Fn]),Q=(0,A.useCallback)(e=>{let t=Sr(e.flow.environmentId);L({step:`confirm`,environmentId:e.flow.environmentId,source:e.flow.source,repositoryInput:e.repositoryInput,repository:e.repository,remoteUrl:e.remoteUrl}),v(null),h(t),P(e=>e+1)},[Sr]);async function Cr(e){if(!I)return;let t=ne(I.environmentId);if(!t){T.add(w({type:`error`,title:`Unable to clone project`,description:`Environment API is not available.`}));return}if(I.step===`repository`){let e=m.trim();if(e.length===0||pn)return;let n=sn(I.source);if(!n){Q({flow:I,repositoryInput:e,repository:null,remoteUrl:e});return}let r=U.data?.repositories??[];if(fn(e)&&kn===e&&r.length===1){let e=r[0];Q({flow:I,repositoryInput:e.nameWithOwner,repository:e,remoteUrl:dn(I.source,e)});return}_n(!0);try{let r=await t.sourceControl.lookupRepository({provider:n,repository:e});Q({flow:I,repositoryInput:e,repository:r,remoteUrl:dn(I.source,r)})}catch(e){T.add(w({type:`error`,title:`Repository lookup failed`,description:gn(e)}))}finally{_n(!1)}return}let n=(e??m).trim();if(n.length===0||vn)return;if(et(n,En)){T.add(w({type:`error`,title:`Clone failed`,description:`Windows-style paths are only supported on Windows.`}));return}if(se(n)&&!q){T.add(w({type:`error`,title:`Clone failed`,description:`Relative paths require an active project.`}));return}let r=nt(n,q);if(r.length!==0){yn(!0);try{let e=sn(I.source),n=await t.sourceControl.cloneRepository({...e&&I.repository?{provider:e,repository:I.repository.nameWithOwner,remoteUrl:I.remoteUrl,...I.source===`bitbucket`?{protocol:`https`}:{}}:{remoteUrl:I.remoteUrl},destinationPath:r});await xr(n.cwd,{environmentId:I.environmentId,api:t})}catch(e){T.add(w({type:`error`,title:`Clone failed`,description:gn(e)}))}finally{yn(!1)}}}function wr(e){let t=ut(m,e);v(null),h(t),P(e=>e+1)}function Tr(e){let t=$e(e);v(null),h(t),P(e=>e+1)}function Er(){if(!Qn)return;let e=Ze(m);e!==null&&(v(null),h(e),P(e=>e+1))}let Dr=ct(m)?Y?.parentPath??m.trim():er?.fullPath??m.trim(),Or=[...Jn.error?[{value:`browse-status`,label:`Filesystem`,items:[{kind:`action`,value:`browse-status:error`,searchTerms:[`filesystem`,`unavailable`,`error`],title:`Unable to browse folders`,description:gn(Jn.error),icon:(0,F.jsx)(Xe,{className:M}),disabled:!0,run:async()=>{}}]}]:[],...Wt({browseEntries:$n,browseQuery:m,canBrowseUp:Qn,upIcon:(0,F.jsx)(jt,{className:M}),directoryIcon:(0,F.jsx)(je,{className:M}),symlinkIcon:(0,F.jsx)(Nt,{className:M}),browseUp:Er,browseTo:wr,browseToPath:Tr})],kr=Or.map(e=>e.value===`directories`?{...e,label:`Select where to clone`}:e),Ar=(0,A.useMemo)(()=>I?.step===`confirm`?{title:I.repository?.nameWithOwner??I.repositoryInput,description:I.repository?.url??I.remoteUrl,icon:R(I.source,M)}:null,[I]),jr=(0,A.useMemo)(()=>{if(I?.step!==`repository`||I.source===`url`||H!==`bitbucket`)return[];let e=U.data?.repositories??[];return e.length>0?[{value:`remote-repositories:${I.environmentId}:${H}`,label:kn.length>0?`Matching repositories`:`Available repositories`,items:e.map(e=>({kind:`action`,value:un(e),searchTerms:[e.nameWithOwner,ln(e.nameWithOwner),e.url,e.sshUrl],title:e.nameWithOwner,description:e.url,icon:R(I.source,M),keepOpen:!0,run:async()=>{Q({flow:I,repositoryInput:e.nameWithOwner,repository:e,remoteUrl:dn(I.source,e)})}}))}]:U.isFetching?[{value:`remote-repositories:${I.environmentId}:${H}:loading`,label:`Repositories`,items:[{kind:`action`,value:`remote-repositories:loading`,searchTerms:[`loading`,`repository`,`repo`],title:`Loading repositories`,description:`Reading available Bitbucket workspaces`,icon:R(I.source,M),disabled:!0,run:async()=>{}}]}]:U.error===null?[]:[{value:`remote-repositories:${I.environmentId}:${H}:error`,label:`Repositories`,items:[{kind:`action`,value:`remote-repositories:error`,searchTerms:[`error`,`repository`,`repo`],title:`Unable to load repositories`,description:gn(U.error),icon:R(I.source,M),disabled:!0,run:async()=>{}}]}]},[I,Q,H,kn,U.data?.repositories,U.error,U.isFetching]),Mr=I?.step===`repository`&&I.source===`bitbucket`?kn.length===0?`No repositories found. Enter workspace/repository manually.`:`No matching repositories. Enter workspace/repository manually.`:null,Nr=br;I?.step===`repository`?Nr=jr:I?.step===`confirm`?Nr=J?[]:kr:W&&(Nr=J?[]:Or);let Pr=cn(I)??qt(An),Fr=An===`submenu`||An===`submenu-browse`,$=_?.startsWith(`browse:`)??!1,Ir=W&&!J,Lr=Ir&&!Yn&&m.trim().length>0&&!$&&(ct(m)?!Y:er===null),Rr=mt(navigator.platform),zr=Rr?`⌘`:`Ctrl`,Br=I?.step===`confirm`,Vr=Br?Lr?`Create & Clone`:`Clone`:Lr?`Create & Add`:`Add`,Hr=$?`${zr} Enter`:`Enter`,Ur=I?I.source===`url`?`Continue`:`Lookup`:null,Wr=pn||vn,Gr=I?.step===`repository`&&m.trim().length>0&&!Wr,Kr=nn(navigator.platform),qr=W&&V!==null&&z!==null&&V===z&&typeof window<`u`&&window.desktopBridge!==void 0,Jr=(0,A.useMemo)(()=>{if(!qr)return;let e=m.trim();if(e.length===0)return;let t=ct(m)?Y?.parentPath??e:Kn||e,n=nt(t,q);return n.length>0?n:void 0},[Kn,Y?.parentPath,qr,q,m]);function Yr(e){return Rr?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function Xr(e){if(I?.step===`repository`&&e.key===`Enter`){e.preventDefault();let t=U.data?.repositories.find(e=>un(e)===_);if(t){Q({flow:I,repositoryInput:t.nameWithOwner,repository:t,remoteUrl:dn(I.source,t)});return}Cr();return}if(Ir&&e.key===`Enter`&&(!$||Yr(e))){e.preventDefault(),Br?Cr(Dr):xr(Dr);return}e.key===`Backspace`&&m===``&&Fr&&(e.preventDefault(),cr())}function Zr(e){if(!e.disabled){if(e.kind===`submenu`){sr(e);return}e.keepOpen||p(!1),e.run().catch(e=>{T.add(w({type:`error`,title:`Unable to run command`,description:e instanceof Error?e.message:`An unexpected error occurred.`}))})}}let Qr=(0,A.useCallback)(async()=>{if(!qr||Xt)return;let e=fe();if(!e)return;Zt(!0);let t=null;try{t=await e.dialogs.pickFolder(Jr?{initialPath:Jr}:void 0)}catch{Zt(!1);return}Zt(!1),t&&await xr(t)},[qr,Jr,xr,Xt]);return(0,F.jsx)(He,{"aria-label":`Command palette`,className:`project-glass-surface overflow-hidden p-0`,"data-testid":`command-palette`,surface:`glass`,finalFocus:()=>(De?.current?.focusAtEnd(),!1),onBackdropPointerDown:()=>{p(!1)},children:(0,F.jsxs)(We,{"aria-label":`Command palette`,autoHighlight:W||Dn?!1:`always`,mode:`none`,onItemHighlighted:e=>{v(typeof e==`string`?e:null)},onValueChange:lr,value:m,children:[(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(Ve,{className:I?.step===`repository`?`pe-32`:W?Lr?`pe-36`:`pe-16`:void 0,placeholder:Pr,wrapperClassName:Fr?`[&_[data-slot=autocomplete-start-addon]]:pointer-events-auto`:void 0,...Fr?{startAddon:(0,F.jsx)(`button`,{type:`button`,className:`flex cursor-pointer items-center`,"aria-label":`Back`,onClick:cr,children:(0,F.jsx)(ze,{})})}:W&&!Fr?{startAddon:(0,F.jsx)(g,{})}:{},onKeyDown:Xr}),I?.step===`repository`?(0,F.jsxs)(ft,{variant:`outline`,size:`xs`,tabIndex:-1,className:`absolute inset-e-2.5 top-1/2 gap-1.5 pe-1 ps-2 -translate-y-1/2`,"aria-label":`${Ur??`Continue`} (Enter)`,disabled:!Gr,onMouseDown:e=>{e.preventDefault()},onClick:()=>{Cr()},title:`${Ur??`Continue`} (Enter)`,children:[(0,F.jsx)(`span`,{children:Wr?`Working`:Ur}),(0,F.jsx)(S,{className:`pointer-events-none -me-0.5 items-center gap-1 pointer-coarse:hidden`,children:(0,F.jsx)(C,{children:`Enter`})})]}):W?(0,F.jsxs)(ft,{variant:`outline`,size:`xs`,tabIndex:-1,className:D(`absolute inset-e-2.5 top-1/2 pe-1 ps-2 -translate-y-1/2`,$?`gap-1`:`gap-1.5`),"aria-label":`${Vr} (${Hr})`,disabled:J||Br&&Wr,onMouseDown:e=>{e.preventDefault()},onClick:()=>{J||(Br?Cr(Dr):xr(Dr))},title:`${Vr} (${Hr})`,children:[(0,F.jsx)(`span`,{children:Br&&Wr?`Cloning`:Vr}),(0,F.jsx)(S,{className:`pointer-events-none -me-0.5 items-center gap-1 pointer-coarse:hidden`,children:(0,F.jsx)(C,{children:$?`${zr} Enter`:`Enter`})})]}):null]}),(0,F.jsxs)(qe,{className:`max-h-[min(28rem,70vh)] bg-transparent`,children:[Ar?(0,F.jsxs)(`div`,{className:`p-2 pb-0`,children:[(0,F.jsx)(`div`,{className:`px-2 py-1.5 font-medium text-muted-foreground text-xs`,children:`Repository`}),(0,F.jsxs)(`div`,{className:`flex min-h-8 items-center gap-2 rounded-sm px-2 py-1.5`,children:[Ar.icon,(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,F.jsx)(`span`,{className:`truncate text-foreground text-sm`,children:Ar.title}),(0,F.jsx)(`span`,{className:`truncate text-muted-foreground/70 text-xs`,children:Ar.description})]})]})]}):null,(0,F.jsx)(Jt,{groups:Nr,highlightedItemValue:_,isActionsOnly:Pe,keybindings:At,onExecuteItem:Zr,...I?.step===`repository`?{emptyStateMessage:I.source===`url`?`Enter a Git clone URL and press Enter to continue.`:Mr??`Enter a repository path and press Enter to look it up.`}:I?.step===`confirm`?{emptyStateMessage:`Choose a destination path and press Enter to clone.`}:J?{emptyStateMessage:`Relative paths require an active project.`}:Lr?{emptyStateMessage:`Press Enter to create this folder and add it as a project.`}:{}})]}),(0,F.jsxs)(Ue,{className:`gap-3 max-sm:flex-col max-sm:items-start`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3 pointer-coarse:hidden`,children:[(0,F.jsxs)(S,{className:`items-center gap-1.5`,children:[(0,F.jsx)(C,{children:(0,F.jsx)(Ae,{})}),(0,F.jsx)(C,{children:(0,F.jsx)(ke,{})}),(0,F.jsx)(`span`,{className:D(`text-muted-foreground/80`),children:`Navigate`})]}),I?.step===`repository`?(0,F.jsxs)(S,{className:`items-center gap-1.5`,children:[(0,F.jsx)(C,{children:`Enter`}),(0,F.jsx)(`span`,{className:D(`text-muted-foreground/80`),children:Ur??`Continue`})]}):!Ir||$?(0,F.jsxs)(S,{className:`items-center gap-1.5`,children:[(0,F.jsx)(C,{children:`Enter`}),(0,F.jsx)(`span`,{className:D(`text-muted-foreground/80`),children:`Select`})]}):null,Fr?(0,F.jsxs)(S,{className:`items-center gap-1.5`,children:[(0,F.jsx)(C,{children:`Backspace`}),(0,F.jsx)(`span`,{className:D(`text-muted-foreground/80`),children:`Back`})]}):null,(0,F.jsxs)(S,{className:`items-center gap-1.5`,children:[(0,F.jsx)(C,{children:`Esc`}),(0,F.jsx)(`span`,{className:D(`text-muted-foreground/80`),children:`Close`})]})]}),qr?(0,F.jsx)(ft,{variant:`ghost`,size:`xs`,className:`h-auto px-2 text-xs text-muted-foreground/80 hover:bg-transparent hover:text-foreground`,disabled:Xt,onClick:()=>{Qr()},children:`Open in ${Kr}`}):null]})]},`${Mt.length}-${Rt}-${W}-${I?.step??`none`}`)})}export{_n as CommandPaletteDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{ia as n}from"./runtime-L56puJDA.js";import{G as r,J as i,K as a,U as o,Y as s,l as c,xt as l}from"./usePositioner-0Kb-C4al.js";import{i as u,r as d,s as f,t as p}from"./useRenderElement-D0HVF5g_.js";import{l as m,p as h}from"./badge-CYDyJZRJ.js";import{A as g,j as _}from"./visuallyHidden-BRaogTVF.js";import{i as v}from"./useValueChanged-CThCTn4h.js";import{a as y,d as b,f as x,i as S,l as C,o as w,r as T,s as E}from"./useScrollLock-AUqaSAkf.js";var D=e(t(),1),O=`data-composite-item-active`;function k(e){let{loopFocus:t=!0,orientation:n=`both`,grid:c,onLoop:u,direction:p,highlightedIndex:h,onHighlightedIndexChange:v,rootRef:C,enableHomeAndEndKeys:O=!1,stopEventPropagation:k,disabledIndices:M,modifierKeys:N=d}=e,[P,F]=D.useState(0),I=c!=null,L=D.useRef(null),R=f(L,C),z=D.useRef([]),B=D.useRef(!1),V=D.useRef(null),H=h??P,U=_((e,t=!1)=>{if(V.current=z.current[e]??null,(v??F)(e),t){let t=z.current[e];x(L.current,t,p,n)}}),W=_(e=>{if(e.size===0)return;if(B.current){let e=z.current,t=e.indexOf(V.current);if(t===-1){let t=e[H];!t||s(e,H,M)?U(A(e,M)):V.current=t}else t!==H&&U(t);return}B.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,a=r?e.get(r)?.index??-1:-1;if(a!==-1)U(a);else if(s(t,H,M)){let e=o(t,{disabledIndices:M});i(t,e)||U(e)}x(L.current,r,p,n)});g(()=>{if(M==null||h!=null||!B.current)return;let e=z.current;if(s(e,H,M)){let t=o(e,{disabledIndices:M});i(e,t)||U(t)}},[M,h,H,z,U]);let G=_((e,t,n)=>u?u(e,t,n,z):n),K=_(e=>{let s=e.key===`Home`||e.key===`End`;if(!E.has(e.key)||!O&&s||j(e,N)||!L.current)return;let d=p===`rtl`,f=d?S:y,h=d?y:S,g=n===`vertical`?T:f,_=n===`vertical`?w:h,v=l(e.nativeEvent);if(v!=null&&b(v)&&!m(v)){let t=v.selectionStart,n=v.selectionEnd,r=v.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==g&&t>0)return}let x=H,C=a(z,M),D=r(z,M);c!=null&&(x=c({disabledIndices:M,elementsRef:z,event:e,highlightedIndex:H,loopFocus:t,maxIndex:D,minIndex:C,onLoop:G,orientation:n,rtl:d}));let A=n!==`vertical`&&e.key===f||n!==`horizontal`&&e.key===`ArrowDown`,P=n!==`vertical`&&e.key===h||n!==`horizontal`&&e.key===`ArrowUp`;O&&(e.key===`Home`?x=C:e.key===`End`&&(x=D)),x===H&&(A||P)&&(t&&x===D&&A?(x=C,u&&(x=u(e,H,x,z))):t&&x===C&&P?(x=D,u&&(x=u(e,H,x,z))):x=o(z.current,{startingIndex:x,decrement:P,disabledIndices:M})),x!==H&&!i(z.current,x)&&(k&&e.stopPropagation(),(I||s||A||P)&&e.preventDefault(),U(x,!0),queueMicrotask(()=>{z.current[x]?.focus()}))});return{props:{ref:R,onFocus(e){let t=L.current,n=l(e.nativeEvent);t&&n!=null&&b(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:K},highlightedIndex:H,onHighlightedIndexChange:U,elementsRef:z,onMapChange:W,relayKeyboardEvent:K}}function A(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!s(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function j(e,t){for(let n of C)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}var M=n();function N(e){let{render:t,className:n,style:r,refs:i=d,props:a=d,state:o=u,stateAttributesMapping:s,highlightedIndex:l,onHighlightedIndexChange:f,orientation:m,grid:g,loopFocus:_,onLoop:y,enableHomeAndEndKeys:b,onMapChange:x,stopEventPropagation:S=!0,rootRef:C,disabledIndices:w,modifierKeys:T,highlightItemOnHover:E=!1,tag:O=`div`,...A}=e,{props:j,highlightedIndex:N,onHighlightedIndexChange:P,elementsRef:F,onMapChange:I,relayKeyboardEvent:L}=k({grid:g,loopFocus:_,onLoop:y,orientation:m,highlightedIndex:l,onHighlightedIndexChange:f,rootRef:C,stopEventPropagation:S,enableHomeAndEndKeys:b,direction:c(),disabledIndices:w,modifierKeys:T}),R=p(O,e,{state:o,ref:i,props:[j,...a,A],stateAttributesMapping:s}),z=D.useMemo(()=>({highlightedIndex:N,onHighlightedIndexChange:P,highlightItemOnHover:E,relayKeyboardEvent:L}),[N,P,E,L]);return(0,M.jsx)(v.Provider,{value:z,children:(0,M.jsx)(h,{elementsRef:F,onMapChange:e=>{x?.(e),I(e)},children:R})})}export{O as n,N as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{ia as n}from"./runtime-L56puJDA.js";import{dr as r,t as i,ur as a}from"./switch-COrEGDkz.js";import{t as o}from"./compiler-runtime-qmuS0Svy.js";import{f as s}from"./useRenderElement-D0HVF5g_.js";import{c,o as l}from"./toast-C_F1LeME.js";import{t as u}from"./monitor-Dyigmrl2.js";import{t as d}from"./button-QrCU0tNP.js";var f={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};f.node;var p=s(f),m={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};m.node;var h=s(m),g=o(),_=e(t(),1),v=n(),y=[{id:`ryco`,label:`Ryco Browser`},{id:`chrome`,label:`Google Chrome`},{id:`brave`,label:`Brave`},{id:`edge`,label:`Microsoft Edge`}];function b(e){let t=(0,g.c)(7),{status:n,checked:i}=e,o=n===`granted`,s=n===`denied`||n===`restricted`,l=o?c:s?a:r,u=o?`Granted`:n===`restricted`?`Restricted`:s?`Not granted`:n===`not_required`?`Not required`:i?`Could not check`:`Not checked`,d=`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${o?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:s?`bg-red-500/10 text-red-700 dark:text-red-300`:`bg-muted text-muted-foreground`}`,f;t[0]===l?f=t[1]:(f=(0,v.jsx)(l,{"aria-hidden":`true`,className:`size-3`}),t[0]=l,t[1]=f);let p;return t[2]!==u||t[3]!==n||t[4]!==d||t[5]!==f?(p=(0,v.jsxs)(`span`,{"data-permission-status":n,className:d,children:[f,u]}),t[2]=u,t[3]=n,t[4]=d,t[5]=f,t[6]=p):p=t[6],p}function x(){let e=window.desktopBridge?.computerUse,[t,n]=(0,_.useState)(null),[r,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(!1),[c,f]=(0,_.useState)(``),[m,g]=(0,_.useState)(null),[x,S]=(0,_.useState)(null),[C,w]=(0,_.useState)(null),{copyToClipboard:T,isCopied:E}=l({onError:()=>a(`Could not copy. Select the text and copy it manually.`)});if((0,_.useEffect)(()=>{if(!e)return;let r=!0,i=!1,o=async()=>{if(!i&&r){i=!0;try{let t=await e.getState();r&&n(t)}catch{r&&a(`Computer-use settings could not be loaded.`)}finally{i=!1}}};o();let s=()=>{o()},c=()=>{document.visibilityState===`visible`&&o()};window.addEventListener(`focus`,s),document.addEventListener(`visibilitychange`,c);let l=t?.policy.enabled?setInterval(()=>{document.visibilityState===`visible`&&document.hasFocus()&&o()},3e3):void 0,u=e.onState(e=>{r&&n(e)});return()=>{r=!1,u(),clearInterval(l),window.removeEventListener(`focus`,s),document.removeEventListener(`visibilitychange`,c)}},[e,t?.policy.enabled]),!e)return null;let D=async e=>{s(!0),a(null);try{await e()}catch(e){a(e instanceof Error?e.message:`Computer-use request failed.`)}finally{s(!1)}},O=r=>{t&&D(async()=>{n(await e.setPolicy({...t.policy,...r})),g(null)})},k=new Map(Object.keys(t?.policy.apps??{}).map(e=>[e,{id:e,name:e.replaceAll(`\\`,`/`).split(`/`).pop()??e}]));for(let e of t?.apps??[])k.set(e.id,e);for(let e of y)k.set(`browser:${e.id}`,{id:`browser:${e.id}`,name:e.label});return(0,v.jsx)(`section`,{"data-settings-section":`Computer Use`,className:`scroll-mt-6 border-b p-6 sm:p-8`,"aria-labelledby":`computer-use-heading`,children:(0,v.jsxs)(`div`,{className:`mx-auto flex max-w-4xl flex-col gap-5`,children:[(0,v.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(u,{className:`size-4 text-muted-foreground`}),(0,v.jsx)(`h2`,{id:`computer-use-heading`,className:`text-lg font-semibold`,children:`Computer use`})]}),(0,v.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-muted-foreground`,children:`Let agents work in apps on this computer while you keep working. An independent Ryco cursor shows their actions. Native tools require Agent Control in Integrations and a new provider session.`})]}),(0,v.jsx)(i,{"aria-label":`Enable computer use on this computer`,checked:t?.policy.enabled??!1,disabled:o||!t,onCheckedChange:e=>O({enabled:!!e})})]}),r||t?.error?(0,v.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:r??t?.error}):null,t?.policy.enabled?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border bg-muted/20 p-3`,role:`status`,children:[(0,v.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,v.jsx)(p,{className:`size-4`}),t.activity?`Working in ${t.activity.target} · ${t.activity.mode}`:`Enabled · waiting for an agent`]}),(0,v.jsxs)(d,{size:`sm`,variant:`outline`,onClick:()=>void D(()=>e.stop()),children:[(0,v.jsx)(h,{className:`size-3`}),`Stop all`]})]}),(0,v.jsx)(`p`,{className:`-mt-3 text-xs text-muted-foreground`,children:`Use ⌘/Ctrl + Shift + Escape while computer use is enabled to stop. A stopped turn must be restarted.`}),(0,v.jsxs)(`div`,{className:`space-y-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,v.jsx)(`span`,{className:`text-sm font-medium`,children:`Native permissions`}),(0,v.jsx)(d,{variant:`ghost`,size:`sm`,disabled:o,onClick:()=>void D(async()=>{n(await e.getState())}),children:`Check permissions`})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,v.jsxs)(d,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void D(()=>e.requestPermission(`accessibility`)),children:[`Accessibility`,` `,(0,v.jsx)(b,{status:t.accessibility,checked:!!t.permissionInfo?.checkedAt})]}),(0,v.jsxs)(d,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void D(()=>e.requestPermission(`screenRecording`)),children:[`Screen recording`,` `,(0,v.jsx)(b,{status:t.screenRecording,checked:!!t.permissionInfo?.checkedAt})]})]}),t.permissionInfo?.error?(0,v.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:t.permissionInfo.error}):null,t.permissionInfo?.development?(0,v.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Development build: grant permissions to `,t.permissionInfo.appName,` in macOS Settings. Access is checked again when you return. If Screen Recording stays denied after granting it, restart this build.`]}):(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Permissions are checked automatically when you return from system settings.`}),(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`p`,{className:`text-sm font-medium`,children:`Allow foreground takeover requests`}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Ask before taking over your mouse and keyboard when background control is unavailable.`})]}),(0,v.jsx)(i,{"aria-label":`Allow foreground takeover requests`,checked:t.policy.foregroundEnabled,disabled:o,onCheckedChange:e=>O({foregroundEnabled:!!e})})]})]}),(0,v.jsxs)(`section`,{"data-settings-section":`Browser Use`,className:`scroll-mt-6 space-y-3 border-t pt-4`,children:[(0,v.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Browser Use`}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Ryco Browser has a separate profile. Pair Chrome, Brave or Edge to use your existing tabs and sign-ins.`}),y.map(n=>(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,v.jsxs)(`div`,{className:`text-sm`,children:[n.label,(0,v.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:n.id===`ryco`?`Built in`:t.connectedBrowsers.includes(n.id)?`Connected`:`Not connected`})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-3`,children:[n.id!==`ryco`&&t.policy.browsers.includes(n.id)?(0,v.jsx)(d,{size:`sm`,variant:`ghost`,disabled:o,onClick:()=>void D(async()=>{g(JSON.stringify(await e.pairBrowser(n.id))),S(n.id)}),children:`Pair`}):null,(0,v.jsx)(i,{"aria-label":`Enable ${n.label} control`,checked:t.policy.browsers.includes(n.id),disabled:o,onCheckedChange:e=>O({browsers:e?[...t.policy.browsers,n.id]:t.policy.browsers.filter(e=>e!==n.id)})})]})]},n.id)),(0,v.jsx)(d,{variant:`outline`,size:`sm`,onClick:()=>void D(async()=>{w(await e.showExtension())}),children:`Show browser extension folder`}),m?(0,v.jsxs)(`div`,{className:`space-y-2 rounded-lg border p-3`,children:[(0,v.jsx)(`p`,{className:`text-sm font-medium`,children:`Connect your browser`}),(0,v.jsxs)(`ol`,{className:`list-decimal space-y-1 pl-4 text-xs text-muted-foreground`,children:[(0,v.jsx)(`li`,{children:`Open Extensions, enable Developer mode, then choose Load unpacked.`}),(0,v.jsx)(`li`,{children:`Select the Ryco extension folder shown below. On macOS, paste its path with ⌘ + Shift + G in the folder chooser.`}),(0,v.jsx)(`li`,{children:`Open Ryco Browser Control in the browser toolbar and paste the pairing configuration.`})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x?(0,v.jsx)(d,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void D(()=>e.openBrowserSetup(x)),children:`Open browser Extensions`}):null,(0,v.jsx)(d,{size:`sm`,variant:`outline`,disabled:o,onClick:()=>void D(async()=>{w(await e.showExtension())}),children:`Show extension folder`}),(0,v.jsx)(d,{size:`sm`,variant:`outline`,onClick:()=>T(m,void 0),children:`Copy pairing configuration`})]}),C?(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`input`,{"aria-label":`Extension folder path`,readOnly:!0,value:C,onFocus:e=>e.currentTarget.select(),className:`min-w-0 flex-1 rounded-md border bg-background p-2 font-mono text-xs`}),(0,v.jsx)(d,{size:`sm`,variant:`ghost`,onClick:()=>T(C,void 0),children:`Copy folder path`})]}):null,E?(0,v.jsx)(`p`,{role:`status`,className:`text-xs text-emerald-700 dark:text-emerald-300`,children:`Copied`}):null,(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Pairing replaces the previous connection. Pair again after restarting Ryco.`}),(0,v.jsx)(`textarea`,{"aria-label":`Browser pairing configuration`,readOnly:!0,value:m,className:`h-20 w-full rounded-md border bg-background p-2 font-mono text-xs`,onFocus:e=>e.currentTarget.select()}),(0,v.jsx)(d,{size:`sm`,variant:`ghost`,onClick:()=>g(null),children:`Hide configuration`})]}):null]}),(0,v.jsxs)(`div`,{className:`space-y-3 border-t pt-4`,children:[(0,v.jsx)(`h3`,{className:`text-sm font-semibold`,children:`App access`}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Apps ask on first use. Blocked apps cannot be inspected or controlled. Changing permissions stops current work.`}),(0,v.jsxs)(`form`,{className:`flex gap-2`,onSubmit:t=>{t.preventDefault(),D(async()=>{n(await e.refresh(c||void 0))})},children:[(0,v.jsx)(`input`,{"aria-label":`Find installed apps`,placeholder:`Find installed apps…`,value:c,onChange:e=>f(e.target.value),className:`min-w-0 flex-1 rounded-md border bg-background px-3 py-2 text-sm`}),(0,v.jsx)(d,{variant:`outline`,size:`sm`,disabled:o,children:`Find apps`})]}),(0,v.jsx)(`div`,{className:`max-h-80 divide-y overflow-y-auto`,children:[...k.values()].filter(e=>!c||e.name.toLowerCase().includes(c.toLowerCase())||t.policy.apps[e.id]!==void 0).map(e=>(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-4 py-2`,children:[(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsx)(`p`,{className:`truncate text-sm`,children:e.name}),(0,v.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,title:e.id,children:e.id})]}),(0,v.jsxs)(`select`,{"aria-label":`Access to ${e.name}`,className:`rounded-md border bg-background px-2 py-1 text-sm`,disabled:o,value:t.policy.apps[e.id]??`ask`,onChange:n=>O({apps:{...t.policy.apps,[e.id]:n.target.value}}),children:[(0,v.jsx)(`option`,{value:`ask`,children:`Ask`}),(0,v.jsx)(`option`,{value:`allow`,children:`Always allow`}),(0,v.jsx)(`option`,{value:`block`,children:`Block`})]})]},e.id))})]})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Off. Agents cannot inspect or operate apps or browsers through Ryco computer use.`}),(0,v.jsxs)(`section`,{"data-settings-section":`Browser Use`,className:`scroll-mt-6 space-y-2 border-t pt-4`,children:[(0,v.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Browser Use`}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Enable Computer Use above to configure Ryco Browser or pair Chrome, Brave, and Edge.`})]})]})]})})}export{x as ComputerUseSettings};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./react-SIfiwpqq.js";import{A as n,C as r,F as i,M as a,T as o,U as s,g as c,h as l,j as u,k as d,m as f,p,u as m}from"./primary-DjXNHNGV.js";import{Ga as h,Qr as g}from"./src-gDjuIvMO.js";import{Ct as _,Ji as v,K as y,Li as b,Ot as x,Tn as S,V as C,_i as w,h as T,ia as E,l as D,m as O,n as k,r as A,s as j,vi as M}from"./runtime-L56puJDA.js";import{A as N,At as P,Dt as F,F as I,Ft as ee,I as L,It as R,Lt as te,M as z,Mt as ne,N as re,Nt as ie,P as ae,Pt as oe,St as se,Tn as B,Wn as V,_t as ce,ct as le,dt as ue,gt as de,ht as fe,j as pe,jt as H,kt as me,lt as he,st as ge,t as _e,ut as ve,vt as ye,wn as U,yt as be}from"./switch-COrEGDkz.js";import{t as xe}from"./compiler-runtime-qmuS0Svy.js";import{n as Se,t as Ce}from"./pairingUrl-rQM9kSGT.js";import{r as we,t as Te}from"./hostedPairing-PogXRAb7.js";import{f as Ee}from"./useRenderElement-D0HVF5g_.js";import{c as De,o as W,s as Oe}from"./SettingsPanels-CeuvwIV_.js";import{t as ke}from"./arrow-up-right-DP0hmMEB.js";import{t as Ae}from"./chevron-down-yka18-iP.js";import{a as je,i as G,o as Me}from"./toast-C_F1LeME.js";import{t as Ne}from"./qr-code-CkI1p05P.js";import{t as Pe}from"./refresh-cw-MqmsC7V0.js";import{t as Fe}from"./triangle-alert-YXqtFxD6.js";import{t as K}from"./button-QrCU0tNP.js";import{t as Ie}from"./utils-5-6TOrS1.js";import{i as Le,n as Re,t as ze}from"./tooltip-iy3_osu5.js";import{t as Be}from"./input-BAC5Cd3b.js";import{t as Ve}from"./scroll-area-DCGCzd6v.js";import{a as He,i as Ue,n as We,r as q}from"./settingsLayout-CmNqO2kB.js";import{n as J,t as Ge}from"./data-list-CsiYTho5.js";import{t as Ke}from"./AnimatedHeight-D9bpLPqe.js";import{n as qe,t as Je}from"./group-DfFZdj79.js";import{t as Ye}from"./qr-code-Bun4dpvz.js";import{Gt as Xe,at as Ze,ot as Qe,ut as $e}from"./main-DaXSCt8g.js";var Y={name:`chevrons-left-right-ellipsis`,size:24,node:[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`m17 7 5 5-5 5`,key:`1xlxn0`}],[`path`,{d:`m7 7-5 5 5 5`,key:`19njba`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}]]};Y.node;var et=Ee(Y),X=e(t(),1),Z=xe();function tt(e,t){let n=new URL(e);return n.pathname=`/pair`,Se(n,t).toString()}function Q(e,t){return new URL(e).protocol===`https:`?Te({host:e,token:t}):null}var nt=`/assets/relay-architecture-YeimmXuP.html`,$=E();function rt(e,t){return e===null||t===null||!e.fileSecretStoreFallbackSupported?!1:t.enrolled===`none`||t.enrolled===`unknown`&&!e.allowFileSecretStore}function it(e,t){return e===null||t===null?`Loading local launch configuration and identity state.`:e.fileSecretStoreFallbackSupported?t.enrolled===`active`||t.enrolled===`pending`?`Locked while this machine holds Hub identity material. Leave the Hub before changing it.`:t.enrolled===`unknown`?e.allowFileSecretStore?`Identity custody is unreadable, so an enabled fallback cannot be turned off.`:`Enable this only as a recovery action when an existing file-backed identity cannot be read.`:`Ryco still prefers the system credential store. This only permits the hardened POSIX file fallback when that store is unavailable.`:`Unavailable on Windows. Ryco requires the system credential store on this host.`}function at(e){return e<1024?`${e} B`:`${(e/1024).toFixed(+(e<10240))} KiB`}function ot(e,t){if(e===null)return[{label:`Protocol`,value:`Loading`},{label:`Channels`,value:`Loading`},{label:`Relay queue`,value:`Loading`},{label:`Reconnect`,value:`Loading`}];let n=e.state===`online`&&e.protocolMajor!==void 0&&e.protocolMinor!==void 0?`${e.protocolMajor}.${e.protocolMinor}`:`Not negotiated`,r=e.nextRetryAt===void 0?e.reconnectAttempt===void 0?`Not scheduled`:`Attempt ${e.reconnectAttempt}`:`Attempt ${e.reconnectAttempt??0}, ${Math.max(0,Math.ceil((Date.parse(e.nextRetryAt)-t)/1e3))}s`;return[{label:`Protocol`,value:n},{label:`Channels`,value:String(e.activeChannels)},{label:`Relay queue`,value:at(e.queuedBytes)},{label:`Reconnect`,value:r}]}function st(e){let t=(0,Z.c)(84),{config:n,identity:r,status:i,nowMs:a,savingFileFallback:o,configError:s,onFileFallbackChange:c,onOpenGuide:l}=e,[u,d]=(0,X.useState)(!1),f;t[0]!==n||t[1]!==r?(f=rt(n,r),t[0]=n,t[1]=r,t[2]=f):f=t[2];let p=f,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k;if(t[3]!==p||t[4]!==n||t[5]!==s||t[6]!==r||t[7]!==a||t[8]!==c||t[9]!==l||t[10]!==u||t[11]!==o||t[12]!==i){let e=ot(i,a);g=W,y=u,b=d;let f=u?`Hide advanced options`:`Show advanced options`,A;t[29]===f?A=t[30]:(A=(0,$.jsx)(`span`,{className:`block text-[13px] font-semibold tracking-[-0.01em] text-foreground`,children:f}),t[29]=f,t[30]=A);let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,$.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground/80`,children:`Key custody, startup ownership, CLI flags, and bounded relay diagnostics.`}),t[31]=j):j=t[31];let M;t[32]===s?M=t[33]:(M=s?(0,$.jsx)(`span`,{className:`mt-1 block text-[11px] text-destructive`,children:s}):null,t[32]=s,t[33]=M);let N;t[34]!==A||t[35]!==M?(N=(0,$.jsxs)(`span`,{children:[A,j,M]}),t[34]=A,t[35]=M,t[36]=N):N=t[36];let P=`size-4 shrink-0 text-muted-foreground transition-transform duration-200 motion-reduce:transition-none ${u?`rotate-180`:``}`,F;t[37]===P?F=t[38]:(F=(0,$.jsx)(Ae,{className:P,"aria-hidden":!0}),t[37]=P,t[38]=F),t[39]!==N||t[40]!==F?(x=(0,$.jsxs)(De,{className:`group flex w-full items-center justify-between gap-4 border-t border-border/60 px-4 py-3.5 text-left transition-colors hover:bg-muted/25 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring sm:px-5`,children:[N,F]}),t[39]=N,t[40]=F,t[41]=x):x=t[41],h=Oe,v=`motion-reduce:transition-none`,D=`border-t border-border/60 bg-muted/10`;let I;t[42]!==n||t[43]!==r?(I=it(n,r),t[42]=n,t[43]=r,t[44]=I):I=t[44];let ee=n?.allowFileSecretStore??!1,L=!p||o,R;t[45]===c?R=t[46]:(R=e=>c(!!e),t[45]=c,t[46]=R);let te;t[47]!==ee||t[48]!==L||t[49]!==R?(te=(0,$.jsx)(_e,{checked:ee,disabled:L,onCheckedChange:R,"aria-label":`Allow permissioned-file Hub key storage`}),t[47]=ee,t[48]=L,t[49]=R,t[50]=te):te=t[50],t[51]!==I||t[52]!==te?(O=(0,$.jsx)(q,{title:`Protected key fallback`,description:I,status:`Changing this launch setting restarts Ryco. It never moves or exports an existing key.`,control:te}),t[51]=I,t[52]=te,t[53]=O):O=t[53],t[54]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,$.jsx)(q,{title:`Who owns startup`,description:`The desktop app owns Hub launch values for its bundled server and restarts that server to apply them. Exported Hub environment variables do not override this panel.`,status:`The Hub address stays outside ordinary server settings, diagnostics, and support output.`}),t[54]=k):k=t[54],t[55]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(q,{title:`CLI equivalents`,description:`Use these flags for a headless Ryco node. Explicit flags override matching environment variables.`,status:`Use RYCO_HUB_NODE_NAME instead of --hub-node-name when environment configuration is preferable. Boolean flags also support canonical --no-... forms.`,children:(0,$.jsx)(`div`,{className:`pb-3.5 pt-3`,children:(0,$.jsx)(`pre`,{className:`overflow-x-auto rounded-lg border border-border/60 bg-background/70 px-3 py-2.5 font-mono text-[11px] leading-5 text-foreground`,children:(0,$.jsx)(`code`,{children:`ryco serve \\
|
|
2
|
-
--hub-connector-enabled \\
|
|
3
|
-
--hub-origin https://app.ryco.space \\
|
|
4
|
-
--hub-node-name "Build node"
|
|
5
|
-
|
|
6
|
-
# Optional on supported POSIX hosts
|
|
7
|
-
ryco serve --hub-allow-file-secret-store`})})})}),t[55]=_):_=t[55],m=q,w=`Relay diagnostics`,T=`Bounded local counters only. No Hub address, key, ticket, project, path, or payload is exposed here.`;let z;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,$.jsx)(ke,{className:`size-3`}),t[56]=z):z=t[56],t[57]===l?E=t[58]:(E=(0,$.jsxs)(K,{size:`xs`,variant:`outline`,onClick:l,children:[`Open relay guide`,z]}),t[57]=l,t[58]=E),S=`grid grid-cols-2 gap-x-6 gap-y-3 pb-3.5 pt-3 sm:grid-cols-4`,C=e.map(ct),t[3]=p,t[4]=n,t[5]=s,t[6]=r,t[7]=a,t[8]=c,t[9]=l,t[10]=u,t[11]=o,t[12]=i,t[13]=m,t[14]=h,t[15]=g,t[16]=_,t[17]=v,t[18]=y,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T,t[25]=E,t[26]=D,t[27]=O,t[28]=k}else m=t[13],h=t[14],g=t[15],_=t[16],v=t[17],y=t[18],b=t[19],x=t[20],S=t[21],C=t[22],w=t[23],T=t[24],E=t[25],D=t[26],O=t[27],k=t[28];let A;t[59]!==S||t[60]!==C?(A=(0,$.jsx)(`dl`,{className:S,children:C}),t[59]=S,t[60]=C,t[61]=A):A=t[61];let j;t[62]!==m||t[63]!==A||t[64]!==w||t[65]!==T||t[66]!==E?(j=(0,$.jsx)(m,{title:w,description:T,control:E,children:A}),t[62]=m,t[63]=A,t[64]=w,t[65]=T,t[66]=E,t[67]=j):j=t[67];let M;t[68]!==_||t[69]!==j||t[70]!==D||t[71]!==O||t[72]!==k?(M=(0,$.jsxs)(`div`,{className:D,children:[O,k,_,j]}),t[68]=_,t[69]=j,t[70]=D,t[71]=O,t[72]=k,t[73]=M):M=t[73];let N;t[74]!==h||t[75]!==v||t[76]!==M?(N=(0,$.jsx)(h,{className:v,children:M}),t[74]=h,t[75]=v,t[76]=M,t[77]=N):N=t[77];let P;return t[78]!==g||t[79]!==y||t[80]!==b||t[81]!==x||t[82]!==N?(P=(0,$.jsxs)(g,{open:y,onOpenChange:b,children:[x,N]}),t[78]=g,t[79]=y,t[80]=b,t[81]=x,t[82]=N,t[83]=P):P=t[83],P}function ct(e){return(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`dt`,{className:`text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground/65`,children:e.label}),(0,$.jsx)(`dd`,{className:`mt-1 truncate font-mono text-[11px] text-foreground`,children:e.value})]},e.label)}var lt={configuration_invalid:{headline:`Hub configuration is invalid`,detail:`The address this backend started with was rejected. Check it and restart.`,action:`none`},identity_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The system keychain is locked or unavailable. Unlock it, then try again.`,action:`retry`},identity_store_unavailable:{headline:`Can't read this machine's Hub key`,detail:`The keychain was unavailable when Ryco started. Restart Ryco to try again.`,action:`restart`},identity_origin_mismatch:{headline:`Enrolled with a different Hub`,detail:`This machine's key belongs to another Hub. Leave that Hub to enrol here.`,action:`leave`},enrollment_unavailable:{headline:`Enrollment was denied`,detail:`Someone declined this request on the Hub. Check with them before trying again.`,action:`enroll`},enrollment_expired:{headline:`Enrollment expired`,detail:`The request timed out before it was approved.`,action:`enroll`},authentication_failed:{headline:`The Hub rejected this machine's key`,detail:`Check this node's status on the Hub. Leaving lets you enrol again from scratch.`,action:`open-hub`},connection_replaced:{headline:`Another process connected as this machine`,detail:`Two copies of Ryco can't share one Hub identity. Stop the other one, then retry.`,action:`retry`},protocol_invalid:{headline:`The Hub connection kept failing`,detail:`Ryco stopped retrying after repeated protocol errors. Update Ryco and the Hub.`,action:`retry`},network_unavailable:{headline:`Can't reach the Hub`,detail:null,action:`none`},tls_unavailable:{headline:`Can't reach the Hub securely`,detail:null,action:`none`},authentication_timeout:{headline:`The Hub didn't respond`,detail:null,action:`none`},server_draining:{headline:`The Hub is restarting`,detail:null,action:`none`},rate_limited:{headline:`The Hub is rate limiting`,detail:null,action:`none`},heartbeat_timeout:{headline:`The Hub stopped responding`,detail:null,action:`none`},slow_consumer:{headline:`The connection fell behind`,detail:null,action:`none`},internal_error:{headline:`The Hub connection failed`,detail:null,action:`none`}},ut=(e,t)=>{let n=new Date(e).getTime()-t;if(Number.isNaN(n))return null;if(n<=0)return`now`;let r=Math.ceil(n/1e3);return r<60?`${r}s`:`${Math.ceil(r/60)}m`};function dt(e,t,n){switch(e.state){case`disabled`:return t.enrolled===`none`?{dot:`idle`,ping:!1,headline:`Not connected`,detail:null,action:`enable`,secondaryAction:`none`,retrying:!1}:{dot:`idle`,ping:!1,headline:`Turned off`,detail:`This machine stays enrolled.`,action:`enable`,secondaryAction:`leave`,retrying:!1};case`enrolling`:return{dot:`warning`,ping:!1,headline:`Ready to enrol`,detail:`Start enrollment, then approve this machine on your Hub.`,action:`enroll`,secondaryAction:`disable`,retrying:!1};case`awaiting_approval`:return{dot:`warning`,ping:!0,headline:`Waiting for approval on the Hub`,detail:`Compare every field below before approving.`,action:`open-hub`,secondaryAction:`cancel-enrollment`,retrying:!1};case`connecting`:return{dot:`warning`,ping:!0,headline:`Connecting`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`authenticating`:return{dot:`warning`,ping:!0,headline:`Authenticating`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1};case`online`:return{dot:`success`,ping:!0,headline:`Connected`,detail:e.activeChannels===1?`1 active session`:`${e.activeChannels} active sessions`,action:`disable`,secondaryAction:`none`,retrying:!1};case`degraded`:{if(e.degradedMode===`backing_off`){let t=e.nextRetryAt===void 0?null:ut(e.nextRetryAt,n),r=e.reconnectAttempt;return{dot:`warning`,ping:!0,headline:`Reconnecting`,detail:[t===null?null:t===`now`?`Retrying now`:`Next attempt in ${t}`,r===void 0||r===0?null:`attempt ${r}`].filter(e=>e!==null).join(` · `),action:`none`,secondaryAction:`none`,retrying:!0}}let t=lt[e.failure??`internal_error`];return{dot:`destructive`,ping:!1,headline:t.headline,detail:t.detail,action:t.action,secondaryAction:t.action===`leave`?`none`:`leave`,retrying:!1}}case`revoked`:return{dot:`destructive`,ping:!1,headline:`Revoked at the Hub`,detail:`This will not retry. Leaving erases this machine's key so you can enrol again.`,action:`leave`,secondaryAction:`open-hub`,retrying:!1};case`version_incompatible`:return{dot:`destructive`,ping:!1,headline:`Incompatible Hub version`,detail:`This will not retry. Update Ryco, or the Hub, so both speak the same protocol.`,action:`none`,secondaryAction:`none`,retrying:!1};case`stopping`:return{dot:`idle`,ping:!1,headline:`Shutting down`,detail:null,action:`none`,secondaryAction:`none`,retrying:!1}}}function ft(e){return e.enrolled===`none`}var pt=5e3,mt=15e3,ht={enable:`Enable`,disable:`Turn off`,enroll:`Start enrollment`,"cancel-enrollment":`Cancel`,"open-hub":`Open Hub`,retry:`Retry now`,leave:`Leave this Hub`,restart:`Restart Ryco`},gt=1e4;function _t({desktopBridge:e}){let t=He(1e3),n=$e(),[r,a]=(0,X.useState)(null),[s,u]=(0,X.useState)(null),p=(0,X.useRef)(new Map),h=y(e=>e.closeSettings),[_,v]=(0,X.useState)(null),[C,w]=(0,X.useState)(``),[T,E]=(0,X.useState)(null),[D,O]=(0,X.useState)(``),[k,A]=(0,X.useState)(null),[j,M]=(0,X.useState)(null),[P,F]=(0,X.useState)(``),[ee,R]=(0,X.useState)(null),[te,ne]=(0,X.useState)(!1),[ie,oe]=(0,X.useState)(null),[se,B]=(0,X.useState)(null),[V,ce]=(0,X.useState)(null),[le,ue]=(0,X.useState)(!1),[de,fe]=(0,X.useState)(!1),[H,me]=(0,X.useState)(null),[he,ge]=(0,X.useState)(!1),[_e,ve]=(0,X.useState)(null),[ye,U]=(0,X.useState)(!1),[be,xe]=(0,X.useState)(null),[Se,Ce]=(0,X.useState)(!1),[we,Te]=(0,X.useState)(null),[Ee,De]=(0,X.useState)(``),W=(0,X.useRef)(!0),Oe=(0,X.useRef)(null),{copyToClipboard:ke}=Me(),Ae=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;(0,X.useEffect)(()=>(W.current=!0,()=>{W.current=!1}),[]);let je=(0,X.useCallback)(async()=>{try{let[e,t]=await Promise.all([c(),l()]),n=e.state===`awaiting_approval`?await f():null;if(!W.current)return;a({status:e,identity:t,enrollment:n,readAt:Date.now()}),oe(null)}catch(e){if(!W.current)return;oe(e instanceof Error?e.message:`Unable to read Hub status.`)}},[]);(0,X.useEffect)(()=>{let e=x({lifecycle:b,run:je,resolveDelayMs:()=>pt,jitterRatio:.1});return Oe.current=e,()=>{Oe.current===e&&(Oe.current=null),e.stop()}},[je]);let G=(0,X.useCallback)(()=>Oe.current?.refresh()??je(),[je]);(0,X.useEffect)(()=>{e&&e.getHubLaunchConfig().then(e=>{W.current&&(E(e),O(e.origin??``),F(e.nodeName??``),B(null))}).catch(e=>{W.current&&B(e instanceof Error?e.message:`Unable to read Hub launch configuration.`)})},[e]),(0,X.useEffect)(()=>()=>{for(let e of p.current.values())e();p.current.clear()},[]),(0,X.useEffect)(()=>{e?.getHostedIdentityState&&e.getHostedIdentityState().then(e=>{W.current&&(me(e),ve(null))}).catch(()=>{W.current&&(me({status:`unavailable`}),ve(`Unable to read the native account setup state.`))})},[e]);let Ne=(0,X.useCallback)(async t=>{let n=t===`connect`?e?.connectHostedIdentity:e?.disconnectHostedIdentity;if(n){ge(!0),ve(null);try{let e=await n();if(!W.current)return;me(e)}catch{if(!W.current)return;me({status:`unavailable`}),ve(t===`connect`?`Automatic secure setup did not finish. Retry when the Hub is reachable.`:`Unable to clear the native account session.`)}finally{W.current&&ge(!1)}}},[e]),Pe=(0,X.useCallback)(async()=>{if(e?.refreshDesktopWorkspaceCatalog){u(null);try{await e.refreshDesktopWorkspaceCatalog()}catch{u(`Unable to refresh this account's machine directory.`)}}},[e]);(0,X.useEffect)(()=>{H?.status===`ready`&&Pe()},[H?.status,Pe]);let Ie=(0,X.useCallback)(e=>{p.current.has(e)||p.current.set(e,Ze(e))},[]),Le=(0,X.useCallback)(e=>{p.current.get(e)?.(),p.current.delete(e)},[]),Re=(0,X.useCallback)(e=>{Ie(e),S.getState().setActiveEnvironmentId(e),h()},[h,Ie]),ze=(0,X.useCallback)(async()=>{if(e?.verifyDesktopWorkspaceApproval&&_){u(null);try{await e.verifyDesktopWorkspaceApproval({nodeId:_.nodeId,environmentId:g.make(_.environmentId),payload:C.trim()});let t=Qe(g.make(_.environmentId));globalThis.setTimeout(t,gt),await e.cancelDesktopWorkspaceVerification?.(_.handle).catch(()=>void 0),v(null),w(``)}catch{u(`That approval code does not match this Desktop client, machine, account, or current node security state.`)}}},[e,C,_]),Ve=(0,X.useCallback)(async t=>{if(e?.beginDesktopWorkspaceVerification){u(null);try{_&&await e.cancelDesktopWorkspaceVerification?.(_.handle).catch(()=>void 0);let n=await e.beginDesktopWorkspaceVerification({nodeId:t.nodeId,environmentId:g.make(t.environmentId)});v({...t,handle:n.handle}),w(``)}catch{u(`Unable to introduce this Desktop client to that machine. Confirm it is online and retry.`)}}},[e,_]),We=(0,X.useCallback)(async(t,n)=>{let r=t===`connect`?e?.connectHostedGitHub:e?.disconnectHostedGitHub;if(r){U(!0),xe(null);try{let e=await r(n?{totpCode:n}:void 0);if(!W.current)return;me(e.state),e.outcome===`step-up-required`?(Te(t),De(``)):(Te(null),De(``),Ce(!1),e.outcome===`last-primary-credential`?xe(`Add another primary sign-in method before disconnecting GitHub.`):e.outcome===`unavailable`&&xe(`GitHub account access is temporarily unavailable.`))}catch{W.current&&xe(`GitHub account access is temporarily unavailable.`)}finally{W.current&&U(!1)}}},[e]),qe=(0,X.useCallback)(async t=>{ce(t),oe(null);try{switch(t){case`enroll`:await i();break;case`cancel-enrollment`:await m();break;case`retry`:await d();break;case`leave`:await o();break;case`enable`:case`disable`:await e?.setHubLaunchConfig({enabled:t===`enable`});return;case`restart`:if(!e?.restartApp)throw Error(`Desktop restart is unavailable.`);await e.restartApp();return;case`open-hub`:{let e=T?.origin;e&&window.open(e,`_blank`,`noopener,noreferrer`);return}default:return}await G()}catch(e){if(!W.current)return;oe(e instanceof Error?e.message:`That didn't work.`)}finally{W.current&&ce(null)}},[T,e,G]),Je=(0,X.useCallback)(async()=>{if(!e||D.trim()===``){A(null),M(null);return}let t=await e.validateHubOrigin(D);if(W.current){if(t.ok){O(t.origin),A(null),M(null);return}M(t.suggestion??null),A({empty:`Enter a Hub address.`,too_long:`That address is too long.`,not_a_url:`That doesn't look like an address.`,insecure_scheme:`A Hub address must use https.`,has_credentials:`Remove the username and password from the address.`,has_path:`Use the Hub's address only, without a path.`,invalid:`That address can't be used.`}[t.reason])}},[e,D]),Ye=(0,X.useCallback)(async t=>{if(e){ce(`enable`);try{await e.setHubLaunchConfig({origin:t})}catch(e){if(!W.current)return;oe(e instanceof Error?e.message:`Unable to save the Hub address.`),ce(null)}}},[e]),Xe=(0,X.useCallback)(e=>{F(e),R(e.trim().length>100?`Use 100 characters or fewer.`:null)},[]),Y=(0,X.useCallback)(async()=>{if(!e)return;let t=P.trim();if(t.length>100){R(`Use 100 characters or fewer.`);return}ne(!0),R(null);try{await e.setHubLaunchConfig({nodeName:t===``?null:t})}catch(e){if(!W.current)return;R(e instanceof Error?e.message:`Unable to save the Hub node name.`),ne(!1)}},[e,P]),et=(0,X.useCallback)(async t=>{if(e&&await e.confirm(t?`Allow permissioned-file storage when the system credential store is unavailable? Ryco will restart. Existing keys are not moved.`:`Stop allowing permissioned-file Hub key storage? Ryco will restart.`)&&W.current){ue(!0),B(null);try{await e.setHubLaunchConfig({allowFileSecretStore:t})}catch(e){if(!W.current)return;B(e instanceof Error?e.message:`Unable to save the key storage setting.`),ue(!1)}}},[e]),Z=(0,X.useCallback)(async()=>{if(e)try{let t=new URL(nt,window.location.href).toString();if(!await e.openExternal(t))throw Error(`The relay guide could not be opened.`);B(null)}catch(e){if(!W.current)return;B(e instanceof Error?e.message:`Unable to open the relay guide.`)}},[e]);if(!e)return null;let tt=r!==null&&t-r.readAt>mt,Q=r===null?null:dt(r.status,r.identity,t),rt=r!==null&&ft(r.identity),it=D.trim()!==(T?.origin??``),at=P.trim()!==(T?.nodeName??``),ot=T!==null&&T.origin!==null&&e.getHostedIdentityState!==void 0&&e.connectHostedIdentity!==void 0&&r?.identity.enrolled===`none`&&(Q?.action===`enable`||Q?.action===`enroll`),ct=(e,t)=>e===`none`?null:(0,$.jsx)(K,{size:`xs`,variant:t,disabled:V!==null,onClick:()=>{if(e===`leave`){fe(!0);return}qe(e)},children:V===e?`Working…`:ht[e]});return(0,$.jsxs)(Ue,{title:`Hub`,children:[(0,$.jsx)(q,{title:`Connection`,description:ot?`Connect your Ryco account below. Ryco will register this Mac with this Hub automatically.`:Q===null?`Loading…`:Q.detail===null?`Reach this Mac from anywhere, including behind NAT or CGNAT, without opening a port.`:Q.detail,status:(0,$.jsxs)($.Fragment,{children:[Q===null?null:(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${tt?`bg-muted-foreground/40`:Q.dot===`success`?`bg-success`:Q.dot===`warning`?`bg-warning`:Q.dot===`destructive`?`bg-destructive`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),tt?`${Q.headline} · last checked ${Math.round((t-r.readAt)/1e3)}s ago`:ot?`Ready for account setup`:Q.headline]}),ie?(0,$.jsx)(`span`,{className:`block text-destructive`,children:ie}):null]}),control:Q===null?null:(0,$.jsxs)($.Fragment,{children:[ct(ot?`none`:Q.action,Q.action===`leave`?`destructive-outline`:`outline`),ct(ot?`none`:Q.secondaryAction,Q.secondaryAction===`leave`?`destructive-outline`:`outline`)]}),children:(0,$.jsx)(Ke,{children:r?.enrollment?(0,$.jsxs)(`div`,{className:`pb-3.5`,children:[(0,$.jsx)(`p`,{className:`pb-2 text-xs text-muted-foreground/80`,children:`Compare every field with the Hub's approval screen before approving.`}),(0,$.jsxs)(Ge,{className:`rounded-xl border border-border/60 bg-muted/20 p-3`,children:[(0,$.jsx)(J,{term:`Label`,children:r.enrollment.label}),(0,$.jsx)(J,{term:`Platform`,children:`${r.enrollment.platformOs} · ${r.enrollment.platformArch}`}),(0,$.jsx)(J,{term:`Version`,mono:!0,children:r.enrollment.clientVersion}),(0,$.jsx)(J,{term:`Algorithm`,children:r.enrollment.algorithm}),(0,$.jsx)(J,{term:`Fingerprint`,mono:!0,children:r.enrollment.fingerprint}),(0,$.jsx)(J,{term:`Expires`,children:new Date(r.enrollment.expiresAt).toLocaleString()}),(0,$.jsx)(J,{term:`Device code`,mono:!0,action:Ae?(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:()=>ke(r.enrollment.deviceCode),children:`Copy`}):null,children:r.enrollment.deviceCode})]}),(0,$.jsx)(`p`,{className:`pt-2 text-[11px] text-muted-foreground/70`,children:`The device code only routes the request. It does not prove which machine you are approving.`}),(0,$.jsxs)(`p`,{className:`flex items-center gap-1.5 pt-2 text-xs text-warning`,children:[(0,$.jsx)(Fe,{className:`size-3.5 shrink-0`}),`If the fingerprint on the Hub differs by even one character, deny it there and cancel here.`]})]}):null})}),T!==null&&T.origin!==null&&e.getHostedIdentityState!==void 0?(0,$.jsx)(q,{title:`Ryco account`,description:H===null?`Checking this Mac's native account setup…`:ot&&H.status===`ready`?`You are signed in. Finish setup to register this Mac with the Hub and verify local trust automatically.`:H.status===`ready`?`Your native account session and this Mac's automatic node claim are ready. Local trust introduction is verified.`:H.status===`signed-out`?`Sign in in your browser. Ryco will claim this Mac's node and verify its local trust automatically.`:`Automatic secure setup did not finish. Existing node and trust state are preserved while you retry.`,status:(0,$.jsxs)($.Fragment,{children:[H===null?null:(0,$.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`inline-block size-2 shrink-0 rounded-full ${ot&&H.status===`ready`?`bg-warning`:H.status===`ready`?`bg-success`:H.status===`unavailable`?`bg-warning`:`bg-muted-foreground/40`}`,"aria-hidden":!0}),H.status===`ready`?ot?`Signed in · Node setup needed`:`Secure setup complete`:H.status===`unavailable`?`Setup needs attention`:`Not signed in`]}),_e?(0,$.jsx)(`span`,{className:`block text-destructive`,children:_e}):null]}),control:H===null?null:ot&&H.status===`ready`?(0,$.jsx)(K,{size:`xs`,disabled:he||!e.connectHostedIdentity,onClick:()=>void Ne(`connect`),children:he?`Finishing setup…`:`Finish setup`}):H.status===`ready`?(0,$.jsx)(K,{size:`xs`,variant:`outline`,disabled:he||!e.disconnectHostedIdentity,onClick:()=>void Ne(`disconnect`),children:he?`Working…`:`Sign out`}):(0,$.jsx)(K,{size:`xs`,variant:`outline`,disabled:he||!e.connectHostedIdentity,onClick:()=>void Ne(`connect`),children:he?`Opening browser…`:H.status===`unavailable`?`Retry secure setup`:`Connect account`})}):null,H?.status===`ready`&&e?.getDesktopWorkspaceState?(0,$.jsxs)(q,{title:`Workspace machines`,description:`Connect, open, and manage each machine independently. Cached lists remain read-only until connected.`,status:s??`${n.machines.filter(e=>e.online).length} online · ${n.activeConnectionCount} connected`,control:(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:()=>void Pe(),children:`Refresh`}),children:[(0,$.jsx)(Ge,{children:n.machines.map(e=>(0,$.jsx)(J,{term:e.label,action:(0,$.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-1.5`,children:[e.nodeId&&e.online&&(e.nativeTrust===`unverified`||e.nativeTrust===`unknown`||e.nativeTrust===`account-trusted`)?(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:()=>{Ve({nodeId:e.nodeId,environmentId:e.environmentId})},children:e.nativeTrust===`account-trusted`?`Verify independently`:`Verify`}):null,(e.nativeTrust===`verified`||e.nativeTrust===`account-trusted`)&&e.online?e.connectionState===`connected`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:()=>Re(e.environmentId),children:`Open`}),(0,$.jsx)(K,{size:`xs`,variant:`ghost`,onClick:()=>Le(e.environmentId),children:`Disconnect`})]}):(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:()=>Ie(e.environmentId),children:`Connect`}):null]}),children:e.nativeTrust===`verified`?e.online?`Encrypted · Verified locally · ${e.connectionState===`connected`?`Connected`:`Online`}`:`Encrypted · Verified locally · Offline`:e.nativeTrust===`account-trusted`?e.online?`Encrypted · Account trusted · ${e.connectionState===`connected`?`Connected`:`Online`}`:`Encrypted · Account trusted · Offline`:e.nativeTrust===`identity-conflict`?`Identity changed · Locked`:e.online?`Needs verification`:`Needs verification · Offline`},`${e.nodeId??`unknown`}:${e.environmentId}`))}),_?(0,$.jsxs)(`div`,{className:`mt-3 flex flex-col gap-2 border-t border-border/60 py-3 sm:flex-row`,children:[(0,$.jsx)(Be,{value:C,onChange:e=>w(e.target.value),placeholder:`Paste the approval code shown by this exact node`,"aria-label":`Machine approval code`}),(0,$.jsx)(K,{size:`sm`,disabled:C.trim().length===0,onClick:()=>void ze(),children:`Verify`}),(0,$.jsx)(K,{size:`sm`,variant:`ghost`,onClick:()=>{e.cancelDesktopWorkspaceVerification?.(_.handle).catch(()=>void 0),v(null),w(``)},children:`Cancel`})]}):null]}):null,H?.status===`ready`&&H.github!==void 0?(0,$.jsx)(q,{title:H.github.identity?`GitHub · @${H.github.identity.login}`:`GitHub`,description:H.github.identity?`Use this GitHub identity to sign in to Ryco. Repository access remains separate.`:`Connect GitHub as another way to sign in. Ryco requests no repository access.`,status:be?(0,$.jsx)(`span`,{className:`block text-destructive`,children:be}):H.github.identity?.displayName?H.github.identity.displayName:null,control:H.github.linkAvailable?H.github.identity?(0,$.jsx)(K,{size:`xs`,variant:`outline`,disabled:ye||!e?.disconnectHostedGitHub,onClick:()=>Ce(!0),children:ye?`Working…`:`Disconnect`}):(0,$.jsx)(K,{size:`xs`,variant:`outline`,disabled:ye||!e?.connectHostedGitHub,onClick:()=>void We(`connect`),children:ye?`Opening browser…`:`Connect GitHub`}):null}):null,(0,$.jsx)(q,{title:`Hub address`,description:rt?`The address of the Hub you or your team operate.`:`Locked while this machine is enrolled. Leave this Hub to change it.`,status:k?(0,$.jsxs)(`span`,{className:`block text-destructive`,children:[k,j?(0,$.jsxs)(`button`,{type:`button`,className:`ml-1 underline underline-offset-2`,onClick:()=>{O(j),A(null),M(null)},children:[`Use `,j]}):null]}):null,control:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Be,{value:D,disabled:!rt||V!==null,placeholder:`https://…`,className:`w-64 font-mono text-xs`,onChange:e=>O(e.currentTarget.value),onBlur:()=>void Je()}),rt&&it&&k===null&&D.trim()!==``?(0,$.jsx)(K,{size:`xs`,variant:`outline`,disabled:V!==null,onClick:()=>void Ye(D.trim()),children:`Save and restart`}):null]})}),(0,$.jsx)(q,{title:`Node name`,description:rt?`Choose the name proposed on the Hub approval screen. Leave it blank for a stable automatic name.`:r?.identity.enrolled===`pending`?`Locked while enrollment is pending. Cancel enrollment to change the proposed name.`:`Managed on the Hub after enrollment. An owner can rename this node from its Hub details.`,status:ee?(0,$.jsx)(`span`,{className:`block text-destructive`,children:ee}):null,control:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Be,{value:P,disabled:!rt||V!==null||te,placeholder:`Automatic: machine name · node code`,"aria-label":`Hub node name`,className:`w-64 text-xs`,onChange:e=>Xe(e.currentTarget.value)}),rt&&at&&ee===null?(0,$.jsx)(K,{size:`xs`,variant:`outline`,disabled:V!==null||te,onClick:()=>void Y(),children:te?`Saving…`:`Save and restart`}):null]})}),r!==null&&r.status.state===`online`?(0,$.jsx)(q,{title:`Who can connect`,description:`Managed on the Hub, not here. Sessions arriving through the Hub carry a role: viewer reads, operator edits files and runs terminals, owner also changes credentials and server policy.`}):null,(0,$.jsx)(st,{config:T,identity:r?.identity??null,status:r?.status??null,nowMs:t,savingFileFallback:le||V!==null,configError:se,onFileFallbackChange:e=>void et(e),onOpenGuide:()=>void Z()}),(0,$.jsx)(N,{open:de,onOpenChange:fe,children:(0,$.jsxs)(I,{children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(L,{children:`Leave this Hub?`}),(0,$.jsxs)(z,{children:[`This erases this machine's Hub key. You can enrol again afterwards, but it will join as a new machine and needs a new approval.`,(0,$.jsx)(`br`,{}),(0,$.jsx)(`br`,{}),`It does `,(0,$.jsx)(`strong`,{children:`not`}),` revoke anything on the Hub. The old entry stays there until an owner removes it.`]})]}),(0,$.jsxs)(re,{children:[(0,$.jsx)(pe,{children:`Keep it`}),(0,$.jsx)(K,{variant:`destructive`,disabled:V!==null,onClick:()=>{fe(!1),qe(`leave`)},children:`Erase this machine's key`})]})]})}),(0,$.jsx)(N,{open:Se,onOpenChange:Ce,children:(0,$.jsxs)(I,{children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(L,{children:`Disconnect GitHub?`}),(0,$.jsx)(z,{children:`GitHub stops working as a Ryco sign-in method. Ryco refuses this change when it is your only primary sign-in method. Repository access is separate.`})]}),(0,$.jsxs)(re,{children:[(0,$.jsx)(pe,{children:`Cancel`}),(0,$.jsx)(K,{variant:`destructive`,disabled:ye,onClick:()=>void We(`disconnect`),children:`Disconnect GitHub`})]})]})}),(0,$.jsx)(N,{open:we!==null,onOpenChange:t=>{!t&&!ye&&(we===`connect`&&e?.cancelHostedGitHubConnection?.(),Te(null),De(``))},children:(0,$.jsxs)(I,{children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(L,{children:`Confirm this account change`}),(0,$.jsx)(z,{children:`Enter a current code from your authenticator app. The pending GitHub authorization is reused; Ryco does not reopen the browser.`})]}),(0,$.jsx)(Be,{"aria-label":`Authenticator code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:16,value:Ee,onChange:e=>De(e.currentTarget.value.replace(/\D/gu,``))}),(0,$.jsxs)(re,{children:[(0,$.jsx)(pe,{children:`Cancel`}),(0,$.jsx)(K,{disabled:ye||Ee.length<6,onClick:()=>{we!==null&&We(we,Ee)},children:`Confirm`})]})]})})]})}var vt=443,yt=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`});function bt(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:yt.format(t)}function xt(e){let t=(0,Z.c)(21),{tooltipText:n,dotClassName:r,pingClassName:i}=e,a;t[0]===i?a=t[1]:(a=i?(0,$.jsx)(`span`,{className:Ie(`absolute inline-flex h-full w-full animate-status-ping rounded-full`,i)}):null,t[0]=i,t[1]=a);let o;t[2]===r?o=t[3]:(o=Ie(`relative inline-flex size-2 rounded-full`,r),t[2]=r,t[3]=o);let s;t[4]===o?s=t[5]:(s=(0,$.jsx)(`span`,{className:o}),t[4]=o,t[5]=s);let c;t[6]!==a||t[7]!==s?(c=(0,$.jsxs)($.Fragment,{children:[a,s]}),t[6]=a,t[7]=s,t[8]=c):c=t[8];let l=c;if(!n){let e;return t[9]===l?e=t[10]:(e=(0,$.jsx)(`span`,{className:`relative flex size-3 shrink-0 items-center justify-center`,children:l}),t[9]=l,t[10]=e),e}let u;t[11]!==l||t[12]!==n?(u=(0,$.jsx)(`button`,{type:`button`,title:n,"aria-label":n,className:`relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden`,children:l}),t[11]=l,t[12]=n,t[13]=u):u=t[13];let d=u,f;t[14]===d?f=t[15]:(f=(0,$.jsx)(Le,{render:d}),t[14]=d,t[15]=f);let p;t[16]===n?p=t[17]:(p=(0,$.jsx)(Re,{side:`top`,className:`max-w-80 whitespace-pre-wrap leading-tight`,children:n}),t[16]=n,t[17]=p);let m;return t[18]!==f||t[19]!==p?(m=(0,$.jsxs)(ze,{children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function St(e,t,n){let r=e?.connectionState??`disconnected`;if(r===`connected`){let r=e?.connectedAt??t.lastConnectedAt;return r?`Connected for ${U(r,n)}`:null}return r===`connecting`?null:r===`error`?e?.lastError??`An unknown connection error occurred.`:t.lastConnectedAt?`Last connected at ${bt(t.lastConnectedAt)}`:`Not connected yet.`}function Ct(e){let t=e.username?`${e.username}@${e.hostname}`:e.hostname;return e.port?`${t}:${e.port}`:t}function wt(e){let t=e.host.trim();if(t.length===0)throw Error(`SSH host or alias is required.`);let n=t,r=e.username.trim()||null,i=null,a=n.lastIndexOf(`@`);if(a>0){let e=n.slice(0,a).trim();n=n.slice(a+1).trim(),!r&&e.length>0&&(r=e)}let o=/^\[([^\]]+)\](?::(\d+))?$/u.exec(n);if(o)n=o[1].trim(),o[2]&&(i=Number.parseInt(o[2],10));else{let e=n.split(`:`);e.length===2&&/^\d+$/u.test(e[1]??``)&&(n=e[0].trim(),i=Number.parseInt(e[1],10))}let s=e.port.trim();if(s.length>0&&(i=Number.parseInt(s,10)),n.length===0)throw Error(`SSH host or alias is required.`);if(i!==null&&(!Number.isInteger(i)||i<=0||i>65535))throw Error(`SSH port must be between 1 and 65535.`);return{alias:n,hostname:n,username:r,port:i}}function Tt(e){let t=e.trim();if(!t)return null;try{let e=/^[a-zA-Z][a-zA-Z\d+.-]*:\/\//u.test(t)||t.startsWith(`//`)?t:`https://${t}`,n=new URL(e,window.location.origin),r=we(n);if(r)return{host:r.host,pairingCode:r.token};let i=Ce(n);return i?{host:n.origin,pairingCode:i}:null}catch{return null}}function Et(e){let t=Tt(e.host);if(t)return t;let n=e.host.trim(),r=e.pairingCode.trim();if(!n)throw Error(`Enter a backend host.`);if(!r)throw Error(`Enter a pairing code.`);return{host:n,pairingCode:r}}function Dt(e){let t=`Failed to connect SSH host.`;return(e instanceof Error?e.message:t).replace(/^Error invoking remote method 'desktop:ensure-ssh-environment':\s*/u,``).replace(/^Ssh[A-Za-z]+Error:\s*/u,``).trim()||t}var Ot=`border-t border-border/60 px-4 py-4 first:border-t-0 sm:px-5`,kt=`border-t border-border/60 px-4 py-2.5 first:border-t-0 sm:px-5`,At=`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`;function jt(e){return Ot}function Mt(e,t){return e===`endpoint-rail`?Ie(`relative border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,!t&&`bg-muted/20`):Ie(kt,!t&&`bg-muted/24`)}function Nt(e){return[...e].toSorted((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime())}function Pt(e){return[...e].toSorted((e,t)=>e.current===t.current?e.connected===t.connected?new Date(t.issuedAt).getTime()-new Date(e.issuedAt).getTime():e.connected?-1:1:e.current?-1:1)}function Ft(e){return{...e,createdAt:h(e.createdAt),expiresAt:h(e.expiresAt)}}function It(e){return{...e,issuedAt:h(e.issuedAt),expiresAt:h(e.expiresAt),lastConnectedAt:e.lastConnectedAt===null?null:h(e.lastConnectedAt)}}function Lt(e,t){let n=e.findIndex(e=>e.id===t.id);if(n===-1)return Nt([...e,t]);let r=[...e];return r[n]=t,Nt(r)}function Rt(e,t){return e.filter(e=>e.id!==t)}function zt(e,t){let n=e.findIndex(e=>e.sessionId===t.sessionId);if(n===-1)return Pt([...e,t]);let r=[...e];return r[n]=t,Pt(r)}function Bt(e,t){return e.filter(e=>e.sessionId!==t)}function Vt(e,t){let n=e.filter(e=>e.status!==`unavailable`);if(t){let e=n.find(e=>Ut(e)===t);if(e)return e}return n.find(e=>e.isDefault)??n.find(e=>e.reachability!==`loopback`)??n.find(e=>e.compatibility.hostedHttpsApp===`compatible`)??null}function Ht(e){return e.id.startsWith(`tailscale-magicdns:`)}function Ut(e){if(e.id.startsWith(`desktop-loopback:`)||e.id.startsWith(`server-loopback:`))return`desktop-core:loopback:http`;if(e.id.startsWith(`desktop-lan:`)||e.id.startsWith(`server-network:`))return`desktop-core:lan:http`;if(e.id.startsWith(`tailscale-ip:`))return`tailscale:ip:http`;if(Ht(e))return`tailscale:magicdns:https`;let t=`unknown`;try{t=new URL(e.httpBaseUrl).protocol.replace(/:$/u,``)}catch{}return`${e.provider.id}:${e.reachability}:${t}:${e.label}`}function Wt(e){switch(e){case`mixed-content-blocked`:return`Hosted app blocked`;case`requires-configuration`:return`Setup required for hosted app`;default:return null}}function Gt(e){switch(e){case`mixed-content-blocked`:return`The hosted HTTPS app cannot connect to HTTP endpoints because browsers block mixed content.`;case`requires-configuration`:return`Configure HTTPS access before using this endpoint from the hosted app.`;default:return null}}function Kt(e,t){return e.compatibility.hostedHttpsApp===`compatible`?Q(e.httpBaseUrl,t)??tt(e.httpBaseUrl,t):tt(e.httpBaseUrl,t)}function qt(e){let t=new URL(`/pair`,window.location.href);return Se(t,e).toString()}function Jt(e){try{let t=new URL(e);return t.pathname===`/pair`&&t.searchParams.has(`host`)}catch{return!1}}var Yt=(0,X.memo)(function(e){let t=(0,Z.c)(146),{pairingLink:n,endpointUrl:r,endpoints:i,defaultEndpointKey:a,presentation:o,revokingPairingLinkId:c,onRevoke:l}=e,u=o===void 0?`current`:o,d=He(1e3),f;t[0]===n.expiresAt?f=t[1]:(f=new Date(n.expiresAt).getTime(),t[0]=n.expiresAt,t[1]=f);let p=f,[m,h]=(0,X.useState)(!1),g;t[2]===n.credential?g=t[3]:(g=qt(n.credential),t[2]=n.credential,t[3]=g);let _=g,v;t[4]!==r||t[5]!==n.credential?(v=r!=null&&r!==``?Q(r,n.credential):null,t[4]=r,t[5]=n.credential,t[6]=v):v=t[6];let y=v,b;if(t[7]!==a||t[8]!==i||t[9]!==n.credential){let e=Vt(i,a);b=e?Kt(e,n.credential):null,t[7]=a,t[8]=i,t[9]=n.credential,t[10]=b}else b=t[10];let x=b,S;if(t[11]!==i||t[12]!==n.credential){let e;t[14]===n.credential?e=t[15]:(e=e=>{let t=Kt(e,n.credential);return{key:Ut(e),label:e.label,url:t,detail:Jt(t)?`Hosted app link`:`Backend pairing URL`}},t[14]=n.credential,t[15]=e),S=i.filter(on).map(e),t[11]=i,t[12]=n.credential,t[13]=S}else S=t[13];let C=S,w;t[16]!==_||t[17]!==x||t[18]!==r||t[19]!==y||t[20]!==n.credential?(w=x??(r!=null&&r!==``?y??tt(r,n.credential):s(window.location.hostname)?null:_),t[16]=_,t[17]=x,t[18]=r,t[19]=y,t[20]=n.credential,t[21]=w):w=t[21];let T=w,E=T??n.credential,D=T!==null&&Jt(T),O=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null,k;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(k={onCopy:sn,onError:(e,t)=>{h(!0),G.add(je({type:`error`,title:O?t===`hosted-link`?`Could not copy hosted app link`:t===`link`?`Could not copy pairing URL`:`Could not copy pairing code`:`Clipboard copy unavailable`,description:O?e.message:`Showing the full value instead.`}))}},t[22]=k):k=t[22];let{copyToClipboard:A}=Me(k),j;t[23]===A?j=t[24]:(j=(e,t)=>{A(e,t)},t[23]=A,t[24]=j);let M=j,N=cn,P;t[25]!==M||t[26]!==n.credential?(P=()=>{M(n.credential,`code`)},t[25]=M,t[26]=n.credential,t[27]=P):P=t[27];let I=P,L;t[28]!==M||t[29]!==T?(L=()=>{T&&M(T,N(T))},t[28]=M,t[29]=T,t[30]=L):L=t[30];let z=L,re;t[31]===n.expiresAt?re=t[32]:(re=bt(n.expiresAt),t[31]=n.expiresAt,t[32]=re);let ae=re,V=n.role===`owner`?`Owner`:`Client`,le=n.label??`${V} link`,pe;t[33]!==a||t[34]!==C?(pe=C.find(e=>e.key===a)??C[0]??null,t[33]=a,t[34]=C,t[35]=pe):pe=t[35];let _e=pe?.label??`URL`,U,xe,Se,Ce,we,Te,Ee,De,W;if(t[36]!==M||t[37]!==_e||t[38]!==C||t[39]!==ae||t[40]!==p||t[41]!==I||t[42]!==z||t[43]!==m||t[44]!==d||t[45]!==n.createdAt||t[46]!==n.expiresAt||t[47]!==u||t[48]!==le||t[49]!==V||t[50]!==T){W=Symbol.for(`react.early_return_sentinel`);bb0:{let e=C.filter(ln),r=C.filter(un),i;t[60]!==M||t[61]!==C?(i=(e,t)=>{let n=e===void 0?C:e,r=t===void 0||t;return n.map(e=>(0,$.jsx)(ye,{onClick:()=>M(e.url,N(e.url)),children:(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate`,children:e.label}),r?(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:e.detail}):null]})},e.key))},t[60]=M,t[61]=C,t[62]=i):i=t[62];let a=i,o;t[63]===I?o=t[64]:(o=e=>(0,$.jsx)(ye,{onClick:I,children:(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`block truncate`,children:`Copy code`}),e===void 0||e?(0,$.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:`Token only`}):null]})}),t[63]=I,t[64]=o);let s=o,c;t[65]===a?c=t[66]:(c=(e,t,n)=>t.length>0?(0,$.jsxs)($.Fragment,{children:[n?(0,$.jsx)(se,{}):null,(0,$.jsxs)(de,{children:[(0,$.jsx)(ce,{children:e}),a(t,!1)]})]}):null,t[65]=a,t[66]=c);let l=c,f=t=>(0,$.jsxs)($.Fragment,{children:[t?.codeFirst?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(de,{children:[(0,$.jsx)(ce,{children:`Pairing code`}),s(!1)]}),C.length>0?(0,$.jsx)(se,{}):null]}):null,l(`Pairing URLs`,e,!1),l(`Hosted app link`,r,e.length>0),t?.codeFirst?null:(0,$.jsxs)($.Fragment,{children:[C.length>0?(0,$.jsx)(se,{}):null,(0,$.jsxs)(de,{children:[(0,$.jsx)(ce,{children:`Pairing code`}),s(!1)]})]})]});if(p<=d){W=null;break bb0}t[67]===u?De=t[68]:(De=jt(u),t[67]=u,t[68]=De),Te=At;let g;t[69]===n.createdAt?g=t[70]:(g=bt(n.createdAt),t[69]=n.createdAt,t[70]=g);let _=`Link created at ${g}`,v;t[71]===_?v=t[72]:(v=(0,$.jsx)(xt,{tooltipText:_,dotClassName:`bg-amber-400`}),t[71]=_,t[72]=v);let y;t[73]===le?y=t[74]:(y=(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:le}),t[73]=le,t[74]=y);let b;t[75]===T?b=t[76]:(b=T?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ue,{openOnHover:!0,delay:250,closeDelay:100,render:(0,$.jsx)(`button`,{type:`button`,className:`inline-flex size-4 shrink-0 items-center justify-center rounded-sm text-muted-foreground/50 outline-none hover:text-foreground`,"aria-label":`Show QR code`}),children:(0,$.jsx)(Ne,{"aria-hidden":!0,className:`size-3`})}),(0,$.jsx)(ve,{side:`top`,align:`start`,tooltipStyle:!0,className:`w-max`,children:(0,$.jsx)(Ye,{value:T,size:88,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})})]}):null,t[75]=T,t[76]=b);let x;t[77]===b?x=t[78]:(x=(0,$.jsx)(he,{children:b}),t[77]=b,t[78]=x);let S;t[79]!==v||t[80]!==y||t[81]!==x?(S=(0,$.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[v,y,x]}),t[79]=v,t[80]=y,t[81]=x,t[82]=S):S=t[82];let w;t[83]!==d||t[84]!==n.expiresAt?(w=B(n.expiresAt,d),t[83]=d,t[84]=n.expiresAt,t[85]=w):w=t[85];let E;t[86]!==V||t[87]!==w?(E=[V,w],t[86]=V,t[87]=w,t[88]=E):E=t[88];let D=E.join(` · `),k;t[89]!==ae||t[90]!==D?(k=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,title:ae,children:D}),t[89]=ae,t[90]=D,t[91]=k):k=t[91];let A;t[92]===T?A=t[93]:(A=T===null?(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground/70`,children:`Copy the token and pair from another client using this backend's reachable host.`}):null,t[92]=T,t[93]=A),t[94]!==S||t[95]!==k||t[96]!==A?(Ee=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[S,k,A]}),t[94]=S,t[95]=k,t[96]=A,t[97]=Ee):Ee=t[97],we=`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,U=me,xe=m,Se=h,Ce=O?(0,$.jsx)($.Fragment,{children:T?(0,$.jsxs)(Je,{"aria-label":`Copy selected endpoint`,children:[(0,$.jsx)(K,{size:`xs`,variant:`outline`,className:`max-w-56`,title:`Copy pairing URL for: ${_e}`,onClick:z,children:(0,$.jsxs)(`span`,{className:`truncate`,children:[`Copy pairing URL for: `,_e]})}),(0,$.jsx)(qe,{}),(0,$.jsxs)(fe,{children:[(0,$.jsx)(F,{render:(0,$.jsx)(K,{size:`icon-xs`,variant:`outline`,"aria-label":`Choose endpoint to copy`}),children:(0,$.jsx)(Ae,{className:`size-3.5`})}),(0,$.jsx)(be,{align:`end`,className:`min-w-60`,children:f()})]})]}):(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:I,children:`Copy code`})}):(0,$.jsx)(te,{render:(0,$.jsx)(K,{size:`xs`,variant:`outline`}),children:T?`Show link`:`Show code`})}t[36]=M,t[37]=_e,t[38]=C,t[39]=ae,t[40]=p,t[41]=I,t[42]=z,t[43]=m,t[44]=d,t[45]=n.createdAt,t[46]=n.expiresAt,t[47]=u,t[48]=le,t[49]=V,t[50]=T,t[51]=U,t[52]=xe,t[53]=Se,t[54]=Ce,t[55]=we,t[56]=Te,t[57]=Ee,t[58]=De,t[59]=W}else U=t[51],xe=t[52],Se=t[53],Ce=t[54],we=t[55],Te=t[56],Ee=t[57],De=t[58],W=t[59];if(W!==Symbol.for(`react.early_return_sentinel`))return W;let Oe=T?D?`Hosted app pairing link`:`Pairing link`:`Pairing code`,ke;t[98]===Oe?ke=t[99]:(ke=(0,$.jsx)(R,{children:Oe}),t[98]=Oe,t[99]=ke);let Pe=T?D?`Clipboard copy is unavailable here. Open or manually copy this hosted app link on the device you want to connect.`:`Clipboard copy is unavailable here. Open or manually copy this full pairing URL on the device you want to connect.`:`Clipboard copy is unavailable here. Manually copy this code into another client.`,Fe;t[100]===Pe?Fe=t[101]:(Fe=(0,$.jsx)(H,{children:Pe}),t[100]=Pe,t[101]=Fe);let Ie;t[102]!==ke||t[103]!==Fe?(Ie=(0,$.jsxs)(ie,{children:[ke,Fe]}),t[102]=ke,t[103]=Fe,t[104]=Ie):Ie=t[104];let Le=T?4:3,Re;t[105]!==E||t[106]!==Le?(Re=(0,$.jsx)(ge,{readOnly:!0,value:E,rows:Le,className:`text-xs leading-relaxed`,onFocus:dn,onClick:fn}),t[105]=E,t[106]=Le,t[107]=Re):Re=t[107];let ze;t[108]===T?ze=t[109]:(ze=T?(0,$.jsx)(`div`,{className:`flex justify-center rounded-xl border border-border/60 bg-muted/30 p-4`,children:(0,$.jsx)(Ye,{value:T,size:132,level:`M`,marginSize:2,title:`Pairing link — scan to open on another device`})}):null,t[108]=T,t[109]=ze);let Be;t[110]!==Re||t[111]!==ze?(Be=(0,$.jsxs)(oe,{className:`space-y-4`,children:[Re,ze]}),t[110]=Re,t[111]=ze,t[112]=Be):Be=t[112];let Ve;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,$.jsx)(K,{variant:`outline`,onClick:()=>h(!1),children:`Done`}),t[113]=Ve):Ve=t[113];let Ue;t[114]===I?Ue=t[115]:(Ue=O?(0,$.jsx)(K,{variant:`outline`,size:`xs`,onClick:I,children:`Copy code`}):null,t[114]=I,t[115]=Ue);let We;t[116]===Ue?We=t[117]:(We=(0,$.jsxs)(ne,{variant:`bare`,children:[Ve,Ue]}),t[116]=Ue,t[117]=We);let q;t[118]!==Ie||t[119]!==Be||t[120]!==We?(q=(0,$.jsxs)(ee,{className:`max-w-md`,children:[Ie,Be,We]}),t[118]=Ie,t[119]=Be,t[120]=We,t[121]=q):q=t[121];let J;t[122]!==U||t[123]!==xe||t[124]!==Se||t[125]!==Ce||t[126]!==q?(J=(0,$.jsxs)(U,{open:xe,onOpenChange:Se,children:[Ce,q]}),t[122]=U,t[123]=xe,t[124]=Se,t[125]=Ce,t[126]=q,t[127]=J):J=t[127];let Ge=c===n.id,Ke;t[128]!==l||t[129]!==n.id?(Ke=()=>void l(n.id),t[128]=l,t[129]=n.id,t[130]=Ke):Ke=t[130];let Xe=c===n.id?`Revoking…`:`Revoke`,Ze;t[131]!==Ge||t[132]!==Ke||t[133]!==Xe?(Ze=(0,$.jsx)(K,{size:`xs`,variant:`destructive-outline`,disabled:Ge,onClick:Ke,children:Xe}),t[131]=Ge,t[132]=Ke,t[133]=Xe,t[134]=Ze):Ze=t[134];let Qe;t[135]!==we||t[136]!==J||t[137]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:we,children:[J,Ze]}),t[135]=we,t[136]=J,t[137]=Ze,t[138]=Qe):Qe=t[138];let $e;t[139]!==Te||t[140]!==Ee||t[141]!==Qe?($e=(0,$.jsxs)(`div`,{className:Te,children:[Ee,Qe]}),t[139]=Te,t[140]=Ee,t[141]=Qe,t[142]=$e):$e=t[142];let Y;return t[143]!==De||t[144]!==$e?(Y=(0,$.jsx)(`div`,{className:De,children:$e}),t[143]=De,t[144]=$e,t[145]=Y):Y=t[145],Y}),Xt=(0,X.memo)(function(e){let t=(0,Z.c)(50),{clientSession:n,presentation:r,revokingClientSessionId:i,onRevokeSession:a}=e,o=r===void 0?`current`:r,s=He(1e3),c=n.current||n.connected,l=n.lastConnectedAt,u;t[0]!==c||t[1]!==l||t[2]!==s?(u=c?l?`Connected for ${U(l,s)}`:`Connected`:l?`Last connected at ${bt(l)}`:`Not connected yet.`,t[0]=c,t[1]=l,t[2]=s,t[3]=u):u=t[3];let d=u,f=n.role===`owner`?`Owner`:`Client`,p;t[4]===n.client.deviceType?p=t[5]:(p=n.client.deviceType===`unknown`?null:n.client.deviceType[0]?.toUpperCase()+n.client.deviceType.slice(1),t[4]=n.client.deviceType,t[5]=p);let m=n.client.os??null,h=n.client.browser??null,g=n.client.ipAddress??null,_;t[6]!==p||t[7]!==m||t[8]!==h||t[9]!==g?(_=[p,m,h,g].filter(pn),t[6]=p,t[7]=m,t[8]=h,t[9]=g,t[10]=_):_=t[10];let v=_,y;t[11]!==n.client.browser||t[12]!==n.client.label||t[13]!==n.client.os||t[14]!==n.subject?(y=n.client.label??([n.client.os,n.client.browser].filter(Boolean).join(` · `)||n.subject),t[11]=n.client.browser,t[12]=n.client.label,t[13]=n.client.os,t[14]=n.subject,t[15]=y):y=t[15];let b=y,x;t[16]===o?x=t[17]:(x=jt(o),t[16]=o,t[17]=x);let S=c?`bg-success`:`bg-muted-foreground/30`,C;t[18]!==d||t[19]!==S?(C=(0,$.jsx)(xt,{tooltipText:d,dotClassName:S,pingClassName:null}),t[18]=d,t[19]=S,t[20]=C):C=t[20];let w;t[21]===b?w=t[22]:(w=(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:b}),t[21]=b,t[22]=w);let T;t[23]===n.current?T=t[24]:(T=n.current?(0,$.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 rounded-md border border-border/50 bg-muted/50 px-1 py-0.5`,children:`This device`}):null,t[23]=n.current,t[24]=T);let E;t[25]!==C||t[26]!==w||t[27]!==T?(E=(0,$.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[C,w,T]}),t[25]=C,t[26]=w,t[27]=T,t[28]=E):E=t[28];let D;t[29]!==v||t[30]!==f?(D=[f,...v],t[29]=v,t[30]=f,t[31]=D):D=t[31];let O=D.join(` · `),k;t[32]===O?k=t[33]:(k=(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:O}),t[32]=O,t[33]=k);let A;t[34]!==E||t[35]!==k?(A=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[E,k]}),t[34]=E,t[35]=k,t[36]=A):A=t[36];let j;t[37]!==n.current||t[38]!==n.sessionId||t[39]!==a||t[40]!==i?(j=n.current?null:(0,$.jsx)(K,{size:`xs`,variant:`destructive-outline`,disabled:i===n.sessionId,onClick:()=>void a(n.sessionId),children:i===n.sessionId?`Revoking…`:`Revoke`}),t[37]=n.current,t[38]=n.sessionId,t[39]=a,t[40]=i,t[41]=j):j=t[41];let M;t[42]===j?M=t[43]:(M=(0,$.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:j}),t[42]=j,t[43]=M);let N;t[44]!==A||t[45]!==M?(N=(0,$.jsxs)(`div`,{className:At,children:[A,M]}),t[44]=A,t[45]=M,t[46]=N):N=t[46];let P;return t[47]!==N||t[48]!==x?(P=(0,$.jsx)(`div`,{className:x,children:N}),t[47]=N,t[48]=x,t[49]=P):P=t[49],P}),Zt=(0,X.memo)(function({clientSessions:e,isRevokingOtherClients:t,onRevokeOtherClients:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(``),[s,c]=(0,X.useState)(!1),l=(0,X.useCallback)(async()=>{c(!0);try{await p(a),o(``),i(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to create pairing URL.`;G.add(je({type:`error`,title:`Could not create pairing URL`,description:t}))}finally{c(!1)}},[a]);return(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(K,{size:`xs`,variant:`destructive-outline`,disabled:t||e.every(e=>e.current),onClick:()=>void n(),children:t?`Revoking…`:`Revoke others`}),(0,$.jsxs)(me,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,$.jsx)(te,{render:(0,$.jsxs)(K,{size:`xs`,variant:`default`,children:[(0,$.jsx)(Xe,{className:`size-3`}),`Create link`]})}),(0,$.jsxs)(ee,{className:`max-w-sm`,children:[(0,$.jsxs)(ie,{children:[(0,$.jsx)(R,{children:`Create pairing link`}),(0,$.jsx)(H,{children:`Generate a one-time link that another device can use to pair with this backend as an authorized client.`})]}),(0,$.jsx)(oe,{children:(0,$.jsxs)(`label`,{className:`block`,children:[(0,$.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Client label (optional)`}),(0,$.jsx)(Be,{value:a,onChange:e=>o(e.target.value),placeholder:`e.g. Living room iPad`,disabled:s,autoFocus:!0})]})}),(0,$.jsxs)(ne,{variant:`bare`,children:[(0,$.jsx)(K,{variant:`outline`,disabled:s,onClick:()=>i(!1),children:`Cancel`}),(0,$.jsx)(K,{disabled:s,onClick:()=>void l(),children:s?`Creating…`:`Create link`})]})]})]})]})}),Qt=(0,X.memo)(function(e){let t=(0,Z.c)(33),{endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:a,isLoading:o,pairingLinks:s,clientSessions:c,revokingPairingLinkId:l,revokingClientSessionId:u,onRevokePairingLink:d,onRevokeClientSession:f}=e,p=a===void 0?`current`:a,m;if(t[0]!==i||t[1]!==n||t[2]!==r||t[3]!==d||t[4]!==s||t[5]!==p||t[6]!==l){let e;t[8]!==i||t[9]!==n||t[10]!==r||t[11]!==d||t[12]!==p||t[13]!==l?(e=e=>(0,$.jsx)(Yt,{pairingLink:e,endpointUrl:n,endpoints:r,defaultEndpointKey:i,presentation:p,revokingPairingLinkId:l,onRevoke:d},e.id),t[8]=i,t[9]=n,t[10]=r,t[11]=d,t[12]=p,t[13]=l,t[14]=e):e=t[14],m=s.map(e),t[0]=i,t[1]=n,t[2]=r,t[3]=d,t[4]=s,t[5]=p,t[6]=l,t[7]=m}else m=t[7];let h;if(t[15]!==c||t[16]!==f||t[17]!==p||t[18]!==u){let e;t[20]!==f||t[21]!==p||t[22]!==u?(e=e=>(0,$.jsx)(Xt,{clientSession:e,presentation:p,revokingClientSessionId:u,onRevokeSession:f},e.sessionId),t[20]=f,t[21]=p,t[22]=u,t[23]=e):e=t[23],h=c.map(e),t[15]=c,t[16]=f,t[17]=p,t[18]=u,t[19]=h}else h=t[19];let g;t[24]!==c.length||t[25]!==o||t[26]!==s.length||t[27]!==p?(g=s.length===0&&c.length===0&&!o?(0,$.jsx)(`div`,{className:jt(p),children:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:`No pairing links or client sessions.`})}):null,t[24]=c.length,t[25]=o,t[26]=s.length,t[27]=p,t[28]=g):g=t[28];let _;return t[29]!==m||t[30]!==h||t[31]!==g?(_=(0,$.jsxs)($.Fragment,{children:[m,h,g]}),t[29]=m,t[30]=h,t[31]=g,t[32]=_):_=t[32],_}),$t=(0,X.memo)(function(e){let t=(0,Z.c)(58),{endpoint:n,isDefault:r,presentation:i,onSetDefault:a,onSetupTailscaleServe:o,onDisableTailscaleServe:s,isUpdatingTailscaleServe:c}=e,l=i===void 0?`current`:i,u=n.status===`available`,d;t[0]===n?d=t[1]:(d=Ht(n)&&n.status!==`available`,t[0]=n,t[1]=d);let f=d,p;t[2]===n.compatibility.hostedHttpsApp?p=t[3]:(p=Wt(n.compatibility.hostedHttpsApp),t[2]=n.compatibility.hostedHttpsApp,t[3]=p);let m=p,h;t[4]===n.compatibility.hostedHttpsApp?h=t[5]:(h=Gt(n.compatibility.hostedHttpsApp),t[4]=n.compatibility.hostedHttpsApp,t[5]=h);let g=h,_;t[6]===n?_=t[7]:(_=Ht(n)&&n.status===`available`,t[6]=n,t[7]=_);let v=_,y=!f,b=l===`endpoint-rail`,x;t[8]!==u||t[9]!==l?(x=Mt(l,u),t[8]=u,t[9]=l,t[10]=x):x=t[10];let S;t[11]!==r||t[12]!==b?(S=b&&r?(0,$.jsx)(`span`,{className:`absolute inset-y-2 left-0 w-1 rounded-r-full bg-primary`,"aria-hidden":!0}):null,t[11]=r,t[12]=b,t[13]=S):S=t[13];let C;t[14]===n.label?C=t[15]:(C=(0,$.jsx)(`h3`,{className:`shrink-0 text-sm leading-5 font-medium text-foreground`,children:n.label}),t[14]=n.label,t[15]=C);let w;t[16]!==n.httpBaseUrl||t[17]!==y?(w=y?(0,$.jsx)(`p`,{className:`min-w-0 truncate text-xs leading-5 text-muted-foreground`,title:n.httpBaseUrl,children:n.httpBaseUrl}):null,t[16]=n.httpBaseUrl,t[17]=y,t[18]=w):w=t[18];let T;t[19]===u?T=t[20]:(T=u?null:(0,$.jsx)(`span`,{className:`shrink-0 rounded-md border border-border/70 px-1 py-0.5 text-[10px] text-muted-foreground`,children:`Setup required`}),t[19]=u,t[20]=T);let E;t[21]!==g||t[22]!==m?(E=m?(0,$.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-amber-500/30 bg-amber-500/10 px-1 py-0.5 text-[10px] text-amber-700 dark:text-amber-300`,title:g??void 0,children:[(0,$.jsx)(Fe,{"aria-hidden":!0,className:`size-3`}),m]}):null,t[21]=g,t[22]=m,t[23]=E):E=t[23];let D;t[24]!==T||t[25]!==E||t[26]!==C||t[27]!==w?(D=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[C,w,T,E]}),t[24]=T,t[25]=E,t[26]=C,t[27]=w,t[28]=D):D=t[28];let O;t[29]===r?O=t[30]:(O=r?(0,$.jsx)(`span`,{className:`rounded-md border border-primary/30 bg-primary/10 px-1 py-0.5 text-[10px] text-primary`,children:`Default`}):null,t[29]=r,t[30]=O);let k;t[31]!==n||t[32]!==c||t[33]!==f||t[34]!==o?(k=f?(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:()=>o(n),disabled:c,children:c?`Restarting…`:`Setup`}):null,t[31]=n,t[32]=c,t[33]=f,t[34]=o,t[35]=k):k=t[35];let A;t[36]!==v||t[37]!==n||t[38]!==c||t[39]!==s?(A=v?(0,$.jsx)(K,{size:`xs`,variant:`destructive-outline`,onClick:()=>s(n),disabled:c,children:c?`Restarting…`:`Disable`}):null,t[36]=v,t[37]=n,t[38]=c,t[39]=s,t[40]=A):A=t[40];let j;t[41]!==n||t[42]!==r||t[43]!==f||t[44]!==a?(j=!f&&!r?(0,$.jsx)(K,{size:`xs`,variant:`outline`,onClick:()=>a(n),children:`Set as default`}):null,t[41]=n,t[42]=r,t[43]=f,t[44]=a,t[45]=j):j=t[45];let M;t[46]!==O||t[47]!==k||t[48]!==A||t[49]!==j?(M=(0,$.jsxs)(`div`,{className:`ml-auto flex min-h-6 shrink-0 items-center justify-end gap-2`,children:[O,k,A,j]}),t[46]=O,t[47]=k,t[48]=A,t[49]=j,t[50]=M):M=t[50];let N;t[51]!==D||t[52]!==M?(N=(0,$.jsxs)(`div`,{className:`flex min-h-6 min-w-0 flex-col gap-2 sm:-my-0.5 sm:flex-row sm:items-center`,children:[D,M]}),t[51]=D,t[52]=M,t[53]=N):N=t[53];let P;return t[54]!==N||t[55]!==x||t[56]!==S?(P=(0,$.jsxs)(`div`,{className:x,children:[S,N]}),t[54]=N,t[55]=x,t[56]=S,t[57]=P):P=t[57],P});function en(e){let t=(0,Z.c)(17),{endpoint:n,hiddenEndpointCount:r,expanded:i,onToggleExpanded:a,fallback:o}=e;if(!n)return o;let s;t[0]===n.httpBaseUrl?s=t[1]:(s=(0,$.jsx)(`span`,{className:`min-w-0 truncate`,children:n.httpBaseUrl}),t[0]=n.httpBaseUrl,t[1]=s);let c;t[2]===n.compatibility.hostedHttpsApp?c=t[3]:(c=Wt(n.compatibility.hostedHttpsApp)?(0,$.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-[11px] text-amber-700 dark:text-amber-300`,title:Gt(n.compatibility.hostedHttpsApp)??void 0,children:[(0,$.jsx)(Fe,{"aria-hidden":!0,className:`size-3`}),Wt(n.compatibility.hostedHttpsApp)]}):null,t[2]=n.compatibility.hostedHttpsApp,t[3]=c);let l;t[4]!==i||t[5]!==r?(l=r>0?(0,$.jsx)(`span`,{className:`shrink-0 text-xs font-medium`,children:i?`Hide`:`+${r}`}):null,t[4]=i,t[5]=r,t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,$.jsxs)($.Fragment,{children:[s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d=u,f;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,$.jsx)(`span`,{className:`shrink-0`,children:`Reachable at`}),t[11]=f):f=t[11];let p;return t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==d?(p=(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-1`,children:[f,r>0?(0,$.jsx)(`button`,{type:`button`,className:`inline-flex min-w-0 max-w-full items-baseline gap-2 border-b border-dotted border-muted-foreground/60 text-left text-muted-foreground underline-offset-4 hover:border-foreground hover:text-foreground`,onClick:a,"aria-expanded":i,children:d}):(0,$.jsx)(`span`,{className:`inline-flex min-w-0 max-w-full items-baseline gap-2`,children:d})]}),t[12]=i,t[13]=r,t[14]=a,t[15]=d,t[16]=p):p=t[16],p}function tn(e){let t=(0,Z.c)(57),{environmentId:n,reconnectingEnvironmentId:r,disconnectingEnvironmentId:i,removingEnvironmentId:a,onConnect:o,onDisconnect:s,onRemove:c}=e,l=He(1e3),u;t[0]===n?u=t[1]:(u=e=>e.byId[n]??null,t[0]=n,t[1]=u);let d=w(u),f;t[2]===n?f=t[3]:(f=e=>e.byId[n]??null,t[2]=n,t[3]=f);let p=M(f);if(!d)return null;let m=p?.connectionState??`disconnected`,h=m===`connected`,g=m===`connecting`||r===n,v=i===n,y=m===`connected`?`bg-success`:m===`connecting`?`bg-warning`:m===`error`?`bg-destructive`:`bg-muted-foreground/40`,b=p?.role?p.role===`owner`?`Owner`:`Client`:null,x=p?.descriptor?.label??null??d.label,S;t[4]!==l||t[5]!==d||t[6]!==p?(S=St(p,d,l),t[4]=l,t[5]=d,t[6]=p,t[7]=S):S=t[7];let C=S,T=p?.serverConfig,E;t[8]===T?E=t[9]:(E=_(T),t[8]=T,t[9]=E);let D=E,O;t[10]===d.desktopSsh?O=t[11]:(O=d.desktopSsh?`SSH ${Ct(d.desktopSsh)}`:null,t[10]=d.desktopSsh,t[11]=O);let k;t[12]===d.lastConnectedAt?k=t[13]:(k=d.lastConnectedAt?`Last connected ${bt(d.lastConnectedAt)}`:null,t[12]=d.lastConnectedAt,t[13]=k);let A;t[14]!==b||t[15]!==O||t[16]!==k?(A=[O,b,k].filter(nn),t[14]=b,t[15]=O,t[16]=k,t[17]=A):A=t[17];let j=A,N=m===`connecting`?`bg-warning/60 duration-2000`:null,P;t[18]!==y||t[19]!==C||t[20]!==N?(P=(0,$.jsx)(xt,{tooltipText:C,dotClassName:y,pingClassName:N}),t[18]=y,t[19]=C,t[20]=N,t[21]=P):P=t[21];let F;t[22]===x?F=t[23]:(F=(0,$.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:x}),t[22]=x,t[23]=F);let I;t[24]!==P||t[25]!==F?(I=(0,$.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[P,F]}),t[24]=P,t[25]=F,t[26]=I):I=t[26];let ee;t[27]===j?ee=t[28]:(ee=j.length>0?(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:j.join(` · `)}):null,t[27]=j,t[28]=ee);let L;t[29]===D?L=t[30]:(L=D?(0,$.jsxs)(`p`,{className:`flex items-center gap-1 text-warning text-xs`,children:[(0,$.jsx)(Fe,{className:`size-3.5 shrink-0`}),`Version drift: client `,D.clientVersion,`, server`,` `,D.serverVersion,`.`]}):null,t[29]=D,t[30]=L);let R;t[31]!==I||t[32]!==ee||t[33]!==L?(R=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[I,ee,L]}),t[31]=I,t[32]=ee,t[33]=L,t[34]=R):R=t[34];let te=h?v:g,z;t[35]!==n||t[36]!==h||t[37]!==o||t[38]!==s?(z=()=>void(h?s(n):o(n)),t[35]=n,t[36]=h,t[37]=o,t[38]=s,t[39]=z):z=t[39];let ne=h?v?`Disconnecting…`:`Disconnect`:g?`Connecting…`:`Connect`,re;t[40]!==te||t[41]!==z||t[42]!==ne?(re=(0,$.jsx)(K,{size:`xs`,variant:`outline`,disabled:te,onClick:z,children:ne}),t[40]=te,t[41]=z,t[42]=ne,t[43]=re):re=t[43];let ie=a===n,ae;t[44]!==n||t[45]!==c?(ae=()=>void c(n),t[44]=n,t[45]=c,t[46]=ae):ae=t[46];let oe=a===n?`Removing…`:`Remove`,se;t[47]!==ie||t[48]!==ae||t[49]!==oe?(se=(0,$.jsx)(K,{size:`xs`,variant:`destructive-outline`,disabled:ie,onClick:ae,children:oe}),t[47]=ie,t[48]=ae,t[49]=oe,t[50]=se):se=t[50];let B;t[51]!==re||t[52]!==se?(B=(0,$.jsxs)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:[re,se]}),t[51]=re,t[52]=se,t[53]=B):B=t[53];let V;return t[54]!==R||t[55]!==B?(V=(0,$.jsx)(`div`,{className:Ot,children:(0,$.jsxs)(`div`,{className:At,children:[R,B]})}),t[54]=R,t[55]=B,t[56]=V):V=t[56],V}function nn(e){return e!==null}var rn=(0,X.memo)(function(e){let t=(0,Z.c)(24),{target:n,connectingHostAlias:r,onConnect:i}=e,a;t[0]===n?a=t[1]:(a=Ct(n),t[0]=n,t[1]=a);let o=a,s=o!==n.alias,c=r===n.alias?`Adding…`:`Add environment`,l;t[2]===n.alias?l=t[3]:(l=(0,$.jsx)(`h3`,{className:`truncate text-sm font-medium text-foreground`,children:n.alias}),t[2]=n.alias,t[3]=l);let u;t[4]!==o||t[5]!==s?(u=s?(0,$.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:o}):null,t[4]=o,t[5]=s,t[6]=u):u=t[6];let d;t[7]!==l||t[8]!==u?(d=(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[l,u]}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f=r===n.alias,p;t[10]!==i||t[11]!==n?(p=()=>i(n),t[10]=i,t[11]=n,t[12]=p):p=t[12];let m;t[13]!==r||t[14]!==n.alias?(m=r===n.alias?(0,$.jsx)(Pe,{className:`size-3 animate-spin`}):null,t[13]=r,t[14]=n.alias,t[15]=m):m=t[15];let h;t[16]!==c||t[17]!==f||t[18]!==p||t[19]!==m?(h=(0,$.jsx)(`div`,{className:`flex w-full shrink-0 items-center gap-2 sm:w-auto sm:justify-end`,children:(0,$.jsxs)(K,{size:`xs`,variant:`outline`,disabled:f,onClick:p,children:[m,c]})}),t[16]=c,t[17]=f,t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==d||t[22]!==h?(g=(0,$.jsx)(`div`,{className:`border-t border-border/60 px-4 py-3 first:border-t-0 sm:px-5`,children:(0,$.jsxs)(`div`,{className:At,children:[d,h]})}),t[21]=d,t[22]=h,t[23]=g):g=t[23],g});function an(){let e=window.desktopBridge,[t,i]=(0,X.useState)(e?`owner`:null),[o,s]=(0,X.useState)(null),c=w(e=>e.byId),l=(0,X.useMemo)(()=>Object.values(c).toSorted((e,t)=>e.label.localeCompare(t.label)).map(e=>e.environmentId),[c]),d=(0,X.useMemo)(()=>Object.values(c).reduce((e,t)=>(t.desktopSsh?.alias&&(e[t.desktopSsh.alias]=t),e),{}),[c]),f=(0,X.useMemo)(()=>{let e=new Set;for(let t of Object.values(c)){let n=t.desktopSsh;n&&(e.add(n.alias),e.add(Ct(n)))}return e},[c]),[p,m]=(0,X.useState)([]),[h,g]=(0,X.useState)(!1),[y,b]=(0,X.useState)(!1),[x,S]=(0,X.useState)(null),[E,M]=(0,X.useState)(null),[F,se]=(0,X.useState)(null),[B,ce]=(0,X.useState)([]),[ue,de]=(0,X.useState)(null),[fe,he]=(0,X.useState)([]),[ge,ve]=(0,X.useState)([]),[ye,U]=(0,X.useState)(null),[be,xe]=(0,X.useState)(!1),[Se,Ce]=(0,X.useState)(null),[we,Te]=(0,X.useState)(null),[Ee,De]=(0,X.useState)(!1),[W,Oe]=(0,X.useState)(!1),[ke,Ae]=(0,X.useState)(`remote`),[Me,Ne]=(0,X.useState)(``),[He,J]=(0,X.useState)(``),[Ge,qe]=(0,X.useState)(``),[Je,Ye]=(0,X.useState)(``),[Ze,Qe]=(0,X.useState)(``),[$e,Y]=(0,X.useState)(null),[Z,tt]=(0,X.useState)(!1),Q=(0,X.useMemo)(()=>p.filter(e=>{let t=Ct(e);return!f.has(e.alias)&&!f.has(t)}),[p,f]),[nt,rt]=(0,X.useState)(null),[it,at]=(0,X.useState)(null),[ot,st]=(0,X.useState)(null),[ct,lt]=(0,X.useState)(!1),[ut,dt]=(0,X.useState)(!1),[ft,pt]=(0,X.useState)(!1),[mt,ht]=(0,X.useState)(null),[gt,yt]=(0,X.useState)(!1),[bt,xt]=(0,X.useState)(String(vt)),[St,kt]=(0,X.useState)(null),At=v(),Mt=_(At),[Wt,Gt]=(0,X.useState)(!1),Kt=C(e=>e.defaultAdvertisedEndpointKey),qt=C(e=>e.setDefaultAdvertisedEndpointKey),Jt=t===`owner`,Yt=e?F?.mode===`network-accessible`:o===`remote-reachable`,Xt=bt.trim(),nn=Number(Xt),an=/^\d+$/u.test(Xt)&&Number.isInteger(nn)&&nn>=1&&nn<=65535,on=(0,X.useMemo)(()=>{if(!mt)return null;if(!an||nn===vt)return mt.httpBaseUrl;try{let e=new URL(mt.httpBaseUrl);return e.port=String(nn),e.toString().replace(/\/$/u,``)}catch{return mt.httpBaseUrl}},[an,nn,mt]),sn=(0,X.useCallback)(async t=>{if(e){lt(!0),de(null);try{let n=await e.setServerExposureMode(t?`network-accessible`:`local-only`);se(n),dt(!1),lt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to update network exposure.`;dt(!1),de(t),G.add(je({type:`error`,title:`Could not update network access`,description:t})),lt(!1)}}},[e]),cn=(0,X.useCallback)(()=>{St!==null&&sn(St===`network-accessible`)},[sn,St]),ln=(0,X.useCallback)(async()=>{if(e&&an){pt(!0),de(null);try{let t=await e.setTailscaleServeEnabled({enabled:!0,port:nn});se(t),ht(null)}catch(e){let t=e instanceof Error?e.message:`Failed to configure Tailscale HTTPS.`;de(t),G.add(je({type:`error`,title:`Could not set up Tailscale HTTPS`,description:t}))}finally{pt(!1)}}},[e,an,nn]),un=(0,X.useCallback)(e=>{xt(String(F?.tailscaleServePort??vt)),ht(e)},[F?.tailscaleServePort]),dn=(0,X.useCallback)(async()=>{if(e){pt(!0),de(null);try{let t=await e.setTailscaleServeEnabled({enabled:!1,port:F?.tailscaleServePort??vt});se(t),yt(!1)}catch(e){let t=e instanceof Error?e.message:`Failed to disable Tailscale HTTPS.`;de(t),G.add(je({type:`error`,title:`Could not disable Tailscale HTTPS`,description:t}))}finally{pt(!1)}}},[e,F?.tailscaleServePort]),fn=(0,X.useCallback)(e=>{yt(!0)},[]),pn=(0,X.useCallback)(async e=>{Ce(e),U(null);try{await a(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke pairing link.`;U(t),G.add(je({type:`error`,title:`Could not revoke pairing link`,description:t}))}finally{Ce(null)}},[]),mn=(0,X.useCallback)(async e=>{Te(e),U(null);try{await u(e)}catch(e){let t=e instanceof Error?e.message:`Failed to revoke client access.`;U(t),G.add(je({type:`error`,title:`Could not revoke client access`,description:t}))}finally{Te(null)}},[]),hn=(0,X.useCallback)(async()=>{De(!0),U(null);try{let e=await n();G.add({type:`success`,title:e===1?`Revoked 1 other client`:`Revoked ${e} clients`,description:`Other paired clients will need a new pairing link before reconnecting.`})}catch(e){let t=e instanceof Error?e.message:`Failed to revoke other clients.`;U(t),G.add(je({type:`error`,title:`Could not revoke other clients`,description:t}))}finally{De(!1)}},[]),gn=(0,X.useCallback)(async()=>{if(ke===`ssh`){tt(!0),Y(null);try{let e=wt({host:Ge,username:Je,port:Ze}),t=await A(e,{label:``});Ne(``),J(``),qe(``),Ye(``),Qe(``),Oe(!1),G.add({type:`success`,title:`Environment connected`,description:`${t.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Dt(e);Y(t)}finally{tt(!1)}return}tt(!0),Y(null);try{let e=Et({host:Me,pairingCode:He}),t=await k({label:``,...e});Ne(``),J(``),qe(``),Ye(``),Qe(``),Oe(!1),G.add({type:`success`,title:`Backend added`,description:`${t.label} is now saved and will reconnect on app startup.`})}catch(e){let t=e instanceof Error?e.message:`Failed to add backend.`;Y(t),G.add(je({type:`error`,title:`Could not add backend`,description:t}))}finally{tt(!1)}},[Me,ke,He,Ge,Ze,Je]),_n=(0,X.useCallback)(async e=>{rt(e),Y(null);try{await O(e)}catch(e){let t=e instanceof Error?e.message:`Failed to connect backend.`;Y(t),G.add(je({type:`error`,title:`Could not connect backend`,description:t}))}finally{rt(null)}},[]),vn=(0,X.useCallback)(async e=>{at(e),Y(null);try{await j(e)}catch(e){let t=e instanceof Error?e.message:`Failed to disconnect backend.`;Y(t),G.add(je({type:`error`,title:`Could not disconnect backend`,description:t}))}finally{at(null)}},[]),yn=(0,X.useCallback)(async e=>{st(e),Y(null);try{await T(e)}catch(e){let t=e instanceof Error?e.message:`Failed to remove backend.`;Y(t),G.add(je({type:`error`,title:`Could not remove backend`,description:t}))}finally{st(null)}},[]),bn=(0,X.useCallback)(async()=>{if(!e){m([]),g(!1),S(null);return}b(!0),S(null);try{let t=await e.discoverSshHosts();m(t),g(!0)}catch(e){let t=e instanceof Error?e.message:`Failed to discover SSH hosts.`;S(t),g(!0)}finally{b(!1)}},[e]),xn=(0,X.useCallback)(async(e,t)=>{M(e.alias),ke===`ssh`?Y(null):S(null);try{let n=await A(e,t===void 0?void 0:{label:t});qe(``),Ye(``),Qe(``),Oe(!1),G.add({type:`success`,title:d[e.alias]?`Environment reconnected`:`Environment connected`,description:`${n.label} is ready over an SSH-managed tunnel.`})}catch(e){let t=Dt(e);ke===`ssh`?Y(t):S(t)}finally{M(null)}},[ke,d]);(0,X.useEffect)(()=>{e&&W&&ke===`ssh`&&(h||y||bn())},[W,e,h,y,bn,ke]),(0,X.useEffect)(()=>{if(e){i(`owner`);return}let t=!1;return r().then(e=>{t||(i(e.authenticated?e.role??null:null),s(e.auth.policy))}).catch(()=>{t||(i(null),s(null))}),()=>{t=!0}},[e]),(0,X.useEffect)(()=>{if(!Jt)return;let t=!1;xe(!0);let n=D().client.server.subscribeAuthAccess(e=>{if(!t){switch(e.type){case`snapshot`:he(Nt(e.payload.pairingLinks.map(e=>Ft(e)))),ve(Pt(e.payload.clientSessions.map(e=>It(e))));break;case`pairingLinkUpserted`:he(t=>Lt(t,Ft(e.payload)));break;case`pairingLinkRemoved`:he(t=>Rt(t,e.payload.id));break;case`clientUpserted`:ve(t=>zt(t,It(e.payload)));break;case`clientRemoved`:ve(t=>Bt(t,e.payload.sessionId))}U(null),xe(!1)}},{onResubscribe:()=>{t||xe(!0)}});return e?(e.getServerExposureState().then(e=>{t||se(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load network exposure state.`;de(n)}),e.getAdvertisedEndpoints().then(e=>{t||ce(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;de(n)})):(se(null),D().client.server.getAdvertisedEndpoints().then(e=>{t||ce(e)}).catch(e=>{if(t)return;let n=e instanceof Error?e.message:`Failed to load reachable endpoints.`;de(n)})),()=>{t=!0,n()}},[Jt,e]),(0,X.useEffect)(()=>{Jt||(xe(!1),he([]),ve([]),U(null),se(null),ce([]),de(null))},[Jt]);let Sn=(0,X.useMemo)(()=>fe.filter(e=>e.role===`client`),[fe]),Cn=(0,X.useMemo)(()=>B.find(Ht)??null,[B]),wn=(0,X.useMemo)(()=>Yt?B.filter(e=>!Ht(e)):[],[B,Yt]),Tn=(0,X.useMemo)(()=>Cn?[...wn,Cn]:wn,[Cn,wn]),En=Yt||Cn?.status===`available`,Dn=(0,X.useMemo)(()=>Vt(wn,Kt),[Kt,wn]),On=(0,X.useMemo)(()=>Dn??Vt(Cn?[Cn]:[],Kt),[Kt,Dn,Cn]),kn=On?Ut(On):null,An=(0,X.useCallback)(e=>{qt(Ut(e))},[qt]),jn=(0,X.useCallback)(e=>{let t=Tt(e);if(t){Ne(t.host),J(t.pairingCode);return}Ne(e)},[]),Mn=e=>{let t=ke===e.mode;return(0,$.jsxs)(`button`,{type:`button`,"aria-pressed":t,className:Ie(`group flex min-h-24 items-start gap-3 rounded-lg border p-4 text-left`,t?`border-primary/50 bg-primary/5`:`border-border/60 hover:bg-muted/40`),disabled:Z,onClick:()=>{Ae(e.mode)},children:[e.icon?(0,$.jsx)(`span`,{className:Ie(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md border`,t?`border-primary/30 bg-primary/10 text-primary`:`border-border/70 bg-background text-muted-foreground group-hover:text-foreground`),children:e.icon}):null,(0,$.jsxs)(`span`,{className:`min-w-0`,children:[(0,$.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:e.title}),(0,$.jsx)(`span`,{className:`mt-1 block text-xs leading-relaxed text-muted-foreground`,children:e.description})]})]})};return(0,$.jsxs)(We,{children:[Jt?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Ue,{title:`Manage local backend`,children:[Mt?(0,$.jsx)(q,{title:`Version drift`,description:(0,$.jsxs)(`span`,{className:`flex items-center gap-1 text-warning`,children:[(0,$.jsx)(Fe,{className:`size-3.5 shrink-0`}),`Client `,Mt.clientVersion,`, server`,` `,Mt.serverVersion,`. Sync them if RPC calls or reconnects fail.`]})}):null,e?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{title:`Network access`,description:Yt?(0,$.jsx)(en,{endpoint:Dn,hiddenEndpointCount:Math.max(wn.length-1,0),expanded:Wt,onToggleExpanded:()=>Gt(e=>!e),fallback:F?.endpointUrl?`Reachable at ${F.endpointUrl}`:F?.advertisedHost?`Exposed on all interfaces. Pairing links use ${F.advertisedHost}.`:`Exposed on all interfaces.`}):F?`Limited to this machine.`:`Loading…`,status:ue?(0,$.jsx)(`span`,{className:`block text-destructive`,children:ue}):null,control:(0,$.jsx)(_e,{checked:F?.mode===`network-accessible`,disabled:!F||ct,onCheckedChange:e=>{kt(e?`network-accessible`:`local-only`),dt(!0)},"aria-label":`Enable network access`})}),(e=>Wt?wn.map(t=>{let n=Ut(t);return(0,$.jsx)($t,{endpoint:t,isDefault:n===kn,presentation:e,onSetDefault:An,onSetupTailscaleServe:un,onDisableTailscaleServe:fn,isUpdatingTailscaleServe:ft},t.id)}):null)(`endpoint-rail`),(0,$.jsx)(q,{title:`Tailscale HTTPS`,description:Cn?Cn.status===`available`?Cn.httpBaseUrl:`Use Tailscale Serve to expose this backend through a MagicDNS HTTPS URL.`:`Start Tailscale to set up HTTPS access through MagicDNS.`,control:Cn?(0,$.jsx)(_e,{checked:Cn.status===`available`,disabled:ft,onCheckedChange:e=>{if(e){un(Cn);return}fn(Cn)},"aria-label":`Enable Tailscale HTTPS`}):null})]}):(0,$.jsx)(q,{title:`Network access`,description:o===`remote-reachable`?`This backend is already configured for remote access. Network exposure changes must be made where the server is launched.`:`This backend is only reachable on this machine. Restart it with a non-loopback host to enable remote pairing.`,control:(0,$.jsxs)(ze,{children:[(0,$.jsx)(Le,{render:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(_e,{checked:Yt,disabled:!0,"aria-label":`Enable network access`})})}),(0,$.jsx)(Re,{side:`top`,children:`Network exposure changes restart the backend and must be controlled where the server process is launched.`})]})})]}),En?(0,$.jsx)(Ue,{title:`Authorized clients`,headerAction:(0,$.jsx)(Zt,{clientSessions:ge,isRevokingOtherClients:Ee,onRevokeOtherClients:hn}),children:(e=>(0,$.jsxs)($.Fragment,{children:[ye?(0,$.jsx)(`div`,{className:jt(e),children:(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:ye})}):null,(0,$.jsx)(Qt,{endpointUrl:F?.endpointUrl,endpoints:Tn,defaultEndpointKey:kn,presentation:e,isLoading:be,pairingLinks:Sn,clientSessions:ge,revokingPairingLinkId:Se,revokingClientSessionId:we,onRevokePairingLink:pn,onRevokeClientSession:mn})]}))(`current`)}):null,(0,$.jsx)(N,{open:ut,onOpenChange:e=>{ct||dt(e)},onOpenChangeComplete:e=>{e||kt(null)},children:(0,$.jsxs)(I,{children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(L,{children:St===`network-accessible`?`Enable network access?`:`Disable network access?`}),(0,$.jsx)(z,{children:St===`network-accessible`?`Ryco will restart to expose this environment over the network.`:`Ryco will restart and limit this environment back to this machine.`})]}),(0,$.jsxs)(re,{children:[(0,$.jsx)(pe,{disabled:ct,render:(0,$.jsx)(K,{variant:`outline`,disabled:ct}),children:`Cancel`}),(0,$.jsx)(K,{variant:St===`local-only`?`destructive`:`default`,onClick:cn,disabled:St===null||ct,children:ct?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(le,{className:`size-3.5`}),`Restarting…`]}):St===`network-accessible`?`Restart and enable`:`Restart and disable`})]})]})}),(0,$.jsx)(N,{open:gt,onOpenChange:e=>{ft||yt(e)},children:(0,$.jsxs)(I,{children:[(0,$.jsxs)(ae,{children:[(0,$.jsx)(L,{children:`Disable Tailscale HTTPS?`}),(0,$.jsx)(z,{children:`Ryco will restart the local backend without Tailscale Serve.`})]}),(0,$.jsxs)(re,{children:[(0,$.jsx)(pe,{disabled:ft,render:(0,$.jsx)(K,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,$.jsx)(K,{variant:`destructive`,onClick:()=>void dn(),disabled:ft,children:ft?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(le,{className:`size-3.5`}),`Restarting…`]}):`Restart and disable`})]})]})}),(0,$.jsx)(me,{open:mt!==null,onOpenChange:e=>{ft||e||ht(null)},children:(0,$.jsxs)(ee,{className:`max-w-md`,children:[(0,$.jsxs)(ie,{children:[(0,$.jsx)(R,{children:`Set up Tailscale HTTPS?`}),(0,$.jsx)(H,{children:`Ryco will restart the local backend with Tailscale Serve enabled and ask Tailscale to proxy HTTPS traffic to this backend.`})]}),(0,$.jsxs)(oe,{className:`space-y-4`,children:[(0,$.jsxs)(`label`,{className:`block`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`HTTPS port`}),(0,$.jsx)(Be,{className:`mt-2`,type:`number`,inputMode:`numeric`,min:1,max:65535,step:1,value:bt,onChange:e=>xt(e.target.value),disabled:ft})]}),an?null:(0,$.jsx)(`p`,{className:`mt-2 text-xs text-destructive`,children:`Enter a port from 1 to 65535.`}),(0,$.jsxs)(`div`,{className:`rounded-md border border-border/70 bg-muted/20 px-3 py-2`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:`HTTPS endpoint`}),(0,$.jsx)(`p`,{className:`mt-1 truncate text-sm text-foreground`,title:on??void 0,children:on??`Pending MagicDNS endpoint`})]})]}),(0,$.jsxs)(ne,{children:[(0,$.jsx)(P,{disabled:ft,render:(0,$.jsx)(K,{variant:`outline`,disabled:ft}),children:`Cancel`}),(0,$.jsx)(K,{onClick:()=>void ln(),disabled:ft||!an,children:ft?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(le,{className:`size-3.5`}),`Restarting…`]}):`Enable`})]})]})})]}):(0,$.jsx)(Ue,{title:`Local backend access`,children:(0,$.jsx)(q,{title:`Owner tools`,description:`Pairing links and client-session management are only available to owner sessions for this backend.`})}),e?(0,$.jsx)(_t,{desktopBridge:e}):null,(0,$.jsxs)(Ue,{title:`Remote environments`,headerAction:(0,$.jsxs)(me,{open:W,onOpenChange:e=>{Oe(e),e||Y(null)},children:[(0,$.jsx)(te,{render:(0,$.jsxs)(K,{size:`xs`,variant:`outline`,children:[(0,$.jsx)(Xe,{className:`size-3`}),`Add environment`]})}),(0,$.jsxs)(ee,{className:`max-h-[80dvh] sm:max-w-3xl`,children:[(0,$.jsxs)(ie,{children:[(0,$.jsx)(R,{children:`Add Environment`}),(0,$.jsx)(H,{children:`Pair another environment to this client.`})]}),(0,$.jsx)(oe,{children:(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[Mn({mode:`remote`,title:`Remote link`,description:`Enter a backend host and pairing code.`,icon:(0,$.jsx)(et,{"aria-hidden":!0,className:`size-4`})}),e?Mn({mode:`ssh`,title:`SSH`,description:`Use local SSH config, agent, and tunnels for the backend.`,icon:(0,$.jsx)(V,{"aria-hidden":!0,className:`size-4`})}):null]}),(0,$.jsx)(Ke,{children:ke===`ssh`?(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`label`,{className:`block`,children:[(0,$.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`SSH host or alias`}),(0,$.jsx)(Be,{value:Ge,onChange:e=>qe(e.target.value),placeholder:`Search hosts or type devbox`,disabled:Z,spellCheck:!1})]}),(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_7rem]`,children:[(0,$.jsxs)(`label`,{className:`block`,children:[(0,$.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Username`}),(0,$.jsx)(Be,{value:Je,onChange:e=>Ye(e.target.value),placeholder:`root`,disabled:Z,spellCheck:!1})]}),(0,$.jsxs)(`label`,{className:`block`,children:[(0,$.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Port`}),(0,$.jsx)(Be,{value:Ze,onChange:e=>Qe(e.target.value),placeholder:`22`,inputMode:`numeric`,disabled:Z,spellCheck:!1})]})]}),$e||x?(0,$.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive`,children:$e??x}):null,(0,$.jsxs)(K,{variant:`outline`,className:`w-full`,disabled:Z,onClick:()=>void gn(),children:[(0,$.jsx)(Xe,{className:`size-3.5`}),Z?`Adding…`:`Add environment`]})]}),(0,$.jsxs)(`div`,{className:`overflow-hidden rounded-lg border border-border/60`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border/60 bg-muted/30 px-3 py-2`,children:[(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Suggested hosts`}),(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`From SSH config and known hosts`})]}),(0,$.jsxs)(K,{size:`xs`,variant:`ghost`,disabled:y,onClick:()=>void bn(),children:[y?(0,$.jsx)(Pe,{className:`size-3 animate-spin`}):(0,$.jsx)(Pe,{className:`size-3`}),`Refresh`]})]}),(0,$.jsx)(Ve,{scrollFade:!0,className:`max-h-56`,children:(0,$.jsxs)(`div`,{children:[Q.map(e=>(0,$.jsx)(rn,{target:e,connectingHostAlias:E,onConnect:e=>void xn(e)},`${e.alias}:${e.hostname}:${e.port??``}`)),h&&!y&&Q.length===0?(0,$.jsx)(`div`,{className:Ot,children:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No new SSH hosts were discovered.`})}):null]})})]})]}):(0,$.jsxs)(`div`,{className:`space-y-4`,children:[(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-[minmax(0,1fr)_10rem]`,children:[(0,$.jsxs)(`label`,{className:`block`,children:[(0,$.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Host`}),(0,$.jsx)(Be,{value:Me,onChange:e=>jn(e.target.value),placeholder:`backend.example.com`,disabled:Z,spellCheck:!1})]}),(0,$.jsxs)(`label`,{className:`block`,children:[(0,$.jsx)(`span`,{className:`mb-1.5 block text-xs font-medium text-foreground`,children:`Pairing code`}),(0,$.jsx)(Be,{value:He,onChange:e=>J(e.target.value),placeholder:`PAIRCODE`,disabled:Z,spellCheck:!1})]})]}),(0,$.jsx)(`div`,{children:(0,$.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:`Paste a full pairing URL here to fill both fields automatically. The pairing code is not kept; the browser stores a bearer token for 7 days.`})})]}),$e?(0,$.jsx)(`p`,{className:`text-xs text-destructive`,children:$e}):null,(0,$.jsxs)(K,{variant:`outline`,className:`w-full`,disabled:Z,onClick:()=>void gn(),children:[(0,$.jsx)(Xe,{className:`size-3.5`}),Z?`Adding…`:`Add environment`]})]})})]})})]})]}),children:[l.map(e=>(0,$.jsx)(tn,{environmentId:e,reconnectingEnvironmentId:nt,disconnectingEnvironmentId:it,removingEnvironmentId:ot,onConnect:_n,onDisconnect:vn,onRemove:yn},e)),l.length===0?(0,$.jsx)(`div`,{className:Ot,children:(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No remote environments yet. Click “Add environment” to pair another environment.`})}):null]})]})}function on(e){return e.status!==`unavailable`}function sn(e){G.add({type:`success`,title:e===`hosted-link`?`Hosted app link copied`:e===`link`?`Pairing URL copied`:`Pairing code copied`,description:e===`hosted-link`?`Open it in the browser on the device you want to connect.`:e===`link`?`Open it in the client you want to pair to this environment.`:`Paste it into another client to finish pairing.`})}function cn(e){return Jt(e)?`hosted-link`:`link`}function ln(e){return!Jt(e.url)}function un(e){return Jt(e.url)}function dn(e){return e.currentTarget.select()}function fn(e){return e.currentTarget.select()}function pn(e){return e!==null}export{an as ConnectionsSettings};
|