@openchambery/web 1.18.2-beta.27 → 1.18.2-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AssistantView-Coj_BqNe.js +1 -0
- package/dist/assets/{ChatContainer-MbXH0_9-.js → ChatContainer-rXg0ZK5d.js} +23 -23
- package/dist/assets/{DiagramView-ot0ecLsz.js → DiagramView-CmN3auk-.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl-C64z6iQo.js → MarkdownRendererImpl-BdH1ynSb.js} +2 -2
- package/dist/assets/{MobileDetailNavigation-CbNp5lEK.js → MobileDetailNavigation-DpfpKgPu.js} +1 -1
- package/dist/assets/MobileShareBridge-d58Vzm3O.js +4 -0
- package/dist/assets/MobileSurface-S6hr1_7p.js +2 -0
- package/dist/assets/{MultiRunWindow-gR076nZ1.js → MultiRunWindow-C4Ike8AX.js} +1 -1
- package/dist/assets/{OnboardingScreen-CYeRZznl.js → OnboardingScreen-CW21rCqC.js} +1 -1
- package/dist/assets/OverlayScrollbar-BsFmRX3b.js +1 -0
- package/dist/assets/{SettingsView-DPVCp_I9.js → SettingsView-DLxzV2rK.js} +12 -11
- package/dist/assets/{SettingsWindow-DVJ_vexV.js → SettingsWindow-B-iCDv5r.js} +1 -1
- package/dist/assets/{TerminalView-BRJIrylk.js → TerminalView-jsjZJ-hn.js} +1 -1
- package/dist/assets/{ToolOutputDialog-Cfi4K06k.js → ToolOutputDialog-RCrRpjSt.js} +1 -1
- package/dist/assets/appThemeRegistry-CnlbpoIa.js +2 -0
- package/dist/assets/capgoAdapter-LvGrONDp.js +1 -0
- package/dist/assets/{clipboard-BnElHSnO.js → clipboard-ByPKHEt8.js} +1 -1
- package/dist/assets/{context-menu-DOTwr5ee.js → context-menu-CvnY05Eg.js} +1 -1
- package/dist/assets/{dialog-COrLBm9O.js → dialog-CQLvE6F6.js} +1 -1
- package/dist/assets/{es-DIVYdoxi.js → es-ZHyqPb3M.js} +1 -1
- package/dist/assets/{fr-CNTlVypq.js → fr-nXAAl4qu.js} +1 -1
- package/dist/assets/{gitApi-BDGB8ZAu.js → gitApi-itjXkp9E.js} +6 -6
- package/dist/assets/insertionBoundaries-BumXctlh.js +1 -0
- package/dist/assets/{ja-C_eW5ZM8.js → ja-CLcxQZ5K.js} +1 -1
- package/dist/assets/{ko-CE3cOv7v.js → ko-KgjBt0nP.js} +1 -1
- package/dist/assets/main-BWyu53zj.js +172 -0
- package/dist/assets/main-Drfmhboy.js +2 -0
- package/dist/assets/miniChat-CC3awYO5.js +2 -0
- package/dist/assets/mobile-DbOR4vtC.js +2 -0
- package/dist/assets/multirun-CrlXzIhD.js +4 -0
- package/dist/assets/{pl-BZKZOE99.js → pl-ZJkD7N-8.js} +1 -1
- package/dist/assets/platform-G8Cxe5wN.js +2 -0
- package/dist/assets/{projectMeta-DSKfl_Jm.js → projectMeta-C-VsUy14.js} +1 -1
- package/dist/assets/{pt-BR-DHDgp8S3.js → pt-BR-B6nleSMM.js} +1 -1
- package/dist/assets/{radio-BNJ2-y1d.js → radio-CaoU7Lu-.js} +1 -1
- package/dist/assets/renderElectronMiniChatApp-BX-vxTMr.js +2 -0
- package/dist/assets/renderMobileApp-CSH0JwGO.js +23 -0
- package/dist/assets/runtimeConfig-D6Btfpc2.js +2 -0
- package/dist/assets/runtimeEndpointReset-DfILEKXr.js +145 -0
- package/dist/assets/{sortable-tabs-strip-A9XB-XsC.js → sortable-tabs-strip-DULPi5Jt.js} +1 -1
- package/dist/assets/{src-7UHu0sNZ.css → src-F6gEZAFJ.css} +1 -1
- package/dist/assets/{store-CUWqzRt7.js → store-BDxgw-Hx.js} +2 -2
- package/dist/assets/terminalApi-os4uWEou.js +1 -0
- package/dist/assets/types-BuiqMmh_.js +1 -0
- package/dist/assets/{uk-CfQK6cz1.js → uk-KTDMzdyl.js} +1 -1
- package/dist/assets/{useAppFontEffects-D357X5CO.js → useAppFontEffects-DGq7jjOF.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-COoaoLe8.js → useDesktopWindowControlsLayout-DzesmOSh.js} +1 -1
- package/dist/assets/useEffectiveDirectory-BR3d8iyN.js +1 -0
- package/dist/assets/{useFontPreferences-92Qg-98H.js → useFontPreferences-B2QwnhAp.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-B1PyYZet.js → useMobileNavigationStore-BSreVaq2.js} +11 -11
- package/dist/assets/useSessionAutoCleanup-BNXZ_4Tj.js +1 -0
- package/dist/assets/{useWorkerHighlightedLines-1ioGRcL8.js → useWorkerHighlightedLines-BCqkyru3.js} +1 -1
- package/dist/assets/{zh-CN-DvY2fKWp.js → zh-CN-BilLDIh_.js} +1 -1
- package/dist/assets/{zh-TW-eWe0lm3-.js → zh-TW-DBDsyRLQ.js} +1 -1
- package/dist/index.html +7 -5
- package/dist/mini-chat.html +7 -5
- package/dist/mobile.html +7 -5
- package/package.json +1 -1
- package/dist/assets/AssistantView-CYHGrhVg.js +0 -1
- package/dist/assets/MobileShareBridge-DOn-hxzP.js +0 -4
- package/dist/assets/MobileSurface-CeZhl-lw.js +0 -2
- package/dist/assets/OverlayScrollbar-BMacFRhB.js +0 -1
- package/dist/assets/appThemeRegistry-qxM2cfNQ.js +0 -2
- package/dist/assets/gitApiHttp-BxGAFLTf.js +0 -2
- package/dist/assets/insertionBoundaries-CleTjJ9-.js +0 -1
- package/dist/assets/main-D7RyTbS_.js +0 -2
- package/dist/assets/main-NcWTs_u-.js +0 -172
- package/dist/assets/miniChat-BW298aAZ.js +0 -2
- package/dist/assets/mobile-ClbnzzLq.js +0 -2
- package/dist/assets/multirun-BUYZ43vi.js +0 -4
- package/dist/assets/renderElectronMiniChatApp-rtopJsrU.js +0 -2
- package/dist/assets/renderMobileApp-MHbwmExD.js +0 -23
- package/dist/assets/runtimeConfig-BXCt7ZsQ.js +0 -1
- package/dist/assets/runtimeEndpointReset-D6GYnoPP.js +0 -145
- package/dist/assets/terminalApi-DpiAJlil.js +0 -1
- package/dist/assets/useEffectiveDirectory-f6pNNjRH.js +0 -1
- package/dist/assets/useSessionAutoCleanup-hkAbHGAN.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderElectronMiniChatApp-rtopJsrU.js","assets/rolldown-runtime-C0FnF6B9.js","assets/useUIStore-5agS8bsW.js","assets/vendor-zustand-B4dlGEM2.js","assets/vendor-base-ui-CnHfUmDN.js","assets/persistence-D1lIuyqO.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/gitApiHttp-BxGAFLTf.js","assets/vendor-opencode-sdk-C07HQypa.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/vendor-reactuses-core-DDoDDyM9.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/clipboard-BnElHSnO.js","assets/store-CUWqzRt7.js","assets/useMobileNavigationStore-B1PyYZet.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/vendor-sonner-DVzioF3d.js","assets/useAssistantUIStore-Bq3cPj2x.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/utils-BxJEIWv5.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/Icon-DiIuWOuC.js","assets/button-DaAoVF4X.js","assets/useAppFontEffects-D357X5CO.js","assets/desktopHosts-ZK_vkdzL.js","assets/desktopRelayRestore-CewM6-g5.js","assets/dialog-COrLBm9O.js","assets/gitApi-BDGB8ZAu.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/projectMeta-DSKfl_Jm.js","assets/input-XiL2-2gG.js","assets/tooltip-BLugzWq-.js","assets/OverlayScrollbar-BMacFRhB.js","assets/vendor-dnd-kit-core-CvWxUPdb.js","assets/vendor-dnd-kit-accessibility-BY5LhhUB.js","assets/vendor-dnd-kit-sortable-hHdP9lLb.js","assets/useSessionAutoCleanup-hkAbHGAN.js","assets/radio-BNJ2-y1d.js","assets/vendor-codemirror-autocomplete-DHomsvW7.js","assets/vendor-codemirror-lang-angular-DShkBD6m.js","assets/vendor-codemirror-lang-json-CYJRHck9.js","assets/vendor-codemirror-lang-markdown-WORgx6ZD.js","assets/vendor-codemirror-lang-python-Du6XQ8Zw.js","assets/vendor-codemirror-legacy-modes-DuRAjNvB.js","assets/AgentAvatar-B4fj9PIe.js","assets/useThemeSystem-DMzWVJaW.js","assets/vendor-codemirror-language-data-BfYFhIH1.js","assets/markdownTheme-D-aLQZaM.js","assets/vendor-pierre-diffs-BenIz2TM.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/ChatContainer-MbXH0_9-.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/appThemeRegistry-qxM2cfNQ.js","assets/markdown-worker-BDyY0vt6.js","assets/url-DMs_PgIC.js","assets/useEffectiveDirectory-f6pNNjRH.js","assets/FadeInOnReveal-CKKU6fKI.js","assets/insertionBoundaries-CleTjJ9-.js","assets/useWorkerHighlightedLines-1ioGRcL8.js","assets/vendor-tanstack-react-virtual-tlDgH6PG.js","assets/vendor-cmdk-CeAGfrLo.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-A9XB-XsC.js","assets/vendor-framer-motion-DFy_BSVd.js","assets/useFontPreferences-92Qg-98H.js","assets/terminalApi-DpiAJlil.js","assets/useDesktopWindowControlsLayout-COoaoLe8.js","assets/src-7UHu0sNZ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./runtimeConfig-BXCt7ZsQ.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";/* empty css */window.__OPENCHAMBER_RUNTIME_APIS__=e(),t(async()=>{let{renderElectronMiniChatApp:e}=await import(`./renderElectronMiniChatApp-rtopJsrU.js`);return{renderElectronMiniChatApp:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79])).then(({renderElectronMiniChatApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??e())});
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/renderMobileApp-MHbwmExD.js","assets/rolldown-runtime-C0FnF6B9.js","assets/useUIStore-5agS8bsW.js","assets/vendor-zustand-B4dlGEM2.js","assets/vendor-base-ui-CnHfUmDN.js","assets/persistence-D1lIuyqO.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/gitApiHttp-BxGAFLTf.js","assets/vendor-opencode-sdk-C07HQypa.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/vendor-sonner-DVzioF3d.js","assets/vendor-reactuses-core-DDoDDyM9.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/clipboard-BnElHSnO.js","assets/store-CUWqzRt7.js","assets/useMobileNavigationStore-B1PyYZet.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/useAssistantUIStore-Bq3cPj2x.js","assets/vendor-fuse.js-DB5wDJbI.js","assets/MobileShareBridge-DOn-hxzP.js","assets/desktopHosts-ZK_vkdzL.js","assets/desktopRelayRestore-CewM6-g5.js","assets/MobileDetailNavigation-CbNp5lEK.js","assets/utils-BxJEIWv5.js","assets/vendor-class-variance-authority-BLUaYARZ.js","assets/vendor-tailwind-merge-BicNWLTg.js","assets/Icon-DiIuWOuC.js","assets/button-DaAoVF4X.js","assets/AgentAvatar-B4fj9PIe.js","assets/dialog-COrLBm9O.js","assets/gitApi-BDGB8ZAu.js","assets/useAppFontEffects-D357X5CO.js","assets/vendor-simplewebauthn-browser-Dwhcdg_5.js","assets/projectMeta-DSKfl_Jm.js","assets/input-XiL2-2gG.js","assets/tooltip-BLugzWq-.js","assets/OverlayScrollbar-BMacFRhB.js","assets/vendor-dnd-kit-core-CvWxUPdb.js","assets/vendor-dnd-kit-accessibility-BY5LhhUB.js","assets/vendor-dnd-kit-sortable-hHdP9lLb.js","assets/useSessionAutoCleanup-hkAbHGAN.js","assets/radio-BNJ2-y1d.js","assets/vendor-codemirror-autocomplete-DHomsvW7.js","assets/vendor-codemirror-lang-angular-DShkBD6m.js","assets/vendor-codemirror-lang-json-CYJRHck9.js","assets/vendor-codemirror-lang-markdown-WORgx6ZD.js","assets/vendor-codemirror-lang-python-Du6XQ8Zw.js","assets/vendor-codemirror-legacy-modes-DuRAjNvB.js","assets/useThemeSystem-DMzWVJaW.js","assets/vendor-codemirror-language-data-BfYFhIH1.js","assets/markdownTheme-D-aLQZaM.js","assets/vendor-pierre-diffs-BenIz2TM.js","assets/vendor-hast-util-to-html-B0p1k5Xa.js","assets/vendor-character-entities-legacy-Wut6vMuj.js","assets/vendor-character-entities-html4-DlN_yAFd.js","assets/vendor-ccount-CyGsA0u7.js","assets/vendor-comma-separated-tokens-B9ouxNNS.js","assets/vendor-oniguruma-to-es-CrHzjjSU.js","assets/vendor-oniguruma-parser-D2DIvhSP.js","assets/vendor-diff-Dq7CZNim.js","assets/vendor-lru_map-DpDied8H.js","assets/ChatContainer-MbXH0_9-.js","assets/useRuntimeAPIs-DSLXJybW.js","assets/appThemeRegistry-qxM2cfNQ.js","assets/markdown-worker-BDyY0vt6.js","assets/url-DMs_PgIC.js","assets/useEffectiveDirectory-f6pNNjRH.js","assets/FadeInOnReveal-CKKU6fKI.js","assets/insertionBoundaries-CleTjJ9-.js","assets/useWorkerHighlightedLines-1ioGRcL8.js","assets/vendor-tanstack-react-virtual-tlDgH6PG.js","assets/vendor-cmdk-CeAGfrLo.js","assets/vendor-aria-hidden-BbL3cEyI.js","assets/sortable-tabs-strip-A9XB-XsC.js","assets/vendor-framer-motion-DFy_BSVd.js","assets/useFontPreferences-92Qg-98H.js","assets/terminalApi-DpiAJlil.js","assets/MobileSurface-CeZhl-lw.js","assets/collapsible-BmuQu0dq.js","assets/vendor-codemirror-commands-C9DCaJ0C.js","assets/vendor-codemirror-search-D2SOgzph.js","assets/vendor-replit-codemirror-vim-CEibx3EP.js","assets/projectActions-CWvNGKfA.js","assets/runtimeEndpointReset-D6GYnoPP.js","assets/context-menu-DOTwr5ee.js","assets/vendor-cron-parser-CCD11YFT.js","assets/SettingsView-DPVCp_I9.js","assets/vendor-yaml-DIcAK3EC.js","assets/vendor-qrcode-DAuVxiQR.js","assets/vendor-dijkstrajs-DztKuCwY.js","assets/AssistantView-CYHGrhVg.js","assets/fileQueries-CmWYnRVz.js","assets/src-7UHu0sNZ.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./runtimeConfig-BXCt7ZsQ.js";import{o as t}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";/* empty css */window.__OPENCHAMBER_RUNTIME_APIS__=e(),t(async()=>{let{renderMobileApp:e}=await import(`./renderMobileApp-MHbwmExD.js`);return{renderMobileApp:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95])).then(({renderMobileApp:t})=>{t(window.__OPENCHAMBER_RUNTIME_APIS__??e())});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./useUIStore-5agS8bsW.js";import{Xt as n}from"./persistence-D1lIuyqO.js";import{a as r,r as i}from"./vendor-zustand-B4dlGEM2.js";import{nt as a,rt as o}from"./vendor-base-ui-CnHfUmDN.js";import{kt as s,yt as c}from"./gitApiHttp-BxGAFLTf.js";import{n as l}from"./vendor-react-DLPElpoQ.js";import{n as u}from"./vendor-reactuses-core-DDoDDyM9.js";import{l as d,n as f}from"./clipboard-BnElHSnO.js";import{$i as p,Ba as m,Ha as h,In as g,Ln as _,Wn as v,Xi as y,c as b,er as x,go as S,hr as C,l as w,ra as T,vr as E}from"./useMobileNavigationStore-B1PyYZet.js";import{n as D,t as ee}from"./utils-BxJEIWv5.js";import{n as O}from"./Icon-DiIuWOuC.js";import{t as te}from"./button-DaAoVF4X.js";import{n as ne}from"./gitApi-BDGB8ZAu.js";import{C as re,M as ie,N as k,O as ae,S as A,_ as j,a as oe,b as se,g as ce,h as le,i as M,j as ue,k as de,n as N,o as P,p as F,v as fe,x as pe,y as I}from"./projectMeta-DSKfl_Jm.js";import{t as L}from"./input-XiL2-2gG.js";import{i as R,n as me,t as z}from"./tooltip-BLugzWq-.js";import{o as he}from"./OverlayScrollbar-BMacFRhB.js";import{n as B}from"./useRuntimeAPIs-DSLXJybW.js";import{E as ge,T as _e,a as V,b as H,c as ve,g as U,k as ye,l as W,m as G,o as K,p as q,r as be,x as J}from"./insertionBoundaries-CleTjJ9-.js";import{n as Y,r as xe,t as Se}from"./collapsible-BmuQu0dq.js";var X=e(o(),1),Ce=l(),Z=/^[a-z0-9](?:[a-z0-9-]{0,48}[a-z0-9])?$/,Q=/^g[1-9]\d*$/,we=(e,t,n,r,i)=>{if(!Z.test(e)||t!==void 0&&!Q.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 we(n,void 0,t[1],t[2],void 0);if(t.length===4){let[,e,r,i]=t;return Q.test(e)?we(n,e,r,i,void 0):we(n,void 0,e,r,i)}let[,r,i,a,o]=t;return r===``?we(n,void 0,i,a,o):we(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(`/`)},De=(e,t,n,r)=>{let i=[e];return r&&i.push(r),i.push(t,n,`fusion`),i.join(`/`)},Oe=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).substring(0,50),ke=(e,t)=>`${Oe(e)}-${Oe(t)}`.substring(0,60),Ae=(e,t)=>`${e}/${t}`,je=e=>{let t=e.replace(/\\/g,`/`);return t===`/`?`/`:t.length>1?t.replace(/\/+$/,``):t},Me=(e,t)=>{let n=je(t),r=e.directory,i=typeof r==`string`&&r.trim().length>0?e:{...e,directory:n};T(e.id,n),w.getState().markSessionAsOpenChamberCreated(e.id),C.getState().upsertSession(i);try{p().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},Ne=()=>{let e=S.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=c.getState().currentDirectory??null;if(r&&r.trim().length>0){let e=r.replace(/\\/g,`/`).replace(/\/+$/,``)||r;return{id:`path:${e}`,path:e}}return null},Pe=r()(i(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 c=Ne();if(!c)return e({error:`Select a project`,isLoading:!1}),null;let l=c.path,u=await ne(l)&&t.isolateRuns!==!1,d=Oe(n),f=u?await F(l):void 0,p=u?await W(l):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}`,v=a.get(n)||1,y=(o.get(n)||0)+1;o.set(n,y);let b=ke(g.providerID,g.modelID),S=r.length>1?`g${e+1}`:void 0,C=v>1?Ae(d,`${b}/${y}`):Ae(d,b),T=S?`${S}/${C}`:C,E=Ee({groupSlug:d,runGroup:S,providerID:g.providerID,modelID:g.modelID,index:v>1?y:void 0});try{if(!u){let e=await s.withDirectory(l,()=>s.createSession({title:E}));Me(e,l),m.push({sessionId:e.id,worktreePath:l,providerID:g.providerID,modelID:g.modelID,variant:g.variant,prompt:i});continue}let e=await ve(c,{preferredName:T,mode:`new`,branchName:T,worktreeName:T,startRef:t.worktreeBaseBranch||`HEAD`,setupCommands:h,returnAfterDirectoryCreated:!0},{resolvedRootTrackingRemote:p}),n={...e,createdFromBranch:f,kind:`standard`};await _(c)&&await x(e.path);let r=await s.withDirectory(e.path,()=>s.createSession({title:E}));Me(r,e.path),w.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&&v(c,g).catch(()=>{console.warn(`[MultiRun] Failed to save worktree setup commands`)});let y=m.map(e=>e.sessionId),S=m[0]?.sessionId??null;if(y.length===0)return e({error:`Failed to create any sessions`,isLoading:!1}),null;let C=a?.map(e=>({type:`file`,mime:e.mime,filename:e.filename,url:e.url}));return(async()=>{try{let e=ie.getState().expandText;await Promise.allSettled(m.map(async t=>{try{let n=await e(t.prompt).catch(()=>t.prompt);await b({sessionId:t.sessionId,directory:t.worktreePath,content:n,providerID:t.providerID,modelID:t.modelID,variant:t.variant,agent:i,files:C})}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:y,firstSessionId:S}}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`})),$=a(),Fe=`h-7`,Ie=()=>`${Date.now()}-${Math.random().toString(36).substring(2,9)}`,Le=e=>{let t=(0,Ce.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=ee(`flex items-center gap-1.5 px-2 rounded-md bg-interactive-selection/20 border border-border/30`,Fe),t[0]=c):c=t[0];let l;t[1]!==n.modelID||t[2]!==n.providerID?(l=(0,$.jsx)(de,{modelId:n.modelID,providerId:n.providerID,className:`h-3.5 w-3.5`}),t[1]=n.modelID,t[2]=n.providerID,t[3]=l):l=t[3];let u;t[4]===s?u=t[5]:(u=(0,$.jsx)(`span`,{className:`typography-meta font-medium truncate max-w-[140px]`,children:s}),t[4]=s,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`}),t[6]=d):d=t[6];let f;t[7]===a?f=t[8]:(f=(0,$.jsx)(`button`,{type:`button`,onClick:a,className:`text-muted-foreground hover:text-foreground ml-0.5`,children:d}),t[7]=a,t[8]=f);let p;return t[9]!==l||t[10]!==u||t[11]!==f?(p=(0,$.jsxs)(`div`,{className:c,children:[l,u,f]}),t[9]=l,t[10]=u,t[11]=f,t[12]=p):p=t[12],p},Re=e=>{let n=(0,Ce.c)(131),{selectedModels:r,onAdd:i,onRemove:a,onUpdate:o,minModels:s,addButtonLabel:c,showChips:l,maxModels:u,addButtonClassName:d,dropdownSide:p,dropdownClassName:m,containerClassName:g,triggerIcon:_}=e,v=l===void 0||l,b=p===void 0?`top`:p,{t:x}=f(),S=y(ze),C=y(Be),w=t(Ve),T=t(He),{favoriteModelsList:E,recentModelsList:D}=ae(),ne=t(Ue),ie=t(We),[k,j]=X.useState(!1),[oe,se]=X.useState(``),[M,ue]=X.useState(null),de=X.useRef(null),N=X.useRef(null),P=u===1,F=u===void 0||r.length<u||P,I;if(n[0]!==r){I=new Map;for(let e of r){let t=`${e.providerID}:${e.modelID}`;I.set(t,(I.get(t)||0)+1)}n[0]=r,n[1]=I}else I=n[1];let L=I,R;n[2]===r?R=n[3]:(R=e=>r.filter(t=>t.providerID===e.providerID&&t.modelID===e.modelID).findIndex(t=>t.instanceId===e.instanceId)+1,n[2]=r,n[3]=R);let me=R,z,he;n[4]!==b||n[5]!==k?(z=()=>{if(!k||!N.current)return;let e=N.current.getBoundingClientRect();if(b===`bottom`){let t=(window.visualViewport?.height??document.documentElement.clientHeight??window.innerHeight)-e.bottom-16-112;ue(Math.max(160,Math.min(320,t)));return}let t=N.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;ue(Math.max(150,Math.min(300,r)))},he=[b,k],n[4]=b,n[5]=k,n[6]=z,n[7]=he):(z=n[6],he=n[7]),X.useEffect(z,he);let B,ge;n[8]!==F||n[9]!==k?(B=()=>{!F&&k&&(j(!1),se(``))},ge=[F,k],n[8]=F,n[9]=k,n[10]=B,n[11]=ge):(B=n[10],ge=n[11]),X.useEffect(B,ge);let _e,V;n[12]===k?(_e=n[13],V=n[14]):(_e=()=>{if(!k)return;let e=e=>{de.current&&!de.current.contains(e.target)&&(j(!1),se(``))};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},V=[k],n[12]=k,n[13]=_e,n[14]=V),X.useEffect(_e,V);let H;n[15]!==P||n[16]!==i||n[17]!==o||n[18]!==r.length?(H=e=>{let t={providerID:e.providerID,modelID:e.modelID,displayName:h(e.model,e.modelID)||e.modelID,instanceId:Ie()};P&&r.length>0&&o?o(0,t):i(t),P&&(j(!1),se(``))},n[15]=P,n[16]=i,n[17]=o,n[18]=r.length,n[19]=H):H=n[19];let ve=H,U;n[20]===x?U=n[21]:(U=x(`multirun.modelMultiSelect.search.placeholder`),n[20]=x,n[21]=U);let ye;n[22]===x?ye=n[23]:(ye=x(`multirun.modelMultiSelect.search.noResults`),n[22]=x,n[23]=ye);let W;n[24]===x?W=n[25]:(W=x(`multirun.modelMultiSelect.sections.favorites`),n[24]=x,n[25]=W);let G;n[26]===x?G=n[27]:(G=x(`multirun.modelMultiSelect.sections.recent`),n[26]=x,n[27]=G);let K;n[28]===x?K=n[29]:(K=x(`multirun.modelMultiSelect.keyboard.hint`),n[28]=x,n[29]=K);let q;n[30]===x?q=n[31]:(q=x(`settings.agents.modelSelector.actions.favorite`),n[30]=x,n[31]=q);let be;n[32]===x?be=n[33]:(be=x(`settings.agents.modelSelector.actions.unfavorite`),n[32]=x,n[33]=be);let J;n[34]===x?J=n[35]:(J=x(`chat.modelControls.provider`),n[34]=x,n[35]=J);let Y;n[36]===x?Y=n[37]:(Y=x(`chat.modelControls.capabilities`),n[36]=x,n[37]=Y);let xe;n[38]===x?xe=n[39]:(xe=x(`chat.modelControls.capability.toolCalling`),n[38]=x,n[39]=xe);let Se;n[40]===x?Se=n[41]:(Se=x(`chat.modelControls.capability.reasoning`),n[40]=x,n[41]=Se);let Z;n[42]===x?Z=n[43]:(Z=x(`chat.modelControls.modality.image`),n[42]=x,n[43]=Z);let Q;n[44]===x?Q=n[45]:(Q=x(`chat.modelControls.modality.video`),n[44]=x,n[45]=Q);let we;n[46]===x?we=n[47]:(we=x(`chat.modelControls.modality.audio`),n[46]=x,n[47]=we);let Te;n[48]===x?Te=n[49]:(Te=x(`chat.modelControls.costPerMillion`),n[48]=x,n[49]=Te);let Ee;n[50]===x?Ee=n[51]:(Ee=x(`chat.modelControls.costInput`),n[50]=x,n[51]=Ee);let De;n[52]===x?De=n[53]:(De=x(`chat.modelControls.costOutput`),n[52]=x,n[53]=De);let Oe;n[54]!==U||n[55]!==ye||n[56]!==W||n[57]!==G||n[58]!==K||n[59]!==q||n[60]!==be||n[61]!==J||n[62]!==Y||n[63]!==xe||n[64]!==Se||n[65]!==Z||n[66]!==Q||n[67]!==we||n[68]!==Te||n[69]!==Ee||n[70]!==De?(Oe={searchPlaceholder:U,noResults:ye,favorites:W,recent:G,keyboardHint:K,favorite:q,unfavorite:be,provider:J,capabilities:Y,capabilityToolCalling:xe,capabilityReasoning:Se,modalityImage:Z,modalityVideo:Q,modalityAudio:we,costPerMillion:Te,costInput:Ee,costOutput:De},n[54]=U,n[55]=ye,n[56]=W,n[57]=G,n[58]=K,n[59]=q,n[60]=be,n[61]=J,n[62]=Y,n[63]=xe,n[64]=Se,n[65]=Z,n[66]=Q,n[67]=we,n[68]=Te,n[69]=Ee,n[70]=De,n[71]=Oe):Oe=n[71];let ke=Oe,Ae;n[72]===g?Ae=n[73]:(Ae=ee(`relative`,g),n[72]=g,n[73]=Ae);let je;n[74]===d?je=n[75]:(je=ee(Fe,`!border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70`,d),n[74]=d,n[75]=je);let Me=!F,Ne;n[76]===k?Ne=n[77]:(Ne=()=>{j(!k)},n[76]=k,n[77]=Ne);let Pe;n[78]===_?Pe=n[79]:(Pe=_??(0,$.jsx)(O,{name:`add`,className:`h-3.5 w-3.5 mr-1`}),n[78]=_,n[79]=Pe);let Re;n[80]!==c||n[81]!==x?(Re=c??x(`multirun.modelMultiSelect.actions.addModel`),n[80]=c,n[81]=x,n[82]=Re):Re=n[82];let Ke;n[83]!==je||n[84]!==Me||n[85]!==Ne||n[86]!==Pe||n[87]!==Re?(Ke=(0,$.jsxs)(te,{ref:N,type:`button`,variant:`outline`,size:`sm`,className:je,disabled:Me,onClick:Ne,children:[Pe,Re]}),n[83]=je,n[84]=Me,n[85]=Ne,n[86]=Pe,n[87]=Re,n[88]=Ke):Ke=n[88];let qe;n[89]!==M||n[90]!==F||n[91]!==m||n[92]!==b||n[93]!==E||n[94]!==C||n[95]!==ve||n[96]!==ne||n[97]!==T||n[98]!==k||n[99]!==ke||n[100]!==L||n[101]!==ie||n[102]!==S||n[103]!==D||n[104]!==oe||n[105]!==w?(qe=k?(0,$.jsx)(`div`,{className:ee(`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`,b===`top`?`bottom-full mb-1`:`top-full mt-1`,m),style:{background:`linear-gradient(var(--surface-elevated),var(--surface-elevated)),linear-gradient(var(--surface-background),var(--surface-background))`},children:(0,$.jsx)(re,{providers:S,providerOrder:ie,favoriteModels:E,recentModels:D,getMetadata:C,hiddenModels:ne,searchQuery:oe,onSearchQueryChange:se,onSelect:ve,labels:ke,selectionCount:e=>L.get(`${e.providerID}:${e.modelID}`)||0,disabled:!F,maxHeightClassName:`flex-1`,maxHeightStyle:{maxHeight:M?`${M}px`:`300px`},stickyHeaders:!0,tooltipsEnabled:k,isFavorite:e=>T(e.providerID,e.modelID),onToggleFavorite:e=>w(e.providerID,e.modelID),onEscape:()=>{j(!1),se(``)}})}):null,n[89]=M,n[90]=F,n[91]=m,n[92]=b,n[93]=E,n[94]=C,n[95]=ve,n[96]=ne,n[97]=T,n[98]=k,n[99]=ke,n[100]=L,n[101]=ie,n[102]=S,n[103]=D,n[104]=oe,n[105]=w,n[106]=qe):qe=n[106];let Je;n[107]!==Ae||n[108]!==Ke||n[109]!==qe?(Je=(0,$.jsxs)(`div`,{className:Ae,ref:de,children:[Ke,qe]}),n[107]=Ae,n[108]=Ke,n[109]=qe,n[110]=Je):Je=n[110];let Ye;n[111]!==me||n[112]!==L||n[113]!==a||n[114]!==o||n[115]!==S||n[116]!==r||n[117]!==v||n[118]!==x?(Ye=v&&r.length>0&&(0,$.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,children:r.map((e,t)=>{let n=`${e.providerID}:${e.modelID}`,r=L.get(n)||1,i=me(e),s=S.find(t=>t.id===e.providerID)?.models?.find(t=>t.id===e.modelID),c=s?.variants?Object.keys(s.variants):[],l=c.length>0,u=e.variant??`__default__`;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(Le,{model:e,instanceIndex:i,totalSameModel:r,onRemove:()=>a(t)}),l&&(0,$.jsxs)(le,{value:u,onValueChange:n=>{if(!o)return;let r=n===`__default__`?void 0:n;o(t,{...e,variant:r})},children:[(0,$.jsxs)(pe,{size:`chip`,className:`px-2 gap-1.5 rounded-md !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 typography-meta font-medium text-foreground`,children:[(0,$.jsx)(O,{name:`brain-ai-3`,className:ee(`h-3.5 w-3.5 flex-shrink-0`,u===`__default__`?`text-muted-foreground`:`text-[color:var(--status-info)]`)}),(0,$.jsx)(A,{placeholder:x(`multirun.modelMultiSelect.variant.placeholder`),children:e=>e===`__default__`?x(`multirun.modelMultiSelect.variant.default`):e})]}),(0,$.jsxs)(ce,{fitContent:!0,children:[(0,$.jsx)(fe,{value:`__default__`,className:`pr-2 [&>span:first-child]:hidden`,children:x(`multirun.modelMultiSelect.variant.default`)}),c.map(Ge)]})]})]},e.instanceId)})}),n[111]=me,n[112]=L,n[113]=a,n[114]=o,n[115]=S,n[116]=r,n[117]=v,n[118]=x,n[119]=Ye):Ye=n[119];let Xe;n[120]!==Je||n[121]!==Ye?(Xe=(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 items-center`,children:[Je,Ye]}),n[120]=Je,n[121]=Ye,n[122]=Xe):Xe=n[122];let Ze;n[123]!==u||n[124]!==s||n[125]!==r.length||n[126]!==x?(Ze=s!==void 0&&r.length<s&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground`,children:u===void 0?x(`multirun.modelMultiSelect.validation.minOnly`,{min:s}):x(`multirun.modelMultiSelect.validation.minToMax`,{min:s,max:u})}),n[123]=u,n[124]=s,n[125]=r.length,n[126]=x,n[127]=Ze):Ze=n[127];let Qe;return n[128]!==Xe||n[129]!==Ze?(Qe=(0,$.jsxs)(`div`,{className:`space-y-2`,children:[Xe,Ze]}),n[128]=Xe,n[129]=Ze,n[130]=Qe):Qe=n[130],Qe};function ze(e){return e.providers}function Be(e){return e.getModelMetadata}function Ve(e){return e.toggleFavoriteModel}function He(e){return e.isFavoriteModel}function Ue(e){return e.hiddenModels}function We(e){return e.providerOrder}function Ge(e){return(0,$.jsx)(fe,{value:e,className:`pr-2 [&>span:first-child]:hidden`,children:e},e)}function Ke(e){let t=(0,Ce.c)(30),{git:n}=B(),r=q(e),i=J(e),a=U(e),o=G(e),s=H(Ze),c=H(Xe),l,u;t[0]!==e||t[1]!==c||t[2]!==n||t[3]!==i||t[4]!==a?(l=()=>{!e||!n||i!==null||a||c(e,n,{silent:!0})},u=[e,n,c,i,a],t[0]=e,t[1]=c,t[2]=n,t[3]=i,t[4]=a,t[5]=l,t[6]=u):(l=t[5],u=t[6]),X.useEffect(l,u);let d;t[7]!==r?.all||t[8]!==e||t[9]!==s||t[10]!==n||t[11]!==i?(d=()=>{!e||!n||i===!0&&(r?.all||s(e,n))},t[7]=r?.all,t[8]=e,t[9]=s,t[10]=n,t[11]=i,t[12]=d):d=t[12];let f=r?.all,p;t[13]!==e||t[14]!==s||t[15]!==n||t[16]!==i||t[17]!==f?(p=[e,n,i,f,s],t[13]=e,t[14]=s,t[15]=n,t[16]=i,t[17]=f,t[18]=p):p=t[18],X.useEffect(d,p);let m=a||i===!0&&o,h;bb0:{if(!r?.all){let e;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[19]=e):e=t[19],h=e;break bb0}let e;t[20]===r.all?e=t[21]:(e=r.all.filter(Ye).sort(),t[20]=r.all,t[21]=e),h=e}let g=h,_;bb1:{if(!r?.all){let e;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[22]=e):e=t[22],_=e;break bb1}let e;t[23]===r.all?e=t[24]:(e=r.all.filter(Je).map(qe).sort(),t[23]=r.all,t[24]=e),_=e}let v=_,y;bb2:{if(!e){y=null;break bb2}if(i!==null){y=i;break bb2}if(m){y=null;break bb2}y=r?.all?!0:null}let b=y,x;return t[25]!==b||t[26]!==m||t[27]!==g||t[28]!==v?(x={localBranches:g,remoteBranches:v,isLoading:m,isGitRepository:b},t[25]=b,t[26]=m,t[27]=g,t[28]=v,t[29]=x):x=t[29],x}function qe(e){return e.replace(/^remotes\//,``)}function Je(e){return e.startsWith(`remotes/`)}function Ye(e){return!e.startsWith(`remotes/`)}function Xe(e){return e.fetchStatus}function Ze(e){return e.fetchBranches}var Qe=({directory:e,value:t,onChange:n,className:r,disabled:i,id:a})=>{let{t:o}=f(),{localBranches:s,remoteBranches:c,isLoading:l,isGitRepository:u}=Ke(e),d=X.useMemo(()=>[...s,...c.map(e=>`remotes/${e}`)],[s,c]);return X.useEffect(()=>{if(i||l||d.length===0||t&&d.includes(t))return;let r=t,a=!1;return(async()=>{try{let t=e?await F(e).catch(()=>null):null;if(a)return;let i=localStorage.getItem(V),{sourceBranch:o,shouldClearSavedSourceBranch:s}=K({branches:d,savedSourceBranch:i,rootBranch:t});if(s&&localStorage.removeItem(V),a||r&&d.includes(r))return;o&&n(o)}catch{}})(),()=>{a=!0}},[d,e,i,l,n,t]),(0,$.jsxs)(`div`,{children:[(0,$.jsxs)(le,{value:t,onValueChange:n,disabled:i||!u||l,children:[(0,$.jsx)(pe,{id:a,size:`lg`,className:r??`w-fit typography-meta text-foreground`,children:(0,$.jsx)(A,{placeholder:o(l?`multiRun.branchSelector.status.loadingBranches`:`multiRun.branchSelector.placeholder.selectSourceBranch`)})}),(0,$.jsx)(ce,{className:`max-h-[280px] max-w-[320px]`,children:l?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.loadingBranches`)}):s.length===0&&c.length===0?(0,$.jsx)(`div`,{className:`px-2 py-4 text-center typography-meta text-muted-foreground`,children:o(`multiRun.branchSelector.status.noBranchesFound`)}):(0,$.jsxs)($.Fragment,{children:[s.length>0&&(0,$.jsxs)(j,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.localBranches`)}),s.map(e=>(0,$.jsx)(fe,{value:e,className:`whitespace-normal break-all`,children:e},e))]}),s.length>0&&c.length>0&&(0,$.jsx)(se,{}),c.length>0&&(0,$.jsxs)(j,{children:[(0,$.jsx)(I,{className:`font-semibold text-foreground`,children:o(`multiRun.branchSelector.groups.remoteBranches`)}),c.map(e=>(0,$.jsx)(fe,{value:`remotes/${e}`,className:`whitespace-normal break-all`,children:e},`remotes/${e}`))]})]})})]}),u===!1&&(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground/70 mt-2`,children:o(`multiRun.branchSelector.status.notInGitRepository`)})]})},$e=e=>{let t=(0,Ce.c)(36),{value:n,onChange:r,className:i,disabled:a,id:o,portalToBody:s}=e,{t:c}=f(),l=y(et),u=y(tt),d=y(nt),p;t[0]===l?p=t[1]:(p=l(),t[0]=l,t[1]=p);let m=p,h;t[2]===m?h=t[3]:(h=m.filter(rt),t[2]=m,t[3]=h);let g=h,_,v;t[4]!==m.length||t[5]!==u?(_=()=>{m.length===0&&u()},v=[m.length,u],t[4]=m.length,t[5]=u,t[6]=_,t[7]=v):(_=t[6],v=t[7]),X.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]),X.useEffect(b,x);let S=n.trim().length>0?n:void 0,C;t[15]===i?C=t[16]:(C=ee(`max-w-full typography-meta text-foreground !border-border/80 !bg-[var(--surface-subtle)] hover:!bg-[var(--interactive-hover)]/70 data-[popup-open]:!bg-[var(--interactive-active)]/70`,i),t[15]=i,t[16]=C);let w;t[17]===c?w=t[18]:(w=c(`multirun.agentSelector.placeholder`),t[17]=c,t[18]=w);let T;t[19]===w?T=t[20]:(T=(0,$.jsx)(A,{placeholder:w}),t[19]=w,t[20]=T);let E;t[21]!==o||t[22]!==C||t[23]!==T?(E=(0,$.jsx)(pe,{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,$.jsx)(j,{children:g.map(it)}),t[25]=g,t[26]=D);let O;t[27]!==s||t[28]!==D?(O=(0,$.jsx)(ce,{fitContent:!0,portalToBody:s,children:D}),t[27]=s,t[28]=D,t[29]=O):O=t[29];let te;return t[30]!==a||t[31]!==r||t[32]!==S||t[33]!==E||t[34]!==O?(te=(0,$.jsxs)(le,{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]=te):te=t[35],te};function et(e){return e.getVisibleAgents}function tt(e){return e.loadAgents}function nt(e){return e.currentAgentName}function rt(e){return m(e.mode)}function it(e){return(0,$.jsx)(fe,{value:e.name,className:`w-auto whitespace-nowrap`,children:e.name},e.name)}var at=10485760,ot=5,st=e=>{let t=(0,Ce.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,tabIndex:-1,className:`inline-flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground transition-colors`,children:(0,$.jsx)(O,{name:`information`,className:`h-3.5 w-3.5`})})}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,$.jsxs)(z,{children:[r,(0,$.jsx)(me,{side:`top`,className:`max-w-[240px]`,children:n})]}),t[1]=n,t[2]=i),i},ct=e=>{let t=(0,Ce.c)(9),{htmlFor:n,required:r,children:i,info:a}=e,o;t[0]===r?o=t[1]:(o=r&&(0,$.jsx)(`span`,{className:`text-destructive ml-0.5`,children:`*`}),t[0]=r,t[1]=o);let s;t[2]!==i||t[3]!==n||t[4]!==o?(s=(0,$.jsxs)(`label`,{htmlFor:n,className:`typography-meta font-medium text-foreground`,children:[i,o]}),t[2]=i,t[3]=n,t[4]=o,t[5]=s):s=t[5];let c=a&&a,l;return t[6]!==s||t[7]!==c?(l=(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l},lt=e=>{let t=D(e.path),n=e.icon?M[e.icon]:null,r=e.color?N[e.color]:void 0,i=(0,$.jsx)(O,{name:n??`folder`,className:`h-3.5 w-3.5`,style:r?{color:r}:void 0});return(0,$.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-1.5`,children:[(0,$.jsx)(`span`,{className:`flex h-4 w-4 shrink-0 items-center justify-center overflow-hidden text-muted-foreground`,children:e.iconImage?(0,$.jsx)(oe,{project:e,className:`size-full object-contain`,fallback:i}):i}),(0,$.jsx)(`span`,{className:`truncate`,children:t})]})},ut=({initialPrompt:e,onCreated:t,onCancel:r,isWindowed:i=!1})=>{let{t:a}=f(),[o,s]=X.useState(``),[l,p]=X.useState(()=>[{id:Ie(),prompt:``,models:[]}]),[m,h]=X.useState(``),[_,v]=X.useState([]),[y,b]=X.useState(!1),[x,C]=X.useState([]),[T,D]=X.useState(!1),[ne,re]=X.useState(!1),[ie,ae]=X.useState(!0),j=X.useRef(null),oe=c(e=>e.currentDirectory??null),se=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__VSCODE_CONFIG__?.workspaceFolder;return typeof e==`string`&&e.trim().length>0?e.trim():null},[]),M=S(e=>e.activeProjectId),de=S(e=>e.setActiveProjectIdOnly),N=S(e=>e.projects),[P,F]=X.useState(()=>M??null);X.useEffect(()=>{if(M){F(M);return}!P&&N.length>0&&F(N[0].id)},[M,N,P]);let I=X.useMemo(()=>P?N.find(e=>e.id===P)??null:null,[N,P]),B=I?.path??oe,ge=u(e=>{F(e),e!==M&&de(e)}),_e=X.useMemo(()=>{if(I?.path)return{id:I.id,path:I.path};let e=oe??se;return e?{id:`path:${e}`,path:e}:null},[I,oe,se]),[V]=X.useState(()=>typeof window<`u`&&n()),H=X.useMemo(()=>typeof navigator>`u`?!1:/Macintosh|Mac OS X/.test(navigator.userAgent||``),[]),ve=he(),U=X.useMemo(()=>{if(typeof window>`u`)return null;let e=window.__OPENCHAMBER_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},[]),ye=X.useMemo(()=>V&&H||ve?`pl-[5.5rem]`:`pl-3`,[V,H,ve]),W=X.useMemo(()=>!V||!H||U===null?``:U>=26?`h-12`:U<=15?`h-14`:``,[V,H,U]),G=u(async e=>{e.target.closest(`button, a, input, select, textarea`)||e.button===0&&V&&await d()}),K=u(e=>{r&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),r())}),q=!!r;X.useEffect(()=>{if(q)return window.addEventListener(`keydown`,K,!0),()=>window.removeEventListener(`keydown`,K,!0)},[q]);let[be,J]=X.useState(``),{isLoading:Ce,isGitRepository:Z}=Ke(B),Q=X.useRef(!1),we=Z===!0,Te=we&&ie;X.useEffect(()=>{if(Z===!1){Q.current=!0,ae(!1);return}Z===!0&&Q.current&&(Q.current=!1,ae(!0))},[Z]);let Ee=Pe(e=>e.createMultiRun),De=Pe(e=>e.error),Oe=Pe(e=>e.clearError);X.useEffect(()=>{typeof e==`string`&&e.trim().length>0&&p(t=>{let n=[...t];return n.length>0&&!n[0].prompt.trim()&&(n[0]={...n[0],prompt:e}),n})},[e]),X.useEffect(()=>{if(!_e)return;let e=!1;return re(!0),(async()=>{try{let t=await g(_e);e||C(t)}catch{}finally{e||re(!1)}})(),()=>{e=!0}},[_e]);let ke=u((e,t)=>{p(n=>n.map(n=>n.id===e?{...n,...t}:n))}),Ae=u(e=>{p(t=>t.filter(t=>t.id!==e))}),je=u(()=>{p(e=>[...e,{id:Ie(),prompt:``,models:[]}])}),Me=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>at){E.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:Ie(),filename:r.name,mimeType:r.type||`application/octet-stream`,size:r.size,dataUrl:e}]),n++}catch(e){console.error(`File attach failed`,e),E.error(a(`multirun.launcher.toast.attachFailed`,{fileName:r.name}))}}n>0&&E.success(a(n===1?`multirun.launcher.toast.attachedSingle`:`multirun.launcher.toast.attachedPlural`,{count:n})),j.current&&(j.current.value=``)},Ne=e=>{v(t=>t.filter(t=>t.id!==e))},Fe=X.useMemo(()=>l.reduce((e,t)=>e+t.models.length,0),[l]),Le=async e=>{e.preventDefault();let n=l.filter(e=>e.prompt.trim()&&e.models.length>=1);if(n.length!==0&&!(Fe<1)){b(!0),Oe();try{P&&P!==M&&de(P);let e=_.map(e=>({mime:e.mimeType,filename:e.filename,url:e.dataUrl})),r=x.filter(e=>e.trim().length>0),i=n.map(e=>({prompt:e.prompt.trim(),models:e.models.map(e=>({providerID:e.providerID,modelID:e.modelID,displayName:e.displayName,variant:e.variant}))})),a={name:o.trim(),groups:i,agent:m||void 0,worktreeBaseBranch:Te?be:void 0,isolateRuns:Te,files:e.length>0?e:void 0,setupCommands:r.length>0?r:void 0},s=await Ee(a);s&&(s.firstSessionId&&w.getState().setCurrentSession(s.firstSessionId),t?.())}finally{b(!1)}}},Re=!!(o.trim()&&l.some(e=>e.prompt.trim()&&e.models.length>=1)&&Fe>=1&&B&&!Ce&&(Z===!1||!Te||be)),ze=x.filter(e=>e.trim()).length;return(0,$.jsxs)(`form`,{onSubmit:Le,className:`flex flex-col h-full bg-background`,children:[i?null:(0,$.jsxs)(`header`,{onMouseDown:G,className:ee(`relative flex h-12 shrink-0 items-center justify-center border-b app-region-drag select-none`,ye,W),style:{borderColor:`var(--interactive-border)`},children:[(0,$.jsx)(`h1`,{className:`typography-ui-label font-medium`,children:a(`multirun.launcher.title`)}),r&&(0,$.jsx)(`div`,{className:`absolute right-0 flex items-center pr-3`,children:(0,$.jsxs)(z,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,onClick:r,"aria-label":a(`multirun.launcher.actions.closeEsc`),className:`inline-flex h-9 w-9 items-center justify-center p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary app-region-no-drag`,children:(0,$.jsx)(O,{name:`close`,className:`h-5 w-5`})})}),(0,$.jsx)(me,{children:(0,$.jsx)(`p`,{children:a(`multirun.launcher.actions.closeEsc`)})})]})})]}),(0,$.jsx)(ue,{className:`flex-1 min-h-0 overflow-auto`,size:64,hideTopShadow:!0,children:(0,$.jsx)(`div`,{className:`mx-auto w-full max-w-2xl px-4 sm:px-6 py-5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,$.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-x-4 gap-y-3`,children:[(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-project`,required:!0,children:a(`multirun.launcher.project.label`)}),N.length>0?(0,$.jsxs)(le,{value:P??void 0,onValueChange:ge,children:[(0,$.jsx)(pe,{id:`multirun-project`,size:`lg`,className:`w-fit max-w-full`,children:I?(0,$.jsx)(A,{children:lt(I)}):(0,$.jsx)(A,{placeholder:a(`multirun.launcher.project.placeholder`)})}),(0,$.jsx)(ce,{fitContent:!0,children:N.map(e=>(0,$.jsx)(fe,{value:e.id,className:`max-w-[24rem]`,children:lt(e)},e.id))})]}):(0,$.jsx)(`p`,{className:`typography-micro text-muted-foreground py-2`,children:a(`multirun.launcher.project.empty`)})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`group-name`,required:!0,info:(0,$.jsx)(st,{children:a(`multirun.launcher.groupName.info`)}),children:a(`multirun.launcher.groupName.label`)}),(0,$.jsx)(L,{id:`group-name`,value:o,onChange:e=>s(e.target.value),placeholder:a(`multirun.launcher.groupName.placeholder`),className:`typography-meta w-full`,required:!0})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-worktree-base-branch`,info:(0,$.jsx)(st,{children:a(`multirun.launcher.baseBranch.info`)}),children:a(`multirun.launcher.baseBranch.label`)}),(0,$.jsx)(Qe,{directory:B,value:be,onChange:J,disabled:!Te,id:`multirun-worktree-base-branch`}),(0,$.jsxs)(`label`,{className:`mt-1.5 flex w-fit items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(k,{checked:ie,onChange:ae,disabled:!we,ariaLabel:a(`multirun.launcher.isolateRuns.label`)}),(0,$.jsx)(`span`,{children:a(`multirun.launcher.isolateRuns.label`)})]})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(ct,{htmlFor:`multirun-agent`,info:(0,$.jsx)(st,{children:a(`multirun.launcher.agent.info`)}),children:a(`multirun.launcher.agent.label`)}),(0,$.jsx)($e,{value:m,onChange:h,id:`multirun-agent`})]})]}),(0,$.jsxs)(Se,{open:T,onOpenChange:D,children:[(0,$.jsxs)(xe,{className:`w-full flex items-center gap-2 py-1.5 px-2 -mx-2 rounded-lg hover:bg-[var(--interactive-hover)]/50 transition-colors group`,children:[(0,$.jsx)(O,{name:`terminal`,className:`h-3.5 w-3.5 text-muted-foreground/70`}),(0,$.jsx)(`span`,{className:`typography-meta font-medium text-muted-foreground group-hover:text-foreground transition-colors`,children:a(`multirun.launcher.setupCommands.label`)}),ze>0&&(0,$.jsx)(`span`,{className:`inline-flex items-center justify-center h-4 min-w-4 px-1 rounded-full typography-micro font-medium`,style:{backgroundColor:`var(--primary-base)`,color:`var(--primary-foreground)`,fontSize:`0.625rem`,lineHeight:1},children:ze}),(0,$.jsx)(O,{name:`arrow-down-s`,className:ee(`h-3.5 w-3.5 text-muted-foreground/50 transition-transform duration-200 ml-auto`,T&&`rotate-180`)})]}),(0,$.jsx)(Y,{children:(0,$.jsx)(`div`,{className:`pt-2 space-y-1.5`,children:ne?(0,$.jsx)(`p`,{className:`typography-meta text-muted-foreground/70 px-2`,children:a(`multirun.launcher.setupCommands.loading`)}):(0,$.jsxs)($.Fragment,{children:[x.map((e,t)=>(0,$.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,$.jsx)(L,{value:e,onChange:e=>{let n=[...x];n[t]=e.target.value,C(n)},placeholder:a(`multirun.launcher.setupCommands.commandPlaceholder`),className:`h-8 flex-1 font-mono text-xs`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>C(x.filter((e,n)=>n!==t)),className:`flex-shrink-0 flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50`,"aria-label":a(`multirun.launcher.setupCommands.removeCommandAria`),children:(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`})})]},`${e}-${t}`)),(0,$.jsxs)(`button`,{type:`button`,onClick:()=>C([...x,``]),className:`flex items-center gap-1 typography-meta text-muted-foreground hover:text-foreground transition-colors px-1`,children:[(0,$.jsx)(O,{name:`add`,className:`h-3 w-3`}),a(`multirun.launcher.setupCommands.addCommand`)]})]})})})]}),(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,$.jsx)(ct,{htmlFor:`prompt`,required:!0,children:a(`multirun.launcher.attachments.label`)}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,$.jsx)(`input`,{ref:j,type:`file`,multiple:!0,className:`hidden`,onChange:Me,accept:`*/*`}),(0,$.jsxs)(z,{children:[(0,$.jsx)(R,{asChild:!0,children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>j.current?.click(),className:`inline-flex items-center gap-1 h-6 px-2 rounded-md typography-micro text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(O,{name:`attachment-2`,className:`h-3 w-3`}),a(`multirun.launcher.attachments.attach`)]})}),(0,$.jsx)(me,{children:a(`multirun.launcher.attachments.tooltip`)})]}),_.map(e=>(0,$.jsxs)(`div`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md typography-micro border`,style:{backgroundColor:`var(--surface-elevated)`,borderColor:`var(--interactive-border)`},children:[e.mimeType.startsWith(`image/`)?(0,$.jsx)(O,{name:`file-image`,className:`h-3 w-3 text-muted-foreground`}):(0,$.jsx)(O,{name:`file`,className:`h-3 w-3 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`truncate max-w-[100px]`,title:e.filename,children:e.filename}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>Ne(e.id),className:`text-muted-foreground hover:text-destructive`,children:(0,$.jsx)(O,{name:`close`,className:`h-3 w-3`})})]},e.id))]})]}),l.map((e,t)=>(0,$.jsx)(dt,{group:e,groupIndex:t,canRemove:l.length>1,onUpdate:ke,onRemove:Ae},e.id)),(0,$.jsxs)(`button`,{type:`button`,onClick:je,className:`flex items-center gap-1.5 py-2 px-3 -mx-3 rounded-lg typography-meta font-medium text-muted-foreground hover:text-foreground hover:bg-[var(--interactive-hover)]/50 transition-colors`,children:[(0,$.jsx)(O,{name:`add`,className:`h-3.5 w-3.5`}),a(`multirun.launcher.groups.addGroup`)]}),De&&(0,$.jsx)(`div`,{className:`px-3 py-2 rounded-lg typography-meta`,style:{backgroundColor:`var(--status-error-background)`,color:`var(--status-error)`,borderWidth:1,borderColor:`var(--status-error-border)`},children:De})]})})}),(0,$.jsx)(`div`,{className:`shrink-0 px-4 sm:px-6 py-3`,children:(0,$.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl flex items-center justify-end gap-2`,children:[!Te&&Z!==null?(0,$.jsxs)(`div`,{className:`mr-auto flex min-w-0 items-center gap-1.5 typography-micro text-muted-foreground`,children:[(0,$.jsx)(O,{name:`information`,className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`truncate`,children:a(`multirun.launcher.project.gitRequired`)})]}):null,(0,$.jsx)(te,{type:`button`,variant:`ghost`,size:`sm`,onClick:r,children:a(`multirun.launcher.actions.cancel`)}),(0,$.jsx)(te,{type:`submit`,size:`sm`,disabled:!Re||y,children:y?a(`multirun.launcher.actions.creating`):(0,$.jsx)($.Fragment,{children:a(`multirun.launcher.actions.startWithRunCount`,{count:Fe})})})]})})]})},dt=e=>{let t=(0,Ce.c)(104),{group:n,groupIndex:r,canRemove:i,onUpdate:a,onRemove:o}=e,{t:s}=f(),[c,l]=X.useState(!1),[d,p]=X.useState(``),[m,h]=X.useState(!1),[g,_]=X.useState(``),[v,y]=X.useState(!1),[b,x]=X.useState(``),S=X.useRef(null),C=X.useRef(null),w=X.useRef(null),T=X.useRef(null),E;t[0]!==n.id||t[1]!==n.models||t[2]!==a?(E=e=>{n.models.length>=ot||a(n.id,{models:[...n.models,e]})},t[0]=n.id,t[1]=n.models,t[2]=a,t[3]=E):E=t[3];let D=u(E),ee;t[4]!==n.id||t[5]!==n.models||t[6]!==a?(ee=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]=ee):ee=t[7];let te=u(ee),ne;t[8]!==n.id||t[9]!==n.models||t[10]!==a?(ne=(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]=ne):ne=t[11];let re=u(ne),ie;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(e,t)=>{if(e.startsWith(`/`)){let n=e.indexOf(` `),r=e.indexOf(`
|
|
2
|
-
`),i=Math.min(n===-1?e.length:n,r===-1?e.length:r);if(t<=i&&n===-1){_(e.substring(1,i)),h(!0),l(!1),y(!1);return}}h(!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);if((!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
|
|
3
|
-
`)){x(t),y(!0),l(!1);return}}y(!1);let i=n.lastIndexOf(`@`);if(i!==-1){let e=i>0?n[i-1]:null,t=n.substring(i+1);(!e||/\s/.test(e))&&!t.includes(` `)&&!t.includes(`
|
|
4
|
-
`)?(p(t),l(!0)):l(!1);return}l(!1)},t[12]=ie):ie=t[12];let k=u(ie),ae;t[13]!==n.id||t[14]!==a?(ae=e=>{a(n.id,{prompt:e})},t[13]=n.id,t[14]=a,t[15]=ae):ae=t[15];let A=u(ae),j;t[16]!==n.prompt||t[17]!==A||t[18]!==k?(j=e=>{let t=n.prompt,r=S.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=be(t,i===-1?r:i,r,`@${a}`);A(o.text),l(!1),p(``),requestAnimationFrame(()=>{let e=S.current;e&&(e.selectionStart=o.caret,e.selectionEnd=o.caret,e.focus()),k(o.text,o.caret)})},t[16]=n.prompt,t[17]=A,t[18]=k,t[19]=j):j=t[19];let oe=u(j),se;t[20]!==n.prompt||t[21]!==A||t[22]!==k?(se=e=>{let t=n.prompt,r=S.current?.selectionStart??t.length,i=t.substring(0,r).lastIndexOf(`@`),a=be(t,i===-1?r:i,r,`@${e}`);A(a.text),l(!1),p(``),requestAnimationFrame(()=>{let e=S.current;e&&(e.selectionStart=a.caret,e.selectionEnd=a.caret,e.focus()),k(a.text,a.caret)})},t[20]=n.prompt,t[21]=A,t[22]=k,t[23]=se):se=t[23];let ce=u(se),le;t[24]!==A||t[25]!==k?(le=e=>{let t=`/${e.name} `;A(t),h(!1),_(``),y(!1),requestAnimationFrame(()=>{let e=S.current;e&&(e.focus(),e.selectionStart=e.value.length,e.selectionEnd=e.value.length),k(t,t.length)})},t[24]=A,t[25]=k,t[26]=le):le=t[26];let M=u(le),ue;t[27]!==n.prompt||t[28]!==A||t[29]!==k?(ue=(e,t)=>{let r=n.prompt,i=S.current?.selectionStart??r.length,a=r.substring(0,i).lastIndexOf(`#`),o=a===-1?i:a,s=`${r.substring(0,o)}#${t} ${r.substring(i)}`,c=o+t.length+2;A(s),y(!1),x(``),requestAnimationFrame(()=>{let e=S.current;e&&(e.selectionStart=c,e.selectionEnd=c,e.focus()),k(s,c)})},t[27]=n.prompt,t[28]=A,t[29]=k,t[30]=ue):ue=t[30];let de=u(ue),N;t[31]!==m||t[32]!==c||t[33]!==v?(N=e=>{if(m&&w.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)){e.preventDefault(),w.current.handleKeyDown(e.key);return}c&&C.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),C.current.handleKeyDown(e.key)),v&&T.current&&(e.key===`Enter`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`Escape`||e.key===`Tab`)&&(e.preventDefault(),T.current.handleKeyDown(e.key))},t[31]=m,t[32]=c,t[33]=v,t[34]=N):N=t[34];let F=u(N),fe=r+1,pe;t[35]!==s||t[36]!==fe?(pe=s(`multirun.launcher.groups.groupLabel`,{index:fe}),t[35]=s,t[36]=fe,t[37]=pe):pe=t[37];let I;t[38]===pe?I=t[39]:(I=(0,$.jsx)(`span`,{className:`typography-meta font-medium text-foreground`,children:pe}),t[38]=pe,t[39]=I);let L;t[40]!==i||t[41]!==n.id||t[42]!==o||t[43]!==s?(L=i&&(0,$.jsx)(`button`,{type:`button`,onClick:()=>o(n.id),className:`inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-destructive hover:bg-destructive/10`,"aria-label":s(`multirun.launcher.groups.removeGroup`),children:(0,$.jsx)(O,{name:`close`,className:`h-3.5 w-3.5`})}),t[40]=i,t[41]=n.id,t[42]=o,t[43]=s,t[44]=L):L=t[44];let R;t[45]!==I||t[46]!==L?(R=(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[I,L]}),t[45]=I,t[46]=L,t[47]=R):R=t[47];let me;t[48]===s?me=t[49]:(me=s(`multirun.launcher.groups.prompt.label`),t[48]=s,t[49]=me);let z;t[50]===me?z=t[51]:(z=(0,$.jsx)(ct,{required:!0,children:me}),t[50]=me,t[51]=z);let he=n.prompt,B;t[52]!==A||t[53]!==k?(B=e=>{let t=e.target.value;A(t);let n=e.target.selectionStart??t.length;k(t,n)},t[52]=A,t[53]=k,t[54]=B):B=t[54];let V;t[55]===s?V=t[56]:(V=s(`multirun.launcher.groups.prompt.placeholder`),t[55]=s,t[56]=V);let H;t[57]!==n.prompt||t[58]!==F||t[59]!==B||t[60]!==V?(H=(0,$.jsx)(P,{ref:S,value:he,onChange:B,onKeyDown:F,placeholder:V,className:`typography-meta min-h-[80px] max-h-[200px] resize-none overflow-y-auto field-sizing-content`,required:!0}),t[57]=n.prompt,t[58]=F,t[59]=B,t[60]=V,t[61]=H):H=t[61];let ve;t[62]!==g||t[63]!==M||t[64]!==m?(ve=m?(0,$.jsx)(ge,{ref:w,searchQuery:g,onCommandSelect:M,onClose:()=>h(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[62]=g,t[63]=M,t[64]=m,t[65]=ve):ve=t[65];let U;t[66]!==ce||t[67]!==oe||t[68]!==d||t[69]!==c?(U=c?(0,$.jsx)(ye,{ref:C,searchQuery:d,onFileSelect:oe,onAgentSelect:ce,onClose:()=>l(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[66]=ce,t[67]=oe,t[68]=d,t[69]=c,t[70]=U):U=t[70];let W;t[71]!==de||t[72]!==v||t[73]!==b?(W=v?(0,$.jsx)(_e,{ref:T,searchQuery:b,onSnippetSelect:de,onClose:()=>y(!1),style:{left:0,top:`auto`,bottom:`calc(100% + 6px)`,marginBottom:0,maxWidth:`100%`}}):null,t[71]=de,t[72]=v,t[73]=b,t[74]=W):W=t[74];let G;t[75]!==H||t[76]!==ve||t[77]!==U||t[78]!==W?(G=(0,$.jsxs)(`div`,{className:`relative`,children:[H,ve,U,W]}),t[75]=H,t[76]=ve,t[77]=U,t[78]=W,t[79]=G):G=t[79];let K;t[80]!==z||t[81]!==G?(K=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[z,G]}),t[80]=z,t[81]=G,t[82]=K):K=t[82];let q;t[83]===s?q=t[84]:(q=s(`multirun.launcher.models.info`,{max:ot}),t[83]=s,t[84]=q);let J;t[85]===q?J=t[86]:(J=(0,$.jsx)(st,{children:q}),t[85]=q,t[86]=J);let Y;t[87]===s?Y=t[88]:(Y=s(`multirun.launcher.models.label`),t[87]=s,t[88]=Y);let xe;t[89]!==J||t[90]!==Y?(xe=(0,$.jsx)(ct,{required:!0,info:J,children:Y}),t[89]=J,t[90]=Y,t[91]=xe):xe=t[91];let Se;t[92]!==n.models||t[93]!==D||t[94]!==te||t[95]!==re?(Se=(0,$.jsx)(Re,{selectedModels:n.models,onAdd:D,onRemove:te,onUpdate:re,minModels:1,maxModels:ot}),t[92]=n.models,t[93]=D,t[94]=te,t[95]=re,t[96]=Se):Se=t[96];let Z;t[97]!==xe||t[98]!==Se?(Z=(0,$.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[xe,Se]}),t[97]=xe,t[98]=Se,t[99]=Z):Z=t[99];let Q;return t[100]!==R||t[101]!==K||t[102]!==Z?(Q=(0,$.jsxs)(`div`,{className:`rounded-lg border border-border p-3 space-y-3`,children:[R,K,Z]}),t[100]=R,t[101]=K,t[102]=Z,t[103]=Q):Q=t[103],Q};export{De as a,Ie as i,$e as n,Te as o,Re as r,ut as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/gitApi-BDGB8ZAu.js","assets/rolldown-runtime-C0FnF6B9.js","assets/persistence-D1lIuyqO.js","assets/useUIStore-5agS8bsW.js","assets/vendor-zustand-B4dlGEM2.js","assets/vendor-base-ui-CnHfUmDN.js","assets/vendor-pathe-vBmvQE8f.js","assets/vendor-react-DLPElpoQ.js","assets/vendor-tanstack-query-core-BWz0ose6.js","assets/gitApiHttp-BxGAFLTf.js","assets/vendor-opencode-sdk-C07HQypa.js","assets/vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js","assets/useMobileNavigationStore-B1PyYZet.js","assets/vendor-tanstack-react-query-D7pys_c9.js","assets/vendor-sonner-DVzioF3d.js","assets/vendor-reactuses-core-DDoDDyM9.js","assets/vendor-lodash-es-DfLbG5Af.js","assets/vendor-js-cookie-hSOiFTtX.js","assets/clipboard-BnElHSnO.js","assets/store-CUWqzRt7.js","assets/useAssistantUIStore-Bq3cPj2x.js","assets/vendor-fuse.js-DB5wDJbI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./useUIStore-5agS8bsW.js";import{Ft as n,Sn as r,Zt as i,n as a,qt as o,t as s}from"./persistence-D1lIuyqO.js";import{nt as c,rt as l}from"./vendor-base-ui-CnHfUmDN.js";import{kt as u,yt as d}from"./gitApiHttp-BxGAFLTf.js";import{o as f}from"./vendor-aparajita-capacitor-secure-storage-CjQdwfjS.js";import{n as p,t as m}from"./vendor-react-DLPElpoQ.js";/* empty css */import{n as h,s as g}from"./vendor-reactuses-core-DDoDDyM9.js";import{i as _,n as v}from"./clipboard-BnElHSnO.js";import{n as y}from"./store-CUWqzRt7.js";import{Fa as b,On as x,Xi as S,b as ee,en as te,go as ne,kn as re,kt as ie,l as C,ta as ae,un as oe}from"./useMobileNavigationStore-B1PyYZet.js";import{t as se}from"./utils-BxJEIWv5.js";import{n as ce}from"./Icon-DiIuWOuC.js";import{t as le}from"./button-DaAoVF4X.js";import{B as ue,C as de,G as w,H as fe,K as T,Q as pe,R as me,S as he,U as E,V as ge,W as _e,a as ve,q as D,t as O,z as ye}from"./useAppFontEffects-D357X5CO.js";import{c as be}from"./projectMeta-DSKfl_Jm.js";import{r as xe}from"./tooltip-BLugzWq-.js";import{p as Se}from"./useSessionAutoCleanup-hkAbHGAN.js";import{U as Ce,z as k}from"./radio-BNJ2-y1d.js";import{A as we,q as Te,t as Ee}from"./ChatContainer-MbXH0_9-.js";import{n as De}from"./useRuntimeAPIs-DSLXJybW.js";import{b as Oe,f as ke}from"./insertionBoundaries-CleTjJ9-.js";import{i as Ae,n as je,r as Me,t as Ne}from"./useDesktopWindowControlsLayout-COoaoLe8.js";var Pe=m(),A=p(),j=e(l(),1),M=c(),Fe=e=>{let t=(0,A.c)(3),{mode:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,M.jsx)(we.Provider,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i},Ie=e=>{let t=typeof e==`string`?e.trim():``;if(!t)return``;let n=typeof window<`u`?window.__OPENCHAMBER_HOME__:``;if(n&&t===n)return`~`;if(n&&t.startsWith(`${n}/`))return`~/${t.slice(n.length+1)}`;let r=t.split(`/`).filter(Boolean);return r.length<=3?t:`.../${r.slice(-3).join(`/`)}`},N=e=>{let t=typeof e==`string`?e.trim():``;if(!t)return``;let n=t.replace(/\\/g,`/`);return n===`/`?`/`:n.replace(/\/+$/,``)},P=e=>{let t=(0,A.c)(133),{mode:n}=e,{t:r}=v(),a=C(Re),s=C(ze),c=C(Be),l=d(Ve),u=ne(He),f=ne(Ue),p=S(We),m=S(Ge),h=oe(),g=te(a??``),_=De(),y=Oe(Ke),b;t[0]===a?b=t[1]:(b=e=>a?e.worktreeMetadata.get(a)?.path??``:``,t[0]=a,t[1]=b);let ie=C(b),ae;t[2]===a?ae=t[3]:(ae=e=>a?e.worktreeMetadata.get(a)?.branch?.trim()??null:null,t[2]=a,t[3]=ae);let ue=C(ae),de;t[4]===a?de=t[5]:(de=e=>a?e.getAttachment(a):void 0,t[4]=a,t[5]=de);let w=ee(de),fe=C(qe),[T,pe]=j.useState(!1),me=typeof window<`u`?window.__OPENCHAMBER_MACOS_MAJOR__??0:0,he=Number.isFinite(me)&&me>0,{usesFramelessChrome:E,side:ge}=Ne(),_e=he?me>=26?`h-12`:me<=15?`h-14`:``:``,ve;t[6]!==a||t[7]!==h?(ve=a?h.find(e=>e.id===a)??null:null,t[6]=a,t[7]=h,t[8]=ve):ve=t[8];let D=ve,O=D?.worktreeMetadata??null,ye,be;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(ye=()=>{i()&&o(`desktop_get_window_pinned`).then(e=>{typeof e?.pinned==`boolean`&&pe(e.pinned)})},be=[],t[9]=ye,t[10]=be):(ye=t[9],be=t[10]),j.useEffect(ye,be);let xe;t[11]!==s||t[12]!==n||t[13]!==D?.title||t[14]!==r?(xe=D?.title?.trim()||r(s||n===`draft`?`miniChat.header.newSession`:`miniChat.header.session`),t[11]=s,t[12]=n,t[13]=D?.title,t[14]=r,t[15]=xe):xe=t[15];let Se=xe,Ce=D?.directory??null,k;t[16]===Ce?k=t[17]:(k=N(Ce),t[16]=Ce,t[17]=k);let we=k,Te=ie||O?.path||w?.cwd||w?.worktreeRoot||``,Ee;t[18]===Te?Ee=t[19]:(Ee=N(Te),t[18]=Te,t[19]=Ee);let Pe=Ee,Fe;t[20]===l?Fe=t[21]:(Fe=N(l),t[20]=l,t[21]=Fe);let P=Pe||we||fe||Fe,Le;t[22]===P?Le=t[23]:(Le=Ie(P),t[22]=P,t[23]=Le);let tt=Le,nt;t[24]!==we||t[25]!==Pe?(nt=e=>{let t=N(Pe||we||``);if(!t)return null;for(let n of e.availableWorktreesByProject.values()){let e=n.find(e=>N(e.path)===t)?.branch?.trim();if(e)return e}return null},t[24]=we,t[25]=Pe,t[26]=nt):nt=t[26];let rt=C(nt),it,at;t[27]!==y||t[28]!==P||t[29]!==_.git?(it=()=>{P&&y(P,_.git).catch(Je)},at=[y,P,_.git],t[27]=y,t[28]=P,t[29]=_.git,t[30]=it,t[31]=at):(it=t[30],at=t[31]),j.useEffect(it,at),O?.projectDirectory,w?.worktreeRoot;let ot;bb0:{let e=O?.projectDirectory??w?.worktreeRoot??null,n;t[32]===e?n=t[33]:(n=N(e),t[32]=e,t[33]=n);let r=n||P;if(!r){ot=null;break bb0}let i;t[34]!==r||t[35]!==u?(i=u.map(Ye).filter(e=>e.normalizedPath&&(e.normalizedPath===r||r.startsWith(`${e.normalizedPath}/`))).sort(Xe)[0]??null,t[34]=r,t[35]=u,t[36]=i):i=t[36],ot=i}let st=ot,ct;bb1:{let e=st??f;if(!e){ct=tt||`OpenChamber`;break bb1}let n;t[37]===e.path?n=t[38]:(n=e.path.split(/[\\/]/).filter(Boolean).at(-1)??e.path,t[37]=e.path,t[38]=n),ct=n}let lt=ct,ut=ke(P||null),dt;t[39]!==rt||t[40]!==ut||t[41]!==O?.branch||t[42]!==w?.branch||t[43]!==ue?(dt=ut||ue||O?.branch?.trim()||w?.branch?.trim()||rt,t[39]=rt,t[40]=ut,t[41]=O?.branch,t[42]=w?.branch,t[43]=ue,t[44]=dt):dt=t[44];let ft=dt,pt=ft&&ft!==`HEAD`?ft:null,mt;t[45]===p?mt=t[46]:(mt=p(),t[45]=p,t[46]=mt);let ht=mt,gt;bb2:{for(let e=g.length-1;e>=0;--e){let t=g[e];if(t.role!==`assistant`||typeof t.providerID!=`string`||typeof t.modelID!=`string`)continue;let n=m.find(e=>e.id===t.providerID)?.models.find(e=>e.id===t.modelID);if(n){gt=n;break bb2}}gt=void 0}let _t=gt,vt=ht?.limit?ht:_t,F=vt&&typeof vt.limit==`object`&&vt.limit!==null?vt.limit:null,I=F&&typeof F.context==`number`?F.context:0,yt=F&&typeof F.output==`number`?F.output:0,L;if(t[47]!==I||t[48]!==a||t[49]!==g||t[50]!==yt){bb3:{if(!a||g.length===0){L=null;break bb3}let e=re(g,Ze);if(!e||`compacted`in e){L=null;break bb3}let n=e.tokens,r=e.totalTokens,i=I>0?I:2e5,o;t[52]!==I||t[53]!==r?(o=I>0?Math.round(r/I*100):0,t[52]=I,t[53]=r,t[54]=o):o=t[54];let s=o,c=yt>0?Math.round(x(n.output)/yt*100):void 0,l=I||0,u=yt||void 0,d;t[55]!==e||t[56]!==c||t[57]!==s||t[58]!==l||t[59]!==u||t[60]!==i||t[61]!==r?(d={totalTokens:r,percentage:s,contextLimit:l,outputLimit:u,normalizedOutput:c,thresholdLimit:i,lastMessageId:e.messageId},t[55]=e,t[56]=c,t[57]=s,t[58]=l,t[59]=u,t[60]=i,t[61]=r,t[62]=d):d=t[62],L=d}t[47]=I,t[48]=a,t[49]=g,t[50]=yt,t[51]=L}else L=t[51];let R=L,[z,bt]=j.useState(null),xt;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(xt={WebkitAppRegion:`drag`},t[63]=xt):xt=t[63];let St=xt,Ct;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(Ct={WebkitAppRegion:`no-drag`},t[64]=Ct):Ct=t[64];let wt=Ct,Tt,Et;t[65]!==R||t[66]!==a?(Tt=()=>{if(!a){bt(Qe);return}if(R&&R.totalTokens>0){bt(e=>e&&e.totalTokens===R.totalTokens&&e.percentage===R.percentage&&e.contextLimit===R.contextLimit&&(e.outputLimit??0)===(R.outputLimit??0)&&(e.normalizedOutput??0)===(R.normalizedOutput??0)&&e.thresholdLimit===R.thresholdLimit&&e.lastMessageId===R.lastMessageId?e:R);return}bt($e)},Et=[R,a],t[65]=R,t[66]=a,t[67]=Tt,t[68]=Et):(Tt=t[67],Et=t[68]),j.useEffect(Tt,Et);let Dt=z&&z.contextLimit>0?Math.min(999,z.totalTokens/z.contextLimit*100):0,Ot;t[69]===T?Ot=t[70]:(Ot=()=>{let e=!T;pe(e),o(`desktop_set_window_pinned`,{pinned:e}).catch(()=>{pe(!e)})},t[69]=T,t[70]=Ot);let kt=Ot,At;t[71]!==l||t[72]!==a||t[73]!==c||t[74]!==P||t[75]!==D?(At=()=>{let e=a?{sessionId:a,directory:D?.directory??l??``}:{mode:`draft`,directory:P||l||``,projectId:c};o(`desktop_focus_main_window`,e).then(et)},t[71]=l,t[72]=a,t[73]=c,t[74]=P,t[75]=D,t[76]=At):At=t[76];let jt=At,Mt=E?`h-12`:_e||`min-h-14`,B;t[77]===Mt?B=t[78]:(B=se(`flex items-center gap-3 bg-background pr-3`,he?`pl-[5.5rem]`:`pl-3`,Mt),t[77]=Mt,t[78]=B);let V;t[79]!==E||t[80]!==ge?(V=E&&ge===`left`?(0,M.jsx)(Me,{visible:!0,position:`left`}):null,t[79]=E,t[80]=ge,t[81]=V):V=t[81];let H;t[82]===r?H=t[83]:(H=r(`sessions.switcher.openAria`),t[82]=r,t[83]=H);let U;t[84]===Se?U=t[85]:(U=(0,M.jsx)(`span`,{className:`truncate typography-ui-label text-[14px] font-normal leading-tight text-foreground max-w-full`,children:Se}),t[84]=Se,t[85]=U);let W;t[86]===lt?W=t[87]:(W=(0,M.jsx)(`span`,{className:`truncate`,children:lt}),t[86]=lt,t[87]=W);let G;t[88]===pt?G=t[89]:(G=pt?(0,M.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-0.5`,children:[(0,M.jsx)(ce,{name:`git-branch`,className:`h-3 w-3 flex-shrink-0 text-muted-foreground/70`}),(0,M.jsx)(`span`,{className:`truncate`,children:pt})]}):null,t[88]=pt,t[89]=G);let K;t[90]!==W||t[91]!==G?(K=(0,M.jsxs)(`span`,{className:`flex min-w-0 max-w-full items-center gap-1.5 truncate typography-micro text-[10.5px] font-normal leading-tight text-muted-foreground/75`,children:[W,G]}),t[90]=W,t[91]=G,t[92]=K):K=t[92];let q;t[93]!==H||t[94]!==U||t[95]!==K?(q=(0,M.jsx)(je,{children:(0,M.jsxs)(`button`,{type:`button`,"aria-label":H,style:wt,className:`flex min-w-0 max-w-full flex-col items-start rounded-md px-1 py-0.5 text-left transition-colors hover:bg-interactive-hover/60 focus-visible:outline-none focus-visible:bg-interactive-hover/60`,children:[U,K]})}),t[93]=H,t[94]=U,t[95]=K,t[96]=q):q=t[96];let Nt;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,M.jsx)(`div`,{className:`min-w-0 flex-1`}),t[97]=Nt):Nt=t[97];let J;t[98]!==Dt||t[99]!==z?(J=z&&z.totalTokens>0?(0,M.jsx)(Ae,{totalTokens:z.totalTokens,percentage:Dt,colorPercentage:z.percentage,contextLimit:z.contextLimit,outputLimit:z.outputLimit??0,className:`h-9 shrink-0 pl-1 pr-1 typography-ui-label`,valueClassName:`font-semibold leading-none`,hideIcon:!0,showPercentIcon:!0,percentIconClassName:`h-4.5 w-4.5`}):null,t[98]=Dt,t[99]=z,t[100]=J):J=t[100];let Y;t[101]!==T||t[102]!==r?(Y=r(T?`miniChat.actions.unpinAria`:`miniChat.actions.pinAria`),t[101]=T,t[102]=r,t[103]=Y):Y=t[103];let X;t[104]!==T||t[105]!==r?(X=r(T?`miniChat.actions.unpin`:`miniChat.actions.pin`),t[104]=T,t[105]=r,t[106]=X):X=t[106];let Z;t[107]===T?Z=t[108]:(Z=T?(0,M.jsx)(ce,{name:`pushpin-2-fill`,className:`h-4 w-4`}):(0,M.jsx)(ce,{name:`pushpin-2`,className:`h-4 w-4`}),t[107]=T,t[108]=Z);let Q;t[109]!==kt||t[110]!==Y||t[111]!==X||t[112]!==Z?(Q=(0,M.jsx)(le,{type:`button`,variant:`ghost`,size:`icon`,onClick:kt,"aria-label":Y,title:X,style:wt,children:Z}),t[109]=kt,t[110]=Y,t[111]=X,t[112]=Z,t[113]=Q):Q=t[113];let Pt;t[114]===r?Pt=t[115]:(Pt=r(`miniChat.actions.openMainAria`),t[114]=r,t[115]=Pt);let Ft;t[116]===r?Ft=t[117]:(Ft=r(`miniChat.actions.openMain`),t[116]=r,t[117]=Ft);let It;t[118]===Symbol.for(`react.memo_cache_sentinel`)?(It=(0,M.jsx)(ce,{name:`external-link`,className:`h-4 w-4`}),t[118]=It):It=t[118];let Lt;t[119]!==jt||t[120]!==Pt||t[121]!==Ft?(Lt=(0,M.jsx)(le,{type:`button`,variant:`ghost`,size:`icon`,onClick:jt,"aria-label":Pt,title:Ft,style:wt,children:It}),t[119]=jt,t[120]=Pt,t[121]=Ft,t[122]=Lt):Lt=t[122];let Rt=E&&ge===`right`,$;t[123]===Rt?$=t[124]:($=(0,M.jsx)(Me,{visible:Rt,position:`right`}),t[123]=Rt,t[124]=$);let zt;return t[125]!==B||t[126]!==V||t[127]!==q||t[128]!==J||t[129]!==Q||t[130]!==Lt||t[131]!==$?(zt=(0,M.jsxs)(`header`,{className:B,style:St,children:[V,q,Nt,J,Q,Lt,$]}),t[125]=B,t[126]=V,t[127]=q,t[128]=J,t[129]=Q,t[130]=Lt,t[131]=$,t[132]=zt):zt=t[132],zt},Le=e=>{let t=(0,A.c)(9),{mode:n,autoOpenDraft:r,unavailable:i}=e,a=r!==void 0&&r,o=i!==void 0&&i,{t:s}=v(),c;t[0]===n?c=t[1]:(c=(0,M.jsx)(P,{mode:n}),t[0]=n,t[1]=c);let l;t[2]!==a||t[3]!==s||t[4]!==o?(l=(0,M.jsx)(`main`,{className:`min-h-0 flex-1`,children:o?(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center typography-ui-label text-muted-foreground`,children:(0,M.jsxs)(`div`,{className:`max-w-sm rounded-lg border border-[var(--interactive-border)] bg-[var(--surface-elevated)] px-4 py-3`,children:[(0,M.jsx)(`div`,{className:`font-medium text-foreground`,children:s(`miniChat.unavailable.title`)}),(0,M.jsx)(`div`,{className:`mt-1 typography-small text-muted-foreground`,children:s(`miniChat.unavailable.description`)})]})}):(0,M.jsx)(Fe,{mode:`mini-chat`,children:(0,M.jsx)(Ee,{autoOpenDraft:a})})}),t[2]=a,t[3]=s,t[4]=o,t[5]=l):l=t[5];let u;return t[6]!==c||t[7]!==l?(u=(0,M.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background text-foreground`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8],u};function Re(e){return e.currentSessionId}function ze(e){return!!e.newSessionDraft?.open}function Be(e){return e.newSessionDraft?.selectedProjectId??null}function Ve(e){return e.currentDirectory}function He(e){return e.projects}function Ue(e){return e.getActiveProject()}function We(e){return e.getCurrentModel}function Ge(e){return e.providers}function Ke(e){return e.ensureStatus}function qe(e){return e.newSessionDraft?.open?N(e.newSessionDraft.bootstrapPendingDirectory??e.newSessionDraft.directoryOverride??``):``}function Je(){}function Ye(e){return{...e,normalizedPath:N(e.path)}}function Xe(e,t){return t.path.length-e.path.length}function Ze(e){return ae(e)}function Qe(e){return e===null?e:null}function $e(e){return e===null?e:null}function et(e){return e?.focused===!0?o(`desktop_close_current_window`):null}var tt=()=>{document.querySelector(`textarea[data-chat-input="true"]`)?.focus()},nt=()=>{let e=t(e=>e.shortcutOverrides),r=d(e=>e.currentDirectory),i=ne(e=>e.getActiveProject()),a=C(e=>e.openNewSessionDraft);j.useEffect(()=>{let s=t=>Ce(t,e),c=e=>{if(k(e,s(`focus_input`))){e.preventDefault(),tt();return}if(n()&&k(e,s(`close_context_panel_tab`))){e.preventDefault(),o(`desktop_close_current_window`).catch(e=>{console.warn(`[mini-chat-shortcuts] failed to close current window`,e)});return}if(n()&&k(e,s(`new_mini_chat`))){e.preventDefault(),o(`desktop_open_draft_mini_chat_window`,{directory:r||i?.path||``,projectId:i?.id??null})?.catch(e=>{console.warn(`[mini-chat-shortcuts] failed to open draft mini chat window`,e)});return}if(k(e,s(`new_chat`))){e.preventDefault(),a({selectedProjectId:i?.id??null,directoryOverride:r||i?.path||null,preserveDirectoryOverride:!!(r||i?.path)}),tt();return}if(k(e,s(`open_model_selector`))){e.preventDefault();let{isModelSelectorOpen:n,setModelSelectorOpen:r}=t.getState();r(!n,{instant:!0});return}if(k(e,s(`cycle_thinking_variant`))){let t=S.getState();if(t.getCurrentModelVariants().length===0)return;e.preventDefault(),t.cycleCurrentVariant();let n=S.getState().currentVariant,r=C.getState().currentSessionId,i=S.getState().currentAgentName,a=S.getState().currentProviderId,o=S.getState().currentModelId;r&&i&&a&&o&&b.getState().saveAgentModelVariantForSession(r,i,a,o,n),i&&a&&o&&S.getState().saveAgentModelSelection(i,a,o,n);return}let c=k(e,s(`cycle_favorite_model_forward`)),l=k(e,s(`cycle_favorite_model_backward`));if(c||l){let{favoriteModels:n,addRecentModel:r}=t.getState();if(n.length===0)return;e.preventDefault();let{currentProviderId:i,currentModelId:a,setProvider:o,setModel:s}=S.getState(),l=n[(n.findIndex(e=>e.providerID===i&&e.modelID===a)+(c?1:-1)+n.length)%n.length];o(l.providerID),s(l.modelID),r(l.providerID,l.modelID)}};return window.addEventListener(`keydown`,c),()=>window.removeEventListener(`keydown`,c)},[i?.id,i?.path,r,a,e])},rt=`openchamber:mini-chat-presence`,it=()=>{let e=typeof window<`u`?new URLSearchParams(window.location.search):new URLSearchParams;return{mode:e.get(`mode`)===`session`?`session`:`draft`,sessionId:e.get(`sessionId`)?.trim()||null,directory:e.get(`directory`)?.trim()||null,projectId:e.get(`projectId`)?.trim()||null}},at=({config:e})=>{let t=oe(),n=d(e=>e.currentDirectory),r=d(e=>e.setDirectory),i=ne(e=>e.projects),a=C(e=>e.currentSessionId),o=C(e=>!!e.newSessionDraft?.open),s=C(e=>e.newSessionDraft?.open?e.newSessionDraft.bootstrapPendingDirectory??e.newSessionDraft.directoryOverride??``:``),c=C(e=>e.setCurrentSession),l=C(e=>e.openNewSessionDraft),u=S(e=>e.initializeApp),p=S(e=>e.isInitialized),m=Te();j.useEffect(()=>{u()},[u]),j.useEffect(()=>{if(p)return;let e=!0,t=0,n=window.setInterval(()=>{if(e){if(t+=1,t>10){window.clearInterval(n);return}S.getState().isInitialized||S.getState().initializeApp()}},1e3);return()=>{e=!1,window.clearInterval(n)}},[p]);let _=j.useRef(!1);j.useEffect(()=>{if(!_.current&&e.mode===`session`&&e.directory){if(n===e.directory){_.current=!0;return}r(e.directory,{showOverlay:!1}),_.current=!0}},[e.directory,e.mode,n,r]),j.useEffect(()=>{e.mode!==`draft`||!o||a||!s||n===s||r(s,{showOverlay:!1})},[e.mode,n,a,s,o,r]),ue({enabled:!0,source:`electronMiniChat:recovery`});let v=j.useRef(!1);j.useEffect(()=>{if(v.current||e.mode!==`session`||!e.sessionId)return;if(a===e.sessionId){v.current=!0;return}if(a){v.current=!0;return}let n=t.find(t=>t.id===e.sessionId);if(!n){m.ensureSessionRenderable(e.sessionId);return}let r=n.directory??e.directory;c(e.sessionId,r),v.current=!0},[e,a,t,c,m]);let y=g(t),b=h(e=>{let t=e.detail,n=typeof t?.sessionId==`string`?t.sessionId.trim():``;if(!n||C.getState().currentSessionId===n)return;let r=typeof t?.directory==`string`&&t.directory.trim().length>0?t.directory.trim():y.current.find(e=>e.id===n)?.directory??null;m.ensureSessionRenderable(n),c(n,r),v.current=!0});j.useEffect(()=>(window.addEventListener(`openchamber:open-session`,b),()=>window.removeEventListener(`openchamber:open-session`,b)),[b]),j.useEffect(()=>{e.mode!==`draft`||o||a||l({selectedProjectId:e.projectId,directoryOverride:e.directory,preserveDirectoryOverride:!!e.directory})},[e,a,o,l]),j.useEffect(()=>{if(i.length===0)return;let e=!1;return(async()=>{await Promise.all(i.map(async t=>{let n=t.path.replace(/\\/g,`/`).replace(/\/+$/,``);if(n)try{if(!(Oe.getState().directories.get(n)?.isGitRepo??await f(()=>import(`./gitApi-BDGB8ZAu.js`).then(e=>e.S).then(e=>e.checkIsGitRepository(n)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])))||e)return;await be({id:t.id,path:n},{isCurrent:()=>!e})}catch{}}))})(),()=>{e=!0}},[i]);let x=j.useRef(!1);return j.useEffect(()=>{if(x.current||!p)return;let t=()=>{if(x.current)return;x.current=!0;let e=typeof document<`u`?document.getElementById(`initial-loading`):null;e&&(e.classList.add(`fade-out`),window.setTimeout(()=>e.remove(),300))},n=e.mode===`session`?a===e.sessionId:o,r=window.setTimeout(t,n?100:1500);return()=>window.clearTimeout(r)},[p,e.mode,e.sessionId,a,o]),null},ot=()=>{let e=(0,A.c)(4),t=C(mt),n=d(ht),r,i;return e[0]!==n||e[1]!==t?(r=()=>{if(!t||!n||typeof BroadcastChannel>`u`)return;let e=new BroadcastChannel(rt),r=r=>{e.postMessage({type:`mini-chat-session-presence`,sessionId:t,directory:n,viewed:r})};r(!0);let i=window.setInterval(()=>r(!0),5e3),a=()=>r(!1);return window.addEventListener(`beforeunload`,a),()=>{window.clearInterval(i),window.removeEventListener(`beforeunload`,a),r(!1),e.close()}},i=[n,t],e[0]=n,e[1]=t,e[2]=r,e[3]=i):(r=e[2],i=e[3]),j.useEffect(r,i),null},st=e=>{let t=(0,A.c)(6),n=oe(),r=C(gt),[i,a]=j.useState(!1),o,s;return t[0]!==e.mode||t[1]!==e.sessionId||t[2]!==r||t[3]!==n?(o=()=>{if(e.mode!==`session`||!e.sessionId||r===e.sessionId){a(!1);return}if(n.some(t=>t.id===e.sessionId)){a(!1);return}let t=window.setTimeout(()=>a(!0),5e3);return()=>window.clearTimeout(t)},s=[e.mode,e.sessionId,r,n],t[0]=e.mode,t[1]=e.sessionId,t[2]=r,t[3]=n,t[4]=o,t[5]=s):(o=t[4],s=t[5]),j.useEffect(o,s),i};function ct(e){let t=(0,A.c)(16),{apis:n}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=it(),t[0]=i):i=t[0];let a=i,o=d(ft),s=C(dt),c=C(ut),l,f;t[1]===o?(l=t[2],f=t[3]):(l=()=>{u.setDirectory(o||a.directory||void 0)},f=[a.directory,o],t[1]=o,t[2]=l,t[3]=f),j.useEffect(l,f);let p,m;t[4]===n?(p=t[5],m=t[6]):(p=()=>(r(n),lt),m=[n],t[4]=n,t[5]=p,t[6]=m),j.useEffect(p,m),O(),nt();let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h={enabled:!0},t[7]=h):h=t[7],de(h),he();let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=u.getSdkClient(),t[8]=g):g=t[8];let _=o||a.directory||``,v=!(c&&s===null),y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,M.jsx)(xe,{delayDuration:300,skipDelayDuration:150,children:(0,M.jsxs)(`div`,{className:`h-full text-foreground bg-background`,children:[(0,M.jsx)(pt,{config:a}),(0,M.jsx)(me,{})]})}),t[9]=y):y=t[9];let b;t[10]===n?b=t[11]:(b=(0,M.jsx)(ye,{apis:n,children:y}),t[10]=n,t[11]=b);let x;return t[12]!==b||t[13]!==_||t[14]!==v?(x=(0,M.jsx)(Se,{children:(0,M.jsx)(ie,{sdk:g,directory:_,bootstrapDirectory:v,children:b})}),t[12]=b,t[13]=_,t[14]=v,t[15]=x):x=t[15],x}function lt(){return r(null)}function ut(e){return!!e.newSessionDraft?.open}function dt(e){return e.currentSessionId}function ft(e){return e.currentDirectory}var pt=e=>{let t=(0,A.c)(11),{config:n}=e,r=st(n),i;t[0]===n?i=t[1]:(i=(0,M.jsx)(at,{config:n}),t[0]=n,t[1]=i);let a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsx)(ot,{}),o=(0,M.jsx)(ve,{embeddedBackgroundWorkEnabled:!0}),t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s=n.mode===`draft`,c;t[4]!==n.mode||t[5]!==r||t[6]!==s?(c=(0,M.jsx)(Le,{mode:n.mode,autoOpenDraft:s,unavailable:r}),t[4]=n.mode,t[5]=r,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==c?(l=(0,M.jsxs)(M.Fragment,{children:[i,a,o,c]}),t[8]=i,t[9]=c,t[10]=l):l=t[10],l};function mt(e){return e.currentSessionId}function ht(e){return e.currentDirectory}function gt(e){return e.currentSessionId}var _t=()=>{y(),s().then(()=>{Promise.all([a(),pe()]).catch(e=>{console.error(`[mini-chat-main] settings init failed:`,e)}),_e(),E(),fe()}).catch(e=>{console.error(`[mini-chat-main] appearance init failed:`,e)})};function vt(e){_t();let t=document.getElementById(`root`);if(!t)throw Error(`Root element not found`);(0,Pe.createRoot)(t).render((0,M.jsx)(j.StrictMode,{children:(0,M.jsx)(ge,{children:(0,M.jsx)(_,{children:(0,M.jsx)(w,{children:(0,M.jsx)(T,{children:(0,M.jsx)(D,{children:(0,M.jsx)(ct,{apis:e})})})})})})}))}export{vt as renderElectronMiniChatApp};
|