@yuriai/web 0.3.6-beta.8 → 0.3.6
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/README.md +19 -3
- package/bin/install-portable.sh +102 -0
- package/bin/install-portable.test.js +112 -0
- package/bin/lib/DOCUMENTATION.md +2 -0
- package/bin/lib/cli-startup.js +7 -2
- package/bin/lib/cli-startup.portable.test.js +30 -0
- package/bin/lib/commands-serve.js +4 -1
- package/bin/lib/commands-update.js +3 -0
- package/bin/lib/commands-update.test.js +18 -0
- package/dist/assets/{AgentAvatar-COZrpK6y.js → AgentAvatar-BOvjZ-DI.js} +1 -1
- package/dist/assets/{AgentSelector-7iPujobN.js → AgentSelector-Dl_zIOMk.js} +1 -1
- package/dist/assets/ArchivedSessionsDialog-Cr9Ji-RY.js +1 -0
- package/dist/assets/{AssistantConversationSurface-C6tCgfuc.js → AssistantConversationSurface-CLdjNFeJ.js} +3 -3
- package/dist/assets/{AssistantSessionCard-BLKXoc6z.js → AssistantSessionCard-BufyrOfo.js} +2 -2
- package/dist/assets/{AssistantUnreadBadge-BSWBtgFe.js → AssistantUnreadBadge-Dn9HAEDr.js} +1 -1
- package/dist/assets/{AssistantView-YdmEtDcb.js → AssistantView-Cg0wPomu.js} +1 -1
- package/dist/assets/{AssistantWorkingAvatar-Cnl5oL-I.js → AssistantWorkingAvatar-1KNjr2A2.js} +1 -1
- package/dist/assets/{AssistantsSettingsPage-CqtitUB4.js → AssistantsSettingsPage-DeYfZAYH.js} +1 -1
- package/dist/assets/{BinaryFileFallback-ITV09rfY.js → BinaryFileFallback-DfD02fS_.js} +1 -1
- package/dist/assets/{BtwPanel-SwSsRp_l.js → BtwPanel-B_2w8P0X.js} +2 -2
- package/dist/assets/BusyDots-CAv4ygIO.js +4 -0
- package/dist/assets/{ChatContainer-C_-17prp.js → ChatContainer-Dgv075jT.js} +23 -23
- package/dist/assets/ChatView-Cr71C0ZB.js +3 -0
- package/dist/assets/{DiagramView-DDMO_6X5.js → DiagramView-CTnpBsWU.js} +1 -1
- package/dist/assets/{DiffView-DCQrow3l.js → DiffView-j_yWF1Mz.js} +2 -2
- package/dist/assets/{DiffViewToggle-uJM3Jn3y.js → DiffViewToggle-CYusbmY5.js} +1 -1
- package/dist/assets/{ErrorBoundary-BFXVt5ct.js → ErrorBoundary-yr_JeVdx.js} +1 -1
- package/dist/assets/{FadeInOnReveal-CrbIIB5N.js → FadeInOnReveal-C56koblQ.js} +1 -1
- package/dist/assets/{GuiPluginMount-FFI3j0Vq.js → GuiPluginMount-CBJiLdzR.js} +1 -1
- package/dist/assets/{GuiPluginPage-B9I2nkDa.js → GuiPluginPage-DJa8gFLk.js} +1 -1
- package/dist/assets/{GuiPluginSurface-D_IoxXvc.js → GuiPluginSurface-Cc7q80jp.js} +1 -1
- package/dist/assets/{GuiPluginTitlebarItems-C4eqm-dM.js → GuiPluginTitlebarItems-rbK3leaL.js} +1 -1
- package/dist/assets/{GuiPluginWindow-BMeBjsJ4.js → GuiPluginWindow-Cpg2HYWe.js} +1 -1
- package/dist/assets/{Icon-C1m8PihJ.js → Icon-C1rjS64C.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-CJmo4kkb.js → ImageLoadingPlaceholder-2hMqBtYh.js} +1 -1
- package/dist/assets/{LoadingImage-956pmYDm.js → LoadingImage-Bs-621ZL.js} +1 -1
- package/dist/assets/MarkdownRenderer-BZl_T1ng.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-B0BDlD7a.js → MarkdownRendererImpl-DiCCNjDr.js} +3 -3
- package/dist/assets/{MarkstreamRendererImpl-CNodTwpI.js → MarkstreamRendererImpl-Bzz3OZlX.js} +2 -2
- package/dist/assets/{MobileAssistantSettingsPage-DMLyFaSP.js → MobileAssistantSettingsPage-pBhJR2t6.js} +1 -1
- package/dist/assets/{MobileAssistantTab-C8r9diC7.js → MobileAssistantTab-Ceo442NF.js} +1 -1
- package/dist/assets/{MobileBtwPage-CoQGTHvz.js → MobileBtwPage-DPPmDMA6.js} +1 -1
- package/dist/assets/{MobileChangesSurface-CmZpDOwU.js → MobileChangesSurface-DfDoSkTS.js} +1 -1
- package/dist/assets/{MobileChatScreen-Db2VIMuY.js → MobileChatScreen-DHTbrnAr.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DX3hD4c-.js → MobileDetailNavigation-e1u1y59T.js} +1 -1
- package/dist/assets/{MobileFilesSurface-BERQLtDW.js → MobileFilesSurface-CJoqR3By.js} +2 -2
- package/dist/assets/{MobileHtmlNetworkBoundary-5XyCoKjL.js → MobileHtmlNetworkBoundary-GBhYVYvu.js} +2 -2
- package/dist/assets/{MobileOverlayPanel-XkMrn5-W.js → MobileOverlayPanel-DzKTKeZX.js} +1 -1
- package/dist/assets/{MobileResizableSheet-CcOOlg4R.js → MobileResizableSheet-CkA7qhco.js} +1 -1
- package/dist/assets/{MobileSettingsTab-iRC8w_jI.js → MobileSettingsTab-Bv0HsXFH.js} +1 -1
- package/dist/assets/{MobileShareBridge-DSL2iOvl.js → MobileShareBridge-B-co2UPE.js} +1 -1
- package/dist/assets/{MobileSurface-CkgVejQ3.js → MobileSurface-D63k27t5.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-DDqtoIoS.js → MobileTabPageHeader-FmtbGhwq.js} +1 -1
- package/dist/assets/{ModelLogo-DK6xHKii.js → ModelLogo-CMnp5fyy.js} +1 -1
- package/dist/assets/{ModelSelector-DMmMUIB2.js → ModelSelector-BF4wYwaz.js} +1 -1
- package/dist/assets/{MultiRunWindow-B6jL_lNE.js → MultiRunWindow-D0OU63re.js} +1 -1
- package/dist/assets/{OnboardingScreen-BCIOJR5C.js → OnboardingScreen-CDHtDQ0k.js} +1 -1
- package/dist/assets/{OverlayScrollbar-CbdvcSXs.js → OverlayScrollbar-m1EAqRES.js} +1 -1
- package/dist/assets/{PierreDiffViewer-Dn1NIerc.js → PierreDiffViewer-CZk1tZ3K.js} +1 -1
- package/dist/assets/{ProviderLogo-CmOgqmZH.js → ProviderLogo-BqQTME35.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-BydwHPmQ.js → RemoteAssistantSessionCard-CrbCVhqD.js} +1 -1
- package/dist/assets/{RemoteDesktopPanel-q0HrpV8w.js → RemoteDesktopPanel-BzLmzmjb.js} +1 -1
- package/dist/assets/ScheduledTasksDialog-DmtcDZHc.js +3 -0
- package/dist/assets/{ScrollableOverlay-DIkp2MKc.js → ScrollableOverlay-CEglrXfm.js} +1 -1
- package/dist/assets/{SettingsGroup-YUId7nD5.js → SettingsGroup-Bm-l3IIs.js} +1 -1
- package/dist/assets/{SettingsView-DLMfj0mQ.js → SettingsView-CYEjDYWC.js} +15 -15
- package/dist/assets/{SettingsWindow-DCPFcip-.js → SettingsWindow-CvJsxUyu.js} +1 -1
- package/dist/assets/{SetupTourDialog-0bzhfhsY.js → SetupTourDialog-DWaVtkY0.js} +1 -1
- package/dist/assets/{SyncActions-8f50jzAU.js → SyncActions-C0gph0P8.js} +1 -1
- package/dist/assets/TerminalView-Cm8Ts51w.js +9 -0
- package/dist/assets/{TextSelectionMenu-BozjXtuL.js → TextSelectionMenu-Dcv_PdES.js} +2 -2
- package/dist/assets/{ToolOutputDialog-BK0D8GxM.js → ToolOutputDialog-QJpQjmqK.js} +2 -2
- package/dist/assets/{YuriLogo-KR0TAQlB.js → YuriLogo-BbS_Wj4g.js} +1 -1
- package/dist/assets/{YuriWordmark-B0uXpGcz.js → YuriWordmark-CqkcfAJl.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-BNDj8_aw.js → assistant-attachment-cache-CIij0OGm.js} +1 -1
- package/dist/assets/{assistantMessagePreview-Ccp5_-kq.js → assistantMessagePreview-wmP-d_oa.js} +1 -1
- package/dist/assets/{assistantQueries-DDTlQu6m.js → assistantQueries-Dpxq78yP.js} +1 -1
- package/dist/assets/{auto-read-context-C8RimaOE.js → auto-read-context-aRn5yhDb.js} +1 -1
- package/dist/assets/{capgoAdapter-DvATpyxN.js → capgoAdapter-BSnmtwX8.js} +1 -1
- package/dist/assets/{card-alsnQayp.js → card-aoveY4I3.js} +1 -1
- package/dist/assets/{chatUpwardIntent-D_Yt_quU.js → chatUpwardIntent-WxxmOppY.js} +1 -1
- package/dist/assets/{checkbox-LzFeQCyX.js → checkbox-CljLXON1.js} +1 -1
- package/dist/assets/{client-i5Q82JUc.js → client-CmtAKi5B.js} +1 -1
- package/dist/assets/{collapsible-HsY9X-Ve.js → collapsible-DkeWKEAb.js} +1 -1
- package/dist/assets/{connection-hint-DsbzB6Ms.js → connection-hint-DsKyICgn.js} +1 -1
- package/dist/assets/{context-menu-Dpuzxt3o.js → context-menu-XuMa5TsA.js} +1 -1
- package/dist/assets/{desktopHosts-DRAWu-NH.js → desktopHosts-COI-czjF.js} +1 -1
- package/dist/assets/{desktopRelayRestore-DFWsoSoG.js → desktopRelayRestore-BEPNc7qb.js} +1 -1
- package/dist/assets/device-TCHW5U2y.js +2 -0
- package/dist/assets/{diagram-COwAj2NM.js → diagram-DFv7Lh0h.js} +1 -1
- package/dist/assets/dialog-B6B8FIrL.css +1 -0
- package/dist/assets/{dialog-Cv20xnEj.js → dialog-Cx20I73q.js} +1 -1
- package/dist/assets/{dropdown-menu-B_P1dDl7.js → dropdown-menu-XdfySbu2.js} +1 -1
- package/dist/assets/es-CLAEdHpc.js +15 -0
- package/dist/assets/{fileMentionTouchSelection-BRu1cBlZ.js → fileMentionTouchSelection-pXNTKHAc.js} +1 -1
- package/dist/assets/{fileReferenceActions-FVCTQlDH.js → fileReferenceActions-wN7mWY3w.js} +1 -1
- package/dist/assets/fr-BOB0gfdQ.js +13 -0
- package/dist/assets/{gitApi-BH7j-M9u.js → gitApi-LXGRaDt8.js} +1 -1
- package/dist/assets/{gitApiHttp-Be5VpQHC.js → gitApiHttp-ZjM4HkSo.js} +2 -2
- package/dist/assets/{githubAuthQueries-Dli4cDU7.js → githubAuthQueries-3AJp5LD5.js} +1 -1
- package/dist/assets/{historyImportQueries-SUqjfVSc.js → historyImportQueries-B_mfphxe.js} +1 -1
- package/dist/assets/host-fTclNJST.js +1 -0
- package/dist/assets/{i18n-CBCskgqa.js → i18n-iu4pzqPi.js} +1 -1
- package/dist/assets/{icons-BQMGp0ts.js → icons-BWijARKS.js} +1 -1
- package/dist/assets/{imageSource-DoyhaY3E.js → imageSource-qzgDdfT4.js} +1 -1
- package/dist/assets/{input-CY-NU-bG.js → input-BMYgp87Q.js} +1 -1
- package/dist/assets/{input-store-C4dE7Hgl.js → input-store-CzG_3qFv.js} +1 -1
- package/dist/assets/insertionBoundaries-bmxIeFzH.js +1 -0
- package/dist/assets/ja-CfM9jZ6u.js +15 -0
- package/dist/assets/{kbd-DJnHCHPh.js → kbd-6RW-BxuR.js} +1 -1
- package/dist/assets/ko-DZOSVPHB.js +15 -0
- package/dist/assets/main-B-Wdp6An.js +169 -0
- package/dist/assets/main-BLBAaohb.js +2 -0
- package/dist/assets/{markdownHeightCache-BAuvVQZt.js → markdownHeightCache-ojT5txMS.js} +1 -1
- package/dist/assets/{mcpQueries-lBUNZsO9.js → mcpQueries-BRuytwhB.js} +1 -1
- package/dist/assets/miniChat-BsrHy2rU.js +2 -0
- package/dist/assets/mobile-B8SHiXyq.js +2 -0
- package/dist/assets/{mobileBackNavigation-BzQ0WYuk.js → mobileBackNavigation-CVrR_jtn.js} +1 -1
- package/dist/assets/{mobileConnections-CSyrEiXH.js → mobileConnections-iSUwFNqu.js} +2 -2
- package/dist/assets/{multirun-BUjPLUCQ.js → multirun-Y3K5yS-8.js} +1 -1
- package/dist/assets/{native-config-C-fqN2Cf.js → native-config-tvqKHwCC.js} +1 -1
- package/dist/assets/{nativeComposerCover-DT9d7IrX.js → nativeComposerCover-5rYz1E3W.js} +1 -1
- package/dist/assets/{navigation-D2V5N7IH.js → navigation-DFmCAq2g.js} +2 -2
- package/dist/assets/openRemoteProjectSession-CeSahDtQ.js +1 -0
- package/dist/assets/openSessionFromDeepLink-DsZnNy4W.js +2 -0
- package/dist/assets/pl-CaT81Sz8.js +15 -0
- package/dist/assets/platform-B2ylz14u.js +1 -0
- package/dist/assets/{pluginPresentation-CbOzLlWM.js → pluginPresentation-rls1AMJN.js} +2 -2
- package/dist/assets/{project-preview-ClK_VQFz.js → project-preview-yQerlKs2.js} +1 -1
- package/dist/assets/{projectActions-CD3dKulN.js → projectActions-B11KAI3f.js} +1 -1
- package/dist/assets/{prompt-attachment-upload-BG4nBKxi.js → prompt-attachment-upload-BzYqZdzd.js} +1 -1
- package/dist/assets/pt-BR-9p1IKCEF.js +15 -0
- package/dist/assets/pwa-BrLPfcLk.js +2 -0
- package/dist/assets/{queue-abort-optimistic-DcW7tzaK.js → queue-abort-optimistic-CXKdQu_T.js} +1 -1
- package/dist/assets/{quota-Cyq21PUF.js → quota-BhdKv_Wc.js} +1 -1
- package/dist/assets/{reference-history-BZIwpng4.js → reference-history-Bzn-aPYg.js} +1 -1
- package/dist/assets/{remote-input-store-CiwwBt7K.js → remote-input-store-DPw_n0MZ.js} +1 -1
- package/dist/assets/{remoteProjectQueries-CuuZggLJ.js → remoteProjectQueries-BQzoY_Y9.js} +1 -1
- package/dist/assets/{remoteSessionReference-DAt2R0UC.js → remoteSessionReference-DORvqUYQ.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-C7YpH2qP.js → renderElectronMiniChatApp-DXKgwBat.js} +2 -2
- package/dist/assets/renderMobileApp-CKN6rWxR.js +17 -0
- package/dist/assets/{runtime-file-download-RzAqq2xr.js → runtime-file-download-CaeLqIEY.js} +1 -1
- package/dist/assets/{runtime-file-resource-COtIWnSi.js → runtime-file-resource-BGZ4tGr5.js} +1 -1
- package/dist/assets/{runtimeConfig-Byc5NYTD.js → runtimeConfig-BqUZF6Wt.js} +1 -1
- package/dist/assets/runtimeEndpointReset-Bu02gAs3.js +4 -0
- package/dist/assets/{scheduledTaskNavigation-DuM1gQ9g.js → scheduledTaskNavigation-r3g3DfXq.js} +1 -1
- package/dist/assets/{select-DxI3wkmK.js → select-BPIsJWhM.js} +1 -1
- package/dist/assets/{sessionLookup-UJH1iLm2.js → sessionLookup-DZhrkKRI.js} +1 -1
- package/dist/assets/{sessionOwnership-W4KQ8CbY.js → sessionOwnership-LoUNVeuJ.js} +1 -1
- package/dist/assets/{shortcuts-FWBXko6F.js → shortcuts-DMupfl7l.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-Bq5JCAvR.js → sortable-tabs-strip-1bKw81VO.js} +1 -1
- package/dist/assets/{speechSettingsQueries-Cybc1zo2.js → speechSettingsQueries-C3JgzCqy.js} +1 -1
- package/dist/assets/src-BacdFOCS.css +2 -0
- package/dist/assets/{store-BRt8bo0A.js → store-BgsgBTwJ.js} +5 -5
- package/dist/assets/{switch-BDwSWOjd.js → switch-B4-v9kvg.js} +1 -1
- package/dist/assets/{terminalApi-BMMDklSX.js → terminalApi-wdwb9MVG.js} +1 -1
- package/dist/assets/{textarea-BshZJgqE.js → textarea-DExmj0ZR.js} +1 -1
- package/dist/assets/{timeFormat-7kWOlby7.js → timeFormat-BlSO2-ws.js} +1 -1
- package/dist/assets/{tooltip-Cdy71vjH.js → tooltip-Di-WRJUZ.js} +1 -1
- package/dist/assets/{truncated-path-YngMm0g8.js → truncated-path-nKzykV5p.js} +1 -1
- package/dist/assets/types-4xeqxklF.js +2 -0
- package/dist/assets/ui-BCYkB585.js +13 -0
- package/dist/assets/uk-BUSl_Y_1.js +15 -0
- package/dist/assets/useAppFontEffects-BCJPQstm.js +7 -0
- package/dist/assets/{useAssistantUIStore-LaS5RREA.js → useAssistantUIStore-BUWPTwNV.js} +1 -1
- package/dist/assets/{useDesktopWindowControlsLayout-Icn9KYUk.js → useDesktopWindowControlsLayout-BtpyMlOS.js} +1 -1
- package/dist/assets/{useDictation-C1sdxoEy.js → useDictation-4HBMkISY.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-BnoYSkb7.js → useEffectiveDirectory-BYswRwIv.js} +1 -1
- package/dist/assets/useFontPreferences-C4dQT72k.js +1 -0
- package/dist/assets/{useGitStore-FAEWrkVE.js → useGitStore-DqBPgmf-.js} +1 -1
- package/dist/assets/{useInlineCommentDraftStore-CjyZgWKx.js → useInlineCommentDraftStore-CGJ6dM8d.js} +1 -1
- package/dist/assets/useMcpConfigStore-DEcxFuzW.js +1 -0
- package/dist/assets/{useMobileSwipeActions-3JgGyG-s.js → useMobileSwipeActions-DqlR4X-T.js} +1 -1
- package/dist/assets/useMobileTranscriptSyncHint-BDKcqtq_.js +10 -0
- package/dist/assets/{useModelLists-Cz7CBWNr.js → useModelLists-DsFTBlMr.js} +1 -1
- package/dist/assets/{useOpenCodeReadiness-DSTj-ijS.js → useOpenCodeReadiness-CHybAoBh.js} +1 -1
- package/dist/assets/usePluginsStore-BIBHPK4A.js +1 -0
- package/dist/assets/{useProjectGitActions-C0z5ldH7.js → useProjectGitActions-DeFcqi_O.js} +1 -1
- package/dist/assets/{useProjectGitStore-C6ZCDvmO.js → useProjectGitStore-JGZk-NCk.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-Fi6XrG43.js → useProjectRuntimeAPIs-BMBBtJB-.js} +1 -1
- package/dist/assets/{useQuotaStore-yM_EeU_A.js → useQuotaStore-C3qJTiD7.js} +1 -1
- package/dist/assets/{useSessionBtwStore-1yHVqSCf.js → useSessionBtwStore-D7P-pknd.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-BbawjMGN.js → useStreamingTextThrottle-CjWAE0oQ.js} +1 -1
- package/dist/assets/useTerminalStore-C_QzSEgP.js +1 -0
- package/dist/assets/{useUIStore-Dz0bOfkB.js → useUIStore-68ZPpgYA.js} +1 -1
- package/dist/assets/worktreeManager-pRvX5dQT.js +1 -0
- package/dist/assets/{worktreeSourceBranchPreference-BJrbhZ4m.js → worktreeSourceBranchPreference-B7d3RYcc.js} +1 -1
- package/dist/assets/zh-CN-BGKgQtWd.js +15 -0
- package/dist/assets/zh-TW-jM5lIKfe.js +15 -0
- package/dist/index.html +16 -16
- package/dist/mini-chat.html +16 -16
- package/dist/mobile.html +2 -2
- package/package.json +2 -1
- package/server/index.js +22 -10
- package/server/lib/assistants/DOCUMENTATION.md +11 -6
- package/server/lib/assistants/builtin-skills.js +19 -3
- package/server/lib/assistants/builtin-skills.test.js +17 -0
- package/server/lib/assistants/contact-tools.js +47 -3
- package/server/lib/assistants/contact-tools.test.js +59 -0
- package/server/lib/assistants/harness.js +5 -2
- package/server/lib/assistants/harness.test.js +1 -1
- package/server/lib/assistants/routes.js +1 -0
- package/server/lib/assistants/service.js +7 -2
- package/server/lib/assistants/yuri-tools.js +1 -1
- package/server/lib/assistants/yuri-tools.test.js +1 -1
- package/server/lib/gui-customization/DOCUMENTATION.md +32 -7
- package/server/lib/gui-customization/projects-client.mjs +1 -1
- package/server/lib/gui-customization/projects.js +6 -6
- package/server/lib/gui-customization/projects.test.js +13 -2
- package/server/lib/gui-customization/remote-connections-client.mjs +1 -1
- package/server/lib/gui-customization/remote-connections.js +7 -6
- package/server/lib/gui-customization/remote-connections.test.js +17 -0
- package/server/lib/gui-customization/session-skill.js +16 -4
- package/server/lib/gui-customization/session-skill.test.js +16 -0
- package/server/lib/gui-customization/skill/SKILL.md +2 -2
- package/server/lib/gui-customization/skill/references/deep-links.md +15 -11
- package/server/lib/gui-customization/skill/references/gui-api.md +50 -1
- package/server/lib/gui-customization/skill/references/projects.md +19 -0
- package/server/lib/gui-customization/skill/references/remote-connections.md +3 -0
- package/server/lib/gui-customization/skill-caller.js +18 -0
- package/server/lib/host-update/DOCUMENTATION.md +5 -0
- package/server/lib/host-update/cli.js +5 -2
- package/server/lib/host-update/cli.test.js +15 -2
- package/server/lib/opencode/DOCUMENTATION.md +2 -1
- package/server/lib/opencode/custom-provider.test.js +41 -0
- package/server/lib/opencode/feature-routes-runtime.js +20 -3
- package/server/lib/opencode/settings-helpers.js +5 -0
- package/server/lib/opencode/settings-helpers.test.js +10 -0
- package/server/lib/package-manager.js +14 -0
- package/server/lib/package-manager.test.js +7 -0
- package/server/lib/portable-installation.js +34 -0
- package/server/lib/portable-installation.test.js +38 -0
- package/server/lib/session-index/DOCUMENTATION.md +8 -0
- package/server/lib/session-index/adopt-unindexed-session.js +46 -0
- package/server/lib/session-index/adopt-unindexed-session.test.js +77 -0
- package/server/lib/session-index/event-ingest.js +14 -1
- package/server/lib/session-index/event-ingest.test.js +18 -0
- package/dist/assets/ArchivedSessionsDialog-DLZzsdyB.js +0 -1
- package/dist/assets/BusyDots-C2pMtufA.js +0 -4
- package/dist/assets/ChatView-CNNGCekk.js +0 -3
- package/dist/assets/MarkdownRenderer-GdoxOy4f.js +0 -2
- package/dist/assets/ScheduledTasksDialog-DY9GJF-s.js +0 -3
- package/dist/assets/TerminalView-B9AFgs54.js +0 -8
- package/dist/assets/device-gKeFQDLT.js +0 -2
- package/dist/assets/dialog-D9CkSNCA.css +0 -1
- package/dist/assets/es-BuXtFKUW.js +0 -15
- package/dist/assets/fr-BaZeffY9.js +0 -13
- package/dist/assets/host-CgzhgNKF.js +0 -1
- package/dist/assets/insertionBoundaries-DUMGOIsz.js +0 -1
- package/dist/assets/ja-CGVx5A8U.js +0 -15
- package/dist/assets/ko-C663nzbf.js +0 -15
- package/dist/assets/main-CSPEphQ0.js +0 -169
- package/dist/assets/main-VozcdE4o.js +0 -2
- package/dist/assets/miniChat-DuIhQwv6.js +0 -2
- package/dist/assets/mobile-zYF3NcbJ.js +0 -2
- package/dist/assets/openRemoteProjectSession-Dz9GJCUz.js +0 -1
- package/dist/assets/openSessionFromDeepLink-DHu8AmBy.js +0 -2
- package/dist/assets/pl-CeBOMwg9.js +0 -15
- package/dist/assets/platform-z1TeG-ky.js +0 -1
- package/dist/assets/pt-BR-r8268Pk6.js +0 -15
- package/dist/assets/pwa-Dc46OTi7.js +0 -2
- package/dist/assets/renderMobileApp-DkFS7I4O.js +0 -17
- package/dist/assets/runtimeEndpointReset-BOfBQwJk.js +0 -4
- package/dist/assets/src-DYCPWwUH.css +0 -2
- package/dist/assets/types-CjZZGQvx.js +0 -2
- package/dist/assets/ui-DeV7Us1B.js +0 -13
- package/dist/assets/uk-CeQ1XJ99.js +0 -15
- package/dist/assets/useAppFontEffects-CWZFjoHJ.js +0 -7
- package/dist/assets/useFontPreferences-CLUZvRho.js +0 -1
- package/dist/assets/useMcpConfigStore-n8Iyj2v9.js +0 -1
- package/dist/assets/useMobileTranscriptSyncHint-CgAaYuLF.js +0 -10
- package/dist/assets/usePluginsStore-CsChIifx.js +0 -1
- package/dist/assets/worktreeManager-XchvRN9O.js +0 -1
- package/dist/assets/zh-CN-Bv854olO.js +0 -15
- package/dist/assets/zh-TW-gx8cO-Cx.js +0 -15
package/dist/assets/{scheduledTaskNavigation-DuM1gQ9g.js → scheduledTaskNavigation-r3g3DfXq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./useUIStore-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./useUIStore-68ZPpgYA.js";import{t as n}from"./router-DXUi1sBd.js";var r=e({openScheduledTask:()=>i});function i(e,r){let i=t.getState();i.setActiveMainTab(`schedule`)&&(i.setSettingsDialogOpen(!1),n({sessionId:null,tab:`schedule`,isSettingsOpen:!1,settingsPath:i.settingsPage,diffFile:null,scheduleView:`tasks`,scheduleProjectId:e,scheduleTaskId:r}),i.setScheduledTaskOpenRequest({projectId:e,taskId:r}),i.isMobile&&i.setScheduledTasksDialogOpen(!0))}export{r as n,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,a as n,c as r,d as i,f as a,g as o,h as s,l as c,m as l,o as u,ot as d,p as f,s as p,st as m,u as h}from"./vendor-base-ui-wXsskyKm.js";import{n as g}from"./vendor-react-BkccXcWz.js";import{r as _}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as v}from"./useUIStore-Dz0bOfkB.js";import{no as y}from"./ui-DeV7Us1B.js";import{n as b}from"./Icon-C1m8PihJ.js";import{t as x}from"./i18n-CBCskgqa.js";import{t as S}from"./ScrollableOverlay-DIkp2MKc.js";import{t as C}from"./MobileResizableSheet-CcOOlg4R.js";import{r as w}from"./device-gKeFQDLT.js";var T=g(),E=e(m(),1),D=d(),O=E.createContext(null),ee=e=>e?e.closest(`[data-slot="dialog-content"], [role="dialog"]`):null,k=()=>{let e={reason:`none`,event:new Event(`change`),cancel:()=>{e.isCanceled=!0},allowPropagation:()=>{e.isPropagationAllowed=!0},isCanceled:!1,isPropagationAllowed:!1,trigger:void 0};return e};function A({onValueChange:e,open:t,defaultOpen:n=!1,onOpenChange:r,modal:i=!1,...a}){let[s,c]=E.useState(null),[l,u]=E.useState(n),[d,f]=E.useState(null),p=t??l,m=E.useRef(p);m.current=p;let h=_((e,n)=>{r?.(e,n),!n.isCanceled&&(m.current=e,t===void 0&&u(e))}),g=_(e=>{e!==m.current&&h(e,k())}),v=E.useMemo(()=>({portalContainer:s,setPortalContainer:c,open:p,setOpen:g,triggerAriaLabel:d,setTriggerAriaLabel:f}),[p,s,g,d]),y=E.useCallback((t,n)=>{typeof t==`string`&&e?.(t,n)},[e]);return(0,D.jsx)(O.Provider,{value:v,children:(0,D.jsx)(o,{...a,open:p,modal:i,onOpenChange:h,onValueChange:y})})}function j(e){let t=(0,T.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(u,{"data-slot":`select-group`,...n}),t[2]=n,t[3]=r),r}function M(e){let t=(0,T.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({placeholder:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=e=>{let t=typeof e==`string`||e===void 0?e:e===null?void 0:String(e);return typeof n==`function`?n(t):n??(t===void 0||t===``?r:t)},t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==i||t[8]!==a?(o=(0,D.jsx)(l,{"data-slot":`select-value`,...i,children:a}),t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function N(e){let t=(0,T.c)(40),n,r,i,a,o,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7]):({className:i,size:l,children:r,asChild:n,onPointerDownCapture:o,onFocusCapture:a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l);let u=l===void 0?`default`:l,d=E.useContext(O),p=typeof c[`aria-label`]==`string`?c[`aria-label`]:null,m;t[8]!==d||t[9]!==p?(m=()=>{d?.setTriggerAriaLabel(p)},t[8]=d,t[9]=p,t[10]=m):m=t[10];let h=d?.setTriggerAriaLabel,g;t[11]!==h||t[12]!==p?(g=[h,p],t[11]=h,t[12]=p,t[13]=g):g=t[13],E.useEffect(m,g);let _;t[14]===d?_=t[15]:(_=e=>{if(!d)return;let t=e instanceof HTMLElement?e:null;d.setPortalContainer(ee(t))},t[14]=d,t[15]=_);let v=_,x;t[16]!==n||t[17]!==r?(x=n&&E.isValidElement(r)?{render:r}:null,t[16]=n,t[17]=r,t[18]=x):x=t[18];let S=x,C;t[19]===i?C=t[20]:(C=y(`border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-2 py-2 typography-ui-label whitespace-nowrap shadow-none outline-none focus-visible:outline-none hover:bg-interactive-hover data-[popup-open]:bg-interactive-active focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-6 data-[size=sm]:h-6 data-[size=lg]:h-8 data-[size=lg]:py-1.5 data-[size=chip]:h-7 data-[size=chip]:py-1 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[19]=i,t[20]=C);let w;t[21]!==o||t[22]!==v?(w=e=>{v(e.currentTarget),o?.(e)},t[21]=o,t[22]=v,t[23]=w):w=t[23];let k;t[24]!==a||t[25]!==v?(k=e=>{v(e.currentTarget),a?.(e)},t[24]=a,t[25]=v,t[26]=k):k=t[26];let A;t[27]===S?A=t[28]:(A=S??{},t[27]=S,t[28]=A);let j;t[29]!==S||t[30]!==r?(j=S?void 0:(0,D.jsxs)(D.Fragment,{children:[r,(0,D.jsx)(f,{children:(0,D.jsx)(b,{name:`arrow-down-s`,className:`size-4 opacity-50`})})]}),t[29]=S,t[30]=r,t[31]=j):j=t[31];let M;return t[32]!==c||t[33]!==u||t[34]!==A||t[35]!==j||t[36]!==C||t[37]!==w||t[38]!==k?(M=(0,D.jsx)(s,{"data-slot":`select-trigger`,"data-size":u,className:C,onPointerDownCapture:w,onFocusCapture:k,...c,...A,children:j}),t[32]=c,t[33]=u,t[34]=A,t[35]=j,t[36]=C,t[37]=w,t[38]=k,t[39]=M):M=t[39],M}function P(e){let t=(0,T.c)(67),n,r,o,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11]):({className:o,children:r,position:u,fitContent:d,portalToBody:f,sideOffset:l,side:c,align:n,collisionPadding:p,collisionAvoidance:m,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m);let g=u===void 0?`popper`:u,b=d!==void 0&&d,ee=f!==void 0&&f,k=p===void 0?8:p,A;t[12]===m?A=t[13]:(A=m===void 0?{side:`shift`,align:`shift`}:m,t[12]=m,t[13]=A);let j=A,M=E.useContext(O),{t:N}=x(),P=v(te),{isMobile:F}=w(),I=E.useId(),L=g===`item-aligned`,ne=M?.portalContainer??null,R=M?.open??!1,z;t[14]===M?z=t[15]:(z=e=>{M?.setOpen(e)},t[14]=M,t[15]=z);let B=_(z);if(P||F){let e=`mobile-select-sheet-${I}`,n;t[16]!==M?.triggerAriaLabel||t[17]!==N?(n=M?.triggerAriaLabel??N(`mobile.select.sheetAria`),t[16]=M?.triggerAriaLabel,t[17]=N,t[18]=n):n=t[18];let a;t[19]===N?a=t[20]:(a=N(`mobile.surface.closeAria`),t[19]=N,t[20]=a);let c;t[21]===N?c=t[22]:(c=N(`mobile.sessions.sheet.resizeAria`),t[21]=N,t[22]=c);let l;t[23]===o?l=t[24]:(l=y(o,`relative !max-h-none !w-full !min-w-0 !max-w-none bg-transparent text-foreground shadow-none outline-none`),t[23]=o,t[24]=l);let u;t[25]===r?u=t[26]:(u=(0,D.jsx)(S,{fillContainer:!1,outerClassName:`max-h-[calc(72dvh-5rem)]`,className:`flex max-h-[calc(72dvh-5rem)] w-full flex-col gap-1 py-1`,disableHorizontal:!0,preventOverscroll:!0,children:r}),t[25]=r,t[26]=u);let d;t[27]!==s||t[28]!==l||t[29]!==u?(d=(0,D.jsx)(i,{alignItemWithTrigger:!1,className:`!static !inset-auto !w-full !transform-none pointer-events-auto`,children:(0,D.jsx)(h,{...s,"data-slot":`select-content`,className:l,children:u})}),t[27]=s,t[28]=l,t[29]=u,t[30]=d):d=t[30];let f;return t[31]!==B||t[32]!==R||t[33]!==a||t[34]!==c||t[35]!==d||t[36]!==e||t[37]!==n?(f=(0,D.jsx)(C,{id:e,open:R,onOpenChange:B,fitContent:!0,ariaLabel:n,closeAriaLabel:a,resizeAriaLabel:c,bodyClassName:`px-2`,children:d}),t[31]=B,t[32]=R,t[33]=a,t[34]=c,t[35]=d,t[36]=e,t[37]=n,t[38]=f):f=t[38],f}let V=ee?void 0:ne||void 0,H;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(H={color:`var(--surface-elevated-foreground)`},t[39]=H):H=t[39];let U=!L&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,W=b&&`w-max min-w-0`,G;t[40]!==o||t[41]!==U||t[42]!==W?(G=y(`yuri-mobile-overlay-surface yuri-popup-surface pointer-events-auto transition-all duration-150 ease-out data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 relative z-[120] max-h-[var(--available-height)] min-w-[8rem] origin-[var(--transform-origin)] overflow-x-hidden rounded-xl`,U,W,o),t[40]=o,t[41]=U,t[42]=W,t[43]=G):G=t[43];let K=b?`w-max`:`w-full`,q;t[44]===K?q=t[45]:(q=y(`max-h-[var(--available-height)]`,K),t[44]=K,t[45]=q);let J=!L&&(b?`w-max min-w-0 scroll-my-1`:`w-full min-w-[var(--anchor-width)] scroll-my-1`),Y;t[46]===J?Y=t[47]:(Y=y(`p-1`,J),t[46]=J,t[47]=Y);let X;t[48]!==r||t[49]!==q||t[50]!==Y?(X=(0,D.jsx)(S,{outerClassName:q,className:Y,preventOverscroll:!0,children:r}),t[48]=r,t[49]=q,t[50]=Y,t[51]=X):X=t[51];let Z;t[52]!==s||t[53]!==G||t[54]!==X?(Z=(0,D.jsx)(h,{"data-slot":`select-content`,style:H,className:G,...s,children:X}),t[52]=s,t[53]=G,t[54]=X,t[55]=Z):Z=t[55];let Q;t[56]!==n||t[57]!==L||t[58]!==j||t[59]!==k||t[60]!==c||t[61]!==l||t[62]!==Z?(Q=(0,D.jsx)(i,{alignItemWithTrigger:L,sideOffset:l,side:c,align:n,collisionPadding:k,collisionAvoidance:j,className:`absolute z-[120] pointer-events-auto`,children:Z}),t[56]=n,t[57]=L,t[58]=j,t[59]=k,t[60]=c,t[61]=l,t[62]=Z,t[63]=Q):Q=t[63];let $;return t[64]!==Q||t[65]!==V?($=(0,D.jsx)(a,{container:V,children:Q}),t[64]=Q,t[65]=V,t[66]=$):$=t[66],$}function te(e){return e.isMobile}function F(e){let t=(0,T.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=y(`text-muted-foreground px-2 py-1.5 typography-meta`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,D.jsx)(n,{"data-slot":`select-label`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function I(e){let t=(0,T.c)(13),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({className:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o;t[4]===i?o=t[5]:(o=y(`data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover data-[selected]:bg-interactive-selection data-[selected]:text-interactive-selection-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 typography-ui-label outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,i),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,D.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(r,{children:(0,D.jsx)(b,{name:`check`,className:`size-4`})})}),t[6]=s):s=t[6];let l;t[7]===n?l=t[8]:(l=(0,D.jsx)(p,{children:n}),t[7]=n,t[8]=l);let u;return t[9]!==a||t[10]!==o||t[11]!==l?(u=(0,D.jsxs)(c,{"data-slot":`select-item`,className:o,...a,children:[s,l]}),t[9]=a,t[10]=o,t[11]=l,t[12]=u):u=t[12],u}function L(e){let n=(0,T.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=y(`yuri-popup-separator bg-border pointer-events-none -mx-1 my-1 h-px`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,D.jsx)(t,{"data-slot":`select-separator`,className:a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}export{F as a,M as c,I as i,P as n,L as o,j as r,N as s,A as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{M as t,a as n,c as r,d as i,f as a,g as o,h as s,l as c,m as l,o as u,ot as d,p as f,s as p,st as m,u as h}from"./vendor-base-ui-wXsskyKm.js";import{n as g}from"./vendor-react-BkccXcWz.js";import{r as _}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as v}from"./useUIStore-68ZPpgYA.js";import{io as y}from"./ui-BCYkB585.js";import{n as b}from"./Icon-C1rjS64C.js";import{t as x}from"./i18n-iu4pzqPi.js";import{t as S}from"./ScrollableOverlay-CEglrXfm.js";import{t as C}from"./MobileResizableSheet-CkA7qhco.js";import{r as w}from"./device-TCHW5U2y.js";var T=g(),E=e(m(),1),D=d(),O=E.createContext(null),ee=e=>e?e.closest(`[data-slot="dialog-content"], [role="dialog"]`):null,k=()=>{let e={reason:`none`,event:new Event(`change`),cancel:()=>{e.isCanceled=!0},allowPropagation:()=>{e.isPropagationAllowed=!0},isCanceled:!1,isPropagationAllowed:!1,trigger:void 0};return e};function A({onValueChange:e,open:t,defaultOpen:n=!1,onOpenChange:r,modal:i=!1,...a}){let[s,c]=E.useState(null),[l,u]=E.useState(n),[d,f]=E.useState(null),p=t??l,m=E.useRef(p);m.current=p;let h=_((e,n)=>{r?.(e,n),!n.isCanceled&&(m.current=e,t===void 0&&u(e))}),g=_(e=>{e!==m.current&&h(e,k())}),v=E.useMemo(()=>({portalContainer:s,setPortalContainer:c,open:p,setOpen:g,triggerAriaLabel:d,setTriggerAriaLabel:f}),[p,s,g,d]),y=E.useCallback((t,n)=>{typeof t==`string`&&e?.(t,n)},[e]);return(0,D.jsx)(O.Provider,{value:v,children:(0,D.jsx)(o,{...a,open:p,modal:i,onOpenChange:h,onValueChange:y})})}function j(e){let t=(0,T.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,D.jsx)(u,{"data-slot":`select-group`,...n}),t[2]=n,t[3]=r),r}function M(e){let t=(0,T.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({placeholder:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=e=>{let t=typeof e==`string`||e===void 0?e:e===null?void 0:String(e);return typeof n==`function`?n(t):n??(t===void 0||t===``?r:t)},t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==i||t[8]!==a?(o=(0,D.jsx)(l,{"data-slot":`select-value`,...i,children:a}),t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function N(e){let t=(0,T.c)(40),n,r,i,a,o,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],l=t[7]):({className:i,size:l,children:r,asChild:n,onPointerDownCapture:o,onFocusCapture:a,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=l);let u=l===void 0?`default`:l,d=E.useContext(O),p=typeof c[`aria-label`]==`string`?c[`aria-label`]:null,m;t[8]!==d||t[9]!==p?(m=()=>{d?.setTriggerAriaLabel(p)},t[8]=d,t[9]=p,t[10]=m):m=t[10];let h=d?.setTriggerAriaLabel,g;t[11]!==h||t[12]!==p?(g=[h,p],t[11]=h,t[12]=p,t[13]=g):g=t[13],E.useEffect(m,g);let _;t[14]===d?_=t[15]:(_=e=>{if(!d)return;let t=e instanceof HTMLElement?e:null;d.setPortalContainer(ee(t))},t[14]=d,t[15]=_);let v=_,x;t[16]!==n||t[17]!==r?(x=n&&E.isValidElement(r)?{render:r}:null,t[16]=n,t[17]=r,t[18]=x):x=t[18];let S=x,C;t[19]===i?C=t[20]:(C=y(`border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex w-fit items-center justify-between gap-2 rounded-lg border bg-transparent px-2 py-2 typography-ui-label whitespace-nowrap shadow-none outline-none focus-visible:outline-none hover:bg-interactive-hover data-[popup-open]:bg-interactive-active focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-6 data-[size=sm]:h-6 data-[size=lg]:h-8 data-[size=lg]:py-1.5 data-[size=chip]:h-7 data-[size=chip]:py-1 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[19]=i,t[20]=C);let w;t[21]!==o||t[22]!==v?(w=e=>{v(e.currentTarget),o?.(e)},t[21]=o,t[22]=v,t[23]=w):w=t[23];let k;t[24]!==a||t[25]!==v?(k=e=>{v(e.currentTarget),a?.(e)},t[24]=a,t[25]=v,t[26]=k):k=t[26];let A;t[27]===S?A=t[28]:(A=S??{},t[27]=S,t[28]=A);let j;t[29]!==S||t[30]!==r?(j=S?void 0:(0,D.jsxs)(D.Fragment,{children:[r,(0,D.jsx)(f,{children:(0,D.jsx)(b,{name:`arrow-down-s`,className:`size-4 opacity-50`})})]}),t[29]=S,t[30]=r,t[31]=j):j=t[31];let M;return t[32]!==c||t[33]!==u||t[34]!==A||t[35]!==j||t[36]!==C||t[37]!==w||t[38]!==k?(M=(0,D.jsx)(s,{"data-slot":`select-trigger`,"data-size":u,className:C,onPointerDownCapture:w,onFocusCapture:k,...c,...A,children:j}),t[32]=c,t[33]=u,t[34]=A,t[35]=j,t[36]=C,t[37]=w,t[38]=k,t[39]=M):M=t[39],M}function P(e){let t=(0,T.c)(67),n,r,o,s,c,l,u,d,f,p,m;t[0]===e?(n=t[1],r=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11]):({className:o,children:r,position:u,fitContent:d,portalToBody:f,sideOffset:l,side:c,align:n,collisionPadding:p,collisionAvoidance:m,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m);let g=u===void 0?`popper`:u,b=d!==void 0&&d,ee=f!==void 0&&f,k=p===void 0?8:p,A;t[12]===m?A=t[13]:(A=m===void 0?{side:`shift`,align:`shift`}:m,t[12]=m,t[13]=A);let j=A,M=E.useContext(O),{t:N}=x(),P=v(te),{isMobile:F}=w(),I=E.useId(),L=g===`item-aligned`,ne=M?.portalContainer??null,R=M?.open??!1,z;t[14]===M?z=t[15]:(z=e=>{M?.setOpen(e)},t[14]=M,t[15]=z);let B=_(z);if(P||F){let e=`mobile-select-sheet-${I}`,n;t[16]!==M?.triggerAriaLabel||t[17]!==N?(n=M?.triggerAriaLabel??N(`mobile.select.sheetAria`),t[16]=M?.triggerAriaLabel,t[17]=N,t[18]=n):n=t[18];let a;t[19]===N?a=t[20]:(a=N(`mobile.surface.closeAria`),t[19]=N,t[20]=a);let c;t[21]===N?c=t[22]:(c=N(`mobile.sessions.sheet.resizeAria`),t[21]=N,t[22]=c);let l;t[23]===o?l=t[24]:(l=y(o,`relative !max-h-none !w-full !min-w-0 !max-w-none bg-transparent text-foreground shadow-none outline-none`),t[23]=o,t[24]=l);let u;t[25]===r?u=t[26]:(u=(0,D.jsx)(S,{fillContainer:!1,outerClassName:`max-h-[calc(72dvh-5rem)]`,className:`flex max-h-[calc(72dvh-5rem)] w-full flex-col gap-1 py-1`,disableHorizontal:!0,preventOverscroll:!0,children:r}),t[25]=r,t[26]=u);let d;t[27]!==s||t[28]!==l||t[29]!==u?(d=(0,D.jsx)(i,{alignItemWithTrigger:!1,className:`!static !inset-auto !w-full !transform-none pointer-events-auto`,children:(0,D.jsx)(h,{...s,"data-slot":`select-content`,className:l,children:u})}),t[27]=s,t[28]=l,t[29]=u,t[30]=d):d=t[30];let f;return t[31]!==B||t[32]!==R||t[33]!==a||t[34]!==c||t[35]!==d||t[36]!==e||t[37]!==n?(f=(0,D.jsx)(C,{id:e,open:R,onOpenChange:B,fitContent:!0,ariaLabel:n,closeAriaLabel:a,resizeAriaLabel:c,bodyClassName:`px-2`,children:d}),t[31]=B,t[32]=R,t[33]=a,t[34]=c,t[35]=d,t[36]=e,t[37]=n,t[38]=f):f=t[38],f}let V=ee?void 0:ne||void 0,H;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(H={color:`var(--surface-elevated-foreground)`},t[39]=H):H=t[39];let U=!L&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,W=b&&`w-max min-w-0`,G;t[40]!==o||t[41]!==U||t[42]!==W?(G=y(`yuri-mobile-overlay-surface yuri-popup-surface pointer-events-auto transition-all duration-150 ease-out data-[starting-style]:opacity-0 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:scale-95 relative z-[120] max-h-[var(--available-height)] min-w-[8rem] origin-[var(--transform-origin)] overflow-x-hidden rounded-xl`,U,W,o),t[40]=o,t[41]=U,t[42]=W,t[43]=G):G=t[43];let K=b?`w-max`:`w-full`,q;t[44]===K?q=t[45]:(q=y(`max-h-[var(--available-height)]`,K),t[44]=K,t[45]=q);let J=!L&&(b?`w-max min-w-0 scroll-my-1`:`w-full min-w-[var(--anchor-width)] scroll-my-1`),Y;t[46]===J?Y=t[47]:(Y=y(`p-1`,J),t[46]=J,t[47]=Y);let X;t[48]!==r||t[49]!==q||t[50]!==Y?(X=(0,D.jsx)(S,{outerClassName:q,className:Y,preventOverscroll:!0,children:r}),t[48]=r,t[49]=q,t[50]=Y,t[51]=X):X=t[51];let Z;t[52]!==s||t[53]!==G||t[54]!==X?(Z=(0,D.jsx)(h,{"data-slot":`select-content`,style:H,className:G,...s,children:X}),t[52]=s,t[53]=G,t[54]=X,t[55]=Z):Z=t[55];let Q;t[56]!==n||t[57]!==L||t[58]!==j||t[59]!==k||t[60]!==c||t[61]!==l||t[62]!==Z?(Q=(0,D.jsx)(i,{alignItemWithTrigger:L,sideOffset:l,side:c,align:n,collisionPadding:k,collisionAvoidance:j,className:`absolute z-[120] pointer-events-auto`,children:Z}),t[56]=n,t[57]=L,t[58]=j,t[59]=k,t[60]=c,t[61]=l,t[62]=Z,t[63]=Q):Q=t[63];let $;return t[64]!==Q||t[65]!==V?($=(0,D.jsx)(a,{container:V,children:Q}),t[64]=Q,t[65]=V,t[66]=$):$=t[66],$}function te(e){return e.isMobile}function F(e){let t=(0,T.c)(8),r,i;t[0]===e?(r=t[1],i=t[2]):({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let a;t[3]===r?a=t[4]:(a=y(`text-muted-foreground px-2 py-1.5 typography-meta`,r),t[3]=r,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,D.jsx)(n,{"data-slot":`select-label`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function I(e){let t=(0,T.c)(13),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({className:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o;t[4]===i?o=t[5]:(o=y(`data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover data-[selected]:bg-interactive-selection data-[selected]:text-interactive-selection-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-pointer items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 typography-ui-label outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,i),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,D.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(r,{children:(0,D.jsx)(b,{name:`check`,className:`size-4`})})}),t[6]=s):s=t[6];let l;t[7]===n?l=t[8]:(l=(0,D.jsx)(p,{children:n}),t[7]=n,t[8]=l);let u;return t[9]!==a||t[10]!==o||t[11]!==l?(u=(0,D.jsxs)(c,{"data-slot":`select-item`,className:o,...a,children:[s,l]}),t[9]=a,t[10]=o,t[11]=l,t[12]=u):u=t[12],u}function L(e){let n=(0,T.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=y(`yuri-popup-separator bg-border pointer-events-none -mx-1 my-1 h-px`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,D.jsx)(t,{"data-slot":`select-separator`,className:a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}export{F as a,M as c,I as i,P as n,L as o,j as r,N as s,A as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./client-
|
|
1
|
+
import{n as e}from"./client-CmtAKi5B.js";import{Ii as t,Ni as n,Ui as r}from"./ui-BCYkB585.js";function i(e){if(!e||e.trim().length===0)return null;let r=t.getState(),i=r.activeSessions.find(t=>t.id===e)??r.archivedSessions.find(t=>t.id===e)??null;if(!i)return null;let a=n(i);return a?{sessionId:e,directory:a,session:i,fromCache:!r.hasLoaded,source:`memory`}:null}function a(e){return i(e)?.directory??null}var o=new Map;async function s(t,n){let a=t.trim();if(!a)return null;let s=i(a);if(s)return s;let c=o.get(a);if(c)return c;let l=(async()=>{let t=i(a);if(t)return t;let o=await r(a,{signal:n?.signal});if(o?.directory)return{sessionId:o.id,directory:o.directory,session:null,fromCache:!1,source:`session-index`};if(n?.trySessionGet===!1)return null;try{let t=await e.getSession(a),n=typeof t.directory==`string`&&t.directory.trim()||(typeof t.project?.worktree==`string`?t.project.worktree.trim():``)||null;return n?{sessionId:a,directory:n,session:t,fromCache:!1,source:`session-get`}:null}catch{return null}})().finally(()=>{o.get(a)===l&&o.delete(a)});return o.set(a,l),l}export{a as n,s as r,i as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/rolldown-runtime-hePW80VL.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,i as n,n as r}from"./runtime-switch-DEPKHgdL.js";import{n as i}from"./runtime-fetch-V-iMWR8t.js";import{B as a,F as o,L as s,N as c,P as l,R as u,X as d,h as f,n as p,p as m,t as h,z as g}from"./platform-z1TeG-ky.js";import{t as _}from"./runtimeAPIRegistry-C2VogTny.js";import{a as v,i as y,r as b}from"./vendor-zustand-CTekDqaS.js";import{ot as x,st as S}from"./vendor-base-ui-wXsskyKm.js";import{Ft as C,St as w}from"./gitApiHttp-Be5VpQHC.js";import{i as T,t as E}from"./safeStorage-DTOhKN0V.js";import{n as D}from"./client-i5Q82JUc.js";import{n as O}from"./pathNormalization-ewtPqJWn.js";import{n as k}from"./vendor-react-BkccXcWz.js";import{n as A,s as j,u as M}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{G as N,W as P}from"./runtime-file-resource-COtIWnSi.js";import{r as F}from"./vendor-reactuses-core-DjKFMfz7.js";import{o as I}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as L}from"./useUIStore-Dz0bOfkB.js";import{o as ee}from"./useMobileHtmlPreviewStore-BYunNOBo.js";import{a as R,t as te}from"./types-CjZZGQvx.js";import{Yn as ne,no as z,t as re,to as ie}from"./ui-DeV7Us1B.js";import{n as B}from"./Icon-C1m8PihJ.js";import{n as ae,t as oe}from"./i18n-CBCskgqa.js";import{t as se}from"./ScrollableOverlay-DIkp2MKc.js";import{n as ce,o as le,r as ue,t as de}from"./dialog-Cv20xnEj.js";import{t as fe}from"./device-gKeFQDLT.js";import{a as pe,c as me,g as he,n as ge,r as _e,u as ve}from"./gitApi-BH7j-M9u.js";import{n as ye}from"./MarkdownRenderer-GdoxOy4f.js";import{t as be}from"./checkbox-LzFeQCyX.js";import{i as xe,n as Se,r as Ce}from"./githubAuthQueries-Dli4cDU7.js";import{c as V,i as we,o as Te}from"./mcpQueries-lBUNZsO9.js";import{c as Ee,s as De}from"./usePluginsStore-CsChIifx.js";var Oe=k(),H=x();function ke(e){let t=(0,Oe.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,H.jsx)(`path`,{d:`M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z`}),r=(0,H.jsx)(`path`,{d:`M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:`0.5`,fillRule:`evenodd`,viewBox:`-0.5 -0.5 25 25`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var Ae={},U=(e,t=n())=>JSON.stringify([t,we(e)]),je=(e,t,n)=>{if(!e[t]?.[n])return e;let r={...e[t]};return delete r[n],{...e,[t]:r}},W=e=>{let t=we(e);return t?D.getScopedApiClient(t):D.getApiClient()},G=e=>e?{location:{directory:e}}:void 0,K=new Map,q=(e,t)=>JSON.stringify([r(),U(t),e]),Me=async(e,t,n)=>{let r=(await e.mcp.list(G(n))).data.find(e=>e.name===t)?.integrationID;if(!r)throw Error(`MCP server "${t}" has no authentication integration`);return(await e.integration.get({integrationID:r,...G(n)})).data},J=e=>we(e===void 0?w.getState().currentDirectory:e),Ne=v()(b((e,t)=>({diagnosticsByDirectory:{},getDiagnosticForDirectory:e=>{let n=U(J(e));return t().diagnosticsByDirectory[n]??Ae},clearDiagnostic:(t,n,r)=>{let i=U(J(n),r);e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,i,t)}))},connect:async(t,r)=>{let i=J(r),a=n(),o=U(i,a),s=W(i);try{await s.mcp.connect({server:t,...G(i)})}catch(n){let r=n instanceof Error?n.message:`Connection failed`;throw e(e=>({diagnosticsByDirectory:{...e.diagnosticsByDirectory,[o]:{...e.diagnosticsByDirectory[o]??{},[t]:{status:`failed`,error:r}}}})),n}await V(P,i,a),e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,o,t)}))},disconnect:async(t,r)=>{let i=J(r),a=n(),o=U(i,a);await W(i).mcp.disconnect({server:t,...G(i)}),await V(P,i,a),e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,o,t)}))},startAuth:async(e,t)=>{let n=J(t),r=q(e,n),i=W(n),a=await Me(i,e,n),o=a.methods.find(e=>e.type===`oauth`);if(!o)throw Error(`MCP server "${e}" has no OAuth method`);if(r!==q(e,n))throw Error(`MCP authorization runtime changed`);let s=K.get(r);if(s&&(await i.integration.oauth.cancel({integrationID:s.integrationID,attemptID:s.attempt.attemptID,...G(n)}),K.delete(r)),r!==q(e,n))throw Error(`MCP authorization runtime changed`);let{data:c}=await i.integration.oauth.connect({integrationID:a.id,methodID:o.id,...G(n)});if(r!==q(e,n))throw Error(`MCP authorization runtime changed`);for(let[e,t]of K)t.attempt.time.expires<=Date.now()&&K.delete(e);return K.set(r,{integrationID:a.id,attempt:c}),c},authStatus:async(e,t)=>{let n=J(t),r=q(e,n),i=K.get(r);if(!i)throw Error(`MCP authorization attempt not found`);let{data:a}=await W(n).integration.oauth.status({integrationID:i.integrationID,attemptID:i.attempt.attemptID,...G(n)});if(r!==q(e,n))throw Error(`MCP authorization runtime changed`);return a.status!==`pending`&&K.get(r)===i&&K.delete(r),a},completeAuth:async(e,t,r)=>{let i=J(r),a=n(),o=q(e,i),s=K.get(o);if(!s||s.attempt.mode!==`code`)throw Error(`MCP authorization requires the browser callback`);if(!t.trim())throw Error(`MCP authorization code is empty`);if(await W(i).integration.oauth.complete({integrationID:s.integrationID,attemptID:s.attempt.attemptID,code:t.trim(),...G(i)}),K.get(o)===s&&K.delete(o),o!==q(e,i))throw Error(`MCP authorization runtime changed`);await V(P,i,a)},clearAuth:async(e,t)=>{let r=J(t),i=n(),a=q(e,r),o=W(r),s=await Me(o,e,r);if(a!==q(e,r))throw Error(`MCP authorization runtime changed`);let c=K.get(a);c&&(await o.integration.oauth.cancel({integrationID:c.integrationID,attemptID:c.attempt.attemptID,...G(r)}),K.delete(a));let l=new Set(s.connections.flatMap(e=>e.type===`credential`?[e.id]:[]));for(let t of l){if(a!==q(e,r))throw Error(`MCP authorization runtime changed`);await o.credential.remove({credentialID:t})}if(a!==q(e,r))throw Error(`MCP authorization runtime changed`);await V(P,r,i)},testConnection:async(t,r)=>{let i=J(r),a=n(),o=U(i,a),s=W(i),c=Te(P,i,a)[t]?.status===`connected`,l,u;try{await s.mcp.connect({server:t,...G(i)})}catch(n){l=n instanceof Error?n.message:`Connection failed`,e(e=>({diagnosticsByDirectory:{...e.diagnosticsByDirectory,[o]:{...e.diagnosticsByDirectory[o]??{},[t]:{status:`failed`,error:l??`Connection failed`}}}}))}let d=(await V(P,i,a))[t],f=d;if(!c&&d?.status===`connected`){try{await s.mcp.disconnect({server:t,...G(i)})}catch(e){u=`Connection test succeeded, but cleanup disconnect failed: ${e instanceof Error?e.message:`Disconnect failed`}`}await V(P,i,a)}return l||e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,o,t)})),{status:f??Te(P,i,a)[t],error:l,warning:u}}}))),Y=e(S(),1),Pe=`https://yuri-updates.xiaobe.top/v1/update/check`,Fe=`https://yuri-origin.xiaobe.top/v1/update/check`,Ie=`https://github.com/yee94/yuri/releases/latest`,Le=`https://github.com/yee94/yuri/releases`,Re=`https://testflight.apple.com/join/pN5SSHeg`,ze=1e4;function Be(e){let t=String(e||``).replace(/^v/,``).split(`+`)[0]??``,n=t.indexOf(`-`);return{parts:(n>=0?t.slice(0,n):t).split(`.`).map(e=>{let t=Number.parseInt(e||`0`,10);return Number.isFinite(t)?t:0}),prerelease:n>=0}}function Ve(e,t){let n=Be(e),r=Be(t),i=Math.max(n.parts.length,r.parts.length);for(let e=0;e<i;e+=1){let t=(n.parts[e]||0)-(r.parts[e]||0);if(t!==0)return t}return n.prerelease===r.prerelease?0:n.prerelease?-1:1}function He(){return[Pe,Fe]}function Ue(e,t,n=Date.now){let r=e-n();return r<=0||t<=0?null:Math.max(1,Math.ceil(r/t))}function We(e){return{appType:`mobile-capacitor`,deviceClass:e.deviceClass||`mobile`,platform:e.platform===`ios`||e.platform===`android`?e.platform:`android`,arch:e.arch||`unknown`,channel:`stable`,currentVersion:e.currentVersion,instanceMode:`remote`,reportUsage:e.reportUsage===!0}}async function Ge(e,t,n,r){try{if(p())try{let{CapacitorHttp:r}=await I(async()=>{let{CapacitorHttp:e}=await import(`./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js`).then(e=>e.i);return{CapacitorHttp:e}},__vite__mapDeps([0,1])),i=Object.fromEntries(new Headers(t.headers).entries()),a;if(typeof t.body==`string`)try{a=JSON.parse(t.body)}catch{a=t.body}let o=await Promise.race([r.request({url:e,method:t.method||`GET`,headers:i,data:a,connectTimeout:n,readTimeout:n}),new Promise(e=>{window.setTimeout(()=>e(null),n)})]);return o?{ok:o.status>=200&&o.status<300,status:o.status,url:typeof o.url==`string`?o.url:e,json:async()=>{if(typeof o.data==`string`)try{return JSON.parse(o.data)}catch{return o.data}return o.data}}:null}catch{}let i=await r(e,{...t,signal:AbortSignal.timeout(n)});return{ok:i.ok,status:i.status,url:i.url,json:()=>i.json()}}catch{return null}}function Ke(e,t){return e===`ios`?Re:`${Le}/download/v${t}/app-release.apk`}function qe(e,t,n){if(typeof e.latestVersion!=`string`||e.latestVersion.trim().length===0)return null;let r=e.latestVersion.trim(),i=Ve(r,t);if(i<0)return null;let a=typeof e.releaseNotesUrl==`string`&&e.releaseNotesUrl.trim().length>0?e.releaseNotesUrl.trim():`${Le}/tag/v${r}`,o=typeof e.downloadUrl==`string`&&e.downloadUrl.trim().length>0?e.downloadUrl.trim():typeof e.download?.url==`string`&&e.download.url.trim().length>0?e.download.url.trim():Ke(n,r);return{available:!!e.updateAvailable&&i>0,version:r,currentVersion:t,body:typeof e.releaseNotes==`string`?e.releaseNotes:void 0,releaseUrl:a,downloadUrl:o,nextSuggestedCheckInSec:typeof e.nextSuggestedCheckInSec==`number`&&Number.isFinite(e.nextSuggestedCheckInSec)?e.nextSuggestedCheckInSec:void 0}}async function Je(e,t,n,r){let i=await Ge(e,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(We(t))},n,r);if(!i?.ok)return null;let a;try{a=await i.json()}catch{return null}return qe(a,t.currentVersion,t.platform)}async function Ye(e,t,n,r){let i=await Ge(Ie,{method:`GET`,headers:{Accept:`text/html`},redirect:`follow`},n,r);if(!i?.ok)return null;let a=typeof i.url==`string`&&i.url.length>0?i.url:Ie,o=null;try{o=new URL(a).pathname.match(/\/releases\/tag\/v(\d+\.\d+\.\d+(?:-[\w.]+)?)/)}catch{return null}if(!o?.[1])return null;let s=o[1],c=Ve(s,e),l=`${Le}/tag/v${s}`;return{available:c>0,version:s,currentVersion:e,releaseUrl:l,downloadUrl:Ke(t,s)}}async function Xe(e){let t=e.currentVersion?.trim()||`unknown`;if(t===`unknown`)return{available:!1,currentVersion:t,error:`Unable to check for mobile updates`};let n=e.fetchImpl??fetch,r=e.now??Date.now,i=He(),a=r()+ze;for(let[t,o]of i.entries()){let s=Ue(a,i.length-t+1,r);if(s===null)break;let c=await Je(o,e,s,n);if(c)return c}let o=Ue(a,1,r);if(o!==null){let r=await Ye(t,e.platform,o,n);if(r)return r}return{available:!1,currentVersion:t,error:`Unable to check for mobile updates`}}function Ze(){if(typeof window>`u`)return`unknown`;try{let{deviceType:e}=fe();return e}catch{return`unknown`}}function Qe(){let e=typeof window<`u`?window.__VSCODE_CONFIG__?.arch?.toLowerCase?.():void 0;if(e===`arm64`||e===`aarch64`)return`arm64`;if(e===`x64`||e===`amd64`||e===`x86_64`)return`x64`;let t=(typeof navigator<`u`?navigator.userAgentData:void 0)?.architecture?.toLowerCase?.();if(t===`arm`||t===`arm64`||t===`aarch64`)return`arm64`;if(t===`x86`||t===`x64`||t===`amd64`)return`x64`;let n=typeof navigator<`u`?navigator.userAgent.toLowerCase():``;return n.includes(`aarch64`)||n.includes(`arm64`)||n.includes(`armv`)?`arm64`:n.includes(`x86_64`)||n.includes(`x64`)||n.includes(`amd64`)||n.includes(`win64`)?`x64`:`unknown`}function $e(){let e=h();if(e===`android`||e===`ios`)return e;if(typeof navigator>`u`)return`web`;let t=(navigator.platform||``).toLowerCase();return t.includes(`mac`)?`macos`:t.includes(`win`)?`windows`:t.includes(`linux`)?`linux`:`web`}function et(e){let t=L.getState().reportUsage,n=new URLSearchParams({reportUsage:t?`true`:`false`});return n.set(`deviceClass`,Ze()),n.set(`arch`,Qe()),n.set(`platform`,$e()),e===`desktop`?(n.set(`appType`,`desktop-electron`),n.set(`instanceMode`,c()?`local`:`remote`),n):e===`vscode`?(n.set(`appType`,`vscode`),n.set(`instanceMode`,`local`),n):e===`mobile`?(n.set(`appType`,`mobile-capacitor`),n.set(`instanceMode`,`remote`),n):(n.set(`appType`,`web`),n.set(`instanceMode`,`unknown`),n)}async function tt(e,t){let n=t??`unknown`;try{let r=et(e),a=typeof window<`u`?window.__VSCODE_CONFIG__?.extensionVersion:void 0;t?r.set(`currentVersion`,t):e===`vscode`&&a&&r.set(`currentVersion`,a);let o=await i(`/api/yuri/update-check?${r.toString()}`,{method:`GET`,headers:{Accept:`application/json`}}),s=null;try{s=await o.json()}catch{s=null}if(!o.ok)return{available:!1,currentVersion:n,error:typeof s?.error==`string`&&s.error.trim().length>0?s.error.trim():`Server responded with ${o.status}`};if(!s)return{available:!1,currentVersion:n,error:`Update check returned an invalid response`};let c=typeof s.error==`string`&&s.error.trim().length>0?s.error.trim():void 0;return{available:s.available===!0,version:typeof s.version==`string`?s.version:void 0,currentVersion:typeof s.currentVersion==`string`?s.currentVersion:n,body:typeof s.body==`string`?s.body:void 0,releaseUrl:typeof s.releaseUrl==`string`?s.releaseUrl:void 0,downloadUrl:typeof s.downloadUrl==`string`?s.downloadUrl:void 0,nextSuggestedCheckInSec:typeof s.nextSuggestedCheckInSec==`number`&&Number.isFinite(s.nextSuggestedCheckInSec)?s.nextSuggestedCheckInSec:void 0,packageManager:typeof s.packageManager==`string`?s.packageManager:void 0,updateCommand:typeof s.updateCommand==`string`?s.updateCommand:void 0,error:c}}catch(e){return console.warn(`Failed to check for updates:`,e),{available:!1,currentVersion:n,error:e instanceof Error?e.message:`Failed to check for updates`}}}function nt(){return p()?`mobile`:o()?`desktop`:s()?`vscode`:u()?`web`:null}var rt={checking:!1,available:!1,downloading:!1,downloaded:!1,info:null,progress:null,error:null,downloadError:null,downloadVersion:null,downloadChannel:null,runtimeType:null,lastChecked:null,nextCheckInSec:null,otaDecision:null,otaPhase:`idle`,otaDownloadSkipped:!1,lastOtaChannelOverride:null},it=`yuri-client-update-download`,at=e=>typeof e==`string`&&/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/.test(e);function ot(){try{let e=JSON.parse(T().getItem(it)??`null`);return!e||e.runtimeType!==nt()||![`desktop`,`mobile`].includes(e.runtimeType)||!at(e.version)||![null,`stable`,`beta`].includes(e.channel)?{}:{runtimeType:e.runtimeType,downloadVersion:e.version,downloadChannel:e.channel,downloadError:`update_interrupted`}}catch{return{}}}function st(e,t){let n=e.isChannelRollback===!0?{isChannelRollback:!0}:{};if(e.primaryAction===`apply_ota`&&e.ota.bundle)return e.ota.bundle.releaseVersion===t?{available:!1,otaPhase:`idle`,info:{available:!1,currentVersion:t,nextSuggestedCheckInSec:e.nextCheckInSec,...n}}:{available:!0,otaPhase:`available`,info:{available:!0,version:e.ota.bundle.releaseVersion,currentVersion:t,downloadUrl:e.ota.bundle.url,nextSuggestedCheckInSec:e.nextCheckInSec,inAppApply:!0,...e.releaseNotes?{body:e.releaseNotes}:{},...n}};if(e.primaryAction===`install_native_required`){if(!e.native.version?.trim()||!e.native.installUrl?.trim())throw Error(`Native update required, but the update service supplied no complete installation target`);return{available:e.native.state===`required`||e.native.state===`available`,otaPhase:`idle`,info:{available:e.native.state===`required`||e.native.state===`available`,version:e.native.version,currentVersion:t,downloadUrl:e.native.installUrl,nextSuggestedCheckInSec:e.nextCheckInSec,manualUpdate:!0,...e.releaseNotes?{body:e.releaseNotes}:{},...n}}}return{available:!1,otaPhase:`idle`,info:{available:!1,currentVersion:t,nextSuggestedCheckInSec:e.nextCheckInSec,...n}}}var ct=0,lt=v()((e,t)=>({...rt,...ot(),checkForUpdates:async()=>{let n=nt();if(!n)return null;let r=++ct;e({checking:!0,error:null,runtimeType:n});try{let i=null,a=null;if(n===`desktop`){let n=L.getState().otaChannelOverride;t().lastOtaChannelOverride!==n&&e({downloaded:!1,downloading:!1,available:!1,info:null,otaDecision:null,progress:null,otaPhase:`checking`});let i=await m(n);if(r!==ct||L.getState().otaChannelOverride!==n)return null;let a=i?.downloaded===!0,o=!a&&i?.downloading===!0;return e({checking:!1,available:i?.available??!1,downloaded:a,...a?{downloading:!1,progress:null,downloadError:null}:o?{downloading:!0,progress:i?.progress??null}:{},info:i,error:null,lastChecked:Date.now(),nextCheckInSec:i?.nextSuggestedCheckInSec??null,otaDecision:i?.otaDecision??null,otaPhase:a?`pending_restart`:o?`downloading`:i?.inAppApply?`available`:`idle`,lastOtaChannelOverride:n}),i?.nextSuggestedCheckInSec??null}if(n===`web`)i=await tt(`web`),a=i?.nextSuggestedCheckInSec??null;else if(n===`vscode`)a=(await tt(`vscode`))?.nextSuggestedCheckInSec??null;else if(n===`mobile`){let n=await R()??`unknown`,r=p()?_()?.mobileUpdates:void 0,o=L.getState().otaChannelOverride;if(r)try{let i=t().lastOtaChannelOverride!==o;e(i?{otaDecision:null,otaPhase:`checking`,downloaded:!1,otaDownloadSkipped:!1,progress:null,available:!1,info:null}:{otaPhase:`checking`});let a=await r.checkForOtaUpdate(o===`beta`||o===`stable`?{channelOverride:o}:void 0),s=st(a,n),c=(i?void 0:t().otaDecision?.ota.bundle?.bundleId)!==a.ota.bundle?.bundleId,l=!i&&t().downloaded&&!c;return e({checking:!1,available:s.available,info:s.info,error:s.info.error??null,lastChecked:Date.now(),nextCheckInSec:a.nextCheckInSec,otaDecision:a,otaPhase:l?`pending_restart`:s.otaPhase,lastOtaChannelOverride:o,...c||i?{downloaded:!1,otaDownloadSkipped:!1,progress:null}:{}}),a.nextCheckInSec}catch(t){if(!(t instanceof te)){let r=t instanceof Error?t.message:`Mobile OTA check failed`;return e({checking:!1,available:!1,info:{available:!1,currentVersion:n},error:r,lastChecked:Date.now(),otaDecision:null,otaPhase:`error`,lastOtaChannelOverride:o}),null}}return i=await Xe({currentVersion:n,platform:$e()===`ios`?`ios`:`android`,deviceClass:Ze(),arch:Qe(),reportUsage:L.getState().reportUsage}),a=i?.nextSuggestedCheckInSec??null,e({checking:!1,available:i?.available??!1,info:i,error:i?.error??null,lastChecked:Date.now(),nextCheckInSec:a,otaDecision:null,otaPhase:`idle`}),a}return e({checking:!1,available:n===`vscode`?!1:i?.available??!1,info:n===`vscode`?null:i,error:n===`vscode`?null:i?.error??null,lastChecked:Date.now(),nextCheckInSec:a}),a}catch(i){return r===ct&&e({checking:!1,error:i instanceof Error?i.message:`Failed to check for updates`,...n===`desktop`&&!t().downloaded?{otaPhase:`error`}:{}}),null}},downloadUpdate:async n=>{n?.resume===!0&&!t().info&&await t().checkForUpdates();let{available:r,runtimeType:i,otaDecision:a,downloading:o,downloaded:s}=t();if(o||s)return;let c=L.getState().otaChannelOverride,l=n?.resume===!0,u=l?t().downloadVersion:t().info?.version;if(l&&(t().downloadChannel!==c||u!==t().info?.version)){e({downloadError:`update_plan_changed`,error:`update_plan_changed`});return}if(i===`mobile`&&a?.primaryAction===`apply_ota`&&a.ota.bundle){if(o||s)return;let t=_()?.mobileUpdates;if(!t){e({error:`Mobile OTA updates are unavailable in this runtime`,downloadError:`Mobile OTA updates are unavailable in this runtime`,otaPhase:`error`});return}e({downloading:!0,error:null,downloadError:null,downloadVersion:u??null,downloadChannel:c,progress:null,otaPhase:`downloading`,otaDownloadSkipped:!1});try{let{skipped:n}=await t.downloadOtaUpdate(a.ota.bundle);await t.queueOtaUpdateForNextLaunch(),e({downloading:!1,downloaded:!0,downloadError:null,progress:null,otaPhase:`pending_restart`,otaDownloadSkipped:n})}catch(t){e({downloading:!1,error:t instanceof Error?t.message:`Failed to download update`,downloadError:t instanceof Error?t.message:`Failed to download update`,otaPhase:`error`})}return}if(!(i!==`desktop`||!r)){e({downloading:!0,error:null,downloadError:null,downloadVersion:u??null,downloadChannel:c,progress:null});try{let n=L.getState().otaChannelOverride,r=await m(n);if(n!==L.getState().otaChannelOverride)throw Error(`OTA channel changed`);if(u&&r?.version!==u)throw Error(`update_plan_changed`);if(!r?.available||r.manualUpdate)throw Error(`Update detected, but desktop package is not ready yet. Retry in a moment.`);if(e(e=>({info:e.info?{...e.info,...r,body:r.body||e.info.body,available:e.info.available}:r})),r.downloaded||t().downloaded){e({downloading:!1,downloaded:!0,progress:null});return}if(r.downloading&&e({downloading:!0,progress:r.progress??{downloaded:0}}),!await f(t=>{e({progress:t})}))throw Error(`Failed to download update`);e({downloading:!1,downloaded:!0,progress:null,otaPhase:`pending_restart`})}catch(t){e({downloading:!1,error:t instanceof Error?t.message:`Failed to download update`,downloadError:t instanceof Error?t.message:`Failed to download update`})}}},subscribeDesktopUpdateEvents:async()=>{if(!o())return()=>{};let n=[],r=await g(n=>{let r=n.event,i=n.data??null;if(r===`Started`){if(!t().downloading)return;e({error:null,progress:{downloaded:0,total:typeof i?.contentLength==`number`?i.contentLength:void 0}});return}if(r===`Progress`){if(!t().downloading)return;e({progress:{downloaded:typeof i?.downloaded==`number`?i.downloaded:0,total:typeof i?.total==`number`?i.total:void 0}});return}r===`Finished`&&e({downloading:!1,downloaded:!0,progress:null,downloadError:null})});r&&n.push(r);let i=await a(t=>{t.downloaded&&e({downloading:!1,downloaded:!0,available:!0,progress:null,downloadError:null})});return i&&n.push(i),async()=>{for(let e of n)try{let t=e();t instanceof Promise&&await t}catch{}}},restartToUpdate:async()=>{let{downloaded:n,runtimeType:r,otaDecision:i}=t();if(r===`mobile`&&i?.primaryAction===`apply_ota`){if(!n)return;let t=_()?.mobileUpdates;if(!t){e({error:`Mobile OTA updates are unavailable in this runtime`,otaPhase:`error`});return}try{await t.applyOtaUpdateNow()}catch(t){e({error:t instanceof Error?t.message:`Failed to restart`,otaPhase:`error`})}return}if(!(r!==`desktop`||!n))try{if(!await d())throw Error(`Failed to restart`)}catch(t){e({error:t instanceof Error?t.message:`Failed to restart`})}},setOtaPhase:(t,n=null)=>{e({otaPhase:t,...n===void 0?{}:{error:n}})},setOtaDownloadPercent:n=>{if(!Number.isFinite(n)||n<0||n>100)return;let r=t();if(!r.downloading)return;let i=Math.round(n);if((r.progress?.total?Math.round(r.progress.downloaded/r.progress.total*100):null)===i)return;let a=r.otaDecision?.ota.bundle?.size;if(typeof a==`number`&&Number.isFinite(a)&&a>0){e({progress:{downloaded:Math.round(a*n/100),total:a}});return}e({progress:{downloaded:n,total:100}})},setOtaDownloadFailed:t=>{e({downloading:!1,downloaded:!1,error:t??`Failed to download update`,downloadError:t??`Failed to download update`,otaPhase:`error`})},dismiss:()=>{let n=t();n.otaPhase===`pending_restart`||n.downloading||n.downloadError||e({available:!1,downloaded:!1,info:null,otaDecision:null,otaPhase:`idle`,otaDownloadSkipped:!1})},discardInterruptedDownload:()=>{t().downloading||e({downloadError:null,downloadVersion:null,downloadChannel:null,error:null,progress:null})},reset:()=>{e(rt)}}));lt.subscribe((e,t)=>{if(e.downloading===t.downloading&&e.downloaded===t.downloaded&&e.downloadError===t.downloadError&&e.downloadVersion===t.downloadVersion&&e.downloadChannel===t.downloadChannel)return;let n=T();(e.downloading||e.downloadError)&&!e.downloaded&&at(e.downloadVersion)?n.setItem(it,JSON.stringify({version:e.downloadVersion,channel:e.downloadChannel,runtimeType:e.runtimeType})):n.removeItem(it)});var ut=8e3,X=e=>!!(e&&![`succeeded`,`failed`].includes(e.status));function Z(e,t){if(e!==n()||t!==r())throw Error(`Stale update runtime`)}var Q=(e=n(),t=r(),a)=>({queryKey:[e,`host-update`,t,a??`current`],queryFn:async({signal:n})=>{Z(e,t);let r=new AbortController,o=()=>r.abort();n.addEventListener(`abort`,o,{once:!0});let s;try{return await Promise.race([(async()=>{let n=await i(`/api/system/update${a?`?channel=${a}`:``}`,{headers:{Accept:`application/json`},signal:r.signal});if([404,501].includes(n.status))throw Error(`host_update_unsupported`);let o=await n.json();if(Z(e,t),!n.ok&&n.status!==502||typeof o.serverId!=`string`||typeof o.supported!=`boolean`||![`cli`,`electron`].includes(o.host))throw Error(`Host update check failed`);return o})(),new Promise((e,t)=>{s=setTimeout(()=>{r.abort(),t(Error(`host_update_timeout`))},ut)})])}finally{s!==void 0&&clearTimeout(s),n.removeEventListener(`abort`,o)}},staleTime:6e4,retry:!1}),dt=(e=n(),t=r(),i)=>P.getQueryData(Q(e,t,i).queryKey),ft=(e=n(),t=r(),i)=>{let a=dt(e,t,i);return P.fetchQuery({...Q(e,t,i),staleTime:a?.checkError||X(a?.operation)?0:6e4})},pt=(e=n(),t=r(),i)=>P.fetchQuery({...Q(e,t,i),staleTime:0}),mt=(e,t,n)=>{let r=(0,Oe.c)(6),i;r[0]!==n||r[1]!==t||r[2]!==e?(i=Q(e,t,n),r[0]=n,r[1]=t,r[2]=e,r[3]=i):i=r[3];let a;return r[4]===i?a=r[5]:(a={...i,refetchInterval:_t,refetchIntervalInBackground:!1},r[4]=i,r[5]=a),j(a)};async function ht(e,t,n){if(Z(t,n),!e.update)throw Error(`No update plan`);let r=await i(`/api/system/update`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({version:e.update.version,channel:e.channel,planId:e.update.planId,allowDowngrade:e.update.rollback===!0})});if(Z(t,n),!r.ok)throw Error(`Host update was not accepted`);let a=await r.json();if(typeof a.operation?.id!=`string`)throw Error(`Invalid update operation`);return a.operation}async function gt(e,t,n){Z(t,n);let r=await pt(t,n,e.channel);Z(t,n);let i=r.operation;if(i?.id===e.id&&i.version===e.version&&i.channel===e.channel&&i.kind===e.kind&&(X(i)||i.status===`succeeded`&&r.currentVersion===e.version))return P.setQueryData(Q(t,n).queryKey,r),i;if(r.checkError||r.update?.version!==e.version||r.update.kind!==e.kind)throw Error(`update_plan_changed`);let a=await ht(r,t,n);return Z(t,n),P.setQueryData(Q(t,n).queryKey,e=>({...e??r,operation:a})),a}function _t(e){return X(e.state.data?.operation)?2e3:e.state.error?.message===`host_update_unsupported`?!1:e.state.error?15e3:3e5}function vt(e){let t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(ae(),{year:`numeric`,month:`short`,day:`numeric`}).format(t)}function yt(e){return e.replace(/^## \[[^\]]+\] - \d{4}-\d{2}-\d{2}\s*\n?/,``).trim()}function bt(e){return e.replace(/(^|[^a-zA-Z0-9])@([a-zA-Z0-9-]+)/g,`$1[@$2](https://github.com/$2)`)}function xt(e,t){let n=e.split(`.`).map(e=>Number.parseInt(e,10)),r=t.split(`.`).map(e=>Number.parseInt(e,10));for(let e=0;e<3;e+=1){let t=Number.isFinite(n[e])?n[e]:0,i=Number.isFinite(r[e])?r[e]:0;if(t!==i)return i-t}return 0}function St(e){let t=/^## \[(\d+\.\d+\.\d+)\] - (\d{4}-\d{2}-\d{2})\s*$/gm,n=[],r;for(;(r=t.exec(e))!==null;)n.push({version:r[1]??``,date:r[2]??``,start:r.index});return n.map((t,r)=>{let i=n[r+1]?.start??e.length;return{version:t.version,date:t.date,start:t.start,end:i,raw:e.slice(t.start,i).trim()}})}function Ct(e){let t=(0,Oe.c)(70),{open:n,onOpenChange:r,model:i,onAction:a}=e,{t:o}=oe(),[s,c]=(0,Y.useState)(!1),l=F(Tt),u;t[0]===l?u=t[1]:(u=e=>{let t=e.target.closest(`a`);t?.href&&(e.preventDefault(),e.stopPropagation(),l(t.href))},t[0]=l,t[1]=u);let d=F(u),f;t[2]===i.fallbackCommand?f=t[3]:(f=async()=>{i.fallbackCommand&&(await ie(i.fallbackCommand)).ok&&(c(!0),setTimeout(()=>c(!1),2e3))},t[2]=i.fallbackCommand,t[3]=f);let p=F(f),m;if(t[4]!==i.body||t[5]!==o){bb0:{let e=i.body?.trim();if(!e){m=null;break bb0}let n=St(e);if(!n.length){m={kind:`raw`,title:o(`updateDialog.changelog.title`),content:bt(e)};break bb0}let r;t[7]===o?r=t[8]:(r=o(`updateDialog.changelog.title`),t[7]=o,t[8]=r),m={kind:`sections`,title:r,sections:[...n].sort(wt).map(t=>({version:t.version,dateLabel:vt(t.date),content:bt(yt(t.raw)||e)}))}}t[4]=i.body,t[5]=o,t[6]=m}else m=t[6];let h=m,g=i.dismissible===!1?void 0:r,_=i.stableLayout&&`h-[min(38rem,calc(100dvh-2rem))] overflow-hidden transition-[opacity,transform,filter]`,v;t[9]===_?v=t[10]:(v=z(`max-w-4xl gap-0 p-4 sm:p-5 bg-background border-[var(--interactive-border)]`,_),t[9]=_,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,H.jsx)(B,{name:`download-cloud`,className:`h-5 w-5 text-[var(--primary-base)]`}),t[11]=y):y=t[11];let b;t[12]===i.title?b=t[13]:(b=(0,H.jsxs)(le,{className:`flex items-center gap-2`,children:[y,(0,H.jsx)(`span`,{className:`font-semibold text-foreground`,children:i.title})]}),t[12]=i.title,t[13]=b);let x;t[14]!==i.currentVersion||t[15]!==i.methodLabel||t[16]!==i.version?(x=(i.currentVersion||i.version)&&(0,H.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1.5 pl-7 font-mono text-[11px] leading-4 tracking-[-0.01em] tabular-nums sm:text-xs`,children:[i.currentVersion&&(0,H.jsx)(`span`,{className:`text-muted-foreground/75`,children:i.currentVersion}),i.currentVersion&&i.version&&(0,H.jsx)(`span`,{className:`text-muted-foreground/40`,children:`→`}),i.version&&(0,H.jsx)(`span`,{className:`font-medium text-[var(--primary-base)]`,children:i.version}),i.methodLabel&&(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,i.methodLabel]})]}),t[14]=i.currentVersion,t[15]=i.methodLabel,t[16]=i.version,t[17]=x):x=t[17];let S;t[18]===i.description?S=t[19]:(S=i.description&&(0,H.jsx)(ue,{className:`mt-2`,children:i.description}),t[18]=i.description,t[19]=S);let C;t[20]!==S||t[21]!==b||t[22]!==x?(C=(0,H.jsxs)(`div`,{className:`mb-3 shrink-0 pr-8 sm:mb-4`,children:[b,x,S]}),t[20]=S,t[21]=b,t[22]=x,t[23]=C):C=t[23];let w=i.stableLayout?`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto`:`space-y-3 sm:space-y-4`,T;t[24]===i.message?T=t[25]:(T=i.message&&(0,H.jsx)(`p`,{role:`status`,className:`typography-ui-label text-muted-foreground`,children:i.message}),t[24]=i.message,t[25]=T);let E;t[26]===i.warning?E=t[27]:(E=i.warning&&(0,H.jsx)(`p`,{className:`typography-meta text-[var(--status-warning)]`,children:i.warning}),t[26]=i.warning,t[27]=E);let D;t[28]!==h||t[29]!==d||t[30]!==i.hideChangelog||t[31]!==i.stableLayout?(D=h&&!i.hideChangelog&&(0,H.jsxs)(`section`,{className:z(`overflow-hidden rounded-xl border border-[var(--surface-subtle)] bg-[var(--surface-elevated)]/20`,i.stableLayout&&`flex min-h-0 flex-1 flex-col`),children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--surface-subtle)] px-3.5 py-2.5 sm:px-4 sm:py-3`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--primary-base)]`,"aria-hidden":`true`}),(0,H.jsx)(`h3`,{className:`typography-ui-caption font-medium text-muted-foreground`,children:h.title})]}),(0,H.jsx)(se,{className:i.stableLayout?`p-0`:`max-h-[min(42dvh,22rem)] p-0 sm:max-h-[400px]`,outerClassName:i.stableLayout?`flex-1`:void 0,fillContainer:!!i.stableLayout,children:h.kind===`raw`?(0,H.jsx)(`div`,{className:`break-words px-3.5 py-2 text-[13px] leading-[1.65] text-foreground sm:px-4 sm:text-sm [&_.markdown-content]:leading-[1.65] [&_.markdown-content>:first-child]:!mt-0 [&_.markdown-content>:first-child>:first-child]:!mt-0 [&_.markdown-content>:last-child]:!mb-0 [&_a]:!text-[var(--primary-base)] [&_a]:!no-underline [&_a:hover]:!underline`,onClickCapture:d,children:(0,H.jsx)(ye,{content:h.content,disableLinkSafety:!0,enableFileReferences:!1})}):(0,H.jsx)(`div`,{className:`divide-y divide-[var(--surface-subtle)]`,children:h.sections.map(e=>(0,H.jsxs)(`div`,{className:`px-3.5 py-2 sm:px-4`,children:[(0,H.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-center gap-x-2 gap-y-1 sm:mb-3`,children:[(0,H.jsxs)(`span`,{className:`rounded-md bg-[var(--primary-base)]/10 px-1.5 py-0.5 font-mono text-[11px] font-medium leading-4 text-[var(--primary-base)] tabular-nums sm:text-xs`,children:[`v`,e.version]}),(0,H.jsx)(`span`,{className:`text-[11px] leading-4 text-muted-foreground/75 sm:text-xs`,children:e.dateLabel})]}),(0,H.jsx)(`div`,{className:`break-words text-[13px] leading-[1.65] text-foreground sm:text-sm [&_.markdown-content]:leading-[1.65] [&_a]:!text-[var(--primary-base)] [&_a]:!no-underline [&_a:hover]:!underline`,onClickCapture:d,children:(0,H.jsx)(ye,{content:e.content,disableLinkSafety:!0,enableFileReferences:!1})})]},e.version))})})]}),t[28]=h,t[29]=d,t[30]=i.hideChangelog,t[31]=i.stableLayout,t[32]=D):D=t[32];let O;t[33]!==s||t[34]!==p||t[35]!==i.fallbackCommand||t[36]!==o?(O=i.fallbackCommand&&(0,H.jsxs)(`div`,{className:`space-y-2 mt-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 typography-meta text-muted-foreground`,children:[(0,H.jsx)(B,{name:`terminal`,className:`h-4 w-4`}),(0,H.jsx)(`span`,{children:o(`updateDialog.fallback.updateViaTerminal`)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 p-1 pl-3 bg-[var(--surface-elevated)]/50 rounded-md border border-[var(--surface-subtle)]`,children:[(0,H.jsx)(`code`,{className:`flex-1 font-mono text-sm text-foreground overflow-x-auto whitespace-nowrap`,children:i.fallbackCommand}),(0,H.jsx)(`button`,{onClick:p,className:z(`flex items-center justify-center p-2 rounded`,`text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]`,`transition-colors`,s&&`text-[var(--status-success)]`),title:o(s?`updateDialog.actions.copied`:`updateDialog.actions.copyCommand`),children:(0,H.jsx)(B,{name:s?`check`:`clipboard`,className:`h-4 w-4`})})]})]}),t[33]=s,t[34]=p,t[35]=i.fallbackCommand,t[36]=o,t[37]=O):O=t[37];let k;t[38]!==i.stableLayout||t[39]!==i.status?(k=i.status&&(0,H.jsxs)(`div`,{role:`status`,className:z(`space-y-2`,i.stableLayout&&`min-h-9 shrink-0`),children:[(0,H.jsxs)(`div`,{className:`flex h-5 items-center justify-between gap-3`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium text-muted-foreground sm:text-[13px]`,children:[i.status.kind===`activity`&&(0,H.jsx)(B,{name:`loader`,className:`h-3.5 w-3.5 shrink-0 animate-spin text-[var(--primary-base)]`}),(0,H.jsx)(`span`,{className:`truncate`,title:i.status.label,children:i.status.label})]}),i.status.progress!=null&&(0,H.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] leading-4 text-foreground tabular-nums sm:text-xs`,children:[Math.round(i.status.progress),`%`]})]}),(0,H.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-[var(--surface-subtle)] sm:h-1.5`,children:i.status.progress==null?(0,H.jsx)(`div`,{className:`h-full w-1/3 animate-pulse rounded-full bg-[var(--primary-base)]/60`}):(0,H.jsx)(`div`,{className:`h-full rounded-full bg-[var(--primary-base)] transition-[width] duration-500`,style:{width:`${i.status.progress}%`}})}),i.status.detail&&(0,H.jsx)(`p`,{className:`text-xs leading-4 text-muted-foreground`,children:i.status.detail})]}),t[38]=i.stableLayout,t[39]=i.status,t[40]=k):k=t[40];let A;t[41]===i.error?A=t[42]:(A=i.error&&(0,H.jsx)(`div`,{role:`alert`,className:`p-3 mt-4 bg-[var(--status-error-background)] border border-[var(--status-error-border)] rounded-lg`,children:(0,H.jsx)(`p`,{className:`text-sm text-[var(--status-error)]`,children:i.error})}),t[41]=i.error,t[42]=A);let j;t[43]!==w||t[44]!==T||t[45]!==E||t[46]!==D||t[47]!==O||t[48]!==k||t[49]!==A?(j=(0,H.jsxs)(`div`,{className:w,children:[T,E,D,O,k,A]}),t[43]=w,t[44]=T,t[45]=E,t[46]=D,t[47]=O,t[48]=k,t[49]=A,t[50]=j):j=t[50];let M;t[51]===i.option?M=t[52]:(M=i.option&&(0,H.jsxs)(`div`,{className:z(`mt-4 flex shrink-0 items-start gap-2.5`,i.option.disabled&&`opacity-60`),children:[(0,H.jsx)(be,{checked:i.option.checked,onChange:i.option.onChange,disabled:i.option.disabled,ariaLabel:i.option.label,className:`mt-0.5 self-start`}),(0,H.jsxs)(`span`,{className:z(`min-w-0 space-y-0.5`,i.option.disabled?`cursor-not-allowed`:`cursor-pointer`),onClick:i.option.disabled?void 0:()=>i.option?.onChange(!i.option.checked),children:[(0,H.jsx)(`span`,{className:`block typography-ui-label text-foreground`,children:i.option.label}),i.option.hint&&(0,H.jsx)(`span`,{className:`block typography-meta text-muted-foreground`,children:i.option.hint})]})]}),t[51]=i.option,t[52]=M);let N;t[53]===i.notice?N=t[54]:(N=i.notice&&(0,H.jsxs)(`div`,{className:`mt-4 flex items-center gap-2 rounded-lg border border-[var(--status-success-border)] bg-[var(--status-success-background)] px-3 py-2.5 text-sm text-[var(--status-success)]`,children:[(0,H.jsx)(B,{name:`check`,className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:i.notice})]}),t[53]=i.notice,t[54]=N);let P;t[55]!==i.actions||t[56]!==i.releaseLink||t[57]!==a?(P=(i.releaseLink||i.actions.length>0)&&(0,H.jsxs)(`div`,{className:`mt-4 flex shrink-0 items-center justify-between gap-4`,children:[i.releaseLink&&(0,H.jsxs)(`a`,{href:i.releaseLink.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 typography-ui-label text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:[(0,H.jsx)(B,{name:`external-link`,className:`h-4 w-4`}),i.releaseLink.label]}),(0,H.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-nowrap items-center justify-end gap-2`,children:i.actions.map(e=>(0,H.jsxs)(ne,{onClick:()=>a(e.id),disabled:e.disabled,variant:e.variant??`default`,size:`default`,className:`min-w-0 shrink`,title:e.label,children:[e.icon&&(0,H.jsx)(B,{name:e.icon,className:z(`h-4 w-4`,e.loading&&`animate-spin`)}),(0,H.jsx)(`span`,{className:`truncate`,children:e.label})]},e.id))})]}),t[55]=i.actions,t[56]=i.releaseLink,t[57]=a,t[58]=P):P=t[58];let I;t[59]!==C||t[60]!==j||t[61]!==M||t[62]!==N||t[63]!==P||t[64]!==v?(I=(0,H.jsxs)(ce,{className:v,showCloseButton:!0,children:[C,j,M,N,P]}),t[59]=C,t[60]=j,t[61]=M,t[62]=N,t[63]=P,t[64]=v,t[65]=I):I=t[65];let L;return t[66]!==n||t[67]!==I||t[68]!==g?(L=(0,H.jsx)(de,{open:n,onOpenChange:g,children:I}),t[66]=n,t[67]=I,t[68]=g,t[69]=L):L=t[69],L}function wt(e,t){return xt(e.version,t.version)}function Tt(e){ee(e)}var Et=`https://github.com/yee94/yuri/releases`,Dt=2e3,Ot=6e5,$=e=>e.transport===n()&&e.generation===r();async function kt(e,t){try{if(!$(t))return{success:!1};let n=await ft(t.transport,t.generation);return!$(t)||!e||!n.supported||n.update?.version!==e||n.update.rollback?{success:!1}:(await ht(n,t.transport,t.generation),{success:!0,autoRestart:!0})}catch(e){return{success:!1,error:e instanceof Error?e.message:void 0}}}async function At(e,t){let n;try{n=await ft(t.transport,t.generation)}catch(e){if(e instanceof Error&&e.message===`host_update_unsupported`)return!1;throw e}if(!$(t))throw Error(`Stale update runtime`);return!e||!n.supported||!n.update||n.update.rollback||n.update.version!==e?!1:(await ht(n,t.transport,t.generation),!0)}async function jt(e,t,n=Math.ceil(Ot/Dt),r=Dt){for(let i=0;i<n;i++){if(!$(t))return!1;try{let n=await pt(t.transport,t.generation);if(n.operation?.status===`failed`)return!1;if(n.currentVersion===e&&n.operation?.status===`succeeded`&&$(t))return!0}catch{}await new Promise(e=>setTimeout(e,r))}return!1}var Mt=({open:e,onOpenChange:t,info:i,downloading:a,downloaded:o,progress:s,error:u,onDownload:d,onRestart:f,runtimeType:p=`desktop`})=>{let{t:m}=oe(),[h,g]=(0,Y.useState)(`idle`),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(!0),x=lt(e=>e.otaDownloadSkipped),S=i?.releaseUrl||(i?.version?`${Et}/tag/v${i.version}`:Et),C=i?.downloadUrl,w=p===`web`,T=p===`mobile`,E=T&&i?.manualUpdate===!0&&!!C,D=T&&i?.inAppApply===!0,O=p===`desktop`&&i?.manualUpdate===!0,k=h!==`idle`&&h!==`error`,A=p===`desktop`&&!O&&l()&&!c(),j=A&&k,M=T?C:S,N=F(e=>{!e&&D&&o&<.getState().dismiss(),t(e)});(0,Y.useEffect)(()=>{e||(g(`idle`),v(null))},[e]);let P=F(async()=>{let e={transport:n(),generation:r()};g(`updating`),v(null);let t=await kt(i?.version,e);if(!$(e))return;if(!t.success){g(`error`),v(t.error||m(`updateDialog.error.updateFailed`));return}t.autoRestart&&(g(`restarting`),await new Promise(e=>setTimeout(e,2e3))),g(`reconnecting`);let a=await jt(i?.version,e);$(e)&&(a?window.location.reload():(g(`error`),v(m(`updateDialog.error.takingLonger`))))}),I=F(async()=>{if(!A||!y){f();return}let e={transport:n(),generation:r()};g(`updating`),v(null);try{if(await At(i?.version,e)){if(!$(e))return;if(g(`reconnecting`),!await jt(i?.version,e)){$(e)&&(g(`error`),v(m(`updateDialog.error.remoteUpdateFailed`)));return}}}catch{$(e)&&(g(`error`),v(m(`updateDialog.error.remoteUpdateFailed`)));return}$(e)&&(g(`idle`),f())}),L=F(e=>{switch(e){case`download`:d();break;case`restart`:I();break;case`later`:lt.getState().dismiss(),t(!1);break;case`open-external`:{let e=T?C:S;e&&ee(e);break}case`web-update`:P()}}),R=[];!w&&(!T||D)&&(!O&&!o&&!a&&R.push({id:`download`,icon:`download`,label:m(D?`updateDialog.actions.applyOtaNow`:`updateDialog.actions.downloadUpdate`)}),O&&!o&&!a&&R.push({id:`open-external`,icon:`external-link`,label:m(`updateDialog.actions.openMobileUpdate`)}),a&&R.push({id:`downloading`,icon:`loader`,loading:!0,disabled:!0,label:m(`updateDialog.status.downloading`)}),o&&(D&&R.push({id:`later`,variant:`ghost`,label:m(`updateDialog.actions.later`)}),R.push(j?{id:`updating`,icon:`loader`,loading:!0,disabled:!0,label:m(`updateDialog.status.updating`)}:{id:`restart`,icon:`restart`,label:m(`updateDialog.actions.restartToUpdate`)}))),T&&!D&&E&&R.push({id:`open-external`,icon:`external-link`,label:m(`updateDialog.actions.openMobileUpdate`)}),w&&R.push(k?{id:`updating`,icon:`loader`,loading:!0,disabled:!0,label:m(`updateDialog.status.updating`)}:{id:`web-update`,icon:`download`,label:m(`updateDialog.actions.updateNow`)});let te={title:m(h===`restarting`||h===`reconnecting`?`updateDialog.header.updating`:`updateDialog.header.updateAvailable`),currentVersion:i?.currentVersion,version:i?.version,body:i?.body,hideChangelog:k,dismissible:!k,option:A&&o?{label:m(`updateDialog.remote.syncLabel`),hint:m(`updateDialog.remote.syncHint`),checked:y,disabled:j,onChange:b}:void 0,error:u||_,fallbackCommand:w&&h===`error`?i?.updateCommand||`yuri update`:void 0,notice:D&&o&&x?m(`updateDialog.status.otaBundleReused`):void 0,releaseLink:(!T||E)&&M?{url:M,label:`GitHub`}:void 0,actions:R};return w&&k&&(te.status={kind:`activity`,label:m(h===`updating`?`updateDialog.status.installingUpdate`:h===`restarting`?`updateDialog.status.serverRestarting`:`updateDialog.status.waitingForServer`),detail:m(`updateDialog.status.autoReloadHint`)}),j&&(te.status={kind:`activity`,label:m(`updateDialog.status.updatingRemote`)}),!w&&(!T||D)&&a&&(te.status={kind:`download`,label:m(`updateDialog.status.downloadingPayload`),progress:s?.total?Math.round(s.downloaded/s.total*100):0}),(0,H.jsx)(Ct,{open:e,onOpenChange:N,model:te,onAction:L})};function Nt(e,t){return e===`checking`?5:e===`downloading`?5+Math.min(Math.max(t??0,0),100)*.75:e===`installing`?85:e===`restarting`?95:100}function Pt(e,t,n){let r=e?.operation,i=e?.update,a=i??(r&&t.updateDetails&&r.planId===t.updateDetails.planId&&r.version===t.updateDetails.version?t.updateDetails:void 0),o=X(r),s=e?.supported===!1||t.failure===`unsupported`,c={title:n(`settings.yuri.about.hostUpdate.title`),stableLayout:!0,description:n(`settings.yuri.about.hostUpdate.description`),currentVersion:e?.currentVersion??t.versionFallback,version:i?.version??r?.version,body:a||r?a?.releaseNotes||n(`settings.yuri.about.hostUpdate.noNotes`):void 0,warning:!o&&i?.rollback?n(`settings.yuri.about.hostUpdate.downgrade`):void 0,actions:o||t.submitting||t.completed||!i?[]:[{id:`confirm`,icon:`download`,label:n(`settings.yuri.about.hostUpdate.confirm`),disabled:!e?.supported||!!t.failure||!!t.checking}]};return o&&r?c.status={kind:r.status===`downloading`?`download`:`activity`,label:n(t.failure===`disconnected`?`settings.yuri.about.hostUpdate.reconnecting`:`settings.yuri.about.hostUpdate.status.${r.status}`),progress:Nt(r.status,r.progress)}:t.completed&&!i?c.status={kind:`download`,label:n(`settings.yuri.about.hostUpdate.status.succeeded`),progress:100}:t.submitting?c.status={kind:`activity`,label:n(`settings.yuri.about.state.checking`),progress:0}:t.checking===`initial`?c.status={kind:`activity`,label:n(`settings.yuri.about.state.checking`)}:s?c.message=n(`settings.yuri.about.hostUpdate.unsupported`):t.failure?c.error=n(t.failure===`disconnected`?`settings.yuri.about.hostUpdate.reconnecting`:`settings.yuri.about.toast.checkFailed`):!i&&e?.supported&&(c.message=r?.status===`succeeded`?n(`settings.yuri.about.hostUpdate.status.succeeded`):n(`settings.yuri.about.toast.latestVersion`)),r?.status===`failed`&&(c.error=n(`settings.yuri.about.hostUpdate.status.failed`)),c}function Ft(){let e=(0,Oe.c)(7),{t:i}=oe(),a=Y.useSyncExternalStore(t,n,n),o=Y.useSyncExternalStore(t,r,r),s=`${a}:${o}`,c;e[0]===i?c=e[1]:(c=i(`settings.yuri.about.state.unknown`),e[0]=i,e[1]=c);let l;return e[2]!==o||e[3]!==s||e[4]!==c||e[5]!==a?(l=(0,H.jsx)(It,{transport:a,generation:o,version:c},s),e[2]=o,e[3]=s,e[4]=c,e[5]=a,e[6]=l):l=e[6],l}function It({version:e,transport:t,generation:i,itemId:a,channel:o}){let{t:s}=oe(),c=M(),[l,u]=Y.useState(!1),d=L(e=>e.otaChannelOverride),f=o??d??void 0,p=mt(t,i,f),m=p.data,h=m?.operation,g=X(h),_=JSON.stringify([t,i,f??`current`]),[v,y]=Y.useState(null);m?.update&&(v?.scope!==_||v.update!==m.update)&&y({scope:_,update:m.update});let b=A({mutationFn:({plan:e})=>ht(e,t,i),onSuccess:(e,a)=>{t===n()&&i===r()&&c.setQueryData(Q(t,i,a.channel).queryKey,t=>t&&{...t,operation:e})},onSettled:(e,a,o)=>{t===n()&&i===r()&&c.invalidateQueries({queryKey:Q(t,i,o.channel).queryKey,exact:!0})}}),[x,S]=Y.useState(null);l&&g&&h&&h.id!==x&&S(h.id);let C=h?.status===`succeeded`&&h.id===x,w=s(`settings.yuri.about.hostUpdate.status.succeeded`);Y.useEffect(()=>{!C||p.isError||t!==n()||i!==r()||(S(null),u(!1),re.success(w,{id:`host-update:${t}:${i}:${x}`}))},[C,p.isError,t,i,x,w]);let T=Y.useRef(null),E=F(()=>_),D=F(async()=>{if(g){u(!0),p.refetch({cancelRefetch:!1});return}if(T.current===_)return;let e=_;T.current=e;try{let a=await p.refetch({cancelRefetch:!1});if(e!==E()||t!==n()||i!==r())return;if(a.isError||!a.data||a.data.checkError){a.error?.message===`host_update_unsupported`?re.info(s(`settings.yuri.about.hostUpdate.unsupported`)):re.error(s(`settings.yuri.about.toast.checkFailed`));return}X(a.data.operation)?u(!0):a.data.supported?a.data.update?u(!0):(u(!1),re.success(s(`settings.yuri.about.toast.latestVersion`))):re.info(s(`settings.yuri.about.hostUpdate.unsupported`))}finally{T.current===e&&(T.current=null)}}),O=m?.supported===!1||!g&&p.error?.message===`host_update_unsupported`,k=p.isError||!!m?.checkError,j=b.isError&&b.variables?.channel===f,N=Pt(m,{versionFallback:e,checking:p.isPending?`initial`:p.isFetching?`refresh`:!1,submitting:b.isPending,failure:O?`unsupported`:p.isError&&(g||j)?`disconnected`:k||j?`check`:null,completed:C,updateDetails:v?.scope===_?v.update:void 0},s),P=F(e=>{e===`confirm`&&m?.update&&b.mutate({plan:m,channel:f})});return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,"data-settings-item":a,children:[(0,H.jsxs)(`span`,{className:`relative typography-ui-label font-mono text-foreground text-right`,children:[m?.currentVersion??e,m?.update&&!g&&(0,H.jsx)(`span`,{"aria-label":s(`settings.yuri.about.hostUpdate.available`),className:`absolute -right-1.5 -top-0.5 size-1.5 rounded-full bg-[var(--status-error)]`})]}),(0,H.jsx)(ne,{type:`button`,size:`icon`,variant:`ghost`,onClick:D,disabled:p.isFetching&&!g,"aria-label":s(`settings.yuri.about.hostUpdate.title`),title:s(`settings.yuri.about.hostUpdate.title`),children:(0,H.jsx)(B,{name:g||p.isFetching?`loader`:m?.update?`download`:`refresh`,className:g||p.isFetching?`size-4 animate-spin`:`size-4`})})]}),(0,H.jsx)(Ct,{open:l,onOpenChange:u,model:N,onAction:P})]})}var Lt=e=>e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e),Rt=e=>{let t=e.replace(/\\/g,`/`),n=[],[r,...i]=t.split(`/`);for(let e of i)if(e!==``&&e!==`.`){if(e===`..`){n.pop();continue}n.push(e)}return`${/^[A-Za-z]:$/.test(r)?`${r.toUpperCase()}/`:`/`}${n.join(`/`)}`},zt=e=>Rt(`${e.replace(/\\/g,`/`)}/..`),Bt=e=>{try{let t=decodeURIComponent(new URL(e).pathname);return/^\/[A-Za-z]:\//.test(t)?t.slice(1):t}catch{return null}};function Vt(e,t){if(e.startsWith(`file://`)){let t=Bt(e);return t?{kind:`local`,path:Rt(t)}:null}return e.startsWith(`./`)||e.startsWith(`../`)?t?{kind:`local`,path:Rt(`${zt(t)}/${e}`)}:null:Lt(e)?{kind:`local`,path:Rt(e)}:{kind:`package`,target:e}}function Ht(e){return e?{kind:`local`,path:Rt(e)}:null}var Ut=(e,t)=>{if(e.kind===`package`)return t.source.kind===`package`&&t.source.target===e.target;if(t.source.kind!==`local`)return!1;let n=Rt(t.source.path);return n===e.path||n.startsWith(`${e.path}/`)};function Wt(e,t){return t.filter(t=>Ut(e,t))}function Gt(e){for(let t of e)if(t.state.kind===`active`&&t.source.kind===`package`&&t.source.version?.trim())return t.source.version.trim();return null}function Kt(e){let t=e.find(e=>e.state.kind===`failed`);if(t&&t.state.kind===`failed`)return{kind:`failed`,error:t.state.error,ref:t.state.ref};let n=e[0];return n?{kind:`active`,version:n.source.kind===`package`?n.source.version:null}:{kind:`notReported`}}function qt(e){let t=e.flatMap(e=>e.source.kind===`package`?[e.source]:[]);return t.some(e=>e.updating)?`updating`:t.some(e=>e.outdated)?`available`:`none`}function Jt(){let e=(0,Oe.c)(5),t=Ee(),n=De(),r=t.data?.entries,i=t.data?.files,a=n.data,o;bb0:{if(!a){let t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],o=t;break bb0}let t;if(e[1]!==r||e[2]!==i||e[3]!==a){t=[];let n=(e,n,r)=>{if(!r)return;let i=Kt(Wt(r,a));i.kind===`failed`&&t.push({id:e,label:n,error:i.error})};for(let e of r??[])n(e.id,e.spec,Vt(e.spec,e.sourcePath));for(let e of i??[])n(e.id,e.fileName,Ht(e.absolutePath));e[1]=r,e[2]=i,e[3]=a,e[4]=t}else t=e[4];o=t}return o}var Yt=e=>e instanceof Error&&e.name===`CancelledError`,Xt=v(()=>({setStatus:e=>xe(P,e),refreshStatus:async(e,t)=>{let r=n();t?.force&&await P.cancelQueries({queryKey:N.github.auth(r),exact:!0});try{return await Ce(P,e,r)}catch(e){if(Yt(e))return Se(P,r);throw e}}})),Zt=v()(b(y((e,t)=>({selectedProfileId:null,defaultGitIdentityId:null,profiles:[],globalIdentity:null,discoveredCredentials:[],isLoading:!1,setSelectedProfile:t=>{e({selectedProfileId:t})},loadProfiles:async()=>{e({isLoading:!0});let n=t().profiles;try{return e({profiles:await me(),isLoading:!1}),!0}catch(t){return console.error(`Failed to load git identity profiles:`,t),e({profiles:n,isLoading:!1}),!1}},loadGlobalIdentity:async()=>{try{let t=await ve();return t&&t.userName&&t.userEmail?e({globalIdentity:{id:`global`,name:`Global Identity`,userName:t.userName,userEmail:t.userEmail,authType:t.sshCommand?`ssh`:void 0,sshKey:t.sshCommand?t.sshCommand.replace(`ssh -i `,``):null,color:`info`,icon:`house`}}):e({globalIdentity:null}),!0}catch(t){return console.error(`Failed to load global git identity:`,t),e({globalIdentity:null}),!1}},loadDiscoveredCredentials:async()=>{try{return e({discoveredCredentials:await pe()}),!0}catch(t){return console.error(`Failed to discover git credentials:`,t),e({discoveredCredentials:[]}),!1}},loadDefaultGitIdentityId:async()=>{let t=e=>{if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null};try{let n=null;if(n===null){let e=_()?.settings;if(e)try{n=t(((await e.load())?.settings||{}).defaultGitIdentityId)}catch{}}if(n===null)try{let e=await i(`/api/config/settings`,{method:`GET`,headers:{Accept:`application/json`}});e.ok&&(n=t((await e.json().catch(()=>null))?.defaultGitIdentityId))}catch{}return e({defaultGitIdentityId:n}),!0}catch(e){return console.error(`Failed to load default git identity setting:`,e),!1}},setDefaultGitIdentityId:async t=>{try{let n=typeof t==`string`?t.trim():``,r=n.length>0?n:``;return await C({defaultGitIdentityId:r}),e({defaultGitIdentityId:r.length>0?r:null}),!0}catch(e){return console.error(`Failed to save default git identity setting:`,e),!1}},createProfile:async e=>{try{let n={...e,id:e.id||`profile-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,color:e.color||`keyword`,icon:e.icon||`branch`};return await ge(n),await t().loadProfiles(),!0}catch(e){return console.error(`Failed to create git identity profile:`,e),!1}},updateProfile:async(e,n)=>{try{let r=t().profiles.find(t=>t.id===e);if(!r)throw Error(`Profile not found`);let i={...r,...n};return await he(e,i),await t().loadProfiles(),!0}catch(e){return console.error(`Failed to update git identity profile:`,e),!1}},deleteProfile:async n=>{try{return await _e(n),t().selectedProfileId===n&&e({selectedProfileId:null}),await t().loadProfiles(),!0}catch(e){return console.error(`Failed to delete git identity profile:`,e),!1}},getProfileById:e=>{let{profiles:n,globalIdentity:r}=t();return e===`global`?r||void 0:n.find(t=>t.id===e)},getUnimportedCredentials:()=>{let{profiles:e,discoveredCredentials:n}=t();return n.filter(t=>!e.some(e=>e.authType===`token`&&e.host===t.host))}}),{name:`git-identities-store`,storage:E(),partialize:e=>({selectedProfileId:e.selectedProfileId})}),{name:`git-identities-store`}));typeof window<`u`&&(window.__zustand_git_identities_store__=Zt);var Qt=(e,t)=>e?t.kind===e.kind?t.projectRoot.length===e.projectRoot.length?t.projectId.localeCompare(e.projectId)<0:t.projectRoot.length>e.projectRoot.length:t.kind===`project`:!0,$t=(e,t,n)=>{Qt(e.get(t),n)&&e.set(t,n)},en=e=>{let t=e;return O(t.directory)??O(t.project?.worktree)},tn=e=>{if(e===`/`||/^[A-Z]:$/.test(e))return null;let t=e.lastIndexOf(`/`);return t<0?null:t===0?`/`:t===2&&/^[A-Z]:\//.test(e)?e.slice(0,2):e.slice(0,t)},nn=(e,t,n,r,i=[])=>{let a=new Map,o=new Map;for(let e of t){let t=O(e.normalizedPath);if(!t)continue;let n=o.get(t);(!n||e.id.localeCompare(n.id)<0)&&o.set(t,e),$t(a,t,{projectId:e.id,projectRoot:t,scopeDirectory:t,kind:`project`})}if(!r)for(let[e,t]of n){let n=O(e),r=n?o.get(n):void 0;if(!(!r||!n))for(let e of t){let t=O(e.path);t&&$t(a,t,{projectId:r.id,projectRoot:n,scopeDirectory:t,kind:`worktree`})}}let s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=e=>{if(!e)return null;if(s.has(e))return s.get(e)??null;if(r){let t=a.get(e)??null;return s.set(e,t),t}let t=[],n=e,i=null;for(;n;){if(s.has(n)){i=s.get(n)??null;break}if(t.push(n),i=a.get(n)??null,i)break;n=tn(n)}for(let e of t)s.set(e,i);return i},p=(e,t,n)=>{for(let r of e){let e=f(en(r));if(!e)continue;c.set(r.id,e);let i=t.get(e.projectId);if(i?i.push(r):t.set(e.projectId,[r]),!n)continue;let a=n.get(e.scopeDirectory);a?a.add(r.id):n.set(e.scopeDirectory,new Set([r.id]))}};return p(e,l,d),p(i,u),{bySessionId:c,sessionsByProject:l,archivedSessionsByProject:u,sessionsByScope:d,directoryResolutions:s.size}};export{lt as _,Vt as a,Gt as c,Ft as d,It as f,gt as g,X as h,Jt as i,Kt as l,Q as m,Zt as n,Wt as o,Mt as p,Xt as r,Ht as s,nn as t,qt as u,Ne as v,ke as y};
|
|
2
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,i as n,n as r}from"./runtime-switch-DEPKHgdL.js";import{n as i}from"./runtime-fetch-V-iMWR8t.js";import{B as a,F as o,H as s,I as c,L as l,Q as u,V as d,h as f,n as p,p as m,t as h,z as g}from"./platform-B2ylz14u.js";import{t as _}from"./runtimeAPIRegistry-C2VogTny.js";import{a as v,i as y,r as b}from"./vendor-zustand-CTekDqaS.js";import{ot as x,st as S}from"./vendor-base-ui-wXsskyKm.js";import{Ft as C,St as w}from"./gitApiHttp-ZjM4HkSo.js";import{i as T,t as E}from"./safeStorage-DTOhKN0V.js";import{n as D}from"./client-CmtAKi5B.js";import{n as O}from"./pathNormalization-ewtPqJWn.js";import{n as k}from"./vendor-react-BkccXcWz.js";import{n as A,s as j,u as M}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{G as N,W as P}from"./runtime-file-resource-BGZ4tGr5.js";import{r as F}from"./vendor-reactuses-core-DjKFMfz7.js";import{o as I}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as L}from"./useUIStore-68ZPpgYA.js";import{o as ee}from"./useMobileHtmlPreviewStore-BYunNOBo.js";import{a as R,t as te}from"./types-4xeqxklF.js";import{Xn as ne,io as z,ro as re,t as ie}from"./ui-BCYkB585.js";import{n as B}from"./Icon-C1rjS64C.js";import{n as ae,t as oe}from"./i18n-iu4pzqPi.js";import{t as se}from"./ScrollableOverlay-CEglrXfm.js";import{n as ce,o as le,r as ue,t as de}from"./dialog-Cx20I73q.js";import{t as fe}from"./device-TCHW5U2y.js";import{a as pe,c as me,g as he,n as ge,r as _e,u as ve}from"./gitApi-LXGRaDt8.js";import{n as ye}from"./MarkdownRenderer-BZl_T1ng.js";import{t as be}from"./checkbox-CljLXON1.js";import{i as xe,n as Se,r as Ce}from"./githubAuthQueries-3AJp5LD5.js";import{c as V,i as we,o as Te}from"./mcpQueries-BRuytwhB.js";import{c as Ee,s as De}from"./usePluginsStore-BIBHPK4A.js";var Oe=k(),H=x();function ke(e){let t=(0,Oe.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,H.jsx)(`path`,{d:`M15.688 2.343a2.588 2.588 0 00-3.61 0l-9.626 9.44a.863.863 0 01-1.203 0 .823.823 0 010-1.18l9.626-9.44a4.313 4.313 0 016.016 0 4.116 4.116 0 011.204 3.54 4.3 4.3 0 013.609 1.18l.05.05a4.115 4.115 0 010 5.9l-8.706 8.537a.274.274 0 000 .393l1.788 1.754a.823.823 0 010 1.18.863.863 0 01-1.203 0l-1.788-1.753a1.92 1.92 0 010-2.754l8.706-8.538a2.47 2.47 0 000-3.54l-.05-.049a2.588 2.588 0 00-3.607-.003l-7.172 7.034-.002.002-.098.097a.863.863 0 01-1.204 0 .823.823 0 010-1.18l7.273-7.133a2.47 2.47 0 00-.003-3.537z`}),r=(0,H.jsx)(`path`,{d:`M14.485 4.703a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a4.115 4.115 0 000 5.9 4.314 4.314 0 006.016 0l7.12-6.982a.823.823 0 000-1.18.863.863 0 00-1.204 0l-7.119 6.982a2.588 2.588 0 01-3.61 0 2.47 2.47 0 010-3.54l7.12-6.982z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,H.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,fill:`currentColor`,stroke:`currentColor`,strokeWidth:`0.5`,fillRule:`evenodd`,viewBox:`-0.5 -0.5 25 25`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var Ae={},U=(e,t=n())=>JSON.stringify([t,we(e)]),je=(e,t,n)=>{if(!e[t]?.[n])return e;let r={...e[t]};return delete r[n],{...e,[t]:r}},W=e=>{let t=we(e);return t?D.getScopedApiClient(t):D.getApiClient()},G=e=>e?{location:{directory:e}}:void 0,K=new Map,q=(e,t)=>JSON.stringify([r(),U(t),e]),Me=async(e,t,n)=>{let r=(await e.mcp.list(G(n))).data.find(e=>e.name===t)?.integrationID;if(!r)throw Error(`MCP server "${t}" has no authentication integration`);return(await e.integration.get({integrationID:r,...G(n)})).data},J=e=>we(e===void 0?w.getState().currentDirectory:e),Ne=v()(b((e,t)=>({diagnosticsByDirectory:{},getDiagnosticForDirectory:e=>{let n=U(J(e));return t().diagnosticsByDirectory[n]??Ae},clearDiagnostic:(t,n,r)=>{let i=U(J(n),r);e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,i,t)}))},connect:async(t,r)=>{let i=J(r),a=n(),o=U(i,a),s=W(i);try{await s.mcp.connect({server:t,...G(i)})}catch(n){let r=n instanceof Error?n.message:`Connection failed`;throw e(e=>({diagnosticsByDirectory:{...e.diagnosticsByDirectory,[o]:{...e.diagnosticsByDirectory[o]??{},[t]:{status:`failed`,error:r}}}})),n}await V(P,i,a),e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,o,t)}))},disconnect:async(t,r)=>{let i=J(r),a=n(),o=U(i,a);await W(i).mcp.disconnect({server:t,...G(i)}),await V(P,i,a),e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,o,t)}))},startAuth:async(e,t)=>{let n=J(t),r=q(e,n),i=W(n),a=await Me(i,e,n),o=a.methods.find(e=>e.type===`oauth`);if(!o)throw Error(`MCP server "${e}" has no OAuth method`);if(r!==q(e,n))throw Error(`MCP authorization runtime changed`);let s=K.get(r);if(s&&(await i.integration.oauth.cancel({integrationID:s.integrationID,attemptID:s.attempt.attemptID,...G(n)}),K.delete(r)),r!==q(e,n))throw Error(`MCP authorization runtime changed`);let{data:c}=await i.integration.oauth.connect({integrationID:a.id,methodID:o.id,...G(n)});if(r!==q(e,n))throw Error(`MCP authorization runtime changed`);for(let[e,t]of K)t.attempt.time.expires<=Date.now()&&K.delete(e);return K.set(r,{integrationID:a.id,attempt:c}),c},authStatus:async(e,t)=>{let n=J(t),r=q(e,n),i=K.get(r);if(!i)throw Error(`MCP authorization attempt not found`);let{data:a}=await W(n).integration.oauth.status({integrationID:i.integrationID,attemptID:i.attempt.attemptID,...G(n)});if(r!==q(e,n))throw Error(`MCP authorization runtime changed`);return a.status!==`pending`&&K.get(r)===i&&K.delete(r),a},completeAuth:async(e,t,r)=>{let i=J(r),a=n(),o=q(e,i),s=K.get(o);if(!s||s.attempt.mode!==`code`)throw Error(`MCP authorization requires the browser callback`);if(!t.trim())throw Error(`MCP authorization code is empty`);if(await W(i).integration.oauth.complete({integrationID:s.integrationID,attemptID:s.attempt.attemptID,code:t.trim(),...G(i)}),K.get(o)===s&&K.delete(o),o!==q(e,i))throw Error(`MCP authorization runtime changed`);await V(P,i,a)},clearAuth:async(e,t)=>{let r=J(t),i=n(),a=q(e,r),o=W(r),s=await Me(o,e,r);if(a!==q(e,r))throw Error(`MCP authorization runtime changed`);let c=K.get(a);c&&(await o.integration.oauth.cancel({integrationID:c.integrationID,attemptID:c.attempt.attemptID,...G(r)}),K.delete(a));let l=new Set(s.connections.flatMap(e=>e.type===`credential`?[e.id]:[]));for(let t of l){if(a!==q(e,r))throw Error(`MCP authorization runtime changed`);await o.credential.remove({credentialID:t})}if(a!==q(e,r))throw Error(`MCP authorization runtime changed`);await V(P,r,i)},testConnection:async(t,r)=>{let i=J(r),a=n(),o=U(i,a),s=W(i),c=Te(P,i,a)[t]?.status===`connected`,l,u;try{await s.mcp.connect({server:t,...G(i)})}catch(n){l=n instanceof Error?n.message:`Connection failed`,e(e=>({diagnosticsByDirectory:{...e.diagnosticsByDirectory,[o]:{...e.diagnosticsByDirectory[o]??{},[t]:{status:`failed`,error:l??`Connection failed`}}}}))}let d=(await V(P,i,a))[t],f=d;if(!c&&d?.status===`connected`){try{await s.mcp.disconnect({server:t,...G(i)})}catch(e){u=`Connection test succeeded, but cleanup disconnect failed: ${e instanceof Error?e.message:`Disconnect failed`}`}await V(P,i,a)}return l||e(e=>({diagnosticsByDirectory:je(e.diagnosticsByDirectory,o,t)})),{status:f??Te(P,i,a)[t],error:l,warning:u}}}))),Y=e(S(),1),Pe=`https://yuri-updates.xiaobe.top/v1/update/check`,Fe=`https://yuri-origin.xiaobe.top/v1/update/check`,Ie=`https://github.com/yee94/yuri/releases/latest`,Le=`https://github.com/yee94/yuri/releases`,Re=`https://testflight.apple.com/join/pN5SSHeg`,ze=1e4;function Be(e){let t=String(e||``).replace(/^v/,``).split(`+`)[0]??``,n=t.indexOf(`-`);return{parts:(n>=0?t.slice(0,n):t).split(`.`).map(e=>{let t=Number.parseInt(e||`0`,10);return Number.isFinite(t)?t:0}),prerelease:n>=0}}function Ve(e,t){let n=Be(e),r=Be(t),i=Math.max(n.parts.length,r.parts.length);for(let e=0;e<i;e+=1){let t=(n.parts[e]||0)-(r.parts[e]||0);if(t!==0)return t}return n.prerelease===r.prerelease?0:n.prerelease?-1:1}function He(){return[Pe,Fe]}function Ue(e,t,n=Date.now){let r=e-n();return r<=0||t<=0?null:Math.max(1,Math.ceil(r/t))}function We(e){return{appType:`mobile-capacitor`,deviceClass:e.deviceClass||`mobile`,platform:e.platform===`ios`||e.platform===`android`?e.platform:`android`,arch:e.arch||`unknown`,channel:`stable`,currentVersion:e.currentVersion,instanceMode:`remote`,reportUsage:e.reportUsage===!0}}async function Ge(e,t,n,r){try{if(p())try{let{CapacitorHttp:r}=await I(async()=>{let{CapacitorHttp:e}=await import(`./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js`).then(e=>e.i);return{CapacitorHttp:e}},__vite__mapDeps([0,1])),i=Object.fromEntries(new Headers(t.headers).entries()),a;if(typeof t.body==`string`)try{a=JSON.parse(t.body)}catch{a=t.body}let o=await Promise.race([r.request({url:e,method:t.method||`GET`,headers:i,data:a,connectTimeout:n,readTimeout:n}),new Promise(e=>{window.setTimeout(()=>e(null),n)})]);return o?{ok:o.status>=200&&o.status<300,status:o.status,url:typeof o.url==`string`?o.url:e,json:async()=>{if(typeof o.data==`string`)try{return JSON.parse(o.data)}catch{return o.data}return o.data}}:null}catch{}let i=await r(e,{...t,signal:AbortSignal.timeout(n)});return{ok:i.ok,status:i.status,url:i.url,json:()=>i.json()}}catch{return null}}function Ke(e,t){return e===`ios`?Re:`${Le}/download/v${t}/app-release.apk`}function qe(e,t,n){if(typeof e.latestVersion!=`string`||e.latestVersion.trim().length===0)return null;let r=e.latestVersion.trim(),i=Ve(r,t);if(i<0)return null;let a=typeof e.releaseNotesUrl==`string`&&e.releaseNotesUrl.trim().length>0?e.releaseNotesUrl.trim():`${Le}/tag/v${r}`,o=typeof e.downloadUrl==`string`&&e.downloadUrl.trim().length>0?e.downloadUrl.trim():typeof e.download?.url==`string`&&e.download.url.trim().length>0?e.download.url.trim():Ke(n,r);return{available:!!e.updateAvailable&&i>0,version:r,currentVersion:t,body:typeof e.releaseNotes==`string`?e.releaseNotes:void 0,releaseUrl:a,downloadUrl:o,nextSuggestedCheckInSec:typeof e.nextSuggestedCheckInSec==`number`&&Number.isFinite(e.nextSuggestedCheckInSec)?e.nextSuggestedCheckInSec:void 0}}async function Je(e,t,n,r){let i=await Ge(e,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(We(t))},n,r);if(!i?.ok)return null;let a;try{a=await i.json()}catch{return null}return qe(a,t.currentVersion,t.platform)}async function Ye(e,t,n,r){let i=await Ge(Ie,{method:`GET`,headers:{Accept:`text/html`},redirect:`follow`},n,r);if(!i?.ok)return null;let a=typeof i.url==`string`&&i.url.length>0?i.url:Ie,o=null;try{o=new URL(a).pathname.match(/\/releases\/tag\/v(\d+\.\d+\.\d+(?:-[\w.]+)?)/)}catch{return null}if(!o?.[1])return null;let s=o[1],c=Ve(s,e),l=`${Le}/tag/v${s}`;return{available:c>0,version:s,currentVersion:e,releaseUrl:l,downloadUrl:Ke(t,s)}}async function Xe(e){let t=e.currentVersion?.trim()||`unknown`;if(t===`unknown`)return{available:!1,currentVersion:t,error:`Unable to check for mobile updates`};let n=e.fetchImpl??fetch,r=e.now??Date.now,i=He(),a=r()+ze;for(let[t,o]of i.entries()){let s=Ue(a,i.length-t+1,r);if(s===null)break;let c=await Je(o,e,s,n);if(c)return c}let o=Ue(a,1,r);if(o!==null){let r=await Ye(t,e.platform,o,n);if(r)return r}return{available:!1,currentVersion:t,error:`Unable to check for mobile updates`}}function Ze(){if(typeof window>`u`)return`unknown`;try{let{deviceType:e}=fe();return e}catch{return`unknown`}}function Qe(){let e=typeof window<`u`?window.__VSCODE_CONFIG__?.arch?.toLowerCase?.():void 0;if(e===`arm64`||e===`aarch64`)return`arm64`;if(e===`x64`||e===`amd64`||e===`x86_64`)return`x64`;let t=(typeof navigator<`u`?navigator.userAgentData:void 0)?.architecture?.toLowerCase?.();if(t===`arm`||t===`arm64`||t===`aarch64`)return`arm64`;if(t===`x86`||t===`x64`||t===`amd64`)return`x64`;let n=typeof navigator<`u`?navigator.userAgent.toLowerCase():``;return n.includes(`aarch64`)||n.includes(`arm64`)||n.includes(`armv`)?`arm64`:n.includes(`x86_64`)||n.includes(`x64`)||n.includes(`amd64`)||n.includes(`win64`)?`x64`:`unknown`}function $e(){let e=h();if(e===`android`||e===`ios`)return e;if(typeof navigator>`u`)return`web`;let t=(navigator.platform||``).toLowerCase();return t.includes(`mac`)?`macos`:t.includes(`win`)?`windows`:t.includes(`linux`)?`linux`:`web`}function et(e){let t=L.getState().reportUsage,n=new URLSearchParams({reportUsage:t?`true`:`false`});return n.set(`deviceClass`,Ze()),n.set(`arch`,Qe()),n.set(`platform`,$e()),e===`desktop`?(n.set(`appType`,`desktop-electron`),n.set(`instanceMode`,o()?`local`:`remote`),n):e===`vscode`?(n.set(`appType`,`vscode`),n.set(`instanceMode`,`local`),n):e===`mobile`?(n.set(`appType`,`mobile-capacitor`),n.set(`instanceMode`,`remote`),n):(n.set(`appType`,`web`),n.set(`instanceMode`,`unknown`),n)}async function tt(e,t){let n=t??`unknown`;try{let r=et(e),a=typeof window<`u`?window.__VSCODE_CONFIG__?.extensionVersion:void 0;t?r.set(`currentVersion`,t):e===`vscode`&&a&&r.set(`currentVersion`,a);let o=await i(`/api/yuri/update-check?${r.toString()}`,{method:`GET`,headers:{Accept:`application/json`}}),s=null;try{s=await o.json()}catch{s=null}if(!o.ok)return{available:!1,currentVersion:n,error:typeof s?.error==`string`&&s.error.trim().length>0?s.error.trim():`Server responded with ${o.status}`};if(!s)return{available:!1,currentVersion:n,error:`Update check returned an invalid response`};let c=typeof s.error==`string`&&s.error.trim().length>0?s.error.trim():void 0;return{available:s.available===!0,version:typeof s.version==`string`?s.version:void 0,currentVersion:typeof s.currentVersion==`string`?s.currentVersion:n,body:typeof s.body==`string`?s.body:void 0,releaseUrl:typeof s.releaseUrl==`string`?s.releaseUrl:void 0,downloadUrl:typeof s.downloadUrl==`string`?s.downloadUrl:void 0,nextSuggestedCheckInSec:typeof s.nextSuggestedCheckInSec==`number`&&Number.isFinite(s.nextSuggestedCheckInSec)?s.nextSuggestedCheckInSec:void 0,packageManager:typeof s.packageManager==`string`?s.packageManager:void 0,updateCommand:typeof s.updateCommand==`string`?s.updateCommand:void 0,error:c}}catch(e){return console.warn(`Failed to check for updates:`,e),{available:!1,currentVersion:n,error:e instanceof Error?e.message:`Failed to check for updates`}}}function nt(){return p()?`mobile`:l()?`desktop`:g()?`vscode`:a()?`web`:null}var rt={checking:!1,available:!1,downloading:!1,downloaded:!1,info:null,progress:null,error:null,downloadError:null,downloadVersion:null,downloadChannel:null,runtimeType:null,lastChecked:null,nextCheckInSec:null,otaDecision:null,otaPhase:`idle`,otaDownloadSkipped:!1,lastOtaChannelOverride:null},it=`yuri-client-update-download`,at=e=>typeof e==`string`&&/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/.test(e);function ot(){try{let e=JSON.parse(T().getItem(it)??`null`);return!e||e.runtimeType!==nt()||![`desktop`,`mobile`].includes(e.runtimeType)||!at(e.version)||![null,`stable`,`beta`].includes(e.channel)?{}:{runtimeType:e.runtimeType,downloadVersion:e.version,downloadChannel:e.channel,downloadError:`update_interrupted`}}catch{return{}}}function st(e,t){let n=e.isChannelRollback===!0?{isChannelRollback:!0}:{};if(e.primaryAction===`apply_ota`&&e.ota.bundle)return e.ota.bundle.releaseVersion===t?{available:!1,otaPhase:`idle`,info:{available:!1,currentVersion:t,nextSuggestedCheckInSec:e.nextCheckInSec,...n}}:{available:!0,otaPhase:`available`,info:{available:!0,version:e.ota.bundle.releaseVersion,currentVersion:t,downloadUrl:e.ota.bundle.url,nextSuggestedCheckInSec:e.nextCheckInSec,inAppApply:!0,...e.releaseNotes?{body:e.releaseNotes}:{},...n}};if(e.primaryAction===`install_native_required`){if(!e.native.version?.trim()||!e.native.installUrl?.trim())throw Error(`Native update required, but the update service supplied no complete installation target`);return{available:e.native.state===`required`||e.native.state===`available`,otaPhase:`idle`,info:{available:e.native.state===`required`||e.native.state===`available`,version:e.native.version,currentVersion:t,downloadUrl:e.native.installUrl,nextSuggestedCheckInSec:e.nextCheckInSec,manualUpdate:!0,...e.releaseNotes?{body:e.releaseNotes}:{},...n}}}return{available:!1,otaPhase:`idle`,info:{available:!1,currentVersion:t,nextSuggestedCheckInSec:e.nextCheckInSec,...n}}}var ct=0,lt=v()((e,t)=>({...rt,...ot(),checkForUpdates:async()=>{let n=nt();if(!n)return null;let r=++ct;e({checking:!0,error:null,runtimeType:n});try{let i=null,a=null;if(n===`desktop`){let n=L.getState().otaChannelOverride;t().lastOtaChannelOverride!==n&&e({downloaded:!1,downloading:!1,available:!1,info:null,otaDecision:null,progress:null,otaPhase:`checking`});let i=await m(n);if(r!==ct||L.getState().otaChannelOverride!==n)return null;let a=i?.downloaded===!0,o=!a&&i?.downloading===!0;return e({checking:!1,available:i?.available??!1,downloaded:a,...a?{downloading:!1,progress:null,downloadError:null}:o?{downloading:!0,progress:i?.progress??null}:{},info:i,error:null,lastChecked:Date.now(),nextCheckInSec:i?.nextSuggestedCheckInSec??null,otaDecision:i?.otaDecision??null,otaPhase:a?`pending_restart`:o?`downloading`:i?.inAppApply?`available`:`idle`,lastOtaChannelOverride:n}),i?.nextSuggestedCheckInSec??null}if(n===`web`)i=await tt(`web`),a=i?.nextSuggestedCheckInSec??null;else if(n===`vscode`)a=(await tt(`vscode`))?.nextSuggestedCheckInSec??null;else if(n===`mobile`){let n=await R()??`unknown`,r=p()?_()?.mobileUpdates:void 0,o=L.getState().otaChannelOverride;if(r)try{let i=t().lastOtaChannelOverride!==o;e(i?{otaDecision:null,otaPhase:`checking`,downloaded:!1,otaDownloadSkipped:!1,progress:null,available:!1,info:null}:{otaPhase:`checking`});let a=await r.checkForOtaUpdate(o===`beta`||o===`stable`?{channelOverride:o}:void 0),s=st(a,n),c=(i?void 0:t().otaDecision?.ota.bundle?.bundleId)!==a.ota.bundle?.bundleId,l=!i&&t().downloaded&&!c;return e({checking:!1,available:s.available,info:s.info,error:s.info.error??null,lastChecked:Date.now(),nextCheckInSec:a.nextCheckInSec,otaDecision:a,otaPhase:l?`pending_restart`:s.otaPhase,lastOtaChannelOverride:o,...c||i?{downloaded:!1,otaDownloadSkipped:!1,progress:null}:{}}),a.nextCheckInSec}catch(t){if(!(t instanceof te)){let r=t instanceof Error?t.message:`Mobile OTA check failed`;return e({checking:!1,available:!1,info:{available:!1,currentVersion:n},error:r,lastChecked:Date.now(),otaDecision:null,otaPhase:`error`,lastOtaChannelOverride:o}),null}}return i=await Xe({currentVersion:n,platform:$e()===`ios`?`ios`:`android`,deviceClass:Ze(),arch:Qe(),reportUsage:L.getState().reportUsage}),a=i?.nextSuggestedCheckInSec??null,e({checking:!1,available:i?.available??!1,info:i,error:i?.error??null,lastChecked:Date.now(),nextCheckInSec:a,otaDecision:null,otaPhase:`idle`}),a}return e({checking:!1,available:n===`vscode`?!1:i?.available??!1,info:n===`vscode`?null:i,error:n===`vscode`?null:i?.error??null,lastChecked:Date.now(),nextCheckInSec:a}),a}catch(i){return r===ct&&e({checking:!1,error:i instanceof Error?i.message:`Failed to check for updates`,...n===`desktop`&&!t().downloaded?{otaPhase:`error`}:{}}),null}},downloadUpdate:async n=>{n?.resume===!0&&!t().info&&await t().checkForUpdates();let{available:r,runtimeType:i,otaDecision:a,downloading:o,downloaded:s}=t();if(o||s)return;let c=L.getState().otaChannelOverride,l=n?.resume===!0,u=l?t().downloadVersion:t().info?.version;if(l&&(t().downloadChannel!==c||u!==t().info?.version)){e({downloadError:`update_plan_changed`,error:`update_plan_changed`});return}if(i===`mobile`&&a?.primaryAction===`apply_ota`&&a.ota.bundle){if(o||s)return;let t=_()?.mobileUpdates;if(!t){e({error:`Mobile OTA updates are unavailable in this runtime`,downloadError:`Mobile OTA updates are unavailable in this runtime`,otaPhase:`error`});return}e({downloading:!0,error:null,downloadError:null,downloadVersion:u??null,downloadChannel:c,progress:null,otaPhase:`downloading`,otaDownloadSkipped:!1});try{let{skipped:n}=await t.downloadOtaUpdate(a.ota.bundle);await t.queueOtaUpdateForNextLaunch(),e({downloading:!1,downloaded:!0,downloadError:null,progress:null,otaPhase:`pending_restart`,otaDownloadSkipped:n})}catch(t){e({downloading:!1,error:t instanceof Error?t.message:`Failed to download update`,downloadError:t instanceof Error?t.message:`Failed to download update`,otaPhase:`error`})}return}if(!(i!==`desktop`||!r)){e({downloading:!0,error:null,downloadError:null,downloadVersion:u??null,downloadChannel:c,progress:null});try{let n=L.getState().otaChannelOverride,r=await m(n);if(n!==L.getState().otaChannelOverride)throw Error(`OTA channel changed`);if(u&&r?.version!==u)throw Error(`update_plan_changed`);if(!r?.available||r.manualUpdate)throw Error(`Update detected, but desktop package is not ready yet. Retry in a moment.`);if(e(e=>({info:e.info?{...e.info,...r,body:r.body||e.info.body,available:e.info.available}:r})),r.downloaded||t().downloaded){e({downloading:!1,downloaded:!0,progress:null});return}if(r.downloading&&e({downloading:!0,progress:r.progress??{downloaded:0}}),!await f(t=>{e({progress:t})}))throw Error(`Failed to download update`);e({downloading:!1,downloaded:!0,progress:null,otaPhase:`pending_restart`})}catch(t){e({downloading:!1,error:t instanceof Error?t.message:`Failed to download update`,downloadError:t instanceof Error?t.message:`Failed to download update`})}}},subscribeDesktopUpdateEvents:async()=>{if(!l())return()=>{};let n=[],r=await d(n=>{let r=n.event,i=n.data??null;if(r===`Started`){if(!t().downloading)return;e({error:null,progress:{downloaded:0,total:typeof i?.contentLength==`number`?i.contentLength:void 0}});return}if(r===`Progress`){if(!t().downloading)return;e({progress:{downloaded:typeof i?.downloaded==`number`?i.downloaded:0,total:typeof i?.total==`number`?i.total:void 0}});return}r===`Finished`&&e({downloading:!1,downloaded:!0,progress:null,downloadError:null})});r&&n.push(r);let i=await s(t=>{t.downloaded&&e({downloading:!1,downloaded:!0,available:!0,progress:null,downloadError:null})});return i&&n.push(i),async()=>{for(let e of n)try{let t=e();t instanceof Promise&&await t}catch{}}},restartToUpdate:async()=>{let{downloaded:n,runtimeType:r,otaDecision:i}=t();if(r===`mobile`&&i?.primaryAction===`apply_ota`){if(!n)return;let t=_()?.mobileUpdates;if(!t){e({error:`Mobile OTA updates are unavailable in this runtime`,otaPhase:`error`});return}try{await t.applyOtaUpdateNow()}catch(t){e({error:t instanceof Error?t.message:`Failed to restart`,otaPhase:`error`})}return}if(!(r!==`desktop`||!n))try{if(!await u())throw Error(`Failed to restart`)}catch(t){e({error:t instanceof Error?t.message:`Failed to restart`})}},setOtaPhase:(t,n=null)=>{e({otaPhase:t,...n===void 0?{}:{error:n}})},setOtaDownloadPercent:n=>{if(!Number.isFinite(n)||n<0||n>100)return;let r=t();if(!r.downloading)return;let i=Math.round(n);if((r.progress?.total?Math.round(r.progress.downloaded/r.progress.total*100):null)===i)return;let a=r.otaDecision?.ota.bundle?.size;if(typeof a==`number`&&Number.isFinite(a)&&a>0){e({progress:{downloaded:Math.round(a*n/100),total:a}});return}e({progress:{downloaded:n,total:100}})},setOtaDownloadFailed:t=>{e({downloading:!1,downloaded:!1,error:t??`Failed to download update`,downloadError:t??`Failed to download update`,otaPhase:`error`})},dismiss:()=>{let n=t();n.otaPhase===`pending_restart`||n.downloading||n.downloadError||e({available:!1,downloaded:!1,info:null,otaDecision:null,otaPhase:`idle`,otaDownloadSkipped:!1})},discardInterruptedDownload:()=>{t().downloading||e({downloadError:null,downloadVersion:null,downloadChannel:null,error:null,progress:null})},reset:()=>{e(rt)}}));lt.subscribe((e,t)=>{if(e.downloading===t.downloading&&e.downloaded===t.downloaded&&e.downloadError===t.downloadError&&e.downloadVersion===t.downloadVersion&&e.downloadChannel===t.downloadChannel)return;let n=T();(e.downloading||e.downloadError)&&!e.downloaded&&at(e.downloadVersion)?n.setItem(it,JSON.stringify({version:e.downloadVersion,channel:e.downloadChannel,runtimeType:e.runtimeType})):n.removeItem(it)});var ut=8e3,X=e=>!!(e&&![`succeeded`,`failed`].includes(e.status));function Z(e,t){if(e!==n()||t!==r())throw Error(`Stale update runtime`)}var Q=(e=n(),t=r(),a)=>({queryKey:[e,`host-update`,t,a??`current`],queryFn:async({signal:n})=>{Z(e,t);let r=new AbortController,o=()=>r.abort();n.addEventListener(`abort`,o,{once:!0});let s;try{return await Promise.race([(async()=>{let n=await i(`/api/system/update${a?`?channel=${a}`:``}`,{headers:{Accept:`application/json`},signal:r.signal});if([404,501].includes(n.status))throw Error(`host_update_unsupported`);let o=await n.json();if(Z(e,t),!n.ok&&n.status!==502||typeof o.serverId!=`string`||typeof o.supported!=`boolean`||![`cli`,`electron`].includes(o.host))throw Error(`Host update check failed`);return o})(),new Promise((e,t)=>{s=setTimeout(()=>{r.abort(),t(Error(`host_update_timeout`))},ut)})])}finally{s!==void 0&&clearTimeout(s),n.removeEventListener(`abort`,o)}},staleTime:6e4,retry:!1}),dt=(e=n(),t=r(),i)=>P.getQueryData(Q(e,t,i).queryKey),ft=(e=n(),t=r(),i)=>{let a=dt(e,t,i);return P.fetchQuery({...Q(e,t,i),staleTime:a?.checkError||X(a?.operation)?0:6e4})},pt=(e=n(),t=r(),i)=>P.fetchQuery({...Q(e,t,i),staleTime:0}),mt=(e,t,n)=>{let r=(0,Oe.c)(6),i;r[0]!==n||r[1]!==t||r[2]!==e?(i=Q(e,t,n),r[0]=n,r[1]=t,r[2]=e,r[3]=i):i=r[3];let a;return r[4]===i?a=r[5]:(a={...i,refetchInterval:_t,refetchIntervalInBackground:!1},r[4]=i,r[5]=a),j(a)};async function ht(e,t,n){if(Z(t,n),!e.update)throw Error(`No update plan`);let r=await i(`/api/system/update`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify({version:e.update.version,channel:e.channel,planId:e.update.planId,allowDowngrade:e.update.rollback===!0})});if(Z(t,n),!r.ok)throw Error(`Host update was not accepted`);let a=await r.json();if(typeof a.operation?.id!=`string`)throw Error(`Invalid update operation`);return a.operation}async function gt(e,t,n){Z(t,n);let r=await pt(t,n,e.channel);Z(t,n);let i=r.operation;if(i?.id===e.id&&i.version===e.version&&i.channel===e.channel&&i.kind===e.kind&&(X(i)||i.status===`succeeded`&&r.currentVersion===e.version))return P.setQueryData(Q(t,n).queryKey,r),i;if(r.checkError||r.update?.version!==e.version||r.update.kind!==e.kind)throw Error(`update_plan_changed`);let a=await ht(r,t,n);return Z(t,n),P.setQueryData(Q(t,n).queryKey,e=>({...e??r,operation:a})),a}function _t(e){return X(e.state.data?.operation)?2e3:e.state.error?.message===`host_update_unsupported`?!1:e.state.error?15e3:3e5}function vt(e){let t=new Date(`${e}T00:00:00`);return Number.isNaN(t.getTime())?e:new Intl.DateTimeFormat(ae(),{year:`numeric`,month:`short`,day:`numeric`}).format(t)}function yt(e){return e.replace(/^## \[[^\]]+\] - \d{4}-\d{2}-\d{2}\s*\n?/,``).trim()}function bt(e){return e.replace(/(^|[^a-zA-Z0-9])@([a-zA-Z0-9-]+)/g,`$1[@$2](https://github.com/$2)`)}function xt(e,t){let n=e.split(`.`).map(e=>Number.parseInt(e,10)),r=t.split(`.`).map(e=>Number.parseInt(e,10));for(let e=0;e<3;e+=1){let t=Number.isFinite(n[e])?n[e]:0,i=Number.isFinite(r[e])?r[e]:0;if(t!==i)return i-t}return 0}function St(e){let t=/^## \[(\d+\.\d+\.\d+)\] - (\d{4}-\d{2}-\d{2})\s*$/gm,n=[],r;for(;(r=t.exec(e))!==null;)n.push({version:r[1]??``,date:r[2]??``,start:r.index});return n.map((t,r)=>{let i=n[r+1]?.start??e.length;return{version:t.version,date:t.date,start:t.start,end:i,raw:e.slice(t.start,i).trim()}})}function Ct(e){let t=(0,Oe.c)(70),{open:n,onOpenChange:r,model:i,onAction:a}=e,{t:o}=oe(),[s,c]=(0,Y.useState)(!1),l=F(Tt),u;t[0]===l?u=t[1]:(u=e=>{let t=e.target.closest(`a`);t?.href&&(e.preventDefault(),e.stopPropagation(),l(t.href))},t[0]=l,t[1]=u);let d=F(u),f;t[2]===i.fallbackCommand?f=t[3]:(f=async()=>{i.fallbackCommand&&(await re(i.fallbackCommand)).ok&&(c(!0),setTimeout(()=>c(!1),2e3))},t[2]=i.fallbackCommand,t[3]=f);let p=F(f),m;if(t[4]!==i.body||t[5]!==o){bb0:{let e=i.body?.trim();if(!e){m=null;break bb0}let n=St(e);if(!n.length){m={kind:`raw`,title:o(`updateDialog.changelog.title`),content:bt(e)};break bb0}let r;t[7]===o?r=t[8]:(r=o(`updateDialog.changelog.title`),t[7]=o,t[8]=r),m={kind:`sections`,title:r,sections:[...n].sort(wt).map(t=>({version:t.version,dateLabel:vt(t.date),content:bt(yt(t.raw)||e)}))}}t[4]=i.body,t[5]=o,t[6]=m}else m=t[6];let h=m,g=i.dismissible===!1?void 0:r,_=i.stableLayout&&`h-[min(38rem,calc(100dvh-2rem))] overflow-hidden transition-[opacity,transform,filter]`,v;t[9]===_?v=t[10]:(v=z(`max-w-4xl gap-0 p-4 sm:p-5 bg-background border-[var(--interactive-border)]`,_),t[9]=_,t[10]=v);let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,H.jsx)(B,{name:`download-cloud`,className:`h-5 w-5 text-[var(--primary-base)]`}),t[11]=y):y=t[11];let b;t[12]===i.title?b=t[13]:(b=(0,H.jsxs)(le,{className:`flex items-center gap-2`,children:[y,(0,H.jsx)(`span`,{className:`font-semibold text-foreground`,children:i.title})]}),t[12]=i.title,t[13]=b);let x;t[14]!==i.currentVersion||t[15]!==i.methodLabel||t[16]!==i.version?(x=(i.currentVersion||i.version)&&(0,H.jsxs)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1.5 pl-7 font-mono text-[11px] leading-4 tracking-[-0.01em] tabular-nums sm:text-xs`,children:[i.currentVersion&&(0,H.jsx)(`span`,{className:`text-muted-foreground/75`,children:i.currentVersion}),i.currentVersion&&i.version&&(0,H.jsx)(`span`,{className:`text-muted-foreground/40`,children:`→`}),i.version&&(0,H.jsx)(`span`,{className:`font-medium text-[var(--primary-base)]`,children:i.version}),i.methodLabel&&(0,H.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,i.methodLabel]})]}),t[14]=i.currentVersion,t[15]=i.methodLabel,t[16]=i.version,t[17]=x):x=t[17];let S;t[18]===i.description?S=t[19]:(S=i.description&&(0,H.jsx)(ue,{className:`mt-2`,children:i.description}),t[18]=i.description,t[19]=S);let C;t[20]!==S||t[21]!==b||t[22]!==x?(C=(0,H.jsxs)(`div`,{className:`mb-3 shrink-0 pr-8 sm:mb-4`,children:[b,x,S]}),t[20]=S,t[21]=b,t[22]=x,t[23]=C):C=t[23];let w=i.stableLayout?`flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto`:`space-y-3 sm:space-y-4`,T;t[24]===i.message?T=t[25]:(T=i.message&&(0,H.jsx)(`p`,{role:`status`,className:`typography-ui-label text-muted-foreground`,children:i.message}),t[24]=i.message,t[25]=T);let E;t[26]===i.warning?E=t[27]:(E=i.warning&&(0,H.jsx)(`p`,{className:`typography-meta text-[var(--status-warning)]`,children:i.warning}),t[26]=i.warning,t[27]=E);let D;t[28]!==h||t[29]!==d||t[30]!==i.hideChangelog||t[31]!==i.stableLayout?(D=h&&!i.hideChangelog&&(0,H.jsxs)(`section`,{className:z(`overflow-hidden rounded-xl border border-[var(--surface-subtle)] bg-[var(--surface-elevated)]/20`,i.stableLayout&&`flex min-h-0 flex-1 flex-col`),children:[(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--surface-subtle)] px-3.5 py-2.5 sm:px-4 sm:py-3`,children:[(0,H.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-[var(--primary-base)]`,"aria-hidden":`true`}),(0,H.jsx)(`h3`,{className:`typography-ui-caption font-medium text-muted-foreground`,children:h.title})]}),(0,H.jsx)(se,{className:i.stableLayout?`p-0`:`max-h-[min(42dvh,22rem)] p-0 sm:max-h-[400px]`,outerClassName:i.stableLayout?`flex-1`:void 0,fillContainer:!!i.stableLayout,children:h.kind===`raw`?(0,H.jsx)(`div`,{className:`break-words px-3.5 py-2 text-[13px] leading-[1.65] text-foreground sm:px-4 sm:text-sm [&_.markdown-content]:leading-[1.65] [&_.markdown-content>:first-child]:!mt-0 [&_.markdown-content>:first-child>:first-child]:!mt-0 [&_.markdown-content>:last-child]:!mb-0 [&_a]:!text-[var(--primary-base)] [&_a]:!no-underline [&_a:hover]:!underline`,onClickCapture:d,children:(0,H.jsx)(ye,{content:h.content,disableLinkSafety:!0,enableFileReferences:!1})}):(0,H.jsx)(`div`,{className:`divide-y divide-[var(--surface-subtle)]`,children:h.sections.map(e=>(0,H.jsxs)(`div`,{className:`px-3.5 py-2 sm:px-4`,children:[(0,H.jsxs)(`div`,{className:`mb-2.5 flex flex-wrap items-center gap-x-2 gap-y-1 sm:mb-3`,children:[(0,H.jsxs)(`span`,{className:`rounded-md bg-[var(--primary-base)]/10 px-1.5 py-0.5 font-mono text-[11px] font-medium leading-4 text-[var(--primary-base)] tabular-nums sm:text-xs`,children:[`v`,e.version]}),(0,H.jsx)(`span`,{className:`text-[11px] leading-4 text-muted-foreground/75 sm:text-xs`,children:e.dateLabel})]}),(0,H.jsx)(`div`,{className:`break-words text-[13px] leading-[1.65] text-foreground sm:text-sm [&_.markdown-content]:leading-[1.65] [&_a]:!text-[var(--primary-base)] [&_a]:!no-underline [&_a:hover]:!underline`,onClickCapture:d,children:(0,H.jsx)(ye,{content:e.content,disableLinkSafety:!0,enableFileReferences:!1})})]},e.version))})})]}),t[28]=h,t[29]=d,t[30]=i.hideChangelog,t[31]=i.stableLayout,t[32]=D):D=t[32];let O;t[33]!==s||t[34]!==p||t[35]!==i.fallbackCommand||t[36]!==o?(O=i.fallbackCommand&&(0,H.jsxs)(`div`,{className:`space-y-2 mt-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 typography-meta text-muted-foreground`,children:[(0,H.jsx)(B,{name:`terminal`,className:`h-4 w-4`}),(0,H.jsx)(`span`,{children:o(`updateDialog.fallback.updateViaTerminal`)})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 p-1 pl-3 bg-[var(--surface-elevated)]/50 rounded-md border border-[var(--surface-subtle)]`,children:[(0,H.jsx)(`code`,{className:`flex-1 font-mono text-sm text-foreground overflow-x-auto whitespace-nowrap`,children:i.fallbackCommand}),(0,H.jsx)(`button`,{onClick:p,className:z(`flex items-center justify-center p-2 rounded`,`text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]`,`transition-colors`,s&&`text-[var(--status-success)]`),title:o(s?`updateDialog.actions.copied`:`updateDialog.actions.copyCommand`),children:(0,H.jsx)(B,{name:s?`check`:`clipboard`,className:`h-4 w-4`})})]})]}),t[33]=s,t[34]=p,t[35]=i.fallbackCommand,t[36]=o,t[37]=O):O=t[37];let k;t[38]!==i.stableLayout||t[39]!==i.status?(k=i.status&&(0,H.jsxs)(`div`,{role:`status`,className:z(`space-y-2`,i.stableLayout&&`min-h-9 shrink-0`),children:[(0,H.jsxs)(`div`,{className:`flex h-5 items-center justify-between gap-3`,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-xs font-medium text-muted-foreground sm:text-[13px]`,children:[i.status.kind===`activity`&&(0,H.jsx)(B,{name:`loader`,className:`h-3.5 w-3.5 shrink-0 animate-spin text-[var(--primary-base)]`}),(0,H.jsx)(`span`,{className:`truncate`,title:i.status.label,children:i.status.label})]}),i.status.progress!=null&&(0,H.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] leading-4 text-foreground tabular-nums sm:text-xs`,children:[Math.round(i.status.progress),`%`]})]}),(0,H.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-[var(--surface-subtle)] sm:h-1.5`,children:i.status.progress==null?(0,H.jsx)(`div`,{className:`h-full w-1/3 animate-pulse rounded-full bg-[var(--primary-base)]/60`}):(0,H.jsx)(`div`,{className:`h-full rounded-full bg-[var(--primary-base)] transition-[width] duration-500`,style:{width:`${i.status.progress}%`}})}),i.status.detail&&(0,H.jsx)(`p`,{className:`text-xs leading-4 text-muted-foreground`,children:i.status.detail})]}),t[38]=i.stableLayout,t[39]=i.status,t[40]=k):k=t[40];let A;t[41]===i.error?A=t[42]:(A=i.error&&(0,H.jsx)(`div`,{role:`alert`,className:`p-3 mt-4 bg-[var(--status-error-background)] border border-[var(--status-error-border)] rounded-lg`,children:(0,H.jsx)(`p`,{className:`text-sm text-[var(--status-error)]`,children:i.error})}),t[41]=i.error,t[42]=A);let j;t[43]!==w||t[44]!==T||t[45]!==E||t[46]!==D||t[47]!==O||t[48]!==k||t[49]!==A?(j=(0,H.jsxs)(`div`,{className:w,children:[T,E,D,O,k,A]}),t[43]=w,t[44]=T,t[45]=E,t[46]=D,t[47]=O,t[48]=k,t[49]=A,t[50]=j):j=t[50];let M;t[51]===i.option?M=t[52]:(M=i.option&&(0,H.jsxs)(`div`,{className:z(`mt-4 flex shrink-0 items-start gap-2.5`,i.option.disabled&&`opacity-60`),children:[(0,H.jsx)(be,{checked:i.option.checked,onChange:i.option.onChange,disabled:i.option.disabled,ariaLabel:i.option.label,className:`mt-0.5 self-start`}),(0,H.jsxs)(`span`,{className:z(`min-w-0 space-y-0.5`,i.option.disabled?`cursor-not-allowed`:`cursor-pointer`),onClick:i.option.disabled?void 0:()=>i.option?.onChange(!i.option.checked),children:[(0,H.jsx)(`span`,{className:`block typography-ui-label text-foreground`,children:i.option.label}),i.option.hint&&(0,H.jsx)(`span`,{className:`block typography-meta text-muted-foreground`,children:i.option.hint})]})]}),t[51]=i.option,t[52]=M);let N;t[53]===i.notice?N=t[54]:(N=i.notice&&(0,H.jsxs)(`div`,{className:`mt-4 flex items-center gap-2 rounded-lg border border-[var(--status-success-border)] bg-[var(--status-success-background)] px-3 py-2.5 text-sm text-[var(--status-success)]`,children:[(0,H.jsx)(B,{name:`check`,className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:i.notice})]}),t[53]=i.notice,t[54]=N);let P;t[55]!==i.actions||t[56]!==i.releaseLink||t[57]!==a?(P=(i.releaseLink||i.actions.length>0)&&(0,H.jsxs)(`div`,{className:`mt-4 flex shrink-0 items-center justify-between gap-4`,children:[i.releaseLink&&(0,H.jsxs)(`a`,{href:i.releaseLink.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1.5 typography-ui-label text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:[(0,H.jsx)(B,{name:`external-link`,className:`h-4 w-4`}),i.releaseLink.label]}),(0,H.jsx)(`div`,{className:`flex min-w-0 flex-1 flex-nowrap items-center justify-end gap-2`,children:i.actions.map(e=>(0,H.jsxs)(ne,{onClick:()=>a(e.id),disabled:e.disabled,variant:e.variant??`default`,size:`default`,className:`min-w-0 shrink`,title:e.label,children:[e.icon&&(0,H.jsx)(B,{name:e.icon,className:z(`h-4 w-4`,e.loading&&`animate-spin`)}),(0,H.jsx)(`span`,{className:`truncate`,children:e.label})]},e.id))})]}),t[55]=i.actions,t[56]=i.releaseLink,t[57]=a,t[58]=P):P=t[58];let I;t[59]!==C||t[60]!==j||t[61]!==M||t[62]!==N||t[63]!==P||t[64]!==v?(I=(0,H.jsxs)(ce,{className:v,showCloseButton:!0,children:[C,j,M,N,P]}),t[59]=C,t[60]=j,t[61]=M,t[62]=N,t[63]=P,t[64]=v,t[65]=I):I=t[65];let L;return t[66]!==n||t[67]!==I||t[68]!==g?(L=(0,H.jsx)(de,{open:n,onOpenChange:g,children:I}),t[66]=n,t[67]=I,t[68]=g,t[69]=L):L=t[69],L}function wt(e,t){return xt(e.version,t.version)}function Tt(e){ee(e)}var Et=`https://github.com/yee94/yuri/releases`,Dt=2e3,Ot=6e5,$=e=>e.transport===n()&&e.generation===r();async function kt(e,t){try{if(!$(t))return{success:!1};let n=await ft(t.transport,t.generation);return!$(t)||!e||!n.supported||n.update?.version!==e||n.update.rollback?{success:!1}:(await ht(n,t.transport,t.generation),{success:!0,autoRestart:!0})}catch(e){return{success:!1,error:e instanceof Error?e.message:void 0}}}async function At(e,t){let n;try{n=await ft(t.transport,t.generation)}catch(e){if(e instanceof Error&&e.message===`host_update_unsupported`)return!1;throw e}if(!$(t))throw Error(`Stale update runtime`);return!e||!n.supported||!n.update||n.update.rollback||n.update.version!==e?!1:(await ht(n,t.transport,t.generation),!0)}async function jt(e,t,n=Math.ceil(Ot/Dt),r=Dt){for(let i=0;i<n;i++){if(!$(t))return!1;try{let n=await pt(t.transport,t.generation);if(n.operation?.status===`failed`)return!1;if(n.currentVersion===e&&n.operation?.status===`succeeded`&&$(t))return!0}catch{}await new Promise(e=>setTimeout(e,r))}return!1}var Mt=({open:e,onOpenChange:t,info:i,downloading:a,downloaded:s,progress:l,error:u,onDownload:d,onRestart:f,runtimeType:p=`desktop`})=>{let{t:m}=oe(),[h,g]=(0,Y.useState)(`idle`),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(!0),x=lt(e=>e.otaDownloadSkipped),S=i?.releaseUrl||(i?.version?`${Et}/tag/v${i.version}`:Et),C=i?.downloadUrl,w=p===`web`,T=p===`mobile`,E=T&&i?.manualUpdate===!0&&!!C,D=T&&i?.inAppApply===!0,O=p===`desktop`&&i?.manualUpdate===!0,k=h!==`idle`&&h!==`error`,A=p===`desktop`&&!O&&c()&&!o(),j=A&&k,M=T?C:S,N=F(e=>{!e&&D&&s&<.getState().dismiss(),t(e)});(0,Y.useEffect)(()=>{e||(g(`idle`),v(null))},[e]);let P=F(async()=>{let e={transport:n(),generation:r()};g(`updating`),v(null);let t=await kt(i?.version,e);if(!$(e))return;if(!t.success){g(`error`),v(t.error||m(`updateDialog.error.updateFailed`));return}t.autoRestart&&(g(`restarting`),await new Promise(e=>setTimeout(e,2e3))),g(`reconnecting`);let a=await jt(i?.version,e);$(e)&&(a?window.location.reload():(g(`error`),v(m(`updateDialog.error.takingLonger`))))}),I=F(async()=>{if(!A||!y){f();return}let e={transport:n(),generation:r()};g(`updating`),v(null);try{if(await At(i?.version,e)){if(!$(e))return;if(g(`reconnecting`),!await jt(i?.version,e)){$(e)&&(g(`error`),v(m(`updateDialog.error.remoteUpdateFailed`)));return}}}catch{$(e)&&(g(`error`),v(m(`updateDialog.error.remoteUpdateFailed`)));return}$(e)&&(g(`idle`),f())}),L=F(e=>{switch(e){case`download`:d();break;case`restart`:I();break;case`later`:lt.getState().dismiss(),t(!1);break;case`open-external`:{let e=T?C:S;e&&ee(e);break}case`web-update`:P()}}),R=[];!w&&(!T||D)&&(!O&&!s&&!a&&R.push({id:`download`,icon:`download`,label:m(D?`updateDialog.actions.applyOtaNow`:`updateDialog.actions.downloadUpdate`)}),O&&!s&&!a&&R.push({id:`open-external`,icon:`external-link`,label:m(`updateDialog.actions.openMobileUpdate`)}),a&&R.push({id:`downloading`,icon:`loader`,loading:!0,disabled:!0,label:m(`updateDialog.status.downloading`)}),s&&(D&&R.push({id:`later`,variant:`ghost`,label:m(`updateDialog.actions.later`)}),R.push(j?{id:`updating`,icon:`loader`,loading:!0,disabled:!0,label:m(`updateDialog.status.updating`)}:{id:`restart`,icon:`restart`,label:m(`updateDialog.actions.restartToUpdate`)}))),T&&!D&&E&&R.push({id:`open-external`,icon:`external-link`,label:m(`updateDialog.actions.openMobileUpdate`)}),w&&R.push(k?{id:`updating`,icon:`loader`,loading:!0,disabled:!0,label:m(`updateDialog.status.updating`)}:{id:`web-update`,icon:`download`,label:m(`updateDialog.actions.updateNow`)});let te={title:m(h===`restarting`||h===`reconnecting`?`updateDialog.header.updating`:`updateDialog.header.updateAvailable`),currentVersion:i?.currentVersion,version:i?.version,body:i?.body,hideChangelog:k,dismissible:!k,option:A&&s?{label:m(`updateDialog.remote.syncLabel`),hint:m(`updateDialog.remote.syncHint`),checked:y,disabled:j,onChange:b}:void 0,error:u||_,fallbackCommand:w&&h===`error`?i?.updateCommand||`yuri update`:void 0,notice:D&&s&&x?m(`updateDialog.status.otaBundleReused`):void 0,releaseLink:(!T||E)&&M?{url:M,label:`GitHub`}:void 0,actions:R};return w&&k&&(te.status={kind:`activity`,label:m(h===`updating`?`updateDialog.status.installingUpdate`:h===`restarting`?`updateDialog.status.serverRestarting`:`updateDialog.status.waitingForServer`),detail:m(`updateDialog.status.autoReloadHint`)}),j&&(te.status={kind:`activity`,label:m(`updateDialog.status.updatingRemote`)}),!w&&(!T||D)&&a&&(te.status={kind:`download`,label:m(`updateDialog.status.downloadingPayload`),progress:l?.total?Math.round(l.downloaded/l.total*100):0}),(0,H.jsx)(Ct,{open:e,onOpenChange:N,model:te,onAction:L})};function Nt(e,t){return e===`checking`?5:e===`downloading`?5+Math.min(Math.max(t??0,0),100)*.75:e===`installing`?85:e===`restarting`?95:100}function Pt(e,t,n){let r=e?.operation,i=e?.update,a=i??(r&&t.updateDetails&&r.planId===t.updateDetails.planId&&r.version===t.updateDetails.version?t.updateDetails:void 0),o=X(r),s=e?.supported===!1||t.failure===`unsupported`,c={title:n(`settings.yuri.about.hostUpdate.title`),stableLayout:!0,description:n(`settings.yuri.about.hostUpdate.description`),currentVersion:e?.currentVersion??t.versionFallback,version:i?.version??r?.version,body:a||r?a?.releaseNotes||n(`settings.yuri.about.hostUpdate.noNotes`):void 0,warning:!o&&i?.rollback?n(`settings.yuri.about.hostUpdate.downgrade`):void 0,actions:o||t.submitting||t.completed||!i?[]:[{id:`confirm`,icon:`download`,label:n(`settings.yuri.about.hostUpdate.confirm`),disabled:!e?.supported||!!t.failure||!!t.checking}]};return o&&r?c.status={kind:r.status===`downloading`?`download`:`activity`,label:n(t.failure===`disconnected`?`settings.yuri.about.hostUpdate.reconnecting`:`settings.yuri.about.hostUpdate.status.${r.status}`),progress:Nt(r.status,r.progress)}:t.completed&&!i?c.status={kind:`download`,label:n(`settings.yuri.about.hostUpdate.status.succeeded`),progress:100}:t.submitting?c.status={kind:`activity`,label:n(`settings.yuri.about.state.checking`),progress:0}:t.checking===`initial`?c.status={kind:`activity`,label:n(`settings.yuri.about.state.checking`)}:s?c.message=n(`settings.yuri.about.hostUpdate.unsupported`):t.failure?c.error=n(t.failure===`disconnected`?`settings.yuri.about.hostUpdate.reconnecting`:`settings.yuri.about.toast.checkFailed`):!i&&e?.supported&&(c.message=r?.status===`succeeded`?n(`settings.yuri.about.hostUpdate.status.succeeded`):n(`settings.yuri.about.toast.latestVersion`)),r?.status===`failed`&&(c.error=n(`settings.yuri.about.hostUpdate.status.failed`)),c}function Ft(){let e=(0,Oe.c)(7),{t:i}=oe(),a=Y.useSyncExternalStore(t,n,n),o=Y.useSyncExternalStore(t,r,r),s=`${a}:${o}`,c;e[0]===i?c=e[1]:(c=i(`settings.yuri.about.state.unknown`),e[0]=i,e[1]=c);let l;return e[2]!==o||e[3]!==s||e[4]!==c||e[5]!==a?(l=(0,H.jsx)(It,{transport:a,generation:o,version:c},s),e[2]=o,e[3]=s,e[4]=c,e[5]=a,e[6]=l):l=e[6],l}function It({version:e,transport:t,generation:i,itemId:a,channel:o}){let{t:s}=oe(),c=M(),[l,u]=Y.useState(!1),d=L(e=>e.otaChannelOverride),f=o??d??void 0,p=mt(t,i,f),m=p.data,h=m?.operation,g=X(h),_=JSON.stringify([t,i,f??`current`]),[v,y]=Y.useState(null);m?.update&&(v?.scope!==_||v.update!==m.update)&&y({scope:_,update:m.update});let b=A({mutationFn:({plan:e})=>ht(e,t,i),onSuccess:(e,a)=>{t===n()&&i===r()&&c.setQueryData(Q(t,i,a.channel).queryKey,t=>t&&{...t,operation:e})},onSettled:(e,a,o)=>{t===n()&&i===r()&&c.invalidateQueries({queryKey:Q(t,i,o.channel).queryKey,exact:!0})}}),[x,S]=Y.useState(null);l&&g&&h&&h.id!==x&&S(h.id);let C=h?.status===`succeeded`&&h.id===x,w=s(`settings.yuri.about.hostUpdate.status.succeeded`);Y.useEffect(()=>{!C||p.isError||t!==n()||i!==r()||(S(null),u(!1),ie.success(w,{id:`host-update:${t}:${i}:${x}`}))},[C,p.isError,t,i,x,w]);let T=Y.useRef(null),E=F(()=>_),D=F(async()=>{if(g){u(!0),p.refetch({cancelRefetch:!1});return}if(T.current===_)return;let e=_;T.current=e;try{let a=await p.refetch({cancelRefetch:!1});if(e!==E()||t!==n()||i!==r())return;if(a.isError||!a.data||a.data.checkError){a.error?.message===`host_update_unsupported`?ie.info(s(`settings.yuri.about.hostUpdate.unsupported`)):ie.error(s(`settings.yuri.about.toast.checkFailed`));return}X(a.data.operation)?u(!0):a.data.supported?a.data.update?u(!0):(u(!1),ie.success(s(`settings.yuri.about.toast.latestVersion`))):ie.info(s(`settings.yuri.about.hostUpdate.unsupported`))}finally{T.current===e&&(T.current=null)}}),O=m?.supported===!1||!g&&p.error?.message===`host_update_unsupported`,k=p.isError||!!m?.checkError,j=b.isError&&b.variables?.channel===f,N=Pt(m,{versionFallback:e,checking:p.isPending?`initial`:p.isFetching?`refresh`:!1,submitting:b.isPending,failure:O?`unsupported`:p.isError&&(g||j)?`disconnected`:k||j?`check`:null,completed:C,updateDetails:v?.scope===_?v.update:void 0},s),P=F(e=>{e===`confirm`&&m?.update&&b.mutate({plan:m,channel:f})});return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,"data-settings-item":a,children:[(0,H.jsxs)(`span`,{className:`relative typography-ui-label font-mono text-foreground text-right`,children:[m?.currentVersion??e,m?.update&&!g&&(0,H.jsx)(`span`,{"aria-label":s(`settings.yuri.about.hostUpdate.available`),className:`absolute -right-1.5 -top-0.5 size-1.5 rounded-full bg-[var(--status-error)]`})]}),(0,H.jsx)(ne,{type:`button`,size:`icon`,variant:`ghost`,onClick:D,disabled:p.isFetching&&!g,"aria-label":s(`settings.yuri.about.hostUpdate.title`),title:s(`settings.yuri.about.hostUpdate.title`),children:(0,H.jsx)(B,{name:g||p.isFetching?`loader`:m?.update?`download`:`refresh`,className:g||p.isFetching?`size-4 animate-spin`:`size-4`})})]}),(0,H.jsx)(Ct,{open:l,onOpenChange:u,model:N,onAction:P})]})}var Lt=e=>e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e),Rt=e=>{let t=e.replace(/\\/g,`/`),n=[],[r,...i]=t.split(`/`);for(let e of i)if(e!==``&&e!==`.`){if(e===`..`){n.pop();continue}n.push(e)}return`${/^[A-Za-z]:$/.test(r)?`${r.toUpperCase()}/`:`/`}${n.join(`/`)}`},zt=e=>Rt(`${e.replace(/\\/g,`/`)}/..`),Bt=e=>{try{let t=decodeURIComponent(new URL(e).pathname);return/^\/[A-Za-z]:\//.test(t)?t.slice(1):t}catch{return null}};function Vt(e,t){if(e.startsWith(`file://`)){let t=Bt(e);return t?{kind:`local`,path:Rt(t)}:null}return e.startsWith(`./`)||e.startsWith(`../`)?t?{kind:`local`,path:Rt(`${zt(t)}/${e}`)}:null:Lt(e)?{kind:`local`,path:Rt(e)}:{kind:`package`,target:e}}function Ht(e){return e?{kind:`local`,path:Rt(e)}:null}var Ut=(e,t)=>{if(e.kind===`package`)return t.source.kind===`package`&&t.source.target===e.target;if(t.source.kind!==`local`)return!1;let n=Rt(t.source.path);return n===e.path||n.startsWith(`${e.path}/`)};function Wt(e,t){return t.filter(t=>Ut(e,t))}function Gt(e){for(let t of e)if(t.state.kind===`active`&&t.source.kind===`package`&&t.source.version?.trim())return t.source.version.trim();return null}function Kt(e){let t=e.find(e=>e.state.kind===`failed`);if(t&&t.state.kind===`failed`)return{kind:`failed`,error:t.state.error,ref:t.state.ref};let n=e[0];return n?{kind:`active`,version:n.source.kind===`package`?n.source.version:null}:{kind:`notReported`}}function qt(e){let t=e.flatMap(e=>e.source.kind===`package`?[e.source]:[]);return t.some(e=>e.updating)?`updating`:t.some(e=>e.outdated)?`available`:`none`}function Jt(){let e=(0,Oe.c)(5),t=Ee(),n=De(),r=t.data?.entries,i=t.data?.files,a=n.data,o;bb0:{if(!a){let t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],o=t;break bb0}let t;if(e[1]!==r||e[2]!==i||e[3]!==a){t=[];let n=(e,n,r)=>{if(!r)return;let i=Kt(Wt(r,a));i.kind===`failed`&&t.push({id:e,label:n,error:i.error})};for(let e of r??[])n(e.id,e.spec,Vt(e.spec,e.sourcePath));for(let e of i??[])n(e.id,e.fileName,Ht(e.absolutePath));e[1]=r,e[2]=i,e[3]=a,e[4]=t}else t=e[4];o=t}return o}var Yt=e=>e instanceof Error&&e.name===`CancelledError`,Xt=v(()=>({setStatus:e=>xe(P,e),refreshStatus:async(e,t)=>{let r=n();t?.force&&await P.cancelQueries({queryKey:N.github.auth(r),exact:!0});try{return await Ce(P,e,r)}catch(e){if(Yt(e))return Se(P,r);throw e}}})),Zt=v()(b(y((e,t)=>({selectedProfileId:null,defaultGitIdentityId:null,profiles:[],globalIdentity:null,discoveredCredentials:[],isLoading:!1,setSelectedProfile:t=>{e({selectedProfileId:t})},loadProfiles:async()=>{e({isLoading:!0});let n=t().profiles;try{return e({profiles:await me(),isLoading:!1}),!0}catch(t){return console.error(`Failed to load git identity profiles:`,t),e({profiles:n,isLoading:!1}),!1}},loadGlobalIdentity:async()=>{try{let t=await ve();return t&&t.userName&&t.userEmail?e({globalIdentity:{id:`global`,name:`Global Identity`,userName:t.userName,userEmail:t.userEmail,authType:t.sshCommand?`ssh`:void 0,sshKey:t.sshCommand?t.sshCommand.replace(`ssh -i `,``):null,color:`info`,icon:`house`}}):e({globalIdentity:null}),!0}catch(t){return console.error(`Failed to load global git identity:`,t),e({globalIdentity:null}),!1}},loadDiscoveredCredentials:async()=>{try{return e({discoveredCredentials:await pe()}),!0}catch(t){return console.error(`Failed to discover git credentials:`,t),e({discoveredCredentials:[]}),!1}},loadDefaultGitIdentityId:async()=>{let t=e=>{if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null};try{let n=null;if(n===null){let e=_()?.settings;if(e)try{n=t(((await e.load())?.settings||{}).defaultGitIdentityId)}catch{}}if(n===null)try{let e=await i(`/api/config/settings`,{method:`GET`,headers:{Accept:`application/json`}});e.ok&&(n=t((await e.json().catch(()=>null))?.defaultGitIdentityId))}catch{}return e({defaultGitIdentityId:n}),!0}catch(e){return console.error(`Failed to load default git identity setting:`,e),!1}},setDefaultGitIdentityId:async t=>{try{let n=typeof t==`string`?t.trim():``,r=n.length>0?n:``;return await C({defaultGitIdentityId:r}),e({defaultGitIdentityId:r.length>0?r:null}),!0}catch(e){return console.error(`Failed to save default git identity setting:`,e),!1}},createProfile:async e=>{try{let n={...e,id:e.id||`profile-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,color:e.color||`keyword`,icon:e.icon||`branch`};return await ge(n),await t().loadProfiles(),!0}catch(e){return console.error(`Failed to create git identity profile:`,e),!1}},updateProfile:async(e,n)=>{try{let r=t().profiles.find(t=>t.id===e);if(!r)throw Error(`Profile not found`);let i={...r,...n};return await he(e,i),await t().loadProfiles(),!0}catch(e){return console.error(`Failed to update git identity profile:`,e),!1}},deleteProfile:async n=>{try{return await _e(n),t().selectedProfileId===n&&e({selectedProfileId:null}),await t().loadProfiles(),!0}catch(e){return console.error(`Failed to delete git identity profile:`,e),!1}},getProfileById:e=>{let{profiles:n,globalIdentity:r}=t();return e===`global`?r||void 0:n.find(t=>t.id===e)},getUnimportedCredentials:()=>{let{profiles:e,discoveredCredentials:n}=t();return n.filter(t=>!e.some(e=>e.authType===`token`&&e.host===t.host))}}),{name:`git-identities-store`,storage:E(),partialize:e=>({selectedProfileId:e.selectedProfileId})}),{name:`git-identities-store`}));typeof window<`u`&&(window.__zustand_git_identities_store__=Zt);var Qt=(e,t)=>e?t.kind===e.kind?t.projectRoot.length===e.projectRoot.length?t.projectId.localeCompare(e.projectId)<0:t.projectRoot.length>e.projectRoot.length:t.kind===`project`:!0,$t=(e,t,n)=>{Qt(e.get(t),n)&&e.set(t,n)},en=e=>{let t=e;return O(t.directory)??O(t.project?.worktree)},tn=e=>{if(e===`/`||/^[A-Z]:$/.test(e))return null;let t=e.lastIndexOf(`/`);return t<0?null:t===0?`/`:t===2&&/^[A-Z]:\//.test(e)?e.slice(0,2):e.slice(0,t)},nn=(e,t,n,r,i=[])=>{let a=new Map,o=new Map;for(let e of t){let t=O(e.normalizedPath);if(!t)continue;let n=o.get(t);(!n||e.id.localeCompare(n.id)<0)&&o.set(t,e),$t(a,t,{projectId:e.id,projectRoot:t,scopeDirectory:t,kind:`project`})}if(!r)for(let[e,t]of n){let n=O(e),r=n?o.get(n):void 0;if(!(!r||!n))for(let e of t){let t=O(e.path);t&&$t(a,t,{projectId:r.id,projectRoot:n,scopeDirectory:t,kind:`worktree`})}}let s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=e=>{if(!e)return null;if(s.has(e))return s.get(e)??null;if(r){let t=a.get(e)??null;return s.set(e,t),t}let t=[],n=e,i=null;for(;n;){if(s.has(n)){i=s.get(n)??null;break}if(t.push(n),i=a.get(n)??null,i)break;n=tn(n)}for(let e of t)s.set(e,i);return i},p=(e,t,n)=>{for(let r of e){let e=f(en(r));if(!e)continue;c.set(r.id,e);let i=t.get(e.projectId);if(i?i.push(r):t.set(e.projectId,[r]),!n)continue;let a=n.get(e.scopeDirectory);a?a.add(r.id):n.set(e.scopeDirectory,new Set([r.id]))}};return p(e,l,d),p(i,u),{bySessionId:c,sessionsByProject:l,archivedSessionsByProject:u,sessionsByScope:d,directoryResolutions:s.size}};export{lt as _,Vt as a,Gt as c,Ft as d,It as f,gt as g,X as h,Jt as i,Kt as l,Q as m,Zt as n,Wt as o,Mt as p,Xt as r,Ht as s,nn as t,qt as u,Ne as v,ke as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e}from"./platform-z1TeG-ky.js";import{co as t}from"./ui-DeV7Us1B.js";var n=`__unassigned__`,r={mod:`mod`,shift:`shift`,alt:`alt`,option:`alt`,ctrl:`ctrl`,meta:`mod`,cmd:`mod`,command:`mod`},i={mod:t()?`⌘`:`Ctrl`,shift:`⇧`,alt:`⌥`,option:`⌥`,ctrl:`⌃`},a={comma:`,`,period:`.`,enter:`Enter`,escape:`Esc`,tab:`Tab`,space:`Space`,backspace:`⌫`,delete:`⌦`,arrowup:`↑`,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`,home:`Home`,end:`End`,pageup:`Page Up`,pagedown:`Page Down`,backtick:"`",grave:"`","=":`=`,equal:`=`,plus:`+`,minus:`-`,"-":`-`},o=[`mod`,`ctrl`,`shift`,`alt`],s={"{":`[`,"}":`]`,":":`;`,'"':`'`,"<":`,`,">":`.`,"?":`/`,"|":`\\`,"~":"`","!":`1`,"@":`2`,"#":`3`,$:`4`,"%":`5`,"^":`6`,"&":`7`,"*":`8`,"(":`9`,")":`0`};function c(e){return e.trim().toLowerCase()===n}function l(e){let t=e.toLowerCase();return t===`,`?`comma`:t===`.`?`period`:t===` `?`space`:t===`esc`?`escape`:t===`+`?`plus`:t===`-`||t===`_`?`minus`:t===`arrowup`?`arrowup`:t===`arrowdown`?`arrowdown`:t===`arrowleft`?`arrowleft`:t===`arrowright`?`arrowright`:t==="`"?`backtick`:s[t]??t}var u=[{id:`open_command_palette`,defaultCombo:`mod+p`,label:`Open command palette`,description:`Open the command palette`,customizable:!0},{id:`focus_input`,defaultCombo:`mod+i`,label:`Focus input`,description:`Focus the chat input field`,customizable:!0},{id:`open_status`,defaultCombo:`mod+shift+o`,label:`Open OpenCode status`,description:`Open the OpenCode status dialog`},{id:`open_settings`,defaultCombo:`mod+comma`,label:`Open settings`,description:`Open the settings panel`,customizable:!0},{id:`toggle_terminal`,defaultCombo:`ctrl+backtick`,label:`Toggle terminal`,description:`Toggle the integrated terminal`,customizable:!0},{id:`toggle_bottom_panel`,defaultCombo:`mod+j`,label:`Toggle bottom panel`,description:`Toggle the bottom panel dock`,customizable:!0},{id:`toggle_terminal_expanded`,defaultCombo:`mod+shift+j`,label:`Toggle terminal expanded`,description:`Toggle terminal expanded or collapsed`,customizable:!0},{id:`new_terminal_tab`,defaultCombo:`mod+t`,label:`New terminal tab`,description:`Create a new terminal tab when the terminal is focused`,customizable:!0},{id:`open_new_terminal`,defaultCombo:`mod+shift+backtick`,label:`Open new terminal`,description:`Open the terminal panel and create a new terminal tab`,customizable:!0},{id:`previous_terminal_tab`,defaultCombo:`mod+shift+[`,label:`Previous terminal tab`,description:`Switch to the previous terminal tab when the terminal is focused`,customizable:!0},{id:`next_terminal_tab`,defaultCombo:`mod+shift+]`,label:`Next terminal tab`,description:`Switch to the next terminal tab when the terminal is focused`,customizable:!0},{id:`toggle_files`,defaultCombo:`mod+shift+f`,label:`Toggle files`,description:`Toggle the files panel`},{id:`toggle_sidebar`,defaultCombo:`mod+b`,label:`Toggle sidebar`,description:`Toggle the session sidebar`,customizable:!0},{id:`open_timeline_dialog`,defaultCombo:`mod+t`,label:`Open conversation timeline`,description:`Search and navigate within current conversation`,customizable:!0},{id:`toggle_prompt_navigator`,defaultCombo:`mod+alt+p`,label:`Toggle prompt navigator`,description:`Show or hide the prompt navigator panel in chat`,customizable:!0},{id:`toggle_right_sidebar`,defaultCombo:`mod+alt+b`,defaultAliases:[`mod+\\`],label:`Toggle review panel`,description:`Toggle the review panel (right sidebar)`,customizable:!0},{id:`open_right_sidebar_git`,defaultCombo:`mod+shift+g`,label:`Open right sidebar Git tab`,description:`Open right sidebar and select Git`,customizable:!0},{id:`open_right_sidebar_files`,defaultCombo:`mod+shift+f`,label:`Open right sidebar Files tab`,description:`Open right sidebar and select Files`,customizable:!0},{id:`cycle_right_sidebar_tab`,defaultCombo:`mod+alt+shift+r`,label:`Cycle right sidebar tab`,description:`Cycle through right sidebar tabs`,customizable:!0},{id:`close_context_panel_tab`,defaultCombo:`mod+w`,label:`Close context panel tab`,description:`Close the active context panel tab (closes the panel when empty)`,customizable:!0},{id:`previous_session`,defaultCombo:`mod+shift+[`,defaultAliases:[`mod+arrowup`],label:`Previous session`,description:`Switch to the previous session`,customizable:!0},{id:`next_session`,defaultCombo:`mod+shift+]`,defaultAliases:[`mod+arrowdown`],label:`Next session`,description:`Switch to the next session`,customizable:!0},{id:`new_chat`,defaultCombo:`mod+n`,label:`New session`,description:`Start a new session`,customizable:!0},{id:`new_chat_worktree`,defaultCombo:`mod+shift+alt+n`,label:`New worktree draft`,description:`Create a new worktree and open a draft in it`,customizable:!0},{id:`new_mini_chat`,defaultCombo:`mod+alt+n`,label:`New Mini Chat window`,description:`Open a new Mini Chat draft window`,customizable:!0},{id:`submit_message`,defaultCombo:`mod+enter`,label:`Submit message`,description:`Submit the current message`},{id:`clear_input`,defaultCombo:`escape`,label:`Clear input`,description:`Clear the input field`},{id:`clear_all_messages`,defaultCombo:`ctrl+c`,label:`Clear all messages`,description:`Clear the composer input and queued messages`,customizable:!0},{id:`open_diff_panel`,defaultCombo:`mod+2`,label:`Open diff panel`,description:`Switch to the diff panel`},{id:`open_terminal_panel`,defaultCombo:`mod+3`,label:`Open terminal panel`,description:`Switch to the terminal panel`},{id:`open_git_panel`,defaultCombo:`mod+4`,label:`Open git panel`,description:`Switch to the git panel`},{id:`open_help`,defaultCombo:`mod+.`,label:`Open keyboard shortcuts`,description:`Show the keyboard shortcuts help`,customizable:!0},{id:`toggle_services_menu`,defaultCombo:`mod+shift+s`,label:`Toggle services menu`,description:`Open or close the services menu`,customizable:!0},{id:`open_usage`,defaultCombo:`mod+shift+c`,label:`Open usage`,description:`Open the usage panel`,customizable:!0},{id:`cycle_services_tab`,defaultCombo:`mod+alt+shift+s`,label:`Cycle services tab`,description:`Cycle through tabs in the services menu`,customizable:!0},{id:`cycle_theme`,defaultCombo:`mod+/`,label:`Cycle theme`,description:`Cycle between light, dark, and system theme`,customizable:!0},{id:`zoom_in`,defaultCombo:`mod+=`,label:`Zoom in`,description:`Increase the webview zoom level`,customizable:!0},{id:`zoom_out`,defaultCombo:`mod+-`,label:`Zoom out`,description:`Decrease the webview zoom level`,customizable:!0},{id:`zoom_reset`,defaultCombo:`mod+0`,label:`Reset zoom`,description:`Reset the webview zoom level to 100%`,customizable:!0},{id:`leader_key`,defaultCombo:`ctrl+x`,label:`Leader key`,description:`Start an OpenCode-style chord, then press M / A / N / C`,customizable:!0},{id:`open_model_selector`,defaultCombo:`mod+shift+m`,label:`Open model selector`,description:`Open model selector while in chat`,customizable:!0},{id:`cycle_thinking_variant`,defaultCombo:`mod+shift+t`,label:`Cycle thinking variant`,description:`Cycle thinking variant while in chat`},{id:`cycle_agent`,defaultCombo:`tab`,label:`Cycle agent`,description:`Cycle agent while the model selector is open`,customizable:!0},{id:`cycle_favorite_model_forward`,defaultCombo:`ctrl+]`,label:`Cycle favorite model forward`,description:`Cycle forward through starred models without opening the picker`,customizable:!0},{id:`cycle_favorite_model_backward`,defaultCombo:`ctrl+[`,label:`Cycle favorite model backward`,description:`Cycle backward through starred models without opening the picker`,customizable:!0},{id:`expand_input`,defaultCombo:`mod+shift+e`,label:`Expand input`,description:`Toggle focus mode for the chat input`,customizable:!0},{id:`toggle_dictation`,defaultCombo:`mod+alt+v`,label:`Voice input`,description:`Start dictation; press again to confirm and insert the transcript`,customizable:!0},{id:`abort_run`,defaultCombo:`escape`,label:`Abort active run`,description:`Abort the currently running task (double press)`},{id:`switch_tab_1`,defaultCombo:`mod+1`,label:`Switch to visible session 1`,description:`Switch to the first visible sidebar session`},{id:`switch_tab_2`,defaultCombo:`mod+2`,label:`Switch to visible session 2`,description:`Switch to the second visible sidebar session`},{id:`switch_tab_3`,defaultCombo:`mod+3`,label:`Switch to visible session 3`,description:`Switch to the third visible sidebar session`},{id:`switch_tab_4`,defaultCombo:`mod+4`,label:`Switch to visible session 4`,description:`Switch to the fourth visible sidebar session`},{id:`switch_tab_5`,defaultCombo:`mod+5`,label:`Switch to visible session 5`,description:`Switch to the fifth visible sidebar session`},{id:`switch_tab_6`,defaultCombo:`mod+6`,label:`Switch to visible session 6`,description:`Switch to the sixth visible sidebar session`},{id:`switch_tab_7`,defaultCombo:`mod+7`,label:`Switch to visible session 7`,description:`Switch to the seventh visible sidebar session`},{id:`switch_tab_8`,defaultCombo:`mod+8`,label:`Switch to visible session 8`,description:`Switch to the eighth visible sidebar session`},{id:`switch_tab_9`,defaultCombo:`mod+9`,label:`Switch to visible session 9`,description:`Switch to the ninth visible sidebar session`}];function d(e){if(c(e))return n;let t=e.toLowerCase().trim().split(`+`).map(e=>e.trim()).filter(Boolean),i=new Set,a=``;for(let e of t){let t=e===`,`?`comma`:e===`.`?`period`:e,n=r[t];if(n){i.add(n);continue}a=t}return[...o.filter(e=>i.has(e)),a].filter(Boolean).join(`+`)}function f(e){return c(e)?!0:p(e).key.trim().length>0}function p(e){if(c(e))return{modifiers:new Set,key:n};let t=d(e).split(`+`),i=new Set,a=``;for(let e of t){let t=r[e];t?i.add(t):a=e}return{modifiers:i,key:a}}function m(e){if(c(e))return`Unassigned`;let t=p(e);if(!t.key&&t.modifiers.size===0)return`Unassigned`;let n=[];for(let e of o)t.modifiers.has(e)&&n.push(i[e]);if(t.key){let e=a[t.key.toLowerCase()]||t.key.toUpperCase();n.push(e)}return n.join(` + `)}function h(e){return u.find(t=>t.id===e)}function g(){return u.filter(e=>e.customizable===!0)}function _(e,t){let r=h(e);if(!r)return``;let i=t?.[e];if(typeof i==`string`){if(i.trim().toLowerCase()===`__unassigned__`)return``;let e=d(i);if(e===`__unassigned__`)return n;if(f(e))return e}return r.defaultCombo}function v(e,t){let n=h(e);if(!n)return[];let r=_(e,t);return r===n.defaultCombo?[n.defaultCombo,...n.defaultAliases??[]]:r?[r]:[]}function y(e){if(c(e))return!1;let t=p(e);if(!t.modifiers.has(`mod`))return!1;let n=t.key.toLowerCase();return new Set([`w`,`t`,`r`,`p`,`s`,`f`,`l`,`n`]).has(n)&&!t.modifiers.has(`shift`)&&!t.modifiers.has(`alt`)}function b(n,r){let i=typeof r==`string`?r:r.defaultCombo;if(c(i))return!1;let a=p(i),o=a.modifiers.has(`mod`),s=a.modifiers.has(`shift`),u=a.modifiers.has(`alt`),d=a.modifiers.has(`ctrl`),f=t()&&e(),m=t(),h=f?n.metaKey:m&&n.metaKey||n.ctrlKey;if(o&&!h||!o&&n.metaKey||s!==n.shiftKey||u!==n.altKey)return!1;if(d){if(!n.ctrlKey)return!1}else{let e=o&&!f&&n.ctrlKey;if(n.ctrlKey&&!e)return!1}let g=n.key;return(!g||g===`Dead`)&&n.code===`Backquote`&&(g="`"),n.altKey&&(n.code.startsWith(`Key`)&&n.code.length===4?g=n.code.slice(3).toLowerCase():n.code.startsWith(`Digit`)&&n.code.length===6&&(g=n.code.slice(5))),l(g)===l(a.key)}function x(){return t()?`⌘`:`Ctrl`}function S(n,r,i){if(b(n,i))return!0;let a=d(i),o=t()&&e(),s=t();return!(o?n.metaKey:s&&n.metaKey||n.ctrlKey)||n.altKey||o&&n.ctrlKey&&!n.metaKey?!1:r===`in`&&a===`mod+=`?n.key===`+`||n.code===`NumpadAdd`:r===`out`&&(a===`mod+-`||a===`mod+minus`)?n.key===`_`||n.code===`NumpadSubtract`:!1}export{g as a,x as c,l as d,d as f,m as i,h as l,b as n,_ as o,S as r,v as s,n as t,y as u};
|
|
1
|
+
import{I as e}from"./platform-B2ylz14u.js";import{uo as t}from"./ui-BCYkB585.js";var n=`__unassigned__`,r={mod:`mod`,shift:`shift`,alt:`alt`,option:`alt`,ctrl:`ctrl`,meta:`mod`,cmd:`mod`,command:`mod`},i={mod:t()?`⌘`:`Ctrl`,shift:`⇧`,alt:`⌥`,option:`⌥`,ctrl:`⌃`},a={comma:`,`,period:`.`,enter:`Enter`,escape:`Esc`,tab:`Tab`,space:`Space`,backspace:`⌫`,delete:`⌦`,arrowup:`↑`,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`,home:`Home`,end:`End`,pageup:`Page Up`,pagedown:`Page Down`,backtick:"`",grave:"`","=":`=`,equal:`=`,plus:`+`,minus:`-`,"-":`-`},o=[`mod`,`ctrl`,`shift`,`alt`],s={"{":`[`,"}":`]`,":":`;`,'"':`'`,"<":`,`,">":`.`,"?":`/`,"|":`\\`,"~":"`","!":`1`,"@":`2`,"#":`3`,$:`4`,"%":`5`,"^":`6`,"&":`7`,"*":`8`,"(":`9`,")":`0`};function c(e){return e.trim().toLowerCase()===n}function l(e){let t=e.toLowerCase();return t===`,`?`comma`:t===`.`?`period`:t===` `?`space`:t===`esc`?`escape`:t===`+`?`plus`:t===`-`||t===`_`?`minus`:t===`arrowup`?`arrowup`:t===`arrowdown`?`arrowdown`:t===`arrowleft`?`arrowleft`:t===`arrowright`?`arrowright`:t==="`"?`backtick`:s[t]??t}var u=[{id:`open_command_palette`,defaultCombo:`mod+p`,label:`Open command palette`,description:`Open the command palette`,customizable:!0},{id:`focus_input`,defaultCombo:`mod+i`,label:`Focus input`,description:`Focus the chat input field`,customizable:!0},{id:`open_status`,defaultCombo:`mod+shift+o`,label:`Open OpenCode status`,description:`Open the OpenCode status dialog`},{id:`open_settings`,defaultCombo:`mod+comma`,label:`Open settings`,description:`Open the settings panel`,customizable:!0},{id:`toggle_terminal`,defaultCombo:`ctrl+backtick`,label:`Toggle terminal`,description:`Toggle the integrated terminal`,customizable:!0},{id:`toggle_bottom_panel`,defaultCombo:`mod+j`,label:`Toggle bottom panel`,description:`Toggle the bottom panel dock`,customizable:!0},{id:`toggle_terminal_expanded`,defaultCombo:`mod+shift+j`,label:`Toggle terminal expanded`,description:`Toggle terminal expanded or collapsed`,customizable:!0},{id:`new_terminal_tab`,defaultCombo:`mod+t`,label:`New terminal tab`,description:`Create a new terminal tab when the terminal is focused`,customizable:!0},{id:`open_new_terminal`,defaultCombo:`mod+shift+backtick`,label:`Open new terminal`,description:`Open the terminal panel and create a new terminal tab`,customizable:!0},{id:`previous_terminal_tab`,defaultCombo:`mod+shift+[`,label:`Previous terminal tab`,description:`Switch to the previous terminal tab when the terminal is focused`,customizable:!0},{id:`next_terminal_tab`,defaultCombo:`mod+shift+]`,label:`Next terminal tab`,description:`Switch to the next terminal tab when the terminal is focused`,customizable:!0},{id:`toggle_files`,defaultCombo:`mod+shift+f`,label:`Toggle files`,description:`Toggle the files panel`},{id:`toggle_sidebar`,defaultCombo:`mod+b`,label:`Toggle sidebar`,description:`Toggle the session sidebar`,customizable:!0},{id:`open_timeline_dialog`,defaultCombo:`mod+t`,label:`Open conversation timeline`,description:`Search and navigate within current conversation`,customizable:!0},{id:`toggle_prompt_navigator`,defaultCombo:`mod+alt+p`,label:`Toggle prompt navigator`,description:`Show or hide the prompt navigator panel in chat`,customizable:!0},{id:`toggle_right_sidebar`,defaultCombo:`mod+alt+b`,defaultAliases:[`mod+\\`],label:`Toggle review panel`,description:`Toggle the review panel (right sidebar)`,customizable:!0},{id:`open_right_sidebar_git`,defaultCombo:`mod+shift+g`,label:`Open right sidebar Git tab`,description:`Open right sidebar and select Git`,customizable:!0},{id:`open_right_sidebar_files`,defaultCombo:`mod+shift+f`,label:`Open right sidebar Files tab`,description:`Open right sidebar and select Files`,customizable:!0},{id:`cycle_right_sidebar_tab`,defaultCombo:`mod+alt+shift+r`,label:`Cycle right sidebar tab`,description:`Cycle through right sidebar tabs`,customizable:!0},{id:`close_context_panel_tab`,defaultCombo:`mod+w`,label:`Close context panel tab`,description:`Close the active context panel tab (closes the panel when empty)`,customizable:!0},{id:`previous_session`,defaultCombo:`mod+shift+[`,defaultAliases:[`mod+arrowup`],label:`Previous session`,description:`Switch to the previous session`,customizable:!0},{id:`next_session`,defaultCombo:`mod+shift+]`,defaultAliases:[`mod+arrowdown`],label:`Next session`,description:`Switch to the next session`,customizable:!0},{id:`new_chat`,defaultCombo:`mod+n`,label:`New session`,description:`Start a new session`,customizable:!0},{id:`new_chat_worktree`,defaultCombo:`mod+shift+alt+n`,label:`New worktree draft`,description:`Create a new worktree and open a draft in it`,customizable:!0},{id:`new_mini_chat`,defaultCombo:`mod+alt+n`,label:`New Mini Chat window`,description:`Open a new Mini Chat draft window`,customizable:!0},{id:`submit_message`,defaultCombo:`mod+enter`,label:`Submit message`,description:`Submit the current message`},{id:`clear_input`,defaultCombo:`escape`,label:`Clear input`,description:`Clear the input field`},{id:`clear_all_messages`,defaultCombo:`ctrl+c`,label:`Clear all messages`,description:`Clear the composer input and queued messages`,customizable:!0},{id:`open_diff_panel`,defaultCombo:`mod+2`,label:`Open diff panel`,description:`Switch to the diff panel`},{id:`open_terminal_panel`,defaultCombo:`mod+3`,label:`Open terminal panel`,description:`Switch to the terminal panel`},{id:`open_git_panel`,defaultCombo:`mod+4`,label:`Open git panel`,description:`Switch to the git panel`},{id:`open_help`,defaultCombo:`mod+.`,label:`Open keyboard shortcuts`,description:`Show the keyboard shortcuts help`,customizable:!0},{id:`toggle_services_menu`,defaultCombo:`mod+shift+s`,label:`Toggle services menu`,description:`Open or close the services menu`,customizable:!0},{id:`open_usage`,defaultCombo:`mod+shift+c`,label:`Open usage`,description:`Open the usage panel`,customizable:!0},{id:`cycle_services_tab`,defaultCombo:`mod+alt+shift+s`,label:`Cycle services tab`,description:`Cycle through tabs in the services menu`,customizable:!0},{id:`cycle_theme`,defaultCombo:`mod+/`,label:`Cycle theme`,description:`Cycle between light, dark, and system theme`,customizable:!0},{id:`zoom_in`,defaultCombo:`mod+=`,label:`Zoom in`,description:`Increase the webview zoom level`,customizable:!0},{id:`zoom_out`,defaultCombo:`mod+-`,label:`Zoom out`,description:`Decrease the webview zoom level`,customizable:!0},{id:`zoom_reset`,defaultCombo:`mod+0`,label:`Reset zoom`,description:`Reset the webview zoom level to 100%`,customizable:!0},{id:`leader_key`,defaultCombo:`ctrl+x`,label:`Leader key`,description:`Start an OpenCode-style chord, then press M / A / N / C`,customizable:!0},{id:`open_model_selector`,defaultCombo:`mod+shift+m`,label:`Open model selector`,description:`Open model selector while in chat`,customizable:!0},{id:`cycle_thinking_variant`,defaultCombo:`mod+shift+t`,label:`Cycle thinking variant`,description:`Cycle thinking variant while in chat`},{id:`cycle_agent`,defaultCombo:`tab`,label:`Cycle agent`,description:`Cycle agent while the model selector is open`,customizable:!0},{id:`cycle_favorite_model_forward`,defaultCombo:`ctrl+]`,label:`Cycle favorite model forward`,description:`Cycle forward through starred models without opening the picker`,customizable:!0},{id:`cycle_favorite_model_backward`,defaultCombo:`ctrl+[`,label:`Cycle favorite model backward`,description:`Cycle backward through starred models without opening the picker`,customizable:!0},{id:`expand_input`,defaultCombo:`mod+shift+e`,label:`Expand input`,description:`Toggle focus mode for the chat input`,customizable:!0},{id:`toggle_dictation`,defaultCombo:`mod+alt+v`,label:`Voice input`,description:`Start dictation; press again to confirm and insert the transcript`,customizable:!0},{id:`abort_run`,defaultCombo:`escape`,label:`Abort active run`,description:`Abort the currently running task (double press)`},{id:`switch_tab_1`,defaultCombo:`mod+1`,label:`Switch to visible session 1`,description:`Switch to the first visible sidebar session`},{id:`switch_tab_2`,defaultCombo:`mod+2`,label:`Switch to visible session 2`,description:`Switch to the second visible sidebar session`},{id:`switch_tab_3`,defaultCombo:`mod+3`,label:`Switch to visible session 3`,description:`Switch to the third visible sidebar session`},{id:`switch_tab_4`,defaultCombo:`mod+4`,label:`Switch to visible session 4`,description:`Switch to the fourth visible sidebar session`},{id:`switch_tab_5`,defaultCombo:`mod+5`,label:`Switch to visible session 5`,description:`Switch to the fifth visible sidebar session`},{id:`switch_tab_6`,defaultCombo:`mod+6`,label:`Switch to visible session 6`,description:`Switch to the sixth visible sidebar session`},{id:`switch_tab_7`,defaultCombo:`mod+7`,label:`Switch to visible session 7`,description:`Switch to the seventh visible sidebar session`},{id:`switch_tab_8`,defaultCombo:`mod+8`,label:`Switch to visible session 8`,description:`Switch to the eighth visible sidebar session`},{id:`switch_tab_9`,defaultCombo:`mod+9`,label:`Switch to visible session 9`,description:`Switch to the ninth visible sidebar session`}];function d(e){if(c(e))return n;let t=e.toLowerCase().trim().split(`+`).map(e=>e.trim()).filter(Boolean),i=new Set,a=``;for(let e of t){let t=e===`,`?`comma`:e===`.`?`period`:e,n=r[t];if(n){i.add(n);continue}a=t}return[...o.filter(e=>i.has(e)),a].filter(Boolean).join(`+`)}function f(e){return c(e)?!0:p(e).key.trim().length>0}function p(e){if(c(e))return{modifiers:new Set,key:n};let t=d(e).split(`+`),i=new Set,a=``;for(let e of t){let t=r[e];t?i.add(t):a=e}return{modifiers:i,key:a}}function m(e){if(c(e))return`Unassigned`;let t=p(e);if(!t.key&&t.modifiers.size===0)return`Unassigned`;let n=[];for(let e of o)t.modifiers.has(e)&&n.push(i[e]);if(t.key){let e=a[t.key.toLowerCase()]||t.key.toUpperCase();n.push(e)}return n.join(` + `)}function h(e){return u.find(t=>t.id===e)}function g(){return u}function _(){return u.filter(e=>e.customizable===!0)}function v(e,t){let r=typeof e==`string`?h(e):e;if(!r)return``;let i=t?.[r.id];if(typeof i==`string`){if(i.trim().toLowerCase()===`__unassigned__`)return``;let e=d(i);if(e===`__unassigned__`)return n;if(f(e))return e}return r.defaultCombo}function y(e,t){let n=typeof e==`string`?h(e):e;if(!n)return[];let r=v(e,t);return r===n.defaultCombo?[n.defaultCombo,...n.defaultAliases??[]]:r?[r]:[]}function b(e){if(c(e))return!1;let t=p(e);if(!t.modifiers.has(`mod`))return!1;let n=t.key.toLowerCase();return new Set([`w`,`t`,`r`,`p`,`s`,`f`,`l`,`n`]).has(n)&&!t.modifiers.has(`shift`)&&!t.modifiers.has(`alt`)}function x(n,r){let i=typeof r==`string`?r:r.defaultCombo;if(c(i))return!1;let a=p(i),o=a.modifiers.has(`mod`),s=a.modifiers.has(`shift`),u=a.modifiers.has(`alt`),d=a.modifiers.has(`ctrl`),f=t()&&e(),m=t(),h=f?n.metaKey:m&&n.metaKey||n.ctrlKey;if(o&&!h||!o&&n.metaKey||s!==n.shiftKey||u!==n.altKey)return!1;if(d){if(!n.ctrlKey)return!1}else{let e=o&&!f&&n.ctrlKey;if(n.ctrlKey&&!e)return!1}let g=n.key;return(!g||g===`Dead`)&&n.code===`Backquote`&&(g="`"),n.altKey&&(n.code.startsWith(`Key`)&&n.code.length===4?g=n.code.slice(3).toLowerCase():n.code.startsWith(`Digit`)&&n.code.length===6&&(g=n.code.slice(5))),l(g)===l(a.key)}function S(){return t()?`⌘`:`Ctrl`}function C(n,r,i){if(x(n,i))return!0;let a=d(i),o=t()&&e(),s=t();return!(o?n.metaKey:s&&n.metaKey||n.ctrlKey)||n.altKey||o&&n.ctrlKey&&!n.metaKey?!1:r===`in`&&a===`mod+=`?n.key===`+`||n.code===`NumpadAdd`:r===`out`&&(a===`mod+-`||a===`mod+minus`)?n.key===`_`||n.code===`NumpadSubtract`:!1}export{_ as a,S as c,b as d,l as f,m as i,h as l,x as n,v as o,d as p,C as r,y as s,n as t,g as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-wXsskyKm.js";import{n as r}from"./vendor-react-BkccXcWz.js";import{r as i}from"./useUIStore-Dz0bOfkB.js";import{no as a}from"./ui-DeV7Us1B.js";import{n as o}from"./Icon-C1m8PihJ.js";import{t as s}from"./i18n-CBCskgqa.js";import{r as c}from"./device-gKeFQDLT.js";import{_ as l,l as u,n as d,s as ee,t as f,v as p,y as m}from"./vendor-dnd-kit-core-qy5stxu5.js";import{o as h,r as te,t as g}from"./vendor-dnd-kit-sortable-CiTIuX4o.js";var ne=r(),_=e(n(),1),v=t(),re=({transform:e})=>({...e,y:0}),ie=e=>{let t=(0,ne.c)(18),{id:n,children:r,className:i}=e,o;t[0]===n?o=t[1]:(o={id:n},t[0]=n,t[1]=o);let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:ee}=h(o),f;t[2]===u?f=t[3]:(f=m.Transform.toString(u),t[2]=u,t[3]=f);let p;t[4]!==f||t[5]!==d?(p={transform:f,transition:d},t[4]=f,t[5]=d,t[6]=p):p=t[6];let te=ee&&`opacity-50`,g;t[7]!==i||t[8]!==te?(g=a(`h-full rounded-md`,i,te),t[7]=i,t[8]=te,t[9]=g):g=t[9];let _;return t[10]!==s||t[11]!==r||t[12]!==n||t[13]!==c||t[14]!==l||t[15]!==p||t[16]!==g?(_=(0,v.jsx)(`div`,{ref:l,"data-sortable-tab-id":n,style:p,className:g,...s,...c,children:r}),t[10]=s,t[11]=r,t[12]=n,t[13]=c,t[14]=l,t[15]=p,t[16]=g,t[17]=_):_=t[17],_},ae=e=>{let t=(0,ne.c)(6),{id:n,children:r,className:i}=e,o;t[0]===i?o=t[1]:(o=a(`h-full`,i),t[0]=i,t[1]=o);let s;return t[2]!==r||t[3]!==n||t[4]!==o?(s=(0,v.jsx)(`div`,{className:o,"data-sortable-tab-id":n,children:r}),t[2]=r,t[3]=n,t[4]=o,t[5]=s):s=t[5],s},y=e=>{let t=(0,ne.c)(124),{items:n,activeId:r,onSelect:m,onClose:h,onReorder:y,layoutMode:he,variant:ge,activePillInsetClassName:_e,activePillButtonClassName:b,inactiveTabsIconOnly:ve,iconOnlyActiveTab:ye,animateActivePill:be,activePillLowercase:xe,className:Se}=e,Ce=he===void 0?`scrollable`:he,we=ge===void 0?`default`:ge,x=ve!==void 0&&ve,S=ye!==void 0&&ye,C=xe===void 0||xe,{t:Te}=s(),w=i(oe),{isTablet:Ee}=c(),T=w||Ee,E=_.useRef(null),De;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(De={left:!1,right:!1},t[0]=De):De=t[0];let[D,Oe]=_.useState(De),ke;t[1]===n?ke=t[2]:(ke=n.map(se),t[1]=n,t[2]=ke);let Ae=ke,O=Ce===`scrollable`,je=we==="default",k=we===`compact`,A=we===`active-pill`,Me=we===`animated`,j=A||Me,M=je,N=j||M,P=A&&O,Ne=j,Pe=be??Me,Fe=typeof y==`function`,F=Fe?ie:ae,Ie;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=new Map,t[3]=Ie):Ie=t[3];let Le=_.useRef(Ie),[I,Re]=_.useState(null),ze;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(ze={activationConstraint:{distance:8}},t[4]=ze):ze=t[4];let Be=p(l(ee,ze)),Ve=ce,He;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(He=(e,t)=>{if(t){Le.current.set(e,t);return}Le.current.delete(e)},t[5]=He):He=t[5];let Ue=He,We;t[6]!==r||t[7]!==N?(We=()=>{if(!N||!r){Re(le);return}let e=E.current,t=Le.current.get(r);if(!e||!t){Re(ue);return}let n=0,i=0,a=t;for(;a&&a!==e;)n+=a.offsetLeft,i+=a.offsetTop,a=a.offsetParent;let o={left:n,top:i,width:t.offsetWidth,height:t.offsetHeight};Re(e=>Ve(e,o)?e:o)},t[6]=r,t[7]=N,t[8]=We):We=t[8];let L=We,R;t[9]===O?R=t[10]:(R=()=>{if(!O){Oe({left:!1,right:!1});return}let e=E.current;if(!e){Oe({left:!1,right:!1});return}Oe({left:e.scrollLeft>2,right:e.scrollLeft+e.clientWidth<e.scrollWidth-2})},t[9]=O,t[10]=R);let z=R,Ge;t[11]!==O||t[12]!==z?(Ge=()=>{if(!O){Oe({left:!1,right:!1});return}let e=E.current;if(!e)return;z(),e.addEventListener(`scroll`,z,{passive:!0});let t=new ResizeObserver(z);return t.observe(e),()=>{e.removeEventListener(`scroll`,z),t.disconnect()}},t[11]=O,t[12]=z,t[13]=Ge):Ge=t[13];let B;t[14]!==O||t[15]!==n.length||t[16]!==z?(B=[O,n.length,z],t[14]=O,t[15]=n.length,t[16]=z,t[17]=B):B=t[17],_.useEffect(Ge,B);let V;t[18]!==r||t[19]!==L||t[20]!==N?(V=()=>{if(!N){Re(null);return}L();let e=E.current;if(!e)return;let t=new ResizeObserver(L);if(t.observe(e),r){let e=Le.current.get(r);e&&t.observe(e)}return()=>{t.disconnect()}},t[18]=r,t[19]=L,t[20]=N,t[21]=V):V=t[21];let H;t[22]!==r||t[23]!==n.length||t[24]!==L||t[25]!==N?(H=[r,n.length,L,N],t[22]=r,t[23]=n.length,t[24]=L,t[25]=N,t[26]=H):H=t[26],_.useEffect(V,H);let Ke;t[27]===L?Ke=t[28]:(Ke=()=>{L()},t[27]=L,t[28]=Ke),_.useLayoutEffect(Ke);let qe;t[29]!==r||t[30]!==O||t[31]!==z?(qe=()=>{if(!O||!r)return;let e=E.current;if(!e)return;let t=window.requestAnimationFrame(()=>{let t=typeof window.CSS?.escape==`function`?window.CSS.escape(r):r.replace(/"/g,`\\"`),n=e.querySelector(`[data-sortable-tab-id="${t}"]`);n&&(n.scrollIntoView({block:`nearest`,inline:`nearest`}),z())});return()=>{window.cancelAnimationFrame(t)}},t[29]=r,t[30]=O,t[31]=z,t[32]=qe):qe=t[32];let Je;t[33]!==r||t[34]!==O||t[35]!==n.length||t[36]!==z?(Je=[r,O,n.length,z],t[33]=r,t[34]=O,t[35]=n.length,t[36]=z,t[37]=Je):Je=t[37],_.useEffect(qe,Je);let Ye;t[38]===y?Ye=t[39]:(Ye=e=>{if(!y)return;let{active:t,over:n}=e;!n||t.id===n.id||y(String(t.id),String(n.id))},t[38]=y,t[39]=Ye);let Xe=Ye,U;t[40]===Se?U=t[41]:(U=a(`relative flex h-full min-w-0 flex-1`,Se),t[40]=Se,t[41]=U);let W;t[42]!==O||t[43]!==D||t[44]!==j?(W=O&&D.left?(0,v.jsx)(`div`,{className:a(`pointer-events-none absolute inset-y-0 left-0 z-20 bg-gradient-to-r to-transparent`,j?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[42]=O,t[43]=D,t[44]=j,t[45]=W):W=t[45];let G;t[46]!==O||t[47]!==D||t[48]!==j?(G=O&&D.right?(0,v.jsx)(`div`,{className:a(`pointer-events-none absolute inset-y-0 right-0 z-20 bg-gradient-to-l to-transparent`,j?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[46]=O,t[47]=D,t[48]=j,t[49]=G):G=t[49];let Ze=j?`items-center overflow-x-hidden overflow-y-hidden`:`items-stretch`,Qe=j&&`@container/pill-tabs`,$e=j&&`pill-tabs__track`,et=j&&(_e??`gap-0.5 py-0.5`),tt=M&&`items-center overflow-y-hidden`,nt=k&&`items-center gap-1 overflow-y-hidden`,rt=Ne&&`rounded-[10px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] bg-[color-mix(in_srgb,var(--foreground)_2%,transparent)] p-0.5 gap-0.5`,it=O?`overflow-x-auto scrollbar-none`:`overflow-x-hidden`,K;t[50]!==Ze||t[51]!==Qe||t[52]!==$e||t[53]!==et||t[54]!==tt||t[55]!==nt||t[56]!==rt||t[57]!==it?(K=a(`relative flex h-full min-w-0 flex-1`,Ze,Qe,$e,et,tt,nt,rt,it),t[50]=Ze,t[51]=Qe,t[52]=$e,t[53]=et,t[54]=tt,t[55]=nt,t[56]=rt,t[57]=it,t[58]=K):K=t[58];let q;t[59]===O?q=t[60]:(q=O?{scrollbarWidth:`none`,msOverflowStyle:`none`}:void 0,t[59]=O,t[60]=q);let J;t[61]===Te?J=t[62]:(J=Te(`sortableTabsStrip.aria.tabs`),t[61]=Te,t[62]=J);let Y;t[63]!==I||t[64]!==Pe||t[65]!==j?(Y=j&&I?(0,v.jsx)(`div`,{className:a(`yuri-segmented-selected-pill pointer-events-none absolute left-0 top-0 z-0 rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px]`),style:{transform:`translate3d(${I.left}px, ${I.top}px, 0)`,width:`${I.width}px`,height:`${I.height}px`,transition:Pe?`transform 300ms cubic-bezier(0.65, 0, 0.35, 1), width 300ms cubic-bezier(0.65, 0, 0.35, 1), height 300ms cubic-bezier(0.65, 0, 0.35, 1)`:void 0}}):null,t[63]=I,t[64]=Pe,t[65]=j,t[66]=Y):Y=t[66];let X;t[67]!==I||t[68]!==M?(X=M&&I?(0,v.jsx)(`div`,{className:`pointer-events-none absolute left-0 -bottom-px z-10 h-[3px] rounded-t-[2px] bg-[var(--primary-base)]`,style:{transform:`translate3d(${I.left}px, 0, 0)`,width:`${I.width}px`},"aria-hidden":!0}):null,t[67]=I,t[68]=M,t[69]=X):X=t[69];let Z;if(t[70]!==F||t[71]!==r||t[72]!==b||t[73]!==C||t[74]!==T||t[75]!==S||t[76]!==x||t[77]!==A||t[78]!==k||t[79]!==w||t[80]!==O||t[81]!==n||t[82]!==h||t[83]!==m||t[84]!==P||t[85]!==j){let e;t[87]!==F||t[88]!==r||t[89]!==b||t[90]!==C||t[91]!==T||t[92]!==S||t[93]!==x||t[94]!==A||t[95]!==k||t[96]!==w||t[97]!==O||t[98]!==h||t[99]!==m||t[100]!==P||t[101]!==j?(e=e=>{let t=e.id===r,n=x&&j&&!t&&!!e.icon,i=!n,s=!!e.icon&&(!S||t),c=x&&j&&t&&!O&&!P,l=e.closable!==!1&&!!h,u=l&&!!e.icon&&!k,d=O||P?void 0:j?c?`flex-none basis-auto`:w?`flex-1 basis-0 min-w-0`:`flex-1 basis-0 min-w-fit`:`min-w-0 flex-1 basis-0`,ee=l?t=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),h?.(e.id))}:void 0,f=l?de:void 0;return(0,v.jsx)(F,{id:e.id,className:d,children:(0,v.jsxs)(`div`,{ref:t=>Ue(e.id,t),onAuxClick:ee,onMouseDown:f,className:a(`group flex h-full min-w-0 flex-nowrap items-center`,O||P?`shrink-0`:j?`w-full`:`w-full min-w-0`,k?a(`relative rounded-md transition-colors`,t?`bg-interactive-selection text-interactive-selection-foreground`:`text-muted-foreground hover:bg-interactive-hover hover:text-foreground`):j?`relative z-10 bg-transparent`:t?`relative z-10 bg-transparent text-foreground`:`relative z-10 bg-transparent text-muted-foreground hover:text-foreground`),children:[(0,v.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,"aria-label":n?e.title??e.label:void 0,onClick:()=>m(e.id),className:a(k?`flex h-full max-w-56 min-w-0 flex-nowrap items-center rounded-md px-2 text-left text-xs font-normal !min-h-0 !min-w-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--interactive-focus-ring)]`:j?`animated-tabs__button pill-tabs__button relative z-10 flex flex-1 min-w-0 flex-nowrap items-center justify-center rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] text-sm font-medium transition-colors duration-150 !min-h-0`:`flex h-full min-w-0 flex-nowrap items-center typography-micro`,j&&C?`lowercase`:null,j&&(n?`gap-0`:`gap-1.5`),j?P?`shrink-0 whitespace-nowrap px-3 text-center`:O?`max-w-56 shrink-0 px-3 text-center`:n?`px-2 !min-w-0 text-center`:c?`shrink-0 whitespace-nowrap px-3 text-center`:`px-3 text-center`:k?null:O?`max-w-56 justify-start truncate px-3 text-left`:`w-full justify-center truncate px-3 text-center`,j?b??(A?w?`h-[38px]`:`h-[31px]`:`h-7`):null,j?t?`text-foreground`:`text-muted-foreground hover:text-foreground`:null,j?`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] focus-visible:ring-offset-1 focus-visible:ring-offset-background`:null),title:e.title??e.label,children:j?(0,v.jsxs)(v.Fragment,{children:[s?(0,v.jsxs)(`span`,{className:`relative flex h-4 w-4 shrink-0 items-center justify-center`,children:[(0,v.jsx)(`span`,{className:a(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:a(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:fe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(o,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,i?(0,v.jsx)(`span`,{className:`animated-tabs__label truncate`,children:e.label}):null]}):(0,v.jsxs)(`span`,{className:a(`flex min-w-0 flex-nowrap items-center gap-1.5`,!O&&`justify-center`),children:[s?(0,v.jsxs)(`span`,{className:a(`relative flex h-4 w-4 shrink-0 items-center justify-center transition-colors duration-200 ease-out`,!k&&(t?`text-[var(--primary-base)]`:`text-muted-foreground`)),children:[(0,v.jsx)(`span`,{className:a(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:a(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:pe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(o,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,(0,v.jsx)(`span`,{className:`truncate leading-[1.2]`,children:e.label})]})}),l&&!u?(0,v.jsx)(`button`,{type:`button`,onPointerDown:me,onClick:t=>{t.stopPropagation(),h?.(e.id)},className:a(`relative z-20 inline-flex !min-h-0 !min-w-0 items-center justify-center transition-opacity`,k?`mr-1 size-4 shrink-0 self-center rounded-sm text-muted-foreground hover:bg-interactive-hover hover:text-foreground`:j?`-ml-2.5 mr-1 h-[88%] w-5 self-center !aspect-auto rounded-md`:`aspect-square h-[65%] min-h-4 max-h-5 rounded-sm mr-1`,!k&&(j?t?`text-muted-foreground hover:bg-transparent hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-transparent hover:text-foreground group-hover:opacity-100`:t?`text-muted-foreground hover:bg-interactive-hover/60 hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-interactive-hover/80 hover:text-foreground group-hover:opacity-100`)),"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(o,{name:`close`,className:`h-3 w-3`})}):null]})},e.id)},t[87]=F,t[88]=r,t[89]=b,t[90]=C,t[91]=T,t[92]=S,t[93]=x,t[94]=A,t[95]=k,t[96]=w,t[97]=O,t[98]=h,t[99]=m,t[100]=P,t[101]=j,t[102]=e):e=t[102],Z=n.map(e),t[70]=F,t[71]=r,t[72]=b,t[73]=C,t[74]=T,t[75]=S,t[76]=x,t[77]=A,t[78]=k,t[79]=w,t[80]=O,t[81]=n,t[82]=h,t[83]=m,t[84]=P,t[85]=j,t[86]=Z}else Z=t[86];let Q;t[103]!==K||t[104]!==q||t[105]!==J||t[106]!==Y||t[107]!==X||t[108]!==Z?(Q=(0,v.jsxs)(`div`,{ref:E,className:K,style:q,role:`tablist`,"aria-label":J,children:[Y,X,Z]}),t[103]=K,t[104]=q,t[105]=J,t[106]=Y,t[107]=X,t[108]=Z,t[109]=Q):Q=t[109];let at;t[110]!==U||t[111]!==W||t[112]!==G||t[113]!==Q?(at=(0,v.jsxs)(`div`,{className:U,children:[W,G,Q]}),t[110]=U,t[111]=W,t[112]=G,t[113]=Q,t[114]=at):at=t[114];let ot=at;if(!Fe)return ot;let st;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(st=[re],t[115]=st):st=t[115];let $;t[116]!==Ae||t[117]!==ot?($=(0,v.jsx)(g,{items:Ae,strategy:te,children:ot}),t[116]=Ae,t[117]=ot,t[118]=$):$=t[118];let ct;t[119]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,v.jsx)(d,{dropAnimation:null}),t[119]=ct):ct=t[119];let lt;return t[120]!==Xe||t[121]!==Be||t[122]!==$?(lt=(0,v.jsxs)(f,{sensors:Be,collisionDetection:u,onDragEnd:Xe,modifiers:st,children:[$,ct]}),t[120]=Xe,t[121]=Be,t[122]=$,t[123]=lt):lt=t[123],lt};function oe(e){return e.isMobile}function se(e){return e.id}function ce(e,t){return!e||!t?e===t:Math.abs(e.left-t.left)<.5&&Math.abs(e.top-t.top)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function le(e){return e===null?e:null}function ue(e){return e===null?e:null}function de(e){e.button===1&&e.preventDefault()}function fe(e){e.stopPropagation()}function pe(e){e.stopPropagation()}function me(e){e.stopPropagation()}export{y as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{ot as t,st as n}from"./vendor-base-ui-wXsskyKm.js";import{n as r}from"./vendor-react-BkccXcWz.js";import{r as i}from"./useUIStore-68ZPpgYA.js";import{io as a}from"./ui-BCYkB585.js";import{n as o}from"./Icon-C1rjS64C.js";import{t as s}from"./i18n-iu4pzqPi.js";import{r as c}from"./device-TCHW5U2y.js";import{_ as l,l as u,n as d,s as ee,t as f,v as p,y as m}from"./vendor-dnd-kit-core-qy5stxu5.js";import{o as h,r as te,t as g}from"./vendor-dnd-kit-sortable-CiTIuX4o.js";var ne=r(),_=e(n(),1),v=t(),re=({transform:e})=>({...e,y:0}),ie=e=>{let t=(0,ne.c)(18),{id:n,children:r,className:i}=e,o;t[0]===n?o=t[1]:(o={id:n},t[0]=n,t[1]=o);let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:ee}=h(o),f;t[2]===u?f=t[3]:(f=m.Transform.toString(u),t[2]=u,t[3]=f);let p;t[4]!==f||t[5]!==d?(p={transform:f,transition:d},t[4]=f,t[5]=d,t[6]=p):p=t[6];let te=ee&&`opacity-50`,g;t[7]!==i||t[8]!==te?(g=a(`h-full rounded-md`,i,te),t[7]=i,t[8]=te,t[9]=g):g=t[9];let _;return t[10]!==s||t[11]!==r||t[12]!==n||t[13]!==c||t[14]!==l||t[15]!==p||t[16]!==g?(_=(0,v.jsx)(`div`,{ref:l,"data-sortable-tab-id":n,style:p,className:g,...s,...c,children:r}),t[10]=s,t[11]=r,t[12]=n,t[13]=c,t[14]=l,t[15]=p,t[16]=g,t[17]=_):_=t[17],_},ae=e=>{let t=(0,ne.c)(6),{id:n,children:r,className:i}=e,o;t[0]===i?o=t[1]:(o=a(`h-full`,i),t[0]=i,t[1]=o);let s;return t[2]!==r||t[3]!==n||t[4]!==o?(s=(0,v.jsx)(`div`,{className:o,"data-sortable-tab-id":n,children:r}),t[2]=r,t[3]=n,t[4]=o,t[5]=s):s=t[5],s},y=e=>{let t=(0,ne.c)(124),{items:n,activeId:r,onSelect:m,onClose:h,onReorder:y,layoutMode:he,variant:ge,activePillInsetClassName:_e,activePillButtonClassName:b,inactiveTabsIconOnly:ve,iconOnlyActiveTab:ye,animateActivePill:be,activePillLowercase:xe,className:Se}=e,Ce=he===void 0?`scrollable`:he,we=ge===void 0?`default`:ge,x=ve!==void 0&&ve,S=ye!==void 0&&ye,C=xe===void 0||xe,{t:Te}=s(),w=i(oe),{isTablet:Ee}=c(),T=w||Ee,E=_.useRef(null),De;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(De={left:!1,right:!1},t[0]=De):De=t[0];let[D,Oe]=_.useState(De),ke;t[1]===n?ke=t[2]:(ke=n.map(se),t[1]=n,t[2]=ke);let Ae=ke,O=Ce===`scrollable`,je=we==="default",k=we===`compact`,A=we===`active-pill`,Me=we===`animated`,j=A||Me,M=je,N=j||M,P=A&&O,Ne=j,Pe=be??Me,Fe=typeof y==`function`,F=Fe?ie:ae,Ie;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=new Map,t[3]=Ie):Ie=t[3];let Le=_.useRef(Ie),[I,Re]=_.useState(null),ze;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(ze={activationConstraint:{distance:8}},t[4]=ze):ze=t[4];let Be=p(l(ee,ze)),Ve=ce,He;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(He=(e,t)=>{if(t){Le.current.set(e,t);return}Le.current.delete(e)},t[5]=He):He=t[5];let Ue=He,We;t[6]!==r||t[7]!==N?(We=()=>{if(!N||!r){Re(le);return}let e=E.current,t=Le.current.get(r);if(!e||!t){Re(ue);return}let n=0,i=0,a=t;for(;a&&a!==e;)n+=a.offsetLeft,i+=a.offsetTop,a=a.offsetParent;let o={left:n,top:i,width:t.offsetWidth,height:t.offsetHeight};Re(e=>Ve(e,o)?e:o)},t[6]=r,t[7]=N,t[8]=We):We=t[8];let L=We,R;t[9]===O?R=t[10]:(R=()=>{if(!O){Oe({left:!1,right:!1});return}let e=E.current;if(!e){Oe({left:!1,right:!1});return}Oe({left:e.scrollLeft>2,right:e.scrollLeft+e.clientWidth<e.scrollWidth-2})},t[9]=O,t[10]=R);let z=R,Ge;t[11]!==O||t[12]!==z?(Ge=()=>{if(!O){Oe({left:!1,right:!1});return}let e=E.current;if(!e)return;z(),e.addEventListener(`scroll`,z,{passive:!0});let t=new ResizeObserver(z);return t.observe(e),()=>{e.removeEventListener(`scroll`,z),t.disconnect()}},t[11]=O,t[12]=z,t[13]=Ge):Ge=t[13];let B;t[14]!==O||t[15]!==n.length||t[16]!==z?(B=[O,n.length,z],t[14]=O,t[15]=n.length,t[16]=z,t[17]=B):B=t[17],_.useEffect(Ge,B);let V;t[18]!==r||t[19]!==L||t[20]!==N?(V=()=>{if(!N){Re(null);return}L();let e=E.current;if(!e)return;let t=new ResizeObserver(L);if(t.observe(e),r){let e=Le.current.get(r);e&&t.observe(e)}return()=>{t.disconnect()}},t[18]=r,t[19]=L,t[20]=N,t[21]=V):V=t[21];let H;t[22]!==r||t[23]!==n.length||t[24]!==L||t[25]!==N?(H=[r,n.length,L,N],t[22]=r,t[23]=n.length,t[24]=L,t[25]=N,t[26]=H):H=t[26],_.useEffect(V,H);let Ke;t[27]===L?Ke=t[28]:(Ke=()=>{L()},t[27]=L,t[28]=Ke),_.useLayoutEffect(Ke);let qe;t[29]!==r||t[30]!==O||t[31]!==z?(qe=()=>{if(!O||!r)return;let e=E.current;if(!e)return;let t=window.requestAnimationFrame(()=>{let t=typeof window.CSS?.escape==`function`?window.CSS.escape(r):r.replace(/"/g,`\\"`),n=e.querySelector(`[data-sortable-tab-id="${t}"]`);n&&(n.scrollIntoView({block:`nearest`,inline:`nearest`}),z())});return()=>{window.cancelAnimationFrame(t)}},t[29]=r,t[30]=O,t[31]=z,t[32]=qe):qe=t[32];let Je;t[33]!==r||t[34]!==O||t[35]!==n.length||t[36]!==z?(Je=[r,O,n.length,z],t[33]=r,t[34]=O,t[35]=n.length,t[36]=z,t[37]=Je):Je=t[37],_.useEffect(qe,Je);let Ye;t[38]===y?Ye=t[39]:(Ye=e=>{if(!y)return;let{active:t,over:n}=e;!n||t.id===n.id||y(String(t.id),String(n.id))},t[38]=y,t[39]=Ye);let Xe=Ye,U;t[40]===Se?U=t[41]:(U=a(`relative flex h-full min-w-0 flex-1`,Se),t[40]=Se,t[41]=U);let W;t[42]!==O||t[43]!==D||t[44]!==j?(W=O&&D.left?(0,v.jsx)(`div`,{className:a(`pointer-events-none absolute inset-y-0 left-0 z-20 bg-gradient-to-r to-transparent`,j?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[42]=O,t[43]=D,t[44]=j,t[45]=W):W=t[45];let G;t[46]!==O||t[47]!==D||t[48]!==j?(G=O&&D.right?(0,v.jsx)(`div`,{className:a(`pointer-events-none absolute inset-y-0 right-0 z-20 bg-gradient-to-l to-transparent`,j?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[46]=O,t[47]=D,t[48]=j,t[49]=G):G=t[49];let Ze=j?`items-center overflow-x-hidden overflow-y-hidden`:`items-stretch`,Qe=j&&`@container/pill-tabs`,$e=j&&`pill-tabs__track`,et=j&&(_e??`gap-0.5 py-0.5`),tt=M&&`items-center overflow-y-hidden`,nt=k&&`items-center gap-1 overflow-y-hidden`,rt=Ne&&`rounded-[10px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] bg-[color-mix(in_srgb,var(--foreground)_2%,transparent)] p-0.5 gap-0.5`,it=O?`overflow-x-auto scrollbar-none`:`overflow-x-hidden`,K;t[50]!==Ze||t[51]!==Qe||t[52]!==$e||t[53]!==et||t[54]!==tt||t[55]!==nt||t[56]!==rt||t[57]!==it?(K=a(`relative flex h-full min-w-0 flex-1`,Ze,Qe,$e,et,tt,nt,rt,it),t[50]=Ze,t[51]=Qe,t[52]=$e,t[53]=et,t[54]=tt,t[55]=nt,t[56]=rt,t[57]=it,t[58]=K):K=t[58];let q;t[59]===O?q=t[60]:(q=O?{scrollbarWidth:`none`,msOverflowStyle:`none`}:void 0,t[59]=O,t[60]=q);let J;t[61]===Te?J=t[62]:(J=Te(`sortableTabsStrip.aria.tabs`),t[61]=Te,t[62]=J);let Y;t[63]!==I||t[64]!==Pe||t[65]!==j?(Y=j&&I?(0,v.jsx)(`div`,{className:a(`yuri-segmented-selected-pill pointer-events-none absolute left-0 top-0 z-0 rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px]`),style:{transform:`translate3d(${I.left}px, ${I.top}px, 0)`,width:`${I.width}px`,height:`${I.height}px`,transition:Pe?`transform 300ms cubic-bezier(0.65, 0, 0.35, 1), width 300ms cubic-bezier(0.65, 0, 0.35, 1), height 300ms cubic-bezier(0.65, 0, 0.35, 1)`:void 0}}):null,t[63]=I,t[64]=Pe,t[65]=j,t[66]=Y):Y=t[66];let X;t[67]!==I||t[68]!==M?(X=M&&I?(0,v.jsx)(`div`,{className:`pointer-events-none absolute left-0 -bottom-px z-10 h-[3px] rounded-t-[2px] bg-[var(--primary-base)]`,style:{transform:`translate3d(${I.left}px, 0, 0)`,width:`${I.width}px`},"aria-hidden":!0}):null,t[67]=I,t[68]=M,t[69]=X):X=t[69];let Z;if(t[70]!==F||t[71]!==r||t[72]!==b||t[73]!==C||t[74]!==T||t[75]!==S||t[76]!==x||t[77]!==A||t[78]!==k||t[79]!==w||t[80]!==O||t[81]!==n||t[82]!==h||t[83]!==m||t[84]!==P||t[85]!==j){let e;t[87]!==F||t[88]!==r||t[89]!==b||t[90]!==C||t[91]!==T||t[92]!==S||t[93]!==x||t[94]!==A||t[95]!==k||t[96]!==w||t[97]!==O||t[98]!==h||t[99]!==m||t[100]!==P||t[101]!==j?(e=e=>{let t=e.id===r,n=x&&j&&!t&&!!e.icon,i=!n,s=!!e.icon&&(!S||t),c=x&&j&&t&&!O&&!P,l=e.closable!==!1&&!!h,u=l&&!!e.icon&&!k,d=O||P?void 0:j?c?`flex-none basis-auto`:w?`flex-1 basis-0 min-w-0`:`flex-1 basis-0 min-w-fit`:`min-w-0 flex-1 basis-0`,ee=l?t=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),h?.(e.id))}:void 0,f=l?de:void 0;return(0,v.jsx)(F,{id:e.id,className:d,children:(0,v.jsxs)(`div`,{ref:t=>Ue(e.id,t),onAuxClick:ee,onMouseDown:f,className:a(`group flex h-full min-w-0 flex-nowrap items-center`,O||P?`shrink-0`:j?`w-full`:`w-full min-w-0`,k?a(`relative rounded-md transition-colors`,t?`bg-interactive-selection text-interactive-selection-foreground`:`text-muted-foreground hover:bg-interactive-hover hover:text-foreground`):j?`relative z-10 bg-transparent`:t?`relative z-10 bg-transparent text-foreground`:`relative z-10 bg-transparent text-muted-foreground hover:text-foreground`),children:[(0,v.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,"aria-label":n?e.title??e.label:void 0,onClick:()=>m(e.id),className:a(k?`flex h-full max-w-56 min-w-0 flex-nowrap items-center rounded-md px-2 text-left text-xs font-normal !min-h-0 !min-w-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--interactive-focus-ring)]`:j?`animated-tabs__button pill-tabs__button relative z-10 flex flex-1 min-w-0 flex-nowrap items-center justify-center rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] text-sm font-medium transition-colors duration-150 !min-h-0`:`flex h-full min-w-0 flex-nowrap items-center typography-micro`,j&&C?`lowercase`:null,j&&(n?`gap-0`:`gap-1.5`),j?P?`shrink-0 whitespace-nowrap px-3 text-center`:O?`max-w-56 shrink-0 px-3 text-center`:n?`px-2 !min-w-0 text-center`:c?`shrink-0 whitespace-nowrap px-3 text-center`:`px-3 text-center`:k?null:O?`max-w-56 justify-start truncate px-3 text-left`:`w-full justify-center truncate px-3 text-center`,j?b??(A?w?`h-[38px]`:`h-[31px]`:`h-7`):null,j?t?`text-foreground`:`text-muted-foreground hover:text-foreground`:null,j?`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] focus-visible:ring-offset-1 focus-visible:ring-offset-background`:null),title:e.title??e.label,children:j?(0,v.jsxs)(v.Fragment,{children:[s?(0,v.jsxs)(`span`,{className:`relative flex h-4 w-4 shrink-0 items-center justify-center`,children:[(0,v.jsx)(`span`,{className:a(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:a(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:fe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(o,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,i?(0,v.jsx)(`span`,{className:`animated-tabs__label truncate`,children:e.label}):null]}):(0,v.jsxs)(`span`,{className:a(`flex min-w-0 flex-nowrap items-center gap-1.5`,!O&&`justify-center`),children:[s?(0,v.jsxs)(`span`,{className:a(`relative flex h-4 w-4 shrink-0 items-center justify-center transition-colors duration-200 ease-out`,!k&&(t?`text-[var(--primary-base)]`:`text-muted-foreground`)),children:[(0,v.jsx)(`span`,{className:a(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:a(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:pe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(o,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,(0,v.jsx)(`span`,{className:`truncate leading-[1.2]`,children:e.label})]})}),l&&!u?(0,v.jsx)(`button`,{type:`button`,onPointerDown:me,onClick:t=>{t.stopPropagation(),h?.(e.id)},className:a(`relative z-20 inline-flex !min-h-0 !min-w-0 items-center justify-center transition-opacity`,k?`mr-1 size-4 shrink-0 self-center rounded-sm text-muted-foreground hover:bg-interactive-hover hover:text-foreground`:j?`-ml-2.5 mr-1 h-[88%] w-5 self-center !aspect-auto rounded-md`:`aspect-square h-[65%] min-h-4 max-h-5 rounded-sm mr-1`,!k&&(j?t?`text-muted-foreground hover:bg-transparent hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-transparent hover:text-foreground group-hover:opacity-100`:t?`text-muted-foreground hover:bg-interactive-hover/60 hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-interactive-hover/80 hover:text-foreground group-hover:opacity-100`)),"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(o,{name:`close`,className:`h-3 w-3`})}):null]})},e.id)},t[87]=F,t[88]=r,t[89]=b,t[90]=C,t[91]=T,t[92]=S,t[93]=x,t[94]=A,t[95]=k,t[96]=w,t[97]=O,t[98]=h,t[99]=m,t[100]=P,t[101]=j,t[102]=e):e=t[102],Z=n.map(e),t[70]=F,t[71]=r,t[72]=b,t[73]=C,t[74]=T,t[75]=S,t[76]=x,t[77]=A,t[78]=k,t[79]=w,t[80]=O,t[81]=n,t[82]=h,t[83]=m,t[84]=P,t[85]=j,t[86]=Z}else Z=t[86];let Q;t[103]!==K||t[104]!==q||t[105]!==J||t[106]!==Y||t[107]!==X||t[108]!==Z?(Q=(0,v.jsxs)(`div`,{ref:E,className:K,style:q,role:`tablist`,"aria-label":J,children:[Y,X,Z]}),t[103]=K,t[104]=q,t[105]=J,t[106]=Y,t[107]=X,t[108]=Z,t[109]=Q):Q=t[109];let at;t[110]!==U||t[111]!==W||t[112]!==G||t[113]!==Q?(at=(0,v.jsxs)(`div`,{className:U,children:[W,G,Q]}),t[110]=U,t[111]=W,t[112]=G,t[113]=Q,t[114]=at):at=t[114];let ot=at;if(!Fe)return ot;let st;t[115]===Symbol.for(`react.memo_cache_sentinel`)?(st=[re],t[115]=st):st=t[115];let $;t[116]!==Ae||t[117]!==ot?($=(0,v.jsx)(g,{items:Ae,strategy:te,children:ot}),t[116]=Ae,t[117]=ot,t[118]=$):$=t[118];let ct;t[119]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,v.jsx)(d,{dropAnimation:null}),t[119]=ct):ct=t[119];let lt;return t[120]!==Xe||t[121]!==Be||t[122]!==$?(lt=(0,v.jsxs)(f,{sensors:Be,collisionDetection:u,onDragEnd:Xe,modifiers:st,children:[$,ct]}),t[120]=Xe,t[121]=Be,t[122]=$,t[123]=lt):lt=t[123],lt};function oe(e){return e.isMobile}function se(e){return e.id}function ce(e,t){return!e||!t?e===t:Math.abs(e.left-t.left)<.5&&Math.abs(e.top-t.top)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function le(e){return e===null?e:null}function ue(e){return e===null?e:null}function de(e){e.button===1&&e.preventDefault()}function fe(e){e.stopPropagation()}function pe(e){e.stopPropagation()}function me(e){e.stopPropagation()}export{y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./runtime-switch-DEPKHgdL.js";import{n}from"./runtime-fetch-V-iMWR8t.js";import{Vt as r}from"./gitApiHttp-
|
|
1
|
+
import{i as e,n as t}from"./runtime-switch-DEPKHgdL.js";import{n}from"./runtime-fetch-V-iMWR8t.js";import{Vt as r}from"./gitApiHttp-ZjM4HkSo.js";import{n as i}from"./vendor-react-BkccXcWz.js";import{s as a}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{W as o}from"./runtime-file-resource-BGZ4tGr5.js";import{Za as s}from"./ui-BCYkB585.js";var c=i(),l=(t=e())=>({queryKey:[t,`speech`,`settings`],queryFn:({signal:e})=>r(e,async e=>{let t=await n(`/api/voice/settings`,{signal:e});if(!t.ok)throw Error(`Unable to load speech settings`);return s(await t.json())}),staleTime:3e4,networkMode:`always`,retry:1,refetchOnWindowFocus:!0}),u=()=>{let e=(0,c.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=l(),e[0]=t):t=e[0],a(t)};async function d(i,a=t(),c=e()){let{queryKey:u}=l(c);if(await o.cancelQueries({queryKey:u,exact:!0}),a!==t())throw Error(`Runtime changed`);let d=await r(new AbortController().signal,async e=>{let t=await n(`/api/voice/settings`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i),signal:e});if(!t.ok)throw Error(`Unable to save speech settings`);return s(await t.json())});if(a!==t()||c!==e()||(await o.cancelQueries({queryKey:u,exact:!0}),a!==t()))throw Error(`Runtime changed`);return o.setQueryData(u,d),d}export{l as n,u as r,d as t};
|