@openchamber/web 1.13.6 → 1.13.7

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 (26) hide show
  1. package/bin/lib/commands-update.test.js +50 -0
  2. package/dist/assets/{DiagramView-C_f1Il8p.js → DiagramView-BJkP8Fjp.js} +1 -1
  3. package/dist/assets/{MarkdownRendererImpl-BR0DXO9F.js → MarkdownRendererImpl-Nq7bOf31.js} +1 -1
  4. package/dist/assets/{MultiRunWindow-WBqBXcts.js → MultiRunWindow-CRKVePMG.js} +1 -1
  5. package/dist/assets/{NewWorktreeDialog-D7l2VA7o.js → NewWorktreeDialog-Dj6KETex.js} +1 -1
  6. package/dist/assets/{OnboardingScreen-ChaxLu9k.js → OnboardingScreen-DRe8UNiS.js} +1 -1
  7. package/dist/assets/{SessionSwitcherDropdown-xaYa-FIx.js → SessionSwitcherDropdown-Cn_yoQrm.js} +1 -1
  8. package/dist/assets/{SettingsWindow-D5aAKCEM.js → SettingsWindow-BIKNrxSK.js} +1 -1
  9. package/dist/assets/{TerminalView-D8GzsMZF.js → TerminalView-BDjzrhGS.js} +1 -1
  10. package/dist/assets/{index-DxqTiFfR.css → index-Bv4711NQ.css} +1 -1
  11. package/dist/assets/{main-DUn82Iwq.js → main-BByFAmjA.js} +3 -3
  12. package/dist/assets/{main-CLkcy9_q.js → main-BJDsJGkp.js} +2 -2
  13. package/dist/assets/miniChat-Ckr71tB9.js +2 -0
  14. package/dist/assets/mobile-DVDtnIcD.js +2 -0
  15. package/dist/assets/{renderElectronMiniChatApp-BTsP-lHc.js → renderElectronMiniChatApp-CXvtB6Rd.js} +2 -2
  16. package/dist/assets/{renderMobileApp-CSEgabkw.js → renderMobileApp-BVAt5rTM.js} +3 -3
  17. package/dist/assets/{useAppFontEffects-BPhei6aO.js → useAppFontEffects-B66TruVB.js} +111 -111
  18. package/dist/index.html +3 -3
  19. package/dist/mini-chat.html +3 -3
  20. package/dist/mobile.html +3 -3
  21. package/package.json +1 -1
  22. package/server/lib/package-manager.js +2 -2
  23. package/server/lib/package-manager.test.js +13 -1
  24. package/dist/assets/miniChat-Ag1CYNF5.js +0 -2
  25. package/dist/assets/mobile-DtojUfiY.js +0 -2
  26. /package/dist/assets/{index-DJHN0H4h.js → index-AsCHiJ5P.js} +0 -0
@@ -0,0 +1,50 @@
1
+ import fs from 'fs';
2
+ import os from 'os';
3
+ import path from 'path';
4
+ import { describe, expect, it, vi } from 'vitest';
5
+
6
+ import { createUpdateCommand } from './commands-update.js';
7
+
8
+ async function withTempOpenChamberDataDir(fn) {
9
+ const previous = process.env.OPENCHAMBER_DATA_DIR;
10
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'openchamber-update-test-'));
11
+ process.env.OPENCHAMBER_DATA_DIR = dir;
12
+ try {
13
+ return await fn(dir);
14
+ } finally {
15
+ if (typeof previous === 'string') {
16
+ process.env.OPENCHAMBER_DATA_DIR = previous;
17
+ } else {
18
+ delete process.env.OPENCHAMBER_DATA_DIR;
19
+ }
20
+ fs.rmSync(dir, { recursive: true, force: true });
21
+ }
22
+ }
23
+
24
+ describe('update command', () => {
25
+ it('uses the package-manager helpers on the update-available path', async () => {
26
+ await withTempOpenChamberDataDir(async () => {
27
+ const originalWrite = process.stdout.write;
28
+ process.stdout.write = vi.fn(() => true);
29
+ const executeUpdate = vi.fn(() => ({ success: true, exitCode: 0 }));
30
+ const updateCommand = createUpdateCommand({
31
+ packageManagerPath: '/fake/package-manager.js',
32
+ serveCommand: vi.fn(),
33
+ importFromFilePath: vi.fn(async () => ({
34
+ checkForUpdates: vi.fn(async () => ({ available: true, version: '9.9.9' })),
35
+ detectPackageManager: vi.fn(() => 'npm'),
36
+ executeUpdate,
37
+ getCurrentVersion: vi.fn(() => '1.0.0'),
38
+ })),
39
+ });
40
+
41
+ try {
42
+ await updateCommand({ json: true });
43
+
44
+ expect(executeUpdate).toHaveBeenCalledWith('npm', { silent: true });
45
+ } finally {
46
+ process.stdout.write = originalWrite;
47
+ }
48
+ });
49
+ });
50
+ });
@@ -1 +1 @@
1
- import{R as s,j as e}from"./vendor-.bun-By2L9XvG.js";import{b as c}from"./index-DJHN0H4h.js";import{u as b,a as j,I as a}from"./useAppFontEffects-BPhei6aO.js";import{D as y}from"./main-DUn82Iwq.js";import"./NewWorktreeDialog-D7l2VA7o.js";import"./mobileLayoutPreference-Dio-WWkI.js";import"./SessionSwitcherDropdown-xaYa-FIx.js";function S(){const{t:n}=b(),{files:r}=j(),[t,x]=s.useState(null),[l,o]=s.useState(""),[p,m]=s.useState(!0),u=s.useRef(null),f=c(i=>i.pendingDiagramFile),d=s.useCallback(async i=>{m(!0),x(i);try{const g=await r?.readFile?.(i);g&&o(g.content)}catch{o("")}finally{m(!1)}},[r]);s.useEffect(()=>{if(!f)return;const i=c.getState().consumePendingDiagramFile();i&&d(i)},[d,f]);const h=s.useCallback(async()=>{const i=u.current?.getXml();t&&r?.writeFile&&i&&i!==l&&(await r.writeFile(t,i),o(i))},[t,r,l]),v=t?t.split("/").pop()||t:"";return t?p?e.jsx("div",{className:"flex h-full items-center justify-center p-3",children:e.jsx(a,{name:"loader-4",className:"size-4 animate-spin"})}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 px-3 py-1.5",children:[e.jsx(a,{name:"file",className:"size-4 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"typography-ui text-muted-foreground truncate flex-1",children:v}),e.jsx("button",{type:"button",onClick:()=>{h()},className:"size-6 flex items-center justify-center rounded-md text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",title:n("filesView.diagram.saveDiagram"),children:e.jsx(a,{name:"save-3",className:"size-4"})}),e.jsx("button",{type:"button",onClick:()=>c.getState().setActiveMainTab("chat"),className:"size-6 flex items-center justify-center rounded-md text-muted-foreground hover:bg-interactive-hover/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",title:n("filesView.diagram.closeDiagramView"),children:e.jsx(a,{name:"close",className:"size-4"})})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(y,{ref:u,xml:l,className:"h-full"})})]}):e.jsx("div",{className:"flex h-full items-center justify-center p-3",children:e.jsx("div",{className:"typography-ui text-muted-foreground",children:n("filesView.editor.pickFileFromTree")})})}export{S as DiagramView};
1
+ import{R as s,j as e}from"./vendor-.bun-By2L9XvG.js";import{b as c}from"./index-AsCHiJ5P.js";import{u as b,a as j,I as a}from"./useAppFontEffects-B66TruVB.js";import{D as y}from"./main-BByFAmjA.js";import"./NewWorktreeDialog-Dj6KETex.js";import"./mobileLayoutPreference-Dio-WWkI.js";import"./SessionSwitcherDropdown-Cn_yoQrm.js";function S(){const{t:n}=b(),{files:r}=j(),[t,x]=s.useState(null),[l,o]=s.useState(""),[p,m]=s.useState(!0),u=s.useRef(null),f=c(i=>i.pendingDiagramFile),d=s.useCallback(async i=>{m(!0),x(i);try{const g=await r?.readFile?.(i);g&&o(g.content)}catch{o("")}finally{m(!1)}},[r]);s.useEffect(()=>{if(!f)return;const i=c.getState().consumePendingDiagramFile();i&&d(i)},[d,f]);const h=s.useCallback(async()=>{const i=u.current?.getXml();t&&r?.writeFile&&i&&i!==l&&(await r.writeFile(t,i),o(i))},[t,r,l]),v=t?t.split("/").pop()||t:"";return t?p?e.jsx("div",{className:"flex h-full items-center justify-center p-3",children:e.jsx(a,{name:"loader-4",className:"size-4 animate-spin"})}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 px-3 py-1.5",children:[e.jsx(a,{name:"file",className:"size-4 shrink-0 text-muted-foreground"}),e.jsx("span",{className:"typography-ui text-muted-foreground truncate flex-1",children:v}),e.jsx("button",{type:"button",onClick:()=>{h()},className:"size-6 flex items-center justify-center rounded-md text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",title:n("filesView.diagram.saveDiagram"),children:e.jsx(a,{name:"save-3",className:"size-4"})}),e.jsx("button",{type:"button",onClick:()=>c.getState().setActiveMainTab("chat"),className:"size-6 flex items-center justify-center rounded-md text-muted-foreground hover:bg-interactive-hover/50 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",title:n("filesView.diagram.closeDiagramView"),children:e.jsx(a,{name:"close",className:"size-4"})})]}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(y,{ref:u,xml:l,className:"h-full"})})]}):e.jsx("div",{className:"flex h-full items-center justify-center p-3",children:e.jsx("div",{className:"typography-ui text-muted-foreground",children:n("filesView.editor.pickFileFromTree")})})}export{S as DiagramView};
@@ -1,4 +1,4 @@
1
- import{cc as $e,cd as Pe,ce as re,cf as it,R as x,e as B,cg as ct,ch as lt,ci as dt,j as X}from"./vendor-.bun-By2L9XvG.js";import{eT as ut,eU as mt,eV as ft,eW as pt,eX as Oe,eY as ht,eZ as bt,p as ce,cR as gt,cS as wt,a as De,b as Be,e_ as He,m as qe,dy as yt,r as ye,u as kt,e$ as Et,f0 as At,au as vt,f1 as ke,f2 as Ct,f3 as St,f4 as xt,f5 as Nt,c1 as Mt}from"./useAppFontEffects-BPhei6aO.js";import{w as be,b as ge,h as Tt,j as Lt,e as Rt}from"./index-DJHN0H4h.js";const G=t=>t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),_t=t=>/^\[[^\]]+\]:\s+\S+/m.test(t)||/^\[\^[^\]]+\]:\s+/m.test(t),Ft=t=>{const e=t.match(/^[ \t]{0,3}(`{3,}|~{3,})/);if(!e)return!1;const n=e[1];if(!n)return!1;const r=n[0],s=n.length,o=t.trimEnd().split(`
1
+ import{cc as $e,cd as Pe,ce as re,cf as it,R as x,e as B,cg as ct,ch as lt,ci as dt,j as X}from"./vendor-.bun-By2L9XvG.js";import{eT as ut,eU as mt,eV as ft,eW as pt,eX as Oe,eY as ht,eZ as bt,p as ce,cR as gt,cS as wt,a as De,b as Be,e_ as He,m as qe,dy as yt,r as ye,u as kt,e$ as Et,f0 as At,au as vt,f1 as ke,f2 as Ct,f3 as St,f4 as xt,f5 as Nt,c1 as Mt}from"./useAppFontEffects-B66TruVB.js";import{w as be,b as ge,h as Tt,j as Lt,e as Rt}from"./index-AsCHiJ5P.js";const G=t=>t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),_t=t=>/^\[[^\]]+\]:\s+\S+/m.test(t)||/^\[\^[^\]]+\]:\s+/m.test(t),Ft=t=>{const e=t.match(/^[ \t]{0,3}(`{3,}|~{3,})/);if(!e)return!1;const n=e[1];if(!n)return!1;const r=n[0],s=n.length,o=t.trimEnd().split(`
2
2
  `).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${r}{${s},}[\\t ]*$`).test(o)},Z=t=>{try{return it(t,{linkMode:"text-only"})}catch{return t}},It=(t,e)=>{if(!e)return[{raw:t,src:t,mode:"full",highlight:!0}];if(_t(t))return[{raw:t,src:Z(t),mode:"live",highlight:!0}];let n;try{n=$e.lexer(t)}catch{return[{raw:t,src:Z(t),mode:"live",highlight:!0}]}let r=-1;for(let o=n.length-1;o>=0;o-=1)if(n[o]?.type!=="space"){r=o;break}if(r<0)return[{raw:t,src:Z(t),mode:"live",highlight:!0}];const s=[];for(let o=0;o<n.length;o+=1){const i=n[o];if(!i||i.type==="space")continue;const a=i.raw??"",c=o===r,l=i.type==="code"&&Ft(a);s.push({raw:a,src:l?a:Z(a),mode:c?"live":"full",highlight:!l})}return s.length===0?[{raw:t,src:Z(t),mode:"live",highlight:!0}]:s},We=(t,e,n)=>{try{return Pe.renderToString(t,{displayMode:n,throwOnError:!1})}catch{return e}},$t={name:"inlineMath",level:"inline",start(t){const e=t.indexOf("\\(");return e<0?void 0:e},tokenizer(t){const e=/^\\\(([\s\S]+?)\\\)/.exec(t);if(e)return{type:"inlineMath",raw:e[0],text:e[1]??""}},renderer(t){const e=t;return We(e.text,e.raw,!1)}},Pt={name:"blockMath",level:"block",start(t){const e=t.indexOf("\\[");return e<0?void 0:e},tokenizer(t){const e=/^\\\[([\s\S]+?)\\\]/.exec(t);if(e)return{type:"blockMath",raw:e[0],text:e[1]??""}},renderer(t){const e=t;return We(e.text,e.raw,!0)}},je=$e.use({gfm:!0,breaks:!1,extensions:[$t,Pt],renderer:{link({href:t,title:e,text:n}){const r=t??"",s=ut(r);if(s)return`<a href="${G(ft(s))}" data-openchamber-agent-mention="true" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">${n}</a>`;const o=mt(r);if(o)return`<a href="${G(r)}" data-skill-name="${G(o)}" class="text-primary hover:underline">${n}</a>`;const i=e?` title="${G(e)}"`:"";return`<a href="${G(r)}"${i} class="external-link" target="_blank" rel="noopener noreferrer">${n}</a>`}}}),Ot=t=>t.replace(/\$\$([\s\S]*?)\$\$/g,(e,n)=>{try{return Pe.renderToString(n,{displayMode:!0,throwOnError:!1})}catch{return`$$${n}$$`}}),ze=t=>{if(t.indexOf("$")===-1)return t;const e=/(<(?:pre|code|kbd)[^>]*>[\s\S]*?<\/(?:pre|code|kbd)>)/gi;return t.split(e).map((n,r)=>r%2===1?n:Ot(n)).join("")},Dt=/<pre><code(?:\s+class="language-([^"]*)")?>([\s\S]*?)<\/code><\/pre>/g,Bt=1200,Ht=200,qt=(t,e)=>{let n=1;for(let r=0;r<t.length;r+=1)if(t.charCodeAt(r)===10&&++n>e)return!0;return!1},Wt=t=>t.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&amp;/g,"&"),jt=async t=>{const e=[...t.matchAll(Dt)];if(e.length===0)return t;const n=be()?Ht:Bt;let r=t;for(const s of e){const[o,i,a]=s,c=(i||"text").toLowerCase();if(c==="mermaid")continue;const l=Wt(a??"");if(qt(l,n)){r=r.replace(o,()=>o.replace("<pre",`<pre data-md-lang="${c}"`));continue}const d=await pt(l,c);if(d){const m=d.replace(/^<pre/,`<pre data-md-lang="${c}"`);r=r.replace(o,()=>m)}}return r},zt={USE_PROFILES:{html:!0,mathMl:!0,svg:!0},ADD_TAGS:["svg","path","g","rect","line","polygon","polyline","circle","ellipse","text","tspan","defs","marker"],ADD_ATTR:["d","viewBox","preserveAspectRatio","xmlns","target","fill","stroke","stroke-width","transform","points","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","style"],FORBID_TAGS:["script"],FORBID_CONTENTS:["script"]};let Ee=!1;const Kt=()=>{Ee||typeof window>"u"||!re.isSupported||(Ee=!0,re.addHook("afterSanitizeAttributes",t=>{t instanceof HTMLAnchorElement&&t.target==="_blank"&&t.setAttribute("rel","noopener noreferrer")}))},Ke=t=>re.isSupported?(Kt(),re.sanitize(t,zt)):"",Vt=240,K=new Map,Ut=t=>{let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t.charCodeAt(n),e=Math.imul(e,16777619);return(e>>>0).toString(36)},Ae=(t,e)=>{if(K.delete(t),K.set(t,e),K.size<=Vt)return;const n=K.keys().next().value;n&&K.delete(n)},Gt=async t=>{const e=await Promise.resolve(je.parse(t.src)),n=ze(e),r=t.highlight?await jt(n):n;return Ke(r)},Zt=t=>{if(!t)return"";const e=je.parse(t),n=ze(e);return Ke(n)},Xt=async(t,e,n)=>{if(!t)return[];const r=It(t,e);return Promise.all(r.map(async(s,o)=>{const i=Ut(s.raw),a=`${i}:${s.mode}:${s.highlight?1:0}`,c=`${n}:${o}:${s.mode}`,l=K.get(c);if(l&&l.hash===i)return Ae(c,l),{id:a,html:l.html};const d=await Gt(s);return Ae(c,{hash:i,html:d}),{id:a,html:d}}))},le=t=>`<svg class="remixicon size-3.5" viewBox="0 0 24 24" aria-hidden="true"><use href="#oc-${t}"></use></svg>`,oe={copy:le("file-copy"),check:le("check"),download:le("download")},Ve="p-1 rounded hover:bg-interactive-hover/60 text-muted-foreground hover:text-foreground transition-colors",Y=(t,e)=>{t.innerHTML=e},U=(t,e,n)=>{const r=document.createElement("button");return r.type="button",r.className=Ve,r.setAttribute("data-md-action",n),r.setAttribute("title",e),r.setAttribute("aria-label",e),Y(r,oe[t]),r},ve=(t,e,n,r)=>{Y(t,oe.check),t.setAttribute("title",e),window.setTimeout(()=>{Y(t,oe[n]),t.setAttribute("title",r)},2e3)},Yt=t=>{const e=t.querySelectorAll(":not(pre) > code");for(const n of Array.from(e))n.getAttribute("data-markdown")!=="inline-code"&&n.setAttribute("data-markdown","inline-code")},Jt=(t,e)=>{const n=t.querySelectorAll("pre");for(const r of Array.from(n)){if(r.querySelector("code.language-mermaid"))continue;const s=r.parentElement;if(!s||s.closest('[data-component="markdown-code"]'))continue;const o=r.querySelector("code")?.className.match(/language-([\w+#.-]+)/)?.[1],i=r.getAttribute("data-md-lang")??o??"text",a=document.createElement("div");a.setAttribute("data-component","markdown-code"),a.className="my-4 group overflow-hidden rounded-2xl border border-border/80 bg-[var(--surface-elevated)]";const c=document.createElement("div");c.className="flex items-center justify-between border-b border-border/70 px-3 py-1.5";const l=document.createElement("span");l.className="font-mono text-[13px] text-muted-foreground",l.textContent=i;const d=U("copy",e.copy,"copy-code");c.appendChild(l),c.appendChild(d);const m=document.createElement("div");m.className="px-3 py-2.5 overflow-x-auto",s.replaceChild(a,r),r.style.margin="0",r.style.background="transparent",m.appendChild(r),a.appendChild(c),a.appendChild(m)}},Ce=t=>{const e=[],n=[],r=t.querySelectorAll("thead th");for(const o of Array.from(r))e.push((o.textContent??"").trim());const s=t.querySelectorAll("tbody tr");for(const o of Array.from(s)){const i=Array.from(o.querySelectorAll("td")).map(a=>(a.textContent??"").trim());i.length>0&&n.push(i)}return{headers:e,rows:n}},Qt=t=>/[",\n]/.test(t)?`"${t.replace(/"/g,'""')}"`:t,Se=({headers:t,rows:e})=>[t,...e].map(n=>n.map(Qt).join(",")).join(`
3
3
  `),en=({headers:t,rows:e})=>[t,...e].map(n=>n.join(" ")).join(`
4
4
  `),xe=({headers:t,rows:e})=>{const n=`| ${t.join(" | ")} |`,r=`| ${t.map(()=>"---").join(" | ")} |`,s=e.map(o=>`| ${o.join(" | ")} |`).join(`
@@ -1 +1 @@
1
- import{e as _,R as k,j as n,bi as D,bh as C,bg as I,be as M,bc as S}from"./vendor-.bun-By2L9XvG.js";import{u as z,m as w,I as O}from"./useAppFontEffects-BPhei6aO.js";import{M as P}from"./main-DUn82Iwq.js";import"./index-DJHN0H4h.js";import"./NewWorktreeDialog-D7l2VA7o.js";import"./mobileLayoutPreference-Dio-WWkI.js";import"./SessionSwitcherDropdown-xaYa-FIx.js";const G=R=>{const e=_.c(33),{open:y,onOpenChange:t,initialPrompt:v}=R,i=k.useId(),{t:o}=z(),N=B;let s;e[0]!==t?(s=j=>{!j&&N()||t(j)},e[0]=t,e[1]=s):s=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(D,{className:w("fixed inset-0 z-50 bg-black/50 dark:bg-black/75","transition-opacity duration-150 ease-out","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0")}),e[2]=g):g=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=w("relative pointer-events-auto","w-[90vw] max-w-[720px] h-[680px] max-h-[85vh]","flex flex-col rounded-xl border shadow-none overflow-hidden origin-center","bg-background","transition-all duration-150 ease-out","data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98]","data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]"),e[3]=h):h=e[3];let a;e[4]!==t?(a=()=>t(!1),e[4]=t,e[5]=a):a=e[5];let l;e[6]!==o?(l=o("multiRun.window.actions.closeAria"),e[6]=o,e[7]=l):l=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(O,{name:"close",className:"h-5 w-5"}),e[8]=x):x=e[8];let r;e[9]!==a||e[10]!==l?(r=n.jsx("div",{className:"absolute right-0.5 top-0.5 z-50",children:n.jsx("button",{type:"button",onClick:a,"aria-label":l,className:"inline-flex h-7 w-7 items-center justify-center rounded-md p-0.5 text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",children:x})}),e[9]=a,e[10]=l,e[11]=r):r=e[11];let c;e[12]!==o?(c=o("multiRun.window.description"),e[12]=o,e[13]=c):c=e[13];let d;e[14]!==i||e[15]!==c?(d=n.jsx(C,{id:i,className:"sr-only",children:c}),e[14]=i,e[15]=c,e[16]=d):d=e[16];let u,m;e[17]!==t?(u=()=>t(!1),m=()=>t(!1),e[17]=t,e[18]=u,e[19]=m):(u=e[18],m=e[19]);let f;e[20]!==v||e[21]!==u||e[22]!==m?(f=n.jsx(P,{initialPrompt:v,onCreated:u,onCancel:m,isWindowed:!0}),e[20]=v,e[21]=u,e[22]=m,e[23]=f):f=e[23];let p;e[24]!==i||e[25]!==f||e[26]!==r||e[27]!==d?(p=n.jsxs(I,{children:[g,n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center pointer-events-none",children:n.jsxs(M,{"aria-describedby":i,className:h,children:[r,d,f]})})]}),e[24]=i,e[25]=f,e[26]=r,e[27]=d,e[28]=p):p=e[28];let b;return e[29]!==y||e[30]!==s||e[31]!==p?(b=n.jsx(S,{open:y,onOpenChange:s,children:p}),e[29]=y,e[30]=s,e[31]=p,e[32]=b):b=e[32],b};function B(){return typeof document>"u"?!1:!!document.querySelector('[data-slot="dropdown-menu-content"][data-open], [data-slot="select-content"][data-open]')}export{G as MultiRunWindow};
1
+ import{e as _,R as k,j as n,bi as D,bh as C,bg as I,be as M,bc as S}from"./vendor-.bun-By2L9XvG.js";import{u as z,m as w,I as O}from"./useAppFontEffects-B66TruVB.js";import{M as P}from"./main-BByFAmjA.js";import"./index-AsCHiJ5P.js";import"./NewWorktreeDialog-Dj6KETex.js";import"./mobileLayoutPreference-Dio-WWkI.js";import"./SessionSwitcherDropdown-Cn_yoQrm.js";const G=R=>{const e=_.c(33),{open:y,onOpenChange:t,initialPrompt:v}=R,i=k.useId(),{t:o}=z(),N=B;let s;e[0]!==t?(s=j=>{!j&&N()||t(j)},e[0]=t,e[1]=s):s=e[1];let g;e[2]===Symbol.for("react.memo_cache_sentinel")?(g=n.jsx(D,{className:w("fixed inset-0 z-50 bg-black/50 dark:bg-black/75","transition-opacity duration-150 ease-out","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0")}),e[2]=g):g=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=w("relative pointer-events-auto","w-[90vw] max-w-[720px] h-[680px] max-h-[85vh]","flex flex-col rounded-xl border shadow-none overflow-hidden origin-center","bg-background","transition-all duration-150 ease-out","data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98]","data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]"),e[3]=h):h=e[3];let a;e[4]!==t?(a=()=>t(!1),e[4]=t,e[5]=a):a=e[5];let l;e[6]!==o?(l=o("multiRun.window.actions.closeAria"),e[6]=o,e[7]=l):l=e[7];let x;e[8]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(O,{name:"close",className:"h-5 w-5"}),e[8]=x):x=e[8];let r;e[9]!==a||e[10]!==l?(r=n.jsx("div",{className:"absolute right-0.5 top-0.5 z-50",children:n.jsx("button",{type:"button",onClick:a,"aria-label":l,className:"inline-flex h-7 w-7 items-center justify-center rounded-md p-0.5 text-muted-foreground hover:text-foreground hover:bg-interactive-hover/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",children:x})}),e[9]=a,e[10]=l,e[11]=r):r=e[11];let c;e[12]!==o?(c=o("multiRun.window.description"),e[12]=o,e[13]=c):c=e[13];let d;e[14]!==i||e[15]!==c?(d=n.jsx(C,{id:i,className:"sr-only",children:c}),e[14]=i,e[15]=c,e[16]=d):d=e[16];let u,m;e[17]!==t?(u=()=>t(!1),m=()=>t(!1),e[17]=t,e[18]=u,e[19]=m):(u=e[18],m=e[19]);let f;e[20]!==v||e[21]!==u||e[22]!==m?(f=n.jsx(P,{initialPrompt:v,onCreated:u,onCancel:m,isWindowed:!0}),e[20]=v,e[21]=u,e[22]=m,e[23]=f):f=e[23];let p;e[24]!==i||e[25]!==f||e[26]!==r||e[27]!==d?(p=n.jsxs(I,{children:[g,n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center pointer-events-none",children:n.jsxs(M,{"aria-describedby":i,className:h,children:[r,d,f]})})]}),e[24]=i,e[25]=f,e[26]=r,e[27]=d,e[28]=p):p=e[28];let b;return e[29]!==y||e[30]!==s||e[31]!==p?(b=n.jsx(S,{open:y,onOpenChange:s,children:p}),e[29]=y,e[30]=s,e[31]=p,e[32]=b):b=e[32],b};function B(){return typeof document>"u"?!1:!!document.querySelector('[data-slot="dropdown-menu-content"][data-open], [data-slot="select-content"][data-open]')}export{G as MultiRunWindow};