@yuriai/web 0.3.3 → 0.3.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 (93) hide show
  1. package/dist/assets/{AgentSelector-DpOQ7dyw.js → AgentSelector-uBoLtut8.js} +1 -1
  2. package/dist/assets/{ArchivedSessionsDialog-nqnWb-Vc.js → ArchivedSessionsDialog-DZcicxVO.js} +1 -1
  3. package/dist/assets/{AssistantConversationSurface-CKXgty02.js → AssistantConversationSurface-36aP0hRf.js} +3 -3
  4. package/dist/assets/{AssistantSessionCard-C2-2fJul.js → AssistantSessionCard-CZ-1oJiE.js} +2 -2
  5. package/dist/assets/{AssistantView-BR8hsjOv.js → AssistantView-8fyAae7J.js} +1 -1
  6. package/dist/assets/{AssistantsSettingsPage-Bwid1xE0.js → AssistantsSettingsPage-DD6spbXz.js} +1 -1
  7. package/dist/assets/{BinaryFileFallback-Cb3uP7y1.js → BinaryFileFallback-DgYaMG9f.js} +1 -1
  8. package/dist/assets/{BtwPanel-9VAdk_qa.js → BtwPanel-BkobGcf3.js} +1 -1
  9. package/dist/assets/{BusyDots-DeDkh4Ke.js → BusyDots-COTTwItx.js} +1 -1
  10. package/dist/assets/{ChatContainer-wP6o_O4K.js → ChatContainer-BfQ7RXwY.js} +8 -8
  11. package/dist/assets/{ChatView-DU_2-cfD.js → ChatView-ByMRjY1h.js} +1 -1
  12. package/dist/assets/{DiagramView-CaefmjA4.js → DiagramView-DGnmjS2b.js} +1 -1
  13. package/dist/assets/{DiffView-BaqthIvq.js → DiffView-Bbit6OZ8.js} +1 -1
  14. package/dist/assets/{ErrorBoundary-_5B1xjgZ.js → ErrorBoundary-D7QcwhmL.js} +1 -1
  15. package/dist/assets/{FadeInOnReveal-BYHr1gqj.js → FadeInOnReveal-B3uT04YJ.js} +1 -1
  16. package/dist/assets/{GuiPluginMount-Btp3mJT2.js → GuiPluginMount-TC5FELtQ.js} +1 -1
  17. package/dist/assets/{GuiPluginPage-DM_RLx6u.js → GuiPluginPage-BPjU8N49.js} +1 -1
  18. package/dist/assets/{GuiPluginSurface-KiyqqEKU.js → GuiPluginSurface-CYPH6XzX.js} +1 -1
  19. package/dist/assets/{MarkdownRenderer-D7p9Iflj.js → MarkdownRenderer-VvziwyJB.js} +2 -2
  20. package/dist/assets/{MarkdownRendererImpl-BZc_jUrV.js → MarkdownRendererImpl-D8q0FMnr.js} +1 -1
  21. package/dist/assets/{MarkstreamRendererImpl-BUk_c3g1.js → MarkstreamRendererImpl-U_m_ZKG7.js} +1 -1
  22. package/dist/assets/{MobileAssistantSettingsPage-BBIiFN2g.js → MobileAssistantSettingsPage-Dgq5FMho.js} +1 -1
  23. package/dist/assets/{MobileBtwPage-DVZm5hrZ.js → MobileBtwPage-DQUkSO6N.js} +1 -1
  24. package/dist/assets/{MobileChangesSurface-CiqsGZsg.js → MobileChangesSurface-DsYNmAuM.js} +1 -1
  25. package/dist/assets/{MobileChatScreen-DDenVTX8.js → MobileChatScreen-p356_BCN.js} +1 -1
  26. package/dist/assets/{MobileFilesSurface-DIVH9aPV.js → MobileFilesSurface-CF3EW_SK.js} +2 -2
  27. package/dist/assets/{MobileHtmlNetworkBoundary-TBxrF4jJ.js → MobileHtmlNetworkBoundary-DlPF4iPS.js} +2 -2
  28. package/dist/assets/{MobileSettingsTab-MmDnxG47.js → MobileSettingsTab-DaTtRHo1.js} +1 -1
  29. package/dist/assets/{MobileShareBridge-DAlGSXoj.js → MobileShareBridge-CZpFYmiy.js} +1 -1
  30. package/dist/assets/{ModelSelector-HJmXcB3j.js → ModelSelector-EmtltPnd.js} +1 -1
  31. package/dist/assets/{MultiRunWindow-BmxVnblA.js → MultiRunWindow-CeSxAB8w.js} +1 -1
  32. package/dist/assets/{OnboardingScreen-DnEtIaxG.js → OnboardingScreen-BubjTNcy.js} +1 -1
  33. package/dist/assets/{PierreDiffViewer-B1e1H6br.js → PierreDiffViewer-DVKsdwJR.js} +1 -1
  34. package/dist/assets/{RemoteAssistantSessionCard-BgL7oxAK.js → RemoteAssistantSessionCard-DAoFvZht.js} +1 -1
  35. package/dist/assets/{RemoteDesktopPanel-DBrEQwpr.js → RemoteDesktopPanel-f3vRj4ZP.js} +1 -1
  36. package/dist/assets/{ScheduledTasksDialog-BVh0yaZR.js → ScheduledTasksDialog-D_hBP47Y.js} +1 -1
  37. package/dist/assets/{SettingsView-CLE6ra3s.js → SettingsView-DEU94-h1.js} +1 -1
  38. package/dist/assets/{SettingsWindow-DpzeOekS.js → SettingsWindow-DMVAV_el.js} +1 -1
  39. package/dist/assets/{SetupTourDialog-CY_CU5qU.js → SetupTourDialog-BlR7FJvd.js} +1 -1
  40. package/dist/assets/{TerminalView-mO5f0Axl.js → TerminalView-Xcwp3SG1.js} +1 -1
  41. package/dist/assets/{TextSelectionMenu-VsKriqtT.js → TextSelectionMenu-h8iUeNzE.js} +1 -1
  42. package/dist/assets/{ToolOutputDialog-DqCCsC-N.js → ToolOutputDialog-DpaaQ1uZ.js} +1 -1
  43. package/dist/assets/{auto-read-context-DVGIDEr6.js → auto-read-context-ClBUErN2.js} +1 -1
  44. package/dist/assets/{capgoAdapter-94K243Zv.js → capgoAdapter-pfQJmvW2.js} +1 -1
  45. package/dist/assets/{chatUpwardIntent-tvLWGs9Q.js → chatUpwardIntent-B2NrGMm-.js} +1 -1
  46. package/dist/assets/{gitApi-BWsBS_2N.js → gitApi-CoVwjIDy.js} +1 -1
  47. package/dist/assets/{insertionBoundaries-BSDUOMHN.js → insertionBoundaries-Btqgsu1M.js} +1 -1
  48. package/dist/assets/{main-DAbyAg5_.js → main-CXH2hObl.js} +4 -4
  49. package/dist/assets/{main-CHO9s_kb.js → main-ClH7cLKr.js} +2 -2
  50. package/dist/assets/{mcpQueries-1WNtiFYh.js → mcpQueries-Rmp1BKeo.js} +1 -1
  51. package/dist/assets/{miniChat-BZMkNMht.js → miniChat-B_Bw6udu.js} +2 -2
  52. package/dist/assets/{mobile-C9XDDOHq.js → mobile-BR73yoNi.js} +2 -2
  53. package/dist/assets/{mobileBackNavigation-DF_uhF-i.js → mobileBackNavigation-C94n2eLT.js} +1 -1
  54. package/dist/assets/{mobileConnections-DjT1L-_m.js → mobileConnections-x07fHO_5.js} +2 -2
  55. package/dist/assets/{multirun-D34EMeEj.js → multirun-CKQymP08.js} +1 -1
  56. package/dist/assets/{native-config-DSpTDz3F.js → native-config-DVg8_Zx1.js} +1 -1
  57. package/dist/assets/{nativeComposerCover-DXFy97OQ.js → nativeComposerCover-Bhv1EKPT.js} +1 -1
  58. package/dist/assets/{navigation-jU0HUH9s.js → navigation-D1klsD7k.js} +1 -1
  59. package/dist/assets/{openRemoteProjectSession-Bm_nafYw.js → openRemoteProjectSession-DNr74gHD.js} +1 -1
  60. package/dist/assets/{pluginPresentation-DexqrdQ0.js → pluginPresentation-DtyC8NF2.js} +1 -1
  61. package/dist/assets/{pwa-BaWpUiOR.js → pwa-CtDladgB.js} +1 -1
  62. package/dist/assets/{queue-abort-optimistic-UwpgXn4g.js → queue-abort-optimistic-DFbWDRKT.js} +1 -1
  63. package/dist/assets/{reference-history-DBxnA_fF.js → reference-history-IEuzG8KC.js} +1 -1
  64. package/dist/assets/{remoteSessionReference-Cug8RfIG.js → remoteSessionReference-ex07CtrZ.js} +1 -1
  65. package/dist/assets/{renderElectronMiniChatApp-CqrlQAsJ.js → renderElectronMiniChatApp-DM9y9qXo.js} +2 -2
  66. package/dist/assets/{renderMobileApp-CwcwGOox.js → renderMobileApp-DqpPYtZI.js} +4 -4
  67. package/dist/assets/{runtimeConfig-zzeYHX6k.js → runtimeConfig-CyvlrO58.js} +1 -1
  68. package/dist/assets/{runtimeEndpointReset-DUD-TCLY.js → runtimeEndpointReset-C0zNrsI9.js} +3 -3
  69. package/dist/assets/{sessionLookup-4zOaVAuF.js → sessionLookup-DQOiycHr.js} +1 -1
  70. package/dist/assets/{sessionOwnership-CEkPFbS4.js → sessionOwnership-BjhXe6pi.js} +1 -1
  71. package/dist/assets/{speechSettingsQueries-DQnPLEf3.js → speechSettingsQueries-BmkXNn4w.js} +1 -1
  72. package/dist/assets/{types-s_oc_LRs.js → types-DpcA-uDW.js} +1 -1
  73. package/dist/assets/{ui-DrAJTWV6.js → ui-ee2iN869.js} +12 -12
  74. package/dist/assets/{useAppFontEffects-nvkTSYHB.js → useAppFontEffects-rbTKcF0f.js} +2 -2
  75. package/dist/assets/{useDesktopWindowControlsLayout-i6qqpMbd.js → useDesktopWindowControlsLayout-BOkRz-p9.js} +1 -1
  76. package/dist/assets/{useEffectiveDirectory-BxolHzt4.js → useEffectiveDirectory-DiJBIfai.js} +1 -1
  77. package/dist/assets/{useGitStore-B641o_o0.js → useGitStore-Bv8xmXDa.js} +1 -1
  78. package/dist/assets/{useMcpConfigStore-BUSvv0Bl.js → useMcpConfigStore-DKTl0PvE.js} +1 -1
  79. package/dist/assets/{useMobileTranscriptSyncHint-86i3xO8J.js → useMobileTranscriptSyncHint-DM8WG7kz.js} +1 -1
  80. package/dist/assets/{useModelLists-Ca085-di.js → useModelLists-Bf60FIJu.js} +1 -1
  81. package/dist/assets/{useOpenCodeReadiness-CsNcdsCJ.js → useOpenCodeReadiness-Dm6BjA1T.js} +1 -1
  82. package/dist/assets/{usePluginsStore-ZHQOW-R5.js → usePluginsStore-Du4WlceO.js} +1 -1
  83. package/dist/assets/{useProjectGitActions-1QRsD7Rb.js → useProjectGitActions-D3B9ma9z.js} +1 -1
  84. package/dist/assets/{useProjectGitStore-C1K6WpCe.js → useProjectGitStore-DzU2pvrH.js} +1 -1
  85. package/dist/assets/{useProjectRuntimeAPIs-BItoD9Bt.js → useProjectRuntimeAPIs-tjGuODhu.js} +1 -1
  86. package/dist/assets/{useSessionBtwStore-BCHq3UOB.js → useSessionBtwStore-CwvlMabN.js} +1 -1
  87. package/dist/assets/{useStreamingTextThrottle-DGAjmaMZ.js → useStreamingTextThrottle-C9SaKeil.js} +1 -1
  88. package/dist/assets/{worktreeManager-QmahFqHc.js → worktreeManager-DGu8M01Z.js} +1 -1
  89. package/dist/assets/{worktreeSourceBranchPreference-B5Fldnhm.js → worktreeSourceBranchPreference-CuLKwxkx.js} +1 -1
  90. package/dist/index.html +5 -5
  91. package/dist/mini-chat.html +5 -5
  92. package/dist/mobile.html +1 -1
  93. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t}from"./platform-CiUKDeXd.js";import{a as n,r}from"./vendor-zustand-CTekDqaS.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{St as o}from"./gitApiHttp-Dd-FwgCq.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{_t as s,ft as c,n as l}from"./client-B_907PBv.js";import{n as u}from"./vendor-react-BkccXcWz.js";import{R as d}from"./runtime-file-resource-Bc_ss-sW.js";import{r as f}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as p}from"./useUIStore-C3ewjGgP.js";import{i as m,o as h,s as g}from"./session-startup-barrier-DT-hIBRf.js";import{n as _}from"./Icon-DmykXZL1.js";import{$i as v,Hi as y,Jr as b,Na as x,Oi as S,Qr as C,Xr as w,d as T,f as E,si as D,t as O,ta as ee}from"./ui-DrAJTWV6.js";import{c as k,t as te}from"./i18n-DXc6czdR.js";import{n as ne}from"./ScrollableOverlay-stxT7gLf.js";import{i as A,n as j,t as re}from"./tooltip-CpTbxEOE.js";import{a as ie}from"./device-EIfSfSWk.js";import{n as ae,r as oe,t as se}from"./collapsible-Z0IjDAMO.js";import{t as ce}from"./textarea-ZiXxEOHK.js";import{t as le}from"./gitApi-BWsBS_2N.js";import{c as M,i as N,n as P,r as F,s as I}from"./useGitStore-B641o_o0.js";import{t as L}from"./input-Cf16qJ6g.js";import{t as ue}from"./checkbox-BMN5hAVm.js";import{a as de,c as R,r as z}from"./insertionBoundaries-BSDUOMHN.js";import{t as B}from"./ModelLogo-BkbD514M.js";import{n as V,t as fe}from"./useModelLists-Ca085-di.js";import{a as H,c as pe,i as U,n as me,o as W,r as G,s as he,t as ge}from"./select-vZCgcnYG.js";import{s as K}from"./worktreeManager-QmahFqHc.js";import{a as q,i as J,n as _e,t as ve}from"./worktreeSourceBranchPreference-B5Fldnhm.js";import{a as ye,i as be,n as xe}from"./projectMeta-vIaGFaQr.js";var Y=e(a(),1),Se=u(),Ce=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,we=/^g[1-9]\d*$/,X=(e,t,n,r,i)=>{if(!Ce.test(e)||t!==void 0&&!we.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}},Te=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 X(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return we.test(e)?X(n,e,r,i,void 0):X(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?X(n,void 0,i,a,o):X(n,r,i,a,o)},Ee=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(`/`)},Z=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},De=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),Oe=(e,t)=>`${De(e)}-${De(t)}`.substring(0,60),ke=(e,t)=>`${e}/${t}`,Ae=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},je=(e,t)=>{let n=Ae(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};s(e.id,n),E.getState().markSessionAsYuriCreated(e.id),S.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},Me=()=>{let e=x.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Ne=n()(r(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let s=Me();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let c=s.path,u=await le(c)&&t.isolateRuns!==!1,d=De(n),f=u?await K(c):void 0,p=u?await q(c):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let g of n.models){let n=`${g.providerID}:${g.modelID}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=Oe(g.providerID,g.modelID),b=r.length>1?`g${e+1}`:void 0,x=_>1?ke(d,`${y}/${v}`):ke(d,y),S=b?`${b}/${x}`:x,C=Ee({groupSlug:d,runGroup:b,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await l.withDirectory(c,()=>l.createSession({title:C}));je(e,c),m.push({sessionId:e.id,worktreePath:c,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await J(s,{preferredName:S,mode:`new`,branchName:S,worktreeName:S,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await w(s)&&await D(e.worktreeRoot??e.path);let r=await l.withDirectory(e.path,()=>l.createSession({title:C}));je(r,e.path),E.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let g=o?.filter(e=>e.trim().length>0)??[];g.length>0&&C(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),v=m[0]?.sessionId??null;if(_.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let y=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(m.map(async e=>{try{await T({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:y})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:_,firstSessionId:v}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),Q=i(),Pe=`h-7`,Fe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Ie=e=>{let t=(0,Se.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=h(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Pe),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,Q.jsx)(B,{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,Q.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,Q.jsx)(_,{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,Q.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,Q.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},$=e=>{let t=(0,Se.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:u,dropdownSide:d,dropdownClassName:f,containerClassName:g,triggerIcon:v}=e,b=c===void 0||c,x=d===void 0?`top`:d,{t:S}=te(),C=y(Le),w=y(Re),T=p(ze),E=p(Be),{favoriteModelsList:D,recentModelsList:O}=fe(),k=p(Ve),ne=p(He),[A,j]=Y.useState(!1),[re,ie]=Y.useState(``),[ae,oe]=Y.useState(null),se=Y.useRef(null),ce=Y.useRef(null),le=l===1,M=l===void 0||n.length<l||le,N;if(t[0]!==n){N=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;N.set(t,(N.get(t)||0)+1)}t[0]=n,t[1]=N}else N=t[1];let P=N,F;t[2]===n?F=t[3]:(F=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=F);let I=F,L,ue;t[4]!==x||t[5]!==A?(L=()=>{if(!A||!ce.current)return;let e=ce.current.getBoundingClientRect();if(x===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;oe(Math.max(160,Math.min(320,t)));return}let t=ce.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;oe(Math.max(150,Math.min(300,r)))},ue=[x,A],t[4]=x,t[5]=A,t[6]=L,t[7]=ue):(L=t[6],ue=t[7]),Y.useEffect(L,ue);let de,R;t[8]!==M||t[9]!==A?(de=()=>{!M&&A&&(j(!1),ie(``))},R=[M,A],t[8]=M,t[9]=A,t[10]=de,t[11]=R):(de=t[10],R=t[11]),Y.useEffect(de,R);let z,B;t[12]===A?(z=t[13],B=t[14]):(z=()=>{if(!A)return;let e=e=>{se.current&&!se.current.contains(e.target)&&(j(!1),ie(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},B=[A],t[12]=A,t[13]=z,t[14]=B),Y.useEffect(z,B);let H;t[15]!==le||t[16]!==r||t[17]!==a||t[18]!==n.length?(H=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:ee(e.model,e.modelID)||e.modelID,instanceId:Fe()};le&&n.length>0&&a?a(0,t):r(t),le&&(j(!1),ie(``))},t[15]=le,t[16]=r,t[17]=a,t[18]=n.length,t[19]=H):H=t[19];let W=H,G;t[20]===S?G=t[21]:(G=S(`multirun.modelMultiSelect.search.placeholder`),t[20]=S,t[21]=G);let K;t[22]===S?K=t[23]:(K=S(`multirun.modelMultiSelect.search.noResults`),t[22]=S,t[23]=K);let q;t[24]===S?q=t[25]:(q=S(`multirun.modelMultiSelect.sections.favorites`),t[24]=S,t[25]=q);let J;t[26]===S?J=t[27]:(J=S(`multirun.modelMultiSelect.sections.recent`),t[26]=S,t[27]=J);let _e;t[28]===S?_e=t[29]:(_e=S(`multirun.modelMultiSelect.keyboard.hint`),t[28]=S,t[29]=_e);let ve;t[30]===S?ve=t[31]:(ve=S(`settings.agents.modelSelector.actions.favorite`),t[30]=S,t[31]=ve);let ye;t[32]===S?ye=t[33]:(ye=S(`settings.agents.modelSelector.actions.unfavorite`),t[32]=S,t[33]=ye);let be;t[34]===S?be=t[35]:(be=S(`chat.modelControls.provider`),t[34]=S,t[35]=be);let xe;t[36]===S?xe=t[37]:(xe=S(`chat.modelControls.capabilities`),t[36]=S,t[37]=xe);let Ce;t[38]===S?Ce=t[39]:(Ce=S(`chat.modelControls.capability.toolCalling`),t[38]=S,t[39]=Ce);let we;t[40]===S?we=t[41]:(we=S(`chat.modelControls.capability.reasoning`),t[40]=S,t[41]=we);let X;t[42]===S?X=t[43]:(X=S(`chat.modelControls.modality.image`),t[42]=S,t[43]=X);let Te;t[44]===S?Te=t[45]:(Te=S(`chat.modelControls.modality.video`),t[44]=S,t[45]=Te);let Ee;t[46]===S?Ee=t[47]:(Ee=S(`chat.modelControls.modality.audio`),t[46]=S,t[47]=Ee);let Z;t[48]===S?Z=t[49]:(Z=S(`chat.modelControls.costPerMillion`),t[48]=S,t[49]=Z);let De;t[50]===S?De=t[51]:(De=S(`chat.modelControls.costInput`),t[50]=S,t[51]=De);let Oe;t[52]===S?Oe=t[53]:(Oe=S(`chat.modelControls.costOutput`),t[52]=S,t[53]=Oe);let ke;t[54]!==G||t[55]!==K||t[56]!==q||t[57]!==J||t[58]!==_e||t[59]!==ve||t[60]!==ye||t[61]!==be||t[62]!==xe||t[63]!==Ce||t[64]!==we||t[65]!==X||t[66]!==Te||t[67]!==Ee||t[68]!==Z||t[69]!==De||t[70]!==Oe?(ke={searchPlaceholder:G,noResults:K,favorites:q,recent:J,keyboardHint:_e,favorite:ve,unfavorite:ye,provider:be,capabilities:xe,capabilityToolCalling:Ce,capabilityReasoning:we,modalityImage:X,modalityVideo:Te,modalityAudio:Ee,costPerMillion:Z,costInput:De,costOutput:Oe},t[54]=G,t[55]=K,t[56]=q,t[57]=J,t[58]=_e,t[59]=ve,t[60]=ye,t[61]=be,t[62]=xe,t[63]=Ce,t[64]=we,t[65]=X,t[66]=Te,t[67]=Ee,t[68]=Z,t[69]=De,t[70]=Oe,t[71]=ke):ke=t[71];let Ae=ke,je;t[72]===g?je=t[73]:(je=h(`relative`,g),t[72]=g,t[73]=je);let Me;t[74]===u?Me=t[75]:(Me=h(Pe,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,u),t[74]=u,t[75]=Me);let Ne=!M,$;t[76]===A?$=t[77]:($=()=>{j(!A)},t[76]=A,t[77]=$);let We;t[78]===v?We=t[79]:(We=v??(0,Q.jsx)(_,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=v,t[79]=We);let Ge;t[80]!==s||t[81]!==S?(Ge=s??S(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=S,t[82]=Ge):Ge=t[82];let Ke;t[83]!==Me||t[84]!==Ne||t[85]!==$||t[86]!==We||t[87]!==Ge?(Ke=(0,Q.jsxs)(m,{ref:ce,type:`button`,variant:`outline`,size:`sm`,className:Me,disabled:Ne,onClick:$,children:[We,Ge]}),t[83]=Me,t[84]=Ne,t[85]=$,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==ae||t[90]!==M||t[91]!==f||t[92]!==x||t[93]!==D||t[94]!==w||t[95]!==W||t[96]!==k||t[97]!==E||t[98]!==A||t[99]!==Ae||t[100]!==P||t[101]!==ne||t[102]!==C||t[103]!==O||t[104]!==re||t[105]!==T?(qe=A?(0,Q.jsx)(`div`,{className:h(`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`,x===`top`?`bottom-full mb-1`:`top-full mt-1`,f),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,Q.jsx)(V,{providers:C,providerOrder:ne,favoriteModels:D,recentModels:O,getMetadata:w,hiddenModels:k,searchQuery:re,onSearchQueryChange:ie,onSelect:W,labels:Ae,selectionCount:e=>P.get(`${e.providerID}:${e.modelID}`)||0,disabled:!M,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:ae?`${ae}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:A,isFavorite:e=>E(e.providerID,e.modelID),onToggleFavorite:e=>T(e.providerID,e.modelID),onEscape:()=>{j(!1),ie(``)}})}):null,t[89]=ae,t[90]=M,t[91]=f,t[92]=x,t[93]=D,t[94]=w,t[95]=W,t[96]=k,t[97]=E,t[98]=A,t[99]=Ae,t[100]=P,t[101]=ne,t[102]=C,t[103]=O,t[104]=re,t[105]=T,t[106]=qe):qe=t[106];let Je;t[107]!==je||t[108]!==Ke||t[109]!==qe?(Je=(0,Q.jsxs)(`div`,{className:je,ref:se,children:[Ke,qe]}),t[107]=je,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==I||t[112]!==P||t[113]!==i||t[114]!==a||t[115]!==C||t[116]!==n||t[117]!==b||t[118]!==S?(Ye=b&&n.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=P.get(n)||1,o=I(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,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(Ie,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,Q.jsxs)(ge,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,Q.jsxs)(he,{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,Q.jsx)(_,{name:`brain-ai-3`,className:h(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,Q.jsx)(pe,{placeholder:S(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?S(`multirun.modelMultiSelect.variant.default`):e})]}),(0,Q.jsxs)(me,{fitContent:!0,children:[(0,Q.jsx)(U,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:S(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=I,t[112]=P,t[113]=i,t[114]=a,t[115]=C,t[116]=n,t[117]=b,t[118]=S,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,Q.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]!==S?(Ze=o!==void 0&&n.length<o&&(0,Q.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?S(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):S(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=S,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,Q.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,Q.jsx)(U,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,Se.c)(30),{git:n}=d(),r=P(e),i=M(e),a=N(e),o=F(e),s=I(Ye),c=I(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]),Y.useEffect(l,u);let f;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(f=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=f):f=t[12];let p=r?.all,m;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==p?(m=[e,n,i,p,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=p,t[18]=m):m=t[18],Y.useEffect(f,m);let h=a||i===!0&&o,g;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],g=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),g=e}let _=g,v;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],v=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),v=e}let y=v,b;bb2:{if(!e){b=null;break bb2}if(i!==null){b=i;break bb2}if(h){b=null;break bb2}b=r?.all?!0:null}let x=b,S;return t[25]!==x||t[26]!==h||t[27]!==_||t[28]!==y?(S={localBranches:_,remoteBranches:y,isLoading:h,isGitRepository:x},t[25]=x,t[26]=h,t[27]=_,t[28]=y,t[29]=S):S=t[29],S}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=te(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(e),d=Y.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return Y.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await K(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(ve),{sourceBranch:o,shouldClearSavedSourceBranch:s}=_e({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(ve),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(ge,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,Q.jsx)(he,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,Q.jsx)(pe,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,Q.jsx)(me,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,Q.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,Q.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,Q.jsxs)(Q.Fragment,{children:[s.length>0&&(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,Q.jsx)(U,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,Q.jsx)(W,{}),c.length>0&&(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,Q.jsx)(U,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,Q.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},Ze=e=>{let t=(0,Se.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=te(),l=y(Qe),u=y($e),d=y(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 g=m,_,v;t[4]!==p.length||t[5]!==u?(_=()=>{p.length===0&&u()},v=[p.length,u],t[4]=p.length,t[5]=u,t[6]=_,t[7]=v):(_=t[6],v=t[7]),Y.useEffect(_,v);let b,x;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==g||t[12]!==n?(b=()=>{if(a)return;let e=n.trim();if(e.length>0&&g.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&g.some(e=>e.name===t)){r(t);return}let i=g[0]?.name;i&&r(i)},x=[d,a,r,g,n],t[8]=d,t[9]=a,t[10]=r,t[11]=g,t[12]=n,t[13]=b,t[14]=x):(b=t[13],x=t[14]),Y.useEffect(b,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=h(`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,Q.jsx)(pe,{placeholder:w}),t[19]=w,t[20]=T);let E;t[21]!==o||t[22]!==C||t[23]!==T?(E=(0,Q.jsx)(he,{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]===g?D=t[26]:(D=g.length>0&&(0,Q.jsx)(G,{children:g.map(nt)}),t[25]=g,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,Q.jsx)(me,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let ee;return t[30]!==a||t[31]!==r||t[32]!==S||t[33]!==E||t[34]!==O?(ee=(0,Q.jsxs)(ge,{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]=ee):ee=t[35],ee};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return v(e.mode)}function nt(e){return(0,Q.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,Se.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(A,{asChild:!0,children:(0,Q.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,Q.jsx)(_,{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,Q.jsxs)(re,{children:[r,(0,Q.jsx)(j,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,Se.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,Q.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,Q.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,Q.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=g(e.path),n=e.icon?be[e.icon]:null,r=e.color?xe[e.color]:void 0,i=(0,Q.jsx)(_,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`relative top-px flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,Q.jsx)(ye,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,Q.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=te(),[s,c]=Y.useState(``),[l,u]=Y.useState(()=>[{id:Fe(),prompt:``,models:[]}]),[d,p]=Y.useState(``),[g,v]=Y.useState([]),[y,S]=Y.useState(!1),[C,w]=Y.useState([]),[T,D]=Y.useState(!1),[ee,ce]=Y.useState(!1),[le,M]=Y.useState(!0),N=Y.useRef(null),P=o(e=>e.currentDirectory??null),F=Y.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=x(e=>e.activeProjectId),de=x(e=>e.setActiveProjectIdOnly),R=x(e=>e.projects),[z,B]=Y.useState(()=>I??null);Y.useEffect(()=>{if(I){B(I);return}!z&&R.length>0&&B(R[0].id)},[I,R,z]);let V=Y.useMemo(()=>z?R.find(e=>e.id===z)??null:null,[R,z]),fe=V?.path??P,H=f(e=>{B(e),e!==I&&de(e)}),W=Y.useMemo(()=>{if(V?.path)return{id:V.id,path:V.path};let e=P??F;return e?{id:`path:${e}`,path:e}:null},[V,P,F]),[G]=Y.useState(()=>typeof window<`u`&&t()),K=Y.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),q=ie(),J=Y.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},[]),_e=Y.useMemo(()=>G&&K||q?`pl-[5.5rem]`:`pl-3`,[G,K,q]),ve=Y.useMemo(()=>!G||!K||J===null?``:J>=26?`h-12`:J<=15?`h-14`:``,[G,K,J]),ye=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&G&&await k()}),be=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),xe=!!r;Y.useEffect(()=>{if(xe)return window.addEventListener(`keydown`,be,!0),()=>window.removeEventListener(`keydown`,be,!0)},[xe]);let[Se,Ce]=Y.useState(``),{isLoading:we,isGitRepository:X}=We(fe),Te=Y.useRef(!1),Ee=X===!0,Z=Ee&&le;Y.useEffect(()=>{if(X===!1){Te.current=!0,M(!1);return}X===!0&&Te.current&&(Te.current=!1,M(!0))},[X]);let De=Ne(e=>e.createMultiRun),Oe=Ne(e=>e.error),ke=Ne(e=>e.clearError);Y.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]),Y.useEffect(()=>{if(!W)return;let e=!1;return ce(!0),(async()=>{try{let t=await b(W);e||w(t)}catch{}finally{e||ce(!1)}})(),()=>{e=!0}},[W]);let Ae=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),je=f(e=>{u(t=>t.filter(t=>t.id!==e))}),Me=f(()=>{u(e=>[...e,{id:Fe(),prompt:``,models:[]}])}),Pe=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){O.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)});v(t=>[...t,{id:Fe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),O.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&O.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),N.current&&(N.current.value=``)},Ie=e=>{v(t=>t.filter(t=>t.id!==e))},$=Y.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&&!($<1)){S(!0),ke();try{z&&z!==I&&de(z);let e=g.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:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Z?Se:void 0,isolateRuns:Z,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await De(a);o&&(o.firstSessionId&&E.getState().setCurrentSession(o.firstSessionId),n?.())}finally{S(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&$>=1&&fe&&!we&&(X===!1||!Z||Se)),ze=C.filter(e=>e.trim()).length;return(0,Q.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,Q.jsxs)(`header`,{onMouseDown:ye,className:h(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,_e,ve),style:{borderColor:`var(--interactive-border)`},children:[(0,Q.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,Q.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,Q.jsxs)(re,{children:[(0,Q.jsx)(A,{asChild:!0,children:(0,Q.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,Q.jsx)(_,{name:`close`,className:`h-5 w-5`})})}),(0,Q.jsx)(j,{children:(0,Q.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,Q.jsx)(ne,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,Q.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),R.length>0?(0,Q.jsxs)(ge,{value:z??void 0,onValueChange:H,children:[(0,Q.jsx)(he,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:V?(0,Q.jsx)(pe,{children:st(V)}):(0,Q.jsx)(pe,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,Q.jsx)(me,{fitContent:!0,children:R.map(e=>(0,Q.jsx)(U,{value:e.id,className:`max-w-[24rem]`,children:st(e)},e.id))})]}):(0,Q.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`group-name`,required:!0,info:(0,Q.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,Q.jsx)(L,{id:`group-name`,value:s,onChange:e=>c(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,Q.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,Q.jsx)(Xe,{directory:fe,value:Se,onChange:Ce,disabled:!Z,id:`multirun-worktree-base-branch`}),(0,Q.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,Q.jsx)(ue,{checked:le,onChange:M,disabled:!Ee,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,Q.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`multirun-agent`,info:(0,Q.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,Q.jsx)(Ze,{value:d,onChange:p,id:`multirun-agent`})]})]}),(0,Q.jsxs)(se,{open:T,onOpenChange:D,children:[(0,Q.jsxs)(oe,{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,Q.jsx)(_,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,Q.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,Q.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,Q.jsx)(_,{name:`arrow-down-s`,className:h(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,T&&`rotate-180`)})]}),(0,Q.jsx)(ae,{children:(0,Q.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:ee?(0,Q.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,Q.jsxs)(Q.Fragment,{children:[C.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,Q.jsx)(L,{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,Q.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,Q.jsx)(_,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,Q.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,Q.jsx)(_,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(ot,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,Q.jsx)(`input`,{ref:N,type:`file`,multiple:!0,className:`hidden`,onChange:Pe,accept:`*/*`}),(0,Q.jsxs)(re,{children:[(0,Q.jsx)(A,{asChild:!0,children:(0,Q.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,Q.jsx)(_,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,Q.jsx)(j,{children:a(`multirun.launcher.attachments.tooltip`)})]}),g.map(e=>(0,Q.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,Q.jsx)(_,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,Q.jsx)(_,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>Ie(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,Q.jsx)(_,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,Q.jsx)(lt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:Ae,onRemove:je},e.id)),(0,Q.jsxs)(`button`,{type:`button`,onClick:Me,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,Q.jsx)(_,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),Oe&&(0,Q.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:Oe})]})})}),(0,Q.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Z&&X!==null?(0,Q.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,Q.jsx)(_,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,Q.jsx)(m,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,Q.jsx)(m,{type:`submit`,size:`sm`,disabled:!Re||y,children:y?a(`multirun.launcher.actions.creating`):(0,Q.jsx)(Q.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:$})})})]})})]})},lt=e=>{let t=(0,Se.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=te(),[c,l]=Y.useState(!1),[u,d]=Y.useState(``),[p,m]=Y.useState(!1),[h,g]=Y.useState(``),v=Y.useRef(null),y=Y.useRef(null),b=Y.useRef(null),x;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(x=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]=x):x=t[3];let S=f(x),C;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(C=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]=C):C=t[7];let w=f(C),T;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(T=(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]=T):T=t[11];let E=f(T),D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{F as t}from"./platform-CiUKDeXd.js";import{a as n,r}from"./vendor-zustand-CTekDqaS.js";import{ot as i,st as a}from"./vendor-base-ui-wXsskyKm.js";import{St as o}from"./gitApiHttp-Dd-FwgCq.js";import"./brand-storage-bootstrap-D4BW3w-M.js";import{_t as s,ft as c,n as l}from"./client-B_907PBv.js";import{n as u}from"./vendor-react-BkccXcWz.js";import{R as d}from"./runtime-file-resource-Bc_ss-sW.js";import{r as f}from"./vendor-reactuses-core-DjKFMfz7.js";import{r as p}from"./useUIStore-C3ewjGgP.js";import{i as m,o as h,s as g}from"./session-startup-barrier-DT-hIBRf.js";import{n as _}from"./Icon-DmykXZL1.js";import{$i as v,Hi as y,Jr as b,Na as x,Oi as S,Qr as C,Xr as w,d as T,f as E,si as D,t as O,ta as ee}from"./ui-ee2iN869.js";import{c as k,t as te}from"./i18n-DXc6czdR.js";import{n as ne}from"./ScrollableOverlay-stxT7gLf.js";import{i as A,n as j,t as re}from"./tooltip-CpTbxEOE.js";import{a as ie}from"./device-EIfSfSWk.js";import{n as ae,r as oe,t as se}from"./collapsible-Z0IjDAMO.js";import{t as ce}from"./textarea-ZiXxEOHK.js";import{t as le}from"./gitApi-CoVwjIDy.js";import{c as M,i as N,n as P,r as F,s as I}from"./useGitStore-Bv8xmXDa.js";import{t as L}from"./input-Cf16qJ6g.js";import{t as ue}from"./checkbox-BMN5hAVm.js";import{a as de,c as R,r as z}from"./insertionBoundaries-Btqgsu1M.js";import{t as B}from"./ModelLogo-BkbD514M.js";import{n as V,t as fe}from"./useModelLists-Bf60FIJu.js";import{a as H,c as pe,i as U,n as me,o as W,r as G,s as he,t as ge}from"./select-vZCgcnYG.js";import{s as K}from"./worktreeManager-DGu8M01Z.js";import{a as q,i as J,n as _e,t as ve}from"./worktreeSourceBranchPreference-CuLKwxkx.js";import{a as ye,i as be,n as xe}from"./projectMeta-vIaGFaQr.js";var Y=e(a(),1),Se=u(),Ce=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,we=/^g[1-9]\d*$/,X=(e,t,n,r,i)=>{if(!Ce.test(e)||t!==void 0&&!we.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}},Te=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 X(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return we.test(e)?X(n,e,r,i,void 0):X(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?X(n,void 0,i,a,o):X(n,r,i,a,o)},Ee=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(`/`)},Z=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},De=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),Oe=(e,t)=>`${De(e)}-${De(t)}`.substring(0,60),ke=(e,t)=>`${e}/${t}`,Ae=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},je=(e,t)=>{let n=Ae(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};s(e.id,n),E.getState().markSessionAsYuriCreated(e.id),S.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},Me=()=>{let e=x.getState(),t=e.activeProjectId;if(!t)return null;let n=e.projects.find(e=>e.id===t);if(n?.path)return{id:n.id,path:n.path};let r=o.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Ne=n()(r(e=>({isLoading:!1,error:null,createMultiRun:async t=>{let n=t.name.trim(),{groups:r,agent:i,files:a,setupCommands:o}=t;if(!n)return e({error:`Group name is required`}),null;if(!r||r.length===0)return e({error:`At least one run group is required`}),null;for(let t=0;t<r.length;t++){if(!r[t].prompt.trim())return e({error:`Group ${t+1}: prompt is required`}),null;if(r[t].models.length<1)return e({error:`Group ${t+1}: select at least 1 model`}),null;if(r[t].models.length>5)return e({error:`Group ${t+1}: maximum 5 models allowed`}),null}e({isLoading:!0,error:null});try{let s=Me();if(!s)return e({error:`Select a project`,isLoading:!1}),null;let c=s.path,u=await le(c)&&t.isolateRuns!==!1,d=De(n),f=u?await K(c):void 0,p=u?await q(c):null,m=[],h=o?.filter(e=>e.trim().length>0)??[];for(let e=0;e<r.length;e++){let n=r[e],i=n.prompt,a=new Map;for(let e of n.models){let t=`${e.providerID}:${e.modelID}`;a.set(t,(a.get(t)||0)+1)}let o=new Map;for(let g of n.models){let n=`${g.providerID}:${g.modelID}`,_=a.get(n)||1,v=(o.get(n)||0)+1;o.set(n,v);let y=Oe(g.providerID,g.modelID),b=r.length>1?`g${e+1}`:void 0,x=_>1?ke(d,`${y}/${v}`):ke(d,y),S=b?`${b}/${x}`:x,C=Ee({groupSlug:d,runGroup:b,providerID:g.providerID,modelID:g.modelID,index:_>1?v:void 0});try{if(!u){let e=await l.withDirectory(c,()=>l.createSession({title:C}));je(e,c),m.push({sessionId:e.id,worktreePath:c,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await J(s,{preferredName:S,mode:`new`,branchName:S,worktreeName:S,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await w(s)&&await D(e.worktreeRoot??e.path);let r=await l.withDirectory(e.path,()=>l.createSession({title:C}));je(r,e.path),E.getState().setWorktreeMetadata(r.id,n),m.push({sessionId:r.id,worktreePath:e.path,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i})}catch(e){console.warn(`[MultiRun] Failed to create session:`,e)}}}let g=o?.filter(e=>e.trim().length>0)??[];g.length>0&&C(s,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let _=m.map(e=>e.sessionId),v=m[0]?.sessionId??null;if(_.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let y=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{await Promise.allSettled(m.map(async e=>{try{await T({sessionId:e.sessionId,directory:e.worktreePath,content:e.prompt,providerID:e.providerID,modelID:e.modelID,variant:e.variant,agent:i,files:y})}catch(e){console.warn(`[MultiRun] Failed to start run:`,e)}}))}catch(e){console.warn(`[MultiRun] Failed to start runs:`,e)}})(),e({isLoading:!1}),{groupSlug:d,sessionIds:_,firstSessionId:v}}catch(t){return e({error:t instanceof Error?t.message:`Failed to create Multi-Run`,isLoading:!1}),null}},clearError:()=>{e({error:null})}}),{name:`multirun-store`})),Q=i(),Pe=`h-7`,Fe=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Ie=e=>{let t=(0,Se.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=h(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Pe),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,Q.jsx)(B,{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,Q.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,Q.jsx)(_,{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,Q.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,Q.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},$=e=>{let t=(0,Se.c)(131),{selectedModels:n,onAdd:r,onRemove:i,onUpdate:a,minModels:o,addButtonLabel:s,showChips:c,maxModels:l,addButtonClassName:u,dropdownSide:d,dropdownClassName:f,containerClassName:g,triggerIcon:v}=e,b=c===void 0||c,x=d===void 0?`top`:d,{t:S}=te(),C=y(Le),w=y(Re),T=p(ze),E=p(Be),{favoriteModelsList:D,recentModelsList:O}=fe(),k=p(Ve),ne=p(He),[A,j]=Y.useState(!1),[re,ie]=Y.useState(``),[ae,oe]=Y.useState(null),se=Y.useRef(null),ce=Y.useRef(null),le=l===1,M=l===void 0||n.length<l||le,N;if(t[0]!==n){N=new Map;for(let e of n){let t=`${e.providerID}:${e.modelID}`;N.set(t,(N.get(t)||0)+1)}t[0]=n,t[1]=N}else N=t[1];let P=N,F;t[2]===n?F=t[3]:(F=e=>n.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,t[2]=n,t[3]=F);let I=F,L,ue;t[4]!==x||t[5]!==A?(L=()=>{if(!A||!ce.current)return;let e=ce.current.getBoundingClientRect();if(x===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;oe(Math.max(160,Math.min(320,t)));return}let t=ce.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;oe(Math.max(150,Math.min(300,r)))},ue=[x,A],t[4]=x,t[5]=A,t[6]=L,t[7]=ue):(L=t[6],ue=t[7]),Y.useEffect(L,ue);let de,R;t[8]!==M||t[9]!==A?(de=()=>{!M&&A&&(j(!1),ie(``))},R=[M,A],t[8]=M,t[9]=A,t[10]=de,t[11]=R):(de=t[10],R=t[11]),Y.useEffect(de,R);let z,B;t[12]===A?(z=t[13],B=t[14]):(z=()=>{if(!A)return;let e=e=>{se.current&&!se.current.contains(e.target)&&(j(!1),ie(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},B=[A],t[12]=A,t[13]=z,t[14]=B),Y.useEffect(z,B);let H;t[15]!==le||t[16]!==r||t[17]!==a||t[18]!==n.length?(H=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:ee(e.model,e.modelID)||e.modelID,instanceId:Fe()};le&&n.length>0&&a?a(0,t):r(t),le&&(j(!1),ie(``))},t[15]=le,t[16]=r,t[17]=a,t[18]=n.length,t[19]=H):H=t[19];let W=H,G;t[20]===S?G=t[21]:(G=S(`multirun.modelMultiSelect.search.placeholder`),t[20]=S,t[21]=G);let K;t[22]===S?K=t[23]:(K=S(`multirun.modelMultiSelect.search.noResults`),t[22]=S,t[23]=K);let q;t[24]===S?q=t[25]:(q=S(`multirun.modelMultiSelect.sections.favorites`),t[24]=S,t[25]=q);let J;t[26]===S?J=t[27]:(J=S(`multirun.modelMultiSelect.sections.recent`),t[26]=S,t[27]=J);let _e;t[28]===S?_e=t[29]:(_e=S(`multirun.modelMultiSelect.keyboard.hint`),t[28]=S,t[29]=_e);let ve;t[30]===S?ve=t[31]:(ve=S(`settings.agents.modelSelector.actions.favorite`),t[30]=S,t[31]=ve);let ye;t[32]===S?ye=t[33]:(ye=S(`settings.agents.modelSelector.actions.unfavorite`),t[32]=S,t[33]=ye);let be;t[34]===S?be=t[35]:(be=S(`chat.modelControls.provider`),t[34]=S,t[35]=be);let xe;t[36]===S?xe=t[37]:(xe=S(`chat.modelControls.capabilities`),t[36]=S,t[37]=xe);let Ce;t[38]===S?Ce=t[39]:(Ce=S(`chat.modelControls.capability.toolCalling`),t[38]=S,t[39]=Ce);let we;t[40]===S?we=t[41]:(we=S(`chat.modelControls.capability.reasoning`),t[40]=S,t[41]=we);let X;t[42]===S?X=t[43]:(X=S(`chat.modelControls.modality.image`),t[42]=S,t[43]=X);let Te;t[44]===S?Te=t[45]:(Te=S(`chat.modelControls.modality.video`),t[44]=S,t[45]=Te);let Ee;t[46]===S?Ee=t[47]:(Ee=S(`chat.modelControls.modality.audio`),t[46]=S,t[47]=Ee);let Z;t[48]===S?Z=t[49]:(Z=S(`chat.modelControls.costPerMillion`),t[48]=S,t[49]=Z);let De;t[50]===S?De=t[51]:(De=S(`chat.modelControls.costInput`),t[50]=S,t[51]=De);let Oe;t[52]===S?Oe=t[53]:(Oe=S(`chat.modelControls.costOutput`),t[52]=S,t[53]=Oe);let ke;t[54]!==G||t[55]!==K||t[56]!==q||t[57]!==J||t[58]!==_e||t[59]!==ve||t[60]!==ye||t[61]!==be||t[62]!==xe||t[63]!==Ce||t[64]!==we||t[65]!==X||t[66]!==Te||t[67]!==Ee||t[68]!==Z||t[69]!==De||t[70]!==Oe?(ke={searchPlaceholder:G,noResults:K,favorites:q,recent:J,keyboardHint:_e,favorite:ve,unfavorite:ye,provider:be,capabilities:xe,capabilityToolCalling:Ce,capabilityReasoning:we,modalityImage:X,modalityVideo:Te,modalityAudio:Ee,costPerMillion:Z,costInput:De,costOutput:Oe},t[54]=G,t[55]=K,t[56]=q,t[57]=J,t[58]=_e,t[59]=ve,t[60]=ye,t[61]=be,t[62]=xe,t[63]=Ce,t[64]=we,t[65]=X,t[66]=Te,t[67]=Ee,t[68]=Z,t[69]=De,t[70]=Oe,t[71]=ke):ke=t[71];let Ae=ke,je;t[72]===g?je=t[73]:(je=h(`relative`,g),t[72]=g,t[73]=je);let Me;t[74]===u?Me=t[75]:(Me=h(Pe,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,u),t[74]=u,t[75]=Me);let Ne=!M,$;t[76]===A?$=t[77]:($=()=>{j(!A)},t[76]=A,t[77]=$);let We;t[78]===v?We=t[79]:(We=v??(0,Q.jsx)(_,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),t[78]=v,t[79]=We);let Ge;t[80]!==s||t[81]!==S?(Ge=s??S(`multirun.modelMultiSelect.actions.addModel`),t[80]=s,t[81]=S,t[82]=Ge):Ge=t[82];let Ke;t[83]!==Me||t[84]!==Ne||t[85]!==$||t[86]!==We||t[87]!==Ge?(Ke=(0,Q.jsxs)(m,{ref:ce,type:`button`,variant:`outline`,size:`sm`,className:Me,disabled:Ne,onClick:$,children:[We,Ge]}),t[83]=Me,t[84]=Ne,t[85]=$,t[86]=We,t[87]=Ge,t[88]=Ke):Ke=t[88];let qe;t[89]!==ae||t[90]!==M||t[91]!==f||t[92]!==x||t[93]!==D||t[94]!==w||t[95]!==W||t[96]!==k||t[97]!==E||t[98]!==A||t[99]!==Ae||t[100]!==P||t[101]!==ne||t[102]!==C||t[103]!==O||t[104]!==re||t[105]!==T?(qe=A?(0,Q.jsx)(`div`,{className:h(`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`,x===`top`?`bottom-full mb-1`:`top-full mt-1`,f),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,Q.jsx)(V,{providers:C,providerOrder:ne,favoriteModels:D,recentModels:O,getMetadata:w,hiddenModels:k,searchQuery:re,onSearchQueryChange:ie,onSelect:W,labels:Ae,selectionCount:e=>P.get(`${e.providerID}:${e.modelID}`)||0,disabled:!M,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:ae?`${ae}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:A,isFavorite:e=>E(e.providerID,e.modelID),onToggleFavorite:e=>T(e.providerID,e.modelID),onEscape:()=>{j(!1),ie(``)}})}):null,t[89]=ae,t[90]=M,t[91]=f,t[92]=x,t[93]=D,t[94]=w,t[95]=W,t[96]=k,t[97]=E,t[98]=A,t[99]=Ae,t[100]=P,t[101]=ne,t[102]=C,t[103]=O,t[104]=re,t[105]=T,t[106]=qe):qe=t[106];let Je;t[107]!==je||t[108]!==Ke||t[109]!==qe?(Je=(0,Q.jsxs)(`div`,{className:je,ref:se,children:[Ke,qe]}),t[107]=je,t[108]=Ke,t[109]=qe,t[110]=Je):Je=t[110];let Ye;t[111]!==I||t[112]!==P||t[113]!==i||t[114]!==a||t[115]!==C||t[116]!==n||t[117]!==b||t[118]!==S?(Ye=b&&n.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:n.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=P.get(n)||1,o=I(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,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(Ie,{model:e,instanceIndex:o,totalSameModel:r,onRemove:()=>i(t)}),l&&(0,Q.jsxs)(ge,{value:u,onValueChange:n=>{if(!a)return;let r=n===`__default__`?void 0:n;a(t,{...e,variant:r})},children:[(0,Q.jsxs)(he,{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,Q.jsx)(_,{name:`brain-ai-3`,className:h(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,Q.jsx)(pe,{placeholder:S(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?S(`multirun.modelMultiSelect.variant.default`):e})]}),(0,Q.jsxs)(me,{fitContent:!0,children:[(0,Q.jsx)(U,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:S(`multirun.modelMultiSelect.variant.default`)}),c.map(Ue)]})]})]},e.instanceId)})}),t[111]=I,t[112]=P,t[113]=i,t[114]=a,t[115]=C,t[116]=n,t[117]=b,t[118]=S,t[119]=Ye):Ye=t[119];let Xe;t[120]!==Je||t[121]!==Ye?(Xe=(0,Q.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]!==S?(Ze=o!==void 0&&n.length<o&&(0,Q.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:l===void 0?S(`multirun.modelMultiSelect.validation.minOnly`,{min:o}):S(`multirun.modelMultiSelect.validation.minToMax`,{min:o,max:l})}),t[123]=l,t[124]=o,t[125]=n.length,t[126]=S,t[127]=Ze):Ze=t[127];let Qe;return t[128]!==Xe||t[129]!==Ze?(Qe=(0,Q.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,Q.jsx)(U,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function We(e){let t=(0,Se.c)(30),{git:n}=d(),r=P(e),i=M(e),a=N(e),o=F(e),s=I(Ye),c=I(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]),Y.useEffect(l,u);let f;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(f=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=f):f=t[12];let p=r?.all,m;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==p?(m=[e,n,i,p,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=p,t[18]=m):m=t[18],Y.useEffect(f,m);let h=a||i===!0&&o,g;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],g=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(qe).sort(),t[20]=r.all,t[21]=e),g=e}let _=g,v;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],v=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Ke).map(Ge).sort(),t[23]=r.all,t[24]=e),v=e}let y=v,b;bb2:{if(!e){b=null;break bb2}if(i!==null){b=i;break bb2}if(h){b=null;break bb2}b=r?.all?!0:null}let x=b,S;return t[25]!==x||t[26]!==h||t[27]!==_||t[28]!==y?(S={localBranches:_,remoteBranches:y,isLoading:h,isGitRepository:x},t[25]=x,t[26]=h,t[27]=_,t[28]=y,t[29]=S):S=t[29],S}function Ge(e){return e.replace(/^remotes\//,``)}function Ke(e){return e.startsWith(`remotes/`)}function qe(e){return!e.startsWith(`remotes/`)}function Je(e){return e.fetchStatus}function Ye(e){return e.fetchBranches}var Xe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=te(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=We(e),d=Y.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return Y.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await K(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(ve),{sourceBranch:o,shouldClearSavedSourceBranch:s}=_e({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(ve),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(ge,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,Q.jsx)(he,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,Q.jsx)(pe,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,Q.jsx)(me,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,Q.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,Q.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,Q.jsxs)(Q.Fragment,{children:[s.length>0&&(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,Q.jsx)(U,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,Q.jsx)(W,{}),c.length>0&&(0,Q.jsxs)(G,{children:[(0,Q.jsx)(H,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,Q.jsx)(U,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,Q.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},Ze=e=>{let t=(0,Se.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=te(),l=y(Qe),u=y($e),d=y(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 g=m,_,v;t[4]!==p.length||t[5]!==u?(_=()=>{p.length===0&&u()},v=[p.length,u],t[4]=p.length,t[5]=u,t[6]=_,t[7]=v):(_=t[6],v=t[7]),Y.useEffect(_,v);let b,x;t[8]!==d||t[9]!==a||t[10]!==r||t[11]!==g||t[12]!==n?(b=()=>{if(a)return;let e=n.trim();if(e.length>0&&g.some(t=>t.name===e))return;let t=typeof d==`string`&&d.trim().length>0?d.trim():null;if(t&&g.some(e=>e.name===t)){r(t);return}let i=g[0]?.name;i&&r(i)},x=[d,a,r,g,n],t[8]=d,t[9]=a,t[10]=r,t[11]=g,t[12]=n,t[13]=b,t[14]=x):(b=t[13],x=t[14]),Y.useEffect(b,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=h(`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,Q.jsx)(pe,{placeholder:w}),t[19]=w,t[20]=T);let E;t[21]!==o||t[22]!==C||t[23]!==T?(E=(0,Q.jsx)(he,{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]===g?D=t[26]:(D=g.length>0&&(0,Q.jsx)(G,{children:g.map(nt)}),t[25]=g,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,Q.jsx)(me,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let ee;return t[30]!==a||t[31]!==r||t[32]!==S||t[33]!==E||t[34]!==O?(ee=(0,Q.jsxs)(ge,{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]=ee):ee=t[35],ee};function Qe(e){return e.getVisibleAgents}function $e(e){return e.loadAgents}function et(e){return e.currentAgentName}function tt(e){return v(e.mode)}function nt(e){return(0,Q.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,Se.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Q.jsx)(A,{asChild:!0,children:(0,Q.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,Q.jsx)(_,{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,Q.jsxs)(re,{children:[r,(0,Q.jsx)(j,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ot=e=>{let t=(0,Se.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,Q.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,Q.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,Q.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=g(e.path),n=e.icon?be[e.icon]:null,r=e.color?xe[e.color]:void 0,i=(0,Q.jsx)(_,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,Q.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`relative top-px flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,Q.jsx)(ye,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,Q.jsx)(`span`,{className:`truncate`,children:t})]})},ct=({initialPrompt:e,onCreated:n,onCancel:r,isWindowed:i=!1})=>{let{t:a}=te(),[s,c]=Y.useState(``),[l,u]=Y.useState(()=>[{id:Fe(),prompt:``,models:[]}]),[d,p]=Y.useState(``),[g,v]=Y.useState([]),[y,S]=Y.useState(!1),[C,w]=Y.useState([]),[T,D]=Y.useState(!1),[ee,ce]=Y.useState(!1),[le,M]=Y.useState(!0),N=Y.useRef(null),P=o(e=>e.currentDirectory??null),F=Y.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=x(e=>e.activeProjectId),de=x(e=>e.setActiveProjectIdOnly),R=x(e=>e.projects),[z,B]=Y.useState(()=>I??null);Y.useEffect(()=>{if(I){B(I);return}!z&&R.length>0&&B(R[0].id)},[I,R,z]);let V=Y.useMemo(()=>z?R.find(e=>e.id===z)??null:null,[R,z]),fe=V?.path??P,H=f(e=>{B(e),e!==I&&de(e)}),W=Y.useMemo(()=>{if(V?.path)return{id:V.id,path:V.path};let e=P??F;return e?{id:`path:${e}`,path:e}:null},[V,P,F]),[G]=Y.useState(()=>typeof window<`u`&&t()),K=Y.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),q=ie(),J=Y.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},[]),_e=Y.useMemo(()=>G&&K||q?`pl-[5.5rem]`:`pl-3`,[G,K,q]),ve=Y.useMemo(()=>!G||!K||J===null?``:J>=26?`h-12`:J<=15?`h-14`:``,[G,K,J]),ye=f(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&G&&await k()}),be=f(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),xe=!!r;Y.useEffect(()=>{if(xe)return window.addEventListener(`keydown`,be,!0),()=>window.removeEventListener(`keydown`,be,!0)},[xe]);let[Se,Ce]=Y.useState(``),{isLoading:we,isGitRepository:X}=We(fe),Te=Y.useRef(!1),Ee=X===!0,Z=Ee&&le;Y.useEffect(()=>{if(X===!1){Te.current=!0,M(!1);return}X===!0&&Te.current&&(Te.current=!1,M(!0))},[X]);let De=Ne(e=>e.createMultiRun),Oe=Ne(e=>e.error),ke=Ne(e=>e.clearError);Y.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]),Y.useEffect(()=>{if(!W)return;let e=!1;return ce(!0),(async()=>{try{let t=await b(W);e||w(t)}catch{}finally{e||ce(!1)}})(),()=>{e=!0}},[W]);let Ae=f((e,t)=>{u(n=>n.map(n=>n.id===e?{...n,...t}:n))}),je=f(e=>{u(t=>t.filter(t=>t.id!==e))}),Me=f(()=>{u(e=>[...e,{id:Fe(),prompt:``,models:[]}])}),Pe=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){O.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)});v(t=>[...t,{id:Fe(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),O.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&O.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),N.current&&(N.current.value=``)},Ie=e=>{v(t=>t.filter(t=>t.id!==e))},$=Y.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&&!($<1)){S(!0),ke();try{z&&z!==I&&de(z);let e=g.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:s.trim(),groups:i,agent:d||void 0,worktreeBaseBranch:Z?Se:void 0,isolateRuns:Z,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},o=await De(a);o&&(o.firstSessionId&&E.getState().setCurrentSession(o.firstSessionId),n?.())}finally{S(!1)}}},Re=!!(s.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&$>=1&&fe&&!we&&(X===!1||!Z||Se)),ze=C.filter(e=>e.trim()).length;return(0,Q.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,Q.jsxs)(`header`,{onMouseDown:ye,className:h(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,_e,ve),style:{borderColor:`var(--interactive-border)`},children:[(0,Q.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,Q.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,Q.jsxs)(re,{children:[(0,Q.jsx)(A,{asChild:!0,children:(0,Q.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,Q.jsx)(_,{name:`close`,className:`h-5 w-5`})})}),(0,Q.jsx)(j,{children:(0,Q.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,Q.jsx)(ne,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,Q.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),R.length>0?(0,Q.jsxs)(ge,{value:z??void 0,onValueChange:H,children:[(0,Q.jsx)(he,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:V?(0,Q.jsx)(pe,{children:st(V)}):(0,Q.jsx)(pe,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,Q.jsx)(me,{fitContent:!0,children:R.map(e=>(0,Q.jsx)(U,{value:e.id,className:`max-w-[24rem]`,children:st(e)},e.id))})]}):(0,Q.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`group-name`,required:!0,info:(0,Q.jsx)(at,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,Q.jsx)(L,{id:`group-name`,value:s,onChange:e=>c(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`multirun-worktree-base-branch`,info:(0,Q.jsx)(at,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,Q.jsx)(Xe,{directory:fe,value:Se,onChange:Ce,disabled:!Z,id:`multirun-worktree-base-branch`}),(0,Q.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,Q.jsx)(ue,{checked:le,onChange:M,disabled:!Ee,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,Q.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(ot,{htmlFor:`multirun-agent`,info:(0,Q.jsx)(at,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,Q.jsx)(Ze,{value:d,onChange:p,id:`multirun-agent`})]})]}),(0,Q.jsxs)(se,{open:T,onOpenChange:D,children:[(0,Q.jsxs)(oe,{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,Q.jsx)(_,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,Q.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,Q.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,Q.jsx)(_,{name:`arrow-down-s`,className:h(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,T&&`rotate-180`)})]}),(0,Q.jsx)(ae,{children:(0,Q.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:ee?(0,Q.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,Q.jsxs)(Q.Fragment,{children:[C.map((e,t)=>(0,Q.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,Q.jsx)(L,{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,Q.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,Q.jsx)(_,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,Q.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,Q.jsx)(_,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(ot,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,Q.jsx)(`input`,{ref:N,type:`file`,multiple:!0,className:`hidden`,onChange:Pe,accept:`*/*`}),(0,Q.jsxs)(re,{children:[(0,Q.jsx)(A,{asChild:!0,children:(0,Q.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,Q.jsx)(_,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,Q.jsx)(j,{children:a(`multirun.launcher.attachments.tooltip`)})]}),g.map(e=>(0,Q.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,Q.jsx)(_,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,Q.jsx)(_,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>Ie(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,Q.jsx)(_,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,Q.jsx)(lt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:Ae,onRemove:je},e.id)),(0,Q.jsxs)(`button`,{type:`button`,onClick:Me,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,Q.jsx)(_,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),Oe&&(0,Q.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:Oe})]})})}),(0,Q.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Z&&X!==null?(0,Q.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,Q.jsx)(_,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,Q.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,Q.jsx)(m,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,Q.jsx)(m,{type:`submit`,size:`sm`,disabled:!Re||y,children:y?a(`multirun.launcher.actions.creating`):(0,Q.jsx)(Q.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:$})})})]})})]})},lt=e=>{let t=(0,Se.c)(94),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=te(),[c,l]=Y.useState(!1),[u,d]=Y.useState(``),[p,m]=Y.useState(!1),[h,g]=Y.useState(``),v=Y.useRef(null),y=Y.useRef(null),b=Y.useRef(null),x;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(x=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]=x):x=t[3];let S=f(x),C;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(C=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]=C):C=t[7];let w=f(C),T;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(T=(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]=T):T=t[11];let E=f(T),D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
2
2
  `),i=Math.min(n===-1?e.length:n,r===-1?e.length:r);if(t<=i&&n===-1){g(e.substring(1,i)),m(!0),l(!1);return}}m(!1);let n=e.substring(0,t),r=n.lastIndexOf(`@`);if(r!==-1){let e=r>0?n[r-1]:null,t=n.substring(r+1);(!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
3
3
  `)?(d(t),l(!0)):l(!1);return}l(!1)},t[12]=D):D=t[12];let O=f(D),ee;t[13]!==n.id||t[14]!==a?(ee=e=>{a(n.id,{prompt:e})},t[13]=n.id,t[14]=a,t[15]=ee):ee=t[15];let k=f(ee),ne;t[16]!==n.prompt||t[17]!==k||t[18]!==O?(ne=e=>{let t=n.prompt,r=v.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=v.current;e&&(e.selectionStart=o.caret,e.selectionEnd=o.caret,e.focus()),O(o.text,o.caret)})},t[16]=n.prompt,t[17]=k,t[18]=O,t[19]=ne):ne=t[19];let A=f(ne),j;t[20]!==n.prompt||t[21]!==k||t[22]!==O?(j=e=>{let t=n.prompt,r=v.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=v.current;e&&(e.selectionStart=a.caret,e.selectionEnd=a.caret,e.focus()),O(a.text,a.caret)})},t[20]=n.prompt,t[21]=k,t[22]=O,t[23]=j):j=t[23];let re=f(j),ie;t[24]!==k||t[25]!==O?(ie=e=>{let t=`/${e.name} `;k(t),m(!1),g(``),requestAnimationFrame(()=>{let e=v.current;e&&(e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length),O(t,t.length)})},t[24]=k,t[25]=O,t[26]=ie):ie=t[26];let ae=f(ie),oe;t[27]!==p||t[28]!==c?(oe=e=>{if(p&&b.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)){e.preventDefault(),b.current.handleKeyDown(e.key);return}c&&y.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),y.current.handleKeyDown(e.key))},t[27]=p,t[28]=c,t[29]=oe):oe=t[29];let se=f(oe),le=r+1,M;t[30]!==s||t[31]!==le?(M=s(`multirun.launcher.groups.groupLabel`,{index:le}),t[30]=s,t[31]=le,t[32]=M):M=t[32];let N;t[33]===M?N=t[34]:(N=(0,Q.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:M}),t[33]=M,t[34]=N);let P;t[35]!==i||t[36]!==n.id||t[37]!==o||t[38]!==s?(P=i&&(0,Q.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,Q.jsx)(_,{name:`close`,className:`h-3.5 w-3.5`})}),t[35]=i,t[36]=n.id,t[37]=o,t[38]=s,t[39]=P):P=t[39];let F;t[40]!==N||t[41]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[N,P]}),t[40]=N,t[41]=P,t[42]=F):F=t[42];let I;t[43]===s?I=t[44]:(I=s(`multirun.launcher.groups.prompt.label`),t[43]=s,t[44]=I);let L;t[45]===I?L=t[46]:(L=(0,Q.jsx)(ot,{required:!0,children:I}),t[45]=I,t[46]=L);let ue=n.prompt,B;t[47]!==k||t[48]!==O?(B=e=>{let t=e.target.value;k(t);let n=e.target.selectionStart??t.length;O(t,n)},t[47]=k,t[48]=O,t[49]=B):B=t[49];let V;t[50]===s?V=t[51]:(V=s(`multirun.launcher.groups.prompt.placeholder`),t[50]=s,t[51]=V);let fe;t[52]!==n.prompt||t[53]!==se||t[54]!==B||t[55]!==V?(fe=(0,Q.jsx)(ce,{ref:v,value:ue,onChange:B,onKeyDown:se,placeholder:V,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]=se,t[54]=B,t[55]=V,t[56]=fe):fe=t[56];let H;t[57]!==h||t[58]!==ae||t[59]!==p?(H=p?(0,Q.jsx)(de,{ref:b,searchQuery:h,onCommandSelect:ae,onClose:()=>m(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[57]=h,t[58]=ae,t[59]=p,t[60]=H):H=t[60];let pe;t[61]!==re||t[62]!==A||t[63]!==u||t[64]!==c?(pe=c?(0,Q.jsx)(R,{ref:y,searchQuery:u,onFileSelect:A,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]=A,t[63]=u,t[64]=c,t[65]=pe):pe=t[65];let U;t[66]!==fe||t[67]!==H||t[68]!==pe?(U=(0,Q.jsxs)(`div`,{className:`relative`,children:[fe,H,pe]}),t[66]=fe,t[67]=H,t[68]=pe,t[69]=U):U=t[69];let me;t[70]!==L||t[71]!==U?(me=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[L,U]}),t[70]=L,t[71]=U,t[72]=me):me=t[72];let W;t[73]===s?W=t[74]:(W=s(`multirun.launcher.models.info`,{max:it}),t[73]=s,t[74]=W);let G;t[75]===W?G=t[76]:(G=(0,Q.jsx)(at,{children:W}),t[75]=W,t[76]=G);let he;t[77]===s?he=t[78]:(he=s(`multirun.launcher.models.label`),t[77]=s,t[78]=he);let ge;t[79]!==G||t[80]!==he?(ge=(0,Q.jsx)(ot,{required:!0,info:G,children:he}),t[79]=G,t[80]=he,t[81]=ge):ge=t[81];let K;t[82]!==n.models||t[83]!==S||t[84]!==w||t[85]!==E?(K=(0,Q.jsx)($,{selectedModels:n.models,onAdd:S,onRemove:w,onUpdate:E,minModels:1,maxModels:it}),t[82]=n.models,t[83]=S,t[84]=w,t[85]=E,t[86]=K):K=t[86];let q;t[87]!==ge||t[88]!==K?(q=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[ge,K]}),t[87]=ge,t[88]=K,t[89]=q):q=t[89];let J;return t[90]!==F||t[91]!==me||t[92]!==q?(J=(0,Q.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-3`,children:[F,me,q]}),t[90]=F,t[91]=me,t[92]=q,t[93]=J):J=t[93],J};export{Z as a,Fe as i,Ze as n,Te as o,$ as r,ct as t};
@@ -1 +1 @@
1
- import{n as e}from"./platform-CiUKDeXd.js";import{a as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-s_oc_LRs.js";var r=t(`YuriUpdateConfig`);async function i(){if(!e())throw new n;let t=await r.getConfiguration();if(t.channel!==`stable`&&t.channel!==`beta`||typeof t.shellApiVersion!=`number`||!Number.isInteger(t.shellApiVersion)||t.shellApiVersion<1)throw Error(`Invalid native update configuration`);return{channel:t.channel,shellApiVersion:t.shellApiVersion}}export{i as t};
1
+ import{n as e}from"./platform-CiUKDeXd.js";import{a as t}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{t as n}from"./types-DpcA-uDW.js";var r=t(`YuriUpdateConfig`);async function i(){if(!e())throw new n;let t=await r.getConfiguration();if(t.channel!==`stable`&&t.channel!==`beta`||typeof t.shellApiVersion!=`number`||!Number.isInteger(t.shellApiVersion)||t.shellApiVersion<1)throw Error(`Invalid native update configuration`);return{channel:t.channel,shellApiVersion:t.shellApiVersion}}export{i as t};
@@ -1 +1 @@
1
- import{a as e}from"./mobileBackNavigation-DF_uhF-i.js";var t=(e=>{let t=new Map,n=()=>{let e=0;for(let n of t.values())e+=n;return e};return{hold(r){let i=(t.get(r)??0)+1;t.set(r,i),n()===1&&e.conceal();let a=!1;return()=>{if(a)return;a=!0;let i=(t.get(r)??1)-1;i<=0?t.delete(r):t.set(r,i),n()===0&&e.reveal()}}}})(e),n=new Map,r=e=>t.hold(e),i=e=>{n.has(e)||n.set(e,t.hold(e))},a=e=>{let t=n.get(e);t&&(n.delete(e),t())},o=`btw-page`,s=`btw-sheet`,c=`text-selection`;export{r as a,i,s as n,a as o,c as r,o as t};
1
+ import{a as e}from"./mobileBackNavigation-C94n2eLT.js";var t=(e=>{let t=new Map,n=()=>{let e=0;for(let n of t.values())e+=n;return e};return{hold(r){let i=(t.get(r)??0)+1;t.set(r,i),n()===1&&e.conceal();let a=!1;return()=>{if(a)return;a=!0;let i=(t.get(r)??1)-1;i<=0?t.delete(r):t.set(r,i),n()===0&&e.reveal()}}}})(e),n=new Map,r=e=>t.hold(e),i=e=>{n.has(e)||n.set(e,t.hold(e))},a=e=>{let t=n.get(e);t&&(n.delete(e),t())},o=`btw-page`,s=`btw-sheet`,c=`text-selection`;export{r as a,i,s as n,a as o,c as r,o as t};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/remote-input-store-C6UIEZxp.js","assets/rolldown-runtime-hePW80VL.js","assets/runtime-switch-DEPKHgdL.js","assets/runtime-auth-DA-qfGHk.js","assets/platform-CiUKDeXd.js","assets/runtimeAPIRegistry-C2VogTny.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-zustand-CTekDqaS.js","assets/vendor-base-ui-wXsskyKm.js","assets/prompt-attachment-upload-B5DHrw6U.js","assets/runtime-fetch-V-iMWR8t.js","assets/reasoning-projection-client-BEhVknv9.js","assets/runtime-file-resource-Bc_ss-sW.js","assets/vendor-react-BkccXcWz.js","assets/vendor-tanstack-react-query-DIb_ItL-.js","assets/vendor-tanstack-query-core-BSjXNgF_.js","assets/yuriEvents-BFrD5fMU.js","assets/path-utils-jGozTg9d.js","assets/vendor-reactuses-core-DjKFMfz7.js","assets/vendor-lodash-es-BS45jPoZ.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/vendor-aparajita-capacitor-secure-storage-xol_6BsB.js","assets/runtime-file-store-BVRgEtI-.js","assets/brand-storage-migration-Bhz6UOBJ.js","assets/input-store-BSJBQTMi.js","assets/brand-storage-bootstrap-D4BW3w-M.js","assets/uuid-D-SDZijH.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r}from"./runtime-switch-DEPKHgdL.js";import{P as i}from"./runtime-file-resource-Bc_ss-sW.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Ia as o,Na as s}from"./ui-DrAJTWV6.js";import{i as c,n as l,r as u}from"./remoteProjectQueries-C8382jM8.js";var d=e({applyRemoteProjectRoute:()=>f,seedRemoteProjectDraft:()=>p});async function f(e,a=()=>!0){if(!e.hostId||!e.hubId||!e.directory)throw Error(`Incomplete remote session route`);let d=t(),f=n(),p=r(),m=await l();if(!a())return!1;if(!m.supported||m.hubId!==e.hubId||d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to a different or unsupported Hub`);let h=e.projectId?m.projects.find(t=>t.hostId===e.hostId&&t.id===e.projectId):i(m.projects,m.hubId,e.hostId,e.directory,(await u(c(m),e.hostId)).worktrees);if(!a())return!1;if(d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to an inactive Hub`);if(!h)throw Error(`Remote Project is not referenced by this Hub`);let g={hubId:m.hubId,hostId:h.hostId,directory:e.directory,...e.instanceId||h.instanceId?{instanceId:e.instanceId||h.instanceId}:{}};g.instanceId&&c(m).resolve(g).sdk();let _=s.getState();return _.upsertRemoteProject(h,m.hubId),_.setActiveProjectIdOnly(h.id),o.getState().openRemoteSession(h,g,e.isNewSession?null:e.sessionId),!0}async function p(e,n){let r=t(),{seedRemoteDraft:i}=await a(async()=>{let{seedRemoteDraft:e}=await import(`./remote-input-store-C6UIEZxp.js`).then(e=>e.a);return{seedRemoteDraft:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]));r===t()&&await i(e,n)}export{d as n,p as r,f as t};
2
+ import{n as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r}from"./runtime-switch-DEPKHgdL.js";import{P as i}from"./runtime-file-resource-Bc_ss-sW.js";import{o as a}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{Ia as o,Na as s}from"./ui-ee2iN869.js";import{i as c,n as l,r as u}from"./remoteProjectQueries-C8382jM8.js";var d=e({applyRemoteProjectRoute:()=>f,seedRemoteProjectDraft:()=>p});async function f(e,a=()=>!0){if(!e.hostId||!e.hubId||!e.directory)throw Error(`Incomplete remote session route`);let d=t(),f=n(),p=r(),m=await l();if(!a())return!1;if(!m.supported||m.hubId!==e.hubId||d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to a different or unsupported Hub`);let h=e.projectId?m.projects.find(t=>t.hostId===e.hostId&&t.id===e.projectId):i(m.projects,m.hubId,e.hostId,e.directory,(await u(c(m),e.hostId)).worktrees);if(!a())return!1;if(d!==t()||f!==n()||p!==r())throw Error(`Remote route belongs to an inactive Hub`);if(!h)throw Error(`Remote Project is not referenced by this Hub`);let g={hubId:m.hubId,hostId:h.hostId,directory:e.directory,...e.instanceId||h.instanceId?{instanceId:e.instanceId||h.instanceId}:{}};g.instanceId&&c(m).resolve(g).sdk();let _=s.getState();return _.upsertRemoteProject(h,m.hubId),_.setActiveProjectIdOnly(h.id),o.getState().openRemoteSession(h,g,e.isNewSession?null:e.sessionId),!0}async function p(e,n){let r=t(),{seedRemoteDraft:i}=await a(async()=>{let{seedRemoteDraft:e}=await import(`./remote-input-store-C6UIEZxp.js`).then(e=>e.a);return{seedRemoteDraft:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]));r===t()&&await i(e,n)}export{d as n,p as r,f as t};
@@ -1 +1 @@
1
- import{r as e}from"./useUIStore-C3ewjGgP.js";import{At as t,Ia as n,Na as r}from"./ui-DrAJTWV6.js";import{i,n as a}from"./remoteProjectQueries-C8382jM8.js";function o(i,a,o,s=i.path,c=!1,l){a.assertCurrent(),r.getState().setActiveProjectIdOnly(i.id),n.getState().openRemoteSession(i,{hubId:a.hubId,hostId:i.hostId,directory:s,...i.instanceId?{instanceId:i.instanceId}:{}},o,l),e.getState().setActiveMainTab(`chat`),c&&t.getState().openRemoteProject()}async function s(e,t=!1){let n=await a(),s=n.projects.find(t=>t.id===e.id&&t.hostId===e.hostId&&t.path===e.path);if(!s)throw Error(`Remote project is not registered in the current Hub`);let c=i(n);c.assertCurrent(),r.getState().upsertRemoteProject(s,n.hubId),o(s,c,null,s.path,t)}export{o as n,s as t};
1
+ import{r as e}from"./useUIStore-C3ewjGgP.js";import{At as t,Ia as n,Na as r}from"./ui-ee2iN869.js";import{i,n as a}from"./remoteProjectQueries-C8382jM8.js";function o(i,a,o,s=i.path,c=!1,l){a.assertCurrent(),r.getState().setActiveProjectIdOnly(i.id),n.getState().openRemoteSession(i,{hubId:a.hubId,hostId:i.hostId,directory:s,...i.instanceId?{instanceId:i.instanceId}:{}},o,l),e.getState().setActiveMainTab(`chat`),c&&t.getState().openRemoteProject()}async function s(e,t=!1){let n=await a(),s=n.projects.find(t=>t.id===e.id&&t.hostId===e.hostId&&t.path===e.path);if(!s)throw Error(`Remote project is not registered in the current Hub`);let c=i(n);c.assertCurrent(),r.getState().upsertRemoteProject(s,n.hubId),o(s,c,null,s.path,t)}export{o as n,s as t};