@dyyz1993/codenomad 0.15.2 → 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,7 +149,7 @@ export class BackgroundProcessManager {
149
149
  }
150
150
  async readOutput(workspaceId, processId, options) {
151
151
  const outputPath = this.getOutputPath(workspaceId, processId);
152
- if (!existsSync(outputPath)) {
152
+ if (!outputPath || !existsSync(outputPath)) {
153
153
  return { id: processId, content: "", truncated: false, sizeBytes: 0 };
154
154
  }
155
155
  const stats = await fs.stat(outputPath);
@@ -184,7 +184,7 @@ export class BackgroundProcessManager {
184
184
  }
185
185
  async streamOutput(workspaceId, processId, reply) {
186
186
  const outputPath = this.getOutputPath(workspaceId, processId);
187
- if (!existsSync(outputPath)) {
187
+ if (!outputPath || !existsSync(outputPath)) {
188
188
  reply.code(404).send({ error: "Output not found" });
189
189
  return;
190
190
  }
@@ -356,6 +356,9 @@ export class BackgroundProcessManager {
356
356
  }
357
357
  async ensureProcessDir(workspaceId, processId) {
358
358
  const root = await this.ensureWorkspaceDir(workspaceId);
359
+ if (!root) {
360
+ throw new Error("Workspace not found");
361
+ }
359
362
  const processDir = path.join(root, processId);
360
363
  await fs.mkdir(processDir, { recursive: true });
361
364
  return processDir;
@@ -363,7 +366,7 @@ export class BackgroundProcessManager {
363
366
  async ensureWorkspaceDir(workspaceId) {
364
367
  const workspace = this.deps.workspaceManager.get(workspaceId);
365
368
  if (!workspace) {
366
- throw new Error("Workspace not found");
369
+ return null;
367
370
  }
368
371
  const root = path.join(workspace.path, ROOT_DIR, workspaceId);
369
372
  await fs.mkdir(root, { recursive: true });
@@ -372,7 +375,7 @@ export class BackgroundProcessManager {
372
375
  getOutputPath(workspaceId, processId) {
373
376
  const workspace = this.deps.workspaceManager.get(workspaceId);
374
377
  if (!workspace) {
375
- throw new Error("Workspace not found");
378
+ return null;
376
379
  }
377
380
  return path.join(workspace.path, ROOT_DIR, workspaceId, processId, OUTPUT_FILE);
378
381
  }
@@ -382,6 +385,8 @@ export class BackgroundProcessManager {
382
385
  }
383
386
  async readIndex(workspaceId) {
384
387
  const indexPath = await this.getIndexPath(workspaceId);
388
+ if (!indexPath)
389
+ return [];
385
390
  if (!existsSync(indexPath))
386
391
  return [];
387
392
  try {
@@ -411,13 +416,15 @@ export class BackgroundProcessManager {
411
416
  }
412
417
  async writeIndex(workspaceId, records) {
413
418
  const indexPath = await this.getIndexPath(workspaceId);
419
+ if (!indexPath)
420
+ return;
414
421
  await fs.mkdir(path.dirname(indexPath), { recursive: true });
415
422
  await fs.writeFile(indexPath, JSON.stringify(records, null, 2));
416
423
  }
417
424
  async getIndexPath(workspaceId) {
418
425
  const workspace = this.deps.workspaceManager.get(workspaceId);
419
426
  if (!workspace) {
420
- throw new Error("Workspace not found");
427
+ return null;
421
428
  }
422
429
  return path.join(workspace.path, ROOT_DIR, workspaceId, INDEX_FILE);
423
430
  }
@@ -439,7 +446,7 @@ export class BackgroundProcessManager {
439
446
  }
440
447
  async getOutputSize(workspaceId, processId) {
441
448
  const outputPath = this.getOutputPath(workspaceId, processId);
442
- if (!existsSync(outputPath)) {
449
+ if (!outputPath || !existsSync(outputPath)) {
443
450
  return 0;
444
451
  }
445
452
  try {
@@ -475,6 +482,11 @@ export class BackgroundProcessManager {
475
482
  };
476
483
  }
477
484
  async finalizeRecord(workspaceId, record, completion) {
485
+ if (!this.deps.workspaceManager.get(workspaceId)) {
486
+ this.deps.logger.debug({ workspaceId, processId: record.id }, "Skipping finalizeRecord: workspace already removed");
487
+ this.running.delete(record.id);
488
+ return;
489
+ }
478
490
  if (this.shouldSendCompletionPrompt(record, completion)) {
479
491
  try {
480
492
  await this.sendCompletionPrompt(workspaceId, record);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyyz1993/codenomad",
3
- "version": "0.15.2",
3
+ "version": "0.15.4",
4
4
  "description": "CodeNomad Server",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-YY9yfE-p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as K}from"./index-BCGPLzO4.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-YY9yfE-p.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-BD79zzZs.js";import{S as H}from"./SplitFilePanel-CA0D92l1.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-DBbZ3aZQ.js";import"./align-justify-BnvEPTpu.js";import"./wrap-text-B7hZaBx4.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
2
+ import{_ as K}from"./index-BCGPLzO4.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-YY9yfE-p.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-QnXHmp3q.js";import{S as H}from"./SplitFilePanel-CA0D92l1.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-Bnnuz06l.js";import"./align-justify-B0Fj8sHg.js";import"./wrap-text-Cx3H2UIz.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
@@ -1 +1 @@
1
- import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-YY9yfE-p.js";import{u as T}from"./index-BCGPLzO4.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,K as I}from"./main-DBbZ3aZQ.js";import{A as D}from"./align-justify-BnvEPTpu.js";import{W as E}from"./wrap-text-B7hZaBx4.js";const F=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],H=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:F}));var N=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(D,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(H,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
1
+ import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-YY9yfE-p.js";import{u as T}from"./index-BCGPLzO4.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,K as I}from"./main-Bnnuz06l.js";import{A as D}from"./align-justify-B0Fj8sHg.js";import{W as E}from"./wrap-text-Cx3H2UIz.js";const F=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],H=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:F}));var N=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(D,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(H,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-YY9yfE-p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as G}from"./index-BCGPLzO4.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-YY9yfE-p.js";import{n as o,m as Y,d as A,b as P,c as $,S as g,a as w,z as p,A as ee,F as te}from"./git-diff-vendor-CSgooKT_.js";import{S as le}from"./SplitFilePanel-CA0D92l1.js";import{I as ne,R as K,M as re,N as ae,C as ie,e as se,O as oe}from"./main-DBbZ3aZQ.js";import{W as ce}from"./wrap-text-B7hZaBx4.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const de=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],he=e=>o(ne,Y(e,{name:"Save",iconNode:de}));var ue=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),ve=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),O=h('<div class="p-3 text-xs text-secondary">'),fe=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ge=h('<div class="p-3 text-xs text-error">'),we=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),k=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Se=h('<div class="file-viewer-panel flex-1"><div>'),be=h('<div class="h-full outline-none"tabindex=0>'),me=h("<span>"),$e=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),ye=h("<button type=button style=margin-inline-start:auto>"),_e=h("<button type=button>"),q=h("<button type=button class=files-header-icon-button>"),Ce=h("<span class=text-error>");const ke=ee(()=>G(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function xe(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const Ie=e=>{const[E,L]=A(""),{isDark:N}=J(),[Q,M]=A(!1);let S;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),x=$(()=>{const n=W(),i=H();return n?i.filter(d=>String(d.name||"").toLowerCase().includes(n)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,Z=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>xe(e.browserSelectedPath())),b=$(()=>_()&&Q());P(()=>{_()||M(!1)});const D=()=>{const n=e.browserSelectedContent();n!=null&&e.onSave(n)},j=async(n,i)=>{i==null||i.stopPropagation();const d=await se(n);oe({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{b()&&requestAnimationFrame(()=>S==null?void 0:S.focus())});const T=()=>[(()=>{var n=ue(),i=n.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ae,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),r=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),t},{e:void 0,t:void 0}),w(()=>l.value=E()),n})(),(()=>{var n=ve(),i=n.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>x().length),n})(),o(g,{get when(){return e.parentPath()},children:n=>(()=>{var i=fe(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(n()),w(()=>u(l,"title",n())),i})()}),o(g,{get when(){return y()},get children(){var n=O();return s(n,()=>e.t("instanceInfo.loading")),n}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&x().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var n=ge();return s(n,()=>e.browserError()),n})():(()=>{var n=O();return s(n,Z),n})():void 0},get children(){return o(te,{get each(){return x()},children:n=>(()=>{var i=we(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,r=a.firstChild,c=r.firstChild,f=r.nextSibling;return i.$$click=()=>{if(n.type==="directory"){e.onLoadEntries(n.path);return}e.onRequestOpenFile(n.path)},s(t,()=>n.name),s(c,()=>n.type),f.$$click=v=>void j(n.path,v),s(f,o(ie,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===n.path?"file-list-item-active":""}`,z=n.path,I=n.path,R=e.t("instanceShell.filesShell.actions.copyPath"),V=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),I!==v.a&&u(l,"title",v.a=I),R!==v.o&&u(f,"title",v.o=R),V!==v.i&&u(f,"aria-label",v.i=V),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],B=n=>{!(n.ctrlKey||n.metaKey)||n.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(n.preventDefault(),D())};return m(()=>{const n=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=Se(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=k(),r=a.firstChild;return s(r,i),a})()},children:a=>o(g,{get when(){return b()},get fallback(){return o(p,{get fallback(){return(()=>{var r=k(),c=r.firstChild;return s(c,()=>e.t("instanceInfo.loading")),r})()},get children(){return o(ke,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var r=be();r.$$mousedown=()=>S==null?void 0:S.focus(),r.$$keydown=B;var c=S;return typeof c=="function"?U(c,r):S=r,s(r,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return N()},escapeRawHtml:!0})),r}})})},children:a=>(()=>{var r=k(),c=r.firstChild;return s(c,a),r})()})},get children(){var a=k(),r=a.firstChild;return s(r,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,b()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(le,{get header(){return[(()=>{var l=$e(),t=l.firstChild,a=t.firstChild,r=a.firstChild;return s(r,n),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=me();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=Ce();return s(f,c),f})()}),null),w(()=>u(a,"title",n())),l})(),(()=>{var l=ye();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!b());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${b()?" active":""}`,r=!_();return a!==t.e&&C(l,t.e=a),r!==t.t&&(l.disabled=t.t=r),t},{e:void 0,t:void 0}),l})(),(()=>{var l=_e();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(ce,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,r=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=b();return a!==t.e&&C(l,t.e=a),r!==t.t&&u(l,"title",t.t=r),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=q();return l.$$click=D,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(he,{class:"h-4 w-4"})},get children(){return o(K,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",r=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=q();return l.$$click=()=>e.onRefresh(),s(l,o(K,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),r=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(T,{}),overlay:()=>o(T,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};X(["input","click","keydown","mousedown"]);export{Ie as default};
2
+ import{_ as G}from"./index-BCGPLzO4.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-YY9yfE-p.js";import{n as o,m as Y,d as A,b as P,c as $,S as g,a as w,z as p,A as ee,F as te}from"./git-diff-vendor-CSgooKT_.js";import{S as le}from"./SplitFilePanel-CA0D92l1.js";import{I as ne,R as K,M as re,N as ae,C as ie,e as se,O as oe}from"./main-Bnnuz06l.js";import{W as ce}from"./wrap-text-Cx3H2UIz.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const de=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],he=e=>o(ne,Y(e,{name:"Save",iconNode:de}));var ue=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),ve=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),O=h('<div class="p-3 text-xs text-secondary">'),fe=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ge=h('<div class="p-3 text-xs text-error">'),we=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),k=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Se=h('<div class="file-viewer-panel flex-1"><div>'),be=h('<div class="h-full outline-none"tabindex=0>'),me=h("<span>"),$e=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),ye=h("<button type=button style=margin-inline-start:auto>"),_e=h("<button type=button>"),q=h("<button type=button class=files-header-icon-button>"),Ce=h("<span class=text-error>");const ke=ee(()=>G(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function xe(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const Ie=e=>{const[E,L]=A(""),{isDark:N}=J(),[Q,M]=A(!1);let S;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),x=$(()=>{const n=W(),i=H();return n?i.filter(d=>String(d.name||"").toLowerCase().includes(n)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,Z=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>xe(e.browserSelectedPath())),b=$(()=>_()&&Q());P(()=>{_()||M(!1)});const D=()=>{const n=e.browserSelectedContent();n!=null&&e.onSave(n)},j=async(n,i)=>{i==null||i.stopPropagation();const d=await se(n);oe({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{b()&&requestAnimationFrame(()=>S==null?void 0:S.focus())});const T=()=>[(()=>{var n=ue(),i=n.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ae,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),r=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),t},{e:void 0,t:void 0}),w(()=>l.value=E()),n})(),(()=>{var n=ve(),i=n.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>x().length),n})(),o(g,{get when(){return e.parentPath()},children:n=>(()=>{var i=fe(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(n()),w(()=>u(l,"title",n())),i})()}),o(g,{get when(){return y()},get children(){var n=O();return s(n,()=>e.t("instanceInfo.loading")),n}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&x().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var n=ge();return s(n,()=>e.browserError()),n})():(()=>{var n=O();return s(n,Z),n})():void 0},get children(){return o(te,{get each(){return x()},children:n=>(()=>{var i=we(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,r=a.firstChild,c=r.firstChild,f=r.nextSibling;return i.$$click=()=>{if(n.type==="directory"){e.onLoadEntries(n.path);return}e.onRequestOpenFile(n.path)},s(t,()=>n.name),s(c,()=>n.type),f.$$click=v=>void j(n.path,v),s(f,o(ie,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===n.path?"file-list-item-active":""}`,z=n.path,I=n.path,R=e.t("instanceShell.filesShell.actions.copyPath"),V=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),I!==v.a&&u(l,"title",v.a=I),R!==v.o&&u(f,"title",v.o=R),V!==v.i&&u(f,"aria-label",v.i=V),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],B=n=>{!(n.ctrlKey||n.metaKey)||n.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(n.preventDefault(),D())};return m(()=>{const n=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=Se(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=k(),r=a.firstChild;return s(r,i),a})()},children:a=>o(g,{get when(){return b()},get fallback(){return o(p,{get fallback(){return(()=>{var r=k(),c=r.firstChild;return s(c,()=>e.t("instanceInfo.loading")),r})()},get children(){return o(ke,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var r=be();r.$$mousedown=()=>S==null?void 0:S.focus(),r.$$keydown=B;var c=S;return typeof c=="function"?U(c,r):S=r,s(r,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return N()},escapeRawHtml:!0})),r}})})},children:a=>(()=>{var r=k(),c=r.firstChild;return s(c,a),r})()})},get children(){var a=k(),r=a.firstChild;return s(r,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,b()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(le,{get header(){return[(()=>{var l=$e(),t=l.firstChild,a=t.firstChild,r=a.firstChild;return s(r,n),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=me();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=Ce();return s(f,c),f})()}),null),w(()=>u(a,"title",n())),l})(),(()=>{var l=ye();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!b());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${b()?" active":""}`,r=!_();return a!==t.e&&C(l,t.e=a),r!==t.t&&(l.disabled=t.t=r),t},{e:void 0,t:void 0}),l})(),(()=>{var l=_e();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(ce,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,r=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=b();return a!==t.e&&C(l,t.e=a),r!==t.t&&u(l,"title",t.t=r),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=q();return l.$$click=D,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(he,{class:"h-4 w-4"})},get children(){return o(K,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",r=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=q();return l.$$click=()=>e.onRefresh(),s(l,o(K,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),r=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(T,{}),overlay:()=>o(T,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};X(["input","click","keydown","mousedown"]);export{Ie as default};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-YY9yfE-p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
2
- import{_ as se}from"./index-BCGPLzO4.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-YY9yfE-p.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-BD79zzZs.js";import{S as ge}from"./SplitFilePanel-CA0D92l1.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-DBbZ3aZQ.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-BnvEPTpu.js";import"./wrap-text-B7hZaBx4.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
2
+ import{_ as se}from"./index-BCGPLzO4.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-YY9yfE-p.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-QnXHmp3q.js";import{S as ge}from"./SplitFilePanel-CA0D92l1.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-Bnnuz06l.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-B0Fj8sHg.js";import"./wrap-text-Cx3H2UIz.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
@@ -1 +1 @@
1
- import{m as Pe,P as Xe,t as _,i as h,a as Ye,d as O,f as Ge}from"./monaco-viewer-YY9yfE-p.js";import{n as d,m as S,b as T,o as k,k as ee,l as te,q as ae,s as M,d as I,c as W,S as J,t as Qe,w as we,a as he,F as ge}from"./git-diff-vendor-CSgooKT_.js";import{I as ce,P as Ze,Q as F,T as re,U as Je,V as et,W as ke,X as Ie,Y as Te,Z as tt,_ as fe,$ as le,a0 as de,a1 as $e,a2 as ne,a3 as oe,a4 as nt,a5 as me,a6 as ot,a7 as st,a8 as A,a9 as be,aa as it,ab as rt,ac as lt,ad as R,ae as at,af as ct,ag as Se,H as dt,ah as pe,ai as ut,aj as gt,ak as ft,al as pt,am as ht}from"./main-DBbZ3aZQ.js";import{u as mt}from"./index-BCGPLzO4.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],vt=e=>d(ce,S(e,{name:"BellRing",iconNode:bt})),yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xt=e=>d(ce,S(e,{name:"Info",iconNode:yt})),Ct=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],wt=e=>d(ce,S(e,{name:"TerminalSquare",iconNode:Ct})),St=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pt=e=>d(ce,S(e,{name:"XOctagon",iconNode:St}));var De=ee();function kt(){return te(De)}function It(){const e=kt();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Oe(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Tt(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&Oe(n,l))return r+1}return 0}function $t(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),c=s.ref();return i===c||!i||!c?0:Oe(i,c)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function _e(e,o){const l=$t(e);e!==l&&o(l)}function Dt(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return re(r).body}function Ot(e,o){T(()=>{const l=setTimeout(()=>{_e(e(),o)});k(()=>clearTimeout(l))})}function _t(e,o){if(typeof IntersectionObserver!="function"){Ot(e,o);return}let l=[];T(()=>{const r=()=>{const s=!!l.length;l=e(),s&&_e(e(),o)},t=Dt(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}k(()=>n.disconnect())})}function Mt(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});_t(o,l);const r=n=>(l(s=>{const i=Tt(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(c=>c.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(De.Provider,{value:{registerItem:r},get children(){return n.children}})}}function Et(e){const o=It(),l=F({shouldRegisterItem:!0},e);T(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());k(r)})}var At={};be(At,{Arrow:()=>ke,Content:()=>Ee,Portal:()=>Ae,Root:()=>Re,Tooltip:()=>Z,Trigger:()=>Fe,useTooltipContext:()=>ue});var Me=ee();function ue(){const e=te(Me);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Ee(e){const o=ue(),l=F({id:o.generateId("content")},e),[r,t]=M(l,["ref","style"]);return T(()=>k(o.registerContentId(t.id))),d(J,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=ne(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return me({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ae(e){const o=ue();return d(J,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Rt(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,c=t.top+t.height/2;switch(r){case"top":s.push([t.left,c]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,c]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,c]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,c]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var H={},Ft=0,X=!1,E,Q,Y;function Re(e){const o=`tooltip-${ae()}`,l=`${++Ft}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=M(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,c]=I(),[a,f]=I(),[u,g]=I(),[y,v]=I(n.placement),x=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var P;return(P=t.onOpenChange)==null?void 0:P.call(t,b)}}),{present:$}=Te({show:()=>t.forceMount||x.isOpen(),element:()=>u()??null}),m=()=>{H[l]=C},w=()=>{for(const b in H)b!==l&&(H[b](!0),delete H[b])},C=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,x.close()):s||(s=window.setTimeout(()=>{s=void 0,x.close()},t.closeDelay)),window.clearTimeout(E),E=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(Y=window.setTimeout(()=>{window.clearTimeout(Y),Y=void 0},t.skipDelayDuration)),X&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete H[l],Q=void 0,X=!1},t.closeDelay))},p=()=>{clearTimeout(s),s=void 0,w(),m(),X=!0,x.open(),window.clearTimeout(E),E=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(Y),Y=void 0},q=()=>{w(),m(),!x.isOpen()&&!E&&!X?E=window.setTimeout(()=>{E=void 0,X=!0,p()},t.openDelay):x.isOpen()||p()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!Y?q():p()},z=()=>{window.clearTimeout(E),E=void 0,X=!1},B=()=>{window.clearTimeout(s),s=void 0},U=b=>fe(a(),b)||fe(u(),b),D=b=>{const P=a(),N=u();if(!(!P||!N))return Rt(b,P,N)},L=b=>{const P=b.target;if(U(P)){B();return}if(!t.ignoreSafeArea){const N=D(y());if(N&&ot(st(b),N)){B();return}}s||C()};T(()=>{if(!x.isOpen())return;const b=re();b.addEventListener("pointermove",L,!0),k(()=>{b.removeEventListener("pointermove",L,!0)})}),T(()=>{const b=a();if(!b||!x.isOpen())return;const P=ze=>{const Ve=ze.target;fe(Ve,b)&&C(!0)},N=tt();N.addEventListener("scroll",P,{capture:!0}),k(()=>{N.removeEventListener("scroll",P,{capture:!0})})}),k(()=>{clearTimeout(s),H[l]&&delete H[l]});const ie={dataset:W(()=>({"data-expanded":x.isOpen()?"":void 0,"data-closed":x.isOpen()?void 0:""})),isOpen:x.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:$,openTooltip:K,hideTooltip:C,cancelOpening:z,generateId:de(()=>r.id),registerContentId:le(c),isTargetOnTooltip:U,setTriggerRef:f,setContentRef:g};return d(Me.Provider,{value:ie,get children(){return d($e,S({anchorRef:a,contentRef:u,onCurrentPlacementChange:v},n))}})}function Fe(e){let o;const l=ue(),[r,t]=M(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const c=()=>{n=!1},a=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},f=m=>{l.isOpen()&&!s&&!i&&l.hideTooltip(m)},u=m=>{A(m,r.onPointerEnter),!(m.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||m.defaultPrevented)&&(s=!0,a())},g=m=>{A(m,r.onPointerLeave),m.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?f():l.cancelOpening())},y=m=>{A(m,r.onPointerDown),n=!0,re(o).addEventListener("pointerup",c,{once:!0})},v=m=>{A(m,r.onClick),s=!1,i=!1,f(!0)},x=m=>{A(m,r.onFocus),!(l.isDisabled()||m.defaultPrevented||n)&&(i=!0,a())},$=m=>{A(m,r.onBlur);const w=m.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,f(!0))};return k(()=>{re(o).removeEventListener("pointerup",c)}),d(oe,S({as:"button",ref(m){var w=ne(C=>{l.setTriggerRef(C),o=C},r.ref);typeof w=="function"&&w(m)},get"aria-describedby"(){return Pe(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:y,onClick:v,onFocus:x,onBlur:$},()=>l.dataset(),t))}var Z=Object.assign(Re,{Arrow:ke,Content:Ee,Portal:Ae,Trigger:Fe}),Kt={};be(Kt,{Collapsible:()=>Bt,Content:()=>ve,Root:()=>ye,Trigger:()=>xe,useCollapsibleContext:()=>se});var Ke=ee();function se(){const e=te(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function ve(e){const[o,l]=I(),r=se(),t=F({id:r.generateId("content")},e),[n,s]=M(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[c,a]=I(0),[f,u]=I(0);let y=r.isOpen()||i();return Qe(()=>{const v=requestAnimationFrame(()=>{y=!1});k(()=>{cancelAnimationFrame(v)})}),T(we(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const v=o().getBoundingClientRect();a(v.height),u(v.width),y||(o().style.transitionDuration="",o().style.animationName="")})),T(we(r.isOpen,v=>{!v&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),T(()=>k(r.registerContentId(n.id))),d(J,{get when(){return i()},get children(){return d(oe,S({as:"div",ref(v){var x=ne(l,n.ref);typeof x=="function"&&x(v)},get id(){return n.id},get style(){return me({"--kb-collapsible-content-height":c()?`${c()}px`:void 0,"--kb-collapsible-content-width":f()?`${f()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ye(e){const o=`collapsible-${ae()}`,l=F({id:o},e),[r,t]=M(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=I(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:f=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,f)}}),c=W(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),a={dataset:c,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:de(()=>t.id),registerContentId:le(s)};return d(Ke.Provider,{value:a,get children(){return d(oe,S({as:"div"},c,t))}})}function xe(e){const o=se(),[l,r]=M(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Pe(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{A(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Bt=Object.assign(ye,{Content:ve,Trigger:xe}),G={};be(G,{Accordion:()=>Lt,Content:()=>Ne,Header:()=>Ue,Item:()=>je,Root:()=>We,Trigger:()=>qe,useAccordionContext:()=>Ce});var Be=ee();function Le(){const e=te(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ne(e){const o=Le(),l=o.generateId("content"),r=F({id:l},e),[t,n]=M(r,["id","style"]);return T(()=>k(o.registerContentId(t.id))),d(ve,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return me({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=se();return d(oe,S({as:"h3"},()=>o.dataset(),e))}var He=ee();function Ce(){const e=te(He);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function je(e){const o=Ce(),l=`${o.generateId("item")}-${ae()}`,r=F({id:l},e),[t,n]=M(r,["value","disabled"]),[s,i]=I(),[c,a]=I(),f=()=>o.listState().selectionManager(),u=()=>f().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:c,generateId:de(()=>n.id),registerTriggerId:le(i),registerContentId:le(a)};return d(Be.Provider,{value:g,get children(){return d(ye,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function We(e){let o;const l=`accordion-${ae()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=M(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=I([]),{DomCollectionProvider:c}=Mt({items:s,onItemsChange:i}),a=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var y;return(y=t.onChange)==null?void 0:y.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});a.selectionManager().setFocusedKey("item-1");const f=lt({selectionManager:()=>a.selectionManager(),collection:()=>a.collection(),disallowEmptySelection:()=>a.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>a,generateId:de(()=>t.id)};return d(c,{get children(){return d(He.Provider,{value:u,get children(){return d(oe,S({as:"div",get id(){return t.id},ref(g){var y=ne(v=>o=v,t.ref);typeof y=="function"&&y(g)},get onKeyDown(){return R([t.onKeyDown,f.onKeyDown])},get onMouseDown(){return R([t.onMouseDown,f.onMouseDown])},get onFocusIn(){return R([t.onFocusIn])},get onFocusOut(){return R([t.onFocusOut,f.onFocusOut])}},n))}})}})}function qe(e){let o;const l=Ce(),r=Le(),t=se(),n=r.generateId("trigger"),s=F({id:n},e),[i,c]=M(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);Et({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const a=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),f=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),A(u,i.onKeyDown),A(u,a.onKeyDown)};return T(()=>k(r.registerTriggerId(c.id))),d(xe,S({ref(u){var g=ne(y=>o=y,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return a.dataKey()},get onPointerDown(){return R([i.onPointerDown,a.onPointerDown])},get onPointerUp(){return R([i.onPointerUp,a.onPointerUp])},get onClick(){return R([i.onClick,a.onClick])},onKeyDown:f,get onMouseDown(){return R([i.onMouseDown,a.onMouseDown])},get onFocus(){return R([i.onFocus,a.onFocus])}},c))}var Lt=Object.assign(We,{Content:Ne,Header:Ue,Item:je,Trigger:qe}),Nt=_('<div><div class="flex flex-wrap items-center gap-2 text-xs text-primary"><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary">');const Ut=e=>{const{t:o}=mt(),l=W(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=W(()=>l().inputTokens??0),t=W(()=>l().outputTokens??0),n=W(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=W(()=>`$${n().toFixed(2)}`);return(()=>{var i=Nt(),c=i.firstChild,a=c.firstChild,f=a.firstChild,u=f.nextSibling,g=a.nextSibling,y=g.firstChild,v=y.nextSibling,x=g.nextSibling,$=x.firstChild,m=$.nextSibling;return h(f,()=>o("contextUsagePanel.labels.input")),h(u,()=>Se(r())),h(y,()=>o("contextUsagePanel.labels.output")),h(v,()=>Se(t())),h($,()=>o("contextUsagePanel.labels.cost")),h(m,s),he(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var j=_('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ht=_('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),jt=_('<div class="flex flex-col gap-3 min-h-0"><div class="flex items-center justify-between gap-2 text-[11px] text-secondary"><span></span><span class="flex items-center gap-2"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)></span></span></div><div class="rounded-md border border-base bg-surface-secondary p-2 max-h-[40vh] overflow-y-auto"><div class="flex flex-col">'),Wt=_('<button type=button class="border-b border-base last:border-b-0 text-left hover:bg-surface-muted rounded-sm"><div class="flex items-center justify-between gap-3"><div class="text-xs font-mono text-primary min-w-0 flex-1 overflow-hidden whitespace-nowrap"style=text-overflow:ellipsis;direction:rtl;text-align:left;unicode-bidi:plaintext></div><div class="flex items-center gap-2 text-[11px] flex-shrink-0"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)>'),qt=_('<div class="flex flex-col gap-2">'),zt=_("<span>"),Vt=_('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Xt=_("<div class=status-tab-container>"),Yt=_("<span class=section-left><span class=section-label>");const nn=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var c=Ht(),a=c.firstChild,f=a.firstChild,u=f.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(a,d(ft,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),c})():(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.yoloMode.noSessionSelected")),c})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const c=e.activeSessionDiffs();if(c===void 0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(c)||c.length===0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const a=[...c].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),f=a.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=jt(),g=u.firstChild,y=g.firstChild,v=y.nextSibling,x=v.firstChild,$=x.nextSibling,m=g.nextSibling,w=m.firstChild;return h(y,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:a.length})),h(x,()=>`+${f.additions}`),h($,()=>`-${f.deletions}`),h(w,d(ge,{each:a,children:C=>(()=>{var p=Wt(),q=p.firstChild,K=q.firstChild,z=K.nextSibling,B=z.firstChild,U=B.nextSibling;return p.$$click=()=>e.onOpenChangesTab(C.file),h(K,()=>C.file),h(B,()=>`+${C.additions}`),h(U,()=>`-${C.deletions}`),he(D=>{var L=e.t("instanceShell.sessionChanges.actions.show"),V=C.file;return L!==D.e&&O(p,"title",D.e=L),V!==D.t&&O(K,"title",D.t=V),D},{e:void 0,t:void 0}),p})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.noSessionSelected")),a})();const c=e.latestTodoState();return c?d(pt,{state:c,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.empty")),a})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.backgroundProcesses.empty")),c})():(()=>{var c=qt();return h(c,d(ge,{each:i,children:a=>(()=>{var f=Vt(),u=f.firstChild,g=u.firstChild,y=g.nextSibling,v=y.firstChild,x=v.nextSibling,$=u.nextSibling,m=$.firstChild,w=m.nextSibling,C=w.nextSibling;return h(g,()=>a.title),h(v,d(vt,{class:"h-3.5 w-3.5"})),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:a.status})),h(y,d(J,{get when(){return typeof a.outputSizeBytes=="number"},get children(){var p=zt();return h(p,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((a.outputSizeBytes??0)/1024)})),p}}),null),m.$$click=()=>e.onOpenBackgroundOutput(a),h(m,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onStopBackgroundProcess(a.id),h(w,d(Pt,{class:"h-4 w-4"})),C.$$click=()=>e.onTerminateBackgroundProcess(a.id),h(C,d(ht,{class:"h-4 w-4"})),he(p=>{var q=!!a.notifyEnabled,K=!a.notifyEnabled,z=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),B=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),U=e.t("instanceShell.backgroundProcesses.actions.output"),D=e.t("instanceShell.backgroundProcesses.actions.output"),L=a.status!=="running",V=e.t("instanceShell.backgroundProcesses.actions.stop"),ie=e.t("instanceShell.backgroundProcesses.actions.stop"),b=e.t("instanceShell.backgroundProcesses.actions.terminate"),P=e.t("instanceShell.backgroundProcesses.actions.terminate");return q!==p.e&&v.classList.toggle("text-success",p.e=q),K!==p.t&&v.classList.toggle("text-tertiary",p.t=K),z!==p.a&&O(v,"aria-label",p.a=z),B!==p.o&&O(v,"title",p.o=B),U!==p.i&&O(m,"aria-label",p.i=U),D!==p.n&&O(m,"title",p.n=D),L!==p.s&&(w.disabled=p.s=L),V!==p.h&&O(w,"aria-label",p.h=V),ie!==p.r&&O(w,"title",p.r=ie),b!==p.d&&O(C,"aria-label",p.d=b),P!==p.l&&O(C,"title",p.l=P),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),f})()})),c})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=Xt();return h(i,d(J,{get when(){return e.activeSession()},children:c=>d(Ut,{get instanceId(){return e.instanceId},get sessionId(){return c().id},class:"status-tab-context-panel"})}),null),h(i,d(G.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(ge,{each:s,children:c=>d(G.Item,{get value(){return c.id},class:"right-panel-accordion-item",get children(){return[d(G.Header,{class:"right-panel-accordion-header-row",get children(){return[d(G.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var a=Yt(),f=a.firstChild;return h(f,()=>e.t(c.labelKey)),a})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(c.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Z,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Z.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(c.tooltipKey)},get children(){return d(xt,{class:"section-info-icon"})}}),d(Z.Portal,{get children(){return d(Z.Content,{class:"section-info-tooltip",get children(){return e.t(c.tooltipKey)}})}})]}})]}}),d(G.Content,{class:"right-panel-accordion-content",get children(){return c.render()}})]}})})}}),null),i})()};Ge(["click"]);export{nn as default};
1
+ import{m as Pe,P as Xe,t as _,i as h,a as Ye,d as O,f as Ge}from"./monaco-viewer-YY9yfE-p.js";import{n as d,m as S,b as T,o as k,k as ee,l as te,q as ae,s as M,d as I,c as W,S as J,t as Qe,w as we,a as he,F as ge}from"./git-diff-vendor-CSgooKT_.js";import{I as ce,P as Ze,Q as F,T as re,U as Je,V as et,W as ke,X as Ie,Y as Te,Z as tt,_ as fe,$ as le,a0 as de,a1 as $e,a2 as ne,a3 as oe,a4 as nt,a5 as me,a6 as ot,a7 as st,a8 as A,a9 as be,aa as it,ab as rt,ac as lt,ad as R,ae as at,af as ct,ag as Se,H as dt,ah as pe,ai as ut,aj as gt,ak as ft,al as pt,am as ht}from"./main-Bnnuz06l.js";import{u as mt}from"./index-BCGPLzO4.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const bt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],vt=e=>d(ce,S(e,{name:"BellRing",iconNode:bt})),yt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],xt=e=>d(ce,S(e,{name:"Info",iconNode:yt})),Ct=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],wt=e=>d(ce,S(e,{name:"TerminalSquare",iconNode:Ct})),St=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Pt=e=>d(ce,S(e,{name:"XOctagon",iconNode:St}));var De=ee();function kt(){return te(De)}function It(){const e=kt();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function Oe(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Tt(e,o){var t;const l=o.ref();if(!l)return-1;let r=e.length;if(!r)return-1;for(;r--;){const n=(t=e[r])==null?void 0:t.ref();if(n&&Oe(n,l))return r+1}return 0}function $t(e){const o=e.map((r,t)=>[t,r]);let l=!1;return o.sort(([r,t],[n,s])=>{const i=t.ref(),c=s.ref();return i===c||!i||!c?0:Oe(i,c)?(r>n&&(l=!0),-1):(r<n&&(l=!0),1)}),l?o.map(([r,t])=>t):e}function _e(e,o){const l=$t(e);e!==l&&o(l)}function Dt(e){var t,n;const o=e[0],l=(t=e[e.length-1])==null?void 0:t.ref();let r=(n=o==null?void 0:o.ref())==null?void 0:n.parentElement;for(;r;){if(l&&r.contains(l))return r;r=r.parentElement}return re(r).body}function Ot(e,o){T(()=>{const l=setTimeout(()=>{_e(e(),o)});k(()=>clearTimeout(l))})}function _t(e,o){if(typeof IntersectionObserver!="function"){Ot(e,o);return}let l=[];T(()=>{const r=()=>{const s=!!l.length;l=e(),s&&_e(e(),o)},t=Dt(e()),n=new IntersectionObserver(r,{root:t});for(const s of e()){const i=s.ref();i&&n.observe(i)}k(()=>n.disconnect())})}function Mt(e={}){const[o,l]=Ze({value:()=>et(e.items),onChange:n=>{var s;return(s=e.onItemsChange)==null?void 0:s.call(e,n)}});_t(o,l);const r=n=>(l(s=>{const i=Tt(s,n);return Je(s,n,i)}),()=>{l(s=>{const i=s.filter(c=>c.ref()!==n.ref());return s.length===i.length?s:i})});return{DomCollectionProvider:n=>d(De.Provider,{value:{registerItem:r},get children(){return n.children}})}}function Et(e){const o=It(),l=F({shouldRegisterItem:!0},e);T(()=>{if(!l.shouldRegisterItem)return;const r=o.registerItem(l.getItem());k(r)})}var At={};be(At,{Arrow:()=>ke,Content:()=>Ee,Portal:()=>Ae,Root:()=>Re,Tooltip:()=>Z,Trigger:()=>Fe,useTooltipContext:()=>ue});var Me=ee();function ue(){const e=te(Me);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function Ee(e){const o=ue(),l=F({id:o.generateId("content")},e),[r,t]=M(l,["ref","style"]);return T(()=>k(o.registerContentId(t.id))),d(J,{get when(){return o.contentPresent()},get children(){return d($e.Positioner,{get children(){return d(nt,S({ref(n){var s=ne(i=>{o.setContentRef(i)},r.ref);typeof s=="function"&&s(n)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return me({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:n=>n.preventDefault(),onDismiss:()=>o.hideTooltip(!0)},()=>o.dataset(),t))}})}})}function Ae(e){const o=ue();return d(J,{get when(){return o.contentPresent()},get children(){return d(Xe,e)}})}function Rt(e,o,l){const r=e.split("-")[0],t=o.getBoundingClientRect(),n=l.getBoundingClientRect(),s=[],i=t.left+t.width/2,c=t.top+t.height/2;switch(r){case"top":s.push([t.left,c]),s.push([n.left,n.bottom]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([t.right,c]);break;case"right":s.push([i,t.top]),s.push([n.left,n.top]),s.push([n.right,n.top]),s.push([n.right,n.bottom]),s.push([n.left,n.bottom]),s.push([i,t.bottom]);break;case"bottom":s.push([t.left,c]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([n.right,n.top]),s.push([t.right,c]);break;case"left":s.push([i,t.top]),s.push([n.right,n.top]),s.push([n.left,n.top]),s.push([n.left,n.bottom]),s.push([n.right,n.bottom]),s.push([i,t.bottom]);break}return s}var H={},Ft=0,X=!1,E,Q,Y;function Re(e){const o=`tooltip-${ae()}`,l=`${++Ft}`,r=F({id:o,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[t,n]=M(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let s;const[i,c]=I(),[a,f]=I(),[u,g]=I(),[y,v]=I(n.placement),x=Ie({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:b=>{var P;return(P=t.onOpenChange)==null?void 0:P.call(t,b)}}),{present:$}=Te({show:()=>t.forceMount||x.isOpen(),element:()=>u()??null}),m=()=>{H[l]=C},w=()=>{for(const b in H)b!==l&&(H[b](!0),delete H[b])},C=(b=!1)=>{b||t.closeDelay&&t.closeDelay<=0?(window.clearTimeout(s),s=void 0,x.close()):s||(s=window.setTimeout(()=>{s=void 0,x.close()},t.closeDelay)),window.clearTimeout(E),E=void 0,t.skipDelayDuration&&t.skipDelayDuration>=0&&(Y=window.setTimeout(()=>{window.clearTimeout(Y),Y=void 0},t.skipDelayDuration)),X&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete H[l],Q=void 0,X=!1},t.closeDelay))},p=()=>{clearTimeout(s),s=void 0,w(),m(),X=!0,x.open(),window.clearTimeout(E),E=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(Y),Y=void 0},q=()=>{w(),m(),!x.isOpen()&&!E&&!X?E=window.setTimeout(()=>{E=void 0,X=!0,p()},t.openDelay):x.isOpen()||p()},K=(b=!1)=>{!b&&t.openDelay&&t.openDelay>0&&!s&&!Y?q():p()},z=()=>{window.clearTimeout(E),E=void 0,X=!1},B=()=>{window.clearTimeout(s),s=void 0},U=b=>fe(a(),b)||fe(u(),b),D=b=>{const P=a(),N=u();if(!(!P||!N))return Rt(b,P,N)},L=b=>{const P=b.target;if(U(P)){B();return}if(!t.ignoreSafeArea){const N=D(y());if(N&&ot(st(b),N)){B();return}}s||C()};T(()=>{if(!x.isOpen())return;const b=re();b.addEventListener("pointermove",L,!0),k(()=>{b.removeEventListener("pointermove",L,!0)})}),T(()=>{const b=a();if(!b||!x.isOpen())return;const P=ze=>{const Ve=ze.target;fe(Ve,b)&&C(!0)},N=tt();N.addEventListener("scroll",P,{capture:!0}),k(()=>{N.removeEventListener("scroll",P,{capture:!0})})}),k(()=>{clearTimeout(s),H[l]&&delete H[l]});const ie={dataset:W(()=>({"data-expanded":x.isOpen()?"":void 0,"data-closed":x.isOpen()?void 0:""})),isOpen:x.isOpen,isDisabled:()=>t.disabled??!1,triggerOnFocusOnly:()=>t.triggerOnFocusOnly??!1,contentId:i,contentPresent:$,openTooltip:K,hideTooltip:C,cancelOpening:z,generateId:de(()=>r.id),registerContentId:le(c),isTargetOnTooltip:U,setTriggerRef:f,setContentRef:g};return d(Me.Provider,{value:ie,get children(){return d($e,S({anchorRef:a,contentRef:u,onCurrentPlacementChange:v},n))}})}function Fe(e){let o;const l=ue(),[r,t]=M(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let n=!1,s=!1,i=!1;const c=()=>{n=!1},a=()=>{!l.isOpen()&&(s||i)&&l.openTooltip(i)},f=m=>{l.isOpen()&&!s&&!i&&l.hideTooltip(m)},u=m=>{A(m,r.onPointerEnter),!(m.pointerType==="touch"||l.triggerOnFocusOnly()||l.isDisabled()||m.defaultPrevented)&&(s=!0,a())},g=m=>{A(m,r.onPointerLeave),m.pointerType!=="touch"&&(s=!1,i=!1,l.isOpen()?f():l.cancelOpening())},y=m=>{A(m,r.onPointerDown),n=!0,re(o).addEventListener("pointerup",c,{once:!0})},v=m=>{A(m,r.onClick),s=!1,i=!1,f(!0)},x=m=>{A(m,r.onFocus),!(l.isDisabled()||m.defaultPrevented||n)&&(i=!0,a())},$=m=>{A(m,r.onBlur);const w=m.relatedTarget;l.isTargetOnTooltip(w)||(s=!1,i=!1,f(!0))};return k(()=>{re(o).removeEventListener("pointerup",c)}),d(oe,S({as:"button",ref(m){var w=ne(C=>{l.setTriggerRef(C),o=C},r.ref);typeof w=="function"&&w(m)},get"aria-describedby"(){return Pe(()=>!!l.isOpen())()?l.contentId():void 0},onPointerEnter:u,onPointerLeave:g,onPointerDown:y,onClick:v,onFocus:x,onBlur:$},()=>l.dataset(),t))}var Z=Object.assign(Re,{Arrow:ke,Content:Ee,Portal:Ae,Trigger:Fe}),Kt={};be(Kt,{Collapsible:()=>Bt,Content:()=>ve,Root:()=>ye,Trigger:()=>xe,useCollapsibleContext:()=>se});var Ke=ee();function se(){const e=te(Ke);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function ve(e){const[o,l]=I(),r=se(),t=F({id:r.generateId("content")},e),[n,s]=M(t,["ref","id","style"]),{present:i}=Te({show:r.shouldMount,element:()=>o()??null}),[c,a]=I(0),[f,u]=I(0);let y=r.isOpen()||i();return Qe(()=>{const v=requestAnimationFrame(()=>{y=!1});k(()=>{cancelAnimationFrame(v)})}),T(we(i,()=>{if(!o())return;o().style.transitionDuration="0s",o().style.animationName="none";const v=o().getBoundingClientRect();a(v.height),u(v.width),y||(o().style.transitionDuration="",o().style.animationName="")})),T(we(r.isOpen,v=>{!v&&o()&&(o().style.transitionDuration="",o().style.animationName="")},{defer:!0})),T(()=>k(r.registerContentId(n.id))),d(J,{get when(){return i()},get children(){return d(oe,S({as:"div",ref(v){var x=ne(l,n.ref);typeof x=="function"&&x(v)},get id(){return n.id},get style(){return me({"--kb-collapsible-content-height":c()?`${c()}px`:void 0,"--kb-collapsible-content-width":f()?`${f()}px`:void 0},n.style)}},()=>r.dataset(),s))}})}function ye(e){const o=`collapsible-${ae()}`,l=F({id:o},e),[r,t]=M(l,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[n,s]=I(),i=Ie({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:f=>{var u;return(u=r.onOpenChange)==null?void 0:u.call(r,f)}}),c=W(()=>({"data-expanded":i.isOpen()?"":void 0,"data-closed":i.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),a={dataset:c,isOpen:i.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||i.isOpen(),contentId:n,toggle:i.toggle,generateId:de(()=>t.id),registerContentId:le(s)};return d(Ke.Provider,{value:a,get children(){return d(oe,S({as:"div"},c,t))}})}function xe(e){const o=se(),[l,r]=M(e,["onClick"]);return d(it,S({get"aria-expanded"(){return o.isOpen()},get"aria-controls"(){return Pe(()=>!!o.isOpen())()?o.contentId():void 0},get disabled(){return o.disabled()},onClick:n=>{A(n,l.onClick),o.toggle()}},()=>o.dataset(),r))}var Bt=Object.assign(ye,{Content:ve,Trigger:xe}),G={};be(G,{Accordion:()=>Lt,Content:()=>Ne,Header:()=>Ue,Item:()=>je,Root:()=>We,Trigger:()=>qe,useAccordionContext:()=>Ce});var Be=ee();function Le(){const e=te(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ne(e){const o=Le(),l=o.generateId("content"),r=F({id:l},e),[t,n]=M(r,["id","style"]);return T(()=>k(o.registerContentId(t.id))),d(ve,S({role:"region",get"aria-labelledby"(){return o.triggerId()},get style(){return me({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},n))}function Ue(e){const o=se();return d(oe,S({as:"h3"},()=>o.dataset(),e))}var He=ee();function Ce(){const e=te(He);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function je(e){const o=Ce(),l=`${o.generateId("item")}-${ae()}`,r=F({id:l},e),[t,n]=M(r,["value","disabled"]),[s,i]=I(),[c,a]=I(),f=()=>o.listState().selectionManager(),u=()=>f().isSelected(t.value),g={value:()=>t.value,triggerId:s,contentId:c,generateId:de(()=>n.id),registerTriggerId:le(i),registerContentId:le(a)};return d(Be.Provider,{value:g,get children(){return d(ye,S({get open(){return u()},get disabled(){return t.disabled}},n))}})}function We(e){let o;const l=`accordion-${ae()}`,r=F({id:l,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,n]=M(r,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[s,i]=I([]),{DomCollectionProvider:c}=Mt({items:s,onItemsChange:i}),a=rt({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>{var y;return(y=t.onChange)==null?void 0:y.call(t,Array.from(g))},disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:s});a.selectionManager().setFocusedKey("item-1");const f=lt({selectionManager:()=>a.selectionManager(),collection:()=>a.collection(),disallowEmptySelection:()=>a.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>o),u={listState:()=>a,generateId:de(()=>t.id)};return d(c,{get children(){return d(He.Provider,{value:u,get children(){return d(oe,S({as:"div",get id(){return t.id},ref(g){var y=ne(v=>o=v,t.ref);typeof y=="function"&&y(g)},get onKeyDown(){return R([t.onKeyDown,f.onKeyDown])},get onMouseDown(){return R([t.onMouseDown,f.onMouseDown])},get onFocusIn(){return R([t.onFocusIn])},get onFocusOut(){return R([t.onFocusOut,f.onFocusOut])}},n))}})}})}function qe(e){let o;const l=Ce(),r=Le(),t=se(),n=r.generateId("trigger"),s=F({id:n},e),[i,c]=M(s,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);Et({getItem:()=>({ref:()=>o,type:"item",key:r.value(),textValue:"",disabled:t.disabled()})});const a=at({key:()=>r.value(),selectionManager:()=>l.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>o),f=u=>{["Enter"," "].includes(u.key)&&u.preventDefault(),A(u,i.onKeyDown),A(u,a.onKeyDown)};return T(()=>k(r.registerTriggerId(c.id))),d(xe,S({ref(u){var g=ne(y=>o=y,i.ref);typeof g=="function"&&g(u)},get"data-key"(){return a.dataKey()},get onPointerDown(){return R([i.onPointerDown,a.onPointerDown])},get onPointerUp(){return R([i.onPointerUp,a.onPointerUp])},get onClick(){return R([i.onClick,a.onClick])},onKeyDown:f,get onMouseDown(){return R([i.onMouseDown,a.onMouseDown])},get onFocus(){return R([i.onFocus,a.onFocus])}},c))}var Lt=Object.assign(We,{Content:Ne,Header:Ue,Item:je,Trigger:qe}),Nt=_('<div><div class="flex flex-wrap items-center gap-2 text-xs text-primary"><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary"></span></div><div class="inline-flex items-center gap-1 rounded-full border border-base px-2 py-0.5 text-xs text-primary"><span class="uppercase text-[10px] tracking-wide text-muted"></span><span class="font-semibold text-primary">');const Ut=e=>{const{t:o}=mt(),l=W(()=>ct(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),r=W(()=>l().inputTokens??0),t=W(()=>l().outputTokens??0),n=W(()=>{const i=l().isSubscriptionModel?0:l().cost;return i>0?i:0}),s=W(()=>`$${n().toFixed(2)}`);return(()=>{var i=Nt(),c=i.firstChild,a=c.firstChild,f=a.firstChild,u=f.nextSibling,g=a.nextSibling,y=g.firstChild,v=y.nextSibling,x=g.nextSibling,$=x.firstChild,m=$.nextSibling;return h(f,()=>o("contextUsagePanel.labels.input")),h(u,()=>Se(r())),h(y,()=>o("contextUsagePanel.labels.output")),h(v,()=>Se(t())),h($,()=>o("contextUsagePanel.labels.cost")),h(m,s),he(()=>Ye(i,`session-context-panel px-4 py-2 ${e.class??""}`)),i})()};var j=_('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Ht=_('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),jt=_('<div class="flex flex-col gap-3 min-h-0"><div class="flex items-center justify-between gap-2 text-[11px] text-secondary"><span></span><span class="flex items-center gap-2"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)></span></span></div><div class="rounded-md border border-base bg-surface-secondary p-2 max-h-[40vh] overflow-y-auto"><div class="flex flex-col">'),Wt=_('<button type=button class="border-b border-base last:border-b-0 text-left hover:bg-surface-muted rounded-sm"><div class="flex items-center justify-between gap-3"><div class="text-xs font-mono text-primary min-w-0 flex-1 overflow-hidden whitespace-nowrap"style=text-overflow:ellipsis;direction:rtl;text-align:left;unicode-bidi:plaintext></div><div class="flex items-center gap-2 text-[11px] flex-shrink-0"><span style=color:var(--session-status-idle-fg)></span><span style=color:var(--session-status-working-fg)>'),qt=_('<div class="flex flex-col gap-2">'),zt=_("<span>"),Vt=_('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Xt=_("<div class=status-tab-container>"),Yt=_("<span class=section-left><span class=section-label>");const nn=e=>{const o=i=>e.expandedItems().includes(i),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const i=e.activeSession();return i?(()=>{var c=Ht(),a=c.firstChild,f=a.firstChild,u=f.firstChild,g=u.nextSibling;return h(u,()=>e.t("instanceShell.yoloMode.title")),h(g,()=>e.t("instanceShell.yoloMode.description")),h(a,d(ft,{get checked(){return gt(e.instanceId,i.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>ut(e.instanceId,i.id)}),null),c})():(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.yoloMode.noSessionSelected")),c})()}},{id:"session-changes",labelKey:"instanceShell.rightPanel.sections.sessionChanges",tooltipKey:"instanceShell.rightPanel.sections.sessionChanges.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.noSessionSelected")),u})();const c=e.activeSessionDiffs();if(c===void 0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.loading")),u})();if(!Array.isArray(c)||c.length===0)return(()=>{var u=j(),g=u.firstChild;return h(g,()=>e.t("instanceShell.sessionChanges.empty")),u})();const a=[...c].sort((u,g)=>String(u.file||"").localeCompare(String(g.file||""))),f=a.reduce((u,g)=>(u.additions+=typeof g.additions=="number"?g.additions:0,u.deletions+=typeof g.deletions=="number"?g.deletions:0,u),{additions:0,deletions:0});return(()=>{var u=jt(),g=u.firstChild,y=g.firstChild,v=y.nextSibling,x=v.firstChild,$=x.nextSibling,m=g.nextSibling,w=m.firstChild;return h(y,()=>e.t("instanceShell.sessionChanges.filesChanged",{count:a.length})),h(x,()=>`+${f.additions}`),h($,()=>`-${f.deletions}`),h(w,d(ge,{each:a,children:C=>(()=>{var p=Wt(),q=p.firstChild,K=q.firstChild,z=K.nextSibling,B=z.firstChild,U=B.nextSibling;return p.$$click=()=>e.onOpenChangesTab(C.file),h(K,()=>C.file),h(B,()=>`+${C.additions}`),h(U,()=>`-${C.deletions}`),he(D=>{var L=e.t("instanceShell.sessionChanges.actions.show"),V=C.file;return L!==D.e&&O(p,"title",D.e=L),V!==D.t&&O(K,"title",D.t=V),D},{e:void 0,t:void 0}),p})()})),u})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const i=e.activeSessionId();if(!i||i==="info")return(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.noSessionSelected")),a})();const c=e.latestTodoState();return c?d(pt,{state:c,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var a=j(),f=a.firstChild;return h(f,()=>e.t("instanceShell.plan.empty")),a})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const i=e.backgroundProcessList();return i.length===0?(()=>{var c=j(),a=c.firstChild;return h(a,()=>e.t("instanceShell.backgroundProcesses.empty")),c})():(()=>{var c=qt();return h(c,d(ge,{each:i,children:a=>(()=>{var f=Vt(),u=f.firstChild,g=u.firstChild,y=g.nextSibling,v=y.firstChild,x=v.nextSibling,$=u.nextSibling,m=$.firstChild,w=m.nextSibling,C=w.nextSibling;return h(g,()=>a.title),h(v,d(vt,{class:"h-3.5 w-3.5"})),h(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:a.status})),h(y,d(J,{get when(){return typeof a.outputSizeBytes=="number"},get children(){var p=zt();return h(p,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((a.outputSizeBytes??0)/1024)})),p}}),null),m.$$click=()=>e.onOpenBackgroundOutput(a),h(m,d(wt,{class:"h-4 w-4"})),w.$$click=()=>e.onStopBackgroundProcess(a.id),h(w,d(Pt,{class:"h-4 w-4"})),C.$$click=()=>e.onTerminateBackgroundProcess(a.id),h(C,d(ht,{class:"h-4 w-4"})),he(p=>{var q=!!a.notifyEnabled,K=!a.notifyEnabled,z=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),B=e.t(a.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),U=e.t("instanceShell.backgroundProcesses.actions.output"),D=e.t("instanceShell.backgroundProcesses.actions.output"),L=a.status!=="running",V=e.t("instanceShell.backgroundProcesses.actions.stop"),ie=e.t("instanceShell.backgroundProcesses.actions.stop"),b=e.t("instanceShell.backgroundProcesses.actions.terminate"),P=e.t("instanceShell.backgroundProcesses.actions.terminate");return q!==p.e&&v.classList.toggle("text-success",p.e=q),K!==p.t&&v.classList.toggle("text-tertiary",p.t=K),z!==p.a&&O(v,"aria-label",p.a=z),B!==p.o&&O(v,"title",p.o=B),U!==p.i&&O(m,"aria-label",p.i=U),D!==p.n&&O(m,"title",p.n=D),L!==p.s&&(w.disabled=p.s=L),V!==p.h&&O(w,"aria-label",p.h=V),ie!==p.r&&O(w,"title",p.r=ie),b!==p.d&&O(C,"aria-label",p.d=b),P!==p.l&&O(C,"title",p.l=P),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),f})()})),c})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>d(pe,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var i=Xt();return h(i,d(J,{get when(){return e.activeSession()},children:c=>d(Ut,{get instanceId(){return e.instanceId},get sessionId(){return c().id},class:"status-tab-context-panel"})}),null),h(i,d(G.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return d(ge,{each:s,children:c=>d(G.Item,{get value(){return c.id},class:"right-panel-accordion-item",get children(){return[d(G.Header,{class:"right-panel-accordion-header-row",get children(){return[d(G.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var a=Yt(),f=a.firstChild;return h(f,()=>e.t(c.labelKey)),a})(),d(dt,{get class(){return`right-panel-accordion-chevron ${o(c.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),d(Z,{openDelay:200,gutter:4,placement:"top",get children(){return[d(Z.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(c.tooltipKey)},get children(){return d(xt,{class:"section-info-icon"})}}),d(Z.Portal,{get children(){return d(Z.Content,{class:"section-info-tooltip",get children(){return e.t(c.tooltipKey)}})}})]}})]}}),d(G.Content,{class:"right-panel-accordion-content",get children(){return c.render()}})]}})})}}),null),i})()};Ge(["click"]);export{nn as default};
@@ -1 +1 @@
1
- import{I as n}from"./main-DBbZ3aZQ.js";import{n as o,m as y}from"./git-diff-vendor-CSgooKT_.js";const i=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]],t=e=>o(n,y(e,{name:"AlignJustify",iconNode:i}));export{t as A};
1
+ import{I as n}from"./main-Bnnuz06l.js";import{n as o,m as y}from"./git-diff-vendor-CSgooKT_.js";const i=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]],t=e=>o(n,y(e,{name:"AlignJustify",iconNode:i}));export{t as A};
@@ -1 +1 @@
1
- import{ac as _,t as b,i as x,u as E,m as V,k as B}from"./monaco-viewer-YY9yfE-p.js";import{c as L,b as F,n as p,a as D,S as q,E as z,D as G,C as T,G as U}from"./git-diff-vendor-CSgooKT_.js";import{ap as N,aq as K}from"./main-DBbZ3aZQ.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./index-BCGPLzO4.js";var $=b("<div>"),O=b("<div class=tool-call-diff-viewer>"),P=b("<pre class=tool-call-diff-fallback>");const j=B("session");U();function I(e,s,o){const a=window.getComputedStyle(o),i=document.createElement("span");i.textContent=s||"",i.style.position="absolute",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="inline-block",i.style.width="auto",i.style.maxWidth="none",i.style.whiteSpace="nowrap",i.style.fontFamily=a.fontFamily,i.style.fontSize=a.fontSize,i.style.fontWeight=a.fontWeight,i.style.fontStyle=a.fontStyle,i.style.letterSpacing=a.letterSpacing,i.style.fontVariant=a.fontVariant,i.style.textTransform=a.textTransform,i.style.lineHeight=a.lineHeight,e.appendChild(i);const f=Math.ceil(i.getBoundingClientRect().width);return i.remove(),f}function M(e,s,o=40){const a=s.reduce((l,n)=>Math.max(l,I(e,n.text,n.source)),0),i=s.reduce((l,n)=>Math.max(l,n.text.length),1),f=Math.round(i*7+4);return Math.max(2,Math.min(o,a>0?a+2:f))}function J(e,s){const o=e.querySelector(".unified-diff-table-wrapper"),a=e.querySelector(".unified-diff-table"),i=e.querySelector(".unified-diff-table-num-col"),f=e.querySelectorAll(".diff-line-num"),l=e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper"),n=[];a&&(s?(a.classList.add("table-fixed"),a.style.tableLayout="fixed",a.style.width="100%",a.style.minWidth="100%"):(a.classList.remove("table-fixed"),a.style.tableLayout="auto",a.style.width="max-content",a.style.minWidth="100%")),f.forEach(r=>{var v,k;const c=r.querySelector("[data-line-old-num]"),m=r.querySelector("[data-line-new-num]"),W=r.querySelector(".shrink-0"),S=r.querySelector(":scope > .flex"),C=r.querySelector(":scope > .tool-call-diff-compact-line-number"),y=((v=c==null?void 0:c.textContent)==null?void 0:v.trim())??"",w=((k=m==null?void 0:m.textContent)==null?void 0:k.trim())??"",H=w.length>0&&w!=="0",R=y.length>0&&y!=="0",g=H?w:R?y:w||y;S&&(S.style.display="none"),W&&(W.style.display="none"),c&&(c.style.display="none",c.style.width="auto"),m&&(m.style.display="none",m.style.width="auto"),r.style.paddingLeft="1px",r.style.paddingRight="1px",r.style.textAlign="left";const u=C??document.createElement("span");u.className="tool-call-diff-compact-line-number",u.textContent=g,u.setAttribute("aria-hidden",g?"false":"true"),C||r.appendChild(u),n.push({gutter:r,label:u,text:g})});const t=M(e,n.map(r=>({text:r.text,source:r.label}))),d=`${t}px`,h=`${Math.max(8,t-10)}px`;o&&(o.style.setProperty("--diff-aside-width",h),o.style.setProperty("--diff-aside-width--",h)),i&&(i.style.width=d),n.forEach(({gutter:r,label:c})=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,c.style.width="auto",c.style.maxWidth="none"}),l.forEach(r=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,r.style.paddingLeft="0",r.style.paddingRight="0"})}function Q(e){const s=e.querySelector(".old-diff-table-wrapper"),o=e.querySelector(".new-diff-table-wrapper"),a=Array.from(e.querySelectorAll(".diff-line-old-num, .diff-line-new-num")),i=Array.from(e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper")),f=a.map(t=>({cell:t,span:t.querySelector("[data-line-num]")})).filter(t=>!!t.span),n=`${M(e,f.map(({span:t})=>{var d;return{text:((d=t.textContent)==null?void 0:d.trim())??"",source:t}}),64)}px`;[s,o].forEach(t=>{t&&t.style.setProperty("--diff-aside-width",n)}),a.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="2px",t.style.paddingRight="2px",t.style.textAlign="left",t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),f.forEach(({span:t})=>{t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),i.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="0",t.style.paddingRight="0"})}function A(e,s,o=!1){if(s==="unified"){J(e,o);return}s==="split"&&Q(e)}function ne(e){const s=L(()=>{const f=_(e.diffText);if(!f)return null;const l=N(e.filePath)||"text",n=e.filePath||"diff";return{oldFile:{fileName:n,fileLang:l},newFile:{fileName:n,fileLang:l},hunks:[f]}});let o,a;const i=L(()=>s()?`${e.theme}|${e.mode}|${e.wrap?"wrap":"nowrap"}|${e.diffText}`:"");return F(()=>{var n;if(e.cachedHtml){o&&A(o,e.mode,!!e.wrap),(n=e.onRendered)==null||n.call(e);return}const l=i();l&&o&&a!==l&&requestAnimationFrame(()=>{var d;if(!o)return;A(o,e.mode,!!e.wrap);const t=o.innerHTML;t&&(a=l,e.cacheEntryParams&&K(e.cacheEntryParams,{text:e.diffText,html:t,theme:e.theme,mode:e.mode,wrap:e.wrap}),(d=e.onRendered)==null||d.call(e))})}),(()=>{var f=O();return x(f,p(q,{get when(){return e.cachedHtml},get fallback(){return(()=>{var l=$(),n=o;return typeof n=="function"?E(n,l):o=l,x(l,p(q,{get when(){return s()},get fallback(){return(()=>{var t=P();return x(t,()=>e.diffText),t})()},children:t=>p(z,{fallback:d=>(j.warn("Failed to render diff view",d),(()=>{var h=P();return x(h,()=>e.diffText),h})()),get children(){return p(G,{get data(){return t()},get diffViewMode(){return V(()=>e.mode==="split")()?T.Split:T.Unified},get diffViewTheme(){return e.theme},diffViewHighlight:!0,get diffViewWrap(){return!!e.wrap},diffViewFontSize:13})}})})),l})()},get children(){var l=$(),n=o;return typeof n=="function"?E(n,l):o=l,D(()=>l.innerHTML=e.cachedHtml),l}})),f})()}export{ne as ToolCallDiffViewer};
1
+ import{ac as _,t as b,i as x,u as E,m as V,k as B}from"./monaco-viewer-YY9yfE-p.js";import{c as L,b as F,n as p,a as D,S as q,E as z,D as G,C as T,G as U}from"./git-diff-vendor-CSgooKT_.js";import{ap as N,aq as K}from"./main-Bnnuz06l.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./index-BCGPLzO4.js";var $=b("<div>"),O=b("<div class=tool-call-diff-viewer>"),P=b("<pre class=tool-call-diff-fallback>");const j=B("session");U();function I(e,s,o){const a=window.getComputedStyle(o),i=document.createElement("span");i.textContent=s||"",i.style.position="absolute",i.style.visibility="hidden",i.style.pointerEvents="none",i.style.display="inline-block",i.style.width="auto",i.style.maxWidth="none",i.style.whiteSpace="nowrap",i.style.fontFamily=a.fontFamily,i.style.fontSize=a.fontSize,i.style.fontWeight=a.fontWeight,i.style.fontStyle=a.fontStyle,i.style.letterSpacing=a.letterSpacing,i.style.fontVariant=a.fontVariant,i.style.textTransform=a.textTransform,i.style.lineHeight=a.lineHeight,e.appendChild(i);const f=Math.ceil(i.getBoundingClientRect().width);return i.remove(),f}function M(e,s,o=40){const a=s.reduce((l,n)=>Math.max(l,I(e,n.text,n.source)),0),i=s.reduce((l,n)=>Math.max(l,n.text.length),1),f=Math.round(i*7+4);return Math.max(2,Math.min(o,a>0?a+2:f))}function J(e,s){const o=e.querySelector(".unified-diff-table-wrapper"),a=e.querySelector(".unified-diff-table"),i=e.querySelector(".unified-diff-table-num-col"),f=e.querySelectorAll(".diff-line-num"),l=e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper"),n=[];a&&(s?(a.classList.add("table-fixed"),a.style.tableLayout="fixed",a.style.width="100%",a.style.minWidth="100%"):(a.classList.remove("table-fixed"),a.style.tableLayout="auto",a.style.width="max-content",a.style.minWidth="100%")),f.forEach(r=>{var v,k;const c=r.querySelector("[data-line-old-num]"),m=r.querySelector("[data-line-new-num]"),W=r.querySelector(".shrink-0"),S=r.querySelector(":scope > .flex"),C=r.querySelector(":scope > .tool-call-diff-compact-line-number"),y=((v=c==null?void 0:c.textContent)==null?void 0:v.trim())??"",w=((k=m==null?void 0:m.textContent)==null?void 0:k.trim())??"",H=w.length>0&&w!=="0",R=y.length>0&&y!=="0",g=H?w:R?y:w||y;S&&(S.style.display="none"),W&&(W.style.display="none"),c&&(c.style.display="none",c.style.width="auto"),m&&(m.style.display="none",m.style.width="auto"),r.style.paddingLeft="1px",r.style.paddingRight="1px",r.style.textAlign="left";const u=C??document.createElement("span");u.className="tool-call-diff-compact-line-number",u.textContent=g,u.setAttribute("aria-hidden",g?"false":"true"),C||r.appendChild(u),n.push({gutter:r,label:u,text:g})});const t=M(e,n.map(r=>({text:r.text,source:r.label}))),d=`${t}px`,h=`${Math.max(8,t-10)}px`;o&&(o.style.setProperty("--diff-aside-width",h),o.style.setProperty("--diff-aside-width--",h)),i&&(i.style.width=d),n.forEach(({gutter:r,label:c})=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,c.style.width="auto",c.style.maxWidth="none"}),l.forEach(r=>{r.style.width=d,r.style.minWidth=d,r.style.maxWidth=d,r.style.paddingLeft="0",r.style.paddingRight="0"})}function Q(e){const s=e.querySelector(".old-diff-table-wrapper"),o=e.querySelector(".new-diff-table-wrapper"),a=Array.from(e.querySelectorAll(".diff-line-old-num, .diff-line-new-num")),i=Array.from(e.querySelectorAll(".diff-line-hunk-action, .diff-line-widget-wrapper, .diff-line-extend-wrapper")),f=a.map(t=>({cell:t,span:t.querySelector("[data-line-num]")})).filter(t=>!!t.span),n=`${M(e,f.map(({span:t})=>{var d;return{text:((d=t.textContent)==null?void 0:d.trim())??"",source:t}}),64)}px`;[s,o].forEach(t=>{t&&t.style.setProperty("--diff-aside-width",n)}),a.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="2px",t.style.paddingRight="2px",t.style.textAlign="left",t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),f.forEach(({span:t})=>{t.style.whiteSpace="nowrap",t.style.overflowWrap="normal",t.style.wordBreak="normal"}),i.forEach(t=>{t.style.width=n,t.style.minWidth=n,t.style.maxWidth=n,t.style.paddingLeft="0",t.style.paddingRight="0"})}function A(e,s,o=!1){if(s==="unified"){J(e,o);return}s==="split"&&Q(e)}function ne(e){const s=L(()=>{const f=_(e.diffText);if(!f)return null;const l=N(e.filePath)||"text",n=e.filePath||"diff";return{oldFile:{fileName:n,fileLang:l},newFile:{fileName:n,fileLang:l},hunks:[f]}});let o,a;const i=L(()=>s()?`${e.theme}|${e.mode}|${e.wrap?"wrap":"nowrap"}|${e.diffText}`:"");return F(()=>{var n;if(e.cachedHtml){o&&A(o,e.mode,!!e.wrap),(n=e.onRendered)==null||n.call(e);return}const l=i();l&&o&&a!==l&&requestAnimationFrame(()=>{var d;if(!o)return;A(o,e.mode,!!e.wrap);const t=o.innerHTML;t&&(a=l,e.cacheEntryParams&&K(e.cacheEntryParams,{text:e.diffText,html:t,theme:e.theme,mode:e.mode,wrap:e.wrap}),(d=e.onRendered)==null||d.call(e))})}),(()=>{var f=O();return x(f,p(q,{get when(){return e.cachedHtml},get fallback(){return(()=>{var l=$(),n=o;return typeof n=="function"?E(n,l):o=l,x(l,p(q,{get when(){return s()},get fallback(){return(()=>{var t=P();return x(t,()=>e.diffText),t})()},children:t=>p(z,{fallback:d=>(j.warn("Failed to render diff view",d),(()=>{var h=P();return x(h,()=>e.diffText),h})()),get children(){return p(G,{get data(){return t()},get diffViewMode(){return V(()=>e.mode==="split")()?T.Split:T.Unified},get diffViewTheme(){return e.theme},diffViewHighlight:!0,get diffViewWrap(){return!!e.wrap},diffViewFontSize:13})}})})),l})()},get children(){var l=$(),n=o;return typeof n=="function"?E(n,l):o=l,D(()=>l.innerHTML=e.cachedHtml),l}})),f})()}export{ne as ToolCallDiffViewer};