@yuriai/web 0.3.3-beta.7 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentAvatar-BMyOvw1S.js → AgentAvatar-CHCjMxCF.js} +1 -1
- package/dist/assets/{AgentSelector-DjvFTge_.js → AgentSelector-DpOQ7dyw.js} +1 -1
- package/dist/assets/ArchivedSessionsDialog-nqnWb-Vc.js +1 -0
- package/dist/assets/{AssistantConversationSurface-CbB08eUc.js → AssistantConversationSurface-CKXgty02.js} +3 -3
- package/dist/assets/{AssistantSessionCard-B5uaSamD.js → AssistantSessionCard-C2-2fJul.js} +2 -2
- package/dist/assets/{AssistantUnreadBadge-CrffD9Ox.js → AssistantUnreadBadge-p9mkpbMC.js} +1 -1
- package/dist/assets/{AssistantView-CWPh6KhU.js → AssistantView-BR8hsjOv.js} +1 -1
- package/dist/assets/{AssistantWorkingAvatar-C7TLqC2c.js → AssistantWorkingAvatar-CoxhuMvM.js} +1 -1
- package/dist/assets/{AssistantsSettingsPage-CqUeZz_6.js → AssistantsSettingsPage-Bwid1xE0.js} +1 -1
- package/dist/assets/{BinaryFileFallback-D85qP-k5.js → BinaryFileFallback-Cb3uP7y1.js} +1 -1
- package/dist/assets/BtwPanel-9VAdk_qa.js +6 -0
- package/dist/assets/BusyDots-DeDkh4Ke.js +4 -0
- package/dist/assets/{ChatContainer-B7K4osTN.js → ChatContainer-wP6o_O4K.js} +21 -21
- package/dist/assets/ChatView-DU_2-cfD.js +3 -0
- package/dist/assets/{DiagramView-DPUg5cMA.js → DiagramView-CaefmjA4.js} +1 -1
- package/dist/assets/{DiffView-C6DEdXdm.js → DiffView-BaqthIvq.js} +1 -1
- package/dist/assets/{DiffViewToggle-BTeyGjzp.js → DiffViewToggle-BwJ6MYB7.js} +1 -1
- package/dist/assets/{ErrorBoundary-DtsSmzjn.js → ErrorBoundary-_5B1xjgZ.js} +1 -1
- package/dist/assets/{FadeInOnReveal-CsCYrMAl.js → FadeInOnReveal-BYHr1gqj.js} +1 -1
- package/dist/assets/{GuiPluginMount-CivDyUvN.js → GuiPluginMount-Btp3mJT2.js} +1 -1
- package/dist/assets/{GuiPluginPage-BeFJN9rd.js → GuiPluginPage-DM_RLx6u.js} +1 -1
- package/dist/assets/{GuiPluginSurface-C770Vmoc.js → GuiPluginSurface-KiyqqEKU.js} +1 -1
- package/dist/assets/{GuiPluginTitlebarItems-CjphhXcO.js → GuiPluginTitlebarItems-DxFINwbr.js} +1 -1
- package/dist/assets/{GuiPluginWindow-LOsErAXl.js → GuiPluginWindow-BkAFJyFd.js} +1 -1
- package/dist/assets/{Icon-BLvjcKMe.js → Icon-DmykXZL1.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-CepamQfa.js → ImageLoadingPlaceholder-DgM_EFHn.js} +1 -1
- package/dist/assets/{LoadingImage-CJQhmN6k.js → LoadingImage-Df22Rkor.js} +1 -1
- package/dist/assets/MarkdownRenderer-D7p9Iflj.js +2 -0
- package/dist/assets/{MarkdownRendererImpl-BBmjvHcO.js → MarkdownRendererImpl-BZc_jUrV.js} +2 -2
- package/dist/assets/{MarkstreamRendererImpl-BrUwQjka.js → MarkstreamRendererImpl-BUk_c3g1.js} +1 -1
- package/dist/assets/{MobileAssistantSettingsPage-DBl7VNVJ.js → MobileAssistantSettingsPage-BBIiFN2g.js} +1 -1
- package/dist/assets/{MobileAssistantTab-BsxiOYep.js → MobileAssistantTab-CMIQansR.js} +1 -1
- package/dist/assets/{MobileBtwPage-CdFSaIWx.js → MobileBtwPage-DVZm5hrZ.js} +1 -1
- package/dist/assets/{MobileChangesSurface-G84PMQ4F.js → MobileChangesSurface-CiqsGZsg.js} +1 -1
- package/dist/assets/{MobileChatScreen-BxkkAw15.js → MobileChatScreen-DDenVTX8.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DzmPZiX2.js → MobileDetailNavigation-ldTzGo19.js} +1 -1
- package/dist/assets/{MobileFilesSurface-CXb_s2LT.js → MobileFilesSurface-DIVH9aPV.js} +2 -2
- package/dist/assets/{MobileHtmlNetworkBoundary-Dnzk1vzw.js → MobileHtmlNetworkBoundary-TBxrF4jJ.js} +2 -2
- package/dist/assets/{MobileOverlayPanel-Bqorq1sh.js → MobileOverlayPanel-C36VWWmN.js} +1 -1
- package/dist/assets/{MobileResizableSheet-DqBQmWZR.js → MobileResizableSheet-CqphcaKq.js} +1 -1
- package/dist/assets/{MobileSettingsTab-CtVgHZJU.js → MobileSettingsTab-MmDnxG47.js} +1 -1
- package/dist/assets/{MobileShareBridge-BoZE2atm.js → MobileShareBridge-DAlGSXoj.js} +1 -1
- package/dist/assets/{MobileSurface-qkgXdsHc.js → MobileSurface-cmaGf3hZ.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-BcxLuIaE.js → MobileTabPageHeader-D6P4K98S.js} +1 -1
- package/dist/assets/{ModelLogo-DTkCJzj-.js → ModelLogo-BkbD514M.js} +1 -1
- package/dist/assets/{ModelSelector-BN7tJsu7.js → ModelSelector-HJmXcB3j.js} +1 -1
- package/dist/assets/{MultiRunWindow-BOLguz2X.js → MultiRunWindow-BmxVnblA.js} +1 -1
- package/dist/assets/{OnboardingScreen-C8BRto1e.js → OnboardingScreen-DnEtIaxG.js} +1 -1
- package/dist/assets/{OverlayScrollbar-lHvfLKuz.js → OverlayScrollbar-D6vmoMkQ.js} +1 -1
- package/dist/assets/{PierreDiffViewer-CW1R8hHt.js → PierreDiffViewer-B1e1H6br.js} +1 -1
- package/dist/assets/{ProviderLogo-BcbWSLI8.js → ProviderLogo-DA98yu7M.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-B53bp3bD.js → RemoteAssistantSessionCard-BgL7oxAK.js} +1 -1
- package/dist/assets/{RemoteDesktopPanel-DgiOjJIb.js → RemoteDesktopPanel-DBrEQwpr.js} +1 -1
- package/dist/assets/{ScheduledTasksDialog-CgzzcaoZ.js → ScheduledTasksDialog-BVh0yaZR.js} +2 -2
- package/dist/assets/{ScrollableOverlay-By9Xj7Dt.js → ScrollableOverlay-stxT7gLf.js} +1 -1
- package/dist/assets/{SettingsGroup-HFyD41Fr.js → SettingsGroup-CvaPYznp.js} +1 -1
- package/dist/assets/{SettingsView-Dq1ykKpv.js → SettingsView-CLE6ra3s.js} +10 -10
- package/dist/assets/{SettingsWindow-CIMjBpqt.js → SettingsWindow-DpzeOekS.js} +1 -1
- package/dist/assets/{SetupTourDialog-CMiSn6j9.js → SetupTourDialog-CY_CU5qU.js} +1 -1
- package/dist/assets/{SyncActions-CIrflsf0.js → SyncActions-CrOoREWF.js} +1 -1
- package/dist/assets/{TerminalView-CuvylS2B.js → TerminalView-mO5f0Axl.js} +1 -1
- package/dist/assets/{TextSelectionMenu-Cu7FN5ja.js → TextSelectionMenu-VsKriqtT.js} +1 -1
- package/dist/assets/{ToolOutputDialog-ph2fXE2y.js → ToolOutputDialog-DqCCsC-N.js} +1 -1
- package/dist/assets/{YuriLogo-Dh6Zy7-k.js → YuriLogo-Cp6vWDWp.js} +1 -1
- package/dist/assets/{assistantMessagePreview-CDi-qTU6.js → assistantMessagePreview-DLBvPQtq.js} +1 -1
- package/dist/assets/{assistantQueries-DlXx9G2k.js → assistantQueries-NdPqu6rx.js} +1 -1
- package/dist/assets/{auto-read-context-CgvMs7Ew.js → auto-read-context-DVGIDEr6.js} +1 -1
- package/dist/assets/{capgoAdapter-LNbcqkI5.js → capgoAdapter-94K243Zv.js} +1 -1
- package/dist/assets/{card-DG0czc0D.js → card-DmysoUAV.js} +1 -1
- package/dist/assets/{chatUpwardIntent-PAbn9QBv.js → chatUpwardIntent-tvLWGs9Q.js} +1 -1
- package/dist/assets/{checkbox-B6qJy2q5.js → checkbox-BMN5hAVm.js} +1 -1
- package/dist/assets/{collapsible-7JLOH-sI.js → collapsible-Z0IjDAMO.js} +1 -1
- package/dist/assets/{connection-hint-B5jzYxF5.js → connection-hint-B-kOWome.js} +1 -1
- package/dist/assets/{context-menu-DLkbq4VB.js → context-menu-CKlB6wxo.js} +1 -1
- package/dist/assets/{diagram-BjjqtBwW.js → diagram-CzY6n_4N.js} +1 -1
- package/dist/assets/{dialog-BjoDEvdt.js → dialog-BeFBA6ja.js} +1 -1
- package/dist/assets/{dropdown-menu-1XT-gOct.js → dropdown-menu-BblI9sN2.js} +1 -1
- package/dist/assets/{es-CgrPbaq2.js → es-DqYZgeC6.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-i5rR1buz.js → fileMentionTouchSelection-BQEUty_A.js} +1 -1
- package/dist/assets/{fr-B6DCYpJP.js → fr-BHaun7Zq.js} +1 -1
- package/dist/assets/{gitApi-D_jhXTt_.js → gitApi-BWsBS_2N.js} +1 -1
- package/dist/assets/{i18n-ByGlB3HF.js → i18n-DXc6czdR.js} +1 -1
- package/dist/assets/{icons-C-c38sK-.js → icons-Bd-INsoy.js} +1 -1
- package/dist/assets/{input-DCG7mwtP.js → input-Cf16qJ6g.js} +1 -1
- package/dist/assets/insertionBoundaries-BSDUOMHN.js +1 -0
- package/dist/assets/{ja-2cg_IC2I.js → ja-BGNugvrx.js} +1 -1
- package/dist/assets/{kbd-DUjBYHW8.js → kbd-CamdaxHJ.js} +1 -1
- package/dist/assets/{ko-Cu4ZaN5G.js → ko-CGbNBfDe.js} +1 -1
- package/dist/assets/{main-BBrAYdja.js → main-CHO9s_kb.js} +2 -2
- package/dist/assets/main-DAbyAg5_.js +169 -0
- package/dist/assets/{markdownHeightCache-RG3lV4ki.js → markdownHeightCache-CHGGNhWI.js} +1 -1
- package/dist/assets/{mcpQueries-w3NIPhbC.js → mcpQueries-1WNtiFYh.js} +1 -1
- package/dist/assets/miniChat-BZMkNMht.js +2 -0
- package/dist/assets/{mobile-UvHaKFPy.js → mobile-C9XDDOHq.js} +2 -2
- package/dist/assets/{mobileBackNavigation-4qLXJUZN.js → mobileBackNavigation-DF_uhF-i.js} +1 -1
- package/dist/assets/{mobileConnections-Dpq17An0.js → mobileConnections-DjT1L-_m.js} +2 -2
- package/dist/assets/multirun-D34EMeEj.js +3 -0
- package/dist/assets/{native-config-DFjLIuqz.js → native-config-DSpTDz3F.js} +1 -1
- package/dist/assets/{nativeComposerCover-CivHtrWS.js → nativeComposerCover-DXFy97OQ.js} +1 -1
- package/dist/assets/{navigation-B_4E2p49.js → navigation-jU0HUH9s.js} +1 -1
- package/dist/assets/{openRemoteProjectSession-DAER2JWb.js → openRemoteProjectSession-Bm_nafYw.js} +1 -1
- package/dist/assets/{pl-7PeuQHGy.js → pl-k8-4URiE.js} +1 -1
- package/dist/assets/{pluginPresentation-BDGZINXk.js → pluginPresentation-DexqrdQ0.js} +2 -2
- package/dist/assets/{pt-BR-B18khyq7.js → pt-BR-DdwCzXBH.js} +1 -1
- package/dist/assets/pwa-BaWpUiOR.js +2 -0
- package/dist/assets/{queue-abort-optimistic-Coy1T1Qy.js → queue-abort-optimistic-UwpgXn4g.js} +1 -1
- package/dist/assets/{quota-CfWnlc-n.js → quota-CqWNkFzw.js} +1 -1
- package/dist/assets/{reference-history-BlQiy_nb.js → reference-history-DBxnA_fF.js} +1 -1
- package/dist/assets/{remoteSessionReference-CLzAvFKI.js → remoteSessionReference-Cug8RfIG.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-BqxpFP6D.js → renderElectronMiniChatApp-CqrlQAsJ.js} +2 -2
- package/dist/assets/renderMobileApp-CwcwGOox.js +17 -0
- package/dist/assets/{runtimeConfig-lcYYeoCg.js → runtimeConfig-zzeYHX6k.js} +1 -1
- package/dist/assets/{runtimeEndpointReset-CwRG2_aT.js → runtimeEndpointReset-DUD-TCLY.js} +4 -4
- package/dist/assets/{select-BjsrUiHl.js → select-vZCgcnYG.js} +1 -1
- package/dist/assets/{session-startup-barrier-BfAFvTz_.js → session-startup-barrier-DT-hIBRf.js} +1 -1
- package/dist/assets/{sessionLookup-C-6PgSD0.js → sessionLookup-4zOaVAuF.js} +1 -1
- package/dist/assets/{sessionOwnership-QwBlmZrm.js → sessionOwnership-CEkPFbS4.js} +1 -1
- package/dist/assets/{shortcuts-kbr1xn9y.js → shortcuts-WkN3Gh8v.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-CitX5Org.js → sortable-tabs-strip-DmtfYPz0.js} +1 -1
- package/dist/assets/{speechSettingsQueries-BV_Pl_yS.js → speechSettingsQueries-DQnPLEf3.js} +1 -1
- package/dist/assets/src-QTj33Z0x.css +2 -0
- package/dist/assets/{store-CHWK-CqR.js → store-C1ifDY0C.js} +3 -3
- package/dist/assets/{switch-DiEXd4Rk.js → switch-CNmsFYfY.js} +1 -1
- package/dist/assets/{textarea-BXKtOkSw.js → textarea-ZiXxEOHK.js} +1 -1
- package/dist/assets/{timeFormat-CkKq2gbp.js → timeFormat-dCsf2MQv.js} +1 -1
- package/dist/assets/{tooltip-ccmDDb27.js → tooltip-CpTbxEOE.js} +1 -1
- package/dist/assets/{truncated-path-WQoHq84P.js → truncated-path-CcmWjgCQ.js} +1 -1
- package/dist/assets/types-s_oc_LRs.js +2 -0
- package/dist/assets/{ui-BBJAK87V.js → ui-DrAJTWV6.js} +9 -9
- package/dist/assets/{uk-B8oVVfyT.js → uk-DU-7fAP4.js} +1 -1
- package/dist/assets/{useAppFontEffects-Qz_MYSp2.js → useAppFontEffects-nvkTSYHB.js} +4 -4
- package/dist/assets/{useDesktopWindowControlsLayout-jzHx4r3Z.js → useDesktopWindowControlsLayout-i6qqpMbd.js} +1 -1
- package/dist/assets/{useDictation-DxbKP53d.js → useDictation-CZzAlsW0.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-BjJFgVDo.js → useEffectiveDirectory-BxolHzt4.js} +1 -1
- package/dist/assets/{useGitStore-__WQm2ss.js → useGitStore-B641o_o0.js} +1 -1
- package/dist/assets/{useInlineCommentDraftStore-DDVhdall.js → useInlineCommentDraftStore-B2mkmAZd.js} +1 -1
- package/dist/assets/{useMcpConfigStore-B9xxBbIA.js → useMcpConfigStore-BUSvv0Bl.js} +1 -1
- package/dist/assets/useMobileSwipeActions-XoxrtaUo.js +1 -0
- package/dist/assets/useMobileTranscriptSyncHint-86i3xO8J.js +10 -0
- package/dist/assets/{useModelLists-BSDtEidb.js → useModelLists-Ca085-di.js} +1 -1
- package/dist/assets/{useOpenCodeReadiness-4gtPD0YS.js → useOpenCodeReadiness-CsNcdsCJ.js} +1 -1
- package/dist/assets/usePluginsStore-ZHQOW-R5.js +1 -0
- package/dist/assets/{useProjectGitActions-B4Gr0aOm.js → useProjectGitActions-1QRsD7Rb.js} +1 -1
- package/dist/assets/{useProjectGitStore-YLxAq2tN.js → useProjectGitStore-C1K6WpCe.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-KvnGYSW7.js → useProjectRuntimeAPIs-BItoD9Bt.js} +1 -1
- package/dist/assets/{useQuotaStore-BiF4Uh3a.js → useQuotaStore-CSn2pk3T.js} +1 -1
- package/dist/assets/{useSessionBtwStore-D0X_QY4j.js → useSessionBtwStore-BCHq3UOB.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-n7T02P5g.js → useStreamingTextThrottle-DGAjmaMZ.js} +1 -1
- package/dist/assets/{worktreeManager-DG7xNQ2O.js → worktreeManager-QmahFqHc.js} +1 -1
- package/dist/assets/{worktreeSourceBranchPreference-CkNHSsTL.js → worktreeSourceBranchPreference-B5Fldnhm.js} +1 -1
- package/dist/assets/{zh-CN-q5EBLCd8.js → zh-CN-DOHH7nht.js} +1 -1
- package/dist/assets/{zh-TW-B8dWtU1k.js → zh-TW-t1qlXGOg.js} +1 -1
- package/dist/index.html +6 -6
- package/dist/mini-chat.html +6 -6
- package/dist/mobile.html +2 -2
- package/package.json +1 -1
- package/dist/assets/ArchivedSessionsDialog-WPrvCBi1.js +0 -1
- package/dist/assets/BtwPanel-CtLW0udb.js +0 -6
- package/dist/assets/BusyDots-DbMzMIeN.js +0 -4
- package/dist/assets/ChatView-BFrPmZ4J.js +0 -3
- package/dist/assets/MarkdownRenderer-CSkl6FsA.js +0 -2
- package/dist/assets/insertionBoundaries-98_64UQf.js +0 -1
- package/dist/assets/main-BoXIEInN.js +0 -169
- package/dist/assets/miniChat-DsAFkq0l.js +0 -2
- package/dist/assets/multirun-Bzf-9V4P.js +0 -3
- package/dist/assets/pwa-ax7afoF2.js +0 -2
- package/dist/assets/renderMobileApp-CCZSPYop.js +0 -17
- package/dist/assets/src-CGjpov7O.css +0 -2
- package/dist/assets/types-C2asfTP5.js +0 -2
- package/dist/assets/useMobileSwipeActions-DAujwA-Y.js +0 -1
- package/dist/assets/useMobileTranscriptSyncHint-CI8AZGRi.js +0 -10
- package/dist/assets/usePluginsStore-BJYXkska.js +0 -1
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-capacitor-app-B5H_XtmE.js","assets/rolldown-runtime-hePW80VL.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/AssistantView-CWPh6KhU.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/vendor-base-ui-wXsskyKm.js","assets/vendor-react-BkccXcWz.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/useUIStore-C3ewjGgP.js","assets/reasoning-projection-client-BEhVknv9.js","assets/platform-CiUKDeXd.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-zustand-CTekDqaS.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/safeStorage-DTOhKN0V.js","assets/useMobileHtmlPreviewStore-BYunNOBo.js","assets/session-startup-barrier-BfAFvTz_.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/Icon-BLvjcKMe.js","assets/i18n-ByGlB3HF.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-CHWK-CqR.js","assets/tour-CMXP3Kif.js","assets/useAssistantUIStore-CpJZ4Rqs.js","assets/mobileAppContext-BQgdTp5T.js","assets/device-EIfSfSWk.js","assets/assistantQueries-DlXx9G2k.js","assets/runtime-fetch-V-iMWR8t.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/yuriEvents-BFrD5fMU.js","assets/assistantPresentation-DRbsH1Ej.js","assets/MobileDetailNavigation-DzmPZiX2.js","assets/AssistantConversationSurface-CbB08eUc.js","assets/gitApiHttp-Dd-FwgCq.js","assets/client-B_907PBv.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/prompt-attachment-upload-B5DHrw6U.js","assets/runtime-file-resource-Bc_ss-sW.js","assets/path-utils-jGozTg9d.js","assets/runtime-file-store-BVRgEtI-.js","assets/uuid-D-SDZijH.js","assets/ui-BBJAK87V.js","assets/vendor-sonner-DX3nfJx4.js","assets/remoteProjectQueries-C8382jM8.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/input-store-BSJBQTMi.js","assets/toolHelpers-iEHVHQ9p.js","assets/ScrollableOverlay-By9Xj7Dt.js","assets/OverlayScrollbar-lHvfLKuz.js","assets/vendor-framer-motion-D5NyyC73.js","assets/ImageLoadingPlaceholder-CepamQfa.js","assets/image-loading-DA9JEHD8.css","assets/LoadingImage-CJQhmN6k.js","assets/MarkdownRenderer-CSkl6FsA.js","assets/useEffectiveDirectory-BjJFgVDo.js","assets/markdownHeightCache-RG3lV4ki.js","assets/dualLimitLru-D8Sphgua.js","assets/imageSource-BR4C9TuS.js","assets/MobileShareBridge-BoZE2atm.js","assets/dialog-BjoDEvdt.js","assets/dialog-D9CkSNCA.css","assets/rasterizePng-056Poix7.js","assets/mobileConnections-Dpq17An0.js","assets/AgentAvatar-BMyOvw1S.js","assets/useThemeSystem-BIXghnHj.js","assets/agentColors-DWSbQXy2.js","assets/vendor-dicebear-core-CV95S5Pg.js","assets/vendor-dicebear-styles-C4OfoX7R.js","assets/chatUpwardIntent-PAbn9QBv.js","assets/MobileResizableSheet-DqBQmWZR.js","assets/MobileWindowStack-DGLdgoGr.js","assets/textarea-BXKtOkSw.js","assets/fileMentionTouchSelection-i5rR1buz.js","assets/vendor-fuzzysort-ukaRp9PC.js","assets/fileMentionAutocompleteState-B9411b4o.js","assets/spacedFileMention-Ds4GtgiF.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/reference-history-BlQiy_nb.js","assets/themes-BgDJcxRc.js","assets/useDictation-DxbKP53d.js","assets/audio-session-BFWjrDbp.js","assets/reference-history-8C8nv-EP.css","assets/vendor-motion-vLNN8EMu.js","assets/assistant-attachment-cache-bRIIESGe.js","assets/AssistantWorkingAvatar-C7TLqC2c.js","assets/AssistantSessionCard-B5uaSamD.js","assets/sessionLookup-C-6PgSD0.js","assets/scheduledTaskNavigation-VVTOq9n2.js","assets/router-DXUi1sBd.js","assets/contextPanelEmbeddedChat-Dm5R_b5X.js","assets/AssistantConversationSurface-B59k-lXE.css","assets/AssistantUnreadBadge-CrffD9Ox.js","assets/sortAssistantContacts-CcEdm3mS.js","assets/assistantMessagePreview-CDi-qTU6.js","assets/context-menu-DLkbq4VB.js","assets/dropdown-menu.styles-BDla58Rm.js","assets/MobileAssistantTab-BsxiOYep.js","assets/select-assistant-mmsKjj2O.js","assets/MobileSurface-qkgXdsHc.js","assets/MobileTabPageHeader-BcxLuIaE.js","assets/useMobileSwipeActions-DAujwA-Y.js","assets/MobileAssistantSettingsPage-DBl7VNVJ.js","assets/ErrorBoundary-DtsSmzjn.js","assets/card-DG0czc0D.js","assets/AssistantsSettingsPage-CqUeZz_6.js","assets/dropdown-menu-1XT-gOct.js","assets/input-DCG7mwtP.js","assets/select-BjsrUiHl.js","assets/SettingsGroup-HFyD41Fr.js","assets/ModelSelector-BN7tJsu7.js","assets/ModelLogo-DTkCJzj-.js","assets/zhipuai-coding-plan-CcFj8zKy.js","assets/useModelLists-BSDtEidb.js","assets/vendor-tanstack-react-virtual-qsd3nvZb.js","assets/tooltip-ccmDDb27.js","assets/vendor-dnd-kit-core-qy5stxu5.js","assets/vendor-dnd-kit-accessibility-u0XSXxKq.js","assets/vendor-dnd-kit-sortable-CiTIuX4o.js","assets/ProviderLogo-BcbWSLI8.js","assets/useOpenCodeReadiness-4gtPD0YS.js","assets/vendor-qrcode-D7jBCyl-.js","assets/vendor-dijkstrajs-BAzPDGZM.js","assets/MobileBtwPage-CdFSaIWx.js","assets/mobileBackNavigation-4qLXJUZN.js","assets/BtwPanel-CtLW0udb.js","assets/SessionSurfaceContext-BP4NCKp6.js","assets/useSessionBtwStore-D0X_QY4j.js","assets/nativeComposerCover-CivHtrWS.js","assets/inlineMessageLinks-DC78iKO5.js","assets/auto-read-context-CgvMs7Ew.js","assets/browserVoiceService-x5Pci8L3.js","assets/vendor-marked-S3gCOYp1.js","assets/timeFormat-CkKq2gbp.js","assets/MobileSettingsTab-CtVgHZJU.js","assets/SettingsView-Dq1ykKpv.js","assets/desktopHosts-BsTrBVja.js","assets/desktopRelayRestore-BxbRKak_.js","assets/vendor-codemirror-autocomplete-C0FrlFqZ.js","assets/react-CPBNl-S9.js","assets/collapsible-7JLOH-sI.js","assets/appThemeRegistry-BdjrGBQ4.js","assets/vendor-pierre-diffs-B0OmIhMO.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/gitApi-D_jhXTt_.js","assets/GuiPluginMount-CivDyUvN.js","assets/MobileHtmlNetworkBoundary-Dnzk1vzw.js","assets/shortcuts-kbr1xn9y.js","assets/pwa-ax7afoF2.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/githubAuthQueries-DqregESf.js","assets/projectMeta-vIaGFaQr.js","assets/sortable-tabs-strip-CitX5Org.js","assets/permission-rules-DoQUXKll.js","assets/useQuotaStore-BiF4Uh3a.js","assets/quota-CfWnlc-n.js","assets/sessionOwnership-QwBlmZrm.js","assets/types-C2asfTP5.js","assets/mcpQueries-w3NIPhbC.js","assets/usePluginsStore-BJYXkska.js","assets/switch-DiEXd4Rk.js","assets/useMcpConfigStore-B9xxBbIA.js","assets/native-config-DFjLIuqz.js","assets/YuriLogo-Dh6Zy7-k.js","assets/GuiPluginWindow-LOsErAXl.js","assets/pluginPresentation-BDGZINXk.js","assets/speechSettingsQueries-BV_Pl_yS.js","assets/pluginPresentation-C0HSdVvS.css","assets/AgentSelector-DjvFTge_.js","assets/ArchivedSessionsDialog-WPrvCBi1.js","assets/vendor-codemirror-lang-angular-Cm7vBE3E.js","assets/vendor-codemirror-lang-json-DowyFczU.js","assets/vendor-codemirror-lang-markdown-npWBZIoE.js","assets/vendor-codemirror-lang-python-OPRdU26g.js","assets/vendor-codemirror-legacy-modes-DwltVFbT.js","assets/MobileOverlayPanel-Bqorq1sh.js","assets/worktreeManager-DG7xNQ2O.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-codemirror-commands-5saeUOVY.js","assets/vendor-codemirror-search-hZY-L2l8.js","assets/vendor-replit-codemirror-vim-BmQmU1lR.js","assets/vendor-codemirror-language-data-B3pLWvv-.js","assets/vendor-yaml-C9KlJAlj.js","assets/vendor-capacitor-push-notifications-D5cqJIPw.js","assets/ChatView-BFrPmZ4J.js","assets/useProjectRuntimeAPIs-KvnGYSW7.js","assets/terminalApi-DXvEquBF.js","assets/useProjectGitStore-YLxAq2tN.js","assets/useGitStore-__WQm2ss.js","assets/ChatContainer-B7K4osTN.js","assets/useInlineCommentDraftStore-DDVhdall.js","assets/truncated-path-WQoHq84P.js","assets/kbd-DUjBYHW8.js","assets/TextSelectionMenu-Cu7FN5ja.js","assets/useDebouncedValue-BHlMPqY8.js","assets/checkbox-B6qJy2q5.js","assets/connection-hint-B5jzYxF5.js","assets/insertionBoundaries-98_64UQf.js","assets/BusyDots-DbMzMIeN.js","assets/worktreeSourceBranchPreference-CkNHSsTL.js","assets/remote-input-store-C6UIEZxp.js","assets/vendor-cmdk-BDWoZLve.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/queue-abort-optimistic-Coy1T1Qy.js","assets/ToolOutputDialog-ph2fXE2y.js","assets/runtime-file-download-BWeoSXRb.js","assets/tap-LkQum5bB.js","assets/markdownTheme-D84XyNiT.js","assets/DiffViewToggle-BTeyGjzp.js","assets/touch-gestures-DOoBxhz5.js","assets/FadeInOnReveal-CsCYrMAl.js","assets/useStreamingTextThrottle-n7T02P5g.js","assets/ChatContainer-K31q-1OV.css","assets/DiffView-C6DEdXdm.js","assets/PierreDiffViewer-CW1R8hHt.js","assets/DiffWorkerProvider-VFPkag9y.js","assets/MobileChangesSurface-G84PMQ4F.js","assets/useProjectGitActions-B4Gr0aOm.js","assets/SyncActions-CIrflsf0.js","assets/MobileFilesSurface-CXb_s2LT.js","assets/BinaryFileFallback-D85qP-k5.js","assets/relay-preview-frame-src-BPyz3nXA.js","assets/BinaryFileFallback-CKNAgvHj.css","assets/MobileChatScreen-BxkkAw15.js","assets/useMobileTranscriptSyncHint-CI8AZGRi.js","assets/icons-C-c38sK-.js","assets/GuiPluginTitlebarItems-CjphhXcO.js","assets/RemoteDesktopPanel-DgiOjJIb.js","assets/ScheduledTasksDialog-CgzzcaoZ.js","assets/vendor-cron-parser-BmO80h0C.js","assets/vendor-capacitor-status-bar-D9bcMr9Q.js","assets/vendor-capacitor-keyboard-BRVcFyc9.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{S as t,_ as n,p as r,r as i,t as a,v as o}from"./runtime-auth-DA-qfGHk.js";import{c as s,f as c,i as l,l as u,n as d,r as f,t as p}from"./runtime-switch-DEPKHgdL.js";import{n as m}from"./runtime-fetch-V-iMWR8t.js";import{f as h,n as g,r as _,s as v,t as y}from"./platform-CiUKDeXd.js";import{n as b,t as x}from"./runtimeAPIRegistry-C2VogTny.js";import{a as S}from"./vendor-zustand-CTekDqaS.js";import{ot as C,st as w}from"./vendor-base-ui-wXsskyKm.js";import{Mt as T,Pt as E,St as D}from"./gitApiHttp-Dd-FwgCq.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as O}from"./safeStorage-DTOhKN0V.js";import{n as k}from"./client-B_907PBv.js";import{n as A,t as j}from"./vendor-react-BkccXcWz.js";import{s as M}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{E as N,R as ee,k as P}from"./runtime-file-resource-Bc_ss-sW.js";import{i as F,l as I,r as L}from"./vendor-reactuses-core-DjKFMfz7.js";import{a as te,n as R,o as z}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as B}from"./useUIStore-C3ewjGgP.js";import{a as ne,o as re,s as ie,t as ae}from"./useMobileHtmlPreviewStore-BYunNOBo.js";import{t as oe}from"./capgoAdapter-LNbcqkI5.js";/* empty css */import{r as V}from"./vendor-sonner-DX3nfJx4.js";import{i as H,o as U}from"./session-startup-barrier-BfAFvTz_.js";import{n as W}from"./Icon-BLvjcKMe.js";import{An as se,At as G,Br as ce,Di as le,Ei as ue,Fa as de,Ir as fe,K as pe,L as me,Ma as he,Mi as ge,Mr as _e,R as ve,Rr as K,Ur as ye,V as q,Vi as be,Vt as xe,Wr as Se,Zn as Ce,a as we,dn as Te,et as Ee,f as J,fr as De,i as Oe,ji as ke,k as Ae,kt as je,lt as Me,mi as Ne,n as Pe,nr as Y,o as Fe,q as Ie,qa as Le,qi as Re,r as ze,rr as Be,rt as Ve,t as X,tr as He,ut as Ue,wi as We,wt as Ge,xi as Ke,yi as qe,zi as Je}from"./ui-BBJAK87V.js";import{d as Ye,h as Xe,i as Ze,m as Qe,p as $e}from"./remoteProjectQueries-C8382jM8.js";import{r as et,t as tt}from"./i18n-ByGlB3HF.js";import{i as nt,n as rt}from"./store-CHWK-CqR.js";import{n as it}from"./useAssistantUIStore-CpJZ4Rqs.js";import{n as at,t as ot}from"./ScrollableOverlay-By9Xj7Dt.js";import{d as st,r as ct,t as lt,u as ut,v as dt}from"./MobileResizableSheet-DqBQmWZR.js";import{t as ft}from"./mobileAppContext-BQgdTp5T.js";import{a as pt,i as mt,n as ht,o as gt,r as _t,t as vt}from"./dialog-BjoDEvdt.js";import{r as yt}from"./tooltip-ccmDDb27.js";import{i as bt,o as xt,t as St}from"./device-EIfSfSWk.js";import{c as Ct,n as wt,r as Tt,t as Et}from"./dropdown-menu-1XT-gOct.js";import{t as Dt}from"./DiffWorkerProvider-VFPkag9y.js";import{a as Ot,c as kt,o as At,s as jt}from"./useGitStore-__WQm2ss.js";import{A as Mt,E as Nt,a as Pt,j as Ft,n as It,p as Lt,r as Rt,t as zt}from"./mobileBackNavigation-4qLXJUZN.js";import{i as Bt,t as Vt}from"./MobileHtmlNetworkBoundary-Dnzk1vzw.js";import{t as Ht}from"./relay-preview-frame-src-BPyz3nXA.js";/* empty css */import{t as Ut}from"./input-DCG7mwtP.js";import{o as Wt}from"./MarkdownRenderer-CSkl6FsA.js";import{o as Gt}from"./useSessionBtwStore-D0X_QY4j.js";import{a as Kt,i as qt,o as Jt,t as Yt}from"./nativeComposerCover-CivHtrWS.js";import{a as Xt,i as Zt,l as Qt,o as $t,r as en,s as tn,t as nn,u as rn}from"./mobileConnections-Dpq17An0.js";import{m as an,v as on,x as sn,y as cn}from"./assistantQueries-DlXx9G2k.js";import{a as ln,t as un}from"./MobileShareBridge-BoZE2atm.js";import{t as dn}from"./MobileDetailNavigation-DzmPZiX2.js";import{A as fn,C as pn,D as mn,E as hn,M as gn,N as _n,O as vn,R as yn,S as bn,T as xn,i as Sn,j as Cn,k as wn,r as Tn,t as En,w as Dn,x as On,z as kn}from"./useAppFontEffects-Qz_MYSp2.js";import{S as An}from"./pwa-ax7afoF2.js";import{t as jn}from"./YuriLogo-Dh6Zy7-k.js";import{t as Mn}from"./ErrorBoundary-DtsSmzjn.js";import{L as Nn,R as Pn,T as Fn,X as In,i as Ln,t as Rn}from"./BusyDots-DbMzMIeN.js";import{r as zn}from"./queue-abort-optimistic-Coy1T1Qy.js";import{t as Bn}from"./MobileOverlayPanel-Bqorq1sh.js";import{n as Vn,t as Hn}from"./ProviderLogo-BcbWSLI8.js";import{n as Un,s as Wn}from"./worktreeManager-DG7xNQ2O.js";import{a as Gn,i as Kn,n as qn}from"./projectMeta-vIaGFaQr.js";import{i as Jn,n as Yn,t as Xn}from"./auto-read-context-CgvMs7Ew.js";import{a as Zn,n as Qn,r as $n,u as er}from"./useQuotaStore-BiF4Uh3a.js";import{a as tr,i as nr,s as rr}from"./quota-CfWnlc-n.js";import{t as ir}from"./openRemoteProjectSession-DAER2JWb.js";import{i as ar}from"./router-DXUi1sBd.js";import{t as or}from"./useFontPreferences-BiRBKhti.js";import{$ as sr,Ct as cr,Dt as lr,Et as ur,Ft as dr,I as fr,It as pr,J as mr,K as hr,Lt as gr,Mt as _r,N as vr,Nt as yr,Ot as br,P as xr,R as Sr,S as Cr,St as wr,Tt as Tr,X as Er,Y as Dr,Z as Or,_t as kr,a as Ar,at as jr,c as Mr,ct as Nr,d as Pr,dt as Fr,et as Ir,f as Lr,ft as Rr,g as zr,gt as Br,h as Vr,ht as Hr,i as Ur,it as Wr,jt as Gr,l as Kr,lt as qr,m as Jr,mt as Yr,n as Xr,nt as Zr,o as Qr,ot as $r,p as ei,pt as ti,q as ni,r as ri,rt as ii,s as ai,st as oi,t as si,tt as ci,u as li,ut as ui,w as di,wt as fi,x as pi,xt as mi,y as hi}from"./runtimeEndpointReset-CwRG2_aT.js";import{t as gi}from"./YuriWordmark-CLGHwobA.js";import{_ as _i,p as vi,r as yi,y as bi}from"./sessionOwnership-QwBlmZrm.js";import{r as xi,t as Si}from"./mcpQueries-w3NIPhbC.js";import{n as Ci}from"./SettingsGroup-HFyD41Fr.js";import{a as wi,n as Ti,o as Ei}from"./useMcpConfigStore-B9xxBbIA.js";import{n as Di}from"./project-preview-BCtFY4Rg.js";import{i as Oi,r as ki}from"./icons-C-c38sK-.js";import{a as Ai,i as ji,o as Mi,r as Ni,s as Pi,t as Fi}from"./useMobileTranscriptSyncHint-CI8AZGRi.js";import{n as Ii,r as Li,t as Ri}from"./select-assistant-mmsKjj2O.js";import{i as zi,n as Bi,t as Vi}from"./MobileSurface-qkgXdsHc.js";import{t as Hi}from"./AssistantUnreadBadge-CrffD9Ox.js";var Z=e(w(),1),Ui=j(),Wi=null,Gi=!1,Ki=new Promise(e=>{Wi=e});function qi(){Gi||(Gi=!0,Wi?.())}var Ji=6,Yi=e=>e.parentID??null,Xi=e=>{let t=e.replace(/\/+$/,``);return t.slice(t.lastIndexOf(`/`)+1)||t},Zi=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``),Qi=(e,t)=>{if(!e)return``;let n=null,r=-1;for(let i of t){let t=Zi(i.path);(e===t||e.startsWith(`${t}/`))&&t.length>r&&(n=i,r=t.length)}return Xi(n?n.path:e)},$i=()=>{let e=le.getState().activeSessions,t=fe.getState().index.session.unseenCount,n=he.getState().projects,r=0,i=[];for(let a of e){let e=Yi(a)!==null,o=(t[a.id]??0)>0&&!e;o&&(r+=1),e||i.push({id:a.id,title:a.title??``,updated:a.time?.updated??a.time?.created??0,unread:o,project:Qi(We(a),n)})}i.sort((e,t)=>t.updated-e.updated);let a=i.slice(0,Ji).map(({id:e,title:t,unread:n,project:r})=>({id:e,title:t,unread:n,project:r}));return{attentionCount:r,recentSessions:a}},ea=`__YURI_WIDGET_SNAPSHOT__`,ta=()=>{typeof window>`u`||(window[ea]=()=>{try{return JSON.stringify($i())}catch{return null}})},Q=A(),na=te(`YuriScreenAwake`),ra=Promise.resolve(),ia=0;function aa(e){let t=ra.then(()=>na.setEnabled({enabled:e}));return ra=t.catch(()=>void 0),t}async function oa(){if(R.isNativePlatform()&&R.isPluginAvailable(`YuriScreenAwake`)){ia+=1;try{await aa(!0)}catch(e){throw--ia,e}let e=!1;return async()=>{e||(e=!0,--ia,ia===0&&await aa(!1))}}if(!navigator.wakeLock)throw Error(`Screen wake lock unavailable`);let e=await navigator.wakeLock.request(`screen`);return async()=>{e.released||await e.release()}}var $=C();function sa(e){let t=(0,Q.c)(3),n=Be(),r=e.remoteState??n??void 0,i;return t[0]!==e||t[1]!==r?(i=(0,$.jsx)(ua,{...e,remoteState:r}),t[0]=e,t[1]=r,t[2]=i):i=t[2],i}function ca(e){let t=(0,Q.c)(6),{identity:n,onSource:r}=e,i=Me(e.sessionId,e.directory),a=Ue(e.sessionId,e.directory),o,s;return t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==a?(o=()=>r({identity:n,resolved:a,getMessages:()=>i}),s=[n,r,i,a],t[0]=n,t[1]=i,t[2]=r,t[3]=a,t[4]=o,t[5]=s):(o=t[4],s=t[5]),(0,Z.useLayoutEffect)(o,s),null}function la(e){let{identity:t,onSource:n}=e,r=e.remoteState,i=(0,Z.useMemo)(()=>r.scope(e.sessionId),[r,e.sessionId]),a=(0,Z.useMemo)(()=>e=>r.repository.subscribe(i,e),[r,i]),o=(0,Z.useMemo)(()=>()=>r.repository.hasSession?.(i)||r.repository.getRequestState?.(i)?.status===`ready`||r.repository.getTranscript(i).messageOrder.length>0,[r,i]),s=(0,Z.useSyncExternalStore)(a,o,o),c=L(function*(){let e=r.repository.getTranscript(i);for(let t of e.messageOrder)yield e.messagesByID[t]});return(0,Z.useLayoutEffect)(()=>n({identity:t,resolved:s,getMessages:c}),[t,n,s,c]),null}function ua(e){let{sessionId:t,directory:n,active:r,children:i,remoteState:a}=e,{t:o}=tt(),c=JSON.stringify([a?.entry.key??(e.remote?`remote-pending`:`local`),a?.entry.connectionGeneration,t,n]),l=(0,Z.useRef)(null),[u,d]=(0,Z.useState)(null),f=L(e=>{l.current=e,d(t=>t?.identity===e.identity&&t.resolved===e.resolved?t:{identity:e.identity,resolved:e.resolved})}),[p,m]=I(`yuri.auto-read`,!1),h=p===!0,[g,_]=(0,Z.useState)(0),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),[S,C]=(0,Z.useState)(document.visibilityState===`visible`),w=Jn({enabled:v}),T=(0,Z.useRef)({enabled:!1,generation:0,floor:0,seen:new Set,observed:new Set,pending:[],playing:!1}),E=(0,Z.useRef)(!1),D=r&&!!t&&u?.identity===c&&u.resolved,O=L(()=>{let e=T.current;e.enabled=!1,e.generation+=1,e.pending=[],e.playing=!1,e.seen.clear(),e.observed.clear(),E.current=!1,w.stop(),x(null),y(!1)}),k=L(()=>{let e=T.current;if(!e.enabled||e.playing||!r||document.visibilityState!==`visible`)return;let t=e.pending.shift();if(!t)return;e.playing=!0,x(t);let n=e.generation;w.play(t.text,t=>{if(n===e.generation){if(e.playing=!1,x(null),t){O(),V.error(o(`mobile.menu.autoReadFailed`));return}k()}},{target:t.target})}),A=L(e=>{let n=T.current;!n.enabled||!D||e.sessionId!==t||!e.text.trim()||e.created<n.floor&&!n.observed.has(e.messageId)||n.seen.has(e.messageId)||(n.seen.add(e.messageId),n.pending.push(e),k())}),j=L((e,n)=>{T.current.enabled&&D&&e===t&&T.current.observed.add(n)}),M=L(()=>{if(h){m(!1),O();return}D&&(m(!0),w.unlock().catch(()=>{V.error(o(`mobile.menu.autoReadFailed`))}))}),N=L(()=>{let e=T.current;e.floor=0,e.seen=new Set;for(let t of l.current?.getMessages()??[])e.floor=Math.max(e.floor,t.time.created),(t.time.completed!=null||t.role!==`assistant`)&&e.seen.add(t.id);e.enabled=!0,y(!0)});(0,Z.useEffect)(()=>(O(),h&&D&&N(),O),[t,n,c,h,D,g,N,O]),(0,Z.useEffect)(()=>s(()=>{O(),_(e=>e+1)}),[O]);let ee=L(()=>{m(!1),O()});F(`pointerdown`,()=>{if(!T.current.enabled||E.current)return;E.current=!0;let e=T.current.generation;w.unlock().catch(()=>{e===T.current.generation&&(E.current=!1)})},document),F(`visibilitychange`,()=>{C(document.visibilityState===`visible`),document.visibilityState===`visible`?k():(T.current.generation+=1,T.current.playing=!1,T.current.pending=[],w.stop(),x(null))},document),(0,Z.useEffect)(()=>{if(!v||!D||!S)return;let e=!1,t;return oa().then(n=>{e?n().catch(()=>void 0):t=n}).catch(()=>{e||V.warning(o(`mobile.menu.autoReadAwakeFailed`))}),()=>{e=!0,t?.().catch(()=>void 0)}},[v,D,S,t,n,c,g,o]);let P=(0,Z.useMemo)(()=>({enabled:h,available:D,toggle:M,rendered:A,streaming:j}),[h,D,M,A,j]),te=(0,Z.useMemo)(()=>v&&r&&S&&w.isPlaying&&b?.sessionId===t?{sessionId:t,messageId:b.messageId,stop:ee}:null,[v,r,S,w.isPlaying,b,t,ee]);return(0,$.jsx)(Xn.Provider,{value:P,children:(0,$.jsxs)(Yn.Provider,{value:te,children:[a?(0,$.jsx)(la,{...e,identity:c,onSource:f,remoteState:a}):e.remote?null:(0,$.jsx)(ca,{...e,identity:c,onSource:f}),i]})})}function da(e){let t=(0,Q.c)(3),{children:n}=e,r=(0,Z.useContext)(Xn);if(!r)return null;let i;return t[0]!==n||t[1]!==r?(i=n(r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}var fa={getPlatform:()=>R.getPlatform(),isPluginAvailable:e=>R.isPluginAvailable(e),openInSystemBrowser:e=>ie.open(e),openExternal:re},pa=async(e,t=fa)=>{if(t.getPlatform()===`android`){if(!t.isPluginAvailable(`YuriExternalBrowser`))return!1;try{return await t.openInSystemBrowser({url:e}),!0}catch{return!1}}return t.openExternal(e)},ma=`mobile-app-update-available`,ha=`mobile-app-update-toast-dismissed-version`,ga=()=>{let e=(0,Q.c)(9),{t}=tt(),n=_i(_a),r=_i(va),i=_i(ya),a=_i(ba),o=_i(xa),s;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=new Set,e[0]=s):s=e[0];let c=Z.useRef(s),l,u;return e[1]!==n||e[2]!==a||e[3]!==o||e[4]!==r||e[5]!==t||e[6]!==i?(l=()=>{if(y()!==`android`||r!==`mobile`||!n||!i||!a||o){X.dismiss(ma);return}O().getItem(ha)!==i&&(c.current.has(i)||(c.current.add(i),X.info(t(`mobileUpdate.toast.available.title`),{id:ma,description:t(`mobileUpdate.toast.available.description`,{version:i}),duration:1/0,icon:(0,$.jsx)(W,{name:`download`,className:`h-4 w-4 text-muted-foreground`}),action:{label:t(`mobileUpdate.toast.actions.download`),onClick:()=>{pa(a)}},cancel:{label:t(`mobileUpdate.toast.actions.dismiss`),onClick:()=>{O().setItem(ha,i),X.dismiss(ma)}}})))},u=[n,a,o,r,t,i],e[1]=n,e[2]=a,e[3]=o,e[4]=r,e[5]=t,e[6]=i,e[7]=l,e[8]=u):(l=e[7],u=e[8]),Z.useEffect(l,u),null};function _a(e){return e.available}function va(e){return e.runtimeType}function ya(e){return e.info?.version}function ba(e){return e.info?.downloadUrl}function xa(e){return e.info?.inAppApply===!0}var Sa=e=>!(!e.enabled||e.runtimeType!==`mobile`||!e.available||!e.inAppApply||!e.version||e.seenVersions.has(e.version)||e.dismissedVersion!==null&&e.dismissedVersion===e.version),Ca=e=>e.enabled&&!e.alreadyChecked,wa=`mobile-ota-update-available`,Ta=`mobile-ota-update-toast-dismissed-version`,Ea=()=>{let e=(0,Q.c)(24),{t}=tt(),[n,r]=Z.useState(!1),i=Z.useRef(!1),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=new Set,e[0]=a):a=e[0];let o=Z.useRef(a),s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=g(),e[1]=s):s=e[1];let c=s,l=_i(Da),u=_i(Oa),d=_i(ka),f=_i(Aa),p=_i(ja),m=_i(Ma),h=_i(Na),_=_i(Pa),v=_i(Fa),y=d?.version,b=d?.inAppApply===!0,x,S;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{Ca({enabled:c,alreadyChecked:i.current})&&(i.current=!0,_i.getState().checkForUpdates().catch(Ia))},S=[c],e[2]=x,e[3]=S):(x=e[2],S=e[3]),Z.useEffect(x,S);let C;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>{r(!0)},e[4]=C):C=e[4];let w=L(C),T=L(La),E,D;if(e[5]!==l||e[6]!==T||e[7]!==b||e[8]!==w||e[9]!==u||e[10]!==t||e[11]!==y?(E=()=>{if(!Sa({enabled:c,runtimeType:u,available:l,inAppApply:b,version:y??``,dismissedVersion:O().getItem(Ta),seenVersions:o.current})||!y){(!l||!b||u!==`mobile`)&&X.dismiss(wa);return}o.current.add(y),X.info(t(`mobileUpdate.ota.toast.available.title`),{id:wa,description:t(`mobileUpdate.ota.toast.available.description`,{version:y}),duration:1/0,icon:(0,$.jsx)(W,{name:`refresh`,className:`h-4 w-4 text-muted-foreground`}),action:{label:t(`mobileUpdate.ota.toast.actions.update`),onClick:w},cancel:{label:t(`mobileUpdate.ota.toast.actions.dismiss`),onClick:()=>{T(y)}}})},D=[l,b,c,w,T,u,t,y],e[5]=l,e[6]=T,e[7]=b,e[8]=w,e[9]=u,e[10]=t,e[11]=y,e[12]=E,e[13]=D):(E=e[12],D=e[13]),Z.useEffect(E,D),!c)return null;let k;return e[14]!==n||e[15]!==_||e[16]!==p||e[17]!==f||e[18]!==h||e[19]!==d||e[20]!==m||e[21]!==v||e[22]!==u?(k=(0,$.jsx)(vi,{open:n,onOpenChange:r,info:d,downloading:f,downloaded:p,progress:m,error:h,onDownload:_,onRestart:v,runtimeType:u}),e[14]=n,e[15]=_,e[16]=p,e[17]=f,e[18]=h,e[19]=d,e[20]=m,e[21]=v,e[22]=u,e[23]=k):k=e[23],k};function Da(e){return e.available}function Oa(e){return e.runtimeType}function ka(e){return e.info}function Aa(e){return e.downloading}function ja(e){return e.downloaded}function Ma(e){return e.progress}function Na(e){return e.error}function Pa(e){return e.downloadUpdate}function Fa(e){return e.restartToUpdate}function Ia(){}function La(e){O().setItem(Ta,e),X.dismiss(wa)}var Ra=te(`BarcodeScanner`),za=`yuri-barcode-scanner-active`,Ba=()=>to()?Ra:null,Va=()=>window.Capacitor?.getPlatform?.()===`android`,Ha=e=>typeof e==`object`&&e&&`message`in e?String(e.message??``):String(e??``),Ua=e=>/^\s*scan canceled\.?\s*$/i.test(Ha(e)),Wa=e=>/denied access to camera/i.test(Ha(e)),Ga=e=>!Ua(e)&&!Wa(e),Ka=e=>{let t=Ha(e);return/module/i.test(t)&&/not\s*available|unavailable/i.test(t)},qa=e=>{e.installGoogleBarcodeScannerModule?.().catch(()=>void 0)},Ja=e=>{let t=e.trim();if(!t)return null;if(/^yuri:\/\//i.test(t)){let e=wi(t);return e?{pairing:e}:null}return/^https?:\/\//i.test(t)?{url:t}:null},Ya=e=>{let t=Ja(e);return t?`pairing`in t?{status:`pairing`,...t}:{status:`ok`,...t}:{status:`invalid`}},Xa=e=>{typeof document>`u`||document.documentElement.classList.toggle(za,e)},Za=e=>{try{e()}catch{}},Qa=e=>{if(typeof document>`u`)return()=>void 0;let t=document.body,n=document.createElement(`button`);n.type=`button`,n.className=`yuri-barcode-scanner-chrome`,n.setAttribute(`aria-label`,`Cancel`),n.textContent=`×`,n.addEventListener(`click`,e),t.appendChild(n);let r=!1;return()=>{r||(r=!0,n.removeEventListener(`click`,e),n.parentNode===t&&t.removeChild(n))}},$a=async e=>{if(!e.startScan||!e.stopScan||!e.addListener)return{status:`unsupported`};let t,n,r,i=!1,a=()=>void 0,o=new Promise(e=>{a=e}),s=e=>{i||(i=!0,a(e))};Xa(!0);let c=Qa(()=>s({status:`cancelled`}));try{let{App:e}=await z(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])),t=await e.addListener(`backButton`,()=>s({status:`cancelled`}));r=()=>void t.remove()}catch{r=void 0}try{return(await Promise.allSettled([Promise.resolve(e.addListener(`barcodesScanned`,({barcodes:e})=>{let t=e?.[0],n=(t?.rawValue??t?.displayValue??``).trim();n&&s(Ya(n))})).then(e=>{t=e}),Promise.resolve(e.addListener(`scanError`,()=>s({status:`failed`}))).then(e=>{n=e})])).some(({status:e})=>e===`rejected`)?s({status:`failed`}):i||e.startScan({formats:[`QR_CODE`]}).catch(e=>{Wa(e)?s({status:`permission-denied`}):s({status:`failed`})}),await o}finally{Xa(!1),Za(c),Za(()=>r?.()),await Promise.allSettled([Promise.resolve(t?.remove()),Promise.resolve(n?.remove()),e.stopScan()])}},eo=e=>e.isNativePlatform&&e.isPluginAvailable,to=()=>eo({isNativePlatform:R.isNativePlatform(),isPluginAvailable:R.isPluginAvailable(`BarcodeScanner`)}),no=async()=>{let e=Ba();if(!e)return{status:`unsupported`};try{if(e.requestPermissions){let t=(await e.requestPermissions())?.camera;if(t&&t!==`granted`&&t!==`limited`)return{status:`permission-denied`}}if(e.scan)try{let t=(await e.scan({formats:[`QR_CODE`]}))?.barcodes?.[0],n=(t?.rawValue??t?.displayValue??``).trim();return n?Ya(n):{status:`cancelled`}}catch(t){return Ua(t)?{status:`cancelled`}:Wa(t)?{status:`permission-denied`}:Va()&&Ga(t)&&e.startScan?(Ka(t)&&qa(e),$a(e)):{status:`failed`}}return Va()&&e.startScan?$a(e):{status:`unsupported`}}catch{return{status:`failed`}}},ro={autoComplete:`off`,autoCorrect:`off`,spellCheck:!1},io=({disabled:e=!1,isBusy:t=!1,tabIndex:n,inputClassName:r,buttonVariant:i=`outline`,buttonClassName:a=`h-12 w-full`,value:o,onValueChange:s,showPasteButton:c=!1,error:l,onRedeem:u,onInvalid:d})=>{let{t:f}=tt(),[p,m]=Z.useState(``),[h,g]=Z.useState(null),[_,v]=Z.useState(!1),y=o??p,b=Z.useId(),x=e=>{g(null),m(e),s?.(e)},S=L(async()=>{if(!(e||t||_)){v(!0);try{let e=await navigator.clipboard.readText();x(e);let t=Ja(e);e.trim()&&(!t||!(`pairing`in t))&&d()}catch{g(f(`mobile.connect.link.pasteFallback`))}finally{v(!1)}}}),C=L(n=>{if(n.preventDefault(),e||t||_)return;let r=Ja(y);if(!r||!(`pairing`in r)){d();return}u(r.pairing)});return(0,$.jsxs)(`form`,{className:`flex w-full flex-col gap-3`,onSubmit:C,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Ut,{...ro,value:y,onChange:e=>x(e.target.value),placeholder:f(`mobile.connect.link.placeholder`),"aria-label":f(`mobile.connect.link.label`),inputMode:`url`,autoCapitalize:`none`,tabIndex:n,disabled:e||t||_,"aria-invalid":!!l,"aria-describedby":l||h?b:void 0,className:r}),c?(0,$.jsx)(H,{variant:`outline`,size:`icon`,onClick:()=>void S(),disabled:e||t||_,"aria-label":f(`mobile.connect.link.paste`),children:(0,$.jsx)(W,{name:`clipboard`,className:`size-5`})}):null]}),l||h?(0,$.jsx)(`p`,{id:b,role:`alert`,className:`typography-small text-[var(--status-error)]`,children:l||h}):null,(0,$.jsx)(H,{type:`submit`,variant:i,size:`lg`,className:a,disabled:e||t||_||!y.trim(),children:f(t?`mobile.connect.connecting`:`mobile.connect.connectButton`)})]})};function ao({connection:e}){let{t}=tt(),{connections:n,isBusy:r,error:i,pendingConnection:a}=e,o=Z.useMemo(()=>to(),[]),[s,c]=Z.useState(null),[l,u]=Z.useState(!1),[d,f]=Z.useState(null),[p,m]=Z.useState(!1),[h,_]=Z.useState(null),[v,y]=Z.useState(null),[b,x]=Z.useState(``),[S,C]=Z.useState(``),[w,T]=Z.useState(``),E=n[0],D=n.find(e=>e.id===v),O=r||p,k=s!==null||a!==null,A=t=>{e.setError(null),c(t)},j=()=>{e.setError(null),c(null),u(!0)},M=L(()=>{O||(a?(e.cancelPassword(),C(``)):A(null))}),N=L(async t=>{O||(_(t.id),C(``),await e.connect({id:t.id,candidates:t.candidates,label:t.label}))}),ee=L(async()=>{if(!O){_(null),m(!0),e.setError(null);try{let n=await no();n.status===`ok`?await e.connect({url:n.url,label:n.label,clientToken:n.clientToken}):n.status===`pairing`?await e.redeemPairingConnection(n.pairing):n.status===`permission-denied`?e.setError(t(`mobile.connect.scan.permissionDenied`)):n.status===`invalid`?e.setError(t(`mobile.connect.scan.invalid`)):n.status===`unsupported`?e.setError(t(`mobile.connect.scan.unsupported`)):n.status===`failed`&&e.setError(t(`mobile.connect.scan.failed`))}catch{e.setError(t(`mobile.connect.scan.failed`))}finally{m(!1)}}}),P=L(()=>d?(f(null),!0):k?(M(),!0):l?(u(!1),!0):!1);Z.useEffect(()=>{if(!g())return;let e=!1,t;return z(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])).then(async({App:n})=>{let r=await n.addListener(`backButton`,()=>{P()||n.minimizeApp().catch(()=>void 0)});e?r.remove():t=()=>{r.remove()}}).catch(()=>void 0),()=>{e=!0,t?.()}},[P]);let F=e=>h===e.id&&r&&!a&&s!==`rename`&&s!==`remove`?t(`mobile.connect.connecting`):e.id===E?.id&&e.lastUsedAt>0?t(`mobile.connect.history.lastUsed`):t(`mobile.instances.status.saved`),I=e=>(0,$.jsxs)(H,{size:`lg`,variant:e?`default`:`ghost`,className:e?`yuri-welcome-primary w-full`:`w-full`,disabled:O,onClick:()=>void ee(),children:[(0,$.jsx)(W,{name:p?`loader-4`:`scan-2`,className:p?`size-5 animate-spin motion-reduce:animate-none`:`size-5`}),t(`mobile.connect.scanQr`)]}),te=t(a?a.reason===`pairing`?`mobile.connect.pairing.expired`:`mobile.connect.password.label`:s===`rename`?`mobile.connect.history.rename`:s===`remove`?`mobile.connect.history.remove`:`mobile.connect.welcome.moreOptions`);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`main`,{className:`yuri-keyboard-fill-screen yuri-mobile-welcome`,inert:k||l,"aria-hidden":k||l||void 0,"data-welcome-paused":k||l||p?`true`:void 0,children:[(0,$.jsx)(`header`,{className:`yuri-welcome-brand`,children:(0,$.jsx)(gi,{className:`block`,width:88})}),(0,$.jsxs)(`div`,{className:`yuri-welcome-content`,children:[(0,$.jsxs)(`div`,{className:`yuri-welcome-intro`,children:[(0,$.jsxs)(`div`,{className:`yuri-welcome-art`,"aria-hidden":`true`,children:[(0,$.jsx)(`span`,{className:`yuri-image-loading yuri-welcome-dots`}),(0,$.jsx)(`div`,{className:`yuri-welcome-logo`,children:(0,$.jsx)(jn,{width:144,height:144,className:`size-full`})})]}),(0,$.jsxs)(`div`,{className:`yuri-welcome-copy`,children:[(0,$.jsx)(`h1`,{children:t(E?`mobile.connect.history.welcomeBack`:`mobile.connect.welcome.heading`)}),(0,$.jsx)(`p`,{children:t(`mobile.connect.welcome.pairingHint`)})]})]}),(0,$.jsxs)(`div`,{className:`yuri-welcome-actions flex w-full flex-col gap-3`,children:[E?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(H,{variant:`outline`,className:`yuri-welcome-device`,disabled:O,onClick:j,children:[(0,$.jsx)(W,{name:`computer`,className:`size-7`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1 text-left`,children:[(0,$.jsx)(`span`,{className:`block truncate typography-ui-label`,children:E.label}),(0,$.jsx)(`span`,{className:`block typography-small font-normal text-muted-foreground`,children:F(E)})]}),(0,$.jsx)(W,{name:`arrow-right-s`,className:`size-5 text-muted-foreground`})]}),(0,$.jsx)(H,{size:`lg`,className:`yuri-welcome-primary w-full`,disabled:O,onClick:()=>void N(E),children:r&&h===E.id?t(`mobile.connect.connecting`):i&&h===E.id?t(`desktopHostSwitcher.actions.retry`):t(`mobile.connect.history.continue`)})]}):null,o?I(!E):E?null:(0,$.jsx)(H,{size:`lg`,className:`yuri-welcome-primary w-full`,disabled:O,onClick:()=>A(`more`),children:t(`mobile.connect.link.useLink`)}),i&&!k&&!l?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:i}):null,(0,$.jsx)(H,{variant:`ghost`,size:`lg`,disabled:O,className:`mx-auto text-muted-foreground`,onClick:()=>A(`more`),children:t(`mobile.connect.welcome.moreOptions`)})]})]})]}),(0,$.jsxs)(ct,{id:`welcome-history`,open:l,onOpenChange:u,presentation:`page`,edge:`right`,dismissGesture:!0,ariaLabel:t(`mobile.connect.history.title`),children:[(0,$.jsx)(dn,{title:t(`mobile.connect.history.title`),backAriaLabel:t(`header.actions.backAria`),onBack:()=>u(!1)}),(0,$.jsxs)(ot,{outerClassName:`flex-1`,className:`px-6 py-6`,disableHorizontal:!0,children:[(0,$.jsx)(`h1`,{className:`typography-h1 mb-3`,children:t(`mobile.connect.history.title`)}),(0,$.jsx)(`p`,{className:`mb-6 typography-ui-label font-normal text-muted-foreground`,children:t(n.length?`mobile.connect.history.description`:`mobile.connect.saved.empty`)}),n.map(e=>(0,$.jsx)(`div`,{className:`border-b border-border/60 py-3`,children:(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(H,{variant:`ghost`,className:`yuri-welcome-history-row min-w-0 flex-1`,disabled:O,onClick:()=>void N(e),children:[(0,$.jsx)(W,{name:r&&h===e.id&&!k?`loader-4`:`computer`,className:r&&h===e.id&&!k?`size-7 animate-spin motion-reduce:animate-none`:`size-7`}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1 text-left`,children:[(0,$.jsx)(`span`,{className:`block truncate typography-ui-label`,children:e.label}),(0,$.jsx)(`span`,{className:`block typography-small font-normal text-muted-foreground`,children:F(e)})]})]}),i&&h===e.id&&!k&&!r?(0,$.jsx)(H,{variant:`ghost`,size:`icon`,disabled:O,"aria-label":t(`desktopHostSwitcher.actions.retry`),onClick:()=>void N(e),children:(0,$.jsx)(W,{name:`error-warning-fill`,className:`size-5 text-[var(--status-error)]`})}):null,(0,$.jsxs)(Et,{open:d===e.id,onOpenChange:t=>f(t?e.id:null),children:[(0,$.jsx)(Ct,{asChild:!0,children:(0,$.jsx)(H,{variant:`ghost`,size:`icon`,disabled:O,"aria-label":t(`mobile.connect.history.actions`,{name:e.label}),children:(0,$.jsx)(W,{name:`more`,className:`size-5`})})}),(0,$.jsxs)(wt,{align:`end`,children:[(0,$.jsxs)(Tt,{onSelect:()=>{y(e.id),x(e.label),A(`rename`)},children:[(0,$.jsx)(W,{name:`edit`,className:`size-4`}),t(`mobile.connect.history.rename`)]}),(0,$.jsxs)(Tt,{onSelect:()=>{y(e.id),A(`remove`)},className:`text-[var(--status-error)]`,children:[(0,$.jsx)(W,{name:`delete-bin`,className:`size-4 text-inherit`}),t(`mobile.connect.history.remove`)]})]})]})]})},e.id)),i&&!h&&!k?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:i}):null]}),(0,$.jsxs)(`div`,{className:`yuri-welcome-history-footer`,children:[(0,$.jsx)(jn,{width:36,height:36,className:`mx-auto mb-5 opacity-40`}),o?I(!1):null,(0,$.jsx)(H,{variant:`ghost`,size:`lg`,className:`w-full`,disabled:O,onClick:()=>A(`more`),children:t(`mobile.connect.link.useLink`)})]})]}),(0,$.jsx)(lt,{id:`welcome-options`,open:k,onOpenChange:e=>{e||M()},fitContent:!0,title:(0,$.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold`,children:te}),ariaLabel:te,closeAriaLabel:t(`mobile.surface.closeAria`),resizeAriaLabel:t(`mobile.connect.options.resize`),children:(0,$.jsx)(ot,{className:`px-5 py-5`,disableHorizontal:!0,fillContainer:!1,children:a?.reason===`pairing`?(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(W,{name:`computer`,className:`size-6 shrink-0 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`min-w-0 flex-1 truncate typography-ui-label`,children:a.label}),n.some(e=>e.id===a.id)?(0,$.jsx)(H,{variant:`ghost`,size:`icon`,disabled:O,"aria-label":t(`mobile.instances.deleteAria`,{label:a.label}),onClick:()=>{y(a.id),e.cancelPassword(),A(`remove`)},children:(0,$.jsx)(W,{name:`delete-bin`,className:`size-5`})}):null]}),(0,$.jsx)(`p`,{className:`typography-small text-muted-foreground`,children:t(`mobile.connect.pairing.reconnectHint`)}),i?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:i}):null,o?I(!0):null,(0,$.jsx)(H,{variant:o?`ghost`:`default`,size:`lg`,disabled:O,onClick:()=>{e.cancelPassword(),A(`more`)},children:t(`mobile.connect.link.useLink`)})]}):a?(0,$.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),r||e.submitPassword(S)},children:[(0,$.jsx)(`p`,{className:`truncate typography-ui-label`,children:a.label}),(0,$.jsx)(Ut,{type:`password`,autoComplete:`current-password`,value:S,onChange:e=>C(e.target.value),"aria-label":t(`mobile.connect.password.label`),placeholder:t(`mobile.connect.password.placeholder`),disabled:r}),i?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:i}):null,(0,$.jsx)(H,{type:`submit`,size:`lg`,className:`yuri-welcome-primary w-full`,disabled:r||!S.trim(),children:t(r?`mobile.connect.connecting`:`mobile.connect.unlockButton`)}),(0,$.jsx)(H,{variant:`ghost`,disabled:r,onClick:M,children:t(`mobile.connect.cancelPassword`)})]}):s===`rename`&&D?(0,$.jsxs)(`form`,{className:`flex flex-col gap-4`,onSubmit:t=>{t.preventDefault(),e.renameConnection(D.id,b).then(e=>{e&&c(null)})},children:[(0,$.jsx)(Ut,{value:b,onChange:e=>x(e.target.value),disabled:r,"aria-label":t(`mobile.instances.label.label`),autoComplete:`off`,maxLength:120}),i?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:i}):null,(0,$.jsx)(H,{type:`submit`,size:`lg`,disabled:r||!b.trim(),children:t(`mobile.instances.saveEdit`)})]}):s===`remove`&&D?(0,$.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,$.jsx)(`p`,{className:`typography-ui-label font-normal`,children:t(`mobile.connect.history.removeHint`,{name:D.label})}),i?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:i}):null,(0,$.jsx)(H,{variant:`destructive`,size:`lg`,disabled:r,onClick:()=>{e.removeConnection(D.id).then(e=>{e&&(c(null),_(null))})},children:t(`mobile.connect.history.remove`)}),(0,$.jsx)(H,{variant:`ghost`,disabled:r,onClick:M,children:t(`mobile.instances.cancelEdit`)})]}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h3`,{className:`typography-ui-header mb-2`,children:t(`mobile.connect.link.useLink`)}),(0,$.jsx)(`p`,{className:`typography-small text-muted-foreground`,children:t(`mobile.connect.link.help`)})]}),(0,$.jsx)(io,{value:w,onValueChange:t=>{T(t),e.setError(null)},showPasteButton:!0,inputClassName:`min-w-0 flex-1 text-[16px]`,buttonClassName:`yuri-welcome-primary w-full`,buttonVariant:`default`,disabled:O,isBusy:r,error:i,onInvalid:()=>e.setError(t(`mobile.connect.link.invalid`)),onRedeem:t=>{_(null),e.redeemPairingConnection(t)}}),(0,$.jsxs)(H,{variant:`outline`,className:`yuri-welcome-history-row`,disabled:O,onClick:j,children:[(0,$.jsx)(W,{name:`history`,className:`size-6`}),(0,$.jsx)(`span`,{className:`flex-1 text-left`,children:t(`mobile.connect.history.title`)}),(0,$.jsx)(W,{name:`arrow-right-s`,className:`size-5`})]}),(0,$.jsx)(`p`,{className:`typography-small leading-relaxed text-muted-foreground`,children:t(`mobile.connect.welcome.scanHint`)})]})})})]})}function oo(e){let t=(0,Q.c)(17),{children:n}=e,r=B(lo),i=B(co),a=Z.useRef(null),o=Z.useRef(null),s;t[0]===i?s=t[1]:(s=()=>i(!1),t[0]=i,t[1]=s);let c;t[2]!==r||t[3]!==s?(c={id:`mobile-global-search`,active:r,onBack:s,surfaceRef:a,underlayRef:o},t[2]=r,t[3]=s,t[4]=c):c=t[4],It(c);let l,u;t[5]===r?(l=t[6],u=t[7]):(l=()=>{if(!r)return;let e=document.activeElement,t=Kt(`global-search-page`);return()=>{t(),e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:!0})}},u=[r],t[5]=r,t[6]=l,t[7]=u),Z.useLayoutEffect(l,u);let d=r||void 0,f=r||void 0,p;t[8]!==n||t[9]!==d||t[10]!==f?(p=(0,$.jsx)(`div`,{ref:o,inert:d,"aria-hidden":f,className:`h-full min-h-0 w-full`,children:n}),t[8]=n,t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===r?m=t[13]:(m=r?(0,$.jsx)(`div`,{ref:a,"data-mobile-search-page":`true`,className:`absolute inset-0 z-50 flex min-h-0 flex-col overflow-hidden bg-background`,"data-page-scroll-lock":`true`,children:(0,$.jsx)(br,{presentation:`page`,onBack:so})}):null,t[12]=r,t[13]=m);let h;return t[14]!==p||t[15]!==m?(h=(0,$.jsxs)(`div`,{className:`relative isolate flex h-[100dvh] min-h-0 w-full flex-col overflow-hidden bg-background`,"data-page-scroll-lock":`true`,children:[p,m]}),t[14]=p,t[15]=m,t[16]=h):h=t[16],h}function so(){zt.requestAnimatedBack(`root`)}function co(e){return e.setCommandPaletteOpen}function lo(e){return e.isCommandPaletteOpen}async function uo(e,t,n,i){if(i){let r=await Di(i,e,n);if(!ne(e))return r;if(!t)throw Error(`unsupported_host`);let a=new URL(r.src,`http://runtime.invalid`);return{...r,src:`${t}${a.pathname}${a.search}${a.hash}`}}let a=d(),o=()=>{if(n.aborted||a!==d())throw new DOMException(`Preview ended`,`AbortError`)};o();let s=new URL(e);if(![`http:`,`https:`].includes(s.protocol)||s.username||s.password)throw Error(`invalid_url`);if(!ne(e))return{src:s.href};if(!t)throw Error(`unsupported_host`);let l=await m(`/api/preview/targets`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:s.href}),signal:n});if(!l.ok)throw Error(`preview_unavailable`);let u=await l.json();if(o(),typeof u.proxyBasePath!=`string`||!/^\/api\/preview\/proxy\/[a-f0-9]{16,64}$/i.test(u.proxyBasePath)||!Ht(`${u.proxyBasePath}${s.pathname}`)||typeof u.previewToken!=`string`||!u.previewToken||typeof u.expiresAt!=`number`||!Number.isFinite(u.expiresAt)||u.expiresAt<=Date.now())throw Error(`invalid_preview`);await r(),o();let f=new URLSearchParams(s.search);f.delete(`yuri_client_token`),f.delete(`yuri_url_token`),f.set(`yuri_preview_token`,u.previewToken);let p=`${u.proxyBasePath}${s.pathname}?${f}${s.hash}`,h=new URL(c().authenticatedAsset(p),`http://runtime.invalid`);return{src:`${t}${h.pathname}${h.search}${h.hash}`,expiresAt:u.expiresAt}}function fo({url:e,hostOrigin:t,entry:n}){let{t:r}=tt(),i=Z.useRef(null),[s,c]=Z.useReducer(e=>e+1,0),l=n?JSON.stringify(n.queryScope):`local`,[u,d]=Z.useState();Z.useEffect(()=>{let r=new AbortController,i,c=0,u=async()=>{let a=++c;clearTimeout(i);try{let o=await uo(e,t,r.signal,n);if(r.signal.aborted||a!==c)return;d({url:e,hostOrigin:t,scope:l,attempt:s,src:o.src}),o.expiresAt&&(i=setTimeout(()=>{u()},Math.max(1e3,o.expiresAt-Date.now()-1e4)))}catch{!r.signal.aborted&&a===c&&d({url:e,hostOrigin:t,scope:l,attempt:s,error:!0})}},f=ne(e),p=f?a():void 0,m=f?o(()=>{u()}):void 0;return u(),()=>{r.abort(),clearTimeout(i),m?.(),p?.()}},[e,t,s,n,l]);let f=u?.url===e&&u.hostOrigin===t&&u.scope===l&&u.attempt===s?u:void 0;return F(`message`,t=>{if(!f?.src||!ne(e)||t.source!==i.current?.contentWindow||t.origin!==new URL(f.src).origin)return;let r=t.data;r?.source===`yuri-preview-bridge`&&r.version===1&&r.type===`navigate-preview`&&typeof r.url==`string`&&ae.getState().open(r.url,n?.location)}),f?.error?(0,$.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3`,children:[(0,$.jsx)(Bt,{message:r(`contextPanel.preview.proxyError`)}),(0,$.jsx)(H,{size:`sm`,onClick:c,children:r(`contextPanel.preview.actions.retry`)})]}):f?.src?(0,$.jsx)(`iframe`,{ref:i,src:f.src,title:r(`contextPanel.preview.iframeTitle`),onError:()=>d({url:e,hostOrigin:t,scope:l,attempt:s,error:!0}),className:`h-full w-full border-0`,sandbox:`allow-scripts allow-same-origin allow-forms`}):(0,$.jsx)(`div`,{className:`flex h-full items-center justify-center text-muted-foreground`,children:r(`contextPanel.preview.loading`)})}function po(e){let t=(0,Q.c)(10),{location:n,url:r,hostOrigin:i}=e,{t:a}=tt(),o=Qe(!0);if(!o.registry||o.registry.hubId!==n.hubId){let e;return t[0]!==o.error||t[1]!==a?(e=o.error?(0,$.jsx)(Bt,{message:o.error.message}):(0,$.jsx)(`div`,{className:`text-muted-foreground`,children:a(`contextPanel.preview.loading`)}),t[0]=o.error,t[1]=a,t[2]=e):e=t[2],e}let s;t[3]!==n||t[4]!==o.registry?(s=o.registry.resolve(n),t[3]=n,t[4]=o.registry,t[5]=s):s=t[5];let c;return t[6]!==i||t[7]!==s||t[8]!==r?(c=(0,$.jsx)(fo,{url:r,hostOrigin:i,entry:s}),t[6]=i,t[7]=s,t[8]=r,t[9]=c):c=t[9],c}function mo(){let e=(0,Q.c)(17),{t}=tt(),n=ae(go),r=N(),i=Z.useSyncExternalStore(s,d,d),a=n?.generation===i?n:null,o=!!a,c;e[0]===t?c=e[1]:(c=t(`contextPanel.preview.iframeTitle`),e[0]=t,e[1]=c);let l;e[2]===t?l=e[3]:(l=t(`guiPlugins.close`),e[2]=t,e[3]=l);let u;e[4]===t?u=e[5]:(u=t(`guiPlugins.resize`),e[4]=t,e[5]=u);let f=a?.url??``,p;e[6]!==a||e[7]!==i||e[8]!==r?(p=a?(0,$.jsx)(Vt,{children:e=>a.location?.hostId?r?.entry.location.hubId===a.location.hubId&&r.entry.location.hostId===a.location.hostId&&r.entry.location.directory===a.location.directory?(0,$.jsx)(fo,{url:a.url,hostOrigin:e?.hostOrigin,entry:r.entry}):(0,$.jsx)(po,{location:a.location,url:a.url,hostOrigin:e?.hostOrigin}):(0,$.jsx)(fo,{url:a.url,hostOrigin:e?.hostOrigin})},i):null,e[6]=a,e[7]=i,e[8]=r,e[9]=p):p=e[9];let m;return e[10]!==o||e[11]!==c||e[12]!==l||e[13]!==u||e[14]!==f||e[15]!==p?(m=(0,$.jsx)(lt,{id:`mobile-html-preview`,open:o,ariaLabel:c,closeAriaLabel:l,resizeAriaLabel:u,initiallyExpanded:!0,title:f,onOpenChange:ho,children:p}),e[10]=o,e[11]=c,e[12]=l,e[13]=u,e[14]=f,e[15]=p,e[16]=m):m=e[16],m}function ho(e){e||ae.getState().close()}function go(e){return e.target}function _o(){let e=he(e=>e.projects.find(t=>t.id===e.activeProjectId)),t=de(e=>e.remoteSession),n=!!e?.hostId,r=Ye(),i=Qe(n&&r),a=r&&i.catalog?.supported!==!1,o=Z.useMemo(()=>e?.hubId&&e.hostId?{supported:!0,hubId:e.hubId,projects:[],hosts:[{id:e.hostId,name:e.hostId,source:`direct`,state:`offline`}]}:void 0,[e?.hubId,e?.hostId]),s=n&&a?i.registry??(o?Ze(o):void 0):void 0,c=e?.hostId,l=Z.useMemo(()=>e=>s&&c?s.subscribeHost(c,e):()=>{},[s,c]),u=Z.useMemo(()=>()=>s&&c?s.getHost(c):void 0,[s,c]),d=Z.useSyncExternalStore(l,u,u),f=t?.projectId===e?.id&&t?.location.hostId===c&&t?.location.hubId===(e?.hubId??s?.hubId),p=Z.useMemo(()=>s&&c&&e&&(!e.hubId||s.hubId===e.hubId)?{hubId:s.hubId,hostId:c,directory:f&&t?t.location.directory:e.path}:void 0,[s,c,e,f,t]),m=p&&s?s.resolve(p):void 0,[h,g]=Z.useState();Z.useEffect(()=>{if(!s||!m)return;let e=Y(s,m),t=e.retain();return g({entry:m,owner:e}),t},[s,m]);let _=h?.entry===m?h?.owner:void 0,y=f?t?.sessionId??null:null,b=Z.useMemo(()=>e=>_?_.state.subscribeSnapshot(e):()=>{},[_]),x=Z.useMemo(()=>()=>_&&y?_.state.getSnapshot(y).session:void 0,[_,y]),S=Z.useSyncExternalStore(b,x,x),C=$e(s,c,n&&a);return{enabled:n,supported:a,project:e,registry:s,entry:m,owner:_,sessionId:y,session:S??C.data?.directories.find(e=>e.directory===p?.directory)?.sessions.find(e=>e.id===y),host:d,openSession:L(t=>{if(!e?.hostId||!p)throw Error(`Remote Host scope unavailable`);de.getState().openRemoteSession(e,p,t)}),refresh:L(async()=>{if(!_||!y)throw Error(`Remote session unavailable`);await _.state.repository.refreshFromAuthority(_.state.scope(y))}),key:p?v(p):e?.id??``,error:i.error}}var vo=e=>{let t=(0,Q.c)(20),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({children:n,className:r,contentClassName:i,style:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===r?s=t[7]:(s=U(`yuri-mobile-header relative z-30 shrink-0 border-b border-border/30 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80`,r),t[6]=r,t[7]=s);let c;t[8]===o?c=t[9]:(c={paddingTop:`var(--yuri-safe-area-top, 0px)`,...o},t[8]=o,t[9]=c);let l;t[10]===i?l=t[11]:(l=U(`flex h-[var(--yuri-header-height,56px)] w-full items-center gap-1 px-2`,i),t[10]=i,t[11]=l);let u;t[12]!==n||t[13]!==l?(u=(0,$.jsx)(`div`,{className:l,children:n}),t[12]=n,t[13]=l,t[14]=u):u=t[14];let d;return t[15]!==a||t[16]!==s||t[17]!==c||t[18]!==u?(d=(0,$.jsx)(`header`,{className:s,style:c,...a,children:u}),t[15]=a,t[16]=s,t[17]=c,t[18]=u,t[19]=d):d=t[19],d};function yo(e){let t=(0,Q.c)(17),{scope:n,children:r}=e,{t:i}=tt();if(!n.supported){let e;t[0]===i?e=t[1]:(e=i(`remoteProjects.unsupported`),t[0]=i,t[1]=e);let n;return t[2]===e?n=t[3]:(n=(0,$.jsx)(`div`,{role:`status`,children:e}),t[2]=e,t[3]=n),n}if(!n.registry||!n.entry||!n.owner){let e=n.error?`alert`:`status`,r;t[4]!==n.error?.message||t[5]!==i?(r=n.error?.message??i(`remoteProjects.state.connecting`),t[4]=n.error?.message,t[5]=i,t[6]=r):r=t[6];let a;return t[7]!==e||t[8]!==r?(a=(0,$.jsx)(`div`,{role:e,children:r}),t[7]=e,t[8]=r,t[9]=a):a=t[9],a}let a;t[10]!==r||t[11]!==n.owner.state?(a=(0,$.jsx)(He.Provider,{value:n.owner.state,children:r}),t[10]=r,t[11]=n.owner.state,t[12]=a):a=t[12];let o;return t[13]!==n.entry.location||t[14]!==n.registry||t[15]!==a?(o=(0,$.jsx)(P,{registry:n.registry,location:n.entry.location,children:a}),t[13]=n.entry.location,t[14]=n.registry,t[15]=a,t[16]=o):o=t[16],o}function bo(e){let t=(0,Q.c)(58),{scope:n,onOpenSessions:r,menuOpen:i,onToggleMenu:a,surfaceShortcuts:o}=e,{t:s}=tt(),[c,l]=Z.useState(!1),u;t[0]===r?u=t[1]:(u=()=>{l(!1),r()},t[0]=r,t[1]=u);let d=L(u),f;t[2]===a?f=t[3]:(f=()=>{l(!1),a()},t[2]=a,t[3]=f);let p=L(f),m;t[4]!==i||t[5]!==a?(m=e=>{e&&i&&a(),l(e)},t[4]=i,t[5]=a,t[6]=m):m=t[6];let h=L(m),g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>l(!1),t[7]=g):g=t[7];let _;t[8]!==n.key||t[9]!==n.sessionId?(_=[n.key,n.sessionId],t[8]=n.key,t[9]=n.sessionId,t[10]=_):_=t[10],Z.useEffect(g,_);let v;t[11]!==n.project?.label||t[12]!==n.project?.path||t[13]!==s?(v=n.project?.label?.trim()||n.project?.path.split(/[\\/]/).filter(Boolean).at(-1)||s(`mobile.header.noProject`),t[11]=n.project?.label,t[12]=n.project?.path,t[13]=s,t[14]=v):v=t[14];let y=v,b;t[15]===s?b=t[16]:(b=s(`mobile.sessions.openSheetAria`),t[15]=s,t[16]=b);let x;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(W,{name:`folders`,className:`size-5`}),t[17]=x):x=t[17];let S;t[18]!==d||t[19]!==b?(S=(0,$.jsx)(H,{variant:`ghost`,size:`icon`,"aria-label":b,onClick:d,children:x}),t[18]=d,t[19]=b,t[20]=S):S=t[20];let C;t[21]!==y||t[22]!==n.session?.title||t[23]!==n.sessionId||t[24]!==s?(C=n.session?.title?.trim()||(n.sessionId?s(`mobile.sessions.untitled`):y),t[21]=y,t[22]=n.session?.title,t[23]=n.sessionId,t[24]=s,t[25]=C):C=t[25];let w;t[26]===C?w=t[27]:(w=(0,$.jsx)(`span`,{className:`truncate typography-ui-label text-foreground`,children:C}),t[26]=C,t[27]=w);let T;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(W,{name:`computer`,className:`size-3 shrink-0`}),t[28]=T):T=t[28];let E=n.sessionId?`${y} · `:``,D=n.host?.name??n.entry?.location.hostId,O;t[29]!==E||t[30]!==D?(O=(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1 typography-micro text-muted-foreground`,children:[T,(0,$.jsxs)(`span`,{className:`truncate`,children:[E,D]})]}),t[29]=E,t[30]=D,t[31]=O):O=t[31];let k;t[32]!==w||t[33]!==O?(k=(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col px-2 py-1.5 text-left leading-tight`,children:[w,O]}),t[32]=w,t[33]=O,t[34]=k):k=t[34];let A=n.sessionId??``,j;t[35]!==c||t[36]!==h||t[37]!==A?(j=(0,$.jsx)(Ni,{sessionId:A,open:c,onOpenChange:h}),t[35]=c,t[36]=h,t[37]=A,t[38]=j):j=t[38];let M;t[39]!==o||t[40]!==s?(M=o?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(H,{variant:`ghost`,size:`icon`,"aria-label":s(`mobile.menu.files`),"aria-pressed":o.activePanel===`files`,onClick:o.onToggleFiles,children:(0,$.jsx)(W,{name:`file-text`,className:`size-5`})}),(0,$.jsxs)(H,{variant:`ghost`,size:`icon`,className:`relative`,"aria-label":s(`mobile.menu.changes`),"aria-pressed":o.activePanel===`changes`,onClick:o.onToggleChanges,children:[(0,$.jsx)(W,{name:`git-branch`,className:`size-5`}),o.changesDirty?(0,$.jsx)(`span`,{className:`absolute right-2 top-2 size-2 rounded-full bg-primary`,"aria-hidden":!0}):null]})]}):null,t[39]=o,t[40]=s,t[41]=M):M=t[41];let N;t[42]===s?N=t[43]:(N=s(`mobile.header.openMenuAria`),t[42]=s,t[43]=N);let ee;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,$.jsx)(W,{name:`more-2`,className:`size-5`}),t[44]=ee):ee=t[44];let P;t[45]!==p||t[46]!==i||t[47]!==N?(P=(0,$.jsx)(H,{variant:`ghost`,size:`icon`,"aria-label":N,"aria-controls":`mobile-overflow-menu`,"aria-expanded":i,"aria-haspopup":`menu`,onClick:p,children:ee}),t[45]=p,t[46]=i,t[47]=N,t[48]=P):P=t[48];let F;t[49]!==k||t[50]!==j||t[51]!==M||t[52]!==P||t[53]!==S?(F=(0,$.jsxs)(vo,{children:[S,k,j,M,P]}),t[49]=k,t[50]=j,t[51]=M,t[52]=P,t[53]=S,t[54]=F):F=t[54];let I;return t[55]!==n||t[56]!==F?(I=(0,$.jsx)(yo,{scope:n,children:F}),t[55]=n,t[56]=F,t[57]=I):I=t[57],I}var xo=`yuri:assistant-share-welcome:v1`,So=[{image:Ii,titleKey:`assistants.shareWelcome.example.chat.title`,descriptionKey:`assistants.shareWelcome.example.chat.description`},{image:Li,titleKey:`assistants.shareWelcome.example.article.title`,descriptionKey:`assistants.shareWelcome.example.article.description`},{image:Ri,titleKey:`assistants.shareWelcome.example.note.title`,descriptionKey:`assistants.shareWelcome.example.note.description`}],Co=e=>{let t=(0,Q.c)(40),{enabled:n,open:r,onOpenChange:i}=e,a=n!==void 0&&n,{t:o}=tt(),[s,c]=I(xo,!1),l=r!==void 0,u=l?r:a&&s!==!0,d;t[0]!==l||t[1]!==i||t[2]!==c?(d=()=>{l||c(!0),i?.(!1)},t[0]=l,t[1]=i,t[2]=c,t[3]=d):d=t[3];let f=L(d),p;t[4]!==f||t[5]!==i?(p=e=>{e?i?.(!0):f()},t[4]=f,t[5]=i,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,$.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-interactive-selection text-interactive-selection-foreground sm:size-12`,children:(0,$.jsx)(W,{name:`share-2`,className:`size-5`})}),t[7]=m):m=t[7];let h;t[8]===o?h=t[9]:(h=o(`assistants.shareWelcome.title`),t[8]=o,t[9]=h);let g;t[10]===h?g=t[11]:(g=(0,$.jsx)(gt,{className:`typography-ui-header text-left sm:text-3xl`,children:h}),t[10]=h,t[11]=g);let _;t[12]===o?_=t[13]:(_=o(`assistants.shareWelcome.description`),t[12]=o,t[13]=_);let v;t[14]===_?v=t[15]:(v=(0,$.jsx)(_t,{className:`typography-ui text-left leading-6 sm:max-w-3xl sm:text-base sm:leading-7`,children:_}),t[14]=_,t[15]=v);let y;t[16]!==g||t[17]!==v?(y=(0,$.jsxs)(pt,{className:`flex-row items-start gap-3 px-5 pb-5 pt-6 text-left sm:gap-4 sm:px-8 sm:pb-6 sm:pt-8`,children:[m,(0,$.jsxs)(`div`,{className:`min-w-0 space-y-1.5 sm:space-y-2`,children:[g,v]})]}),t[16]=g,t[17]=v,t[18]=y):y=t[18];let b;t[19]===o?b=t[20]:(b=o(`assistants.shareWelcome.examplesAria`),t[19]=o,t[20]=b);let x;t[21]===o?x=t[22]:(x=So.map((e,t)=>(0,$.jsxs)(`article`,{className:`w-[min(78vw,19rem)] shrink-0 snap-center overflow-hidden rounded-xl border border-border bg-background lg:w-auto lg:min-w-0`,children:[(0,$.jsxs)(`div`,{className:`relative overflow-hidden border-b border-border bg-muted`,children:[(0,$.jsx)(`img`,{src:e.image,alt:``,className:`h-72 w-full object-cover object-bottom lg:h-[min(38vh,23rem)]`}),(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`absolute left-3 top-3 flex size-7 items-center justify-center rounded-full bg-[var(--surface-elevated)] typography-meta font-semibold text-foreground shadow-sm`,children:t+1})]}),(0,$.jsxs)(`div`,{className:`space-y-1 px-4 py-3.5 lg:min-h-25`,children:[(0,$.jsx)(`h2`,{className:`typography-ui-label font-semibold text-foreground`,children:o(e.titleKey)}),(0,$.jsx)(`p`,{className:`typography-meta leading-5 text-muted-foreground`,children:o(e.descriptionKey)})]})]},e.titleKey)),t[21]=o,t[22]=x);let S;t[23]!==b||t[24]!==x?(S=(0,$.jsx)(`div`,{className:`overflow-hidden px-5 pb-5 sm:px-8 sm:pb-7`,children:(0,$.jsx)(`div`,{className:`flex snap-x snap-mandatory gap-3 overflow-x-auto pb-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden lg:grid lg:grid-cols-3 lg:overflow-visible lg:pb-0`,"aria-label":b,children:x})}),t[23]=b,t[24]=x,t[25]=S):S=t[25];let C;t[26]===o?C=t[27]:(C=o(`assistants.shareWelcome.action`),t[26]=o,t[27]=C);let w;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,$.jsx)(W,{name:`arrow-right-s`,className:`size-4`}),t[28]=w):w=t[28];let T;t[29]!==f||t[30]!==C?(T=(0,$.jsx)(mt,{className:`border-t border-border px-5 py-4 sm:px-8 sm:py-5`,children:(0,$.jsxs)(H,{size:`lg`,className:`w-full lg:mx-auto lg:w-72`,onClick:f,children:[C,w]})}),t[29]=f,t[30]=C,t[31]=T):T=t[31];let E;t[32]!==S||t[33]!==T||t[34]!==y?(E=(0,$.jsxs)(ht,{showCloseButton:!1,className:`w-[min(100%,31rem)] max-w-none gap-0 overflow-hidden rounded-2xl border-border bg-[var(--surface-elevated)] p-0 sm:w-[min(calc(100%-3rem),44rem)] lg:w-[min(calc(100%-4rem),74rem)]`,containerClassName:`fixed inset-0 z-50 flex items-end justify-center px-0 pt-8 sm:items-center sm:p-6`,children:[y,S,T]}),t[32]=S,t[33]=T,t[34]=y,t[35]=E):E=t[35];let D;return t[36]!==u||t[37]!==E||t[38]!==p?(D=(0,$.jsx)(vt,{open:u,onOpenChange:p,children:E}),t[36]=u,t[37]=E,t[38]=p,t[39]=D):D=t[39],D},wo=te(`YuriNativeHeader`),To=`header.yuri-mobile-detail-navigation, header.yuri-mobile-header`,Eo=`yuri-native-header-source`,Do=`yuri-native-header-ready`,Oo=new Set([Do,`yuri-keyboard-open`,`yuri-kb-animating`,`yuri-kb-hide`,`yuri-kb-caret-hold`]),ko=`--yuri-native-viewport-top`,Ao=`.fixed, [role="dialog"]`,jo=new Set([`style`,`data-yuri-header-collapse-phase`,`data-yuri-header-collapse-rest`]),Mo=()=>parseFloat(document.documentElement.style.getPropertyValue(`--yuri-native-viewport-top`))||0,No=`[data-avatar-motion]`,Po=new Set([`class`,`style`,`inert`,`aria-hidden`,`hidden`]),Fo=e=>{if(e.querySelector(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)||e.getClientRects().length===0||e.offsetHeight<=0||e.closest(`[inert],[aria-hidden="true"]`))return!1;let t=e.parentElement;if(!t||(typeof t.checkVisibility==`function`?!t.checkVisibility({visibilityProperty:!0,contentVisibilityAuto:!0,opacityProperty:!0}):getComputedStyle(t).visibility===`hidden`))return!1;let n=e.getBoundingClientRect().top-Mo();return e.dataset.yuriCollapsibleHeader===`true`||Math.abs(n)<=1},Io=(e,t)=>{let n=[...document.querySelectorAll(To)].filter(Fo);if(t&&e&&n.includes(e))return e;for(let e of n){let t=e.getBoundingClientRect(),n=document.elementFromPoint(t.left+t.width/2,t.bottom-4);if(n&&e.contains(n))return e}return n.at(-1)??null},Lo=()=>{let e=[];for(let t of document.styleSheets)try{for(let n of t.cssRules)e.push(n.cssText)}catch{}return e.join(`
|
|
3
|
-
`)},Ro=()=>{let e=0;for(let t of document.styleSheets)try{e+=t.cssRules.length}catch{}return`${document.styleSheets.length}:${e}`},zo=wo,Bo=()=>new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e(1)))});function Vo(){let e=document.documentElement,t=window,n=!1,r=0,i=0,a=null,o=``,s=``,c=``,l=``,u=!1,d=!1,f=[],p=()=>{if(!a)return;let e=parseFloat(a.style.getPropertyValue(`--yuri-mobile-header-collapse`))||0,n=a.dataset.yuriHeaderCollapsePhase??`rest`,r=a.dataset.yuriHeaderCollapseRest??`expanded`,i=`${e}|${n}|${r}`;i!==l&&(l=i,t.YuriHeaderCollapse?t.YuriHeaderCollapse.set(e,n,r):t.webkit?.messageHandlers?.yuriHeaderCollapse?.postMessage({progress:e,phase:n,rest:r}))},m=()=>{e.classList.remove(Do),u&&(u=!1,o=``,wo.update({seq:++r,visible:!1}).catch(()=>void 0))},h=()=>{if(i=0,n)return;let t=Io(a,d);if(t!==a){if(a?.classList.remove(Eo),m(),a=t,l=``,!t)return;t.classList.add(Eo),p()}if(!t)return;let f=window.devicePixelRatio||1,h=t.offsetHeight,g=parseFloat(getComputedStyle(t,`::after`).height)||0,_=Math.ceil(h*f),v=t.querySelector(Ao)===null?Math.ceil(Math.max(h,g)*f):_,y=(h+2*(parseFloat(getComputedStyle(e).fontSize)||16))*f,b=t.cloneNode(!0);b.classList.remove(Eo),b.style.removeProperty(Ln),delete b.dataset.yuriHeaderCollapsePhase,delete b.dataset.yuriHeaderCollapseRest;for(let e of b.querySelectorAll(Ao))e.style.display=`none`;let x=b.outerHTML,S=[...e.classList].filter(e=>!Oo.has(e)).join(` `),C=(e.getAttribute(`style`)??``).replace(RegExp(`${ko}\\s*:[^;]*;?`,`g`),``),w=document.body.className,T=`${x}|${S}|${C}|${w}|${v}|${y}`,E=Ro(),D=document.getElementById(`yuri-icon-sprite-v2`)?.outerHTML??``;if(T===o&&E===s&&D===c)return;o=T;let O={seq:++r,visible:!0,height:v,hitBottom:_,collapseDistance:y,html:x,rootClass:S,rootStyle:C,bodyClass:w};E!==s&&(s=E,O.css=Lo()),D!==c&&(c=D,O.sprite=D),u=!0,wo.update(O).catch(()=>void 0)},g=()=>{!i&&!n&&(i=requestAnimationFrame(h))};f.push(wo.addListener(`shown`,t=>{d&&t.seq===r&&a&&e.classList.add(Do)})),f.push(wo.addListener(`tap`,e=>{if(!a||!d)return;let t=a;try{for(let n of JSON.parse(e.path))t=t?.children[n]??null}catch{return}let n=t?.closest(`button, a, [role="button"]`);if(!n||!a.contains(n))return;let r={bubbles:!0,cancelable:!0,pointerType:`touch`,isPrimary:!0};n.dispatchEvent(new PointerEvent(`pointerdown`,r)),n.dispatchEvent(new PointerEvent(`pointerup`,r)),n.click()}));let _=new MutationObserver(e=>{if(!a||!a.isConnected){g();return}let t=!1;for(let n of e){if(n.target===a&&n.type===`attributes`&&jo.has(n.attributeName??``)){p();continue}let e=n.target instanceof Element?n.target:n.target.parentElement;if(!(e?.closest(No)&&a.contains(e))){if(a.contains(n.target)||n.type===`attributes`&&n.target.contains(a))t=!0;else if(n.type===`attributes`&&Po.has(n.attributeName??``)&&n.target instanceof Element&&n.target.querySelector(To))t=!0;else if(n.type===`childList`)for(let e of n.addedNodes)e instanceof Element&&(e.matches(To)||e.querySelector(To))&&(t=!0)}}t&&g()});_.observe(document.body,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let v=new MutationObserver(g);v.observe(e,{attributes:!0,attributeFilter:[`class`,`style`]});let y=new MutationObserver(()=>{s=``,g()});y.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),window.addEventListener(`resize`,g),g(),t.__yuriImeOffset=t=>(window.dispatchEvent(new Event(`yuri:keyboard-native-layout`)),e.style.setProperty(ko,`${Math.max(0,t)}px`),Bo());let b=window;return b.__yuriNativeHeader=t=>(d=t,e.classList.toggle(Do,t&&a!==null),Bo()),()=>{n=!0,delete b.__yuriNativeHeader,i&&cancelAnimationFrame(i),_.disconnect(),v.disconnect(),y.disconnect(),window.removeEventListener(`resize`,g),delete t.__yuriImeOffset,e.classList.remove(Do),a?.classList.remove(Eo),a=null;for(let e of f)e.then(e=>e.remove()).catch(()=>void 0);wo.update({seq:++r,visible:!1}).catch(()=>void 0)}}var Ho=`.yuri-mobile-composer`,Uo=`[data-btw-composer]`;function Wo(e,t){if(!e)return!1;let n=t;return!n||typeof n.closest!=`function`||!n.closest(Uo)}function Go(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.closest==`function`&&!!t.closest(Ho)}function Ko(e){return Go(e??null)}var qo=S(e=>({expandedParents:{},toggleParent:t=>e(e=>{let n={...e.expandedParents};return n[t]?delete n[t]:n[t]=!0,{expandedParents:n}})})),Jo=36,Yo=18,Xo=e=>e.parentID??null,Zo=e=>(e||``).replace(/\\/g,`/`).replace(/\/+$/g,``),Qo=e=>{let t=e;return Zo(t.directory??t.project?.worktree??null)},$o=e=>{let t=Zo(e);if(!t)return``;let n=t.split(`/`).filter(Boolean);return n[n.length-1]||t},es=e=>{let t=e.time?.updated??e.time?.created,n=typeof t==`number`?t:Number(t);return Number.isFinite(n)&&n>0?n:0},ts=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e)),ns=e=>{if(e<=0)return``;let t=Date.now()-e;if(t<6e4)return`now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m`;let r=Math.floor(n/60);if(r<24)return`${r}h`;let i=Math.floor(r/24);return i<7?`${i}d`:new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(new Date(e))},rs=(e,t)=>{let n=Zo(e),r=Zo(t);return!!(n&&r&&(n===r||n.startsWith(`${r}/`)))},is=(e,t)=>e.worktrees.find(e=>Zo(e.path)===t)??null,as=(e,t)=>t===e.path||!!is(e,t),os=(e,t)=>{let n=Zo(t);return n?e.find(e=>as(e,n))??null:null},ss=(e,t,n)=>!n||`${e.title??``} ${e.id} ${Qo(e)} ${t}`.toLowerCase().includes(n),cs=e=>{let t=(0,Q.c)(14),{project:n,size:r}=e,i=r===void 0?`md`:r,a=i===`sm`?`size-6 rounded-md`:`size-8 rounded-lg`,o=i===`sm`?`size-3.5`:`size-4`,s=n.icon?Kn[n.icon]:null,c=n.color?qn[n.color]:void 0,l=s??`folder-open`,u;t[0]===c?u=t[1]:(u=c?{color:c}:void 0,t[0]=c,t[1]=u);let d;t[2]!==o||t[3]!==l||t[4]!==u?(d=(0,$.jsx)(W,{name:l,className:o,style:u}),t[2]=o,t[3]=l,t[4]=u,t[5]=d):d=t[5];let f=d,p;t[6]===a?p=t[7]:(p=U(`flex shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,a),t[6]=a,t[7]=p);let m;t[8]!==f||t[9]!==n?(m=n.iconImage?(0,$.jsx)(Gn,{project:n,className:`size-full object-contain`,fallback:f}):f,t[8]=f,t[9]=n,t[10]=m):m=t[10];let h;return t[11]!==p||t[12]!==m?(h=(0,$.jsx)(`span`,{className:p,children:m}),t[11]=p,t[12]=m,t[13]=h):h=t[13],h},ls=e=>{let t=(0,Q.c)(5),{expanded:n}=e,r=n?`rotate-0`:`-rotate-90`,i;t[0]===r?i=t[1]:(i=U(`flex size-5 shrink-0 items-center justify-center text-muted-foreground/70 transition-transform duration-150`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,$.jsx)(W,{name:`arrow-down-s`,className:`size-4`}),t[2]=a):a=t[2];let o;return t[3]===i?o=t[4]:(o=(0,$.jsx)(`span`,{"aria-hidden":!0,className:i,children:a}),t[3]=i,t[4]=o),o},us=e=>{let t=(0,Q.c)(2),{ariaLabel:n}=e,r;return t[0]===n?r=t[1]:(r=(0,$.jsx)(`span`,{className:`inline-block size-1.5 shrink-0 rounded-full bg-primary`,"aria-label":n}),t[0]=n,t[1]=r),r},ds=e=>{let t=(0,Q.c)(12),{onClick:n,className:r}=e,{t:i}=tt(),a;t[0]===i?a=t[1]:(a=i(`sessions.sidebar.project.actions.newWorktree`),t[0]=i,t[1]=a);let o=a,s;t[2]===r?s=t[3]:(s=U(`flex size-9 shrink-0 items-center justify-center rounded-full text-[var(--surface-mutedForeground)] transition-colors hover:bg-[var(--interactive-hover)] hover:text-[var(--surface-foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`,r),t[2]=r,t[3]=s);let c;t[4]===n?c=t[5]:(c=e=>{e.stopPropagation(),n()},t[4]=n,t[5]=c);let l,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l={touchAction:`manipulation`},u=(0,$.jsx)(W,{name:`node-tree`,className:`size-4`}),t[6]=l,t[7]=u):(l=t[6],u=t[7]);let d;return t[8]!==o||t[9]!==s||t[10]!==c?(d=(0,$.jsx)(`button`,{type:`button`,className:s,"aria-label":o,title:o,onClick:c,style:l,children:u}),t[8]=o,t[9]=s,t[10]=c,t[11]=d):d=t[11],d},fs=e=>{let t=(0,Q.c)(10),{icon:n,label:r,onClick:i,destructive:a}=e,o=a!==void 0&&a?`destructive`:`ghost`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s={touchAction:`manipulation`},t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=(0,$.jsx)(W,{name:n,className:`size-5 shrink-0 text-inherit`}),t[1]=n,t[2]=c);let l;t[3]===r?l=t[4]:(l=(0,$.jsx)(`span`,{className:`truncate`,children:r}),t[3]=r,t[4]=l);let u;return t[5]!==i||t[6]!==o||t[7]!==c||t[8]!==l?(u=(0,$.jsxs)(H,{type:`button`,variant:o,size:`default`,className:`min-h-12 w-full justify-start gap-3 rounded-xl px-3 typography-ui-label`,onClick:i,style:s,children:[c,l]}),t[5]=i,t[6]=o,t[7]=c,t[8]=l,t[9]=u):u=t[9],u},ps=e=>{let t=(0,Q.c)(107),{session:n,active:r,indent:i,contextLabel:a,confirmingArchive:o,hasChildren:s,expanded:c,onToggleChildren:l,onSelect:u,onRequestArchive:d,onConfirmArchive:f,onStop:p,stopAriaLabel:m,longPressHandlers:h,highlightQuery:g}=e,_=o!==void 0&&o,v=s!==void 0&&s,y=c!==void 0&&c,{t:b}=tt(),x;t[0]===n?x=t[1]:(x=ns(es(n)),t[0]=n,t[1]=x);let S=x,C,w,T,E,D,O,k,A,j,M,N,ee,P,F,I,L,te,R;if(t[2]!==r||t[3]!==_||t[4]!==y||t[5]!==v||t[6]!==g||t[7]!==i||t[8]!==h.onContextMenu||t[9]!==h.onPointerCancel||t[10]!==h.onPointerDown||t[11]!==h.onPointerMove||t[12]!==h.onPointerUp||t[13]!==h.pressed||t[14]!==u||t[15]!==l||t[16]!==n.title||t[17]!==b){R=n.title?.trim()||b(`mobile.sessions.untitled`);let e=r&&!_&&`bg-[color-mix(in_srgb,var(--primary)_10%,transparent)]`,a=_&&`bg-[color-mix(in_srgb,var(--destructive)_8%,transparent)]`;t[36]!==e||t[37]!==a?(N=U(`relative flex items-center gap-1 transition-colors`,e,a),t[36]=e,t[37]=a,t[38]=N):N=t[38],t[39]!==y||t[40]!==v||t[41]!==i||t[42]!==l||t[43]!==b?(ee=v&&l?(0,$.jsx)(`button`,{type:`button`,className:`absolute z-10 flex w-6 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,style:{left:Math.max(i-32,2),top:0,bottom:0,touchAction:`manipulation`},"aria-label":b(y?`sessions.sidebar.session.subsessions.collapse`:`sessions.sidebar.session.subsessions.expand`),onClick:e=>{e.stopPropagation(),l()},children:(0,$.jsx)(W,{name:`arrow-down-s`,className:U(`size-[18px] transition-transform duration-150`,y?`rotate-0`:`-rotate-90`)})}):null,t[39]=y,t[40]=v,t[41]=i,t[42]=l,t[43]=b,t[44]=ee):ee=t[44],C=`button`;let o=_&&`opacity-50`,s=h.pressed&&`bg-interactive-active scale-[0.99]`;t[45]!==o||t[46]!==s?(w=U(`flex min-h-12 min-w-0 flex-1 items-center gap-2.5 py-2 pr-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,o,s),t[45]=o,t[46]=s,t[47]=w):w=t[47],t[48]===i?T=t[49]:(T={paddingLeft:i,touchAction:`manipulation`},t[48]=i,t[49]=T),E=u,D=h.onPointerDown,O=h.onPointerMove,k=h.onPointerUp,A=h.onPointerCancel,j=h.onContextMenu,M=_,te=`flex min-w-0 flex-1 flex-col`,I=`flex items-center gap-2.5`;let c=r?`bg-primary`:`bg-muted-foreground/30`,d;t[50]===c?d=t[51]:(d=U(`size-1.5 shrink-0 rounded-full`,c),t[50]=c,t[51]=d),t[52]===d?L=t[53]:(L=(0,$.jsx)(`span`,{className:d,"aria-hidden":!0}),t[52]=d,t[53]=L);let f=r?`text-primary`:`text-foreground`;t[54]===f?P=t[55]:(P=U(`block min-w-0 flex-1 truncate typography-ui-label`,f),t[54]=f,t[55]=P),F=g?An(R,g):R,t[2]=r,t[3]=_,t[4]=y,t[5]=v,t[6]=g,t[7]=i,t[8]=h.onContextMenu,t[9]=h.onPointerCancel,t[10]=h.onPointerDown,t[11]=h.onPointerMove,t[12]=h.onPointerUp,t[13]=h.pressed,t[14]=u,t[15]=l,t[16]=n.title,t[17]=b,t[18]=C,t[19]=w,t[20]=T,t[21]=E,t[22]=D,t[23]=O,t[24]=k,t[25]=A,t[26]=j,t[27]=M,t[28]=N,t[29]=ee,t[30]=P,t[31]=F,t[32]=I,t[33]=L,t[34]=te,t[35]=R}else C=t[18],w=t[19],T=t[20],E=t[21],D=t[22],O=t[23],k=t[24],A=t[25],j=t[26],M=t[27],N=t[28],ee=t[29],P=t[30],F=t[31],I=t[32],L=t[33],te=t[34],R=t[35];let z;t[56]!==P||t[57]!==F?(z=(0,$.jsx)(`span`,{className:P,children:F}),t[56]=P,t[57]=F,t[58]=z):z=t[58];let B;t[59]===S?B=t[60]:(B=S?(0,$.jsx)(`span`,{className:`shrink-0 typography-micro text-muted-foreground tabular-nums`,children:S}):null,t[59]=S,t[60]=B);let ne;t[61]!==z||t[62]!==B||t[63]!==I||t[64]!==L?(ne=(0,$.jsxs)(`span`,{className:I,children:[L,z,B]}),t[61]=z,t[62]=B,t[63]=I,t[64]=L,t[65]=ne):ne=t[65];let re;t[66]!==a||t[67]!==g?(re=a?(0,$.jsx)(`span`,{className:`block truncate typography-micro text-muted-foreground pl-4`,children:g?An(a,g):a}):null,t[66]=a,t[67]=g,t[68]=re):re=t[68];let ie;t[69]!==ne||t[70]!==re||t[71]!==te?(ie=(0,$.jsxs)(`span`,{className:te,children:[ne,re]}),t[69]=ne,t[70]=re,t[71]=te,t[72]=ie):ie=t[72];let ae;t[73]!==C||t[74]!==w||t[75]!==T||t[76]!==E||t[77]!==D||t[78]!==O||t[79]!==k||t[80]!==A||t[81]!==j||t[82]!==M||t[83]!==ie?(ae=(0,$.jsx)(`button`,{type:C,className:w,style:T,onClick:E,onPointerDown:D,onPointerMove:O,onPointerUp:k,onPointerCancel:A,onContextMenu:j,disabled:M,children:ie}),t[73]=C,t[74]=w,t[75]=T,t[76]=E,t[77]=D,t[78]=O,t[79]=k,t[80]=A,t[81]=j,t[82]=M,t[83]=ie,t[84]=ae):ae=t[84];let oe;t[85]!==p||t[86]!==m?(oe=p?(0,$.jsx)(`button`,{type:`button`,className:`mr-0.5 flex size-9 shrink-0 items-center justify-center rounded-xl text-[var(--surface-mutedForeground)] transition-colors hover:bg-[var(--interactive-hover)] hover:text-[var(--surface-foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`,"aria-label":m,onClick:e=>{e.stopPropagation(),p()},style:{touchAction:`manipulation`},children:(0,$.jsx)(kr,{})}):null,t[85]=p,t[86]=m,t[87]=oe):oe=t[87];let V;t[88]===b?V=t[89]:(V=b(`sessions.sidebar.session.menu.label`),t[88]=b,t[89]=V);let se;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,$.jsx)(W,{name:`more-2`,className:`size-4`}),t[90]=se):se=t[90];let G;t[91]!==h.onOpenActions||t[92]!==V?(G=(0,$.jsx)(H,{variant:`ghost`,size:`icon`,"data-session-drag-ignore":!0,"aria-label":V,onClick:h.onOpenActions,children:se}),t[91]=h.onOpenActions,t[92]=V,t[93]=G):G=t[93];let ce;t[94]!==_||t[95]!==f||t[96]!==d||t[97]!==b||t[98]!==R?(ce=d?(0,$.jsxs)($.Fragment,{children:[_?(0,$.jsxs)(`button`,{type:`button`,className:`flex h-9 shrink-0 items-center gap-1.5 rounded-xl bg-destructive px-3 text-destructive-foreground transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive`,"aria-label":b(`mobile.sessions.archiveSessionAria`,{title:R}),onClick:f,style:{touchAction:`manipulation`},children:[(0,$.jsx)(W,{name:`archive`,className:`size-4`}),(0,$.jsx)(`span`,{className:`typography-ui-label`,children:b(`sessions.sidebar.bulkActions.archive`)})]}):null,(0,$.jsx)(`button`,{type:`button`,className:`mr-1.5 flex size-9 shrink-0 items-center justify-center rounded-xl text-muted-foreground/70 transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,"aria-label":b(_?`mobile.sessions.cancelArchiveAria`:`mobile.sessions.archiveSessionAria`,{title:R}),onClick:d,style:{touchAction:`manipulation`},children:_?(0,$.jsx)(W,{name:`close`,className:`size-4`}):(0,$.jsx)(W,{name:`archive`,className:`size-4`})})]}):null,t[94]=_,t[95]=f,t[96]=d,t[97]=b,t[98]=R,t[99]=ce):ce=t[99];let le;return t[100]!==N||t[101]!==ee||t[102]!==ae||t[103]!==oe||t[104]!==G||t[105]!==ce?(le=(0,$.jsxs)(`div`,{className:N,children:[ee,ae,oe,G,ce]}),t[100]=N,t[101]=ee,t[102]=ae,t[103]=oe,t[104]=G,t[105]=ce,t[106]=le):le=t[106],le},ms=e=>{let t=(0,Q.c)(15),{indent:n,showMore:r,showFewer:i,loadingMore:a,onShowMore:o,onShowFewer:s}=e,c=a!==void 0&&a,{t:l}=tt();if(!r&&!i)return null;let u;t[0]===n?u=t[1]:(u={paddingLeft:n,touchAction:`manipulation`},t[0]=n,t[1]=u);let d;t[2]!==s||t[3]!==i||t[4]!==l?(d=i?(0,$.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 text-left transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,onClick:s,children:[(0,$.jsx)(W,{name:`arrow-up-s`,className:`size-4`}),(0,$.jsx)(`span`,{className:`typography-micro`,children:l(`sessions.sidebar.group.showFewer`)})]}):null,t[2]=s,t[3]=i,t[4]=l,t[5]=d):d=t[5];let f;t[6]!==c||t[7]!==o||t[8]!==r||t[9]!==l?(f=r?(0,$.jsxs)(`button`,{type:`button`,className:U(`inline-flex items-center gap-1.5 text-left transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset disabled:pointer-events-none disabled:opacity-60`,c&&`animate-pulse`),onClick:o,disabled:c,children:[(0,$.jsx)(W,{name:`arrow-down-s`,className:`size-4`}),(0,$.jsx)(`span`,{className:`typography-micro`,children:l(`sessions.sidebar.group.showMore`)})]}):null,t[6]=c,t[7]=o,t[8]=r,t[9]=l,t[10]=f):f=t[10];let p;return t[11]!==u||t[12]!==d||t[13]!==f?(p=(0,$.jsxs)(`div`,{className:`flex min-h-10 w-full items-center gap-3 py-1.5 pr-3 text-muted-foreground`,style:u,children:[d,f]}),t[11]=u,t[12]=d,t[13]=f,t[14]=p):p=t[14],p},hs=({open:e,onOpenChange:t,variant:n=`sheet`})=>{let{t:r}=tt(),{git:i}=ee(),a=Te(),o=me(),s=le(e=>e.activeSessions),c=le(e=>e.activePaginationByDirectory),l=he(e=>e.projects),u=Z.useMemo(()=>l.filter(e=>!e.hostId),[l]),d=l.some(e=>!!e.hostId),f=Qe(e&&d),p=f.catalog?.projects??[],m=he(e=>e.activeProjectId),h=D(e=>e.currentDirectory),g=J(e=>e.currentSessionId),_=J(e=>e.availableWorktreesByProject),v=J(e=>e.setCurrentSession),y=J(e=>e.archiveSession),b=J(e=>e.archiveSessions),x=J(e=>e.updateSessionTitle),S=J(e=>e.requestSessionSmartTitle),C=J(e=>e.shareSession),w=J(e=>e.unshareSession),T=J(e=>e.openNewSessionDraft),E=he(e=>e.setActiveProject),O=he(e=>e.setActiveProjectIdOnly),k=he(e=>e.removeProject),A=ke();Er();let j=Ne(e=>e.sessionOrderByScope),M=Ne(e=>e.sessionOrderActivityByScope),N=ge(),P=ni(e=>e.projectExpanded),F=ni(e=>e.worktreeExpanded),I=ni(e=>e.setProjectExpanded),te=ni(e=>e.setWorktreeExpanded),R=ce(e=>e.orderByProject),z=qo(e=>e.expandedParents),B=qo(e=>e.toggleParent),[ne,re]=Z.useState(``),[ie,ae]=Z.useState(null),[oe,V]=Z.useState(null),[se,G]=Z.useState(0),[de,fe]=Z.useState(!1),[pe,_e]=Z.useState(!1),[ve,ye]=Z.useState(null),[q,be]=Z.useState(null),Se=q?.kind===`session`?q.session:null,{unread:Ce,onToggleRead:we}=Wr(Se,Se?Qo(Se):void 0),[Ee,De]=Z.useState(null),[Oe,Ae]=Z.useState(null),[je,Me]=Z.useState(null),[Pe,Y]=Z.useState(``),[Fe,Ie]=Z.useState(!1),[Re,ze]=Z.useState(null),Be=Z.useRef(null);Be.current||=Yr({onPressedKeyChange:Ae});let[Ve,He]=Z.useState(new Set),[Ue,We]=Z.useState(new Map),[Ge,Ye]=Z.useState(new Map),Xe=Tr(),Ze=fi(),$e=L(e=>{zn(e),xe(e)}),et=L(e=>{Promise.all(e.map(e=>(zn(e),xe(e))))});Z.useEffect(()=>{if(!e){re(``),Ye(new Map),ae(null),V(null),be(null),Me(null),ze(null),Be.current?.reset();return}},[e]),Z.useEffect(()=>()=>{Be.current?.reset()},[]),Z.useEffect(()=>{if(!e)return;if(u.length===0){J.setState(e=>{let t=Fr(e.availableWorktreesByProject,new Set,[]);return t===e.availableWorktreesByProject?{}:{availableWorktreesByProject:t,availableWorktrees:[]}}),He(e=>e.size===0?e:new Set),We(e=>e.size===0?e:new Map);return}let t=!1;return(async()=>{let e=await Promise.all(u.map(async e=>{let n=Zo(e.path);if(!n)return null;let r;try{r=await i.checkIsGitRepository(n)}catch{return{id:e.id,path:n,gitStatus:`failed`}}if(!r)return{id:e.id,path:n,gitStatus:`success`,isGitRepo:r,worktreeStatus:`success`,worktrees:[]};let[a,o]=await Promise.allSettled([Un({id:e.id,path:n},{isCurrent:()=>!t}),Wn(n)]);return{id:e.id,path:n,gitStatus:`success`,isGitRepo:r,worktreeStatus:a.status===`fulfilled`?`success`:`failed`,worktrees:a.status===`fulfilled`?a.value.worktrees:void 0,rootBranchStatus:o.status===`fulfilled`?`success`:`failed`,rootBranch:o.status===`fulfilled`?o.value:void 0}}));if(t)return;let n=new Set(u.map(e=>Zo(e.path)).filter(Boolean)),r=e.flatMap(e=>e?.worktreeStatus?[{path:e.path,status:e.worktreeStatus,worktrees:e.worktrees}]:[]);J.setState(e=>{let t=Fr(e.availableWorktreesByProject,n,r);return t===e.availableWorktreesByProject?{}:{availableWorktreesByProject:t,availableWorktrees:Array.from(t.values()).flat()}}),He(t=>{let r=new Set([...t].filter(e=>n.has(e)));for(let t of e)t?.gitStatus===`success`&&(t.isGitRepo?r.add(t.path):r.delete(t.path));return ts(r,t)?t:r}),We(t=>{let n=new Set(u.map(e=>e.id)),r=new Map([...t].filter(([e])=>n.has(e)));for(let t of e){if(!t||t.gitStatus!==`success`)continue;if(!t.isGitRepo){r.delete(t.id);continue}if(t.rootBranchStatus!==`success`)continue;let e=t.rootBranch?.trim();e&&e!==`HEAD`?r.set(t.id,e):r.delete(t.id)}return r.size===t.size&&[...r].every(([e,n])=>t.get(e)===n)?t:r})})(),()=>{t=!0}},[i,e,u,se]);let nt=Z.useMemo(()=>u.map(e=>({id:e.id,label:$o(e.path),path:Zo(e.path),icon:e.icon,color:e.color,iconImage:e.iconImage,iconBackground:e.iconBackground,isGitRepo:Ve.has(Zo(e.path)),worktrees:K(R[e.id],_.get(Zo(e.path))??[])})),[Ve,u,R,_]),rt=Z.useMemo(()=>{let e=new Map(o.map(e=>[e.id,e])),t=s.map(t=>{let n=e.get(t.id);return n?Ke(n,t):t}),n=new Set(t.map(e=>e.id));for(let e of o)n.has(e.id)||t.push(e);return t},[s,o]),it=ne.trim().toLowerCase(),ot=Z.useMemo(()=>{let e=nt.map(e=>({project:e,buckets:[],totalSessions:0,isActive:e.id===m})),t=(e,t,n)=>{let r=Zo(t)||e.project.path,i=r||`__root__`,a=e.buckets.find(e=>e.key===i);return a||(a={key:i,label:n?.branch||$o(r),path:r,worktree:n,sessions:[]},e.buckets.push(a)),a};for(let n of e){t(n,n.project.path,null);for(let e of n.project.worktrees)t(n,e.path,e)}for(let n of rt){let r=Qo(n);if(!r)continue;let i=Zo(r),a=e.find(e=>as(e.project,i));if(!a)continue;let o=is(a.project,i);(o?t(a,o.path,o):t(a,a.project.path,null)).sessions.push(n)}for(let t of e)for(let e of t.buckets){let n=Zo(e.path),r=cr(e.sessions.map(e=>({session:e})),j[n],M[n],A);e.sessions.sort((e,t)=>r({session:e},{session:t}));for(let n of e.sessions)Xo(n)||(t.totalSessions+=1)}return e},[m,nt,rt,j,M,A]),st=Zo(h),ct=e=>e.isActive?st===e.project.path?e.project.path:e.project.worktrees.find(e=>rs(st,e.path))?.path??e.project.path:null,ut=e=>P[e.project.id]??!0,ft=(e,t)=>F[`${e.project.id}::${t.key}`]??!1,pt=e=>{Ye(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},mt=()=>{be(null),Be.current?.reset()},ht=e=>({onOpenActions:()=>be(e),pressed:Oe===e.key||q?.key===e.key,onPointerDown:t=>{e.kind!==`session`&&(t.pointerType!==`touch`&&t.pointerType!==`pen`||t.button!==0||Be.current?.start({pointerId:t.pointerId,key:e.key,clientX:t.clientX,clientY:t.clientY,onTrigger:()=>be(e)}))},onPointerMove:e=>{Be.current?.move(e.pointerId,e.clientX,e.clientY)},onPointerUp:e=>{Be.current?.end(e.pointerId)},onPointerCancel:e=>{Be.current?.cancel(e.pointerId)},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),e.kind!==`session`&&Be.current?.openFromContextMenu(e.key,()=>be(e))}}),gt=(e,t)=>{Be.current?.consumeClick(e)||t()},_t=(e,t,n,r)=>{let i=qr(),a=ui();if(Ye(t=>{let r=new Map(t),o=Math.max(i,t.get(e)??i,n);return r.set(e,o+a),r}),Math.max(i,n)+a<r)return;let o=Zo(t);if(!o)return;let s=le.getState().activePaginationByDirectory.get(o);s?.hasMore&&!s.loadingMore&&qe(o)},vt=(e,t,n)=>{let i=`${e.project.id}::${t.key}`,a=qr(),o=new Set(t.sessions.map(e=>e.id)),s=new Map;for(let e of t.sessions){let t=Xo(e);if(t&&o.has(t)){let n=s.get(t)??[];n.push(e),s.set(t,n)}}let l=t.sessions.filter(e=>!Xo(e)),u=Ge.get(i)??a,d=mi(l,u,Ze),f=l.length-d.length,p=c.get(Zo(t.path)),m=p?.hasMore===!0,h=p?.loadingMore===!0,_=l.length>a&&u>a,v=(e,t)=>{let n=s.get(e.id)??[],i=n.length>0,a=!!z[e.id],o=Xe.has(e.id),c=i&&!a?n.filter(e=>Xe.has(e.id)).map(e=>e.id):[],l=c.length>0,u=o?[e.id,...c]:c,d=e.title?.trim()||r(`mobile.sessions.untitled`),f=`session:${e.id}`;return(0,$.jsxs)(Z.Fragment,{children:[(0,$.jsx)(ps,{session:e,active:g===e.id,indent:t,hasChildren:i,expanded:a,onToggleChildren:i?()=>B(e.id):void 0,confirmingArchive:oe===e.id,onSelect:()=>gt(f,()=>xt(e)),onRequestArchive:()=>St(e.id),onConfirmArchive:()=>void Ct(e),onStop:o||l?()=>et(u):void 0,stopAriaLabel:r(l?`mobile.sessions.stopSubsessionsAria`:`mobile.sessions.stopSessionAria`,{title:d}),longPressHandlers:ht({key:f,kind:`session`,session:e})}),i&&a?n.map(e=>v(e,t+Yo)):null]},e.id)};return(0,$.jsxs)(`div`,{children:[l.length===0&&!m&&!h?(0,$.jsx)(`div`,{className:`py-1.5 pr-3 typography-ui-label font-normal text-muted-foreground/80`,style:{paddingLeft:n},children:r(`sessions.sidebar.group.empty.noSessionsInWorkspace`)}):null,(0,$.jsx)(Dr,{scopeKey:oe?null:Zo(t.path),sessionIds:d.map(e=>e.id),folderIdBySessionId:new Map(d.map(e=>[e.id,Ne.getState().getSessionFolderId(Zo(t.path),e.id)])),onSessionDroppedOnFolder:()=>{},onSessionsReordered:(e,n)=>{Ne.getState().reorderSessions(Zo(t.path),d.map(e=>e.id),e,n,wr(t.sessions)).catch(()=>X.error(r(`sessions.order.saveFailed`)))},children:d.map(e=>oe?v(e,n):(0,$.jsx)(mr,{sessionId:e.id,sessionDirectory:t.path,sessionTitle:e.title??``,children:v(e,n)},e.id))}),(0,$.jsx)(ms,{indent:n,showMore:f>0||m,showFewer:_,loadingMore:h,onShowMore:()=>_t(i,t.path,u,l.length),onShowFewer:()=>pt(i)})]})},yt=(e,t)=>{I(e,!t)},bt=(e,t,n)=>{te(`${e}::${t}`,!n)},xt=e=>{dt();let n=Qo(e)||null,r=os(nt,n??``);r&&O(r.id),v(e.id,n),t(!1)},St=e=>{V(t=>t===e?null:e)},Ct=async e=>{V(null),await y(e.id)?Br({sessionIds:[e.id],message:r(`sessions.sidebar.session.archive.success`),undoLabel:r(`sessions.sidebar.undo`),settingsLabel:r(`settings.yuri.archivedSessions.actions.view`),undoFailedMessage:r(`sessions.sidebar.session.archive.undoFailed`)}):X.error(r(`sessions.sidebar.session.archive.error`))},wt=()=>{T(),t(!1)},Tt=e=>{ye(e),O(e),_e(!0)},Et=e=>{let t=new Map;for(let e of rt){let n=Xo(e);if(!n)continue;let r=t.get(n)??[];r.push(e.id),t.set(n,r)}let n=[],r=new Set,i=e=>{if(!r.has(e)){r.add(e),n.push(e);for(let n of t.get(e)??[])i(n)}};return i(e),n},Dt=async e=>{let t=Et(e.id),{archivedIds:n,failedIds:i}=await b(t);n.length>0&&Br({sessionIds:n,message:n.length===1?r(`sessions.sidebar.session.archive.success`):r(`sessions.sidebar.bulkActions.archivedPlural`,{count:n.length}),undoLabel:r(`sessions.sidebar.undo`),settingsLabel:r(`settings.yuri.archivedSessions.actions.view`),undoFailedMessage:n.length===1?r(`sessions.sidebar.session.archive.undoFailed`):r(`sessions.sidebar.bulkActions.archiveUndoFailed`,{count:n.length})}),i.length>0&&X.error(i.length===1?r(`sessions.sidebar.bulkActions.failedArchiveSingle`,{count:i.length}):r(`sessions.sidebar.bulkActions.failedArchivePlural`,{count:i.length}))},Ot=e=>{let t=Et(e.id);Hr({sessionIds:t,message:t.length===1?r(`sessions.sidebar.session.delete.success`):r(`sessions.sidebar.bulkActions.deletedPlural`,{count:t.length}),undoLabel:r(`sessions.sidebar.undo`),commitFailedMessage:r(`sessions.sidebar.session.delete.error`)})},kt=async e=>{try{if(!(await C(e.id))?.share?.url){X.error(r(`sessions.sidebar.session.share.error`));return}X.success(r(`sessions.sidebar.session.share.successTitle`),{description:r(`sessions.sidebar.session.share.successDescription`)})}catch{X.error(r(`sessions.sidebar.session.share.error`))}},At=async e=>{if((await Le(e)).ok){X.success(r(`sessions.sidebar.session.menu.copied`));return}X.error(r(`sessions.sidebar.session.share.copyUrlError`))},jt=async e=>{try{if(await w(e)){X.success(r(`sessions.sidebar.session.unshare.success`));return}X.error(r(`sessions.sidebar.session.unshare.error`))}catch{X.error(r(`sessions.sidebar.session.unshare.error`))}},Mt=async()=>{if(!je)return;let e=Pe.trim();if(e)try{await x(je.id,e),Me(null),Y(``)}catch{X.error(r(`sessions.sidebar.session.menu.rename`),{description:r(`sessions.sidebar.dialogs.deleteResult.tryAgain`)})}},Nt=async()=>{if(!je||Fe)return;let e=je.id;Me(null),Y(``),Ie(!0);try{await S(e)}catch{X.error(r(`sessions.sidebar.session.rename.smartTitle`),{description:r(`sessions.sidebar.dialogs.deleteResult.tryAgain`)})}finally{Ie(!1)}},Pt=(e,n)=>{O(e.id),T({selectedProjectId:e.id,directoryOverride:n,preserveDirectoryOverride:!0}),t(!1)},Ft=e=>{(async()=>{try{await Un({id:e.id,path:e.path})}catch(e){console.warn(`[MobileSessions] Worktree refresh before session sync failed:`,e)}let t=J.getState().availableWorktreesByProject.get(e.path)??e.worktrees,n=[e.path,...t.map(e=>e.path)];await ue(n,rt)})()},It=e=>{let t=Qo(e),n=os(nt,t);if(!n)return $o(t)||t;let r=is(n,Zo(t));return r?.branch?`${n.label} · ${r.branch}`:n.label},Lt=e=>{E(e.id),t(!1)},Rt=Z.useMemo(()=>it?ot.filter(e=>`${e.project.label} ${e.project.path}`.toLowerCase().includes(it)?!0:e.buckets.some(t=>t.sessions.some(t=>ss(t,e.project.label,it)))):ot,[it,ot]),zt=Z.useMemo(()=>it?rt.filter(e=>{let t=Qo(e);return ss(e,os(nt,t)?.label??``,it)}).sort((e,t)=>Je(t)-Je(e)):[],[it,nt,rt]),Bt=Z.useMemo(()=>it?nt.filter(e=>`${e.label} ${e.path}`.toLowerCase().includes(it)).map(e=>({...e,sessionCount:rt.filter(t=>!Xo(t)&&as(e,Zo(Qo(t)))).length})):[],[it,nt,rt]),Vt=it&&zt.length===0&&Bt.length===0,Ht=nt.length>0?(0,$.jsxs)(H,{type:`button`,variant:`default`,size:`sm`,"aria-label":r(`mobile.sessions.newChat`),onClick:wt,style:{touchAction:`manipulation`},children:[(0,$.jsx)(W,{name:`add`,className:`size-4`}),r(`mobile.sessions.newChat`)]}):null,Wt=nt.find(e=>e.id===m)??null,Gt=Wt?.isGitRepo?(0,$.jsx)(H,{type:`button`,variant:`chip`,size:`sm`,"aria-label":r(`sessions.sidebar.project.actions.newWorktree`),title:r(`sessions.sidebar.project.actions.newWorktree`),onClick:()=>Tt(Wt.id),style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`node-tree`,className:`size-4`})}):null,Kt=(0,$.jsx)(H,{type:`button`,variant:`chip`,size:`sm`,"aria-label":r(`sessions.sidebar.header.actions.addProject`),title:r(`sessions.sidebar.header.actions.addProject`),onClick:()=>fe(!0),style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`folder-add`,className:`size-4`})}),qt=Ht||Kt?(0,$.jsxs)($.Fragment,{children:[Ht,Gt,Kt]}):null,Jt=q?.kind===`project`?q.project.label:q?.kind===`worktree`?q.worktree.branch||q.worktree.label||q.worktree.path:q?.kind===`session`?q.session.title?.trim()||r(`mobile.sessions.untitled`):``,Yt=Z.useMemo(()=>{if(!q)return[];if(q.kind===`project`){let e=q.project;return jr({gitRepository:e.isGitRepo,onNewSession:()=>{mt(),Pt(e,e.path)},onNewWorktree:()=>{mt(),Tt(e.id)},onSyncSessions:()=>{mt(),Ft(e)},onEditProject:()=>{mt(),ae(e.id)},onCloseProject:()=>{mt(),De(e)}})}if(q.kind===`worktree`){let{project:e,worktree:t}=q;return oi({onNewSession:()=>{mt(),Pt(e,t.path)},onDeleteWorktree:()=>{mt(),ze({project:e,worktree:t})}})}let e=q.session,t=!!e.share?.url;return $r({pinned:A.has(e.id),shared:t,unread:Ce,onToggleRead:we?()=>{mt(),we()}:void 0,onRename:()=>{mt(),Y(e.title?.trim()||r(`mobile.sessions.untitled`)),Me(e)},onTogglePin:()=>{mt(),N(e.id)},onShare:!a||t?void 0:()=>{mt(),kt(e)},onCopyLink:a&&t?()=>{let t=e.share?.url;mt(),t&&At(t)}:void 0,onUnshare:a&&t?()=>{mt(),jt(e.id)}:void 0,onArchive:()=>{mt(),Dt(e)},onDelete:()=>{mt(),Ot(e)}})},[q,Ce,mt,Dt,At,Ot,Tt,kt,jt,we,A,Pt,Ft,r,N]),Xt=Yt.length>0?(0,$.jsx)(`div`,{className:`flex flex-col gap-1`,children:Yt.map(e=>{let t=(0,$.jsx)(fs,{icon:e.icon,label:Nr(e,r),destructive:e.destructive,onClick:e.onClick},e.id);return e.separated?(0,$.jsx)(`div`,{className:q?.kind===`project`?`border-t border-[var(--yuri-popup-divider)]`:`mt-3 border-t border-[var(--surface-subtle)] pt-3`,children:t},e.id):t})}):null,Zt=(0,$.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,$.jsx)(`div`,{className:`shrink-0 px-4 pb-2 pt-1`,children:(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(W,{name:`search`,className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,$.jsx)(Ut,{value:ne,onChange:e=>re(e.target.value),placeholder:r(`mobile.sessions.search.placeholder`),className:U(`h-11 pl-9`,ne&&`pr-10`)}),ne?(0,$.jsx)(`button`,{type:`button`,className:`absolute right-1.5 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,"aria-label":r(`mobile.sessions.clearSearchAria`),onClick:()=>re(``),style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`close`,className:`size-4`})}):null]})}),(0,$.jsxs)(at,{className:`overlay-scrollbar-container min-h-0 flex-1 overflow-y-auto pb-4`,children:[d&&f.registry&&p.map(e=>(0,$.jsx)(Qr,{project:e,registry:f.registry,search:ne,mobile:!0,reorderEnabled:!1},e.id)),nt.length===0&&!d?(0,$.jsx)(gs,{title:r(`mobile.sessions.empty.noProjectsTitle`),description:r(`mobile.sessions.empty.noProjectsDescription`),action:(0,$.jsxs)(H,{type:`button`,size:`lg`,onClick:()=>fe(!0),children:[(0,$.jsx)(W,{name:`folder-add`,className:`size-4`}),r(`sessions.sidebar.header.actions.addProject`)]})}):Vt&&!d?(0,$.jsx)(gs,{title:r(`mobile.sessions.empty.searchTitle`),description:r(`mobile.sessions.empty.searchDescription`)}):it?(0,$.jsxs)(`div`,{className:`flex flex-col gap-3 px-3 pt-2`,children:[zt.length>0?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-1 pb-1.5`,children:[(0,$.jsx)(`span`,{className:`typography-micro font-semibold uppercase tracking-wider text-muted-foreground`,children:r(`mobile.sessions.search.section.sessions`)}),(0,$.jsx)(`span`,{className:`typography-micro text-muted-foreground tabular-nums`,children:zt.length})]}),(0,$.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/40 bg-[var(--surface-elevated)]`,children:zt.map((e,t)=>{let n=Xe.has(e.id),i=e.title?.trim()||r(`mobile.sessions.untitled`);return(0,$.jsx)(`div`,{className:U(t>0&&`border-t border-border/30`),children:(0,$.jsx)(ps,{session:e,active:g===e.id,indent:12,contextLabel:It(e),highlightQuery:it,onSelect:()=>gt(`session:${e.id}`,()=>xt(e)),longPressHandlers:ht({key:`session:${e.id}`,kind:`session`,session:e}),onStop:n?()=>$e(e.id):void 0,stopAriaLabel:r(`mobile.sessions.stopSessionAria`,{title:i})})},e.id)})})]}):null,Bt.length>0?(0,$.jsxs)(`section`,{children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between px-1 pb-1.5`,children:[(0,$.jsx)(`span`,{className:`typography-micro font-semibold uppercase tracking-wider text-muted-foreground`,children:r(`mobile.sessions.search.section.projects`)}),(0,$.jsx)(`span`,{className:`typography-micro text-muted-foreground tabular-nums`,children:Bt.length})]}),(0,$.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border/40 bg-[var(--surface-elevated)]`,children:Bt.map((e,t)=>{let n=`project:${e.id}`,r=ht({key:n,kind:`project`,project:e});return(0,$.jsxs)(`div`,{className:U(`flex items-center`,t>0&&`border-t border-border/30`),children:[(0,$.jsxs)(`button`,{type:`button`,className:U(`flex min-h-14 min-w-0 flex-1 items-center gap-3 px-3 py-2 text-left transition-all hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,r.pressed&&`bg-interactive-active scale-[0.99]`),onClick:()=>gt(n,()=>Lt(e)),onPointerDown:r.onPointerDown,onPointerMove:r.onPointerMove,onPointerUp:r.onPointerUp,onPointerCancel:r.onPointerCancel,onContextMenu:r.onContextMenu,style:{touchAction:`manipulation`},children:[(0,$.jsx)(cs,{project:e}),(0,$.jsx)(`span`,{className:`block min-w-0 flex-1 truncate typography-ui-label text-foreground`,children:An(e.label,it)}),(0,$.jsx)(`span`,{className:`shrink-0 typography-micro text-muted-foreground tabular-nums`,children:e.sessionCount})]}),e.isGitRepo?(0,$.jsx)(ds,{className:`mr-2`,onClick:()=>Tt(e.id)}):null]},e.id)})})]}):null]}):(0,$.jsx)(`div`,{className:`flex flex-col`,children:Rt.map((e,t)=>{let n=ut(e),i=`project:${e.project.id}`,a=ht({key:i,kind:`project`,project:e.project}),o=it?e.buckets.filter(t=>t.sessions.some(t=>ss(t,e.project.label,it))):e.buckets,s=ct(e);return(0,$.jsxs)(`section`,{className:U(t>0&&`border-t border-border/30`),children:[(0,$.jsxs)(`div`,{className:`flex min-h-14 w-full items-center`,children:[(0,$.jsxs)(`button`,{type:`button`,className:U(`flex min-h-14 min-w-0 flex-1 items-center gap-2 px-3 py-2 text-left transition-all hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,a.pressed&&`bg-interactive-active scale-[0.99]`),onClick:()=>gt(i,()=>yt(e.project.id,n)),onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.onPointerUp,onPointerCancel:a.onPointerCancel,onContextMenu:a.onContextMenu,"aria-expanded":n,"aria-label":r(n?`sessions.sidebar.group.collapseAria`:`sessions.sidebar.group.expandAria`,{label:e.project.label}),style:{touchAction:`manipulation`},children:[(0,$.jsx)(cs,{project:e.project}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,$.jsx)(`span`,{className:`block truncate typography-ui-label font-semibold text-foreground`,children:e.project.label}),Ue.get(e.project.id)?(0,$.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 typography-micro text-muted-foreground`,children:[(0,$.jsx)(W,{name:`git-branch`,className:`size-3 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:Ue.get(e.project.id)})]}):null]}),e.isActive?(0,$.jsx)(us,{ariaLabel:r(`mobile.sessions.activeProjectAria`)}):null,(0,$.jsx)(`span`,{className:`shrink-0 typography-micro text-muted-foreground tabular-nums`,children:e.totalSessions})]}),(()=>{let t=n?[]:[...new Set(e.buckets.flatMap(e=>e.sessions.filter(e=>Xe.has(e.id)).map(e=>e.id)))];return t.length>0?(0,$.jsx)(`button`,{type:`button`,className:`flex size-9 shrink-0 items-center justify-center rounded-full text-[var(--surface-mutedForeground)] transition-colors hover:bg-[var(--interactive-hover)] hover:text-[var(--surface-foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] mr-1`,"aria-label":r(`mobile.sessions.stopGroupAria`,{label:e.project.label}),onClick:e=>{e.stopPropagation(),et(t)},style:{touchAction:`manipulation`},children:(0,$.jsx)(kr,{})}):null})(),e.project.isGitRepo?(0,$.jsx)(ds,{className:`mr-2`,onClick:()=>Tt(e.project.id)}):null]}),n?(0,$.jsx)(`div`,{className:`pb-2`,children:(()=>{let t=o.find(e=>e.worktree===null),n=o.filter(e=>e.worktree!==null);return(0,$.jsxs)($.Fragment,{children:[t&&(t.sessions.length>0||n.length===0)?vt(e,t,Jo):null,n.map(t=>{let n=ft(e,t),i=s===t.path,a=`worktree:${e.project.id}:${t.key}`,o=ht({key:a,kind:`worktree`,project:e.project,worktree:t.worktree});return(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(`button`,{type:`button`,className:U(`flex min-h-11 w-full items-center gap-2 py-1.5 pl-4 pr-3 text-left transition-all hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,o.pressed&&`bg-interactive-active scale-[0.99]`),onClick:()=>gt(a,()=>bt(e.project.id,t.key,n)),onPointerDown:o.onPointerDown,onPointerMove:o.onPointerMove,onPointerUp:o.onPointerUp,onPointerCancel:o.onPointerCancel,onContextMenu:o.onContextMenu,"aria-expanded":n,"aria-label":r(n?`sessions.sidebar.group.collapseAria`:`sessions.sidebar.group.expandAria`,{label:t.label}),style:{touchAction:`manipulation`},children:[(0,$.jsx)(ls,{expanded:n}),(0,$.jsx)(W,{name:`node-tree`,className:U(`size-4 shrink-0`,i?`text-primary`:`text-muted-foreground`)}),(0,$.jsx)(`span`,{className:U(`block min-w-0 flex-1 truncate typography-ui-label font-semibold`,i?`text-foreground`:`text-foreground/90`),children:t.label}),i?(0,$.jsx)(us,{ariaLabel:r(`mobile.sessions.activeWorktreeAria`)}):null,(()=>{let e=n?[]:t.sessions.filter(e=>Xe.has(e.id)).map(e=>e.id);return e.length>0?(0,$.jsx)(`button`,{type:`button`,className:`flex size-9 shrink-0 items-center justify-center rounded-full text-[var(--surface-mutedForeground)] transition-colors hover:bg-[var(--interactive-hover)] hover:text-[var(--surface-foreground)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)]`,"aria-label":r(`mobile.sessions.stopGroupAria`,{label:t.label}),onClick:t=>{t.stopPropagation(),et(e)},style:{touchAction:`manipulation`},children:(0,$.jsx)(kr,{})}):null})(),(0,$.jsx)(`span`,{className:`shrink-0 typography-micro text-muted-foreground tabular-nums`,children:t.sessions.length})]}),n?vt(e,t,Jo):null]},t.key)})]})})()}):null]},e.project.id)})})]}),(0,$.jsx)(Or,{open:de,onOpenChange:fe,forceMobile:!0}),(0,$.jsx)(Fn,{open:pe,projectId:ve,onOpenChange:e=>{_e(e),e||ye(null)},onWorktreeCreated:(e,n)=>{n?.sessionId?v(n.sessionId,e):T({selectedProjectId:ve,directoryOverride:e,preserveDirectoryOverride:!0}),t(!1)}}),(0,$.jsx)(Bn,{open:!!q,title:Jt,onClose:mt,contentMaxHeightClassName:`max-h-[min(68dvh,560px)]`,children:Xt}),(0,$.jsx)(Bn,{open:!!Ee,title:r(`sessions.sidebar.project.actions.closeProject`),onClose:()=>De(null),closeAriaLabel:r(`mobile.surface.closeAria`),footer:(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(H,{type:`button`,variant:`ghost`,className:`flex-1`,onClick:()=>De(null),children:r(`sessions.sidebar.dialogs.cancel`)}),(0,$.jsx)(H,{type:`button`,variant:`destructive`,className:`flex-1`,onClick:()=>{if(!Ee)return;let e=Ee;De(null),k(e.id),X.success(r(`mobile.sessions.toast.projectRemoved`,{label:e.label}))},children:r(`mobile.sessions.confirmRemoveProject`)})]}),children:(0,$.jsx)(`p`,{className:`px-1 py-1 typography-ui-body text-foreground`,children:r(`mobile.projects.closeConfirmMessage`,{title:Ee?.label??``})})}),(0,$.jsx)(Bn,{open:!!je,title:r(`sessions.sidebar.session.menu.rename`),onClose:()=>{Fe||(Me(null),Y(``))},footer:(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,$.jsx)(H,{type:`button`,variant:`default`,className:`flex-1`,disabled:Fe,onClick:()=>{Me(null),Y(``)},children:r(`sessions.sidebar.dialogs.cancel`)}),(0,$.jsx)(H,{type:`button`,variant:`default`,className:`flex-1`,disabled:!Pe.trim()||Fe,onClick:()=>void Mt(),children:r(`sessions.sidebar.session.rename.save`)})]}),children:(0,$.jsxs)(`form`,{className:`flex flex-col gap-3 px-1 py-1`,onSubmit:e=>{e.preventDefault(),Mt()},children:[(0,$.jsx)(Ut,{value:Pe,onChange:e=>Y(e.target.value),autoFocus:!0,className:`h-12`,disabled:Fe}),(0,$.jsxs)(H,{type:`button`,variant:`outline`,className:`w-full gap-2`,disabled:Fe,onClick:()=>void Nt(),children:[Fe?(0,$.jsx)(W,{name:`loader-4`,className:`size-4 animate-spin`}):(0,$.jsx)(W,{name:`ai-generate-2`,className:`size-4`}),r(`sessions.sidebar.session.rename.smartTitle`)]})]})}),Re?(0,$.jsx)(ti,{open:!0,project:{id:Re.project.id,path:Re.project.path},worktree:Re.worktree,onClose:()=>ze(null),onDeleted:()=>G(e=>e+1)}):null,(0,$.jsx)(Rr,{open:ie!==null,project:nt.find(e=>e.id===ie)??null,onClose:()=>ae(null),onWorktreesChanged:()=>G(e=>e+1)})]});return n===`sidebar`?e?(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,$.jsx)(`div`,{className:`flex h-[var(--yuri-header-height,56px)] shrink-0 items-center justify-end gap-2 px-4`,children:qt?(0,$.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:qt}):null}),Zt]}):null:(0,$.jsx)(lt,{id:`mobile-sessions-sheet`,open:e,onOpenChange:t,trailing:qt,ariaLabel:r(`mobile.sessions.sheet.title`),closeAriaLabel:r(`mobile.surface.closeAria`),resizeAriaLabel:r(`mobile.sessions.sheet.resizeAria`),initiallyExpanded:!0,children:Zt})},gs=e=>{let t=(0,Q.c)(10),{title:n,description:r,action:i}=e,a;t[0]===n?a=t[1]:(a=(0,$.jsx)(`p`,{className:`typography-ui-label text-foreground`,children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=r?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:r}):null,t[2]=r,t[3]=o);let s;t[4]===i?s=t[5]:(s=i?(0,$.jsx)(`div`,{className:`pt-2`,children:i}):null,t[4]=i,t[5]=s);let c;return t[6]!==a||t[7]!==o||t[8]!==s?(c=(0,$.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-6 text-center`,children:[a,o,s]}),t[6]=a,t[7]=o,t[8]=s,t[9]=c):c=t[9],c},_s=[{id:`projects`,icon:`folder-open`,labelKey:`mobile.tabs.projects`},{id:`assistant`,icon:`sparkling`,labelKey:`mobile.tabs.assistant`},{id:`scheduled`,icon:`calendar-schedule`,labelKey:`mobile.tabs.scheduled`},{id:`settings`,icon:`settings-3`,labelKey:`mobile.tabs.settings`}];function vs(e){let t=(0,Q.c)(23),{activeTab:n,onTabChange:r,className:i,tabMarks:a,homeView:o}=e,s=o===void 0?`projects`:o,{t:c}=tt(),l=on(),u;t[0]===c?u=t[1]:(u=c(`mobile.tabs.activity.loading`),t[0]=c,t[1]=u);let d=u,f;t[2]===r?f=t[3]:(f=e=>{r(e.currentTarget.dataset.tab)},t[2]=r,t[3]=f);let p=L(f),m;t[4]!==n||t[5]!==r?(m=e=>{if(![`ArrowLeft`,`ArrowRight`,`Home`,`End`].includes(e.key))return;e.preventDefault();let t=_s.findIndex(e=>e.id===n),i=_s[e.key===`Home`?0:e.key===`End`?_s.length-1:(t+(e.key===`ArrowRight`?1:-1)+_s.length)%_s.length];r(i.id),document.getElementById(`mobile-tab-${i.id}`)?.focus()},t[4]=n,t[5]=r,t[6]=m):m=t[6];let h=L(m),g;t[7]===c?g=t[8]:(g=c(`mobile.nav.aria`),t[7]=c,t[8]=g);let _;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_={role:`tablist`},t[9]=_):_=t[9];let v;t[10]!==n||t[11]!==l||t[12]!==p||t[13]!==h||t[14]!==s||t[15]!==d||t[16]!==c||t[17]!==a?(v=_s.map(e=>{let t=e.id===n,r=c(e.labelKey),i=e.id===`assistant`&&l>0,o=!i&&a?.[e.id]===`loading`,u=i?`mobile-tab-assistant-unread`:o?`mobile-tab-${e.id}-activity`:void 0;return(0,$.jsxs)(H,{id:`mobile-tab-${e.id}`,"data-tab":e.id,type:`button`,role:`tab`,variant:`ghost`,size:`sm`,"aria-controls":`mobile-tabpanel-${e.id}`,"aria-label":r,"aria-describedby":u,"aria-selected":t,tabIndex:t?0:-1,title:r,onClick:p,onKeyDown:h,className:U(`yuri-mobile-tab-button min-w-0 flex-1 flex-col overflow-visible`,`font-medium leading-none tracking-tight text-muted-foreground`,`transition-[background-color,color,box-shadow,transform] duration-100`,`hover:bg-transparent hover:text-foreground`,`active:bg-interactive-active`,`motion-reduce:transition-none`,t&&[`bg-interactive-selection/55 text-primary`,`hover:bg-interactive-selection/55 hover:text-primary`,`font-semibold`]),children:[(0,$.jsxs)(`span`,{className:`relative inline-flex size-[23px] shrink-0 items-center justify-center overflow-visible`,children:[e.id===`assistant`?(0,$.jsx)(Ar,{size:23,className:`size-[23px] shrink-0 items-center justify-center [&[data-assistant-navigation-avatar]]:scale-105`}):(0,$.jsx)(W,{name:e.id===`projects`?s===`tasks`?`list-check-2`:`folder-tree`:e.icon,weight:`medium`,className:`size-[23px] shrink-0`}),u?(0,$.jsx)(`span`,{id:u,role:o?`status`:void 0,"aria-label":o?d:void 0,"data-mobile-tab-activity":o?`loading`:void 0,className:`pointer-events-none absolute left-full -top-1 ml-0.5 inline-flex z-10`,children:i?(0,$.jsx)(Hi,{className:`h-[18px] min-w-[18px] px-1 text-[11px] font-bold tracking-normal ring-2 ring-background`}):(0,$.jsx)(`span`,{className:`inline-flex size-[18px] items-center justify-center rounded-full bg-foreground text-background ring-2 ring-background`,children:(0,$.jsx)(W,{name:`loader-4`,className:`size-3 animate-spin`})})}):null]}),(0,$.jsx)(`span`,{className:`yuri-mobile-tab-label block max-w-full overflow-hidden text-ellipsis whitespace-nowrap`,children:r})]},e.id)}),t[10]=n,t[11]=l,t[12]=p,t[13]=h,t[14]=s,t[15]=d,t[16]=c,t[17]=a,t[18]=v):v=t[18];let y;return t[19]!==i||t[20]!==g||t[21]!==v?(y=(0,$.jsx)(Vi,{as:`nav`,"aria-label":g,variant:`navigation`,surfaceProps:_,className:i,children:v}),t[19]=i,t[20]=g,t[21]=v,t[22]=y):y=t[22],y}function ys(e){return e.unreadCount>0?`unread`:e.working?`loading`:null}var bs=`yuri-native-ios-tab-bar`,xs=`YuriTabBar`,Ss=[`projects`,`assistant`,`scheduled`,`settings`],Cs=te(xs),ws=e=>e.isCapacitor&&e.platform===`ios`&&e.pluginAvailable&&e.nativeUiEnabled!==!1;function Ts(){return typeof window>`u`?!1:ws({isCapacitor:g(),platform:y(),pluginAvailable:R.isPluginAvailable(xs),nativeUiEnabled:Mt()})}var Es=e=>e.classList.contains(`dark`)?`dark`:`light`,Ds=()=>Nt(`--primary`),Os=e=>typeof e==`string`&&Ss.includes(e),ks=e=>typeof e==`string`&&Os(e)?e:null,As=(e,t)=>e.selectedTab===t.selectedTab&&e.appearance===t.appearance&&e.ariaLabel===t.ariaLabel&&e.accentColor===t.accentColor&&e.tabs.length===t.tabs.length&&e.tabs.every((e,n)=>e.id===t.tabs[n]?.id&&e.label===t.tabs[n]?.label&&e.badge===t.tabs[n]?.badge&&e.activity===!0==(t.tabs[n]?.activity===!0)&&(e.activity===!0?e.activityLabel??null:null)===(t.tabs[n]?.activity===!0?t.tabs[n]?.activityLabel??null:null)),js=(e,t)=>{e.classList.toggle(bs,t)},Ms=(e,t)=>e&&!t,Ns=e=>e.visible?e.overlayHidden?{action:`present`}:e.lastState&&As(e.lastState,e.nextState)?{action:`skip`}:{action:`present`}:e.overlayHidden?{action:`skip`}:{action:`hide`},Ps=()=>Cs,Fs=`mobile-overlay-root`;function Is(e){let t=(0,Q.c)(28),n=Ft(),r;t[0]===n?r=t[1]:(r=n&&Ts(),t[0]=n,t[1]=r);let i=r,[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),d=(0,Z.useRef)(null),f=(0,Z.useRef)(!1),p=(0,Z.useRef)(!1),m=L(e.onTabChange),h;t[2]===e.tabs?h=t[3]:(h=JSON.stringify(e.tabs.map(Rs)),t[2]=e.tabs,t[3]=h);let g=h,_;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(_=typeof document>`u`?`dark`:Es(document.documentElement),t[4]=_):_=t[4];let v=_,y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=typeof document>`u`?``:Ds(),t[5]=y):y=t[5];let b=y,x,S;t[6]===i?(x=t[7],S=t[8]):(x=()=>{if(!i||typeof document>`u`)return;let e=document.getElementById(Fs);e||(e=document.createElement(`div`),e.id=Fs,document.body.appendChild(e));let t=()=>u(Pn(e.children));t();let n=new MutationObserver(t);return n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[Nn]}),()=>n.disconnect()},S=[i],t[6]=i,t[7]=x,t[8]=S),(0,Z.useEffect)(x,S);let C;t[9]!==i||t[10]!==m?(C=()=>{if(!i)return;let e=!1,t=Ps(),n=[];return t.addListener(`tabSelected`,e=>{let t=ks(e.tab);t&&m(t)}).then(t=>{if(e){t.remove();return}n.push(t)}),()=>{e=!0,d.current=null,t.hide();for(let e of n)e.remove();typeof document<`u`&&js(document.documentElement,!1)}},t[9]=i,t[10]=m,t[11]=C):C=t[11];let w;t[12]===i?w=t[13]:(w=[i],t[12]=i,t[13]=w),(0,Z.useEffect)(C,w);let T;t[14]!==e.activeTab||t[15]!==e.ariaLabel||t[16]!==e.tabs||t[17]!==e.visible||t[18]!==i||t[19]!==l?(T=()=>{if(!i||p.current)return;let t=!1,n=Ps(),r={tabs:e.tabs.map(Ls),selectedTab:e.activeTab,appearance:v,accentColor:b,ariaLabel:e.ariaLabel},a=Ns({visible:Ms(e.visible,l),overlayHidden:f.current,lastState:d.current,nextState:r});return(async()=>{if(a.action===`skip`)return;if(a.action===`hide`){f.current=!0,n.hide();return}let e=await n.present(r);if(!t){if(e.adopted!==!0){p.current=!0,c(!0),o(!1),typeof document<`u`&&js(document.documentElement,!1);return}f.current=!1,d.current=r,o(!0),typeof document<`u`&&js(document.documentElement,!0)}})().catch(()=>{t||(p.current=!0,c(!0),o(!1),typeof document<`u`&&js(document.documentElement,!1))}),()=>{t=!0}},t[14]=e.activeTab,t[15]=e.ariaLabel,t[16]=e.tabs,t[17]=e.visible,t[18]=i,t[19]=l,t[20]=T):T=t[20];let E;return t[21]!==e.activeTab||t[22]!==e.ariaLabel||t[23]!==e.visible||t[24]!==i||t[25]!==l||t[26]!==g?(E=[i,e.visible,l,e.activeTab,e.ariaLabel,v,b,g],t[21]=e.activeTab,t[22]=e.ariaLabel,t[23]=e.visible,t[24]=i,t[25]=l,t[26]=g,t[27]=E):E=t[27],(0,Z.useLayoutEffect)(T,E),!i||s?`web`:a?`native`:`pending`}function Ls(e){return{id:e.id,label:e.label,badge:e.badge??null,activity:e.activity===!0,activityLabel:e.activity===!0?e.activityLabel??null:null}}function Rs(e){return[e.id,e.label,e.badge??null,e.activity===!0,e.activity===!0?e.activityLabel??null:null]}function zs(e){let t=(0,Q.c)(52),{homeView:n,tabs:r,navigation:i,onTabChange:a,secondaryPages:o,showTabBar:s,tabBarCovered:c,className:l}=e,u=n===void 0?`projects`:n,d=o===void 0?[]:o,f=s===void 0||s,p=c!==void 0&&c,{t:m}=tt(),h=i.activeTab,g=d.slice(-2),_=g.at(-1)??null,v=_?.key??null,y=_?.depth,b=g.length>1?g[g.length-2].key:null,x;t[0]===h?x=t[1]:(x=()=>new Set([h]),t[0]=h,t[1]=x);let[S,C]=Z.useState(x);S.has(h)||C(e=>{if(e.has(h))return e;let t=new Set(e);return t.add(h),t});let w=Z.useRef(null),T=Z.useRef(null),E=Z.useRef(null),D=Z.useRef(new Map),O=Z.useRef(null),k=Z.useRef(!1),A=Z.useRef(``),j=L(()=>_?.onBack());It({id:_?`mobile-secondary:${_.key}`:`mobile-secondary:inactive`,active:!!_,onBack:j,surfaceRef:w,underlayRef:T}),Z.useLayoutEffect(()=>{let e=v===null?null:D.current.get(v)??null,t=b===null?E.current:D.current.get(b)??null;w.current=e,T.current=t},[v,y,b]);let M;t[2]===_?M=t[3]:(M=[_],t[2]=_,t[3]=M),Z.useLayoutEffect(()=>{if(_){if(!k.current){let e=document.activeElement;O.current=e instanceof HTMLElement?e:null,k.current=!0}A.current!==_.key&&(A.current=_.key,w.current?.focus());return}if(k.current){k.current=!1,A.current=``;let e=O.current;O.current=null,e&&e.isConnected&&e.focus()}},M);let N;t[4]===a?N=t[5]:(N=e=>{a(e)},t[4]=a,t[5]=N);let ee=L(N),P=on(),F=cn(),I=sn(),te;t[6]===m?te=t[7]:(te=m(`mobile.tabs.activity.loading`),t[6]=m,t[7]=te);let R=te,z;t[8]!==P||t[9]!==F?(z=ys({unreadCount:P,working:F}),t[8]=P,t[9]=F,t[10]=z):z=t[10];let B=z,ne;t[11]===I?ne=t[12]:(ne=ys({unreadCount:0,working:I}),t[11]=I,t[12]=ne);let re=ne,ie;t[13]!==B||t[14]!==P||t[15]!==R||t[16]!==re||t[17]!==m?(ie=_s.map(e=>{let t=e.id===`assistant`&&B===`loading`||e.id===`scheduled`&&re===`loading`;return{id:e.id,label:m(e.labelKey),badge:e.id===`assistant`&&B===`unread`?P>99?`99+`:String(P):null,activity:t,activityLabel:t?R:null}}),t[13]=B,t[14]=P,t[15]=R,t[16]=re,t[17]=m,t[18]=ie):ie=t[18];let ae=ie,oe=f&&!p&&!_,V;t[19]===m?V=t[20]:(V=m(`mobile.nav.aria`),t[19]=m,t[20]=V);let H;t[21]!==ee||t[22]!==oe||t[23]!==ae||t[24]!==h||t[25]!==V?(H={visible:oe,activeTab:h,tabs:ae,ariaLabel:V,onTabChange:ee},t[21]=ee,t[22]=oe,t[23]=ae,t[24]=h,t[25]=V,t[26]=H):H=t[26];let W=Is(H),se=W===`native`,G=f&&W===`web`,ce=Ft(),le,ue;t[27]!==ce||t[28]!==se?(le=()=>{if(!ce){Pt.shutdown();return}se&&Lt(!0)&&Pt.warm()},ue=[ce,se],t[27]=ce,t[28]=se,t[29]=le,t[30]=ue):(le=t[29],ue=t[30]),Z.useEffect(le,ue);let de=h===`assistant`&&`yuri-assistant-wallpaper`,fe;t[31]!==l||t[32]!==de?(fe=U(`yuri-mobile-floating-shell relative isolate flex h-full min-h-0 flex-col overflow-hidden text-foreground`,`bg-[var(--yuri-mobile-page-background)]`,de,l),t[31]=l,t[32]=de,t[33]=fe):fe=t[33];let pe=_?!0:void 0,me=_?!0:void 0,he=_?`true`:void 0,ge;t[34]!==h||t[35]!==f||t[36]!==G||t[37]!==m||t[38]!==r||t[39]!==S?(ge=_s.map(e=>{let t=S.has(e.id);return(0,$.jsx)(`section`,{id:`mobile-tabpanel-${e.id}`,role:`tabpanel`,"aria-labelledby":G?`mobile-tab-${e.id}`:void 0,"aria-label":G?void 0:m(e.labelKey),hidden:h!==e.id,tabIndex:0,className:U(`scrollbar-none h-full min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain px-[var(--yuri-mobile-page-inline-inset)] pt-[calc(var(--safe-area-inset-top,env(safe-area-inset-top,0px))+1rem)] outline-none`,f?`pb-[calc(var(--yuri-mobile-dock-height)+2.5rem+var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px)))]`:`pb-0`),children:t?(0,$.jsx)(Z.Suspense,{fallback:null,children:r?.[e.id]??(0,$.jsx)(Bs,{tab:e.id,icon:e.icon})}):null},e.id)}),t[34]=h,t[35]=f,t[36]=G,t[37]=m,t[38]=r,t[39]=S,t[40]=ge):ge=t[40];let _e=f?(0,$.jsx)(`div`,{"data-mobile-navigation-dock-underlay":`true`,"aria-hidden":_||se?!0:void 0,inert:_||se?!0:void 0,children:G?(0,$.jsx)(vs,{activeTab:h,homeView:u,onTabChange:ee,tabMarks:{assistant:B===`loading`?`loading`:null,scheduled:re===`loading`?`loading`:null}}):null}):null,ve;t[41]!==E||t[42]!==pe||t[43]!==me||t[44]!==he||t[45]!==ge||t[46]!==_e?(ve=(0,$.jsxs)(`div`,{ref:E,"data-mobile-navigation-underlay":`true`,"aria-hidden":pe,inert:me,"data-mobile-navigation-parked":he,className:`flex h-full min-h-0 flex-1 flex-col`,children:[ge,_e]}),t[41]=E,t[42]=pe,t[43]=me,t[44]=he,t[45]=ge,t[46]=_e,t[47]=ve):ve=t[47];let K=g.map((e,t)=>{let n=t===g.length-1;return(0,$.jsx)(`div`,{ref:t=>{t?D.current.set(e.key,t):D.current.delete(e.key)},"data-mobile-secondary-page":`true`,"data-mobile-secondary-active":n?`true`:`false`,role:n?`dialog`:void 0,"aria-modal":n?!0:void 0,"aria-label":n?e.ariaLabel??m(`mobile.nav.secondaryPageAria`):void 0,"aria-hidden":!n||void 0,inert:!n||void 0,tabIndex:n?-1:void 0,className:U(`absolute inset-0 flex h-full min-h-0 flex-col overflow-hidden bg-background outline-none`,n?`z-50`:`z-40`),children:(0,$.jsx)(Z.Suspense,{fallback:null,children:e.content})},e.key)}),ye;return t[48]!==fe||t[49]!==ve||t[50]!==K?(ye=(0,$.jsxs)(`div`,{className:fe,children:[ve,K]}),t[48]=fe,t[49]=ve,t[50]=K,t[51]=ye):ye=t[51],ye}function Bs(e){let t=(0,Q.c)(17),{tab:n,icon:r,className:i}=e,{t:a}=tt(),o,s,c,l;if(t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==n){let e=_s.find(e=>e.id===n)??_s[0];t[8]===i?c=t[9]:(c=U(`flex min-h-[70dvh] flex-col items-center justify-center gap-3 text-center`,i),t[8]=i,t[9]=c),l=(0,$.jsx)(`span`,{className:`flex size-12 items-center justify-center rounded-2xl bg-[var(--surface-muted)] text-muted-foreground`,children:(0,$.jsx)(W,{name:r??e.icon,className:`size-6`})}),o=`typography-ui-label font-semibold tracking-[-0.01em] text-foreground`,s=a(e.labelKey),t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else o=t[4],s=t[5],c=t[6],l=t[7];let u;t[10]!==o||t[11]!==s?(u=(0,$.jsx)(`h1`,{className:o,children:s}),t[10]=o,t[11]=s,t[12]=u):u=t[12];let d;return t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,$.jsxs)(`div`,{className:c,children:[l,u]}),t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}var Vs=(e,t)=>e.id===t.id&&e.title===t.title&&e.directory===t.directory&&e.projectLabel===t.projectLabel&&e.project===t.project&&e.branch===t.branch&&e.activityLabel===t.activityLabel&&e.unread===t.unread&&e.pinned===t.pinned&&e.active===t.active,Hs=[],Us=(e,t,n)=>{let r=(e??t)?.trim();return r&&r!==`HEAD`&&r!==n?r:void 0};function Ws(e,t){let{enabled:n,settledLimit:r}=t,{t:i}=tt(),a=ke(),o=Ur(),s=Tr({enabled:n}),c=Ve(),l=fe(e=>e.index.session.unseenCount),u=Ne(e=>e.sessionOrderByScope[vr]),d=he(e=>e.projects),f=J(e=>e.currentSessionId),p=hi(s,n),m=Z.useRef(new Map),{git:h}=ee(),g=jt(e=>e.ensureStatus),_=Z.useMemo(()=>n?[...e.projectMetaById.values()].map(e=>e.path):Hs,[n,e.projectMetaById]),v=Ot(_);return Z.useEffect(()=>{if(!(!n||!h))for(let e of _)g(e,h)},[n,g,h,_]),Z.useMemo(()=>{if(!n)return null;let t=pi({sessions:e.allSessions,pinnedSessionIds:a,settledSessionIds:o,runningSessionIds:s,pendingRequestSessionIds:c,unseenBySession:l}),h=xr(e.allSessions,a,u).filter(Cr),g=new Map(d.map(e=>[e.id,e.color??void 0])),_=i(`mobile.sessions.untitled`),y=i(`sessions.sidebar.task.unassigned`),b=m.current,x=new Map,S=(t,n)=>{let r=e.ownership.bySessionId.get(t.id),i=r?e.projectMetaById.get(r.projectId):void 0,a=i&&r?.kind===`worktree`?ai(i,r.scopeDirectory):null,o={id:t.id,title:t.title?.trim()||_,directory:li(t),projectLabel:i?.label||y,project:i?{id:i.id,icon:i.icon??void 0,color:g.get(i.id),iconImage:i.iconImage??void 0}:null,branch:Us(a?.branch,i?v.get(i.path)?.branch:null,i?.label),activityLabel:Mr(Pr(t))||void 0,unread:(l[t.id]??0)>0,pinned:n,active:f===t.id},s=b.get(t.id),c=s&&Vs(s,o)&&s.project?.iconImage===o.project?.iconImage?s:o;return x.set(t.id,c),c},C={pinned:h.map(e=>S(e,!0)),active:t.active.map(e=>S(e,!1)),settled:t.settled.slice(0,r).map(e=>S(e,!1)),settledTotal:t.settled.length,settledIds:o,runStartTimes:p};return m.current=x,C},[f,n,v,e.allSessions,e.ownership,e.projectMetaById,c,u,a,d,p,s,o,r,i,l])}var Gs=(e,t,n)=>e?.kind===`project`&&e.project.id===t?{...e,isGitRepository:n}:e;function Ks({homeView:e,onHomeViewChange:t,onOpenChat:n,onAddProject:r,onNewSession:i,onScanQr:a,onSwitchInstance:o,onRemoteDesktop:s,instanceOptions:c,className:l}){let{t:u}=tt(),{git:d}=ee(),f=Te(),p=Jr(),[m,g]=Z.useState(()=>new Map),_=L((e,t)=>{g(n=>{if(!t.length&&!n.has(e))return n;let r=new Map(n);return t.length?r.set(e,t):r.delete(e),r})}),v=L((e,t,n,r)=>{let i=Ne.getState(),a=e===`__pinned__`?e:h(e);if(!a||a!==`__pinned__`&&i.getSessionFolderId(a,n)!==i.getSessionFolderId(a,r))return;let o=a===`__pinned__`?{}:wr(p.allSessions.filter(e=>li(e)===a));i.reorderSessions(a,t,n,r,o).catch(()=>X.error(u(`sessions.order.saveFailed`)))}),y=ni(e=>e.setProjectExpanded),b=ni(e=>e.setWorktreeExpanded),x=ge(),S=ri(),[C,w]=Z.useState(!1),[T,E]=Z.useState(30),D=Ws(p,{enabled:e===`tasks`,settledLimit:T}),O=L(e=>{w(e),e||E(30)}),k=L(()=>E(e=>e+30)),A=L(e=>{S(e,!1)}),j=ke(),M=J(e=>e.archiveSessions),N=J(e=>e.updateSessionTitle),P=J(e=>e.requestSessionSmartTitle),F=J(e=>e.shareSession),I=J(e=>e.unshareSession),te=J(e=>e.openNewSessionDraft),R=G(e=>e.openDraft),z=G(e=>e.openSession),B=he(e=>e.projects),ne=_e(e=>e.projectSortOrder),re=hr(),ie=Z.useMemo(()=>B.filter(e=>e.hostId).map(Xe),[B]),ae=Z.useMemo(()=>ie.flatMap(e=>m.get(e.id)??[]).map(e=>({pinned:!!e.pinned,time:Je(e.node.session),session:{id:e.identity,title:e.node.session.title||``,content:e.content}})),[ie,m]),oe=Ne(e=>e.sessionOrderByScope[vr]),V=Z.useMemo(()=>fr([...p.pinnedSessions,...ae.filter(e=>e.pinned).map(e=>e.session)],e=>e.id,oe),[p.pinnedSessions,ae,oe]),U=Z.useMemo(()=>[...p.inProgressSessions.map(e=>({session:e,time:p.sessionById.get(e.id)?Je(p.sessionById.get(e.id)):0})),...ae.filter(e=>!e.pinned)].sort((e,t)=>t.time-e.time).map(e=>e.session),[p.inProgressSessions,p.sessionById,ae]),se=he(e=>e.setActiveProjectIdOnly),ce=he(e=>e.removeProject),le=In(),[de,fe]=Z.useState(null),[me,ve]=Z.useState(!1),[K,ye]=Z.useState(null),[q,be]=Z.useState(null),[xe,Se]=Z.useState(null),[Ce,we]=Z.useState(``),[Ee,De]=Z.useState(!1),[Oe,Ae]=Z.useState(!1),[je,Me]=Z.useState(null),[Pe,Y]=Z.useState(null),[Fe,Ie]=Z.useState(null),Re=de?.kind===`session`?de.session.id:``,ze=pe(Re),Be=ze?.type===`busy`||ze?.type===`retry`,Ve=de?.kind===`session`?li(de.session):``,{unread:He,onToggleRead:Ue}=Wr(de?.kind===`session`?de.session:null,Ve),We=!!Re&&Fe===Re,Ge=!Ve||We||Be,Ke=L(e=>{let t=new Map;for(let e of p.allSessions){let n=Kr(e);if(!n)continue;let r=t.get(n)??[];r.push(e.id),t.set(n,r)}let n=[],r=new Set,i=e=>{if(!r.has(e)){r.add(e),n.push(e);for(let n of t.get(e)??[])i(n)}};return i(e),n}),qe=L(()=>{ve(!1),fe(null)}),Ye=L(e=>{if(Lr(e.id)){let t=ei(e.id);if(!t)return;t.kind===`more`?p.showMoreBucketSessions(t.projectId,t.bucketKey):p.resetBucketVisibleCount(t.projectId,t.bucketKey);return}let t=p.sessionById.get(e.id),r=t&&li(t)||null;n({sessionId:e.id,directory:r})}),Ze=L(e=>{Ye({id:e,title:``})}),Qe=L(e=>{Lr(e.id)||x(e.id)}),$e=L(async t=>{if(Lr(t.id))return;if(e===`tasks`){S(t.id,!0),X.success(u(`sessions.sidebar.session.archive.success`),{action:{label:u(`sessions.sidebar.undo`),onClick:()=>S(t.id,!1)}});return}let n=Ke(t.id),{archivedIds:r,failedIds:i}=await M(n);r.length>0&&Br({sessionIds:r,message:r.length===1?u(`sessions.sidebar.session.archive.success`):u(`sessions.sidebar.bulkActions.archivedPlural`,{count:r.length}),undoLabel:u(`sessions.sidebar.undo`),settingsLabel:u(`settings.yuri.archivedSessions.actions.view`),undoFailedMessage:r.length===1?u(`sessions.sidebar.session.archive.undoFailed`):u(`sessions.sidebar.bulkActions.archiveUndoFailed`,{count:r.length})}),i.length>0&&X.error(i.length===1?u(`sessions.sidebar.bulkActions.failedArchiveSingle`,{count:i.length}):u(`sessions.sidebar.bulkActions.failedArchivePlural`,{count:i.length}))}),et=L(()=>{if(!de||de.kind!==`session`)return;let e=de.session,t=li(e),n=ze?.type??`idle`;!t||Fe===e.id||n===`busy`||n===`retry`||(Ie(e.id),(async()=>{try{await le.refreshSessionTranscript(e.id,{directory:t}),X.success(u(`sessions.sidebar.session.menu.refreshTranscriptSuccess`))}catch{X.error(u(`sessions.sidebar.session.menu.refreshTranscriptFailed`))}finally{Ie(t=>t===e.id?null:t)}})())}),nt=L(e=>{if(Lr(e.id))return;let t=p.sessionById.get(e.id);t&&(fe({kind:`session`,session:t}),ve(!0))}),rt=L(e=>{nt({id:e,title:``})}),it=L(e=>{y(e.id,!e.expanded)}),at=L((e,t)=>{b(`${e.id}::${t.id}`,!t.expanded)}),ot=L((e,t)=>{se(e.id),R({selectedProjectId:e.id,directoryOverride:t,preserveDirectoryOverride:!0})}),st=L(()=>{let e=he.getState().getActiveProject();if(e?.hostId){ir(Xe(e),!0).catch(e=>X.error(e instanceof Error?e.message:String(e)));return}if(i){i();return}te()}),ct=L(e=>{let t=p.projectMetaById.get(e.id);t&&(fe({kind:`project`,project:t,isGitRepository:!1}),ve(!0),d.checkIsGitRepository(t.path).then(e=>{fe(n=>Gs(n,t.id,e))}).catch(()=>{fe(e=>Gs(e,t.id,!1))}))}),lt=L((e,t)=>{let n=h(t);return n?e.worktrees.find(e=>h(e.path)===n)||((J.getState().availableWorktreesByProject.get(e.path)??[]).find(e=>h(e.path)===n)??null):null}),ut=L((e,t)=>{let n=p.projectMetaById.get(e.id);n&&ot(n,t.path)}),dt=L((e,t)=>{let n=p.projectMetaById.get(e.id);n&&(fe({kind:`worktree`,project:n,worktreePath:t.path,worktreeName:t.name}),ve(!0))}),ft=L((e,t)=>{let n=p.projectMetaById.get(e.id);if(!n)return;let r=lt(n,t.path);if(!r){X.error(u(`sessions.sidebar.sessionDialogs.worktree.errorRemoveTitle`),{description:u(`sessions.sidebar.dialogs.deleteResult.tryAgain`)});return}Y({project:n,worktree:r})}),pt=L(e=>{Me(e),se(e),Ae(!0)}),mt=L(e=>{(async()=>{let t=e.worktrees;try{t=(await Un({id:e.id,path:e.path})).worktrees}catch(n){console.warn(`[MobileProjectsHome] Worktree refresh before session sync failed:`,n),t=J.getState().availableWorktreesByProject.get(e.path)??e.worktrees}await ue([e.path,...t.map(e=>e.path)],p.allSessions)})()}),ht=L((e,t)=>{let n=je;if(Ae(!1),Me(null),t?.sessionId){z({sessionId:t.sessionId,directory:e});return}R({selectedProjectId:n,directoryOverride:e,preserveDirectoryOverride:!0})}),gt=L(async e=>{try{if(!(await F(e.id))?.share?.url){X.error(u(`sessions.sidebar.session.share.error`));return}X.success(u(`sessions.sidebar.session.share.successTitle`),{description:u(`sessions.sidebar.session.share.successDescription`)})}catch{X.error(u(`sessions.sidebar.session.share.error`))}}),_t=L(async e=>{if((await Le(e)).ok){X.success(u(`sessions.sidebar.session.menu.copied`));return}X.error(u(`sessions.sidebar.session.share.copyUrlError`))}),vt=L(async e=>{try{if(await I(e)){X.success(u(`sessions.sidebar.session.unshare.success`));return}X.error(u(`sessions.sidebar.session.unshare.error`))}catch{X.error(u(`sessions.sidebar.session.unshare.error`))}}),yt=L(e=>{let t=Ke(e.id);Hr({sessionIds:t,message:t.length===1?u(`sessions.sidebar.session.delete.success`):u(`sessions.sidebar.bulkActions.deletedPlural`,{count:t.length}),undoLabel:u(`sessions.sidebar.undo`),commitFailedMessage:u(`sessions.sidebar.session.delete.error`)})}),bt=L(async()=>{if(!xe)return;let e=Ce.trim();if(e)try{await N(xe.id,e),Se(null),we(``)}catch{X.error(u(`sessions.sidebar.session.menu.rename`),{description:u(`sessions.sidebar.dialogs.deleteResult.tryAgain`)})}}),xt=L(async()=>{if(!xe||Ee)return;let e=xe.id;Se(null),we(``),De(!0);try{await P(e)}catch{X.error(u(`sessions.sidebar.session.rename.smartTitle`),{description:u(`sessions.sidebar.dialogs.deleteResult.tryAgain`)})}finally{De(!1)}}),St=Z.useMemo(()=>de?de.kind===`session`?{kind:`session`,title:de.session.title?.trim()||u(`mobile.sessions.untitled`),pinned:j.has(de.session.id),shared:!!de.session.share?.url,unread:He}:de.kind===`project`?{kind:`project`,title:de.project.label,gitRepository:de.isGitRepository}:{kind:`worktree`,title:de.worktreeName}:null,[de,He,j,u]),Ct=Z.useMemo(()=>{if(!de)return{};if(de.kind===`session`){let e=de.session;return{onRename:()=>{we(e.title?.trim()||u(`mobile.sessions.untitled`)),Se(e)},onTogglePin:()=>x(e.id),onToggleRead:Ue,onShare:f&&!e.share?.url?()=>{gt(e)}:void 0,onCopyLink:f&&e.share?.url?()=>{_t(e.share.url)}:void 0,onUnshare:f&&e.share?.url?()=>{vt(e.id)}:void 0,onRefreshTranscript:et,onArchive:()=>{$e({id:e.id,title:e.title?.trim()||u(`mobile.sessions.untitled`)})},onDelete:()=>yt(e)}}if(de.kind===`project`){let e=de.project;return{onNewSession:()=>ot(e,e.path),onNewWorktree:()=>pt(e.id),onSyncSessions:()=>mt(e),onEditProject:()=>ye(e.id),onCloseProject:()=>be(e)}}let{project:e,worktreePath:t}=de;return{onNewSession:()=>ot(e,t),onDeleteWorktree:()=>{let n=lt(e,t);if(!n){X.error(u(`sessions.sidebar.sessionDialogs.worktree.errorRemoveTitle`),{description:u(`sessions.sidebar.dialogs.deleteResult.tryAgain`)});return}Y({project:e,worktree:n})}}},[de,$e,_t,yt,et,pt,mt,gt,vt,Ue,lt,f,ot,u,x]),wt=Z.useMemo(()=>{if(!K)return null;let e=B.find(e=>e.id===K),t=p.projectMetaById.get(K);if(!e||!t)return null;let n=de?.kind===`project`&&de.project.id===K?de.isGitRepository:t.worktrees.length>0;return{id:e.id,label:e.label?.trim()||t.label,path:h(e.path)||t.path,icon:e.icon,color:e.color,iconImage:e.iconImage,iconBackground:e.iconBackground,isGitRepo:n,worktrees:t.worktrees}},[de,K,p.projectMetaById,B]);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(zr,{remoteProjects:ie,hostRegistry:re.registry,projectOrderIds:Vr(B,ne).map(e=>e.id),renderRemoteProject:re.registry?e=>(0,$.jsx)(Qr,{project:e,registry:re.registry,mobile:!0,reorderEnabled:!1,onActivityItems:_}):void 0,remoteError:re.catalog.error?.message,className:l,projects:p.projects,pinnedSessions:V,inProgressSessions:U,onAddProject:r,onNewSession:st,onScanQr:a,onSwitchInstance:o,instanceOptions:c,onRemoteDesktop:s,onToggleProject:it,onOpenProjectActions:ct,onToggleWorktree:at,onNewWorktreeSession:ut,onOpenWorktreeActions:dt,onDeleteWorktree:ft,onSelectSession:Ye,onPinSession:Qe,onArchiveSession:e=>{$e(e)},onOpenSessionActions:nt,onReorderSessions:v,task:{view:e,onViewChange:t,model:D,settledOpen:C,onSettledOpenChange:O,onShowMoreSettled:k,onSelectTask:Ze,onOpenTaskActions:rt,onRestoreTask:A}}),(0,$.jsx)(Sr,{open:me,target:St,actions:Ct,refreshTranscriptDisabled:Ge,refreshTranscriptSpinning:We,onOpenChange:e=>{e?ve(!0):qe()}}),(0,$.jsx)(Fn,{open:Oe,projectId:je,onOpenChange:e=>{Ae(e),e||Me(null)},onWorktreeCreated:ht}),Pe?(0,$.jsx)(ti,{open:!0,project:{id:Pe.project.id,path:Pe.project.path},worktree:Pe.worktree,onClose:()=>Y(null)}):null,(0,$.jsx)(Bn,{open:!!q,title:u(`sessions.sidebar.project.actions.closeProject`),onClose:()=>be(null),closeAriaLabel:u(`mobile.surface.closeAria`),footer:(0,$.jsxs)(`div`,{className:`flex gap-2`,children:[(0,$.jsx)(H,{type:`button`,variant:`ghost`,className:`flex-1`,onClick:()=>be(null),children:u(`sessions.sidebar.dialogs.cancel`)}),(0,$.jsx)(H,{type:`button`,variant:`destructive`,className:`flex-1`,onClick:()=>{if(!q)return;let e=q;be(null),ce(e.id),X.success(u(`mobile.sessions.toast.projectRemoved`,{label:e.label}))},children:u(`mobile.sessions.confirmRemoveProject`)})]}),children:(0,$.jsx)(`p`,{className:`px-1 py-1 typography-ui-body text-foreground`,children:u(`mobile.projects.closeConfirmMessage`,{title:q?.label??``})})}),(0,$.jsx)(Bn,{open:!!xe,title:u(`sessions.sidebar.session.menu.rename`),onClose:()=>{Ee||(Se(null),we(``))},closeAriaLabel:u(`mobile.surface.closeAria`),footer:(0,$.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,$.jsx)(H,{type:`button`,variant:`default`,className:`flex-1`,disabled:Ee,onClick:()=>{Se(null),we(``)},children:u(`sessions.sidebar.dialogs.cancel`)}),(0,$.jsx)(H,{type:`button`,variant:`default`,className:`flex-1`,disabled:!Ce.trim()||Ee,onClick:()=>void bt(),children:u(`sessions.sidebar.session.rename.save`)})]}),children:(0,$.jsxs)(`form`,{className:`flex flex-col gap-3 px-1 py-1`,onSubmit:e=>{e.preventDefault(),bt()},children:[(0,$.jsx)(Ut,{value:Ce,onChange:e=>we(e.target.value),autoFocus:!0,className:`h-12`,disabled:Ee}),(0,$.jsxs)(H,{type:`button`,variant:`outline`,className:`w-full gap-2`,disabled:Ee,onClick:()=>void xt(),children:[Ee?(0,$.jsx)(W,{name:`loader-4`,className:`size-4 animate-spin`}):(0,$.jsx)(W,{name:`ai-generate-2`,className:`size-4`}),u(`sessions.sidebar.session.rename.smartTitle`)]})]})}),(0,$.jsx)(Rr,{open:K!==null,project:wt,onClose:()=>ye(null)})]})}function qs(e){let t=(0,Q.c)(10),{children:n,content:r,className:i,contentClassName:a,showHeader:o}=e,s=o===void 0||o,{t:c}=tt(),l;t[0]===c?l=t[1]:(l=c(`sessions.scheduledTasks.dialog.title`),t[0]=c,t[1]=l);let u;t[2]===a?u=t[3]:(u=U(`yuri-mobile-scheduled-content`,a),t[2]=a,t[3]=u);let d=n??r,f;return t[4]!==i||t[5]!==s||t[6]!==l||t[7]!==u||t[8]!==d?(f=(0,$.jsx)(zi,{title:l,className:i,surface:!1,scrollsWithPage:!0,showHeader:s,surfaceClassName:u,children:d}),t[4]=i,t[5]=s,t[6]=l,t[7]=u,t[8]=d,t[9]=f):f=t[9],f}var Js=Wt(()=>z(()=>import(`./AssistantView-CWPh6KhU.js`).then(e=>({default:e.AssistantView})),__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,2,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105]))),Ys=Wt(()=>z(()=>import(`./MobileAssistantTab-BsxiOYep.js`).then(e=>({default:e.MobileAssistantTab})),__vite__mapDeps([106,1,6,7,8,9,10,21,13,5,4,14,15,22,23,24,25,26,17,18,27,28,16,2,29,30,19,11,12,20,31,33,34,35,36,37,38,94,73,59,74,75,66,76,77,107,108,109,110,101,102,103,51,69,70,104,105]))),Xs=Wt(()=>z(()=>import(`./MobileAssistantSettingsPage-DBl7VNVJ.js`).then(e=>({default:e.MobileAssistantSettingsPage})),__vite__mapDeps([111,1,6,7,25,13,5,4,14,15,26,17,18,27,28,16,2,29,39,21,22,23,24,112,50,12,34,41,19,42,43,44,45,46,35,36,37,47,8,9,10,48,11,20,49,51,52,53,54,55,56,30,113,108,109,114,57,58,69,70,115,105,81,116,33,68,71,72,38,73,59,74,75,66,76,77,117,79,80,32,97,98,99,118,119,120,121,122,123,124,125,126,127,128,129,130,131]))),Zs=Wt(()=>z(()=>import(`./MobileBtwPage-CdFSaIWx.js`).then(e=>({default:e.MobileBtwPage})),__vite__mapDeps([132,6,1,7,25,13,5,4,14,15,26,17,18,27,28,16,2,29,133,8,9,10,50,12,34,41,19,42,43,44,45,46,35,36,37,47,48,11,20,49,51,21,22,23,52,53,54,55,56,30,75,71,39,24,134,85,86,79,59,80,124,32,115,105,64,63,65,66,135,136,137,78,81,57,58,62,60,61,120,121,138,92,139,90,140,141,142]))),Qs=Wt(()=>z(()=>import(`./MobileSettingsTab-CtVgHZJU.js`).then(e=>({default:e.MobileSettingsTab})),__vite__mapDeps([143,6,1,7,25,13,5,4,14,15,26,17,18,27,28,16,2,29,98,99,108,21,22,23,109,8,9,10,144,34,12,145,146,41,19,42,43,44,45,46,35,36,37,47,48,11,20,49,147,51,24,50,52,53,54,55,56,30,57,58,69,70,124,74,148,32,115,105,104,149,81,150,151,152,153,154,155,156,157,158,159,160,161,133,75,71,162,163,116,63,64,65,66,164,33,39,165,166,112,113,128,121,117,79,59,80,167,168,169,125,126,127,142,170,171,172,173,174,175,176,177,118,178,179,180,181,182,120,89,90,140,183,184,119,122,123,129,185,73,76,77,114,68,72,38,97,130,131,186,187,188,189,190,191,192,193,194,195,196,197,198,199])));function $s(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Js,{...e}),t[0]=e,t[1]=n),n}function ec(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Ys,{...e}),t[0]=e,t[1]=n),n}function tc(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Xs,{...e}),t[0]=e,t[1]=n),n}function nc(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Zs,{...e}),t[0]=e,t[1]=n),n}function rc(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(Qs,{...e}),t[0]=e,t[1]=n),n}var ic=`yuri.mobile.homeView`;function ac(e){let t=(0,Q.c)(119),{onAddProject:n,onScanQr:r,onSwitchInstance:i,onRemoteDesktop:a,remoteDesktopActive:o,instanceOptions:s,onEnableAssistants:c,instancesPage:l,instancesSecondaryPage:u,parentSessionTarget:d,registerSecondaryBackHandler:f,scheduledContent:p,renderChat:m,className:g}=e,_=o!==void 0&&o,v=d===void 0?null:d,{t:y}=tt(),[b,x]=Z.useState(Ec),S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{x(e);try{O().setItem(ic,e)}catch{}},t[0]=S):S=t[0];let C=L(S),w=B(Tc),T=G(),E=G(wc),D=G(Cc),k=G(Sc),A=G(xc),j=G(bc),M=G(yc),N=G(vc),ee=G(_c),P=G(gc),F=G(hc),I=G(mc),te=G(pc),R;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(R=[],t[1]=R):R=t[1],Z.useEffect(fc,R);let z=T.secondary?.kind===`chat`?T.secondary.btw??null:null,ne=Z.useRef(null),re,ie;t[2]===z?(re=t[3],ie=t[4]):(re=()=>{let e=ne.current;ne.current=z,e&&e!==z&&Gt.getState().clear({sessionId:e.sessionId,directory:e.directory}),z?qt(Yt):Jt(Yt)},ie=[z],t[2]=z,t[3]=re,t[4]=ie),Z.useEffect(re,ie);let ae;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(ae=[],t[5]=ae):ae=t[5],Z.useEffect(uc,ae);let oe;t[6]===E?oe=t[7]:(oe=e=>{e===`settings`&&B.getState().setSettingsPage(`home`),E(e)},t[6]=E,t[7]=oe);let V=L(oe),H;t[8]===D?H=t[9]:(H=e=>{D(e)},t[8]=D,t[9]=H);let U=L(H),W;t[10]===N?W=t[11]:(W=()=>{N()},t[10]=N,t[11]=W);let se=L(W),ce;t[12]===k?ce=t[13]:(ce=()=>{k()},t[12]=k,t[13]=ce);let le=L(ce),ue;t[14]===A?ue=t[15]:(ue=e=>{A(e)},t[14]=A,t[15]=ue);let fe=L(ue),pe=Z.useRef(null),[me,he]=Z.useState(!1),ge;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ge=e=>{pe.current=e},t[16]=ge):ge=t[16];let _e=L(ge),ve;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>{he(e)},t[17]=ve):ve=t[17];let K=L(ve),ye;t[18]!==se||t[19]!==v||t[20]!==M||t[21]!==te||t[22]!==ee?(ye=()=>{if(pe.current?.())return!0;let e=G.getState().secondary;return e?.kind===`chat`&&e.btw?(te(),!0):e?.kind===`assistant`&&e.settingsAssistantID?(M(),!0):(e?.kind===`draft`||e?.kind===`chat`)&&v?.onSelect?(v.onSelect(),!0):e?.kind===`chat`&&e.routes.length>1?(ee(),!0):e?(se(),!0):!1},t[18]=se,t[19]=v,t[20]=M,t[21]=te,t[22]=ee,t[23]=ye):ye=t[23];let q=L(ye),be=T.secondary!==null,xe;t[24]!==q||t[25]!==f?(xe=()=>{if(f)return f(()=>q()),()=>f(null)},t[24]=q,t[25]=f,t[26]=xe):xe=t[26];let Se;t[27]!==q||t[28]!==f||t[29]!==be?(Se=[f,be,q],t[27]=q,t[28]=f,t[29]=be,t[30]=Se):Se=t[30],Z.useEffect(xe,Se);let Ce=J(lc),we=de(cc),Te;t[31]===Ce?Te=t[32]:(Te=e=>Ce?e.getDirectoryForSession(Ce):null,t[31]=Ce,t[32]=Te);let Ee=J(Te),De,Oe;t[33]!==Ee||t[34]!==Ce||t[35]!==F||t[36]!==we||t[37]!==I?(De=()=>{let e=G.getState().secondary;if(we)return;if(e?.kind===`draft`&&Ce){F({sessionId:Ce,directory:Ee});return}if(e?.kind!==`chat`||!Ce||Ge({sessionId:Ce,directory:Ee})===`internal`)return;let t=e.routes.at(-1);(t?.sessionId!==Ce||h(t.directory)!==h(Ee))&&I({sessionId:Ce,directory:Ee})},Oe=[Ee,Ce,F,I,we],t[33]=Ee,t[34]=Ce,t[35]=F,t[36]=we,t[37]=I,t[38]=De,t[39]=Oe):(De=t[38],Oe=t[39]),Z.useEffect(De,Oe);let ke,Ae;t[40]!==Ce||t[41]!==v||t[42]!==P||t[43]!==we?(ke=()=>{let e=G.getState().secondary;if(e?.kind!==`chat`||!v||v.onSelect||we)return;let t=e.routes.at(-1);!t||t.sessionId!==Ce||P({sessionId:v.id,directory:v.directory})},Ae=[Ce,v,P,we],t[40]=Ce,t[41]=v,t[42]=P,t[43]=we,t[44]=ke,t[45]=Ae):(ke=t[44],Ae=t[45]),Z.useEffect(ke,Ae);let je;t[46]!==K||t[47]!==_e||t[48]!==p?(je=typeof p==`function`?p(_e,K):p,t[46]=K,t[47]=_e,t[48]=p,t[49]=je):je=t[49];let Me=je,Ne;t[50]!==C||t[51]!==le||t[52]!==b||t[53]!==s||t[54]!==n||t[55]!==a||t[56]!==r||t[57]!==i||t[58]!==U?(Ne=(0,$.jsx)(Ks,{homeView:b,onHomeViewChange:C,onOpenChat:U,onAddProject:n,onNewSession:le,onScanQr:r,onSwitchInstance:i,onRemoteDesktop:a,instanceOptions:s}),t[50]=C,t[51]=le,t[52]=b,t[53]=s,t[54]=n,t[55]=a,t[56]=r,t[57]=i,t[58]=U,t[59]=Ne):Ne=t[59];let Pe;t[60]!==c||t[61]!==fe?(Pe=(0,$.jsx)(ec,{onEnable:c,onOpenAssistant:fe}),t[60]=c,t[61]=fe,t[62]=Pe):Pe=t[62];let Y;t[63]===Me?Y=t[64]:(Y=(0,$.jsx)(qs,{showHeader:!1,children:Me}),t[63]=Me,t[64]=Y);let Fe;t[65]===l?Fe=t[66]:(Fe=(0,$.jsx)(rc,{instancesPage:l}),t[65]=l,t[66]=Fe);let Ie;t[67]!==Ne||t[68]!==Pe||t[69]!==Y||t[70]!==Fe?(Ie={projects:Ne,assistant:Pe,scheduled:Y,settings:Fe},t[67]=Ne,t[68]=Pe,t[69]=Y,t[70]=Fe,t[71]=Ie):Ie=t[71];let Le=Ie,Re=T.secondary?.kind??null,ze;bb0:{if(!Re){ze=null;break bb0}let e;t[72]!==q||t[73]!==j||t[74]!==y?(e=e=>({key:`assistant-secondary`,depth:1,ariaLabel:y(`assistants.title`),onBack:q,content:(0,$.jsx)($s,{activeOverride:e,onMobileBack:sc,onMobileOpenSettings:j})}),t[72]=q,t[73]=j,t[74]=y,t[75]=e):e=t[75];let n=e;if(Re===`assistant`){let e=T.secondary?.kind===`assistant`?T.secondary.settingsAssistantID:void 0,r=!e,i;t[76]!==n||t[77]!==r?(i=n(r),t[76]=n,t[77]=r,t[78]=i):i=t[78];let a;t[79]!==q||t[80]!==e||t[81]!==y?(a=e?[{key:`assistant-settings:${e}`,depth:2,ariaLabel:y(`assistants.conversation.openSettings`),onBack:q,content:(0,$.jsx)(tc,{assistantID:e,onBack:oc})}]:[],t[79]=q,t[80]=e,t[81]=y,t[82]=a):a=t[82];let o;t[83]!==i||t[84]!==a?(o=[i,...a],t[83]=i,t[84]=a,t[85]=o):o=t[85],ze=o;break bb0}if(Re===`instances`){let e;t[86]===y?e=t[87]:(e=y(`mobile.settings.switchInstance`),t[86]=y,t[87]=e);let n;t[88]!==q||t[89]!==u||t[90]!==e?(n=[{key:`instances-secondary`,depth:1,ariaLabel:e,onBack:q,content:u}],t[88]=q,t[89]=u,t[90]=e,t[91]=n):n=t[91],ze=n;break bb0}if(T.secondary?.kind===`draft`){let e;t[92]===y?e=t[93]:(e=y(`mobile.nav.secondaryPageAria`),t[92]=y,t[93]=e);let n;t[94]===m?n=t[95]:(n=m({sessionId:``,directory:null,viewKey:`chat-primary`,active:!0}),t[94]=m,t[95]=n);let r;t[96]!==q||t[97]!==e||t[98]!==n?(r=[{key:`chat-primary`,depth:1,ariaLabel:e,onBack:q,content:n}],t[96]=q,t[97]=e,t[98]=n,t[99]=r):r=t[99],ze=r;break bb0}if(T.secondary?.kind!==`chat`){let e;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[100]=e):e=t[100],ze=e;break bb0}let r=T.secondary.routes,i;if(t[101]!==n||t[102]!==q||t[103]!==T.secondary.btw||t[104]!==T.secondary.returnTo||t[105]!==m||t[106]!==r||t[107]!==y){let e=T.secondary.returnTo?[n(!1)]:[],a=T.secondary.btw,o=r.slice(a?-1:-2),s=r.length-o.length+1+e.length,c=o.map((e,t)=>{let n=!a&&t===o.length-1;return{key:e.key,depth:s+t,ariaLabel:y(`mobile.nav.secondaryPageAria`),onBack:q,content:m({sessionId:e.sessionId,directory:e.directory,viewKey:e.key,active:n})}});i=a?[...e,...c,{key:`chat-btw`,depth:r.length+1+e.length,ariaLabel:y(`chat.btw.title`),onBack:q,content:(0,$.jsx)(nc,{route:a})}]:[...e,...c],t[101]=n,t[102]=q,t[103]=T.secondary.btw,t[104]=T.secondary.returnTo,t[105]=m,t[106]=r,t[107]=y,t[108]=i}else i=t[108];ze=i}let Be=ze,Ve;t[109]===Be?Ve=t[110]:(Ve=Be??[],t[109]=Be,t[110]=Ve);let X=me||w||_,He;return t[111]!==g||t[112]!==b||t[113]!==T||t[114]!==V||t[115]!==Ve||t[116]!==X||t[117]!==Le?(He=(0,$.jsx)(zs,{homeView:b,className:g,navigation:T,onTabChange:V,tabs:Le,secondaryPages:Ve,tabBarCovered:X}),t[111]=g,t[112]=b,t[113]=T,t[114]=V,t[115]=Ve,t[116]=X,t[117]=Le,t[118]=He):He=t[118],He}function oc(){zt.requestAnimatedBack(`root`)}function sc(){return zt.requestAnimatedBack(`root`)}function cc(e){return e.remoteSession}function lc(e){return e.currentSessionId}function uc(){return dc}function dc(){return Jt(Yt)}function fc(){return je()}function pc(e){return e.popBtw}function mc(e){return e.replaceChatSession}function hc(e){return e.materializeDraftSession}function gc(e){return e.reconcileChatPredecessor}function _c(e){return e.popChatSession}function vc(e){return e.closeSecondary}function yc(e){return e.popAssistantSettings}function bc(e){return e.pushAssistantSettings}function xc(e){return e.openAssistant}function Sc(e){return e.openDraft}function Cc(e){return e.openSession}function wc(e){return e.setActiveTab}function Tc(e){return e.isCommandPaletteOpen}function Ec(){return di(O().getItem(ic))}function Dc(e){let t=(0,Q.c)(7),n=e===void 0?2500:e,{uiFont:r}=or(),[i,a]=Z.useState(!1),o,s;t[0]===i?(o=t[1],s=t[2]):(o=()=>{if(!i)return;let e=document.getElementById(`initial-loading`);if(!e)return;e.classList.add(`fade-out`);let t=window.setTimeout(()=>e.remove(),300);return()=>window.clearTimeout(t)},s=[i],t[0]=i,t[1]=o,t[2]=s),Z.useEffect(o,s);let c,l;return t[3]!==n||t[4]!==r?(c=()=>{let e=!1,t=()=>{e||a(!0)},i=()=>{requestAnimationFrame(()=>requestAnimationFrame(t))},o=Promise.all([Tn(r).catch(Mc),document.fonts?.ready?.then(jc).catch(Ac)??Promise.resolve(),Ki.catch(kc)]).then(Oc),s=new Promise(e=>{window.setTimeout(e,n)});return Promise.race([o,s]).then(i),()=>{e=!0}},l=[r,n],t[3]=n,t[4]=r,t[5]=c,t[6]=l):(c=t[5],l=t[6]),Z.useEffect(c,l),i}function Oc(){}function kc(){}function Ac(){}function jc(){}function Mc(){}var Nc=e=>e.replace(/^\/+|\/+$/g,``),Pc=e=>{let t=e.get(`directory`)||e.get(`dir`)||e.get(`path`);if(typeof t!=`string`)return;let n=t.trim();return n.length>0?n:void 0},Fc=e=>{let t=Nc(e.pathname).split(`/`).filter(Boolean);return e.host?[e.host,...t]:t};function Ic(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(![`yuri:`,`openchamber:`,`openchambery:`].includes(t.protocol))return null;let n=Fc(t),r=(n[0]??``).toLowerCase(),i=n.slice(1),a=t.searchParams;switch(r){case`connect`:{let t=wi(e);return t?{type:`connect`,pairing:t}:null}case`session`:{let e=i[0]||a.get(`id`)||``;return e?{type:`session`,sessionId:e,directory:Pc(a)}:null}case`assistant`:{let e=i[0]||a.get(`id`)||``;return e?{type:`assistant`,assistantId:e}:null}case`new`:case`new-session`:{let e=a.get(`prompt`)?.trim();return{type:`new-session`,directory:Pc(a),projectId:a.get(`project`)??void 0,agent:a.get(`agent`)??void 0,model:a.get(`model`)??void 0,prompt:e||void 0}}case`project`:case`open-project`:{let e;if(i.length>0)try{e=decodeURIComponent(i.join(`/`))}catch{e=i.join(`/`)}let t=Pc(a)||e;return t?{type:`open-project`,directory:t}:null}case`sessions`:{let e=a.get(`filter`);return{type:`sessions`,filter:e===`attention`||e===`recent`||e===`all`?e:void 0}}case`status`:return{type:`status`};case`settings`:return{type:`settings`,section:i[0]||a.get(`section`)||void 0};case`changes`:return{type:`changes`,path:i.join(`/`)||a.get(`path`)||void 0,staged:a.get(`staged`)===`true`};case`view`:{let e=(i[0]||``).toLowerCase();return e===`changes`?{type:`changes`}:e===`files`||e===`mcp`||e===`instances`||e===`update`?{type:`view`,target:e}:null}default:return null}}var Lc={},Rc=null,zc=!1,Bc=null,Vc=e=>{switch(e.type){case`connect`:return Rc?(Rc(e.pairing),!0):!1;case`session`:return _()?(J.getState().setCurrentSession(e.sessionId,e.directory??null),!0):(G.getState().openSession({sessionId:e.sessionId,directory:e.directory??null}),!0);case`assistant`:if(!_()){let t=G.getState();return t.setActiveTab(`assistant`),t.openAssistant(e.assistantId),!0}return it(e.assistantId),!0;case`new-session`:return _()?(J.getState().openNewSessionDraft({directoryOverride:e.directory??null,selectedProjectId:e.projectId??null,preserveDirectoryOverride:!!e.directory,ensureProjectForDirectory:!!e.directory,initialPrompt:e.prompt}),!0):(G.getState().openDraft({directoryOverride:e.directory??null,selectedProjectId:e.projectId??null,preserveDirectoryOverride:!!e.directory,ensureProjectForDirectory:!!e.directory,initialPrompt:e.prompt}),!0);case`open-project`:return _()?(J.getState().openNewSessionDraft({directoryOverride:e.directory,preserveDirectoryOverride:!0}),!0):(G.getState().openDraft({directoryOverride:e.directory,preserveDirectoryOverride:!0}),!0);case`sessions`:return Lc.openSessions?(Lc.openSessions(e.filter),!0):!1;case`status`:return Lc.openSessions?(Lc.openSessions(),!0):(B.getState().setMobileSessionPanelOpen(!0),!0);case`view`:return Lc.openView?(Lc.openView(e.target),!0):!1;case`changes`:return Lc.openChanges?(Lc.openChanges({path:e.path,staged:e.staged}),!0):!1;case`settings`:return Lc.openSettings?(Lc.openSettings(e.section),!0):!1}return!1},Hc=()=>{if(!Bc||!zc&&Bc.type!==`connect`)return;let e=Bc;Bc=null,Vc(e)||(Bc=e)},Uc=e=>{Bc=e,Hc()},Wc=e=>{let t=Ic(e);t&&Uc(t)},Gc=e=>{zc=e,Hc()},Kc=e=>{let t=(0,Q.c)(3),n,r;t[0]===e?(n=t[1],r=t[2]):(n=()=>(Lc=e,Hc(),()=>{Lc===e&&(Lc={})}),r=[e],t[0]=e,t[1]=n,t[2]=r),Z.useEffect(n,r)},qc=e=>{let t=(0,Q.c)(3),n,r;t[0]===e?(n=t[1],r=t[2]):(n=()=>(Rc=e,Hc(),()=>{Rc===e&&(Rc=null)}),r=[e],t[0]=e,t[1]=n,t[2]=r),Z.useEffect(n,r)},Jc=e=>{let{ready:t}=e,[n,r]=Z.useState(()=>g()?`pending`:`none`);return Z.useEffect(()=>{Gc(t)},[t]),Z.useEffect(()=>{if(!g())return;let e=!1,t=[];return z(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])).then(async({App:n})=>{if(e)return;let i=await n.addListener(`appUrlOpen`,e=>{Wc(e?.url)});if(e){i.remove();return}t.push(()=>void i.remove());let a=await n.getLaunchUrl().catch(()=>void 0);if(e)return;let o=Ic(a?.url);r(o?.type===`connect`?`connect`:o?`other`:`none`),o&&Uc(o)}).catch(()=>{e||r(`none`)}),z(async()=>{let{PushNotifications:e}=await import(`./vendor-capacitor-push-notifications-D5cqJIPw.js`).then(e=>e.t);return{PushNotifications:e}},__vite__mapDeps([200,1,2])).then(async({PushNotifications:n})=>{if(e)return;let r=await n.addListener(`pushNotificationActionPerformed`,e=>{let t=e?.notification?.data,n=typeof t?.url==`string`?t.url:typeof t?.deeplink==`string`?t.deeplink:void 0;if(n){Wc(n);return}let r=typeof t?.assistantID==`string`?t.assistantID.trim():``;if(r){Uc({type:`assistant`,assistantId:r});return}let i=typeof t?.sessionId==`string`?t.sessionId:void 0;i&&Uc({type:`session`,sessionId:i})});if(e){r.remove();return}t.push(()=>void r.remove())}).catch(()=>void 0),()=>{e=!0,t.forEach(e=>e())}},[]),n},Yc=.85,Xc=8,Zc=.35,Qc=.22,$c=e=>({segmentStart:e,lastTouch:e,open:!1}),el=e=>e*Zc,tl=e=>e*Qc,nl=(e,t)=>Math.max(0,e-t),rl=(e,t)=>Math.max(0,t-e),il=(e,t)=>{let n=Math.abs(e);return n<Xc||Math.abs(t)<=n*Yc},al=(e,t,n)=>{let r=t.clientX-e.segmentStart.clientX,i=t.clientY-e.segmentStart.clientY,a=nl(e.segmentStart.clientX,t.clientX),o=el(n),s=tl(n),c=e.open;return c=a<=0?!1:e.open?a>=s:a>=o&&il(r,i),{segmentStart:e.segmentStart,lastTouch:t,open:c}},ol=e=>{if(e.disabled||e.startedOnExcludedTarget)return{open:!1,back:!1};let t=e.endX-e.startX,n=e.endY-e.startY,r=nl(e.startX,e.endX),i=rl(e.startX,e.endX),a=el(e.viewportWidth),o=il(t,n);return{open:r>=a&&o,back:i>=a&&o}},sl=(e,t,n)=>Math.min(nl(e,t)/Math.max(1,el(n)),1),cl=(e,t,n)=>Math.min(rl(e,t)/Math.max(1,el(n)),1),ll=e=>{let t=e;for(;t&&t!==document.body&&t!==document.documentElement;){let e=window.getComputedStyle(t).overflowX;if((e===`auto`||e===`scroll`)&&t.scrollWidth>t.clientWidth)return!0;t=t.parentElement}return!1},ul=e=>{let t=document.elementFromPoint(e.clientX,e.clientY);return!!t?.closest(`.yuri-mobile-composer`)||ll(t)},dl=1,fl=(e,t)=>{if(!e||e.rangeCount===0||e.isCollapsed)return!1;if(!t)return!0;let n=e.anchorNode;if(!n)return!1;let r=n.nodeType===dl?n:n.parentElement;return!!(r&&t.contains(r))},pl=e=>fl(window.getSelection(),e),ml=(e,t,n)=>{let r=Z.useRef(t.onOpen);r.current=t.onOpen;let i=Z.useRef(t.onPreviewStart);i.current=t.onPreviewStart;let a=Z.useRef(t.onPreviewCancel);a.current=t.onPreviewCancel;let o=Z.useRef(t.onProgress);o.current=t.onProgress;let s=Z.useRef(t.onBack);s.current=t.onBack;let c=Z.useRef(t.onBackProgress);c.current=t.onBackProgress;let l=Z.useRef(t.disabled);l.current=t.disabled,Z.useEffect(()=>{let t=e.current;if(!t)return;let n=!1,u=!1,d=null,f=!1,p=!1,m=!1,h=0,g=0,_=null,v=e=>{let t=el(g),n=Pe({thresholdReached:p,distance:e,enterDistance:t,cancelDistance:tl(g),available:!0});p=n.thresholdReached,n.event===`enter`&&(m=ze(`medium`,{bypassCadence:!0})),n.event===`cancel`&&(ze(`light`,{bypassCadence:!0}),m=!1)},y=e=>{o.current?.(null),p&&!e&&ze(`light`,{bypassCadence:!0}),p=!1,m=!1,e?r.current():f&&a.current?.(),f=!1},b=e=>{c.current?.(null),p&&!e&&ze(`light`,{bypassCadence:!0}),p=!1,m=!1,e&&s.current?.()},x=e=>{if(e.touches.length!==1){n=!1,_=null;return}if(l.current){n=!1,_=null;return}let r=e.touches[0];n=!0,g=window.innerWidth,u=ul(r)||pl(t),d=null,f=!1,p=!1,m=!1,h=0,_=$c(r)},S=e=>{if(!n||u||!_)return;if(e.touches.length!==1){d===`sessions`&&y(!1),d===`back`&&b(!1),n=!1,_=null;return}let r=e.touches[0];_=al(_,r,g);let a=r.clientX-_.segmentStart.clientX,l=r.clientY-_.segmentStart.clientY;if(d===null){if(pl(t))return;let e=Math.abs(a);if(e<Xc||Math.abs(l)>e*Yc)return;if(a<0)d=`sessions`,f=!0,i.current?.();else if(s.current)d=`back`;else return}e.preventDefault(),h=d===`sessions`?nl(_.segmentStart.clientX,r.clientX):rl(_.segmentStart.clientX,r.clientX),v(h),d===`sessions`?o.current?.(sl(_.segmentStart.clientX,r.clientX,g)):c.current?.(cl(_.segmentStart.clientX,r.clientX,g))},C=e=>{if(!n||!_)return;if(n=!1,!d){_=null;return}let t=e.changedTouches[0];t&&(_=al(_,t,g),h=d===`sessions`?nl(_.segmentStart.clientX,t.clientX):rl(_.segmentStart.clientX,t.clientX),v(h));let r=d===`sessions`?_.open:ol({startX:_.segmentStart.clientX,startY:_.segmentStart.clientY,endX:_.lastTouch.clientX,endY:_.lastTouch.clientY,viewportWidth:g,disabled:!1,startedOnExcludedTarget:!1}).back;_=null,e.preventDefault(),r&&!m&&ze(`medium`,{bypassCadence:!0}),d===`sessions`?y(r):b(r)},w=()=>{d===`sessions`&&y(!1),d===`back`&&b(!1),n=!1,_=null};return t.addEventListener(`touchstart`,x,{passive:!0,capture:!0}),t.addEventListener(`touchmove`,S,{passive:!1,capture:!0}),t.addEventListener(`touchend`,C,{passive:!1,capture:!0}),t.addEventListener(`touchcancel`,w,{passive:!0,capture:!0}),()=>{f&&y(!1),d===`back`&&b(!1),t.removeEventListener(`touchstart`,x,!0),t.removeEventListener(`touchmove`,S,!0),t.removeEventListener(`touchend`,C,!0),t.removeEventListener(`touchcancel`,w,!0)}},[e,n])},hl=te(`YuriNotifications`),gl=()=>R.getPlatform()===`android`&&R.isPluginAvailable(`YuriNotifications`);async function _l(e,n){let r=f(),a=t(),o=a?``:p();if(!a&&!/^https?:\/\//.test(o))return null;let s=await i();s.set(`Accept-Language`,n);let c=(await $t()).find(e=>tn(e)===r)?.candidates.find(e=>e.kind===`relay`);return{runtimeKey:r,baseUrl:o,relay:a??(c?.kind===`relay`?c.relay:void 0),preferRelay:!!a,headers:Object.fromEntries(s.entries()),labels:e}}function vl(e){let t=0,n=!1;return{refresh:async()=>{let r=++t;try{if(await e.plugin.stop(),n||r!==t)return;let i=await e.resolveConfig();if(n||r!==t||!i)return;let a=await e.plugin.configure({config:i});!n&&r===t&&e.onState(a.state)}catch{!n&&r===t&&e.onError()}},stop:()=>{++t,e.plugin.stop().catch(e.onError)},dispose:()=>{n=!0,++t,e.plugin.stop().catch(e.onError)}}}var yl=()=>{if(gl()||typeof window>`u`)return!1;let e=window.Capacitor?.getPlatform?.();return e===`ios`||e===`android`},bl=(e,t)=>{x()?.push?.registerApnsToken?.({token:e,platform:y(),locale:t})},xl=e=>{let{enabled:t}=e,n=B(e=>e.nativeNotificationsEnabled),r=nt(e=>e.locale),i=Z.useRef(null),a=Z.useRef(r);a.current=r,Z.useEffect(()=>{if(!t||!n||!yl())return;let e=!1,r=[];return z(async()=>{let{PushNotifications:e}=await import(`./vendor-capacitor-push-notifications-D5cqJIPw.js`).then(e=>e.t);return{PushNotifications:e}},__vite__mapDeps([200,1,2])).then(async({PushNotifications:t})=>{if(e)return;let n=await t.checkPermissions().catch(()=>null);if(n?.receive!==`granted`&&(n=await t.requestPermissions().catch(()=>null)),n?.receive!==`granted`)return;let o=await t.addListener(`registration`,e=>{i.current=e.value,bl(e.value,a.current)}),s=await t.addListener(`registrationError`,e=>{console.warn(`[Push] APNs registration error:`,e)});if(await t.register().catch(()=>void 0),e){o.remove(),s.remove();return}r.push(()=>void o.remove(),()=>void s.remove())}).catch(()=>void 0),()=>{e=!0,r.forEach(e=>e())}},[t,n]),Z.useEffect(()=>{if(!t||!n||!yl())return;let e=i.current;e&&bl(e,r)},[t,n,r]),Z.useEffect(()=>{if(n)return;let e=i.current;e&&(i.current=null,x()?.push?.unregisterApnsToken?.({token:e}))},[n])},Sl=`YuriLiveActivity`,Cl=5e3,wl=3600,Tl=`live`,El=te(Sl),Dl=e=>e.isCapacitor&&e.platform===`ios`&&e.pluginAvailable;function Ol(){return typeof window>`u`?!1:Dl({isCapacitor:g(),platform:y(),pluginAvailable:R.isPluginAvailable(Sl)})}var kl=()=>El,Al=new Set([`permission`,`input`,`retry`]),jl=()=>({trackedSessionId:null,started:!1,startedAt:null,busySince:null,lastStatus:null,eventVersion:0,items:[]}),Ml=(e,t)=>Math.max(Math.floor(e),t+1),Nl=e=>e.failedEpoch===e.currentEpoch?e.previous:e.current,Pl=e=>e.failedEpoch===e.currentEpoch&&e.retryCount<1,Fl=e=>e.hasSessionError?`error`:e.hasPendingPermissions?`permission`:e.hasPendingQuestions?`input`:e.statusType===`retry`?`retry`:e.statusType===`busy`?`working`:e.statusType===`idle`?`complete`:null,Il=e=>{let t=e.trim();return t.length<=80?t:`${t.slice(0,79)}…`},Ll=e=>typeof e.parentID==`string`&&e.parentID.length>0?e.parentID:null,Rl=e=>{if(e.runningIds.size===0)return[];let t=[];for(let n of e.sessions)!e.runningIds.has(n.id)||Ll(n)||t.push({sessionId:n.id,title:Il(n.title??``),statusType:e.statuses[n.id]?.type??`busy`});return t},zl=e=>e!==`complete`&&e!==`error`,Bl=e=>e.some(e=>e.status===`permission`)?`permission`:e.some(e=>e.status===`input`)?`input`:e.some(e=>e.status===`retry`)?`retry`:e.some(e=>e.status===`tool`)?`tool`:e.some(e=>e.status===`stale`)?`stale`:e.some(e=>e.status===`working`)?`working`:e.some(e=>e.status===`error`)?`error`:`complete`,Vl=e=>{if(e.length<=4)return e;let t=e.filter(e=>zl(e.status)),n=e.filter(e=>!zl(e.status)).sort((e,t)=>(t.endedAt??0)-(e.endedAt??0)),r=[...t];for(let e of n){if(r.length>=4)break;r.push(e)}return r.slice(0,4)},Hl=(e,t,n,r)=>{if(n&&n.length>0)return n;let i=r?.[e];return i&&i.length>0?i:t},Ul=(e,t,n,r,i)=>{let a=new Map;for(let e of t)a.set(e.sessionId,e);let o=[],s=new Set;for(let t of e){if(i&&!i.has(t.sessionId))continue;let e=a.get(t.sessionId);if(e){let i=Fl({statusType:e.statusType,hasPendingPermissions:e.hasPendingPermissions===!0,hasPendingQuestions:e.hasPendingQuestions===!0,hasSessionError:e.hasSessionError===!0})??`working`;o.push({sessionId:t.sessionId,title:Hl(t.sessionId,t.title,e.title,r),status:i,startedAt:t.startedAt,busySince:i===`working`?t.busySince??n:null})}else if(zl(t.status))o.push({...t,title:Hl(t.sessionId,t.title,void 0,r),status:`complete`,endedAt:n,busySince:null});else{let e=Hl(t.sessionId,t.title,void 0,r);o.push(e===t.title?t:{...t,title:e})}s.add(t.sessionId)}for(let e of t){if(s.has(e.sessionId))continue;let t=Fl({statusType:e.statusType,hasPendingPermissions:e.hasPendingPermissions===!0,hasPendingQuestions:e.hasPendingQuestions===!0,hasSessionError:e.hasSessionError===!0})??`working`;o.push({sessionId:e.sessionId,title:e.title,status:t,startedAt:n,busySince:t===`working`?n:null})}return Vl(o)},Wl=e=>e.map(e=>`${e.sessionId}\0${e.title}\0${e.status}\0${e.endedAt??``}`).join(`
|
|
4
|
-
`),Gl=e=>e.map(e=>{let t={sessionId:e.sessionId,title:e.title,status:e.status,startedAt:e.startedAt};return e.endedAt!==void 0&&(t.endedAt=e.endedAt),t}),Kl=(e,t,n,r,i)=>{let a=e.filter(e=>zl(e.status)),o=a[0]??e[0],s={sessionId:Tl,startedAt:o?.startedAt??r,status:t,eventVersion:n,updatedAt:r,title:o?.title,workingCount:a.length,items:Gl(e)};return i?.endedAt!==void 0&&(s.endedAt=i.endedAt),i?.dismissalSeconds!==void 0&&(s.dismissalSeconds=i.dismissalSeconds),s},ql=e=>{let t={sessionId:e.sessionId,startedAt:e.startedAt,status:e.status,eventVersion:e.eventVersion,updatedAt:e.updatedAt};return e.endedAt!==void 0&&(t.endedAt=e.endedAt),e.dismissalSeconds!==void 0&&(t.dismissalSeconds=e.dismissalSeconds),e.title!==void 0&&(t.title=e.title),e.workingCount!==void 0&&(t.workingCount=e.workingCount),e.items!==void 0&&(t.items=e.items),t},Jl=(e,t,n,r)=>{let i=e.trackedSessionId;if(!i||!e.started)return{state:jl(),commands:[]};let a=Ml(t,e.eventVersion);return{state:jl(),commands:[{type:`end`,payload:ql({sessionId:i,startedAt:e.startedAt??t,status:n,eventVersion:a,updatedAt:t,endedAt:t,dismissalSeconds:r})}]}},Yl=(e,t,n,r,i)=>{let a=Ml(r,i);return{state:{trackedSessionId:e,started:!0,startedAt:n,busySince:null,lastStatus:t,eventVersion:a,items:[]},commands:[{type:`start`,payload:ql({sessionId:e,startedAt:n,status:t,eventVersion:a,updatedAt:r})}]}},Xl=(e,t,n)=>{let r=Fl(t),i=e.busySince;if(r===`working`?i??=t.now:(!e.started&&!r||!e.started&&r===`complete`||!e.started&&r===`error`)&&(i=null),!e.started){if(r===`working`){let r=Cl-(t.now-(i??t.now));if(r>0)return{state:{...e,trackedSessionId:n,busySince:i},commands:[{type:`wait`,delayMs:r}]}}else if(!r||!Al.has(r))return{state:{...jl(),trackedSessionId:n},commands:[]};return Yl(n,r,i??t.now,t.now,e.eventVersion)}if(r===`complete`)return Jl({...e,busySince:i},t.now,`complete`,900);if(r===`error`)return Jl({...e,busySince:i},t.now,`error`,wl);if(!r||r===e.lastStatus)return{state:{...e,trackedSessionId:n,busySince:i},commands:[]};let a=Ml(t.now,e.eventVersion);return{state:{trackedSessionId:n,started:!0,startedAt:e.startedAt??t.now,busySince:r===`working`?i:null,lastStatus:r,eventVersion:a,items:e.items},commands:[{type:`update`,payload:ql({sessionId:n,startedAt:e.startedAt??t.now,status:r,eventVersion:a,updatedAt:t.now})}]}},Zl=(e,t,n)=>{let r=e.trackedSessionId;if(!r||!e.started)return{state:e,commands:[]};let i=Ml(n,e.eventVersion);return{state:{...e,busySince:null,lastStatus:t,eventVersion:i},commands:[{type:`update`,payload:ql({sessionId:r,startedAt:e.startedAt??n,status:t,eventVersion:i,updatedAt:n})}]}},Ql=(e,t,n)=>{let r=Ul(e.items,n,t.now,t.sessionTitles,t.rootSessionIds),i=r.filter(e=>zl(e.status)),a=Bl(r),o=i.reduce((e,t)=>{let n=t.busySince??t.startedAt;return e===null||n<e?n:e},null);if(!t.connected){let n=e.busySince===null?e:{...e,busySince:null};if(!n.started||n.lastStatus===`stale`)return{state:{...n,items:r},commands:[]};let i=Ml(t.now,n.eventVersion),a=r.map(e=>zl(e.status)?{...e,status:`stale`}:e);return{state:{...n,items:a,lastStatus:`stale`,eventVersion:i,busySince:null},commands:[{type:`update`,payload:ql(Kl(a,`stale`,i,t.now))}]}}if(!e.started){if(i.length===0)return{state:jl(),commands:[]};if(!i.some(e=>Al.has(e.status))){let n=Cl-(t.now-(o??t.now));if(n>0)return{state:{...e,trackedSessionId:Tl,items:r,busySince:o},commands:[{type:`wait`,delayMs:n}]}}let n=o??t.now,s=r.map(e=>zl(e.status)?{...e,startedAt:e.busySince??n}:e),c=Ml(t.now,e.eventVersion);return{state:{trackedSessionId:Tl,started:!0,startedAt:n,busySince:null,lastStatus:a,eventVersion:c,items:s},commands:[{type:`start`,payload:ql(Kl(s,a,c,t.now))}]}}if(i.length===0){let n=r.some(e=>e.status===`error`)?`error`:`complete`,i=Ml(t.now,e.eventVersion);return{state:jl(),commands:[{type:`end`,payload:ql(Kl(r,n,i,t.now,{endedAt:t.now,dismissalSeconds:n===`error`?wl:900}))}]}}if(Wl(e.items)===Wl(r)&&e.lastStatus===a)return{state:{...e,trackedSessionId:Tl,items:r,busySince:null},commands:[]};let s=Ml(t.now,e.eventVersion);return{state:{trackedSessionId:Tl,started:!0,startedAt:e.startedAt??o??t.now,busySince:null,lastStatus:a,eventVersion:s,items:r},commands:[{type:`update`,payload:ql(Kl(r,a,s,t.now))}]}},$l=(e,t)=>{if(t.catalog)return Ql(e,t,t.catalog);if(!t.connected){let n=e.busySince===null?e:{...e,busySince:null};return!n.started||n.lastStatus===`stale`||!n.trackedSessionId?{state:n,commands:[]}:Zl(n,`stale`,t.now)}let n=[],r=e;if(r.trackedSessionId&&r.trackedSessionId!==t.sessionId)if(r.started){let e=Jl(r,t.now,r.lastStatus??`complete`,0);n.push(...e.commands),r=e.state}else r=jl();if(!t.sessionId){if(r.started){let e=Jl(r,t.now,`complete`,900);return{state:e.state,commands:[...n,...e.commands]}}return{state:jl(),commands:n}}let i=Xl(r,t,t.sessionId);return{state:i.state,commands:[...n,...i.commands]}},eu=e=>e/1e3,tu=e=>{let t={sessionId:e.sessionId,title:e.title,status:e.status,startedAt:eu(e.startedAt)};return e.endedAt!==void 0&&(t.endedAt=eu(e.endedAt)),t},nu=e=>{let t={sessionId:e.sessionId,startedAt:eu(e.startedAt),status:e.status,eventVersion:e.eventVersion,updatedAt:eu(e.updatedAt)};return e.endedAt!==void 0&&(t.endedAt=eu(e.endedAt)),e.dismissalSeconds!==void 0&&(t.dismissalSeconds=e.dismissalSeconds),e.title!==void 0&&(t.title=e.title),e.workingCount!==void 0&&(t.workingCount=e.workingCount),e.items!==void 0&&(t.items=e.items.map(tu)),t},ru=e=>{let t={};return e.title!==void 0&&(t.title=e.title),e.workingCount!==void 0&&(t.workingCount=e.workingCount),e.items!==void 0&&(t.items=e.items),t},iu=(e,t,n)=>{if(!e||n.type===`wait`)return Promise.resolve();let r=nu(n.payload),i=ru(r);return n.type===`start`?t.start({sessionId:r.sessionId,startedAt:r.startedAt,status:r.status,eventVersion:r.eventVersion,updatedAt:r.updatedAt,...i}):n.type===`update`?t.update({sessionId:r.sessionId,startedAt:r.startedAt,status:r.status,eventVersion:r.eventVersion,updatedAt:r.updatedAt,...i}):t.end({sessionId:r.sessionId,startedAt:r.startedAt,status:r.status,eventVersion:r.eventVersion,updatedAt:r.updatedAt,endedAt:r.endedAt,dismissalSeconds:r.dismissalSeconds,...i})},au=e=>e.getCurrentEpoch()===e.epoch?!e.getCurrentSessionId||e.getCurrentSessionId()===e.observation.sessionId:!1,ou=async e=>{let t=e.state;if(!au(e))return{state:t,delayMs:null,retry:!1,superseded:!0};let n=$l(t,e.observation),r=n.commands.find(e=>e.type===`wait`),i=r?.type===`wait`?r.delayMs:null,a=n.commands.filter(e=>e.type!==`wait`);if(a.length===0)return au(e)?{state:n.state,delayMs:i,retry:!1,superseded:!1}:{state:t,delayMs:null,retry:!1,superseded:!0};let o=t;try{for(let[r,i]of a.entries()){if(!au(e)||(await iu(e.available,e.plugin,i),!au(e)))return{state:t,delayMs:null,retry:!1,superseded:!0};let s=r===a.length-1;o=i.type===`end`&&!s?jl():n.state}return{state:n.state,delayMs:i,retry:!1,superseded:!1}}catch{if(!au(e))return{state:t,delayMs:null,retry:!1,superseded:!0};let r=Nl({failedEpoch:e.epoch,currentEpoch:e.getCurrentEpoch(),previous:o,current:n.state}),i=Pl({failedEpoch:e.epoch,currentEpoch:e.getCurrentEpoch(),retryCount:e.retryCount});return{state:r,delayMs:i?250:null,retry:i,superseded:!1}}},su=()=>({desired:null,registered:null}),cu=e=>{if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null},lu=e=>{if(!e||typeof e!=`object`)return null;let t=e,n=cu(t.activityId),r=cu(t.sessionId),i=cu(t.token);return!n||!r||!i?null:{activityId:n,sessionId:r,token:i}},uu=(e,t)=>e.activityId===t.activityId&&e.token===t.token,du=(e,t)=>{let n=e.registered?.runtimeIdentity===t?e.registered:null;return e.desired===null&&n===e.registered?e:{desired:null,registered:n}},fu=(e,t)=>{if(!t.connected)return[];if(e.desired&&t.enabled&&t.selectedSessionId&&e.desired.sessionId===t.selectedSessionId){let n=e.registered;return n&&uu(n,e.desired)&&n.runtimeIdentity===t.runtimeIdentity?[]:[{type:`register`,payload:{activityId:e.desired.activityId,sessionId:e.desired.sessionId,token:e.desired.token},runtimeIdentity:t.runtimeIdentity}]}return e.registered&&e.registered.runtimeIdentity===t.runtimeIdentity?[{type:`unregister`,payload:{token:e.registered.token},runtimeIdentity:t.runtimeIdentity}]:[]},pu=(e,t,n)=>{let r=e;if(n.type===`pushToken`){if(!t.enabled||n.sessionId!==t.selectedSessionId)return{state:e,commands:[]};r={...e,desired:{activityId:n.activityId,sessionId:n.sessionId,token:n.token}}}else n.type===`localEndSucceeded`||n.type===`dispose`||!t.enabled||e.desired&&e.desired.sessionId!==t.selectedSessionId?r=du(e,t.runtimeIdentity):e.registered&&e.registered.runtimeIdentity!==t.runtimeIdentity&&!e.desired&&(r={...e,registered:null});return{state:r,commands:fu(r,t)}},mu=async e=>{try{return await e}catch{return null}},hu=async e=>{let t=e.state;for(let n of e.commands){if(n.runtimeIdentity!==e.getRuntimeIdentity()){n.type===`unregister`&&t.registered?.runtimeIdentity===n.runtimeIdentity&&(t={...t,registered:null});continue}if(n.type===`register`){let r=t.registered;if(n.runtimeIdentity!==e.getRuntimeIdentity()||(await mu(e.register(n.payload)))?.ok!==!0||n.runtimeIdentity!==e.getRuntimeIdentity())continue;if(t={...t,registered:{...n.payload,runtimeIdentity:n.runtimeIdentity}},r&&r.runtimeIdentity===n.runtimeIdentity&&r.token!==n.payload.token){if(n.runtimeIdentity!==e.getRuntimeIdentity())continue;await mu(e.unregister({token:r.token}))}continue}if(n.runtimeIdentity!==e.getRuntimeIdentity()){t.registered?.runtimeIdentity===n.runtimeIdentity&&(t={...t,registered:null});continue}(await mu(e.unregister(n.payload)))?.ok===!0&&t.registered?.token===n.payload.token&&(t={...t,registered:null})}return t},gu=new Map,_u=[];function vu(){let e=Ol(),t=be(e=>e.isConnected),n=ve({enabled:e}),r=De(t=>e?t.statusById:gu),i=le(t=>e?t.activeSessions:_u),a=(0,Z.useMemo)(()=>e?se(n,r):new Set,[e,r,n]),o=(0,Z.useMemo)(()=>e?Rl({runningIds:a,statuses:n,sessions:i}):[],[e,n,a,i]),c=(0,Z.useMemo)(()=>{if(!e)return{};let t={};for(let e of i){let n=e.parentID;if(typeof n==`string`&&n.length>0)continue;let r=typeof e.title==`string`?e.title.trim():``;r&&(t[e.id]=r.length<=80?r:`${r.slice(0,79)}…`)}return t},[e,i]),u=(0,Z.useMemo)(()=>{if(!e)return new Set;let t=new Set;for(let e of i){let n=e.parentID;typeof n==`string`&&n.length>0||t.add(e.id)}return t},[e,i]),d=(0,Z.useMemo)(()=>[o.map(e=>`${e.sessionId}\0${e.title}\0${e.statusType??``}`).join(`
|
|
5
|
-
`),Object.entries(c).map(([e,t])=>`${e}\0${t}`).join(`
|
|
6
|
-
`)].join(`
|
|
7
|
-
---
|
|
8
|
-
`),[o,c]),f=(0,Z.useRef)(jl()),p=(0,Z.useRef)(su()),m=(0,Z.useRef)(null),h=(0,Z.useRef)(0),g=(0,Z.useRef)(Promise.resolve()),_=(0,Z.useRef)(Promise.resolve()),v=(0,Z.useRef)(null),y=L(()=>({sessionId:Tl,statusType:void 0,hasPendingPermissions:!1,hasPendingQuestions:!1,hasSessionError:!1,now:Date.now(),connected:t,catalog:o,sessionTitles:c,rootSessionIds:u})),b=L(n=>{_.current=_.current.then(async()=>{let r=pu(p.current,{selectedSessionId:Tl,runtimeIdentity:l(),connected:t,enabled:e},n);p.current=r.state,r.commands.length!==0&&(p.current=await hu({state:p.current,commands:r.commands,getRuntimeIdentity:l,register:e=>x()?.push?.registerLiveActivityToken?.({...e,items:f.current.items.map(e=>{let t={sessionId:e.sessionId,title:e.title,status:e.status,startedAt:eu(e.startedAt)};return e.endedAt===void 0?t:{...t,endedAt:eu(e.endedAt)}})})??Promise.resolve(null),unregister:e=>x()?.push?.unregisterLiveActivityToken?.(e)??Promise.resolve(null)}))}).catch(()=>void 0)}),S=L(e=>{let t=lu(e);t&&b({type:`pushToken`,...t,sessionId:Tl})});(0,Z.useEffect)(()=>{b({type:e?`sync`:`dispose`})},[e,t]),(0,Z.useEffect)(()=>s(()=>{b({type:`sync`})}),[]),(0,Z.useEffect)(()=>{if(!e){v.current?.remove(),v.current=null;return}let t=!1,n=null,r=0,i=kl(),a=h.current+1;h.current=a;let o=()=>{g.current=g.current.then(async()=>{if(t||h.current!==a)return;if(m.current!==!0){if(m.current===!1)return;let e=await i.isSupported().catch(()=>({supported:!1}));if(t||h.current!==a||(m.current=e.supported===!0,!m.current))return}let e=y(),s=f.current.started,c=await ou({available:!0,plugin:i,state:f.current,observation:e,epoch:a,getCurrentEpoch:()=>h.current,retryCount:r});if(!(t||h.current!==a||c.superseded)){if(f.current=c.state,s&&!c.state.started)b({type:`localEndSucceeded`});else if(c.state.started){let e=p.current.desired;e&&x()?.push?.registerLiveActivityToken?.({activityId:e.activityId,sessionId:Tl,token:e.token,items:c.state.items.map(e=>{let t={sessionId:e.sessionId,title:e.title,status:e.status,startedAt:eu(e.startedAt)};return e.endedAt===void 0?t:{...t,endedAt:eu(e.endedAt)}})})}c.retry?r+=1:r=0,c.delayMs!=null&&(n=setTimeout(()=>{o()},c.delayMs))}}).catch(()=>void 0)};return g.current=g.current.then(async()=>{if(!(t||h.current!==a)&&!v.current)try{let e=await i.addListener(`pushToken`,e=>{S(e)});if(t){await e.remove();return}v.current=e}catch{return}}).then(()=>{!t&&h.current===a&&o()}).catch(()=>void 0),()=>{t=!0,h.current===a&&(h.current+=1),n!==null&&clearTimeout(n)}},[e,t,d]),(0,Z.useEffect)(()=>()=>{v.current?.remove(),v.current=null,b({type:`dispose`})},[])}function yu(){let e=(0,Q.c)(49),t=B(xu),{t:r,locale:i}=tt(),a;e[0]===r?a=e[1]:(a=r(`mobile.notifications.service`),e[0]=r,e[1]=a);let o=a,c;e[2]===r?c=e[3]:(c=r(`settings.page.notifications.title`),e[2]=r,e[3]=c);let l=c,u;e[4]===r?u=e[5]:(u=r(`mobile.connect.connecting`),e[4]=r,e[5]=u);let d=u,f;e[6]===r?f=e[7]:(f=r(`mobile.notifications.connected`),e[6]=r,e[7]=f);let p=f,m;e[8]===r?m=e[9]:(m=r(`layout.browserProvider.status.reconnecting`),e[8]=r,e[9]=m);let h=m,g;e[10]===r?g=e[11]:(g=r(`mobile.notifications.unavailable`),e[10]=r,e[11]=g);let _=g,v;e[12]===r?v=e[13]:(v=r(`mobile.notifications.gap`),e[12]=r,e[13]=v);let y=v,b;e[14]===r?b=e[15]:(b=r(`settings.notifications.page.toast.permissionDenied.title`),e[14]=r,e[15]=b);let x=b,S;e[16]===r?S=e[17]:(S=r(`settings.notifications.page.template.defaults.error.title`),e[16]=r,e[17]=S);let C=S,w;e[18]===r?w=e[19]:(w=r(`mobile.notifications.auth`),e[18]=r,e[19]=w);let T=w,E;e[20]===r?E=e[21]:(E=r(`mobile.notifications.endpoint`),e[20]=r,e[21]=E);let D=E,O;e[22]===r?O=e[23]:(O=r(`mobile.notifications.response`),e[22]=r,e[23]=O);let k=O,A;e[24]===r?A=e[25]:(A=r(`mobile.notifications.server`),e[24]=r,e[25]=A);let j=A,M;e[26]===r?M=e[27]:(M=r(`mobile.notifications.relay`),e[26]=r,e[27]=M);let N=M,ee;e[28]===r?ee=e[29]:(ee=r(`mobile.notifications.identity`),e[28]=r,e[29]=ee);let P=ee,F,I;e[30]!==l||e[31]!==T||e[32]!==p||e[33]!==d||e[34]!==x||e[35]!==t||e[36]!==D||e[37]!==C||e[38]!==y||e[39]!==P||e[40]!==i||e[41]!==h||e[42]!==N||e[43]!==k||e[44]!==j||e[45]!==o||e[46]!==_?(F=()=>{if(!gl())return;if(!t){hl.stop().catch(bu);return}let e=!1,r=t=>{e||(e=!0,X.error(t))},a=vl({plugin:hl,resolveConfig:()=>_l({service:o,alerts:l,connecting:d,connected:p,reconnecting:h,unavailable:_,gap:y,error:C,auth:T,endpoint:D,response:k,server:j,relay:N,identity:P},i),onState:e=>{(e===`denied`||e===`unavailable`)&&r(e===`denied`?x:_)},onError:()=>r(_)}),c=s(()=>{a.refresh()}),u=n(e=>{let{reason:t}=e;t===`invalidate`?a.stop():t!==`endpoint-switch`&&a.refresh()});return a.refresh(),()=>{c(),u(),a.dispose()}},I=[t,i,o,l,d,p,h,_,y,x,C,T,D,k,j,N,P],e[30]=l,e[31]=T,e[32]=p,e[33]=d,e[34]=x,e[35]=t,e[36]=D,e[37]=C,e[38]=y,e[39]=P,e[40]=i,e[41]=h,e[42]=N,e[43]=k,e[44]=j,e[45]=o,e[46]=_,e[47]=F,e[48]=I):(F=e[47],I=e[48]),(0,Z.useEffect)(F,I)}function bu(){console.warn(`[Native notifications] stop failed`)}function xu(e){return e.nativeNotificationsEnabled}var Su=Wt(()=>z(()=>import(`./ChatView-BFrPmZ4J.js`).then(e=>e.n).then(e=>({default:e.ChatView})),__vite__mapDeps([201,1,13,5,4,14,15,16,6,42,34,12,43,44,17,18,19,45,46,7,35,36,37,47,8,9,10,2,48,11,20,51,21,22,23,24,50,41,49,52,25,26,27,28,29,53,54,55,56,30,148,64,202,203,204,205,73,59,74,75,66,76,77,113,206,151,152,153,154,155,156,157,158,159,160,85,86,57,58,79,80,31,123,69,70,124,207,208,32,115,105,209,150,88,161,133,71,60,61,62,116,63,65,67,164,135,210,136,137,211,212,180,99,213,78,81,82,83,84,214,120,121,89,90,134,138,92,139,140,141,142,87,91,215,192,167,193,216,217,218,219,169,125,126,127,220,122,128,129,221,222,223,224,194,225,226,117,168,170,227,228,229]))),Cu=Wt(()=>z(()=>import(`./AssistantView-CWPh6KhU.js`).then(e=>({default:e.AssistantView})),__vite__mapDeps([3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,2,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105]))),wu=Wt(()=>z(()=>import(`./DiffView-C6DEdXdm.js`).then(e=>e.n).then(e=>({default:e.DiffView})),__vite__mapDeps([230,1,4,5,34,12,6,42,13,14,15,16,43,44,17,18,19,45,46,7,35,36,37,47,8,9,10,2,48,11,20,151,152,153,154,155,156,157,158,159,160,21,22,23,24,50,41,49,51,52,25,26,27,28,29,53,54,55,56,30,57,58,79,59,80,31,124,207,74,148,208,32,115,105,231,104,149,81,209,232,150,88,202,203,64,204,205,62,60,61,225]))),Tu=Wt(()=>z(()=>import(`./SettingsView-Dq1ykKpv.js`).then(e=>({default:e.SettingsView})),__vite__mapDeps([144,1,5,4,34,12,13,14,15,145,146,16,6,41,17,18,19,42,43,44,45,46,7,35,36,37,47,8,9,10,2,48,11,20,49,147,51,21,22,23,24,50,52,25,26,27,28,29,53,54,55,56,30,57,58,69,70,124,74,148,32,115,105,104,149,81,150,151,152,153,154,155,156,157,158,159,160,161,133,75,71,162,163,116,63,64,65,66,164,33,39,165,166,112,113,128,121,117,79,59,80,167,168,169,125,126,127,142,170,171,172,98,99,173,174,175,176,177,118,178,179,180,109,108,181,182,120,89,90,140,183,184,119,122,123,129,185,73,76,77,114,68,72,38,97,130,131,186,187,188,189,190,191,192,193,194,195,196,197,198,199]))),Eu=Wt(()=>z(()=>import(`./MobileChangesSurface-G84PMQ4F.js`).then(e=>({default:e.MobileChangesSurface})),__vite__mapDeps([233,1,6,7,47,8,9,10,21,13,5,4,14,15,22,23,24,50,12,34,16,41,17,18,19,42,43,44,45,46,35,36,37,2,48,11,20,49,51,52,25,26,27,28,29,53,54,55,56,30,57,58,79,59,80,31,234,123,69,70,124,207,74,148,208,32,202,203,64,161,235,231,151,152,153,154,155,156,157,158,159,160,115,105,104,149,81,209,232,150,88,204,205,133,75,71]))),Du=Wt(()=>z(()=>import(`./MobileFilesSurface-CXb_s2LT.js`).then(e=>({default:e.MobileFilesSurface})),__vite__mapDeps([236,1,6,7,46,5,4,34,12,13,14,15,35,36,37,47,8,9,10,2,48,18,11,16,17,19,20,151,152,153,154,155,156,157,158,159,160,21,22,23,24,50,41,42,43,44,45,49,51,52,25,26,27,28,29,53,54,55,56,30,57,58,79,59,80,207,74,148,231,32,115,105,104,149,81,209,232,150,88,202,203,64,133,75,71,163,237,238,162,239,60,61,62,116,63,65,66,67,210,164,135,136,137,211]))),Ou=Wt(()=>z(()=>import(`./MobileChatScreen-BxkkAw15.js`).then(e=>({default:e.MobileChatScreen})),__vite__mapDeps([240,1,6,7,36,35,37,4,5,34,12,46,13,14,15,47,8,9,10,2,48,18,21,22,23,50,16,41,17,19,42,43,44,45,11,20,49,51,52,25,26,27,28,29,53,54,55,56,30,39,24,213,124,241,205,128,121,171,172,142,242,243,148]))),ku=Wt(()=>z(()=>import(`./RemoteDesktopPanel-DgiOjJIb.js`).then(e=>({default:e.RemoteDesktopPanel})),__vite__mapDeps([244,1,5,4,34,12,6,41,13,14,15,16,17,18,19,42,43,44,45,46,7,35,36,37,47,8,9,10,2,48,11,20,49,21,22,23,24,25,26,27,28,29,223,133,50,51,52,53,54,55,56,30,75,71,116,137,226]))),Au=Wt(()=>z(()=>import(`./ScheduledTasksDialog-CgzzcaoZ.js`).then(e=>e.t).then(e=>({default:e.ScheduledTasksWorkspace})),__vite__mapDeps([245,1,13,5,4,14,15,6,7,35,36,37,34,12,8,9,10,11,16,17,18,19,20,2,21,22,23,24,50,41,42,43,44,45,46,47,48,49,51,52,25,26,27,28,29,53,54,55,56,30,57,58,79,59,80,69,70,115,105,104,81,133,75,71,116,33,73,74,66,76,77,39,212,214,85,86,211,82,83,84,192,92,117,32,168,98,99,97,177,109,102,119,120,121,122,123,124,125,126,127,128,129,185,246])));function ju(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(lr,{children:(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(Ou,{...e})})}),t[0]=e,t[1]=n),n}function Mu(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(lr,{children:(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(Su,{...e})})}),t[0]=e,t[1]=n),n}function Nu(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(lr,{children:(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(wu,{...e})})}),t[0]=e,t[1]=n),n}function Pu(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(lr,{children:(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(Du,{...e})})}),t[0]=e,t[1]=n),n}function Fu(e){let t=(0,Q.c)(2),n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(lr,{children:(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(Eu,{...e})})}),t[0]=e,t[1]=n),n}function Iu(){let e=(0,Q.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,$.jsx)(lr,{children:(0,$.jsx)(mo,{})}),e[0]=t):t=e[0],t}var Lu=`mobile-direct-diff`,Ru=`mobile-turn-diff`,zu=`mobile-direct-file`,Bu=`mobile-files`,Vu=`mobile-changes`,Hu=`mobile-mcp`,Uu=`mobile-settings`,Wu=`mobile-update`,Gu=`mobile-overflow-menu`,Ku=320,qu=380,Ju=280,Yu=560,Xu=380,Zu=e=>Math.min(Yu,Math.max(Ju,Math.round(e))),Qu=(e,t)=>{let n=e.current;n&&(n.style.width=`${t}px`,n.style.minWidth=`${t}px`,n.style.maxWidth=`${t}px`,n.style.setProperty(`--yuri-ipad-sidebar-width`,`${t}px`))};function $u(e,t,n){let r=(0,Q.c)(17),i=Z.useRef(null),a;r[0]!==n||r[1]!==t?(a=()=>{if(typeof window>`u`)return n;let e=Number.parseInt(window.localStorage.getItem(t)??``,10);return Number.isFinite(e)?Math.min(Yu,Math.max(Ju,e)):n},r[0]=n,r[1]=t,r[2]=a):a=r[2];let[o,s]=Z.useState(a),[c,l]=Z.useState(!1),u=Z.useRef(0),d=Z.useRef(o),f=Z.useRef(null),p=Z.useRef(null),m;r[3]===o?m=r[4]:(m=e=>{try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}p.current=e.pointerId,u.current=e.clientX,d.current=o,f.current=o,l(!0),e.preventDefault()},r[3]=o,r[4]=m);let h=L(m),g;r[5]===e?g=r[6]:(g=t=>{if(p.current!==t.pointerId)return;let n=t.clientX-u.current,r=Zu(d.current+(e===`left`?n:-n));f.current!==r&&(f.current=r,Qu(i,r))},r[5]=e,r[6]=g);let _=L(g),v;r[7]===t?v=r[8]:(v=e=>{if(p.current!==e.pointerId)return;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}let n=Zu(f.current??d.current);p.current=null,f.current=null,l(!1),s(n);try{window.localStorage.setItem(t,String(n))}catch{}},r[7]=t,r[8]=v);let y=L(v),b;r[9]!==h||r[10]!==y||r[11]!==_?(b={onPointerDown:h,onPointerMove:_,onPointerUp:y,onPointerCancel:y},r[9]=h,r[10]=y,r[11]=_,r[12]=b):b=r[12];let x=b,S;return r[13]!==x||r[14]!==c||r[15]!==o?(S={asideRef:i,width:o,isResizing:c,handleProps:x},r[13]=x,r[14]=c,r[15]=o,r[16]=S):S=r[16],S}var ed=e=>{let t=(0,Q.c)(12),{side:n,isResizing:r,ariaLabel:i,handleProps:a}=e,o=n===`left`?`right-0`:`left-0`,s;t[0]===o?s=t[1]:(s=U(`absolute inset-y-0 z-30 w-6 cursor-col-resize touch-none`,o),t[0]=o,t[1]=s);let c=n===`left`?`right-0`:`left-0`,l=r&&`bg-[var(--interactive-border)]`,u;t[2]!==c||t[3]!==l?(u=U(`absolute inset-y-0 w-[3px] transition-colors`,c,l),t[2]=c,t[3]=l,t[4]=u):u=t[4];let d;t[5]===u?d=t[6]:(d=(0,$.jsx)(`div`,{className:u}),t[5]=u,t[6]=d);let f;return t[7]!==i||t[8]!==a||t[9]!==s||t[10]!==d?(f=(0,$.jsx)(`div`,{className:s,role:`separator`,"aria-orientation":`vertical`,"aria-label":i,...a,children:d}),t[7]=i,t[8]=a,t[9]=s,t[10]=d,t[11]=f):f=t[11],f},td=()=>typeof window>`u`?!1:window.Capacitor?.isNativePlatform?.()===!0||window.location.protocol===`capacitor:`,nd=()=>{Z.useEffect(()=>{if(!td())return;document.documentElement.classList.add(`yuri-native-app-active`);let e=!1,t=[],n=document.documentElement;n.classList.add(`yuri-capacitor-app`),window.Capacitor?.getPlatform?.()===`android`&&n.classList.add(`yuri-platform-android`);let r=e=>{n.style.setProperty(`--yuri-keyboard-inset`,`${Math.max(0,Math.round(e))}px`)};return z(async()=>{let{StatusBar:e,Style:t}=await import(`./vendor-capacitor-status-bar-D9bcMr9Q.js`).then(e=>e.t);return{StatusBar:e,Style:t}},__vite__mapDeps([247,1,2])).then(async({StatusBar:n,Style:r})=>{if(e)return;let i=window.Capacitor?.getPlatform?.(),a=async()=>{if(i===`android`){let e=document.documentElement.classList.contains(`dark`),t=(e?localStorage.getItem(`splashBgDark`):localStorage.getItem(`splashBgLight`))||(e?`#121212`:`#FFFFFF`);await n.setOverlaysWebView({overlay:!1}).catch(()=>void 0),await n.setBackgroundColor({color:t}).catch(()=>void 0),await n.setStyle({style:e?r.Dark:r.Light}).catch(()=>void 0),await n.show().catch(()=>void 0);return}await n.setStyle({style:r.Default}).catch(()=>void 0),await n.setOverlaysWebView({overlay:!0}).catch(()=>void 0),await n.show().catch(()=>void 0)};await a();let o=window.setTimeout(()=>void a(),400);t.push(()=>window.clearTimeout(o));let{App:s}=await z(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])),c=await s.addListener(`appStateChange`,({isActive:e})=>{if(e&&a(),!e&&i===`ios`){let e=document.activeElement;e instanceof HTMLElement&&Go(e)&&e.blur()}});if(e){c.remove();return}t.push(()=>void c.remove())}).catch(()=>void 0),z(async()=>{let{Keyboard:e}=await import(`./vendor-capacitor-keyboard-BRVcFyc9.js`).then(e=>e.t);return{Keyboard:e}},__vite__mapDeps([248,1,2])).then(async({Keyboard:i})=>{if(e)return;let a=window.Capacitor?.getPlatform?.(),o=a===`android`;await i.setAccessoryBarVisible({isVisible:!1}).catch(()=>void 0);let s=`cubic-bezier(0.38, 0.7, 0.125, 1)`,c=null,l=null,u=0,d=!1,f=0,p=!1,m=(e,t)=>{n.style.setProperty(e,`${Math.max(0,Math.round(t))}px`)},h=()=>{c!==null&&(window.clearTimeout(c),c=null)},g=(e,t)=>{window.dispatchEvent(new CustomEvent(e,{detail:t}))},_=e=>e.getClientRects().length>0&&getComputedStyle(e).visibility!==`hidden`,v=e=>{for(let t of document.querySelectorAll(e))if(_(t))return t;return null},y=e=>e instanceof HTMLElement&&(e.tagName===`TEXTAREA`||e.tagName===`INPUT`||e.isContentEditable),b=()=>{for(let e of document.querySelectorAll(`.yuri-mobile-composer, .yuri-draft-center`))e.style.transition=``,e.style.transform=``},x=()=>{let e=document.querySelector(`.yuri-mobile-app-shell`);f=e&&parseFloat(getComputedStyle(e).paddingBottom)||0},S=!o&&a===`ios`,C=null,w=()=>{let e=document.activeElement,t=!(S&&Wo(n.classList.contains(`yuri-native-ios-composer`),e))&&(y(e)?Go(e):C===!0);t!==C&&(C=t,r(t?0:u),m(`--yuri-kb-layout`,0),x(),m(`--yuri-kb-scroll-inset`,t?0:Math.max(0,u-f)),n.classList.remove(`yuri-keyboard-open`,`yuri-kb-animating`,`yuri-kb-caret-hold`,`yuri-kb-hide`),d=!1,p=!t&&u>0,n.classList.toggle(`yuri-native-ime`,t),zo.setImeSync({enabled:t}).catch(()=>void 0))};if(o||S){r(0),m(`--yuri-kb-layout`,0),m(`--yuri-kb-scroll-inset`,0);let i=e=>{let t=e;if(S&&!C)return;let i=t.detail??t;if(typeof i.open!=`boolean`)return;if(typeof i.height==`number`&&(u=i.open?i.height/(o&&window.devicePixelRatio||1):0),o&&!C){r(u),x(),m(`--yuri-kb-scroll-inset`,Math.max(0,u-f)),n.classList.remove(`yuri-keyboard-open`,`yuri-kb-animating`),g(`yuri:keyboard-settled`,{open:i.open,nativeResize:!1});return}let a=i.phase===`start`;if(n.classList.toggle(`yuri-keyboard-open`,i.open||a),n.classList.toggle(`yuri-kb-animating`,a),a){g(`yuri:keyboard-anim`,{phase:i.open?`show`:`hide`,durationMs:i.durationMs??0,nativeResize:!0});return}let s=Go(document.activeElement);o&&!i.open&&y(document.activeElement)&&s&&document.activeElement.blur(),!i.open&&(o||!s)&&g(`yuri:keyboard-intent`,{open:!1}),g(`yuri:keyboard-settled`,{open:i.open,nativeResize:!0})};window.addEventListener(`yuri:ime-state`,i),t.push(()=>window.removeEventListener(`yuri:ime-state`,i)),e||t.push(Vo()),w(),document.addEventListener(`focusin`,w,!0);let a=new MutationObserver(w);if(a.observe(n,{attributes:!0,attributeFilter:[`class`]}),t.push(()=>{a.disconnect(),document.removeEventListener(`focusin`,w,!0),n.classList.remove(`yuri-native-ime`),zo.setImeSync({enabled:!1}).catch(()=>void 0)}),o)return}let T=()=>!(S&&C),E=`yuri.iosImeHeightRatio.v1`,D=e=>Number.isFinite(e)?Math.min(.68,Math.max(.28,e)):.39,O=()=>{try{let e=D(Number.parseFloat(localStorage.getItem(E)??``));return Math.round(window.innerHeight*e)}catch{return Math.round(window.innerHeight*.39)}},k=e=>{if(!(e<=0||window.innerHeight<=0))try{localStorage.setItem(E,String(D(e/window.innerHeight)))}catch{}},A=e=>{x();let t=Math.max(0,e-f);r(e),m(`--yuri-kb-layout`,e),m(`--yuri-kb-scroll-inset`,0),d=!0,b(),window.scrollTo(0,0),document.body.scrollTop!==0&&(document.body.scrollTop=0);let n=document.activeElement instanceof Element?document.activeElement.closest(`.yuri-mobile-composer`):null;return(n&&_(n)?n:v(`.yuri-mobile-composer`))?.scrollIntoView({block:`end`,inline:`nearest`}),t},j=e=>{if(!T()||Wo(n.classList.contains(`yuri-native-ios-composer`),document.activeElement)||e.detail?.open!==!0||d||y(document.activeElement)&&!Go(document.activeElement))return;p=!0,n.classList.remove(`yuri-kb-hide`),n.classList.add(`yuri-keyboard-open`);let t=u>0?u:O(),r=A(t);g(`yuri:keyboard-anim`,{phase:`show`,slide:r,durationMs:0,easing:s}),g(`yuri:keyboard-settled`,{open:!0})};window.addEventListener(`yuri:keyboard-intent`,j);let M=await i.addListener(`keyboardWillShow`,e=>{if(!T()||Wo(n.classList.contains(`yuri-native-ios-composer`),document.activeElement))return;h(),u=e.keyboardHeight,k(u);let t=Go(document.activeElement)||n.classList.contains(`yuri-keyboard-open`)&&!y(document.activeElement);if(p=!0,n.classList.remove(`yuri-kb-hide`),l!==null&&(window.clearTimeout(l),l=null),!t){r(u),m(`--yuri-kb-layout`,0),x(),m(`--yuri-kb-scroll-inset`,Math.max(0,u-f)),n.classList.remove(`yuri-keyboard-open`,`yuri-kb-animating`,`yuri-kb-caret-hold`),b(),d=!1,g(`yuri:keyboard-settled`,{open:!0});return}n.classList.add(`yuri-keyboard-open`);let i=A(u);g(`yuri:keyboard-settled`,{open:!0}),g(`yuri:keyboard-anim`,{phase:`show`,slide:i,durationMs:0,easing:s})}),N=()=>{p||(window.scrollTo(0,0),document.body.scrollTop!==0&&(document.body.scrollTop=0))},ee=()=>{p=!1,h(),l!==null&&(window.clearTimeout(l),l=null),n.classList.remove(`yuri-keyboard-open`,`yuri-kb-animating`,`yuri-kb-caret-hold`,`yuri-kb-hide`),r(0),m(`--yuri-kb-scroll-inset`,0),m(`--yuri-kb-layout`,0),d=!1,b(),N(),window.setTimeout(N,350)},P=()=>{if(!T())return;if(n.classList.contains(`yuri-native-ios-composer`)){ee(),g(`yuri:keyboard-settled`,{open:!1});return}if(!p)return;p=!1,h(),Go(document.activeElement)||g(`yuri:keyboard-intent`,{open:!1}),l!==null&&(window.clearTimeout(l),l=null),n.classList.remove(`yuri-kb-caret-hold`,`yuri-kb-animating`);let e=Math.max(0,u-f);n.classList.remove(`yuri-keyboard-open`),r(0),m(`--yuri-kb-scroll-inset`,0),m(`--yuri-kb-layout`,0),d=!1,b(),N(),window.setTimeout(N,350),g(`yuri:keyboard-anim`,{phase:`hide`,slide:e,durationMs:0,easing:s}),n.classList.add(`yuri-kb-animating`,`yuri-kb-hide`),c=window.setTimeout(()=>{c=null,n.classList.remove(`yuri-kb-animating`,`yuri-kb-hide`),g(`yuri:keyboard-settled`,{open:!1})},260)},F=await i.addListener(`keyboardWillHide`,P),I=e=>e instanceof HTMLElement&&(e.tagName===`TEXTAREA`||e.tagName===`INPUT`||e.isContentEditable),L=e=>{if(T()&&p&&I(e.target)){if(Ko(e.relatedTarget)){m(`--yuri-kb-scroll-inset`,0);return}window.setTimeout(()=>{if(p&&!Go(document.activeElement)){if(I(document.activeElement)){h(),n.classList.remove(`yuri-keyboard-open`,`yuri-kb-animating`,`yuri-kb-caret-hold`,`yuri-kb-hide`),r(u),m(`--yuri-kb-layout`,0),x(),m(`--yuri-kb-scroll-inset`,Math.max(0,u-f)),d=!1,b(),g(`yuri:keyboard-intent`,{open:!1}),g(`yuri:keyboard-settled`,{open:!0});return}P()}},0)}};if(document.addEventListener(`focusout`,L,!0),e){h(),document.removeEventListener(`focusout`,L,!0),window.removeEventListener(`yuri:keyboard-intent`,j),M.remove(),F.remove();return}t.push(h,()=>{l!==null&&(window.clearTimeout(l),l=null)},()=>document.removeEventListener(`focusout`,L,!0),()=>window.removeEventListener(`yuri:keyboard-intent`,j),()=>void M.remove(),()=>void F.remove())}).catch(()=>void 0),()=>{e=!0,t.forEach(e=>e()),n.classList.remove(`yuri-capacitor-app`,`yuri-keyboard-open`,`yuri-kb-animating`,`yuri-kb-hide`,`yuri-kb-caret-hold`,`yuri-platform-android`),n.style.removeProperty(`--yuri-keyboard-inset`),n.style.removeProperty(`--yuri-kb-shift`),n.style.removeProperty(`--yuri-kb-layout`),n.style.removeProperty(`--yuri-kb-scroll-inset`)}},[])},rd=e=>{let t=Z.useRef(!1);Z.useEffect(()=>{if(!td())return;let n=!1,r=[],i=()=>{t.current&&(t.current=!1,e())},a=()=>{if(document.visibilityState===`hidden`){t.current=!0;return}i()};return document.addEventListener(`visibilitychange`,a),r.push(()=>document.removeEventListener(`visibilitychange`,a)),z(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])).then(async({App:e})=>{if(n)return;let a=await e.getState().catch(()=>null);if(n)return;a&&document.documentElement.classList.toggle(`yuri-native-app-active`,a.isActive);let o=await e.addListener(`appStateChange`,({isActive:e})=>{if(document.documentElement.classList.toggle(`yuri-native-app-active`,e),!e){t.current=!0;return}i()}),s=await e.addListener(`resume`,i);if(n){o.remove(),s.remove();return}r.push(()=>void o.remove(),()=>void s.remove())}).catch(()=>void 0),()=>{n=!0,r.forEach(e=>e()),document.documentElement.classList.remove(`yuri-native-app-active`)}},[e])},id=e=>{Z.useEffect(()=>{if(!td())return;let t=!1,n=null;return z(async()=>{let{App:e}=await import(`./vendor-capacitor-app-B5H_XtmE.js`).then(e=>e.t);return{App:e}},__vite__mapDeps([0,1,2])).then(async({App:r})=>{if(t)return;let i=await r.addListener(`backButton`,()=>{e()||r.minimizeApp().catch(()=>void 0)});if(t){i.remove();return}n=()=>void i.remove()}).catch(()=>void 0),()=>{t=!0,n?.()}},[e])},ad=e=>(e||``).replace(/\\/g,`/`).replace(/\/+$/g,``),od={autoComplete:`off`,autoCorrect:`off`,spellCheck:!1},sd=1e3,cd=e=>{let t=ad(e);if(!t)return``;let n=t.split(`/`).filter(Boolean);return n[n.length-1]||t},ld=(e,t)=>cd(e?e.path:t),ud=({connection:e,onActiveConnectionDeleted:t,onConnect:n})=>{let{t:r}=tt(),i=e,{connections:a,isBusy:o,isPasswordBusy:s,error:c,pendingConnection:l,connect:u,submitPassword:d,cancelPassword:f,renameConnection:p,removeConnection:m,subscribeConnected:h,setError:g}=i,[_,v]=Z.useState(null),y=_?a.find(e=>e.id===_)??null:null,[b,x]=Z.useState(null),[S,C]=Z.useState(``),[w,T]=Z.useState(``),[E,D]=Z.useState(!1),O=Z.useId(),k=Z.useId(),[A,j]=Z.useState(``),[M,N]=Z.useState(!1),ee=Z.useMemo(()=>to(),[]),[P,F]=Z.useState(null),[I,te]=Z.useState(null),R=L(()=>{D(!1),T(``),n()});Z.useEffect(()=>h(R),[R,h]);let z=L(()=>{v(null),C(``),te(null),g(null),D(!1)}),B=L(()=>{o||M||(D(!1),g(null))}),ne=L(()=>{o||M||z()}),re=L(e=>{e.preventDefault(),!(!_||!S.trim())&&p(_,S).then(e=>{e&&z()})}),ie=L(e=>{i.redeemPairingConnection(e)}),ae=L(()=>{g(r(`mobile.connect.link.invalid`))}),oe=L(async()=>{if(!M){g(null),te(null),N(!0);try{let e=await no();switch(e.status){case`ok`:await u({url:e.url,label:e.label,clientToken:e.clientToken});break;case`pairing`:await i.redeemPairingConnection(e.pairing);break;case`permission-denied`:g(r(`mobile.connect.scan.permissionDenied`));break;case`invalid`:g(r(`mobile.connect.scan.invalid`));break;case`unsupported`:g(r(`mobile.connect.scan.unsupported`));break;case`failed`:g(r(`mobile.connect.scan.failed`))}}catch{g(r(`mobile.connect.scan.failed`))}finally{N(!1)}}}),V=L(e=>{e.preventDefault(),d(A)}),se=L(()=>{j(``),f()}),G=L(e=>{x(t=>t===e?null:e)}),ce=L(e=>{x(null),_===e&&z();let n=a.length===1;m(e).then(e=>{e&&(n||Xt(e))&&t()})});if(l)return l.reason===`pairing`?(0,$.jsx)(`div`,{className:`yuri-settings-page-content`,children:(0,$.jsx)(Ci,{label:r(`mobile.connect.pairing.expired`),itemId:`instances.manage`,children:(0,$.jsxs)(`div`,{className:`yuri-settings-group-row flex flex-col gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(W,{name:`computer`,className:`size-6 shrink-0 text-muted-foreground`}),(0,$.jsx)(`p`,{className:`min-w-0 flex-1 truncate typography-ui-label`,children:l.label}),a.some(e=>e.id===l.id)?(0,$.jsx)(H,{variant:`ghost`,size:`icon`,disabled:o||M,"aria-label":r(`mobile.instances.deleteAria`,{label:l.label}),onClick:()=>{x(l.id),se()},children:(0,$.jsx)(W,{name:`delete-bin`,className:`size-5`})}):null]}),(0,$.jsx)(`p`,{className:`typography-small text-muted-foreground`,children:r(`mobile.connect.pairing.reconnectHint`)}),c?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:c}):null,ee?(0,$.jsxs)(H,{size:`lg`,disabled:o||M,onClick:()=>void oe(),children:[(0,$.jsx)(W,{name:`scan-2`,className:`size-5`}),r(`mobile.connect.scanQr`)]}):null,(0,$.jsx)(H,{variant:ee?`ghost`:`default`,size:`lg`,disabled:o||M,onClick:()=>{se(),D(!0)},children:r(`mobile.connect.link.useLink`)})]})})}):(0,$.jsx)(`div`,{className:`yuri-settings-page-content`,children:(0,$.jsx)(Ci,{label:r(`mobile.connect.password.label`),itemId:`instances.manage`,children:(0,$.jsxs)(`form`,{className:`yuri-settings-group-row flex flex-col gap-3`,onSubmit:V,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 rounded-[18px] border border-border/70 bg-surface-elevated px-3.5 py-3`,children:[(0,$.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-[12px] bg-interactive-hover text-foreground`,children:(0,$.jsx)(W,{name:`lock`,className:`size-[18px]`})}),(0,$.jsxs)(`div`,{className:`min-w-0`,children:[(0,$.jsx)(`p`,{className:`truncate typography-ui-label text-foreground`,children:l.label}),(0,$.jsx)(`p`,{className:`truncate typography-small text-muted-foreground`,children:l.candidates.some(e=>e.kind===`direct`)?en(l):r(`mobile.connect.relay.badge`)})]})]}),(0,$.jsx)(`input`,{...od,value:A,onChange:e=>j(e.target.value),placeholder:r(`mobile.connect.password.placeholder`),"aria-label":r(`mobile.connect.password.label`),type:`password`,autoFocus:!0,className:`h-12 w-full rounded-[16px] border border-border/70 bg-surface-elevated px-4 text-[16px] text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20`}),c?(0,$.jsx)(`p`,{role:`alert`,className:`px-1 typography-small text-[var(--status-error)]`,children:c}):null,(0,$.jsx)(H,{type:`submit`,size:`lg`,className:`mt-1 h-12 w-full`,disabled:s||!A.trim(),children:r(s?`mobile.connect.connecting`:`mobile.connect.unlockButton`)}),(0,$.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,className:`w-full`,onClick:se,children:r(`mobile.connect.cancelPassword`)})]})})});let le=(0,$.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:re,children:[(0,$.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,$.jsx)(`span`,{className:`block typography-ui-label text-foreground`,children:r(`mobile.instances.label.label`)}),(0,$.jsx)(Ut,{value:S,onChange:e=>C(e.target.value),placeholder:r(`mobile.instances.label.placeholder`),autoComplete:`off`,autoCapitalize:`words`,autoCorrect:`off`,spellCheck:!1,maxLength:120,autoFocus:!0,disabled:o||M,className:`h-12 w-full text-[16px]`})]}),c?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:c}):null,(0,$.jsx)(H,{type:`submit`,size:`lg`,className:`w-full`,disabled:o||M||!S.trim(),children:r(`mobile.instances.saveEdit`)})]});return(0,$.jsxs)(`div`,{className:`yuri-settings-page-content`,children:[(0,$.jsx)(Ci,{label:r(`mobile.connect.saved.title`),itemId:`instances.manage`,children:a.length>0?a.map(e=>{let t=b===e.id,n=Xt(e),i=P===e.id,a=r(i?`mobile.connect.connecting`:n?`mobile.instances.status.connected`:`mobile.instances.status.saved`);return(0,$.jsxs)(Z.Fragment,{children:[(0,$.jsxs)(`div`,{className:U(`yuri-settings-group-row relative flex items-center`,t&&`bg-[color-mix(in_srgb,var(--destructive)_8%,transparent)]`),children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":r(`desktopHostSwitcher.actions.switchToAria`,{instance:e.label}),"data-mobile-press-feedback":`none`,className:`absolute inset-0 z-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary disabled:pointer-events-none`,onClick:()=>{n||(g(null),te(e.id),F(e.id),u({id:e.id,candidates:e.candidates,clientToken:e.clientToken,label:e.label}).finally(()=>F(null)))},disabled:n||o&&!i||t,style:{touchAction:`manipulation`}}),(0,$.jsxs)(`div`,{className:`pointer-events-none relative z-[1] flex min-w-0 flex-1 items-center gap-3`,children:[(0,$.jsx)(`span`,{className:`relative flex size-9 shrink-0 items-center justify-center rounded-[12px] bg-interactive-hover text-foreground`,children:(0,$.jsx)(W,{name:`server`,className:`size-[18px]`})}),(0,$.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:(0,$.jsx)(`span`,{className:`block truncate typography-ui-label text-foreground`,children:e.label})}),(0,$.jsx)(`span`,{className:U(`block truncate typography-small`,n&&!i?`text-[var(--status-success)]`:`text-muted-foreground`),children:a})]})]}),(0,$.jsxs)(`div`,{className:`relative z-10 flex shrink-0 items-center gap-0.5 pr-2`,children:[t?(0,$.jsxs)(`button`,{type:`button`,"aria-label":r(`mobile.instances.confirmDeleteAria`,{label:e.label}),className:`flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-destructive px-3 text-destructive-foreground transition-opacity active:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive`,onClick:()=>ce(e.id),style:{touchAction:`manipulation`},children:[(0,$.jsx)(W,{name:`delete-bin`,className:`size-[18px]`}),(0,$.jsx)(`span`,{className:`typography-ui-label`,children:r(`mobile.instances.delete`)})]}):i?(0,$.jsx)(`span`,{className:`flex size-9 items-center justify-center text-muted-foreground`,"aria-hidden":!0,children:(0,$.jsx)(W,{name:`loader-4`,className:`size-[18px] animate-spin`})}):(0,$.jsx)(`button`,{type:`button`,"aria-label":r(`mobile.instances.edit`),className:`flex size-9 items-center justify-center rounded-full text-muted-foreground transition-colors active:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,onClick:()=>{v(e.id),C(e.label),te(null),g(null)},style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`edit`,className:`size-[18px]`})}),(0,$.jsx)(`button`,{type:`button`,"aria-label":r(t?`mobile.instances.cancelDeleteAria`:`mobile.instances.deleteAria`,{label:e.label}),className:`flex size-9 items-center justify-center rounded-full text-muted-foreground transition-colors active:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,onClick:()=>G(e.id),style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:t?`close`:`delete-bin`,className:`size-[18px]`})})]})]}),c&&I===e.id&&!t?(0,$.jsx)(`div`,{className:`yuri-settings-group-row`,role:`alert`,children:(0,$.jsx)(`p`,{className:`typography-small text-[var(--status-error)]`,children:c})}):null]},e.id)}):(0,$.jsx)(`div`,{className:`yuri-settings-group-row flex items-center justify-center text-center typography-small text-muted-foreground`,children:r(`mobile.connect.saved.empty`)})}),(0,$.jsx)(Ci,{label:r(`mobile.instances.addTitle`),children:(0,$.jsxs)(`div`,{className:`yuri-settings-group-row flex flex-col gap-3`,children:[ee?(0,$.jsxs)(H,{type:`button`,size:`lg`,className:`w-full`,onClick:()=>void oe(),disabled:o||M,children:[(0,$.jsx)(W,{name:`scan-2`,className:U(`size-[18px]`,M&&`animate-pulse`)}),r(`mobile.connect.scanQr`)]}):null,(0,$.jsx)(H,{type:`button`,variant:ee?`ghost`:`default`,size:`lg`,className:`w-full`,disabled:o||M,onClick:()=>{te(null),g(null),D(!0)},children:r(`mobile.connect.link.useLink`)}),c&&!E&&!y&&!I?(0,$.jsx)(`p`,{role:`alert`,className:`typography-small text-[var(--status-error)]`,children:c}):null]})}),(0,$.jsx)(lt,{id:`mobile-instance-edit-${k}`,open:y!==null,onOpenChange:e=>{e||ne()},fitContent:!0,ariaLabel:r(`mobile.instances.editTitle`),closeAriaLabel:r(`mobile.surface.closeAria`),resizeAriaLabel:r(`mobile.connect.options.resize`),children:(0,$.jsx)(ot,{className:`px-5 pb-5 pt-1`,disableHorizontal:!0,fillContainer:!1,children:le})}),(0,$.jsx)(lt,{id:`mobile-instance-add-${O}`,open:E,onOpenChange:e=>{e||B()},fitContent:!0,title:(0,$.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold`,children:r(`mobile.connect.link.useLink`)}),ariaLabel:r(`mobile.connect.link.useLink`),closeAriaLabel:r(`mobile.surface.closeAria`),resizeAriaLabel:r(`mobile.connect.options.resize`),children:(0,$.jsx)(ot,{className:`px-5 py-5`,disableHorizontal:!0,fillContainer:!1,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsx)(`p`,{className:`typography-small text-muted-foreground`,children:r(`mobile.connect.link.help`)}),(0,$.jsx)(io,{value:w,onValueChange:e=>{T(e),g(null)},showPasteButton:!0,disabled:o||M,isBusy:o,inputClassName:`min-w-0 flex-1 text-[16px]`,buttonVariant:`default`,buttonClassName:`yuri-welcome-primary w-full`,error:c,onRedeem:ie,onInvalid:ae})]})})})]})},dd=e=>{let t=e.usedPercent;return typeof t!=`number`||!Number.isFinite(t)?`text-foreground`:t>=80?`text-[var(--status-error)]`:t>=50?`text-[var(--status-warning)]`:`text-foreground`},fd=e=>{let t=(0,Q.c)(13),{icon:n,iconNode:r,label:i,children:a}=e,o;t[0]!==n||t[1]!==r?(o=r??(n?(0,$.jsx)(W,{name:n,className:`size-[18px]`}):null),t[0]=n,t[1]=r,t[2]=o):o=t[2];let s;t[3]===o?s=t[4]:(s=(0,$.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center text-muted-foreground`,children:o}),t[3]=o,t[4]=s);let c;t[5]===i?c=t[6]:(c=(0,$.jsx)(`span`,{className:`shrink-0 typography-ui-label text-muted-foreground`,children:i}),t[5]=i,t[6]=c);let l;t[7]===a?l=t[8]:(l=(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-right typography-ui-label font-medium text-foreground`,children:a}),t[7]=a,t[8]=l);let u;return t[9]!==s||t[10]!==c||t[11]!==l?(u=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 rounded-xl px-2.5 py-2.5`,children:[s,c,l]}),t[9]=s,t[10]=c,t[11]=l,t[12]=u):u=t[12],u},pd=e=>{let t=(0,Q.c)(55),{open:n,onClose:r,anchorRef:i,contextDisplay:a,branchLabel:o,usageGroups:s,usageDisplayMode:c,isUsageLoading:l,timeFormatPreference:u}=e,{t:d}=tt(),f=Z.useRef(null),[p,m]=Z.useState(n),[h,g]=Z.useState(!1),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=_(),t[0]=v):v=t[0];let y=v,b=Z.useRef(null),[x,S]=Z.useState(null),C,w;t[1]!==i||t[2]!==n||t[3]!==p?(C=()=>{if(!n||!y||!p)return;let e=()=>{let e=i.current?.getBoundingClientRect(),t=b.current?.getBoundingClientRect();if(!e||!t){S(null);return}let n=e.left-t.left,r=Math.min(Math.max(n,8),Math.max(8,t.width-Xu-8));S(r)};e();let t=b.current;if(typeof ResizeObserver>`u`||!t)return;let r=new ResizeObserver(e);return r.observe(t),()=>r.disconnect()},w=[i,y,n,p],t[1]=i,t[2]=n,t[3]=p,t[4]=C,t[5]=w):(C=t[4],w=t[5]),Z.useLayoutEffect(C,w);let T=y&&x!==null,E,D;t[6]!==n||t[7]!==p?(E=()=>{if(n){m(!0),g(!1);return}if(!p)return;g(!0);let e=window.setTimeout(()=>{m(!1),g(!1)},140);return()=>window.clearTimeout(e)},D=[n,p],t[6]=n,t[7]=p,t[8]=E,t[9]=D):(E=t[8],D=t[9]),Z.useEffect(E,D);let O,k;t[10]!==r||t[11]!==n?(O=()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},k=[r,n],t[10]=r,t[11]=n,t[12]=O,t[13]=k):(O=t[12],k=t[13]),Z.useEffect(O,k);let A,j;if(t[14]!==i||t[15]!==r||t[16]!==n?(A=()=>{if(!n)return;let e=e=>{let t=e.target;if(!(t instanceof Node)){r();return}f.current?.contains(t)||i.current?.contains(t)||r()};return document.addEventListener(`pointerdown`,e,!0),document.addEventListener(`wheel`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0),document.removeEventListener(`wheel`,e,!0)}},j=[i,r,n],t[14]=i,t[15]=r,t[16]=n,t[17]=A,t[18]=j):(A=t[17],j=t[18]),Z.useEffect(A,j),!p)return null;let M;t[19]===d?M=t[20]:(M=d(`mobile.header.openMetadataAria`),t[19]=d,t[20]=M);let N=T?`absolute origin-top-left`:`mx-3 mt-2`,ee=h?`pointer-events-none`:`pointer-events-auto`,P;t[21]!==N||t[22]!==ee?(P=U(`overflow-x-hidden overflow-y-auto overscroll-contain rounded-[20px] yuri-mobile-overlay-surface p-2 will-change-transform`,N,ee),t[21]=N,t[22]=ee,t[23]=P):P=t[23];let F=`${h?`session-metadata-out`:`session-metadata-in`} ${h?140:170}ms cubic-bezier(0.32, 0.72, 0, 1) forwards`,I;t[24]!==x||t[25]!==T?(I=T?{top:8,left:x??8,width:`min(${Xu}px, calc(100% - 16px))`}:null,t[24]=x,t[25]=T,t[26]=I):I=t[26];let L;t[27]!==F||t[28]!==I?(L={animation:F,maxHeight:`min(72dvh, calc(100dvh - var(--yuri-safe-area-top, 0px) - var(--yuri-header-height, 56px) - 1rem))`,...I},t[27]=F,t[28]=I,t[29]=L):L=t[29];let te;t[30]===d?te=t[31]:(te=d(`mobile.header.metadata.branch`),t[30]=d,t[31]=te);let R;t[32]!==o||t[33]!==te?(R=(0,$.jsx)(fd,{icon:`git-branch`,label:te,children:o}),t[32]=o,t[33]=te,t[34]=R):R=t[34];let z;t[35]!==a||t[36]!==d?(z=a?(0,$.jsx)(fd,{iconNode:(0,$.jsx)(Pi,{percentage:a.percentage,pending:a.pending}),label:d(`mobile.header.metadata.context`),children:(0,$.jsxs)(`span`,{className:`inline-flex items-baseline gap-1.5 tabular-nums`,children:[(0,$.jsx)(`span`,{className:U(`font-semibold`,a.colorClass),children:a.pending?d(`contextUsage.pending`):`${a.percentage.toFixed(1)}%`}),(0,$.jsx)(`span`,{className:`text-muted-foreground`,children:a.tokens})]})}):null,t[35]=a,t[36]=d,t[37]=z):z=t[37];let B;t[38]!==l||t[39]!==u||t[40]!==c||t[41]!==s?(B=(0,$.jsx)(md,{groups:s,displayMode:c,isLoading:l,timeFormatPreference:u}),t[38]=l,t[39]=u,t[40]=c,t[41]=s,t[42]=B):B=t[42];let ne;t[43]!==R||t[44]!==z||t[45]!==B?(ne=(0,$.jsxs)(`div`,{className:`space-y-1`,children:[R,z,B]}),t[43]=R,t[44]=z,t[45]=B,t[46]=ne):ne=t[46];let re;t[47]!==M||t[48]!==P||t[49]!==L||t[50]!==ne?(re=(0,$.jsx)(`div`,{ref:f,role:`dialog`,"aria-label":M,className:P,style:L,children:ne}),t[47]=M,t[48]=P,t[49]=L,t[50]=ne,t[51]=re):re=t[51];let ie;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,$.jsx)(`style`,{children:`
|
|
9
|
-
@keyframes session-metadata-in {
|
|
10
|
-
from { opacity: 0; transform: translateY(-8px) scale(0.985); }
|
|
11
|
-
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
12
|
-
}
|
|
13
|
-
@keyframes session-metadata-out {
|
|
14
|
-
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
15
|
-
to { opacity: 0; transform: translateY(-6px) scale(0.985); }
|
|
16
|
-
}
|
|
17
|
-
`}),t[52]=ie):ie=t[52];let ae;return t[53]===re?ae=t[54]:(ae=(0,$.jsxs)(`div`,{ref:b,className:`fixed inset-x-0 bottom-0 top-[calc(var(--yuri-safe-area-top,0px)+var(--yuri-header-height,56px))] z-20 pointer-events-none`,children:[re,ie]}),t[53]=re,t[54]=ae),ae},md=e=>{let t=(0,Q.c)(30),{groups:n,displayMode:r,isLoading:i,timeFormatPreference:a}=e,{t:o}=tt(),s;t[0]!==r||t[1]!==o?(s=o(r===`remaining`?`header.services.remaining`:`header.services.used`),t[0]=r,t[1]=o,t[2]=s):s=t[2];let c=s;if(n.length===0)return null;let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,$.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center text-muted-foreground`,children:(0,$.jsx)(W,{name:`timer`,className:`size-[18px]`})}),t[3]=l):l=t[3];let u;t[4]===o?u=t[5]:(u=o(`mobile.header.metadata.usage`),t[4]=o,t[5]=u);let d;t[6]===u?d=t[7]:(d=(0,$.jsx)(`span`,{className:`shrink-0 typography-ui-label text-muted-foreground`,children:u}),t[6]=u,t[7]=d);let f;t[8]===i?f=t[9]:(f=i?(0,$.jsx)(W,{name:`refresh`,className:`size-3.5 animate-spin`}):null,t[8]=i,t[9]=f);let p;t[10]===c?p=t[11]:(p=(0,$.jsx)(`span`,{className:`truncate`,children:c}),t[10]=c,t[11]=p);let m;t[12]!==f||t[13]!==p?(m=(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 flex-1 items-center justify-end gap-1.5 typography-ui-label text-muted-foreground`,children:[f,p]}),t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;t[15]!==d||t[16]!==m?(h=(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 px-2.5 pb-1.5`,children:[l,d,m]}),t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;if(t[18]!==r||t[19]!==n||t[20]!==a){let e;t[22]!==r||t[23]!==a?(e=e=>(0,$.jsxs)(`div`,{className:`min-w-0 rounded-xl bg-[var(--surface-muted)] p-2.5`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,$.jsx)(Hn,{providerId:e.providerId,className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate typography-ui-label font-medium text-foreground`,children:e.providerName}),e.status&&e.rows.length===0?(0,$.jsx)(`span`,{className:`min-w-0 max-w-[60%] truncate typography-micro text-muted-foreground`,children:e.status}):null]}),e.rows.length>0?(0,$.jsx)(`div`,{className:`mt-1.5 space-y-1`,children:e.rows.map((t,n)=>{let i=ki(e.rows.map(xd),n),o=r===`remaining`?t.window.remainingPercent:t.window.usedPercent,s=tr(t.window.valueLabel,o),c=nr(t.window.resetAt,t.window.resetAfterFormatted??t.window.resetAtFormatted,a);return(0,$.jsxs)(Z.Fragment,{children:[i?(0,$.jsx)(`div`,{className:U(`typography-micro font-medium uppercase tracking-wide text-muted-foreground`,n>0&&`mt-3 border-t border-[var(--surface-subtle)] pt-2`),children:i}):null,(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline justify-between gap-3`,children:[(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 flex-1 items-baseline gap-1.5`,children:[(0,$.jsx)(`span`,{className:`truncate typography-ui-label text-muted-foreground`,children:t.subtitle?`${t.subtitle} · ${t.label}`:t.label}),c?(0,$.jsx)(`span`,{className:`min-w-0 truncate typography-micro text-muted-foreground/70`,children:c}):null]}),(0,$.jsx)(`span`,{className:U(`min-w-0 max-w-[60%] shrink-0 truncate typography-ui-label font-semibold tabular-nums`,dd(t.window)),children:s===`-`?``:s})]})]},t.key)})}):null,e.status&&e.rows.length>0?(0,$.jsx)(`div`,{className:`mt-1.5 truncate typography-micro text-muted-foreground`,title:e.status,children:e.status}):null]},e.providerId),t[22]=r,t[23]=a,t[24]=e):e=t[24],g=n.map(e),t[18]=r,t[19]=n,t[20]=a,t[21]=g}else g=t[21];let _;t[25]===g?_=t[26]:(_=(0,$.jsx)(`div`,{className:`space-y-1.5`,children:g}),t[25]=g,t[26]=_);let v;return t[27]!==_||t[28]!==h?(v=(0,$.jsxs)(`div`,{className:`pt-2.5`,children:[h,_]}),t[27]=_,t[28]=h,t[29]=v):v=t[29],v},hd=e=>{let t=(0,Q.c)(35),{open:n,onClose:r,items:i,rightOffset:a}=e,o=a===void 0?0:a,{t:s}=tt(),c,l;if(t[0]!==r||t[1]!==n?(c=()=>{if(!n)return;let e=e=>{e.key===`Escape`&&r()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},l=[r,n],t[0]=r,t[1]=n,t[2]=c,t[3]=l):(c=t[2],l=t[3]),Z.useEffect(c,l),!n)return null;let u;t[4]===r?u=t[5]:(u=(e,t,n)=>(0,$.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemcheckbox`,"aria-checked":n,className:U(`flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-inset`,t>0&&`border-t border-border/30`,e.disabled&&`cursor-not-allowed opacity-60`),style:{touchAction:`manipulation`},disabled:e.disabled,onClick:()=>{e.onSelect(),r()},children:[e.iconNode??(e.icon?(0,$.jsx)(W,{name:e.icon,className:U(`size-5 shrink-0 text-muted-foreground`,e.spinning&&`animate-spin`,e.key===`auto-read`&&`translate-x-px`)}):null),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate typography-ui-label text-foreground`,children:e.label}),e.badge&&e.badge>0?(0,$.jsx)(`span`,{className:`inline-flex size-2 shrink-0 rounded-full bg-primary`,"aria-hidden":!0}):null,n&&(0,$.jsx)(W,{name:`check`,className:`size-4 shrink-0 text-muted-foreground`})]},e.key),t[4]=r,t[5]=u);let d=u,f;t[6]===s?f=t[7]:(f=s(`mobile.menu.titleAria`),t[6]=s,t[7]=f);let p;t[8]===s?p=t[9]:(p=s(`mobile.surface.closeAria`),t[8]=s,t[9]=p);let m;t[10]===r?m=t[11]:(m=e=>{e.preventDefault(),r()},t[10]=r,t[11]=m);let h;t[12]!==p||t[13]!==m?(h=(0,$.jsx)(`button`,{type:`button`,className:`pointer-events-auto absolute inset-x-0 bottom-0 cursor-default top-[calc(var(--yuri-safe-area-top,0px)+var(--yuri-mobile-detail-navigation-height,3.5rem)+0.25rem)]`,"aria-label":p,onPointerDown:m}),t[12]=p,t[13]=m,t[14]=h):h=t[14];let g=`max(1rem, calc(8px + ${o}px + var(--yuri-safe-area-right, 0px)))`,_;t[15]===g?_=t[16]:(_={right:g,animation:`mobile-menu-in 160ms cubic-bezier(0.32, 0.72, 0, 1) forwards`},t[15]=g,t[16]=_);let v;if(t[17]!==i||t[18]!==d){let e;t[20]===d?e=t[21]:(e=(e,t)=>d(e,t),t[20]=d,t[21]=e),v=i.map(e),t[17]=i,t[18]=d,t[19]=v}else v=t[19];let y;t[22]!==i.length||t[23]!==d||t[24]!==s?(y=(0,$.jsx)(da,{children:e=>{let{enabled:t,available:n,toggle:r}=e;return d({key:`auto-read`,icon:`volume-up`,label:s(`mobile.menu.autoRead`),disabled:!n,onSelect:r},i.length,t)}}),t[22]=i.length,t[23]=d,t[24]=s,t[25]=y):y=t[25];let b;t[26]!==_||t[27]!==v||t[28]!==y?(b=(0,$.jsxs)(`div`,{id:Gu,className:`pointer-events-auto absolute top-[calc(var(--yuri-safe-area-top,0px)+var(--yuri-mobile-detail-navigation-height,3.5rem)+0.25rem)] w-[min(220px,calc(100vw-1rem))] origin-top-right overflow-hidden rounded-2xl yuri-mobile-overlay-surface`,role:`menu`,style:_,onAnimationEnd:Sd,children:[v,y]}),t[26]=_,t[27]=v,t[28]=y,t[29]=b):b=t[29];let x;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,$.jsx)(`style`,{children:`@keyframes mobile-menu-in { from { opacity: 0; transform: translateY(-6px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }`}),t[30]=x):x=t[30];let S;return t[31]!==b||t[32]!==f||t[33]!==h?(S=(0,$.jsxs)(`div`,{className:`pointer-events-none fixed inset-0 z-50`,role:`dialog`,"aria-modal":`true`,"aria-label":f,children:[h,b,x]}),t[31]=b,t[32]=f,t[33]=h,t[34]=S):S=t[34],S},gd=Z.memo(function(e){let t=(0,Q.c)(90),{open:n,onOpenChange:r,currentSessionId:i,effectiveDirectory:a,gitDirectory:o,isNewSessionDraftOpen:s,primaryLabel:c,secondaryLabel:l}=e,{t:u}=tt(),{git:d}=ee(),f=Fi(i??``,a||void 0),p=f??l,m=Z.useRef(null),h=Me(i??``,a||void 0),g=kt(o),_=At(o),v=jt(Cd),y=jt(wd),b=be(Td),x=be(Ed),S=be(Dd),C=be(Od),w;t[0]===i?w=t[1]:(w=e=>i?e.sessionModelSelections.get(i)??null:null,t[0]=i,t[1]=w);let T=Re(w),E=$n(kd),D=$n(Ad),O=$n(jd),k=$n(Md),A=$n(Nd),j=$n(Pd),M=B(Fd);Qn();let N,P;t[2]!==v||t[3]!==d||t[4]!==o?(N=()=>{o&&v(o,d)},P=[v,d,o],t[2]=v,t[3]=d,t[4]=o,t[5]=N,t[6]=P):(N=t[5],P=t[6]),Z.useEffect(N,P);let F,I;t[7]!==y||t[8]!==d||t[9]!==o?(F=()=>{if(o)return Ce.onGitRefreshHint(e=>{ad(e.directory)===o&&y(o,d)})},I=[y,d,o],t[7]=y,t[8]=d,t[9]=o,t[10]=F,t[11]=I):(F=t[10],I=t[11]),Z.useEffect(F,I);let L,te;t[12]===D?(L=t[13],te=t[14]):(L=()=>{D()},te=[D],t[12]=D,t[13]=L,t[14]=te),Z.useEffect(L,te);let R,z;t[15]===A?(R=t[16],z=t[17]):(R=()=>{Vn(A)},z=[A],t[15]=A,t[16]=R,t[17]=z),Z.useEffect(R,z);let ne,re;t[18]===n?(ne=t[19],re=t[20]):(ne=()=>{!n||$n.getState().isLoading||$n.getState().fetchAllQuotas()},re=[n],t[18]=n,t[19]=ne,t[20]=re),Z.useEffect(ne,re);let ie;t[21]===h?ie=t[22]:(ie=Ai(h),t[21]=h,t[22]=ie);let ae=ie,oe;t[23]!==S||t[24]!==x||t[25]!==ae||t[26]!==T?(oe=ae??(T?{providerID:T.providerId,modelID:T.modelId}:null)??(x&&S?{providerID:x,modelID:S}:null),t[23]=S,t[24]=x,t[25]=ae,t[26]=T,t[27]=oe):oe=t[27];let V=oe,H;if(t[28]!==C||t[29]!==V||t[30]!==b){let e=(V?b.find(e=>e.id===V.providerID):void 0)?.models.find(e=>e.id===V?.modelID),n;t[32]!==C||t[33]!==V?(n=V?C(V.providerID,V.modelID):void 0,t[32]=C,t[33]=V,t[34]=n):n=t[34];let r=n;H=Mi(e?.limit,`context`)??r?.limit?.context??0,t[28]=C,t[29]=V,t[30]=b,t[31]=H}else H=t[31];let W=H,se=Ee(i??``,W,0,a||void 0),G=se?.pending?null:se?.totalTokens??0,ce;t[35]!==W||t[36]!==s||t[37]!==G?(ce=ji({totalTokens:G,contextLimit:W,isDraft:s}),t[35]=W,t[36]=s,t[37]=G,t[38]=ce):ce=t[38];let le=ce,ue;t[39]!==_?.current||t[40]!==g||t[41]!==u?(ue=g===!0?_?.current?.trim()||u(`gitView.branch.detachedHead`):u(`common.unavailable`),t[39]=_?.current,t[40]=g,t[41]=u,t[42]=ue):ue=t[42];let de=ue,fe;if(t[43]!==A||t[44]!==E||t[45]!==j||t[46]!==u){let e=new Map(E.map(Id)),n;t[48]===A?n=t[49]:(n=e=>A.includes(e.id),t[48]=A,t[49]=n),fe=er(E).filter(n).filter(t=>e.get(t.id)?.configured===!0).map(t=>{let n=e.get(t.id),r=[];for(let[e,t]of Oi(Object.entries(n?.usage?.windows??{}),n?.usage?.accounts))r.push({key:`window-${e}`,label:rr(t.label??e),window:t});let i=Object.entries(n?.usage?.models??{}),a=j[t.id]??[],o=a.length>0?i.filter(e=>{let[t]=e;return a.includes(t)}):i;for(let[e,t]of o){let n=Object.entries(t.windows??{});if(n.length===0)continue;let[i,a]=n[0];r.push({key:`model-${e}-${i}`,label:rr(a.label??i),subtitle:Zn(e),window:a})}let s=!n.ok&&n.error?n.error:r.length===0?u(`header.services.noRateLimitsReported`):null;return{providerId:t.id,providerName:t.name,rows:r,status:s}}),t[43]=A,t[44]=E,t[45]=j,t[46]=u,t[47]=fe}else fe=t[47];let pe=fe,me,he;t[50]!==n||t[51]!==pe?(me=()=>{!n||pe.length===0||Vn(pe.map(Ld))},he=[n,pe],t[50]=n,t[51]=pe,t[52]=me,t[53]=he):(me=t[52],he=t[53]),Z.useEffect(me,he);let ge;t[54]===c?ge=t[55]:(ge=(0,$.jsx)(`span`,{className:`block truncate typography-ui-label text-foreground`,children:c}),t[54]=c,t[55]=ge);let _e;t[56]!==p||t[57]!==f?(_e=p?(0,$.jsx)(`span`,{className:U(`block truncate`,f?`yuri-mobile-detail-subtitle text-muted-foreground`:`typography-micro text-muted-foreground`),"aria-live":`polite`,children:p}):null,t[56]=p,t[57]=f,t[58]=_e):_e=t[58];let ve;t[59]!==ge||t[60]!==_e?(ve=(0,$.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center px-2 py-1.5 text-left`,children:(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[ge,_e]})}),t[59]=ge,t[60]=_e,t[61]=ve):ve=t[61];let K;t[62]===u?K=t[63]:(K=u(`mobile.header.openMetadataAria`),t[62]=u,t[63]=K);let ye;t[64]===r?ye=t[65]:(ye=()=>r(Rd),t[64]=r,t[65]=ye);let q;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(q={touchAction:`manipulation`},t[66]=q):q=t[66];let xe=le?.percentage??0,Se=le?.pending,we;t[67]!==xe||t[68]!==Se?(we=(0,$.jsx)(Pi,{percentage:xe,pending:Se}),t[67]=xe,t[68]=Se,t[69]=we):we=t[69];let Te;t[70]!==n||t[71]!==K||t[72]!==ye||t[73]!==we?(Te=(0,$.jsx)(`button`,{ref:m,type:`button`,className:`flex size-10 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,"aria-label":K,"aria-expanded":n,onClick:ye,style:q,children:we}),t[70]=n,t[71]=K,t[72]=ye,t[73]=we,t[74]=Te):Te=t[74];let J;t[75]===r?J=t[76]:(J=()=>r(!1),t[75]=r,t[76]=J);let De;t[77]!==de||t[78]!==le||t[79]!==O||t[80]!==n||t[81]!==k||t[82]!==J||t[83]!==M||t[84]!==pe?(De=(0,$.jsx)(pd,{open:n,onClose:J,anchorRef:m,contextDisplay:le,branchLabel:de,usageGroups:pe,usageDisplayMode:k,isUsageLoading:O,timeFormatPreference:M}),t[77]=de,t[78]=le,t[79]=O,t[80]=n,t[81]=k,t[82]=J,t[83]=M,t[84]=pe,t[85]=De):De=t[85];let Oe;return t[86]!==ve||t[87]!==Te||t[88]!==De?(Oe=(0,$.jsxs)($.Fragment,{children:[ve,Te,De]}),t[86]=ve,t[87]=Te,t[88]=De,t[89]=Oe):Oe=t[89],Oe}),_d=({onOpenSessions:e,menuOpen:t,onToggleMenu:n,surfaceShortcuts:r})=>{let{t:i}=tt(),[a,o]=Z.useState(!1),s=D(e=>e.currentDirectory),c=J(e=>e.currentSessionId),l=Z.useMemo(()=>e=>c?e.getDirectoryForSession(c):null,[c]),u=J(l)||s,d=ad(u)||null,f=he(e=>e.projects),p=J(e=>e.availableWorktreesByProject),m=Z.useMemo(()=>e=>c?e.worktreeMetadata.get(c)??null:null,[c]),h=J(m),g=q(c),_=J(e=>!!e.newSessionDraft?.open),v=Z.useMemo(()=>{let e=ad(u);return e&&ld((h?.projectDirectory?ye(f,h.projectDirectory):null)??Se(f,p,e),e)||i(`mobile.header.noProject`)},[p,h?.projectDirectory,u,f,i]),y=g?.title?.trim()||(c?i(`mobile.sessions.untitled`):v),b=c?v:``;Z.useEffect(()=>{o(!1)},[c,u]);let x=L(()=>{o(!1),e()}),S=L(()=>{o(!1),n()});return(0,$.jsx)($.Fragment,{children:(0,$.jsxs)(vo,{children:[(0,$.jsx)(`button`,{type:`button`,className:`flex size-10 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,"aria-label":i(`mobile.sessions.openSheetAria`),onClick:x,style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`folders`,className:`size-5`})}),(0,$.jsx)(gd,{open:a,onOpenChange:o,currentSessionId:c,effectiveDirectory:u,gitDirectory:d,isNewSessionDraftOpen:_,primaryLabel:y,secondaryLabel:b}),r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,className:U(`flex size-10 shrink-0 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,r.activePanel===`files`?`bg-[var(--interactive-selection)] text-[var(--interactive-selectionForeground)]`:`text-muted-foreground hover:bg-interactive-hover hover:text-foreground`),"aria-label":i(`mobile.menu.files`),"aria-pressed":r.activePanel===`files`,onClick:r.onToggleFiles,style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`file-text`,className:`size-5`})}),(0,$.jsxs)(`button`,{type:`button`,className:U(`relative flex size-10 shrink-0 items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,r.activePanel===`changes`?`bg-[var(--interactive-selection)] text-[var(--interactive-selectionForeground)]`:`text-muted-foreground hover:bg-interactive-hover hover:text-foreground`),"aria-label":i(`mobile.menu.changes`),"aria-pressed":r.activePanel===`changes`,onClick:r.onToggleChanges,style:{touchAction:`manipulation`},children:[(0,$.jsx)(W,{name:`git-branch`,className:`size-5`}),r.changesDirty?(0,$.jsx)(`span`,{className:`absolute right-2 top-2 inline-flex size-2 rounded-full bg-primary`,"aria-hidden":!0}):null]})]}):null,(0,$.jsx)(`button`,{type:`button`,className:`flex size-10 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary`,"aria-label":i(`mobile.header.openMenuAria`),"aria-controls":Gu,"aria-expanded":t,"aria-haspopup":`menu`,onClick:S,style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`more-2`,className:`size-5`})})]})})},vd=e=>{let t=(0,Q.c)(5),n=_o();if(!n.enabled){let n;return t[0]===e?n=t[1]:(n=(0,$.jsx)(_d,{...e}),t[0]=e,t[1]=n),n}let r;return t[2]!==e||t[3]!==n?(r=(0,$.jsx)(bo,{...e,scope:n}),t[2]=e,t[3]=n,t[4]=r):r=t[4],r},yd=({connection:e,onActiveConnectionDeleted:t})=>{let{t:n}=tt(),r=In();we(),Oe();let i=B(e=>e.mobileSessionPanelOpen),a=B(e=>e.setMobileSessionPanelOpen),o=B(e=>e.isScheduledTasksDialogOpen),s=B(e=>e.activeMainTab),c=an(),l=B(e=>e.setActiveMainTab),[u,d]=Z.useState(!1),[f,p]=Z.useState(!1),[m,h]=Z.useState(null),[g,v]=Z.useState(!1),[y,b]=Z.useState(!1),[x,S]=Z.useState(null),[C,w]=Z.useState(null),[T,E]=Z.useState(null),[O,k]=Z.useState(0),[A,j]=Z.useState(!1),[N,ee]=Z.useState(!1),[P,F]=Z.useState(!1),[I,te]=Z.useState(!1),[R,z]=Z.useState(!1),[ne,re]=Z.useState(!1),[ie,ae]=Z.useState(`nav`),[oe,se]=Z.useState(!1),[ce,le]=Z.useState(!1),ue=L(()=>{se(!1),le(!0)}),de=L(()=>{if(se(!1),K.enabled){V.info(n(`remoteProjects.nativeCapabilityUnavailable`,{capability:n(`remoteDesktop.title`)}));return}ue()}),fe=L(()=>le(!1)),[pe,me]=Z.useState(!1),he=L(()=>se(e=>!e)),ge=L(()=>se(!1)),[_e,ve]=Z.useState(null),K=_o(),ye=A&&!K.enabled,q=D(e=>e.currentDirectory),be=B(e=>e.setSettingsPage),xe=_i(e=>e.available),Se=_i(e=>e.runtimeType),Te=Z.useMemo(()=>td(),[]),Ee=Z.useMemo(()=>to(),[]),De=q??null,{data:ke=[],refetch:Ae}=M({...Si(De),enabled:ye}),{refetch:je}=M({...xi(De),enabled:ye}),Me=Ti(e=>e.setMcpDraft),Ne=Ti(e=>e.setSelectedMcp),Pe=At(K.enabled?K.entry?.key??null:ad(q)||null)?.files?.length??0;Z.useEffect(()=>Ce.onDirectoryRequest(()=>z(!0)),[]);let Y=Z.useMemo(()=>_(),[]),Fe=G(e=>e.secondary?.kind??null),Le=J(e=>K.enabled?null:e.currentSessionId),Re=K.enabled?K.sessionId:Le,ze=J(e=>e.setCurrentSession),Be=Z.useMemo(()=>e=>!K.enabled&&Re?e.getDirectoryForSession(Re):null,[Re,K.enabled]),Ve=J(Be),X=K.enabled?K.entry?.location.directory:Ve,He=bt()===`portrait`,[Ue,We]=Z.useState(Y&&!He),[Ge,Ke]=Z.useState(null),qe=L(e=>{if(e&&be(e),Y){ae(e?`page-content`:`nav`),F(!0);return}let t=G.getState();if(e){t.openSettingsFromCurrent();return}be(`home`),t.setActiveTab(`settings`)}),Je=L(()=>{qe(`instances`)}),Ye=L(()=>{G.getState().openInstances()}),Xe=L(async t=>{if(!t){Ye();return}let n=e.connections.find(e=>e.id===t);!n||e.isBusy||Xt(n)||(await e.connect({id:n.id,candidates:n.candidates,clientToken:n.clientToken,label:n.label}),Xt(n)||Ye())}),Ze=L(()=>{G.getState().closeSecondary()}),Qe=L(async()=>{if(!ne){re(!0);try{let t=await no();switch(t.status){case`ok`:await e.connect({url:t.url,clientToken:t.clientToken,label:t.label});break;case`pairing`:await e.redeemPairingConnection(t.pairing);break;case`permission-denied`:V.error(n(`mobile.connect.scan.permissionDenied`));break;case`invalid`:V.error(n(`mobile.connect.scan.invalid`));break;case`unsupported`:V.error(n(`mobile.connect.scan.unsupported`));break;case`failed`:V.error(n(`mobile.connect.scan.failed`))}}finally{re(!1)}}});Rt({enabled:!Y,rootRoutesBlocked:i||u||f||g||y||o||ye||P||I||R||oe});let $e=L(()=>{let e=!Ue;e&&He&&Ke(null),We(e)}),et=L(()=>{if(b(!1),S(null),w(null),p(!1),h(null),Y){ve(null),Ke(`files`),He&&We(!1);return}d(!0)}),nt=L(()=>{p(!1),h(null)}),rt=L(e=>{let t=e.path.trim();if(t){if(b(!1),S(null),w(null),ve(null),v(!1),Y){B.getState().setPendingFileFocusPath(t),Ke(`files`),He&&We(!1);return}d(!1),h({path:t,targetLine:typeof e.targetLine==`number`&&Number.isFinite(e.targetLine)?Math.max(1,Math.trunc(e.targetLine)):void 0}),p(!0)}}),it=B(e=>e.pendingFileFocusPath);Z.useEffect(()=>{if(it){if(Y){et();return}rt({path:it}),B.getState().setPendingFileFocusPath(null)}},[it,Y,et,rt]);let at=L((e=null)=>{if(b(!1),S(null),w(null),E(null),p(!1),h(null),ve(e),Y){Ke(`changes`),He&&We(!1);return}v(!0)}),ot=L((e,t,n)=>{ve(null),v(!1),p(!1),h(null),S(e??null),w(typeof t==`string`&&t.trim()?t.trim():null);let r=typeof n==`string`&&n.trim()?n.trim():null;if(E(r),k(e=>e+1),Y){Ke(`turn-diff`),He&&We(!1);return}b(!0)}),ct=L(()=>{Ke(null),ve(null),E(null)}),dt=L(e=>{if(Ge===e){ct();return}e===`files`?et():at()}),pt=Z.useRef(`changes`);Ge&&(pt.current=Ge);let[mt,ht]=Z.useState(!1);Z.useEffect(()=>{if(!Y)return;if(Ge){ht(!0);return}let e=window.setTimeout(()=>ht(!1),240);return()=>window.clearTimeout(e)},[Ge,Y]);let gt=Ge??pt.current,_t=$u(`left`,`yuri.ipad.leftSidebarWidth`,Ku),vt=$u(`right`,`yuri.ipad.rightSidebarWidth`,qu),yt=Z.useMemo(()=>({openChanges:({diffPath:e,staged:t,targetLine:n}={})=>{at(e?{path:e,staged:t===!0,targetLine:n}:null)},openToolDiff:({diffPath:e,patches:t,targetLine:n})=>{at({path:e,staged:!1,targetLine:n,toolPatches:t})},openTurnDiff:ot,openFile:({path:e,targetLine:t})=>{rt({path:e,targetLine:t})},openFiles:()=>et(),openSettings:e=>{qe(e)}}),[at,rt,et,qe,ot]),xt=L(()=>{v(!1),ve(null)}),St=L(()=>{b(!1),E(null)});Kc(Z.useMemo(()=>({openSessions:()=>{if(Y){We(!0);return}G.getState().setActiveTab(`projects`)},openView:e=>{e===`files`?et():e===`mcp`?j(!0):e===`instances`?Je():e===`update`&&te(!0)},openChanges:({path:e,staged:t}={})=>{at(e?{path:e,staged:t===!0}:null)},openSettings:e=>{qe(e)}}),[Y,at,et,Je,qe]));let Ct=Z.useRef(null),wt=Z.useRef(null),Tt=Ie(K.enabled?null:Re,K.enabled?void 0:X||q||void 0),Et=K.session?.parentID,Dt=K.enabled?Et?{id:Et,directory:X}:null:Tt,Ot=L(()=>{Dt&&(K.enabled?K.openSession(Dt.id):ze(Dt.id,Dt.directory))});vu();let kt=Z.useRef(0);Z.useEffect(()=>(kt.current+=1,me(!1),()=>{kt.current+=1}),[Re,K.key,K.entry]);let jt=L(()=>{let e=Re;if(!e||pe)return;let t=X||q||void 0,i=++kt.current;me(!0),(async()=>{try{K.enabled?await K.refresh():await r.refreshSessionTranscript(e,{directory:t}),i===kt.current&&V.success(n(`sessions.sidebar.session.menu.refreshTranscriptSuccess`))}catch{i===kt.current&&V.error(n(`sessions.sidebar.session.menu.refreshTranscriptFailed`))}finally{i===kt.current&&me(!1)}})()}),Mt=!Y&&(Fe===`chat`||Fe===`draft`);Z.useEffect(()=>{!Y&&!Mt&&se(!1)},[Y,Mt]),Z.useEffect(()=>{se(!1)},[Re,K.key]);let Nt=Y&&s===`assistant`||!Y&&!Mt||i||u||f||g||y||o||ye||P||I||R||oe||ce;ml(wt,{onOpen:L(()=>{st(ut)?.finish(`commit`)}),onPreviewStart:L(()=>{st(ut)?.begin(`present`)}),onPreviewCancel:L(()=>{st(ut)?.finish(`cancel`)}),onProgress:L(e=>{e!==null&&st(ut)?.update(e)}),disabled:Nt},Y||Mt);let Pt=L(e=>{Ct.current=e});id(L(()=>ce?(fe(),!0):oe?(se(!1),!0):R?(z(!1),!0):o?(window.dispatchEvent(new Event(`yuri:scheduled-tasks-close-request`)),!0):i?(a(!1),!0):zt.backImmediately(`overlay`)?!0:f?(nt(),!0):u?(d(!1),!0):y?(St(),!0):g?(xt(),!0):ye?(j(!1),!0):P?(F(!1),!0):I?(te(!1),!0):zt.requestAnimatedBack(`root`)||Ct.current?.()?!0:s===`assistant`?(l(`chat`),!0):Dt?(Ot(),!0):!1));let Ft=xe&&(Se===`desktop`||Se===`web`),It=L(()=>{if(K.enabled){V.info(n(`remoteProjects.configurationReadOnly`));return}let e=`new-mcp-server`,t=e,r=1;for(;ke.some(e=>e.name===t);)t=`${e}-${r}`,r+=1;Me({name:t,scope:`user`,type:`local`,command:[],url:``,environment:[],headers:[],oauthEnabled:!0,oauthClientId:``,oauthClientSecret:``,oauthScope:``,oauthRedirectUri:``,timeout:``,enabled:!0}),Ne(t),j(!1),qe(`mcp`)}),Lt=L(()=>{if(N)return;if(K.enabled&&!K.entry){V.error(n(`remoteProjects.host-unavailable`));return}ee(!0);let e=new Promise(e=>window.setTimeout(e,500));Promise.all([je(),Ae(),e]).finally(()=>ee(!1))}),Bt=J(e=>e.openNewSessionDraft),Vt=Z.useMemo(()=>{let e=[{key:`new-session`,icon:`chat-new`,label:n(`mobile.menu.newSession`),onSelect:()=>{if(K.enabled){if(!K.entry){V.error(n(`remoteProjects.host-unavailable`));return}K.openSession(null),Y?l(`chat`):G.getState().openRemoteProject();return}if(Y){l(`chat`),Bt();return}G.getState().openDraft()}}];return Y||e.push({key:`files`,icon:`file-text`,label:n(`mobile.menu.files`),onSelect:()=>et()},{key:`changes`,icon:`git-branch`,label:n(`mobile.menu.changes`),badge:Pe,onSelect:()=>at()}),K.enabled||e.push({key:`mcp`,iconNode:(0,$.jsx)(bi,{className:`size-5 shrink-0 text-muted-foreground`}),label:n(`mobile.menu.mcp`),onSelect:()=>j(!0)}),Ft&&e.push({key:`update`,icon:`download`,label:n(`mobile.menu.update`),onSelect:()=>te(!0)}),Y&&e.push({key:`settings`,icon:`settings-3`,label:n(`mobile.menu.settings`),onSelect:()=>qe()}),Re&&e.push({key:`refresh-transcript`,icon:`refresh`,label:n(`sessions.sidebar.session.menu.refreshTranscript`),disabled:pe,spinning:pe,onSelect:jt}),e.push({key:`remote-desktop`,icon:`computer`,label:n(`remoteDesktop.title`),onSelect:de}),e},[Re,Pe,Y,pe,at,et,Bt,de,qe,jt,K,l,Ft,n]);return(0,$.jsx)(sa,{remote:K.enabled,remoteState:K.owner?.state,sessionId:Re??``,directory:X||q||void 0,active:Y?s!==`assistant`:Fe===`chat`||K.enabled&&Fe===`draft`,children:(0,$.jsx)(ft,{actions:yt,children:(0,$.jsxs)(oo,{children:[(0,$.jsxs)(`div`,{className:`yuri-mobile-app-shell main-content-safe-area flex h-[100dvh] flex-row text-foreground`,"data-page-scroll-lock":`true`,children:[Y?(0,$.jsxs)(`aside`,{ref:_t.asideRef,className:U(`relative flex h-full shrink-0 flex-col overflow-hidden border-r border-border/50 bg-sidebar will-change-[width] motion-reduce:transition-none`,!Ue&&`border-r-0`),style:{width:Ue?_t.width:0,minWidth:Ue?_t.width:0,maxWidth:Ue?_t.width:0,"--yuri-ipad-sidebar-width":`${_t.width}px`,overflowX:`clip`,paddingTop:`var(--yuri-safe-area-top, 0px)`,transitionProperty:_t.isResizing?`none`:`width, min-width, max-width`,transitionDuration:`200ms`,transitionTimingFunction:`cubic-bezier(0.22, 1, 0.36, 1)`},"aria-hidden":!Ue,"data-page-scroll-lock":`true`,children:[Ue?(0,$.jsx)(ed,{side:`left`,isResizing:_t.isResizing,ariaLabel:n(`sidebar.resize.leftPanelAria`),handleProps:_t.handleProps}):null,(0,$.jsx)(`div`,{className:U(`flex h-full shrink-0 flex-col transition-opacity duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none`,_t.isResizing&&`pointer-events-none`,!Ue&&`pointer-events-none select-none opacity-0`),style:{width:`var(--yuri-ipad-sidebar-width)`,overflowX:`hidden`},children:(0,$.jsx)(Mn,{children:(0,$.jsx)(hs,{open:!0,variant:`sidebar`,onOpenChange:e=>{!e&&He&&We(!1)}})})})]}):null,(0,$.jsx)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col`,"data-page-scroll-lock":`true`,inert:ce||void 0,"aria-hidden":ce||void 0,children:Y?(0,$.jsxs)($.Fragment,{children:[s===`assistant`?null:(0,$.jsx)(`div`,{children:(0,$.jsx)(vd,{onOpenSessions:()=>$e(),menuOpen:oe,onToggleMenu:he,surfaceShortcuts:{activePanel:Ge===`turn-diff`?`changes`:Ge,changesDirty:Pe>0,onToggleFiles:()=>dt(`files`),onToggleChanges:()=>dt(`changes`)}})}),(0,$.jsx)(`main`,{ref:wt,className:`relative min-h-0 flex-1 overflow-hidden`,"data-page-scroll-lock":`true`,children:(0,$.jsx)(`div`,{className:`relative h-full w-full bg-background`,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(Z.Suspense,{fallback:null,children:s===`assistant`?(0,$.jsx)(Cu,{}):(0,$.jsx)(Mu,{})})})})})]}):(0,$.jsx)(ac,{className:`min-h-0 flex-1`,onAddProject:()=>z(!0),onScanQr:Te&&Ee?()=>{Qe()}:void 0,onSwitchInstance:Te?Xe:void 0,onRemoteDesktop:ue,remoteDesktopActive:ce,instanceOptions:Te?e.connections.map(t=>({id:t.id,label:t.label,active:Xt(t),disabled:e.isBusy})):void 0,onEnableAssistants:()=>{qe(`assistants`)},instancesPage:Te?(0,$.jsx)(ud,{connection:e,onConnect:()=>void 0,onActiveConnectionDeleted:t}):void 0,instancesSecondaryPage:Te?(0,$.jsxs)(`div`,{className:`yuri-settings-workspace yuri-settings-workspace-mobile flex h-full min-h-0 flex-col bg-[var(--surface-background)]`,children:[(0,$.jsx)(dn,{title:n(`mobile.settings.switchInstance`),backAriaLabel:n(`header.actions.backAria`),onBack:Ze}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-[var(--yuri-mobile-page-inline-inset)]`,children:(0,$.jsx)(Bi,{className:`yuri-mobile-settings-detail-card`,children:(0,$.jsx)(ud,{connection:e,onConnect:()=>void 0,onActiveConnectionDeleted:t})})})]}):void 0,parentSessionTarget:Dt?{id:Dt.id,directory:Dt.directory??null,...K.enabled?{onSelect:Ot}:{}}:null,registerSecondaryBackHandler:Pt,scheduledContent:(e,t)=>(0,$.jsx)(Au,{presentation:`mobile-tab`,registerEditorBackHandler:e,onEditorActiveChange:t}),renderChat:e=>(0,$.jsx)(ju,{sessionId:K.enabled?K.sessionId??``:e.sessionId,directory:K.enabled?K.entry?.location.directory:e.directory,title:K.enabled?K.session?.title:void 0,onBack:()=>{ge(),zt.requestAnimatedBack(`root`)},onOpenMenu:he,onCloseMenu:ge,menuOpen:e.active&&oe,children:(0,$.jsx)(`main`,{ref:e.active?wt:void 0,className:`relative h-full min-h-0 flex-1 overflow-hidden`,"data-page-scroll-lock":`true`,children:(0,$.jsx)(`div`,{className:`relative h-full w-full bg-background`,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(Mu,{readOnly:!e.active,active:e.active,selectionOverride:{sessionId:K.enabled?K.sessionId:e.sessionId||null,directory:K.enabled?K.entry?.location.directory??null:e.directory,viewKey:K.enabled?`${K.key}:${K.sessionId??`draft`}`:e.viewKey}})})})})})})}),Y?(0,$.jsxs)(`aside`,{ref:vt.asideRef,className:U(`relative flex h-full shrink-0 flex-col overflow-hidden border-l border-border/50 bg-background will-change-[width] motion-reduce:transition-none`,!Ge&&`border-l-0`),style:{width:Ge?vt.width:0,minWidth:Ge?vt.width:0,maxWidth:Ge?vt.width:0,"--yuri-ipad-sidebar-width":`${vt.width}px`,overflowX:`clip`,paddingTop:`var(--yuri-safe-area-top, 0px)`,transitionProperty:vt.isResizing?`none`:`width, min-width, max-width`,transitionDuration:`200ms`,transitionTimingFunction:`cubic-bezier(0.22, 1, 0.36, 1)`},"aria-hidden":!Ge,"data-page-scroll-lock":`true`,children:[Ge?(0,$.jsx)(ed,{side:`right`,isResizing:vt.isResizing,ariaLabel:n(`sidebar.resize.rightPanelAria`),handleProps:vt.handleProps}):null,(0,$.jsx)(`div`,{className:U(`flex h-full shrink-0 flex-col transition-opacity duration-200 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none`,vt.isResizing&&`pointer-events-none`,!Ge&&`pointer-events-none select-none opacity-0`),style:{width:`var(--yuri-ipad-sidebar-width)`,overflowX:`hidden`},children:mt?(0,$.jsx)(Mn,{children:gt===`files`?(0,$.jsx)(Pu,{onClose:ct}):gt===`turn-diff`?(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden bg-background text-foreground`,children:[(0,$.jsxs)(`header`,{className:`flex h-[var(--yuri-header-height,56px)] shrink-0 items-center gap-2 border-b border-border/40 px-3`,children:[(0,$.jsx)(`h2`,{className:`min-w-0 flex-1 truncate typography-ui-label font-semibold text-foreground`,children:n(`mobile.nav.changes`)}),(0,$.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,onClick:ct,"aria-label":n(`mobile.surface.closeAria`),className:`shrink-0 text-muted-foreground`,style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`close`,className:`size-5`})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,$.jsx)(Nu,{hideStackedFileSidebar:!0,pinSelectedFileHeaderToTopOnNavigate:!0,diffScope:`turn`,turnMessageId:x,sessionId:C,targetFilePath:T,navigationRequestKey:O,flushContent:!0})})]}):_e?.toolPatches?.length?(0,$.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden bg-background text-foreground`,children:[(0,$.jsxs)(`header`,{className:`flex h-[var(--yuri-header-height,56px)] shrink-0 items-center gap-2 border-b border-border/40 px-3`,children:[(0,$.jsx)(`h2`,{className:`min-w-0 flex-1 truncate typography-ui-label font-semibold text-foreground`,children:_e.toolPatches.length>1?n(`mobile.nav.changes`):_e.path}),(0,$.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,onClick:ct,"aria-label":n(`mobile.surface.closeAria`),className:`shrink-0 text-muted-foreground`,style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`close`,className:`size-5`})})]}),(0,$.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,$.jsx)(Nu,{hideStackedFileSidebar:!0,diffScope:`turn`,targetFilePath:_e.path,targetLine:_e.targetLine??null,toolPatches:_e.toolPatches,singleFileView:_e.toolPatches.length===1,flushContent:!0})})]}):(0,$.jsx)(Fu,{onClose:ct,initialDiffPath:_e?.path??null,initialDiffStaged:_e?.staged===!0,initialDiffTargetLine:_e?.targetLine??null})}):null})]}):null,(0,$.jsx)(Or,{open:R,onOpenChange:z,forceMobile:!0}),(0,$.jsx)(hd,{open:oe,onClose:()=>se(!1),items:Vt,rightOffset:Y&&Ge?vt.width:0}),(0,$.jsx)(sr,{}),ce&&(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(ku,{onClose:fe,instanceName:e.connections.find(Xt)?.label})}),u?(0,$.jsx)(lt,{id:Bu,open:u,onOpenChange:e=>{e||d(!1)},ariaLabel:n(`mobile.menu.files`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.sessions.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(Pu,{onClose:()=>d(!1)})})}):null,f&&m?(0,$.jsx)(lt,{id:zu,open:f,onOpenChange:e=>{e||nt()},title:(0,$.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold text-foreground`,children:m.path.split(/[/\\]/).filter(Boolean).at(-1)??m.path}),ariaLabel:n(`mobile.menu.files`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.changes.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(Pu,{onClose:nt,initialFilePath:m.path,directFilePreview:!0,hideFileHeader:!0},m.path)})}):null,(0,$.jsx)(lt,{id:Ru,open:y,onOpenChange:e=>{e||St()},title:(0,$.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold text-foreground`,children:n(`mobile.nav.changes`)}),ariaLabel:n(`mobile.nav.changes`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.changes.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(Nu,{hideStackedFileSidebar:!0,pinSelectedFileHeaderToTopOnNavigate:!0,toolbarInSheetHeader:!0,diffScope:`turn`,turnMessageId:x,sessionId:C,targetFilePath:T,navigationRequestKey:O,flushContent:!0})})}),g&&_e?(0,$.jsx)(lt,{id:Lu,open:g,onOpenChange:e=>{e||xt()},title:(0,$.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold text-foreground`,children:_e.toolPatches&&_e.toolPatches.length>1?n(`mobile.nav.changes`):_e.path}),ariaLabel:n(`mobile.menu.changes`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.changes.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:_e.toolPatches?.length?(0,$.jsx)(Nu,{hideStackedFileSidebar:!0,toolbarInSheetHeader:!0,diffScope:`turn`,targetFilePath:_e.path,targetLine:_e.targetLine??null,toolPatches:_e.toolPatches,singleFileView:_e.toolPatches.length===1,flushContent:!0}):(0,$.jsx)(Fu,{initialDiffPath:_e.path,initialDiffStaged:_e.staged,initialDiffTargetLine:_e.targetLine??null,hideDiffHeader:!0})})}):g?(0,$.jsx)(lt,{id:Vu,open:g,onOpenChange:e=>{e||xt()},ariaLabel:n(`mobile.menu.changes`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.changes.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(Fu,{onClose:xt,initialDiffPath:_e?.path??null,initialDiffStaged:_e?.staged===!0,initialDiffTargetLine:_e?.targetLine??null})})}):null,ye?(0,$.jsx)(lt,{id:Hu,open:ye,onOpenChange:e=>{e||j(!1)},title:(0,$.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold text-foreground`,children:n(`mcpDropdown.title`)}),trailing:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,onClick:It,"aria-label":n(`settings.mcp.sidebar.actions.addServerTitle`),title:n(`settings.mcp.sidebar.actions.addServerTitle`),style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`add`,className:`size-5`})}),(0,$.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,onClick:Lt,disabled:N,"aria-label":n(`mcpDropdown.actions.refreshAria`),title:n(`mcpDropdown.actions.refreshAria`),style:{touchAction:`manipulation`},children:(0,$.jsx)(W,{name:`refresh`,className:U(`size-5`,N&&`animate-spin`)})})]}),ariaLabel:n(`mcpDropdown.title`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.sessions.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(dr,{active:!0,className:`h-full`,listClassName:`max-h-none`,hideHeader:!0,mobileListDensity:!0})})}):null,P&&Y?(0,$.jsx)(lt,{id:Uu,open:P,onOpenChange:e=>{e||F(!1)},ariaLabel:n(`mobile.menu.settings`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.sessions.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(Z.Suspense,{fallback:null,children:(0,$.jsx)(Tu,{forceMobile:!0,isWindowed:!0,initialMobileStage:ie,visiblePageSlugs:[...ar],onClose:()=>F(!1),mobileInstancesPage:Te?(0,$.jsx)(ud,{connection:e,onConnect:()=>F(!1),onActiveConnectionDeleted:t}):void 0})})})}):null,I?(0,$.jsx)(lt,{id:Wu,open:I,onOpenChange:e=>{e||te(!1)},title:(0,$.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold text-foreground`,children:n(`mobile.menu.update`)}),ariaLabel:n(`mobile.menu.update`),closeAriaLabel:n(`mobile.surface.closeAria`),resizeAriaLabel:n(`mobile.sessions.sheet.resizeAria`),initiallyExpanded:!0,children:(0,$.jsx)(Mn,{children:(0,$.jsx)(`div`,{className:`h-full overflow-auto px-5 py-4`,children:(0,$.jsx)(Ei,{initialUpdateDialogOpen:!0})})})}):null]}),(0,$.jsx)(Co,{enabled:Te&&s===`assistant`&&c.data?.supported===!0&&c.data?.enabled===!0}),(0,$.jsx)(Mn,{children:(0,$.jsx)(ii,{})}),(0,$.jsx)(_r,{})]})})})};function bd({apis:e}){Z.useEffect(()=>Fe(),[]);let{t}=tt(),n=be(e=>e.initializeApp),r=be(e=>e.isInitialized),i=be(e=>e.isConnected),a=be(e=>e.connectionPhase),o=D(e=>e.currentDirectory),c=J(e=>e.currentSessionId),l=J(e=>!!e.newSessionDraft?.open),d=J(e=>e.error),f=J(e=>e.clearError),m=B(e=>e.setIsMobile),h=yi(e=>e.refreshStatus),[g,_]=Z.useState(0),[v,y]=Z.useState(0),[x,S]=Z.useState(!1),[C,w]=Z.useState(`pending`),T=Z.useMemo(()=>Zt(),[]),[,E]=Z.useReducer(e=>e+1,0),O=Z.useMemo(()=>td(),[]),A=Z.useRef(0),j=Z.useRef(0),M=rn(()=>{w(`done`),_(e=>e+1)});qc(L(e=>{M.redeemPairingConnection(e)}));let N=Jc({ready:O&&i&&r});Z.useEffect(()=>{!M.error||!p()||V.error(M.error)},[M.error]);let ee=L(()=>{let t=p(),r=j.current+1;if(j.current=r,!t){nn();return}let i=()=>{n(),h(e.github,{force:!0}),be.getState().refreshMissingCatalogs({source:`mobileApp:nativeResume`})},a=()=>{u({apiBaseUrl:``,clientToken:null,runtimeKey:`mobile-disconnected`}),_(e=>e+1)};Qt().then(e=>{if(j.current===r){if(e===`no-connection`){a();return}if(e===`unreachable`){window.setTimeout(()=>{j.current===r&&Qt().then(e=>{if(j.current===r&&e!==`switched`&&e===`unchanged`){i();return}})},4e3);return}e!==`switched`&&i()}});let o=Date.now();o-A.current>=sd&&(A.current=o,window.dispatchEvent(new Event(`yuri:system-resume`)))});nd(),rd(ee),Z.useEffect(()=>{if(!O)return;let e,t=()=>{window.clearTimeout(e),e=window.setTimeout(()=>ee(),1500)};return window.addEventListener(`online`,t),()=>{window.removeEventListener(`online`,t),window.clearTimeout(e)}},[O,ee]),Z.useEffect(()=>(b(e),()=>b(null)),[e]),Z.useEffect(()=>{O&&oe().then(e=>{e&&e.notifyAppReady().catch(()=>void 0)})},[O]),Z.useEffect(()=>{if(!O)return;let e=!1,t=[];return oe().then(async n=>{if(!(!n||e))try{let r=await n.addListener(`download`,e=>{_i.getState().setOtaDownloadPercent(e.percent)}),i=await n.addListener(`downloadFailed`,()=>{_i.getState().setOtaDownloadFailed()}),a=await n.addListener(`downloadComplete`,()=>{_i.getState().setOtaPhase(`pending_restart`)}),o=await n.addListener(`appReloaded`,()=>{_i.getState().setOtaPhase(`pending_restart`)}),s=await n.addListener(`autoRevert`,()=>{console.warn(`[OTA] Capgo auto-reverted the last bundle`),_i.getState().setOtaPhase(`error`,`OTA update was reverted`)});if(e){r.remove(),i.remove(),a.remove(),o.remove(),s.remove();return}t.push(()=>void r.remove(),()=>void i.remove(),()=>void a.remove(),()=>void o.remove(),()=>void s.remove())}catch(e){console.warn(`[OTA] Failed to subscribe to Capgo updater events:`,e)}}),()=>{e=!0;for(let e of t)e()}},[O]),Z.useEffect(()=>s(e=>{if(e.runtimeKey&&e.runtimeKey===e.previousRuntimeKey){si(),E();return}Xr(e),G.getState().reset(),y(e=>e+1),_(e=>e+1)}),[]),Z.useEffect(()=>{if(N===`pending`)return;if(N===`connect`){w(`done`);return}if(!O||i||p()){w(`done`);return}let e=!1;return w(`attempting`),ln().then(e=>e?!0:nn()).catch(()=>!1).then(()=>{e||w(`done`)}),()=>{e=!0}},[N]),Z.useEffect(()=>{m(!0)},[m]),Z.useEffect(()=>{O&&!p()||n()},[g,n,O]),xn({enabled:!O||!!p(),source:`mobileApp:recovery`}),Z.useEffect(()=>{i&&k.setDirectory(o)},[o,i]),Z.useEffect(()=>{i&&h(e.github,{force:!0})},[e.github,i,h]),Z.useEffect(()=>{if(!d)return;let e=window.setTimeout(()=>f(),5e3);return()=>window.clearTimeout(e)},[f,d]),Z.useEffect(()=>{if(!(!i&&(!O||p()))){S(!1);return}let e=window.setTimeout(()=>S(!0),8e3);return()=>window.clearTimeout(e)},[i,O,g,v]),En(),bn({enabled:!0}),On(),ci(),xl({enabled:O&&i}),yu();let P=Dc(),F=!i&&a===`reconnecting`;if(!P)return(0,$.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background text-foreground`,children:(0,$.jsx)(jn,{width:120,height:120,isAnimated:!0})});let I=!!p();return O&&(!I||!i&&!F)?I?(0,$.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background px-6 text-center text-foreground`,children:(0,$.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-4`,children:[(0,$.jsx)(jn,{width:120,height:120,isAnimated:!x}),x?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsx)(`h1`,{className:`typography-h3 text-foreground`,children:t(`sessionAuth.error.networkTitle`)}),(0,$.jsx)(`p`,{className:`typography-body text-muted-foreground`,children:t(`sessionAuth.error.networkDescription`)})]}),(0,$.jsx)(H,{type:`button`,variant:`outline`,onClick:()=>{u({apiBaseUrl:``,clientToken:null,runtimeKey:`mobile-disconnected`}),_(e=>e+1)},children:t(`mobile.connect.cancelPassword`)})]}):null]})}):C===`done`?(0,$.jsx)(ao,{connection:M}):(0,$.jsxs)(`main`,{className:`relative flex min-h-dvh items-center justify-center bg-background text-foreground`,children:[(0,$.jsx)(jn,{width:120,height:120,isAnimated:!0}),T?(0,$.jsxs)(`div`,{className:`absolute inset-x-0 top-[calc(50%+84px)] flex flex-col items-center gap-0.5 px-6 text-center`,children:[(0,$.jsx)(`p`,{className:`typography-small text-muted-foreground`,children:t(`mobile.connect.splash.connectingTo`)}),(0,$.jsxs)(`p`,{className:`typography-small text-foreground`,children:[T,(0,$.jsx)(Rn,{})]})]}):null]}):!i&&!F?x?(0,$.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background px-6 text-center text-foreground`,children:(0,$.jsxs)(`div`,{className:`max-w-sm space-y-3`,children:[(0,$.jsx)(`h1`,{className:`typography-h3 text-foreground`,children:t(`sessionAuth.error.networkTitle`)}),(0,$.jsx)(`p`,{className:`typography-body text-muted-foreground`,children:t(`sessionAuth.error.networkDescription`)})]})}):(0,$.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background text-foreground`,children:(0,$.jsx)(jn,{width:120,height:120,isAnimated:!0})}):(0,$.jsx)(Mn,{children:(0,$.jsx)(Ae,{sdk:k.getSdkClient(),directory:o||``,bootstrapDirectory:!(l&&c===null),children:(0,$.jsxs)(Dn,{apis:e,children:[(0,$.jsx)(ur,{}),(0,$.jsx)(Zr,{ready:r,children:(0,$.jsx)(yt,{delayDuration:300,skipDelayDuration:150,children:(0,$.jsxs)(`div`,{className:`h-full bg-background text-foreground`,children:[(0,$.jsx)(Ir,{}),(0,$.jsx)(un,{}),(0,$.jsx)(Iu,{}),(0,$.jsx)(Sn,{embeddedBackgroundWorkEnabled:r}),(0,$.jsx)(yr,{}),(0,$.jsx)(ga,{}),(0,$.jsx)(Ea,{}),(0,$.jsx)(yd,{connection:M,onActiveConnectionDeleted:()=>{u({apiBaseUrl:``,clientToken:null,runtimeKey:`mobile-disconnected`}),G.getState().reset(),_(e=>e+1)}}),(0,$.jsx)(pn,{position:`top-center`,offset:`calc(var(--yuri-safe-area-top, 0px) + 16px)`}),r?(0,$.jsx)(Gr,{}):null,r?(0,$.jsx)(gr,{}):null,r?(0,$.jsx)(pr,{autoStart:!1}):null]})})})]})},v)})}function xd(e){return e.window}function Sd(e){e.currentTarget.style.transform=`none`}function Cd(e){return e.ensureStatus}function wd(e){return e.fetchStatus}function Td(e){return e.providers}function Ed(e){return e.currentProviderId}function Dd(e){return e.currentModelId}function Od(e){return e.getModelMetadata}function kd(e){return e.results}function Ad(e){return e.loadSettings}function jd(e){return e.isLoading}function Md(e){return e.displayMode}function Nd(e){return e.dropdownProviderIds}function Pd(e){return e.selectedModels}function Fd(e){return e.timeFormatPreference}function Id(e){return[e?.providerId,e]}function Ld(e){return e.providerId}function Rd(e){return!e}var zd=()=>{rt(),yn({runtimeKey:f(),initializeAppearance:async()=>{try{await T()}finally{qi()}},syncSettings:E,applyDirectory:kn,startWatchers:()=>{wn(),vn(),mn()},onError:(e,t)=>{console.error(e===`appearance`?`[mobile-main] appearance init failed:`:`[mobile-main] settings init failed:`,t)}})};function Bd(e){zd(),B.getState().setIsMobile(!0),ta(),St(),xt();let t=document.getElementById(`root`);if(!t)throw Error(`Root element not found`);let n=window.Capacitor?.isNativePlatform?.()===!0||window.location.protocol===`capacitor:`;n&&document.documentElement.classList.add(`yuri-native-app-active`);let r=n?{...e,notifications:{notifyAgentCompletion:async()=>!1,canNotify:()=>!1}}:e,i=(0,$.jsx)(bd,{apis:r});(0,Ui.createRoot)(t).render((0,$.jsx)(Z.StrictMode,{children:(0,$.jsx)(hn,{children:(0,$.jsx)(et,{children:(0,$.jsx)(fn,{children:(0,$.jsx)(Cn,{children:(0,$.jsx)(Dt,{children:(0,$.jsx)(gn,{children:n?i:(0,$.jsx)(_n,{children:i})})})})})})})}))}export{Bd as renderMobileApp};
|