@yuriai/web 0.3.6-beta.14 → 0.3.6-beta.15
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-5tMBB3OP.js → AgentAvatar-DmUeOy5j.js} +1 -1
- package/dist/assets/{AgentSelector-Cb7GNCSr.js → AgentSelector-p1Ai0tlg.js} +1 -1
- package/dist/assets/{ArchivedSessionsDialog-8gBAWGWJ.js → ArchivedSessionsDialog-Bjd3hgS2.js} +1 -1
- package/dist/assets/{AssistantConversationSurface-DBgTUUEt.js → AssistantConversationSurface-CTYtqGK_.js} +3 -3
- package/dist/assets/{AssistantSessionCard-_yFsx4WB.js → AssistantSessionCard-CX8zzXnW.js} +2 -2
- package/dist/assets/{AssistantUnreadBadge-a2u_bBfi.js → AssistantUnreadBadge-Nhei_TuI.js} +1 -1
- package/dist/assets/{AssistantView-BxqHaArC.js → AssistantView-BvmJC0q9.js} +1 -1
- package/dist/assets/{AssistantWorkingAvatar-DHZVN5kD.js → AssistantWorkingAvatar-BKPxjA77.js} +1 -1
- package/dist/assets/{AssistantsSettingsPage-CCG2-SGj.js → AssistantsSettingsPage-CPYKT5su.js} +1 -1
- package/dist/assets/{BinaryFileFallback-DyOwcZlP.js → BinaryFileFallback-DAmQpBO1.js} +1 -1
- package/dist/assets/{BtwPanel-BhJA_qnp.js → BtwPanel-BQgdeqj4.js} +2 -2
- package/dist/assets/BusyDots-CyVVXNMc.js +4 -0
- package/dist/assets/{ChatContainer-vX0hPadC.js → ChatContainer-_6gB1Tiu.js} +21 -21
- package/dist/assets/ChatView-DfPX2ADw.js +3 -0
- package/dist/assets/{DiagramView-XjJTNa7h.js → DiagramView-BAZPsxz1.js} +1 -1
- package/dist/assets/{DiffView-B6_7v5dX.js → DiffView-B_03bICv.js} +1 -1
- package/dist/assets/{DiffViewToggle-as2OeoZV.js → DiffViewToggle-CI-tbUKa.js} +1 -1
- package/dist/assets/{ErrorBoundary-6AeJc3yJ.js → ErrorBoundary-B1yQx4PN.js} +1 -1
- package/dist/assets/{FadeInOnReveal-BKAakuxD.js → FadeInOnReveal-CyF7ie8o.js} +1 -1
- package/dist/assets/{GuiPluginMount-DlrUvFjg.js → GuiPluginMount-jUR5ZEw-.js} +1 -1
- package/dist/assets/{GuiPluginPage-DsBH_Y2M.js → GuiPluginPage-Du-pLMlp.js} +1 -1
- package/dist/assets/{GuiPluginSurface-BisC0s24.js → GuiPluginSurface-hCEJJ4PF.js} +1 -1
- package/dist/assets/{GuiPluginTitlebarItems-CraVxzKU.js → GuiPluginTitlebarItems-DrOGcHI0.js} +1 -1
- package/dist/assets/{GuiPluginWindow-DjrDed9m.js → GuiPluginWindow-CDiqRDYz.js} +1 -1
- package/dist/assets/{Icon-zB0u-x9G.js → Icon-D4ELZTbQ.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-COr72scf.js → ImageLoadingPlaceholder-BKk1qYNK.js} +1 -1
- package/dist/assets/{LoadingImage-DCyqFHPY.js → LoadingImage-BWknOYgx.js} +1 -1
- package/dist/assets/{MarkdownRenderer-YxMjOHQg.js → MarkdownRenderer-B8pnxnuP.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-FJ3saBi-.js → MarkdownRendererImpl-HvxkLk8k.js} +3 -3
- package/dist/assets/{MarkstreamRendererImpl-69EMw8mz.js → MarkstreamRendererImpl-oBJscGhT.js} +1 -1
- package/dist/assets/{MobileAssistantSettingsPage-BoH-3iPc.js → MobileAssistantSettingsPage-ADZ_zb24.js} +1 -1
- package/dist/assets/{MobileAssistantTab-59nMj5dF.js → MobileAssistantTab-D2B1DhXn.js} +1 -1
- package/dist/assets/{MobileBtwPage-EwMOy6Vg.js → MobileBtwPage-D9AHKfUL.js} +1 -1
- package/dist/assets/{MobileChangesSurface-BfMWp6TX.js → MobileChangesSurface-C-fS41BA.js} +1 -1
- package/dist/assets/{MobileChatScreen-CZDiNi7M.js → MobileChatScreen-CpjY3NfP.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-DKv1HfQX.js → MobileDetailNavigation-DyEDDj7j.js} +1 -1
- package/dist/assets/{MobileFilesSurface-BiK7LCem.js → MobileFilesSurface-i1CdOJt_.js} +2 -2
- package/dist/assets/{MobileHtmlNetworkBoundary-BXh_BJ93.js → MobileHtmlNetworkBoundary-B0eGttNW.js} +2 -2
- package/dist/assets/{MobileOverlayPanel-Pr-vLaIF.js → MobileOverlayPanel-BRsSjQB0.js} +1 -1
- package/dist/assets/{MobileResizableSheet-O2gv2sCB.js → MobileResizableSheet-Iz6IOJIC.js} +1 -1
- package/dist/assets/{MobileSettingsTab-DadXop75.js → MobileSettingsTab-IFxVifD4.js} +1 -1
- package/dist/assets/{MobileShareBridge-CaiscA4w.js → MobileShareBridge-CYupKqbK.js} +1 -1
- package/dist/assets/{MobileSurface-B_2aVFm1.js → MobileSurface-Dj0XqWPS.js} +1 -1
- package/dist/assets/{MobileTabPageHeader-T0zUz7Wl.js → MobileTabPageHeader-DyDjEHij.js} +1 -1
- package/dist/assets/{ModelLogo-C1Vv7gz6.js → ModelLogo-Ddsuaz2-.js} +1 -1
- package/dist/assets/{ModelSelector-BP_s_VhY.js → ModelSelector-BLqwVn9h.js} +1 -1
- package/dist/assets/{MultiRunWindow--tNVFKUJ.js → MultiRunWindow-DOpqKyhx.js} +1 -1
- package/dist/assets/{OnboardingScreen-DMdy73Dq.js → OnboardingScreen-CyYxHZ27.js} +1 -1
- package/dist/assets/{OverlayScrollbar-n5T49w2e.js → OverlayScrollbar-DdK6iB_P.js} +1 -1
- package/dist/assets/{PierreDiffViewer-i3OsvUKm.js → PierreDiffViewer-DnLcVaQ_.js} +1 -1
- package/dist/assets/{ProviderLogo-D-ldwq0G.js → ProviderLogo-ClFNH0bR.js} +1 -1
- package/dist/assets/{RemoteAssistantSessionCard-CNpcgVmv.js → RemoteAssistantSessionCard-Bf3dzN6s.js} +1 -1
- package/dist/assets/{RemoteDesktopPanel-hTuLKJZb.js → RemoteDesktopPanel-CYrH1ew9.js} +1 -1
- package/dist/assets/ScheduledTasksDialog-Cjl3xt0U.js +3 -0
- package/dist/assets/{ScrollableOverlay-DAMUOn67.js → ScrollableOverlay-CpChvNBP.js} +1 -1
- package/dist/assets/{SettingsGroup-CwMJmhq2.js → SettingsGroup-DiF6MwFq.js} +1 -1
- package/dist/assets/{SettingsView-bYWNjHtA.js → SettingsView-BG9k0S0n.js} +10 -10
- package/dist/assets/{SettingsWindow-D0ZzAXW0.js → SettingsWindow-CZqmOqJh.js} +1 -1
- package/dist/assets/{SetupTourDialog-CgM5YonA.js → SetupTourDialog-Dm893t6A.js} +1 -1
- package/dist/assets/{SyncActions-Ct2yZTbg.js → SyncActions-DxL0WqMS.js} +1 -1
- package/dist/assets/{TerminalView-BU5w40RA.js → TerminalView-Cm_Az2IR.js} +3 -3
- package/dist/assets/{TextSelectionMenu-a7yyDz5R.js → TextSelectionMenu-C-QA2JSI.js} +2 -2
- package/dist/assets/{ToolOutputDialog-CGYnrXVV.js → ToolOutputDialog-IbK1m1cQ.js} +2 -2
- package/dist/assets/{YuriLogo-Cexwa29m.js → YuriLogo-CdbCjzA8.js} +1 -1
- package/dist/assets/{YuriWordmark-Bn5KdqMC.js → YuriWordmark-rISEHjrd.js} +1 -1
- package/dist/assets/{assistant-attachment-cache-Y7yhlQcv.js → assistant-attachment-cache-BsIYVOYw.js} +1 -1
- package/dist/assets/{assistantMessagePreview-BXNdMDW-.js → assistantMessagePreview-DbTwPLzY.js} +1 -1
- package/dist/assets/{assistantQueries-DkAmjFg7.js → assistantQueries-DJyuR5Cm.js} +1 -1
- package/dist/assets/{auto-read-context-DLilPZMl.js → auto-read-context-B0niCh-F.js} +1 -1
- package/dist/assets/{capgoAdapter-DaIrgBjp.js → capgoAdapter-CXshem6r.js} +1 -1
- package/dist/assets/{card-CXE0ffyH.js → card-BCtykvi_.js} +1 -1
- package/dist/assets/{chatUpwardIntent-DRFjEP4t.js → chatUpwardIntent-DR7dxJwx.js} +1 -1
- package/dist/assets/{checkbox-hYuewn9u.js → checkbox-DsB97EEi.js} +1 -1
- package/dist/assets/{client-QcYZg8_d.js → client-BuCd-T7s.js} +1 -1
- package/dist/assets/{collapsible-C4a0ndbm.js → collapsible-acYUve5w.js} +1 -1
- package/dist/assets/{connection-hint-Ci6c4iij.js → connection-hint-BYkEkoO4.js} +1 -1
- package/dist/assets/{context-menu-D73tnkiI.js → context-menu-HoHZ2sEw.js} +1 -1
- package/dist/assets/{desktopHosts-DFa3lf0i.js → desktopHosts-COI-czjF.js} +1 -1
- package/dist/assets/{desktopRelayRestore-CGq-Ylgq.js → desktopRelayRestore-BEPNc7qb.js} +1 -1
- package/dist/assets/device-TCHW5U2y.js +2 -0
- package/dist/assets/{diagram-B2X1oieg.js → diagram-Bp_Qevoe.js} +1 -1
- package/dist/assets/{dialog-B2Po85oU.js → dialog-CeXUC0Ej.js} +1 -1
- package/dist/assets/{dropdown-menu-vW7wfT5z.js → dropdown-menu-CwcXAdvN.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-B73h0W0P.js → fileMentionTouchSelection-vrvxc508.js} +1 -1
- package/dist/assets/{fileReferenceActions-DEUhs_7h.js → fileReferenceActions-wN7mWY3w.js} +1 -1
- package/dist/assets/{gitApi-DG2Gj6gC.js → gitApi-Di_eB3Io.js} +1 -1
- package/dist/assets/{gitApiHttp-C8AU1uiY.js → gitApiHttp-CrPYe9Oc.js} +2 -2
- package/dist/assets/{githubAuthQueries-IJPWBo0B.js → githubAuthQueries-CTTiXZ9q.js} +1 -1
- package/dist/assets/{historyImportQueries-B3QBdaKo.js → historyImportQueries-B4DVAuxZ.js} +1 -1
- package/dist/assets/{host-DchPrZpw.js → host-BjnskVUP.js} +1 -1
- package/dist/assets/{i18n-WsU03nwB.js → i18n-CYty_Jft.js} +1 -1
- package/dist/assets/{icons-6sA6AOaU.js → icons-P6A_c8tb.js} +1 -1
- package/dist/assets/{imageSource-B39pFDdo.js → imageSource-BquIRnWW.js} +1 -1
- package/dist/assets/{input-BpDiYSsP.js → input-CozXpDTq.js} +1 -1
- package/dist/assets/{input-store-PqhVEhUI.js → input-store-BtvRZZcg.js} +1 -1
- package/dist/assets/insertionBoundaries-Cw7x86o4.js +1 -0
- package/dist/assets/{kbd-Dd1lM8OM.js → kbd-DPRFdABo.js} +1 -1
- package/dist/assets/{main-BtqqLSTt.js → main-CmWGNM6N.js} +2 -2
- package/dist/assets/main-DxvrNIsv.js +169 -0
- package/dist/assets/{markdownHeightCache-BzWUzccz.js → markdownHeightCache-BIB64pXI.js} +1 -1
- package/dist/assets/{mcpQueries-8frBxd65.js → mcpQueries-WWAWy_n9.js} +1 -1
- package/dist/assets/miniChat-CA9XT4K1.js +2 -0
- package/dist/assets/mobile-BKQlIKz3.js +2 -0
- package/dist/assets/{mobileBackNavigation-Ch0aK3t9.js → mobileBackNavigation-CX_MC0oM.js} +1 -1
- package/dist/assets/{mobileConnections-Bay_JNn0.js → mobileConnections-DuohwVoG.js} +2 -2
- package/dist/assets/{multirun-CQ2v1-nW.js → multirun-DXO3dw9u.js} +1 -1
- package/dist/assets/{native-config-B8eHFnvv.js → native-config-C_hqdruM.js} +1 -1
- package/dist/assets/{nativeComposerCover--wSR2Iru.js → nativeComposerCover-Cyi4eoBm.js} +1 -1
- package/dist/assets/{navigation-33oih6q2.js → navigation-Bxjv649w.js} +2 -2
- package/dist/assets/openRemoteProjectSession-W9p1SC1j.js +1 -0
- package/dist/assets/openSessionFromDeepLink-CeiBnoBN.js +2 -0
- package/dist/assets/platform-B2ylz14u.js +1 -0
- package/dist/assets/{pluginPresentation-BqcbcLYL.js → pluginPresentation-CWyI_3os.js} +2 -2
- package/dist/assets/{project-preview-CIkGbBPZ.js → project-preview-Dq--046z.js} +1 -1
- package/dist/assets/{projectActions-D84EVh3q.js → projectActions-B11KAI3f.js} +1 -1
- package/dist/assets/{prompt-attachment-upload-D1c308Ba.js → prompt-attachment-upload-m0vbcftI.js} +1 -1
- package/dist/assets/{pwa-JM_Ia4Qo.js → pwa-RpFKwS6l.js} +2 -2
- package/dist/assets/{queue-abort-optimistic-BspQeOrZ.js → queue-abort-optimistic-B624kCyc.js} +1 -1
- package/dist/assets/{quota-C7uYEfoX.js → quota-CNmk_bQD.js} +1 -1
- package/dist/assets/{reference-history-DuOv6xPy.js → reference-history-xOIH7D3x.js} +1 -1
- package/dist/assets/{remote-input-store-CquhCIoR.js → remote-input-store-CE88ZLsw.js} +1 -1
- package/dist/assets/{remoteProjectQueries-BunVM5PM.js → remoteProjectQueries-zO4jYbru.js} +1 -1
- package/dist/assets/{remoteSessionReference-brIKt6ea.js → remoteSessionReference-CNows8Mw.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-1iiZ6q0N.js → renderElectronMiniChatApp-C0VEQ1ge.js} +2 -2
- package/dist/assets/renderMobileApp-ByzqYif5.js +17 -0
- package/dist/assets/{runtime-file-download-wMVtKk2v.js → runtime-file-download-CzZ_VAoB.js} +1 -1
- package/dist/assets/{runtime-file-resource-DKJJoOOc.js → runtime-file-resource-9kLrAtnQ.js} +1 -1
- package/dist/assets/{runtimeConfig-qjNoqcXT.js → runtimeConfig-CnEfMg7l.js} +1 -1
- package/dist/assets/runtimeEndpointReset-DFqTJZ0I.js +4 -0
- package/dist/assets/{scheduledTaskNavigation-DpfZSGu8.js → scheduledTaskNavigation-r3g3DfXq.js} +1 -1
- package/dist/assets/{select-Ojd202kE.js → select-B2UkBeQN.js} +1 -1
- package/dist/assets/sessionLookup-DCk6ryrM.js +1 -0
- package/dist/assets/{sessionOwnership-Nqb7MQgW.js → sessionOwnership-BAee5GI3.js} +1 -1
- package/dist/assets/{shortcuts-BOzfBNF8.js → shortcuts-CiFlt2ws.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-DlQjS9bw.js → sortable-tabs-strip-Doz9wEki.js} +1 -1
- package/dist/assets/{speechSettingsQueries-DzDLUBnb.js → speechSettingsQueries-DxCvZVJ0.js} +1 -1
- package/dist/assets/{switch-BN9zvb0m.js → switch-YSNGU195.js} +1 -1
- package/dist/assets/{terminalApi-D2ECmoAo.js → terminalApi-CsTh04jY.js} +1 -1
- package/dist/assets/{textarea-ChLN9tnA.js → textarea-DxGZoBdI.js} +1 -1
- package/dist/assets/{timeFormat-D1hdmWbu.js → timeFormat-fIpRkrOb.js} +1 -1
- package/dist/assets/{tooltip-Cdsa-YWG.js → tooltip-D2BtRCgs.js} +1 -1
- package/dist/assets/{truncated-path-DjN9DJvh.js → truncated-path-ouBMaMLS.js} +1 -1
- package/dist/assets/{types-DHO20zYy.js → types-B-Io5z5w.js} +1 -1
- package/dist/assets/ui-BwSpLYDL.js +13 -0
- package/dist/assets/useAppFontEffects-Cuirbagj.js +7 -0
- package/dist/assets/{useAssistantUIStore-DEiMjSqf.js → useAssistantUIStore-BUWPTwNV.js} +1 -1
- package/dist/assets/{useDesktopWindowControlsLayout-OdYH5vsn.js → useDesktopWindowControlsLayout-BBO7snRO.js} +1 -1
- package/dist/assets/{useDictation-DUR68U4T.js → useDictation-C81KyPa6.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-DNVTRp-B.js → useEffectiveDirectory-DeoADFfu.js} +1 -1
- package/dist/assets/{useFontPreferences-BY0TXvWI.js → useFontPreferences-DyMUXTQC.js} +1 -1
- package/dist/assets/{useGitStore-DsxzluvZ.js → useGitStore-BVToTkFp.js} +1 -1
- package/dist/assets/{useInlineCommentDraftStore-DU-yffqD.js → useInlineCommentDraftStore-BN8BgIUL.js} +1 -1
- package/dist/assets/useMcpConfigStore-CFUCk1mM.js +1 -0
- package/dist/assets/{useMobileSwipeActions-rPGl_HNn.js → useMobileSwipeActions-l0OHTMa8.js} +1 -1
- package/dist/assets/useMobileTranscriptSyncHint-LoxQ23zb.js +10 -0
- package/dist/assets/{useModelLists-xVEEc-e7.js → useModelLists-RMIHCaOi.js} +1 -1
- package/dist/assets/{useOpenCodeReadiness-C5D4297L.js → useOpenCodeReadiness-Cw5UOeLB.js} +1 -1
- package/dist/assets/{usePluginsStore-DEctn121.js → usePluginsStore-Cnj8I3MZ.js} +1 -1
- package/dist/assets/{useProjectGitActions-D7yZSor5.js → useProjectGitActions-D9TZc59T.js} +1 -1
- package/dist/assets/{useProjectGitStore-DFz9Eb6v.js → useProjectGitStore-qcnLHK_q.js} +1 -1
- package/dist/assets/{useProjectRuntimeAPIs-TALa4FqO.js → useProjectRuntimeAPIs-BoNGczR0.js} +1 -1
- package/dist/assets/{useQuotaStore-BqPJ1nzk.js → useQuotaStore-B4FEz0gR.js} +1 -1
- package/dist/assets/{useSessionBtwStore-DAQVlbuf.js → useSessionBtwStore-DD2dFcs5.js} +1 -1
- package/dist/assets/{useStreamingTextThrottle-BpC1BNz_.js → useStreamingTextThrottle-Cj6xIVZf.js} +1 -1
- package/dist/assets/{useUIStore-P32bzAJc.js → useUIStore-68ZPpgYA.js} +1 -1
- package/dist/assets/{worktreeManager-D56glCi_.js → worktreeManager-CnxL8GZi.js} +1 -1
- package/dist/assets/{worktreeSourceBranchPreference-CNtT0ymW.js → worktreeSourceBranchPreference-ii7ydXPw.js} +1 -1
- package/dist/index.html +15 -15
- package/dist/mini-chat.html +15 -15
- package/dist/mobile.html +1 -1
- package/package.json +1 -1
- package/server/lib/gui-customization/skill/references/deep-links.md +6 -6
- package/dist/assets/BusyDots-B9Zv4OUg.js +0 -4
- package/dist/assets/ChatView-OJAZBsfN.js +0 -3
- package/dist/assets/ScheduledTasksDialog-dgU5OpBK.js +0 -3
- package/dist/assets/device-CtdJ8KBJ.js +0 -2
- package/dist/assets/insertionBoundaries-Cu6Djn8S.js +0 -1
- package/dist/assets/main-CdUAbE7p.js +0 -169
- package/dist/assets/miniChat-C7JCQrXA.js +0 -2
- package/dist/assets/mobile-CcIasitd.js +0 -2
- package/dist/assets/openRemoteProjectSession-B94TYao_.js +0 -1
- package/dist/assets/openSessionFromDeepLink-C9jS-EIM.js +0 -2
- package/dist/assets/platform-CNdx57HN.js +0 -1
- package/dist/assets/renderMobileApp-CdTenU5H.js +0 -17
- package/dist/assets/runtimeEndpointReset-DKchBECK.js +0 -4
- package/dist/assets/sessionLookup-D299jmfx.js +0 -1
- package/dist/assets/ui-CU6n15y3.js +0 -13
- package/dist/assets/useAppFontEffects-Bqt4cv2k.js +0 -7
- package/dist/assets/useMcpConfigStore-al7LZT72.js +0 -1
- package/dist/assets/useMobileTranscriptSyncHint-BVvgdcp4.js +0 -10
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{r as n}from"./platform-CNdx57HN.js";import{ot as r,st as i}from"./vendor-base-ui-wXsskyKm.js";import{n as a}from"./vendor-react-BkccXcWz.js";import{n as o,s,t as c}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{G as l,P as u,W as d}from"./runtime-file-resource-DKJJoOOc.js";import{a as f,r as p}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as m}from"./useUIStore-P32bzAJc.js";import{Ba as ee,Dt as te,Pt as h,Yi as g,Yn as _,no as v,oa as y,ro as b,t as x}from"./ui-CU6n15y3.js";import{n as S}from"./Icon-zB0u-x9G.js";import{n as C,t as ne}from"./i18n-WsU03nwB.js";import{n as w}from"./ScrollableOverlay-DAMUOn67.js";import{n as re,t as T}from"./MobileResizableSheet-O2gv2sCB.js";import{i as E,t as D}from"./vendor-framer-motion-D5NyyC73.js";import{n as ie,o as ae,r as oe,t as O}from"./dialog-B2Po85oU.js";import{c as k,n as se,r as A,t as ce}from"./dropdown-menu-vW7wfT5z.js";import{a as j,n as M,r as le,t as ue}from"./context-menu-D73tnkiI.js";import{t as de}from"./textarea-ChLN9tnA.js";import{n as fe}from"./mobileBackNavigation-Ch0aK3t9.js";import{t as pe}from"./input-BpDiYSsP.js";import{D as N,E as P,O as me,T as he,_ as F,k as ge}from"./assistantQueries-DkAmjFg7.js";import{n as I}from"./AgentAvatar-5tMBB3OP.js";import{t as L}from"./MobileDetailNavigation-DKv1HfQX.js";import{t as R}from"./checkbox-hYuewn9u.js";import{a as z,c as B,r as _e}from"./insertionBoundaries-Cu6Djn8S.js";import{t as ve}from"./MobileOverlayPanel-Pr-vLaIF.js";import{t as V}from"./vendor-motion-vLNN8EMu.js";import{c as H,i as ye,n as be,s as xe,t as Se}from"./select-Ojd202kE.js";import{a as U,i as Ce,n as we}from"./projectMeta-vIaGFaQr.js";import{r as Te,t as Ee}from"./router-DXUi1sBd.js";import{t as De}from"./scheduledTaskNavigation-DpfZSGu8.js";import{t as Oe}from"./switch-BN9zvb0m.js";import{t as ke}from"./MobileTabPageHeader-T0zUz7Wl.js";import{t as Ae}from"./sortAssistantContacts-CcEdm3mS.js";import{t as W}from"./ModelSelector-BP_s_VhY.js";import{t as je}from"./AgentSelector-Cb7GNCSr.js";import{t as Me}from"./vendor-cron-parser-BmO80h0C.js";var G=t(i(),1),Ne=a(),Pe=`yuri-settings-group-row border-b border-[var(--yuri-settings-row-divider)] last:border-b-0`,Fe=`yuri-settings-group-label`,Ie=Me();function K(e){if(!e||!e.trim())return{valid:!1,error:`required`};try{return Ie.CronExpressionParser.parse(e),{valid:!0}}catch(e){return{valid:!1,error:e instanceof Error?e.message:`Invalid cron expression`}}}function Le(e,t,n=4){try{let r=t?{tz:t,currentDate:new Date}:{currentDate:new Date},i=Ie.CronExpressionParser.parse(e,r),a=[];for(let e=0;e<n;e+=1){let e=i.next();e&&a.push(e.toDate())}return a}catch{return[]}}var Re=[{expression:`*/5 * * * *`,labelKey:`sessions.scheduledTasks.editor.cronExpression.examples.every5min`},{expression:`0 * * * *`,labelKey:`sessions.scheduledTasks.editor.cronExpression.examples.everyHour`},{expression:`0 9 * * 1`,labelKey:`sessions.scheduledTasks.editor.cronExpression.examples.monday9am`},{expression:`0 9,17 * * *`,labelKey:`sessions.scheduledTasks.editor.cronExpression.examples.9am5pm`},{expression:`0 0 1 * *`,labelKey:`sessions.scheduledTasks.editor.cronExpression.examples.firstOfMonth`}],q=r(),ze=[0,1,2,3,4,5,6],Be=`!h-9 !min-h-9 w-full min-w-0 rounded-full border-0 bg-[var(--surface-elevated)] px-3 py-1 ring-1 ring-inset ring-border/60 transition-[background-color,box-shadow] duration-150 ease-out hover:[&:not(:focus)]:bg-[var(--surface-subtle)] hover:[&:not(:focus)]:ring-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] data-[popup-open]:bg-[var(--surface-subtle)] data-[popup-open]:shadow-sm motion-reduce:transition-none`,Ve=`yuri-settings-inline-value`,He=`yuri-settings-split-row ${Pe}`,J=Ve,Y=He,Ue=()=>{let e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`},X=e=>{let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=new Date(n,r-1,i);return Number.isNaN(a.getTime())||a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==i?null:a},We=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`,Ge=(e,t,n)=>{let r=X(e);return r?new Intl.DateTimeFormat(n,{month:`short`,day:`numeric`,year:`numeric`}).format(r):t},Z=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,1),Ke=(e,t)=>{let n=e.getFullYear(),r=e.getMonth(),i=(new Date(n,r,1).getDay()-t+7)%7,a=new Date(n,r+1,0).getDate(),o=new Date(n,r,0).getDate(),s=[];for(let e=0;e<42;e+=1){let t=e-i+1;if(t<=0){let e=o+t;s.push({date:new Date(n,r-1,e),inCurrentMonth:!1});continue}if(t>a){s.push({date:new Date(n,r+1,t-a),inCurrentMonth:!1});continue}s.push({date:new Date(n,r,t),inCurrentMonth:!0})}return s},Q=e=>{let t=/^([01]\d|2[0-3]):([0-5]\d)$/.exec(e);if(!t)return{hour24:`00`,hour12:`12`,minute:`00`,meridiem:`AM`};let n=Number(t[1]),r=t[2],i=n>=12?`PM`:`AM`,a=n%12==0?12:n%12;return{hour24:String(n).padStart(2,`0`),hour12:String(a).padStart(2,`0`),minute:r,meridiem:i}},qe=(e,t,n)=>{let r=Number(e),i=Number(t),a=Number.isFinite(r)?Math.min(12,Math.max(1,r)):12,o=Number.isFinite(i)?Math.min(59,Math.max(0,i)):0,s=a%12;return n===`PM`&&(s+=12),`${String(s).padStart(2,`0`)}:${String(o).padStart(2,`0`)}`},$=(e,t)=>{let{max:n,min:r=0,loop:i=!1}=t,a=Number.parseInt(e,10);return Number.isFinite(a)?(i?(a>n&&(a=r),a<r&&(a=n)):(a>n&&(a=n),a<r&&(a=r)),String(a).padStart(2,`0`)):`00`},Je=e=>/^(0[1-9]|1[0-2])$/.test(e)?e:$(e,{min:1,max:12}),Ye=e=>/^[0-5][0-9]$/.test(e)?e:$(e,{max:59}),Xe=(e,t)=>$(String(Number.parseInt(e,10)+t),{min:1,max:12,loop:!0}),Ze=(e,t)=>$(String(Number.parseInt(e,10)+t),{min:0,max:59,loop:!0}),Qe=e=>{try{let t=Intl.Locale;if(typeof t!=`function`)return 1;let n=new t(e).weekInfo?.firstDay;return typeof n==`number`?n%7:1}catch{return 1}},$e=e=>{try{let t=new Intl.DateTimeFormat(e,{hour:`numeric`}).resolvedOptions();return typeof t.hour12==`boolean`?!t.hour12:t.hourCycle===`h23`||t.hourCycle===`h24`}catch{return!0}},et=e=>{let t=new Intl.DateTimeFormat(e,{weekday:`short`}),n=new Date(2023,0,1);return ze.map(e=>t.format(new Date(n.getFullYear(),n.getMonth(),n.getDate()+e)))},tt=(e,t)=>[...e.slice(t),...e.slice(0,t)],nt=e=>{let t=(0,Ne.c)(9),{htmlFor:n,required:r,className:i,children:a}=e,o;t[0]===i?o=t[1]:(o=v(`typography-ui-label font-normal text-foreground`,i),t[0]=i,t[1]=o);let s;t[2]===r?s=t[3]:(s=r&&(0,q.jsx)(`span`,{className:`ml-0.5 text-destructive`,children:`*`}),t[2]=r,t[3]=s);let c;return t[4]!==a||t[5]!==n||t[6]!==o||t[7]!==s?(c=(0,q.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,q.jsxs)(`label`,{htmlFor:n,className:o,children:[a,s]})}),t[4]=a,t[5]=n,t[6]=o,t[7]=s,t[8]=c):c=t[8],c},rt=e=>{let t=(0,Ne.c)(85),{value:n,onChange:r,className:i,use24Hour:a,hourAriaLabel:o,minuteAriaLabel:s,periodAriaLabel:c,amLabel:l,pmLabel:u}=e,d;t[0]===n?d=t[1]:(d=Q(n),t[0]=n,t[1]=d);let f=d,p=G.useRef(null),m=G.useRef(null),[ee,te]=G.useState(null),[h,g]=G.useState(null),_=G.useRef(null),y=G.useRef(null),b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{_.current=e,te(e)},t[2]=b):b=t[2];let x=b,S;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{y.current=e,g(e)},t[3]=S):S=t[3];let C=S,ne=pt,w=mt,re=ht,T;t[4]!==r||t[5]!==f.meridiem||t[6]!==f.minute||t[7]!==a?(T=e=>{let t=e.replace(/\D/g,``).slice(0,2);x(t),t.length===2&&(r(a?re(ne(t),f.minute):qe(Je(t),f.minute,f.meridiem)),x(null),m.current?.focus())},t[4]=r,t[5]=f.meridiem,t[6]=f.minute,t[7]=a,t[8]=T):T=t[8];let E=T,D;t[9]!==r||t[10]!==f.meridiem||t[11]!==f.minute||t[12]!==a?(D=()=>{let e=_.current;if(e!==null&&(x(null),e.length!==0)){if(a){r(re(ne(e.padStart(2,`0`)),f.minute));return}r(qe(Je(e.padStart(2,`0`)),f.minute,f.meridiem))}},t[9]=r,t[10]=f.meridiem,t[11]=f.minute,t[12]=a,t[13]=D):D=t[13];let ie=D,ae;t[14]!==r||t[15]!==f.hour12||t[16]!==f.hour24||t[17]!==f.meridiem||t[18]!==a?(ae=e=>{let t=e.replace(/\D/g,``).slice(0,2);C(t),t.length===2&&(r(a?re(f.hour24,Ye(t)):qe(f.hour12,Ye(t),f.meridiem)),C(null))},t[14]=r,t[15]=f.hour12,t[16]=f.hour24,t[17]=f.meridiem,t[18]=a,t[19]=ae):ae=t[19];let oe=ae,O;t[20]!==r||t[21]!==f.hour12||t[22]!==f.hour24||t[23]!==f.meridiem||t[24]!==a?(O=()=>{let e=y.current;e!==null&&(C(null),e.length!==0&&r(a?re(f.hour24,Ye(e.padStart(2,`0`))):qe(f.hour12,Ye(e.padStart(2,`0`)),f.meridiem)))},t[20]=r,t[21]=f.hour12,t[22]=f.hour24,t[23]=f.meridiem,t[24]=a,t[25]=O):O=t[25];let k=O,se;t[26]!==r||t[27]!==f.hour12||t[28]!==f.hour24||t[29]!==f.meridiem||t[30]!==f.minute||t[31]!==a?(se=e=>r(a?re(w(f.hour24,e),f.minute):qe(Xe(f.hour12,e),f.minute,f.meridiem)),t[26]=r,t[27]=f.hour12,t[28]=f.hour24,t[29]=f.meridiem,t[30]=f.minute,t[31]=a,t[32]=se):se=t[32];let A=se,ce;t[33]!==r||t[34]!==f.hour12||t[35]!==f.hour24||t[36]!==f.meridiem||t[37]!==f.minute||t[38]!==a?(ce=e=>r(a?re(f.hour24,Ze(f.minute,e)):qe(f.hour12,Ze(f.minute,e),f.meridiem)),t[33]=r,t[34]=f.hour12,t[35]=f.hour24,t[36]=f.meridiem,t[37]=f.minute,t[38]=a,t[39]=ce):ce=t[39];let j=ce,M;t[40]!==r||t[41]!==f.hour12||t[42]!==f.meridiem||t[43]!==f.minute?(M=e=>{e!==f.meridiem&&r(qe(f.hour12,f.minute,e))},t[40]=r,t[41]=f.hour12,t[42]=f.meridiem,t[43]=f.minute,t[44]=M):M=t[44];let le=M,ue;t[45]!==ie||t[46]!==A?(ue=e=>{if(e.key===`ArrowRight`){e.preventDefault(),ie(),m.current?.focus();return}(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),x(null),A(e.key===`ArrowUp`?1:-1))},t[45]=ie,t[46]=A,t[47]=ue):ue=t[47];let de=ue,fe;t[48]!==k||t[49]!==j?(fe=e=>{if(e.key===`ArrowLeft`&&(e.currentTarget.selectionStart??0)===0){e.preventDefault(),k(),p.current?.focus();return}(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),C(null),j(e.key===`ArrowUp`?1:-1))},t[48]=k,t[49]=j,t[50]=fe):fe=t[50];let pe=fe,N=a?`px-2`:`pl-2 pr-1`,P;t[51]!==i||t[52]!==N?(P=v(`flex h-9 w-full min-w-0 items-center gap-1 rounded-full border-0 bg-[var(--surface-elevated)] ring-1 ring-inset ring-border/60 transition duration-200 ease-out hover:[&:not(:focus-within)]:bg-[var(--surface-subtle)] hover:[&:not(:focus-within)]:ring-transparent focus-within:ring-2 focus-within:ring-[var(--interactive-focus-ring)]`,N,i),t[51]=i,t[52]=N,t[53]=P):P=t[53];let me=ee??(a?f.hour24:f.hour12),he;t[54]===E?he=t[55]:(he=e=>E(e.target.value),t[54]=E,t[55]=he);let F;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>x(``),t[56]=F):F=t[56];let ge;t[57]!==ie||t[58]!==o||t[59]!==de||t[60]!==me||t[61]!==he?(ge=(0,q.jsx)(`input`,{ref:p,inputMode:`numeric`,value:me,onChange:he,onKeyDown:de,onFocus:F,onBlur:ie,maxLength:2,"aria-label":o,className:`h-7 w-7 shrink-0 rounded-sm bg-transparent text-center font-mono text-sm tabular-nums text-foreground outline-none caret-transparent focus:bg-interactive-hover`}),t[57]=ie,t[58]=o,t[59]=de,t[60]=me,t[61]=he,t[62]=ge):ge=t[62];let I;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,q.jsx)(`span`,{className:`font-mono text-sm text-muted-foreground`,children:`:`}),t[63]=I):I=t[63];let L=h??f.minute,R;t[64]===oe?R=t[65]:(R=e=>oe(e.target.value),t[64]=oe,t[65]=R);let z;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>C(``),t[66]=z):z=t[66];let B;t[67]!==k||t[68]!==s||t[69]!==pe||t[70]!==L||t[71]!==R?(B=(0,q.jsx)(`input`,{ref:m,inputMode:`numeric`,value:L,onChange:R,onKeyDown:pe,onFocus:z,onBlur:k,maxLength:2,"aria-label":s,className:`h-7 w-7 shrink-0 rounded-sm bg-transparent text-center font-mono text-sm tabular-nums text-foreground outline-none caret-transparent focus:bg-interactive-hover`}),t[67]=k,t[68]=s,t[69]=pe,t[70]=L,t[71]=R,t[72]=B):B=t[72];let _e;t[73]!==l||t[74]!==f.meridiem||t[75]!==c||t[76]!==u||t[77]!==le||t[78]!==a?(_e=a?null:(0,q.jsxs)(Se,{value:f.meridiem,onValueChange:e=>le(e),children:[(0,q.jsx)(xe,{"aria-label":c,className:`ml-1 h-7 w-fit border-0 bg-transparent pl-2 pr-1 shadow-none hover:bg-interactive-hover focus:ring-0`,children:(0,q.jsx)(H,{})}),(0,q.jsxs)(be,{className:`motion-reduce:transition-none`,children:[(0,q.jsx)(ye,{value:`AM`,children:l}),(0,q.jsx)(ye,{value:`PM`,children:u})]})]}),t[73]=l,t[74]=f.meridiem,t[75]=c,t[76]=u,t[77]=le,t[78]=a,t[79]=_e):_e=t[79];let ve;return t[80]!==P||t[81]!==ge||t[82]!==B||t[83]!==_e?(ve=(0,q.jsxs)(`div`,{className:P,children:[ge,I,B,_e]}),t[80]=P,t[81]=ge,t[82]=B,t[83]=_e,t[84]=ve):ve=t[84],ve},it=e=>new Date(e.getFullYear(),e.getMonth(),1),at=()=>{let e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())},ot=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),st=e=>{if(!e)return[`09:00`];let t=(Array.isArray(e.schedule.times)?e.schedule.times:e.schedule.time?[e.schedule.time]:[]).filter(e=>typeof e==`string`&&/^([01]\d|2[0-3]):([0-5]\d)$/.test(e)).map(e=>e.trim()),n=Array.from(new Set(t)).sort((e,t)=>e.localeCompare(t));return n.length>0?n:[`09:00`]},ct=(e,t)=>{let n=Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`;return e?{id:e.id,name:e.name,enabled:e.enabled,schedule:{kind:e.schedule.kind===`cron`?`cron`:e.schedule.kind===`once`?`once`:e.schedule.kind===`weekly`?`weekly`:`daily`,times:st(e),onceDate:typeof e.schedule.date==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e.schedule.date)?e.schedule.date:Ue(),onceTime:typeof e.schedule.time==`string`&&/^([01]\d|2[0-3]):([0-5]\d)$/.test(e.schedule.time)?e.schedule.time:`09:00`,weekdays:Array.isArray(e.schedule.weekdays)?e.schedule.weekdays:[1],timezone:e.schedule.timezone||n,cronExpression:e.schedule.kind===`cron`&&typeof e.schedule.cron==`string`?e.schedule.cron:``},execution:{prompt:e.execution.prompt,providerID:e.execution.providerID,modelID:e.execution.modelID,variant:e.execution.variant||``,agent:e.execution.agent||``,goalEnabled:e.execution.goalEnabled===!0},state:e.state}:{name:``,enabled:!0,schedule:{kind:`daily`,times:[`09:00`],onceDate:Ue(),onceTime:`09:00`,weekdays:[1],timezone:n,cronExpression:``},execution:{prompt:``,providerID:t.providerID,modelID:t.modelID,variant:t.variant,agent:t.agent,goalEnabled:!1}}},lt=(e,t)=>{if(!e.name.trim())return t(`sessions.scheduledTasks.editor.validation.taskNameRequired`);if(!e.execution.prompt.trim())return t(`sessions.scheduledTasks.editor.validation.promptRequired`);if(!e.execution.providerID.trim()||!e.execution.modelID.trim())return t(`sessions.scheduledTasks.editor.validation.modelRequired`);if(e.schedule.kind===`once`){if(!/^\d{4}-\d{2}-\d{2}$/.test(e.schedule.onceDate))return t(`sessions.scheduledTasks.editor.validation.dateFormat`);if(!/^([01]\d|2[0-3]):([0-5]\d)$/.test(e.schedule.onceTime))return t(`sessions.scheduledTasks.editor.validation.timeFormat`)}else if(e.schedule.kind===`cron`){if(!e.schedule.cronExpression.trim())return t(`sessions.scheduledTasks.editor.validation.cronRequired`);if(!K(e.schedule.cronExpression).valid)return t(`sessions.scheduledTasks.editor.validation.cronInvalid`)}else if(e.schedule.times.filter(e=>/^([01]\d|2[0-3]):([0-5]\d)$/.test(e)).length===0)return t(`sessions.scheduledTasks.editor.validation.atLeastOneTime`);return e.schedule.kind===`weekly`&&e.schedule.weekdays.length===0?t(`sessions.scheduledTasks.editor.validation.atLeastOneWeekday`):e.schedule.timezone.trim()?null:t(`sessions.scheduledTasks.editor.validation.timezoneRequired`)},ut=e=>{let t=e.filter(e=>/^([01]\d|2[0-3]):([0-5]\d)$/.test(e));return Array.from(new Set(t)).sort((e,t)=>e.localeCompare(t))},dt=e=>{let t=(0,Ne.c)(74),{draft:n,setDraft:r,locale:i,t:a,panel:o,mobilePanel:s}=e,c=o!==void 0&&o,l=s!==void 0&&s,u=c||l,d=l?Y:He,f=n.schedule.cronExpression,p;t[0]===f?p=t[1]:(p=f.trim()?K(f):null,t[0]=f,t[1]=p);let m=p,ee;bb0:{if(!m?.valid||!f.trim()){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[2]=e):e=t[2],ee=e;break bb0}let e;t[3]!==f||t[4]!==n.schedule.timezone?(e=Le(f,n.schedule.timezone),t[3]=f,t[4]=n.schedule.timezone,t[5]=e):e=t[5],ee=e}let te=ee,h;t[6]!==n.schedule.timezone||t[7]!==i?(h=e=>new Intl.DateTimeFormat(i,{timeZone:n.schedule.timezone,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}).format(e),t[6]=n.schedule.timezone,t[7]=i,t[8]=h):h=t[8];let g=h,y=u&&`gap-0`,b;t[9]===y?b=t[10]:(b=v(`flex flex-col gap-3`,y),t[9]=y,t[10]=b);let x=u&&d,S;t[11]===x?S=t[12]:(S=v(`flex flex-col gap-1`,x),t[11]=x,t[12]=S);let C;t[13]===a?C=t[14]:(C=a(`sessions.scheduledTasks.editor.cronExpression.label`),t[13]=a,t[14]=C);let ne;t[15]===C?ne=t[16]:(ne=(0,q.jsx)(nt,{htmlFor:`sched-cron`,required:!0,children:C}),t[15]=C,t[16]=ne);let w=u?``:void 0,re=u&&`yuri-settings-split-row-control flex-wrap`,T;t[17]===re?T=t[18]:(T=v(`min-w-0`,re),t[17]=re,t[18]=T);let E;t[19]===r?E=t[20]:(E=e=>r(t=>({...t,schedule:{...t.schedule,cronExpression:e.target.value}})),t[19]=r,t[20]=E);let D;t[21]===a?D=t[22]:(D=a(`sessions.scheduledTasks.editor.cronExpression.placeholder`),t[21]=a,t[22]=D);let ie=u&&`min-w-[140px] text-right`,ae;t[23]===ie?ae=t[24]:(ae=v(`w-full font-mono`,ie),t[23]=ie,t[24]=ae);let oe;t[25]!==f||t[26]!==E||t[27]!==D||t[28]!==ae?(oe=(0,q.jsx)(pe,{id:`sched-cron`,value:f,onChange:E,placeholder:D,className:ae}),t[25]=f,t[26]=E,t[27]=D,t[28]=ae,t[29]=oe):oe=t[29];let O;t[30]!==f||t[31]!==m||t[32]!==a?(O=m&&!m.valid&&f.trim()?(0,q.jsx)(`span`,{className:`w-full typography-micro text-right text-destructive`,children:a(`sessions.scheduledTasks.editor.validation.cronInvalid`)}):null,t[30]=f,t[31]=m,t[32]=a,t[33]=O):O=t[33];let k;t[34]!==w||t[35]!==T||t[36]!==oe||t[37]!==O?(k=(0,q.jsxs)(`div`,{"data-settings-value":w,className:T,children:[oe,O]}),t[34]=w,t[35]=T,t[36]=oe,t[37]=O,t[38]=k):k=t[38];let se;t[39]!==ne||t[40]!==k||t[41]!==S?(se=(0,q.jsxs)(`div`,{className:S,children:[ne,k]}),t[39]=ne,t[40]=k,t[41]=S,t[42]=se):se=t[42];let A;t[43]!==g||t[44]!==u||t[45]!==te||t[46]!==d||t[47]!==a?(A=te.length>0?(0,q.jsxs)(`div`,{className:v(`flex flex-col gap-1`,u&&[d,`yuri-scheduled-task-detail-row`]),children:[(0,q.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:a(`sessions.scheduledTasks.editor.cronExpression.nextRuns`)}),(0,q.jsx)(`span`,{"data-settings-value":u?``:void 0,className:`flex min-w-0 flex-wrap gap-x-4 gap-y-1 typography-micro text-muted-foreground`,children:te.map(e=>(0,q.jsx)(`span`,{className:`whitespace-nowrap tabular-nums`,children:g(e)},e.toISOString()))})]}):null,t[43]=g,t[44]=u,t[45]=te,t[46]=d,t[47]=a,t[48]=A):A=t[48];let ce;t[49]!==u||t[50]!==d?(ce=u&&[d,`yuri-scheduled-task-detail-row`],t[49]=u,t[50]=d,t[51]=ce):ce=t[51];let j;t[52]===ce?j=t[53]:(j=v(`flex flex-col gap-1`,ce),t[52]=ce,t[53]=j);let M;t[54]===a?M=t[55]:(M=a(`sessions.scheduledTasks.editor.cronExpression.examples`),t[54]=a,t[55]=M);let le;t[56]===M?le=t[57]:(le=(0,q.jsx)(`span`,{className:`typography-meta text-muted-foreground`,children:M}),t[56]=M,t[57]=le);let ue=u?``:void 0,de;t[58]!==f||t[59]!==r||t[60]!==a?(de=Re.map(e=>(0,q.jsx)(_,{type:`button`,variant:`chip`,size:`xs`,"aria-pressed":f.trim()===e.expression,title:e.expression,onClick:()=>r(t=>({...t,schedule:{...t.schedule,cronExpression:e.expression}})),children:a(e.labelKey)},e.expression)),t[58]=f,t[59]=r,t[60]=a,t[61]=de):de=t[61];let fe;t[62]!==ue||t[63]!==de?(fe=(0,q.jsx)(`div`,{"data-settings-value":ue,className:`flex min-w-0 flex-wrap gap-1.5`,children:de}),t[62]=ue,t[63]=de,t[64]=fe):fe=t[64];let N;t[65]!==j||t[66]!==le||t[67]!==fe?(N=(0,q.jsxs)(`div`,{className:j,children:[le,fe]}),t[65]=j,t[66]=le,t[67]=fe,t[68]=N):N=t[68];let P;return t[69]!==se||t[70]!==A||t[71]!==N||t[72]!==b?(P=(0,q.jsxs)(`div`,{className:b,children:[se,A,N]}),t[69]=se,t[70]=A,t[71]=N,t[72]=b,t[73]=P):P=t[73],P};function ft(e){let{open:t,task:n,onOpenChange:r,onSave:i,presentation:a=`dialog`,onDirtyChange:o,onRun:s,onOpenTaskHistory:c,onDelete:l,onToggleEnabled:u,actionBusy:d=!1,projectID:f=``,projectOptions:p=[],onProjectChange:ee}=e,te=a===`panel`,h=a===`mobile-panel`,b=a===`mobile-tab`,C=h||b,re=h||b,T=te||C,E=C?J:Ve,D=C?Y:He,{t:j,locale:M}=ne(),le=g(e=>e.loadProviders),ue=g(e=>e.loadAgents),fe=g(e=>e.providers),N=g(e=>e.currentProviderId),P=g(e=>e.currentModelId),me=g(e=>e.currentVariant||``),he=g(e=>e.currentAgentName||``),F=m(e=>e.timeFormatPreference),ge=m(e=>e.weekStartPreference),I=m(e=>e.isMobile),[V,U]=G.useState(()=>ct(n,{providerID:N,modelID:P,variant:me,agent:he})),[Ce,we]=G.useState(!1),[Te,Ee]=G.useState(!1),[De,ke]=G.useState(!1),[Ae,Me]=G.useState(``),[Ne,Pe]=G.useState(!1),[Ie,K]=G.useState(``),[Le,Re]=G.useState(()=>{let e=X(n?.schedule?.date||``)||new Date;return new Date(e.getFullYear(),e.getMonth(),1)}),Ue=G.useRef(null),Q=G.useRef(null),qe=G.useRef(null),$=G.useRef(null),Je=G.useRef(``),Ye=G.useRef(void 0),Xe=G.useRef(n);Xe.current=n;let Ze=n?.id||null,st=G.useMemo(()=>$e(M),[M]),ft=G.useMemo(()=>Qe(M),[M]),pt=G.useMemo(()=>F===`24h`||F!==`12h`&&st,[F,st]),mt=G.useMemo(()=>ge===`sunday`?0:ge===`monday`?1:ft,[ge,ft]),ht=G.useMemo(()=>{let e=et(M);return tt(ze.map(t=>({value:t,label:e[t]||``})),mt)},[M,mt]);G.useEffect(()=>{t&&(le({source:`scheduledTaskEditor`}),ue({source:`scheduledTaskEditor`}))},[t,le,ue]),G.useEffect(()=>{if(!t){Ye.current=void 0;return}if(Ye.current===Ze)return;Ye.current=Ze;let e=Xe.current,n=ct(e,{providerID:N,modelID:P,variant:me,agent:he});Je.current=JSON.stringify(n),U(n),o?.(!1);let r=X(e?.schedule?.date||``)||new Date;Re(new Date(r.getFullYear(),r.getMonth(),1)),Ee(!1),Pe(!1),ke(!1),K(``),Me(``)},[t,Ze,N,P,me,he,o]),G.useEffect(()=>{if(!(!t||!n||V.id!==n.id||V.enabled===n.enabled)&&(U(e=>({...e,enabled:n.enabled})),Je.current)){let e=JSON.parse(Je.current);Je.current=JSON.stringify({...e,enabled:n.enabled})}},[V.enabled,V.id,t,n]),G.useEffect(()=>{!t||!Je.current||o?.(JSON.stringify(V)!==Je.current)},[V,o,t]),G.useEffect(()=>{if(!Te)return;let e=e=>{Ue.current&&!Ue.current.contains(e.target)&&Ee(!1)};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[Te]);let gt=G.useMemo(()=>fe.find(e=>e.id===V.execution.providerID)?.models?.find(e=>e.id===V.execution.modelID),[V.execution.modelID,V.execution.providerID,fe]),_t=G.useMemo(()=>gt?.variants?Object.keys(gt.variants):[],[gt]);G.useEffect(()=>{!gt||!V.execution.variant||_t.includes(V.execution.variant)||U(e=>({...e,execution:{...e.execution,variant:``}}))},[_t,V.execution.variant,gt]);let vt=G.useCallback((e,t)=>{U(n=>{let r=new Set(n.schedule.weekdays);return t?r.add(e):r.delete(e),{...n,schedule:{...n.schedule,weekdays:Array.from(r).sort((e,t)=>e-t)}}})},[]),yt=G.useCallback((e,t)=>{U(n=>{let r=n.schedule.times.slice();return r[e]=t,{...n,schedule:{...n.schedule,times:r}}})},[]),bt=G.useCallback(e=>{U(t=>{let n=t.schedule.times.filter((t,n)=>n!==e);return{...t,schedule:{...t.schedule,times:n.length>0?n:[`09:00`]}}})},[]),xt=G.useCallback(()=>{U(e=>({...e,schedule:{...e.schedule,times:[...e.schedule.times,`12:00`]}}))},[]),St=G.useMemo(()=>at(),[]),Ct=G.useMemo(()=>it(St),[St]),wt=G.useMemo(()=>{let e=X(V.schedule.onceDate);return e?ot(e,St)?j(`sessions.scheduledTasks.editor.date.today`):new Intl.DateTimeFormat(M,{weekday:`short`}).format(e):null},[V.schedule.onceDate,M,j,St]),Tt=G.useMemo(()=>it(Le).getTime()<=Ct.getTime(),[Le,Ct]),Et=G.useMemo(()=>ht.map(e=>e.label),[ht]),Dt=G.useCallback(e=>{U(t=>({...t,schedule:{...t.schedule,onceDate:e}}))},[]),Ot=G.useCallback((e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
|
|
2
|
-
`),i=Math.min(n===-1?e.length:n,r===-1?e.length:r);if(t<=i&&n===-1){K(e.substring(1,i)),Pe(!0),ke(!1);return}}Pe(!1);let n=e.substring(0,t),r=n.lastIndexOf(`@`);if(r!==-1){let e=r>0?n[r-1]:null,t=n.substring(r+1);(!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
|
|
3
|
-
`)?(Me(t),ke(!0)):ke(!1);return}ke(!1)},[]),kt=G.useCallback(e=>{U(t=>({...t,execution:{...t.execution,prompt:e}}))},[]),At=G.useCallback(e=>{let t=V.execution.prompt,n=Q.current?.selectionStart??t.length,r=t.substring(0,n).lastIndexOf(`@`),i=e.relativePath&&e.relativePath.trim().length>0?e.relativePath.trim():e.path||e.name,a=_e(t,r===-1?n:r,n,`@${i}`);kt(a.text),ke(!1),Me(``),requestAnimationFrame(()=>{let e=Q.current;e&&(e.selectionStart=a.caret,e.selectionEnd=a.caret,e.focus()),Ot(a.text,a.caret)})},[V.execution.prompt,kt,Ot]),jt=G.useCallback(e=>{let t=V.execution.prompt,n=Q.current?.selectionStart??t.length,r=t.substring(0,n).lastIndexOf(`@`),i=_e(t,r===-1?n:r,n,`@${e}`);kt(i.text),ke(!1),Me(``),requestAnimationFrame(()=>{let e=Q.current;e&&(e.selectionStart=i.caret,e.selectionEnd=i.caret,e.focus()),Ot(i.text,i.caret)})},[V.execution.prompt,kt,Ot]),Mt=G.useCallback(e=>{let t=`/${e.name} `;kt(t),Pe(!1),K(``),requestAnimationFrame(()=>{let e=Q.current;e&&(e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length),Ot(t,t.length)})},[kt,Ot]),Nt=G.useCallback(e=>{if(Ne&&$.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)){e.preventDefault(),$.current.handleKeyDown(e.key);return}De&&qe.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),qe.current.handleKeyDown(e.key))},[Ne,De]),Pt=G.useCallback(async()=>{let e=lt(V,j);if(e){x.error(e);return}let t={...V.id?{id:V.id}:{},name:V.name.trim(),enabled:V.enabled,schedule:{kind:V.schedule.kind,timezone:V.schedule.timezone.trim(),...V.schedule.kind===`cron`?{cron:V.schedule.cronExpression.trim()}:V.schedule.kind===`once`?{date:V.schedule.onceDate,time:V.schedule.onceTime}:{times:ut(V.schedule.times),...V.schedule.kind===`weekly`?{weekdays:V.schedule.weekdays}:{}}},execution:{prompt:V.execution.prompt,providerID:V.execution.providerID,modelID:V.execution.modelID,...V.execution.variant.trim()?{variant:V.execution.variant.trim()}:{},...V.execution.agent.trim()?{agent:V.execution.agent.trim()}:{},...V.execution.goalEnabled?{goalEnabled:!0}:{}},...V.state?{state:V.state}:{}};we(!0);try{let e=await i(t);if(a===`panel`){let t=ct(e||n,{providerID:N,modelID:P,variant:me,agent:he});Je.current=JSON.stringify(t),U(t),o?.(!1)}else r(!1)}catch(e){x.error(e instanceof Error?e.message:j(`sessions.scheduledTasks.editor.toast.saveFailed`))}finally{we(!1)}},[he,P,N,me,V,o,r,i,a,j,n]),Ft=G.useId(),It=G.useCallback(()=>typeof document>`u`?!1:!!document.querySelector(`[data-slot="dropdown-menu-content"], [data-slot="select-content"]`),[]),Lt=j(n?`sessions.scheduledTasks.editor.title.edit`:`sessions.scheduledTasks.editor.title.new`),Rt=j(`sessions.scheduledTasks.editor.description`),zt=(0,q.jsxs)(`div`,{className:v(`yuri-settings-workspace yuri-settings-page-content yuri-scheduled-task-form`,I?`yuri-settings-workspace-mobile`:`yuri-settings-workspace-desktop`),children:[(0,q.jsxs)(`div`,{className:v(`flex flex-col gap-1`,(te||b)&&`hidden`),children:[(0,q.jsx)(nt,{htmlFor:`sched-name`,required:!0,children:j(`sessions.scheduledTasks.editor.taskName.label`)}),(0,q.jsx)(pe,{id:`sched-name`,value:V.name,onChange:e=>U(t=>({...t,name:e.target.value})),placeholder:j(`sessions.scheduledTasks.editor.taskName.placeholder`),maxLength:80,required:!0,"aria-invalid":!V.name.trim(),className:`yuri-scheduled-task-title w-full`})]}),(0,q.jsxs)(`div`,{className:v(`flex flex-col gap-3 border-t border-border/40 pt-5`,T&&`yuri-settings-group order-4 animate-in fade-in slide-in-from-right-1 border-0 pt-0 duration-200 [animation-delay:80ms] [animation-fill-mode:both] motion-reduce:animate-none`),children:[T?(0,q.jsx)(`h3`,{className:Fe,children:j(`sessions.scheduledTasks.editor.panel.frequency`)}):null,(0,q.jsxs)(`div`,{className:v(T&&`yuri-settings-group-card`,T&&V.schedule.kind===`once`&&Te&&`overflow-visible`),children:[(0,q.jsx)(`div`,{className:v(`grid grid-cols-1 gap-x-4 gap-y-3`,T&&`flex flex-col gap-0`,!I&&!T&&`sm:grid-cols-2`),children:(0,q.jsxs)(`div`,{className:v(`flex min-w-0 flex-col gap-1`,T&&[D,`last:border-b`]),children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.editor.scheduleType.label`)}),(0,q.jsx)(`div`,{"data-settings-value":T?``:void 0,className:v(T&&`yuri-settings-split-row-control`),children:(0,q.jsxs)(Se,{value:V.schedule.kind,onValueChange:e=>{U(t=>({...t,schedule:{...t.schedule,kind:e,...e===`cron`&&!t.schedule.cronExpression?{cronExpression:`0 * * * *`}:{}}}))},children:[(0,q.jsx)(xe,{className:v(!T&&Be,T&&E),children:(0,q.jsx)(H,{children:e=>j(e===`daily`?`sessions.scheduledTasks.editor.scheduleType.daily`:e===`weekly`?`sessions.scheduledTasks.editor.scheduleType.weekly`:e===`cron`?`sessions.scheduledTasks.editor.scheduleType.cron`:`sessions.scheduledTasks.editor.scheduleType.once`)})}),(0,q.jsxs)(be,{className:`motion-reduce:transition-none`,children:[(0,q.jsx)(ye,{value:`daily`,children:j(`sessions.scheduledTasks.editor.scheduleType.daily`)}),(0,q.jsx)(ye,{value:`weekly`,children:j(`sessions.scheduledTasks.editor.scheduleType.weekly`)}),(0,q.jsx)(ye,{value:`once`,children:j(`sessions.scheduledTasks.editor.scheduleType.once`)}),(0,q.jsx)(ye,{value:`cron`,children:j(`sessions.scheduledTasks.editor.scheduleType.cron`)})]})]})})]})}),V.schedule.kind===`cron`?(0,q.jsx)(dt,{draft:V,setDraft:U,locale:M,t:j,panel:te,mobilePanel:C}):V.schedule.kind===`once`?(0,q.jsxs)(`div`,{className:v(`grid grid-cols-1 gap-x-4 gap-y-3`,T&&`flex flex-col gap-0`,!I&&!T&&`sm:grid-cols-2`),children:[(0,q.jsxs)(`div`,{className:v(`flex min-w-0 flex-col gap-1`,T&&D),ref:Ue,children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.editor.date.label`)}),(0,q.jsxs)(`div`,{"data-settings-value":T?``:void 0,className:v(`relative`,T&&`yuri-settings-split-row-control`),children:[(0,q.jsxs)(`button`,{type:`button`,className:v(!T&&Be,`flex items-center justify-between gap-2 text-left`,T&&[E,`w-full`]),onClick:()=>Ee(e=>!e),children:[(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(S,{name:`calendar`,className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`truncate typography-ui-label text-foreground`,children:Ge(V.schedule.onceDate,j(`sessions.scheduledTasks.editor.date.placeholder`),M)})]}),(0,q.jsx)(S,{name:`arrow-down-s`,className:`h-4 w-4 shrink-0 text-muted-foreground`})]}),Te?(0,q.jsxs)(`div`,{className:v(`absolute top-[calc(100%+6px)] z-50 w-[min(288px,calc(100vw-2rem))] animate-in fade-in zoom-in-95 slide-in-from-top-1 rounded-xl border border-border bg-background p-3 shadow-sm duration-150 motion-reduce:animate-none`,C?`right-0`:`left-0`),children:[(0,q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,q.jsx)(`button`,{type:`button`,className:`inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-interactive-hover disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>Re(e=>Z(e,-1)),"aria-label":j(`sessions.scheduledTasks.editor.date.previousMonth`),disabled:Tt,children:(0,q.jsx)(S,{name:`arrow-left-s`,className:`h-4 w-4`})}),(0,q.jsx)(`div`,{className:`typography-ui-label text-foreground`,children:new Intl.DateTimeFormat(M,{month:`long`,year:`numeric`}).format(Le)}),(0,q.jsx)(`button`,{type:`button`,className:`inline-flex h-8 w-8 items-center justify-center rounded-md hover:bg-interactive-hover`,onClick:()=>Re(e=>Z(e,1)),"aria-label":j(`sessions.scheduledTasks.editor.date.nextMonth`),children:(0,q.jsx)(S,{name:`arrow-right-s`,className:`h-4 w-4`})})]}),(0,q.jsx)(`div`,{className:`mb-1 grid grid-cols-7 gap-1 px-1`,children:Et.map((e,t)=>(0,q.jsx)(`div`,{className:`py-1 text-center typography-micro text-muted-foreground`,children:e},`${e}-${t}`))}),(0,q.jsx)(`div`,{className:`grid grid-cols-7 gap-1`,children:Ke(Le,mt).map(({date:e,inCurrentMonth:t})=>{let n=We(e),r=n===V.schedule.onceDate,i=ot(e,St),a=e.getTime()<St.getTime();return(0,q.jsx)(`button`,{type:`button`,onClick:()=>{a||(Dt(n),Ee(!1))},disabled:a,className:[`h-8 rounded-md typography-ui-label`,r?`bg-interactive-selection text-interactive-selection-foreground`:a?`text-muted-foreground/40`:t?`text-foreground hover:bg-interactive-hover`:`text-muted-foreground/60 hover:bg-interactive-hover`,i&&!r?`ring-1 ring-inset ring-interactive-focusRing bg-interactive-hover/50`:``,a?`cursor-not-allowed opacity-45`:``].join(` `),children:e.getDate()},n)})}),(0,q.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-border pt-2`,children:[(0,q.jsx)(`div`,{className:`typography-micro text-muted-foreground`,children:wt||``}),(0,q.jsx)(_,{type:`button`,size:`xs`,variant:`ghost`,onClick:()=>{Dt(We(St)),Re(new Date(St.getFullYear(),St.getMonth(),1))},children:j(`sessions.scheduledTasks.editor.date.jumpToToday`)})]})]}):null]})]}),(0,q.jsxs)(`div`,{className:v(`flex min-w-0 flex-col gap-1`,T&&D),children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.editor.time.label`)}),(0,q.jsx)(`div`,{"data-settings-value":T?``:void 0,className:v(T&&`yuri-settings-split-row-control`),children:(0,q.jsx)(rt,{value:V.schedule.onceTime,className:v(T&&`yuri-settings-inline-value w-fit min-w-0 justify-end`),use24Hour:pt,hourAriaLabel:j(`sessions.scheduledTasks.editor.time.hourAria`),minuteAriaLabel:j(`sessions.scheduledTasks.editor.time.minuteAria`),periodAriaLabel:j(`sessions.scheduledTasks.editor.time.periodAria`),amLabel:j(`sessions.scheduledTasks.editor.time.period.am`),pmLabel:j(`sessions.scheduledTasks.editor.time.period.pm`),onChange:e=>U(t=>({...t,schedule:{...t.schedule,onceTime:e}}))})})]})]}):(0,q.jsxs)(`div`,{className:v(`grid grid-cols-1 gap-x-4 gap-y-3`,T&&`flex flex-col gap-0`,!I&&!T&&`sm:grid-cols-2`),children:[V.schedule.kind===`weekly`?(0,q.jsxs)(`div`,{className:v(`flex flex-col gap-1`,T&&[`yuri-settings-group-row border-b border-[var(--yuri-settings-row-divider)] last:border-b-0`,`yuri-settings-split-row`],!I&&!T&&`sm:col-span-2`),children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.editor.weekdays.label`)}),(0,q.jsx)(`div`,{"data-settings-value":T?``:void 0,className:v(`flex flex-wrap gap-x-3 gap-y-2`,T&&`yuri-settings-split-row-control justify-end`),children:ht.map(e=>{let t=V.schedule.weekdays.includes(e.value);return(0,q.jsxs)(`div`,{className:[`group inline-flex items-center gap-1.5 px-0.5 py-0.5 typography-meta`,t?`text-foreground`:`text-muted-foreground`].join(` `),children:[(0,q.jsx)(R,{checked:t,onChange:t=>vt(e.value,t),ariaLabel:e.label}),(0,q.jsx)(`button`,{type:`button`,onClick:()=>vt(e.value,!t),className:`group-hover:text-foreground`,children:e.label})]},e.value)})})]}):null,(0,q.jsxs)(`div`,{className:v(`flex min-w-0 flex-col gap-2`,T&&[D,`justify-start`],C&&`flex-col items-stretch`),children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.editor.times.label`)}),(0,q.jsxs)(`div`,{"data-settings-value":T?``:void 0,className:v(T?`yuri-settings-split-row-control relative flex-wrap justify-end`:`contents`),children:[(0,q.jsx)(`div`,{className:v(`flex flex-col gap-2`,T&&`flex-row flex-wrap justify-end transition-[padding] motion-reduce:transition-none`,te&&`group-hover:pr-8`),children:V.schedule.times.map((e,t)=>(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(rt,{value:e,className:v(T&&`yuri-settings-inline-value w-fit min-w-0`),use24Hour:pt,hourAriaLabel:j(`sessions.scheduledTasks.editor.time.hourAria`),minuteAriaLabel:j(`sessions.scheduledTasks.editor.time.minuteAria`),periodAriaLabel:j(`sessions.scheduledTasks.editor.time.periodAria`),amLabel:j(`sessions.scheduledTasks.editor.time.period.am`),pmLabel:j(`sessions.scheduledTasks.editor.time.period.pm`),onChange:e=>yt(t,e)}),V.schedule.times.length>1?(0,q.jsx)(_,{type:`button`,size:`icon`,variant:`ghost`,onClick:()=>bt(t),"aria-label":j(`sessions.scheduledTasks.editor.times.removeAria`),children:(0,q.jsx)(S,{name:`close`,className:`h-4 w-4`})}):null]},t))}),(0,q.jsx)(`div`,{className:v(T&&`shrink-0`,te&&`absolute right-0`),children:(0,q.jsxs)(_,{type:`button`,size:T?`icon`:`sm`,variant:T?`ghost`:`outline`,className:v(`h-9`,te&&`size-7 opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100 motion-reduce:transition-none`,C&&`size-9`),onClick:xt,"aria-label":j(`sessions.scheduledTasks.editor.times.add`),children:[(0,q.jsx)(S,{name:`add`,className:v(`h-4 w-4`,!T&&`mr-1`)}),T?null:j(`sessions.scheduledTasks.editor.times.add`)]})})]})]})]})]})]}),(0,q.jsxs)(`div`,{className:v(`flex flex-col gap-3 border-t border-border/40 pt-5`,T&&`contents`),children:[(0,q.jsxs)(`div`,{className:v(T?`yuri-settings-group order-2`:`contents`),children:[T?(0,q.jsx)(`h3`,{className:Fe,children:j(`sessions.scheduledTasks.editor.panel.details`)}):null,(0,q.jsxs)(`div`,{className:v(`grid grid-cols-1 gap-x-4 gap-y-3`,T&&[`flex flex-col gap-0 animate-in fade-in slide-in-from-right-1 duration-200 [animation-delay:40ms] [animation-fill-mode:both] motion-reduce:animate-none`,`yuri-settings-group-card`],!I&&!T&&`sm:grid-cols-2`),children:[p.length>0?(0,q.jsxs)(`div`,{className:v(`flex min-w-0 flex-col gap-1`,T&&D),children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.dialog.project.label`)}),(0,q.jsx)(`div`,{"data-settings-value":T?``:void 0,className:v(T&&`yuri-settings-split-row-control`),children:(0,q.jsxs)(Se,{value:f,disabled:!ee,onValueChange:ee,children:[(0,q.jsx)(xe,{className:v(!T&&Be,T&&E),children:(0,q.jsx)(H,{children:e=>p.find(t=>t.id===e)?.label})}),(0,q.jsx)(be,{className:`motion-reduce:transition-none`,children:p.map(e=>(0,q.jsx)(ye,{value:e.id,children:e.label},e.id))})]})})]}):null,(0,q.jsxs)(`div`,{className:v(`flex min-w-0 flex-col gap-1`,T&&D),children:[(0,q.jsx)(nt,{required:!0,children:j(`sessions.scheduledTasks.editor.model.label`)}),(0,q.jsx)(`div`,{"data-settings-value":T?``:void 0,className:v(T&&`yuri-settings-split-row-control`),children:(0,q.jsx)(W,{providerId:V.execution.providerID,modelId:V.execution.modelID,variant:V.execution.variant,className:v(!T&&Be,T&&E,`[&>div]:min-w-0 [&>div]:flex-1 [&_span]:truncate`),showIcon:!te,onChange:(e,t,n=``)=>{U(r=>({...r,execution:{...r.execution,providerID:e,modelID:t,variant:n}}))}})})]}),T?(0,q.jsxs)(`div`,{className:D,children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.editor.agent.label`)}),(0,q.jsx)(`div`,{"data-settings-value":``,className:`yuri-settings-split-row-control`,children:(0,q.jsx)(je,{agentName:V.execution.agent,className:v(E,`[&>div]:min-w-0 [&>div]:flex-1 [&_span]:truncate`),showIcon:!0,filter:e=>y(e.mode),onChange:e=>U(t=>({...t,execution:{...t.execution,agent:e}}))})})]}):null,T?(0,q.jsxs)(`label`,{className:v(D,`cursor-pointer`),children:[(0,q.jsx)(`span`,{className:`typography-ui-label text-foreground`,children:j(`sessions.scheduledTasks.editor.goal.label`)}),(0,q.jsx)(`span`,{"data-settings-value":``,className:`yuri-settings-split-row-control`,children:(0,q.jsx)(R,{checked:V.execution.goalEnabled,onChange:e=>U(t=>({...t,execution:{...t.execution,goalEnabled:e}})),ariaLabel:j(`sessions.scheduledTasks.editor.goal.aria`)})})]}):null]})]}),T?null:(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,q.jsx)(nt,{children:j(`sessions.scheduledTasks.editor.agent.label`)}),(0,q.jsx)(je,{agentName:V.execution.agent,className:v(Be,`[&>div]:min-w-0 [&>div]:flex-1 [&_span]:truncate`),filter:e=>y(e.mode),onChange:e=>U(t=>({...t,execution:{...t.execution,agent:e}}))})]}),(0,q.jsxs)(`div`,{className:v(`flex flex-col gap-1`,T&&`order-1`),children:[(0,q.jsx)(`div`,{className:v(T&&`sr-only`),children:(0,q.jsx)(nt,{htmlFor:`sched-prompt`,required:!0,children:j(`sessions.scheduledTasks.editor.prompt.label`)})}),(0,q.jsxs)(`div`,{className:`relative`,children:[(0,q.jsx)(de,{id:`sched-prompt`,ref:Q,value:V.execution.prompt,onChange:e=>{let t=e.target.value;kt(t);let n=e.target.selectionStart??t.length;Ot(t,n)},onKeyDown:Nt,rows:8,outerClassName:`h-64 min-h-32`,placeholder:j(`sessions.scheduledTasks.editor.prompt.placeholder`),className:v(`typography-meta min-h-0 overflow-y-auto`,T&&`px-4 pt-4 text-base placeholder:text-muted-foreground/65`)}),Ne?(0,q.jsx)(z,{ref:$,searchQuery:Ie,onCommandSelect:Mt,onClose:()=>Pe(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,De?(0,q.jsx)(B,{ref:qe,searchQuery:Ae,onFileSelect:At,onAgentSelect:jt,onSkillSelect:e=>jt(e.name),onClose:()=>ke(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null]})]}),T?null:(0,q.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-8 gap-y-2`,children:(0,q.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-2`,children:[(0,q.jsx)(R,{checked:V.execution.goalEnabled,onChange:e=>U(t=>({...t,execution:{...t.execution,goalEnabled:e}})),ariaLabel:j(`sessions.scheduledTasks.editor.goal.aria`)}),(0,q.jsx)(`span`,{className:`typography-meta`,children:j(`sessions.scheduledTasks.editor.goal.label`)})]})})]})]}),Bt=(0,q.jsxs)(`div`,{className:v(`flex flex-wrap items-center justify-between gap-3`,a===`panel`&&`justify-end`,re&&`flex-nowrap gap-2`),children:[(0,q.jsxs)(`label`,{className:v(`inline-flex items-center gap-2`,a===`panel`&&`hidden`),children:[(0,q.jsx)(R,{checked:V.enabled,onChange:e=>U(t=>({...t,enabled:e})),ariaLabel:j(`sessions.scheduledTasks.editor.enabled.aria`)}),(0,q.jsx)(`span`,{className:`typography-meta`,children:j(`sessions.scheduledTasks.editor.enabled.label`)})]}),(0,q.jsxs)(`div`,{className:v(`flex flex-wrap items-center justify-end gap-2`,re&&`ml-auto flex-nowrap`),children:[a!==`panel`&&!re?(0,q.jsx)(_,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>r(!1),disabled:Ce,children:j(`sessions.scheduledTasks.editor.actions.cancel`)}):null,(0,q.jsx)(_,{type:`button`,size:`sm`,className:v(a===`panel`&&`rounded-lg`,re&&`min-h-11 px-5`),onClick:Pt,disabled:Ce,children:j(Ce?`sessions.scheduledTasks.editor.actions.saving`:n?`sessions.scheduledTasks.editor.actions.save`:`sessions.scheduledTasks.dialog.actions.create`)})]})]}),Vt=!!(n&&c),Ht=n&&l&&s?(0,q.jsxs)(ce,{children:[(0,q.jsx)(k,{asChild:!0,children:(0,q.jsx)(_,{type:`button`,variant:b?`mobileGlass`:`ghost`,size:b?`mobileIcon`:`icon`,className:v(!b&&`rounded-lg`,!b&&(I?`size-11`:`size-8`)),disabled:Ce||d,"aria-label":j(`sessions.scheduledTasks.dialog.actions.moreAria`,{taskName:n.name}),children:(0,q.jsx)(S,{name:`more-2`,className:b?`size-5`:`size-4`})})}),(0,q.jsxs)(se,{align:`end`,className:`min-w-40 motion-reduce:transition-none`,children:[(0,q.jsxs)(A,{className:v(b&&`min-h-11`),onSelect:()=>void s(n),children:[(0,q.jsx)(S,{name:`play`,className:`size-4`}),j(`sessions.scheduledTasks.dialog.actions.runNow`)]}),Vt?(0,q.jsxs)(A,{className:v(b&&`min-h-11`),onSelect:()=>c?.(n),children:[(0,q.jsx)(S,{name:`history`,className:`size-4`}),j(`sessions.scheduledTasks.workspace.views.history`)]}):null,u?(0,q.jsxs)(A,{className:v(b&&`min-h-11`),onSelect:()=>void u(n,!n.enabled),children:[(0,q.jsx)(S,{name:n.enabled?`pause`:`play`,className:`size-4`}),n.enabled?j(`sessions.scheduledTasks.dialog.taskToggle.pauseAria`,{taskName:n.name}):j(`sessions.scheduledTasks.dialog.taskToggle.enableAria`,{taskName:n.name})]}):null,(0,q.jsxs)(A,{variant:`destructive`,className:v(b&&`min-h-11`),onSelect:()=>void l(n),children:[(0,q.jsx)(S,{name:`delete-bin`,className:`size-4`}),j(`sessions.scheduledTasks.dialog.actions.delete`)]})]})]}):null;return a===`panel`?t?(0,q.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-labelledby":`scheduled-task-panel-title`,children:[(0,q.jsxs)(`header`,{className:`shrink-0 animate-in fade-in slide-in-from-right-1 px-6 pb-4 pt-5 duration-200 motion-reduce:animate-none`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,q.jsx)(`span`,{className:v(`typography-meta font-medium`,n?.enabled?`text-[var(--status-info)]`:`text-muted-foreground`),children:n?n.enabled?j(`sessions.scheduledTasks.dialog.taskToggle.enabled`):j(`sessions.scheduledTasks.dialog.taskToggle.paused`):Lt}),(0,q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[Ht,n&&u?(0,q.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:v(`rounded-lg`,I?`size-11`:`size-8`),disabled:Ce||d,onClick:()=>void u(n,!n.enabled),"aria-label":n.enabled?j(`sessions.scheduledTasks.dialog.taskToggle.pauseAria`,{taskName:n.name}):j(`sessions.scheduledTasks.dialog.taskToggle.enableAria`,{taskName:n.name}),children:(0,q.jsx)(S,{name:n.enabled?`pause`:`play`,className:`size-4`})}):null,(0,q.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:v(`rounded-lg`,I?`size-11`:`size-8`),onClick:()=>r(!1),"aria-label":j(`sessions.scheduledTasks.editor.actions.cancel`),children:(0,q.jsx)(S,{name:I?`arrow-left`:`close`,className:`size-4`})})]})]}),(0,q.jsx)(`h2`,{id:`scheduled-task-panel-title`,className:`sr-only`,children:Lt}),(0,q.jsx)(pe,{value:V.name,onChange:e=>U(t=>({...t,name:e.target.value})),placeholder:j(`sessions.scheduledTasks.editor.taskName.placeholder`),"aria-label":j(`sessions.scheduledTasks.editor.taskName.label`),maxLength:80,required:!0,"aria-invalid":!V.name.trim(),className:`yuri-scheduled-task-title mt-1 !h-9 !min-h-9 border-0 bg-transparent px-0 text-lg font-semibold shadow-none ring-0 hover:!bg-transparent focus:!bg-transparent focus:ring-0`})]}),(0,q.jsx)(w,{className:`min-h-0 flex-1 overflow-auto [scrollbar-gutter:stable]`,size:64,hideTopShadow:!0,children:(0,q.jsx)(`div`,{className:`px-6 pb-6 pt-2`,children:zt})}),(0,q.jsx)(`footer`,{className:`shrink-0 border-t border-border/50 bg-background/95 px-6 py-3 backdrop-blur-sm`,children:Bt})]}):null:a===`mobile-panel`?t?(0,q.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col bg-background`,"aria-label":Lt,children:[(0,q.jsx)(w,{className:`min-h-0 flex-1 overflow-y-auto overflow-x-hidden`,size:48,hideTopShadow:!0,children:(0,q.jsx)(`div`,{className:`w-full px-3 pb-6 pt-4`,children:zt})}),(0,q.jsx)(`footer`,{className:`shrink-0 border-t border-border/50 bg-background/95 px-3 py-2 backdrop-blur-sm`,children:Bt})]}):null:a===`mobile-tab`?t?(0,q.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":Lt,children:[(0,q.jsx)(L,{sticky:!0,title:Lt,backAriaLabel:j(`header.actions.backAria`),onBack:()=>r(!1),backDisabled:Ce,trailing:[(0,q.jsx)(_,{type:`button`,size:`mobileIcon`,onClick:Pt,disabled:Ce,"aria-label":j(Ce?`sessions.scheduledTasks.editor.actions.saving`:n?`sessions.scheduledTasks.editor.actions.save`:`sessions.scheduledTasks.dialog.actions.create`),"aria-busy":Ce,children:(0,q.jsx)(S,{name:Ce?`loader-4`:`check`,className:v(`size-5`,Ce&&`animate-spin motion-reduce:animate-none`)})},`save`),Ht?(0,q.jsx)(G.Fragment,{children:Ht},`more`):null]}),(0,q.jsxs)(`div`,{className:`yuri-mobile-scheduled-editor-body min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-[var(--yuri-mobile-page-inline-inset)] pt-4`,children:[(0,q.jsxs)(`div`,{className:`mb-5 flex items-center gap-4`,children:[(0,q.jsx)(pe,{value:V.name,onChange:e=>U(t=>({...t,name:e.target.value})),placeholder:j(`sessions.scheduledTasks.editor.taskName.placeholder`),"aria-label":j(`sessions.scheduledTasks.editor.taskName.label`),maxLength:80,required:!0,"aria-invalid":!V.name.trim(),className:`yuri-scheduled-task-title yuri-mobile-detail-editor-title min-w-0 flex-1 !h-auto min-h-0 border-0 bg-transparent px-0 py-0 text-xl font-semibold shadow-none ring-0 hover:!bg-transparent focus:!bg-transparent focus:ring-0`}),(0,q.jsx)(Oe,{checked:V.enabled,onCheckedChange:e=>U(t=>({...t,enabled:e})),disabled:Ce,"aria-label":j(`sessions.scheduledTasks.editor.enabled.aria`)})]}),zt]})]}):null:I?(0,q.jsx)(ve,{open:t,title:Lt,onClose:()=>r(!1),contentMaxHeightClassName:`max-h-[min(80vh,640px)]`,renderHeader:e=>(0,q.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-border/40 px-3 py-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(`h2`,{className:`typography-ui-label font-semibold text-foreground`,children:Lt}),e]}),(0,q.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:Rt})]}),footer:Bt,children:zt}):(0,q.jsx)(O,{open:t,onOpenChange:e=>{!e&&It()||r(e)},children:(0,q.jsxs)(ie,{"aria-describedby":Ft,className:`!max-w-[720px] w-[90vw] h-[680px] max-h-[85vh] gap-0 p-0 overflow-hidden`,children:[(0,q.jsx)(oe,{id:Ft,className:`sr-only`,children:Rt}),(0,q.jsx)(`header`,{className:`shrink-0 px-4 sm:px-6 pt-5 pb-3`,children:(0,q.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl`,children:[(0,q.jsx)(ae,{className:`typography-ui-label font-medium text-foreground`,children:Lt}),(0,q.jsx)(`p`,{className:`typography-meta mt-0.5 text-muted-foreground`,children:Rt})]})}),(0,q.jsx)(w,{className:`flex-1 min-h-0 overflow-auto [scrollbar-gutter:stable_both-edges]`,size:64,hideTopShadow:!0,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 pb-5`,children:zt})}),(0,q.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,q.jsx)(`div`,{className:`mx-auto w-full max-w-2xl`,children:Bt})})]})})}function pt(e){return $(e,{min:0,max:23})}function mt(e,t){return $(String(Number.parseInt(e,10)+t),{min:0,max:23,loop:!0})}function ht(e,t){let n=Number(e),r=Number(t),i=Number.isFinite(n)?Math.min(23,Math.max(0,n)):0,a=Number.isFinite(r)?Math.min(59,Math.max(0,r)):0;return`${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`}var gt=e=>{if(!e.enabled)return null;let t=Ae(e.assistants).pinned[0]??e.assistants[0];return t?{id:t.id,name:t.name,seed:t.avatarSeed??t.id}:null};function _t(e){let t=(0,Ne.c)(20),{assistant:n}=e,{t:r}=ne(),[i,a]=G.useState(!0),o=i?`true`:`false`,s;t[0]!==n.name||t[1]!==r?(s=r(`sessions.scheduledTasks.assistant.openAria`,{name:n.name}),t[0]=n.name,t[1]=r,t[2]=s):s=t[2];let c;t[3]===n.id?c=t[4]:(c=()=>h.getState().openAssistant(n.id),t[3]=n.id,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=e=>{e.target===e.currentTarget&&e.animationName===`yuri-schedule-assistant-clip`&&a(!1)},t[5]=l):l=t[5];let u;t[6]!==n.id||t[7]!==n.seed||t[8]!==i?(u=(0,q.jsx)(`span`,{className:`yuri-mobile-schedule-assistant-face`,"aria-hidden":`true`,children:(0,q.jsx)(I,{seed:n.seed,size:40,motion:`idle`,animateIdle:i,followPointer:!1,animationKey:n.id,blinkOnMount:2})}),t[6]=n.id,t[7]=n.seed,t[8]=i,t[9]=u):u=t[9];let d;t[10]===r?d=t[11]:(d=r(`sessions.scheduledTasks.assistant.offer`),t[10]=r,t[11]=d);let f;t[12]===d?f=t[13]:(f=(0,q.jsx)(`span`,{className:`yuri-mobile-schedule-assistant-label`,"aria-hidden":`true`,children:d}),t[12]=d,t[13]=f);let p;return t[14]!==o||t[15]!==s||t[16]!==c||t[17]!==u||t[18]!==f?(p=(0,q.jsx)(`span`,{className:`yuri-mobile-schedule-assistant-anchor`,children:(0,q.jsxs)(_,{type:`button`,variant:`ghost`,size:`mobileIcon`,className:`yuri-mobile-schedule-assistant`,"data-visiting":o,"aria-label":s,onClick:c,onAnimationEnd:l,children:[u,f]})}),t[14]=o,t[15]=s,t[16]=c,t[17]=u,t[18]=f,t[19]=p):p=t[19],p}function vt(){let e=(0,Ne.c)(2),{data:t}=F(gt),n;return e[0]===t?n=e[1]:(n=t?(0,q.jsx)(_t,{assistant:t},t.id):null,e[0]=t,e[1]=n),n}var yt=G.memo(function(e){let t=(0,Ne.c)(3),{active:n}=e,r=h(bt),i;return t[0]!==n||t[1]!==r?(i=n&&r?(0,q.jsx)(vt,{}):null,t[0]=n,t[1]=r,t[2]=i):i=t[2],i});function bt(e){return e.activeTab===`scheduled`&&e.secondary===null}var xt=e({ScheduledTasksDialog:()=>Pt,ScheduledTasksWorkspace:()=>zt}),St=e=>{let t=(Array.isArray(e.schedule.times)?e.schedule.times:e.schedule.time?[e.schedule.time]:[]).filter(e=>typeof e==`string`&&/^([01]\d|2[0-3]):([0-5]\d)$/.test(e));return Array.from(new Set(t)).sort((e,t)=>e.localeCompare(t))},Ct=(e,t,n=!0)=>{let r=St(e).join(`, `)||`--:--`,i=e=>t(e===0?`sessions.scheduledTasks.dialog.schedule.weekdayShort.sun`:e===1?`sessions.scheduledTasks.dialog.schedule.weekdayShort.mon`:e===2?`sessions.scheduledTasks.dialog.schedule.weekdayShort.tue`:e===3?`sessions.scheduledTasks.dialog.schedule.weekdayShort.wed`:e===4?`sessions.scheduledTasks.dialog.schedule.weekdayShort.thu`:e===5?`sessions.scheduledTasks.dialog.schedule.weekdayShort.fri`:e===6?`sessions.scheduledTasks.dialog.schedule.weekdayShort.sat`:`sessions.scheduledTasks.dialog.schedule.weekdayShort.unknown`);if(e.schedule.kind===`daily`)return n&&e.schedule.timezone?t(`sessions.scheduledTasks.dialog.schedule.dailyWithTimezone`,{time:r,timezone:e.schedule.timezone}):t(`sessions.scheduledTasks.dialog.schedule.daily`,{time:r});if(e.schedule.kind===`weekly`){let a=Array.isArray(e.schedule.weekdays)?e.schedule.weekdays.map(e=>i(e)).join(`, `):``;return n&&e.schedule.timezone?t(`sessions.scheduledTasks.dialog.schedule.weeklyWithTimezone`,{days:a,time:r,timezone:e.schedule.timezone}):t(`sessions.scheduledTasks.dialog.schedule.weekly`,{days:a,time:r})}if(e.schedule.kind===`once`){let r=typeof e.schedule.date==`string`&&e.schedule.date.trim().length>0?e.schedule.date:t(`sessions.scheduledTasks.dialog.schedule.unknownDate`),i=typeof e.schedule.time==`string`&&e.schedule.time.trim().length>0?e.schedule.time:`--:--`;return n&&e.schedule.timezone?t(`sessions.scheduledTasks.dialog.schedule.onceWithTimezone`,{date:r,time:i,timezone:e.schedule.timezone}):t(`sessions.scheduledTasks.dialog.schedule.once`,{date:r,time:i})}return n&&e.schedule.timezone?t(`sessions.scheduledTasks.dialog.schedule.cronWithTimezone`,{cron:e.schedule.cron||``,timezone:e.schedule.timezone}):t(`sessions.scheduledTasks.dialog.schedule.cron`,{cron:e.schedule.cron||``})},wt=(e,t)=>{if(!e||!Number.isFinite(e))return``;let n=e-Date.now(),r=Math.abs(n),i=6e4,a=60*i,o=24*a,s=n>=0;if(r<i)return t(s?`sessions.scheduledTasks.dialog.relativeTime.inLessThanOneMinute`:`sessions.scheduledTasks.dialog.relativeTime.justNow`);if(r<a){let e=Math.round(r/i);return t(s?`sessions.scheduledTasks.dialog.relativeTime.inMinutes`:`sessions.scheduledTasks.dialog.relativeTime.minutesAgo`,{count:e})}if(r<o){let e=Math.floor(r/a),n=Math.round(r%a/i),o=n>0?`${e}h ${n}m`:`${e}h`;return t(s?`sessions.scheduledTasks.dialog.relativeTime.inDuration`:`sessions.scheduledTasks.dialog.relativeTime.durationAgo`,{duration:o})}let c=Math.floor(r/o),l=Math.round(r%o/a),u=l>0?`${c}d ${l}h`:`${c}d`;return t(s?`sessions.scheduledTasks.dialog.relativeTime.inDuration`:`sessions.scheduledTasks.dialog.relativeTime.durationAgo`,{duration:u})},Tt=e=>new Intl.DateTimeFormat(C(),{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(new Date(e)),Et=(e,t)=>{if(e.status===`running`)return Math.max(0,t-e.startedAt);if(typeof e.finishedAt==`number`&&Number.isFinite(e.finishedAt)){let t=Math.max(0,e.finishedAt-e.startedAt);return typeof e.durationMs==`number`&&Number.isFinite(e.durationMs)&&e.durationMs>=0?Math.max(e.durationMs,t):t}return typeof e.durationMs==`number`&&Number.isFinite(e.durationMs)&&e.durationMs>=0?e.durationMs:null},Dt=e=>{if(e===null||!Number.isFinite(e)||e<0)return null;if(e<1e3)return`<1s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;if(n<60)return r>0?`${n}m ${r}s`:`${n}m`;let i=Math.floor(n/60),a=n%60;return a>0?`${i}h ${a}m`:`${i}h`},Ot={success:{tone:`success`,Icon:`checkbox-circle`},error:{tone:`error`,Icon:`error-warning`},running:{tone:`warning`,Icon:`loader-4`,spin:!0},idle:{tone:`muted`,Icon:`pulse`}},kt=e=>e===`muted`?{}:{color:`var(--status-${e})`,backgroundColor:`var(--status-${e}-background)`,borderColor:`var(--status-${e}-border)`},At=({projectId:e,taskId:t})=>`${e}:${t}`,jt=null,Mt=()=>jt?jt():(m.getState().setScheduledTasksDialogOpen(!1),!0),Nt=(e,t,n)=>({tasks:[...e?.tasks.filter(e=>e.projectId!==t)??[],...n.map(e=>({projectId:t,task:e}))],failedProjectIds:e?.failedProjectIds.filter(e=>e!==t)??[]});function Pt(){let e=(0,Ne.c)(18),{t}=ne(),n=m(Rt),r=m(Lt);if(!m(It))return null;let i;e[0]===t?i=e[1]:(i=t(`sessions.scheduledTasks.dialog.title`),e[0]=t,e[1]=i);let a;e[2]===t?a=e[3]:(a=t(`sessions.scheduledTasks.dialog.title`),e[2]=t,e[3]=a);let o;e[4]===t?o=e[5]:(o=t(`mobile.surface.closeAria`),e[4]=t,e[5]=o);let s;e[6]===t?s=e[7]:(s=t(`mobile.sessions.sheet.resizeAria`),e[6]=t,e[7]=s);let c;e[8]!==n||e[9]!==r?(c=(0,q.jsx)(zt,{presentation:`mobile-panel`,open:n,onOpenChange:r}),e[8]=n,e[9]=r,e[10]=c):c=e[10];let l;return e[11]!==n||e[12]!==i||e[13]!==a||e[14]!==o||e[15]!==s||e[16]!==c?(l=(0,q.jsx)(T,{id:`scheduled-tasks`,open:n,initiallyExpanded:!0,title:i,ariaLabel:a,closeAriaLabel:o,resizeAriaLabel:s,onOpenChange:Ft,children:c}),e[11]=n,e[12]=i,e[13]=a,e[14]=o,e[15]=s,e[16]=c,e[17]=l):l=e[17],l}function Ft(e){e||Mt()}function It(e){return e.isMobile}function Lt(e){return e.setScheduledTasksDialogOpen}function Rt(e){return e.isScheduledTasksDialogOpen}function zt({presentation:e=`workspace`,open:t=!0,onOpenChange:r,registerEditorBackHandler:i,onEditorActiveChange:a}={}){let{t:h}=ne(),g=l.runtime()[0],y=G.useMemo(()=>[g,`scheduled-tasks`],[g]),C=G.useMemo(()=>[g,`scheduled-task-runs`],[g]),w=D(),T=m(e=>e.isMobile),ie=m(e=>e.scheduledTaskOpenRequest),ae=m(e=>e.isScheduledTasksDialogOpen),oe=m(e=>e.setMainTabGuard),O=ee(e=>e.projects),de=ee(e=>e.getActiveProject())?.id||O[0]?.id||``,[F,I]=G.useState(de),[L,R]=G.useState(()=>{if(T&&e!==`mobile-panel`)return null;let t=Te();return t.scheduleProjectId&&t.scheduleTaskId?{projectId:t.scheduleProjectId,taskId:t.scheduleTaskId}:null}),[z,B]=G.useState(()=>L?`edit`:`closed`),[_e,ve]=G.useState(`all`),[H,ye]=G.useState(()=>Te().scheduleView===`history`?`history`:`tasks`),[be,xe]=G.useState(``),[Se,Oe]=G.useState(!1),Ae=G.useRef(!1),W=p(e=>{Ae.current=e,Oe(e)}),[je,Me]=G.useState(null),[Ne,Pe]=G.useState(null),[Fe,Ie]=G.useState(null),[K,Le]=G.useState(null),Re=G.useRef(null),[ze,Be]=G.useState(null),Ve=G.useRef(null),He=G.useRef(null),J=e===`mobile-tab`,Y=e===`mobile-panel`||J,Ue=p(e=>{Be(J?e?.closest(`[role="tabpanel"]`)??null:e)});G.useEffect(()=>{if(J)return a?.(z!==`closed`),()=>a?.(!1)},[z,J,a]),G.useEffect(()=>{if(!t)return;let n=t=>{let n=Te();if(n.tab===`schedule`){if(T&&e!==`mobile-panel`&&n.scheduleTaskId){R(null),B(`closed`),W(!1);return}let t=n.scheduleView===`history`?`history`:`tasks`;ye(e=>e===t?e:t);let r=n.scheduleProjectId&&n.scheduleTaskId?{projectId:n.scheduleProjectId,taskId:n.scheduleTaskId}:null;R(r),B(r?`edit`:`closed`),W(!1)}else t&&e===`mobile-panel`&&r?.(!1)};return n(),window.addEventListener(`popstate`,n),()=>window.removeEventListener(`popstate`,n)},[t,T,e,r,W]),G.useEffect(()=>{!t||!ie||T&&e!==`mobile-panel`&&ae||(R(ie),B(`edit`),ye(`tasks`),W(!1),m.getState().setScheduledTaskOpenRequest(null))},[t,ie,T,e,ae,W]),G.useEffect(()=>{O.some(e=>e.id===F)||I(de)},[F,de,O]);let X=s({queryKey:y,enabled:t,refetchOnMount:`always`,queryFn:P,select:e=>({...e,tasks:[...e.tasks].sort((e,t)=>e.task.enabled===t.task.enabled?e.task.name.localeCompare(t.task.name):e.task.enabled?-1:1)})}),We=G.useMemo(()=>X.data?.tasks??[],[X.data]),Ge=X.data?.failedProjectIds??[],Z=G.useMemo(()=>L?We.find(({projectId:e,task:t})=>e===L.projectId&&t.id===L.taskId)??null:null,[L,We]),Ke=Z?.task??null,Q=c({queryKey:[...C,K?.projectId??``,K?.taskId??``],enabled:t&&H===`history`,initialPageParam:void 0,queryFn:({pageParam:e,signal:t})=>N({before:e,limit:20,...K?{projectId:K.projectId,taskId:K.taskId}:{}},t),getNextPageParam:e=>e.complete?void 0:e.nextCursor??void 0,refetchOnMount:`always`}),qe=t&&H===`history`&&z===`closed`&&!!ze&&Q.hasNextPage&&!Q.isFetching&&!Q.error;f(qe?Re:null,p(e=>{qe&&e.some(e=>e.isIntersecting)&&Q.fetchNextPage({cancelRefetch:!1})}),{root:ze,rootMargin:`0px 0px 240px 0px`});let $=G.useMemo(()=>{let e=new Set,t=[];for(let n of Q.data?.pages??[])for(let r of n.runs)e.has(r.id)||(e.add(r.id),t.push(r));return t},[Q.data]),Je=G.useMemo(()=>$.some(e=>e.status===`running`),[$]),Ye=G.useMemo(()=>{if(!K)return null;let e=We.find(({projectId:e,task:t})=>e===K.projectId&&t.id===K.taskId);return e?.task.name?e.task.name:$.find(e=>e.projectId===K.projectId&&e.taskId===K.taskId)?.taskName||K.taskId},[K,$,We]),[Xe,Ze]=G.useState(()=>Date.now());G.useEffect(()=>{if(!t||H!==`history`||!Je)return;Ze(Date.now());let e=window.setInterval(()=>Ze(Date.now()),1e3);return()=>window.clearInterval(e)},[Je,t,H]);let Qe=G.useMemo(()=>new Map(O.map(e=>[e.id,e])),[O]);G.useEffect(()=>{let e=null,t=u(t=>{(t.type===`scheduled-task-ran`||t.type===`event-stream-ready`)&&(e&&clearTimeout(e),e=setTimeout(()=>{d.invalidateQueries({queryKey:y,exact:!0}),d.invalidateQueries({queryKey:C})},400))});return()=>{e&&clearTimeout(e),t()}},[y,C]);let $e=o({mutationFn:({projectID:e,taskDraft:t})=>ge(e,t),onSuccess:(e,{projectID:t})=>{d.setQueryData(y,n=>Nt(n,t,e))}}),et=o({mutationFn:({projectID:e,taskID:t})=>he(e,t),onSuccess:(e,{projectID:t})=>{d.setQueryData(y,n=>Nt(n,t,e))}}),tt=o({mutationFn:({projectID:e,taskID:t})=>me(e,t),onSuccess:()=>{d.invalidateQueries({queryKey:y,exact:!0}),d.invalidateQueries({queryKey:C})}}),nt=o({mutationFn:({projectID:e,task:t})=>ge(e,t),onMutate:({projectID:e,task:t})=>{let n=d.getQueryData(y);return d.setQueryData(y,n=>n&&{...n,tasks:n.tasks.map(n=>n.projectId===e&&n.task.id===t.id?{projectId:e,task:t}:n)}),{previousTasks:n}},onSuccess:(e,{projectID:t})=>{d.setQueryData(y,n=>Nt(n,t,e))},onError:(e,t,n)=>{n?.previousTasks&&d.setQueryData(y,n.previousTasks)}}),rt=p(()=>!Ae.current||window.confirm(h(`sessions.scheduledTasks.workspace.confirm.discardChanges`)));G.useEffect(()=>{if(!Se){oe(null);return}let e=e=>e===`schedule`||window.confirm(h(`sessions.scheduledTasks.workspace.confirm.discardChanges`));return oe(e),()=>{m.getState().mainTabGuard===e&&oe(null)}},[Se,oe,h]);let it=p(t=>{let n={projectId:t.projectId,taskId:t.task.id};if((At(n)!==(L?At(L):``)||z!==`edit`)&&rt()){if(T&&e!==`mobile-panel`){De(n.projectId,n.taskId);return}R(n),B(`edit`),W(!1),ot(`tasks`,n)}}),at=p(()=>{!F||!rt()||(R(null),B(`create`),W(!1),ot(`tasks`,null))}),ot=p((e,t)=>{let n=m.getState();Ee({sessionId:null,tab:`schedule`,isSettingsOpen:n.isSettingsDialogOpen,settingsPath:n.settingsPage,diffFile:null,scheduleView:e,scheduleProjectId:t?.projectId??null,scheduleTaskId:t?.taskId??null})}),st=p(e=>{H!==e&&(z!==`closed`&&!rt()||(R(null),B(`closed`),W(!1),Le(null),ye(e),ot(e,null)))}),ct=p((t,i)=>{e===`mobile-panel`&&t&&i&&r?.(!1),te(t,i,{phoneShell:!!(Y&&!n()),switchToChat:!0})}),lt=p(e=>{ct(e.sessionId,e.directory)}),ut=p(e=>{z!==`closed`&&!rt()||(R(null),B(`closed`),W(!1),Le({projectId:e.projectId,taskId:e.task.id}),ye(`history`),ot(`history`,null))}),dt=p(()=>{Le(null)}),pt=p(()=>{Z&&ut(Z)}),mt=p(async()=>{if(Q.data&&Q.hasNextPage){await Q.fetchNextPage();return}await Q.refetch()}),ht=p(e=>{e||!rt()||(R(null),B(`closed`),W(!1),ot(`tasks`,null))}),gt=p(()=>e===`mobile-panel`?!rt()||(R(null),B(`closed`),W(!1),ot(`tasks`,null),r?.(!1),!0):z===`closed`?(r?.(!1),!0):(ht(!1),!0));G.useEffect(()=>{if(e!==`mobile-panel`||!t)return;jt=gt;let n=()=>gt();return window.addEventListener(`yuri:scheduled-tasks-close-request`,n),()=>{jt===gt&&(jt=null),window.removeEventListener(`yuri:scheduled-tasks-close-request`,n)}},[e,t]);let _t=p(()=>z!==`closed`&&(ht(!1),!0));fe({id:`mobile-scheduled-editor`,active:J&&z!==`closed`,onBack:_t,surfaceRef:Ve,underlayRef:He}),G.useEffect(()=>{if(i)return i(_t),()=>i(null)},[i]);let vt=p(async e=>{let t=L?.projectId||F;if(!t)throw Error(h(`sessions.scheduledTasks.dialog.error.chooseProjectFirst`));let n=new Set(We.filter(e=>e.projectId===t).map(e=>e.task.id)),r=await $e.mutateAsync({projectID:t,taskDraft:e}),i=e.id?r.find(t=>t.id===e.id):r.find(e=>!n.has(e.id)),a=[...r].filter(t=>t.name===e.name).sort((e,t)=>(t.state?.updatedAt||0)-(e.state?.updatedAt||0))[0],o=i||a;return o&&(R({projectId:t,taskId:o.id}),B(`edit`),ot(`tasks`,{projectId:t,taskId:o.id})),W(!1),x.success(h(`sessions.scheduledTasks.dialog.toast.saved`)),o}),bt=p(async e=>{let{projectId:t,task:n}=e;if(window.confirm(h(`sessions.scheduledTasks.dialog.confirm.deleteTask`,{taskName:n.name}))){Me(At({projectId:t,taskId:n.id}));try{await et.mutateAsync({projectID:t,taskID:n.id});let e=At({projectId:t,taskId:n.id});L&&At(L)===e&&(R(null),B(`closed`),W(!1),ot(`tasks`,null)),x.success(h(`sessions.scheduledTasks.dialog.toast.deleted`))}catch(e){x.error(e instanceof Error?e.message:h(`sessions.scheduledTasks.dialog.toast.deleteFailed`))}finally{Me(null)}}}),xt=p(async({projectId:e,task:t})=>{Me(At({projectId:e,taskId:t.id}));try{await tt.mutateAsync({projectID:e,taskID:t.id}),x.success(h(`sessions.scheduledTasks.dialog.toast.started`))}catch(e){x.error(e instanceof Error?e.message:h(`sessions.scheduledTasks.dialog.toast.runFailed`))}finally{Me(null)}}),St=p(async({projectId:e,task:t},n)=>{Me(At({projectId:e,taskId:t.id}));try{await nt.mutateAsync({projectID:e,task:{...t,enabled:n}})}catch(e){x.error(e instanceof Error?e.message:h(`sessions.scheduledTasks.dialog.toast.updateFailed`))}finally{Me(null)}}),Mt=G.useMemo(()=>{let e=be.trim().toLocaleLowerCase();return We.filter(({task:t})=>_e===`active`&&!t.enabled||_e===`paused`&&t.enabled?!1:!e||t.name.toLocaleLowerCase().includes(e)||Ct(t,h).toLocaleLowerCase().includes(e))},[_e,be,h,We]),Pt=e=>{let t=e.icon?Ce[e.icon]:null,n=e.color?we[e.color]:void 0,r=(0,q.jsx)(S,{name:t??`folder`,className:`size-3.5`,style:n?{color:n}:void 0});return(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,q.jsx)(`span`,{className:`relative top-px flex size-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,q.jsx)(U,{project:e,className:`size-full object-contain`,fallback:r}):r}),(0,q.jsx)(`span`,{className:`truncate`,children:b(e.path)})]})},Ft=O.map(e=>({id:e.id,label:Pt(e)}));return(0,q.jsxs)(`div`,{className:v(`relative flex min-h-0`,J?`yuri-mobile-scheduled-workspace w-full flex-col overflow-visible bg-transparent`:`h-full overflow-hidden bg-background`,Y&&`flex-col`),"data-presentation":e,children:[(0,q.jsxs)(`div`,{ref:J?He:void 0,"data-mobile-navigation-underlay":J?`true`:void 0,"aria-hidden":J&&z!==`closed`?!0:void 0,inert:J&&z!==`closed`?!0:void 0,className:v(J?`flex w-full min-w-0 flex-col gap-[var(--yuri-mobile-page-gap)]`:`contents`),children:[J?(0,q.jsx)(ke,{title:h(`sessions.scheduledTasks.dialog.title`),trailing:(0,q.jsx)(yt,{active:z===`closed`})}):null,Y&&!J?(0,q.jsx)(re,{children:z===`edit`&&Z?(0,q.jsxs)(ce,{children:[(0,q.jsx)(k,{asChild:!0,children:(0,q.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:`size-11 shrink-0 rounded-lg`,disabled:!!je,"aria-label":h(`sessions.scheduledTasks.dialog.actions.moreAria`,{taskName:Z.task.name}),children:(0,q.jsx)(S,{name:`more-2`,className:`size-5`})})}),(0,q.jsxs)(se,{align:`end`,className:`min-w-40`,children:[(0,q.jsxs)(A,{className:`min-h-11`,onSelect:()=>void xt(Z),children:[(0,q.jsx)(S,{name:`play`,className:`size-4`}),h(`sessions.scheduledTasks.dialog.actions.runNow`)]}),(0,q.jsxs)(A,{className:`min-h-11`,onSelect:()=>ut(Z),children:[(0,q.jsx)(S,{name:`history`,className:`size-4`}),h(`sessions.scheduledTasks.workspace.views.history`)]}),(0,q.jsxs)(A,{className:`min-h-11`,onSelect:()=>void St(Z,!Z.task.enabled),children:[(0,q.jsx)(S,{name:Z.task.enabled?`pause`:`play`,className:`size-4`}),Z.task.enabled?h(`sessions.scheduledTasks.dialog.actions.pause`):h(`sessions.scheduledTasks.dialog.actions.resume`)]}),(0,q.jsxs)(A,{variant:`destructive`,className:`min-h-11`,onSelect:()=>void bt(Z),children:[(0,q.jsx)(S,{name:`delete-bin`,className:`size-4`}),h(`sessions.scheduledTasks.dialog.actions.delete`)]})]})]}):null}):null,(0,q.jsxs)(`section`,{className:v(`min-w-0 flex-col transition-[width] duration-300 ease-out`,J?`flex-none overflow-visible`:`flex-1 overflow-hidden`,Y&&!J&&z!==`closed`?`hidden`:`flex`),children:[(0,q.jsx)(`header`,{className:v(`shrink-0`,J?`pb-0 pt-0`:Y?`px-3 pb-3 pt-3`:`px-4 pb-5 pt-4 sm:px-6`),children:(0,q.jsxs)(`div`,{className:v(`mx-auto w-full`,J?`max-w-[26rem]`:`max-w-4xl`),children:[(0,q.jsx)(`div`,{className:v((H===`tasks`||K||!J)&&`mb-3`,J?`yuri-mobile-floating-surface yuri-mobile-segmented-track`:`grid grid-cols-2 gap-1 rounded-xl bg-[var(--surface-muted)] p-1`),role:`tablist`,"aria-label":h(`sessions.scheduledTasks.workspace.views.aria`),children:[`tasks`,`history`].map(e=>(0,q.jsxs)(_,{type:`button`,variant:`ghost`,size:`sm`,role:`tab`,"aria-selected":H===e,className:v(J?`yuri-mobile-segmented-item`:`relative min-h-9 rounded-lg text-muted-foreground transition-[background-color,color,box-shadow] motion-reduce:transition-none`,!J&&Y&&`min-h-11`,!J&&(H===e?`text-foreground hover:bg-transparent hover:text-foreground`:`hover:bg-interactive-hover/40 hover:text-foreground`)),onClick:()=>st(e),children:[H===e?(0,q.jsx)(V.span,{layoutId:`scheduled-workspace-view-pill`,className:v(`yuri-segmented-selected-pill absolute inset-0`,!J&&`rounded-lg`),transition:{duration:w?0:.18,ease:[.22,1,.36,1]},"aria-hidden":`true`}):null,(0,q.jsxs)(`span`,{className:`relative z-[1] inline-flex items-center gap-1.5`,children:[(0,q.jsx)(S,{name:e===`tasks`?`calendar-schedule`:`history`,className:`size-4 shrink-0`}),h(`sessions.scheduledTasks.workspace.views.${e}`)]})]},e))}),H===`history`&&Ye?(0,q.jsx)(`div`,{className:v(`flex min-w-0 items-center`,J?`mt-[var(--yuri-mobile-page-gap)]`:`mt-3`),role:`status`,"aria-label":h(`sessions.scheduledTasks.history.filter.aria`,{name:Ye}),children:(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1 rounded-full border border-border/60 bg-[var(--surface-elevated)] py-1 pl-3 pr-1`,children:[(0,q.jsx)(`span`,{className:`min-w-0 truncate typography-meta text-foreground`,children:Ye}),(0,q.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:v(`shrink-0 rounded-full`,Y?`size-8`:`size-7`),onClick:dt,"aria-label":h(`sessions.scheduledTasks.history.filter.clearAria`),children:(0,q.jsx)(S,{name:`close`,className:`size-3.5`})})]})}):null,H===`tasks`?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:v(J?`yuri-mobile-floating-surface yuri-mobile-segmented-track yuri-mobile-scheduled-controls`:v(`flex items-center justify-between`,Y?`gap-2`:`gap-3`)),children:[(0,q.jsx)(`div`,{className:v(J?`yuri-mobile-segmented-group`:v(`flex items-center gap-1`,Y&&`min-w-0 flex-1`)),role:`group`,"aria-label":h(`sessions.scheduledTasks.dialog.title`),children:[`all`,`active`,`paused`].map(e=>(0,q.jsxs)(_,{type:`button`,variant:`ghost`,size:`sm`,className:v(J?`yuri-mobile-segmented-item`:`relative border-0 bg-transparent text-muted-foreground shadow-none transition-[color,background-color] duration-150 ease-out motion-reduce:transition-none`,!J&&(Y?`h-11 min-h-11 min-w-0 flex-1 rounded-xl px-2`:`!h-9 !min-h-9 rounded-xl px-3`),!J&&(_e===e?`text-foreground hover:bg-transparent hover:text-foreground`:`hover:bg-interactive-hover/40 hover:text-foreground`)),"aria-pressed":_e===e,onClick:()=>ve(e),children:[_e===e?(0,q.jsx)(V.span,{layoutId:`scheduled-task-filter-pill`,className:v(`yuri-segmented-selected-pill absolute inset-0`,!J&&`rounded-xl`),transition:{duration:w?0:.18,ease:[.22,1,.36,1]},"aria-hidden":`true`}):null,(0,q.jsx)(`span`,{className:`relative z-[1]`,children:h(`sessions.scheduledTasks.workspace.filters.${e}`)})]},e))}),J?(0,q.jsx)(_,{variant:`mobileGlass`,size:`mobileIcon`,"data-mobile-press-feedback":`compact`,className:`yuri-mobile-segmented-action yuri-mobile-inverse-action shrink-0`,onClick:at,disabled:!F,"aria-label":h(`sessions.scheduledTasks.dialog.actions.create`),children:(0,q.jsx)(S,{name:`add`,className:`size-5`})}):(0,q.jsx)(`div`,{className:`flex min-w-0 items-center gap-2`,children:(0,q.jsxs)(_,{variant:`ghost`,"data-mobile-press-feedback":Y?`compact`:void 0,className:v(`shrink-0 rounded-full bg-foreground text-background transition-[background-color,box-shadow] duration-150 ease-out hover:bg-foreground/90 hover:text-background hover:shadow-sm active:bg-interactive-active motion-reduce:transition-none`,Y?`size-11 min-h-11 px-0 min-[400px]:w-auto min-[400px]:px-3.5`:`!h-9 !min-h-9 px-3.5`),onClick:at,disabled:!F,"aria-label":h(`sessions.scheduledTasks.dialog.actions.create`),children:[(0,q.jsx)(S,{name:`add`,className:`h-4 w-4`}),` `,(0,q.jsx)(`span`,{className:v(Y&&`hidden min-[400px]:inline`),children:h(`sessions.scheduledTasks.dialog.actions.create`)})]})})]}),J?null:(0,q.jsxs)(`div`,{className:v(`group relative w-full`,Y?`mt-3`:`mt-7`),children:[(0,q.jsx)(S,{name:`search`,className:`pointer-events-none absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground transition-[color,transform] duration-150 ease-out group-focus-within:scale-105 group-focus-within:text-foreground motion-reduce:transition-none`}),(0,q.jsx)(pe,{value:be,onChange:e=>xe(e.target.value),placeholder:h(`sessions.scheduledTasks.workspace.search.placeholder`),className:v(`rounded-full bg-[var(--surface-elevated)] pl-10 pr-4 ring-1 ring-inset ring-border/50 transition-[background-color,box-shadow,color] duration-200 ease-out hover:[&:not(:focus)]:ring-border focus:bg-[var(--surface-elevated)] focus:shadow-sm focus:ring-2 focus:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,Y?`h-11 min-h-11`:`!h-9 !min-h-9`)})]})]}):null]})}),(0,q.jsx)(`div`,{ref:Ue,className:v(J?`flex-none overflow-visible pt-[var(--yuri-mobile-page-gap)]`:`min-h-0 flex-1 overflow-y-auto`,!J&&(Y?`overscroll-none px-3 pb-[max(1rem,env(safe-area-inset-bottom))]`:`px-6 pb-6 [scrollbar-gutter:stable]`)),children:(0,q.jsx)(`div`,{className:v(`mx-auto w-full`,J?`max-w-[26rem]`:`max-w-4xl pt-4`),children:H===`history`?(0,q.jsxs)(`div`,{className:`space-y-3`,children:[Q.isLoading?(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 typography-meta text-muted-foreground`,children:[(0,q.jsx)(S,{name:`loader-4`,className:`size-4 animate-spin motion-reduce:animate-none`}),h(`sessions.scheduledTasks.history.loading`)]}):Q.error&&$.length===0?(0,q.jsx)(`div`,{className:`rounded-xl border border-dashed border-border p-4`,children:(0,q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,q.jsx)(S,{name:`error-warning`,className:`mt-0.5 size-4 shrink-0 text-[var(--status-error)]`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`p`,{className:`typography-ui-label font-medium text-foreground`,children:h(`sessions.scheduledTasks.history.error.title`)}),(0,q.jsx)(`p`,{className:`mt-1 break-words typography-meta text-muted-foreground`,children:Q.error instanceof Error?Q.error.message:h(`sessions.scheduledTasks.history.error.description`)})]}),(0,q.jsx)(_,{variant:`outline`,size:`sm`,onClick:()=>void mt(),children:h(`sessions.scheduledTasks.history.retry`)})]})}):$.length===0?(0,q.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border p-6 text-center`,children:[(0,q.jsx)(S,{name:`history`,className:`mx-auto size-5 text-muted-foreground`}),(0,q.jsx)(`p`,{className:`mt-2 typography-ui-label font-medium text-foreground`,children:h(`sessions.scheduledTasks.history.empty.title`)}),(0,q.jsx)(`p`,{className:`mt-1 typography-meta text-muted-foreground`,children:h(`sessions.scheduledTasks.history.empty.description`)})]}):(0,q.jsxs)(`div`,{className:v(J?`space-y-4`:Y?`space-y-2`:`divide-y divide-border/50 overflow-hidden rounded-xl border border-border/60 bg-[var(--surface-elevated)]`),children:[$.map(e=>{let t=Qe.get(e.projectId),n=t?b(t.path):e.projectId,r=e.directory?b(e.directory):null,i=r&&r!==n?`${n} · ${r}`:n,a=Ot[e.status],o=!!(e.sessionId&&e.directory),s=Dt(Et(e,Xe))??(e.status===`running`?h(`sessions.scheduledTasks.history.duration.pending`):null),c=Tt(e.startedAt),l=h(`sessions.scheduledTasks.history.trigger.${e.trigger}`),u=e.trigger===`manual`?`play`:`calendar-schedule`,d=h(`sessions.scheduledTasks.dialog.status.${e.status}`),f=a.tone===`muted`?void 0:{color:`var(--status-${a.tone})`},p=t?.icon?Ce[t.icon]??`folder`:`folder`,m=t?.color?we[t.color]:void 0,ee=(0,q.jsx)(`span`,{className:`flex size-3.5 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:t?.iconImage?(0,q.jsx)(U,{project:t,className:`size-full object-contain`,fallback:(0,q.jsx)(S,{name:p,className:`size-3.5`,style:m?{color:m}:void 0})}):(0,q.jsx)(S,{name:p,className:`size-3.5`,style:m?{color:m}:void 0})}),te=(0,q.jsx)(`span`,{className:v(`mt-0.5 flex shrink-0 items-center justify-center rounded-full border`,Y?`size-7`:`size-8`),style:kt(a.tone),title:d,"aria-label":d,children:(0,q.jsx)(S,{name:a.Icon,className:v(Y?`size-3.5`:`size-4`,a.spin&&`animate-spin motion-reduce:animate-none`)})}),g=(0,q.jsxs)(`p`,{className:v(`mt-0.5 flex min-w-0 items-center gap-1.5 text-muted-foreground`,Y?`typography-micro`:`truncate typography-meta`),title:e.directory??n,children:[ee,(0,q.jsx)(`span`,{className:v(`min-w-0`,Y?`break-words`:`truncate`),children:i})]}),_=(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[s?(0,q.jsx)(`span`,{className:`typography-micro tabular-nums text-muted-foreground`,title:s,children:s}):null,(0,q.jsx)(`span`,{className:`typography-micro font-medium`,style:f,children:d})]}),y=(0,q.jsxs)(`div`,{className:v(`flex w-full min-w-0 items-start`,Y?`gap-2.5`:`gap-3`),children:[te,(0,q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex w-full min-w-0 items-start justify-between gap-2`,children:[(0,q.jsx)(`h3`,{className:v(`min-w-0 flex-1 font-semibold text-foreground`,Y?`break-words typography-meta leading-snug`:`truncate typography-ui-label`),children:e.taskName}),_]}),g,(0,q.jsxs)(`div`,{className:v(`mt-1 flex w-full min-w-0 gap-2`,Y?`items-center`:`items-center justify-between gap-3`),children:[(0,q.jsxs)(`div`,{className:v(`flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 typography-micro text-muted-foreground`,Y&&`gap-x-2.5 gap-y-0.5`),children:[(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,title:c,children:[(0,q.jsx)(S,{name:`time`,className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`whitespace-nowrap tabular-nums`,children:c})]}),(0,q.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1`,title:l,children:[(0,q.jsx)(S,{name:u,className:`size-3 shrink-0`,"aria-hidden":`true`}),(0,q.jsx)(`span`,{className:`whitespace-nowrap`,children:l})]})]}),!Y&&o?(0,q.jsx)(`span`,{className:`shrink-0 self-center typography-ui-label font-medium text-foreground`,children:h(`sessions.scheduledTasks.history.openSession`)}):null]}),e.error?(0,q.jsxs)(`p`,{className:v(`mt-1.5 min-w-0 break-words typography-micro text-[var(--surface-muted-foreground)] [overflow-wrap:anywhere]`,Y?`line-clamp-3`:`line-clamp-1`),title:e.error.slice(0,300),children:[(0,q.jsx)(S,{name:`error-warning`,className:`mr-1 inline-block size-3 align-[-0.125em] text-[var(--status-error)]`,"aria-hidden":`true`}),e.error.slice(0,300)]}):null]})]});if(Y){let t=h(`sessions.scheduledTasks.history.openSession`),n=v(`yuri-mobile-scheduled-task-card w-full`,J?`yuri-mobile-floating-surface yuri-mobile-project-shell rounded-[var(--yuri-mobile-surface-radius)]`:`rounded-xl border border-border/60 bg-[var(--surface-elevated)] shadow-sm dark:shadow-none`);return o?(0,q.jsx)(`article`,{"data-mobile-press-surface":`soft`,className:n,children:(0,q.jsx)(`button`,{type:`button`,"data-mobile-press-surface-trigger":!0,className:v(`yuri-mobile-scheduled-task-row w-full p-3 text-left outline-none`,`focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--interactive-focus-ring)]`),"aria-label":t,onClick:()=>lt(e),children:y})},e.id):(0,q.jsx)(`article`,{className:v(n,`p-3`),children:y},e.id)}return o?(0,q.jsx)(`article`,{className:`w-full min-w-0`,children:(0,q.jsx)(`button`,{type:`button`,className:`w-full min-w-0 px-4 py-3 text-left outline-none transition-colors hover:bg-interactive-hover focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,"aria-label":h(`sessions.scheduledTasks.history.openSession`),onClick:()=>lt(e),children:y})},e.id):(0,q.jsx)(`article`,{className:`w-full min-w-0 px-4 py-3`,children:y},e.id)}),Q.error?(0,q.jsxs)(`div`,{className:v(`flex flex-wrap items-center justify-between gap-2 p-3 typography-meta text-[var(--status-error-foreground)]`,Y?`rounded-xl border border-[var(--status-error-border)] bg-[var(--status-error-background)]`:`border-t border-[var(--status-error-border)] bg-[var(--status-error-background)]`),children:[(0,q.jsx)(`span`,{children:h(`sessions.scheduledTasks.history.error.more`)}),(0,q.jsx)(_,{variant:`outline`,size:`sm`,onClick:()=>void mt(),children:h(`sessions.scheduledTasks.history.retry`)})]}):null]}),Q.hasNextPage?(0,q.jsx)(`div`,{ref:Re,className:`flex min-h-px justify-center`,children:Q.isFetchingNextPage?(0,q.jsx)(`span`,{role:`status`,"aria-label":h(`sessions.scheduledTasks.history.loadingMore`),className:`py-1 text-muted-foreground`,children:(0,q.jsx)(S,{name:`loader-4`,className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`})}):null}):null]}):(0,q.jsxs)(q.Fragment,{children:[Ge.length>0?(0,q.jsx)(`div`,{className:`mb-3 rounded-xl border p-3 typography-meta`,style:kt(`warning`),children:h(`sessions.scheduledTasks.workspace.partialLoadWarning`)}):null,X.isLoading?(0,q.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 typography-meta text-muted-foreground`,children:[(0,q.jsx)(S,{name:`loader-4`,className:`h-4 w-4 animate-spin`}),` `,h(`sessions.scheduledTasks.dialog.loading`)]}):X.error&&!X.data?(0,q.jsx)(`div`,{className:`rounded-xl border border-dashed border-border p-4 typography-meta text-muted-foreground`,children:X.error instanceof Error?X.error.message:h(`sessions.scheduledTasks.dialog.toast.loadFailed`)}):(0,q.jsx)(E,{initial:!1,mode:`popLayout`,children:Mt.length===0?(0,q.jsx)(V.div,{initial:w?{opacity:0}:{opacity:0,y:4},animate:{opacity:1,y:0},exit:w?{opacity:0}:{opacity:0,y:-4},transition:{duration:w?0:.18,ease:[.22,1,.36,1]},className:`rounded-xl border border-dashed border-border p-4 typography-meta text-muted-foreground`,children:We.length>0?h(`sessions.scheduledTasks.workspace.search.noResults`):h(`sessions.scheduledTasks.dialog.empty.noTasks`)},`empty`):(0,q.jsx)(V.div,{initial:w?{opacity:0}:{opacity:0,y:4},animate:{opacity:1,y:0},exit:w?{opacity:0}:{opacity:0,y:-4},transition:{duration:w?0:.18,ease:[.22,1,.36,1]},className:v(J?`space-y-4`:`space-y-1`),children:(0,q.jsx)(E,{initial:!1,mode:`popLayout`,children:Mt.map(e=>{let{projectId:t,task:n}=e,r=At({projectId:t,taskId:n.id}),i=z===`edit`&&L!==null&&At(L)===r,a=n.state?.nextRunAt,o=n.state?.lastStatus||`idle`,s=Ot[o],c=je===r,l=t=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(t,{className:v(Y&&`min-h-11`),onClick:t=>{t.stopPropagation(),xt(e)},disabled:c,children:[(0,q.jsx)(S,{name:`play`,className:`size-4`}),h(`sessions.scheduledTasks.dialog.actions.runNow`)]}),(0,q.jsxs)(t,{className:v(Y&&`min-h-11`),onClick:t=>{t.stopPropagation(),ut(e)},children:[(0,q.jsx)(S,{name:`history`,className:`size-4`}),h(`sessions.scheduledTasks.workspace.views.history`)]}),(0,q.jsxs)(t,{className:v(Y&&`min-h-11`),onClick:t=>{t.stopPropagation(),St(e,!n.enabled)},disabled:c,children:[(0,q.jsx)(S,{name:n.enabled?`pause`:`play`,className:`size-4`}),n.enabled?h(`sessions.scheduledTasks.dialog.actions.pause`):h(`sessions.scheduledTasks.dialog.actions.resume`)]}),(0,q.jsxs)(t,{onClick:t=>{t.stopPropagation(),bt(e)},disabled:c,className:v(`text-destructive focus:text-destructive`,Y&&`min-h-11`),children:[(0,q.jsx)(S,{name:`delete-bin`,className:`size-4 text-inherit`}),h(`sessions.scheduledTasks.dialog.actions.delete`)]})]});return(0,q.jsx)(V.div,{layout:`position`,initial:!w&&{opacity:0,y:6},animate:{opacity:1,y:0},exit:w?{opacity:0}:{opacity:0,y:-6},transition:{duration:w?0:.18,ease:[.22,1,.36,1]},"data-mobile-press-surface":J?`soft`:void 0,className:v(J&&`yuri-mobile-floating-surface yuri-mobile-project-shell yuri-mobile-scheduled-task-card`),children:(0,q.jsxs)(ue,{open:Ne===r,onOpenChange:e=>{e&&Ie(null),Pe(e?r:null)},children:[(0,q.jsxs)(`div`,{className:v(`group flex w-full items-center gap-1`,J&&`yuri-mobile-project-card`),children:[(0,q.jsxs)(j,{render:(0,q.jsx)(`button`,{type:`button`,onClick:()=>it(e),onContextMenu:!Y&&!T?e=>{e.preventDefault(),Ie(null),Pe(r)}:void 0,"data-mobile-press-surface-trigger":J?!0:void 0,className:v(`flex min-h-11 min-w-0 flex-1 items-center rounded-xl border py-3 text-left outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] motion-reduce:transition-none`,J?`yuri-mobile-project-trigger yuri-mobile-scheduled-task-row border-0 bg-transparent transition-opacity duration-150`:`transition-[background-color,border-color,box-shadow,opacity] duration-150 ease-out active:bg-interactive-active`,Y&&!J?`gap-2.5 px-3`:J?void 0:`gap-3 px-4`,!J&&(i?`border-border/50 bg-[var(--surface-elevated)] shadow-sm dark:shadow-none`:`border-transparent hover:bg-interactive-hover`),!n.enabled&&`opacity-65`),"aria-pressed":i}),children:[(0,q.jsx)(`span`,{className:v(`flex shrink-0 items-center justify-center rounded-full text-muted-foreground transition-[border-color,color,background-color] duration-150 motion-reduce:transition-none`,J?`yuri-mobile-project-icon yuri-mobile-glass-control`:`size-5 border border-border`),style:n.enabled&&s.tone!==`muted`?{color:`var(--status-${s.tone})`}:void 0,children:(0,q.jsx)(E,{initial:!1,mode:`wait`,children:(0,q.jsx)(V.span,{initial:!w&&{opacity:0,scale:.72},animate:{opacity:1,scale:1},exit:w?{opacity:0}:{opacity:0,scale:.72},transition:{duration:w?0:.15},className:`flex`,children:(0,q.jsx)(S,{name:n.enabled?s.Icon:`pause`,className:v(J?`yuri-mobile-project-icon-glyph`:`size-3.5`,s.spin&&n.enabled&&`animate-spin`)})},`${n.enabled}-${o}`)})}),(0,q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,q.jsx)(`span`,{className:v(`block truncate font-medium`,J?`yuri-mobile-project-title yuri-mobile-entity-title font-semibold`:`typography-ui-label`),children:n.name}),(0,q.jsxs)(`span`,{className:v(`mt-1 flex min-w-0 items-center text-muted-foreground`,J?`yuri-mobile-project-meta yuri-mobile-entity-meta`:`gap-1 typography-micro`),children:[(0,q.jsx)(`span`,{className:`truncate`,children:Ct(n,h,!J)}),(0,q.jsx)(`span`,{className:`shrink-0 text-muted-foreground/50`,children:`·`}),(0,q.jsx)(`span`,{className:`shrink-0 truncate`,children:a?wt(a,h):`—`})]})]})]}),(0,q.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:v(`shrink-0 self-center rounded-lg text-muted-foreground`,Y?`size-11 rounded-full`:`size-9`),onClick:t=>{t.stopPropagation(),ut(e)},"aria-label":h(`sessions.scheduledTasks.workspace.views.history`),children:(0,q.jsx)(S,{name:`history`,className:`size-4`})}),(0,q.jsxs)(ce,{open:Fe===r,onOpenChange:e=>{e&&Pe(null),Ie(e?r:null)},children:[(0,q.jsx)(k,{asChild:!0,children:(0,q.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:v(`shrink-0 self-center text-muted-foreground transition-[opacity,transform,background-color] duration-150 ease-out data-[popup-open]:bg-interactive-hover motion-reduce:transition-none`,J?`yuri-mobile-project-action yuri-mobile-scheduled-task-action rounded-full`:`rounded-lg`,J?void 0:Y?`size-11`:`size-8 translate-x-1 opacity-0 group-hover:translate-x-0 group-hover:opacity-100 data-[popup-open]:translate-x-0 data-[popup-open]:opacity-100`,i&&!J&&`opacity-100`),onClick:e=>e.stopPropagation(),"aria-label":h(`sessions.scheduledTasks.dialog.actions.moreAria`,{taskName:n.name}),children:(0,q.jsx)(S,{name:`more-2`,className:J?`size-5`:`size-4`})})}),(0,q.jsx)(se,{align:`end`,className:`min-w-40 motion-reduce:transition-none`,onClick:e=>e.stopPropagation(),children:l(A)})]})]}),(0,q.jsx)(M,{className:`min-w-40 motion-reduce:transition-none`,children:l(le)})]})},r)})})},`tasks`)})]})})})]})]}),z===`edit`&&!Ke?(0,q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-4`,role:`status`,children:[X.isPending?h(`sessions.scheduledTasks.dialog.loading`):h(`common.unavailable`),X.isPending?null:(0,q.jsx)(_,{variant:`outline`,size:`sm`,onClick:()=>void X.refetch(),children:h(`assistants.actions.retry`)})]}):null,T?z===`create`||z===`edit`&&Ke?(0,q.jsx)(`div`,{ref:J?Ve:void 0,className:v(J?`yuri-mobile-scheduled-editor-overlay flex w-full min-w-0 max-w-full flex-col overflow-hidden bg-background [contain:layout_paint]`:`contents`),children:(0,q.jsx)(ft,{open:!0,presentation:J?`mobile-tab`:Y?`mobile-panel`:void 0,task:z===`edit`?Ke:null,onOpenChange:ht,onSave:vt,onDirtyChange:W,onRun:async()=>{Z&&await xt(Z)},onOpenTaskHistory:pt,onDelete:async()=>{Z&&await bt(Z)},onToggleEnabled:async(e,t)=>{Z&&await St(Z,t)},actionBusy:!!je,projectID:L?.projectId||F,projectOptions:Ft,onProjectChange:z===`create`?I:void 0})}):null:(0,q.jsx)(E,{initial:!1,children:z===`create`||z===`edit`&&Ke?(0,q.jsx)(V.div,{initial:w?{opacity:1,width:0}:{opacity:0,width:0,x:24},animate:{opacity:1,width:`clamp(380px, 36vw, 480px)`,x:0},exit:w?{opacity:0,width:0}:{opacity:0,width:0,x:24},transition:{duration:w?0:.26,ease:[.22,1,.36,1]},className:`h-full min-h-0 max-w-[480px] shrink-0 overflow-hidden`,children:(0,q.jsx)(`aside`,{className:`h-full min-h-0 w-[clamp(380px,36vw,480px)] border-l border-border/60 bg-background`,children:(0,q.jsx)(ft,{open:!0,presentation:`panel`,task:z===`edit`?Ke:null,onOpenChange:ht,onSave:vt,onDirtyChange:W,onRun:async()=>{Z&&await xt(Z)},onOpenTaskHistory:pt,onDelete:async()=>{Z&&await bt(Z)},onToggleEnabled:async(e,t)=>{Z&&await St(Z,t)},actionBusy:!!je,projectID:L?.projectId||F,projectOptions:Ft,onProjectChange:z===`create`?I:void 0})})},`scheduled-task-details`):null})]})}export{zt as n,xt as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/rolldown-runtime-hePW80VL.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t,R as n,n as r}from"./platform-CNdx57HN.js";import{st as i}from"./vendor-base-ui-wXsskyKm.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as a}from"./vendor-react-BkccXcWz.js";import{o}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";var s=e(i(),1),c=a(),l=.85,u=1.2,d=10/9*1.05,f=.9,p=1.029,m=p/f,h=`yuri.designPtScale.v9`;function g(e){return!Number.isFinite(e)||e<=0?1:Math.min(u,Math.max(l,e))}function _(e){if(!e)return p;let t=e.density,n=(e.xdpi+e.ydpi)/2;if(!(t>0)||!(n>=50)||n>800)return p;let r=g(n/t/163);return Math.min(p,r*m)}function v(){if(typeof window>`u`)return 1;try{let e=Number.parseFloat(window.localStorage.getItem(`yuri.designPtScale.v9`)??``),t=window.Capacitor?.getPlatform?.();return t===`android`?!Number.isFinite(e)||e<=0?p:Math.min(p,g(e)):t===`ios`?d:g(e)}catch{return 1}}function y(e){if(!(typeof window>`u`))try{window.localStorage.setItem(h,String(e))}catch{}}function b(e,t=document.documentElement){let n=g(e);t.style.setProperty(`--dpt`,`${n}px`),t.style.setProperty(`--dpt-n`,String(n))}async function x(){if(typeof document>`u`)return 1;b(v());let{Capacitor:e,registerPlugin:t}=await o(async()=>{let{Capacitor:e,registerPlugin:t}=await import(`./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js`).then(e=>e.i);return{Capacitor:e,registerPlugin:t}},__vite__mapDeps([0,1]));if(!e.isNativePlatform())return b(1),1;if(e.getPlatform()===`ios`)return b(d),y(d),d;if(e.getPlatform()!==`android`)return b(1),1;if(!e.isPluginAvailable(`YuriPhysicalScale`))return b(p),y(p),p;try{let e=_(await t(`YuriPhysicalScale`).getMetrics());return y(e),b(e),e}catch{return b(p),y(p),p}}var S=({screenWidth:e,...t})=>t,C={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},w={isMobile:!1,isTablet:!1,isDesktop:!0,deviceType:`desktop`,screenWidth:1024,breakpoint:`lg`,hasTouchInput:!1,hasTouchOnlyPointer:!1},T=S(w),E=()=>typeof window>`u`?!1:new URLSearchParams(window.location.search).get(`surface`)===`desktop`,D=e=>{if(typeof navigator>`u`)return{isExplicitTablet:!1};let t=navigator.userAgent||``,n=navigator.platform||``,r=/iPad/i.test(t)||(/Macintosh|MacIntel/i.test(t)||/MacIntel/i.test(n))&&e>1,i=/Android/i.test(t)&&!/Mobile/i.test(t),a=/Tablet/i.test(t);return{isExplicitTablet:r||i||a}},O=(e,t,n)=>{if(typeof window>`u`)return;let r=document.documentElement,i=t===`mobile`,a=t===`tablet`,o=(e,t)=>{r.classList.contains(e)!==t&&r.classList.toggle(e,t)},s=(e,t)=>{r.style.getPropertyValue(e)!==t&&r.style.setProperty(e,t)};o(`device-mobile`,i),o(`device-tablet`,a),o(`device-desktop`,t===`desktop`),o(`desktop-runtime`,e),o(`mobile-pointer`,!e&&n),e?(s(`--is-mobile`,`0`),s(`--device-type`,`desktop`),s(`--font-scale`,`1`),s(`--has-coarse-pointer`,`0`),s(`--has-touch-input`,`0`)):(s(`--is-mobile`,i?`1`:`0`),s(`--device-type`,t),s(`--font-scale`,i?`0.9`:a?`0.95`:`1`),s(`--has-coarse-pointer`,n?`1`:`0`),s(`--has-touch-input`,n?`1`:`0`));let c=e?1:v();(r.style.getPropertyValue(`--dpt`)!==`${c}px`||r.style.getPropertyValue(`--dpt-n`)!==String(c))&&b(c,r)};function k(){let e=window.innerWidth,i=typeof window.matchMedia==`function`,a=i?window.matchMedia(`(pointer: coarse)`):null,o=i?window.matchMedia(`(hover: none)`):null,s=a?.matches??!1,c=o?.matches??!1,l=typeof navigator<`u`?navigator.maxTouchPoints??0:0,u=t()||n()||E(),{isExplicitTablet:d}=D(l),f=s||c||l>0,p=s||c,m=e>C.md&&e<=C.lg,h=e<=C.md,g=f&&h,_=f&&!g&&(m||d),v=!f||!_&&e>C.lg,y=`desktop`;u?(g=!1,_=!1,v=!0,y=`desktop`):r()?(g=!0,_=!1,v=!1,y=`mobile`):g?y=`mobile`:_?y=`tablet`:(v=!0,y=`desktop`),O(u,y,f);let b=`xs`;for(let[t,n]of Object.entries(C))e>=n&&(b=t);return{isMobile:g,isTablet:_,isDesktop:v,deviceType:y,screenWidth:e,breakpoint:b,hasTouchInput:f,hasTouchOnlyPointer:p}}var A=(e,t)=>e.isMobile===t.isMobile&&e.isTablet===t.isTablet&&e.isDesktop===t.isDesktop&&e.deviceType===t.deviceType&&e.breakpoint===t.breakpoint&&e.hasTouchInput===t.hasTouchInput&&e.hasTouchOnlyPointer===t.hasTouchOnlyPointer,j=new Set,M=new Set,N=null,P=null,F,I=null,L=()=>typeof window>`u`?w:(N||=k(),N),R=()=>typeof window>`u`?T:(P||=S(L()),P),z=()=>{F=void 0;let e=k(),t=!P||!A(P,e);if(!(!t&&N?.screenWidth===e.screenWidth)){if(N=e,t){P=S(e);for(let e of M)e()}for(let e of j)e()}},B=()=>{typeof window>`u`||F!==void 0||(F=window.requestAnimationFrame(z))},V=(e,t)=>e?typeof e.addEventListener==`function`?(e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)):typeof e.addListener==`function`?(e.addListener(t),()=>e.removeListener(t)):()=>{}:()=>{},H=()=>{if(typeof window>`u`)return()=>{};z(),window.addEventListener(`resize`,B);let e=typeof window.matchMedia==`function`?window.matchMedia(`(pointer: coarse)`):null,t=typeof window.matchMedia==`function`?window.matchMedia(`(hover: none)`):null,n=V(e,B),r=V(t,B);return()=>{window.removeEventListener(`resize`,B),n(),r(),F!==void 0&&(window.cancelAnimationFrame(F),F=void 0)}},U=(e,t)=>typeof window>`u`?()=>{}:(e.add(t),I||=H(),()=>{e.delete(t),j.size===0&&M.size===0&&I&&(I(),I=null,N=null,P=null)}),W=e=>U(j,e),G=e=>U(M,e);function K(){if(typeof window>`u`||typeof window<`u`&&t())return!1;let e=document.documentElement,n=e.style.getPropertyValue(`--is-mobile`)||getComputedStyle(e).getPropertyValue(`--is-mobile`);return n===`1`||n===`true`}var q=()=>typeof window>`u`?!1:!!(navigator.standalone===!0||window.matchMedia?.(`(display-mode: standalone)`)?.matches||window.matchMedia?.(`(display-mode: fullscreen)`)?.matches),J=()=>{if(typeof window>`u`||t())return!1;let e=typeof navigator<`u`?navigator.maxTouchPoints??0:0;return q()&&e>0&&window.innerWidth>C.md};function Y(){let e=(0,c.c)(2),[t,n]=s.useState(X),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(J()),t=window.matchMedia?.(`(display-mode: standalone)`),r=window.matchMedia?.(`(display-mode: fullscreen)`);e(),window.addEventListener(`resize`,e),window.addEventListener(`focus`,e);let i=t=>{t&&(typeof t.addEventListener==`function`?t.addEventListener(`change`,e):typeof t.addListener==`function`&&t.addListener(e))},a=t=>{t&&(typeof t.removeEventListener==`function`?t.removeEventListener(`change`,e):typeof t.removeListener==`function`&&t.removeListener(e))};return i(t),i(r),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`focus`,e),a(t),a(r)}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),s.useEffect(r,i),t}function X(){return J()}var Z=()=>typeof window>`u`?`portrait`:window.matchMedia?.(`(orientation: landscape)`)?.matches?`landscape`:`portrait`;function Q(){let e=(0,c.c)(2),[t,n]=s.useState(Z),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(`(orientation: landscape)`),t=()=>n(e.matches?`landscape`:`portrait`);return t(),V(e,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),s.useEffect(r,i),t}function $(e){let t=(0,c.c)(2),n;return t[0]===e?.includeScreenWidth?n=t[1]:(n=()=>e?.includeScreenWidth?w:T,t[0]=e?.includeScreenWidth,t[1]=n),s.useSyncExternalStore(e?.includeScreenWidth?W:G,e?.includeScreenWidth?L:R,n)}export{Y as a,Q as i,K as n,x as o,$ as r,k as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{R as t,l as n,u as r}from"./platform-CNdx57HN.js";import{a as i,i as a,r as o}from"./vendor-zustand-CTekDqaS.js";import{ot as s,st as c}from"./vendor-base-ui-wXsskyKm.js";import{St as l,an as u,jt as d,on as f}from"./gitApiHttp-C8AU1uiY.js";import{t as p}from"./safeStorage-DTOhKN0V.js";import{i as m,t as h}from"./vendor-pathe-vBmvQE8f.js";import{n as g}from"./vendor-react-BkccXcWz.js";import{s as _,u as v}from"./vendor-tanstack-react-query-DIb_ItL-.js";import{E as y}from"./runtime-file-resource-DKJJoOOc.js";import{o as b}from"./path-utils-jGozTg9d.js";import{r as x}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as S}from"./useUIStore-P32bzAJc.js";import{o as C,s as w}from"./spacedFileMention-Ds4GtgiF.js";import{Ba as T,Fi as E,Oi as D,Pa as O,R as k,Yi as A,_ as j,b as M,bt as N,f as P,lo as ee,no as F,ua as I,ut as L,xa as R,za as te}from"./ui-CU6n15y3.js";import{n as z}from"./Icon-zB0u-x9G.js";import{s as ne}from"./remoteProjectQueries-BunVM5PM.js";import{t as re}from"./i18n-WsU03nwB.js";import{t as ie}from"./ScrollableOverlay-DAMUOn67.js";import{t as ae}from"./useDebouncedValue-BHlMPqY8.js";import{t as oe}from"./AgentAvatar-5tMBB3OP.js";import{c as se,d as ce,l as le,n as ue,r as de,t as fe}from"./fileMentionTouchSelection-B73h0W0P.js";import{a as pe,o as me,s as he}from"./fileMentionAutocompleteState-B9411b4o.js";var ge=(e,t)=>{let n=t.trim();if(!n)return[...e].sort((e,t)=>e.isBuiltIn===t.isBuiltIn?e.name.localeCompare(t.name):e.isBuiltIn?-1:1);let r=w([...e],n,e=>[e.name,e.description??``]);return r.sort((e,t)=>e.score===t.score?e.item.isBuiltIn===t.item.isBuiltIn?e.item.name.localeCompare(t.item.name):e.item.isBuiltIn?-1:1:e.score-t.score),r.map(e=>e.item)},_e=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.title===r.title&&(e.subtitle??``)===(r.subtitle??``)&&(e.badge??``)===(r.badge??``)&&e.iconName===r.iconName&&e.agentName===r.agentName}),ve=(e,t)=>e.highlightedIndex===t.highlightedIndex&&_e(e.rows,t.rows),ye=(e,t)=>_e(e,t)?e:t.slice(),be=(e,t,n)=>{e&&(t.current&&ve(t.current,n)||(t.current=n,e(n)))},xe=(e,t)=>{t.current=null,e?.({rows:[],highlightedIndex:0})},B=e(c(),1),V=g(),Se=e=>e.directories.flatMap(e=>e.sessions),H=(e,t)=>({...ne(e,t.location.hostId),select:Se}),Ce=async(e,t,n)=>{n.sdk();let r=await e.fetchQuery(H(t,n));return n.sdk(),Se(r)},U=(e,t,n,r)=>{n.sdk();let i=e.getQueryData(H(t,n).queryKey);for(let e of i?.directories??[]){let t=e.sessions.find(e=>e.id===r);if(t)return t.title||r}return r},W=(e,t,n,r={})=>({queryKey:[...e.queryScope,`composer-files`,t,n,r],staleTime:3e4,gcTime:3e4,queryFn:async({signal:i})=>{let a=await e.sdk().file.find({query:t,location:{directory:e.location.directory},limit:n,type:r.type},{signal:i});if(e.sdk(),i.throwIfAborted(),!Array.isArray(a.data))throw Error(`File search returned no data`);return a.data.map(t=>{let n=m(t.path),r=h(n);return{name:r,path:b(e.location.directory,n),relativePath:n,extension:r.includes(`.`)?r.split(`.`).pop()?.toLowerCase():void 0,isDirectory:t.type===`directory`}})}}),G=e=>{if(!e)return``;let t=e.replace(/\\/g,`/`),n=t.startsWith(`//`),r=t.replace(/\/+/g,`/`);n&&!r.startsWith(`//`)&&(r=`/${r}`);let i=r===`/`,a=/^[A-Za-z]:\/$/.test(r);return!i&&!a&&(r=r.replace(/\/+$/,``)),r},K=e=>/^[A-Za-z]:\//.test(e)?e.toLowerCase():e,q=e=>e.startsWith(`yuri-remote-location:`)?n(e):G(e),J=(e,t)=>{let n=G(r(t,`local`).directory),i=G(e);if(!n||!i)return!1;let a=K(n),o=K(i);return o===a||o.startsWith(a.endsWith(`/`)?a:`${a}/`)},we=e=>{if(!e||typeof e!=`object`)return{};let t=e,n={};for(let[e,r]of Object.entries(t)){let t;try{t=q(e)}catch{continue}if(!t||!r||typeof r!=`object`)continue;let i=r,a=Array.isArray(i.openPaths)?Array.from(new Set(i.openPaths.filter(e=>typeof e==`string`).map(e=>G(e)).filter(e=>J(e,t)))):[],o=Array.isArray(i.expandedPaths)?Array.from(new Set(i.expandedPaths.filter(e=>typeof e==`string`).map(e=>G(e)).filter(e=>J(e,t)))):[],s=typeof i.selectedPath==`string`?G(i.selectedPath):null,c=s&&J(s,t)?s:a[0]??null,l=typeof i.touchedAt==`number`&&Number.isFinite(i.touchedAt)?i.touchedAt:Date.now(),u=n[t];if(u){let e=Array.from(new Set([...u.openPaths,...a])),r=Array.from(new Set([...u.expandedPaths,...o])),i=u.selectedPath??c??e[0]??null;n[t]={openPaths:e,selectedPath:i,expandedPaths:r,touchedAt:Math.max(u.touchedAt,l)};continue}n[t]={openPaths:a,selectedPath:c,expandedPaths:o,touchedAt:l}}return n},Y=(e,t)=>{let n=Object.entries(e);if(n.length<=t)return e;n.sort((e,t)=>(t[1]?.touchedAt??0)-(e[1]?.touchedAt??0));let r={};for(let[e,i]of n.slice(0,t))r[e]=i;return r},X=e=>e?{...e,touchedAt:Date.now()}:{openPaths:[],selectedPath:null,expandedPaths:[],touchedAt:Date.now()},Z=i()(o(a((e,t)=>({byRoot:{},addOpenPath:(t,n,r)=>{let i=q((t||``).trim()),a=G((n||``).trim());!i||!a||!r?.allowOutsideRoot&&!J(a,i)||e(e=>{let t=e.byRoot[i],n=X(t),r=n.openPaths.includes(a),o=r?n.openPaths:[...n.openPaths,a],s=n.selectedPath??a;return t&&r&&t.selectedPath===s?e:{byRoot:Y({...e.byRoot,[i]:{...n,openPaths:o,selectedPath:s}},20)}})},removeOpenPath:(t,n)=>{let r=q((t||``).trim()),i=G((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=K(i),a=e=>K(e)===n,o=t.selectedPath?a(t.selectedPath):!1;if(!t.openPaths.some(a)&&!o)return e;let s=t.openPaths.filter(e=>!a(e)),c=o?s[0]??null:t.selectedPath;return{byRoot:Y({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeOpenPathsByPrefix:(t,n)=>{let r=q((t||``).trim()),i=G((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=K(i),a=n.endsWith(`/`)?n:`${n}/`,o=e=>{let t=K(e);return t===n||t.startsWith(a)},s=t.openPaths.filter(e=>!o(e));if(s.length===t.openPaths.length)return e;let c=t.selectedPath&&o(t.selectedPath)?s[0]??null:t.selectedPath;return{byRoot:Y({...e.byRoot,[r]:{...t,openPaths:s,selectedPath:c,touchedAt:Date.now()}},20)}})},removeExpandedPathsByPrefix:(t,n)=>{let r=q((t||``).trim()),i=G((n||``).trim());!r||!i||e(e=>{let t=e.byRoot[r];if(!t)return e;let n=K(i),a=n.endsWith(`/`)?n:`${n}/`,o=t.expandedPaths.filter(e=>{let t=K(e);return t!==n&&!t.startsWith(a)});return o.length===t.expandedPaths.length?e:{byRoot:Y({...e.byRoot,[r]:{...t,expandedPaths:o,touchedAt:Date.now()}},20)}})},setSelectedPath:(t,n,r)=>{let i=q((t||``).trim()),a=n?G(n.trim()):null;!i||a&&!r?.allowOutsideRoot&&!J(a,i)||e(e=>{let t=e.byRoot[i],n=X(t),r=a&&!n.openPaths.includes(a)?[...n.openPaths,a]:n.openPaths;return t&&t.selectedPath===a&&r===t.openPaths?e:{byRoot:Y({...e.byRoot,[i]:{...n,openPaths:r,selectedPath:a}},20)}})},ensureSelectedPath:e=>{let n=q((e||``).trim());if(!n)return;let r=t().byRoot[n];if(!r||r.selectedPath)return;let i=r.openPaths[0]??null;i&&t().setSelectedPath(n,i)},toggleExpandedPath:(t,n)=>{let r=q((t||``).trim()),i=G((n||``).trim());!r||!i||!J(i,r)||e(e=>{let t=e.byRoot[r],n=X(t),a=n.expandedPaths.includes(i)?n.expandedPaths.filter(e=>e!==i):[...n.expandedPaths,i];return t&&t.expandedPaths===a&&t.selectedPath===n.selectedPath&&t.openPaths===n.openPaths?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:a}},20)}})},expandPath:(t,n)=>{let r=q((t||``).trim()),i=G((n||``).trim());!r||!i||!J(i,r)||e(e=>{let t=e.byRoot[r],n=X(t);return n.expandedPaths.includes(i)&&t?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,i]}},20)}})},expandPaths:(t,n)=>{let r=q((t||``).trim());if(!r||!n||n.length===0)return;let i=n.map(e=>G((e||``).trim())).filter(e=>e&&J(e,r));i.length!==0&&e(e=>{let t=e.byRoot[r],n=X(t),a=new Set(n.expandedPaths),o=i.filter(e=>!a.has(e));return o.length===0?e:{byRoot:Y({...e.byRoot,[r]:{...n,expandedPaths:[...n.expandedPaths,...o]}},20)}})}}),{name:`files-view-tabs-store`,version:2,storage:p(),migrate:e=>{if(!e||typeof e!=`object`)return{byRoot:{}};let t=e.byRoot;return{byRoot:we(t)}},merge:(e,t)=>({...t,byRoot:we(e&&typeof e==`object`?e.byRoot:void 0)}),partialize:e=>({byRoot:we(e.byRoot)})}),{name:`files-view-tabs-store`})),Q=()=>{let e=(0,V.c)(17),t=P(Te),n=N(),r;e[0]===t?r=e[1]:(r=e=>t?e.getAttachment(t):void 0,e[0]=t,e[1]=r);let i=M(r),a=P(Ee),o=P(De),s=T(Oe),c=T(ke),u=l(Ae);if(t){let r;e[2]===i?r=e[3]:(r=j(i),e[2]=i,e[3]=r);let o=r;if(o)return o;let s;e[4]!==t||e[5]!==a?(s=a.get(t),e[4]=t,e[5]=a,e[6]=s):s=e[6];let c=s;if(c?.path)return c.path;let l;if(e[7]!==t||e[8]!==n){let r;e[10]===t?r=e[11]:(r=e=>e.id===t,e[10]=t,e[11]=r),l=n.find(r),e[7]=t,e[8]=n,e[9]=l}else l=e[9];let u=l;if(u?.directory)return u.directory}if(o?.open&&(o.bootstrapPendingDirectory||o.directoryOverride))return(o.bootstrapPendingDirectory||o.directoryOverride)??void 0;if(s){let t;if(e[12]!==s||e[13]!==c){let n;e[15]===s?n=e[16]:(n=e=>e.id===s,e[15]=s,e[16]=n),t=c.find(n),e[12]=s,e[13]=c,e[14]=t}else t=e[14];let n=t;if(n?.path)return n.path}return u??void 0};function Te(e){return e.currentSessionId}function Ee(e){return e.worktreeMetadata}function De(e){return e.newSessionDraft}function Oe(e){return e.activeProjectId}function ke(e){return e.projects}function Ae(e){return e.currentDirectory}var $=s(),je=`bg-transparent font-[inherit] text-[var(--primary-base)]`,Me=(e,t)=>{let n=t.trim().toLowerCase();if(!n)return e;let r=e.toLowerCase();if(!r.includes(n))return e;let i=[],a=0,o=r.indexOf(n);for(;o!==-1;)o>a&&i.push(e.slice(a,o)),i.push((0,$.jsx)(`mark`,{className:je,children:e.slice(o,o+n.length)},`${o}-${n}`)),a=o+n.length,o=r.indexOf(n,a);return a<e.length&&i.push(e.slice(a)),i},Ne=B.forwardRef((e,t)=>{let n=(0,V.c)(4),r=y(),i;return n[0]!==r||n[1]!==e||n[2]!==t?(i=r?.entry.location.hostId?(0,$.jsx)(Le,{...e,ref:t,entry:r.entry,registry:r.registry},JSON.stringify(r.entry.queryScope)):(0,$.jsx)(Pe,{...e,ref:t}),n[0]=r,n[1]=e,n[2]=t,n[3]=i):i=n[3],i}),Pe=B.forwardRef((e,t)=>{let n=(0,V.c)(22),r=Q()??``,i=P(ze),a=E(Be),o=!!e.onSessionSelect,s;n[0]===o?s=n[1]:(s={enabled:o},n[0]=o,n[1]=s);let c=k(s),l=T(Ve),u=T(He),f;if(n[2]!==l||n[3]!==r||n[4]!==u){let e=u.find(e=>e.id===l)?.path||r;f=e?e.replace(/\\/g,`/`).replace(/\/+$/,``):null,n[2]=l,n[3]=r,n[4]=u,n[5]=f}else f=n[5];let p=f,m;n[6]===p?m=n[7]:(m=e=>p?e.byRoot[p]:void 0,n[6]=p,n[7]=m);let h=Z(m),g=A(Ue),_=d(We),v;n[8]!==a||n[9]!==c||n[10]!==e.onSessionSelect?(v=e.onSessionSelect?D(a,c):[],n[8]=a,n[9]=c,n[10]=e.onSessionSelect,n[11]=v):v=n[11];let y=v,b=e.currentSessionId??i,x;return n[12]!==g||n[13]!==r||n[14]!==p||n[15]!==h||n[16]!==e||n[17]!==t||n[18]!==_||n[19]!==y||n[20]!==b?(x=(0,$.jsx)(Re,{...e,ref:t,currentDirectory:r,currentSessionId:b,projectRoot:p,projectTabs:h,agentCatalog:g,sessions:y,searchFiles:_}),n[12]=g,n[13]=r,n[14]=p,n[15]=h,n[16]=e,n[17]=t,n[18]=_,n[19]=y,n[20]=b,n[21]=x):x=n[21],x}),Fe=[],Ie=[],Le=B.forwardRef((e,t)=>{let n=(0,V.c)(32),{entry:r,registry:i}=e,a=v(),o;n[0]===r?o=n[1]:(o=O(r.location.directory,void 0,r),n[0]=r,n[1]=o);let s=!!e.onAgentSelect,c;n[2]!==o||n[3]!==s?(c={...o,enabled:s},n[2]=o,n[3]=s,n[4]=c):c=n[4];let l=_(c),u;n[5]!==r||n[6]!==i?(u=H(i,r),n[5]=r,n[6]=i,n[7]=u):u=n[7];let d=!!e.onSessionSelect,f;n[8]!==u||n[9]!==d?(f={...u,enabled:d},n[8]=u,n[9]=d,n[10]=f):f=n[10];let p=_(f),m;n[11]===r.key?m=n[12]:(m=e=>e.byRoot[r.key],n[11]=r.key,n[12]=m);let h=Z(m),g;n[13]!==a||n[14]!==r?(g=(e,t,n,i)=>{let o=n===void 0?60:n;return a.fetchQuery(W(r,t,o,i))},n[13]=a,n[14]=r,n[15]=g):g=n[15];let y=x(g),b=r.location.directory,S;if(n[16]!==r.location.directory){let e;n[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\/+$/,n[18]=e):e=n[18],S=r.location.directory.replace(/\\/g,`/`).replace(e,``),n[16]=r.location.directory,n[17]=S}else S=n[17];let C=l.data??Ie,w=p.data??Fe,T=l.error??p.error,E;n[19]===r?E=n[20]:(E=()=>{r.sdk()},n[19]=r,n[20]=E);let D;return n[21]!==r.location.directory||n[22]!==h||n[23]!==e||n[24]!==t||n[25]!==y||n[26]!==C||n[27]!==w||n[28]!==T||n[29]!==E||n[30]!==S?(D=(0,$.jsx)(Re,{...e,ref:t,currentDirectory:b,projectRoot:S,projectTabs:h,agentCatalog:C,sessions:w,searchFiles:y,catalogError:T,assertCurrent:E}),n[21]=r.location.directory,n[22]=h,n[23]=e,n[24]=t,n[25]=y,n[26]=C,n[27]=w,n[28]=T,n[29]=E,n[30]=S,n[31]=D):D=n[31],D}),Re=B.forwardRef(({searchQuery:e,onFileSelect:t,onAgentSelect:n,onSkillSelect:r,onSessionSelect:i,onClose:a,style:o,onRowsChange:s,currentDirectory:c,currentSessionId:l,projectRoot:d,projectTabs:p,agentCatalog:m,sessions:h,searchFiles:g,catalogError:_,assertCurrent:v},y)=>{let{t:b}=re(),w=ae(e,180),T=f(),E=u(),[D,O]=B.useState([]),[k,A]=B.useState(!1),[j,M]=B.useState(null),[N,P]=B.useState(0),L=B.useRef(0),te=B.useRef({query:e,directory:c,ids:[]}),[ne,ce]=B.useState(360),[le,ge]=B.useState({}),[_e,ve]=B.useState({}),ye=B.useRef([]),V=B.useRef([]),Se=B.useRef([]),H=B.useRef(null),Ce=B.useRef(null),U=B.useRef(null);U.current||=fe();let W=S(e=>e.isMobile),G=(e??``).trim(),K=R({directory:c||null}),q=B.useMemo(()=>r?K.data??[]:[],[r,K.data]),J=B.useMemo(()=>{if(!d||!p)return[];let e=[p.selectedPath,...p.openPaths.slice().reverse()].filter(e=>typeof e==`string`&&e.length>0),t=new Set,n=[];for(let r of e){if(t.has(r))continue;t.add(r);let e=r.replace(/\\/g,`/`),i=e.split(`/`).filter(Boolean).pop()||e,a=e.startsWith(`${d}/`)?e.slice(d.length+1):e;n.push({name:i,path:e,relativePath:a,extension:i.includes(`.`)?i.split(`.`).pop()?.toLowerCase():void 0})}return he(n,G,{limit:6})},[G,d,p]),we=B.useMemo(()=>n?I(m).filter(e=>e.mode!==`primary`):[],[m,n]),Y=B.useMemo(()=>i?pe({sessions:h,currentSessionId:l??null,searchQuery:G}):[],[h,l,G,i]),X=J,Z=D,Q=B.useMemo(()=>se({skills:q,agents:we,sessions:Y,recentFiles:X,pathHits:Z,searchQuery:G,untitledSession:b(`chat.fileMentionAutocomplete.untitledSession`),sessionBadge:b(`chat.fileMentionAutocomplete.sessionType`),skillBadge:b(`chat.commandAutocomplete.badge.skill`)}),[q,we,Y,X,Z,G,b]);B.useEffect(()=>{let e=e=>{let t=e.target;!t||!H.current||H.current.contains(t)||a()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[a]),B.useEffect(()=>{if(!c){O([]),A(!1),M(null);return}let e=(w??``).trim(),t=C(e);if(!t){O([]),A(!1),M(null);return}let n=!1;A(!0),M(null);let r={includeHidden:T,respectGitignore:!E};return Promise.all([g(c,t,80,{...r,type:`file`}),g(c,t,40,{...r,type:`directory`})]).then(([t,r])=>{if(n)return;let i=new Set(J.map(e=>e.path));O(me({files:t,directories:r,query:e,excludePaths:i,limit:20}))}).catch(e=>{n||M(e instanceof Error?e:Error(String(e)))}).finally(()=>{n||A(!1)}),()=>{n=!0}},[c,w,J,g,T,E]),B.useLayoutEffect(()=>{let t=te.current,n=t.ids[L.current],r=t.query===e&&t.directory===c?Math.max(0,Q.findIndex(e=>e.id===n)):0;te.current={query:e,directory:c,ids:Q.map(e=>e.id)},L.current=r,P(r)},[Q,e,c]),B.useEffect(()=>{ge({}),ve({})},[Q]),B.useEffect(()=>{ye.current[N]?.scrollIntoView({block:`nearest`})},[N]),B.useEffect(()=>{let e=null,t=()=>{e!==null&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{let e={},t={};V.current.forEach((n,r)=>{if(!n)return;let i=Se.current[r]?.offsetWidth??n.scrollWidth,a=Math.max(0,i-n.clientWidth),o=a>8;if(e[r]=o,o){let e=Math.max(.6,a/110);t[r]=e}}),ge(e),ve(t)})};return t(),window.addEventListener(`resize`,t),()=>{e!==null&&cancelAnimationFrame(e),window.removeEventListener(`resize`,t)}},[Q]),B.useEffect(()=>{let e=V.current[N];if(!e)return;let t=()=>{let t=e.clientWidth;t>0&&ce(t)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[N]);let Te=x(e=>{t(e)}),Ee=x(e=>{n?.(e)}),De=x(e=>{i?.(e)}),Oe=x(e=>{r?.(e)}),ke=(e,t)=>({onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&U.current?.pointerDown(e.clientX,e.clientY)},onPointerMove:e=>{e.pointerType===`touch`&&U.current?.pointerMove(e.clientX,e.clientY)},onPointerUp:e=>{e.pointerType===`touch`&&(U.current?.pointerUp(t)??!1)&&(e.preventDefault(),e.stopPropagation())},onPointerCancel:()=>U.current?.pointerCancel(),onClick:()=>{U.current?.click(t)},onMouseMove:()=>{L.current=e,P(e)}}),Ae=e=>{try{v?.()}catch(e){M(e instanceof Error?e:Error(String(e)));return}let t=Q.length;if(t===0)return;let n=(e%t+t)%t,r=Q[n];if(r.agentName!==void 0){Ee(r.agentName);return}if(r.id.startsWith(`skill:`)){let e=q.find(e=>r.id===`skill:${e.name}-${e.scope}`);e&&Oe(e);return}if(r.id.startsWith(`session:`)){let e=Y.find(e=>r.id===`session:${e.id}`);e&&De(e);return}let i=r.id.startsWith(`recent:`)?X.find(e=>r.id===`recent:${e.path}`):Z.find(e=>r.id===`file:${e.path}`);i&&Te(i)};B.useEffect(()=>{be(s,Ce,{rows:Q,highlightedIndex:N})},[s,N,Q]);let je=B.useRef(s);return je.current=s,B.useEffect(()=>()=>{xe(je.current,Ce)},[]),B.useImperativeHandle(y,()=>({acceptIndex:e=>{Ae(e)},handleKeyDown:e=>{if(e===`Escape`){a();return}let t=Q.length;if(t!==0){if(e===`ArrowDown`){L.current=(L.current+1)%t,P(L.current);return}if(e===`ArrowUp`){L.current=(L.current-1+t)%t,P(L.current);return}(e===`Enter`||e===`Tab`)&&Ae(L.current)}}})),(0,$.jsxs)(ue,{ref:H,isMobile:W,className:`max-w-[640px] max-h-64`,style:o,children:[(0,$.jsx)(ie,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0`,children:(0,$.jsxs)(`div`,{className:`py-1`,children:[_||K.error||j?(0,$.jsx)(`div`,{role:`alert`,className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:(_??K.error??j)?.message}):null,Q.map((e,t)=>{let n=e.id.startsWith(`file:`)||e.id.startsWith(`recent:`),r=n?ee(e.title,{maxLength:60}):e.title,i=N===t,a=le[t]??!1,o=_e[t]??2.6;return(0,$.jsxs)(`div`,{"data-mention-id":e.id,ref:e=>{ye.current[t]=e},className:F(`flex items-center gap-2 px-3 py-1.5 cursor-pointer typography-ui-label rounded-lg`,W&&`min-h-11`,de(W,i),!W&&i&&`text-interactive-selection-foreground`),...ke(t,()=>Ae(t)),children:[(0,$.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center`,children:e.agentName===void 0?(0,$.jsx)(z,{name:e.iconName,className:`size-3.5 text-current`}):(0,$.jsx)(oe,{name:e.agentName,size:20})}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,$.jsxs)(`span`,{ref:e=>{V.current[t]=e},className:F(`relative block min-w-0 overflow-hidden`,n&&a&&i&&`file-mention-marquee-container`),style:i?{"--file-mention-marquee-width":`${ne}px`,"--file-mention-marquee-duration":`${o}s`}:void 0,title:e.title,children:[(0,$.jsx)(`span`,{ref:e=>{Se.current[t]=e},className:`absolute invisible whitespace-nowrap pointer-events-none`,"aria-hidden":!0,children:e.title}),n&&a&&i?(0,$.jsx)(`span`,{className:`inline-block whitespace-nowrap file-mention-marquee`,children:Me(e.title,G)}):(0,$.jsx)(`span`,{className:`block truncate`,children:Me(r,G)})]}),e.trailingLabel?(0,$.jsx)(`span`,{className:F(`max-w-[40%] shrink-0 truncate text-muted-foreground`,W?`typography-micro`:`typography-meta`),children:e.trailingLabel}):null]}),e.subtitle?(0,$.jsx)(`div`,{className:F(`truncate text-muted-foreground`,W?`typography-micro`:`typography-meta`),children:Me(e.subtitle,G)}):null]})]},e.id)}),k&&Z.length===0?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-3`,children:(0,$.jsx)(z,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):null,!k&&Q.length===0&&(0,$.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:b(`chat.fileMentionAutocomplete.empty`)})]})}),!W&&(0,$.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:b(`chat.autocomplete.keyboardHint`)})]})});function ze(e){return e.currentSessionId}function Be(e){return e.activeSessions}function Ve(e){return e.activeProjectId}function He(e){return e.projects}function Ue(e){return e.agents}function We(e){return e.searchFiles}var Ge=new Set([`new`,`fork`,`compact`,`reload`,`undo`,`redo`,`model`,`btw`]),Ke=(e,t)=>{if(!t||e.isSkill)return!1;let n=e.name?.trim().toLowerCase();return!!(n&&Ge.has(n))},qe=(e,t)=>!e||t({name:e}),Je=` `,Ye=(e,t)=>{let n=Math.max(0,Math.min(t,e.length)),r=n;for(;r>0&&!/\s/.test(e[r-1]);)--r;return r>=2&&e[r-1]===Je&&e[r-2]===`/`&&(r-=2),e[r]===`/`?{start:r,end:n}:null},Xe=`text-[10px] leading-none uppercase font-bold tracking-tight px-1.5 py-1 rounded border flex-shrink-0`,Ze=F(Xe,`bg-[color-mix(in_srgb,var(--primary-base)_12%,transparent)] text-[color-mix(in_srgb,var(--primary-base)_70%,transparent)] border-[color-mix(in_srgb,var(--primary-base)_24%,transparent)]`),Qe=F(Xe,`bg-[color-mix(in_srgb,var(--status-success)_12%,transparent)] text-[color-mix(in_srgb,var(--status-success)_70%,transparent)] border-[color-mix(in_srgb,var(--status-success)_24%,transparent)]`),$e=F(Xe,`bg-[color-mix(in_srgb,var(--status-info)_12%,transparent)] text-[color-mix(in_srgb,var(--status-info)_70%,transparent)] border-[color-mix(in_srgb,var(--status-info)_24%,transparent)]`),et=F(Xe,`bg-[var(--surface-muted)] text-muted-foreground border-[var(--interactive-border)]/60`),tt=(e,t)=>e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.description===t[n]?.description),nt=e=>{let t=!!e.sessionID;return{hasSession:t,canStartSessionCommand:t||e.hasNewDraft}},rt=B.forwardRef(({searchQuery:e,onCommandSelect:n,onClose:r,directory:i,style:a,commandPolicy:o,commandContext:s,onRowsChange:c},l)=>{let{t:u}=re(),d=S(e=>e.isMobile),f=P(e=>e.currentSessionId),p=P(e=>!!e.newSessionDraft?.open),m=P(B.useCallback(e=>f?e.getDirectoryForSession(f):void 0,[f])),h=L(f??``,m??void 0),g=B.useMemo(()=>s??{sessionID:f??null,hasMessages:h.length>0,hasNewDraft:p},[s,f,h.length,p]),{hasSession:_,canStartSessionCommand:v}=B.useMemo(()=>nt(g),[g]),y=g.hasMessages,[b,x]=B.useState([]),[C,w]=B.useState(!1),T=te({directory:i}),E=B.useMemo(()=>T.data??[],[T.data]),D=T.isFetching,[O,k]=B.useState(0),A=B.useRef(0),j=B.useRef(!1),M=B.useRef([]),N=B.useRef(null),ee=B.useRef(!1),I=B.useRef(null),R=B.useRef(!1),ne=B.useRef(null);B.useEffect(()=>{let e=e=>{let t=e.target;!t||!N.current||N.current.contains(t)||r()};return document.addEventListener(`pointerdown`,e,!0),()=>{document.removeEventListener(`pointerdown`,e,!0)}},[r]),B.useEffect(()=>{(async()=>{w(D);try{let n=E.flatMap((e,t)=>e.source===`skill`?[]:[{id:`opencode:${e.scope??`global`}:${e.name}:${e.agent??``}:${e.model??``}:${t}`,name:e.name,source:`opencode`,description:e.description,agent:e.agent??void 0,model:e.model??void 0,isBuiltIn:e.isBuiltIn,scope:e.scope,reference:e.reference}]),r=[{id:`yuri:new`,name:`new`,source:`yuri`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!y?[{id:`yuri:init`,name:`init`,source:`yuri`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:btw`,name:`btw`,source:`yuri`,description:u(`chat.btw.description`),isBuiltIn:!0},{id:`yuri:undo`,name:`undo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`yuri:redo`,name:`redo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`yuri:fork`,name:`fork`,source:`yuri`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`yuri:timeline`,name:`timeline`,source:`yuri`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`yuri:model`,name:`model`,source:`yuri`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`yuri:compact`,name:`compact`,source:`yuri`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},...t()?[{id:`yuri:reload`,name:`reload`,source:`yuri`,description:u(`chat.commandAutocomplete.command.reloadDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:summary`,name:`summary`,source:`yuri`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isYuri:!0}]:[],...v?[{id:`yuri:workspace-review`,name:`workspace-review`,source:`yuri`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isYuri:!0}]:[],...v?[{id:`yuri:craft-goal`,name:`craft-goal`,source:`yuri`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isYuri:!0}]:[],...v?[{id:`yuri:catch-up`,name:`catch-up`,source:`yuri`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isYuri:!0}]:[],...v?[{id:`yuri:debug`,name:`debug`,source:`yuri`,description:u(`chat.commandAutocomplete.command.debugDescription`),isYuri:!0}]:[],...v?[{id:`yuri:weigh`,name:`weigh`,source:`yuri`,description:u(`chat.commandAutocomplete.command.weighDescription`),isYuri:!0}]:[],...v?[{id:`yuri:explore`,name:`explore`,source:`yuri`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isYuri:!0}]:[],...n],i=!y,a=ge(r.filter(e=>(i||e.name!==`init`)&&(o?.(e)??!0)),e);x(e=>tt(e,a)?e:a)}catch{let n=!y,r=ge([{id:`yuri:new`,name:`new`,source:`yuri`,description:u(`chat.commandAutocomplete.command.newDescription`),isBuiltIn:!0},..._&&!y?[{id:`yuri:init`,name:`init`,source:`yuri`,description:u(`chat.commandAutocomplete.command.initDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:btw`,name:`btw`,source:`yuri`,description:u(`chat.btw.description`),isBuiltIn:!0},{id:`yuri:undo`,name:`undo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.undoDescription`),isBuiltIn:!0},{id:`yuri:redo`,name:`redo`,source:`yuri`,description:u(`chat.commandAutocomplete.command.redoDescription`),isBuiltIn:!0},{id:`yuri:fork`,name:`fork`,source:`yuri`,description:u(`chat.commandAutocomplete.command.forkDescription`),isBuiltIn:!0},{id:`yuri:timeline`,name:`timeline`,source:`yuri`,description:u(`chat.commandAutocomplete.command.timelineDescription`),isBuiltIn:!0}]:[],{id:`yuri:model`,name:`model`,source:`yuri`,description:u(`chat.commandAutocomplete.command.modelDescription`),isBuiltIn:!0},{id:`yuri:compact`,name:`compact`,source:`yuri`,description:u(`chat.commandAutocomplete.command.compactDescription`),isBuiltIn:!0},...t()?[{id:`yuri:reload`,name:`reload`,source:`yuri`,description:u(`chat.commandAutocomplete.command.reloadDescription`),isBuiltIn:!0}]:[],..._?[{id:`yuri:summary`,name:`summary`,source:`yuri`,description:u(`chat.commandAutocomplete.command.summaryDescription`),isYuri:!0}]:[],...v?[{id:`yuri:workspace-review`,name:`workspace-review`,source:`yuri`,description:u(`chat.commandAutocomplete.command.workspaceReviewDescription`),isYuri:!0}]:[],...v?[{id:`yuri:craft-goal`,name:`craft-goal`,source:`yuri`,description:u(`chat.commandAutocomplete.command.craftGoalDescription`),isYuri:!0}]:[],...v?[{id:`yuri:catch-up`,name:`catch-up`,source:`yuri`,description:u(`chat.commandAutocomplete.command.catchUpDescription`),isYuri:!0}]:[],...v?[{id:`yuri:debug`,name:`debug`,source:`yuri`,description:u(`chat.commandAutocomplete.command.debugDescription`),isYuri:!0}]:[],...v?[{id:`yuri:weigh`,name:`weigh`,source:`yuri`,description:u(`chat.commandAutocomplete.command.weighDescription`),isYuri:!0}]:[],...v?[{id:`yuri:explore`,name:`explore`,source:`yuri`,description:u(`chat.commandAutocomplete.command.exploreDescription`),isYuri:!0}]:[]].filter(e=>(n||e.name!==`init`)&&(o?.(e)??!0)),e);x(e=>tt(e,r)?e:r)}finally{w(!1)}})()},[e,y,_,v,E,D,u,o]),B.useEffect(()=>{k(0)},[b]),B.useEffect(()=>{A.current=O},[O]),B.useEffect(()=>{M.current[O]?.scrollIntoView({block:`nearest`})},[O]),B.useEffect(()=>{be(c,ne,{rows:le(b,{skill:u(`chat.commandAutocomplete.badge.skill`),command:u(`chat.commandAutocomplete.badge.command`),system:u(`chat.commandAutocomplete.badge.system`)}),highlightedIndex:O})},[b,c,O,u]);let ae=B.useRef(c);ae.current=c,B.useEffect(()=>()=>{xe(ae.current,ne)},[]),B.useImperativeHandle(l,()=>({acceptIndex:(e,t=!0)=>{let r=b[e];r&&n(r,Ke(r,t))},handleKeyDown:e=>{let t=b.length;if(e===`Escape`){r();return}if(t!==0){if(e===`ArrowDown`){j.current=!0,k(e=>(e+1)%t);return}if(e===`ArrowUp`){j.current=!0,k(e=>(e-1+t)%t);return}if(e===`Enter`||e===`Tab`){let r=(A.current%t+t)%t,i=b[r];i&&n(i,Ke(i,e===`Enter`))}}}}),[b,r,n]);let oe=e=>{let t=ce(e);switch(e.name){case`new`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5`});case`init`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-green-500`});case`undo`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`redo`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-orange-500`});case`timeline`:case`reload`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5`});case`compact`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-purple-500`});case`goal`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5`});case`review`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-blue-500`});case`test`:case`build`:case`run`:return(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-cyan-500`});default:return e.isBuiltIn?(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-yellow-500`}):(0,$.jsx)(z,{name:t,className:`h-3.5 w-3.5 text-muted-foreground`})}};return(0,$.jsxs)(ue,{ref:N,isMobile:d,className:`max-w-[450px] max-h-64`,style:a,children:[(0,$.jsx)(ie,{preventOverscroll:!0,outerClassName:`flex-1 min-h-0`,className:`px-0 py-1.5`,children:C?(0,$.jsx)(`div`,{className:`flex items-center justify-center py-4`,children:(0,$.jsx)(z,{name:`refresh`,className:`h-4 w-4 animate-spin text-muted-foreground`})}):(0,$.jsxs)(`div`,{children:[b.map((t,r)=>{let i=t.isBuiltIn,a=t.isYuri;return(0,$.jsxs)(`div`,{ref:e=>{M.current[r]=e},className:F(`flex gap-2 px-2 py-2 cursor-pointer rounded-lg`,d?`items-center`:`items-start`,de(d,r===O),!d&&r===O&&`bg-interactive-selection/35`),onMouseDown:e=>e.preventDefault(),onPointerDown:e=>{e.pointerType===`touch`&&(I.current={x:e.clientX,y:e.clientY},R.current=!1)},onPointerMove:e=>{if(e.pointerType!==`touch`||!I.current)return;let t=e.clientX-I.current.x,n=e.clientY-I.current.y;Math.hypot(t,n)>6&&(R.current=!0)},onPointerUp:e=>{if(e.pointerType!==`touch`)return;let r=R.current;I.current=null,R.current=!1,!r&&(e.preventDefault(),e.stopPropagation(),ee.current=!0,n(t,Ke(t,d)))},onPointerCancel:()=>{I.current=null,R.current=!1},onClick:()=>{if(ee.current){ee.current=!1;return}n(t,Ke(t,d))},onMouseMove:()=>{j.current=!1,k(r)},children:[(0,$.jsx)(`div`,{className:F(!d&&`mt-0.5`),children:oe(t)}),(0,$.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`typography-ui-label font-medium`,children:[`/`,Me(t.name,e)]}),t.isSkill?(0,$.jsx)(`span`,{className:Ze,children:u(`chat.commandAutocomplete.badge.skill`)}):(0,$.jsx)(`span`,{className:Ze,children:u(`chat.commandAutocomplete.badge.command`)}),a?(0,$.jsx)(`span`,{className:et,children:`Yuri`}):i?(0,$.jsx)(`span`,{className:et,children:u(`chat.commandAutocomplete.badge.system`)}):t.scope?(0,$.jsx)(`span`,{className:t.scope===`project`?$e:Qe,children:t.scope}):null,t.agent&&(0,$.jsx)(`span`,{className:et,children:t.agent})]}),t.description&&!d&&(0,$.jsx)(`div`,{className:`typography-meta text-muted-foreground mt-0.5 truncate`,children:Me(t.description,e)})]})]},t.id)}),b.length===0&&(0,$.jsx)(`div`,{className:`px-3 py-2 typography-ui-label text-muted-foreground`,children:u(`chat.commandAutocomplete.empty`)})]})}),!d&&(0,$.jsx)(`div`,{className:`px-3 pt-1 pb-1.5 border-t typography-meta text-muted-foreground`,children:u(`chat.autocomplete.keyboardHint`)})]})});rt.displayName=`CommandAutocomplete`;var it=(e,t,n)=>{if(!e)return e;let r=t.length>0&&!/\s$/.test(t)&&!/^\s/.test(e)&&!/[([{]$/.test(t),i=n.length>0&&!/\s$/.test(e)&&!/^\s/.test(n)&&!/^[\])}.,;:!?]/.test(n);return`${r?` `:``}${e}${i?` `:``}`},at=(e,t,n)=>{let r=it(e,t,n);return`${t.length===0&&!/^\s/.test(r)?` `:``}${r}${n.length===0&&!/\s$/.test(r)?` `:``}`},ot=(e,t,n,r)=>{let i=e.slice(0,t),a=e.slice(n),o=at(r,i,a),s=Math.max(0,o.indexOf(r)),c=i.length+s;return{text:`${i}${o}${a}`,caret:i.length+o.length,start:c,end:c+r.length}},st=(e,t)=>{let n=e=>`${e.kind}:${e.value}:${e.range.start}:${e.range.end}`;return new Set(e.map(n)).has(n(t))||e.some(e=>e.range.start<t.range.end&&t.range.start<e.range.end)?[...e]:[...e,t]},ct=(e,t)=>t<e.length&&e[t]===` `?t+1:t;export{rt as a,Ne as c,Ce as d,U as f,at as i,Q as l,st as n,Ye as o,ye as p,ot as r,qe as s,ct as t,Z as u};
|