codex-mobile-re 0.1.97 → 0.1.98

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.
@@ -0,0 +1,39 @@
1
+ import{d as G,o as l,c as J,a as d,w as Ae,b as v,t as y,n as z,e as L,T as fo,_ as U,u as T,F as E,r as D,f as ie,g as W,I as ho,h as Ps,i as Ut,j as ee,k as M,l as ce,m as nn,p as je,q as O,s as Vt,v as mo,x as Ss,y as go,z as As,A as Es,B as ot,C as Fs,D as Bs,E as Rs,G as Gn,H as Os,J as Ds,K as Hs,L as Ws}from"./index-7a7RZFTE.js";import{s as Ht}from"./sanitizeHtml-Bd3No2dT.js";function js(e){if(!e||/[\r\n]/u.test(e)||e.endsWith("/")||e.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(e))return!1;const n=e.startsWith("/"),o=/^[A-Za-z]:[\\/]/u.test(e),i=e.startsWith("./")||e.startsWith("../")||e.startsWith("~/");return n||o||i||/^[A-Za-z0-9._@() -]+\.[A-Za-z0-9]{1,12}$/u.test(e)?!0:/^[A-Za-z0-9._@() -]+(?:[\\/][A-Za-z0-9._@() -]+)+$/u.test(e)}function it(e){return e.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||e}function Ee(e){return e.replace(/\\/gu,"/")}function po(e){if(!e.startsWith("file://"))return e;let n=e.replace(/^file:\/\//u,"");try{n=decodeURIComponent(n)}catch{}return/^\/[A-Za-z]:\//u.test(n)&&(n=n.slice(1)),n}function Ns(e){const n=Ee(e),o=n.match(/^\/Users\/([^/]+)/u);if(o)return`/Users/${o[1]}`;const i=n.match(/^\/home\/([^/]+)/u);return i?`/home/${i[1]}`:""}function Pe(e){const n=Ee(e);if(!n)return n;let o="",i=n;const a=i.match(/^([A-Za-z]:)(\/.*)?$/u);a?(o=`${a[1]}/`,i=(a[2]??"").replace(/^\/+/u,"")):i.startsWith("/")&&(o="/",i=i.slice(1));const f=i.split("/").filter(Boolean),c=[];for(const g of f)if(g!=="."){if(g===".."){c.length>0&&c.pop();continue}c.push(g)}const u=c.join("/");return o?`${o}${u}`.replace(/\/+$/u,"")||o:u||n}function vo(e,n){const o=Ee(po(e.trim()));if(!o)return"";if(o.startsWith("/")||/^[A-Za-z]:\//u.test(o))return Pe(o);if(o.startsWith("~/")){const f=Ns(n);if(f)return Pe(`${f}/${o.slice(2)}`)}const a=Ee(n.trim());return Pe(a?`${a.replace(/\/+$/u,"")}/${o}`:o)}function rt(e){let n=e,o="",i="";const a={"(":")","[":"]","{":"}","<":">",'"':'"',"'":"'","`":"`","“":"”","‘":"’"};for(;n.length>0;){const f=n[0],c=Object.prototype.hasOwnProperty.call(a,f)?a[f]:"";if(!c||!n.endsWith(c))break;o+=f,i+=c,n=n.slice(1,-1)}return{core:n,leading:o,trailing:i}}function Ne(e){if(!e)return null;let n=e.trim();n=rt(n).core.trim();let i=null;const a=n.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(a)n=a[1],i=Number(a[2]);else{const f=n.match(/^(.*):(\d+)(?::\d+)?$/u);f&&(n=f[1],i=Number(f[2]))}return n=po(n),js(n)?{path:n,line:i}:null}function Zn(e,n,o){let i=0,a=n-1;for(;a>=o&&e[a]==="*";)i+=1,a-=1;return i}function zs(e,n){let o=0,i=n;for(;i<e.length&&e[i]==="*";)o+=1,i+=1;return o}function ko(e,n,o,i,a){const f=Zn(e,n,i);return f<2?null:zs(e,o)>=f?{segmentStart:n-f,segmentEnd:o+f,tokenEndTrim:0}:Zn(a,a.length,0)>=f?{segmentStart:n-f,segmentEnd:o,tokenEndTrim:f}:null}function Kt(e){const n=e.trim();if(!n.startsWith("[")||!n.endsWith(")"))return null;const o=n.indexOf("]");if(o<=1||n[o+1]!=="(")return null;const i=n.slice(1,o).trim(),a=n.slice(o+2,-1).trim();if(i.includes(`
2
+ `)||a.includes(`
3
+ `))return null;const f=rt(i).core.trim()||i,c=rt(a).core.trim();return c?{label:f,target:c}:null}function lt(e){const n=e.trim().match(/^codex:\/\/threads\/([A-Za-z0-9-]+)$/u);if(!n)return null;if(typeof window>"u")return`/#/thread/${n[1]}`;const o=window.location.pathname.replace(/\/?$/u,"/");return`${window.location.origin}${o}#/thread/${n[1]}`}function Jn(e){const n=Math.min(6,Math.max(1,Math.trunc(e)));return`h${String(n)}`}function Xn(e){switch(Math.min(6,Math.max(1,Math.trunc(e)))){case 1:return"message-heading-h1";case 2:return"message-heading-h2";case 3:return"message-heading-h3";case 4:return"message-heading-h4";case 5:return"message-heading-h5";default:return"message-heading-h6"}}function qs(e){const n=e.trim();if(!n)return"";if(n.startsWith("data:")||n.startsWith("blob:")||n.startsWith("http://")||n.startsWith("https://")||n.startsWith("/codex-local-image?"))return n;if(n.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(n)}`;const o=n.startsWith("/"),i=/^[A-Za-z]:[\\/]/u.test(n);return o||i?`/codex-local-image?path=${encodeURIComponent(n)}`:n}function Se(e,n={}){const o=[],i=/codex:\/\/threads\/[A-Za-z0-9-]+|https?:\/\/[^\s<>"'`,。;:!?、()[\]{}「」『』《》]+|file:\/\/[^\n<>"'`,。;:!?、[\]{}「」『』《》]+|["'](?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^\n"']+["']|`(?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^`\n]+`/gu;let a=0;for(const f of e.matchAll(i)){if(typeof f.index!="number")continue;const c=f.index,u=c+f[0].length;let g=f[0],p="";for(;/[.,;:!?,。;:!?、]$/u.test(g);)p=g.slice(-1)+p,g=g.slice(0,-1);const b=ko(e,c,u,a,g),I=(b==null?void 0:b.segmentStart)??c,A=(b==null?void 0:b.segmentEnd)??u;I>a&&o.push({kind:"text",value:e.slice(a,I)}),b!=null&&b.tokenEndTrim&&(g=g.slice(0,-b.tokenEndTrim));const x=rt(g);g=x.core;const P=x.leading,w=x.trailing+p;P&&o.push({kind:"text",value:P});const F=lt(g);if(F)o.push({kind:"url",value:F,href:F}),w&&o.push({kind:"text",value:w});else if(g.startsWith("**")&&g.endsWith("**")&&g.length>4)o.push({kind:"bold",value:g.slice(2,-2)}),w&&o.push({kind:"text",value:w});else if(/^https?:\/\//u.test(g))o.push({kind:"url",value:g,href:g}),w&&o.push({kind:"text",value:w});else{const B=Ne(g);B?(o.push({kind:"file",value:g,path:B.path,displayPath:g,downloadName:it(B.path)}),w&&o.push({kind:"text",value:w})):o.push({kind:"text",value:f[0]})}a=A}return a<e.length&&o.push({kind:"text",value:e.slice(a)}),n.applyMarkdownMarkers===!1?o:yo(o)}function Wt(e,n){const o=[];let i=!1,a="";const f=c=>{c&&o.push({kind:"text",value:c})};for(const c of e){if(c.kind!=="text"){i&&(f(`${n.marker}${a}`),i=!1,a=""),o.push(c);continue}let u=c.value;for(;u.length>0;){const g=u.indexOf(n.marker);if(g<0){i?a+=u:f(u);break}const p=u.slice(0,g);if(i?a+=p:f(p),u=u.slice(g+n.marker.length),i){const b=a;b.length>0&&(!n.isValidContent||n.isValidContent(b))?o.push({kind:n.kind,value:b}):f(`${n.marker}${b}${n.marker}`),a="",i=!1}else i=!0}}return i&&f(`${n.marker}${a}`),o}function yo(e){const n=i=>i.trim().length>0&&!/^\s/u.test(i)&&!/\s$/u.test(i);let o=Wt(e,{marker:"**",kind:"bold",isValidContent:n});return o=Wt(o,{marker:"~~",kind:"strikethrough",isValidContent:n}),o=Wt(o,{marker:"*",kind:"italic",isValidContent:n}),o}function Us(e,n={}){const o=[];let i=0,a=0;const f=(c,u)=>{let g=c.indexOf("[",u);for(;g>=0;){const p=c.indexOf("]",g+1);if(p<0)return null;if(c[p+1]!=="("){g=c.indexOf("[",g+1);continue}let b=1,I=p+2,A=!1;for(;I<c.length;){const x=c[I];if(x===`
4
+ `){A=!0;break}if(x==="("&&(b+=1),x===")"&&(b-=1,b===0)){const P=c.slice(g,I+1);if(Kt(P))return{start:g,end:I+1,token:P};break}I+=1}if(A){g=c.indexOf("[",g+1);continue}g=c.indexOf("[",g+1)}return null};for(;a<e.length;){const c=f(e,a);if(!c)break;const{start:u,end:g,token:p}=c,b=ko(e,u,g,i,p),I=(b==null?void 0:b.segmentStart)??u,A=(b==null?void 0:b.segmentEnd)??g;I>i&&o.push(...Se(e.slice(i,I),n));const x=Kt(p);if(!x){o.push(...Se(e.slice(I,A),n)),i=A,a=A;continue}const P=x.label,w=x.target,F=lt(w);if(F)o.push({kind:"url",value:P||F,href:F});else if(/^https?:\/\//u.test(w))o.push({kind:"url",value:P||w,href:w});else{const B=Ne(w);B?o.push({kind:"file",value:w,path:B.path,displayPath:P||w,downloadName:it(B.path)}):o.push({kind:"text",value:p})}i=A,a=A}return i<e.length&&o.push(...Se(e.slice(i),n)),o}function Vs(e){const n=e.includes("`"),o=Us(e,{applyMarkdownMarkers:!n});if(!n)return o;if(!o.some(a=>a.kind==="text"&&a.value.includes("`")))return yo(o);const i=a=>{if(!a.includes("`"))return Se(a);const f=[];let c=0,u=0;for(;c<a.length;){if(a[c]!=="`"){c+=1;continue}let g=1;for(;c+g<a.length&&a[c+g]==="`";)g+=1;const p="`".repeat(g);let b=c+g,I=-1;for(;b<a.length;){const x=a.indexOf(p,b);if(x<0)break;const P=x>0&&a[x-1]==="`",w=x+g<a.length&&a[x+g]==="`",F=a.slice(c+g,x).includes(`
5
+ `);if(!P&&!w&&!F){I=x;break}b=x+1}if(I<0){c+=g;continue}c>u&&f.push(...Se(a.slice(u,c)));const A=a.slice(c+g,I);if(A.length>0){const x=Kt(A);if(x){const P=lt(x.target);if(P)f.push({kind:"url",value:x.label||P,href:P});else if(/^https?:\/\//u.test(x.target))f.push({kind:"url",value:x.label||x.target,href:x.target});else{const w=Ne(x.target);w?f.push({kind:"file",value:x.target,path:w.path,displayPath:x.label||x.target,downloadName:it(w.path)}):f.push({kind:"code",value:A})}}else{const P=lt(A);if(P)f.push({kind:"url",value:P,href:P});else if(/^https?:\/\/[^\s]+$/u.test(A))f.push({kind:"url",value:A,href:A});else{const w=Ne(A);if(w){const F=w.line?`${w.path}:${String(w.line)}`:w.path;f.push({kind:"file",value:A,path:w.path,displayPath:F,downloadName:it(w.path)})}else f.push({kind:"code",value:A})}}}else f.push({kind:"text",value:`${p}${p}`});c=I+g,u=c}return u<a.length&&f.push(...Se(a.slice(u))),f};return o.flatMap(a=>a.kind==="text"?i(a.value):[a])}function bo(e){return e.replace(/\r\n/gu,`
6
+ `)}function ue(e){var o;return(((o=e.match(/^\s*/u))==null?void 0:o[0])??"").replace(/\t/gu," ").length}function wo(e,n){if(n<=0)return e.trimStart();let o=0,i=0;for(;o<e.length&&i<n;){const a=e[o];i+=a===" "?4:1,o+=1}return e.slice(o)}function de(e){return e.trim().length===0}function Gt(e){const n=e.match(/^\s{0,3}(#{1,6})\s+(.+)$/u);return n?{level:n[1].length,value:n[2].trim()}:null}function st(e){const n=e.match(/^\s{0,3}>\s?(.*)$/u);return n?n[1]??"":null}function ze(e){var o;const n=e.match(/^\s*[-*+]\s+(.+)$/u);return((o=n==null?void 0:n[1])==null?void 0:o.trim())??null}function Ks(e){var o;const n=e.match(/^(\s*)[-*+]\s+(.+)$/u);return n?{indent:ue(n[1]??""),text:((o=n[2])==null?void 0:o.trim())??""}:null}function qe(e){var o;const n=e.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{checked:(n[1]??" ").toLowerCase()==="x",text:((o=n[2])==null?void 0:o.trim())??""}:null}function Yn(e){var o;const n=e.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{indent:ue(n[1]??""),item:{checked:(n[2]??" ").toLowerCase()==="x",text:((o=n[3])==null?void 0:o.trim())??""}}:null}function $o(e){var o;const n=e.match(/^(\s*)(\d+)[.)]\s+(.+)$/u);return n?{indent:ue(n[1]??""),start:Number.parseInt(n[2]??"1",10)||1,text:((o=n[3])==null?void 0:o.trim())??""}:null}function Zt(e){var n;return((n=$o(e))==null?void 0:n.text)??null}function Qn(e){return $o(e)}function Jt(e){const n=e.trim();if(!n.includes("|"))return null;let o=n;o.startsWith("|")&&(o=o.slice(1)),o.endsWith("|")&&(o=o.slice(0,-1));const i=[];let a="",f=0;for(let c=0;c<o.length;c+=1){const u=o[c];if(u==="\\"&&o[c+1]==="|"){a+="|",c+=1;continue}if(u==="`"){let g=1;for(;o[c+g]==="`";)g+=1;a+=o.slice(c,c+g),f===0?f=g:f===g&&(f=0),c+=g-1;continue}if(u==="|"&&f===0){i.push(a.trim()),a="";continue}a+=u}return i.push(a.trim()),i.some(c=>c.length>0)?i:null}function Gs(e){const n=Jt(e);if(!n||n.length===0)return null;const o=n.map(i=>{const a=i.replace(/\s+/gu,"");if(!/^:?-{3,}:?$/u.test(a))return null;const f=a.startsWith(":"),c=a.endsWith(":");return f&&c?"center":c?"right":f?"left":null});return o.every((i,a)=>i!==null||/^-+$/u.test(n[a].replace(/\s+/gu,"")))?o:null}function eo(e,n){return e.length===n?e:e.length>n?e.slice(0,n):[...e,...Array.from({length:n-e.length},()=>"")]}function to(e,n){var b;if(n+1>=e.length)return null;const o=e[n],i=e[n+1],a=Jt(o),f=Gs(i);if(!a||!f||a.length!==f.length)return null;const c=o.trim();if(!c.startsWith("|")&&(((b=c.match(/\|/gu))==null?void 0:b.length)??0)<2)return null;const u=a.length,g=[];let p=n+2;for(;p<e.length&&!de(e[p]);){const I=Jt(e[p]);if(!I)break;g.push(eo(I,u)),p+=1}return{kind:"table",headers:eo(a,u),rows:g,alignments:f}}function Zs(e){return de(e)||ct(e)!==null||Xt(e)||Gt(e)!==null||st(e)!==null||qe(e)!==null||ze(e)!==null||Zt(e)!==null}function Js(e,n,o=-1){const i=[];let a=n;for(;a<e.length&&!(Zs(e[a])||o>=0&&ue(e[a])<=o);)i.push(o>=0?wo(e[a],o+1):e[a]),a+=1;const f=i.join(`
7
+ `).trim();return f?{value:f,nextIndex:a}:null}function xo(e,n){for(let o=n;o<e.length;o+=1)if(!de(e[o]))return o;return-1}function Xs(e,n,o,i=null,a=!1){const f=[];let c=n;for(;c<e.length;){const u=e[c];if(de(u)){const I=xo(e,c+1);if(I===-1){f.push(""),c=e.length;break}const A=i==null?void 0:i(e[I]);if(A&&A.indent===o||ue(e[I])<=o)break;f.push(""),c+=1;continue}const g=i==null?void 0:i(u);if(g&&g.indent===o)break;const p=ue(u),b=a&&(qe(u)!==null||ze(u)!==null);if(p<=o&&!b)break;f.push(p>o?wo(u,o+1):u.trimStart()),c+=1}for(;f.length>0&&de(f[0]);)f.shift();for(;f.length>0&&de(f[f.length-1]);)f.pop();return f.length===0?null:{blocks:at(f.join(`
8
+ `)),nextIndex:c}}function no(e,n,o,i=!1){const a=[];let f=n;const c=o(e[n]);if(!c)return null;const u=c.indent;for(;f<e.length;){const g=o(e[f]);if(g===null||g.indent!==u)break;const p=[g.text],b=[];for(f+=1;f<e.length;){if(de(e[f])){const w=xo(e,f+1);if(w===-1){f=e.length;break}const F=o(e[w]);if(F&&F.indent===u){f=w;break}if(ue(e[w])<=u){f=w;break}f+=1;continue}const I=o(e[f]);if(I&&I.indent===u)break;const A=ue(e[f])>u,x=i&&(qe(e[f])!==null||ze(e[f])!==null);if(A||x){const w=Xs(e,f,u,o,i);if(w){b.push(...w.blocks),f=w.nextIndex;continue}}if(ue(e[f])<=u)break;const P=Js(e,f,u);if(!P)break;p.push(P.value),f=P.nextIndex}a.push(b.length>0?{paragraphs:p,children:b}:{paragraphs:p})}return a.length>0?{items:a,nextIndex:f}:null}function Xt(e){return/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/u.test(e.trim())}function ct(e){const n=e.match(/^\s{0,3}(```+|~~~+)\s*([^\s`~][^`]*)?\s*$/u);return n?{marker:n[1],language:(n[2]??"").trim()}:null}function at(e){var f;const o=bo(e).split(`
9
+ `),i=[];let a=0;for(;a<o.length;){if(de(o[a])){a+=1;continue}const c=ct(o[a]);if(c){a+=1;const w=[];for(;a<o.length;){if(o[a].trim()===c.marker){a+=1;break}w.push(o[a]),a+=1}i.push({kind:"codeBlock",language:c.language,value:w.join(`
10
+ `)});continue}if(Xt(o[a])){i.push({kind:"thematicBreak"}),a+=1;continue}const u=Gt(o[a]);if(u){i.push({kind:"heading",level:u.level,value:u.value}),a+=1;continue}if(st(o[a])!==null){const w=[];for(;a<o.length;){const F=st(o[a]);if(F===null)break;w.push(F),a+=1}i.push({kind:"blockquote",value:w.join(`
11
+ `).trim()});continue}const p=to(o,a);if(p){i.push(p),a+=2+p.rows.length;continue}if(qe(o[a])!==null){const w=[],F=((f=Yn(o[a]))==null?void 0:f.indent)??0;for(;a<o.length;){const B=Yn(o[a]);if(B===null||B.indent!==F)break;w.push(B.item),a+=1}if(w.length>0){i.push({kind:"taskList",items:w});continue}}const I=ze(o[a]);if(I!==null){const w=no(o,a,Ks);if(w){i.push({kind:"unorderedList",items:w.items}),a=w.nextIndex;continue}if(I.length>0){i.push({kind:"unorderedList",items:[{paragraphs:[I]}]}),a+=1;continue}}const A=Zt(o[a]);if(A!==null){const w=Qn(o[a]),F=no(o,a,Qn,!0);if(F){i.push({kind:"orderedList",items:F.items,start:(w==null?void 0:w.start)??1}),a=F.nextIndex;continue}if(A.length>0){i.push({kind:"orderedList",items:[{paragraphs:[A]}],start:(w==null?void 0:w.start)??1}),a+=1;continue}}const x=[];for(;a<o.length&&!(de(o[a])||ct(o[a])||Xt(o[a])||Gt(o[a])||to(o,a)||st(o[a])!==null||qe(o[a])!==null||ze(o[a])!==null||Zt(o[a])!==null);)x.push(o[a]),a+=1;const P=x.join(`
12
+ `).trim();P&&i.push({kind:"paragraph",value:P})}return i}function Ys(e){if(!e.includes("![")||!e.includes("]("))return at(e);const n=[],o=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let i=0;for(const a of e.matchAll(o)){const[f,c,u]=a;if(typeof a.index!="number")continue;const g=a.index,p=g+f.length,b=qs(u.trim());b&&(g>i&&n.push(...at(e.slice(i,g))),n.push({kind:"image",url:b,alt:c.trim(),markdown:f}),i=p)}return i<e.length&&n.push(...at(e.slice(i))),n}function oo(e){const o=bo(e).split(`
13
+ `),i=[];let a=0,f=0;const c=u=>{if(u<=f)return;const g=o.slice(f,u).join(`
14
+ `);i.push(...Ys(g))};for(;a<o.length;){const u=ct(o[a]);if(!u){a+=1;continue}c(a),a+=1;const g=[];for(;a<o.length;){if(o[a].trim()===u.marker){a+=1;break}g.push(o[a]),a+=1}i.push({kind:"codeBlock",language:u.language,value:g.join(`
15
+ `)}),f=a}return c(o.length),i.length>0?i:[{kind:"paragraph",value:e}]}const _o={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",yml:"yaml",md:"markdown","c++":"cpp","c#":"csharp",ps1:"powershell"};function K(e){return`${e.path}\0${e.movedToPath??""}`}function Qs(e,n){return e?!n||e===n?e:`${e}
16
+ ${n}`.trim():n}function ea(e,n){const o=e.operation==="add"||n.operation==="add"?"add":e.operation==="delete"||n.operation==="delete"?"delete":"update";return{path:n.path||e.path,operation:o,movedToPath:n.movedToPath??e.movedToPath??null,diff:Qs(e.diff,n.diff),addedLineCount:e.addedLineCount+n.addedLineCount,removedLineCount:e.removedLineCount+n.removedLineCount}}function ta(e,n){const o=e.operation==="add"?0:e.operation==="update"?1:2,i=n.operation==="add"?0:n.operation==="update"?1:2;if(o!==i)return o-i;const a=`${e.path}\0${e.movedToPath??""}`,f=`${n.path}\0${n.movedToPath??""}`;return a.localeCompare(f)}function jt(e){const n=new Map;for(const o of e){const i=`${o.path}\0${o.movedToPath??""}`,a=n.get(i);n.set(i,a?ea(a,o):{...o})}return Array.from(n.values()).sort(ta)}function on(e,n){return e.operation==="update"&&e.movedToPath?e.addedLineCount>0||e.removedLineCount>0?n("Moved + edited"):n("Moved"):e.operation==="add"?n("Added"):e.operation==="delete"?n("Deleted"):n("Edited")}function na(e){return e.operation==="update"&&e.movedToPath?"→":e.operation==="add"?"+":e.operation==="delete"?"−":"M"}function Yt(e){return e.operation==="update"&&e.movedToPath?"move":e.operation}function $e(e){const n=[];return e.addedLineCount>0&&n.push(`+${e.addedLineCount}`),e.removedLineCount>0&&n.push(`-${e.removedLineCount}`),n.join(" ")}function Co(e,n,o=""){const i=[];return e>0&&i.push({tone:"add",label:`+${e}`}),n>0&&i.push({tone:"remove",label:`-${n}`}),i.length>0?i:o?[{tone:"neutral",label:o}]:[]}function oa(e){return Co(e.addedLineCount,e.removedLineCount)}function To(e,n){return e===1?`1 ${n("file changed")}`:`${e} ${n("files changed")}`}function sa(e,n){if(!e||e.changes.length===0)return"";let o=0,i=0,a=0,f=0;for(const u of e.changes){if(u.operation==="add"){o+=1;continue}if(u.operation==="delete"){i+=1;continue}if(u.movedToPath){f+=1;continue}a+=1}const c=[];return a>0&&c.push(`${a} ${n("edited")}`),o>0&&c.push(`${o} ${n("added")}`),i>0&&c.push(`${i} ${n("deleted")}`),f>0&&c.push(`${f} ${n("moved")}`),c.join(", ")}function aa(e,n){if(!e||e.changes.length===0)return n("Modified files");const o=To(e.changes.length,n),i=sa(e,n);return i?`${o} · ${i}`:o}function ia(e){if(!e||e.changes.length===0)return[];const n=e.changes.reduce((a,f)=>a+f.addedLineCount,0),o=e.changes.reduce((a,f)=>a+f.removedLineCount,0),i=e.changes.some(a=>a.movedToPath)?"Moved":"Ready";return Co(n,o,i)}function Fe(e,n){const o=vo(e,n),i=Pe(Ee(n.trim())),a=Pe(Ee(o));return i&&a.startsWith(`${i}/`)?a.slice(i.length+1):e}function ra(e,n,o){if(!e||e.changes.length===0)return"";const i=e.changes.map(a=>{const f=Fe(a.path,n),c=a.movedToPath?` -> ${Fe(a.movedToPath,n)}`:"",u=$e(a);return`- ${on(a,o)}: ${f}${c}${u?` (${u})`:""}`});return`${o("Modified files")}:
17
+ ${i.join(`
18
+ `)}`.trim()}function la(e){var i;const o=((i=(e.movedToPath||e.path).split(".").pop())==null?void 0:i.toLowerCase())??"";return _o[o]??o??""}function ca(e){return e.operation==="update"&&/^diff --git |^@@ |^--- |^\+\+\+ |^[ +-]|^\*\*\* (Move to:|End of File)/mu.test(e.diff)}function ua(e){const n=e.diff.replace(/\r\n/g,`
19
+ `),o=n.length>0?n.split(`
20
+ `):[];return o.length>0&&o[o.length-1]===""&&o.pop(),o.map((i,a)=>({key:`${K(e)}:synthetic:${a}`,kind:e.operation==="delete"?"remove":"add",oldLine:e.operation==="delete"?a+1:null,newLine:e.operation==="delete"?null:a+1,text:i}))}function da(e){const n=e.diff.replace(/\r\n/g,`
21
+ `),o=n.length>0?n.split(`
22
+ `):[];o.length>0&&o[o.length-1]===""&&o.pop();const i=[];let a=0,f=0;for(const[c,u]of o.entries()){const g=u.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/u);if(g){a=Number(g[1]),f=Number(g[2]),i.push({key:`${K(e)}:hunk:${c}`,kind:"hunk",oldLine:null,newLine:null,text:u});continue}if(u.startsWith("+")&&!u.startsWith("+++")){i.push({key:`${K(e)}:add:${c}`,kind:"add",oldLine:null,newLine:f,text:u.slice(1)}),f+=1;continue}if(u.startsWith("-")&&!u.startsWith("---")){i.push({key:`${K(e)}:remove:${c}`,kind:"remove",oldLine:a,newLine:null,text:u.slice(1)}),a+=1;continue}if(u.startsWith(" ")){i.push({key:`${K(e)}:context:${c}`,kind:"context",oldLine:a,newLine:f,text:u.slice(1)}),a+=1,f+=1;continue}i.push({key:`${K(e)}:meta:${c}`,kind:"meta",oldLine:null,newLine:null,text:u})}return i}function fa(e){return!e||!e.diff.trim()?[]:ca(e)?da(e):ua(e)}function ha(e){return!!(e!=null&&e.diff.trim())}function ma(e){return e.kind==="add"?"+":e.kind==="remove"?"-":e.kind==="hunk"?"@@":""}const ga=["aria-label"],pa={class:"confirm-dialog-title"},va={class:"confirm-dialog-message"},ka={class:"confirm-dialog-actions"},ya=G({__name:"ConfirmDialog",props:{visible:{type:Boolean},title:{},message:{},confirmLabel:{default:""},cancelLabel:{default:""},danger:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(e){return(n,o)=>(l(),J(fo,{to:"body"},[e.visible?(l(),d("div",{key:0,class:"confirm-dialog-overlay",onClick:o[2]||(o[2]=Ae(i=>n.$emit("cancel"),["self"]))},[v("div",{class:"confirm-dialog-panel",role:"alertdialog","aria-modal":"true","aria-label":e.title},[v("h3",pa,y(e.title),1),v("p",va,y(e.message),1),v("div",ka,[v("button",{class:"confirm-dialog-btn confirm-dialog-btn-cancel",type:"button",onClick:o[0]||(o[0]=i=>n.$emit("cancel"))},y(e.cancelLabel||"Cancel"),1),v("button",{class:z(["confirm-dialog-btn confirm-dialog-btn-confirm",{"is-danger":e.danger}]),type:"button",onClick:o[1]||(o[1]=i=>n.$emit("confirm"))},y(e.confirmLabel||"Confirm"),3)])],8,ga)])):L("",!0)]))}}),ba=U(ya,[["__scopeId","data-v-30493aaa"]]),wa={key:0,class:"diff-viewer-sidebar"},$a={class:"diff-viewer-sidebar-header"},xa={class:"diff-viewer-sidebar-title"},_a={class:"diff-viewer-sidebar-count"},Ca={class:"diff-viewer-sidebar-list"},Ta=["data-active","onClick"],La=["data-operation"],Ia={class:"diff-viewer-file-label"},Ma={key:0,class:"diff-viewer-file-delta"},Pa={class:"diff-viewer-main"},Sa={class:"diff-viewer-toolbar"},Aa={class:"diff-viewer-title-wrap"},Ea={class:"diff-viewer-title"},Fa={class:"diff-viewer-subtitle"},Ba={key:0},Ra={class:"diff-viewer-toolbar-actions"},Oa=["aria-label"],Da={key:0,class:"diff-viewer-empty"},Ha={class:"diff-viewer-empty-title"},Wa={class:"diff-viewer-empty-text"},ja={key:1,class:"diff-viewer-panel"},Na={class:"diff-viewer-meta"},za={class:"diff-viewer-language"},qa={class:"diff-viewer-lines"},Ua=["data-kind"],Va={class:"diff-viewer-line-number"},Ka={class:"diff-viewer-line-number"},Ga={class:"diff-viewer-line-marker"},Za=["innerHTML"],Ja={class:"diff-viewer-mobile-sheet-header"},Xa={class:"diff-viewer-sidebar-title"},Ya={class:"diff-viewer-sidebar-count"},Qa={class:"diff-viewer-mobile-sheet-list"},ei=["data-active","onClick"],ti=["data-operation"],ni={class:"diff-viewer-file-label"},oi={key:0,class:"diff-viewer-file-delta"},si=G({__name:"DiffViewer",props:{change:{},changes:{},lines:{},isMobile:{type:Boolean},isFileListOpen:{type:Boolean},cwd:{}},emits:["close","select-change","toggle-file-list","close-file-list"],setup(e){const n=e,{t:o}=ee();function i(u){return u.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#39;")}const a=M(()=>u=>on(u,o)),f=M(()=>u=>To(u,o)),c=M(()=>u=>Fe(u,n.cwd));return(u,g)=>(l(),J(fo,{to:"body"},[e.change?(l(),d("div",{key:0,class:"diff-viewer-backdrop",onClick:g[5]||(g[5]=p=>u.$emit("close"))},[v("div",{class:"diff-viewer-shell",onClick:g[4]||(g[4]=Ae(()=>{},["stop"]))},[e.isMobile?L("",!0):(l(),d("aside",wa,[v("div",$a,[v("p",xa,y(T(o)("Changed files")),1),v("p",_a,y(f.value(e.changes.length)),1)]),v("div",Ca,[(l(!0),d(E,null,D(e.changes,p=>(l(),d("button",{key:`diff-viewer:${T(K)(p)}`,type:"button",class:"diff-viewer-file-button","data-active":T(K)(p)===T(K)(e.change),onClick:b=>u.$emit("select-change",p)},[v("span",{class:"file-change-badge","data-operation":T(Yt)(p)},y(a.value(p)),9,La),v("span",Ia,[ie(y(c.value(p.path))+" ",1),p.movedToPath?(l(),d(E,{key:0},[ie(" → "+y(c.value(p.movedToPath)),1)],64)):L("",!0)]),T($e)(p)?(l(),d("span",Ma,y(T($e)(p)),1)):L("",!0)],8,Ta))),128))])])),v("section",Pa,[v("div",Sa,[v("div",Aa,[v("p",Ea,[ie(y(c.value(e.change.path))+" ",1),e.change.movedToPath?(l(),d(E,{key:0},[ie(" → "+y(c.value(e.change.movedToPath)),1)],64)):L("",!0)]),v("p",Fa,[ie(y(a.value(e.change))+" ",1),T($e)(e.change)?(l(),d("span",Ba," · "+y(T($e)(e.change)),1)):L("",!0)])]),v("div",Ra,[e.isMobile?(l(),d("button",{key:0,type:"button",class:"diff-viewer-mobile-files-button",onClick:g[0]||(g[0]=p=>u.$emit("toggle-file-list"))},y(f.value(e.changes.length)),1)):L("",!0),v("button",{class:"image-modal-close diff-viewer-close",type:"button","aria-label":T(o)("Close diff viewer"),onClick:g[1]||(g[1]=p=>u.$emit("close"))},[W(ho,{class:"icon-svg"})],8,Oa)])]),T(ha)(e.change)?(l(),d("div",ja,[v("div",Na,[v("span",za,y(T(la)(e.change)||"diff"),1)]),v("div",qa,[(l(!0),d(E,null,D(e.lines,p=>(l(),d("div",{key:p.key,class:"diff-viewer-line","data-kind":p.kind},[v("span",Va,y(p.oldLine??""),1),v("span",Ka,y(p.newLine??""),1),v("span",Ga,y(T(ma)(p)),1),v("code",{class:"diff-viewer-line-code",innerHTML:i(p.text)||" "},null,8,Za)],8,Ua))),128))])])):(l(),d("div",Da,[v("p",Ha,y(T(o)("No diff available")),1),v("p",Wa,y(T(o)("This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.")),1)]))]),W(Ps,{name:"diff-viewer-sheet"},{default:Ut(()=>[e.isMobile&&e.isFileListOpen?(l(),d("div",{key:0,class:"diff-viewer-mobile-sheet-backdrop",onClick:g[3]||(g[3]=p=>u.$emit("close-file-list"))},[v("div",{class:"diff-viewer-mobile-sheet",onClick:g[2]||(g[2]=Ae(()=>{},["stop"]))},[g[6]||(g[6]=v("div",{class:"diff-viewer-mobile-sheet-handle","aria-hidden":"true"},null,-1)),v("div",Ja,[v("p",Xa,y(T(o)("Changed files")),1),v("p",Ya,y(f.value(e.changes.length)),1)]),v("div",Qa,[(l(!0),d(E,null,D(e.changes,p=>(l(),d("button",{key:`diff-viewer-sheet:${T(K)(p)}`,type:"button",class:"diff-viewer-file-button","data-active":T(K)(p)===T(K)(e.change),onClick:b=>u.$emit("select-change",p)},[v("span",{class:"file-change-badge","data-operation":T(Yt)(p)},y(a.value(p)),9,ti),v("span",ni,[ie(y(c.value(p.path))+" ",1),p.movedToPath?(l(),d(E,{key:0},[ie(" → "+y(c.value(p.movedToPath)),1)],64)):L("",!0)]),T($e)(p)?(l(),d("span",oi,y(T($e)(p)),1)):L("",!0)],8,ei))),128))])])])):L("",!0)]),_:1})])])):L("",!0)]))}}),ai=U(si,[["__scopeId","data-v-8269a646"]]),ii={},ri={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function li(e,n){return l(),d("svg",ri,[...n[0]||(n[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Qt=U(ii,[["render",li]]),ci={class:"file-change-summary-label"},ui={class:"file-change-summary-status"},di=["data-tone"],fi={class:"file-change-panel-inner"},hi={class:"file-change-list"},mi=["data-operation","title"],gi={class:"file-change-path-group"},pi=["title","onClick"],vi={key:0,class:"file-change-arrow"},ki=["title","onClick"],yi={key:0,class:"file-change-delta"},bi=["data-tone"],wi=["title","aria-label","onClick"],$i={key:0,class:"file-change-actions"},xi={key:0,class:"file-change-action-error"},_i=["disabled","title","aria-label"],Ci=G({__name:"FileChangeSummaryBlock",props:{summary:{},expanded:{type:Boolean},inline:{type:Boolean},cwd:{},actionable:{type:Boolean},actionStatus:{},actionErrorText:{},nextAction:{},actionLabel:{}},emits:["toggle","open-diff","request-action","request-file-action"],setup(e){const n=e,{t:o}=ee(),i=M(()=>u=>on(u,o)),a=M(()=>u=>aa(u,o)),f=M(()=>u=>Fe(u,n.cwd)),c=M(()=>u=>`${o("Undo")} ${Fe(u.path,n.cwd)}`);return(u,g)=>e.summary?(l(),d("section",{key:0,class:z(["file-change-summary-block",{"file-change-summary-block-inline":e.inline}])},[v("button",{type:"button",class:z(["file-change-summary-row",{"file-change-summary-row-expanded":e.expanded}]),onClick:g[0]||(g[0]=p=>u.$emit("toggle"))},[v("span",{class:z(["file-change-chevron",{"file-change-chevron-open":e.expanded}])},"▶",2),v("span",ci,y(a.value(e.summary)),1),v("span",ui,[(l(!0),d(E,null,D(T(ia)(e.summary),p=>(l(),d("span",{key:`summary-status:${e.summary.turnId}:${p.tone}:${p.label}`,class:"file-change-signed-count","data-tone":p.tone},y(p.label),9,di))),128))])],2),v("div",{class:z(["file-change-panel",{"file-change-panel-visible":e.expanded}])},[v("div",fi,[v("ul",hi,[(l(!0),d(E,null,D(e.summary.changes,p=>(l(),d("li",{key:`file-change:${e.summary.turnId}:${p.path}:${p.movedToPath||""}`,class:"file-change-item"},[v("span",{class:"file-change-badge","data-operation":T(Yt)(p),title:i.value(p)},y(T(na)(p)),9,mi),v("span",gi,[v("button",{type:"button",class:"file-change-path-button",title:p.path,onClick:b=>u.$emit("open-diff",p)},y(f.value(p.path)),9,pi),p.movedToPath?(l(),d("span",vi,"→")):L("",!0),p.movedToPath?(l(),d("button",{key:1,type:"button",class:"file-change-path-button",title:p.movedToPath,onClick:b=>u.$emit("open-diff",p)},y(f.value(p.movedToPath)),9,ki)):L("",!0)]),p.addedLineCount>0||p.removedLineCount>0?(l(),d("span",yi,[(l(!0),d(E,null,D(T(oa)(p),b=>(l(),d("span",{key:`change-delta:${e.summary.turnId}:${p.path}:${b.tone}:${b.label}`,class:"file-change-signed-count","data-tone":b.tone},y(b.label),9,bi))),128))])):L("",!0),e.actionable?(l(),d("button",{key:1,type:"button",class:"file-change-file-undo-button",title:c.value(p),"aria-label":c.value(p),onClick:b=>u.$emit("request-file-action",p)},[W(Qt,{class:"icon-svg file-change-action-icon"})],8,wi)):L("",!0)]))),128))]),e.actionable?(l(),d("div",$i,[e.actionErrorText?(l(),d("p",xi,y(e.actionErrorText),1)):L("",!0),v("button",{type:"button",class:"file-change-action-button",disabled:e.actionStatus==="undoing"||e.actionStatus==="redoing",title:e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn","aria-label":e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn",onClick:g[1]||(g[1]=p=>u.$emit("request-action",e.nextAction))},[W(Qt,{class:z(["icon-svg file-change-action-icon",{"file-change-action-icon-redo":e.nextAction==="redo"}])},null,8,["class"]),ie(" "+y(e.actionLabel),1)],8,_i)])):L("",!0)])],2)],2)):L("",!0)}}),Nt=U(Ci,[["__scopeId","data-v-851281a0"]]),Ti=G({__name:"FileLinkContextMenu",props:{visible:{type:Boolean},x:{},y:{},browseUrl:{},editUrl:{}},emits:["close"],setup(e,{emit:n}){const o=e,i=n,a=O(null),f=M(()=>({left:`${String(o.x)}px`,top:`${String(o.y)}px`}));function c(){i("close")}function u(){const x=o.browseUrl;c(),!(!x||x==="#")&&window.open(x,"_blank","noopener,noreferrer")}function g(){const x=o.editUrl;c(),!(!x||x==="#")&&window.open(x,"_blank","noopener,noreferrer")}async function p(){const x=o.browseUrl;if(c(),!(!x||x==="#"))try{await Vt(x)}catch{}}function b(x){if(!o.visible)return;const P=a.value;if(!P){c();return}const w=x.target;w instanceof Node&&P.contains(w)||c()}function I(){c()}function A(x){x.key==="Escape"&&c()}return ce(()=>o.visible,x=>{x?(window.addEventListener("pointerdown",b,!0),window.addEventListener("blur",I),window.addEventListener("keydown",A,!0)):(window.removeEventListener("pointerdown",b,!0),window.removeEventListener("blur",I),window.removeEventListener("keydown",A,!0))}),nn(()=>{window.removeEventListener("pointerdown",b,!0),window.removeEventListener("blur",I),window.removeEventListener("keydown",A,!0)}),(x,P)=>e.visible?(l(),d("div",{key:0,ref_key:"menuRef",ref:a,class:"file-link-context-menu",style:je(f.value),onClick:P[0]||(P[0]=Ae(()=>{},["stop"]))},[v("button",{type:"button",class:"file-link-context-menu-item",onClick:u}," Open link "),v("button",{type:"button",class:"file-link-context-menu-item",onClick:p}," Copy link "),e.editUrl?(l(),d("button",{key:0,type:"button",class:"file-link-context-menu-item",onClick:g}," Edit file ")):L("",!0)],4)):L("",!0)}}),Li=U(Ti,[["__scopeId","data-v-f6643b04"]]),Ii=12e3,Mi=240;function Pi(e,{streaming:n,truncateStreaming:o=!0,maxChars:i=Ii,maxLines:a=Mi}){if(!o)return e;let f=e,c=!1;if(i>0&&f.length>i&&(f=f.slice(-i),c=!0),a>0){const u=f.split(/\r?\n/);u.length>a&&(f=u.slice(-a).join(`
23
+ `),c=!0)}return c?`...
24
+ ${f}`:f}const Si={class:"conversation-item conversation-item-overlay"},Ai={class:"message-row"},Ei={class:"message-stack"},Fi={class:"live-overlay-inline","aria-live":"polite"},Bi={class:"live-overlay-title-row"},Ri={key:0,class:"live-overlay-spinner","aria-hidden":"true"},Oi=["aria-expanded"],Di={class:"live-overlay-label"},Hi={class:"live-overlay-toggle","aria-hidden":"true"},Wi={key:2,class:"live-overlay-label"},ji={key:0,class:"live-overlay-reasoning"},Ni={key:1,class:"live-overlay-error"},zi=["href"],qi=G({__name:"LiveOverlayItem",props:{overlay:{},feedbackMailto:{}},setup(e){const n=e,{buildFeedbackMailto:o,recordVisibleFailure:i}=mo(),{t:a}=ee(),f=O(!0);function c(){f.value=!f.value}const u=M(()=>{var p;return Pi(((p=n.overlay)==null?void 0:p.reasoningText)??"",{streaming:!0})});function g(p,b){i(b);const I=p.currentTarget;I instanceof HTMLAnchorElement&&(I.href=o())}return(p,b)=>{var I,A,x,P,w,F;return l(),d("li",Si,[v("div",Ai,[v("div",Ei,[v("article",Fi,[v("div",Bi,[(I=e.overlay)!=null&&I.errorText?L("",!0):(l(),d("span",Ri)),(A=e.overlay)!=null&&A.reasoningText?(l(),d("button",{key:1,type:"button",class:"live-overlay-heading","aria-expanded":f.value,onClick:c},[v("span",Di,y((x=e.overlay)==null?void 0:x.activityLabel),1),v("span",Hi,y(f.value?"▾":"▸"),1)],8,Oi)):(l(),d("p",Wi,y((P=e.overlay)==null?void 0:P.activityLabel),1))]),(w=e.overlay)!=null&&w.reasoningText&&f.value?(l(),d("p",ji,y(u.value),1)):L("",!0),(F=e.overlay)!=null&&F.errorText?(l(),d("div",Ni,[v("span",null,y(e.overlay.errorText),1),v("a",{class:"live-overlay-feedback",href:e.feedbackMailto,onClick:b[0]||(b[0]=B=>g(B,e.overlay.errorText))},y(T(a)("Send feedback")),9,zi)])):L("",!0)])])])])}}}),Ui=U(qi,[["__scopeId","data-v-b69a0020"]]),Vi={},Ki={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Gi(e,n){return l(),d("svg",Ki,[...n[0]||(n[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Zi=U(Vi,[["render",Gi]]),Ji=["data-role"],Xi=["aria-label","title"],Yi={key:0,class:"message-rollback-label"},Qi=["aria-label","title"],er={class:"message-fork-label"},tr=["data-copied","aria-label","title"],nr={key:0,class:"message-copy-label"},or=G({__name:"MessageToolbar",props:{role:{},showEdit:{type:Boolean,default:!1},showFork:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},copied:{type:Boolean,default:!1}},emits:["edit","fork","copy"],setup(e){const{t:n}=ee();return(o,i)=>e.showEdit||e.showFork||e.showCopy?(l(),d("div",{key:0,class:"message-toolbar","data-role":e.role},[e.showEdit?(l(),d("button",{key:0,type:"button",class:"message-rollback-button","aria-label":T(n)("Rollback this message"),title:T(n)("Rollback this message"),onClick:i[0]||(i[0]=a=>o.$emit("edit"))},[W(Qt,{class:"icon-svg message-rollback-icon"}),e.role!=="user"?(l(),d("span",Yi,y(T(n)("Rollback")),1)):L("",!0)],8,Xi)):L("",!0),e.showFork?(l(),d("button",{key:1,type:"button",class:"message-fork-button","aria-label":T(n)("Fork thread from this response"),title:T(n)("Fork thread from this response"),onClick:i[1]||(i[1]=a=>o.$emit("fork"))},[W(Ss,{class:"icon-svg message-fork-icon"}),v("span",er,y(T(n)("Fork")),1)],8,Qi)):L("",!0),e.showCopy?(l(),d("button",{key:2,type:"button",class:"message-copy-button","data-copied":e.copied,"aria-label":e.copied?T(n)("Response copied"):T(n)("Copy response"),title:e.copied?T(n)("Response copied"):T(n)("Copy response"),onClick:i[2]||(i[2]=a=>o.$emit("copy"))},[W(Zi,{class:"icon-svg message-copy-icon"}),e.role!=="user"?(l(),d("span",nr,y(e.copied?"Copied":"Copy"),1)):L("",!0)],8,tr)):L("",!0)],8,Ji)):L("",!0)}}),sr=U(or,[["__scopeId","data-v-59a7a725"]]),ar="codex-web-local.process-fold.v1",so="codex:web-local:process-fold";function zt(){return typeof localStorage>"u"?"auto":localStorage.getItem(ar)==="expanded"?"expanded":"auto"}function ir(e){const n=o=>e(o.detail);return window.addEventListener(so,n),()=>window.removeEventListener(so,n)}const rr=["aria-expanded"],lr={class:"process-fold-label"},cr={class:"process-fold-toggle","aria-hidden":"true"},ur={key:0,class:"process-fold-body"},dr=G({__name:"ProcessFold",props:{label:{},running:{type:Boolean},hasOutsideContent:{type:Boolean}},setup(e){const n=e,o=O(zt()==="expanded"||!n.hasOutsideContent),i=O(!1);let a=!1;const f=ir(()=>{i.value=!1,zt()==="expanded"?o.value=!0:!n.running&&n.hasOutsideContent&&(o.value=!1)});ce(()=>n.running,u=>{const g=a;a=u,u?(g||(i.value=!1),i.value||(o.value=!0)):g&&!i.value&&n.hasOutsideContent&&zt()!=="expanded"&&(o.value=!1)},{immediate:!0}),nn(()=>f());function c(){i.value=!0,o.value=!o.value}return(u,g)=>(l(),d("div",{class:z(["process-fold",{"process-fold--open":o.value,"process-fold--running":e.running}])},[v("button",{type:"button",class:"process-fold-header","aria-expanded":o.value,onClick:c},[v("span",lr,y(e.label),1),v("span",cr,y(o.value?"▾":"▸"),1)],8,rr),o.value?(l(),d("div",ur,[go(u.$slots,"default",{},void 0)])):L("",!0)],2))}}),fr=U(dr,[["__scopeId","data-v-de9b3329"]]),hr=["aria-label"],mr=["data-turn","aria-label","onClick"],gr={class:"question-jump-preview-text"},pr=2,qt="#3b82f6",vr=G({__name:"QuestionJumpBar",props:{anchors:{},activeTurn:{}},emits:["jump"],setup(e,{emit:n}){const o=e,i=n,{t:a}=ee(),f=O(null),c=O(-1),u=O("0px"),g=M(()=>{const w=c.value;return w<0?null:o.anchors[w]??null});function p(w){var X;const F=o.activeTurn===((X=o.anchors[w])==null?void 0:X.turn),B={};if(c.value<0)return B.width=F?"18px":"12px",B.background=F?qt:void 0,B;const V=Math.abs(w-c.value);return B.width=V===0?"32px":V===1?"20px":V===2?"14px":F?"18px":"12px",B.background=V===0?qt:V===1?"rgba(59,130,246,0.6)":V===2?"rgba(59,130,246,0.35)":F?qt:void 0,B.transitionDelay=`${V*20}ms`,B}function b(w){const F=f.value;if(!F)return-1;const B=Array.from(F.querySelectorAll(".question-jump-item"));let V=-1,X=Number.POSITIVE_INFINITY;for(let R=0;R<B.length;R+=1){const ve=B[R].getBoundingClientRect(),xe=ve.top+ve.height/2,Z=Math.abs(w-xe);Z<X&&(X=Z,V=R)}return V}function I(w){var xe;const F=b(w.clientY);if(F<0)return;c.value=F;const B=f.value;if(!B)return;const X=(xe=Array.from(B.querySelectorAll(".question-jump-item"))[F])==null?void 0:xe.getBoundingClientRect(),R=B.getBoundingClientRect();if(!X)return;const ve=X.top+X.height/2;u.value=`${ve-R.top}px`}function A(){c.value=-1}function x(w){const F=b(w.clientY),B=F>=0?o.anchors[F]:null;B&&i("jump",B.turn)}function P(w){i("jump",w.turn)}return(w,F)=>e.anchors.length>=pr?(l(),d("nav",{key:0,class:"question-jump-bar","aria-label":T(a)("Question navigation")},[v("div",{ref_key:"trackRef",ref:f,class:"question-jump-track",onMousemove:I,onMouseleave:A,onMousedown:x},[(l(!0),d(E,null,D(e.anchors,(B,V)=>(l(),d("button",{key:B.turn,type:"button",class:"question-jump-item","data-turn":B.turn,"aria-label":T(a)("Jump to question {n}",{n:B.turn+1}),onMousedown:F[0]||(F[0]=Ae(()=>{},["prevent"])),onClick:X=>P(B)},[v("span",{class:"question-jump-dot",style:je(p(V))},null,4)],40,mr))),128))],544),g.value?(l(),d("div",{key:0,class:"question-jump-preview",role:"tooltip",style:je({top:u.value})},[v("span",gr,y(g.value.text),1)],4)):L("",!0)],8,hr)):L("",!0)}}),kr=U(vr,[["__scopeId","data-v-96d087d4"]]),yr=["data-state"],br=["aria-expanded"],wr={class:"reasoning-block-title"},$r={class:"reasoning-block-toggle","aria-hidden":"true"},xr={key:0,class:"reasoning-block-body"},_r={key:0,class:"reasoning-block-summary"},Cr=["innerHTML"],Tr=G({__name:"ReasoningBlock",props:{message:{},expanded:{type:Boolean},contentHtml:{}},emits:["toggle"],setup(e){const n=e,{t:o}=ee(),i=M(()=>{var f;return(((f=n.message.reasoning)==null?void 0:f.summary)??[]).map(c=>c.trim()).filter(Boolean).join(`
25
+ `).trim()});return(a,f)=>(l(),d("div",{class:"reasoning-block","data-state":e.expanded?"expanded":"collapsed"},[v("button",{type:"button",class:"reasoning-block-header","aria-expanded":e.expanded,onClick:f[0]||(f[0]=c=>a.$emit("toggle"))},[v("span",wr,y(T(o)("Thinking process")),1),v("span",$r,y(e.expanded?"▾":"▸"),1)],8,br),e.expanded?(l(),d("div",xr,[i.value?(l(),d("p",_r,y(i.value),1)):L("",!0),v("div",{class:"reasoning-block-content message-card",innerHTML:e.contentHtml},null,8,Cr)])):L("",!0)],8,yr))}}),ao=U(Tr,[["__scopeId","data-v-5fa90230"]]),Lr=new Set(["read_file","ls","grep","glob","web_fetch","read_skill","code_index","connect_tool_source"]),Ir=new Set(["write_file","edit_file","multi_edit","move_file","delete_range","delete_symbol","notebook_edit"]),Mr=new Set(["task","run_skill","explore","research","review","security_review"]);function Pr(e){var o;const n=((o=e.toolCall)==null?void 0:o.tool)??"";return Lr.has(n)?"readonly":Ir.has(n)?"modify":Mr.has(n)?"delegate":null}const Sr=2;function Ar(e){var f;const n=[];let o=[],i=null;const a=()=>{if(i!==null&&o.length>=Sr)n.push({type:"batch",kind:i,messages:o});else for(const c of o)n.push({type:"tool",message:c});o=[],i=null};for(const c of e){if(c.messageType!=="toolCall"||((f=c.toolCall)==null?void 0:f.status)==="inProgress"){a(),n.push({type:"tool",message:c});continue}const u=Pr(c);if(u===null){a(),n.push({type:"tool",message:c});continue}i!==null&&i!==u&&a(),i=u,o.push(c)}return a(),n}function Er(e,n,o){const{t:i}=o;if(e==="readonly"){const a=n.filter(g=>{var p,b;return((p=g.toolCall)==null?void 0:p.tool)==="read_file"||((b=g.toolCall)==null?void 0:b.tool)==="ls"}).length,f=n.filter(g=>{var b;const p=((b=g.toolCall)==null?void 0:b.tool)??"";return p==="grep"||p==="glob"||p==="web_fetch"||p==="code_index"}).length,c=n.length-a-f,u=[];return a>0&&u.push(i("Read {n} files",{n:a})),f>0&&u.push(i("Search {n} files",{n:f})),c>0&&u.push(i("{n} read calls",{n:c})),u.join(" · ")}return e==="modify"?i("Modified {n} files",{n:n.length}):e==="delegate"?i("Delegated {n} tasks",{n:n.length}):i("Explored {n} items",{n:n.length})}const Fr={class:"message-row","data-role":"system"},Br={class:"message-stack","data-role":"system"},Rr=["title"],Or={key:0,class:"tool-call-server"},Dr={class:"tool-call-name"},Hr={class:"tool-call-status"},Wr={key:0,class:"work-block-spinner","aria-hidden":"true"},jr={key:1,class:"tool-call-status-icon","aria-hidden":"true"},Nr={key:2,class:"tool-call-status-icon","aria-hidden":"true"},zr=G({__name:"ToolCallRow",props:{message:{}},setup(e){const n=e,{t:o}=ee(),i=M(()=>{const c=n.message.toolCall;if(!c)return"";switch(c.status){case"inProgress":return o("Running");case"failed":return o("Failed");default:return o("Done")}}),a=M(()=>{var c;switch((c=n.message.toolCall)==null?void 0:c.status){case"inProgress":return"tool-call-running";case"failed":return"tool-call-error";default:return"tool-call-ok"}}),f=M(()=>{const c=n.message.toolCall;if(!c)return"";const u=[];return c.server&&u.push(c.server),u.push(c.tool),c.error&&u.push(c.error),typeof c.durationMs=="number"&&c.durationMs>=0&&u.push(`${c.durationMs}ms`),u.join(" · ")});return(c,u)=>{var g,p,b,I;return l(),d("div",Fr,[v("div",Br,[v("div",{class:z(["tool-call-block",a.value]),title:f.value},[u[0]||(u[0]=v("span",{class:"tool-call-icon","aria-hidden":"true"},"🛠",-1)),(g=e.message.toolCall)!=null&&g.server?(l(),d("span",Or,y(e.message.toolCall.server),1)):L("",!0),v("code",Dr,y(((p=e.message.toolCall)==null?void 0:p.tool)||e.message.text||"(tool)"),1),v("span",Hr,[((b=e.message.toolCall)==null?void 0:b.status)==="inProgress"?(l(),d("span",Wr)):((I=e.message.toolCall)==null?void 0:I.status)==="completed"?(l(),d("span",jr,"✓")):(l(),d("span",Nr,"✗")),ie(" "+y(i.value),1)])],10,Rr)])])}}}),en=U(zr,[["__scopeId","data-v-e25278a7"]]),qr=["aria-expanded","title"],Ur={class:"tool-batch-toggle","aria-hidden":"true"},Vr={class:"tool-batch-label"},Kr={class:"tool-batch-count"},Gr={key:0,class:"tool-batch-body"},Zr=G({__name:"ToolBatchBlock",props:{kind:{},messages:{}},setup(e){const n=e,{t:o}=ee(),i=O(!1),a=M(()=>Er(n.kind,n.messages,{t:o})),f=M(()=>n.messages.map(c=>{var u;return((u=c.toolCall)==null?void 0:u.tool)??""}).join(" · "));return(c,u)=>(l(),d("div",{class:z(["tool-batch-block",{"tool-batch-block--open":i.value}])},[v("button",{type:"button",class:"tool-batch-head","aria-expanded":i.value,title:f.value,onClick:u[0]||(u[0]=g=>i.value=!i.value)},[v("span",Ur,y(i.value?"▾":"▸"),1),u[1]||(u[1]=v("span",{class:"tool-batch-icon","aria-hidden":"true"},"🛠",-1)),v("span",Vr,y(a.value),1),v("span",Kr,y(e.messages.length),1)],8,qr),i.value?(l(),d("div",Gr,[(l(!0),d(E,null,D(e.messages,g=>(l(),J(en,{key:g.id,message:g},null,8,["message"]))),128))])):L("",!0)],2))}}),Jr=U(Zr,[["__scopeId","data-v-df1cadae"]]),Xr=["aria-expanded"],Yr={class:"warm-turn__preview"},Qr={key:0,class:"warm-turn__meta"},el={class:"warm-turn__content"},tl={key:1,class:"warm-turn__assistant"},nl=G({__name:"WarmTurnCard",props:{userText:{},assistantPreview:{},toolCount:{},expanded:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const o=n,{t:i}=ee();function a(){o("toggle")}return(f,c)=>(l(),d("div",{class:z(["warm-turn",{"warm-turn--expanded":e.expanded}])},[v("button",{type:"button",class:"warm-turn__head","aria-expanded":e.expanded,onClick:a},[W(As,{class:z(["warm-turn__chevron",{"warm-turn__chevron--open":e.expanded}])},null,8,["class"]),v("span",Yr,y(e.userText),1),e.toolCount>0?(l(),d("span",Qr,y(T(i)("{n} tools",{n:e.toolCount})),1)):L("",!0)],8,Xr),v("div",el,[e.expanded?go(f.$slots,"default",{},void 0,!0,0):e.assistantPreview?(l(),d("div",tl,y(e.assistantPreview),1)):L("",!0)])],2))}}),ol=U(nl,[["__scopeId","data-v-7e3ebbc7"]]),sl=["aria-expanded"],al=["title"],il={class:"work-block-command"},rl={class:"work-block-status"},ll={key:0,class:"work-block-spinner","aria-hidden":"true"},cl={key:1,class:"work-block-status-icon","aria-hidden":"true"},ul={key:2,class:"work-block-status-icon","aria-hidden":"true"},dl={class:"work-block-output-inner"},fl=["textContent"],hl=["textContent"],ml={key:0,class:"work-block-permission-hint",role:"note"},gl=G({__name:"WorkBlockItem",props:{command:{},stepIndex:{},expanded:{type:Boolean},compact:{type:Boolean},outputCondensed:{type:Boolean}},emits:["toggle"],setup(e){const n=e,{t:o}=ee(),i=M(()=>{var g,p;const u=(g=n.command.commandExecution)==null?void 0:g.status;return u==="inProgress"?"cmd-status-running":u==="completed"&&((p=n.command.commandExecution)==null?void 0:p.exitCode)===0?"cmd-status-ok":"cmd-status-error"}),a=M(()=>{const u=n.command.commandExecution;if(!u)return"";switch(u.status){case"inProgress":return o("Running");case"completed":return u.exitCode===0?o("Done"):`${o("Exit")} ${u.exitCode??"?"}`;case"failed":return o("Failed");case"declined":return o("Declined");case"interrupted":return o("Stopped");default:return""}}),f=[/access to the path .* is denied/iu,/access is denied/iu,/permission denied/iu,/not permitted/iu,/EACCES|EPERM/iu,/denied access|deny access/iu,/拒绝访问/iu,/没有权限/iu,/权限不足/iu,/要求提权|需要提权|require_escalated/iu],c=M(()=>{const u=n.command.commandExecution;if(!u||!(u.status==="failed"||u.status==="declined"||typeof u.exitCode=="number"&&u.exitCode!==0))return"";const p=u.aggregatedOutput??"";return!p||!f.some(b=>b.test(p))?"":o("Command blocked by a permission or sandbox restriction; no approval prompt was shown. Check the approval policy or trusted directories if you expected one.")});return(u,g)=>{var p,b,I,A,x,P;return l(),d("div",{class:z(["work-block",[i.value,{"work-block-expanded":e.expanded,"work-block-compact":e.compact}]])},[v("button",{type:"button",class:"work-block-header","aria-expanded":e.expanded,onClick:g[0]||(g[0]=w=>u.$emit("toggle"))},[v("span",{class:"work-step-dot",title:`${T(o)("Step")} ${String(e.stepIndex+1)}`},y(e.stepIndex+1),9,al),v("code",il,y(T(o)("Command")),1),v("span",rl,[((p=e.command.commandExecution)==null?void 0:p.status)==="inProgress"?(l(),d("span",ll)):((b=e.command.commandExecution)==null?void 0:b.status)==="completed"&&((I=e.command.commandExecution)==null?void 0:I.exitCode)===0?(l(),d("span",cl,"✓")):((A=e.command.commandExecution)==null?void 0:A.status)==="failed"?(l(),d("span",ul,"✗")):L("",!0),ie(" "+y(a.value),1)])],8,sl),v("div",{class:z(["work-block-output-wrap",{"work-block-output-visible":e.expanded}])},[v("div",dl,[v("pre",{class:"work-block-output-command",textContent:y(((x=e.command.commandExecution)==null?void 0:x.command)||"(command)")},null,8,fl),v("pre",{class:z(["work-block-output",{"cmd-output-condensed":e.outputCondensed}]),textContent:y(((P=e.command.commandExecution)==null?void 0:P.aggregatedOutput)||"(no output)")},null,10,hl)])],2),c.value?(l(),d("p",ml,y(c.value),1)):L("",!0)],2)}}}),io=U(gl,[["__scopeId","data-v-e9fdf684"]]),pl=2;function ro(e){const n=e.messageType;return n==="commandExecution"||n==="toolCall"}function vl(e){var o,i;return(((o=e.commandExecution)==null?void 0:o.status)??"")==="inProgress"||(((i=e.toolCall)==null?void 0:i.status)??"")==="inProgress"?!0:(e.messageType??"").endsWith(".live")}function kl(e){const n=[];let o=[],i="";const a=()=>{o.length>0&&(n.push(o),o=[])};for(const u of e){const g=u.turnId??"",p=ro(u)&&g!=="";(!p||g!==i)&&(o.length>0&&a(),i=p?g:""),p&&o.push(u)}a();const f=new Map;for(const u of e)u.messageType==="worked"&&u.turnId&&typeof u.durationMs=="number"&&f.set(u.turnId,u.durationMs);const c=[];for(const u of n){if(u.length<pl)continue;const g=u[0].turnId??"";let p=0,b=0,I=0,A=!1;for(const P of u)P.messageType==="toolCall"?p+=1:P.messageType==="reasoning"?b+=1:P.messageType==="commandExecution"&&(I+=1),vl(P)&&(A=!0);const x=e.some(P=>P.turnId===g&&!ro(P));c.push({turnId:g,messages:u,running:A,toolCount:p,thoughtCount:b,commandCount:I,durationMs:f.get(g)??0,hasOutsideContent:x})}return c}function yl(e,n){const{t:o,formatDuration:i}=n,a=[];return e.running?a.push(o("Working…")):e.durationMs>0?a.push(i(e.durationMs)):a.push(o("Processed")),e.toolCount>0&&a.push(o("{n} tools",{n:e.toolCount})),e.thoughtCount>0&&a.push(o("{n} thoughts",{n:e.thoughtCount})),e.commandCount>0&&a.push(o("{n} commands",{n:e.commandCount})),a.join(" · ")}function Lo(e){return e.replace(/\s+/g," ").trim()}function bl(e){const n=Lo(e);return n.length<=80?n:n.slice(0,80)}function Io(e){const n=Lo(e);return n.length<=80?n:n.slice(0,77)+"..."}function tn(e){return{sessionKey:e,expandedWarmTurns:new Set,coldPage:0}}function ut(e,n){return e.sessionKey===n?e:tn(n)}function wl(e,n){const o=ut(e,n);return{...o,coldPage:o.coldPage+1}}function $l(e,n,o){const i=ut(e,n),a=Math.max(0,Math.floor(o));return i.coldPage>=a?i:{...i,coldPage:a}}function lo(e,n,o,i){const a=ut(e,n),f=new Set(a.expandedWarmTurns);return i?f.add(o):f.delete(o),{...a,expandedWarmTurns:f}}function xl(e){return e.role==="user"}function _l(e){var n;return((n=e.messageType)==null?void 0:n.endsWith(".live"))===!0}function Cl(e){var f;const n=[];let o=-1,i=0;const a=(c,u)=>{n.push({userItem:c,assistantPreview:"",toolCount:0,startIdx:u,endIdx:e.length})};for(let c=0;c<e.length;c+=1){const u=e[c];if(xl(u)){if(o>=0)n[n.length-1].endIdx=c;else{n.push({userItem:u,assistantPreview:"",toolCount:0,startIdx:i,endIdx:e.length}),o=c,i=c;continue}o=c,a(u,c)}else if(o>=0&&n.length>0){const g=n[n.length-1],p=((f=u.text)==null?void 0:f.trim())||"";u.role==="assistant"&&!_l(u)&&p&&(g.assistantPreview=Io(p)),u.messageType==="toolCall"&&(g.toolCount+=1)}}return n}function Tl({turnCount:e,hotTurns:n,pageSize:o,coldPage:i}){const a=Math.max(0,e),f=Math.max(0,n),c=Math.max(0,a-Math.min(a,f));if(c===0)return{warmStartTurn:0,warmEndTurn:0,coldTurnCount:0};const u=Math.max(0,o),g=Math.max(0,Math.floor(i)),p=Math.min(c,u*(g+1));return{warmStartTurn:c-p,warmEndTurn:c,coldTurnCount:c-p}}function Ll({turn:e,turnCount:n,hotTurns:o,pageSize:i}){const a=Math.max(0,n),f=Math.max(0,o),c=Math.max(0,a-Math.min(a,f));if(c===0||e>=c)return 0;const u=Math.max(1,i),g=Math.max(0,Math.floor(e)),p=c-g;return Math.max(0,Math.ceil(p/u)-1)}function Il(e,n,o){if(n.length===0)return e.slice(0);if(o>=n.length)return[];const i=n[o].startIdx;return e.slice(i)}const Ml={key:0,class:"conversation-loading"},Pl={key:1,class:"conversation-empty"},Sl={key:0,class:"conversation-load-more"},Al=["disabled"],El={key:1,class:"conversation-load-more conversation-warm-collapse"},Fl=["disabled"],Bl=["id"],Rl={class:"message-row","data-role":"system"},Ol={class:"message-stack","data-role":"system"},Dl={class:"conversation-item conversation-item-fold","data-role":"system","data-message-type":"processFold"},Hl={class:"message-row","data-role":"system"},Wl={class:"message-stack","data-role":"system"},jl={key:0,class:"work-block-list"},Nl={key:0,class:"conversation-item conversation-item-file-change","data-role":"system","data-message-type":"fileChange"},zl={class:"message-row","data-role":"system"},ql={class:"message-stack","data-role":"system"},Ul=["id","data-role","data-message-type"],Vl={key:0,class:"message-row thread-compaction-row","data-role":"system"},Kl={class:"thread-compaction-inline thread-compaction-inline--pending",role:"status"},Gl={key:1,class:"message-row thread-compaction-row","data-role":"system"},Zl={class:"thread-compaction-inline thread-compaction-inline--done",role:"status"},Jl={key:2,class:"message-row","data-role":"system"},Xl={class:"message-stack","data-role":"system"},Yl={class:"work-block-list"},Ql=["data-role","data-message-type"],ec=["data-role"],tc=["data-role"],nc=["data-role","data-message-type"],oc=["data-role"],sc=["data-role"],ac=["data-role"],ic=["onClick"],rc=["src"],lc=["src","alt"],cc={key:1,class:"message-file-attachments"},uc=["href","title"],dc={key:2,class:"message-skill-attachments"},fc=["href","title"],hc={class:"message-skill-chip-prefix"},mc={class:"message-skill-chip-name"},gc=["data-role"],pc={key:0,class:"automation-message-label"},vc={key:0},kc={key:1,class:"work-summary-wrap","aria-live":"polite"},yc={class:"work-summary-text"},bc={key:0,class:"message-text"},wc={key:0},$c={key:1,class:"message-bold-text"},xc={key:2,class:"message-italic-text"},_c={key:3,class:"message-strikethrough-text"},Cc=["href","title"],Tc=["href","title"],Lc={key:6,class:"message-inline-code"},Ic={key:0},Mc={key:1,class:"message-bold-text"},Pc={key:2,class:"message-italic-text"},Sc={key:3,class:"message-strikethrough-text"},Ac=["href","title"],Ec=["href","title"],Fc={key:6,class:"message-inline-code"},Bc={key:2,class:"message-blockquote"},Rc={key:0},Oc={key:1,class:"message-bold-text"},Dc={key:2,class:"message-italic-text"},Hc={key:3,class:"message-strikethrough-text"},Wc=["href","title"],jc=["href","title"],Nc={key:6,class:"message-inline-code"},zc={key:3,class:"message-list message-list-unordered"},qc=["innerHTML"],Uc={key:4,class:"message-list message-task-list"},Vc=["data-checked"],Kc={class:"message-list-item-text"},Gc={key:0},Zc={key:1,class:"message-bold-text"},Jc={key:2,class:"message-italic-text"},Xc={key:3,class:"message-strikethrough-text"},Yc=["href","title"],Qc=["href","title"],eu={key:6,class:"message-inline-code"},tu=["start"],nu=["innerHTML"],ou={key:6,class:"message-table-wrap"},su={class:"message-table"},au={key:0},iu={key:1,class:"message-bold-text"},ru={key:2,class:"message-italic-text"},lu={key:3,class:"message-strikethrough-text"},cu=["href","title"],uu=["href","title"],du={key:6,class:"message-inline-code"},fu={key:0},hu={key:0},mu={key:1,class:"message-bold-text"},gu={key:2,class:"message-italic-text"},pu={key:3,class:"message-strikethrough-text"},vu=["href","title"],ku=["href","title"],yu={key:6,class:"message-inline-code"},bu={key:7,class:"message-code-block"},wu={key:0,class:"message-code-language"},$u={class:"message-code-pre"},xu=["innerHTML"],_u={key:8,class:"message-divider"},Cu={key:9,class:"message-text"},Tu=["onClick"],Lu=["src"],Iu=["src","alt","onError"],Mu=["href","onClick"],Pu={key:0,class:"conversation-item conversation-item-file-change","data-role":"system","data-message-type":"fileChange"},Su={class:"message-row","data-role":"system"},Au={class:"message-stack","data-role":"system"},Eu=["title","aria-label"],Fu=["aria-label"],Bu=["src"],Ru=["src","alt"],Ou=16,Du=300,Hu=1200,Wu=300,ju=250,co=30,uo=20,Nu=200,zu=G({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},liveTurnId:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},hasMorePersistedAbove:{type:Boolean},isLoadingPersistedAbove:{type:Boolean},loadEarlierMessages:{type:Function}},emits:["forkThread","rollback","respondServerRequest","fileChangesChanged"],setup(e,{expose:n,emit:o}){function i(t){return ra(t,_.cwd,R)}function a(t){return Fe(t,_.cwd)}const f=O(new Set),c=O(new Set),u=O(new Set),g=O(null),p=O(""),b=O(!1),I=O(!1),A=O(0),x=O(0),P=O(""),w=O(""),{isMobile:F}=Es(),{buildFeedbackMailto:B,feedbackMailtoBase:V,recordVisibleFailure:X}=mo(),{t:R}=ee(),ve=V();function xe(t,s){X(s);const h=t.currentTarget;h instanceof HTMLAnchorElement&&(h.href=B())}function Z(t){return t.messageType==="commandExecution"&&!!t.commandExecution}function Mo(t){return t.messageType==="compaction.pending"}function Po(t){return t.messageType==="compaction.done"}function dt(t){return t.messageType==="plan"||t.messageType==="plan.live"}function ft(t){return t.messageType==="reasoning"&&!!t.reasoning}const ht=O(new Set);function sn(t){return ht.value.has(t.id)}function an(t){const s=new Set(ht.value);s.has(t.id)?s.delete(t.id):s.add(t.id),ht.value=s}function rn(t){return t.messageType==="toolCall"&&!!t.toolCall}function So(t){return t.messageType==="turnError"}function Ue(t){return t.messageType==="fileChange"&&t.fileChangeStatus==="completed"&&Array.isArray(t.fileChanges)&&t.fileChanges.length>0}function mt(t){return t.role==="assistant"&&!Z(t)&&t.messageType!=="worked"&&!(t.messageType??"").endsWith(".live")}const gt=M(()=>{var t;for(let s=_.messages.length-1;s>=0;s-=1){const h=_.messages[s];if(h.messageType==="commandExecution"&&((t=h.commandExecution)==null?void 0:t.status)==="inProgress")return h.id}return""}),ln=M(()=>_.messages.some(t=>t.role==="assistant"&&t.messageType==="agentMessage.live"&&t.text.trim().length>0)),cn=M(()=>!!_.liveOverlay||gt.value.length>0||ln.value),un=M(()=>{const t={};for(let s=0;s<_.messages.length;){const h=_.messages[s];if(!Z(h)){s+=1;continue}const r=[];for(;s<_.messages.length&&Z(_.messages[s]);)r.push(_.messages[s]),s+=1;if(r.length<=1)continue;const m=r[r.length-1];t[m.id]=r.slice(0,-1)}return t}),pt=M(()=>{const t=new Set;for(const s of Object.values(un.value))for(const h of s)t.add(h.id);return t});function dn(t){return!ln.value&&t.id===gt.value}function fn(t){return Z(t)?f.value.has(t.id)||!c.value.has(t.id)&&dn(t):!1}function hn(t){return Z(t)&&cn.value}function mn(t){var s;return Z(t)&&(cn.value||((s=t.commandExecution)==null?void 0:s.status)==="inProgress")}function gn(t){if(!Z(t))return;const s=new Set(f.value),h=new Set(c.value),r=dn(t);s.has(t.id)?(s.delete(t.id),r&&h.add(t.id)):r&&!h.has(t.id)?h.add(t.id):(s.add(t.id),h.delete(t.id)),f.value=s,c.value=h}function Ao(t){return un.value[t.id]??[]}function pn(t){return Z(t)?[...Ao(t),t]:[]}function vt(t){const s=new Set(u.value);s.has(t.id)?s.delete(t.id):s.add(t.id),u.value=s}function kt(t){return u.value.has(t.id)}function yt(t,s){t&&(g.value=t,p.value=K(s),b.value=!1)}function Eo(){g.value=null,p.value="",b.value=!1}function Fo(){b.value=!b.value}function Bo(){b.value=!1}function Ro(t){p.value=K(t),F.value&&(b.value=!1)}function bt(t,s){if(t.size===0)return t;const h=new Set;for(const r of t)s.has(r)&&h.add(r);return h.size===t.size?t:h}const _=e,wt=o,fe=O(null),vn=O(null),_e=O(""),$t=O(!1),ke=O(""),q=O({}),te=O({}),ne=O({}),re=O(null),Oo=M(()=>{const t=re.value;return t?t.kind==="edit-message"?R("Rollback this turn?"):t.action==="undo"?R("Undo file changes?"):R("Redo file changes?"):""}),Do=M(()=>{const t=re.value;return t?t.kind==="edit-message"?R("This rolls the thread back to this turn so you can edit the message. Later replies will be removed."):t.filePathLabel?t.action==="undo"?R("Undo the changes to {file}? This modifies the working tree and Codex cannot revert it automatically.",{file:t.filePathLabel}):R("Redo the changes to {file}? This reapplies the edits to the working tree.",{file:t.filePathLabel}):t.action==="undo"?R("Undo the file changes from this turn? This modifies the working tree and Codex cannot revert it automatically."):R("Redo the file changes from this turn? This reapplies the edits to the working tree."):""}),he=O(!0);let ye=0,oe=0,Ve=0,Y=null,Be=null;const kn=new WeakSet,Ke=O(null),Ce=O(0),yn=O(0);let Ge=null;const Re=new Map,Oe=new Map,Te=new Map,Le=new Map;function Ze(t,s,h,r){for(t.has(s)&&t.delete(s),t.set(s,h);t.size>r;){const m=t.keys().next().value;if(m===void 0)break;t.delete(m)}return h}const me=O(tn(_.activeThreadId)),bn=M(()=>ut(me.value,_.activeThreadId)),ge=O(!1),wn=M(()=>_.messages.filter(t=>!dt(t))),De=M(()=>Cl(wn.value)),xt=M(()=>Tl({turnCount:De.value.length,hotTurns:co,pageSize:uo,coldPage:bn.value.coldPage})),$n=M(()=>xt.value.warmStartTurn),Je=M(()=>xt.value.warmEndTurn),xn=M(()=>xt.value.coldTurnCount),_n=M(()=>xn.value>0),Cn=M(()=>bn.value.expandedWarmTurns),Tn=M(()=>{const t=wn.value,s=De.value,h=[],r=Cn.value;for(let m=$n.value;m<Je.value;m+=1){const $=s[m];if(!$)continue;const k=Io($.userItem.text),C=$.assistantPreview,S=$.toolCount;if(r.has(m)){h.push({kind:"warm-card",key:`warm-head-${m}`,turn:m,userText:k,assistantPreview:C,toolCount:S,expanded:!0});for(let N=$.startIdx;N<$.endIdx;N+=1){const H=t[N];H&&h.push({kind:"message",key:H.id,message:H})}}else h.push({kind:"warm-card",key:`warm-${m}`,turn:m,userText:k,assistantPreview:C,toolCount:S,expanded:!1})}for(const m of Il(t,s,Je.value))h.push({kind:"message",key:m.id,message:m});return h});function Ln(){me.value=wl(me.value,_.activeThreadId)}function Ho(t){me.value=lo(me.value,_.activeThreadId,t,!Cn.value.has(t))}const In=M(()=>De.value.map((t,s)=>({turn:s,text:bl(t.userItem.text)}))),Wo=M(()=>Math.max(0,In.value.length-1)),jo=M(()=>{const t=new Map;return De.value.forEach((s,h)=>{t.set(s.userItem.id,h)}),t});function _t(t){return`question-anchor-${t}`}function No(t){const s=jo.value.get(t.id);if(s!==void 0&&!(s<Je.value))return _t(s)}function zo(t){if(t<Je.value){let s=me.value;if(t<$n.value){const h=Ll({turn:t,turnCount:De.value.length,hotTurns:co,pageSize:uo});s=$l(s,_.activeThreadId,h)}s=lo(s,_.activeThreadId,t,!0),me.value=s}he.value=!1,ot().then(()=>{const s=fe.value,h=document.getElementById(_t(t));if(!s||!h)return;const r=h.getBoundingClientRect(),m=s.getBoundingClientRect(),$=s.scrollTop+r.top-m.top-12;s.scrollTo({top:Math.max(0,$),behavior:"smooth"})})}const Ct=M(()=>{const t=[];for(const s of Tn.value)s.kind==="message"&&t.push(s.message);return kl(t)}),He=M(()=>{var s;const t=new Map;for(const h of Ct.value){const r=((s=h.messages[0])==null?void 0:s.id)??"";r&&t.set(r,h)}return t}),qo=M(()=>{const t=new Set;for(const s of Ct.value)for(const h of s.messages)t.add(h.id);return t}),Uo=M(()=>{const t=new Set;for(const s of Ct.value)t.add(s.turnId);return t});function Vo(t){return He.value.has(t.id)}function Mn(t){return qo.value.has(t.id)}function Pn(t){var s;return((s=He.value.get(t.id))==null?void 0:s.messages)??[]}function Tt(t){const s=Pn(t);return s[s.length-1]??t}function se(t){return Q(Tt(t))}function Ko(t){return Ar(Pn(t))}function Go(t){var s;return t.type==="batch"?`tool-batch-${t.kind}-${((s=t.messages[0])==null?void 0:s.id)??""}`:t.message.id}function Zo(t){const s=He.value.get(t.id);return s?yl(s,{t:R,formatDuration:Hs}):""}function Jo(t){var s;return((s=He.value.get(t.id))==null?void 0:s.running)??!1}function Xo(t){var s;return((s=He.value.get(t.id))==null?void 0:s.hasOutsideContent)??!0}function Yo(t){return t.messageType==="worked"}const Qo=M(()=>_.hasMorePersistedAbove===!0),es=M(()=>!he.value&&(_.messages.length>0||_.pendingRequests.length>0||!!_.liveOverlay));function ts(){return Ke.value?Promise.resolve():(Ge||(Ge=Rs(()=>import("./common-BeuopZEI.js"),[]).then(t=>{Ke.value=t.default,Le.clear(),Te.clear(),Ce.value+=1}).finally(()=>{Ge=null})),Ge)}function ns(t){switch(t){case"completed":return"[x]";case"inProgress":return"[~]";default:return"[ ]"}}function os(t){var r;const s=Ds(t);if(!s)return"";const h=[];return(r=s.explanation)!=null&&r.trim()&&h.push(s.explanation.trim()),s.steps.length>0&&h.push(s.steps.map(m=>`- ${ns(m.status)} ${m.step}`.trim()).join(`
26
+ `)),h.join(`
27
+
28
+ `).trim()}function Lt(t){const s=[],h=t.text.trim()||os(t),r=dt(t)&&h?`Plan
29
+ ${h}`:h;r&&s.push(r);const m=(t.fileAttachments??[]).map(k=>k.path.trim()).filter(k=>k.length>0);m.length>0&&s.push(`Files:
30
+ ${m.join(`
31
+ `)}`);const $=(t.images??[]).map(k=>k.trim()).filter(k=>k.length>0);return $.length>0&&s.push(`Images:
32
+ ${$.join(`
33
+ `)}`),s.join(`
34
+
35
+ `).trim()}const Sn=M(()=>{var h;const t=new Map;for(const r of _.messages){if(!mt(r))continue;const m=Lt(r);if(!m)continue;const $=typeof r.turnIndex=="number"?`turn:${r.turnIndex}`:`message:${r.id}`,k=t.get($);if(k){k.anchorMessageId=r.id,k.parts.push(m);continue}t.set($,{anchorMessageId:r.id,parts:[m]})}const s={};for(const r of t.values()){const m=r.parts.join(`
36
+
37
+ `).trim();m&&(s[r.anchorMessageId]=m)}for(const[r,m]of Object.entries(We.value)){if(m.source!=="metadata")continue;const $=i(m);if(!$)continue;const k=(h=s[r])==null?void 0:h.trim();s[r]=k?`${k}
38
+
39
+ ${$}`:$}return s}),An=M(()=>{const t=new Map;for(const h of _.messages){if(!mt(h)||typeof h.turnIndex!="number")continue;const r=`turn:${h.turnIndex}`,m=t.get(r);if(m){m.anchorMessageId=h.id,m.turnIndex=h.turnIndex;continue}t.set(r,{anchorMessageId:h.id,turnIndex:h.turnIndex})}const s={};for(const h of t.values())s[h.anchorMessageId]=h.turnIndex;return s});function ss(t){return typeof Sn.value[t.id]=="string"}function as(t){return t.role==="user"&&Lt(t).length>0}async function is(t){const s=_.messages.find(m=>m.id===t);if(!s)return;const h=Lt(s);if(!h)return;let r=!1;try{await Vt(h),r=!0}catch{r=!1}r||(r=Gn(h)),r&&(ke.value=t,Y&&clearTimeout(Y),Y=setTimeout(()=>{ke.value===t&&(ke.value=""),Y=null},1800))}function rs(t){return typeof An.value[t.id]=="number"}const We=M(()=>{var $,k;const t=new Map,s=new Map,h=new Map,r=C=>!Ue(C)&&!ft(C)&&!dt(C)&&!pt.value.has(C.id)&&!Mn(C);for(const C of _.messages){const S=typeof C.turnIndex=="number"?`turn:${C.turnIndex}`:`message:${C.id}`;if(r(C)&&t.set(S,C.id),mt(C)&&typeof C.turnIndex=="number"&&Array.isArray(C.fileChanges)&&C.fileChanges.length>0&&s.set(C.id,{changes:jt(C.fileChanges),sourceMessageIds:[],source:"assistant",turnId:C.turnId??""}),!Ue(C))continue;const N=h.get(S);N?N.push(C):h.set(S,[C])}const m={};for(const[C,S]of h.entries()){const N=t.get(C);if(!N)continue;const H=(($=s.get(N))==null?void 0:$.turnId)??"";m[N]={changes:jt(S.flatMap(pe=>pe.fileChanges??[])),sourceMessageIds:S.map(pe=>pe.id),source:"metadata",turnId:((k=S.find(pe=>typeof pe.turnId=="string"&&pe.turnId.length>0))==null?void 0:k.turnId)??H}}for(const[C,S]of s.entries())m[C]||(m[C]=S);return m}),It=M(()=>{var r;const t=new Map,s=new Set;for(const m of Object.values(We.value))for(const $ of m.sourceMessageIds)s.add($);for(const m of _.messages){if(!Ue(m))continue;const $=typeof m.turnIndex=="number"?`turn:${m.turnIndex}`:`message:${m.id}`,k=t.get($);k?k.push(m):t.set($,[m])}const h={};for(const[m,$]of t.entries()){if($.some(C=>s.has(C.id)))continue;const k=$[$.length-1];k&&(h[k.id]={changes:jt($.flatMap(C=>C.fileChanges??[])),sourceMessageIds:$.map(C=>C.id),source:"metadata",turnId:k.turnId??((r=$.find(C=>typeof C.turnId=="string"&&C.turnId.length>0))==null?void 0:r.turnId)??""})}return h}),En=M(()=>{const t=new Set;for(const s of Object.values(We.value))for(const h of s.sourceMessageIds)t.add(h);for(const[s,h]of Object.entries(It.value))for(const r of h.sourceMessageIds)r!==s&&t.add(r);return t});function Q(t){return We.value[t.id]??null}function ae(t){return It.value[t.id]??null}function Mt(t){if(!t)return!1;const s=_.liveTurnId??"";return s?(t.turnId??"")!==s:!0}function Ie(t){return t!=null&&t.turnId&&_.activeThreadId?`thread:${_.activeThreadId}:turn:${t.turnId}`:""}function Pt(t){return Ie(t).length>0}function Me(t){const s=Ie(t);return s?q.value[s]??"idle":"idle"}function St(t){const s=Ie(t);return s?te.value[s]??"":""}function Xe(t){const s=Me(t);return s==="undone"||s==="redoing"?"redo":"undo"}function At(t){const s=Me(t);return s==="undoing"?R("Undoing"):s==="redoing"?R("Redoing"):Xe(t)==="redo"?R("Redo"):R("Undo")}async function ls(t,s,h){const r=Ie(t);if(!t||!r||!_.activeThreadId||!_.cwd)return;const m=Me(t),$=s==="undo"?"undoing":"redoing";q.value={...q.value,[r]:$},te.value={...te.value,[r]:""};let k;try{const C=ne.value[r]??[];k=await Os(_.activeThreadId,t.turnId,_.cwd,s,C.length>0?C:void 0,"single_turn",h)}catch(C){q.value={...q.value,[r]:m},te.value={...te.value,[r]:C instanceof Error?C.message:R("Failed to update file changes.")};return}if(k.errors.length>0){s==="undo"?(ne.value={...ne.value,[r]:k.revertedPatchIds??[]},q.value={...q.value,[r]:"undone"}):((k.appliedPatchIds??[]).length>0&&(ne.value={...ne.value,[r]:k.appliedPatchIds??[]}),q.value={...q.value,[r]:"undone"}),te.value={...te.value,[r]:k.errors.join("; ")};return}if((k.changed??0)<=0){q.value={...q.value,[r]:m},te.value={...te.value,[r]:k.message||R(s==="undo"?"No file changes to undo.":"No file changes to redo.")};return}s==="undo"?(ne.value={...ne.value,[r]:k.revertedPatchIds??[]},q.value={...q.value,[r]:"undone"}):(ne.value={...ne.value,[r]:k.appliedPatchIds??[]},q.value={...q.value,[r]:"redone"}),wt("fileChangesChanged",_.activeThreadId)}const Fn=M(()=>{var t;return((t=g.value)==null?void 0:t.changes)??[]}),Bn=M(()=>{const t=Fn.value;return t.length===0?null:t.find(s=>K(s)===p.value)??t[0]}),cs=M(()=>fa(Bn.value));async function us(t){const s=Sn.value[t]??"";if(!s)return;let h=!1;try{await Vt(s),h=!0}catch{h=!1}h||(h=Gn(s)),h&&(ke.value=t,Y&&clearTimeout(Y),Y=setTimeout(()=>{ke.value===t&&(ke.value=""),Y=null},1800))}function ds(t){const s=An.value[t];typeof s=="number"&&_.activeThreadId&&wt("forkThread",{threadId:_.activeThreadId,turnIndex:s})}const Et=M(()=>{const t={};for(const s of _.messages){if(s.role!=="user"||typeof s.turnIndex!="number")continue;const h=typeof s.turnId=="string"&&s.turnId.length>0?s.turnId:"";!h||s.text.trim().length===0||(t[s.id]=h)}return t});function fs(t){return typeof Et.value[t.id]=="string"}function hs(t){Et.value[t]&&(re.value={kind:"edit-message",messageId:t})}function Ft(t,s){Ie(t)&&(re.value={kind:"file-change",summary:t,action:s})}function Bt(t,s){!t||!Ie(t)||!s.path||(re.value={kind:"file-change",summary:t,action:"undo",filePaths:[s.path],filePathLabel:a(s.path)})}function ms(){const t=re.value;if(re.value=null,!!t){if(t.kind==="edit-message"){const s=Et.value[t.messageId];s&&wt("rollback",{turnId:s});return}ls(t.summary,t.action,t.filePaths)}}function be(t){const s=Oe.get(t);return s?(Oe.delete(t),Oe.set(t,s),s):Ze(Oe,t,Vs(t),Hu)}function le(t){const s=t.trim();if(!s)return"#";const h=k=>k.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(k),r=Ne(s),m=(r==null?void 0:r.path)??s,$=vo(m,_.cwd);if(h($)){const k=$.startsWith("/")?$:`/${$}`;return`/codex-local-browse${encodeURI(k)}`}return"#"}function gs(t){const s=t.trim();if(!s)return"";try{const h=new URL(s,window.location.href);return h.pathname.startsWith("/codex-local-browse")?`${`/codex-local-edit${h.pathname.slice(19)}`}${h.search}${h.hash}`:""}catch{return""}}function ps(t){const s=t.target;if(!(s instanceof Element))return;const h=s.closest("a.message-file-link");if(!(h instanceof HTMLAnchorElement))return;const r=(h.getAttribute("href")??"").trim();!r||r==="#"||(t.preventDefault(),t.stopPropagation(),P.value=r,w.value=gs(r),A.value=t.clientX,x.value=t.clientY,I.value=!0)}function vs(){I.value&&(I.value=!1)}function ks(t){const s=Re.get(t.id);if(s&&s.text===t.text&&s.cwd===_.cwd)return Re.delete(t.id),Re.set(t.id,s),s.blocks;const h=oo(t.text);return Ze(Re,t.id,{text:t.text,cwd:_.cwd,blocks:h},Du).blocks}function j(t){return t.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#39;")}function Rn(t){var h;const s=((h=t.trim().split(/\s+/u)[0])==null?void 0:h.toLowerCase())??"";return s?_o[s]??s:""}function ys(t,s){const h=Rn(t);if(!h)return j(s);const r=Ke.value;if(!r)return j(s);try{if(r.getLanguage(h))return r.highlight(s,{language:h,ignoreIllegals:!0}).value}catch{}return j(s)}function On(t,s){return Ht(bs(t,s))}function bs(t,s){const h=`${Ce.value}\0${Rn(t)}\0${t}\0${s}`,r=Le.get(h);return r!==void 0?(Le.delete(h),Le.set(h,r),r):Ze(Le,h,ys(t,s),ju)}function we(t){return be(t).map(s=>s.kind==="text"?j(s.value):s.kind==="bold"?`<strong class="message-bold-text">${j(s.value)}</strong>`:s.kind==="italic"?`<em class="message-italic-text">${j(s.value)}</em>`:s.kind==="strikethrough"?`<s class="message-strikethrough-text">${j(s.value)}</s>`:s.kind==="file"?`<a class="message-file-link" href="${j(le(s.path))}" target="_blank" rel="noopener noreferrer" title="${j(s.path)}">${j(s.displayPath)}</a>`:s.kind==="url"?`<a class="message-file-link" href="${j(s.href)}" target="_blank" rel="noopener noreferrer" title="${j(s.href)}">${j(s.value)}</a>`:`<code class="message-inline-code">${j(s.value)}</code>`).join("")}function ws(t){return t.paragraphs.map(s=>`<div class="message-list-item-text message-list-item-paragraph">${we(s)}</div>`).join("")}function Ye(t){var r;const s=ws(t),h=((r=t.children)==null?void 0:r.map(m=>Hn(m)).join(""))??"";return Ht(s+h)}function Dn(t){return t?` style="text-align:${t}"`:""}function Hn(t){if(t.kind==="paragraph")return`<p class="message-text">${we(t.value)}</p>`;if(t.kind==="heading"){const s=Math.min(6,Math.max(1,Math.trunc(t.level))),h=Jn(s),r=`message-heading ${Xn(s)}`;return`<${h} class="${r}">${we(t.value)}</${h}>`}if(t.kind==="blockquote")return`<blockquote class="message-blockquote">${we(t.value)}</blockquote>`;if(t.kind==="unorderedList")return`<ul class="message-list message-list-unordered">${t.items.map(h=>`<li class="message-list-item"><div class="message-list-item-content">${Ye(h)}</div></li>`).join("")}</ul>`;if(t.kind==="taskList")return`<ul class="message-list message-task-list">${t.items.map(h=>`<li class="message-task-item"><span class="message-task-checkbox" data-checked="${h.checked?"true":"false"}">${h.checked?"☑":"☐"}</span><div class="message-list-item-text">${we(h.text)}</div></li>`).join("")}</ul>`;if(t.kind==="orderedList"){const s=t.items.map(h=>`<li class="message-list-item"><div class="message-list-item-content">${Ye(h)}</div></li>`).join("");return`<ol class="message-list message-list-ordered" start="${t.start}">${s}</ol>`}if(t.kind==="table"){const s=t.headers.map((m,$)=>`<th class="message-table-head-cell"${Dn(t.alignments[$]??null)}>${we(m)}</th>`).join(""),h=t.rows.map(m=>'<tr class="message-table-body-row">'+m.map(($,k)=>`<td class="message-table-cell"${Dn(t.alignments[k]??null)}>${we($)}</td>`).join("")+"</tr>").join(""),r=h?`<tbody>${h}</tbody>`:"";return`<div class="message-table-wrap"><table class="message-table"><thead><tr>${s}</tr></thead>${r}</table></div>`}return t.kind==="codeBlock"?`<div class="message-code-block">${t.language?`<div class="message-code-language">${j(t.language)}</div>`:""}<pre class="message-code-pre"><code class="hljs">${On(t.language,t.value)}</code></pre></div>`:t.kind==="thematicBreak"?'<hr class="message-divider">':nt(t.url)?`<video class="message-image-preview message-video-preview message-markdown-image" src="${j(t.url)}" controls preload="metadata"></video>`:`<img class="message-image-preview message-markdown-image" src="${j(t.url)}" alt="${j(t.alt||"Embedded message image")}" loading="lazy">`}function Wn(t){const s=`${_.cwd}\0${Ce.value}\0${t}`,h=Te.get(s);if(h&&h.text===t&&h.cwd===_.cwd&&h.highlightVersion===Ce.value)return Te.delete(s),Te.set(s,h),h.html;const r=oo(t).map($=>Hn($)).join(""),m=Ht(r);return Ze(Te,s,{text:t,cwd:_.cwd,highlightVersion:Ce.value,html:m},Wu).html}function $s(){const t=fe.value,s=vn.value;!t||!s||(t.scrollTop=t.scrollHeight,s.scrollIntoView({block:"end"}))}function xs(t){return t.scrollHeight-(t.scrollTop+t.clientHeight)<=Ou}function _s(){if(fe.value&&he.value){Qe();return}}function Qe(){fe.value&&$s()}function Rt(){return he.value}function jn(){if(!Rt()){Ve=0,oe=0;return}if(Qe(),Ve-=1,Ve<=0){oe=0;return}oe=requestAnimationFrame(jn)}function et(t=6){Rt()&&(oe&&(cancelAnimationFrame(oe),oe=0),Ve=Math.max(t,1),oe=requestAnimationFrame(jn))}function Nn(){et(3)}function zn(){he.value=!0,Qe(),et(4)}async function qn(){var m;const t=fe.value;if(!t||!_.hasMorePersistedAbove||ge.value||_.isLoadingPersistedAbove===!0)return;ge.value=!0;const s=_.activeThreadId,h=t.scrollHeight,r=t.scrollTop;try{await((m=_.loadEarlierMessages)==null?void 0:m.call(_,s)),await ot(),_.activeThreadId===s&&(t.scrollTop=r+(t.scrollHeight-h))}finally{ge.value=!1}}n({jumpToLatest:zn});function Cs(){if(!Rt())return;const t=fe.value;if(!t)return;const s=t.querySelectorAll("img.message-image-preview");for(const h of s)h.complete||kn.has(h)||(kn.add(h),h.addEventListener("load",Nn,{once:!0}),h.addEventListener("error",Nn,{once:!0}))}async function tt(){return Be||(Be=ot().then(()=>new Promise(t=>{ye&&cancelAnimationFrame(ye),ye=requestAnimationFrame(()=>{ye=0,Be=null,_s(),Cs(),et(),t()})})),Be)}function Ts(){Re.clear(),Oe.clear(),Te.clear(),Le.clear()}ce(()=>_.messages,async t=>{if(_.isLoading)return;const s=new Set(t.filter(h=>h.messageType==="commandExecution"&&h.commandExecution).map(h=>h.id));f.value=bt(f.value,s),c.value=bt(c.value,s),u.value=bt(u.value,new Set([...Object.keys(We.value),...Object.keys(It.value)])),await tt()}),ce(()=>_.messages.some(t=>t.text.includes("```")),t=>{!t||Ke.value||ts()},{immediate:!0}),ce(gt,(t,s)=>{if(!s||s===t||!c.value.has(s))return;const h=new Set(c.value);h.delete(s),c.value=h}),ce(()=>_.pendingRequests,async()=>{_.isLoading||await tt()},{deep:!0}),ce(()=>_.liveOverlay,async t=>{t&&he.value&&(await ot(),Qe(),et(8))},{deep:!0}),ce(()=>_.isLoading,async t=>{t||await tt()}),ce(()=>_.activeThreadId,async()=>{he.value=!0,_e.value="",ge.value=!1,q.value={},te.value={},ne.value={},me.value=tn(_.activeThreadId),await tt()},{flush:"post"});function Ls(){const t=fe.value;!t||_.isLoading||(he.value=xs(t),t.scrollTop<Nu&&!ge.value&&(_n.value?Ln():_.hasMorePersistedAbove===!0&&qn()))}const Ot=O(new Set);function Un(t,s){return`${t}:${s}`}function Is(t,s){return Ot.value.has(Un(t,s))}function Ms(t,s){const h=new Set(Ot.value);h.add(Un(t,s)),Ot.value=h,yn.value+=1}function Vn(t){_e.value=t,$t.value=nt(t)}function Kn(){_e.value="",$t.value=!1}const Dt=/\.(mp4|m4v|webm|mov|mkv|ogv|ogg|mpeg|avi)$/iu;function nt(t){const s=t.trim();if(!s)return!1;if(s.startsWith("data:video/"))return!0;try{const h=new URL(s,window.location.href);return Dt.test(h.pathname)?!0:h.pathname==="/codex-local-image"?Dt.test(h.searchParams.get("path")??""):!1}catch{return Dt.test(s)}}return nn(()=>{Ts(),ye&&(cancelAnimationFrame(ye),ye=0),oe&&(cancelAnimationFrame(oe),oe=0),Y&&(clearTimeout(Y),Y=null)}),(t,s)=>(l(),d(E,null,[v("section",{class:"conversation-root",onContextmenuCapture:ps},[e.isLoading?(l(),d("p",Ml,y(T(R)("Loading messages...")),1)):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(l(),d("p",Pl,y(T(R)("No messages in this thread yet.")),1)):(l(),d("ul",{key:2,ref_key:"conversationListRef",ref:fe,class:"conversation-list",onScroll:Ls},[Qo.value?(l(),d("li",Sl,[v("button",{type:"button",class:"load-more-button",disabled:ge.value||e.isLoadingPersistedAbove,onClick:qn},y(ge.value||e.isLoadingPersistedAbove?T(R)("Loading…"):T(R)("Load earlier messages")),9,Al)])):L("",!0),_n.value?(l(),d("li",El,[v("button",{type:"button",class:"load-more-button",disabled:ge.value,onClick:Ln},y(T(R)("Load earlier ({n} turns)",{n:xn.value})),9,Fl)])):L("",!0),(l(!0),d(E,null,D(Tn.value,h=>(l(),d(E,{key:h.key},[h.kind==="warm-card"?(l(),d("li",{key:0,id:_t(h.turn),class:"conversation-item conversation-item-warm-card","data-role":"system","data-message-type":"warmTurn"},[v("div",Rl,[v("div",Ol,[W(ol,{"user-text":h.userText,"assistant-preview":h.assistantPreview,"tool-count":h.toolCount,expanded:h.expanded,onToggle:r=>Ho(h.turn)},null,8,["user-text","assistant-preview","tool-count","expanded","onToggle"])])])],8,Bl)):(l(!0),d(E,{key:1},D([h.message],r=>(l(),d(E,{key:r.id},[Vo(r)?(l(),d(E,{key:0},[v("li",Dl,[v("div",Hl,[v("div",Wl,[W(fr,{label:Zo(r),running:Jo(r),"has-outside-content":Xo(r)},{default:Ut(()=>[(l(!0),d(E,null,D(Ko(r),m=>(l(),d(E,{key:Go(m)},[m.type==="batch"?(l(),J(Jr,{key:0,kind:m.kind,messages:m.messages},null,8,["kind","messages"])):(l(!0),d(E,{key:1},D([m.message],$=>(l(),d(E,{key:$.id},[!pt.value.has($.id)&&!En.value.has($.id)?(l(),d(E,{key:0},[Z($)?(l(),d("div",jl,[(l(!0),d(E,null,D(pn($),(k,C)=>(l(),J(io,{key:`work-cmd-${k.id}`,command:k,"step-index":C,expanded:fn(k),compact:hn(k),"output-condensed":mn(k),onToggle:S=>gn(k)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])):rn($)?(l(),J(en,{key:1,message:$},null,8,["message"])):ft($)?(l(),J(ao,{key:2,message:$,expanded:sn($),"content-html":Wn($.text),onToggle:k=>an($)},null,8,["message","expanded","content-html","onToggle"])):L("",!0)],64)):L("",!0)],64))),128))],64))),128))]),_:2},1032,["label","running","has-outside-content"])])])]),Mt(se(r))?(l(),d("li",Nl,[v("div",zl,[v("div",ql,[W(Nt,{summary:se(r),expanded:kt(Tt(r)),cwd:_.cwd,actionable:Pt(se(r)),"action-status":Me(se(r)),"action-error-text":St(se(r)),"next-action":Xe(se(r)),"action-label":At(se(r)),onToggle:m=>vt(Tt(r)),onOpenDiff:m=>yt(se(r),m),onRequestAction:m=>Ft(se(r),m),onRequestFileAction:m=>Bt(se(r),m)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])])])])):L("",!0)],64)):!Mn(r)&&!pt.value.has(r.id)&&!En.value.has(r.id)&&!(Yo(r)&&Uo.value.has(r.turnId??""))?(l(),d(E,{key:1},[v("li",{id:No(r),class:"conversation-item","data-role":r.role,"data-message-type":r.messageType||""},[Mo(r)?(l(),d("div",Vl,[v("div",Kl,[s[3]||(s[3]=v("span",{class:"thread-compaction-spinner","aria-hidden":"true"},null,-1)),v("span",null,y(T(R)("Compacting thread context…")),1)])])):Po(r)?(l(),d("div",Gl,[v("div",Zl,y(T(R)("Context compacted")),1)])):Z(r)?(l(),d("div",Jl,[v("div",Xl,[v("div",Yl,[(l(!0),d(E,null,D(pn(r),(m,$)=>(l(),J(io,{key:`work-cmd-${m.id}`,command:m,"step-index":$,expanded:fn(m),compact:hn(m),"output-condensed":mn(m),onToggle:k=>gn(m)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])])])):rn(r)?(l(),J(en,{key:3,message:r},null,8,["message"])):Ue(r)?(l(),d("div",{key:4,class:"message-row","data-role":r.role,"data-message-type":r.messageType||""},[v("div",{class:"message-stack","data-role":r.role},[v("article",{class:"message-body","data-role":r.role},[Mt(ae(r))?(l(),J(Nt,{key:0,summary:ae(r),expanded:kt(r),cwd:_.cwd,actionable:Pt(ae(r)),"action-status":Me(ae(r)),"action-error-text":St(ae(r)),"next-action":Xe(ae(r)),"action-label":At(ae(r)),onToggle:m=>vt(r),onOpenDiff:m=>yt(ae(r),m),onRequestAction:m=>Ft(ae(r),m),onRequestFileAction:m=>Bt(ae(r),m)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):L("",!0)],8,tc)],8,ec)],8,Ql)):(l(),d("div",{key:5,class:"message-row","data-role":r.role,"data-message-type":r.messageType||""},[v("div",{class:"message-stack","data-role":r.role},[v("article",{class:"message-body","data-role":r.role},[r.images&&r.images.length>0?(l(),d("ul",{key:0,class:z(["message-image-list",{"message-generated-image-list":r.messageType==="imageView"}]),"data-role":r.role},[(l(!0),d(E,null,D(r.images,m=>(l(),d("li",{key:m,class:"message-image-item"},[v("button",{class:"message-image-button",type:"button",onClick:$=>Vn(m)},[nt(m)?(l(),d("video",{key:0,class:z(["message-image-preview message-video-preview",{"message-generated-image-preview":r.messageType==="imageView"}]),src:m,controls:"",preload:"metadata"},null,10,rc)):(l(),d("img",{key:1,class:z(["message-image-preview",{"message-generated-image-preview":r.messageType==="imageView"}]),src:m,alt:r.messageType==="imageView"?"Generated image":"Message image preview",loading:"lazy"},null,10,lc))],8,ic)]))),128))],10,ac)):L("",!0),r.fileAttachments&&r.fileAttachments.length>0?(l(),d("div",cc,[(l(!0),d(E,null,D(r.fileAttachments,m=>(l(),d("span",{key:`${r.id}:${m.path}`,class:"message-file-chip"},[s[4]||(s[4]=v("span",{class:"message-file-chip-icon"},"📄",-1)),v("a",{class:"message-file-link message-file-chip-name",href:le(m.path),target:"_blank",rel:"noopener noreferrer",title:m.path},y(m.label),9,uc)]))),128))])):L("",!0),r.skills&&r.skills.length>0?(l(),d("div",dc,[(l(!0),d(E,null,D(r.skills,m=>(l(),d("a",{key:`${r.id}:${m.path}`,class:"message-skill-chip",href:le(m.path),title:m.path},[v("span",hc,y(T(R)("Skill")),1),v("span",mc,y(m.name),1)],8,fc))),128))])):L("",!0),r.text.length>0?(l(),d("article",{key:3,class:"message-card","data-role":r.role},[r.isAutomationRun?(l(),d("div",pc,[s[5]||(s[5]=v("span",null,"Sent via automation",-1)),r.automationDisplayName?(l(),d("code",vc,y(r.automationDisplayName),1)):L("",!0)])):L("",!0),r.messageType==="worked"?(l(),d("div",kc,[v("p",yc,y(r.text),1)])):ft(r)?(l(),J(ao,{key:2,message:r,expanded:sn(r),"content-html":Wn(r.text),onToggle:m=>an(r)},null,8,["message","expanded","content-html","onToggle"])):Fs([r.id,r.text,_.cwd,Ce.value,yn.value],()=>(l(),d("div",{key:3,class:"message-text-flow"},[(l(!0),d(E,null,D(ks(r),(m,$)=>(l(),d(E,{key:`block-${$}`},[m.kind==="paragraph"?(l(),d("p",bc,[(l(!0),d(E,null,D(be(m.value),(k,C)=>(l(),d(E,{key:`seg-${$}-${C}`},[k.kind==="text"?(l(),d("span",wc,y(k.value),1)):k.kind==="bold"?(l(),d("strong",$c,y(k.value),1)):k.kind==="italic"?(l(),d("em",xc,y(k.value),1)):k.kind==="strikethrough"?(l(),d("s",_c,y(k.value),1)):k.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(k.path),target:"_blank",rel:"noopener noreferrer",title:k.path},y(k.displayPath),9,Cc)):k.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:k.href,target:"_blank",rel:"noopener noreferrer",title:k.href},y(k.value),9,Tc)):(l(),d("code",Lc,y(k.value),1))],64))),128))])):m.kind==="heading"?(l(),J(Ws(T(Jn)(m.level)),{key:1,class:z(["message-heading",T(Xn)(m.level)])},{default:Ut(()=>[(l(!0),d(E,null,D(be(m.value),(k,C)=>(l(),d(E,{key:`heading-seg-${$}-${C}`},[k.kind==="text"?(l(),d("span",Ic,y(k.value),1)):k.kind==="bold"?(l(),d("strong",Mc,y(k.value),1)):k.kind==="italic"?(l(),d("em",Pc,y(k.value),1)):k.kind==="strikethrough"?(l(),d("s",Sc,y(k.value),1)):k.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(k.path),target:"_blank",rel:"noopener noreferrer",title:k.path},y(k.displayPath),9,Ac)):k.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:k.href,target:"_blank",rel:"noopener noreferrer",title:k.href},y(k.value),9,Ec)):(l(),d("code",Fc,y(k.value),1))],64))),128))]),_:2},1032,["class"])):m.kind==="blockquote"?(l(),d("blockquote",Bc,[(l(!0),d(E,null,D(be(m.value),(k,C)=>(l(),d(E,{key:`quote-seg-${$}-${C}`},[k.kind==="text"?(l(),d("span",Rc,y(k.value),1)):k.kind==="bold"?(l(),d("strong",Oc,y(k.value),1)):k.kind==="italic"?(l(),d("em",Dc,y(k.value),1)):k.kind==="strikethrough"?(l(),d("s",Hc,y(k.value),1)):k.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(k.path),target:"_blank",rel:"noopener noreferrer",title:k.path},y(k.displayPath),9,Wc)):k.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:k.href,target:"_blank",rel:"noopener noreferrer",title:k.href},y(k.value),9,jc)):(l(),d("code",Nc,y(k.value),1))],64))),128))])):m.kind==="unorderedList"?(l(),d("ul",zc,[(l(!0),d(E,null,D(m.items,(k,C)=>(l(),d("li",{key:`ul-${$}-${C}`,class:"message-list-item"},[v("div",{class:"message-list-item-content",innerHTML:Ye(k)},null,8,qc)]))),128))])):m.kind==="taskList"?(l(),d("ul",Uc,[(l(!0),d(E,null,D(m.items,(k,C)=>(l(),d("li",{key:`task-${$}-${C}`,class:"message-task-item"},[v("span",{class:"message-task-checkbox","data-checked":k.checked},y(k.checked?"☑":"☐"),9,Vc),v("div",Kc,[(l(!0),d(E,null,D(be(k.text),(S,N)=>(l(),d(E,{key:`task-seg-${$}-${C}-${N}`},[S.kind==="text"?(l(),d("span",Gc,y(S.value),1)):S.kind==="bold"?(l(),d("strong",Zc,y(S.value),1)):S.kind==="italic"?(l(),d("em",Jc,y(S.value),1)):S.kind==="strikethrough"?(l(),d("s",Xc,y(S.value),1)):S.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(S.path),target:"_blank",rel:"noopener noreferrer",title:S.path},y(S.displayPath),9,Yc)):S.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:S.href,target:"_blank",rel:"noopener noreferrer",title:S.href},y(S.value),9,Qc)):(l(),d("code",eu,y(S.value),1))],64))),128))])]))),128))])):m.kind==="orderedList"?(l(),d("ol",{key:5,class:"message-list message-list-ordered",start:m.start},[(l(!0),d(E,null,D(m.items,(k,C)=>(l(),d("li",{key:`ol-${$}-${C}`,class:"message-list-item"},[v("div",{class:"message-list-item-content",innerHTML:Ye(k)},null,8,nu)]))),128))],8,tu)):m.kind==="table"?(l(),d("div",ou,[v("table",su,[v("thead",null,[v("tr",null,[(l(!0),d(E,null,D(m.headers,(k,C)=>(l(),d("th",{key:`th-${$}-${C}`,class:"message-table-head-cell",style:je({textAlign:m.alignments[C]??"left"})},[(l(!0),d(E,null,D(be(k),(S,N)=>(l(),d(E,{key:`th-seg-${$}-${C}-${N}`},[S.kind==="text"?(l(),d("span",au,y(S.value),1)):S.kind==="bold"?(l(),d("strong",iu,y(S.value),1)):S.kind==="italic"?(l(),d("em",ru,y(S.value),1)):S.kind==="strikethrough"?(l(),d("s",lu,y(S.value),1)):S.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(S.path),target:"_blank",rel:"noopener noreferrer",title:S.path},y(S.displayPath),9,cu)):S.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:S.href,target:"_blank",rel:"noopener noreferrer",title:S.href},y(S.value),9,uu)):(l(),d("code",du,y(S.value),1))],64))),128))],4))),128))])]),m.rows.length>0?(l(),d("tbody",fu,[(l(!0),d(E,null,D(m.rows,(k,C)=>(l(),d("tr",{key:`tr-${$}-${C}`,class:"message-table-body-row"},[(l(!0),d(E,null,D(k,(S,N)=>(l(),d("td",{key:`td-${$}-${C}-${N}`,class:"message-table-cell",style:je({textAlign:m.alignments[N]??"left"})},[(l(!0),d(E,null,D(be(S),(H,pe)=>(l(),d(E,{key:`td-seg-${$}-${C}-${N}-${pe}`},[H.kind==="text"?(l(),d("span",hu,y(H.value),1)):H.kind==="bold"?(l(),d("strong",mu,y(H.value),1)):H.kind==="italic"?(l(),d("em",gu,y(H.value),1)):H.kind==="strikethrough"?(l(),d("s",pu,y(H.value),1)):H.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(H.path),target:"_blank",rel:"noopener noreferrer",title:H.path},y(H.displayPath),9,vu)):H.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:H.href,target:"_blank",rel:"noopener noreferrer",title:H.href},y(H.value),9,ku)):(l(),d("code",yu,y(H.value),1))],64))),128))],4))),128))]))),128))])):L("",!0)])])):m.kind==="codeBlock"?(l(),d("div",bu,[m.language?(l(),d("div",wu,y(m.language),1)):L("",!0),v("pre",$u,[v("code",{class:"hljs",innerHTML:On(m.language,m.value)},null,8,xu)])])):m.kind==="thematicBreak"?(l(),d("hr",_u)):Is(r.id,$)?(l(),d("p",Cu,y(m.markdown),1)):(l(),d("button",{key:10,class:"message-image-button",type:"button",onClick:k=>Vn(m.url)},[nt(m.url)?(l(),d("video",{key:0,class:"message-image-preview message-video-preview message-markdown-image",src:m.url,controls:"",preload:"metadata"},null,8,Lu)):(l(),d("img",{key:1,class:"message-image-preview message-markdown-image",src:m.url,alt:m.alt||"Embedded message image",loading:"lazy",onError:k=>Ms(r.id,$)},null,40,Iu))],8,Tu))],64))),128))])),s,0),So(r)?(l(),d("a",{key:4,class:"turn-error-feedback",href:T(ve),onClick:m=>xe(m,r.text)},y(T(R)("Send feedback")),9,Mu)):L("",!0)],8,gc)):L("",!0),W(sr,{role:r.role,"show-edit":fs(r),"show-fork":rs(r),"show-copy":ss(r)||as(r),copied:ke.value===r.id,onEdit:m=>hs(r.id),onFork:m=>ds(r.id),onCopy:m=>r.role==="user"?is(r.id):us(r.id)},null,8,["role","show-edit","show-fork","show-copy","copied","onEdit","onFork","onCopy"])],8,sc)],8,oc)],8,nc))],8,Ul),Mt(Q(r))?(l(),d("li",Pu,[v("div",Su,[v("div",Au,[W(Nt,{summary:Q(r),expanded:kt(r),cwd:_.cwd,actionable:Pt(Q(r)),"action-status":Me(Q(r)),"action-error-text":St(Q(r)),"next-action":Xe(Q(r)),"action-label":At(Q(r)),onToggle:m=>vt(r),onOpenDiff:m=>yt(Q(r),m),onRequestAction:m=>Ft(Q(r),m),onRequestFileAction:m=>Bt(Q(r),m)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])])])])):L("",!0)],64)):L("",!0)],64))),128))],64))),128)),e.liveOverlay?(l(),J(Ui,{key:2,overlay:e.liveOverlay,"feedback-mailto":T(ve)},null,8,["overlay","feedback-mailto"])):L("",!0),v("li",{ref_key:"bottomAnchorRef",ref:vn,class:"conversation-bottom-anchor"},null,512)],544)),W(kr,{anchors:In.value,"active-turn":Wo.value,onJump:zo},null,8,["anchors","active-turn"]),es.value?(l(),d("button",{key:3,type:"button",class:"jump-to-latest-button",title:T(R)("Jump to latest"),"aria-label":T(R)("Jump to latest output"),onClick:zn},[W(Bs,{class:"icon-svg jump-to-latest-icon"})],8,Eu)):L("",!0),_e.value.length>0?(l(),d("div",{key:4,class:"image-modal-backdrop",onClick:Kn},[v("div",{class:"image-modal-content",onClick:s[1]||(s[1]=Ae(()=>{},["stop"]))},[v("button",{class:"image-modal-close",type:"button","aria-label":T(R)("Close image preview"),onClick:Kn},[W(ho,{class:"icon-svg"})],8,Fu),$t.value?(l(),d("video",{key:0,class:"image-modal-image",src:_e.value,controls:"",autoplay:""},null,8,Bu)):(l(),d("img",{key:1,class:"image-modal-image",src:_e.value,alt:T(R)("Expanded message image")},null,8,Ru))])])):L("",!0),W(Li,{visible:I.value,x:A.value,y:x.value,"browse-url":P.value,"edit-url":w.value,onClose:vs},null,8,["visible","x","y","browse-url","edit-url"]),W(ai,{change:Bn.value,changes:Fn.value,lines:cs.value,"is-mobile":T(F),"is-file-list-open":b.value,cwd:_.cwd,onClose:Eo,onSelectChange:Ro,onToggleFileList:Fo,onCloseFileList:Bo},null,8,["change","changes","lines","is-mobile","is-file-list-open","cwd"])],32),W(ba,{visible:re.value!==null,title:Oo.value,message:Do.value,"confirm-label":"Confirm",danger:"",onConfirm:ms,onCancel:s[2]||(s[2]=h=>re.value=null)},null,8,["visible","title","message"])],64))}}),Vu=U(zu,[["__scopeId","data-v-fbd03391"]]);export{Vu as default};
@@ -1,4 +1,4 @@
1
- import{d as dn,q as ct,M as un,N as _n,m as fn,l as pn,O as vs,B as gn,P as vn,Q as mn,R as Sn,o as Ht,a as Wt,b as Ke,F as wn,r as bn,n as ms,t as zt,u as Ft,e as yn,j as Cn,S as kn,_ as xn}from"./index-CNFcjd2m.js";/**
1
+ import{d as dn,q as ct,M as un,N as _n,m as fn,l as pn,O as vs,B as gn,P as vn,Q as mn,R as Sn,o as Ht,a as Wt,b as Ke,F as wn,r as bn,n as ms,t as zt,u as Ft,e as yn,j as Cn,S as kn,_ as xn}from"./index-7a7RZFTE.js";/**
2
2
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
3
  * @license MIT
4
4
  *