@yuriai/web 0.2.38-beta.2 → 0.2.38-beta.4

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 (216) hide show
  1. package/dist/assets/{AgentAvatar-DNVD6VCV.js → AgentAvatar-CjZAr6nn.js} +1 -1
  2. package/dist/assets/AssistantContactStatus-DoZk9r1D.js +3 -0
  3. package/dist/assets/AssistantUnreadBadge-BJHZUf6Z.js +1 -0
  4. package/dist/assets/AssistantView-DkjXm6xL.js +1 -0
  5. package/dist/assets/DiagramView-Byel_g4U.js +1 -0
  6. package/dist/assets/{FadeInOnReveal-CK7jBcu4.js → FadeInOnReveal-BrPG6IFE.js} +1 -1
  7. package/dist/assets/GuiPluginPage-C6iXAYM8.js +1 -0
  8. package/dist/assets/GuiPluginSurface-DPXPl4xG.js +1 -0
  9. package/dist/assets/GuiPluginWindow-BdtIwEmZ.js +1 -0
  10. package/dist/assets/{Icon-DsN23fuV.js → Icon-C5rHjO1K.js} +1 -1
  11. package/dist/assets/ImageLoadingPlaceholder-Cdj2zS3j.js +1 -0
  12. package/dist/assets/LoadingImage-Gh9OduKR.js +1 -0
  13. package/dist/assets/MarkdownRenderer-DErp8UoS.js +2 -0
  14. package/dist/assets/{MarkdownRendererImpl-ecACjpZw.js → MarkdownRendererImpl-H41Q6Ds9.js} +3 -3
  15. package/dist/assets/MarkstreamRendererImpl-CJcHC4Ts.js +3 -0
  16. package/dist/assets/MobileDetailNavigation-fdYiFD76.js +1 -0
  17. package/dist/assets/MobileResizableSheet-DDzgYZmt.js +1 -0
  18. package/dist/assets/MobileShareBridge-BNPPhHGf.js +3 -0
  19. package/dist/assets/MobileTabPageHeader-ZZPrTJl4.js +2 -0
  20. package/dist/assets/MultiRunWindow-DoeszXM5.js +1 -0
  21. package/dist/assets/OnboardingScreen-BrYqOlrO.js +1 -0
  22. package/dist/assets/{OverlayScrollbar-BLhv7Nq-.js → OverlayScrollbar-8lCP3DZq.js} +1 -1
  23. package/dist/assets/SettingsView-UuXi7Uya.js +29 -0
  24. package/dist/assets/SettingsWindow-DIYoXakh.js +1 -0
  25. package/dist/assets/SetupTourDialog-BF50uUTW.js +1 -0
  26. package/dist/assets/TerminalView-uVsRpvjV.js +8 -0
  27. package/dist/assets/ToolOutputDialog-Bz23N8ob.js +10 -0
  28. package/dist/assets/VoiceSettings-DbbeM4JG.js +2 -0
  29. package/dist/assets/YuriLogo-DcoYyXzq.js +1 -0
  30. package/dist/assets/YuriWordmark-Dlsq3scd.js +1 -0
  31. package/dist/assets/appThemeRegistry-DE7vwd6j.js +1 -0
  32. package/dist/assets/{appearance--vFosLNi.js → appearance-DFsI3pnP.js} +1 -1
  33. package/dist/assets/{assistant-attachment-cache-C-SlEpSB.js → assistant-attachment-cache-Cmzt4xXE.js} +1 -1
  34. package/dist/assets/bootstrap-BhC95qVC.js +1 -0
  35. package/dist/assets/{capgoAdapter-DceVw3SM.js → capgoAdapter-BPZyUAQO.js} +1 -1
  36. package/dist/assets/{checkbox-CJsiyoER.js → checkbox-Dgn0NjAK.js} +1 -1
  37. package/dist/assets/{collapsible-B3zojUm2.js → collapsible-DbkDwHwV.js} +1 -1
  38. package/dist/assets/{context-menu-DFRg1NJF.js → context-menu-HomYNhkr.js} +1 -1
  39. package/dist/assets/desktopHosts-DovfbQPm.js +1 -0
  40. package/dist/assets/desktopRelayRestore-D4pbpNKN.js +1 -0
  41. package/dist/assets/device-DNG0cNwQ.js +2 -0
  42. package/dist/assets/{diagram-OTF8YAve.js → diagram-if-ktgjK.js} +1 -1
  43. package/dist/assets/dialog-0fjbRGoX.js +1 -0
  44. package/dist/assets/{es-CrVDn7XV.js → es-30Wqm-Bx.js} +1 -1
  45. package/dist/assets/{fileMentionTouchSelection-CorehkTj.js → fileMentionTouchSelection-OwF_hr-t.js} +1 -1
  46. package/dist/assets/{fileQueries-BaEKb7SZ.js → fileQueries-D9l0crnM.js} +1 -1
  47. package/dist/assets/fileReferenceActions-BRF8f7uA.js +1 -0
  48. package/dist/assets/{fileReferenceParser-BayaidRM.js → fileReferenceParser-1HHDBUum.js} +1 -1
  49. package/dist/assets/{fr-CCwt5AOu.js → fr-BbWLXNYa.js} +1 -1
  50. package/dist/assets/{gitApi-C6rhS4rG.js → gitApi-dAPSCbXA.js} +8 -8
  51. package/dist/assets/gitApiHttp-B1mApXwC.js +9 -0
  52. package/dist/assets/{gui-CFdPKvfq.js → gui-DN2sVP96.js} +1 -1
  53. package/dist/assets/{historyImportQueries-BrhVXQhP.js → historyImportQueries-DkB2_92i.js} +1 -1
  54. package/dist/assets/host-kMLXU0hK.js +1 -0
  55. package/dist/assets/i18n-BU14awhU.js +1 -0
  56. package/dist/assets/image-loading-DEXNCcCm.js +1 -0
  57. package/dist/assets/{input-B7-PmgcW.js → input-DYmLJuhI.js} +1 -1
  58. package/dist/assets/insertionBoundaries-CYfwgLf1.js +1 -0
  59. package/dist/assets/{ja-BfwjUNPc.js → ja-BI7m9bgW.js} +1 -1
  60. package/dist/assets/{ko-CZQZFkal.js → ko-B89SVFZa.js} +1 -1
  61. package/dist/assets/main-CaueNFt7.js +169 -0
  62. package/dist/assets/main-DrIci_pj.js +2 -0
  63. package/dist/assets/{markdownHeightCache-DlRC53XG.js → markdownHeightCache-D8yqNy2h.js} +1 -1
  64. package/dist/assets/mcpQueries-DO2TKARf.js +1 -0
  65. package/dist/assets/miniChat-BTI2ObZ2.js +2 -0
  66. package/dist/assets/mobile-Cf_sQtW6.js +2 -0
  67. package/dist/assets/mobile-html-network-CsjZ_Ur0.js +2 -0
  68. package/dist/assets/mobile-network-bridge-B_h92A-9.js +1 -0
  69. package/dist/assets/mobileBackNavigation-DxG3cz8q.js +1 -0
  70. package/dist/assets/mobileConnections-CK4dMDCg.js +2 -0
  71. package/dist/assets/modulepreload-polyfill-P2Xu9kJm.js +1 -0
  72. package/dist/assets/multirun-Cd2-PUEk.js +3 -0
  73. package/dist/assets/native-config-C_nB8tLu.js +1 -0
  74. package/dist/assets/pages-CYkE04ml.js +1 -0
  75. package/dist/assets/path-utils-jGozTg9d.js +1 -0
  76. package/dist/assets/pathNormalization-ewtPqJWn.js +1 -0
  77. package/dist/assets/{pl-B6C3vXqv.js → pl-B55Lf3HE.js} +1 -1
  78. package/dist/assets/platform-DMsFWy1a.js +1 -0
  79. package/dist/assets/projectMeta-apTlCt8d.js +1 -0
  80. package/dist/assets/{pt-BR-BUDTNopP.js → pt-BR-CFZj-ECy.js} +1 -1
  81. package/dist/assets/pwa-wwvKWKhX.js +2 -0
  82. package/dist/assets/queue-abort-optimistic-BnynR3mX.js +1 -0
  83. package/dist/assets/react-B-mb0CtR.js +1 -0
  84. package/dist/assets/readiness-0tATst8c.js +1 -0
  85. package/dist/assets/reasoning-projection-client-BEhVknv9.js +1 -0
  86. package/dist/assets/renderElectronMiniChatApp-xQdVdaLB.js +2 -0
  87. package/dist/assets/renderMobileApp-D95eHLRE.js +29 -0
  88. package/dist/assets/{runtime-auth-Bh3htXtG.js → runtime-auth-mjIpsk3N.js} +1 -1
  89. package/dist/assets/runtime-fetch-DKZOpfzo.js +1 -0
  90. package/dist/assets/runtime-file-download-DMY1k1af.js +1 -0
  91. package/dist/assets/runtime-file-resource-CL7EVzOG.js +2 -0
  92. package/dist/assets/runtime-switch-BMjl5Y5W.js +1 -0
  93. package/dist/assets/runtimeAPIRegistry-C2VogTny.js +1 -0
  94. package/dist/assets/runtimeConfig-BfzZj4LK.js +2 -0
  95. package/dist/assets/runtimeEndpointReset-CjKHwDvh.js +149 -0
  96. package/dist/assets/{scheduledTaskNavigation-C8tBjNoP.js → scheduledTaskNavigation-PH-etFzZ.js} +1 -1
  97. package/dist/assets/select-B9Km1pk9.js +1 -0
  98. package/dist/assets/sessionLookup-8gdDN8Tx.js +1 -0
  99. package/dist/assets/sortable-tabs-strip-BU0Puyy0.js +1 -0
  100. package/dist/assets/{speechSettingsQueries-CJqxaC2Q.js → speechSettingsQueries-C9LCquzH.js} +1 -1
  101. package/dist/assets/src-BFQde2OG.css +2 -0
  102. package/dist/assets/{store-Myt_Fv8d.js → store-BNNIbb4k.js} +3 -3
  103. package/dist/assets/terminalApi-BXKIVBPo.js +1 -0
  104. package/dist/assets/textarea-bB6aD-GS.js +1 -0
  105. package/dist/assets/{tooltip-D5Xeh6py.js → tooltip-DgWHbKz2.js} +1 -1
  106. package/dist/assets/{types-DXSnGXVb.js → types-CnJjf4tP.js} +1 -1
  107. package/dist/assets/{uk-Ct9y1Y2t.js → uk-CS2c4Dtj.js} +1 -1
  108. package/dist/assets/{useAppFontEffects-Blo2lGTo.js → useAppFontEffects-DJp1u2mc.js} +35 -35
  109. package/dist/assets/{useAssistantUIStore-CVSFSgJV.js → useAssistantUIStore-Du8puXWz.js} +1 -1
  110. package/dist/assets/useDesktopWindowControlsLayout-DOmb8EnW.js +1 -0
  111. package/dist/assets/useDictation-CyWtsxSn.js +1 -0
  112. package/dist/assets/useEffectiveDirectory-DmGrksdp.js +1 -0
  113. package/dist/assets/{useFontPreferences-DqBoLHp6.js → useFontPreferences-CAdw6cBK.js} +1 -1
  114. package/dist/assets/useMobileHtmlPreviewStore-C03uVLfX.js +1 -0
  115. package/dist/assets/useMobileNavigationStore-CJBLQxTz.js +17 -0
  116. package/dist/assets/usePluginsStore-El9Tx9Q3.js +1 -0
  117. package/dist/assets/useStreamingTextThrottle-BbUkYQhX.js +1 -0
  118. package/dist/assets/useUIStore-BF882_0b.js +1 -0
  119. package/dist/assets/useWorkerHighlightedLines-CZ8YG-Hi.js +7 -0
  120. package/dist/assets/{zh-CN-BegPizz4.js → zh-CN-BpiwUUs4.js} +1 -1
  121. package/dist/assets/{zh-TW-4xftqQQG.js → zh-TW-Bl9CnlGi.js} +1 -1
  122. package/dist/index.html +26 -21
  123. package/dist/mini-chat.html +26 -21
  124. package/dist/mobile.html +4 -32
  125. package/package.json +1 -1
  126. package/server/index.js +10 -0
  127. package/server/lib/gui-customization/DOCUMENTATION.md +2 -0
  128. package/server/lib/gui-customization/skill/SKILL.md +1 -1
  129. package/server/lib/gui-customization/skill/references/global-pages.md +19 -4
  130. package/server/lib/gui-customization/skill/references/gui-api.md +1 -1
  131. package/server/lib/gui-customization/skill/references/icons.md +35 -8
  132. package/server/lib/gui-network/DOCUMENTATION.md +123 -0
  133. package/server/lib/gui-network/native-ios.test.js +127 -0
  134. package/server/lib/gui-network/runtime.js +146 -0
  135. package/server/lib/gui-network/runtime.test.js +129 -0
  136. package/server/lib/preview/proxy-runtime.js +1 -1
  137. package/server/lib/preview/proxy-runtime.test.js +4 -0
  138. package/server/lib/relay/DOCUMENTATION.md +5 -0
  139. package/server/lib/relay/tunnel-host.js +2 -1
  140. package/server/lib/ui-auth/DOCUMENTATION.md +8 -0
  141. package/server/lib/ui-auth/ui-auth.js +6 -0
  142. package/server/lib/ui-auth/ui-auth.test.js +10 -0
  143. package/dist/assets/AssistantContactStatus-C5zpVdGa.js +0 -3
  144. package/dist/assets/AssistantUnreadBadge-7KpCtnd3.js +0 -1
  145. package/dist/assets/AssistantView-BZU6TlwK.js +0 -1
  146. package/dist/assets/DiagramView-CXgsVJ3A.js +0 -1
  147. package/dist/assets/GuiPluginSurface-Bk01hnV6.js +0 -1
  148. package/dist/assets/GuiPluginWindow-BgOCEgEb.js +0 -1
  149. package/dist/assets/ImageLoadingPlaceholder-MfVzv_y1.js +0 -1
  150. package/dist/assets/LoadingImage-MAgXscGl.js +0 -1
  151. package/dist/assets/MarkdownRenderer-DswMDaKf.js +0 -2
  152. package/dist/assets/MarkstreamRendererImpl-Bqbq2VPn.js +0 -3
  153. package/dist/assets/MobileDetailNavigation-CXcMdlRH.js +0 -1
  154. package/dist/assets/MobileResizableSheet-D_PnyzR0.js +0 -1
  155. package/dist/assets/MobileShareBridge-DfgyncNh.js +0 -4
  156. package/dist/assets/MobileTabPageHeader-Bm8nYrzH.js +0 -2
  157. package/dist/assets/MultiRunWindow-CvCgKiyV.js +0 -1
  158. package/dist/assets/OnboardingScreen-BwJ3iMGY.js +0 -1
  159. package/dist/assets/SettingsView-DGduWj3I.js +0 -29
  160. package/dist/assets/SettingsWindow-BM8abllV.js +0 -1
  161. package/dist/assets/SetupTourDialog-vmNGHNXl.js +0 -1
  162. package/dist/assets/TerminalView-BZObkK0H.js +0 -8
  163. package/dist/assets/ToolOutputDialog-CbGuK5bP.css +0 -1
  164. package/dist/assets/ToolOutputDialog-D_CH2A0-.js +0 -10
  165. package/dist/assets/VoiceSettings-Ru8tm8eq.js +0 -2
  166. package/dist/assets/YuriLogo-C5K_9jSK.js +0 -1
  167. package/dist/assets/YuriWordmark-CJ8qJ14A.js +0 -1
  168. package/dist/assets/appThemeRegistry-CcdIpK3S.js +0 -1
  169. package/dist/assets/bootstrap-BzeQds0D.js +0 -9
  170. package/dist/assets/desktop-Brp3xDpd.js +0 -1
  171. package/dist/assets/desktopHosts-qQ2Rz26_.js +0 -1
  172. package/dist/assets/desktopRelayRestore-DifJHAur.js +0 -1
  173. package/dist/assets/device-Db_TcRdX.js +0 -2
  174. package/dist/assets/dialog-CgtwKUKd.js +0 -1
  175. package/dist/assets/fileReferenceActions-D06_lyuL.js +0 -1
  176. package/dist/assets/host-8TDDnZXo.js +0 -1
  177. package/dist/assets/image-loading-D1DfK_bJ.js +0 -1
  178. package/dist/assets/insertionBoundaries-B-ncem5c.js +0 -1
  179. package/dist/assets/main-BMvwUUi4.js +0 -2
  180. package/dist/assets/main-Chq1F31E.js +0 -169
  181. package/dist/assets/mcpQueries-BRFr-Gfm.js +0 -1
  182. package/dist/assets/miniChat-C3vDY9WG.js +0 -2
  183. package/dist/assets/mobile-B2KYTY1c.js +0 -2
  184. package/dist/assets/mobileBackNavigation-ByUDCJde.js +0 -1
  185. package/dist/assets/multirun-F1yOJb2_.js +0 -3
  186. package/dist/assets/native-config-C2j59qnN.js +0 -1
  187. package/dist/assets/path-utils-HRmerlyU.js +0 -1
  188. package/dist/assets/platform-Dids8J9D.js +0 -1
  189. package/dist/assets/projectMeta-C08trpZE.js +0 -1
  190. package/dist/assets/pwa-C956NPB0.js +0 -2
  191. package/dist/assets/queue-abort-optimistic-CWyeG_sJ.js +0 -1
  192. package/dist/assets/react-a6PrrNTm.js +0 -1
  193. package/dist/assets/readiness-CUPPcONt.js +0 -1
  194. package/dist/assets/renderElectronMiniChatApp-DNK4YFG8.js +0 -2
  195. package/dist/assets/renderMobileApp-DagPx3n0.js +0 -28
  196. package/dist/assets/runtime-fetch-9B8F_rKW.js +0 -1
  197. package/dist/assets/runtime-file-download-D4WGSMk-.js +0 -1
  198. package/dist/assets/runtime-file-resource-tDTBpJT_.js +0 -2
  199. package/dist/assets/runtime-switch-ibQIZnws.js +0 -1
  200. package/dist/assets/runtimeConfig-D_McrwNd.js +0 -2
  201. package/dist/assets/runtimeEndpointReset-D-aHzKPN.js +0 -149
  202. package/dist/assets/select-DoYUmvbX.js +0 -1
  203. package/dist/assets/sessionLookup-D2JIMvDo.js +0 -1
  204. package/dist/assets/sortable-tabs-strip-B-W7ADKC.js +0 -1
  205. package/dist/assets/src-CzDk_0Pp.css +0 -2
  206. package/dist/assets/terminalApi-BXf0a2VZ.js +0 -1
  207. package/dist/assets/textarea-BCTNmuPZ.js +0 -1
  208. package/dist/assets/url-DO6Zrx1P.js +0 -1
  209. package/dist/assets/useDesktopWindowControlsLayout-YAxhtSDl.js +0 -1
  210. package/dist/assets/useDictation-Dp2Y3X49.js +0 -1
  211. package/dist/assets/useEffectiveDirectory-Uc8I6wXt.js +0 -1
  212. package/dist/assets/useMobileNavigationStore-SCjA_7jP.js +0 -17
  213. package/dist/assets/usePluginsStore-DfksbEZx.js +0 -1
  214. package/dist/assets/useStreamingTextThrottle-BY1Ynoj1.js +0 -1
  215. package/dist/assets/useUIStore-BsCfUWQw.js +0 -1
  216. package/dist/assets/useWorkerHighlightedLines-DAxMD3fK.js +0 -7
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./runtime-switch-ibQIZnws.js";import{n}from"./runtime-fetch-9B8F_rKW.js";import{Mn as r,St as i}from"./bootstrap-BzeQds0D.js";import{n as a}from"./vendor-react-DlzBev0S.js";import{s as o}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{_ as s,g as c}from"./fileQueries-BaEKb7SZ.js";import{Ea as l}from"./useMobileNavigationStore-SCjA_7jP.js";var u=e({mcpConfigsQueryOptions:()=>v,mcpStatusQueryOptions:()=>y,normalizeMcpDirectory:()=>f,readMcpConfigsSnapshot:()=>S,readMcpStatusSnapshot:()=>C,refreshMcpConfigsQuery:()=>w,refreshMcpStatusQuery:()=>T,resolveMcpConfigQueryDirectory:()=>p,useMcpConfigsQuery:()=>b,useMcpStatusQuery:()=>x}),d=a(),f=e=>{if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;let n=t.replace(/\\/g,`/`);return n.length>1?n.replace(/\/+$/,``):n},p=()=>{let e=l.getState().getActiveProject?.();return f(e?.path)??f(r.getDirectory())},m=(e,n=t())=>s.mcp.configs(e,n),h=(e,n=t())=>s.mcp.status(e,n),g=e=>e?r.getScopedApiClient(e):r.getApiClient(),_=e=>e?{location:{directory:e}}:void 0,v=(e=p(),r=t())=>{let i=f(e);return{queryKey:m(i,r),queryFn:async({signal:e})=>{let t=i?`?directory=${encodeURIComponent(i)}`:``,r=await n(`/api/config/mcp${t}`,{headers:i?{"x-opencode-directory":i}:void 0,signal:e});if(!r.ok)throw Error(`Failed to load MCP configs`);let a=await r.json();if(!Array.isArray(a))throw Error(`Invalid MCP configs response`);return a},staleTime:5e3,retry:2}},y=(e,n=t())=>{let r=f(e);return{queryKey:h(r,n),queryFn:async()=>{let e=await g(r).mcp.list(_(r));if(!Array.isArray(e.data))throw Error(`v2 mcp.list returned no data`);let t={};for(let n of e.data)n?.name&&(t[n.name]=n.status);return t},staleTime:2e3,retry:1}},b=(e,t)=>{let n=(0,d.c)(9),i;n[0]===t?i=n[1]:(i=t===void 0?{}:t,n[0]=t,n[1]=i);let a=i,s=l(E),c,u;if(n[2]!==s||n[3]!==e){let t=e===void 0?f(s)??f(r.getDirectory()):f(e);u=o,c=v(t),n[2]=s,n[3]=e,n[4]=c,n[5]=u}else c=n[4],u=n[5];let p;return n[6]!==a.enabled||n[7]!==c?(p={...c,enabled:a.enabled},n[6]=a.enabled,n[7]=c,n[8]=p):p=n[8],u(p)},x=(e,t)=>{let n=(0,d.c)(10),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let a=r,s=i(D),c=e===void 0?s:e,l,u,p;if(n[2]!==a.enabled||n[3]!==c){let e=f(c);l=a.enabled!==!1&&!!e,p=o,u=y(e),n[2]=a.enabled,n[3]=c,n[4]=l,n[5]=u,n[6]=p}else l=n[4],u=n[5],p=n[6];let m;return n[7]!==l||n[8]!==u?(m={...u,enabled:l},n[7]=l,n[8]=u,n[9]=m):m=n[9],p(m)},S=(e=c,n=p(),r=t())=>e.getQueryData(m(f(n),r))??[],C=(e=c,n,r=t())=>e.getQueryData(h(f(n),r))??{},w=async(e,n,r)=>{let i=f(n);return t()===r?e.fetchQuery({...v(i,r),staleTime:0}):S(e,i,r)},T=async(e,n,r)=>{let i=f(n);return t()===r?e.fetchQuery({...y(i,r),staleTime:0}):C(e,i,r)};function E(e){return e.getActiveProject?.()?.path??null}function D(e){return e.currentDirectory}export{w as a,b as c,C as i,x as l,f as n,T as o,S as r,p as s,u as t};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderElectronMiniChatApp-DNK4YFG8.js","assets/rolldown-runtime-hePW80VL.js","assets/desktop-Brp3xDpd.js","assets/runtime-auth-Bh3htXtG.js","assets/runtime-switch-ibQIZnws.js","assets/path-utils-HRmerlyU.js","assets/vendor-base-ui-CzHs0bHY.js","assets/bootstrap-BzeQds0D.js","assets/runtime-fetch-9B8F_rKW.js","assets/vendor-zustand-vDaAPGfl.js","assets/vendor-opencode-client-cQ47ywrT.js","assets/vendor-effect-X1Hqc7ba.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/useUIStore-BsCfUWQw.js","assets/vendor-react-DlzBev0S.js","assets/vendor-pathe-vBmvQE8f.js","assets/fileQueries-BaEKb7SZ.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/runtime-file-resource-tDTBpJT_.js","assets/runtime-file-store-BVRgEtI-.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/platform-Dids8J9D.js","assets/runtime-ead7P81A.js","assets/vendor-sonner-BEHGipm5.js","assets/vendor-reactuses-core-CuTmqEMK.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/useMobileNavigationStore-SCjA_7jP.js","assets/store-Myt_Fv8d.js","assets/tour-DDI0Zg7l.js","assets/useAssistantUIStore-CVSFSgJV.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/MobileShareBridge-DfgyncNh.js","assets/MobileDetailNavigation-CXcMdlRH.js","assets/Icon-DsN23fuV.js","assets/AgentAvatar-DNVD6VCV.js","assets/agentColors-DWSbQXy2.js","assets/vendor-dicebear-core-CV95S5Pg.js","assets/vendor-dicebear-styles-C4OfoX7R.js","assets/dualLimitLru-D8Sphgua.js","assets/useThemeSystem-CNzUUkFn.js","assets/vendor-framer-motion-DDMKlXiP.js","assets/dialog-CgtwKUKd.js","assets/dialog-CTYD3Sbr.css","assets/rasterizePng-056Poix7.js","assets/useAppFontEffects-Blo2lGTo.js","assets/desktopHosts-qQ2Rz26_.js","assets/desktopRelayRestore-DifJHAur.js","assets/vendor-pierre-diffs-BFiZ3IhI.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/fileMentionAutocompleteState-BZJqfgae.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/vendor-fuzzysort-ukaRp9PC.js","assets/gitApi-C6rhS4rG.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/checkbox-CJsiyoER.js","assets/input-B7-PmgcW.js","assets/tooltip-D5Xeh6py.js","assets/pwa-C956NPB0.js","assets/MobileResizableSheet-D_PnyzR0.js","assets/MobileWindowStack-DGLdgoGr.js","assets/select-DoYUmvbX.js","assets/device-Db_TcRdX.js","assets/textarea-BCTNmuPZ.js","assets/OverlayScrollbar-BLhv7Nq-.js","assets/dropdown-menu.styles-BDla58Rm.js","assets/projectMeta-C08trpZE.js","assets/vendor-dnd-kit-core-DK4OoOTr.js","assets/vendor-dnd-kit-accessibility-BOtnpZt5.js","assets/vendor-dnd-kit-sortable-Cv69eQm1.js","assets/vendor-tanstack-react-virtual-DSFNK3qc.js","assets/YuriLogo-C5K_9jSK.js","assets/themes-BgDJcxRc.js","assets/scheduledTaskNavigation-C8tBjNoP.js","assets/theme-validation-BGYdrOu7.js","assets/sessionLookup-D2JIMvDo.js","assets/useDictation-Dp2Y3X49.js","assets/LoadingImage-MAgXscGl.js","assets/ImageLoadingPlaceholder-MfVzv_y1.js","assets/image-loading-D1DfK_bJ.js","assets/image-loading-D9Z_BASK.css","assets/sessionLookup-8C8nv-EP.css","assets/fileMentionTouchSelection-CorehkTj.js","assets/insertionBoundaries-B-ncem5c.js","assets/appThemeRegistry-CcdIpK3S.js","assets/queue-abort-optimistic-CWyeG_sJ.js","assets/MarkdownRenderer-DswMDaKf.js","assets/useEffectiveDirectory-Uc8I6wXt.js","assets/markdownHeightCache-DlRC53XG.js","assets/url-DO6Zrx1P.js","assets/toolHelpers-iEHVHQ9p.js","assets/react-a6PrrNTm.js","assets/FadeInOnReveal-CK7jBcu4.js","assets/useWorkerHighlightedLines-DAxMD3fK.js","assets/markdownTheme-CHNl6tUv.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-cmdk-C_tivUtr.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-B-W7ADKC.js","assets/speechSettingsQueries-CJqxaC2Q.js","assets/vendor-marked-S3gCOYp1.js","assets/vendor-motion-C9oiAdx-.js","assets/useStreamingTextThrottle-BY1Ynoj1.js","assets/useFontPreferences-DqBoLHp6.js","assets/terminalApi-BXf0a2VZ.js","assets/useAppFontEffects-RpgNbjA4.css","assets/useDesktopWindowControlsLayout-YAxhtSDl.js","assets/AssistantContactStatus-C5zpVdGa.js","assets/assistant-attachment-cache-C-SlEpSB.js","assets/src-CzDk_0Pp.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./runtimeConfig-D_McrwNd.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";/* empty css */window.__YURI_RUNTIME_APIS__=e(),t(async()=>{let{renderElectronMiniChatApp:e}=await import(`./renderElectronMiniChatApp-DNK4YFG8.js`);return{renderElectronMiniChatApp: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,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122])).then(({renderElectronMiniChatApp:t})=>{t(window.__YURI_RUNTIME_APIS__??e())});
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-DagPx3n0.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-auth-Bh3htXtG.js","assets/runtime-switch-ibQIZnws.js","assets/runtime-fetch-9B8F_rKW.js","assets/path-utils-HRmerlyU.js","assets/vendor-zustand-vDaAPGfl.js","assets/vendor-base-ui-CzHs0bHY.js","assets/bootstrap-BzeQds0D.js","assets/desktop-Brp3xDpd.js","assets/vendor-opencode-client-cQ47ywrT.js","assets/vendor-effect-X1Hqc7ba.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/useUIStore-BsCfUWQw.js","assets/vendor-react-DlzBev0S.js","assets/vendor-pathe-vBmvQE8f.js","assets/fileQueries-BaEKb7SZ.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/runtime-file-resource-tDTBpJT_.js","assets/runtime-file-store-BVRgEtI-.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/platform-Dids8J9D.js","assets/runtime-ead7P81A.js","assets/capgoAdapter-DceVw3SM.js","assets/types-DXSnGXVb.js","assets/vendor-pierre-diffs-BFiZ3IhI.js","assets/vendor-hast-util-to-html-Bw_SgZ1t.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-BMOrLc9L.js","assets/vendor-sonner-BEHGipm5.js","assets/vendor-reactuses-core-CuTmqEMK.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/useMobileNavigationStore-SCjA_7jP.js","assets/store-Myt_Fv8d.js","assets/tour-DDI0Zg7l.js","assets/useAssistantUIStore-CVSFSgJV.js","assets/vendor-zod-DZzbCm1s.js","assets/vendor-opencode-schema-DWT45VBX.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/MobileShareBridge-DfgyncNh.js","assets/MobileDetailNavigation-CXcMdlRH.js","assets/Icon-DsN23fuV.js","assets/AgentAvatar-DNVD6VCV.js","assets/agentColors-DWSbQXy2.js","assets/vendor-dicebear-core-CV95S5Pg.js","assets/vendor-dicebear-styles-C4OfoX7R.js","assets/dualLimitLru-D8Sphgua.js","assets/useThemeSystem-CNzUUkFn.js","assets/vendor-framer-motion-DDMKlXiP.js","assets/dialog-CgtwKUKd.js","assets/dialog-CTYD3Sbr.css","assets/rasterizePng-056Poix7.js","assets/gitApi-C6rhS4rG.js","assets/useAppFontEffects-Blo2lGTo.js","assets/desktopHosts-qQ2Rz26_.js","assets/desktopRelayRestore-DifJHAur.js","assets/fileMentionAutocompleteState-BZJqfgae.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/vendor-fuzzysort-ukaRp9PC.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/checkbox-CJsiyoER.js","assets/input-B7-PmgcW.js","assets/tooltip-D5Xeh6py.js","assets/pwa-C956NPB0.js","assets/MobileResizableSheet-D_PnyzR0.js","assets/MobileWindowStack-DGLdgoGr.js","assets/select-DoYUmvbX.js","assets/device-Db_TcRdX.js","assets/textarea-BCTNmuPZ.js","assets/OverlayScrollbar-BLhv7Nq-.js","assets/dropdown-menu.styles-BDla58Rm.js","assets/projectMeta-C08trpZE.js","assets/vendor-dnd-kit-core-DK4OoOTr.js","assets/vendor-dnd-kit-accessibility-BOtnpZt5.js","assets/vendor-dnd-kit-sortable-Cv69eQm1.js","assets/vendor-tanstack-react-virtual-DSFNK3qc.js","assets/YuriLogo-C5K_9jSK.js","assets/themes-BgDJcxRc.js","assets/scheduledTaskNavigation-C8tBjNoP.js","assets/theme-validation-BGYdrOu7.js","assets/sessionLookup-D2JIMvDo.js","assets/useDictation-Dp2Y3X49.js","assets/LoadingImage-MAgXscGl.js","assets/ImageLoadingPlaceholder-MfVzv_y1.js","assets/image-loading-D1DfK_bJ.js","assets/image-loading-D9Z_BASK.css","assets/sessionLookup-8C8nv-EP.css","assets/fileMentionTouchSelection-CorehkTj.js","assets/insertionBoundaries-B-ncem5c.js","assets/appThemeRegistry-CcdIpK3S.js","assets/queue-abort-optimistic-CWyeG_sJ.js","assets/MarkdownRenderer-DswMDaKf.js","assets/useEffectiveDirectory-Uc8I6wXt.js","assets/markdownHeightCache-DlRC53XG.js","assets/url-DO6Zrx1P.js","assets/toolHelpers-iEHVHQ9p.js","assets/react-a6PrrNTm.js","assets/FadeInOnReveal-CK7jBcu4.js","assets/useWorkerHighlightedLines-DAxMD3fK.js","assets/markdownTheme-CHNl6tUv.js","assets/markdown-worker-oBGEB9Eg.js","assets/vendor-cmdk-C_tivUtr.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-B-W7ADKC.js","assets/speechSettingsQueries-CJqxaC2Q.js","assets/vendor-marked-S3gCOYp1.js","assets/vendor-motion-C9oiAdx-.js","assets/useStreamingTextThrottle-BY1Ynoj1.js","assets/useFontPreferences-DqBoLHp6.js","assets/terminalApi-BXf0a2VZ.js","assets/useAppFontEffects-RpgNbjA4.css","assets/tap-LkQum5bB.js","assets/MobileTabPageHeader-Bm8nYrzH.js","assets/vendor-codemirror-autocomplete-C0FrlFqZ.js","assets/vendor-codemirror-lang-angular-Cm7vBE3E.js","assets/vendor-codemirror-lang-json-DowyFczU.js","assets/vendor-codemirror-lang-markdown-npWBZIoE.js","assets/vendor-codemirror-lang-python-OPRdU26g.js","assets/vendor-codemirror-legacy-modes-DwltVFbT.js","assets/mcpQueries-BRFr-Gfm.js","assets/usePluginsStore-DfksbEZx.js","assets/collapsible-B3zojUm2.js","assets/vendor-codemirror-commands-5saeUOVY.js","assets/vendor-codemirror-search-hZY-L2l8.js","assets/vendor-replit-codemirror-vim-BmQmU1lR.js","assets/vendor-codemirror-language-data-B3pLWvv-.js","assets/AssistantContactStatus-C5zpVdGa.js","assets/assistant-attachment-cache-C-SlEpSB.js","assets/runtimeEndpointReset-D-aHzKPN.js","assets/YuriWordmark-CJ8qJ14A.js","assets/mobileBackNavigation-ByUDCJde.js","assets/AssistantUnreadBadge-7KpCtnd3.js","assets/context-menu-DFRg1NJF.js","assets/readiness-CUPPcONt.js","assets/native-errors-06if6eu-.js","assets/appearance--vFosLNi.js","assets/vendor-cron-parser-BmO80h0C.js","assets/runtimeEndpointReset-6jhYadQt.css","assets/SettingsView-DGduWj3I.js","assets/native-config-C2j59qnN.js","assets/vendor-qrcode-D7jBCyl-.js","assets/vendor-dijkstrajs-BAzPDGZM.js","assets/VoiceSettings-Ru8tm8eq.js","assets/VoiceSettings-C0HSdVvS.css","assets/GuiPluginWindow-BgOCEgEb.js","assets/vendor-yaml-C9KlJAlj.js","assets/AssistantView-BZU6TlwK.js","assets/touch-gestures-CErgaXZ7.js","assets/renderMobileApp-1G4-5u-t.css","assets/src-CzDk_0Pp.css"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./runtimeConfig-D_McrwNd.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";/* empty css */window.__YURI_RUNTIME_APIS__=e(),t(async()=>{let{renderMobileApp:e}=await import(`./renderMobileApp-DagPx3n0.js`);return{renderMobileApp: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,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159])).then(({renderMobileApp:t})=>{t(window.__YURI_RUNTIME_APIS__??e())});
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{st as t}from"./vendor-base-ui-CzHs0bHY.js";import{n}from"./vendor-react-DlzBev0S.js";import{a as r,n as i}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{n as a}from"./platform-Dids8J9D.js";import{r as o}from"./vendor-reactuses-core-CuTmqEMK.js";import{i as s}from"./appThemeRegistry-CcdIpK3S.js";var c=n(),l=e(t(),1),u=`__yuriMobileBackRoute`,d=()=>typeof window>`u`||a()?null:{currentState:()=>window.history.state&&typeof window.history.state==`object`?window.history.state:null,pushState:e=>window.history.pushState(e,``,window.location.href),back:()=>window.history.back(),subscribe:e=>{let t=t=>e(t.state&&typeof t.state==`object`?t.state:null);return window.addEventListener(`popstate`,t),()=>window.removeEventListener(`popstate`,t)}},f=e=>{let t=e?.[u];return typeof t==`number`&&Number.isFinite(t)?t:null},p=new class{routes=[];listeners=new Set;nextToken=1;history;removeHistoryListener=null;programmaticHistoryBackToken=null;pendingHistoryRemovals=new Map;animatedBackDriver=null;presentationCancelDriver=null;constructor(e=d()){this.history=e}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getTopRoute=()=>this.routes.at(-1)??null;register=e=>{let t=this.pendingHistoryRemovals.get(e.id);this.pendingHistoryRemovals.delete(e.id);let n=!!(this.history&&t!==void 0&&f(this.history.currentState())===t),r={...e,token:n&&t!==void 0?t:this.nextToken++};this.routes.push(r),this.ensureHistoryListener(),this.history&&!n&&this.history.pushState({...this.history.currentState()??{},[u]:r.token}),this.notify();let i=!0;return()=>{if(!i)return;i=!1;let e=this.routes.indexOf(r);e<0||(this.routes.splice(e,1),this.history&&f(this.history.currentState())===r.token?(this.pendingHistoryRemovals.set(r.id,r.token),queueMicrotask(()=>{if(this.pendingHistoryRemovals.get(r.id)===r.token){if(this.pendingHistoryRemovals.delete(r.id),!this.history||f(this.history.currentState())!==r.token){this.routes.length===0&&this.pendingHistoryRemovals.size===0&&this.disposeHistoryListener();return}this.programmaticHistoryBackToken=r.token,this.history.back(),this.routes.length===0&&this.pendingHistoryRemovals.size===0&&this.disposeHistoryListener()}})):this.routes.length===0&&this.pendingHistoryRemovals.size===0&&this.disposeHistoryListener(),this.notify())}};backImmediately=e=>{let t=this.getTopRoute();return!t||e&&t.layer!==e?!1:t.onBack()!==!1};requestAnimatedBack=e=>{let t=this.getTopRoute();return!t||e&&t.layer!==e?!1:this.animatedBackDriver?.(t)?!0:this.backImmediately(e)};setAnimatedBackDriver=e=>(this.animatedBackDriver=e,()=>{this.animatedBackDriver===e&&(this.animatedBackDriver=null)});setPresentationCancelDriver=e=>(this.presentationCancelDriver=e,()=>{this.presentationCancelDriver===e&&(this.presentationCancelDriver=null)});cancelPresentation=()=>{this.presentationCancelDriver?.()};requestBrowserBack=()=>{let e=this.getTopRoute();return e?this.history&&f(this.history.currentState())===e.token?(this.history.back(),!0):e.onBack()!==!1:!1};ensureHistoryListener(){!this.history||this.removeHistoryListener||(this.removeHistoryListener=this.history.subscribe(e=>{if(this.programmaticHistoryBackToken!==null){this.programmaticHistoryBackToken=null;return}let t=this.getTopRoute();t&&f(e)!==t.token&&t.onBack()===!1&&this.history&&this.history.pushState({...this.history.currentState()??{},[u]:t.token})}))}disposeHistoryListener(){this.removeHistoryListener?.(),this.removeHistoryListener=null,this.programmaticHistoryBackToken=null,this.pendingHistoryRemovals.clear()}notify(){this.listeners.forEach(e=>e())}},m=e=>{let t=(0,c.c)(8),{id:n,active:r,layer:i,onBack:a,surfaceRef:s,underlayRef:u}=e,d=i===void 0?`root`:i,f=o(a),m,h;t[0]!==r||t[1]!==f||t[2]!==n||t[3]!==d||t[4]!==s||t[5]!==u?(m=()=>{if(r)return p.register({id:n,layer:d,onBack:f,getSurface:()=>s.current,getUnderlay:()=>u?.current??null})},h=[r,f,n,d,s,u],t[0]=r,t[1]=f,t[2]=n,t[3]=d,t[4]=s,t[5]=u,t[6]=m,t[7]=h):(m=t[6],h=t[7]),l.useEffect(m,h)},h=r(`YuriNavigation`),g=e=>Math.min(1,Math.max(0,Number.isFinite(e)?e:0)),_=(e,t)=>!e||!t?!1:e.onBack()!==!1,v=e=>{let t=g(e.progress),n=e.commit?1-t:t;if(n<=.001)return 0;let r=Math.max(1,e.viewportWidth??390),i=Math.abs(e.velocityX??0)/r,a=n/Math.max(e.commit?2.4:2.8,i)*1e3,o=e.commit?90:100,s=e.commit?320:260;return Math.round(Math.min(s,Math.max(o,a)))},y=e=>{let{surface:t,underlay:n,surfaceTransition:r,surfaceAnimation:i,underlayTransition:a,underlayAnimation:o}=e;t.style.removeProperty(`transform`),t.style.removeProperty(`opacity`),t.style.removeProperty(`will-change`),t.style.removeProperty(`box-shadow`),t.style.transition=r,t.style.animation=i,n&&(n.style.removeProperty(`transform`),n.style.removeProperty(`opacity`),n.style.removeProperty(`will-change`),n.style.transition=a??``,n.style.animation=o??``,delete n.dataset.mobileBackRevealing)},b=(e,t)=>{let n=g(t),{surface:r}=e;r.style.transform=`translate3d(${n*100}%, 0, 0)`},x=e=>!e.surfaceConnected||e.topRouteToken!==e.routeToken||e.routeSurface!==e.outgoingSurface,S=async(e,t,n,r)=>{if(!r&&typeof e.animate==`function`){let r=e.style.transform||`translate3d(0%, 0, 0)`,i=`translate3d(${t}%, 0, 0)`,a=e.animate([{transform:r},{transform:i}],{duration:n,easing:`cubic-bezier(0.22, 1, 0.36, 1)`,fill:`forwards`}),o=!1;try{await a.finished,o=!0}catch{}finally{o&&(e.style.transform=i),a.cancel()}return}e.style.transform=`translate3d(${t}%, 0, 0)`},C=async(e,t,n=typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,r=v({progress:Number.parseFloat(e.style.transform.match(/translate3d\(([-\d.]+)%/)?.[1]??`0`)/100,commit:t}))=>S(e,t?100:0,r,n),w=class{pending=0;enqueue(){this.pending+=1}take(){return this.pending!==0&&(--this.pending,!0)}clear(){this.pending=0}},T=e=>{let t=(0,c.c)(4),{enabled:n,rootRoutesBlocked:r}=e,o,u;t[0]!==n||t[1]!==r?(o=()=>{if(!n||!a()||i.getPlatform()===`web`)return;let e=!1,t=null,o=null,c=0,l=0,u=0,d=new w,f=[],m=e=>!!e&&(!r||e?.layer===`overlay`),x=()=>{let e=m(p.getTopRoute());h.setEnabled({enabled:e}).catch(E)},S=()=>{if(p.cancelPresentation(),o)return;let e=p.getTopRoute();if(!m(e))return;let n=e.getSurface();if(!n)return;n.getAnimations().forEach(D),o=null;let r=e.layer===`root`?e.getUnderlay():null,i=n.style.transition,a=n.style.animation,s=r?.style.transition??null,c=r?.style.animation??null;r?.getAnimations().forEach(O),n.style.transition=`none`,n.style.animation=`none`,n.style.willChange=`transform`,r&&(r.style.removeProperty(`transform`),r.style.removeProperty(`will-change`),r.dataset.mobileBackRevealing=`true`),u+=1,t={route:e,surface:n,underlay:r,surfaceTransition:i,surfaceAnimation:a,underlayTransition:s,underlayAnimation:c},b(t,0)},T=e=>{l=g(e),!c&&(c=window.requestAnimationFrame(()=>{c=0,t&&b(t,l)}))},F=k,I=(n,r,i)=>{if(n&&s(),o)return n&&m(p.getTopRoute())?(d.enqueue(),!0):!1;c&&=(window.cancelAnimationFrame(c),0),t||S(),t&&r!==void 0&&b(t,r);let a=t,f=u;if(t=null,!a){if(!n)return!1;let e=p.getTopRoute();return _(e,m(e))}o=a;let h=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,x=v({progress:g(r??l),commit:n,velocityX:i,viewportWidth:window.innerWidth});return C(a.surface,n,h,x).then(async()=>{f===u&&(!e&&n&&(a.route.onBack(),await F(a)),f===u&&(y(a),o===a&&(o=null),!e&&d.take()&&I(!0,0,0)))}),!0},L=p.setAnimatedBackDriver(e=>e!==p.getTopRoute()||!m(e)?!1:I(!0,0,0)),R=p.subscribe(x);return(async()=>{let t=await h.addListener(`backStarted`,S),n=await h.addListener(`backProgressed`,e=>T(e.progress??0)),r=await h.addListener(`backCancelled`,e=>I(!1,e.progress,e.velocityX)),i=await h.addListener(`backInvoked`,e=>I(!0,e.progress,e.velocityX));if(e){await Promise.all([t.remove(),n.remove(),r.remove(),i.remove()]);return}f.push(t,n,r,i),x()})().catch(A),x(),()=>{e=!0,u+=1,d.clear(),R(),L(),c&&window.cancelAnimationFrame(c),t&&y(t),o&&(o.surface.getAnimations().forEach(j),o.underlay?.getAnimations().forEach(M),y(o)),t=null,o=null,h.setEnabled({enabled:!1}).catch(N),f.forEach(P)}},u=[n,r],t[0]=n,t[1]=r,t[2]=o,t[3]=u):(o=t[2],u=t[3]),l.useEffect(o,u)};function E(){}function D(e){return e.cancel()}function O(e){return e.cancel()}function k(e){return new Promise(t=>{let n=0,r=12,i=!1,a=()=>{i||(i=!0,c(),n&&window.cancelAnimationFrame(n),t())},o=()=>{let t=p.getTopRoute();return x({surfaceConnected:e.surface.isConnected,routeToken:e.route.token,topRouteToken:t?.token??null,routeSurface:e.route.getSurface(),outgoingSurface:e.surface})},s=()=>{if(o()||r<=0){a();return}--r,n=window.requestAnimationFrame(s)},c=p.subscribe(()=>{o()&&a()});s()})}function A(){}function j(e){return e.cancel()}function M(e){return e.cancel()}function N(){}function P(e){e.remove()}export{m as n,T as r,p as t};
@@ -1,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t}from"./desktop-Brp3xDpd.js";import{a as n,r}from"./vendor-zustand-vDaAPGfl.js";import{ot as i,st as a}from"./vendor-base-ui-CzHs0bHY.js";import{Mn as o,St as s,Zr as c,ni as l}from"./bootstrap-BzeQds0D.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{r as u}from"./useUIStore-BsCfUWQw.js";import{n as d}from"./vendor-react-DlzBev0S.js";import{u as f}from"./fileQueries-BaEKb7SZ.js";import{r as p}from"./vendor-reactuses-core-CuTmqEMK.js";import{Br as m,Ea as h,Ja as g,Ji as _,Jn as v,Kn as y,Li as b,Or as x,Va as ee,Xi as S,Yn as C,f as w,jr as T,kr as E,oi as D,p as O,ui as k}from"./useMobileNavigationStore-SCjA_7jP.js";import{n as A}from"./Icon-DsN23fuV.js";import{n as te}from"./gitApi-C6rhS4rG.js";import{t as j}from"./checkbox-CJsiyoER.js";import{t as ne}from"./input-B7-PmgcW.js";import{i as re,n as M,t as ie}from"./tooltip-D5Xeh6py.js";import{a as ae}from"./device-Db_TcRdX.js";import{a as oe,b as se,c as N,f as P,h as F,l as I,o as L,p as R,r as z,w as ce,x as B,y as le}from"./insertionBoundaries-B-ncem5c.js";import{a as V,c as ue,d as H,i as U,n as de,o as W,r as G,s as fe,t as pe}from"./select-DoYUmvbX.js";import{r as K,t as me}from"./textarea-BCTNmuPZ.js";import{a as q,f as J,h as he,i as Y,m as ge,n as _e}from"./projectMeta-C08trpZE.js";import{n as ve,r as ye,t as be}from"./collapsible-B3zojUm2.js";var X=e(a(),1),xe=d(),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};l(e.id,n),O.getState().markSessionAsYuriCreated(e.id),D.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=h.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=s.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:s}=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 c=je();if(!c)return e({error:`Select a project`,isLoading:!1}),null;let l=c.path,u=await te(l)&&t.isolateRuns!==!1,d=Ee(n),f=u?await J(l):void 0,p=u?await I(l):null,h=[],g=s?.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 s=new Map;for(let _ of n.models){let n=`${_.providerID}:${_.modelID}`,v=a.get(n)||1,y=(s.get(n)||0)+1;s.set(n,y);let b=De(_.providerID,_.modelID),x=r.length>1?`g${e+1}`:void 0,ee=v>1?Oe(d,`${b}/${y}`):Oe(d,b),S=x?`${x}/${ee}`:ee,C=Te({groupSlug:d,runGroup:x,providerID:_.providerID,modelID:_.modelID,index:v>1?y:void 0});try{if(!u){let e=await o.withDirectory(l,()=>o.createSession({title:C}));Ae(e,l),h.push({sessionId:e.id,worktreePath:l,providerID:_.providerID,modelID:_.modelID,variant:_.variant,prompt:i});continue}let e=await N(c,{preferredName:S,mode:`new`,branchName:S,worktreeName:S,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:g,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await E(c)&&await m(e.worktreeRoot??e.path);let r=await o.withDirectory(e.path,()=>o.createSession({title:C}));Ae(r,e.path),O.getState().setWorktreeMetadata(r.id,n),h.push({sessionId:r.id,worktreePath:e.path,providerID:_.providerID,modelID:_.modelID,variant:_.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let _=s?.filter(e=>e.trim().length>0)??[];_.length>0&&T(c,_).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let v=h.map(e=>e.sessionId),y=h[0]?.sessionId??null;if(v.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let b=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(h.map(async e=>{try{await w({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:b})}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:v,firstSessionId:y}}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=v(`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)(H,{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)(A,{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:d,dropdownSide:f,dropdownClassName:p,containerClassName:m,triggerIcon:h}=e,g=c===void 0||c,_=f===void 0?`top`:f,{t:x}=ee(),C=b(Le),w=b(Re),T=u(ze),E=u(Be),{favoriteModelsList:D,recentModelsList:O}=ge(),k=u(Ve),te=u(He),[j,ne]=X.useState(!1),[re,M]=X.useState(``),[ie,ae]=X.useState(null),oe=X.useRef(null),se=X.useRef(null),N=l===1,P=l===void 0||n.length<l||N,F;if(t[0]!==n){F=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;F.set(t,(F.get(t)||0)+1)}t[0]=n,t[1]=F}else F=t[1];let I=F,L;t[2]===n?L=t[3]:(L=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=L);let R=L,z,ce;t[4]!==_||t[5]!==j?(z=()=>{if(!j||!se.current)return;let e=se.current.getBoundingClientRect();if(_===`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)))},ce=[_,j],t[4]=_,t[5]=j,t[6]=z,t[7]=ce):(z=t[6],ce=t[7]),X.useEffect(z,ce);let B,le;t[8]!==P||t[9]!==j?(B=()=>{!P&&j&&(ne(!1),M(``))},le=[P,j],t[8]=P,t[9]=j,t[10]=B,t[11]=le):(B=t[10],le=t[11]),X.useEffect(B,le);let V,H;t[12]===j?(V=t[13],H=t[14]):(V=()=>{if(!j)return;let e=e=>{oe.current&&!oe.current.contains(e.target)&&(ne(!1),M(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},H=[j],t[12]=j,t[13]=V,t[14]=H),X.useEffect(V,H);let W;t[15]!==N||t[16]!==r||t[17]!==a||t[18]!==n.length?(W=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:S(e.model,e.modelID)||e.modelID,instanceId:Pe()};N&&n.length>0&&a?a(0,t):r(t),N&&(ne(!1),M(``))},t[15]=N,t[16]=r,t[17]=a,t[18]=n.length,t[19]=W):W=t[19];let G=W,K;t[20]===x?K=t[21]:(K=x(`multirun.modelMultiSelect.search.placeholder`),t[20]=x,t[21]=K);let me;t[22]===x?me=t[23]:(me=x(`multirun.modelMultiSelect.search.noResults`),t[22]=x,t[23]=me);let q;t[24]===x?q=t[25]:(q=x(`multirun.modelMultiSelect.sections.favorites`),t[24]=x,t[25]=q);let J;t[26]===x?J=t[27]:(J=x(`multirun.modelMultiSelect.sections.recent`),t[26]=x,t[27]=J);let Y;t[28]===x?Y=t[29]:(Y=x(`multirun.modelMultiSelect.keyboard.hint`),t[28]=x,t[29]=Y);let _e;t[30]===x?_e=t[31]:(_e=x(`settings.agents.modelSelector.actions.favorite`),t[30]=x,t[31]=_e);let ve;t[32]===x?ve=t[33]:(ve=x(`settings.agents.modelSelector.actions.unfavorite`),t[32]=x,t[33]=ve);let ye;t[34]===x?ye=t[35]:(ye=x(`chat.modelControls.provider`),t[34]=x,t[35]=ye);let be;t[36]===x?be=t[37]:(be=x(`chat.modelControls.capabilities`),t[36]=x,t[37]=be);let Se;t[38]===x?Se=t[39]:(Se=x(`chat.modelControls.capability.toolCalling`),t[38]=x,t[39]=Se);let Ce;t[40]===x?Ce=t[41]:(Ce=x(`chat.modelControls.capability.reasoning`),t[40]=x,t[41]=Ce);let Z;t[42]===x?Z=t[43]:(Z=x(`chat.modelControls.modality.image`),t[42]=x,t[43]=Z);let we;t[44]===x?we=t[45]:(we=x(`chat.modelControls.modality.video`),t[44]=x,t[45]=we);let Te;t[46]===x?Te=t[47]:(Te=x(`chat.modelControls.modality.audio`),t[46]=x,t[47]=Te);let Q;t[48]===x?Q=t[49]:(Q=x(`chat.modelControls.costPerMillion`),t[48]=x,t[49]=Q);let Ee;t[50]===x?Ee=t[51]:(Ee=x(`chat.modelControls.costInput`),t[50]=x,t[51]=Ee);let De;t[52]===x?De=t[53]:(De=x(`chat.modelControls.costOutput`),t[52]=x,t[53]=De);let Oe;t[54]!==K||t[55]!==me||t[56]!==q||t[57]!==J||t[58]!==Y||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:me,favorites:q,recent:J,keyboardHint:Y,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]=me,t[56]=q,t[57]=J,t[58]=Y,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=v(`relative`,m),t[72]=m,t[73]=Ae);let je;t[74]===d?je=t[75]:(je=v(Ne,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,d),t[74]=d,t[75]=je);let Me=!P,Ie;t[76]===j?Ie=t[77]:(Ie=()=>{ne(!j)},t[76]=j,t[77]=Ie);let We;t[78]===h?We=t[79]:(We=h??(0,$.jsx)(A,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=h,t[79]=We);let Ge;t[80]!==s||t[81]!==x?(Ge=s??x(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=x,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)(y,{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]!==P||t[91]!==p||t[92]!==_||t[93]!==D||t[94]!==w||t[95]!==G||t[96]!==k||t[97]!==E||t[98]!==j||t[99]!==ke||t[100]!==I||t[101]!==te||t[102]!==C||t[103]!==O||t[104]!==re||t[105]!==T?(qe=j?(0,$.jsx)(`div`,{className:v(`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`,_===`top`?`bottom-full mb-1`:`top-full mt-1`,p),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(he,{providers:C,providerOrder:te,favoriteModels:D,recentModels:O,getMetadata:w,hiddenModels:k,searchQuery:re,onSearchQueryChange:M,onSelect:G,labels:ke,selectionCount:e=>I.get(`${e.providerID}:${e.modelID}`)||0,disabled:!P,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:ie?`${ie}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:j,isFavorite:e=>E(e.providerID,e.modelID),onToggleFavorite:e=>T(e.providerID,e.modelID),onEscape:()=>{ne(!1),M(``)}})}):null,t[89]=ie,t[90]=P,t[91]=p,t[92]=_,t[93]=D,t[94]=w,t[95]=G,t[96]=k,t[97]=E,t[98]=j,t[99]=ke,t[100]=I,t[101]=te,t[102]=C,t[103]=O,t[104]=re,t[105]=T,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]!==R||t[112]!==I||t[113]!==i||t[114]!==a||t[115]!==C||t[116]!==n||t[117]!==g||t[118]!==x?(Ye=g&&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=I.get(n)||1,o=R(e),s=C.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)(pe,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,$.jsxs)(fe,{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)(A,{name:`brain-ai-3`,className:v(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(ue,{placeholder:x(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?x(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(de,{fitContent:!0,children:[(0,$.jsx)(U,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:x(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=R,t[112]=I,t[113]=i,t[114]=a,t[115]=C,t[116]=n,t[117]=g,t[118]=x,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]!==x?(Ze=o!==void 0&&n.length<o&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?x(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):x(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=x,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)(U,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,xe.c)(30),{git:n}=f(),r=P(e),i=se(e),a=F(e),o=R(e),s=le(Ye),c=le(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 d;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(d=()=>{!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]=d):d=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(d,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,ee;return t[25]!==x||t[26]!==h||t[27]!==_||t[28]!==y?(ee={localBranches:_,remoteBranches:y,isLoading:h,isGitRepository:x},t[25]=x,t[26]=h,t[27]=_,t[28]=y,t[29]=ee):ee=t[29],ee}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 J(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(oe),{sourceBranch:o,shouldClearSavedSourceBranch:s}=L({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(oe),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(pe,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(fe,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(ue,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(de,{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)(G,{children:[(0,$.jsx)(V,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(U,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(W,{}),c.length>0&&(0,$.jsxs)(G,{children:[(0,$.jsx)(V,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(U,{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=b(Qe),u=b($e),d=b(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,_;t[4]!==p.length||t[5]!==u?(g=()=>{p.length===0&&u()},_=[p.length,u],t[4]=p.length,t[5]=u,t[6]=g,t[7]=_):(g=t[6],_=t[7]),X.useEffect(g,_);let y,x;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)},x=[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]=x):(y=t[13],x=t[14]),X.useEffect(y,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=v(`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]=C);let w;t[17]===c?w=t[18]:(w=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=w);let T;t[19]===w?T=t[20]:(T=(0,$.jsx)(ue,{placeholder:w}),t[19]=w,t[20]=T);let E;t[21]!==o||t[22]!==C||t[23]!==T?(E=(0,$.jsx)(fe,{id:o,size:`lg`,className:C,children:T}),t[21]=o,t[22]=C,t[23]=T,t[24]=E):E=t[24];let D;t[25]===h?D=t[26]:(D=h.length>0&&(0,$.jsx)(G,{children:h.map(nt)}),t[25]=h,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(de,{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]!==S||t[33]!==E||t[34]!==O?(k=(0,$.jsxs)(pe,{value:S,onValueChange:r,disabled:a,children:[E,O]}),t[30]=a,t[31]=r,t[32]=S,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 _(e.mode)}function nt(e){return(0,$.jsx)(U,{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)(re,{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)(A,{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)(ie,{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=C(e.path),n=e.icon?Y[e.icon]:null,r=e.color?_e[e.color]:void 0,i=(0,$.jsx)(A,{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)(q,{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(),[o,c]=X.useState(``),[l,u]=X.useState(()=>[{id:Pe(),prompt:``,models:[]}]),[d,f]=X.useState(``),[m,_]=X.useState([]),[b,S]=X.useState(!1),[C,w]=X.useState([]),[T,E]=X.useState(!1),[D,te]=X.useState(!1),[oe,se]=X.useState(!0),N=X.useRef(null),P=s(e=>e.currentDirectory??null),F=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},[]),I=h(e=>e.activeProjectId),L=h(e=>e.setActiveProjectIdOnly),R=h(e=>e.projects),[z,ce]=X.useState(()=>I??null);X.useEffect(()=>{if(I){ce(I);return}!z&&R.length>0&&ce(R[0].id)},[I,R,z]);let B=X.useMemo(()=>z?R.find(e=>e.id===z)??null:null,[R,z]),le=B?.path??P,V=p(e=>{ce(e),e!==I&&L(e)}),H=X.useMemo(()=>{if(B?.path)return{id:B.id,path:B.path};let e=P??F;return e?{id:`path:${e}`,path:e}:null},[B,P,F]),[W]=X.useState(()=>typeof window<`u`&&t()),G=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),me=ae(),q=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},[]),J=X.useMemo(()=>W&&G||me?`pl-[5.5rem]`:`pl-3`,[W,G,me]),he=X.useMemo(()=>!W||!G||q===null?``:q>=26?`h-12`:q<=15?`h-14`:``,[W,G,q]),Y=p(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&W&&await g()}),ge=p(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),_e=!!r;X.useEffect(()=>{if(_e)return window.addEventListener(`keydown`,ge,!0),()=>window.removeEventListener(`keydown`,ge,!0)},[_e]);let[xe,Se]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=We(le),we=X.useRef(!1),Te=Z===!0,Q=Te&&oe;X.useEffect(()=>{if(Z===!1){we.current=!0,se(!1);return}Z===!0&&we.current&&(we.current=!1,se(!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(!H)return;let e=!1;return te(!0),(async()=>{try{let t=await x(H);e||w(t)}catch{}finally{e||te(!1)}})(),()=>{e=!0}},[H]);let ke=p((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=p(e=>{u(t=>t.filter(t=>t.id!==e))}),je=p(()=>{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){k.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),k.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&k.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),N.current&&(N.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)){S(!0),Oe();try{z&&z!==I&&L(z);let e=m.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=C.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:o.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},s=await Ee(a);s&&(s.firstSessionId&&O.getState().setCurrentSession(s.firstSessionId),n?.())}finally{S(!1)}}},Re=!!(o.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Ie>=1&&le&&!Ce&&(Z===!1||!Q||xe)),ze=C.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:Y,className:v(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,J,he),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)(ie,{children:[(0,$.jsx)(re,{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)(A,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(M,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(K,{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`)}),R.length>0?(0,$.jsxs)(pe,{value:z??void 0,onValueChange:V,children:[(0,$.jsx)(fe,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:B?(0,$.jsx)(ue,{children:st(B)}):(0,$.jsx)(ue,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(de,{fitContent:!0,children:R.map(e=>(0,$.jsx)(U,{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)(ne,{id:`group-name`,value:o,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:le,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)(j,{checked:oe,onChange:se,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:f,id:`multirun-agent`})]})]}),(0,$.jsxs)(be,{open:T,onOpenChange:E,children:[(0,$.jsxs)(ye,{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)(A,{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)(A,{name:`arrow-down-s`,className:v(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,T&&`rotate-180`)})]}),(0,$.jsx)(ve,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:D?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[C.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(ne,{value:e,onChange:e=>{let n=[...C];n[t]=e.target.value,w(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>w(C.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)(A,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>w([...C,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(A,{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:N,type:`file`,multiple:!0,className:`hidden`,onChange:Ne,accept:`*/*`}),(0,$.jsxs)(ie,{children:[(0,$.jsx)(re,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>N.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)(A,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(M,{children:a(`multirun.launcher.attachments.tooltip`)})]}),m.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)(A,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(A,{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)(A,{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)(A,{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)(A,{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)(y,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(y,{type:`submit`,size:`sm`,disabled:!Re||b,children:b?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(``),[f,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=p(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=p(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=p(w),E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
2
- `),i=Math.min(n===-1?e.length:n,r===-1?e.length:r);if(t<=i&&n===-1){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
- `)?(d(t),l(!0)):l(!1);return}l(!1)},t[12]=E):E=t[12];let D=p(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 k=p(O),te;t[16]!==n.prompt||t[17]!==k||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=z(t,i===-1?r:i,r,`@${a}`);k(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]=k,t[18]=D,t[19]=te):te=t[19];let j=p(te),ne;t[20]!==n.prompt||t[21]!==k||t[22]!==D?(ne=e=>{let t=n.prompt,r=_.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=z(t,i===-1?r:i,r,`@${e}`);k(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]=k,t[22]=D,t[23]=ne):ne=t[23];let re=p(ne),M;t[24]!==k||t[25]!==D?(M=e=>{let t=`/${e.name} `;k(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]=k,t[25]=D,t[26]=M):M=t[26];let ie=p(M),ae;t[27]!==f||t[28]!==c?(ae=e=>{if(f&&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]=f,t[28]=c,t[29]=ae):ae=t[29];let oe=p(ae),se=r+1,N;t[30]!==s||t[31]!==se?(N=s(`multirun.launcher.groups.groupLabel`,{index:se}),t[30]=s,t[31]=se,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)(A,{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]!==k||t[48]!==D?(V=e=>{let t=e.target.value;k(t);let n=e.target.selectionStart??t.length;D(t,n)},t[47]=k,t[48]=D,t[49]=V):V=t[49];let ue;t[50]===s?ue=t[51]:(ue=s(`multirun.launcher.groups.prompt.placeholder`),t[50]=s,t[51]=ue);let H;t[52]!==n.prompt||t[53]!==oe||t[54]!==V||t[55]!==ue?(H=(0,$.jsx)(me,{ref:_,value:le,onChange:V,onKeyDown:oe,placeholder:ue,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]=ue,t[56]=H):H=t[56];let U;t[57]!==h||t[58]!==ie||t[59]!==f?(U=f?(0,$.jsx)(B,{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]=f,t[60]=U):U=t[60];let de;t[61]!==re||t[62]!==j||t[63]!==u||t[64]!==c?(de=c?(0,$.jsx)(ce,{ref:v,searchQuery:u,onFileSelect:j,onAgentSelect:re,onSkillSelect:e=>re(e.name),onClose:()=>l(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[61]=re,t[62]=j,t[63]=u,t[64]=c,t[65]=de):de=t[65];let W;t[66]!==H||t[67]!==U||t[68]!==de?(W=(0,$.jsxs)(`div`,{className:`relative`,children:[H,U,de]}),t[66]=H,t[67]=U,t[68]=de,t[69]=W):W=t[69];let G;t[70]!==R||t[71]!==W?(G=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[R,W]}),t[70]=R,t[71]=W,t[72]=G):G=t[72];let fe;t[73]===s?fe=t[74]:(fe=s(`multirun.launcher.models.info`,{max:it}),t[73]=s,t[74]=fe);let pe;t[75]===fe?pe=t[76]:(pe=(0,$.jsx)(at,{children:fe}),t[75]=fe,t[76]=pe);let K;t[77]===s?K=t[78]:(K=s(`multirun.launcher.models.label`),t[77]=s,t[78]=K);let q;t[79]!==pe||t[80]!==K?(q=(0,$.jsx)(ot,{required:!0,info:pe,children:K}),t[79]=pe,t[80]=K,t[81]=q):q=t[81];let J;t[82]!==n.models||t[83]!==x||t[84]!==C||t[85]!==T?(J=(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]=J):J=t[86];let he;t[87]!==q||t[88]!==J?(he=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[q,J]}),t[87]=q,t[88]=J,t[89]=he):he=t[89];let Y;return t[90]!==I||t[91]!==G||t[92]!==he?(Y=(0,$.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-3`,children:[I,G,he]}),t[90]=I,t[91]=G,t[92]=he,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 +0,0 @@
1
- import{a as e}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{n as t}from"./platform-Dids8J9D.js";import{t as n}from"./types-DXSnGXVb.js";var r=e(`YuriUpdateConfig`);async function i(){if(!t())throw new n;let e=await r.getConfiguration();if(e.channel!==`stable`&&e.channel!==`beta`||typeof e.shellApiVersion!=`number`||!Number.isInteger(e.shellApiVersion)||e.shellApiVersion<1)throw Error(`Invalid native update configuration`);return{channel:e.channel,shellApiVersion:e.shellApiVersion}}export{i as t};
@@ -1 +0,0 @@
1
- var e=null,t=t=>{e=t},n=()=>e||(typeof window>`u`?null:window.__YURI_RUNTIME_APIS__??null),r=/^[A-Za-z]:\/$/,i=/^[A-Za-z]:\//,a=e=>{if(typeof e!=`string`)return``;let t=e.trim();if(!t)return``;let n=t.replace(/\\/g,`/`),i=n.startsWith(`//`),a=n.replace(/\/+/g,`/`);i&&!a.startsWith(`//`)&&(a=`/${a}`);let o=a===`/`,s=r.test(a);return!o&&!s&&(a=a.replace(/\/+$/,``)),a},o=e=>{let t=a(e);return t.startsWith(`/`)||i.test(t)},s=e=>{let t=a(e);return i.test(t)||t.startsWith(`//`)?t.toLowerCase():t},c=e=>e.split(`/`).filter(Boolean),l=(e,t)=>{let n=[...e];for(let e of c(t))if(e!==`.`){if(e===`..`){n.length>0&&n.pop();continue}n.push(e)}return n},u=(e,t)=>{let n=a(t);if(!n)return a(e);if(o(n))return n;let r=a(e);if(!r)return n;let s=i.test(r)?r.slice(0,2):``,u=r.startsWith(`//`),d=r.startsWith(`/`)&&!u,f=l(c(s?r.slice(2):r),n).join(`/`);return s?f?`${s}/${f}`:`${s}/`:u?`//${f}`:d?`/${f}`:f},d=(e,t)=>{let n=a(e),r=a(t);if(!n||!r)return!1;let i=s(n),o=s(r);return i===o||i.startsWith(`${o}/`)},f=(e,t)=>{let n=a(e),r=a(t);return n?r?s(n)===s(r)?`.`:d(n,r)?n.slice(r.length+1):n:n:``},p=(e,t)=>{let n=a(e),r=a(t);if(n&&(!r||d(r,n))||!r)return n;let i=r.lastIndexOf(`/`);return i===0?`/`:i<0?n||r:/^[A-Za-z]:\//.test(r)&&i===2?r.slice(0,3):r.slice(0,i)};export{a,t as c,d as i,f as n,u as o,o as r,n as s,p as t};
@@ -1 +0,0 @@
1
- import{C as e,E as t}from"./desktop-Brp3xDpd.js";import{i as n}from"./vendor-pathe-vBmvQE8f.js";var r=e=>/^[\\/]+$/.test(e),i=e=>{if(typeof e!=`string`)return null;let t=e.trim();if(!t)return null;if(r(t))return t.length===1?`/`:null;let i=n(t);return i===`/`?`/`:(i.length>1?i.replace(/\/+$/,``):i)||null},a=e=>{if(typeof e!=`string`)return``;let t=e.trim();return t?i(t)??t:``},o=()=>typeof window>`u`?!1:window.Capacitor?.isNativePlatform?.()===!0||window.location.protocol===`capacitor:`,s=()=>{if(typeof window>`u`||!o()||c()!==`ios`)return!1;let e=navigator.userAgent||``,t=navigator.maxTouchPoints??0;return/iPad/i.test(e)||/Macintosh|MacIntel/i.test(e)&&t>1},c=()=>{if(typeof window<`u`){let e=window.Capacitor?.getPlatform?.();if(e===`ios`||e===`android`)return e}return t()?`vscode`:e()?`desktop`:`web`};export{i as a,a as i,o as n,s as r,c as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,t as r}from"./runtime-switch-ibQIZnws.js";import{n as i}from"./runtime-fetch-9B8F_rKW.js";import{a,i as o}from"./vendor-zustand-vDaAPGfl.js";import{ot as s,st as c}from"./vendor-base-ui-CzHs0bHY.js";import{W as l}from"./bootstrap-BzeQds0D.js";import{r as u}from"./useUIStore-BsCfUWQw.js";import{n as d}from"./vendor-react-DlzBev0S.js";import{Fr as f,Ha as p,Ir as m,Jn as h,Kn as g,Li as _,Lr as v,Mr as y,Pr as b,Rr as x,Sr as ee,Va as te,Xi as ne,ji as re,p as S,ui as ie,x as C}from"./useMobileNavigationStore-SCjA_7jP.js";import{n as w}from"./Icon-DsN23fuV.js";import{k as ae,l as oe,v as se,x as T}from"./gitApi-C6rhS4rG.js";import{t as ce}from"./input-B7-PmgcW.js";import{n as le,t as ue}from"./tooltip-D5Xeh6py.js";import{d as de,l as fe}from"./select-DoYUmvbX.js";import{_ as pe,l as me,o as he,s as ge,t as _e,v as ve,y as ye}from"./vendor-dnd-kit-core-DK4OoOTr.js";import{n as be,o as xe,s as Se,t as Ce}from"./vendor-dnd-kit-sortable-Cv69eQm1.js";import{n as we}from"./textarea-BCTNmuPZ.js";import{t as Te}from"./vendor-tanstack-react-virtual-DSFNK3qc.js";var E=e(c(),1),D=d(),Ee={compact:{notation:`compact`,compactDisplay:`short`,maximumFractionDigits:1,minimumFractionDigits:0},compactTokensShort:{notation:`compact`,compactDisplay:`short`,maximumFractionDigits:1},usd:{style:`currency`,currency:`USD`,maximumFractionDigits:4,minimumFractionDigits:2}},O=null,k={},A=(e,t)=>{O!==t&&(O=t,k.compact=void 0,k.compactTokensShort=void 0,k.usd=void 0);let n=k[e];if(n)return n;let r=new Intl.NumberFormat(t,Ee[e]);return k[e]=r,r},j=(e,t=p())=>A(`compact`,t).format(e),De=(e,t=p())=>A(`compactTokensShort`,t).format(e),M=(e,t=p())=>A(`usd`,t).format(e),Oe=(e,t=p())=>e.toLocaleDateString(t,{month:`short`,day:`numeric`,year:`numeric`}),ke=(e,t=p())=>new Date(e).toLocaleDateString(t,{year:`numeric`,month:`short`,day:`numeric`}),Ae=(e,t=p())=>new Date(e).toLocaleTimeString(t,{hour:`numeric`,minute:`2-digit`}),je=(e,t)=>{if(!e||typeof e!=`object`)return;let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0},Me=(e,t,n)=>{let r=je(t.limit,`context`),i=je(t.limit,`output`),a=r??n?.limit?.context,o=i??n?.limit?.output;return a===void 0&&o===void 0?n:{...n??{id:typeof t.id==`string`?t.id:``,providerId:e,name:typeof t.name==`string`?t.name:void 0},limit:{...n?.limit,...a===void 0?{}:{context:a},...o===void 0?{}:{output:o}}}};function N(e){let t=e.toLowerCase().trim();return{lower:t,compact:t.replace(/[^a-z0-9]/g,``),tokens:t.split(/[^a-z0-9]+/).filter(Boolean)}}function Ne(e,t){let n=N(t);if(!n.lower)return!0;let r=N(e);return r.lower.includes(n.lower)||n.compact.length>=2&&r.compact.includes(n.compact)?!0:n.tokens.length!==0&&n.tokens.every(e=>r.tokens.some(t=>t.startsWith(e)||t.includes(e)))}var Pe=a()(o(e=>({collapsedSections:{},toggleSection:t=>e(e=>{let n={...e.collapsedSections};return n[t]?delete n[t]:n[t]=!0,{collapsedSections:n}})}),{name:`model-picker-collapsed-sections`,version:1})),P=s(),Fe={image:{icon:`file-image`,labelKey:`modalityImage`},video:{icon:`file-video`,labelKey:`modalityVideo`},audio:{icon:`file-music`,labelKey:`modalityAudio`}},Ie=e=>e.trim().toLowerCase(),F=e=>{let t=(0,D.c)(5),{iconName:n,label:r}=e,i;t[0]===n?i=t[1]:(i=(0,P.jsx)(w,{name:n,className:`size-3.5`}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,P.jsx)(`span`,{className:`flex size-4 flex-shrink-0 items-center justify-center text-muted-foreground`,title:r,"aria-label":r,role:`img`,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a},Le=(e,t)=>{let n=[];e?.tool_call&&t.capabilityToolCalling&&n.push({key:`tool_call`,icon:`tools`,label:t.capabilityToolCalling}),e?.reasoning&&t.capabilityReasoning&&n.push({key:`reasoning`,icon:`brain-ai-3`,label:t.capabilityReasoning});let r=[...e?.modalities?.input??[],...e?.modalities?.output??[]],i=Array.from(new Set(r.map(Ie).filter(Boolean)));for(let e of i){let r=Fe[e];if(!r)continue;let i=t[r.labelKey];i&&n.push({key:`modality-${e}`,icon:r.icon,label:i})}return n},Re=e=>ne(e,void 0,{maxLength:40}),ze=e=>{if(typeof e!=`number`||Number.isNaN(e))return``;if(e===0)return`0`;let t=j(e);return t.endsWith(`.0`)?t.slice(0,-2):t},Be=e=>typeof e!=`number`||!Number.isFinite(e)?`—`:M(e),I=(e,t)=>t?!0:e?!!(e.tool_call||e.reasoning||e.cost?.input!==void 0||e.cost?.output!==void 0||(e.modalities?.input?.length??0)>0||(e.modalities?.output?.length??0)>0):!1,Ve=e=>{let t=(0,D.c)(21),{metadata:n,providerName:r,providerID:i,modelID:a,active:o,anchor:s,labels:c,children:l}=e,{t:u}=te(),[d,f]=E.useState(!1),p=`${i}/${a}`,m,h;t[0]===o?(m=t[1],h=t[2]):(m=()=>{if(!o){f(!1);return}let e=window.setTimeout(()=>f(!0),450);return()=>window.clearTimeout(e)},h=[o],t[0]=o,t[1]=m,t[2]=h),E.useEffect(m,h);let _;t[3]!==o||t[4]!==d||t[5]!==n||t[6]!==r?(_=o&&d&&I(n,r),t[3]=o,t[4]=d,t[5]=n,t[6]=r,t[7]=_):_=t[7];let v=_,y,b;if(t[8]!==s||t[9]!==l||t[10]!==c||t[11]!==n||t[12]!==p||t[13]!==r||t[14]!==v||t[15]!==u){let e=v?Le(n,c):[],i=n?.cost?.input!==void 0||n?.cost?.output!==void 0;y=l,b=v?(0,P.jsx)(ue,{open:!0,onOpenChange:R,children:(0,P.jsx)(le,{anchor:s,side:`right`,sideOffset:8,className:`min-w-52 max-w-xs text-left transition-none data-[starting-style]:opacity-100 data-[starting-style]:scale-100 data-[ending-style]:opacity-100 data-[ending-style]:scale-100`,children:(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 text-left text-xs`,children:[r&&c.provider?(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`typography-meta font-medium`,children:c.provider}),(0,P.jsx)(`span`,{className:`typography-meta text-foreground`,children:r})]}):null,e.length>0?(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-muted-foreground`,children:[(0,P.jsx)(`span`,{className:`typography-meta font-medium shrink-0`,children:c.capabilities}),(0,P.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:e.map(z)})]}):null,i?(0,P.jsxs)(`div`,{className:`flex items-start justify-between gap-3 text-muted-foreground`,children:[c.costPerMillion?(0,P.jsx)(`span`,{className:`typography-meta font-medium shrink-0`,children:c.costPerMillion}):null,(0,P.jsxs)(`div`,{className:`flex flex-col items-end gap-0.5 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 min-w-0`,children:[c.costInput?(0,P.jsx)(`span`,{className:`typography-meta shrink-0`,children:c.costInput}):null,(0,P.jsx)(`span`,{className:`typography-meta text-foreground tabular-nums`,children:Be(n?.cost?.input)})]}),(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 min-w-0`,children:[c.costOutput?(0,P.jsx)(`span`,{className:`typography-meta shrink-0`,children:c.costOutput}):null,(0,P.jsx)(`span`,{className:`typography-meta text-foreground tabular-nums`,children:Be(n?.cost?.output)})]})]})]}):null,(0,P.jsx)(g,{variant:`ghost`,size:`xs`,className:`h-auto min-h-0 w-full min-w-0 justify-end gap-0 rounded-none p-0 text-right cursor-copy font-normal text-muted-foreground hover:bg-transparent active:bg-transparent`,"aria-label":u(`onboarding.common.copyToClipboard`),title:p,onClick:async e=>{e.stopPropagation();try{(await re(p)).ok?ie.success(u(`contextSidebar.actions.copied`)):ie.error(u(`filesView.toast.copyFailed`))}catch{ie.error(u(`filesView.toast.copyFailed`))}},children:(0,P.jsx)(`span`,{className:`block w-full min-w-0 truncate text-right text-[10px] leading-tight`,children:p})})]})})}):null,t[8]=s,t[9]=l,t[10]=c,t[11]=n,t[12]=p,t[13]=r,t[14]=v,t[15]=u,t[16]=y,t[17]=b}else y=t[16],b=t[17];let x;return t[18]!==y||t[19]!==b?(x=(0,P.jsxs)(P.Fragment,{children:[y,b]}),t[18]=y,t[19]=b,t[20]=x):x=t[20],x},He=()=>{let e=0,t=new Set,n=new Map,r=e=>{let t=n.get(e);if(t)for(let e of t)e()};return{getSnapshot:()=>e,subscribe:e=>(t.add(e),()=>t.delete(e)),subscribeIndex:(e,t)=>{let r=n.get(e);return r||(r=new Set,n.set(e,r)),r.add(t),()=>{r.delete(t),r.size===0&&n.delete(e)}},set:n=>{if(e===n)return;let i=e;e=n,r(i),r(n);for(let e of t)e()}}},Ue=E.memo(e=>{let t=(0,D.c)(12),{store:n,index:r,children:i}=e,a;t[0]!==r||t[1]!==n?(a=()=>n.getSnapshot()===r,t[0]=r,t[1]=n,t[2]=a):a=t[2];let[o,s]=E.useState(a),c,l;t[3]!==r||t[4]!==n?(c=()=>{let e=()=>s(n.getSnapshot()===r);return e(),n.subscribeIndex(r,e)},l=[r,n],t[3]=r,t[4]=n,t[5]=c,t[6]=l):(c=t[5],l=t[6]),E.useEffect(c,l);let u;t[7]!==i||t[8]!==o?(u=i(o),t[7]=i,t[8]=o,t[9]=u):u=t[9];let d;return t[10]===u?d=t[11]:(d=(0,P.jsx)(P.Fragment,{children:u}),t[10]=u,t[11]=d),d}),We=e=>{let t=(0,D.c)(11),{store:n,flatModelList:r,footerContent:i,fallback:a}=e,o;t[0]===n?o=t[1]:(o=()=>n.getSnapshot(),t[0]=n,t[1]=o);let[s,c]=E.useState(o),l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>n.subscribe(()=>c(n.getSnapshot())),u=[n],t[2]=n,t[3]=l,t[4]=u),E.useEffect(l,u);let d=r[s],f;t[5]!==d||t[6]!==a||t[7]!==i?(f=typeof i==`function`?i(d):i??a,t[5]=d,t[6]=a,t[7]=i,t[8]=f):f=t[8];let p;return t[9]===f?p=t[10]:(p=(0,P.jsx)(P.Fragment,{children:f}),t[9]=f,t[10]=p),p},Ge=e=>{let t=(0,D.c)(21),{id:n,disabled:r,children:i}=e,a=r!==void 0&&r,o;t[0]!==a||t[1]!==n?(o={id:n,disabled:a},t[0]=a,t[1]=n,t[2]=o):o=t[2];let{attributes:s,listeners:c,setNodeRef:l,setActivatorNodeRef:u,transform:d,transition:f,isDragging:p}=xe(o),m;t[3]===d?m=t[4]:(m=ye.Transform.toString(d),t[3]=d,t[4]=m);let g;t[5]!==m||t[6]!==f?(g={transform:m,transition:f},t[5]=m,t[6]=f,t[7]=g):g=t[7];let _=p&&`opacity-60`,v;t[8]===_?v=t[9]:(v=h(_),t[8]=_,t[9]=v);let y;t[10]!==s||t[11]!==i||t[12]!==p||t[13]!==c||t[14]!==u?(y=i({attributes:s,listeners:c,setActivatorNodeRef:u,isDragging:p}),t[10]=s,t[11]=i,t[12]=p,t[13]=c,t[14]=u,t[15]=y):y=t[15];let b;return t[16]!==l||t[17]!==g||t[18]!==v||t[19]!==y?(b=(0,P.jsx)(`div`,{ref:l,style:g,className:v,children:y}),t[16]=l,t[17]=g,t[18]=v,t[19]=y,t[20]=b):b=t[20],b},Ke=e=>{let t=(0,D.c)(21),{id:n,disabled:r,children:i}=e,a=r!==void 0&&r,o;t[0]!==a||t[1]!==n?(o={id:n,disabled:a},t[0]=a,t[1]=n,t[2]=o):o=t[2];let{attributes:s,listeners:c,setNodeRef:l,setActivatorNodeRef:u,transform:d,transition:f,isDragging:p}=xe(o),m;t[3]===d?m=t[4]:(m=ye.Translate.toString(d),t[3]=d,t[4]=m);let g;t[5]!==m||t[6]!==f?(g={transform:m,transition:f},t[5]=m,t[6]=f,t[7]=g):g=t[7];let _=p&&`opacity-60`,v;t[8]===_?v=t[9]:(v=h(_),t[8]=_,t[9]=v);let y;t[10]!==s||t[11]!==i||t[12]!==p||t[13]!==c||t[14]!==u?(y=i({attributes:s,listeners:c,setActivatorNodeRef:u,isDragging:p}),t[10]=s,t[11]=i,t[12]=p,t[13]=c,t[14]=u,t[15]=y):y=t[15];let b;return t[16]!==l||t[17]!==g||t[18]!==v||t[19]!==y?(b=(0,P.jsx)(`div`,{ref:l,style:g,className:v,children:y}),t[16]=l,t[17]=g,t[18]=v,t[19]=y,t[20]=b):b=t[20],b},qe=32,Je=(e,t)=>{if(!t)return;if(!e){t.scrollIntoView({block:`nearest`});return}let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-n.top+e.scrollTop,a=i+r.height,o=e.scrollTop,s=o+e.clientHeight,c=i<o+qe?i-qe:a>s?a-e.clientHeight:o,l=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=Math.max(0,Math.min(c,l))},L=({providers:e,favoriteModels:t,recentModels:n,getMetadata:r,searchQuery:i,onSearchQueryChange:a,onSelect:o,labels:s,selectedModel:c,hiddenModels:l=[],allowedProviderIds:u,allowedModelIdsByProvider:d,includeNotSelected:f=!1,onSelectNone:p,selectionCount:m,disabled:g=!1,maxHeightClassName:_=`max-h-[min(400px,calc(100dvh-12rem))] flex-1`,maxHeightStyle:v,sectionHeaderClassName:y,rowClassName:b,stickyHeaders:x=!0,autoFocus:ee=!0,onEscape:te,isFavorite:ne,onToggleFavorite:re,renderRowEnd:S,onActiveKeyDown:ie,onActiveEntryChange:C,onVariantKey:ae,onReorderFavorite:oe,reorderFavoriteAriaLabel:se,reorderFavoriteTitle:T,providerOrder:le,onReorderProvider:ue,reorderProviderTitle:ye,footerContent:xe,renderVersion:D,tooltipsEnabled:Ee=!0,virtualize:O=!1})=>{let k=E.useRef(null);k.current||=He();let A=k.current,j=E.useRef([]),De=E.useRef(null),M=E.useRef(!1),Oe=E.useRef(null),ke=Pe(e=>e.collapsedSections),Ae=Pe(e=>e.toggleSection),je=E.useMemo(()=>new Set(Object.keys(ke).filter(e=>ke[e])),[ke]),N=i.trim().length>0,[Fe,Ie]=E.useState(()=>new Set),F=N?Fe:je,Le=ve(pe(ge,{activationConstraint:{distance:8}})),Be=ve(pe(he,{activationConstraint:{distance:8}})),I=E.useMemo(()=>!u||u.length===0?null:new Set(u),[u]),qe=E.useMemo(()=>d?new Map(Object.entries(d).map(([e,t])=>[e,new Set(t)])):null,[d]),L=E.useCallback((e,t)=>!qe||qe.get(e)?.has(t)===!0,[qe]),R=E.useMemo(()=>new Map(e.map(e=>[e.id,e])),[e]),z=E.useCallback((e,t)=>l.some(n=>n.providerID===e&&n.modelID===t),[l]),B=E.useCallback((e,t)=>{let n=i.trim();return!n||Ne(`${t} ${e}`,n)},[i]),V=E.useMemo(()=>t.filter(({model:e,providerID:t,modelID:n})=>{if(I&&!I.has(t)||!L(t,n)||z(t,n))return!1;let r=R.get(t)?.name||t;return B(Re(e),r)}),[I,t,L,z,B,R]),H=E.useMemo(()=>n.filter(({model:e,providerID:t,modelID:n})=>{if(I&&!I.has(t)||!L(t,n)||z(t,n))return!1;let r=R.get(t)?.name||t;return B(Re(e),r)}),[I,L,z,B,R,n]),Ye=E.useMemo(()=>{if(!le||le.length===0)return e;let t=new Map(le.map((e,t)=>[e,t])),n=e.filter(e=>t.has(e.id)).sort((e,n)=>(t.get(e.id)??0)-(t.get(n.id)??0)),r=e.filter(e=>!t.has(e.id));return[...n,...r]},[le,e]),U=E.useMemo(()=>Ye.filter(e=>!I||I.has(e.id)).map(e=>{let t=(Array.isArray(e.models)?e.models:[]).filter(t=>{let n=typeof t.id==`string`?t.id:``;return!n||z(e.id,n)||!L(e.id,n)?!1:B(Re(t),e.name||e.id)});return{...e,models:t}}).filter(e=>e.models.length>0),[I,L,z,B,Ye]),{flatModelList:W,modelRowIndices:Xe}=E.useMemo(()=>{let e=[],t=new Map,n=(n,r)=>{t.set(`${r}:${n.providerID}:${n.modelID}`,e.length),e.push(n)};return F.has(`favorites`)||V.forEach(e=>n(e,`fav`)),F.has(`recent`)||H.forEach(e=>n(e,`recent`)),U.forEach(e=>{F.has(`provider:${e.id}`)||e.models.forEach(t=>n({model:t,providerID:e.id,modelID:t.id},`provider`))}),{flatModelList:e,modelRowIndices:t}},[F,V,U,H]),[G,Ze]=E.useState(16);E.useLayoutEffect(()=>{O&&Ze(Number.parseFloat(getComputedStyle(document.documentElement).fontSize)||16)},[O]);let K=E.useMemo(()=>{if(!O)return[];let e=[],t=0,n=(n,r,i,a)=>{if(e.push({key:n,height:(1.5+(a?.625:0))*G,modelIndex:-1}),!F.has(n))for(let a of r)e.push({key:`${n}:${a.providerID}:${a.modelID}`,height:i*G,modelIndex:t++})};return V.length&&n(`favorites`,V,2.5,!1),H.length&&n(`recent`,H,2.5,V.length>0),U.forEach((e,t)=>n(`provider:${e.id}`,e.models.map(t=>({model:t,providerID:e.id,modelID:t.id})),2,t>0||V.length>0||H.length>0)),e},[F,V,U,H,G,O]),Qe=E.useMemo(()=>({estimateSize:e=>K[e].height,getItemKey:e=>K[e].key}),[K]),$e=Te({enabled:O,count:K.length,getScrollElement:()=>De.current,...Qe,paddingStart:.375*G,paddingEnd:.375*G,overscan:6,initialRect:{width:400,height:400}}).getVirtualItems(),et=new Set($e.map(e=>K[e.index].modelIndex)),q=W.length>0,J=!!oe&&i.trim().length===0&&V.length>1,tt=!!ue&&i.trim().length===0&&!I&&U.length>1,nt=E.useMemo(()=>new Map(V.map(e=>[`${e.providerID}:${e.modelID}`,e])),[V]);E.useEffect(()=>{A.set(0)},[i,A]),E.useEffect(()=>{N||Ie(e=>e.size===0?e:new Set)},[N]);let rt=E.useCallback(e=>{A.set(e),C?.(W[e])},[W,C,A]),it=E.useCallback(e=>{let t=W.length;if(t===0)return;M.current=!0,Oe.current=null;let n=(A.getSnapshot()+e+t)%t;A.set(n),C?.(W[n]),requestAnimationFrame(()=>Je(De.current,j.current[n]))},[W,C,A]);E.useEffect(()=>{C?.(W[A.getSnapshot()])},[W,C,A]);let at=E.useCallback(e=>{if(!e.defaultPrevented){if(e.stopPropagation(),e.key===`ArrowLeft`||e.key===`ArrowRight`){let t=W[A.getSnapshot()];if(t&&ae?.(e,t))return}if(ie?.(e,W[A.getSnapshot()]),!e.defaultPrevented){if(e.key===`ArrowDown`){e.preventDefault(),it(1);return}if(e.key===`ArrowUp`){e.preventDefault(),it(-1);return}if(e.key===`Enter`){e.preventDefault();let t=W[A.getSnapshot()];t&&!g&&o(t);return}e.key===`Escape`&&(e.preventDefault(),te?.())}}},[g,W,it,ie,te,o,ae,A]),ot=h(`model-picker-section-header typography-micro font-semibold text-muted-foreground uppercase tracking-wider flex items-center gap-2 px-2 py-1.5`,x&&`sticky top-0 z-10 [background:linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))]`,y),st=(e,t,n,i)=>{let a=Xe.get(`${t}:${e.providerID}:${e.modelID}`);if(a===void 0)return null;if(O&&!i?.isDragging&&!($e.length?et.has(a):a<12))return(0,P.jsx)(`div`,{ref:e=>{j.current[a]=e},className:`model-picker-row-placeholder`,"data-model-section":t,"aria-hidden":`true`},`${t}-${e.providerID}-${e.modelID}`);let l=Me(e.providerID,e.model,r?.(e.providerID,e.modelID)),u=R.get(e.providerID)?.name||e.providerID,d=ze(l?.limit?.context),f=m?.(e)??0,p=c?.providerID===e.providerID&&c.modelID===e.modelID,_=ne?.(e)??!1,v=e=>{let t={x:e.clientX,y:e.clientY},n=Oe.current,r=!n||n.x!==t.x||n.y!==t.y;Oe.current=t,!(M.current&&!n)&&(M.current&&!r||(M.current&&r&&(M.current=!1),rt(a)))};return(0,P.jsx)(Ue,{store:A,index:a,renderVersion:D,children:r=>{let c=(0,P.jsxs)(`div`,{ref:e=>{j.current[a]=e},role:`option`,"data-model-section":t,"aria-selected":p,"aria-setsize":O?W.length:void 0,"aria-posinset":O?a+1:void 0,"aria-disabled":g||void 0,tabIndex:-1,onClick:()=>{g||o(e)},onKeyDown:t=>{g||(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),o(e))},onMouseEnter:v,onMouseMove:v,className:h(`model-picker-row w-full text-left px-2 py-1.5 rounded-md typography-meta flex items-center gap-2 cursor-pointer`,!g&&(r?`bg-interactive-selection`:`hover:bg-interactive-hover/50`),g&&`cursor-not-allowed opacity-60`,b),children:[(0,P.jsxs)(`div`,{className:`model-picker-row-main flex items-center gap-1.5 flex-1 min-w-0`,children:[i?(0,P.jsx)(`button`,{type:`button`,ref:i.setActivatorNodeRef,...i.attributes,...i.listeners,disabled:g,onClick:e=>{e.preventDefault(),e.stopPropagation()},className:`model-favorite-drag-handle flex size-4 flex-shrink-0 items-center justify-center text-muted-foreground hover:text-foreground disabled:pointer-events-none`,"aria-label":se,title:T,children:(0,P.jsx)(w,{name:`draggable`,className:`size-3.5`})}):null,n?(0,P.jsx)(de,{modelId:e.modelID,providerId:e.providerID,className:`h-3.5 w-3.5 flex-shrink-0`}):null,(0,P.jsxs)(`span`,{className:`model-picker-row-labels contents`,children:[(0,P.jsx)(`span`,{className:`model-picker-row-name font-medium truncate`,children:Re(e.model)}),(0,P.jsxs)(`span`,{className:`model-picker-row-meta contents`,children:[t===`provider`?null:(0,P.jsx)(`span`,{className:`model-picker-row-provider hidden truncate`,children:u}),d?(0,P.jsx)(`span`,{className:`model-picker-row-context typography-micro text-muted-foreground flex-shrink-0`,children:d}):null]})]})]}),f>0?(0,P.jsxs)(`span`,{className:`typography-micro text-muted-foreground flex-shrink-0`,children:[`x`,f]}):null,S?.(e,{isHighlighted:r,isSelected:p}),(0,P.jsx)(`span`,{className:h(`model-picker-row-selection size-4 shrink-0`,!p&&`hidden`),children:p?(0,P.jsx)(w,{name:`check`,className:`h-4 w-4 text-primary`}):null}),re?(0,P.jsx)(`button`,{type:`button`,disabled:g,onClick:t=>{t.preventDefault(),t.stopPropagation(),re(e)},className:h(`model-favorite-button flex h-4 w-4 items-center justify-center hover:text-primary/80 flex-shrink-0 disabled:pointer-events-none`,_?`text-primary`:`text-muted-foreground`),"aria-label":_?s.unfavorite:s.favorite,title:_?s.unfavorite:s.favorite,children:(0,P.jsx)(w,{name:_?`star-fill`:`star`,className:`h-3.5 w-3.5`})}):null]});return(0,P.jsx)(Ve,{metadata:l,providerName:u,providerID:e.providerID,modelID:e.modelID,active:Ee&&r,anchor:()=>j.current[a],labels:s,children:c})}},`${t}-${e.providerID}-${e.modelID}`)},ct=e=>{if(!oe)return;let{active:t,over:n}=e;if(!n||t.id===n.id)return;let r=nt.get(String(t.id)),i=nt.get(String(n.id));!r||!i||oe(r,i)},lt=e=>{if(!ue)return;let{active:t,over:n}=e;if(!n||t.id===n.id)return;let r=Ye.map(e=>e.id),i=r.indexOf(String(t.id)),a=r.indexOf(String(n.id));i!==-1&&a!==-1&&ue(be(r,i,a))},Y=e=>F.has(e),ut=e=>{if(!N){Ae(e);return}Ie(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},dt=(e,t,n,r)=>{let i=Y(e),a=t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),ut(e))};return r?(0,P.jsxs)(`div`,{ref:r.setActivatorNodeRef,...r.attributes,...r.listeners,role:`button`,tabIndex:0,"aria-expanded":!i,title:ye,className:h(ot,`w-full text-left cursor-grab select-none active:cursor-grabbing`),onClick:()=>ut(e),onKeyDown:a,children:[(0,P.jsx)(w,{name:`draggable`,className:`size-3.5 flex-shrink-0 text-muted-foreground/70`}),t,(0,P.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),(0,P.jsx)(`span`,{className:`ml-auto flex size-4 flex-shrink-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(w,{name:i?`arrow-right-s`:`arrow-down-s`,className:`size-4`})})]}):(0,P.jsxs)(`button`,{type:`button`,className:h(ot,`w-full text-left cursor-pointer`),onClick:()=>ut(e),"aria-expanded":!i,children:[t,(0,P.jsx)(`span`,{className:`min-w-0 truncate`,children:n}),(0,P.jsx)(`span`,{className:`ml-auto flex size-4 flex-shrink-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(w,{name:i?`arrow-right-s`:`arrow-down-s`,className:`size-4`})})]})},ft=(e,t,n)=>(0,P.jsxs)(P.Fragment,{children:[t>0?(0,P.jsx)(`div`,{className:`model-picker-section-divider h-px bg-border/40 my-1`}):null,dt(`provider:${e.id}`,(0,P.jsx)(fe,{providerId:e.id,className:`h-4 w-4 flex-shrink-0`}),e.name||e.id,n),Y(`provider:${e.id}`)?null:e.models.map(t=>st({model:t,providerID:e.id,modelID:t.id},`provider`,!0))]});return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`model-picker-search-area p-1.5 pb-1`,children:(0,P.jsxs)(`div`,{className:`relative`,children:[(0,P.jsx)(w,{name:`search`,className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,P.jsx)(ce,{type:`text`,placeholder:s.searchPlaceholder,value:i,onChange:e=>a(e.target.value),onKeyDown:at,className:`model-picker-search h-8 pl-8 typography-meta`,autoFocus:ee})]})}),(0,P.jsx)(we,{ref:De,outerClassName:_,className:`overlay-scrollbar-target--no-gutter`,style:v,children:(0,P.jsxs)(`div`,{className:`model-picker-list px-1`,children:[f?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 typography-meta text-muted-foreground hover:bg-interactive-hover/50`,onClick:p,children:[(0,P.jsx)(w,{name:`close`,className:`h-3.5 w-3.5`}),(0,P.jsx)(`span`,{children:s.notSelected}),c?null:(0,P.jsx)(w,{name:`check`,className:`h-4 w-4 text-primary ml-auto`})]}),(0,P.jsx)(`div`,{className:`h-px bg-border/40 my-1`})]}):null,q?null:(0,P.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:s.noResults}),V.length>0?(0,P.jsxs)(`div`,{className:`model-picker-section`,children:[dt(`favorites`,(0,P.jsx)(w,{name:`star-fill`,className:`h-4 w-4 text-primary`}),s.favorites),!Y(`favorites`)&&(J?(0,P.jsx)(_e,{sensors:Le,collisionDetection:me,onDragEnd:ct,children:(0,P.jsx)(Ce,{items:V.map(e=>`${e.providerID}:${e.modelID}`),strategy:Se,children:V.map(e=>(0,P.jsx)(Ge,{id:`${e.providerID}:${e.modelID}`,disabled:g,children:t=>st(e,`fav`,!0,t)},`fav-sortable-${e.providerID}-${e.modelID}`))})}):V.map(e=>st(e,`fav`,!0)))]}):null,H.length>0?(0,P.jsxs)(`div`,{className:`model-picker-section`,children:[V.length>0?(0,P.jsx)(`div`,{className:`model-picker-section-divider h-px bg-border/40 my-1`}):null,dt(`recent`,(0,P.jsx)(w,{name:`time`,className:`h-4 w-4`}),s.recent),Y(`recent`)?null:H.map(e=>st(e,`recent`,!0))]}):null,(V.length>0||H.length>0)&&U.length>0?(0,P.jsx)(`div`,{className:`model-picker-section-divider h-px bg-border/40 my-1`}):null,tt?(0,P.jsx)(_e,{sensors:Be,collisionDetection:me,onDragEnd:lt,children:(0,P.jsx)(Ce,{items:U.map(e=>e.id),strategy:Se,children:U.map((e,t)=>(0,P.jsx)(Ke,{id:e.id,disabled:g,children:n=>ft(e,t,n)},e.id))})}):U.map((e,t)=>(0,P.jsx)(`div`,{children:ft(e,t)},e.id))]})}),(0,P.jsx)(`div`,{className:`model-picker-footer px-3 pt-1 pb-1.5 border-t border-border/40 typography-micro text-muted-foreground`,children:(0,P.jsx)(We,{store:A,flatModelList:W,footerContent:xe,fallback:s.keyboardHint})})]})};function R(){}function z(e){let{key:t,icon:n,label:r}=e;return(0,P.jsx)(F,{iconName:n,label:r},t)}function B(e,t,n,r,i){let a=e.find(e=>e.id===n);if(!a)return null;let o=(Array.isArray(a.models)?a.models:[]).find(e=>e.id===r);return!o||t.some(e=>e.providerID===n&&e.modelID===r)?null:i===void 0?{provider:a,model:o,providerID:n,modelID:r}:{provider:a,model:o,providerID:n,modelID:r,variant:i}}var V=e=>{let t=(0,D.c)(30),n=_(H),r=u(Ye),i=u(U),a=u(W),o=e?.currentProviderID??null,s=e?.currentModelID??null,c;if(t[0]!==r||t[1]!==a||t[2]!==n){let e;t[4]!==a||t[5]!==n?(e=e=>{let{providerID:t,modelID:r,variant:i}=e;return B(n,a,t,r,i)},t[4]=a,t[5]=n,t[6]=e):e=t[6],c=r.map(e).filter(Xe),t[0]=r,t[1]=a,t[2]=n,t[3]=c}else c=t[3];let l=c,d;if(t[7]!==s||t[8]!==o||t[9]!==r||t[10]!==a||t[11]!==n||t[12]!==i){bb0:{let e;t[14]!==a||t[15]!==n?(e=e=>{let{providerID:t,modelID:r,variant:i}=e;return B(n,a,t,r,i)},t[14]=a,t[15]=n,t[16]=e):e=t[16];let c;t[17]===r?c=t[18]:(c=e=>{let{providerID:t,modelID:n}=e;return!r.some(e=>e.providerID===t&&e.modelID===n)},t[17]=r,t[18]=c);let l=i.map(e).filter(G).filter(c);if(!o||!s){d=l;break bb0}if(r.some(e=>e.providerID===o&&e.modelID===s)){d=l;break bb0}let u;t[19]!==s||t[20]!==o?(u=e=>e.providerID===o&&e.modelID===s,t[19]=s,t[20]=o,t[21]=u):u=t[21];let f=l.findIndex(u);if(f===0){d=l;break bb0}if(f>0){let e=l.slice(),[t]=e.splice(f,1);e.unshift(t),d=e;break bb0}let p;t[22]!==s||t[23]!==o||t[24]!==a||t[25]!==n?(p=B(n,a,o,s),t[22]=s,t[23]=o,t[24]=a,t[25]=n,t[26]=p):p=t[26];let m=p;if(!m){d=l;break bb0}d=[m,...l]}t[7]=s,t[8]=o,t[9]=r,t[10]=a,t[11]=n,t[12]=i,t[13]=d}else d=t[13];let f=d,p;return t[27]!==l||t[28]!==f?(p={favoriteModelsList:l,recentModelsList:f},t[27]=l,t[28]=f,t[29]=p):p=t[29],p};function H(e){return e.providers}function Ye(e){return e.favoriteModels}function U(e){return e.recentModels}function W(e){return e.hiddenModels}function Xe(e){return e!==null}function G(e){return e!==null}var Ze=e=>{if(!e)return``;let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.replace(/\/+$/,``)};async function K(e){let t=Ze(e),n=await se(t);return{isDirty:!n.isClean,ahead:n.ahead,behind:n.behind,upstream:n.tracking}}var Qe=6e4,$e=500,et=1048576,q=new Map,J=new Map,tt=0,nt=(e,t)=>e.length+t.length,rt=(e,t)=>{q.delete(e),q.set(e,{root:t,resolvedAt:Date.now()});let n=0;for(let[e,t]of q)n+=nt(e,t.root);for(;q.size>$e||n>et&&q.size>1;){let e=q.entries().next().value;if(!e)break;n-=nt(e[0],e[1].root),q.delete(e[0])}};function it(e){if(tt+=1,typeof e==`string`&&e){let t=Ze(e);q.delete(t),J.delete(t);return}q.clear(),J.clear()}var at=async e=>ae(e).catch(()=>e),ot=async e=>{let t=q.get(e);if(t&&Date.now()-t.resolvedAt<Qe)return q.delete(e),q.set(e,t),t.root;t&&q.delete(e);let n=J.get(e);if(n)return n;let r=tt,i=at(e).then(t=>(tt===r&&rt(e,t),t)).catch(()=>e).finally(()=>{J.get(e)===i&&J.delete(e)});return J.set(e,i),i};async function st(e,t){let n=Ze(e);if(!n)return`HEAD`;try{let e=await ot(n).catch(()=>n),r=t?.knownBranch?.trim();if(r&&e===n)return r;let i=await se(e);return(typeof i.current==`string`?i.current.trim():``)||`HEAD`}catch{return`HEAD`}}var ct=e=>{let t=(e.branch||``).trim(),n=(e.head||``).trim();return t?`branch`:n?`detached`:`unborn`},lt=(e,t)=>({worktreeRoot:t,worktreeStatus:`ready`,headState:ct(e),worktreeSource:`existing`}),Y=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},ut=e=>e.trim().replace(/^refs\/heads\//,``).replace(/^heads\//,``).replace(/\s+/g,`-`).replace(/^\/+|\/+$/g,``).split(`/`).join(`-`).replace(/[^A-Za-z0-9._-]+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``).slice(0,80),dt=e=>e.trim().replace(/^refs\/heads\//,``).replace(/^heads\//,``).replace(/\s+/g,`-`).replace(/^\/+|\/+$/g,``),ft=(e,t)=>{let n=Y(e);n&&S.setState(e=>{let r=!1,i=e=>Y(e.path)!==n&&Y(e.worktreeRoot??e.path)!==n||e.worktreeStatus===t?e:(r=!0,{...e,worktreeStatus:t}),a=e.availableWorktrees,o=!1,s=e.availableWorktrees.map(e=>{let t=i(e);return t!==e&&(o=!0),t});o&&(a=s);let c=e.availableWorktreesByProject;for(let[t,n]of e.availableWorktreesByProject){let r=!1,a=n.map(e=>{let t=i(e);return t!==e&&(r=!0),t});r&&(c===e.availableWorktreesByProject&&(c=new Map(e.availableWorktreesByProject)),c.set(t,a))}let l=e.worktreeMetadata;for(let[t,n]of e.worktreeMetadata){let r=i(n);r!==n&&(l===e.worktreeMetadata&&(l=new Map(e.worktreeMetadata)),l.set(t,r))}return r?{availableWorktrees:a,availableWorktreesByProject:c,worktreeMetadata:l}:{}})},pt=e=>e?.status===`pending`?`pending`:e?.status===`failed`?`invalid`:`ready`,mt=e=>{let t=Y(e),n=t.split(`/`).filter(Boolean);return n[n.length-1]??t},ht=e=>{let t=[];for(let n of e.setupCommands){let r=n.trim();r&&t.push(y(r,{rootWorktreePath:e.projectDirectory}))}let n=t.filter(Boolean).join(` && `);return n.trim().length>0?n:void 0},gt=(e,t)=>{let n=e.mode===`existing`?`existing`:`new`,r=ut(e.worktreeName??e.preferredName??``),i=dt(e.branchName??(n===`new`?e.preferredName:void 0)??``),a=dt(e.existingBranch??e.branchName??``),o=(e.startRef||``).trim(),s=ht({projectDirectory:t,setupCommands:Array.isArray(e.setupCommands)?e.setupCommands:[]});return{mode:n,...r?{worktreeName:r}:{},...i?{branchName:i}:{},...a?{existingBranch:a}:{},...o?{startRef:o}:{},...s?{startCommand:s}:{},...e.setUpstream?{setUpstream:!0}:{},...e.upstreamRemote?{upstreamRemote:e.upstreamRemote}:{},...e.upstreamBranch?{upstreamBranch:e.upstreamBranch}:{},...e.ensureRemoteName?{ensureRemoteName:e.ensureRemoteName}:{},...e.ensureRemoteUrl?{ensureRemoteUrl:e.ensureRemoteUrl}:{},...e.returnAfterDirectoryCreated?{returnAfterDirectoryCreated:!0}:{}}},_t=(e,t)=>{if(e.size!==t.size)return!1;for(let[n,r]of e){let e=t.get(n);if(!e||e.length!==r.length)return!1;for(let t=0;t<r.length;t++){let n=r[t],i=e[t];if(n.path!==i.path||n.branch!==i.branch||n.name!==i.name||n.label!==i.label||n.projectDirectory!==i.projectDirectory||n.worktreeRoot!==i.worktreeRoot||n.headState!==i.headState||n.worktreeSource!==i.worktreeSource||n.source!==i.source)return!1}}return!0},vt=new Map,X=new Map,yt=new Map,Z=new Map,bt=new Map,xt=new WeakMap,St=3e4,Ct=``,Q=()=>{let e=`${n()}\u0000${t()}`;return e!==Ct&&(Ct=e,vt.clear(),X.clear(),yt.clear(),Z.clear(),bt.clear()),e},wt=e=>`${Q()}\u0000${Y(e)}`,Tt=(e,t=wt(e))=>yt.get(t)??0,Et=e=>{let t=wt(e),n=Z.get(t)??Y(e),r=wt(n);bt.set(r,(bt.get(r)??0)+1);let i=new Set([t,r]);for(let[e,t]of Z)e.startsWith(`${Q()}\u0000`)&&t===n&&i.add(e);for(let e of i)yt.set(e,(yt.get(e)??0)+1),vt.delete(e);l(n),Y(e)!==n&&l(e)},Dt=async(e,t,n)=>{let r=Y(await ae(e)),i=Y(e),a=`${t}\u0000${r}`,o=n&&xt.get(n);n&&!o&&(o=new Map,xt.set(n,o)),n&&!o?.has(a)&&t===Q()&&Et(r);let s=bt.get(a)??0,c=o?.get(a);(!c||c.generation!==s)&&(n&&c&&l(r),c={generation:s,value:T.worktree.list(r)},o?.set(a,c));let u=await c.value;t===Q()&&Z.set(`${t}\u0000${e}`,r);let d=u.filter(e=>typeof e.path==`string`&&e.path.trim().length>0).map(e=>{let t=Y(e.path),n=(e.branch||``).replace(/^refs\/heads\//,``).trim(),i=(e.name||``).trim(),a=lt(e,t);return{source:`sdk`,name:i||mt(t),path:t,projectDirectory:r,branch:n,label:n||i||mt(t),worktreeRoot:a.worktreeRoot,worktreeStatus:a.worktreeStatus,headState:a.headState,worktreeSource:a.worktreeSource}});return ee(i,d).sort((e,t)=>{let n=(e.label||e.branch||e.path).toLowerCase(),r=(t.label||t.branch||t.path).toLowerCase();return n.localeCompare(r)})},Ot=async(e,t,n,r)=>{for(;;){let i=Tt(e,t),a=await Dt(e,n,r);if(n!==Q())return a;if(i===Tt(e,t))return vt.set(t,{value:a,at:Date.now()}),a}};async function kt(e,t){let n=Y(e.path),r=Q(),i=`${r}\u0000${n}`,a=vt.get(i);if(a&&Date.now()-a.at<St)return a.value;let o=X.get(i);if(o)return o;let s=Ot(n,i,r,t).finally(()=>{X.get(i)===s&&X.delete(i)});return X.set(i,s),s}var At=(e,t)=>{let n=f(e.worktreeRoot??e.path),r=n?.status===`pending`?`pending`:n?.status===`failed`?`invalid`:t?.worktreeStatus;return r&&r!==e.worktreeStatus?{...e,worktreeStatus:r}:e},jt=e=>{let t=new Set([...e].map(Y));if(t.size===0)return;let n=S.getState().worktreeMetadata,r=new Map(n);for(let[e,i]of n)t.has(Y(i.path))&&r.delete(e);for(let[e,n]of C.getState().attachments){let r=typeof n.worktreeRoot==`string`&&n.worktreeRoot.trim()?Y(n.worktreeRoot):``,i=typeof n.cwd==`string`&&n.cwd.trim()?Y(n.cwd):``;(r&&t.has(r)||i&&t.has(i))&&C.getState().clearAttachment(e)}r.size!==n.size&&S.setState({worktreeMetadata:r})};async function Mt(e,t={}){let n=Y(e.path),r=wt(n);yt.set(r,Tt(n)+1),vt.delete(r),X.delete(r);let i=await kt({...e,path:n},t.refreshBatch??{}),a=Z.get(r);if(t.isCurrent&&!t.isCurrent())return{worktrees:i,addedDirectories:[],removedDirectories:[],repositoryDirectory:a};let o=i,s=[],c=[];return S.setState(e=>{let t=e.availableWorktreesByProject,r=ee(n,t.get(n)??[]),a=new Map(r.map(e=>[Y(e.path),e])),l=i.map(e=>At(e,a.get(Y(e.path)))),u=new Set(l.map(e=>Y(e.path)));if(s=l.filter(e=>!a.has(Y(e.path))).map(e=>e.path),c=r.filter(e=>!u.has(Y(e.path))).map(e=>e.path),o=l,r.length===l.length&&r.every((e,t)=>{let n=l[t];return n&&e.path===n.path&&e.branch===n.branch&&e.name===n.name&&e.label===n.label&&e.projectDirectory===n.projectDirectory&&e.worktreeRoot===n.worktreeRoot&&e.headState===n.headState&&e.worktreeSource===n.worktreeSource&&e.source===n.source&&e.worktreeStatus===n.worktreeStatus})&&r.every((e,r)=>e===t.get(n)?.[r])&&r.length===(t.get(n)?.length??0))return{};let d=new Map(t);return d.set(n,l),{availableWorktreesByProject:d,availableWorktrees:[...d.values()].flat()}}),jt(c),{worktrees:o,addedDirectories:s,removedDirectories:c,repositoryDirectory:a}}async function Nt(e,t){let n=Y(e.path),r=Y(await ae(n));Z.set(wt(n),r);let i=n===Y(r)?[]:await T.worktree.list(r),a=gt(t,n),o=await T.worktree.create(n,a),s=typeof o?.name==`string`?o.name:``,c=typeof o?.branch==`string`?o.branch:``,l=typeof o?.path==`string`?o.path:``;if(!s||!l)throw Error(`Worktree create missing name/path`);let u={source:`sdk`,name:s,path:Y(l),projectDirectory:r,branch:c,label:c||s,worktreeRoot:Y(l),worktreeStatus:pt(o?.bootstrapStatus),headState:c?`branch`:`unborn`,worktreeSource:`created-for-session`},d=ee(n,[...i.filter(e=>!!e.path).map(e=>({path:e.path,worktreeRoot:e.path,projectDirectory:r,branch:e.branch??``,label:e.branch??``})),u]).find(e=>e.worktreeRoot===u.worktreeRoot)??u,f=d.worktreeRoot??d.path;o?.bootstrapStatus?v(f,o.bootstrapStatus):m(f),x(f,{onFailed:()=>ft(f,`invalid`),onReady:()=>ft(f,`ready`)}),Et(n),it();let p=n;return S.setState(e=>{let t=new Map(e.availableWorktreesByProject),n=t.get(p)??[];return t.set(p,[...n.filter(e=>Y(e.path)!==d.path),d]),{availableWorktreesByProject:t,availableWorktrees:[...t.values()].flat()}}),d}async function Pt(e,t){let n=e.path,r=gt(t,n);return T.worktree.validate(n,r)}async function Ft(e,t,n){let r=Y(e.path),i=!!n?.deleteRemoteBranch,a=n?.deleteLocalBranch===!0,o=n?.remoteName;if(!(await T.worktree.remove(r,{directory:t.worktreeRoot??t.path,deleteLocalBranch:a}))?.success)throw Error(`Worktree removal failed`);b(t.worktreeRoot??t.path),Et(Y(e.path)),it();let s=Y(t.worktreeRoot??t.path),c=S.getState().availableWorktreesByProject,l=new Map(c),u=new Set([s,Y(t.path)]);for(let[e,t]of c){let n=t.filter(e=>Y(e.worktreeRoot??e.path)!==s||(u.add(Y(e.path)),!1));n.length!==t.length&&(l.set(e,n),Et(e))}jt(u),S.setState({availableWorktreesByProject:l,availableWorktrees:S.getState().availableWorktrees.filter(e=>Y(e.worktreeRoot??e.path)!==s)});let d=(t.branch||``).replace(/^refs\/heads\//,``).trim();i&&d&&await oe(r,{branch:d,remote:o}).catch(()=>void 0)}var It=200,$=new Map,Lt=[{key:`code`,Icon:`code-box`,label:`Code`},{key:`terminal`,Icon:`terminal-box`,label:`Terminal`},{key:`rocket`,Icon:`rocket`,label:`Rocket`},{key:`flask`,Icon:`flask`,label:`Lab`},{key:`gamepad`,Icon:`gamepad`,label:`Game`},{key:`briefcase`,Icon:`briefcase`,label:`Work`},{key:`home`,Icon:`home`,label:`Home`},{key:`globe`,Icon:`global`,label:`Web`},{key:`leaf`,Icon:`leaf`,label:`Nature`},{key:`shield`,Icon:`shield`,label:`Security`},{key:`palette`,Icon:`palette`,label:`Design`},{key:`server`,Icon:`server`,label:`Server`},{key:`phone`,Icon:`smartphone`,label:`Mobile`},{key:`database`,Icon:`database-2`,label:`Data`},{key:`lightbulb`,Icon:`lightbulb`,label:`Idea`},{key:`music`,Icon:`music`,label:`Music`},{key:`camera`,Icon:`camera`,label:`Media`},{key:`book`,Icon:`book-open`,label:`Docs`},{key:`heart`,Icon:`heart`,label:`Favorite`}],Rt=Object.fromEntries(Lt.map(e=>[e.key,e.Icon])),zt=[{key:`keyword`,label:`Purple`,cssVar:`var(--syntax-keyword)`},{key:`string`,label:`Green`,cssVar:`var(--syntax-string)`},{key:`number`,label:`Pink`,cssVar:`var(--syntax-number)`},{key:`type`,label:`Gold`,cssVar:`var(--syntax-type)`},{key:`constant`,label:`Cyan`,cssVar:`var(--syntax-constant)`},{key:`comment`,label:`Muted`,cssVar:`var(--syntax-comment)`},{key:`error`,label:`Red`,cssVar:`var(--status-error)`},{key:`primary`,label:`Blue`,cssVar:`var(--primary)`},{key:`success`,label:`Green`,cssVar:`var(--status-success)`}],Bt=Object.fromEntries(zt.map(e=>[e.key,e.cssVar])),Vt=(e,t)=>{if(typeof e!=`number`||e<=0)return null;let n=new URLSearchParams({v:String(e)});return typeof t?.iconColor==`string`&&t.iconColor.trim()&&n.set(`iconColor`,t.iconColor.trim()),(t?.themeVariant===`light`||t?.themeVariant===`dark`)&&n.set(`theme`,t.themeVariant),n},Ht=(e,t)=>e?[r()||`same-origin`,e,t.toString()].join(`|`):null,Ut=(e,t,n)=>{let r=Vt(t,n);if(!r)return null;let i=Ht(e,r);return i?{cacheKey:i,projectId:e,query:r}:null},Wt=()=>{for(;$.size>It;){let e=$.keys().next().value;if(typeof e!=`string`)return;let t=$.get(e);t?.url&&typeof URL<`u`&&typeof URL.revokeObjectURL==`function`&&URL.revokeObjectURL(t.url),$.delete(e)}},Gt=e=>{let t=$.get(e.cacheKey);if(t?.url)return Promise.resolve(t.url);if(t?.promise)return t.promise;let n=i(`/api/projects/${encodeURIComponent(e.projectId)}/icon`,{method:`GET`,headers:{Accept:`image/*`},query:e.query}).then(async t=>{if(!t.ok||typeof URL>`u`||typeof URL.createObjectURL!=`function`)return null;let n=await t.blob(),r=URL.createObjectURL(n);return $.set(e.cacheKey,{url:r}),Wt(),r}).catch(()=>null).finally(()=>{let t=$.get(e.cacheKey);t?.promise===n&&!t.url&&$.delete(e.cacheKey)});return $.set(e.cacheKey,{promise:n}),n},Kt=(e,t)=>{let n=(0,D.c)(10),r=e.id,i=e.iconImage?.updatedAt,a=t?.themeVariant,o=t?.iconColor,s;n[0]!==o||n[1]!==r||n[2]!==a||n[3]!==i?(s=Ut(r,i,{themeVariant:a,iconColor:o}),n[0]=o,n[1]=r,n[2]=a,n[3]=i,n[4]=s):s=n[4];let c=s,l;n[5]===c?l=n[6]:(l=()=>c?$.get(c.cacheKey)?.url??null:null,n[5]=c,n[6]=l);let[u,d]=E.useState(l),f,p;return n[7]===c?(f=n[8],p=n[9]):(f=()=>{if(!c){d(null);return}let e=$.get(c.cacheKey)?.url;if(e){d(e);return}let t=!1;return d(null),Gt(c).then(e=>{t||d(e)}),()=>{t=!0}},p=[c],n[7]=c,n[8]=f,n[9]=p),E.useEffect(f,p),u},qt=e=>{let t=(0,D.c)(21),{project:n,options:r,className:i,alt:a,draggable:o,fallback:s,onError:c}=e,l=a===void 0?``:a,u=o!==void 0&&o,d=s===void 0?null:s,f=Kt(n,r),[p,m]=E.useState(!1),h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{m(!1)},t[0]=h):h=t[0];let g=n.iconImage?.updatedAt,_;if(t[1]!==n.id||t[2]!==f||t[3]!==g?(_=[f,n.id,g],t[1]=n.id,t[2]=f,t[3]=g,t[4]=_):_=t[4],E.useEffect(h,_),!f||p){let e;return t[5]===d?e=t[6]:(e=E.createElement(E.Fragment,null,d),t[5]=d,t[6]=e),e}let v;if(t[7]!==l||t[8]!==i||t[9]!==u||t[10]!==c||t[11]!==f){let e;t[13]===c?e=t[14]:(e=e=>{m(!0),c?.(e)},t[13]=c,t[14]=e);let n;t[15]!==l||t[16]!==i||t[17]!==u||t[18]!==f||t[19]!==e?(n={src:f,alt:l,className:i,draggable:u,onError:e},t[15]=l,t[16]=i,t[17]=u,t[18]=f,t[19]=e,t[20]=n):n=t[20],v=E.createElement(`img`,n),t[7]=l,t[8]=i,t[9]=u,t[10]=c,t[11]=f,t[12]=v}else v=t[12];return v};export{M as C,Ae as S,Me as _,qt as a,Oe as b,kt as c,_t as d,st as f,Ne as g,L as h,Rt as i,Ft as l,V as m,Bt as n,Nt as o,K as p,Lt as r,Mt as s,zt as t,Pt as u,j as v,ke as x,De as y};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/assistant-attachment-cache-C-SlEpSB.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-auth-Bh3htXtG.js","assets/runtime-switch-ibQIZnws.js","assets/runtime-fetch-9B8F_rKW.js","assets/runtime-file-resource-tDTBpJT_.js","assets/path-utils-HRmerlyU.js","assets/fileQueries-BaEKb7SZ.js","assets/vendor-base-ui-CzHs0bHY.js","assets/vendor-react-DlzBev0S.js","assets/vendor-tanstack-query-core-Y_YoRHtC.js","assets/vendor-tanstack-react-query-B-Wpqq5J.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,l as n}from"./runtime-switch-ibQIZnws.js";import{n as r}from"./runtime-fetch-9B8F_rKW.js";import{C as i,t as a,v as o,w as s,y as c}from"./desktop-Brp3xDpd.js";import{s as l}from"./path-utils-HRmerlyU.js";import{f as u,s as d,v as f}from"./desktopHosts-qQ2Rz26_.js";import{i as p,n as m,r as h}from"./desktopRelayRestore-DifJHAur.js";import{A as g,B as _,F as v,I as y,L as b,N as x,P as S,R as ee,at as C,j as w,ot as T,st as E,z as D}from"./vendor-base-ui-CzHs0bHY.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{n as O}from"./vendor-react-DlzBev0S.js";import{n as k}from"./vendor-tanstack-query-core-Y_YoRHtC.js";import{i as te,l as ne,n as re,r as ie,s as A}from"./vendor-tanstack-react-query-B-Wpqq5J.js";import{_ as ae,g as j}from"./fileQueries-BaEKb7SZ.js";import{o as oe}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{a as M}from"./platform-Dids8J9D.js";import{Fi as se,Ha as N,Jn as P,Kn as ce,Li as F,Va as le,Xi as ue,er as I,ji as L,ui as R}from"./useMobileNavigationStore-SCjA_7jP.js";import{i as z,t as B}from"./store-Myt_Fv8d.js";import{n as V}from"./Icon-DsN23fuV.js";import{i as H,n as de,r as fe,t as pe}from"./vendor-simplewebauthn-browser-Dwhcdg_5.js";import{t as me}from"./input-B7-PmgcW.js";import{g as he,h as ge,m as _e,p as ve,t as ye}from"./MobileResizableSheet-D_PnyzR0.js";import{d as be,l as xe}from"./select-DoYUmvbX.js";import{n as Se}from"./textarea-BCTNmuPZ.js";import{n as Ce,r as we,t as Te}from"./dropdown-menu.styles-BDla58Rm.js";import{_ as Ee,g as De,y as Oe}from"./projectMeta-C08trpZE.js";var U=O(),ke=[`desktopHostSwitch`],Ae=class extends Error{result;host;constructor(e,t){super(e.reason),this.name=`DesktopHostSwitchError`,this.result=e,this.host=t}},W=(e,t)=>B(z.getState().dictionary,e,t),je=async e=>{let{host:t}=e;if(t.id===`local`){if(s()&&!a())return await c(`desktop_switch_to_local`),{ok:!0,via:`direct`,status:{status:`ok`,latencyMs:0}};let r=(e.localApiOrigin||``).trim();if(!r)throw new Ae({ok:!1,status:{status:`unreachable`,latencyMs:0},reason:`unreachable`},t);return n({apiBaseUrl:r,clientToken:e.localClientToken||null,runtimeKey:h(t)}),{ok:!0,via:`direct`,status:{status:`ok`,latencyMs:0}}}let r=await p(t,{cachedProbe:e.cachedProbe});if(!r.ok)throw new Ae(r,t);return r},Me=null,Ne=()=>Me||(Me=new k(j,{mutationKey:ke,mutationFn:je,onError:(e,t)=>{if(!(e instanceof Ae)){R.error(W(`desktopHostSwitcher.toast.instanceUnreachable`,{host:f(t.host.label)}),{description:e instanceof Error?e.message:String(e)});return}if(e.result.reason!==`unsupported`){if(e.result.status.status===`auth`){if(u(e.host)){R.error(W(`mobile.connect.pairing.expired`),{description:W(`desktopHostSwitcher.pairing.reconnectHint`),action:{label:W(`settings.remoteInstances.openLocalManager`),onClick:()=>{d().catch(()=>R.error(W(`sessionAuth.error.networkTitle`)))}}});return}R.error(W(`desktopHostSwitcher.status.authRequired`));return}R.error(W(`desktopHostSwitcher.toast.instanceUnreachable`,{host:f(t.host.label)}))}}}),Me.subscribe(()=>void 0),Me),Pe=async e=>{if(m(e.host))return{ok:!0,via:`direct`,status:e.cachedProbe?.status===`ok`?e.cachedProbe:{status:`ok`,latencyMs:0}};if(j.isMutating({mutationKey:ke})>0)return{ok:!1,status:{status:`unreachable`,latencyMs:0},reason:`unsupported`};try{return await Ne().mutate(e)}catch(e){return e instanceof Ae?e.result:{ok:!1,status:{status:`unreachable`,latencyMs:0},reason:`unreachable`}}},Fe=e=>{let t=(0,U.c)(2),n=e!==void 0&&e,r;return t[0]===n?r=t[1]:(r={mutationKey:ke,predicate:e=>!n||!e.state.variables?.inlineProgress},t[0]=n,t[1]=r),ie(r)>0},Ie=()=>{let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={filters:{mutationKey:ke,status:`pending`},select:Le},e[0]=t):t=e[0],te(t)[0]?.host.id??null};function Le(e){return e.state.variables}var G=e=>typeof e==`object`&&!!e,K=(e,t)=>{let n=e[t];return typeof n==`string`?n:null},q=(e,t)=>{let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:null},J=(e,t)=>{let n=e[t];return typeof n==`boolean`?n:null},Re=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Y=()=>o()?(e,t)=>c(e,t):null,ze=e=>{if(!G(e))return;let t=J(e,`enabled`)??!1,n=K(e,`store`)?.toLowerCase()===`settings`?`settings`:`never`,r=K(e,`value`);return{enabled:t,store:n,...r?{value:r}:{}}},Be=e=>e===`remote`||e===`dynamic`?e:`local`,Ve=e=>{if(!G(e))return null;let t=K(e,`id`);if(!t)return null;let n=J(e,`enabled`)??!0,r=Be(K(e,`type`)),i=K(e,`localHost`)||K(e,`local_host`)||void 0,a=q(e,`localPort`)??q(e,`local_port`)??void 0,o=K(e,`remoteHost`)||K(e,`remote_host`)||void 0,s=q(e,`remotePort`)??q(e,`remote_port`)??void 0;return{id:t,enabled:n,type:r,...i?{localHost:i}:{},...typeof a==`number`?{localPort:a}:{},...o?{remoteHost:o}:{},...typeof s==`number`?{remotePort:s}:{}}},He=e=>{if(!G(e))return null;let t=K(e,`id`),n=K(e,`sshCommand`)||K(e,`ssh_command`);if(!t||!n)return null;let r=K(e,`nickname`),i=e.sshParsed,a=G(i)?{destination:K(i,`destination`)||``,args:Re(i.args)}:void 0,o=G(e.remoteYuri)?e.remoteYuri:G(e.remote_yuri)?e.remote_yuri:{},s=G(e.localForward)?e.localForward:G(e.local_forward)?e.local_forward:{},c=G(e.auth)?e.auth:{},l=K(o,`mode`)?.toLowerCase()===`external`?`external`:`managed`,u=K(o,`installMethod`)||K(o,`install_method`),d=u===`npm`||u===`download_release`||u===`upload_bundle`?u:`bun`,f=K(s,`bindHost`)||K(s,`bind_host`)||`127.0.0.1`,p=f===`localhost`||f===`0.0.0.0`?f:`127.0.0.1`,m=(Array.isArray(e.portForwards)?e.portForwards:Array.isArray(e.port_forwards)?e.port_forwards:[]).map(e=>Ve(e)).filter(e=>!!e),h=q(o,`preferredPort`)??q(o,`preferred_port`),g=q(s,`preferredLocalPort`)??q(s,`preferred_local_port`),_=ze(c.sshPassword||c.ssh_password),v=ze(c.yuriPassword||c.yuri_password);return{id:t,...r?{nickname:r}:{},sshCommand:n,...a&&a.destination?{sshParsed:a}:{},connectionTimeoutSec:q(e,`connectionTimeoutSec`)??q(e,`connection_timeout_sec`)??60,remoteYuri:{mode:l,keepRunning:J(o,`keepRunning`)??J(o,`keep_running`)??!0,relayHost:J(o,`relayHost`)??J(o,`relay_host`)??!0,...h?{preferredPort:h}:{},installMethod:d,uploadBundleOverSsh:J(o,`uploadBundleOverSsh`)??J(o,`upload_bundle_over_ssh`)??!1},localForward:{...g?{preferredLocalPort:g}:{},bindHost:p},auth:{..._?{sshPassword:_}:{},...v?{yuriPassword:v}:{}},portForwards:m}},Ue=e=>{switch(e){case`config_resolved`:case`auth_check`:case`master_connecting`:case`remote_probe`:case`installing`:case`updating`:case`server_detecting`:case`server_starting`:case`forwarding`:case`ready`:case`degraded`:case`error`:return e;default:return`idle`}},We=e=>{if(!G(e))return null;let t=K(e,`id`);return t?{id:t,phase:Ue(K(e,`phase`)),...K(e,`detail`)?{detail:K(e,`detail`)||void 0}:{},...K(e,`localUrl`)||K(e,`local_url`)?{localUrl:K(e,`localUrl`)||K(e,`local_url`)||void 0}:{},...typeof(q(e,`localPort`)??q(e,`local_port`))==`number`?{localPort:q(e,`localPort`)??q(e,`local_port`)??void 0}:{},...typeof(q(e,`remotePort`)??q(e,`remote_port`))==`number`?{remotePort:q(e,`remotePort`)??q(e,`remote_port`)??void 0}:{},startedByUs:J(e,`startedByUs`)??J(e,`started_by_us`)??!1,retryAttempt:q(e,`retryAttempt`)??q(e,`retry_attempt`)??0,requiresUserAction:J(e,`requiresUserAction`)??J(e,`requires_user_action`)??!1,...K(e,`errorCode`)||K(e,`error_code`)?{errorCode:K(e,`errorCode`)||K(e,`error_code`)||void 0}:{},updatedAtMs:q(e,`updatedAtMs`)??q(e,`updated_at_ms`)??Date.now()}:null},Ge=e=>{if(!G(e))return null;let t=K(e,`host`),n=K(e,`source`),r=K(e,`sshCommand`)||K(e,`ssh_command`);return!t||!n||!r?null:{host:t,source:n,sshCommand:r,pattern:J(e,`pattern`)??!1}},Ke=(e,t)=>({id:e,sshCommand:t,connectionTimeoutSec:60,remoteYuri:{mode:`managed`,keepRunning:!0,relayHost:!0,installMethod:`bun`,uploadBundleOverSsh:!1},localForward:{bindHost:`127.0.0.1`},auth:{},portForwards:[]}),qe=async()=>{let e=Y();if(!e)return{instances:[]};let t=await e(`desktop_ssh_instances_get`);return G(t)?{instances:(Array.isArray(t.instances)?t.instances:Array.isArray(t.desktopSshInstances)?t.desktopSshInstances:[]).map(e=>He(e)).filter(e=>!!e)}:{instances:[]}},Je=async e=>{let t=Y();t&&await t(`desktop_ssh_instances_set`,{config:{instances:e.instances}})},Ye=async()=>{let e=Y();if(!e)return[];let t=await e(`desktop_ssh_import_hosts`);return Array.isArray(t)?t.map(e=>Ge(e)).filter(e=>!!e):[]},Xe=async e=>{let t=Y();t&&await t(`desktop_ssh_connect`,{id:e})},Ze=async e=>{let t=Y();t&&await t(`desktop_ssh_disconnect`,{id:e})},Qe=async e=>{let t=Y();if(!t)return[];let n=await t(`desktop_ssh_status`,{...e?{id:e}:{}});return Array.isArray(n)?n.map(e=>We(e)).filter(e=>!!e):[]},$e=async(e,t)=>{let n=Y();if(!n)return[];let r=await n(`desktop_ssh_logs`,{id:e,...typeof t==`number`?{limit:t}:{}});return Array.isArray(r)?r.filter(e=>typeof e==`string`):[]},et=async e=>{let t=Y();t&&await t(`desktop_ssh_logs_clear`,{id:e})},tt=(e,t)=>{let n=Math.max(0,Math.trunc(Number(e.fileGroups)||0)),r=Math.max(0,Math.trunc(Number(e.singleFiles)||0)),i=Math.max(0,Math.trunc(Number(e.directories)||0));return{fileGroups:Array.from({length:n},()=>!0),singleFiles:Array.from({length:r},()=>!0),directories:Array.from({length:i},()=>!0),agentsRoot:!0,providerCredentials:t?.includeProviderCredentials===!0,magpie:!1}},nt=e=>{if(!G(e))return null;let t=K(e,`path`),n=q(e,`bytes`);return!t||n===null?null:{path:t,bytes:n}},rt=e=>{if(!G(e))return null;let t=K(e,`path`),n=q(e,`fileCount`)??q(e,`file_count`),r=q(e,`bytes`);return!t||n===null||r===null?null:{path:t,fileCount:n,bytes:r}},it=e=>{if(e==null||!G(e))return null;let t=q(e,`fileCount`)??q(e,`file_count`),n=q(e,`bytes`);return t===null||n===null?null:{fileCount:t,bytes:n}},at=e=>{if(e==null||!G(e))return null;let t=q(e,`bytes`);return t===null?null:{bytes:t}},ot=e=>{if(!G(e))return null;let t=Array.isArray(e.files)?e.files:null,n=Array.isArray(e.directories)?e.directories:null,r=Re(e.deletes),i=q(e,`totalBytes`)??q(e,`total_bytes`);if(!t||!n||i===null||!(`agentsRoot`in e)&&!(`agents_root`in e))return null;let a=t.map(e=>nt(e)).filter(e=>!!e),o=n.map(e=>rt(e)).filter(e=>!!e);if(a.length!==t.length||o.length!==n.length)return null;let s=e.agentsRoot??e.agents_root,c=s==null?null:it(s);if(s!=null&&c===null||!(`providerCredentials`in e))return null;let l=at(e.providerCredentials);if(e.providerCredentials!==null&&l===null)return null;let u=e.direction===`pull`||e.direction===`push`?e.direction:void 0,d=e.selections,f=G(d)?{fileGroups:Array.isArray(d.fileGroups)?d.fileGroups.map(e=>e!==!1):[],singleFiles:Array.isArray(d.singleFiles)?d.singleFiles.map(e=>e!==!1):[],directories:Array.isArray(d.directories)?d.directories.map(e=>e!==!1):[],agentsRoot:d.agentsRoot!==!1,providerCredentials:d.providerCredentials===!0,magpie:d.magpie===!0}:void 0,p=st(e.selectionShape??e.selection_shape);return{files:a,directories:o,agentsRoot:c,providerCredentials:l,magpieAvailable:e.magpieAvailable===!0,magpie:at(e.magpie),deletes:r,totalBytes:i,...u?{direction:u}:{},...f?{selections:f}:{},...p?{selectionShape:p}:{}}},st=e=>{if(!G(e))return null;let t=q(e,`fileGroups`)??q(e,`file_groups`),n=q(e,`singleFiles`)??q(e,`single_files`),r=q(e,`directories`);return t===null||n===null||r===null||t<0||n<0||r<0?null:{fileGroups:t,singleFiles:n,directories:r}},ct=e=>{if(!G(e))return null;let t=ot(e.plan);if(!t)return null;let n=st(e.selectionShape??e.selection_shape)??t.selectionShape??null;return{plan:t,remoteExisting:Re(e.remoteExisting??e.remote_existing),remoteAgentsRootExists:J(e,`remoteAgentsRootExists`)??J(e,`remote_agents_root_exists`)??!1,remoteProviderCredentialsExists:J(e,`remoteProviderCredentialsExists`)??!1,...n?{selectionShape:n}:{}}},lt=e=>{if(!G(e)||J(e,`ok`)!==!0)return null;let t=q(e,`files`),n=q(e,`directories`),r=q(e,`deletes`),i=q(e,`totalBytes`)??q(e,`total_bytes`);if(t===null||n===null||r===null||i===null||!(`agentsRoot`in e)&&!(`agents_root`in e))return null;let a=e.agentsRoot??e.agents_root,o=null;if(a!=null){if(!G(a))return null;let e=q(a,`fileCount`)??q(a,`file_count`);if(e===null)return null;o={fileCount:e}}if(!(`providerCredentials`in e))return null;let s=at(e.providerCredentials);if(e.providerCredentials!==null&&s===null)return null;let c=Re(e.magpieWarnings).filter(e=>e===`sign_in_required`||e===`plugin_install_failed`||e===`agent_settings_skipped`);return{ok:!0,files:t,directories:n,deletes:r,totalBytes:i,agentsRoot:o,providerCredentials:s,...c.length?{magpieWarnings:c}:{}}},ut=async(e={})=>{let t=Y();if(!t)return console.error(`[desktopSsh] config sync local scan skipped: desktop IPC bridge is unavailable in this window`),null;let n=await t(`desktop_ssh_sync_opencode_config`,{stage:`local`,...e.direction?{direction:e.direction}:{},...e.selections?{selections:e.selections}:{}});if(!G(n))return console.error(`[desktopSsh] config sync local scan returned a non-object payload`,n),null;let r=ot(n.plan);if(!r)return console.error(`[desktopSsh] config sync local scan plan payload was not recognized`,n),null;let i=st(n.selectionShape??n.selection_shape)??r.selectionShape??null;return i?{...r,selectionShape:i}:r},dt=async(e,t={})=>{let n=Y();if(!n)return console.error(`[desktopSsh] config sync preview skipped: desktop IPC bridge is unavailable in this window`),null;let r=await n(`desktop_ssh_sync_opencode_config`,{id:e,...t.targetKind?{targetKind:t.targetKind}:{},...t.direction?{direction:t.direction}:{},...t.selections?{selections:t.selections}:{}}),i=ct(r);return i||console.error(`[desktopSsh] config sync preview payload was not recognized`,r),i},ft=async(e,t={})=>{let n=Y();if(!n)return console.error(`[desktopSsh] config sync apply skipped: desktop IPC bridge is unavailable in this window`),null;let r=await n(`desktop_ssh_sync_opencode_config`,{id:e,apply:!0,...t.targetKind?{targetKind:t.targetKind}:{},...t.direction?{direction:t.direction}:{},...t.selections?{selections:t.selections}:{}}),i=lt(r);return i||console.error(`[desktopSsh] config sync apply payload was not recognized`,r),i},pt=async e=>{if(!o())return async()=>{};let t=window.__YURI_DESKTOP__?.listen;if(typeof t!=`function`)return async()=>{};let n=await t(`yuri:ssh-instance-status`,t=>{let n=We(t?.payload);n&&e(n)});return async()=>{await n()}},mt=new Set([`nodeRuntimeMissing`,`packageManagerMissing`,`nativeBinding`,`yuriCliMissing`,`yuriRegistry`,`yuriInstall`,`yuriCliIncompatible`,`opencodeInstall`,`serverStart`,`sshAuth`,`sshUnreachable`,`timeout`,`unknown`]),ht=e=>typeof e==`string`&&mt.has(e),gt=e=>{let t=String(e||``);return/requires Node\.js \d+|no supported Node runtime/i.test(t)?`nodeRuntimeMissing`:/neither bun nor npm/i.test(t)?`packageManagerMissing`:/better-sqlite3|node_gyp_bins|gyp ERR|failed to prepare better-sqlite3/i.test(t)?`nativeBinding`:/Yuri installation completed but the executable is unavailable/i.test(t)?`yuriCliMissing`:/could not reach the npm registry|ENOTFOUND|ECONNREFUSED|ETIMEDOUT|EAI_AGAIN|CERT_HAS_EXPIRED|UNABLE_TO_GET_ISSUER_CERT|self-signed certificate|registry\.npmjs|npm error code E404|npm ERR! code E404|getaddrinfo/i.test(t)?`yuriRegistry`:/Failed to install Yuri/i.test(t)?`yuriInstall`:/Unknown option:\s*--relay-host|does not advertise --relay-host|does not support --relay-host/i.test(t)||/Unknown option:/i.test(t)?`yuriCliIncompatible`:/Failed to install OpenCode|OpenCode CLI/i.test(t)?`opencodeInstall`:/failed to become reachable|Managed Yuri server failed/i.test(t)?`serverStart`:/Permission denied|Authentication failed|publickey|keyboard-interactive/i.test(t)?`sshAuth`:/Could not resolve hostname|Connection refused|Connection timed out|ControlMaster connection timed out|SSH master process exited|Network is unreachable/i.test(t)?`sshUnreachable`:/Timed out waiting for SSH|Timed out waiting for forwarded/i.test(t)?`timeout`:`unknown`},_t=(e,t)=>ht(e)?e:gt(t),vt=e=>{switch(e){case`nodeRuntimeMissing`:return`desktopHostSwitcher.sshError.nodeRuntimeMissing.title`;case`packageManagerMissing`:return`desktopHostSwitcher.sshError.packageManagerMissing.title`;case`nativeBinding`:return`desktopHostSwitcher.sshError.nativeBinding.title`;case`yuriCliMissing`:return`desktopHostSwitcher.sshError.yuriCliMissing.title`;case`yuriRegistry`:return`desktopHostSwitcher.sshError.yuriRegistry.title`;case`yuriInstall`:return`desktopHostSwitcher.sshError.yuriInstall.title`;case`yuriCliIncompatible`:return`desktopHostSwitcher.sshError.yuriCliIncompatible.title`;case`opencodeInstall`:return`desktopHostSwitcher.sshError.opencodeInstall.title`;case`serverStart`:return`desktopHostSwitcher.sshError.serverStart.title`;case`sshAuth`:return`desktopHostSwitcher.sshError.sshAuth.title`;case`sshUnreachable`:return`desktopHostSwitcher.sshError.sshUnreachable.title`;case`timeout`:return`desktopHostSwitcher.sshError.timeout.title`;default:return`desktopHostSwitcher.sshError.unknown.title`}},yt=e=>{switch(e){case`nodeRuntimeMissing`:return`desktopHostSwitcher.sshError.nodeRuntimeMissing.guidance`;case`packageManagerMissing`:return`desktopHostSwitcher.sshError.packageManagerMissing.guidance`;case`nativeBinding`:return`desktopHostSwitcher.sshError.nativeBinding.guidance`;case`yuriCliMissing`:return`desktopHostSwitcher.sshError.yuriCliMissing.guidance`;case`yuriRegistry`:return`desktopHostSwitcher.sshError.yuriRegistry.guidance`;case`yuriInstall`:return`desktopHostSwitcher.sshError.yuriInstall.guidance`;case`yuriCliIncompatible`:return`desktopHostSwitcher.sshError.yuriCliIncompatible.guidance`;case`opencodeInstall`:return`desktopHostSwitcher.sshError.opencodeInstall.guidance`;case`serverStart`:return`desktopHostSwitcher.sshError.serverStart.guidance`;case`sshAuth`:return`desktopHostSwitcher.sshError.sshAuth.guidance`;case`sshUnreachable`:return`desktopHostSwitcher.sshError.sshUnreachable.guidance`;case`timeout`:return`desktopHostSwitcher.sshError.timeout.guidance`;default:return`desktopHostSwitcher.sshError.unknown.guidance`}},bt=e=>e===`unknown`||e===`yuriCliIncompatible`,xt=(e,t,n)=>{let r=typeof n==`string`?n.trim():``;return!bt(t)||!r||r===e?e:`${e}\n${r}`},X=T();function St(e){let t=(0,U.c)(27),{errorCode:n,detail:r,className:i}=e,{t:a}=le(),o,s,c,l,u,d;if(t[0]!==i||t[1]!==r||t[2]!==n||t[3]!==a){let e=_t(n,r);o=a(yt(e));let f;t[10]===r?f=t[11]:(f=typeof r==`string`?r.trim():``,t[10]=r,t[11]=f),s=f,c=bt(e)&&!!s&&s!==o,t[12]===i?d=t[13]:(d=P(`space-y-1`,i),t[12]=i,t[13]=d),l=`typography-ui-label text-[var(--status-error)]`,u=a(vt(e)),t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d}else o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9];let f;t[14]!==l||t[15]!==u?(f=(0,X.jsx)(`p`,{className:l,children:u}),t[14]=l,t[15]=u,t[16]=f):f=t[16];let p;t[17]===o?p=t[18]:(p=(0,X.jsx)(`p`,{className:`typography-meta text-muted-foreground`,children:o}),t[17]=o,t[18]=p);let m;t[19]!==s||t[20]!==c?(m=c?(0,X.jsx)(`p`,{className:`typography-meta break-words text-muted-foreground`,children:s}):null,t[19]=s,t[20]=c,t[21]=m):m=t[21];let h;return t[22]!==d||t[23]!==f||t[24]!==p||t[25]!==m?(h=(0,X.jsxs)(`div`,{className:d,children:[f,p,m]}),t[22]=d,t[23]=f,t[24]=p,t[25]=m,t[26]=h):h=t[26],h}var Ct=`/auth/passkey/authenticate/options`,wt=`/auth/passkey/authenticate/verify`,Tt=`/auth/passkey/register/options`,Et=`/auth/passkey/register/verify`,Dt=`/api/passkeys`,Ot=`/auth/passkey/status`,kt=`/api/auth/reset`,At={enabled:!1,hasPasskeys:!1,passkeyCount:0,rpID:null},jt=async(e,t)=>r(e,{method:`POST`,credentials:`include`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:t===void 0?void 0:JSON.stringify(t)}),Mt=async(e,t)=>{try{let t=await e.json();if(t&&typeof t.error==`string`&&t.error.trim())return t.error}catch{}return t},Nt=e=>e instanceof H&&e.code===`ERROR_CEREMONY_ABORTED`,Pt=()=>{fe.cancelCeremony()},Ft=()=>typeof window>`u`?{supported:!1,reason:`Passkeys are unavailable outside the browser.`}:window.isSecureContext?{supported:!0,reason:``}:{supported:!1,reason:`Passkeys require HTTPS or localhost.`},It=async()=>{let e=Ft();if(!e.supported)throw Error(e.reason);let t=await jt(Tt,{label:typeof navigator.userAgent==`string`&&navigator.userAgent.trim()?navigator.userAgent:`This device`});if(!t.ok)throw Error(await Mt(t,`Could not start passkey setup.`));let{requestId:n,optionsJSON:r}=await t.json(),i=await jt(Et,{requestId:n,response:await de({optionsJSON:r})});if(!i.ok)throw Error(await Mt(i,`Could not finish passkey setup.`));return i.json().catch(()=>null)},Lt=async(e,t={})=>{let n=Ft();if(!n.supported)throw Error(n.reason);let r=await jt(Ct);if(!r.ok)throw Error(await Mt(r,`Passkey sign-in is not available right now.`));let{requestId:i,optionsJSON:a}=await r.json(),o=await jt(wt,{requestId:i,response:await pe({optionsJSON:a}),trustDevice:e,issueClientToken:t.issueClientToken===!0,clientLabel:t.clientLabel,clientKind:t.clientKind,dedupeKey:t.dedupeKey});if(!o.ok)throw Error(await Mt(o,`Passkey sign-in failed.`));return o.json().catch(()=>null)},Rt=async()=>{let e=await r(Ot,{method:`GET`,credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)return At;let t=await e.json().catch(()=>null);return{enabled:t?.enabled===!0,hasPasskeys:t?.hasPasskeys===!0,passkeyCount:typeof t?.passkeyCount==`number`?t.passkeyCount:0,rpID:typeof t?.rpID==`string`&&t.rpID?t.rpID:null}},zt=async()=>{let e=await r(Dt,{method:`GET`,credentials:`include`,headers:{Accept:`application/json`}});if(!e.ok)throw Error(await Mt(e,`Could not load passkeys.`));let t=await e.json().catch(()=>null);return Array.isArray(t?.passkeys)?t.passkeys:[]},Bt=async e=>{let t=await r(`${Dt}/${encodeURIComponent(e)}`,{method:`DELETE`,credentials:`include`,headers:{Accept:`application/json`}});if(!t.ok)throw Error(await Mt(t,`Could not remove passkey.`));return t.json().catch(()=>null)},Vt=async()=>{let e=await jt(kt);if(!e.ok)throw Error(await Mt(e,`Could not clear saved authentication.`));try{let{clearAssistantAttachmentCacheAll:e}=await oe(async()=>{let{clearAssistantAttachmentCacheAll:e}=await import(`./assistant-attachment-cache-C-SlEpSB.js`).then(e=>e.t);return{clearAssistantAttachmentCacheAll:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),{invalidateRuntimeAuthSession:t}=await oe(async()=>{let{invalidateRuntimeAuthSession:e}=await import(`./runtime-auth-Bh3htXtG.js`).then(e=>e.m);return{invalidateRuntimeAuthSession:e}},__vite__mapDeps([2,1]));await e(`auth-reset`),t()}catch{}return e.json().catch(()=>null)},Z=e(E(),1);function Ht(e){let t=(0,U.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=P(`bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`card`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ut(e){let t=(0,U.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=P(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`card-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wt(e){let t=(0,U.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=P(`leading-none font-semibold`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`card-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Gt(e){let t=(0,U.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=P(`px-6`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`card-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Kt=class extends Z.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t,copied:!1}),console.error(`Error caught by boundary:`,e,t)}handleReset=()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})};handleCopy=async()=>{let{strings:e}=this.props,t=`${this.state.error?String(this.state.error):e.unknownError}${this.state.error?.stack?`\n\nStack:\n${this.state.error.stack}`:``}${this.state.errorInfo?.componentStack?`\n\n${e.componentStackLabel}${this.state.errorInfo.componentStack}`:``}`;(await L(t)).ok&&(this.setState({copied:!0}),window.setTimeout(()=>{this.setState(e=>e.copied?{copied:!1}:null)},1500))};render(){let{strings:e}=this.props;return this.state.hasError?this.props.fallback?this.props.fallback:(0,X.jsx)(`div`,{className:`p-4 flex items-center justify-center min-h-screen`,children:(0,X.jsxs)(Ht,{className:`w-full max-w-md`,children:[(0,X.jsx)(Ut,{className:`text-center`,children:(0,X.jsxs)(Wt,{className:`flex items-center justify-center gap-2 text-destructive`,children:[(0,X.jsx)(V,{name:`error-warning`,className:`h-5 w-5`}),e.title]})}),(0,X.jsxs)(Gt,{className:`space-y-4`,children:[(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground text-center`,children:e.description}),this.state.error&&(0,X.jsxs)(`details`,{className:`text-xs font-mono bg-muted p-3 rounded`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer hover:bg-interactive-hover/80`,children:e.detailsSummary}),(0,X.jsxs)(`pre`,{className:`mt-2 max-h-48 overflow-auto`,children:[this.state.error.toString(),this.state.errorInfo?.componentStack?`\n\n${e.componentStackLabel}${this.state.errorInfo.componentStack}`:``]})]}),(0,X.jsxs)(`div`,{className:`flex gap-2`,children:[(0,X.jsxs)(ce,{onClick:this.handleReset,variant:`outline`,className:`flex-1`,children:[(0,X.jsx)(V,{name:`restart`,className:`h-4 w-4 mr-2`}),e.tryAgain]}),(0,X.jsx)(ce,{onClick:this.handleCopy,variant:`outline`,className:`flex-1`,children:this.state.copied?e.copied:e.copy})]})]})]})}):this.props.children}},qt=e=>{let t=(0,U.c)(29),{children:n,fallback:r}=e,{t:i}=le(),a;t[0]===i?a=t[1]:(a=i(`errorBoundary.state.unknownError`),t[0]=i,t[1]=a);let o;t[2]===i?o=t[3]:(o=i(`errorBoundary.title`),t[2]=i,t[3]=o);let s;t[4]===i?s=t[5]:(s=i(`errorBoundary.description`),t[4]=i,t[5]=s);let c;t[6]===i?c=t[7]:(c=i(`errorBoundary.actions.errorDetails`),t[6]=i,t[7]=c);let l;t[8]===i?l=t[9]:(l=i(`errorBoundary.state.componentStackLabel`),t[8]=i,t[9]=l);let u;t[10]===i?u=t[11]:(u=i(`errorBoundary.actions.tryAgain`),t[10]=i,t[11]=u);let d;t[12]===i?d=t[13]:(d=i(`errorBoundary.actions.copied`),t[12]=i,t[13]=d);let f;t[14]===i?f=t[15]:(f=i(`errorBoundary.actions.copy`),t[14]=i,t[15]=f);let p;t[16]!==a||t[17]!==o||t[18]!==s||t[19]!==c||t[20]!==l||t[21]!==u||t[22]!==d||t[23]!==f?(p={unknownError:a,title:o,description:s,detailsSummary:c,componentStackLabel:l,tryAgain:u,copied:d,copy:f},t[16]=a,t[17]=o,t[18]=s,t[19]=c,t[20]=l,t[21]=u,t[22]=d,t[23]=f,t[24]=p):p=t[24];let m=p,h;return t[25]!==n||t[26]!==r||t[27]!==m?(h=(0,X.jsx)(Kt,{fallback:r,strings:m,children:n}),t[25]=n,t[26]=r,t[27]=m,t[28]=h):h=t[28],h},Jt=`__unassigned__`,Yt={mod:`mod`,shift:`shift`,alt:`alt`,option:`alt`,ctrl:`ctrl`,meta:`mod`,cmd:`mod`,command:`mod`},Xt={mod:I()?`⌘`:`Ctrl`,shift:`⇧`,alt:`⌥`,option:`⌥`,ctrl:`⌃`},Zt={comma:`,`,period:`.`,enter:`Enter`,escape:`Esc`,tab:`Tab`,space:`Space`,backspace:`⌫`,delete:`⌦`,arrowup:`↑`,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`,home:`Home`,end:`End`,pageup:`Page Up`,pagedown:`Page Down`,backtick:"`",grave:"`","=":`=`,equal:`=`,plus:`+`,minus:`-`,"-":`-`},Qt=[`mod`,`ctrl`,`shift`,`alt`],$t={"{":`[`,"}":`]`,":":`;`,'"':`'`,"<":`,`,">":`.`,"?":`/`,"|":`\\`,"~":"`","!":`1`,"@":`2`,"#":`3`,$:`4`,"%":`5`,"^":`6`,"&":`7`,"*":`8`,"(":`9`,")":`0`};function en(e){return e.trim().toLowerCase()===Jt}function tn(e){let t=e.toLowerCase();return t===`,`?`comma`:t===`.`?`period`:t===` `?`space`:t===`esc`?`escape`:t===`+`?`plus`:t===`-`||t===`_`?`minus`:t===`arrowup`?`arrowup`:t===`arrowdown`?`arrowdown`:t===`arrowleft`?`arrowleft`:t===`arrowright`?`arrowright`:t==="`"?`backtick`:$t[t]??t}var nn=[{id:`open_command_palette`,defaultCombo:`mod+p`,label:`Open command palette`,description:`Open the command palette`,customizable:!0},{id:`focus_input`,defaultCombo:`mod+i`,label:`Focus input`,description:`Focus the chat input field`,customizable:!0},{id:`open_status`,defaultCombo:`mod+shift+o`,label:`Open OpenCode status`,description:`Open the OpenCode status dialog`},{id:`open_settings`,defaultCombo:`mod+comma`,label:`Open settings`,description:`Open the settings panel`,customizable:!0},{id:`toggle_terminal`,defaultCombo:`ctrl+backtick`,label:`Toggle terminal`,description:`Toggle the integrated terminal`,customizable:!0},{id:`toggle_bottom_panel`,defaultCombo:`mod+j`,label:`Toggle bottom panel`,description:`Toggle the bottom panel dock`,customizable:!0},{id:`toggle_terminal_expanded`,defaultCombo:`mod+shift+j`,label:`Toggle terminal expanded`,description:`Toggle terminal expanded or collapsed`,customizable:!0},{id:`new_terminal_tab`,defaultCombo:`mod+t`,label:`New terminal tab`,description:`Create a new terminal tab when the terminal is focused`,customizable:!0},{id:`open_new_terminal`,defaultCombo:`mod+shift+backtick`,label:`Open new terminal`,description:`Open the terminal panel and create a new terminal tab`,customizable:!0},{id:`previous_terminal_tab`,defaultCombo:`mod+shift+[`,label:`Previous terminal tab`,description:`Switch to the previous terminal tab when the terminal is focused`,customizable:!0},{id:`next_terminal_tab`,defaultCombo:`mod+shift+]`,label:`Next terminal tab`,description:`Switch to the next terminal tab when the terminal is focused`,customizable:!0},{id:`toggle_files`,defaultCombo:`mod+shift+f`,label:`Toggle files`,description:`Toggle the files panel`},{id:`toggle_sidebar`,defaultCombo:`mod+b`,label:`Toggle sidebar`,description:`Toggle the session sidebar`,customizable:!0},{id:`open_timeline_dialog`,defaultCombo:`mod+t`,label:`Open conversation timeline`,description:`Search and navigate within current conversation`,customizable:!0},{id:`toggle_prompt_navigator`,defaultCombo:`mod+alt+p`,label:`Toggle prompt navigator`,description:`Show or hide the prompt navigator panel in chat`,customizable:!0},{id:`toggle_right_sidebar`,defaultCombo:`mod+alt+b`,defaultAliases:[`mod+\\`],label:`Toggle review panel`,description:`Toggle the review panel (right sidebar)`,customizable:!0},{id:`open_right_sidebar_git`,defaultCombo:`mod+shift+g`,label:`Open right sidebar Git tab`,description:`Open right sidebar and select Git`,customizable:!0},{id:`open_right_sidebar_files`,defaultCombo:`mod+shift+f`,label:`Open right sidebar Files tab`,description:`Open right sidebar and select Files`,customizable:!0},{id:`cycle_right_sidebar_tab`,defaultCombo:`mod+alt+shift+r`,label:`Cycle right sidebar tab`,description:`Cycle through right sidebar tabs`,customizable:!0},{id:`close_context_panel_tab`,defaultCombo:`mod+w`,label:`Close context panel tab`,description:`Close the active context panel tab (closes the panel when empty)`,customizable:!0},{id:`previous_session`,defaultCombo:`mod+shift+[`,defaultAliases:[`mod+arrowup`],label:`Previous session`,description:`Switch to the previous session`,customizable:!0},{id:`next_session`,defaultCombo:`mod+shift+]`,defaultAliases:[`mod+arrowdown`],label:`Next session`,description:`Switch to the next session`,customizable:!0},{id:`new_chat`,defaultCombo:`mod+n`,label:`New session`,description:`Start a new session`,customizable:!0},{id:`new_chat_worktree`,defaultCombo:`mod+shift+alt+n`,label:`New worktree draft`,description:`Create a new worktree and open a draft in it`,customizable:!0},{id:`new_mini_chat`,defaultCombo:`mod+alt+n`,label:`New Mini Chat window`,description:`Open a new Mini Chat draft window`,customizable:!0},{id:`submit_message`,defaultCombo:`mod+enter`,label:`Submit message`,description:`Submit the current message`},{id:`clear_input`,defaultCombo:`escape`,label:`Clear input`,description:`Clear the input field`},{id:`clear_all_messages`,defaultCombo:`ctrl+c`,label:`Clear all messages`,description:`Clear the composer input and queued messages`,customizable:!0},{id:`open_diff_panel`,defaultCombo:`mod+2`,label:`Open diff panel`,description:`Switch to the diff panel`},{id:`open_terminal_panel`,defaultCombo:`mod+3`,label:`Open terminal panel`,description:`Switch to the terminal panel`},{id:`open_git_panel`,defaultCombo:`mod+4`,label:`Open git panel`,description:`Switch to the git panel`},{id:`open_help`,defaultCombo:`mod+.`,label:`Open keyboard shortcuts`,description:`Show the keyboard shortcuts help`,customizable:!0},{id:`toggle_services_menu`,defaultCombo:`mod+shift+s`,label:`Toggle services menu`,description:`Open or close the services menu`,customizable:!0},{id:`open_usage`,defaultCombo:`mod+shift+c`,label:`Open usage`,description:`Open the usage panel`,customizable:!0},{id:`cycle_services_tab`,defaultCombo:`mod+alt+shift+s`,label:`Cycle services tab`,description:`Cycle through tabs in the services menu`,customizable:!0},{id:`cycle_theme`,defaultCombo:`mod+/`,label:`Cycle theme`,description:`Cycle between light, dark, and system theme`,customizable:!0},{id:`zoom_in`,defaultCombo:`mod+=`,label:`Zoom in`,description:`Increase the webview zoom level`,customizable:!0},{id:`zoom_out`,defaultCombo:`mod+-`,label:`Zoom out`,description:`Decrease the webview zoom level`,customizable:!0},{id:`zoom_reset`,defaultCombo:`mod+0`,label:`Reset zoom`,description:`Reset the webview zoom level to 100%`,customizable:!0},{id:`leader_key`,defaultCombo:`ctrl+x`,label:`Leader key`,description:`Start an OpenCode-style chord, then press M / A / N / C`,customizable:!0},{id:`open_model_selector`,defaultCombo:`mod+shift+m`,label:`Open model selector`,description:`Open model selector while in chat`,customizable:!0},{id:`cycle_thinking_variant`,defaultCombo:`mod+shift+t`,label:`Cycle thinking variant`,description:`Cycle thinking variant while in chat`},{id:`cycle_agent`,defaultCombo:`tab`,label:`Cycle agent`,description:`Cycle agent while the model selector is open`,customizable:!0},{id:`cycle_favorite_model_forward`,defaultCombo:`ctrl+]`,label:`Cycle favorite model forward`,description:`Cycle forward through starred models without opening the picker`,customizable:!0},{id:`cycle_favorite_model_backward`,defaultCombo:`ctrl+[`,label:`Cycle favorite model backward`,description:`Cycle backward through starred models without opening the picker`,customizable:!0},{id:`expand_input`,defaultCombo:`mod+shift+e`,label:`Expand input`,description:`Toggle focus mode for the chat input`,customizable:!0},{id:`toggle_dictation`,defaultCombo:`mod+alt+v`,label:`Voice input`,description:`Start dictation; press again to confirm and insert the transcript`,customizable:!0},{id:`abort_run`,defaultCombo:`escape`,label:`Abort active run`,description:`Abort the currently running task (double press)`},{id:`switch_tab_1`,defaultCombo:`mod+1`,label:`Switch to visible session 1`,description:`Switch to the first visible sidebar session`},{id:`switch_tab_2`,defaultCombo:`mod+2`,label:`Switch to visible session 2`,description:`Switch to the second visible sidebar session`},{id:`switch_tab_3`,defaultCombo:`mod+3`,label:`Switch to visible session 3`,description:`Switch to the third visible sidebar session`},{id:`switch_tab_4`,defaultCombo:`mod+4`,label:`Switch to visible session 4`,description:`Switch to the fourth visible sidebar session`},{id:`switch_tab_5`,defaultCombo:`mod+5`,label:`Switch to visible session 5`,description:`Switch to the fifth visible sidebar session`},{id:`switch_tab_6`,defaultCombo:`mod+6`,label:`Switch to visible session 6`,description:`Switch to the sixth visible sidebar session`},{id:`switch_tab_7`,defaultCombo:`mod+7`,label:`Switch to visible session 7`,description:`Switch to the seventh visible sidebar session`},{id:`switch_tab_8`,defaultCombo:`mod+8`,label:`Switch to visible session 8`,description:`Switch to the eighth visible sidebar session`},{id:`switch_tab_9`,defaultCombo:`mod+9`,label:`Switch to visible session 9`,description:`Switch to the ninth visible sidebar session`}];function rn(e){if(en(e))return Jt;let t=e.toLowerCase().trim().split(`+`).map(e=>e.trim()).filter(Boolean),n=new Set,r=``;for(let e of t){let t=e===`,`?`comma`:e===`.`?`period`:e,i=Yt[t];if(i){n.add(i);continue}r=t}return[...Qt.filter(e=>n.has(e)),r].filter(Boolean).join(`+`)}function an(e){return en(e)?!0:on(e).key.trim().length>0}function on(e){if(en(e))return{modifiers:new Set,key:Jt};let t=rn(e).split(`+`),n=new Set,r=``;for(let e of t){let t=Yt[e];t?n.add(t):r=e}return{modifiers:n,key:r}}function sn(e){if(en(e))return`Unassigned`;let t=on(e);if(!t.key&&t.modifiers.size===0)return`Unassigned`;let n=[];for(let e of Qt)t.modifiers.has(e)&&n.push(Xt[e]);if(t.key){let e=Zt[t.key.toLowerCase()]||t.key.toUpperCase();n.push(e)}return n.join(` + `)}function cn(e){return nn.find(t=>t.id===e)}function ln(){return nn.filter(e=>e.customizable===!0)}function un(e,t){let n=cn(e);if(!n)return``;let r=t?.[e];if(typeof r==`string`){if(r.trim().toLowerCase()===`__unassigned__`)return``;let e=rn(r);if(e===`__unassigned__`)return Jt;if(an(e))return e}return n.defaultCombo}function dn(e,t){let n=cn(e);if(!n)return[];let r=un(e,t);return r===n.defaultCombo?[n.defaultCombo,...n.defaultAliases??[]]:r?[r]:[]}function fn(e){if(en(e))return!1;let t=on(e);if(!t.modifiers.has(`mod`))return!1;let n=t.key.toLowerCase();return new Set([`w`,`t`,`r`,`p`,`s`,`f`,`l`,`n`]).has(n)&&!t.modifiers.has(`shift`)&&!t.modifiers.has(`alt`)}function pn(e,t){let n=typeof t==`string`?t:t.defaultCombo;if(en(n))return!1;let r=on(n),a=r.modifiers.has(`mod`),o=r.modifiers.has(`shift`),s=r.modifiers.has(`alt`),c=r.modifiers.has(`ctrl`),l=I()&&i(),u=I(),d=l?e.metaKey:u&&e.metaKey||e.ctrlKey;if(a&&!d||!a&&e.metaKey||o!==e.shiftKey||s!==e.altKey)return!1;if(c){if(!e.ctrlKey)return!1}else{let t=a&&!l&&e.ctrlKey;if(e.ctrlKey&&!t)return!1}let f=e.key;return(!f||f===`Dead`)&&e.code===`Backquote`&&(f="`"),e.altKey&&(e.code.startsWith(`Key`)&&e.code.length===4?f=e.code.slice(3).toLowerCase():e.code.startsWith(`Digit`)&&e.code.length===6&&(f=e.code.slice(5))),tn(f)===tn(r.key)}function mn(){return I()?`⌘`:`Ctrl`}function hn(e,t,n){if(pn(e,n))return!0;let r=rn(n),a=I()&&i(),o=I();return!(a?e.metaKey:o&&e.metaKey||e.ctrlKey)||e.altKey||a&&e.ctrlKey&&!e.metaKey?!1:t===`in`&&r===`mod+=`?e.key===`+`||e.code===`NumpadAdd`:t===`out`&&(r===`mod+-`||r===`mod+minus`)?e.key===`_`||e.code===`NumpadSubtract`:!1}var gn=Z.createContext(null),_n=e=>e?e.closest(`[data-slot="dialog-content"], [role="dialog"]`):null;function vn(e,t){return e&&Z.isValidElement(t)?{render:t}:{children:t}}function yn(e){let t=(0,U.c)(9),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let[r,i]=Z.useState(null),a;t[2]===r?a=t[3]:(a={portalContainer:r,setPortalContainer:i},t[2]=r,t[3]=a);let o=a,s;t[4]===n?s=t[5]:(s=(0,X.jsx)(x,{...n}),t[4]=n,t[5]=s);let c;return t[6]!==o||t[7]!==s?(c=(0,X.jsx)(gn.Provider,{value:o,children:s}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function bn(e){let t=(0,U.c)(22),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({asChild:n,children:r,onPointerDownCapture:a,onFocusCapture:i,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=Z.useContext(gn),c;t[6]===s?c=t[7]:(c=e=>{if(!s)return;let t=e instanceof HTMLElement?e:null;s.setPortalContainer(_n(t))},t[6]=s,t[7]=c);let l=c,u;t[8]!==n||t[9]!==r?(u=vn(n,r),t[8]=n,t[9]=r,t[10]=u):u=t[10];let d=u,f;t[11]!==a||t[12]!==l?(f=e=>{l(e.currentTarget),a?.(e)},t[11]=a,t[12]=l,t[13]=f):f=t[13];let p;t[14]!==i||t[15]!==l?(p=e=>{l(e.currentTarget),i?.(e)},t[14]=i,t[15]=l,t[16]=p):p=t[16];let m;return t[17]!==o||t[18]!==d||t[19]!==f||t[20]!==p?(m=(0,X.jsx)(w,{"data-slot":`dropdown-menu-trigger`,onPointerDownCapture:f,onFocusCapture:p,...o,...d}),t[17]=o,t[18]=d,t[19]=f,t[20]=p,t[21]=m):m=t[21],m}function xn(e){let t=(0,U.c)(40),n,r,i,a,o,s,c,l,u,d,f,p,m;if(t[0]!==e){let{className:h,sideOffset:g,align:_,side:v,alignOffset:y,anchor:b,portalToBody:x,positionerClassName:S,style:ee,children:C,onCloseAutoFocus:w,collisionPadding:T,collisionAvoidance:E,...D}=e;o=h,d=g,n=_,l=v,r=y,i=b,f=x,s=S,u=ee,a=C,p=T,m=E,c=D,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13];let h=d===void 0?4:d,g=f!==void 0&&f,_=p===void 0?8:p,v;t[14]===m?v=t[15]:(v=m===void 0?{side:`shift`,align:`shift`}:m,t[14]=m,t[15]=v);let y=v,x=Z.useContext(gn),S=g?void 0:x?.portalContainer||void 0,C;t[16]===s?C=t[17]:(C=P(`app-region-no-drag z-50`,s),t[16]=s,t[17]=C);let w;t[18]===u?w=t[19]:(w={color:`var(--surface-elevated-foreground)`,...u},t[18]=u,t[19]=w);let T;t[20]===o?T=t[21]:(T=P(Ce,o),t[20]=o,t[21]=T);let E;t[22]!==a||t[23]!==c||t[24]!==w||t[25]!==T?(E=(0,X.jsx)(D,{"data-slot":`dropdown-menu-content`,style:w,className:T,...c,children:a}),t[22]=a,t[23]=c,t[24]=w,t[25]=T,t[26]=E):E=t[26];let O;t[27]!==n||t[28]!==r||t[29]!==i||t[30]!==y||t[31]!==_||t[32]!==l||t[33]!==h||t[34]!==E||t[35]!==C?(O=(0,X.jsx)(b,{anchor:i,sideOffset:h,align:n,side:l,alignOffset:r,collisionPadding:_,collisionAvoidance:y,className:C,children:E}),t[27]=n,t[28]=r,t[29]=i,t[30]=y,t[31]=_,t[32]=l,t[33]=h,t[34]=E,t[35]=C,t[36]=O):O=t[36];let k;return t[37]!==O||t[38]!==S?(k=(0,X.jsx)(ee,{container:S,children:O}),t[37]=O,t[38]=S,t[39]=k):k=t[39],k}function Sn(e){let t=(0,U.c)(24),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({className:i,inset:a,variant:l,asChild:n,children:r,onSelect:s,onClick:o,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=l===void 0?`default`:l,d;t[9]!==n||t[10]!==r?(d=vn(n,r),t[9]=n,t[10]=r,t[11]=d):d=t[11];let f=d,p;t[12]!==o||t[13]!==s?(p=e=>{o?.(e),e.defaultPrevented||s?.(e)},t[12]=o,t[13]=s,t[14]=p):p=t[14];let m=p,h;t[15]===i?h=t[16]:(h=P(Te,i),t[15]=i,t[16]=h);let g;return t[17]!==m||t[18]!==a||t[19]!==c||t[20]!==f||t[21]!==h||t[22]!==u?(g=(0,X.jsx)(_,{"data-slot":`dropdown-menu-item`,"data-inset":a,"data-variant":u,className:h,...c,onClick:m,...f}),t[17]=m,t[18]=a,t[19]=c,t[20]=f,t[21]=h,t[22]=u,t[23]=g):g=t[23],g}function Cn(e){let t=(0,U.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(y,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function wn(e){let t=(0,U.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=P(`data-[highlighted]:bg-interactive-hover hover:bg-interactive-hover data-[checked]:bg-interactive-selection data-[checked]:text-interactive-selection-foreground relative flex cursor-pointer items-start gap-2 rounded-lg py-1 pl-2 pr-8 typography-ui-label outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-3.5 items-center justify-center text-primary`,children:(0,X.jsx)(S,{children:(0,X.jsx)(V,{name:`check`,className:`size-3`})})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,X.jsxs)(v,{"data-slot":`dropdown-menu-radio-item`,className:a,...i,children:[o,n]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Tn(e){let t=(0,U.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=P(`px-2 py-1 typography-ui-label font-medium data-[inset]:pl-8`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,X.jsx)(`div`,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function En(e){let t=(0,U.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=P(we,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(g,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Dn=e(C(),1),On=`mobile-overlay-root`,kn=16,An=200,jn=[],Mn=0,Nn=``,Pn=0,Fn=()=>{if(typeof document>`u`)return null;let e=document.getElementById(On);return e||(e=document.createElement(`div`),e.id=On,document.body.appendChild(e)),e},In=({open:e,title:t,onClose:n,children:r,footer:i,className:a,contentMaxHeightClassName:o,renderHeader:s,containedBody:c=!1,closeAriaLabel:l})=>{let u=Z.useRef(null),d=Z.useRef(Symbol(`mobile-overlay`)),f=Z.useRef(n);f.current=n;let[p,m]=Z.useState(!1),[h,g]=Z.useState(!1);if(typeof document<`u`&&!u.current&&(u.current=Fn()),Z.useEffect(()=>{if(!e){m(!1),g(!1);return}let t=window.setTimeout(()=>m(!0),kn),n=window.setTimeout(()=>g(!0),266);return()=>{window.clearTimeout(t),window.clearTimeout(n)}},[e]),Z.useLayoutEffect(()=>{if(e)return Pn===0&&window.dispatchEvent(new Event(`yuri:mobile-overlay-opened`)),Pn+=1,()=>{Pn=Math.max(0,Pn-1),Pn===0&&window.dispatchEvent(new Event(`yuri:mobile-overlay-closed`))}},[e]),Z.useEffect(()=>{if(!e)return;let t=d.current;jn.push(t),Mn===0&&(Nn=document.body.style.overflow),Mn+=1,document.body.style.overflow=`hidden`;let n=e=>{e.key===`Escape`&&jn[jn.length-1]===t&&f.current()};return document.addEventListener(`keydown`,n),()=>{let e=jn.lastIndexOf(t);e>=0&&jn.splice(e,1),Mn=Math.max(0,Mn-1),Mn===0&&(document.body.style.overflow=Nn),document.removeEventListener(`keydown`,n)}},[e]),!e||!u.current)return null;let _=o??`max-h-[min(70vh,520px)]`,v=(0,X.jsx)(`div`,{className:P(`yuri-keyboard-inset-surface fixed inset-0 z-[60] flex flex-col bg-[rgb(0_0_0_/_0.45)] transition-opacity duration-200 ease-out`,!h&&`yuri-keyboard-inset-snap`,p?`opacity-100`:`opacity-0`),role:`dialog`,"aria-modal":`true`,"aria-label":t,onPointerDown:ge,onClick:e=>{he(e)&&n()},children:(0,X.jsxs)(`div`,{className:P(`mt-auto flex max-h-[calc(100dvh-0.75rem)] min-h-0 w-full flex-col rounded-t-xl border-x border-t border-border/50 bg-background pb-[max(0.5rem,var(--yuri-app-bottom-safe,0px),var(--yuri-safe-area-bottom,env(safe-area-inset-bottom,0px)))] shadow-none pwa-overlay-panel`,`mx-auto max-w-lg`,a),style:{transform:p?`none`:`translateY(100%)`,transition:`transform ${An}ms cubic-bezier(0.32, 0.72, 0, 1)`},onClick:e=>e.stopPropagation(),children:[(()=>{let e=(0,X.jsx)(`button`,{type:`button`,onClick:n,className:P(`flex items-center justify-center rounded-lg text-muted-foreground hover:bg-interactive-hover`,c?`size-11`:`h-8 w-8`),"aria-label":l??t,children:(0,X.jsx)(V,{name:`close`,className:`h-4 w-4`})});return s?s(e):(0,X.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border/40`,children:[(0,X.jsx)(`h2`,{className:`typography-ui-label font-semibold text-foreground`,children:t}),e]})})(),c?(0,X.jsx)(`div`,{className:P(`flex min-h-0 flex-1 flex-col overflow-hidden`,_),children:r}):(0,X.jsx)(Se,{useScrollShadow:!0,disableHorizontal:!0,preventOverscroll:!0,outerClassName:P(`min-h-0 flex-1`,_),className:`px-2 py-2 pwa-overlay-scroll`,children:r}),i?(0,X.jsx)(`div`,{className:`shrink-0 border-t border-border/40 px-3 py-2`,children:i}):null]})});return(0,Dn.createPortal)(v,u.current)},Ln=8,Rn=e=>typeof e!=`number`||Number.isNaN(e)?``:Oe(e),zn=(e,t,n)=>{let r=e.find(e=>e.id===t)?.models?.find(e=>e.id===n);return r?.variants?Object.keys(r.variants):[]},Bn=e=>{let t=(0,U.c)(54),{open:n,onClose:r,selectedProviderID:i,selectedModelID:a,resolveSelectedVariant:o,onSelect:s,providers:c,favoriteModels:l,recentModels:u,hiddenModels:d,allowedProviderIds:f,allowedModelIdsByProvider:p,providerOrder:m,variantSelectionEnabled:h,isFavorite:g,onToggleFavorite:_,getMetadata:v,view:y,onViewChange:b}=e,x;t[0]===d?x=t[1]:(x=d===void 0?[]:d,t[0]=d,t[1]=x);let S=x,ee=h===void 0||h,{t:C}=le(),w=Z.useId(),[T,E]=Z.useState(``),D;t[2]===i?D=t[3]:(D=()=>new Set(i?[i]:[]),t[2]=i,t[3]=D);let[O,k]=Z.useState(D),[te,ne]=Z.useState(null),[re,ie]=Z.useState(`model`),[A,ae]=Z.useState(null),j=Z.useRef(!1),oe=y??re,M,se;t[4]!==n||t[5]!==i?(M=()=>{n&&!j.current&&k(new Set(i?[i]:[])),n||(E(``),ne(null),ie(`model`),ae(null)),j.current=n},se=[n,i],t[4]=n,t[5]=i,t[6]=M,t[7]=se):(M=t[6],se=t[7]),Z.useEffect(M,se);let N;t[8]===b?N=t[9]:(N=e=>{ie(e),b?.(e)},t[8]=b,t[9]=N);let P=N,F=oe===`variant`&&!!(A??(i&&a)),ue=`mobile-model-picker-sheet-${w}`,I;t[10]===r?I=t[11]:(I=e=>{e||r()},t[10]=r,t[11]=I);let L;t[12]!==F||t[13]!==P||t[14]!==C?(L=F?(0,X.jsx)(ce,{type:`button`,variant:`ghost`,size:`icon`,onClick:()=>P(`model`),"aria-label":C(`onboarding.common.actions.back`),children:(0,X.jsx)(V,{name:`arrow-left`,className:`size-5`})}):void 0,t[12]=F,t[13]=P,t[14]=C,t[15]=L):L=t[15];let R;t[16]!==F||t[17]!==C?(R=C(F?`chat.modelControls.thinking`:`chat.modelControls.selectModel`),t[16]=F,t[17]=C,t[18]=R):R=t[18];let z;t[19]===C?z=t[20]:(z=C(`mobile.surface.closeAria`),t[19]=C,t[20]=z);let B;t[21]===C?B=t[22]:(B=C(`mobile.sessions.sheet.resizeAria`),t[21]=C,t[22]=B);let H;t[23]!==oe||t[24]!==p||t[25]!==f||t[26]!==te||t[27]!==O||t[28]!==l||t[29]!==v||t[30]!==S||t[31]!==g||t[32]!==s||t[33]!==_||t[34]!==m||t[35]!==c||t[36]!==T||t[37]!==u||t[38]!==o||t[39]!==a||t[40]!==i||t[41]!==P||t[42]!==ee||t[43]!==A?(H=(0,X.jsx)(Vn,{query:T,onQueryChange:E,expandedProviders:O,onExpandedProvidersChange:k,expandedModelKey:te,onExpandedModelKeyChange:ne,activeView:oe,setView:P,variantTarget:A,onVariantTargetChange:ae,selectedProviderID:i,selectedModelID:a,resolveSelectedVariant:o,onSelect:s,providers:c,favoriteModels:l,recentModels:u,hiddenModels:S,allowedProviderIds:f,allowedModelIdsByProvider:p,providerOrder:m,variantSelectionEnabled:ee,isFavorite:g,onToggleFavorite:_,getMetadata:v}),t[23]=oe,t[24]=p,t[25]=f,t[26]=te,t[27]=O,t[28]=l,t[29]=v,t[30]=S,t[31]=g,t[32]=s,t[33]=_,t[34]=m,t[35]=c,t[36]=T,t[37]=u,t[38]=o,t[39]=a,t[40]=i,t[41]=P,t[42]=ee,t[43]=A,t[44]=H):H=t[44];let de;return t[45]!==n||t[46]!==L||t[47]!==R||t[48]!==z||t[49]!==B||t[50]!==H||t[51]!==ue||t[52]!==I?(de=(0,X.jsx)(ye,{id:ue,open:n,onOpenChange:I,leading:L,ariaLabel:R,closeAriaLabel:z,resizeAriaLabel:B,bodyClassName:`px-2`,children:H}),t[45]=n,t[46]=L,t[47]=R,t[48]=z,t[49]=B,t[50]=H,t[51]=ue,t[52]=I,t[53]=de):de=t[53],de},Vn=e=>{let t=(0,U.c)(117),{query:n,onQueryChange:r,expandedProviders:i,onExpandedProvidersChange:a,expandedModelKey:o,onExpandedModelKeyChange:s,activeView:c,setView:l,variantTarget:u,onVariantTargetChange:d,selectedProviderID:f,selectedModelID:p,resolveSelectedVariant:m,onSelect:h,providers:g,favoriteModels:_,recentModels:v,hiddenModels:y,allowedProviderIds:b,allowedModelIdsByProvider:x,providerOrder:S,variantSelectionEnabled:ee,isFavorite:C,onToggleFavorite:w,getMetadata:T}=e,{t:E}=le(),D;t[0]===b?D=t[1]:(D=b&&b.length>0?new Set(b):null,t[0]=b,t[1]=D);let O=D,k;t[2]===x?k=t[3]:(k=x?new Map(Object.entries(x).map(Hn)):null,t[2]=x,t[3]=k);let te=k,ne;t[4]===y?ne=t[5]:(ne=new Set(y.map(Un)),t[4]=y,t[5]=ne);let re=ne,ie;t[6]===g?ie=t[7]:(ie=new Map(g.map(Wn)),t[6]=g,t[7]=ie);let A=ie,ae;bb0:{if(!S?.length){ae=g;break bb0}let e;t[8]===S?e=t[9]:(e=new Map(S.map(Gn)),t[8]=S,t[9]=e);let n=e,r;if(t[10]!==g||t[11]!==n){let e;t[13]===n?e=t[14]:(e=(e,t)=>{let r=n.get(e.id),i=n.get(t.id);return r===void 0&&i===void 0?0:r===void 0?1:i===void 0?-1:r-i},t[13]=n,t[14]=e),r=[...g].sort(e),t[10]=g,t[11]=n,t[12]=r}else r=t[12];ae=r}let j=ae,oe;t[15]!==te||t[16]!==O||t[17]!==re?(oe=(e,t)=>O&&!O.has(e)||te&&te.get(e)?.has(t)!==!0?!1:!re.has(`${e}:${t}`),t[15]=te,t[16]=O,t[17]=re,t[18]=oe):oe=t[18];let M=oe,se;t[19]!==A||t[20]!==n?(se=e=>{let t=n.trim();if(!t)return!0;let r=A.get(e.providerID)?.name||e.providerID,i=ue(e.model,e.modelID,{maxLength:40});return De(`${r} ${i}`,t)||De(`${e.providerID} ${e.modelID}`,t)},t[19]=A,t[20]=n,t[21]=se):se=t[21];let N=se,ce;if(t[22]!==_||t[23]!==M||t[24]!==N){let e;t[26]!==M||t[27]!==N?(e=e=>M(e.providerID,e.modelID)&&N(e),t[26]=M,t[27]=N,t[28]=e):e=t[28],ce=_.filter(e),t[22]=_,t[23]=M,t[24]=N,t[25]=ce}else ce=t[25];let F=ce,I;if(t[29]!==M||t[30]!==N||t[31]!==v){let e;t[33]!==M||t[34]!==N?(e=e=>M(e.providerID,e.modelID)&&N(e),t[33]=M,t[34]=N,t[35]=e):e=t[35],I=v.filter(e),t[29]=M,t[30]=N,t[31]=v,t[32]=I}else I=t[32];let L=I,R;if(t[36]!==O||t[37]!==M||t[38]!==j||t[39]!==n){let e=n.trim(),r;t[41]===O?r=t[42]:(r=e=>!O||O.has(e.id),t[41]=O,t[42]=r),R=j.filter(r).map(t=>{let n=e.length>0&&(De(t.name||t.id,e)||De(t.id,e));return{provider:t,models:(t.models??[]).filter(r=>{let i=typeof r.id==`string`?r.id:``;if(!i||!M(t.id,i))return!1;if(n||!e)return!0;let a=t.name||t.id;return De(`${a} ${ue(r,i,{maxLength:40})}`,e)||De(`${t.id} ${i}`,e)})}}).filter(Kn),t[36]=O,t[37]=M,t[38]=j,t[39]=n,t[40]=R}else R=t[40];let z=R,B;t[43]===E?B=t[44]:(B=e=>{if(!e?.trim())return E(`chat.modelControls.default`);let t=e.trim();return/^\d+(\.\d+)?$/.test(t)?t:t.charAt(0).toUpperCase()+t.slice(1)},t[43]=E,t[44]=B);let H=B,de;t[45]===E?de=t[46]:(de=e=>{let t=[];e?.tool_call&&t.push({key:`tool_call`,icon:`tools`,label:E(`chat.modelControls.capability.toolCalling`)}),e?.reasoning&&t.push({key:`reasoning`,icon:`brain-ai-3`,label:E(`chat.modelControls.capability.reasoning`)});let n={text:{icon:`text`,label:E(`chat.modelControls.modality.text`)},image:{icon:`file-image`,label:E(`chat.modelControls.modality.image`)},video:{icon:`file-video`,label:E(`chat.modelControls.modality.video`)},audio:{icon:`file-music`,label:E(`chat.modelControls.modality.audio`)},pdf:{icon:`file-pdf`,label:E(`chat.modelControls.modality.pdf`)}};for(let r of[...e?.modalities?.input??[],...e?.modalities?.output??[]]){let e=r.trim().toLowerCase(),i=n[e];i&&!t.some(t=>t.key===e)&&t.push({key:e,...i})}return t},t[45]=E,t[46]=de);let fe=de,pe;t[47]!==d||t[48]!==l?(pe=(e,t,n)=>{d(n===void 0?{providerID:e,modelID:t}:{providerID:e,modelID:t,variant:n}),l(`variant`)},t[47]=d,t[48]=l,t[49]=pe):pe=t[49];let he=pe,ge;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ge={onPointerDown:_e,onClickCapture:qn},t[50]=ge):ge=t[50];let ve=ge,ye;t[51]!==o||t[52]!==H||t[53]!==T||t[54]!==fe||t[55]!==C||t[56]!==s||t[57]!==h||t[58]!==w||t[59]!==he||t[60]!==A||t[61]!==g||t[62]!==m||t[63]!==p||t[64]!==f||t[65]!==E||t[66]!==ee?(ye=(e,t)=>{let n=t===void 0?{}:t,{model:r,providerID:i,modelID:a}=e,c=`${i}:${a}`,l=i===f&&a===p,u=Ee(i,r,T?.(i,a)),d=ee?zn(g,i,a):[],_=m(i,a),v=n.preferRememberedVariant&&e.variant!==void 0&&d.includes(e.variant)?e.variant:void 0,y=v===void 0?_:v,b=l||v===void 0?_:v,x=[void 0,...d].slice(0,Ln),S=o===c,D=fe(u),O=u?.limit?.context?`${Rn(u.limit.context)} ctx`:null;return(0,X.jsxs)(`div`,{className:P(`border-b border-border/30 last:border-b-0`,l&&`bg-interactive-selection/15 text-interactive-selection-foreground`),children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5`,children:[(0,X.jsx)(`button`,{type:`button`,...ve,onClick:()=>h(i,a,y),className:`flex min-w-0 flex-1 items-start gap-2 rounded-lg text-left focus:outline-none focus-visible:ring-1 focus-visible:ring-primary`,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[n.showProvider?(0,X.jsx)(`span`,{className:`truncate text-[10px] leading-none text-muted-foreground/60`,children:A.get(i)?.name||i}):null,(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,X.jsx)(be,{modelId:a,providerId:i,className:`size-3.5 flex-shrink-0`}),(0,X.jsx)(`span`,{className:`truncate typography-meta font-medium text-foreground`,children:ue(r,a,{maxLength:40})}),l?(0,X.jsx)(V,{name:`check`,className:`size-4 flex-shrink-0 text-primary`}):null]}),O||D.length>0?(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-hidden typography-micro text-muted-foreground`,children:[O?(0,X.jsx)(`span`,{className:`flex-shrink-0 whitespace-nowrap`,children:O}):null,O&&D.length>0?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px flex-shrink-0 bg-border/50`}):null,(0,X.jsx)(`div`,{className:`flex min-w-0 items-center gap-1 overflow-hidden whitespace-nowrap pl-0.5`,children:D.map(e=>{let{key:t,icon:n,label:r}=e;return(0,X.jsx)(`span`,{className:`flex size-4 flex-shrink-0 items-center justify-center text-muted-foreground`,title:r,"aria-label":r,children:(0,X.jsx)(V,{name:n,className:`size-3`})},`${c}-${t}`)})})]}):null]})}),d.length>0?(0,X.jsxs)(`button`,{type:`button`,...ve,onClick:()=>s(e=>e===c?null:c),className:`flex flex-shrink-0 items-center gap-0.5 typography-micro font-medium text-muted-foreground hover:text-foreground`,"aria-expanded":S,"aria-label":E(S?`chat.modelControls.hideThinkingModes`:`chat.modelControls.showThinkingModes`),children:[(0,X.jsx)(`span`,{className:`whitespace-nowrap`,children:H(b)}),(0,X.jsx)(V,{name:S?`arrow-down-s`:`arrow-right-s`,className:`size-3.5`})]}):null,(0,X.jsx)(`button`,{type:`button`,...ve,onClick:e=>{e.preventDefault(),e.stopPropagation(),w(i,a)},className:P(`model-favorite-button flex size-5 flex-shrink-0 items-center justify-center hover:text-primary/80`,C(i,a)?`text-primary`:`text-muted-foreground`),"aria-label":C(i,a)?E(`chat.modelControls.unfavoriteAria`):E(`chat.modelControls.favoriteAria`),title:C(i,a)?E(`chat.modelControls.removeFromFavorites`):E(`chat.modelControls.addToFavorites`),children:(0,X.jsx)(V,{name:C(i,a)?`star-fill`:`star`,className:`size-4`})})]}),S&&d.length>0?(0,X.jsx)(`div`,{className:`border-t border-border/30 p-2`,children:(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[x.map(e=>{let t=e===b||!e&&!b;return(0,X.jsx)(`button`,{type:`button`,...ve,onClick:()=>h(i,a,e),className:P(`inline-flex items-center rounded-full border px-2.5 py-1 typography-meta font-medium`,t?`border-primary/30 bg-primary/10 text-foreground`:`border-border/40 text-muted-foreground hover:bg-interactive-hover/50`),"aria-pressed":t,children:H(e)},`${c}-${e??`default`}`)}),x.length<d.length+1?(0,X.jsx)(`button`,{type:`button`,...ve,onClick:()=>he(i,a,b),className:`inline-flex items-center rounded-full border border-border/40 px-2.5 py-1 typography-meta font-medium text-muted-foreground hover:bg-interactive-hover/50`,"aria-label":E(`chat.modelControls.moreThinkingModes`),children:E(`inlineComment.actions.showMore`)}):null]})}):null]},`mobile-model-${c}`)},t[51]=o,t[52]=H,t[53]=T,t[54]=fe,t[55]=C,t[56]=s,t[57]=h,t[58]=w,t[59]=he,t[60]=A,t[61]=g,t[62]=m,t[63]=p,t[64]=f,t[65]=E,t[66]=ee,t[67]=ye):ye=t[67];let Ce=ye,we,Te,Oe,ke,Ae,W,je,Me,Ne,Pe;if(t[68]!==c||t[69]!==i||t[70]!==F||t[71]!==z||t[72]!==L||t[73]!==H||t[74]!==s||t[75]!==a||t[76]!==r||t[77]!==h||t[78]!==g||t[79]!==n||t[80]!==Ce||t[81]!==m||t[82]!==p||t[83]!==f||t[84]!==E||t[85]!==u){let e=u??(c===`variant`&&f&&p?{providerID:f,modelID:p}:null),o=e?zn(g,e.providerID,e.modelID):[],l;bb1:{if(!e){l=void 0;break bb1}if(e.providerID===f&&e.modelID===p){l=m(e.providerID,e.modelID);break bb1}l=(e.variant!==void 0&&o.includes(e.variant)?e.variant:void 0)??m(e.providerID,e.modelID)}let d=l,_=F.length>0||L.length>0||z.length>0,v=c===`variant`&&!!e;Ne=`flex min-h-0 flex-1 flex-col gap-2`,t[96]!==v||t[97]!==s||t[98]!==r||t[99]!==n||t[100]!==E?(Pe=v?null:(0,X.jsxs)(`div`,{className:`relative z-10 shrink-0`,"data-mobile-sheet-no-dismiss":``,"data-mobile-sheet-search":``,children:[(0,X.jsx)(V,{name:`search`,className:`pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,X.jsx)(me,{type:`text`,value:n,onChange:e=>{r(e.target.value),s(null)},placeholder:E(`chat.modelControls.searchProvidersOrModels`),className:`h-9 rounded-xl border-border/40 bg-[var(--surface-elevated)] pl-7 typography-meta`,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,enterKeyHint:`search`,inputMode:`search`}),n?(0,X.jsx)(`button`,{type:`button`,onClick:()=>{r(``),s(null)},className:`absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,"aria-label":E(`chat.modelControls.clearSearch`),children:(0,X.jsx)(V,{name:`close-circle`,className:`size-4`})}):null]}),t[96]=v,t[97]=s,t[98]=r,t[99]=n,t[100]=E,t[101]=Pe):Pe=t[101],we=Se,ke=!0,Ae=!0,W=!0,je=`min-h-0 flex-1`,Me=`overscroll-contain`,Te=`flex flex-col gap-2`,Oe=v&&e?(0,X.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:[void 0,...o].map(t=>{let n=t===d||!t&&!d;return(0,X.jsxs)(`button`,{type:`button`,className:P(`flex w-full items-center justify-between gap-2 rounded-xl border px-2 py-1.5 text-left focus:outline-none focus-visible:ring-1 focus-visible:ring-primary`,n?`border-primary/30 bg-primary/10`:`border-border/40`),...ve,onClick:()=>h(e.providerID,e.modelID,t),children:[(0,X.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:H(t)}),n?(0,X.jsx)(V,{name:`check`,className:`size-4 flex-shrink-0 text-primary`}):null]},t??`default`)})}):(0,X.jsxs)(X.Fragment,{children:[_?null:(0,X.jsx)(`div`,{className:`px-3 py-8 text-center typography-meta text-muted-foreground`,children:E(`chat.modelControls.noProvidersOrModelsFound`)}),F.length>0?(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/40 bg-[var(--surface-elevated)]`,children:[(0,X.jsxs)(`div`,{className:`px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[(0,X.jsx)(V,{name:`star-fill`,className:`mr-1.5 inline-block size-3 text-primary`}),E(`chat.modelControls.favorites`)]}),(0,X.jsx)(`div`,{className:`flex flex-col border-t border-border/30`,children:F.map(e=>Ce(e,{showProvider:!0,preferRememberedVariant:!0}))})]}):null,L.length>0?(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/40 bg-[var(--surface-elevated)]`,children:[(0,X.jsxs)(`div`,{className:`px-2 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:[(0,X.jsx)(V,{name:`time`,className:`mr-1.5 inline-block size-3`}),E(`chat.modelControls.recent`)]}),(0,X.jsx)(`div`,{className:`flex flex-col border-t border-border/30`,children:L.map(e=>Ce(e,{showProvider:!0,preferRememberedVariant:!0}))})]}):null,z.map(e=>{let{provider:t,models:r}=e,o=i.has(t.id)||n.trim().length>0;return(0,X.jsxs)(`div`,{className:`overflow-hidden rounded-xl border border-border/40 bg-[var(--surface-elevated)]`,children:[(0,X.jsxs)(`button`,{type:`button`,...ve,onClick:()=>{n.trim()||a(e=>{let n=new Set(e);return n.has(t.id)?n.delete(t.id):n.add(t.id),n})},className:`flex w-full items-center justify-between gap-1.5 px-2 py-1.5 text-left`,"aria-expanded":o,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(xe,{providerId:t.id,className:`size-3.5`}),(0,X.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:t.name||t.id}),t.id===f?(0,X.jsx)(`span`,{className:`typography-micro text-primary/80`,children:E(`chat.modelControls.current`)}):null]}),(0,X.jsx)(V,{name:o?`arrow-down-s`:`arrow-right-s`,className:`size-3 text-muted-foreground`})]}),o?(0,X.jsx)(`div`,{className:`flex flex-col border-t border-border/30`,children:r.map(e=>Ce({model:e,providerID:t.id,modelID:e.id}))}):null]},t.id)})]}),t[68]=c,t[69]=i,t[70]=F,t[71]=z,t[72]=L,t[73]=H,t[74]=s,t[75]=a,t[76]=r,t[77]=h,t[78]=g,t[79]=n,t[80]=Ce,t[81]=m,t[82]=p,t[83]=f,t[84]=E,t[85]=u,t[86]=we,t[87]=Te,t[88]=Oe,t[89]=ke,t[90]=Ae,t[91]=W,t[92]=je,t[93]=Me,t[94]=Ne,t[95]=Pe}else we=t[86],Te=t[87],Oe=t[88],ke=t[89],Ae=t[90],W=t[91],je=t[92],Me=t[93],Ne=t[94],Pe=t[95];let Fe;t[102]!==Te||t[103]!==Oe?(Fe=(0,X.jsx)(`div`,{className:Te,children:Oe}),t[102]=Te,t[103]=Oe,t[104]=Fe):Fe=t[104];let Ie;t[105]!==we||t[106]!==ke||t[107]!==Ae||t[108]!==W||t[109]!==je||t[110]!==Me||t[111]!==Fe?(Ie=(0,X.jsx)(we,{useScrollShadow:ke,disableHorizontal:Ae,preventOverscroll:W,outerClassName:je,className:Me,children:Fe}),t[105]=we,t[106]=ke,t[107]=Ae,t[108]=W,t[109]=je,t[110]=Me,t[111]=Fe,t[112]=Ie):Ie=t[112];let Le;return t[113]!==Ne||t[114]!==Pe||t[115]!==Ie?(Le=(0,X.jsxs)(`div`,{className:Ne,children:[Pe,Ie]}),t[113]=Ne,t[114]=Pe,t[115]=Ie,t[116]=Le):Le=t[116],Le};function Hn(e){let[t,n]=e;return[t,new Set(n)]}function Un(e){return`${e.providerID}:${e.modelID}`}function Wn(e){return[e.id,e]}function Gn(e,t){return[e,t]}function Kn(e){return e.models.length>0}function qn(e){ve(e)||(e.preventDefault(),e.stopPropagation())}function Jn(){let e=(0,U.c)(5),t=F(Qn),n=F(Zn),r=F(Xn),i=F(Yn),a=t||i,o=!a&&r===`init_error`,s=!a&&!o,c;return e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==s?(c={isReady:a,isLoading:s,isUnavailable:o,connectionPhase:n},e[0]=n,e[1]=a,e[2]=o,e[3]=s,e[4]=c):c=e[4],c}function Yn(e){return e.providers.length>0}function Xn(e){return e.lastDisconnectReason}function Zn(e){return e.connectionPhase}function Qn(e){return e.isInitialized}var $n=e=>e??l()?.github,er=(e=t())=>ae.github.auth(e),tr=async(e,t)=>{if(e)return e.authStatus();let n=await r(`/api/github/auth/status`,{method:`GET`,headers:{Accept:`application/json`},signal:t}),i=await n.json().catch(()=>null);if(!n.ok||!i)throw Error(i?.error||n.statusText||`Failed to load GitHub status`);return i},nr=(e,n=t())=>{let r=$n(e);return{queryKey:er(n),queryFn:async({signal:e})=>tr(r,e),retry:2}},rr=e=>!!e&&typeof e==`object`&&`authStatus`in e,ir=e=>{let t=(0,U.c)(5),n=rr(e)?e:void 0,r=rr(e)?void 0:e?.enabled,i;t[0]===n?i=t[1]:(i=nr(n),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a={...i,enabled:r},t[2]=r,t[3]=i,t[4]=a):a=t[4],A(a)},ar=(e=j,n=t())=>e.getQueryData(er(n))??null,or=async(e,n,r)=>t()===r?e.fetchQuery({...nr(n,r),staleTime:0}):e.getQueryData(er(r))??null,sr=(e=j,n,r=t())=>{e.setQueryData(er(r),n)},cr=e=>{if(e===`12h`)return!0;if(e===`24h`)return!1},lr=(e,t,n={})=>{let r=e instanceof Date?e:new Date(e);return Number.isFinite(r.getTime())?r.toLocaleTimeString(N(),{hour:n.hour??`numeric`,minute:`2-digit`,second:n.precision===`second`?`2-digit`:void 0,hour12:cr(t)}):n.fallback??``},ur=(e,t,n)=>{let r=e instanceof Date?e:new Date(e);return Number.isFinite(r.getTime())?r.toLocaleString(N(),{...n,hour12:n.hour?cr(t):n.hour12}):``},dr=e=>e===`allow`||e===`deny`||e===`ask`;function fr(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function pr(e){return fr(e)?typeof e.action==`string`&&typeof e.resource==`string`&&dr(e.effect)?{action:e.action,resource:e.resource,effect:e.effect}:typeof e.permission==`string`&&typeof e.pattern==`string`&&dr(e.action)?{action:e.permission,resource:e.pattern,effect:e.action}:null:null}function mr(e){if(Array.isArray(e))return e.flatMap(e=>{let t=pr(e);return t?[t]:[]});if(dr(e))return[{action:`*`,resource:`*`,effect:e}];if(!fr(e))return[];let t=[];for(let[n,r]of Object.entries(e))if(n!==`__originalKeys`){if(dr(r)){t.push({action:n,resource:`*`,effect:r});continue}if(fr(r))for(let[e,i]of Object.entries(r))dr(i)&&t.push({action:n,resource:e,effect:i})}return t}function hr(e){return mr(e)}var Q=e=>B(z.getState().dictionary,e),gr=e=>typeof e!=`number`||!Number.isFinite(e)?null:Math.max(0,Math.min(100,Math.round(e))),_r=e=>typeof e!=`number`||!Number.isFinite(e)?`-`:`${Math.round(e)}%`,vr=(e,t)=>e??_r(t),yr=(e,t,n=`auto`)=>{if(!e)return t??``;try{let r=new Date(e);if(!Number.isFinite(r.getTime()))return t??``;let i=new Date;return r.toDateString()===i.toDateString()?lr(r,n,{fallback:t??``}):ur(r,n,{month:`short`,day:`numeric`,weekday:`short`,hour:`numeric`,minute:`2-digit`})}catch{return t??``}},br=e=>e===null?`safe`:e>=80?`critical`:e>=50?`warn`:`safe`,xr=e=>e===`5h`?Q(`quota.window.5h`):e===`7d`?Q(`quota.window.7d`):e===`7d-sonnet`?Q(`quota.window.7dSonnet`):e===`7d-opus`?Q(`quota.window.7dOpus`):e===`weekly`?Q(`quota.window.weekly`):e===`daily`?Q(`quota.window.daily`):e===`monthly`?Q(`quota.window.monthly`):e===`credits`?Q(`quota.window.credits`):e===`credits_balance`?Q(`quota.window.creditsBalance`):e===`billing_cycle`?Q(`quota.window.billingCycle`):e===`auto`?Q(`quota.window.auto`):e===`api`?Q(`quota.window.api`):e===`plan_limit`?Q(`quota.window.planLimit`):e===`on_demand`?Q(`quota.window.onDemand`):e===`session`?Q(`quota.window.session`):e===`premium`?Q(`quota.window.premium`):e===`chat`?Q(`quota.window.chat`):e===`completions`?Q(`quota.window.completions`):e===`premium_interactions`?Q(`quota.window.premiumInteractions`):e,Sr=e=>{let t=e.toLowerCase().trim();if(t===`5h`)return 18e3;if(t===`7d`||t===`weekly`||t===`7d-sonnet`||t===`7d-opus`)return 604800;if(t===`monthly`)return 2592e3;if(t===`24h`||t===`daily`)return 86400;if(t===`1h`)return 3600;let n=t.match(/^(\d+)h$/);if(n)return parseInt(n[1],10)*3600;let r=t.match(/^(\d+)d$/);return r?parseInt(r[1],10)*86400:null},Cr=(e,t,n,r)=>{let i=n;if(i===null&&r&&(i=Sr(r)),e===null||t===null||i===null||i<=0)return null;let a=Math.max(0,(t-Date.now())/1e3),o=Math.max(0,Math.min(i,i-a)),s=Math.max(0,Math.min(1,o/i)),c=e/100,l=e>=100&&a>0,u;u=s>.01?Math.min(999,c/s*100):e;let d;d=l?`exhausted`:c<=s?`on-track`:u<=130?`slightly-fast`:`too-fast`;let f=i>=432e3,p=f?86400:3600,m=f?`d`:`h`,h=i/p,g=e/Math.max(o/p,h*.01),_=Number.isFinite(g)?`${Math.min(999.9,Math.max(0,g)).toFixed(1)}%/${m}`:`-`,v=u>100?`+${Math.round(u)}%`:`${Math.round(u)}%`,y=null,b=i/86400;return b>=7&&(y=100/b),{elapsedRatio:s,usageRatio:c,predictedFinalPercent:u,remainingSeconds:a,isExhausted:l,elapsedSeconds:o,totalSeconds:i,status:d,paceRateText:_,predictText:v,dailyAllocationPercent:y}},wr=e=>{switch(e){case`exhausted`:case`too-fast`:return`var(--status-error)`;case`slightly-fast`:return`var(--status-warning)`;case`on-track`:return`var(--status-success)`}},Tr=e=>{let t=Math.floor(Math.max(0,Math.floor(e))/60),n=Math.floor(t/60),r=Math.floor(n/24),i=n%24,a=t%60;return r>0?`${r}d ${i}h`:n>0?`${n}h`:t===0?`<1m`:`${a}m`},Er=e=>Math.min(100,Math.max(0,e*100)),$=(e,t)=>B(z.getState().dictionary,e,t),Dr=e=>{let t=new Date(e),n=new Date,r=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),i=new Date(n);return i.setDate(n.getDate()-1),r(t,n)?$(`common.date.today`):r(t,i)?$(`common.date.yesterday`):t.toLocaleDateString(N(),{month:`short`,day:`numeric`,year:`numeric`}).replace(`,`,``)},Or=e=>{let t=new Date;if(((e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())(new Date(e),t)){let t=Date.now()-e;return t<6e4?$(`common.relative.justNow`):t<36e5?$(`common.relative.minutesAgoShort`,{count:Math.floor(t/6e4)}):$(`common.relative.hoursAgoShort`,{count:Math.floor(t/36e5)})}return Dr(e)},kr=e=>{let t=Math.max(0,Date.now()-e),n=6e4,r=60*n,i=24*r,a=7*i,o=365*i;return t<r?$(`common.relative.minutesAgoCompact`,{count:Math.max(1,Math.floor(t/n))}):t<i?$(`common.relative.hoursAgoCompact`,{count:Math.floor(t/r)}):t<a?$(`common.relative.daysAgoCompact`,{count:Math.floor(t/i)}):t<5*a?$(`common.relative.weeksAgoCompact`,{count:Math.floor(t/a)}):t<o?$(`common.relative.monthsAgoCompact`,{count:Math.floor(t/2592e6)}):$(`common.relative.yearsAgoCompact`,{count:Math.floor(t/o)})},Ar=(e,t)=>jr(M(e),M(t)),jr=(e,t)=>!e||!t?!1:e===t?!0:t===`/`?e.startsWith(`/`):e.startsWith(`${t}/`),Mr=e=>e.toLowerCase().replace(/^opencode[/-]?/i,``).replace(/[-_]/g,``).trim(),Nr=(e,t)=>e?Mr(e)!==Mr(t):!1,Pr=e=>{if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim().length>0){let t=Number(e);if(Number.isFinite(t))return t}},Fr=e=>Pr(e.time?.created)??0,Ir=(e,t,n)=>{let r=n.has(e.id),i=n.has(t.id);return r===i?r&&i?Fr(t)-Fr(e):se(t)-se(e):r?-1:1},Lr=e=>{let t=new Map;return e.forEach(e=>{t.set(e.id,e)}),Array.from(t.values())},Rr=e=>`__archived__:${e}`,zr=(e,t)=>{let n=M(e.directory??null),r=M(e.project?.worktree??null),i=n??r;if(!i)return`unassigned`;if(t&&i===t)return`project root`;let a=(t&&i.startsWith(`${t}/`)?i.slice(t.length+1):i).split(`/`).filter(Boolean);return a[a.length-1]??`unassigned`},Br=`box-border w-full px-2 py-1.5 text-left typography-micro text-muted-foreground/70 select-none`,Vr=`bg-[color-mix(in_srgb,var(--surface-foreground)_6%,transparent)] dark:bg-[color-mix(in_srgb,var(--surface-foreground)_11%,transparent)]`,Hr=`hover:bg-[color-mix(in_srgb,var(--surface-foreground)_3.5%,transparent)] dark:hover:bg-[color-mix(in_srgb,var(--surface-foreground)_8%,transparent)]`,Ur=e=>{let t=Math.max(0,e);return t===0?8:30+(t-1)*14},Wr=(e,t)=>{if(!t)return e;let n=e.toLowerCase(),r=t.toLowerCase(),i=r.length;if(i===0)return e;let a=[],o=0,s=n.indexOf(r,o);for(;s!==-1;){s>o&&a.push(e.slice(o,s));let t=e.slice(s,s+i);a.push((0,X.jsx)(`mark`,{className:`bg-transparent font-[inherit] text-[var(--primary-base)]`,children:t},`${s}-${t}`)),o=s+i,s=n.indexOf(r,o)}return o<e.length&&a.push(e.slice(o)),a.length>0?a:e},Gr=`/api/browser-providers`,Kr=`/api/browser-providers/selection`,qr=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,Jr=200,Yr=e=>`/api/browser-providers/${encodeURIComponent(e)}/surface/ws`,Xr=e=>!!e&&typeof e==`object`&&!Array.isArray(e),Zr=e=>typeof e==`string`&&qr.test(e)?e:null,Qr=e=>{if(!Xr(e))return null;let t=Zr(e.id),n=typeof e.name==`string`?e.name.trim():``;return!t||!n||n.length>Jr?null:{id:t,name:n,surface:e.surface===!0}},$r=e=>{if(!Xr(e)||!Array.isArray(e.providers))return null;let t=[],n=new Set;for(let r of e.providers){let e=Qr(r);!e||n.has(e.id)||(n.add(e.id),t.push(e))}let r=Zr(e.selectedId);return{providers:t,selectedId:r&&n.has(r)?r:null}},ei=e=>{if(!Xr(e))return null;let t=Zr(e.selectedId);return t?{selectedId:t}:null},ti=e=>e?.selectedId?e.providers.find(t=>t.id===e.selectedId)??null:null,ni=e=>!!(e&&e.providers.length>0),ri=e=>ti(e)!==null,ii=e=>typeof e==`number`&&Number.isFinite(e),ai=e=>{if(!Xr(e)||typeof e.type!=`string`)return null;if(e.type===`hello`&&typeof e.viewerId==`string`&&e.viewerId.length>0)return{type:`hello`,viewerId:e.viewerId};if(e.type===`frame`){let t=e.mime===`image/jpeg`||e.mime===`image/png`?e.mime:null;if(!t||!ii(e.seq)||!ii(e.width)||!ii(e.height)||!ii(e.bytes)||e.bytes<1||typeof e.agentActive!=`boolean`)return null;let n=typeof e.title==`string`?e.title:void 0;return{type:`frame`,seq:e.seq,width:e.width,height:e.height,mime:t,bytes:e.bytes,title:n,agentActive:e.agentActive}}if(e.type===`control`){let t=e.controller===`none`||e.controller===`agent`||e.controller===`user`?e.controller:null;return!t||typeof e.mine!=`boolean`?null:{type:`control`,controller:t,mine:e.mine}}return e.type===`resized`&&ii(e.width)&&ii(e.height)?{type:`resized`,width:e.width,height:e.height}:e.type===`error`&&typeof e.code==`string`&&typeof e.message==`string`?{type:`error`,code:e.code,message:e.message}:e.type===`ended`&&(e.reason===`service-stopped`||e.reason===`extension-unavailable`||e.reason===`host-shutdown`)?{type:`ended`,reason:e.reason}:null},oi=class extends Error{status;constructor(e){super(`browser_provider_request_failed:${e}`),this.name=`BrowserProviderRequestError`,this.status=e}},si=(e=t())=>ae.browserProviders.catalog(e),ci=async e=>{let t=await e.text();if(!t)return null;try{return JSON.parse(t)}catch{return null}},li=async e=>{let t=await r(Gr,{method:`GET`,headers:{Accept:`application/json`},signal:e}),n=await ci(t);if(!t.ok)throw new oi(t.status);let i=$r(n);if(!i)throw new oi(t.status||502);return i},ui=(e=t())=>({queryKey:si(e),queryFn:({signal:e})=>li(e),staleTime:5e3,refetchOnWindowFocus:!0,refetchInterval:e=>{let t=e.state.error;return t instanceof oi&&(t.status===404||t.status===501)?!1:15e3}}),di=()=>{let e=(0,U.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=ui(),e[0]=t):t=e[0],A(t)},fi=(e=j,n=t())=>e.getQueryData(si(n))??null,pi=(e,t)=>e?.providers.some(e=>e.id===t)?{providers:e.providers,selectedId:t}:null,mi=async(e,n=j,i)=>{let a=t(),o=await r(Kr,{method:`PUT`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify({id:e}),signal:i}),s=await ci(o);if(!o.ok)throw new oi(o.status);let c=ei(s);if(!c||c.selectedId!==e||t()!==a)throw new oi(o.status||502);let l=pi(n.getQueryData(si(a)),c.selectedId);if(!l)throw new oi(409);return l},hi=()=>{let e=(0,U.c)(2),n=ne(),r;return e[0]===n?r=e[1]:(r={mutationFn:e=>mi(e,n),onMutate:async e=>{let r=t(),i=si(r);await n.cancelQueries({queryKey:i});let a=n.getQueryData(i),o=pi(a,e);return o&&n.setQueryData(i,o),{previous:a,key:i,transport:r}},onError:(e,r,i)=>{!i||t()!==i.transport||n.setQueryData(i.key,i.previous)},onSuccess:(e,r,i)=>{!i||t()!==i.transport||n.setQueryData(i.key,e)}},e[0]=n,e[1]=r),re(r)},gi=[`standalone`,`minimal-ui`,`fullscreen`,`window-controls-overlay`],_i=`yuri.pwaRecentSessions`,vi=e=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(display-mode: ${e})`).matches,yi=()=>typeof window>`u`?`browser`:typeof document<`u`&&document.referrer.startsWith(`android-app://`)?`twa`:window.navigator.standalone?`standalone`:gi.find(e=>vi(e))??`browser`;export{pn as $,xr as A,tt as At,ir as B,ft as Bt,zr as C,Vt as Ct,yr as D,_t as Dt,gr as E,xt as Et,ur as F,qe as Ft,xn as G,Fe as Gt,Bn as H,dt as Ht,lr as I,Je as It,Cn as J,Sn as K,Ie as Kt,ar as L,$e as Lt,br as M,Xe as Mt,hr as N,Ze as Nt,vr as O,yt as Ot,mr as P,Ye as Pt,Jt as Q,or as R,et as Rt,Wr as S,It as St,Cr as T,St as Tt,In as U,pt as Ut,Jn as V,ut as Vt,yn as W,Pe as Wt,En as X,wn as Y,bn as Z,Rr as _,At as _t,hi as a,mn as at,Ar as b,Ft as bt,ri as c,tn as ct,Vr as d,Ht as dt,hn as et,Hr as f,Gt as ft,Or as g,Pt as gt,kr as h,Lt as ht,di as i,dn as it,wr as j,Ke as jt,Tr as k,vt as kt,ni as l,rn as lt,Lr as m,Wt as mt,yi as n,ln as nt,Yr as o,cn as ot,Ir as p,Ut as pt,Tn as q,fi as r,un as rt,ai as s,fn as st,_i as t,sn as tt,Br as u,qt as ut,Ur as v,Rt as vt,Er as w,Bt as wt,Mr as x,Nt as xt,Nr as y,zt as yt,sr as z,Qe as zt};