@yuriai/web 0.3.6 → 0.3.7-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/dist/assets/{AgentAvatar-BOvjZ-DI.js → AgentAvatar-uZt0-TOc.js} +1 -1
  2. package/dist/assets/{AgentSelector-Dl_zIOMk.js → AgentSelector-5iXNLoIx.js} +1 -1
  3. package/dist/assets/{ArchivedSessionsDialog-Cr9Ji-RY.js → ArchivedSessionsDialog-BvaC7Izk.js} +1 -1
  4. package/dist/assets/{AssistantConversationSurface-CLdjNFeJ.js → AssistantConversationSurface-ltD21S9d.js} +3 -3
  5. package/dist/assets/{AssistantSessionCard-BufyrOfo.js → AssistantSessionCard-BQVPnkZz.js} +2 -2
  6. package/dist/assets/{AssistantUnreadBadge-Dn9HAEDr.js → AssistantUnreadBadge-BSVpexQe.js} +1 -1
  7. package/dist/assets/{AssistantView-Cg0wPomu.js → AssistantView-Cn3wym_C.js} +1 -1
  8. package/dist/assets/{AssistantWorkingAvatar-1KNjr2A2.js → AssistantWorkingAvatar-3IFgfMI5.js} +1 -1
  9. package/dist/assets/{AssistantsSettingsPage-DeYfZAYH.js → AssistantsSettingsPage-B52Fwaza.js} +1 -1
  10. package/dist/assets/{BinaryFileFallback-DfD02fS_.js → BinaryFileFallback-CqaGa-BI.js} +1 -1
  11. package/dist/assets/{BtwPanel-B_2w8P0X.js → BtwPanel-grnSijXt.js} +1 -1
  12. package/dist/assets/{BusyDots-CAv4ygIO.js → BusyDots-43VHGWaC.js} +1 -1
  13. package/dist/assets/{ChatContainer-Dgv075jT.js → ChatContainer-Hwe0YX5J.js} +4 -4
  14. package/dist/assets/{ChatView-Cr71C0ZB.js → ChatView-Ei6tfxCe.js} +1 -1
  15. package/dist/assets/{DiagramView-CTnpBsWU.js → DiagramView-BvRz7w00.js} +1 -1
  16. package/dist/assets/{DiffView-j_yWF1Mz.js → DiffView-X_cPRpka.js} +1 -1
  17. package/dist/assets/{DiffViewToggle-CYusbmY5.js → DiffViewToggle-Kt7NTh6a.js} +1 -1
  18. package/dist/assets/{ErrorBoundary-yr_JeVdx.js → ErrorBoundary-DMpwAWMc.js} +1 -1
  19. package/dist/assets/{FadeInOnReveal-C56koblQ.js → FadeInOnReveal-CawaWXLd.js} +1 -1
  20. package/dist/assets/{GuiPluginMount-CBJiLdzR.js → GuiPluginMount-DCZZ6cEG.js} +1 -1
  21. package/dist/assets/{GuiPluginPage-DJa8gFLk.js → GuiPluginPage-D5uAYpR9.js} +1 -1
  22. package/dist/assets/{GuiPluginSurface-Cc7q80jp.js → GuiPluginSurface-CBjXvIos.js} +1 -1
  23. package/dist/assets/{GuiPluginTitlebarItems-rbK3leaL.js → GuiPluginTitlebarItems-C36UkPLK.js} +1 -1
  24. package/dist/assets/{GuiPluginWindow-Cpg2HYWe.js → GuiPluginWindow-DI08lit_.js} +1 -1
  25. package/dist/assets/{Icon-C1rjS64C.js → Icon-B4V3WArH.js} +1 -1
  26. package/dist/assets/{ImageLoadingPlaceholder-2hMqBtYh.js → ImageLoadingPlaceholder-DMofO0Vg.js} +1 -1
  27. package/dist/assets/{LoadingImage-Bs-621ZL.js → LoadingImage-BBXprBjU.js} +1 -1
  28. package/dist/assets/MarkdownRenderer-CspY638V.js +2 -0
  29. package/dist/assets/{MarkdownRendererImpl-DiCCNjDr.js → MarkdownRendererImpl-Be--gMMr.js} +1 -1
  30. package/dist/assets/{MarkstreamRendererImpl-Bzz3OZlX.js → MarkstreamRendererImpl-CYdjvap_.js} +1 -1
  31. package/dist/assets/{MobileAssistantSettingsPage-pBhJR2t6.js → MobileAssistantSettingsPage-CkwFKVXY.js} +1 -1
  32. package/dist/assets/{MobileAssistantTab-Ceo442NF.js → MobileAssistantTab-B3veLes8.js} +1 -1
  33. package/dist/assets/{MobileBtwPage-DPPmDMA6.js → MobileBtwPage-B3XErURE.js} +1 -1
  34. package/dist/assets/{MobileChangesSurface-DfDoSkTS.js → MobileChangesSurface-CRfHLy0W.js} +1 -1
  35. package/dist/assets/{MobileChatScreen-DHTbrnAr.js → MobileChatScreen-CFiiK55S.js} +1 -1
  36. package/dist/assets/{MobileDetailNavigation-e1u1y59T.js → MobileDetailNavigation-fIpP3zJ9.js} +1 -1
  37. package/dist/assets/{MobileFilesSurface-CJoqR3By.js → MobileFilesSurface-0u8kdqVE.js} +2 -2
  38. package/dist/assets/{MobileHtmlNetworkBoundary-GBhYVYvu.js → MobileHtmlNetworkBoundary-C3w-rvNJ.js} +2 -2
  39. package/dist/assets/{MobileOverlayPanel-DzKTKeZX.js → MobileOverlayPanel-DqVr7HoM.js} +1 -1
  40. package/dist/assets/{MobileResizableSheet-CkA7qhco.js → MobileResizableSheet-CmMITCRX.js} +1 -1
  41. package/dist/assets/{MobileSettingsTab-Bv0HsXFH.js → MobileSettingsTab-Bfoj6oZ9.js} +1 -1
  42. package/dist/assets/{MobileShareBridge-B-co2UPE.js → MobileShareBridge-DRywmiRN.js} +1 -1
  43. package/dist/assets/{MobileSurface-D63k27t5.js → MobileSurface-BveBoewm.js} +1 -1
  44. package/dist/assets/{MobileTabPageHeader-FmtbGhwq.js → MobileTabPageHeader-BKkxpg00.js} +1 -1
  45. package/dist/assets/{ModelLogo-CMnp5fyy.js → ModelLogo-BSDCUld6.js} +1 -1
  46. package/dist/assets/{ModelSelector-BF4wYwaz.js → ModelSelector-DcIUMkrC.js} +1 -1
  47. package/dist/assets/{MultiRunWindow-D0OU63re.js → MultiRunWindow-CC0gEHEt.js} +1 -1
  48. package/dist/assets/{OnboardingScreen-CDHtDQ0k.js → OnboardingScreen-CgYmkOnG.js} +1 -1
  49. package/dist/assets/{OverlayScrollbar-m1EAqRES.js → OverlayScrollbar-TqUMJujL.js} +1 -1
  50. package/dist/assets/{PierreDiffViewer-CZk1tZ3K.js → PierreDiffViewer-D5Q_DJ23.js} +1 -1
  51. package/dist/assets/{ProviderLogo-BqQTME35.js → ProviderLogo-Dh2oKu37.js} +1 -1
  52. package/dist/assets/{RemoteAssistantSessionCard-CrbCVhqD.js → RemoteAssistantSessionCard-BvR2QPyd.js} +1 -1
  53. package/dist/assets/{RemoteDesktopPanel-BzLmzmjb.js → RemoteDesktopPanel-CP_NZRqB.js} +1 -1
  54. package/dist/assets/{ScheduledTasksDialog-DmtcDZHc.js → ScheduledTasksDialog-BI5Y_mbe.js} +1 -1
  55. package/dist/assets/{ScrollableOverlay-CEglrXfm.js → ScrollableOverlay-DNBsKLrs.js} +1 -1
  56. package/dist/assets/SettingsGroup-DBUgdYyK.js +1 -0
  57. package/dist/assets/{SettingsView-CYEjDYWC.js → SettingsView-yDGWdErX.js} +5 -5
  58. package/dist/assets/{SettingsWindow-CvJsxUyu.js → SettingsWindow-tYCzlPbh.js} +1 -1
  59. package/dist/assets/{SetupTourDialog-DWaVtkY0.js → SetupTourDialog-DmVwOlaa.js} +1 -1
  60. package/dist/assets/{SyncActions-C0gph0P8.js → SyncActions-CIiH2YAa.js} +1 -1
  61. package/dist/assets/{TerminalView-Cm8Ts51w.js → TerminalView-s8qzyQ1U.js} +1 -1
  62. package/dist/assets/{TextSelectionMenu-Dcv_PdES.js → TextSelectionMenu-DV6-bozc.js} +1 -1
  63. package/dist/assets/{ToolOutputDialog-QJpQjmqK.js → ToolOutputDialog-AQRtLxWE.js} +1 -1
  64. package/dist/assets/{YuriLogo-BbS_Wj4g.js → YuriLogo-1yVZFnVN.js} +1 -1
  65. package/dist/assets/{assistantMessagePreview-wmP-d_oa.js → assistantMessagePreview-B1M5pz20.js} +1 -1
  66. package/dist/assets/{assistantQueries-Dpxq78yP.js → assistantQueries-CKIDS7If.js} +1 -1
  67. package/dist/assets/{auto-read-context-aRn5yhDb.js → auto-read-context-m-DSqlLf.js} +1 -1
  68. package/dist/assets/{capgoAdapter-BSnmtwX8.js → capgoAdapter-DSPS3fL5.js} +1 -1
  69. package/dist/assets/{card-aoveY4I3.js → card-DKTuTAht.js} +1 -1
  70. package/dist/assets/{chatUpwardIntent-WxxmOppY.js → chatUpwardIntent-D2Ay65Ri.js} +1 -1
  71. package/dist/assets/{checkbox-CljLXON1.js → checkbox-BDifu847.js} +1 -1
  72. package/dist/assets/{collapsible-DkeWKEAb.js → collapsible-Cv0Ew8UR.js} +1 -1
  73. package/dist/assets/{connection-hint-DsKyICgn.js → connection-hint-Dk_9Oxi7.js} +1 -1
  74. package/dist/assets/{context-menu-XuMa5TsA.js → context-menu-BjSM4m3u.js} +1 -1
  75. package/dist/assets/{diagram-DFv7Lh0h.js → diagram-Re1b4Drg.js} +1 -1
  76. package/dist/assets/{dialog-Cx20I73q.js → dialog-CSek_Z3q.js} +1 -1
  77. package/dist/assets/{dropdown-menu-XdfySbu2.js → dropdown-menu-D_C8_7Xw.js} +1 -1
  78. package/dist/assets/{es-CLAEdHpc.js → es-C1spVk4O.js} +1 -1
  79. package/dist/assets/{fileMentionTouchSelection-pXNTKHAc.js → fileMentionTouchSelection-DySVh4tf.js} +1 -1
  80. package/dist/assets/{fr-BOB0gfdQ.js → fr-yyP7Hlty.js} +1 -1
  81. package/dist/assets/{gitApi-LXGRaDt8.js → gitApi-Bz38D_S1.js} +1 -1
  82. package/dist/assets/{i18n-iu4pzqPi.js → i18n-Sh2Qk9nD.js} +1 -1
  83. package/dist/assets/{icons-BWijARKS.js → icons-Du1K-vJd.js} +1 -1
  84. package/dist/assets/{input-BMYgp87Q.js → input-C5gthyYl.js} +1 -1
  85. package/dist/assets/{insertionBoundaries-bmxIeFzH.js → insertionBoundaries-DYPFjCrm.js} +1 -1
  86. package/dist/assets/{ja-CfM9jZ6u.js → ja-ChftrfCh.js} +1 -1
  87. package/dist/assets/{kbd-6RW-BxuR.js → kbd-DzULFVDy.js} +1 -1
  88. package/dist/assets/{ko-DZOSVPHB.js → ko-BrLgX_6B.js} +1 -1
  89. package/dist/assets/{main-BLBAaohb.js → main-BKOh3bz9.js} +2 -2
  90. package/dist/assets/{main-B-Wdp6An.js → main-BXPRoPV7.js} +4 -4
  91. package/dist/assets/{markdownHeightCache-ojT5txMS.js → markdownHeightCache-DO3GzWD0.js} +1 -1
  92. package/dist/assets/{mcpQueries-BRuytwhB.js → mcpQueries-CCcPl38n.js} +1 -1
  93. package/dist/assets/{miniChat-BsrHy2rU.js → miniChat-ChjBS5lx.js} +2 -2
  94. package/dist/assets/{mobile-B8SHiXyq.js → mobile-B9Y1NmBW.js} +2 -2
  95. package/dist/assets/{mobileBackNavigation-CVrR_jtn.js → mobileBackNavigation-DbRzQPwl.js} +1 -1
  96. package/dist/assets/{mobileConnections-iSUwFNqu.js → mobileConnections-BtrjKVQ8.js} +2 -2
  97. package/dist/assets/{multirun-Y3K5yS-8.js → multirun-0sGmTbAW.js} +1 -1
  98. package/dist/assets/{native-config-tvqKHwCC.js → native-config-Di2EbpNU.js} +1 -1
  99. package/dist/assets/{nativeComposerCover-5rYz1E3W.js → nativeComposerCover-BQvSzlay.js} +1 -1
  100. package/dist/assets/{navigation-DFmCAq2g.js → navigation-By33kYra.js} +1 -1
  101. package/dist/assets/{openRemoteProjectSession-CeSahDtQ.js → openRemoteProjectSession-CtDnPbHy.js} +1 -1
  102. package/dist/assets/{openSessionFromDeepLink-DsZnNy4W.js → openSessionFromDeepLink-BI3ok38A.js} +2 -2
  103. package/dist/assets/{pl-CaT81Sz8.js → pl-DlKDQDhl.js} +1 -1
  104. package/dist/assets/{pluginPresentation-rls1AMJN.js → pluginPresentation-CWDQXAGY.js} +1 -1
  105. package/dist/assets/{pt-BR-9p1IKCEF.js → pt-BR-BldJPFQ5.js} +1 -1
  106. package/dist/assets/{pwa-BrLPfcLk.js → pwa-DY4ywKCC.js} +1 -1
  107. package/dist/assets/{queue-abort-optimistic-CXKdQu_T.js → queue-abort-optimistic-Deyot0Nr.js} +1 -1
  108. package/dist/assets/{quota-BhdKv_Wc.js → quota-jMPnmJTS.js} +1 -1
  109. package/dist/assets/{reference-history-Bzn-aPYg.js → reference-history-CH-irHvl.js} +1 -1
  110. package/dist/assets/{remoteSessionReference-DORvqUYQ.js → remoteSessionReference-BqNn5Ng9.js} +1 -1
  111. package/dist/assets/{renderElectronMiniChatApp-DXKgwBat.js → renderElectronMiniChatApp-DdDxtINC.js} +2 -2
  112. package/dist/assets/{renderMobileApp-CKN6rWxR.js → renderMobileApp-B3MU9lvz.js} +4 -4
  113. package/dist/assets/{runtimeConfig-BqUZF6Wt.js → runtimeConfig-Cq1eathE.js} +1 -1
  114. package/dist/assets/{runtimeEndpointReset-Bu02gAs3.js → runtimeEndpointReset-7jsAdYmA.js} +2 -2
  115. package/dist/assets/{select-BPIsJWhM.js → select-BXiRJQfM.js} +1 -1
  116. package/dist/assets/{sessionLookup-DZhrkKRI.js → sessionLookup-EXBDKdL9.js} +1 -1
  117. package/dist/assets/{sessionOwnership-LoUNVeuJ.js → sessionOwnership-DGgtXHNT.js} +1 -1
  118. package/dist/assets/{shortcuts-DMupfl7l.js → shortcuts-BF4EX_Rx.js} +1 -1
  119. package/dist/assets/{sortable-tabs-strip-1bKw81VO.js → sortable-tabs-strip-CmCxOwOO.js} +1 -1
  120. package/dist/assets/{speechSettingsQueries-C3JgzCqy.js → speechSettingsQueries-ClTsMdAi.js} +1 -1
  121. package/dist/assets/src-B7qham90.css +2 -0
  122. package/dist/assets/{store-BgsgBTwJ.js → store-BGuutgkJ.js} +3 -3
  123. package/dist/assets/{switch-B4-v9kvg.js → switch-DaczlfD6.js} +1 -1
  124. package/dist/assets/{textarea-DExmj0ZR.js → textarea-BMiRyX6F.js} +1 -1
  125. package/dist/assets/{timeFormat-BlSO2-ws.js → timeFormat-BaiPCZgf.js} +1 -1
  126. package/dist/assets/{tooltip-Di-WRJUZ.js → tooltip-D5wqtxlx.js} +1 -1
  127. package/dist/assets/{truncated-path-nKzykV5p.js → truncated-path-DwHONVyA.js} +1 -1
  128. package/dist/assets/types-BjDNwP80.js +2 -0
  129. package/dist/assets/{ui-BCYkB585.js → ui-B57gL0cH.js} +6 -6
  130. package/dist/assets/{uk-BUSl_Y_1.js → uk-Cw2L_unr.js} +1 -1
  131. package/dist/assets/{useAppFontEffects-BCJPQstm.js → useAppFontEffects-C1DyabMJ.js} +2 -2
  132. package/dist/assets/{useDesktopWindowControlsLayout-BtpyMlOS.js → useDesktopWindowControlsLayout-BS_7xRdK.js} +1 -1
  133. package/dist/assets/{useDictation-4HBMkISY.js → useDictation-83-qDgkn.js} +1 -1
  134. package/dist/assets/{useEffectiveDirectory-BYswRwIv.js → useEffectiveDirectory-BVSvX0gR.js} +1 -1
  135. package/dist/assets/{useGitStore-DqBPgmf-.js → useGitStore-D5j-CYlL.js} +1 -1
  136. package/dist/assets/{useInlineCommentDraftStore-CGJ6dM8d.js → useInlineCommentDraftStore-CvSDMS3T.js} +1 -1
  137. package/dist/assets/{useMcpConfigStore-DEcxFuzW.js → useMcpConfigStore-BCol_XdF.js} +1 -1
  138. package/dist/assets/{useMobileSwipeActions-DqlR4X-T.js → useMobileSwipeActions-Clqu20Uf.js} +1 -1
  139. package/dist/assets/{useMobileTranscriptSyncHint-BDKcqtq_.js → useMobileTranscriptSyncHint-DkwUC5sr.js} +1 -1
  140. package/dist/assets/{useModelLists-DsFTBlMr.js → useModelLists-BfC2IQwO.js} +1 -1
  141. package/dist/assets/{useOpenCodeReadiness-CHybAoBh.js → useOpenCodeReadiness-BHY0hseI.js} +1 -1
  142. package/dist/assets/{usePluginsStore-BIBHPK4A.js → usePluginsStore-CP3eeHCz.js} +1 -1
  143. package/dist/assets/{useProjectGitActions-DeFcqi_O.js → useProjectGitActions-B8Frm8fF.js} +1 -1
  144. package/dist/assets/{useProjectGitStore-JGZk-NCk.js → useProjectGitStore-CqjQngOX.js} +1 -1
  145. package/dist/assets/{useProjectRuntimeAPIs-BMBBtJB-.js → useProjectRuntimeAPIs-Co1VAzSK.js} +1 -1
  146. package/dist/assets/{useQuotaStore-C3qJTiD7.js → useQuotaStore-CHxR2ZkD.js} +1 -1
  147. package/dist/assets/{useSessionBtwStore-D7P-pknd.js → useSessionBtwStore-CZ0QND4b.js} +1 -1
  148. package/dist/assets/{useStreamingTextThrottle-CjWAE0oQ.js → useStreamingTextThrottle-D19Dm3W6.js} +1 -1
  149. package/dist/assets/{worktreeManager-pRvX5dQT.js → worktreeManager-nlQu_BbV.js} +1 -1
  150. package/dist/assets/{worktreeSourceBranchPreference-B7d3RYcc.js → worktreeSourceBranchPreference-BGrLknHI.js} +1 -1
  151. package/dist/assets/{zh-CN-BGKgQtWd.js → zh-CN-BQXjCmNe.js} +1 -1
  152. package/dist/assets/{zh-TW-jM5lIKfe.js → zh-TW-Y0lErpEY.js} +1 -1
  153. package/dist/index.html +6 -6
  154. package/dist/mini-chat.html +6 -6
  155. package/dist/mobile.html +2 -2
  156. package/package.json +1 -1
  157. package/server/lib/relay/DOCUMENTATION.md +1 -1
  158. package/server/lib/relay/relay-server.e2e.test.ts +12 -0
  159. package/server/lib/ui-auth/DOCUMENTATION.md +1 -1
  160. package/server/lib/ui-auth/ui-auth.js +2 -0
  161. package/server/lib/ui-auth/ui-auth.test.js +20 -1
  162. package/dist/assets/MarkdownRenderer-BZl_T1ng.js +0 -2
  163. package/dist/assets/SettingsGroup-Bm-l3IIs.js +0 -1
  164. package/dist/assets/src-BacdFOCS.css +0 -2
  165. package/dist/assets/types-4xeqxklF.js +0 -2
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{I as t}from"./platform-B2ylz14u.js";import{a as n,r}from"./vendor-zustand-CTekDqaS.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{St as o}from"./gitApiHttp-ZjM4HkSo.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{_t as s,ft as c,n as l}from"./client-CmtAKi5B.js";import{n as u}from"./vendor-react-BkccXcWz.js";import{R as d}from"./runtime-file-resource-BGZ4tGr5.js";import{r as f}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as p}from"./useUIStore-68ZPpgYA.js";import{Ha as m,Ii as h,Xn as g,Zi as _,ao as v,ca as y,d as b,f as x,hi as S,ii as C,io as w,ni as T,oi as E,t as D,ua as O}from"./ui-BCYkB585.js";import{n as k}from"./Icon-C1rjS64C.js";import{c as A,t as ee}from"./i18n-iu4pzqPi.js";import{n as te}from"./ScrollableOverlay-CEglrXfm.js";import{i as j,n as M,t as ne}from"./tooltip-Di-WRJUZ.js";import{a as re}from"./device-TCHW5U2y.js";import{n as ie,r as ae,t as oe}from"./collapsible-DkeWKEAb.js";import{t as se}from"./textarea-DExmj0ZR.js";import{t as ce}from"./gitApi-LXGRaDt8.js";import{c as N,i as P,n as F,r as I,s as L}from"./useGitStore-DqBPgmf-.js";import{t as R}from"./input-BMYgp87Q.js";import{t as le}from"./checkbox-CljLXON1.js";import{a as ue,c as z,r as B}from"./insertionBoundaries-bmxIeFzH.js";import{t as V}from"./ModelLogo-CMnp5fyy.js";import{n as H,t as de}from"./useModelLists-DsFTBlMr.js";import{a as U,c as fe,i as W,n as pe,o as G,r as K,s as me,t as he}from"./select-BPIsJWhM.js";import{s as q}from"./worktreeManager-pRvX5dQT.js";import{a as J,i as Y,n as ge,t as _e}from"./worktreeSourceBranchPreference-B7d3RYcc.js";import{a as ve,i as ye,n as be}from"./projectMeta-vIaGFaQr.js";var X=e(a(),1),xe=u(),Se=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Ce=/^g[1-9]\d*$/,Z=(e,t,n,r,i)=>{if(!Se.test(e)||t!==void 0&&!Ce.test(t)||!n?.trim()||!r?.trim()||n!==n.trim()||r!==r.trim())return null;if(i===void 0)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!1};if(i===`fusion`)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!0};if(!/^\d+$/.test(i))return null;let a=Number.parseInt(i,10);return!Number.isSafeInteger(a)||a<=0?null:{groupSlug:e,runGroup:t,providerID:n,modelID:r,index:a,fusion:!1}},we=e=>{if(!e)return null;let t=e.split(`/`);if(t.length<3||t.length>5)return null;let[n]=t;if(t.length===3)return Z(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Ce.test(e)?Z(n,e,r,i,void 0):Z(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?Z(n,void 0,i,a,o):Z(n,r,i,a,o)},Te=e=>{let t=[e.groupSlug];return e.runGroup&&t.push(e.runGroup),t.push(e.providerID,e.modelID),e.index!==void 0&&t.push(String(e.index)),t.join(`/`)},Q=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Ee=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),De=(e,t)=>`${Ee(e)}-${Ee(t)}`.substring(0,60),Oe=(e,t)=>`${e}/${t}`,ke=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Ae=(e,t)=>{let n=ke(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};s(e.id,n),x.getState().markSessionAsYuriCreated(e.id),h.getState().upsertSession(i);try{c().ensureChild(n,{bootstrap:!1}).setState(t=>{let n=t.session.findIndex(t=>t.id===e.id);if(n>=0&&t.session[n]===i)return t;let r=n>=0?t.session.map((e,t)=>t===n?i:e):[...t.session,i].sort((e,t)=>e.id.localeCompare(t.id));return{session:r,sessionTotal:Math.max(t.sessionTotal,r.length),limit:Math.max(t.limit,r.length)}})}catch{}return i},je=()=>{let e=m.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Me=n()(r(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let s=je();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let c=s.path,u=await ce(c)&&t.isolateRuns!==!1,d=Ee(n),f=u?await q(c):void 0,p=u?await J(c):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let g of n.models){let n=`${g.providerID}:${g.modelID}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=De(g.providerID,g.modelID),b=r.length>1?`g${e+1}`:void 0,w=_>1?Oe(d,`${y}/${v}`):Oe(d,y),T=b?`${b}/${w}`:w,E=Te({groupSlug:d,runGroup:b,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await l.withDirectory(c,()=>l.createSession({title:E}));Ae(e,c),m.push({sessionId:e.id,worktreePath:c,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await Y(s,{preferredName:T,mode:`new`,branchName:T,worktreeName:T,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await C(s)&&await S(e.worktreeRoot??e.path);let r=await l.withDirectory(e.path,()=>l.createSession({title:E}));Ae(r,e.path),x.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let g=o?.filter(e=>e.trim().length>0)??[];g.length>0&&E(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),v=m[0]?.sessionId??null;if(_.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let y=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(m.map(async e=>{try{await b({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:y})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:_,firstSessionId:v}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),$=i(),Ne=`h-7`,Pe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Fe=e=>{let t=(0,xe.c)(13),{model:n,instanceIndex:r,totalSameModel:i,onRemove:a}=e,o=n.displayName||`${n.providerID}/${n.modelID}`,s=i>1?`${o} (${r})`:o,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=w(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Ne),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(V,{modelId:n.modelID,providerId:n.providerID,className:`h-3.5 w-3.5`}),t[1]=n.modelID,t[2]=n.providerID,t[3]=l):l=t[3];let u;t[4]===s?u=t[5]:(u=(0,$.jsx)(`span`,{className:`typography-meta font-medium truncate max-w-[140px]`,children:s}),t[4]=s,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(k,{name:`close`,className:`h-3.5 w-3.5`}),t[6]=d):d=t[6];let f;t[7]===a?f=t[8]:(f=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,children:d}),t[7]=a,t[8]=f);let p;return t[9]!==l||t[10]!==u||t[11]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},Ie=e=>{let t=(0,xe.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:u,dropdownSide:d,dropdownClassName:f,containerClassName:m,triggerIcon:h}=e,v=c===void 0||c,y=d===void 0?`top`:d,{t:b}=ee(),x=_(Le),S=_(Re),C=p(ze),T=p(Be),{favoriteModelsList:E,recentModelsList:D}=de(),A=p(Ve),te=p(He),[j,M]=X.useState(!1),[ne,re]=X.useState(``),[ie,ae]=X.useState(null),oe=X.useRef(null),se=X.useRef(null),ce=l===1,N=l===void 0||n.length<l||ce,P;if(t[0]!==n){P=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;P.set(t,(P.get(t)||0)+1)}t[0]=n,t[1]=P}else P=t[1];let F=P,I;t[2]===n?I=t[3]:(I=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=I);let L=I,R,le;t[4]!==y||t[5]!==j?(R=()=>{if(!j||!se.current)return;let e=se.current.getBoundingClientRect();if(y===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ae(Math.max(160,Math.min(320,t)));return}let t=se.current.parentElement;for(;t&&!(t.getAttribute(`role`)===`dialog`||t.hasAttribute(`data-scroll-shadow`));){let e=getComputedStyle(t);if(e.overflow===`auto`||e.overflow===`hidden`||e.overflowY===`auto`||e.overflowY===`hidden`)break;t=t.parentElement}let n=t?t.getBoundingClientRect().top:0,r=e.top-n-16;ae(Math.max(150,Math.min(300,r)))},le=[y,j],t[4]=y,t[5]=j,t[6]=R,t[7]=le):(R=t[6],le=t[7]),X.useEffect(R,le);let ue,z;t[8]!==N||t[9]!==j?(ue=()=>{!N&&j&&(M(!1),re(``))},z=[N,j],t[8]=N,t[9]=j,t[10]=ue,t[11]=z):(ue=t[10],z=t[11]),X.useEffect(ue,z);let B,V;t[12]===j?(B=t[13],V=t[14]):(B=()=>{if(!j)return;let e=e=>{oe.current&&!oe.current.contains(e.target)&&(M(!1),re(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[j],t[12]=j,t[13]=B,t[14]=V),X.useEffect(B,V);let U;t[15]!==ce||t[16]!==r||t[17]!==a||t[18]!==n.length?(U=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:O(e.model,e.modelID)||e.modelID,instanceId:Pe()};ce&&n.length>0&&a?a(0,t):r(t),ce&&(M(!1),re(``))},t[15]=ce,t[16]=r,t[17]=a,t[18]=n.length,t[19]=U):U=t[19];let G=U,K;t[20]===b?K=t[21]:(K=b(`multirun.modelMultiSelect.search.placeholder`),t[20]=b,t[21]=K);let q;t[22]===b?q=t[23]:(q=b(`multirun.modelMultiSelect.search.noResults`),t[22]=b,t[23]=q);let J;t[24]===b?J=t[25]:(J=b(`multirun.modelMultiSelect.sections.favorites`),t[24]=b,t[25]=J);let Y;t[26]===b?Y=t[27]:(Y=b(`multirun.modelMultiSelect.sections.recent`),t[26]=b,t[27]=Y);let ge;t[28]===b?ge=t[29]:(ge=b(`multirun.modelMultiSelect.keyboard.hint`),t[28]=b,t[29]=ge);let _e;t[30]===b?_e=t[31]:(_e=b(`settings.agents.modelSelector.actions.favorite`),t[30]=b,t[31]=_e);let ve;t[32]===b?ve=t[33]:(ve=b(`settings.agents.modelSelector.actions.unfavorite`),t[32]=b,t[33]=ve);let ye;t[34]===b?ye=t[35]:(ye=b(`chat.modelControls.provider`),t[34]=b,t[35]=ye);let be;t[36]===b?be=t[37]:(be=b(`chat.modelControls.capabilities`),t[36]=b,t[37]=be);let Se;t[38]===b?Se=t[39]:(Se=b(`chat.modelControls.capability.toolCalling`),t[38]=b,t[39]=Se);let Ce;t[40]===b?Ce=t[41]:(Ce=b(`chat.modelControls.capability.reasoning`),t[40]=b,t[41]=Ce);let Z;t[42]===b?Z=t[43]:(Z=b(`chat.modelControls.modality.image`),t[42]=b,t[43]=Z);let we;t[44]===b?we=t[45]:(we=b(`chat.modelControls.modality.video`),t[44]=b,t[45]=we);let Te;t[46]===b?Te=t[47]:(Te=b(`chat.modelControls.modality.audio`),t[46]=b,t[47]=Te);let Q;t[48]===b?Q=t[49]:(Q=b(`chat.modelControls.costPerMillion`),t[48]=b,t[49]=Q);let Ee;t[50]===b?Ee=t[51]:(Ee=b(`chat.modelControls.costInput`),t[50]=b,t[51]=Ee);let De;t[52]===b?De=t[53]:(De=b(`chat.modelControls.costOutput`),t[52]=b,t[53]=De);let Oe;t[54]!==K||t[55]!==q||t[56]!==J||t[57]!==Y||t[58]!==ge||t[59]!==_e||t[60]!==ve||t[61]!==ye||t[62]!==be||t[63]!==Se||t[64]!==Ce||t[65]!==Z||t[66]!==we||t[67]!==Te||t[68]!==Q||t[69]!==Ee||t[70]!==De?(Oe={searchPlaceholder:K,noResults:q,favorites:J,recent:Y,keyboardHint:ge,favorite:_e,unfavorite:ve,provider:ye,capabilities:be,capabilityToolCalling:Se,capabilityReasoning:Ce,modalityImage:Z,modalityVideo:we,modalityAudio:Te,costPerMillion:Q,costInput:Ee,costOutput:De},t[54]=K,t[55]=q,t[56]=J,t[57]=Y,t[58]=ge,t[59]=_e,t[60]=ve,t[61]=ye,t[62]=be,t[63]=Se,t[64]=Ce,t[65]=Z,t[66]=we,t[67]=Te,t[68]=Q,t[69]=Ee,t[70]=De,t[71]=Oe):Oe=t[71];let ke=Oe,Ae;t[72]===m?Ae=t[73]:(Ae=w(`relative`,m),t[72]=m,t[73]=Ae);let je;t[74]===u?je=t[75]:(je=w(Ne,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,u),t[74]=u,t[75]=je);let Me=!N,Ie;t[76]===j?Ie=t[77]:(Ie=()=>{M(!j)},t[76]=j,t[77]=Ie);let We;t[78]===h?We=t[79]:(We=h??(0,$.jsx)(k,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=h,t[79]=We);let Ge;t[80]!==s||t[81]!==b?(Ge=s??b(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=b,t[82]=Ge):Ge=t[82];let Ke;t[83]!==je||t[84]!==Me||t[85]!==Ie||t[86]!==We||t[87]!==Ge?(Ke=(0,$.jsxs)(g,{ref:se,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ie,children:[We,Ge]}),t[83]=je,t[84]=Me,t[85]=Ie,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==ie||t[90]!==N||t[91]!==f||t[92]!==y||t[93]!==E||t[94]!==S||t[95]!==G||t[96]!==A||t[97]!==T||t[98]!==j||t[99]!==ke||t[100]!==F||t[101]!==te||t[102]!==x||t[103]!==D||t[104]!==ne||t[105]!==C?(qe=j?(0,$.jsx)(`div`,{className:w(`absolute left-0 z-50 w-[min(420px,calc(100vw-2rem))] max-w-[calc(100vw-2rem)] flex flex-col overflow-hidden rounded-xl border border-border/50 shadow-lg`,y===`top`?`bottom-full mb-1`:`top-full mt-1`,f),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(H,{providers:x,providerOrder:te,favoriteModels:E,recentModels:D,getMetadata:S,hiddenModels:A,searchQuery:ne,onSearchQueryChange:re,onSelect:G,labels:ke,selectionCount:e=>F.get(`${e.providerID}:${e.modelID}`)||0,disabled:!N,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:ie?`${ie}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:j,isFavorite:e=>T(e.providerID,e.modelID),onToggleFavorite:e=>C(e.providerID,e.modelID),onEscape:()=>{M(!1),re(``)}})}):null,t[89]=ie,t[90]=N,t[91]=f,t[92]=y,t[93]=E,t[94]=S,t[95]=G,t[96]=A,t[97]=T,t[98]=j,t[99]=ke,t[100]=F,t[101]=te,t[102]=x,t[103]=D,t[104]=ne,t[105]=C,t[106]=qe):qe=t[106];let Je;t[107]!==Ae||t[108]!==Ke||t[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:oe,children:[Ke,qe]}),t[107]=Ae,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==L||t[112]!==F||t[113]!==i||t[114]!==a||t[115]!==x||t[116]!==n||t[117]!==v||t[118]!==b?(Ye=v&&n.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=F.get(n)||1,o=L(e),s=x.find(t=>t.id===e.providerID)?.models?.find(t=>t.id===e.modelID),c=s?.variants?Object.keys(s.variants):[],l=c.length>0,u=e.variant??`__default__`;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Fe,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,$.jsxs)(he,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,$.jsxs)(me,{size:`chip`,className:`px-2 gap-1.5 rounded-md !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 typography-meta font-medium text-foreground`,children:[(0,$.jsx)(k,{name:`brain-ai-3`,className:w(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(fe,{placeholder:b(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?b(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(pe,{fitContent:!0,children:[(0,$.jsx)(W,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:b(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=L,t[112]=F,t[113]=i,t[114]=a,t[115]=x,t[116]=n,t[117]=v,t[118]=b,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),t[120]=Je,t[121]=Ye,t[122]=Xe):Xe=t[122];let Ze;t[123]!==l||t[124]!==o||t[125]!==n.length||t[126]!==b?(Ze=o!==void 0&&n.length<o&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?b(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):b(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=b,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),t[128]=Xe,t[129]=Ze,t[130]=Qe):Qe=t[130],Qe};function Le(e){return e.providers}function Re(e){return e.getModelMetadata}function ze(e){return e.toggleFavoriteModel}function Be(e){return e.isFavoriteModel}function Ve(e){return e.hiddenModels}function He(e){return e.providerOrder}function Ue(e){return(0,$.jsx)(W,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,xe.c)(30),{git:n}=d(),r=F(e),i=N(e),a=P(e),o=I(e),s=L(Ye),c=L(Je),l,u;t[0]!==e||t[1]!==c||t[2]!==n||t[3]!==i||t[4]!==a?(l=()=>{!e||!n||i!==null||a||c(e,n,{silent:!0})},u=[e,n,c,i,a],t[0]=e,t[1]=c,t[2]=n,t[3]=i,t[4]=a,t[5]=l,t[6]=u):(l=t[5],u=t[6]),X.useEffect(l,u);let f;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(f=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=f):f=t[12];let p=r?.all,m;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==p?(m=[e,n,i,p,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=p,t[18]=m):m=t[18],X.useEffect(f,m);let h=a||i===!0&&o,g;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],g=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),g=e}let _=g,v;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],v=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),v=e}let y=v,b;bb2:{if(!e){b=null;break bb2}if(i!==null){b=i;break bb2}if(h){b=null;break bb2}b=r?.all?!0:null}let x=b,S;return t[25]!==x||t[26]!==h||t[27]!==_||t[28]!==y?(S={localBranches:_,remoteBranches:y,isLoading:h,isGitRepository:x},t[25]=x,t[26]=h,t[27]=_,t[28]=y,t[29]=S):S=t[29],S}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=ee(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(e),d=X.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return X.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await q(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(_e),{sourceBranch:o,shouldClearSavedSourceBranch:s}=ge({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(_e),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(he,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(me,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(fe,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(pe,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.loadingBranches`)}):s.length===0&&c.length===0?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,$.jsxs)($.Fragment,{children:[s.length>0&&(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(W,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(G,{}),c.length>0&&(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(W,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},Ze=e=>{let t=(0,xe.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=ee(),l=_(Qe),u=_($e),d=_(et),f;t[0]===l?f=t[1]:(f=l(),t[0]=l,t[1]=f);let p=f,m;t[2]===p?m=t[3]:(m=p.filter(tt),t[2]=p,t[3]=m);let h=m,g,v;t[4]!==p.length||t[5]!==u?(g=()=>{p.length===0&&u()},v=[p.length,u],t[4]=p.length,t[5]=u,t[6]=g,t[7]=v):(g=t[6],v=t[7]),X.useEffect(g,v);let y,b;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==h||t[12]!==n?(y=()=>{if(a)return;let e=n.trim();if(e.length>0&&h.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&h.some(e=>e.name===t)){r(t);return}let i=h[0]?.name;i&&r(i)},b=[d,a,r,h,n],t[8]=d,t[9]=a,t[10]=r,t[11]=h,t[12]=n,t[13]=y,t[14]=b):(y=t[13],b=t[14]),X.useEffect(y,b);let x=n.trim().length>0?n:void 0,S;t[15]===i?S=t[16]:(S=w(`max-w-full typography-meta text-foreground !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 data-[popup-open]:!bg-[var(--interactive-active)]/70`,i),t[15]=i,t[16]=S);let C;t[17]===c?C=t[18]:(C=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=C);let T;t[19]===C?T=t[20]:(T=(0,$.jsx)(fe,{placeholder:C}),t[19]=C,t[20]=T);let E;t[21]!==o||t[22]!==S||t[23]!==T?(E=(0,$.jsx)(me,{id:o,size:`lg`,className:S,children:T}),t[21]=o,t[22]=S,t[23]=T,t[24]=E):E=t[24];let D;t[25]===h?D=t[26]:(D=h.length>0&&(0,$.jsx)(K,{children:h.map(nt)}),t[25]=h,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(pe,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let k;return t[30]!==a||t[31]!==r||t[32]!==x||t[33]!==E||t[34]!==O?(k=(0,$.jsxs)(he,{value:x,onValueChange:r,disabled:a,children:[E,O]}),t[30]=a,t[31]=r,t[32]=x,t[33]=E,t[34]=O,t[35]=k):k=t[35],k};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return y(e.mode)}function nt(e){return(0,$.jsx)(W,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var rt=10485760,it=5,at=e=>{let t=(0,xe.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground transition-colors`,children:(0,$.jsx)(k,{name:`information`,className:`h-3.5 w-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(ne,{children:[r,(0,$.jsx)(M,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,xe.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,$.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`}),t[0]=r,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==o?(s=(0,$.jsxs)(`label`,{htmlFor:n,className:`typography-meta font-medium text-foreground`,children:[i,o]}),t[2]=i,t[3]=n,t[4]=o,t[5]=s):s=t[5];let c=a&&a,l;return t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l},st=e=>{let t=v(e.path),n=e.icon?ye[e.icon]:null,r=e.color?be[e.color]:void 0,i=(0,$.jsx)(k,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`relative top-px flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(ve,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=ee(),[s,c]=X.useState(``),[l,u]=X.useState(()=>[{id:Pe(),prompt:``,models:[]}]),[d,p]=X.useState(``),[h,_]=X.useState([]),[v,y]=X.useState(!1),[b,S]=X.useState([]),[C,E]=X.useState(!1),[O,se]=X.useState(!1),[ce,N]=X.useState(!0),P=X.useRef(null),F=o(e=>e.currentDirectory??null),I=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__VSCODE_CONFIG__?.workspaceFolder;return typeof e==`string`&&e.trim().length>0?e.trim():null},[]),L=m(e=>e.activeProjectId),ue=m(e=>e.setActiveProjectIdOnly),z=m(e=>e.projects),[B,V]=X.useState(()=>L??null);X.useEffect(()=>{if(L){V(L);return}!B&&z.length>0&&V(z[0].id)},[L,z,B]);let H=X.useMemo(()=>B?z.find(e=>e.id===B)??null:null,[z,B]),de=H?.path??F,U=f(e=>{V(e),e!==L&&ue(e)}),G=X.useMemo(()=>{if(H?.path)return{id:H.id,path:H.path};let e=F??I;return e?{id:`path:${e}`,path:e}:null},[H,F,I]),[K]=X.useState(()=>typeof window<`u`&&t()),q=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),J=re(),Y=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__YURI_MACOS_MAJOR__;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;if(typeof navigator>`u`)return null;let t=(navigator.userAgent||``).match(/Mac OS X (\d+)[._](\d+)/);if(!t)return null;let n=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);return Number.isNaN(n)?null:n===10?r:n},[]),ge=X.useMemo(()=>K&&q||J?`pl-[5.5rem]`:`pl-3`,[K,q,J]),_e=X.useMemo(()=>!K||!q||Y===null?``:Y>=26?`h-12`:Y<=15?`h-14`:``,[K,q,Y]),ve=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&K&&await A()}),ye=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),be=!!r;X.useEffect(()=>{if(be)return window.addEventListener(`keydown`,ye,!0),()=>window.removeEventListener(`keydown`,ye,!0)},[be]);let[xe,Se]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=We(de),we=X.useRef(!1),Te=Z===!0,Q=Te&&ce;X.useEffect(()=>{if(Z===!1){we.current=!0,N(!1);return}Z===!0&&we.current&&(we.current=!1,N(!0))},[Z]);let Ee=Me(e=>e.createMultiRun),De=Me(e=>e.error),Oe=Me(e=>e.clearError);X.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&u(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),X.useEffect(()=>{if(!G)return;let e=!1;return se(!0),(async()=>{try{let t=await T(G);e||S(t)}catch{}finally{e||se(!1)}})(),()=>{e=!0}},[G]);let ke=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=f(e=>{u(t=>t.filter(t=>t.id!==e))}),je=f(()=>{u(e=>[...e,{id:Pe(),prompt:``,models:[]}])}),Ne=async e=>{let t=e.target.files;if(!t)return;let n=0;for(let e=0;e<t.length;e++){let r=t[e];if(r.size>rt){D.error(a(`multirun.launcher.toast.fileTooLarge`,{fileName:r.name}));continue}try{let e=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)});_(t=>[...t,{id:Pe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),D.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&D.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),P.current&&(P.current.value=``)},Fe=e=>{_(t=>t.filter(t=>t.id!==e))},Ie=X.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let t=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(t.length!==0&&!(Ie<1)){y(!0),Oe();try{B&&B!==L&&ue(B);let e=h.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=b.filter(e=>e.trim().length>0),i=t.map(e=>({prompt:e.prompt.trim(),models:e.models.map(e=>({providerID:e.providerID,modelID:e.modelID,displayName:e.displayName,variant:e.variant}))})),a={name:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Q?xe:void 0,isolateRuns:Q,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await Ee(a);o&&(o.firstSessionId&&x.getState().setCurrentSession(o.firstSessionId),n?.())}finally{y(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Ie>=1&&de&&!Ce&&(Z===!1||!Q||xe)),ze=b.filter(e=>e.trim()).length;return(0,$.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,$.jsxs)(`header`,{onMouseDown:ve,className:w(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,ge,_e),style:{borderColor:`var(--interactive-border)`},children:[(0,$.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,$.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,$.jsxs)(ne,{children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`multirun.launcher.actions.closeEsc`),className:`inline-flex h-9 w-9 items-center justify-center p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary app-region-no-drag`,children:(0,$.jsx)(k,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(M,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(te,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),z.length>0?(0,$.jsxs)(he,{value:B??void 0,onValueChange:U,children:[(0,$.jsx)(me,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:H?(0,$.jsx)(fe,{children:st(H)}):(0,$.jsx)(fe,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(pe,{fitContent:!0,children:z.map(e=>(0,$.jsx)(W,{value:e.id,className:`max-w-[24rem]`,children:st(e)},e.id))})]}):(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(R,{id:`group-name`,value:s,onChange:e=>c(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Xe,{directory:de,value:xe,onChange:Se,disabled:!Q,id:`multirun-worktree-base-branch`}),(0,$.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(le,{checked:ce,onChange:N,disabled:!Te,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,$.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-agent`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)(Ze,{value:d,onChange:p,id:`multirun-agent`})]})]}),(0,$.jsxs)(oe,{open:C,onOpenChange:E,children:[(0,$.jsxs)(ae,{className:`w-full flex items-center gap-2 py-1.5 px-2 -mx-2 rounded-lg hover:bg-[var(--interactive-hover)]/50 transition-colors group`,children:[(0,$.jsx)(k,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,$.jsx)(`span`,{className:`typography-meta font-medium text-muted-foreground group-hover:text-foreground transition-colors`,children:a(`multirun.launcher.setupCommands.label`)}),ze>0&&(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center h-4 min-w-4 px-1 rounded-full typography-micro font-medium`,style:{backgroundColor:`var(--primary-base)`,color:`var(--primary-foreground)`,fontSize:`0.625rem`,lineHeight:1},children:ze}),(0,$.jsx)(k,{name:`arrow-down-s`,className:w(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,C&&`rotate-180`)})]}),(0,$.jsx)(ie,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:O?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[b.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(R,{value:e,onChange:e=>{let n=[...b];n[t]=e.target.value,S(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>S(b.filter((e,n)=>n!==t)),className:`flex-shrink-0 flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,"aria-label":a(`multirun.launcher.setupCommands.removeCommandAria`),children:(0,$.jsx)(k,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S([...b,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(k,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(ot,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`input`,{ref:P,type:`file`,multiple:!0,className:`hidden`,onChange:Ne,accept:`*/*`}),(0,$.jsxs)(ne,{children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>P.current?.click(),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md typography-micro text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(k,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(M,{children:a(`multirun.launcher.attachments.tooltip`)})]}),h.map(e=>(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md typography-micro border`,style:{backgroundColor:`var(--surface-elevated)`,borderColor:`var(--interactive-border)`},children:[e.mimeType.startsWith(`image/`)?(0,$.jsx)(k,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(k,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Fe(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(k,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(lt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:ke,onRemove:Ae},e.id)),(0,$.jsxs)(`button`,{type:`button`,onClick:je,className:`flex items-center gap-1.5 py-2 px-3 -mx-3 rounded-lg typography-meta font-medium text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(k,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),De&&(0,$.jsx)(`div`,{className:`px-3 py-2 rounded-lg typography-meta`,style:{backgroundColor:`var(--status-error-background)`,color:`var(--status-error)`,borderWidth:1,borderColor:`var(--status-error-border)`},children:De})]})})}),(0,$.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Q&&Z!==null?(0,$.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(k,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(g,{type:`submit`,size:`sm`,disabled:!Re||v,children:v?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Ie})})})]})})]})},lt=e=>{let t=(0,xe.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=ee(),[c,l]=X.useState(!1),[u,d]=X.useState(``),[p,m]=X.useState(!1),[h,g]=X.useState(``),_=X.useRef(null),v=X.useRef(null),y=X.useRef(null),b;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(b=e=>{n.models.length>=it||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=b):b=t[3];let x=f(b),S;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(S=e=>{a(n.id,{models:n.models.filter((t,n)=>n!==e)})},t[4]=n.id,t[5]=n.models,t[6]=a,t[7]=S):S=t[7];let C=f(S),w;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(w=(e,t)=>{a(n.id,{models:n.models.map((n,r)=>r===e?t:n)})},t[8]=n.id,t[9]=n.models,t[10]=a,t[11]=w):w=t[11];let T=f(w),E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{I as t}from"./platform-B2ylz14u.js";import{a as n,r}from"./vendor-zustand-CTekDqaS.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{St as o}from"./gitApiHttp-ZjM4HkSo.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{_t as s,ft as c,n as l}from"./client-CmtAKi5B.js";import{n as u}from"./vendor-react-BkccXcWz.js";import{R as d}from"./runtime-file-resource-BGZ4tGr5.js";import{r as f}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as p}from"./useUIStore-68ZPpgYA.js";import{Ha as m,Ii as h,Xn as g,Zi as _,ao as v,ca as y,d as b,f as x,hi as S,ii as C,io as w,ni as T,oi as E,t as D,ua as O}from"./ui-B57gL0cH.js";import{n as k}from"./Icon-B4V3WArH.js";import{c as A,t as ee}from"./i18n-Sh2Qk9nD.js";import{n as te}from"./ScrollableOverlay-DNBsKLrs.js";import{i as j,n as M,t as ne}from"./tooltip-D5wqtxlx.js";import{a as re}from"./device-TCHW5U2y.js";import{n as ie,r as ae,t as oe}from"./collapsible-Cv0Ew8UR.js";import{t as se}from"./textarea-BMiRyX6F.js";import{t as ce}from"./gitApi-Bz38D_S1.js";import{c as N,i as P,n as F,r as I,s as L}from"./useGitStore-D5j-CYlL.js";import{t as R}from"./input-C5gthyYl.js";import{t as le}from"./checkbox-BDifu847.js";import{a as ue,c as z,r as B}from"./insertionBoundaries-DYPFjCrm.js";import{t as V}from"./ModelLogo-BSDCUld6.js";import{n as H,t as de}from"./useModelLists-BfC2IQwO.js";import{a as U,c as fe,i as W,n as pe,o as G,r as K,s as me,t as he}from"./select-BXiRJQfM.js";import{s as q}from"./worktreeManager-nlQu_BbV.js";import{a as J,i as Y,n as ge,t as _e}from"./worktreeSourceBranchPreference-BGrLknHI.js";import{a as ve,i as ye,n as be}from"./projectMeta-vIaGFaQr.js";var X=e(a(),1),xe=u(),Se=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Ce=/^g[1-9]\d*$/,Z=(e,t,n,r,i)=>{if(!Se.test(e)||t!==void 0&&!Ce.test(t)||!n?.trim()||!r?.trim()||n!==n.trim()||r!==r.trim())return null;if(i===void 0)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!1};if(i===`fusion`)return{groupSlug:e,runGroup:t,providerID:n,modelID:r,fusion:!0};if(!/^\d+$/.test(i))return null;let a=Number.parseInt(i,10);return!Number.isSafeInteger(a)||a<=0?null:{groupSlug:e,runGroup:t,providerID:n,modelID:r,index:a,fusion:!1}},we=e=>{if(!e)return null;let t=e.split(`/`);if(t.length<3||t.length>5)return null;let[n]=t;if(t.length===3)return Z(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Ce.test(e)?Z(n,e,r,i,void 0):Z(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?Z(n,void 0,i,a,o):Z(n,r,i,a,o)},Te=e=>{let t=[e.groupSlug];return e.runGroup&&t.push(e.runGroup),t.push(e.providerID,e.modelID),e.index!==void 0&&t.push(String(e.index)),t.join(`/`)},Q=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Ee=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),De=(e,t)=>`${Ee(e)}-${Ee(t)}`.substring(0,60),Oe=(e,t)=>`${e}/${t}`,ke=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Ae=(e,t)=>{let n=ke(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};s(e.id,n),x.getState().markSessionAsYuriCreated(e.id),h.getState().upsertSession(i);try{c().ensureChild(n,{bootstrap:!1}).setState(t=>{let n=t.session.findIndex(t=>t.id===e.id);if(n>=0&&t.session[n]===i)return t;let r=n>=0?t.session.map((e,t)=>t===n?i:e):[...t.session,i].sort((e,t)=>e.id.localeCompare(t.id));return{session:r,sessionTotal:Math.max(t.sessionTotal,r.length),limit:Math.max(t.limit,r.length)}})}catch{}return i},je=()=>{let e=m.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Me=n()(r(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let s=je();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let c=s.path,u=await ce(c)&&t.isolateRuns!==!1,d=Ee(n),f=u?await q(c):void 0,p=u?await J(c):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let g of n.models){let n=`${g.providerID}:${g.modelID}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=De(g.providerID,g.modelID),b=r.length>1?`g${e+1}`:void 0,w=_>1?Oe(d,`${y}/${v}`):Oe(d,y),T=b?`${b}/${w}`:w,E=Te({groupSlug:d,runGroup:b,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await l.withDirectory(c,()=>l.createSession({title:E}));Ae(e,c),m.push({sessionId:e.id,worktreePath:c,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await Y(s,{preferredName:T,mode:`new`,branchName:T,worktreeName:T,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await C(s)&&await S(e.worktreeRoot??e.path);let r=await l.withDirectory(e.path,()=>l.createSession({title:E}));Ae(r,e.path),x.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let g=o?.filter(e=>e.trim().length>0)??[];g.length>0&&E(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),v=m[0]?.sessionId??null;if(_.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let y=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(m.map(async e=>{try{await b({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:y})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:_,firstSessionId:v}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),$=i(),Ne=`h-7`,Pe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Fe=e=>{let t=(0,xe.c)(13),{model:n,instanceIndex:r,totalSameModel:i,onRemove:a}=e,o=n.displayName||`${n.providerID}/${n.modelID}`,s=i>1?`${o} (${r})`:o,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=w(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Ne),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(V,{modelId:n.modelID,providerId:n.providerID,className:`h-3.5 w-3.5`}),t[1]=n.modelID,t[2]=n.providerID,t[3]=l):l=t[3];let u;t[4]===s?u=t[5]:(u=(0,$.jsx)(`span`,{className:`typography-meta font-medium truncate max-w-[140px]`,children:s}),t[4]=s,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(k,{name:`close`,className:`h-3.5 w-3.5`}),t[6]=d):d=t[6];let f;t[7]===a?f=t[8]:(f=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,children:d}),t[7]=a,t[8]=f);let p;return t[9]!==l||t[10]!==u||t[11]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},Ie=e=>{let t=(0,xe.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:u,dropdownSide:d,dropdownClassName:f,containerClassName:m,triggerIcon:h}=e,v=c===void 0||c,y=d===void 0?`top`:d,{t:b}=ee(),x=_(Le),S=_(Re),C=p(ze),T=p(Be),{favoriteModelsList:E,recentModelsList:D}=de(),A=p(Ve),te=p(He),[j,M]=X.useState(!1),[ne,re]=X.useState(``),[ie,ae]=X.useState(null),oe=X.useRef(null),se=X.useRef(null),ce=l===1,N=l===void 0||n.length<l||ce,P;if(t[0]!==n){P=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;P.set(t,(P.get(t)||0)+1)}t[0]=n,t[1]=P}else P=t[1];let F=P,I;t[2]===n?I=t[3]:(I=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=I);let L=I,R,le;t[4]!==y||t[5]!==j?(R=()=>{if(!j||!se.current)return;let e=se.current.getBoundingClientRect();if(y===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ae(Math.max(160,Math.min(320,t)));return}let t=se.current.parentElement;for(;t&&!(t.getAttribute(`role`)===`dialog`||t.hasAttribute(`data-scroll-shadow`));){let e=getComputedStyle(t);if(e.overflow===`auto`||e.overflow===`hidden`||e.overflowY===`auto`||e.overflowY===`hidden`)break;t=t.parentElement}let n=t?t.getBoundingClientRect().top:0,r=e.top-n-16;ae(Math.max(150,Math.min(300,r)))},le=[y,j],t[4]=y,t[5]=j,t[6]=R,t[7]=le):(R=t[6],le=t[7]),X.useEffect(R,le);let ue,z;t[8]!==N||t[9]!==j?(ue=()=>{!N&&j&&(M(!1),re(``))},z=[N,j],t[8]=N,t[9]=j,t[10]=ue,t[11]=z):(ue=t[10],z=t[11]),X.useEffect(ue,z);let B,V;t[12]===j?(B=t[13],V=t[14]):(B=()=>{if(!j)return;let e=e=>{oe.current&&!oe.current.contains(e.target)&&(M(!1),re(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[j],t[12]=j,t[13]=B,t[14]=V),X.useEffect(B,V);let U;t[15]!==ce||t[16]!==r||t[17]!==a||t[18]!==n.length?(U=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:O(e.model,e.modelID)||e.modelID,instanceId:Pe()};ce&&n.length>0&&a?a(0,t):r(t),ce&&(M(!1),re(``))},t[15]=ce,t[16]=r,t[17]=a,t[18]=n.length,t[19]=U):U=t[19];let G=U,K;t[20]===b?K=t[21]:(K=b(`multirun.modelMultiSelect.search.placeholder`),t[20]=b,t[21]=K);let q;t[22]===b?q=t[23]:(q=b(`multirun.modelMultiSelect.search.noResults`),t[22]=b,t[23]=q);let J;t[24]===b?J=t[25]:(J=b(`multirun.modelMultiSelect.sections.favorites`),t[24]=b,t[25]=J);let Y;t[26]===b?Y=t[27]:(Y=b(`multirun.modelMultiSelect.sections.recent`),t[26]=b,t[27]=Y);let ge;t[28]===b?ge=t[29]:(ge=b(`multirun.modelMultiSelect.keyboard.hint`),t[28]=b,t[29]=ge);let _e;t[30]===b?_e=t[31]:(_e=b(`settings.agents.modelSelector.actions.favorite`),t[30]=b,t[31]=_e);let ve;t[32]===b?ve=t[33]:(ve=b(`settings.agents.modelSelector.actions.unfavorite`),t[32]=b,t[33]=ve);let ye;t[34]===b?ye=t[35]:(ye=b(`chat.modelControls.provider`),t[34]=b,t[35]=ye);let be;t[36]===b?be=t[37]:(be=b(`chat.modelControls.capabilities`),t[36]=b,t[37]=be);let Se;t[38]===b?Se=t[39]:(Se=b(`chat.modelControls.capability.toolCalling`),t[38]=b,t[39]=Se);let Ce;t[40]===b?Ce=t[41]:(Ce=b(`chat.modelControls.capability.reasoning`),t[40]=b,t[41]=Ce);let Z;t[42]===b?Z=t[43]:(Z=b(`chat.modelControls.modality.image`),t[42]=b,t[43]=Z);let we;t[44]===b?we=t[45]:(we=b(`chat.modelControls.modality.video`),t[44]=b,t[45]=we);let Te;t[46]===b?Te=t[47]:(Te=b(`chat.modelControls.modality.audio`),t[46]=b,t[47]=Te);let Q;t[48]===b?Q=t[49]:(Q=b(`chat.modelControls.costPerMillion`),t[48]=b,t[49]=Q);let Ee;t[50]===b?Ee=t[51]:(Ee=b(`chat.modelControls.costInput`),t[50]=b,t[51]=Ee);let De;t[52]===b?De=t[53]:(De=b(`chat.modelControls.costOutput`),t[52]=b,t[53]=De);let Oe;t[54]!==K||t[55]!==q||t[56]!==J||t[57]!==Y||t[58]!==ge||t[59]!==_e||t[60]!==ve||t[61]!==ye||t[62]!==be||t[63]!==Se||t[64]!==Ce||t[65]!==Z||t[66]!==we||t[67]!==Te||t[68]!==Q||t[69]!==Ee||t[70]!==De?(Oe={searchPlaceholder:K,noResults:q,favorites:J,recent:Y,keyboardHint:ge,favorite:_e,unfavorite:ve,provider:ye,capabilities:be,capabilityToolCalling:Se,capabilityReasoning:Ce,modalityImage:Z,modalityVideo:we,modalityAudio:Te,costPerMillion:Q,costInput:Ee,costOutput:De},t[54]=K,t[55]=q,t[56]=J,t[57]=Y,t[58]=ge,t[59]=_e,t[60]=ve,t[61]=ye,t[62]=be,t[63]=Se,t[64]=Ce,t[65]=Z,t[66]=we,t[67]=Te,t[68]=Q,t[69]=Ee,t[70]=De,t[71]=Oe):Oe=t[71];let ke=Oe,Ae;t[72]===m?Ae=t[73]:(Ae=w(`relative`,m),t[72]=m,t[73]=Ae);let je;t[74]===u?je=t[75]:(je=w(Ne,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,u),t[74]=u,t[75]=je);let Me=!N,Ie;t[76]===j?Ie=t[77]:(Ie=()=>{M(!j)},t[76]=j,t[77]=Ie);let We;t[78]===h?We=t[79]:(We=h??(0,$.jsx)(k,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=h,t[79]=We);let Ge;t[80]!==s||t[81]!==b?(Ge=s??b(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=b,t[82]=Ge):Ge=t[82];let Ke;t[83]!==je||t[84]!==Me||t[85]!==Ie||t[86]!==We||t[87]!==Ge?(Ke=(0,$.jsxs)(g,{ref:se,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ie,children:[We,Ge]}),t[83]=je,t[84]=Me,t[85]=Ie,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==ie||t[90]!==N||t[91]!==f||t[92]!==y||t[93]!==E||t[94]!==S||t[95]!==G||t[96]!==A||t[97]!==T||t[98]!==j||t[99]!==ke||t[100]!==F||t[101]!==te||t[102]!==x||t[103]!==D||t[104]!==ne||t[105]!==C?(qe=j?(0,$.jsx)(`div`,{className:w(`absolute left-0 z-50 w-[min(420px,calc(100vw-2rem))] max-w-[calc(100vw-2rem)] flex flex-col overflow-hidden rounded-xl border border-border/50 shadow-lg`,y===`top`?`bottom-full mb-1`:`top-full mt-1`,f),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(H,{providers:x,providerOrder:te,favoriteModels:E,recentModels:D,getMetadata:S,hiddenModels:A,searchQuery:ne,onSearchQueryChange:re,onSelect:G,labels:ke,selectionCount:e=>F.get(`${e.providerID}:${e.modelID}`)||0,disabled:!N,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:ie?`${ie}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:j,isFavorite:e=>T(e.providerID,e.modelID),onToggleFavorite:e=>C(e.providerID,e.modelID),onEscape:()=>{M(!1),re(``)}})}):null,t[89]=ie,t[90]=N,t[91]=f,t[92]=y,t[93]=E,t[94]=S,t[95]=G,t[96]=A,t[97]=T,t[98]=j,t[99]=ke,t[100]=F,t[101]=te,t[102]=x,t[103]=D,t[104]=ne,t[105]=C,t[106]=qe):qe=t[106];let Je;t[107]!==Ae||t[108]!==Ke||t[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:oe,children:[Ke,qe]}),t[107]=Ae,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==L||t[112]!==F||t[113]!==i||t[114]!==a||t[115]!==x||t[116]!==n||t[117]!==v||t[118]!==b?(Ye=v&&n.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=F.get(n)||1,o=L(e),s=x.find(t=>t.id===e.providerID)?.models?.find(t=>t.id===e.modelID),c=s?.variants?Object.keys(s.variants):[],l=c.length>0,u=e.variant??`__default__`;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Fe,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,$.jsxs)(he,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,$.jsxs)(me,{size:`chip`,className:`px-2 gap-1.5 rounded-md !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 typography-meta font-medium text-foreground`,children:[(0,$.jsx)(k,{name:`brain-ai-3`,className:w(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(fe,{placeholder:b(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?b(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(pe,{fitContent:!0,children:[(0,$.jsx)(W,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:b(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=L,t[112]=F,t[113]=i,t[114]=a,t[115]=x,t[116]=n,t[117]=v,t[118]=b,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),t[120]=Je,t[121]=Ye,t[122]=Xe):Xe=t[122];let Ze;t[123]!==l||t[124]!==o||t[125]!==n.length||t[126]!==b?(Ze=o!==void 0&&n.length<o&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?b(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):b(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=b,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),t[128]=Xe,t[129]=Ze,t[130]=Qe):Qe=t[130],Qe};function Le(e){return e.providers}function Re(e){return e.getModelMetadata}function ze(e){return e.toggleFavoriteModel}function Be(e){return e.isFavoriteModel}function Ve(e){return e.hiddenModels}function He(e){return e.providerOrder}function Ue(e){return(0,$.jsx)(W,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,xe.c)(30),{git:n}=d(),r=F(e),i=N(e),a=P(e),o=I(e),s=L(Ye),c=L(Je),l,u;t[0]!==e||t[1]!==c||t[2]!==n||t[3]!==i||t[4]!==a?(l=()=>{!e||!n||i!==null||a||c(e,n,{silent:!0})},u=[e,n,c,i,a],t[0]=e,t[1]=c,t[2]=n,t[3]=i,t[4]=a,t[5]=l,t[6]=u):(l=t[5],u=t[6]),X.useEffect(l,u);let f;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(f=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=f):f=t[12];let p=r?.all,m;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==p?(m=[e,n,i,p,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=p,t[18]=m):m=t[18],X.useEffect(f,m);let h=a||i===!0&&o,g;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],g=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),g=e}let _=g,v;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],v=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),v=e}let y=v,b;bb2:{if(!e){b=null;break bb2}if(i!==null){b=i;break bb2}if(h){b=null;break bb2}b=r?.all?!0:null}let x=b,S;return t[25]!==x||t[26]!==h||t[27]!==_||t[28]!==y?(S={localBranches:_,remoteBranches:y,isLoading:h,isGitRepository:x},t[25]=x,t[26]=h,t[27]=_,t[28]=y,t[29]=S):S=t[29],S}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=ee(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(e),d=X.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return X.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await q(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(_e),{sourceBranch:o,shouldClearSavedSourceBranch:s}=ge({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(_e),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(he,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(me,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(fe,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(pe,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.loadingBranches`)}):s.length===0&&c.length===0?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,$.jsxs)($.Fragment,{children:[s.length>0&&(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(W,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(G,{}),c.length>0&&(0,$.jsxs)(K,{children:[(0,$.jsx)(U,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(W,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},Ze=e=>{let t=(0,xe.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=ee(),l=_(Qe),u=_($e),d=_(et),f;t[0]===l?f=t[1]:(f=l(),t[0]=l,t[1]=f);let p=f,m;t[2]===p?m=t[3]:(m=p.filter(tt),t[2]=p,t[3]=m);let h=m,g,v;t[4]!==p.length||t[5]!==u?(g=()=>{p.length===0&&u()},v=[p.length,u],t[4]=p.length,t[5]=u,t[6]=g,t[7]=v):(g=t[6],v=t[7]),X.useEffect(g,v);let y,b;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==h||t[12]!==n?(y=()=>{if(a)return;let e=n.trim();if(e.length>0&&h.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&h.some(e=>e.name===t)){r(t);return}let i=h[0]?.name;i&&r(i)},b=[d,a,r,h,n],t[8]=d,t[9]=a,t[10]=r,t[11]=h,t[12]=n,t[13]=y,t[14]=b):(y=t[13],b=t[14]),X.useEffect(y,b);let x=n.trim().length>0?n:void 0,S;t[15]===i?S=t[16]:(S=w(`max-w-full typography-meta text-foreground !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 data-[popup-open]:!bg-[var(--interactive-active)]/70`,i),t[15]=i,t[16]=S);let C;t[17]===c?C=t[18]:(C=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=C);let T;t[19]===C?T=t[20]:(T=(0,$.jsx)(fe,{placeholder:C}),t[19]=C,t[20]=T);let E;t[21]!==o||t[22]!==S||t[23]!==T?(E=(0,$.jsx)(me,{id:o,size:`lg`,className:S,children:T}),t[21]=o,t[22]=S,t[23]=T,t[24]=E):E=t[24];let D;t[25]===h?D=t[26]:(D=h.length>0&&(0,$.jsx)(K,{children:h.map(nt)}),t[25]=h,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(pe,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let k;return t[30]!==a||t[31]!==r||t[32]!==x||t[33]!==E||t[34]!==O?(k=(0,$.jsxs)(he,{value:x,onValueChange:r,disabled:a,children:[E,O]}),t[30]=a,t[31]=r,t[32]=x,t[33]=E,t[34]=O,t[35]=k):k=t[35],k};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return y(e.mode)}function nt(e){return(0,$.jsx)(W,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var rt=10485760,it=5,at=e=>{let t=(0,xe.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(j,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground transition-colors`,children:(0,$.jsx)(k,{name:`information`,className:`h-3.5 w-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(ne,{children:[r,(0,$.jsx)(M,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,xe.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,$.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`}),t[0]=r,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==o?(s=(0,$.jsxs)(`label`,{htmlFor:n,className:`typography-meta font-medium text-foreground`,children:[i,o]}),t[2]=i,t[3]=n,t[4]=o,t[5]=s):s=t[5];let c=a&&a,l;return t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l},st=e=>{let t=v(e.path),n=e.icon?ye[e.icon]:null,r=e.color?be[e.color]:void 0,i=(0,$.jsx)(k,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`relative top-px flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(ve,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=ee(),[s,c]=X.useState(``),[l,u]=X.useState(()=>[{id:Pe(),prompt:``,models:[]}]),[d,p]=X.useState(``),[h,_]=X.useState([]),[v,y]=X.useState(!1),[b,S]=X.useState([]),[C,E]=X.useState(!1),[O,se]=X.useState(!1),[ce,N]=X.useState(!0),P=X.useRef(null),F=o(e=>e.currentDirectory??null),I=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__VSCODE_CONFIG__?.workspaceFolder;return typeof e==`string`&&e.trim().length>0?e.trim():null},[]),L=m(e=>e.activeProjectId),ue=m(e=>e.setActiveProjectIdOnly),z=m(e=>e.projects),[B,V]=X.useState(()=>L??null);X.useEffect(()=>{if(L){V(L);return}!B&&z.length>0&&V(z[0].id)},[L,z,B]);let H=X.useMemo(()=>B?z.find(e=>e.id===B)??null:null,[z,B]),de=H?.path??F,U=f(e=>{V(e),e!==L&&ue(e)}),G=X.useMemo(()=>{if(H?.path)return{id:H.id,path:H.path};let e=F??I;return e?{id:`path:${e}`,path:e}:null},[H,F,I]),[K]=X.useState(()=>typeof window<`u`&&t()),q=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),J=re(),Y=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__YURI_MACOS_MAJOR__;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;if(typeof navigator>`u`)return null;let t=(navigator.userAgent||``).match(/Mac OS X (\d+)[._](\d+)/);if(!t)return null;let n=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);return Number.isNaN(n)?null:n===10?r:n},[]),ge=X.useMemo(()=>K&&q||J?`pl-[5.5rem]`:`pl-3`,[K,q,J]),_e=X.useMemo(()=>!K||!q||Y===null?``:Y>=26?`h-12`:Y<=15?`h-14`:``,[K,q,Y]),ve=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&K&&await A()}),ye=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),be=!!r;X.useEffect(()=>{if(be)return window.addEventListener(`keydown`,ye,!0),()=>window.removeEventListener(`keydown`,ye,!0)},[be]);let[xe,Se]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=We(de),we=X.useRef(!1),Te=Z===!0,Q=Te&&ce;X.useEffect(()=>{if(Z===!1){we.current=!0,N(!1);return}Z===!0&&we.current&&(we.current=!1,N(!0))},[Z]);let Ee=Me(e=>e.createMultiRun),De=Me(e=>e.error),Oe=Me(e=>e.clearError);X.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&u(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),X.useEffect(()=>{if(!G)return;let e=!1;return se(!0),(async()=>{try{let t=await T(G);e||S(t)}catch{}finally{e||se(!1)}})(),()=>{e=!0}},[G]);let ke=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=f(e=>{u(t=>t.filter(t=>t.id!==e))}),je=f(()=>{u(e=>[...e,{id:Pe(),prompt:``,models:[]}])}),Ne=async e=>{let t=e.target.files;if(!t)return;let n=0;for(let e=0;e<t.length;e++){let r=t[e];if(r.size>rt){D.error(a(`multirun.launcher.toast.fileTooLarge`,{fileName:r.name}));continue}try{let e=await new Promise((e,t)=>{let n=new FileReader;n.onload=()=>e(n.result),n.onerror=t,n.readAsDataURL(r)});_(t=>[...t,{id:Pe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),D.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&D.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),P.current&&(P.current.value=``)},Fe=e=>{_(t=>t.filter(t=>t.id!==e))},Ie=X.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let t=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(t.length!==0&&!(Ie<1)){y(!0),Oe();try{B&&B!==L&&ue(B);let e=h.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=b.filter(e=>e.trim().length>0),i=t.map(e=>({prompt:e.prompt.trim(),models:e.models.map(e=>({providerID:e.providerID,modelID:e.modelID,displayName:e.displayName,variant:e.variant}))})),a={name:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Q?xe:void 0,isolateRuns:Q,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await Ee(a);o&&(o.firstSessionId&&x.getState().setCurrentSession(o.firstSessionId),n?.())}finally{y(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Ie>=1&&de&&!Ce&&(Z===!1||!Q||xe)),ze=b.filter(e=>e.trim()).length;return(0,$.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,$.jsxs)(`header`,{onMouseDown:ve,className:w(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,ge,_e),style:{borderColor:`var(--interactive-border)`},children:[(0,$.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,$.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,$.jsxs)(ne,{children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`multirun.launcher.actions.closeEsc`),className:`inline-flex h-9 w-9 items-center justify-center p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary app-region-no-drag`,children:(0,$.jsx)(k,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(M,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(te,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),z.length>0?(0,$.jsxs)(he,{value:B??void 0,onValueChange:U,children:[(0,$.jsx)(me,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:H?(0,$.jsx)(fe,{children:st(H)}):(0,$.jsx)(fe,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(pe,{fitContent:!0,children:z.map(e=>(0,$.jsx)(W,{value:e.id,className:`max-w-[24rem]`,children:st(e)},e.id))})]}):(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(R,{id:`group-name`,value:s,onChange:e=>c(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Xe,{directory:de,value:xe,onChange:Se,disabled:!Q,id:`multirun-worktree-base-branch`}),(0,$.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(le,{checked:ce,onChange:N,disabled:!Te,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,$.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ot,{htmlFor:`multirun-agent`,info:(0,$.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)(Ze,{value:d,onChange:p,id:`multirun-agent`})]})]}),(0,$.jsxs)(oe,{open:C,onOpenChange:E,children:[(0,$.jsxs)(ae,{className:`w-full flex items-center gap-2 py-1.5 px-2 -mx-2 rounded-lg hover:bg-[var(--interactive-hover)]/50 transition-colors group`,children:[(0,$.jsx)(k,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,$.jsx)(`span`,{className:`typography-meta font-medium text-muted-foreground group-hover:text-foreground transition-colors`,children:a(`multirun.launcher.setupCommands.label`)}),ze>0&&(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center h-4 min-w-4 px-1 rounded-full typography-micro font-medium`,style:{backgroundColor:`var(--primary-base)`,color:`var(--primary-foreground)`,fontSize:`0.625rem`,lineHeight:1},children:ze}),(0,$.jsx)(k,{name:`arrow-down-s`,className:w(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,C&&`rotate-180`)})]}),(0,$.jsx)(ie,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:O?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[b.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(R,{value:e,onChange:e=>{let n=[...b];n[t]=e.target.value,S(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>S(b.filter((e,n)=>n!==t)),className:`flex-shrink-0 flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,"aria-label":a(`multirun.launcher.setupCommands.removeCommandAria`),children:(0,$.jsx)(k,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>S([...b,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(k,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(ot,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`input`,{ref:P,type:`file`,multiple:!0,className:`hidden`,onChange:Ne,accept:`*/*`}),(0,$.jsxs)(ne,{children:[(0,$.jsx)(j,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>P.current?.click(),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md typography-micro text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(k,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(M,{children:a(`multirun.launcher.attachments.tooltip`)})]}),h.map(e=>(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md typography-micro border`,style:{backgroundColor:`var(--surface-elevated)`,borderColor:`var(--interactive-border)`},children:[e.mimeType.startsWith(`image/`)?(0,$.jsx)(k,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(k,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Fe(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(k,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(lt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:ke,onRemove:Ae},e.id)),(0,$.jsxs)(`button`,{type:`button`,onClick:je,className:`flex items-center gap-1.5 py-2 px-3 -mx-3 rounded-lg typography-meta font-medium text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(k,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),De&&(0,$.jsx)(`div`,{className:`px-3 py-2 rounded-lg typography-meta`,style:{backgroundColor:`var(--status-error-background)`,color:`var(--status-error)`,borderWidth:1,borderColor:`var(--status-error-border)`},children:De})]})})}),(0,$.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Q&&Z!==null?(0,$.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(k,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,$.jsx)(g,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(g,{type:`submit`,size:`sm`,disabled:!Re||v,children:v?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Ie})})})]})})]})},lt=e=>{let t=(0,xe.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=ee(),[c,l]=X.useState(!1),[u,d]=X.useState(``),[p,m]=X.useState(!1),[h,g]=X.useState(``),_=X.useRef(null),v=X.useRef(null),y=X.useRef(null),b;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(b=e=>{n.models.length>=it||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=b):b=t[3];let x=f(b),S;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(S=e=>{a(n.id,{models:n.models.filter((t,n)=>n!==e)})},t[4]=n.id,t[5]=n.models,t[6]=a,t[7]=S):S=t[7];let C=f(S),w;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(w=(e,t)=>{a(n.id,{models:n.models.map((n,r)=>r===e?t:n)})},t[8]=n.id,t[9]=n.models,t[10]=a,t[11]=w):w=t[11];let T=f(w),E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
2
2
  `),i=Math.min(n===-1?e.length:n,r===-1?e.length:r);if(t<=i&&n===-1){g(e.substring(1,i)),m(!0),l(!1);return}}m(!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
3
  `)?(d(t),l(!0)):l(!1);return}l(!1)},t[12]=E):E=t[12];let D=f(E),O;t[13]!==n.id||t[14]!==a?(O=e=>{a(n.id,{prompt:e})},t[13]=n.id,t[14]=a,t[15]=O):O=t[15];let A=f(O),te;t[16]!==n.prompt||t[17]!==A||t[18]!==D?(te=e=>{let t=n.prompt,r=_.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=e.relativePath&&e.relativePath.trim().length>0?e.relativePath.trim():e.path||e.name,o=B(t,i===-1?r:i,r,`@${a}`);A(o.text),l(!1),d(``),requestAnimationFrame(()=>{let e=_.current;e&&(e.selectionStart=o.caret,e.selectionEnd=o.caret,e.focus()),D(o.text,o.caret)})},t[16]=n.prompt,t[17]=A,t[18]=D,t[19]=te):te=t[19];let j=f(te),M;t[20]!==n.prompt||t[21]!==A||t[22]!==D?(M=e=>{let t=n.prompt,r=_.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=B(t,i===-1?r:i,r,`@${e}`);A(a.text),l(!1),d(``),requestAnimationFrame(()=>{let e=_.current;e&&(e.selectionStart=a.caret,e.selectionEnd=a.caret,e.focus()),D(a.text,a.caret)})},t[20]=n.prompt,t[21]=A,t[22]=D,t[23]=M):M=t[23];let ne=f(M),re;t[24]!==A||t[25]!==D?(re=e=>{let t=`/${e.name} `;A(t),m(!1),g(``),requestAnimationFrame(()=>{let e=_.current;e&&(e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length),D(t,t.length)})},t[24]=A,t[25]=D,t[26]=re):re=t[26];let ie=f(re),ae;t[27]!==p||t[28]!==c?(ae=e=>{if(p&&y.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)){e.preventDefault(),y.current.handleKeyDown(e.key);return}c&&v.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),v.current.handleKeyDown(e.key))},t[27]=p,t[28]=c,t[29]=ae):ae=t[29];let oe=f(ae),ce=r+1,N;t[30]!==s||t[31]!==ce?(N=s(`multirun.launcher.groups.groupLabel`,{index:ce}),t[30]=s,t[31]=ce,t[32]=N):N=t[32];let P;t[33]===N?P=t[34]:(P=(0,$.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:N}),t[33]=N,t[34]=P);let F;t[35]!==i||t[36]!==n.id||t[37]!==o||t[38]!==s?(F=i&&(0,$.jsx)(`button`,{type:`button`,onClick:()=>o(n.id),className:`inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10`,"aria-label":s(`multirun.launcher.groups.removeGroup`),children:(0,$.jsx)(k,{name:`close`,className:`h-3.5 w-3.5`})}),t[35]=i,t[36]=n.id,t[37]=o,t[38]=s,t[39]=F):F=t[39];let I;t[40]!==P||t[41]!==F?(I=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[P,F]}),t[40]=P,t[41]=F,t[42]=I):I=t[42];let L;t[43]===s?L=t[44]:(L=s(`multirun.launcher.groups.prompt.label`),t[43]=s,t[44]=L);let R;t[45]===L?R=t[46]:(R=(0,$.jsx)(ot,{required:!0,children:L}),t[45]=L,t[46]=R);let le=n.prompt,V;t[47]!==A||t[48]!==D?(V=e=>{let t=e.target.value;A(t);let n=e.target.selectionStart??t.length;D(t,n)},t[47]=A,t[48]=D,t[49]=V):V=t[49];let H;t[50]===s?H=t[51]:(H=s(`multirun.launcher.groups.prompt.placeholder`),t[50]=s,t[51]=H);let de;t[52]!==n.prompt||t[53]!==oe||t[54]!==V||t[55]!==H?(de=(0,$.jsx)(se,{ref:_,value:le,onChange:V,onKeyDown:oe,placeholder:H,className:`typography-meta min-h-[80px] max-h-[200px] resize-none overflow-y-auto field-sizing-content`,required:!0}),t[52]=n.prompt,t[53]=oe,t[54]=V,t[55]=H,t[56]=de):de=t[56];let U;t[57]!==h||t[58]!==ie||t[59]!==p?(U=p?(0,$.jsx)(ue,{ref:y,searchQuery:h,onCommandSelect:ie,onClose:()=>m(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[57]=h,t[58]=ie,t[59]=p,t[60]=U):U=t[60];let fe;t[61]!==ne||t[62]!==j||t[63]!==u||t[64]!==c?(fe=c?(0,$.jsx)(z,{ref:v,searchQuery:u,onFileSelect:j,onAgentSelect:ne,onSkillSelect:e=>ne(e.name),onClose:()=>l(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[61]=ne,t[62]=j,t[63]=u,t[64]=c,t[65]=fe):fe=t[65];let W;t[66]!==de||t[67]!==U||t[68]!==fe?(W=(0,$.jsxs)(`div`,{className:`relative`,children:[de,U,fe]}),t[66]=de,t[67]=U,t[68]=fe,t[69]=W):W=t[69];let pe;t[70]!==R||t[71]!==W?(pe=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[R,W]}),t[70]=R,t[71]=W,t[72]=pe):pe=t[72];let G;t[73]===s?G=t[74]:(G=s(`multirun.launcher.models.info`,{max:it}),t[73]=s,t[74]=G);let K;t[75]===G?K=t[76]:(K=(0,$.jsx)(at,{children:G}),t[75]=G,t[76]=K);let me;t[77]===s?me=t[78]:(me=s(`multirun.launcher.models.label`),t[77]=s,t[78]=me);let he;t[79]!==K||t[80]!==me?(he=(0,$.jsx)(ot,{required:!0,info:K,children:me}),t[79]=K,t[80]=me,t[81]=he):he=t[81];let q;t[82]!==n.models||t[83]!==x||t[84]!==C||t[85]!==T?(q=(0,$.jsx)(Ie,{selectedModels:n.models,onAdd:x,onRemove:C,onUpdate:T,minModels:1,maxModels:it}),t[82]=n.models,t[83]=x,t[84]=C,t[85]=T,t[86]=q):q=t[86];let J;t[87]!==he||t[88]!==q?(J=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[he,q]}),t[87]=he,t[88]=q,t[89]=J):J=t[89];let Y;return t[90]!==I||t[91]!==pe||t[92]!==J?(Y=(0,$.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-3`,children:[I,pe,J]}),t[90]=I,t[91]=pe,t[92]=J,t[93]=Y):Y=t[93],Y};export{Q as a,Pe as i,Ze as n,we as o,Ie as r,ct as t};
@@ -1 +1 @@
1
- import{n as e}from"./platform-B2ylz14u.js";import{a as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-4xeqxklF.js";var r=t(`YuriUpdateConfig`);async function i(){if(!e())throw new n;let t=await r.getConfiguration();if(t.channel!==`stable`&&t.channel!==`beta`||typeof t.shellApiVersion!=`number`||!Number.isInteger(t.shellApiVersion)||t.shellApiVersion<1)throw Error(`Invalid native update configuration`);return{channel:t.channel,shellApiVersion:t.shellApiVersion}}export{i as t};
1
+ import{n as e}from"./platform-B2ylz14u.js";import{a as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-BjDNwP80.js";var r=t(`YuriUpdateConfig`);async function i(){if(!e())throw new n;let t=await r.getConfiguration();if(t.channel!==`stable`&&t.channel!==`beta`||typeof t.shellApiVersion!=`number`||!Number.isInteger(t.shellApiVersion)||t.shellApiVersion<1)throw Error(`Invalid native update configuration`);return{channel:t.channel,shellApiVersion:t.shellApiVersion}}export{i as t};
@@ -1 +1 @@
1
- import{a as e}from"./mobileBackNavigation-CVrR_jtn.js";var t=(e=>{let t=new Map,n=()=>{let e=0;for(let n of t.values())e+=n;return e};return{hold(r){let i=(t.get(r)??0)+1;t.set(r,i),n()===1&&e.conceal();let a=!1;return()=>{if(a)return;a=!0;let i=(t.get(r)??1)-1;i<=0?t.delete(r):t.set(r,i),n()===0&&e.reveal()}}}})(e),n=new Map,r=e=>t.hold(e),i=e=>{n.has(e)||n.set(e,t.hold(e))},a=e=>{let t=n.get(e);t&&(n.delete(e),t())},o=`btw-page`,s=`btw-sheet`,c=`text-selection`;export{r as a,i,s as n,a as o,c as r,o as t};
1
+ import{a as e}from"./mobileBackNavigation-DbRzQPwl.js";var t=(e=>{let t=new Map,n=()=>{let e=0;for(let n of t.values())e+=n;return e};return{hold(r){let i=(t.get(r)??0)+1;t.set(r,i),n()===1&&e.conceal();let a=!1;return()=>{if(a)return;a=!0;let i=(t.get(r)??1)-1;i<=0?t.delete(r):t.set(r,i),n()===0&&e.reveal()}}}})(e),n=new Map,r=e=>t.hold(e),i=e=>{n.has(e)||n.set(e,t.hold(e))},a=e=>{let t=n.get(e);t&&(n.delete(e),t())},o=`btw-page`,s=`btw-sheet`,c=`text-selection`;export{r as a,i,s as n,a as o,c as r,o as t};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-input-store-DPw_n0MZ.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/platform-B2ylz14u.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-zustand-CTekDqaS.js","assets/vendor-base-ui-wXsskyKm.js","assets/prompt-attachment-upload-BzYqZdzd.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/runtime-file-resource-BGZ4tGr5.js","assets/vendor-react-BkccXcWz.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/summaries-BQMyJaaw.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/input-store-CzG_3qFv.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/uuid-D-SDZijH.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r}from"./runtime-switch-DEPKHgdL.js";import{r as i}from"./summaries-BQMyJaaw.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Ga as o,Ha as s}from"./ui-BCYkB585.js";import{i as c,n as l,r as u}from"./remoteProjectQueries-BQzoY_Y9.js";var d=e({applyRemoteProjectRoute:()=>f,seedRemoteProjectDraft:()=>p});async function f(e,a=()=>!0){if(!e.hostId||!e.hubId||!e.directory)throw Error(`Incomplete remote session route`);let d=t(),f=n(),p=r(),m=await l();if(!a())return!1;if(!m.supported||m.hubId!==e.hubId||d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to a different or unsupported Hub`);let h=e.projectId?m.projects.find(t=>t.hostId===e.hostId&&t.id===e.projectId):i(m.projects,m.hubId,e.hostId,e.directory,(await u(c(m),e.hostId)).worktrees);if(!a())return!1;if(d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to an inactive Hub`);if(!h)throw Error(`Remote Project is not referenced by this Hub`);let g={hubId:m.hubId,hostId:h.hostId,directory:e.directory,...e.instanceId||h.instanceId?{instanceId:e.instanceId||h.instanceId}:{}};g.instanceId&&c(m).resolve(g).sdk();let _=s.getState();return _.upsertRemoteProject(h,m.hubId),_.setActiveProjectIdOnly(h.id),o.getState().openRemoteSession(h,g,e.isNewSession?null:e.sessionId),!0}async function p(e,n){let r=t(),{seedRemoteDraft:i}=await a(async()=>{let{seedRemoteDraft:e}=await import(`./remote-input-store-DPw_n0MZ.js`).then(e=>e.a);return{seedRemoteDraft:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]));r===t()&&await i(e,n)}export{d as n,p as r,f as t};
2
+ import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r}from"./runtime-switch-DEPKHgdL.js";import{r as i}from"./summaries-BQMyJaaw.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Ga as o,Ha as s}from"./ui-B57gL0cH.js";import{i as c,n as l,r as u}from"./remoteProjectQueries-BQzoY_Y9.js";var d=e({applyRemoteProjectRoute:()=>f,seedRemoteProjectDraft:()=>p});async function f(e,a=()=>!0){if(!e.hostId||!e.hubId||!e.directory)throw Error(`Incomplete remote session route`);let d=t(),f=n(),p=r(),m=await l();if(!a())return!1;if(!m.supported||m.hubId!==e.hubId||d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to a different or unsupported Hub`);let h=e.projectId?m.projects.find(t=>t.hostId===e.hostId&&t.id===e.projectId):i(m.projects,m.hubId,e.hostId,e.directory,(await u(c(m),e.hostId)).worktrees);if(!a())return!1;if(d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to an inactive Hub`);if(!h)throw Error(`Remote Project is not referenced by this Hub`);let g={hubId:m.hubId,hostId:h.hostId,directory:e.directory,...e.instanceId||h.instanceId?{instanceId:e.instanceId||h.instanceId}:{}};g.instanceId&&c(m).resolve(g).sdk();let _=s.getState();return _.upsertRemoteProject(h,m.hubId),_.setActiveProjectIdOnly(h.id),o.getState().openRemoteSession(h,g,e.isNewSession?null:e.sessionId),!0}async function p(e,n){let r=t(),{seedRemoteDraft:i}=await a(async()=>{let{seedRemoteDraft:e}=await import(`./remote-input-store-DPw_n0MZ.js`).then(e=>e.a);return{seedRemoteDraft:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]));r===t()&&await i(e,n)}export{d as n,p as r,f as t};
@@ -1 +1 @@
1
- import{r as e}from"./useUIStore-68ZPpgYA.js";import{Ft as t,Ga as n,Ha as r}from"./ui-BCYkB585.js";import{i,n as a}from"./remoteProjectQueries-BQzoY_Y9.js";function o(i,a,o,s=i.path,c=!1,l){a.assertCurrent(),r.getState().setActiveProjectIdOnly(i.id),n.getState().openRemoteSession(i,{hubId:a.hubId,hostId:i.hostId,directory:s,...i.instanceId?{instanceId:i.instanceId}:{}},o,l),e.getState().setActiveMainTab(`chat`),c&&t.getState().openRemoteProject()}async function s(e,t=!1){let n=await a(),s=n.projects.find(t=>t.id===e.id&&t.hostId===e.hostId&&t.path===e.path);if(!s)throw Error(`Remote project is not registered in the current Hub`);let c=i(n);c.assertCurrent(),r.getState().upsertRemoteProject(s,n.hubId),o(s,c,null,s.path,t)}export{o as n,s as t};
1
+ import{r as e}from"./useUIStore-68ZPpgYA.js";import{Ft as t,Ga as n,Ha as r}from"./ui-B57gL0cH.js";import{i,n as a}from"./remoteProjectQueries-BQzoY_Y9.js";function o(i,a,o,s=i.path,c=!1,l){a.assertCurrent(),r.getState().setActiveProjectIdOnly(i.id),n.getState().openRemoteSession(i,{hubId:a.hubId,hostId:i.hostId,directory:s,...i.instanceId?{instanceId:i.instanceId}:{}},o,l),e.getState().setActiveMainTab(`chat`),c&&t.getState().openRemoteProject()}async function s(e,t=!1){let n=await a(),s=n.projects.find(t=>t.id===e.id&&t.hostId===e.hostId&&t.path===e.path);if(!s)throw Error(`Remote project is not registered in the current Hub`);let c=i(n);c.assertCurrent(),r.getState().upsertRemoteProject(s,n.hubId),o(s,c,null,s.path,t)}export{o as n,s as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remoteProjectQueries-BQzoY_Y9.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/platform-B2ylz14u.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-base-ui-wXsskyKm.js","assets/client-CmtAKi5B.js","assets/vendor-zustand-CTekDqaS.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/safeStorage-DTOhKN0V.js","assets/prompt-attachment-upload-BzYqZdzd.js","assets/runtime-file-resource-BGZ4tGr5.js","assets/vendor-react-BkccXcWz.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/summaries-BQMyJaaw.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/navigation-DFmCAq2g.js","assets/ui-BCYkB585.js","assets/gitApiHttp-ZjM4HkSo.js","assets/useUIStore-68ZPpgYA.js","assets/useMobileHtmlPreviewStore-BYunNOBo.js","assets/uuid-D-SDZijH.js","assets/vendor-sonner-DX3nfJx4.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/i18n-iu4pzqPi.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-BgsgBTwJ.js","assets/tour-CMXP3Kif.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/input-store-CzG_3qFv.js","assets/toolHelpers-iEHVHQ9p.js","assets/useAssistantUIStore-BUWPTwNV.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as t}from"./useUIStore-68ZPpgYA.js";import{Dt as n,Hi as r,f as i}from"./ui-BCYkB585.js";import{r as a,t as o}from"./sessionLookup-DZhrkKRI.js";var s=0;async function c(e){let t=o(e.trim());if(t)return{status:`found`,directory:t.directory};let n=await r(e);return n?{status:`found`,directory:n.directory}:{status:`not-found`}}async function l(r){let o=typeof r?.sessionId==`string`?r.sessionId.trim():``;if(!o)return;let c=typeof r.directory==`string`?r.directory.trim():``,l=++s,u=()=>l===s,d=r.probe===`unconfirmed`?`unresolved`:`not-found`;if(t.getState().setActiveMainTab(`chat`),r.probe===`ambiguous`){n(o,`unresolved`);return}let f=await a(o,{trySessionGet:!1});if(u()){if(f){i.getState().setCurrentSession(o,f.directory);return}if(!c){n(o,d);return}try{let[{supportsRemoteProjects:t,ensureRemoteHostCatalog:r},{resolveRemoteProjectOwner:i},{applyRemoteProjectRoute:a}]=await Promise.all([e(()=>import(`./remoteProjectQueries-BQzoY_Y9.js`).then(e=>e.l),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29])),e(()=>import(`./summaries-BQMyJaaw.js`).then(e=>e.i),__vite__mapDeps([27,1,8,9])),e(()=>import(`./navigation-DFmCAq2g.js`).then(e=>e.n),__vite__mapDeps([30,1,2,3,27,8,9,28,31,5,4,6,7,12,10,32,15,16,17,11,13,14,18,19,20,21,22,23,24,25,26,29,33,34,35,36,37,38,0,39,40,41,42,43,44,45,46,47,48]))]);if(!t()){n(o,d);return}let s=await r();if(!u())return;if(!s.supported){n(o,d);return}let l=[...new Set(s.projects.map(e=>e.hostId))].flatMap(e=>{let t=i(s.projects,s.hubId,e,c);return t?[t]:[]});if(l.length!==1){n(o,d);return}let[f]=l;await a({sessionId:o,directory:c,hostId:f.hostId,hubId:s.hubId,projectId:f.id,isNewSession:!1},u)}catch{u()&&n(o,d)}}}export{l as openSessionFromDeepLink,c as probeSessionLink};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remoteProjectQueries-BQzoY_Y9.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/platform-B2ylz14u.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/pathNormalization-ewtPqJWn.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-base-ui-wXsskyKm.js","assets/client-CmtAKi5B.js","assets/vendor-zustand-CTekDqaS.js","assets/vendor-opencode-client-BM2r1f0o.js","assets/vendor-effect-X1Hqc7ba.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/safeStorage-DTOhKN0V.js","assets/prompt-attachment-upload-BzYqZdzd.js","assets/runtime-file-resource-BGZ4tGr5.js","assets/vendor-react-BkccXcWz.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/summaries-BQMyJaaw.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/navigation-By33kYra.js","assets/ui-B57gL0cH.js","assets/gitApiHttp-ZjM4HkSo.js","assets/useUIStore-68ZPpgYA.js","assets/useMobileHtmlPreviewStore-BYunNOBo.js","assets/uuid-D-SDZijH.js","assets/vendor-sonner-DX3nfJx4.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/i18n-Sh2Qk9nD.js","assets/runtime-ead7P81A.js","assets/bootstrap-eLlfzqAI.js","assets/store-BGuutgkJ.js","assets/tour-CMXP3Kif.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/input-store-CzG_3qFv.js","assets/toolHelpers-iEHVHQ9p.js","assets/useAssistantUIStore-BUWPTwNV.js"])))=>i.map(i=>d[i]);
2
+ import{o as e}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{r as t}from"./useUIStore-68ZPpgYA.js";import{Dt as n,Hi as r,f as i}from"./ui-B57gL0cH.js";import{r as a,t as o}from"./sessionLookup-EXBDKdL9.js";var s=0;async function c(e){let t=o(e.trim());if(t)return{status:`found`,directory:t.directory};let n=await r(e);return n?{status:`found`,directory:n.directory}:{status:`not-found`}}async function l(r){let o=typeof r?.sessionId==`string`?r.sessionId.trim():``;if(!o)return;let c=typeof r.directory==`string`?r.directory.trim():``,l=++s,u=()=>l===s,d=r.probe===`unconfirmed`?`unresolved`:`not-found`;if(t.getState().setActiveMainTab(`chat`),r.probe===`ambiguous`){n(o,`unresolved`);return}let f=await a(o,{trySessionGet:!1});if(u()){if(f){i.getState().setCurrentSession(o,f.directory);return}if(!c){n(o,d);return}try{let[{supportsRemoteProjects:t,ensureRemoteHostCatalog:r},{resolveRemoteProjectOwner:i},{applyRemoteProjectRoute:a}]=await Promise.all([e(()=>import(`./remoteProjectQueries-BQzoY_Y9.js`).then(e=>e.l),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29])),e(()=>import(`./summaries-BQMyJaaw.js`).then(e=>e.i),__vite__mapDeps([27,1,8,9])),e(()=>import(`./navigation-By33kYra.js`).then(e=>e.n),__vite__mapDeps([30,1,2,3,27,8,9,28,31,5,4,6,7,12,10,32,15,16,17,11,13,14,18,19,20,21,22,23,24,25,26,29,33,34,35,36,37,38,0,39,40,41,42,43,44,45,46,47,48]))]);if(!t()){n(o,d);return}let s=await r();if(!u())return;if(!s.supported){n(o,d);return}let l=[...new Set(s.projects.map(e=>e.hostId))].flatMap(e=>{let t=i(s.projects,s.hubId,e,c);return t?[t]:[]});if(l.length!==1){n(o,d);return}let[f]=l;await a({sessionId:o,directory:c,hostId:f.hostId,hubId:s.hubId,projectId:f.id,isNewSession:!1},u)}catch{u()&&n(o,d)}}}export{l as openSessionFromDeepLink,c as probeSessionLink};