@muyichengshayu/promptx 0.1.43 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/apps/server/src/workspaceFiles.js +9 -0
- package/apps/web/dist/assets/CodexSessionManagerDialog-D7MUHe2h.js +1 -0
- package/apps/web/dist/assets/{TaskDiffReviewDialog-D4rUvNG6.js → TaskDiffReviewDialog-C3WgGtC2.js} +1 -1
- package/apps/web/dist/assets/{WorkbenchSettingsDialog-ClVb-_Av.js → WorkbenchSettingsDialog-DPnL7UAx.js} +1 -1
- package/apps/web/dist/assets/{WorkbenchView-D0SJDU9Q.js → WorkbenchView-CB2beALS.js} +22 -22
- package/apps/web/dist/assets/{WorkbenchView-DHfai3aW.css → WorkbenchView-caF5wQfm.css} +1 -1
- package/apps/web/dist/assets/{index-CsDHhm4n.js → index-By0kbUJQ.js} +2 -2
- package/apps/web/dist/assets/{vendor-shiki-core-DIyrqeBY.js → vendor-shiki-core-BnzZnwfD.js} +4 -4
- package/apps/web/dist/assets/vendor-shiki-lang-bash-DvIe5yFX.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-c-DsfNMf57.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-cpp-DJeq1KY_.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-csharp-CfWxWYxW.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-css-oWiIfyaT.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-diff-DPOfCluu.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-dockerfile-CehKevaB.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-dotenv-OOt7jwxE.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-fish-BIcGBJxU.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-go-B46FgY49.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-html-D2lGgzRb.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-ini-BRO-4anr.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-java-CNTxAD-j.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-javascript-hLLwg4kE.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-json-DVxgtBUk.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-less-Bm0zE0qZ.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-markdown-Ctd6eGrZ.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-powershell-C4XrPiEo.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-python-DzOtNOWI.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-rust-BYDOAjeh.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-sass-CegctIKi.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-scss-COA3uazA.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-sql-DUzqOedr.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-toml-BPfcgC5W.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-tsx-wehLdarw.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-typescript-CdBtsRXV.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-vue-Dz_8CJBS.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-xml-DvWyHJVz.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-lang-yaml-DzJ1MBJQ.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-theme-github-dark-default-CgnhGCyu.js +1 -0
- package/apps/web/dist/assets/vendor-shiki-theme-github-light-UIi0TSpi.js +1 -0
- package/apps/web/dist/index.html +1 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/CodexSessionManagerDialog-DxrPimh4.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-bash-DziaAEzp.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-c-DxZVXGej.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-cpp-C0nFeuYF.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-css-5_xDM_L5.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-diff-DV4GsN7t.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-dockerfile-C-v4Vs5o.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-fish-BJ5QHV1v.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-go-BNuwOTVZ.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-html-CUvSKgQ6.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-java-BgscQPPM.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-javascript-BAicPUAA.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-json-C_GpujJu.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-markdown-Isb_iOaL.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-powershell-xNYeLH7k.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-python-ByInZN1m.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-rust-DTGgkwhP.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-sql-paI0NZrg.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-tsx-BXEzAsy_.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-typescript-CPG3q_60.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-vue-BoIQS9wF.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-xml-DzGGQ07l.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-lang-yaml-DuPzWjyg.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-theme-github-dark-default-DxFCgFpQ.js +0 -1
- package/apps/web/dist/assets/vendor-shiki-theme-github-light-CcI-1qo0.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.44
|
|
4
|
+
|
|
5
|
+
- 修复源码相关搜索列表的路径截断:源码查看、目录选择与 `@` 文件选择器里的搜索结果,文件名与完整路径都改为优先完整展示,不再因为单行省略而看不清长路径。
|
|
6
|
+
- 补齐常用样式 / 配置文件的语言识别与高亮:新增 `SCSS / Sass / Less / TOML / INI / .env / C#` 的源码预览与回复代码块语言映射,解决 `.scss` 等文件明明是代码却仍按纯文本展示的问题。
|
|
7
|
+
- 为上述语言识别补充前后端回归测试,并再次确认前端构建无大包告警,保证这轮补丁发布足够稳定。
|
|
8
|
+
|
|
3
9
|
## 0.1.43
|
|
4
10
|
|
|
5
11
|
- 继续完善项目源码查看:左侧目录树、路径搜索、内容搜索、`@` 文件选择器与代码变更文件列表统一为同一套选中 / hover / 间距 / 图标 / 副文本视觉语言,深浅主题下的状态反馈更一致。
|
|
@@ -65,6 +65,7 @@ const TEXT_FILE_EXTENSIONS = new Set([
|
|
|
65
65
|
'.js',
|
|
66
66
|
'.json',
|
|
67
67
|
'.jsx',
|
|
68
|
+
'.less',
|
|
68
69
|
'.log',
|
|
69
70
|
'.md',
|
|
70
71
|
'.mjs',
|
|
@@ -72,6 +73,8 @@ const TEXT_FILE_EXTENSIONS = new Set([
|
|
|
72
73
|
'.py',
|
|
73
74
|
'.rb',
|
|
74
75
|
'.rs',
|
|
76
|
+
'.sass',
|
|
77
|
+
'.scss',
|
|
75
78
|
'.sh',
|
|
76
79
|
'.sql',
|
|
77
80
|
'.svg',
|
|
@@ -106,22 +109,28 @@ const LANGUAGE_BY_EXTENSION = new Map([
|
|
|
106
109
|
['.csh', 'bash'],
|
|
107
110
|
['.css', 'css'],
|
|
108
111
|
['.diff', 'diff'],
|
|
112
|
+
['.env', 'dotenv'],
|
|
109
113
|
['.fish', 'fish'],
|
|
110
114
|
['.go', 'go'],
|
|
111
115
|
['.h', 'c'],
|
|
112
116
|
['.html', 'html'],
|
|
117
|
+
['.ini', 'ini'],
|
|
113
118
|
['.java', 'java'],
|
|
114
119
|
['.js', 'javascript'],
|
|
115
120
|
['.json', 'json'],
|
|
116
121
|
['.jsx', 'react'],
|
|
122
|
+
['.less', 'less'],
|
|
117
123
|
['.md', 'markdown'],
|
|
118
124
|
['.mjs', 'javascript'],
|
|
119
125
|
['.ps1', 'powershell'],
|
|
120
126
|
['.py', 'python'],
|
|
121
127
|
['.rs', 'rust'],
|
|
128
|
+
['.sass', 'sass'],
|
|
129
|
+
['.scss', 'scss'],
|
|
122
130
|
['.sh', 'bash'],
|
|
123
131
|
['.sql', 'sql'],
|
|
124
132
|
['.svg', 'svg'],
|
|
133
|
+
['.toml', 'toml'],
|
|
125
134
|
['.ts', 'typescript'],
|
|
126
135
|
['.tsx', 'react'],
|
|
127
136
|
['.txt', 'text'],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as De,f as dt,c as ut}from"./index-By0kbUJQ.js";import{A as ct,n as Je,j as He,d as pt,W as Ye,c as st,k as ft,s as gt,m as vt,o as Ze,_ as mt,b as ht,p as et}from"./WorkbenchView-CB2beALS.js";import{w as me,n as re,ak as lt,aD as p,aI as he,aJ as xe,aF as n,aQ as d,u as l,aG as k,aW as xt,aU as yt,aX as bt,aE as m,aR as Te,aS as Ke,aL as A,aN as C,aV as wt,aK as St,b as _,c as S,aZ as it,r as kt}from"./vendor-misc-DxKJ95A9.js";import{c as $t,L as Ge,F as ze,e as _t,b as ot,M as Ct,o as Mt,x as jt,P as It,i as tt,E as Pt,N as Rt,n as Tt,r as Dt,O as Et}from"./vendor-ui-DTqxu3Qf.js";import"./vendor-router-iukOUtEP.js";import"./vendor-markdown-BENmzbO1.js";import"./vendor-tiptap-COqMdKic.js";function At(o=[]){return(Array.isArray(o)&&o.length?o:ct).filter($=>$&&typeof $=="object").map($=>{const f=Je($.value);return{...$,value:f,label:String($.label||He(f)).trim()||He(f),enabled:$.enabled!==!1,available:$.available!==!1}})}function Xe(o=[]){return At(o).filter(R=>R.enabled&&R.available)}async function Lt(){const o=await pt("/api/meta",{cache:"no-store"});return Xe(o==null?void 0:o.agentEngineOptions)}const Ft={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Bt={class:"theme-muted-text mt-1 text-xs leading-5"},Nt={class:"theme-divider mt-4 rounded-sm border border-dashed px-3 py-2"},Ot={class:"flex items-start gap-2 text-xs leading-5"},Ut={class:"theme-muted-text shrink-0"},zt={class:"min-w-0 break-all font-mono text-[var(--theme-textPrimary)]"},Ht={class:"theme-muted-text mt-4 block text-xs"},Kt={class:"theme-input-shell mt-1 flex h-10 items-center gap-2 rounded-sm border px-3 transition focus-within:ring-2"},Vt=["placeholder"],qt={class:"theme-content-panel mt-3 min-h-0 flex-1 overflow-y-auto p-2"},Wt={key:0,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},Qt={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},Gt={key:2,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},Jt={key:3,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},Xt={key:4,class:"theme-empty-state px-3 py-8 text-sm"},Yt={key:5,class:"theme-empty-state px-3 py-8 text-sm"},Zt={key:6,class:"theme-empty-state px-3 py-8 text-sm"},en={key:7,class:"space-y-1"},tn=["onClick"],nn={class:"min-w-0 flex-1"},an=["innerHTML"],sn=["innerHTML"],ln={key:0,class:"theme-muted-text px-1 pt-2 text-xs"},on={key:8,class:"space-y-1"},rn={class:"flex items-start gap-1.5"},dn=["onClick"],un=["onClick"],cn={class:"min-w-0 flex-1"},pn={key:0,class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all"},fn={class:"theme-divider flex flex-col-reverse gap-2 border-t border-dashed px-4 py-4 sm:flex-row sm:items-center sm:justify-end sm:px-5"},gn={class:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center"},vn=["disabled"],mn=["disabled"],hn={__name:"CodexDirectoryPickerDialog",props:{open:{type:Boolean,default:!1},initialPath:{type:String,default:""},suggestions:{type:Array,default:()=>[]}},emits:["close","select"],setup(o,{emit:R}){const $=o,f=R,{t:v}=De(),M=_(""),c=_(null),x=_(!1),y=_(""),r=_(!1),g=_(""),L=_([]),Q=_(!1),E=_(""),I=_(""),K=_(null);let F=null,N=0,O=null;const V=new Map,ee=S(()=>$e(c.value?[c.value]:[])),q=S(()=>String(E.value||"").trim()),ae=S(()=>q.value.length>=Ye),P=S(()=>!!q.value),J=S(()=>P.value?L.value:ee.value),b=S(()=>J.value.map(e=>{const s=T((e==null?void 0:e.path)||""),a=e!=null&&e.expanded?1:0,u=e!=null&&e.loading?1:0;return`${s}:${a}:${u}`}).join("|")),ye=S(()=>P.value&&!ae.value&&!r.value&&!g.value),Ve=S(()=>P.value&&ae.value&&!r.value&&!g.value&&!L.value.length),de=S(()=>!P.value&&!x.value&&!y.value&&!ee.value.length);function se(e=""){const s=String(e||"").trim();return/^[a-z]:[\\/]/i.test(s)||s.includes("\\")}function T(e=""){const s=String(e||"").trim();if(!s)return"";const a=se(s);let u=s.replace(/\\/g,"/");return u.length>1&&!/^[a-z]:\/?$/i.test(u)&&u!=="/"&&(u=u.replace(/\/+$/,"")),a?u.toLowerCase():u}function X(e="",s=""){const a=T(e),u=T(s);return!a||!u?!1:a===u||a.startsWith(`${u}/`)}function j(e="",s=""){const a=String(e||"").trim(),u=String(s||"").trim();return a?u?se(a)?/^[a-z]:\\?$/i.test(a)?`${a.replace(/[\\/]+$/,"")}\\${u}`:`${a.replace(/[\\/]+$/,"")}\\${u}`:a==="/"?`/${u}`:`${a.replace(/\/+$/,"")}/${u}`:a:u}function qe(e="",s=""){const a=T(e),u=T(s);if(!a||!u||!X(u,a))return[];const B=u===a?"":u.slice(a.length).replace(/^\//,"");return B?B.split("/").filter(Boolean):[]}function ue(e=""){const s=String(e||"").trim();if(!s||T(s)===T(M.value))return"";const a=se(s),u=s.replace(/\\/g,"/");if(a){const Z=u.replace(/\/+$/,""),t=Z.lastIndexOf("/");if(t<=2)return"";const i=Z.slice(0,t).replace(/\//g,"\\");return X(i,M.value)?i:""}const B=u.replace(/\/+$/,""),G=B.lastIndexOf("/");if(G<=0)return"";const ve=B.slice(0,G)||"/";return X(ve,M.value)?ve:""}function be(e){return(e==null?void 0:e.name)||(e==null?void 0:e.path)||v("directoryPicker.unnamedDirectory")}function we(e=""){const s=String(e||"").trim();return s?s.split(/[\\/]/).filter(Boolean).at(-1)||s:"Home"}function oe(e=""){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ee(e="",s=""){const a=String(e||""),u=String(s||"").trim().toLowerCase();if(!a||!u)return null;const B=a.toLowerCase(),G=B.indexOf(u);if(G>=0)return{start:G,end:G+u.length};const ve=u.split(/[\\/\s_.-]+/).filter(Boolean).sort((Z,t)=>t.length-Z.length);for(const Z of ve){if(Z.length<2)continue;const t=B.indexOf(Z);if(t>=0)return{start:t,end:t+Z.length}}return null}function Se(e="",s=""){const a=String(e||""),u=Ee(a,s);return u?`${oe(a.slice(0,u.start))}<mark class="theme-search-highlight">${oe(a.slice(u.start,u.end))}</mark>${oe(a.slice(u.end))}`:oe(a)}function Ae(e){return Se(be(e),E.value)}function Le(e){return Se((e==null?void 0:e.path)||"",E.value)}function ke(e,s=0){return{...e,depth:s,expanded:!1,loaded:!1,loading:!1,children:[]}}function $e(e=[],s=[]){return e.forEach(a=>{s.push(a),a.expanded&&a.children.length&&$e(a.children,s)}),s}function te(){c.value&&(c.value={...c.value})}function U(){F&&(window.clearTimeout(F),F=null),O&&(O.abort(),O=null)}function ne(e,s=c.value?[c.value]:[]){const a=T(e);if(!a)return null;for(const u of s){if(T(u.path)===a)return u;if(u.children.length){const B=ne(e,u.children);if(B)return B}}return null}function z(e){I.value=String((e==null?void 0:e.path)||"").trim()}function Y(e=""){return T(e)}function ce(e,s){const a=Y(e);if(a){if(s){V.set(a,s);return}V.delete(a)}}function le(){var s;const e=V.get(Y(I.value));(s=e==null?void 0:e.scrollIntoView)==null||s.call(e,{block:"nearest"})}function _e(){re(()=>{var e,s;(s=(e=K.value)==null?void 0:e.focus)==null||s.call(e)})}function Ce(){const e=J.value;if(!e.length){I.value="";return}const s=Y(I.value);s&&e.some(a=>Y((a==null?void 0:a.path)||"")===s)||z(e[0])}function pe(){const e=J.value;if(!e.length)return-1;const s=Y(I.value),a=e.findIndex(u=>Y((u==null?void 0:u.path)||"")===s);return a>=0?a:0}function ie(){const e=J.value,s=pe();return s<0||!e.length?null:e[s]||null}function W(e=1){const s=J.value;if(!s.length)return!1;const a=pe(),u=a<0?0:(a+e+s.length)%s.length;return z(s[u]),re(le),!0}async function fe(){if(P.value)return!1;const e=ie();if(!e||!e.hasChildren)return!1;if(!e.expanded)return await Pe(e),!0;const s=J.value,a=pe(),u=s[a+1];return u&&ue(u.path)===e.path?(z(u),re(le),!0):!1}function Me(){if(P.value)return!1;const e=ie();if(!e)return!1;if(e.expanded&&e.hasChildren)return e.expanded=!1,te(),z(e),!0;const s=ue(e.path);if(!s)return!1;const a=ne(s);return a?(z(a),re(le),!0):!1}function ge(e){var s,a,u;if((s=e==null?void 0:e.preventDefault)==null||s.call(e),q.value){(a=e==null?void 0:e.stopPropagation)==null||a.call(e),E.value="";return}(u=e==null?void 0:e.stopPropagation)==null||u.call(e),f("close")}function Fe(e){const s=String((e==null?void 0:e.key)||"");if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter","Escape"].includes(s)&&!(P.value&&(s==="ArrowLeft"||s==="ArrowRight"))){if(s==="ArrowDown"){e.preventDefault(),W(1);return}if(s==="ArrowUp"){e.preventDefault(),W(-1);return}if(s==="Escape"){ge(e);return}if(P.value){if(s==="Enter"){e.preventDefault();const a=ie();a&&Re(a)}return}if(s==="ArrowRight"){e.preventDefault(),fe();return}if(s==="ArrowLeft"){e.preventDefault(),Me();return}s==="Enter"&&(e.preventDefault(),Ue())}}async function je(e,s={}){if(!(!e||e.loading)&&!(e.loaded&&!s.force)){e.loading=!0,y.value="",te();try{const a=await Ze({path:e.path,limit:240});e.children=(a.items||[]).map(u=>ke(u,e.depth+1)),e.loaded=!0}catch(a){y.value=a.message||v("directoryPicker.loadFailed")}finally{e.loading=!1,te()}}}async function We(){x.value=!0,y.value="";try{const e=await Ze({limit:240});M.value=String(e.path||""),c.value=ke({name:we(e.path||""),path:String(e.path||""),type:"directory",hasChildren:!0,isHomeRoot:!0},0),c.value.children=(e.items||[]).map(s=>ke(s,1)),c.value.loaded=!0,c.value.expanded=!0,z(c.value)}catch(e){y.value=e.message||v("directoryPicker.treeLoadFailed"),c.value=null,M.value=""}finally{x.value=!1}}async function Ie(e=""){const s=String(e||"").trim();if(!s||!M.value||!X(s,M.value))return;let a=c.value;if(!a)return;z(a);const u=qe(M.value,s);for(const B of u){await je(a),a.expanded=!0,te();const G=ne(j(a.path,B),a.children);if(!G)break;a=G,z(a)}}async function Qe(){E.value="",L.value=[],g.value="",Q.value=!1,I.value="",await We();const e=String($.initialPath||"").trim();e&&X(e,M.value)&&await Ie(e)}async function Pe(e){if(e!=null&&e.path&&(z(e),!!e.hasChildren)){if(!e.loaded){e.expanded=!0,te(),await je(e);return}e.expanded=!e.expanded,te()}}function Be(e){e!=null&&e.path&&z(e)}async function Ne(){const e=String(E.value||"").trim();N+=1;const s=N;if(U(),!$.open||!e||!M.value||!ae.value){r.value=!1,g.value="",L.value=[],Q.value=!1;return}r.value=!0,g.value="",O=new AbortController;try{const a=await gt(e,{path:M.value,limit:80,signal:O.signal});if(s!==N)return;L.value=Array.isArray(a.items)?a.items:[],Q.value=!!a.truncated}catch(a){if(vt(a)||s!==N)return;g.value=a.message||v("directoryPicker.searchFailed"),L.value=[],Q.value=!1}finally{s===N&&(O=null),s===N&&(r.value=!1)}}function Oe(){if(U(),!String(E.value||"").trim()||!ae.value){r.value=!1,g.value="",L.value=[],Q.value=!1;return}r.value=!0,g.value="",F=window.setTimeout(()=>{F=null,Ne()},ft)}async function Re(e){e!=null&&e.path&&(await Ie(e.path),E.value="")}function Ue(){I.value&&(f("select",I.value),f("close"))}return me(E,()=>{Oe()}),me(b,()=>{Ce(),re(le)},{immediate:!0}),me(()=>$.open,e=>{if(e){Qe().catch(()=>{}),_e();return}U()}),lt(()=>{U()}),(e,s)=>(p(),he(st,{open:o.open,"stack-level":1,"panel-class":"settings-dialog-panel h-full max-w-4xl sm:h-auto sm:max-h-[86vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 flex-col overflow-hidden px-4 py-4 sm:px-5","close-disabled":x.value||r.value,"close-on-backdrop":!(x.value||r.value),"close-on-escape":!(x.value||r.value),onClose:s[2]||(s[2]=a=>f("close"))},{title:xe(()=>[n("div",null,[n("div",Ft,[k(l(ze),{class:"h-4 w-4"}),n("span",null,d(l(v)("directoryPicker.title")),1)]),n("p",Bt,d(l(v)("directoryPicker.intro")),1)])]),default:xe(()=>[n("div",{class:"flex min-h-0 flex-1 flex-col overflow-hidden",onKeydown:Fe},[n("div",Nt,[n("div",Ot,[n("span",Ut,d(l(v)("directoryPicker.currentSelection")),1),n("span",zt,d(I.value||l(v)("directoryPicker.selectionPlaceholder")),1)])]),n("label",Ht,[n("span",null,d(l(v)("directoryPicker.searchLabel")),1),n("div",Kt,[k(l($t),{class:"h-4 w-4 shrink-0 text-[var(--theme-textMuted)]"}),xt(n("input",{ref_key:"searchInputRef",ref:K,"onUpdate:modelValue":s[0]||(s[0]=a=>E.value=a),type:"text",placeholder:l(v)("directoryPicker.searchPlaceholder"),class:"min-w-0 flex-1 border-0 bg-transparent px-0 text-sm text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",onKeydown:yt(ge,["esc"])},null,40,Vt),[[bt,E.value]])])]),n("div",qt,[P.value&&g.value?(p(),m("div",Wt,d(g.value),1)):!P.value&&y.value?(p(),m("div",Qt,d(y.value),1)):P.value&&r.value?(p(),m("div",Gt,[k(l(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,d(l(v)("directoryPicker.searching")),1)])):!P.value&&x.value?(p(),m("div",Jt,[k(l(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,d(l(v)("directoryPicker.treeLoading")),1)])):ye.value?(p(),m("div",Xt,d(l(v)("directoryPicker.searchMinKeywordHint",{count:l(Ye)})),1)):Ve.value?(p(),m("div",Yt,d(l(v)("directoryPicker.noSearchResults")),1)):de.value?(p(),m("div",Zt,d(l(v)("directoryPicker.emptyTree")),1)):P.value?(p(),m("div",en,[(p(!0),m(Te,null,Ke(L.value,a=>(p(),m("button",{key:a.path,ref_for:!0,ref:u=>ce(a.path,u),type:"button",class:A(["theme-list-row focus:outline-none",T(I.value)===T(a.path)?"theme-list-item-active":"theme-list-item-hover"]),onClick:u=>Re(a)},[k(l(ze),{class:"theme-list-item-icon"}),n("div",nn,[n("div",null,[n("span",{class:"theme-list-item-title block break-all",innerHTML:Ae(a)},null,8,an)]),n("div",{class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all",innerHTML:Le(a)},null,8,sn)])],10,tn))),128)),Q.value?(p(),m("p",ln,d(l(v)("directoryPicker.truncatedHint")),1)):C("",!0)])):(p(),m("div",on,[(p(!0),m(Te,null,Ke(ee.value,a=>(p(),m("div",{key:a.path,ref_for:!0,ref:u=>ce(a.path,u),class:A(["theme-list-tree-item outline-none focus:outline-none focus-visible:outline-none",T(I.value)===T(a.path)?"theme-list-item-active":a.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:wt({paddingLeft:`${a.depth*16+6}px`})},[n("div",rn,[n("button",{type:"button",class:A(["theme-icon-button h-5 w-5 shrink-0",a.hasChildren?"":"invisible pointer-events-none"]),onClick:St(u=>Pe(a),["stop"])},[a.loading?(p(),he(l(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(p(),he(l(_t),{key:1,class:A(["h-3.5 w-3.5 transition",a.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],10,dn),n("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:u=>Be(a)},[k(l(ze),{class:A(["h-4 w-4 shrink-0",T(I.value)===T(a.path)?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"]),n("div",cn,[n("div",{class:A(["theme-list-item-title truncate",a.isHomeRoot?"font-medium text-[var(--theme-textSecondary)]":"font-medium text-[var(--theme-textPrimary)]"])},d(be(a)),3),a.isHomeRoot?(p(),m("div",pn,d(a.path),1)):C("",!0)])],8,un)])],6))),128))]))])],32),n("div",fn,[n("div",gn,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:x.value||r.value,onClick:s[1]||(s[1]=a=>f("close"))},d(l(v)("directoryPicker.cancel")),9,vn),n("button",{type:"button",class:"tool-button tool-button-primary inline-flex w-full items-center justify-center gap-2 px-3 py-2 text-xs sm:w-auto",disabled:x.value||r.value||!I.value,onClick:Ue},[k(l(ot),{class:"h-4 w-4"}),n("span",null,d(l(v)("directoryPicker.useCurrentDirectory")),1)],8,mn)])])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},xn={class:"grid gap-4"},yn={class:"theme-muted-text block text-xs"},bn=["value","disabled"],wn={class:"theme-muted-text block text-xs"},Sn={class:"mt-1 flex gap-2"},kn=["value","disabled"],$n=["disabled"],_n={id:"codex-manager-workspace-suggestions"},Cn=["value"],Mn={key:0,class:"mt-2 text-[11px] leading-5 text-[var(--theme-warningText)]"},jn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},In={class:"theme-muted-text block text-xs"},Pn={class:"mt-1"},Rn={class:"flex items-center gap-2 text-sm"},Tn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},Dn=["disabled","onClick"],En={class:"flex items-center justify-between gap-3"},An={class:"min-w-0 flex-1 truncate"},Ln={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},Fn={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},Bn={class:"theme-muted-text block text-xs"},Nn={class:"mt-1 flex gap-2"},On=["value","disabled"],Un=["disabled"],zn={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},Hn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},nt={__name:"CodexSessionManagerForm",props:{busy:{type:Boolean,default:!1},canEditEngine:{type:Boolean,default:!0},canEditCwd:{type:Boolean,default:!0},canEditSessionId:{type:Boolean,default:!0},cwd:{type:String,default:""},cwdReadonlyMessage:{type:String,default:""},duplicateCwdMessage:{type:String,default:""},engine:{type:String,default:"codex"},engineOptions:{type:Array,default:()=>[]},engineReadonlyMessage:{type:String,default:""},mobile:{type:Boolean,default:!1},sessionId:{type:String,default:""},sessionIdCopied:{type:Boolean,default:!1},sessionIdReadonlyMessage:{type:String,default:""},title:{type:String,default:""},workspaceSuggestions:{type:Array,default:()=>[]}},emits:["copy-session-id","open-directory-picker","update:cwd","update:engine","update:sessionId","update:title"],setup(o,{emit:R}){const $=o,f=R,{t:v}=De(),M=S(()=>{const x=String($.engine||"").trim();return $.engineOptions.find(y=>String((y==null?void 0:y.value)||"").trim()===x)||null}),c=S(()=>String($.sessionId||"").trim());return(x,y)=>(p(),m("div",xn,[n("label",yn,[n("span",null,d(l(v)("projectManager.projectTitleOptional")),1),n("input",{value:o.title,type:"text",maxlength:"140",placeholder:"",class:"tool-input mt-1",disabled:o.busy,onInput:y[0]||(y[0]=r=>f("update:title",r.target.value))},null,40,bn)]),n("label",wn,[n("span",null,d(l(v)("projectManager.workingDirectoryField")),1),n("div",Sn,[n("input",{value:o.cwd,type:"text",list:"codex-manager-workspace-suggestions",placeholder:"",class:A(["tool-input min-w-0 flex-1 disabled:cursor-not-allowed disabled:opacity-80",o.duplicateCwdMessage?"border-[var(--theme-warning)]":""]),disabled:o.busy||!o.canEditCwd,onInput:y[1]||(y[1]=r=>f("update:cwd",r.target.value))},null,42,kn),n("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:o.busy||!o.canEditCwd,onClick:y[2]||(y[2]=r=>f("open-directory-picker"))},[k(l(ze),{class:"h-4 w-4"}),n("span",null,d(o.mobile?l(v)("projectManager.choose"):l(v)("projectManager.chooseDirectory")),1)],8,$n)]),n("datalist",_n,[(p(!0),m(Te,null,Ke(o.workspaceSuggestions,r=>(p(),m("option",{key:r,value:r},null,8,Cn))),128))]),o.duplicateCwdMessage?(p(),m("p",Mn,d(o.duplicateCwdMessage),1)):o.cwdReadonlyMessage?(p(),m("p",jn,d(o.cwdReadonlyMessage),1)):C("",!0)]),n("label",In,[n("span",null,d(l(v)("projectManager.engineField")),1),n("div",Pn,[k(mt,{"model-value":o.engine,options:o.engineOptions,disabled:o.busy||!o.canEditEngine,placeholder:l(v)("projectManager.selectEngine"),"empty-text":l(v)("projectManager.noEngines"),"get-option-value":r=>(r==null?void 0:r.value)||"","onUpdate:modelValue":y[3]||(y[3]=r=>f("update:engine",r))},{trigger:xe(({disabled:r})=>{var g;return[n("div",Rn,[n("span",{class:A(["min-w-0 flex-1 truncate",r?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},d(((g=M.value)==null?void 0:g.label)||l(v)("projectManager.selectEngine")),3),M.value&&M.value.enabled===!1?(p(),m("span",Tn,d(l(v)("projectManager.comingSoon")),1)):C("",!0)])]}),option:xe(({option:r,selected:g,select:L})=>[n("button",{type:"button",class:A(["w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm transition",g?"theme-filter-active":"theme-filter-idle"]),disabled:(r==null?void 0:r.enabled)===!1,onClick:L},[n("div",En,[n("span",An,d(r.label),1),(r==null?void 0:r.enabled)===!1?(p(),m("span",Ln,d(l(v)("projectManager.comingSoon")),1)):C("",!0)])],10,Dn)]),_:1},8,["model-value","options","disabled","placeholder","empty-text","get-option-value"])]),o.engineReadonlyMessage?(p(),m("p",Fn,d(o.engineReadonlyMessage),1)):C("",!0)]),n("label",Bn,[n("span",null,d(l(v)("projectManager.sessionId")),1),n("div",Nn,[n("input",{value:o.sessionId,type:"text",placeholder:"",class:"tool-input min-w-0 flex-1 disabled:cursor-not-allowed disabled:opacity-80",disabled:o.busy||!o.canEditSessionId,onInput:y[4]||(y[4]=r=>f("update:sessionId",r.target.value))},null,40,On),c.value?(p(),m("button",{key:0,type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:o.busy,onClick:y[5]||(y[5]=r=>f("copy-session-id"))},[o.sessionIdCopied?(p(),he(l(ot),{key:0,class:"h-4 w-4"})):(p(),he(l(Ct),{key:1,class:"h-4 w-4"})),n("span",null,d(o.sessionIdCopied?l(v)("projectManager.sessionIdCopied"):l(v)("projectManager.copySessionId")),1)],8,Un)):C("",!0)]),o.sessionIdReadonlyMessage?(p(),m("p",zn,d(o.sessionIdReadonlyMessage),1)):(p(),m("p",Hn,d(l(v)("projectManager.sessionIdHint")),1))])]))}},Kn={class:"flex items-center justify-between gap-3"},Vn={class:"theme-heading text-sm font-medium"},qn={key:0,class:"theme-muted-text mt-1 text-xs"},Wn=["disabled"],Qn=["onClick"],Gn={key:0,class:"theme-selection-indicator absolute inset-y-3 left-0 w-1 rounded-full"},Jn={class:"flex w-full flex-col gap-2 text-left"},Xn={class:"theme-heading min-w-0 text-sm font-medium"},Yn=["title"],Zn=["title"],ea={class:"theme-muted-text flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] leading-5"},ta={key:0,"aria-hidden":"true"},na={key:1},aa={class:"flex flex-wrap items-center gap-2 pt-1"},sa={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},at={__name:"CodexSessionManagerList",props:{busy:{type:Boolean,default:!1},editingSessionId:{type:String,default:""},formatUpdatedAt:{type:Function,default:o=>o},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},hasSessions:{type:Boolean,default:!1},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1},mode:{type:String,default:"edit"},mobile:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]}},emits:["create","select"],setup(o,{emit:R}){const $=o,f=R,{t:v}=De();function M(y){return $.mode==="edit"&&$.editingSessionId===y.id?"theme-card-selected":$.isSessionRunning(y.id)?"theme-card-warning":"theme-card-idle-strong"}function c(y){return $.isCurrentSession(y.id)?v("projectManager.current"):v("projectManager.regular")}function x(y){return $.isCurrentSession(y.id)?"theme-status-info":"theme-status-neutral"}return(y,r)=>(p(),m("div",{class:A(o.mobile?"flex h-full min-h-0 flex-col":"")},[n("div",Kn,[n("div",null,[n("div",Vn,d(l(v)("projectManager.projectList")),1),o.hasSessions?C("",!0):(p(),m("p",qn,d(l(v)("projectManager.noProjects")),1))]),n("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:o.busy,onClick:r[0]||(r[0]=g=>f("create"))},[k(l(Mt),{class:"h-4 w-4"}),n("span",null,d(l(v)("projectManager.create")),1)],8,Wn)]),n("div",{class:A(["mt-4 space-y-2",o.mobile?"min-h-0 flex-1 overflow-y-auto":"max-h-52 overflow-y-auto pr-1 sm:max-h-64 lg:max-h-[calc(88vh-11rem)]"])},[(p(!0),m(Te,null,Ke(o.sessions,g=>(p(),m("article",{key:g.id,class:A(["relative cursor-pointer rounded-sm border p-3 transition",M(g)]),onClick:L=>f("select",g.id)},[o.mode==="edit"&&o.editingSessionId===g.id?(p(),m("span",Gn)):C("",!0),n("div",Jn,[n("div",Xn,[n("span",{class:"block truncate",title:g.title||l(v)("projectManager.untitledProject")},d(g.title||l(v)("projectManager.untitledProject")),9,Yn)]),n("div",{class:"theme-muted-text break-all font-mono text-[11px] leading-5",title:g.cwd},d(g.cwd),9,Zn),n("div",ea,[n("span",null,d(l(He)(g.engine)),1),o.mobile?C("",!0):(p(),m("span",ta,"·")),o.mobile?C("",!0):(p(),m("span",na,d(o.formatUpdatedAt(g.updatedAt)),1))]),n("div",aa,[n("span",{class:A(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",x(g)])},d(c(g)),3),n("span",{class:A(["inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",o.getRuntimeStatusClass(g.id)])},[o.isSessionRunning(g.id)?(p(),m("span",sa)):C("",!0),it(" "+d(o.getRuntimeStatusLabel(g.id)),1)],2),n("span",{class:A(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",o.getThreadStatusClass(g)])},d(o.getThreadStatusLabel(g)),3)])])],10,Qn))),128))],2)],2))}},la={class:"space-y-3"},ia={class:"dashed-panel px-3 py-3"},oa={class:"theme-muted-text text-[11px]"},ra={class:"mt-2 flex flex-wrap gap-2"},da={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},ua={key:0,class:"theme-status-info inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs"},ca={class:"dashed-panel px-3 py-3"},pa={class:"theme-muted-text text-[11px]"},fa={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},ga={class:"dashed-panel px-3 py-3"},va={class:"theme-muted-text text-[11px]"},ma={class:"mt-2 break-all font-mono text-xs leading-6 text-[var(--theme-textPrimary)]"},ha={class:"dashed-panel px-3 py-3"},xa={class:"theme-muted-text text-[11px]"},ya={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},ba={class:"dashed-panel px-3 py-3"},wa={class:"theme-muted-text inline-flex items-center gap-2 text-[11px]"},Sa={class:"mt-2 text-xs leading-6 text-[var(--theme-textSecondary)]"},ka={__name:"CodexSessionManagerStatus",props:{activeSession:{type:Object,default:null},formatUpdatedAt:{type:Function,default:o=>o},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1}},setup(o){const{t:R}=De();return($,f)=>{var v,M,c,x,y,r,g;return p(),m("div",la,[n("div",ia,[n("div",oa,d(l(R)("projectManager.runtimeStatus")),1),n("div",ra,[n("span",{class:A(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",o.getRuntimeStatusClass((v=o.activeSession)==null?void 0:v.id)])},[o.isSessionRunning((M=o.activeSession)==null?void 0:M.id)?(p(),m("span",da)):C("",!0),it(" "+d(o.getRuntimeStatusLabel((c=o.activeSession)==null?void 0:c.id)),1)],2),n("span",{class:A(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",o.getThreadStatusClass(o.activeSession)])},d(o.getThreadStatusLabel(o.activeSession)),3),(x=o.activeSession)!=null&&x.id&&o.isCurrentSession(o.activeSession.id)?(p(),m("span",ua,d(l(R)("projectManager.currentProject")),1)):C("",!0)])]),n("div",ca,[n("div",pa,d(l(R)("projectManager.engine")),1),n("div",fa,d(l(He)((y=o.activeSession)==null?void 0:y.engine)),1)]),n("div",ga,[n("div",va,d(l(R)("projectManager.workingDirectory")),1),n("div",ma,d(((r=o.activeSession)==null?void 0:r.cwd)||l(R)("projectManager.notSet")),1)]),n("div",ha,[n("div",xa,d(l(R)("projectManager.updatedAt")),1),n("div",ya,d(o.formatUpdatedAt((g=o.activeSession)==null?void 0:g.updatedAt)),1)]),n("div",ba,[n("div",wa,[k(l(jt),{class:"h-3.5 w-3.5"}),n("span",null,d(l(R)("projectManager.note")),1)]),n("p",Sa,d(l(R)("projectManager.noteDescription")),1)])])}}},$a={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},_a={key:0,class:"grid min-h-0 flex-1 gap-0 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]"},Ca={class:"theme-divider theme-muted-panel border-b px-3 py-3 sm:px-4 sm:py-4 lg:border-b-0 lg:border-r"},Ma={class:"min-h-0 overflow-y-auto px-4 py-4 sm:px-5"},ja={class:"flex flex-wrap items-start justify-between gap-3"},Ia={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Pa={class:"mt-5"},Ra={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Ta={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4 sm:flex-row sm:items-center sm:justify-between"},Da={class:"flex flex-wrap items-center gap-2"},Ea=["disabled"],Aa=["disabled"],La=["disabled"],Fa={class:"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:items-center"},Ba=["disabled"],Na=["disabled"],Oa=["disabled"],Ua={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},za={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ha={class:"min-h-0 flex-1 overflow-hidden px-3 py-3"},Ka={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Va={class:"theme-divider flex items-center gap-3 border-b px-4 py-3"},qa=["disabled"],Wa={class:"min-w-0 flex-1"},Qa={class:"theme-heading truncate text-sm font-medium"},Ga={key:0,class:"theme-muted-text mt-1 truncate text-xs"},Ja={class:"theme-divider border-b px-4 py-3"},Xa={class:"grid grid-cols-2 gap-2"},Ya=["disabled"],Za={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4"},es={key:0},ts={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},ns={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4"},as=["disabled"],ss=["disabled"],ls=["disabled"],is=["disabled"],gs={__name:"CodexSessionManagerDialog",props:{open:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]},workspaces:{type:Array,default:()=>[]},selectedSessionId:{type:String,default:""},selectionLocked:{type:Boolean,default:!1},selectionLockReason:{type:String,default:""},loading:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},onRefresh:{type:Function,default:null},onCreate:{type:Function,default:null},onUpdate:{type:Function,default:null},onDelete:{type:Function,default:null},onReset:{type:Function,default:null}},emits:["close","project-created","select-session","open-source-browser"],setup(o,{expose:R,emit:$}){const f=o,v=$,{locale:M,t:c}=De(),x=_("edit"),y=_(""),r=kt({title:"",engine:"codex",cwd:"",sessionId:""}),g=_(""),L=_(!1),Q=_(!1),E=_(!1),I=_(!1),K=_(!1),F=_(!1),N=_(!1),O=_(!1),{matches:V}=ht("(max-width: 767px)"),ee=_("list"),q=_("basic"),ae=_(Xe());let P=null;const J=S(()=>z(f.sessions)),b=S(()=>f.sessions.find(t=>t.id===y.value)||null),ye=S(()=>f.sessions.length>0),Ve=S(()=>f.sessions.find(t=>t.id===f.selectedSessionId)||null),de=S(()=>!!(b.value&&U(b.value.id))),se=S(()=>{var t;return!((t=b.value)!=null&&t.started)}),T=S(()=>{var t;return!((t=b.value)!=null&&t.started)}),X=S(()=>{var t;return!((t=b.value)!=null&&t.started)}),j=S(()=>f.loading||L.value||Q.value||E.value||I.value),qe=S(()=>String(r.sessionId||"").trim()),ue=S(()=>{var h,w;const t=new Set,i=[];return[r.cwd,(h=b.value)==null?void 0:h.cwd,(w=Ve.value)==null?void 0:w.cwd,...f.workspaces,...f.sessions.map(H=>H.cwd)].forEach(H=>{const D=String(H||"").trim();!D||t.has(D)||(t.add(D),i.push(D))}),i.slice(0,12)}),be=S(()=>ae.value),we=S(()=>{const t=te(r.cwd);return t?f.sessions.filter(i=>{var h;return i.id===((h=b.value)==null?void 0:h.id)?!1:te(i.cwd)===t}):[]}),oe=S(()=>{if(!we.value.length)return"";const t=we.value.slice(0,3).map(i=>{const h=i.title||c("projectManager.untitledProject");return M.value==="en-US"?`"${h}"`:`「${h}」`}).join(M.value==="en-US"?", ":"、");return c("projectManager.duplicateDirectory",{labels:t,count:we.value.length})}),Ee=S(()=>x.value!=="edit"||se.value?"":c("projectManager.cwdReadonly")),Se=S(()=>x.value!=="edit"||!b.value||T.value?"":c("projectManager.engineReadonly")),Ae=S(()=>x.value!=="edit"||!b.value||X.value?"":c("projectManager.sessionIdReadonly")),Le=S(()=>x.value==="create"?L.value?c("projectManager.creatingProject"):c("projectManager.createProject"):Q.value?c("projectManager.savingChanges"):c("projectManager.saveChanges")),ke=S(()=>{var t;return x.value==="create"?c("projectManager.newProject"):((t=b.value)==null?void 0:t.title)||c("projectManager.untitledProject")});function $e(t=""){const i=Date.parse(String(t||""));return Number.isFinite(i)?i:0}function te(t=""){const i=String(t||"").trim();if(!i)return"";const h=/^[a-z]:[\\/]/i.test(i)||i.includes("\\");let w=i.replace(/\\/g,"/");return w.length>1&&!/^[a-z]:\/$/i.test(w)&&(w=w.replace(/\/+$/,"")),h?w.toLowerCase():w}function U(t){var i;return!!((i=f.sessions.find(h=>h.id===t))!=null&&i.running)}function ne(t){return!!t&&t===f.selectedSessionId}function z(t=[]){return[...t].sort((i,h)=>{const w=Number(U(h.id))-Number(U(i.id));if(w)return w;const H=Number(ne(h.id))-Number(ne(i.id));if(H)return H;const D=$e(h.updatedAt)-$e(i.updatedAt);return D||ut(String(i.title||i.cwd||i.id),String(h.title||h.cwd||h.id))})}function Y(t){return U(t)?c("projectManager.running"):c("projectManager.idle")}function ce(t){return U(t)?"theme-status-warning":"theme-status-success"}function le(t){return t!=null&&t.started?c("projectManager.threadBound"):c("projectManager.notStarted")}function _e(t){return t!=null&&t.started?"theme-status-success":"theme-status-neutral"}function Ce(t=""){if(!t)return c("projectManager.unknown");const i=new Date(t);return Number.isNaN(i.getTime())?t:dt(i.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function pe(t){r.title=String((t==null?void 0:t.title)||""),r.engine=Je(t==null?void 0:t.engine),r.cwd=String((t==null?void 0:t.cwd)||""),r.sessionId=String((t==null?void 0:t.sessionId)||(t==null?void 0:t.engineSessionId)||(t==null?void 0:t.engineThreadId)||(t==null?void 0:t.codexThreadId)||"").trim()}function ie(){x.value="create",y.value="",g.value="",r.title="",r.engine="codex",r.cwd="",r.sessionId=""}function W(t){const i=f.sessions.find(h=>h.id===t);i&&(x.value="edit",y.value=i.id,g.value="",pe(i))}function fe(){var t;return f.selectedSessionId&&f.sessions.some(i=>i.id===f.selectedSessionId)?f.selectedSessionId:((t=J.value[0])==null?void 0:t.id)||""}function Me(t="basic"){ee.value="detail",q.value=t}function ge(){ee.value="list",q.value="basic"}function Fe(){ie(),V.value&&Me("basic")}function je(t){j.value||(W(t),V.value&&Me("basic"))}function We(t){r.cwd=String(t||"").trim()}async function Ie(){var i,h;const t=((i=b.value)==null?void 0:i.id)||fe();return!t||((!b.value||b.value.id!==t)&&(W(t),await re()),!((h=b.value)!=null&&h.cwd))?!1:(V.value&&Me("basic"),v("open-source-browser",b.value),v("close"),!0)}function Qe(){return K.value?(K.value=!1,!0):F.value?(F.value=!1,!0):N.value?(N.value=!1,!0):f.open?(v("close"),!0):!1}function Pe(t){r.title=String(t||"")}function Be(t){r.engine=Je(t)}function Ne(t){r.cwd=String(t||"")}function Oe(t){r.sessionId=String(t||"")}function Re(){g.value="",K.value=!1,F.value=!1,O.value=!1,q.value="basic",ee.value=V.value?"list":"detail";const t=fe();if(t){W(t);return}ie()}async function Ue(){if(!(j.value||typeof f.onRefresh!="function")){g.value="";try{await Promise.all([f.onRefresh(),e()])}catch(t){g.value=t.message}}}async function e(){try{ae.value=await Lt()}catch{ae.value=Xe()}}async function s(t){var h;if((h=navigator.clipboard)!=null&&h.writeText&&window.isSecureContext){await navigator.clipboard.writeText(t);return}const i=document.createElement("textarea");i.value=t,i.setAttribute("readonly","true"),i.style.position="fixed",i.style.opacity="0",i.style.pointerEvents="none",document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}async function a(){const t=qe.value;if(t)try{await s(t),O.value=!0,P&&clearTimeout(P),P=setTimeout(()=>{O.value=!1,P=null},1800)}catch(i){g.value=(i==null?void 0:i.message)||c("projectManager.copySessionIdFailed")}}async function u(){if(!j.value){g.value="";try{const t=B();if(!t)return;await G(t)}catch(t){g.value=t.message}}}function B(){if(x.value==="create"){const i=String(r.cwd||"").trim();return i?{type:"create",cwd:i,payload:{title:r.title,engine:r.engine,cwd:i,sessionId:String(r.sessionId||"").trim()}}:(g.value=c("projectManager.directoryRequired"),null)}if(!b.value)return g.value=c("projectManager.projectMissing"),null;const t={title:r.title,engine:r.engine};return se.value&&(t.cwd=r.cwd),X.value&&(t.sessionId=String(r.sessionId||"").trim()),{type:"update",sessionId:b.value.id,payload:t}}async function G(t){var i,h;if(t.type==="create"){L.value=!0;try{const w=await((i=f.onCreate)==null?void 0:i.call(f,t.payload));w!=null&&w.id&&(W(w.id),v("select-session",w.id),await re(),v("project-created",w),v("close"));return}finally{L.value=!1}}Q.value=!0;try{const w=await((h=f.onUpdate)==null?void 0:h.call(f,t.sessionId,t.payload));w!=null&&w.id&&W(w.id)}finally{Q.value=!1}}async function ve(){var i,h;if(!b.value||E.value)return;const t=b.value.id;g.value="",E.value=!0;try{const w=await((i=f.onDelete)==null?void 0:i.call(f,t));K.value=!1;const H=f.sessions.filter(rt=>rt.id!==t),D=(w==null?void 0:w.selectedSessionId)||((h=z(H)[0])==null?void 0:h.id)||"";v("select-session",D),D?(W(D),V.value&&ge()):(ie(),V.value&&ge())}catch(w){g.value=w.message}finally{E.value=!1}}async function Z(){var i;if(!b.value||I.value)return;const t=b.value.id;g.value="",I.value=!0;try{const h=await((i=f.onReset)==null?void 0:i.call(f,t));F.value=!1;const w=(h==null?void 0:h.session)||f.sessions.find(H=>H.id===t)||null;w!=null&&w.id&&W(w.id)}catch(h){g.value=h.message}finally{I.value=!1}}return me(()=>f.open,t=>{if(t){Re(),typeof f.onRefresh=="function"?Ue().catch(()=>{}):e().catch(()=>{});return}N.value=!1,K.value=!1,F.value=!1,O.value=!1,g.value=""},{immediate:!0}),me(V,t=>{t||(ee.value="detail")},{immediate:!0}),me(()=>f.sessions,()=>{if(!f.open)return;if(x.value==="create"){if(!!(String(r.title||"").trim()||String(r.cwd||"").trim())||!!String(r.sessionId||"").trim())return;const h=fe();h&&W(h);return}if(b.value){pe(b.value);return}const t=fe();if(t){W(t);return}ie()}),lt(()=>{P&&(clearTimeout(P),P=null)}),R({closeTopDialog:Qe}),(t,i)=>(p(),m(Te,null,[k(et,{open:F.value,title:l(c)("projectManager.confirmResetTitle"),description:b.value?l(c)("projectManager.confirmResetDescription",{title:b.value.title||l(c)("projectManager.untitledProject")}):"","confirm-text":l(c)("projectManager.confirmReset"),"cancel-text":l(c)("projectManager.keep"),loading:I.value,onCancel:i[0]||(i[0]=h=>F.value=!1),onConfirm:Z},null,8,["open","title","description","confirm-text","cancel-text","loading"]),k(et,{open:K.value,title:l(c)("projectManager.confirmDeleteTitle"),description:b.value?l(c)("projectManager.confirmDeleteDescription",{title:b.value.title||l(c)("projectManager.untitledProject")}):"","confirm-text":l(c)("projectManager.confirmDelete"),"cancel-text":l(c)("projectManager.keep"),loading:E.value,danger:"",onCancel:i[1]||(i[1]=h=>K.value=!1),onConfirm:ve},null,8,["open","title","description","confirm-text","cancel-text","loading"]),k(hn,{open:N.value,"initial-path":r.cwd,suggestions:ue.value,onClose:i[2]||(i[2]=h=>N.value=!1),onSelect:We},null,8,["open","initial-path","suggestions"]),k(st,{open:o.open,"panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-auto sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 overflow-hidden","close-disabled":j.value,"close-on-backdrop":!j.value,"close-on-escape":!j.value,onClose:i[12]||(i[12]=h=>v("close"))},{title:xe(()=>[n("div",$a,[k(l(Et),{class:"h-4 w-4"}),n("span",null,d(l(c)("projectManager.managingTitle")),1)])]),default:xe(()=>{var h,w,H;return[l(V)?(p(),m("div",Ua,[ee.value==="list"?(p(),m("div",za,[n("div",Ha,[k(at,{mobile:"",busy:j.value,"editing-session-id":y.value,"format-updated-at":Ce,"get-runtime-status-class":ce,"get-runtime-status-label":Y,"get-thread-status-class":_e,"get-thread-status-label":le,"has-sessions":ye.value,"is-current-session":ne,"is-session-running":U,mode:x.value,sessions:J.value,onCreate:Fe,onSelect:je},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])])])):(p(),m("div",Ka,[n("div",Va,[n("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-3 py-2 text-xs",disabled:j.value,onClick:ge},[k(l(Dt),{class:"h-4 w-4"}),n("span",null,d(l(c)("projectManager.projectList")),1)],8,qa),n("div",Wa,[n("div",Qa,d(ke.value),1),x.value==="edit"&&((w=b.value)!=null&&w.cwd)?(p(),m("p",Ga,d(b.value.cwd),1)):C("",!0)])]),n("div",Ja,[n("div",Xa,[n("button",{type:"button",class:A(["tool-button px-3 py-2 text-sm",q.value==="basic"?"tool-button-accent-subtle":""]),onClick:i[7]||(i[7]=D=>q.value="basic")},d(l(c)("projectManager.basicInfo")),3),n("button",{type:"button",class:A(["tool-button px-3 py-2 text-sm",q.value==="status"?"tool-button-accent-subtle":""]),disabled:x.value==="create",onClick:i[8]||(i[8]=D=>q.value="status")},d(l(c)("projectManager.status")),11,Ya)])]),n("div",Za,[q.value==="basic"?(p(),m("div",es,[k(nt,{mobile:"",busy:j.value,"can-edit-engine":x.value!=="edit"||T.value,"can-edit-cwd":x.value!=="edit"||se.value,"can-edit-session-id":x.value!=="edit"||X.value,cwd:r.cwd,"cwd-readonly-message":Ee.value,"duplicate-cwd-message":oe.value,engine:r.engine,"engine-options":be.value,"engine-readonly-message":Se.value,"session-id":r.sessionId,"session-id-copied":O.value,"session-id-readonly-message":Ae.value,title:r.title,"workspace-suggestions":ue.value,onCopySessionId:a,onOpenDirectoryPicker:i[9]||(i[9]=D=>N.value=!0),"onUpdate:cwd":Ne,"onUpdate:engine":Be,"onUpdate:sessionId":Oe,"onUpdate:title":Pe},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"]),g.value?(p(),m("p",ts,[k(l(tt),{class:"h-4 w-4"}),n("span",null,d(g.value),1)])):C("",!0),n("div",ns,[n("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-sm",disabled:j.value,onClick:u},d(Le.value),9,as),x.value==="edit"&&b.value?(p(),m("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:j.value||!((H=b.value)!=null&&H.cwd),onClick:Ie},d(l(c)("projectManager.viewSource")),9,ss)):C("",!0),x.value==="edit"&&b.value?(p(),m("button",{key:1,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:j.value||de.value,onClick:i[10]||(i[10]=D=>F.value=!0)},d(I.value?l(c)("projectManager.resettingSession"):l(c)("projectManager.newSession")),9,ls)):C("",!0),x.value==="edit"&&b.value?(p(),m("button",{key:2,type:"button",class:"tool-button tool-button-danger-subtle w-full px-3 py-2 text-sm",disabled:j.value||de.value,onClick:i[11]||(i[11]=D=>K.value=!0)},d(E.value?l(c)("projectManager.deletingProject"):l(c)("projectManager.deleteProject")),9,is)):C("",!0)])])):(p(),he(ka,{key:1,"active-session":b.value,"format-updated-at":Ce,"get-runtime-status-class":ce,"get-runtime-status-label":Y,"get-thread-status-class":_e,"get-thread-status-label":le,"is-current-session":ne,"is-session-running":U},null,8,["active-session"]))])]))])):(p(),m("div",_a,[n("aside",Ca,[k(at,{busy:j.value,"editing-session-id":y.value,"format-updated-at":Ce,"get-runtime-status-class":ce,"get-runtime-status-label":Y,"get-thread-status-class":_e,"get-thread-status-label":le,"has-sessions":ye.value,"is-current-session":ne,"is-session-running":U,mode:x.value,sessions:J.value,onCreate:Fe,onSelect:je},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])]),n("div",Ma,[n("div",ja,[n("div",null,[n("div",Ia,[k(l(It),{class:"h-4 w-4"}),n("span",null,d(x.value==="create"?l(c)("projectManager.createTitle"):l(c)("projectManager.editTitle")),1)])])]),n("div",Pa,[k(nt,{busy:j.value,"can-edit-engine":x.value!=="edit"||T.value,"can-edit-cwd":x.value!=="edit"||se.value,"can-edit-session-id":x.value!=="edit"||X.value,cwd:r.cwd,"cwd-readonly-message":Ee.value,"duplicate-cwd-message":oe.value,engine:r.engine,"engine-options":be.value,"engine-readonly-message":Se.value,"session-id":r.sessionId,"session-id-copied":O.value,"session-id-readonly-message":Ae.value,title:r.title,"workspace-suggestions":ue.value,onCopySessionId:a,onOpenDirectoryPicker:i[3]||(i[3]=D=>N.value=!0),"onUpdate:cwd":Ne,"onUpdate:engine":Be,"onUpdate:sessionId":Oe,"onUpdate:title":Pe},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"])]),g.value?(p(),m("p",Ra,[k(l(tt),{class:"h-4 w-4"}),n("span",null,d(g.value),1)])):C("",!0),n("div",Ta,[n("div",Da,[x.value==="edit"&&b.value?(p(),m("button",{key:0,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:j.value||!((h=b.value)!=null&&h.cwd),onClick:Ie},[k(l(Pt),{class:"h-4 w-4"}),n("span",null,d(l(c)("projectManager.viewSource")),1)],8,Ea)):C("",!0),x.value==="edit"&&b.value?(p(),m("button",{key:1,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:j.value||de.value,onClick:i[4]||(i[4]=D=>F.value=!0)},[k(l(Rt),{class:"h-4 w-4"}),n("span",null,d(I.value?l(c)("projectManager.resettingSession"):l(c)("projectManager.newSession")),1)],8,Aa)):C("",!0),x.value==="edit"&&b.value?(p(),m("button",{key:2,type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:j.value||de.value,onClick:i[5]||(i[5]=D=>K.value=!0)},[k(l(Tt),{class:"h-4 w-4"}),n("span",null,d(E.value?l(c)("projectManager.deletingProject"):l(c)("projectManager.deleteProject")),1)],8,La)):C("",!0)]),n("div",Fa,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:j.value,onClick:i[6]||(i[6]=D=>v("close"))},d(l(c)("projectManager.close")),9,Ba),x.value==="create"&&ye.value?(p(),m("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:j.value,onClick:Re},d(l(c)("projectManager.backToList")),9,Na)):C("",!0),n("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-xs sm:w-auto",disabled:j.value,onClick:u},d(Le.value),9,Oa)])])])]))]}),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"])],64))}};export{gs as default};
|
package/apps/web/dist/assets/{TaskDiffReviewDialog-D4rUvNG6.js → TaskDiffReviewDialog-C3WgGtC2.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as Ze,t as P,f as Ge,u as Re,a as et,b as tt}from"./index-
|
|
1
|
+
import{g as Ze,t as P,f as Ge,u as Re,a as et,b as tt}from"./index-By0kbUJQ.js";import{u as st,g as $e,l as at,r as nt,e as it,D as Te,a as lt,i as ot,b as rt,_ as ut,c as dt}from"./WorkbenchView-CB2beALS.js";import{w as z,c as V,b as H,n as qe,aD as g,aE as y,aF as a,aR as ne,aS as Se,aL as D,aQ as c,aG as $,u as t,aW as De,aX as ct,aN as J,aI as Ie,aJ as ue,f as ft,a$ as Me}from"./vendor-misc-DxKJ95A9.js";import{c as ht,j as Ne,C as Be,R as Ve,b as mt,i as vt,h as Ke,F as ze,z as Ee}from"./vendor-ui-DTqxu3Qf.js";import"./vendor-router-iukOUtEP.js";import"./vendor-markdown-BENmzbO1.js";import"./vendor-tiptap-COqMdKic.js";function se(e,i,r=""){const h=i==="run"?"run":i==="task"?"task":"workspace";return[String(e||"").trim(),h,String(r||"").trim()].join("::")}function gt(e="",i=""){return`${String(e||"").trim()}::${String(i||"").trim()}`}function pt(e=""){return`${String(e||"").trim()}::`}function Je(e){if(!e||typeof e!="object")return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function we(e,i){const r=e.get(i);return r?(e.delete(i),e.set(i,r),Je(r)):null}function _e(e,i,r,h=0){for(e.delete(i),e.set(i,Je(r));h>0&&e.size>h;){const f=e.keys().next().value;if(typeof f>"u")break;e.delete(f)}}function ae(e=""){const i=String(e||"").trim().toUpperCase();return i==="A"||i==="D"?i:"M"}function xt(e=""){const i=String(e||"");if(!i)return[];const r=i.split(`
|
|
2
2
|
`),h=[];let f=0,R=0;return r.forEach((b,u)=>{const T=b.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(T){f=Number(T[1]),R=Number(T[2]),h.push({id:`hunk-${u}`,kind:"hunk",oldNumber:"",newNumber:"",content:b});return}if(b.startsWith("+")&&!b.startsWith("+++")){h.push({id:`line-${u}`,kind:"add",oldNumber:"",newNumber:R,content:b}),R+=1;return}if(b.startsWith("-")&&!b.startsWith("---")){h.push({id:`line-${u}`,kind:"delete",oldNumber:f,newNumber:"",content:b}),f+=1;return}if(b.startsWith(" ")){h.push({id:`line-${u}`,kind:"context",oldNumber:f,newNumber:R,content:b}),f+=1,R+=1;return}h.push({id:`line-${u}`,kind:"meta",oldNumber:"",newNumber:"",content:b})}),h}function kt(e=""){const i=String(e||"").trim();if(!i)return"";const r=i.match(/^当前分支已从 (.+) 切换到 (.+)$/);return r?P("diffReview.warningBranchChanged",{from:r[1],to:r[2]}):i==="当前 HEAD 已不在基线 commit 的后续历史中,仓库可能经历了 reset、rebase 或切分支"?P("diffReview.warningHeadDetachedFromBaseline"):i}function We(e=""){const i=String(e||"").trim();if(!i)return"";const h=new Map([["二进制文件暂不支持在线 diff 预览。","diffReview.binaryPreviewUnavailable"],["文件内容较大,暂不展示具体 diff。","diffReview.fileTooLarge"],["diff 内容较长,暂不在页面内完整展示。","diffReview.diffTooLong"],["当前工作目录不是 Git 仓库,暂不支持代码变更审查。","diffReview.notGitRepo"],["任务不存在。","diffReview.taskNotFound"],["请选择一轮执行后再查看本轮代码变更。","diffReview.runRequired"],["没有找到对应的执行记录。","diffReview.runNotFound"],["这轮执行还没有建立代码变更基线,暂时无法查看本轮 diff。","diffReview.runBaselineMissing"],["当前任务还没有建立代码变更基线,请先让 Codex 执行一轮。","diffReview.taskBaselineMissing"],["这轮执行缺少结束快照,暂时无法准确还原本轮代码变更。","diffReview.runSnapshotMissing"],["原工作目录已不是有效的 Git 仓库,暂时无法读取代码变更。","diffReview.originalRepoInvalid"],["基线对应的 commit 已不存在,仓库可能被 reset、rebase 或切换到无关历史,暂时无法准确读取该范围的代码变更。","diffReview.baselineCommitMissing"]]).get(i);return h?P(h):i}function He(e=null){return!e||typeof e!="object"?e:{...e,reason:We(e.reason),warnings:Array.isArray(e.warnings)?e.warnings.map(i=>kt(i)).filter(Boolean):[],files:Array.isArray(e.files)?e.files.map(i=>({...i,message:We(i==null?void 0:i.message)})):[]}}function yt(e){const i=H("workspace"),r=H(""),h=H(""),f=H("all"),R=H(""),b=H([]),u=H(null),T=H(!1),A=H(!1),O=H(""),l=H(!1),w=H(null),S=H(0),L=new Map,j=st();let p=0,n=0,d="",F="",E="",W=-1;const U=new Map,B=new Map,G=new Map,ie=V(()=>b.value.filter(s=>s.completed)),de=V(()=>{var o;const s={all:0,A:0,M:0,D:0};return(((o=u.value)==null?void 0:o.files)||[]).forEach(m=>{const k=ae(m==null?void 0:m.status);s.all+=1,s[k]+=1}),s}),Z=V(()=>{var m;const s=((m=u.value)==null?void 0:m.files)||[],o=String(R.value||"").trim().toLowerCase();return s.filter(k=>f.value!=="all"&&ae(k==null?void 0:k.status)!==f.value?!1:o?String((k==null?void 0:k.path)||"").toLowerCase().includes(o):!0)}),ce=V(()=>{const s=Z.value;return s.find(o=>o.path===h.value)||s[0]||null}),re=V(()=>{var s;return xt(((s=ce.value)==null?void 0:s.patch)||"")}),q=V(()=>re.value.map((s,o)=>({...s,index:o})).filter(s=>s.kind==="hunk")),fe=V(()=>{var s,o;return A.value&&!((o=(s=u.value)==null?void 0:s.summary)!=null&&o.statsComplete)}),ee=V(()=>{var m;const s=((m=u.value)==null?void 0:m.baseline)||null;if(!(s!=null&&s.createdAt)&&!(s!=null&&s.headShort))return"";const o=[];return s.createdAt&&o.push(P("diffReview.baselineTime",{value:Ge(s.createdAt)})),s.branch&&o.push(P("diffReview.baselineBranch",{value:s.branch})),s.headShort&&o.push(P("diffReview.baselineCommit",{value:s.headShort})),s.currentHeadShort&&o.push(P("diffReview.currentHead",{value:s.currentHeadShort})),o.join(" · ")});function M(s){return(s==null?void 0:s.status)==="completed"?P("diffReview.completed"):(s==null?void 0:s.status)==="error"?P("diffReview.failed"):(s==null?void 0:s.status)==="interrupted"?P("diffReview.interrupted"):P("diffReview.stopped")}function C(s,o){if(s){if(o){L.set(s,o);return}L.delete(s)}}function he(s,o={}){const m=q.value;if(!m.length)return;const k=Math.min(Math.max(0,Number(s)||0),m.length-1),N=m[k],_=L.get(N.id);_&&(S.value=k,_.scrollIntoView({block:o.block||"center",behavior:o.behavior||"smooth"}))}function me(s=1){q.value.length&&he(S.value+s)}function K(s){return`${new Date((s==null?void 0:s.startedAt)||(s==null?void 0:s.createdAt)).toLocaleString(Ze())} · ${M(s)}`}function v(){const s=ie.value;if(!s.length){r.value="";return}s.some(o=>o.id===r.value)||(r.value=s[0].id)}function te(){const s=Z.value;if(!s.length){h.value="";return}s.some(o=>o.path===h.value)||(h.value=s[0].path)}function ve(s=""){return ae(s)==="A"?P("diffReview.added"):ae(s)==="D"?P("diffReview.deleted"):P("diffReview.modified")}function ge(s=""){return ae(s)==="A"?"theme-status-success":ae(s)==="D"?"theme-status-danger":"theme-status-warning"}function pe(s="all"){return s==="A"?P("diffReview.added"):s==="D"?P("diffReview.deleted"):s==="M"?P("diffReview.modified"):P("diffReview.all")}function xe(s="all"){return f.value===s?"theme-filter-active":"theme-filter-idle"}function x(s="context"){return s==="add"?"theme-patch-add":s==="delete"?"theme-patch-delete":s==="hunk"?"theme-patch-hunk":s==="meta"?"theme-patch-meta":"theme-patch-context"}function le(s,o=""){const m=String(o||"").trim();m&&Array.from(s.keys()).forEach(k=>{String(k||"").startsWith(m)&&s.delete(k)})}function Fe(){const s=pt(e.taskSlug);le(U,s),le(B,s),le(G,s)}async function Qe(){if(!e.taskSlug){b.value=[],r.value="",E="",W=-1;return}const s=j.getTaskRunSyncVersion(e.taskSlug);if(E===e.taskSlug&&W===s)return;const o=await at(e.taskSlug,{limit:20,events:"none"});b.value=o.items||[],E=e.taskSlug,W=s,v()}async function Ce(){if(!e.taskSlug||!e.active)return;const s=++p;T.value=!0,A.value=!1,O.value="";try{const o=i.value==="run"?"run":i.value==="task"?"task":"workspace";o==="run"&&await Qe();const m=se(e.taskSlug,o,o==="run"?r.value:"");if(o==="run"&&!r.value){u.value={supported:!1,reason:P("diffReview.noReviewRuns"),repoRoot:"",summary:{fileCount:0,additions:0,deletions:0,statsComplete:!0},files:[]},te();return}const k=we(U,m);if(k){u.value=k,d=m;const I=we(B,m);I?(u.value={...k,baseline:I.baseline||k.baseline||null,warnings:I.warnings||k.warnings||[],summary:I.summary||k.summary},F=m):F="",te(),ke().catch(()=>{}),I||Ae().catch(()=>{});return}const N=await $e(e.taskSlug,{scope:o,runId:o==="run"?r.value:"",includeStats:!1});if(s!==p)return;const _=He(N);u.value=_,_e(U,m,_,36),d=m,F="",te(),ke().catch(()=>{}),Ae().catch(()=>{})}catch(o){if(s!==p)return;O.value=o.message,u.value=null}finally{s===p&&(T.value=!1)}}async function Ae(){var N,_,I;if(!e.taskSlug||!e.active||!((N=u.value)!=null&&N.supported))return;const s=i.value==="run"?"run":i.value==="task"?"task":"workspace",o=s==="run"?r.value:"",m=se(e.taskSlug,s,o);if(F===m&&((I=(_=u.value)==null?void 0:_.summary)!=null&&I.statsComplete))return;const k=we(B,m);if(k){u.value={...u.value,baseline:k.baseline||u.value.baseline||null,warnings:k.warnings||u.value.warnings||[],summary:k.summary||u.value.summary},F=m,A.value=!1;return}A.value=!0;try{const X=await $e(e.taskSlug,{scope:s,runId:o,includeFiles:!1,includeStats:!0}),oe=se(e.taskSlug,i.value,i.value==="run"?r.value:"");if(m!==oe||!u.value)return;const Q=He(X);u.value={...u.value,baseline:Q.baseline||u.value.baseline||null,warnings:Q.warnings||u.value.warnings||[],summary:Q.summary||u.value.summary},_e(B,m,{baseline:Q.baseline||null,warnings:Q.warnings||[],summary:Q.summary||null},36),F=m}catch{}finally{const X=se(e.taskSlug,i.value,i.value==="run"?r.value:"");m===X&&(A.value=!1)}}async function ke(){var oe,Q,je;const s=String(h.value||"").trim();if(!e.taskSlug||!e.active||!s||l.value)return;const o=i.value==="run"?"run":i.value==="task"?"task":"workspace",m=o==="run"?r.value:"",k=se(e.taskSlug,o,m),N=(((oe=u.value)==null?void 0:oe.files)||[]).find(Y=>Y.path===s);if(!N||N.patchLoaded||N.binary||N.tooLarge||N.message)return;const _=gt(k,s),I=we(G,_);if(I&&((Q=u.value)!=null&&Q.files)){u.value={...u.value,files:u.value.files.map(Y=>Y.path===s?I:Y)};return}const X=++n;l.value=!0;try{const Y=await $e(e.taskSlug,{scope:o,runId:m,filePath:s});if(X!==n)return;const Ye=se(e.taskSlug,i.value,i.value==="run"?r.value:"");if(k!==Ye)return;const Le=He(Y),Pe=(Le.files||[]).find(be=>be.path===s);if(!Pe||!((je=u.value)!=null&&je.files))return;_e(G,_,Pe,120),u.value={...u.value,baseline:Le.baseline||u.value.baseline||null,warnings:Le.warnings||u.value.warnings||[],files:u.value.files.map(be=>be.path===s?Pe:be)}}catch(Y){O.value=Y.message}finally{X===n&&(l.value=!1,String(h.value||"").trim()!==s&&ke().catch(()=>{}))}}function ye({force:s=!1}={}){if(!e.taskSlug||!e.active)return;const o=se(e.taskSlug,i.value,i.value==="run"?r.value:"");!s&&o===d||Ce().catch(()=>{})}async function Xe(){!e.taskSlug||!e.active||T.value||(Fe(),d="",F="",E="",W=-1,await Ce())}return z(()=>[e.taskSlug,e.active,i.value,r.value],([s,o],m=[])=>{const k=m[0]||"";s!==k&&(h.value="",d="",b.value=[],r.value="",E="",W=-1,F=""),!(!s||!o)&&ye()},{immediate:!0}),z(()=>{var s,o;return[f.value,((o=(s=u.value)==null?void 0:s.files)==null?void 0:o.length)||0]},()=>{te()}),z(()=>[h.value,q.value.length],()=>{S.value=0,L.clear(),qe(()=>{var s,o;q.value.length?he(0,{behavior:"auto",block:"start"}):(o=(s=w.value)==null?void 0:s.scrollTo)==null||o.call(s,{top:0,behavior:"auto"})})}),z(()=>h.value,()=>{ke().catch(()=>{})},{immediate:!0}),z(()=>[e.preferredScope,e.preferredRunId,e.focusToken],([s,o,m],k=[])=>{const N=Number(k[2]||0),_=s==="run"?"run":s==="task"?"task":"workspace",I=_==="run"&&o?String(o||""):"",X=i.value!==_,oe=_==="run"&&I&&r.value!==I;i.value=_,I&&(r.value=I),_!=="run"&&(r.value=""),!X&&!oe&&e.active&&e.taskSlug&&m!==N&&(d="",ye())},{immediate:!0}),z(()=>j.readyVersion.value,()=>{!e.active||!e.taskSlug||(E="",W=-1,d="",F="",ye({force:!0}))}),z(()=>j.getTaskDiffSyncVersion(e.taskSlug),()=>{!e.active||!e.taskSlug||(E="",W=-1,F="",d="",ye({force:!0}))}),{activeHunkIndex:S,baselineMetaText:ee,diffPayload:u,diffScope:i,error:O,fileSearch:R,filteredFiles:Z,getFilterButtonClass:xe,getFilterLabel:pe,getPatchLineClass:x,getRunStatusLabel:M,getStatusClass:ge,getStatusLabel:ve,jumpToAdjacentHunk:me,loadDiff:Ce,loading:T,normalizeFileStatus:ae,patchLoading:l,patchViewportRef:w,runs:b,selectedFile:ce,selectedFilePath:h,selectedPatchHunks:q,selectedPatchLines:re,selectedRunId:r,setPatchLineRef:C,showSummarySkeleton:fe,statsLoading:A,statusCounts:de,statusFilter:f,terminalRuns:ie,formatRunOptionLabel:K,refreshDiff:Xe}}const bt={class:"mb-3 grid grid-cols-2 gap-2"},wt=["onClick"],St={class:"theme-input-shell mb-3 flex items-center gap-2 rounded-sm border px-3 py-2 text-xs text-[var(--theme-textMuted)]"},Rt=["placeholder"],Ft={key:0,class:"theme-empty-state theme-empty-state-strong mb-3 px-3 py-2 text-[11px]"},Ct={key:1,class:"theme-empty-state px-3 py-4 text-xs"},Lt={key:2,class:"theme-empty-state px-3 py-4 text-xs"},Pt={key:3,class:"space-y-1"},$t=["onClick","onKeydown"],Tt={class:"min-w-0 flex-1"},_t={class:"theme-list-item-title break-all"},Ht={class:"theme-list-item-meta mt-1"},Oe={__name:"TaskDiffFileList",props:{diffPayload:{type:Object,default:null},fileSearch:{type:String,default:""},autoFocusSelected:{type:Boolean,default:!1},filteredFiles:{type:Array,default:()=>[]},focusToken:{type:Number,default:0},getFilterButtonClass:{type:Function,default:()=>""},getFilterLabel:{type:Function,default:e=>e},getStatusClass:{type:Function,default:()=>""},getStatusLabel:{type:Function,default:e=>e},selectedFilePath:{type:String,default:""},showSummarySkeleton:{type:Boolean,default:!1},statusCounts:{type:Object,default:()=>({})},statusFilter:{type:String,default:"all"}},emits:["select-file","update:fileSearch","update:statusFilter"],setup(e,{emit:i}){const r=e,h=i,{t:f}=Re(),R=new Map,b=H(0),u=H(0),T=V({get:()=>r.fileSearch,set:p=>h("update:fileSearch",p)}),A=V({get:()=>r.statusFilter,set:p=>h("update:statusFilter",p)}),O=V(()=>{var p;return Array.isArray((p=r.diffPayload)==null?void 0:p.files)&&r.diffPayload.files.length>0});function l(p,n){if(n){R.set(p,n);return}R.delete(p)}function w(p){qe(()=>{var d,F;const n=R.get(p);(d=n==null?void 0:n.focus)==null||d.call(n),(F=n==null?void 0:n.scrollIntoView)==null||F.call(n,{block:"nearest",inline:"nearest"})})}function S(){!r.autoFocusSelected||!r.selectedFilePath||b.value===u.value||(u.value=b.value,w(r.selectedFilePath))}function L(p=1,n=""){const d=Array.isArray(r.filteredFiles)?r.filteredFiles:[];if(!d.length)return;const F=d.findIndex(G=>G.path===n),E=d.findIndex(G=>G.path===r.selectedFilePath),U=(Math.max(0,F>=0?F:E)+p+d.length)%d.length,B=d[U];B!=null&&B.path&&(h("select-file",B.path),w(B.path))}function j(p,n){const d=String((p==null?void 0:p.key)||"");if(d==="ArrowDown"){p.preventDefault(),L(1,n);return}if(d==="ArrowUp"){p.preventDefault(),L(-1,n);return}(d==="Enter"||d===" ")&&n&&(p.preventDefault(),h("select-file",n))}return z(()=>r.focusToken,p=>{b.value=p,S()},{immediate:!0}),z(()=>r.selectedFilePath,()=>{S()}),(p,n)=>(g(),y(ne,null,[a("div",bt,[(g(),y(ne,null,Se(["all","A","M","D"],d=>a("button",{key:d,type:"button",class:D(["inline-flex w-full items-center justify-center gap-1 whitespace-nowrap rounded-sm border px-2 py-1 text-[11px] transition",e.getFilterButtonClass(d)]),onClick:F=>A.value=d},c(e.getFilterLabel(d))+" "+c(e.statusCounts[d]||0),11,wt)),64))]),a("label",St,[$(t(ht),{class:"h-3.5 w-3.5 shrink-0"}),De(a("input",{"onUpdate:modelValue":n[0]||(n[0]=d=>T.value=d),type:"text",placeholder:t(f)("diffReview.searchFilePath"),class:"min-w-0 flex-1 bg-transparent text-xs text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]"},null,8,Rt),[[ct,T.value]])]),e.showSummarySkeleton?(g(),y("div",Ft,c(t(f)("diffReview.statsPending")),1)):J("",!0),O.value?e.filteredFiles.length?(g(),y("div",Pt,[(g(!0),y(ne,null,Se(e.filteredFiles,d=>(g(),y("button",{key:d.path,ref_for:!0,ref:F=>l(d.path,F),type:"button",class:D(["theme-list-row focus:outline-none",d.path===e.selectedFilePath?"theme-list-item-active":"theme-list-item-hover"]),onClick:F=>h("select-file",d.path),onKeydown:F=>j(F,d.path)},[a("span",{class:D(["theme-list-item-badge",e.getStatusClass(d.status)])},c(e.getStatusLabel(d.status)),3),a("div",Tt,[a("div",_t,c(d.path),1),a("div",Ht,c(d.statsLoaded?`+${d.additions} / -${d.deletions}`:t(f)("diffReview.statsOnDemand")),1)])],42,$t))),128))])):(g(),y("div",Lt,c(t(f)("diffReview.noMatches")),1)):(g(),y("div",Ct,c(t(f)("diffReview.noChanges")),1))],64))}},Dt={key:0,class:"flex h-full min-h-0 flex-col overflow-hidden"},It={class:"theme-divider theme-secondary-text border-b px-4 py-3 text-xs"},At={class:"space-y-3 sm:hidden"},jt={class:"flex items-start gap-2"},Mt={class:"min-w-0 break-all font-medium text-[var(--theme-textPrimary)]"},Nt={class:"flex items-center justify-between gap-3"},Bt={class:"opacity-75"},Vt=["disabled"],zt={class:"min-w-[64px] text-center text-[11px] text-[var(--theme-textSecondary)]"},Et=["disabled"],Wt={class:"hidden items-center gap-3 sm:flex"},Ot={class:"flex min-w-0 flex-1 flex-wrap items-center gap-2"},Ut={class:"break-all font-medium text-[var(--theme-textPrimary)]"},Gt={class:"opacity-75"},qt=["disabled"],Kt={class:"min-w-[64px] text-center text-[11px] text-[var(--theme-textSecondary)]"},Jt=["disabled"],Qt={key:0,class:"theme-secondary-text flex-1 overflow-y-auto px-4 py-4 text-sm"},Xt={class:"theme-empty-state px-4 py-4"},Yt={key:1,class:"theme-muted-text flex-1 overflow-y-auto px-4 py-4 text-sm"},Zt={class:"min-w-max px-4 py-4 font-mono text-[11px] leading-5"},es={class:"task-diff-row__number select-none"},ts={class:"task-diff-row__number select-none"},ss=["innerHTML"],as={key:3,class:"theme-secondary-text flex-1 overflow-y-auto px-4 py-4 text-sm"},ns={class:"theme-empty-state px-4 py-4"},is={key:1,class:"theme-muted-text flex h-full items-center justify-center px-5 text-sm"},ls={__name:"TaskDiffPatchView",props:{activeHunkIndex:{type:Number,default:0},getPatchLineClass:{type:Function,default:()=>""},getStatusClass:{type:Function,default:()=>""},getStatusLabel:{type:Function,default:e=>e},jumpToAdjacentHunk:{type:Function,default:()=>{}},patchLoading:{type:Boolean,default:!1},selectedFile:{type:Object,default:null},selectedPatchHunks:{type:Array,default:()=>[]},selectedPatchLines:{type:Array,default:()=>[]},setPatchLineRef:{type:Function,default:()=>{}},setPatchViewportRef:{type:Function,default:()=>{}}},setup(e){const i=e,{t:r}=Re(),{isDark:h}=tt(),f=H([]),R=V(()=>{var l;return ot(((l=i.selectedFile)==null?void 0:l.path)||"")});function b(l){return(l==null?void 0:l.kind)==="add"?"+":(l==null?void 0:l.kind)==="delete"?"-":(l==null?void 0:l.kind)==="context"?" ":""}function u(l){const w=String((l==null?void 0:l.content)||"");return(l==null?void 0:l.kind)==="add"||(l==null?void 0:l.kind)==="delete"||(l==null?void 0:l.kind)==="context"?w.slice(1):w}function T(l=""){return String(l||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function A(l,w=""){if((l==null?void 0:l.kind)==="add"||(l==null?void 0:l.kind)==="delete"||(l==null?void 0:l.kind)==="context"){const S=b(l),L=`task-diff-line__prefix--${l.kind}`;return{...l,renderedHtml:`<span class="task-diff-line__prefix ${L}">${T(S||" ")}</span><span class="task-diff-line__body">${w||"​"}</span>`}}return{...l,renderedHtml:T(String((l==null?void 0:l.content)||""))}}async function O(){const l=Array.isArray(i.selectedPatchLines)?i.selectedPatchLines:[],w=[];l.forEach((n,d)=>{((n==null?void 0:n.kind)==="add"||(n==null?void 0:n.kind)==="delete"||(n==null?void 0:n.kind)==="context")&&w.push({lineIndex:d,body:u(n)})});const S=nt(w.map(n=>n.body));let L=0;if(f.value=l.map(n=>{if((n==null?void 0:n.kind)==="add"||(n==null?void 0:n.kind)==="delete"||(n==null?void 0:n.kind)==="context"){const d=S[L]||"​";return L+=1,A(n,d)}return A(n)}),!w.length||it(w.map(n=>n.body),Te))return;const j=await lt(w.map(n=>n.body),{isDark:h.value,language:R.value,maxHighlightLines:Te.maxLines,maxHighlightChars:Te.maxChars});let p=0;f.value=l.map(n=>{if((n==null?void 0:n.kind)==="add"||(n==null?void 0:n.kind)==="delete"||(n==null?void 0:n.kind)==="context"){const d=j[p]||"​";return p+=1,A(n,d)}return A(n)})}return z(()=>{var l;return[i.selectedPatchLines,(l=i.selectedFile)==null?void 0:l.path,h.value]},()=>{O()},{immediate:!0,deep:!0}),(l,w)=>e.selectedFile?(g(),y("div",Dt,[a("div",It,[a("div",At,[a("div",jt,[a("span",{class:D(["inline-flex shrink-0 rounded-sm border px-1.5 py-0.5 text-[10px]",e.getStatusClass(e.selectedFile.status)])},c(e.getStatusLabel(e.selectedFile.status)),3),a("span",Mt,c(e.selectedFile.path),1)]),a("div",Nt,[a("span",Bt,c(e.selectedFile.statsLoaded?`+${e.selectedFile.additions} / -${e.selectedFile.deletions}`:t(r)("diffReview.statsOnDemand")),1),a("div",{class:D(["inline-flex h-8 shrink-0 items-center gap-1 rounded-sm border px-1.5 py-1",e.selectedPatchHunks.length?"theme-inline-panel":"pointer-events-none invisible border-transparent"])},[a("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex<=0,onClick:w[0]||(w[0]=S=>e.jumpToAdjacentHunk(-1))},[$(t(Ne),{class:"h-4 w-4"})],8,Vt),a("span",zt,c(t(r)("diffReview.changeIndex",{current:Math.min(e.activeHunkIndex+1,e.selectedPatchHunks.length),total:e.selectedPatchHunks.length})),1),a("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex>=e.selectedPatchHunks.length-1,onClick:w[1]||(w[1]=S=>e.jumpToAdjacentHunk(1))},[$(t(Be),{class:"h-4 w-4"})],8,Et)],2)])]),a("div",Wt,[a("div",Ot,[a("span",{class:D(["inline-flex rounded-sm border px-1.5 py-0.5 text-[10px]",e.getStatusClass(e.selectedFile.status)])},c(e.getStatusLabel(e.selectedFile.status)),3),a("span",Ut,c(e.selectedFile.path),1),a("span",Gt,c(e.selectedFile.statsLoaded?`+${e.selectedFile.additions} / -${e.selectedFile.deletions}`:t(r)("diffReview.statsOnDemand")),1)]),a("div",{class:D(["inline-flex h-8 w-[132px] shrink-0 items-center gap-1 rounded-sm border px-1.5 py-1",e.selectedPatchHunks.length?"theme-inline-panel":"pointer-events-none invisible border-transparent"])},[a("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex<=0,onClick:w[2]||(w[2]=S=>e.jumpToAdjacentHunk(-1))},[$(t(Ne),{class:"h-4 w-4"})],8,qt),a("span",Kt,c(t(r)("diffReview.changeIndex",{current:Math.min(e.activeHunkIndex+1,e.selectedPatchHunks.length),total:e.selectedPatchHunks.length})),1),a("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex>=e.selectedPatchHunks.length-1,onClick:w[3]||(w[3]=S=>e.jumpToAdjacentHunk(1))},[$(t(Be),{class:"h-4 w-4"})],8,Jt)],2)])]),e.selectedFile.message?(g(),y("div",Qt,[a("div",Xt,c(e.selectedFile.message),1)])):e.patchLoading&&!e.selectedFile.patchLoaded?(g(),y("div",Yt,c(t(r)("diffReview.loadingFileDiff")),1)):e.selectedPatchLines.length?(g(),y("div",{key:2,ref:e.setPatchViewportRef,class:"flex-1 overflow-auto"},[a("div",Zt,[(g(!0),y(ne,null,Se(f.value,S=>{var L;return g(),y("div",{key:S.id,ref_for:!0,ref:j=>e.setPatchLineRef(S.id,j),class:D(["task-diff-row grid",[e.getPatchLineClass(S.kind),S.kind==="hunk"&&((L=e.selectedPatchHunks[e.activeHunkIndex])==null?void 0:L.id)===S.id?"ring-1 ring-inset ring-[var(--theme-warning)]":""]])},[a("span",es,c(S.oldNumber),1),a("span",ts,c(S.newNumber),1),a("pre",{class:D(["task-diff-line overflow-visible whitespace-pre px-3 py-0.5",S.kind==="meta"||S.kind==="hunk"?"task-diff-line--plain":""]),innerHTML:S.renderedHtml},null,10,ss)],2)}),128))])],512)):(g(),y("div",as,[a("div",ns,c(t(r)("diffReview.noFileDiffContent")),1)]))])):(g(),y("div",is,c(t(r)("diffReview.selectFile")),1))}},Ue=et(ls,[["__scopeId","data-v-1a81fddc"]]),os={class:"panel flex h-full min-h-0 flex-col overflow-hidden"},rs={class:"theme-divider border-b px-4 py-3"},us={class:"flex flex-col gap-2"},ds={class:"grid grid-cols-4 gap-2 sm:flex sm:flex-wrap sm:items-center"},cs={class:"sm:hidden"},fs={class:"hidden sm:inline"},hs={class:"sm:hidden"},ms={class:"hidden sm:inline"},vs=["disabled"],gs={class:"sm:hidden"},ps={class:"hidden sm:inline"},xs={class:"truncate text-xs text-[var(--theme-textPrimary)]"},ks={class:"theme-divider theme-muted-text border-b border-dashed px-3 py-2 text-[11px]"},ys=["onClick"],bs={class:"flex items-start gap-3"},ws={class:"min-w-0 flex-1"},Ss={class:"truncate text-xs font-medium text-[var(--theme-textPrimary)]"},Rs={class:"theme-muted-text mt-1 text-[11px]"},Fs={key:0,class:"theme-divider theme-danger-text border-b px-4 py-3 text-sm"},Cs={class:"inline-flex items-start gap-2"},Ls={class:"break-all"},Ps={key:1,class:"theme-muted-text flex flex-1 items-center justify-center px-5 text-sm"},$s={key:2,class:"flex flex-1 items-center justify-center px-5"},Ts={class:"theme-empty-state w-full max-w-xl px-4 py-5 text-sm text-[var(--theme-textSecondary)]"},_s={class:"theme-heading inline-flex items-center gap-2 font-medium"},Hs={class:"mt-2 break-all leading-7"},Ds={key:0,class:"mt-3 flex flex-wrap gap-2 text-xs"},Is={class:"theme-status-neutral inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},As={class:"break-all"},js={key:0,class:"theme-status-success inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},Ms={key:3,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ns={class:"theme-divider theme-secondary-text border-b px-4 py-3 text-xs"},Bs={class:"flex flex-wrap items-center gap-2"},Vs={key:0,class:"theme-status-info inline-flex min-w-0 items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},zs={class:"min-w-0 break-all"},Es={class:"theme-status-success inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},Ws={class:"text-[var(--theme-textPrimary)]"},Os={class:"font-medium text-[var(--theme-success)]"},Us={class:"font-medium text-[var(--theme-danger)]"},Gs={key:2,class:"opacity-75"},qs={key:0,class:"mt-2 break-all text-[11px] opacity-75"},Ks={key:1,class:"mt-2 flex flex-col gap-1"},Js={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Qs={class:"theme-divider border-b px-3 py-3"},Xs={class:"grid grid-cols-2 gap-2"},Ys=["disabled"],Zs={class:"theme-divider theme-muted-panel min-h-0 flex-1 overflow-y-auto p-3"},ea={class:"min-h-0 flex-1 overflow-hidden bg-[var(--theme-appPanelStrong)]"},ta={key:1,class:"grid min-h-0 flex-1 grid-cols-[320px_minmax(0,1fr)] overflow-hidden"},sa={class:"theme-divider theme-muted-panel min-h-0 overflow-y-auto border-r p-3"},aa={class:"min-h-0 overflow-hidden bg-[var(--theme-appPanelStrong)]"},na={__name:"TaskDiffReviewPanel",props:{taskSlug:{type:String,default:""},preferredScope:{type:String,default:"workspace"},preferredRunId:{type:String,default:""},focusToken:{type:Number,default:0},active:{type:Boolean,default:!1}},setup(e){const i=e,{activeHunkIndex:r,baselineMetaText:h,diffPayload:f,diffScope:R,error:b,fileSearch:u,filteredFiles:T,formatRunOptionLabel:A,getFilterButtonClass:O,getFilterLabel:l,getPatchLineClass:w,getRunStatusLabel:S,getStatusClass:L,getStatusLabel:j,jumpToAdjacentHunk:p,loading:n,patchLoading:d,patchViewportRef:F,refreshDiff:E,selectedFile:W,selectedFilePath:U,selectedPatchHunks:B,selectedPatchLines:G,selectedRunId:ie,setPatchLineRef:de,showSummarySkeleton:Z,statsLoading:ce,statusCounts:re,statusFilter:q,terminalRuns:fe}=yt(i),{matches:ee}=rt("(max-width: 767px)"),M=H("files"),{t:C}=Re();function he(K){U.value=K,ee.value&&(M.value="patch")}function me(K){F.value=K||null}return z(ee,K=>{K||(M.value="files")},{immediate:!0}),z(U,K=>{!K&&ee.value&&(M.value="files")}),z(R,()=>{ee.value&&(M.value="files")}),(K,v)=>{var te,ve,ge,pe,xe;return g(),y("section",os,[a("div",rs,[a("div",us,[a("div",ds,[a("button",{type:"button",class:D(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",t(R)==="workspace"?"theme-filter-active":""]),onClick:v[0]||(v[0]=x=>R.value="workspace")},[a("span",cs,c(t(C)("diffReview.scopeCurrentShort")),1),a("span",fs,c(t(C)("diffReview.scopeCurrent")),1)],2),a("button",{type:"button",class:D(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",t(R)==="task"?"theme-filter-active":""]),onClick:v[1]||(v[1]=x=>R.value="task")},[a("span",hs,c(t(C)("diffReview.scopeTaskShort")),1),a("span",ms,c(t(C)("diffReview.scopeTask")),1)],2),a("button",{type:"button",class:D(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",t(R)==="run"?"theme-filter-active":""]),onClick:v[2]||(v[2]=x=>R.value="run")},[a("span",null,c(t(C)("diffReview.scopeRun")),1)],2),a("button",{type:"button",class:"tool-button tool-button-info-subtle inline-flex shrink-0 items-center justify-center gap-2 px-3 py-2 text-xs",disabled:t(n),onClick:v[3]||(v[3]=(...x)=>t(E)&&t(E)(...x))},[$(t(Ve),{class:D(["h-3.5 w-3.5 sm:hidden",t(n)?"animate-spin":""])},null,8,["class"]),a("span",gs,c(t(C)("diffReview.refresh")),1),$(t(Ve),{class:D(["hidden h-3.5 w-3.5 sm:inline-block",t(n)?"animate-spin":""])},null,8,["class"]),a("span",ps,c(t(n)?t(C)("diffReview.refreshing"):t(ce)?t(C)("diffReview.computing"):t(C)("diffReview.refresh")),1)],8,vs)]),t(R)==="run"?(g(),Ie(ut,{key:0,modelValue:t(ie),"onUpdate:modelValue":v[4]||(v[4]=x=>ft(ie)?ie.value=x:null),class:"min-w-0 sm:max-w-[360px]",options:t(fe),loading:t(n),"get-option-value":x=>(x==null?void 0:x.id)||"",placeholder:t(C)("diffReview.selectRun"),"empty-text":t(C)("diffReview.noRuns")},{trigger:ue(({selectedOption:x})=>[a("div",xs,c(x?t(A)(x):t(C)("diffReview.selectRun")),1)]),header:ue(()=>[a("div",ks,c(t(C)("diffReview.runCount",{count:t(fe).length})),1)]),option:ue(({option:x,selected:le,select:Fe})=>[a("button",{type:"button",class:D(["w-full rounded-sm border border-dashed px-3 py-2 text-left transition",le?"theme-filter-active":"theme-filter-idle"]),onClick:Fe},[a("div",bs,[a("div",ws,[a("div",Ss,c(t(Ge)(x.startedAt||x.createdAt)),1),a("div",Rs,c(t(S)(x)),1)]),le?(g(),Ie(t(mt),{key:0,class:"mt-0.5 h-4 w-4 shrink-0 text-[var(--theme-textSecondary)]"})):J("",!0)])],10,ys)]),_:1},8,["modelValue","options","loading","get-option-value","placeholder","empty-text"])):J("",!0)])]),t(b)?(g(),y("div",Fs,[a("div",Cs,[$(t(vt),{class:"mt-0.5 h-4 w-4 shrink-0"}),a("span",Ls,c(t(b)),1)])])):J("",!0),t(n)&&!t(f)?(g(),y("div",Ps,c(t(C)("diffReview.loading")),1)):t(f)&&!t(f).supported?(g(),y("div",$s,[a("div",Ts,[a("div",_s,[$(t(Ke),{class:"h-4 w-4"}),a("span",null,c(t(C)("diffReview.unavailableTitle")),1)]),a("p",Hs,c(t(f).reason||t(C)("diffReview.unavailableReason")),1),t(f).repoRoot?(g(),y("div",Ds,[a("div",Is,[$(t(ze),{class:"h-3.5 w-3.5 shrink-0"}),a("span",As,c(t(f).repoRoot),1)]),t(f).branch?(g(),y("div",js,[$(t(Ee),{class:"h-3.5 w-3.5 shrink-0"}),a("span",null,c(t(f).branch),1)])):J("",!0)])):J("",!0)])])):t(f)?(g(),y("div",Ms,[a("div",Ns,[a("div",Bs,[t(f).repoRoot?(g(),y("div",Vs,[$(t(ze),{class:"h-3.5 w-3.5 shrink-0"}),a("span",zs,c(t(f).repoRoot),1)])):J("",!0),a("div",Es,[$(t(Ee),{class:"h-3.5 w-3.5 shrink-0"}),a("span",null,c(t(f).branch||t(C)("diffReview.unknownBranch")),1),v[16]||(v[16]=a("span",{class:"opacity-50"},"•",-1)),a("span",Ws,c(t(C)("diffReview.fileCount",{count:((te=t(f).summary)==null?void 0:te.fileCount)||0})),1),(ve=t(f).summary)!=null&&ve.statsComplete?(g(),y(ne,{key:0},[v[12]||(v[12]=a("span",{class:"opacity-50"},"•",-1)),a("span",Os,"+"+c(((ge=t(f).summary)==null?void 0:ge.additions)||0),1),a("span",Us,"-"+c(((pe=t(f).summary)==null?void 0:pe.deletions)||0),1)],64)):t(Z)?(g(),y(ne,{key:1},[v[13]||(v[13]=a("span",{class:"opacity-50"},"•",-1)),v[14]||(v[14]=a("span",{class:"h-3 w-10 animate-pulse rounded bg-[var(--theme-successSoft)]"},null,-1)),v[15]||(v[15]=a("span",{class:"h-3 w-10 animate-pulse rounded bg-[var(--theme-dangerSoft)]"},null,-1))],64)):(g(),y("span",Gs,c(t(C)("diffReview.waitingStats")),1))])]),t(h)?(g(),y("p",qs,c(t(h)),1)):J("",!0),(xe=t(f).warnings)!=null&&xe.length?(g(),y("div",Ks,[(g(!0),y(ne,null,Se(t(f).warnings,x=>(g(),y("p",{key:x,class:"text-[11px] text-[var(--theme-warningText)]"},c(x),1))),128))])):J("",!0)]),t(ee)?(g(),y("div",Js,[a("div",Qs,[a("div",Xs,[a("button",{type:"button",class:D(["tool-button px-3 py-2 text-sm",M.value==="files"?"tool-button-accent-subtle":""]),onClick:v[5]||(v[5]=x=>M.value="files")},c(t(C)("diffReview.filesTab")),3),a("button",{type:"button",class:D(["tool-button px-3 py-2 text-sm",M.value==="patch"?"tool-button-accent-subtle":""]),disabled:!t(W),onClick:v[6]||(v[6]=x=>M.value="patch")},c(t(C)("diffReview.diffTab")),11,Ys)])]),De(a("div",Zs,[$(Oe,{"auto-focus-selected":e.active&&M.value==="files","diff-payload":t(f),"file-search":t(u),"focus-token":e.focusToken,"filtered-files":t(T),"get-filter-button-class":t(O),"get-filter-label":t(l),"get-status-class":t(L),"get-status-label":t(j),"selected-file-path":t(U),"show-summary-skeleton":t(Z),"status-counts":t(re),"status-filter":t(q),"onUpdate:fileSearch":v[7]||(v[7]=x=>u.value=x),"onUpdate:statusFilter":v[8]||(v[8]=x=>q.value=x),onSelectFile:he},null,8,["auto-focus-selected","diff-payload","file-search","focus-token","filtered-files","get-filter-button-class","get-filter-label","get-status-class","get-status-label","selected-file-path","show-summary-skeleton","status-counts","status-filter"])],512),[[Me,M.value==="files"]]),De(a("div",ea,[$(Ue,{"active-hunk-index":t(r),"get-patch-line-class":t(w),"get-status-class":t(L),"get-status-label":t(j),"jump-to-adjacent-hunk":t(p),"patch-loading":t(d),"selected-file":t(W),"selected-patch-hunks":t(B),"selected-patch-lines":t(G),"set-patch-line-ref":t(de),"set-patch-viewport-ref":me},null,8,["active-hunk-index","get-patch-line-class","get-status-class","get-status-label","jump-to-adjacent-hunk","patch-loading","selected-file","selected-patch-hunks","selected-patch-lines","set-patch-line-ref"])],512),[[Me,M.value==="patch"]])])):(g(),y("div",ta,[a("div",sa,[$(Oe,{"auto-focus-selected":e.active,"diff-payload":t(f),"file-search":t(u),"focus-token":e.focusToken,"filtered-files":t(T),"get-filter-button-class":t(O),"get-filter-label":t(l),"get-status-class":t(L),"get-status-label":t(j),"selected-file-path":t(U),"show-summary-skeleton":t(Z),"status-counts":t(re),"status-filter":t(q),"onUpdate:fileSearch":v[9]||(v[9]=x=>u.value=x),"onUpdate:statusFilter":v[10]||(v[10]=x=>q.value=x),onSelectFile:v[11]||(v[11]=x=>U.value=x)},null,8,["auto-focus-selected","diff-payload","file-search","focus-token","filtered-files","get-filter-button-class","get-filter-label","get-status-class","get-status-label","selected-file-path","show-summary-skeleton","status-counts","status-filter"])]),a("div",aa,[$(Ue,{"active-hunk-index":t(r),"get-patch-line-class":t(w),"get-status-class":t(L),"get-status-label":t(j),"jump-to-adjacent-hunk":t(p),"patch-loading":t(d),"selected-file":t(W),"selected-patch-hunks":t(B),"selected-patch-lines":t(G),"set-patch-line-ref":t(de),"set-patch-viewport-ref":me},null,8,["active-hunk-index","get-patch-line-class","get-status-class","get-status-label","jump-to-adjacent-hunk","patch-loading","selected-file","selected-patch-hunks","selected-patch-lines","set-patch-line-ref"])])]))])):J("",!0)])}}},ia={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ha={__name:"TaskDiffReviewDialog",props:{open:{type:Boolean,default:!1},taskSlug:{type:String,default:""},taskTitle:{type:String,default:""},preferredScope:{type:String,default:"task"},preferredRunId:{type:String,default:""},focusToken:{type:Number,default:0}},emits:["close"],setup(e,{emit:i}){const r=e,h=i,{t:f}=Re(),R=V(()=>{const b=String(r.taskTitle||"").trim();return b?f("diffReview.dialogTitleWithTask",{title:b}):f("diffReview.dialogTitle")});return(b,u)=>(g(),Ie(dt,{open:e.open,"stack-level":2,"panel-class":"settings-dialog-panel h-full sm:h-[90vh] sm:w-[90vw] sm:max-w-[90vw]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body min-h-0 flex-1 overflow-hidden p-3 sm:p-4",onClose:u[0]||(u[0]=T=>h("close"))},{title:ue(()=>[a("div",ia,[$(t(Ke),{class:"h-4 w-4"}),a("span",null,c(R.value),1)])]),default:ue(()=>[$(na,{"task-slug":e.taskSlug,active:e.open,"preferred-scope":e.preferredScope,"preferred-run-id":e.preferredRunId,"focus-token":e.focusToken},null,8,["task-slug","active","preferred-scope","preferred-run-id","focus-token"])]),_:1},8,["open"]))}};export{ha as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aD as l,aE as r,aF as e,aQ as a,u as i,aR as O,aS as z,aL as Xe,aV as Tt,aI as $,aN as h,c as v,w as Ke,ak as Rt,aJ as ue,aG as L,aW as ne,aY as St,aX as pe,b2 as Pt,b as m,r as ye}from"./vendor-misc-DxKJ95A9.js";import{d as K,f as Et,_ as Mt,c as $t,h as Ut}from"./WorkbenchView-D0SJDU9Q.js";import{u as Ye,b as Bt,f as Nt}from"./index-CsDHhm4n.js";import{b as jt,D as We,E as Lt,g as Ft,L as me,H as Je,K as Ge,t as It,J as qt,x as Vt}from"./vendor-ui-DTqxu3Qf.js";import"./vendor-markdown-BENmzbO1.js";import"./vendor-tiptap-COqMdKic.js";import"./vendor-router-iukOUtEP.js";function At(){return K("/api/relay/config",{cache:"no-store"})}function Qe(U){return K("/api/relay/config",{method:"PUT",body:JSON.stringify(U)})}function Ht(){return K("/api/relay/reconnect",{method:"POST"})}function Ot(){return K("/api/system/config",{cache:"no-store"})}function zt(U){return K("/api/system/config",{method:"PUT",body:JSON.stringify(U)})}function Kt(){return K("/api/diagnostics/runtime",{cache:"no-store"})}const Wt={class:"space-y-4"},Jt={class:"flex items-center justify-between gap-3"},Gt={class:"theme-heading text-sm font-medium"},Qt={class:"theme-toggle-current theme-badge-muted theme-muted-text rounded-sm border border-dashed px-2 py-1 text-[11px]"},Xt={class:"theme-muted-text theme-note-text mt-1"},Yt={class:"space-y-4"},Zt={class:"theme-muted-text px-1 text-[10px] font-medium uppercase tracking-[0.16em]"},es=["onClick"],ts={class:"flex items-start gap-3"},ss={class:"mt-0.5 flex items-center gap-1.5"},ns={class:"min-w-0 flex-1"},as={class:"flex items-center justify-between gap-2"},is={class:"truncate text-sm font-medium"},os={class:"theme-muted-text theme-note-text mt-1"},ls={__name:"ThemeToggle",setup(U){const{currentTheme:W,setTheme:J,themes:ae}=Bt(),{t:S}=Ye(),ge=v(()=>{const b=ae.value.filter(p=>p.mode==="light"),F=ae.value.filter(p=>p.mode==="dark");return[{id:"light",label:S("theme.groupLight"),items:b},{id:"dark",label:S("theme.groupDark"),items:F}].filter(p=>p.items.length)});function he(b){J(b)}function s(b){return S(`theme.description.${b.id}`,{},b.description)}return(b,F)=>(l(),r("div",Wt,[e("div",null,[e("div",Jt,[e("div",Gt,a(i(S)("theme.heading")),1),e("div",Qt,a(i(S)("theme.currentTheme",{name:i(W).shortName})),1)]),e("div",Xt,a(i(S)("theme.helper")),1)]),e("div",Yt,[(l(!0),r(O,null,z(ge.value,p=>(l(),r("section",{key:p.id,class:"space-y-1.5"},[e("div",Zt,a(p.label),1),(l(!0),r(O,null,z(p.items,x=>(l(),r("button",{key:x.id,type:"button",class:Xe(["theme-option theme-toggle-card w-full rounded-sm border px-3 py-2 text-left transition",x.id===i(W).id?"theme-option-active":"theme-option-idle"]),onClick:k=>he(x.id)},[e("div",ts,[e("div",ss,[(l(!0),r(O,null,z(x.swatches,(k,w)=>(l(),r("span",{key:`${x.id}-${w}`,class:"h-3 w-3 rounded-full border border-black/10",style:Tt({backgroundColor:k})},null,4))),128))]),e("div",ns,[e("div",as,[e("span",is,a(x.shortName),1),x.id===i(W).id?(l(),$(i(jt),{key:0,class:"h-4 w-4 shrink-0"})):h("",!0)]),e("div",os,a(s(x)),1)])])],10,es))),128))]))),128))])]))}},rs={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},cs={class:"settings-dialog-content min-h-0 flex-1 overflow-y-auto px-5 py-5"},ds={key:0,class:"space-y-4"},us={class:"theme-heading text-base font-medium"},ms={class:"theme-muted-text mt-1 text-xs leading-5"},gs={class:"settings-section-card px-4 py-4"},hs={class:"settings-section-card space-y-4 px-4 py-4"},vs={class:"theme-heading text-sm font-medium"},xs={class:"theme-muted-text mt-1 text-xs leading-5"},ps={class:"block space-y-1.5"},ys={class:"theme-muted-text text-xs"},_s={class:"truncate text-sm text-[var(--theme-textPrimary)]"},fs=["onClick"],bs={class:"flex items-center justify-between gap-3"},Ds={class:"min-w-0"},ks={class:"truncate text-[var(--theme-textPrimary)]"},ws={class:"theme-muted-text mt-1 truncate text-xs"},Cs={key:0,class:"theme-status-success rounded-sm border border-dashed px-2 py-0.5 text-[10px]"},Ts={class:"theme-muted-text theme-note-text"},Rs={key:1,class:"space-y-4"},Ss={class:"flex items-start justify-between gap-3"},Ps={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Es={class:"settings-section-card space-y-4 px-4 py-4"},Ms={class:"settings-form-card flex items-center justify-between gap-3 px-3 py-2"},$s={class:"text-sm font-medium text-[var(--theme-textPrimary)]"},Us={class:"theme-muted-text mt-1 text-xs"},Bs=["disabled"],Ns={class:"grid gap-4 sm:grid-cols-2"},js={class:"space-y-1.5 sm:col-span-2"},Ls={class:"theme-muted-text text-xs"},Fs=["disabled"],Is={class:"space-y-1.5"},qs={class:"theme-muted-text text-xs"},Vs=["disabled"],As={class:"space-y-1.5"},Hs={class:"theme-muted-text text-xs"},Os={class:"relative"},zs=["type","placeholder","disabled"],Ks=["disabled"],Ws={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},Js={class:"min-w-0 space-y-1"},Gs={key:0,class:"theme-danger-text theme-note-text"},Qs={key:1,class:"theme-status-warning theme-note-text"},Xs={key:2,class:"theme-danger-text theme-note-text"},Ys={key:3,class:"theme-status-success theme-note-text"},Zs={key:4,class:"theme-danger-text theme-note-text"},en={key:5,class:"theme-muted-text theme-note-text"},tn={key:6,class:"theme-muted-text theme-note-text"},sn={key:7,class:"theme-muted-text theme-note-text"},nn={key:8,class:"theme-status-success theme-note-text"},an={key:9,class:"theme-muted-text theme-note-text"},on={class:"flex flex-wrap items-center gap-2"},ln=["disabled"],rn=["disabled"],cn=["disabled"],dn={key:2,class:"space-y-4"},un={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},mn={class:"theme-muted-text mt-1 text-xs leading-5"},gn={class:"settings-section-card space-y-4 px-4 py-4"},hn={class:"space-y-1.5"},vn={class:"theme-muted-text text-xs"},xn=["disabled"],pn={class:"theme-muted-text text-xs leading-5"},yn={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},_n={class:"min-w-0 space-y-1"},fn={key:0,class:"theme-status-warning theme-note-text"},bn={key:1,class:"theme-danger-text theme-note-text"},Dn={key:2,class:"theme-status-success theme-note-text"},kn={key:3,class:"theme-muted-text theme-note-text"},wn={class:"flex flex-wrap items-center gap-2"},Cn=["disabled"],Tn={class:"settings-section-card space-y-4 px-4 py-4"},Rn={class:"flex flex-wrap items-start justify-between gap-3"},Sn={class:"theme-heading text-sm font-medium"},Pn={class:"theme-muted-text mt-1 text-xs leading-5"},En={class:"flex flex-wrap items-center gap-2"},Mn=["disabled"],$n={class:"min-w-0 space-y-1"},Un={key:0,class:"theme-danger-text theme-note-text"},Bn={key:1,class:"theme-status-success theme-note-text"},Nn={key:2,class:"theme-muted-text theme-note-text"},jn={key:0,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Ln={class:"settings-form-card space-y-1 px-3 py-3"},Fn={class:"theme-heading text-lg font-medium"},In={class:"theme-muted-text text-xs"},qn={class:"settings-form-card space-y-1 px-3 py-3"},Vn={class:"theme-heading text-lg font-medium"},An={class:"theme-muted-text text-xs"},Hn={class:"settings-form-card space-y-1 px-3 py-3"},On={class:"theme-heading text-lg font-medium"},zn={class:"theme-muted-text text-xs"},Kn={class:"settings-form-card space-y-1 px-3 py-3"},Wn={class:"theme-heading text-lg font-medium"},Jn={class:"theme-muted-text text-xs"},Gn={key:1,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Qn={class:"settings-form-card space-y-1 px-3 py-3"},Xn={class:"theme-heading text-lg font-medium"},Yn={class:"theme-muted-text text-xs"},Zn={class:"settings-form-card space-y-1 px-3 py-3"},ea={class:"theme-heading text-lg font-medium"},ta={class:"theme-muted-text text-xs"},sa={class:"settings-form-card space-y-1 px-3 py-3"},na={class:"theme-heading text-lg font-medium"},aa={class:"theme-muted-text text-xs"},ia={class:"settings-form-card space-y-1 px-3 py-3"},oa={class:"theme-heading text-lg font-medium"},la={class:"theme-muted-text text-xs"},ra={key:2,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3"},ca={class:"settings-form-card space-y-1 px-3 py-3"},da={class:"theme-heading text-lg font-medium"},ua={class:"theme-muted-text text-xs"},ma={class:"settings-form-card space-y-1 px-3 py-3"},ga={class:"theme-heading text-lg font-medium"},ha={class:"theme-muted-text text-xs"},va={class:"settings-form-card space-y-1 px-3 py-3"},xa={class:"theme-heading text-sm font-medium"},pa={class:"theme-muted-text text-xs"},ya={class:"grid gap-4 lg:grid-cols-2"},_a={class:"settings-form-card space-y-3 px-3 py-3"},fa={class:"theme-heading text-sm font-medium"},ba={class:"space-y-2 text-xs"},Da={class:"flex items-center justify-between gap-3"},ka={class:"truncate text-right text-[var(--theme-textPrimary)]"},wa={class:"flex items-center justify-between gap-3"},Ca={class:"text-right text-[var(--theme-textPrimary)]"},Ta={class:"flex items-center justify-between gap-3"},Ra={class:"text-right text-[var(--theme-textPrimary)]"},Sa={class:"flex items-center justify-between gap-3"},Pa={class:"text-right text-[var(--theme-textPrimary)]"},Ea={class:"flex items-center justify-between gap-3"},Ma={class:"text-right text-[var(--theme-textPrimary)]"},$a={class:"settings-form-card space-y-3 px-3 py-3"},Ua={class:"theme-heading text-sm font-medium"},Ba={class:"space-y-2 text-xs"},Na={class:"theme-muted-text"},ja={class:"text-[var(--theme-textPrimary)]"},La={key:3,class:"settings-form-card space-y-3 px-3 py-3"},Fa={class:"theme-heading text-sm font-medium"},Ia={class:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3 text-xs"},qa={class:"theme-muted-text"},Va={class:"text-[var(--theme-textPrimary)]"},Aa={key:4,class:"settings-form-card space-y-2 px-3 py-3"},Ha={class:"theme-heading text-sm font-medium"},Oa={class:"theme-muted-text text-xs leading-5"},za={class:"theme-muted-text text-xs leading-5"},Ka={key:3,class:"space-y-4"},Wa={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Ja={class:"theme-muted-text mt-1 text-xs leading-5"},Ga={class:"settings-section-card space-y-3 px-4 py-4"},Qa={class:"min-w-0"},Xa={class:"text-sm font-medium text-[var(--theme-textPrimary)]"},Ya={class:"theme-muted-text mt-1 text-xs leading-5"},Za={class:"flex flex-wrap items-center gap-2"},ei={class:"rounded-sm border border-dashed border-[var(--theme-borderDefault)] px-2.5 py-1 text-xs font-medium text-[var(--theme-textPrimary)]"},ti={class:"rounded-sm border border-dashed border-[var(--theme-borderDefault)] px-2.5 py-1 text-xs font-medium text-[var(--theme-textPrimary)]"},si={class:"theme-muted-text theme-note-text"},ni={key:4,class:"space-y-4"},ai={class:"theme-heading text-base font-medium"},ii={class:"theme-muted-text mt-1 text-xs leading-5"},oi={class:"settings-section-card px-4 py-4"},li={class:"flex items-center justify-between gap-3"},ri={class:"theme-heading text-sm font-medium"},ci={class:"theme-muted-text mt-1 text-xs leading-5"},di={class:"theme-badge-strong rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium"},_i={__name:"WorkbenchSettingsDialog",props:{open:{type:Boolean,default:!1}},emits:["close"],setup(U,{emit:W}){const J=U,ae=W,{locale:S,localeOptions:ge,setLocale:he,t:s}=Ye(),b=m(""),F=m(!1),p=m(""),x=m(!1),k=m(!1),w=m(!1),_=m(""),C=m(""),ie=m(!1),I=m(!1),q=m(""),G=m(""),V=m(!1),Q=m(""),T=m(null),u=m(null),f=m(!1),A=ye({runnerMaxConcurrentRuns:!1}),X=m(!1),oe=m(!1),le=m(!1),re=m(!1),c=ye({enabled:!1,relayUrl:"",deviceId:"",deviceToken:""}),H=ye({runnerMaxConcurrentRuns:3}),R=m("theme");let B=null,N=null,ce=null;const Ze=v(()=>[{id:"theme",label:s("theme.title"),description:s("theme.sectionDescription"),icon:qt},{id:"relay",label:s("settingsDialog.relay.sectionLabel"),description:s("settingsDialog.relay.sectionDescription"),icon:We},{id:"system",label:s("settingsDialog.system.sectionLabel"),description:s("settingsDialog.system.sectionDescription"),icon:Je},{id:"shortcuts",label:s("settingsDialog.shortcuts.sectionLabel"),description:s("settingsDialog.shortcuts.sectionDescription"),icon:Ge},{id:"about",label:s("settingsDialog.about.sectionLabel"),description:s("settingsDialog.about.sectionDescription"),icon:Vt}]);function et(t=null,n=""){const o=String((t==null?void 0:t.messageKey)||"").trim();if(o){const g=s(o);if(g&&g!==o)return g}return String((t==null?void 0:t.message)||"").trim()||(n?s(n):"")}function de(t="",n=""){const o=String(t||"").trim();if(o){const g=`settingsDialog.relay.reason.${o}`,D=s(g);if(D!==g)return D}return String(n||"").trim()||s("common.notAvailable")}function tt(t=null){const n=String((t==null?void 0:t.type)||"").trim()||"unknown",o=`settingsDialog.relay.event.${n}`,g=s(o);return g!==o?g:n}function st(t=null){const n=String((t==null?void 0:t.lastErrorKey)||"").trim(),o=t!=null&&t.lastErrorParams&&typeof t.lastErrorParams=="object"?t.lastErrorParams:{};return n==="connect_failed"?s("settingsDialog.relay.error.connect_failed"):n==="disconnected"?s("settingsDialog.relay.error.disconnected",{reason:de(o.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="rejected"?s("settingsDialog.relay.error.rejected",{reason:de(o.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="closed_with_code"?s("settingsDialog.relay.error.closedWithCode",{code:o.code||(t==null?void 0:t.lastCloseCode)||0}):String((t==null?void 0:t.lastError)||"").trim()}const nt=v(()=>{var t,n,o,g;return w.value?s("settingsDialog.relay.status.reconnecting"):k.value||X.value?s("settingsDialog.relay.status.saving"):x.value?s("settingsDialog.relay.status.loading"):(t=u.value)!=null&&t.reconnectPaused?s("settingsDialog.relay.status.paused"):(n=u.value)!=null&&n.connected?s("settingsDialog.relay.status.connected"):(((o=u.value)==null?void 0:o.enabled)??c.enabled)&&Number(((g=u.value)==null?void 0:g.nextReconnectDelayMs)||0)>0?s("settingsDialog.relay.status.waitingReconnect"):c.enabled?s("settingsDialog.relay.status.disconnected"):s("settingsDialog.relay.status.disabled")}),at=v(()=>{var t,n;return(t=u.value)!=null&&t.reconnectPaused?"theme-status-danger":(n=u.value)!=null&&n.connected?"theme-status-success":c.enabled?"theme-status-warning":"theme-status-neutral"}),it=v(()=>[{id:"open-settings",label:s("settingsDialog.shortcuts.openSettingsTitle"),description:s("settingsDialog.shortcuts.openSettingsDescription"),mac:"⌘ ⇧ ,",windows:"Ctrl + Shift + ,"},{id:"open-project-manager",label:s("settingsDialog.shortcuts.openProjectManagerTitle"),description:s("settingsDialog.shortcuts.openProjectManagerDescription"),mac:"⌘ ⇧ K",windows:"Ctrl + Shift + K"},{id:"open-source-browser",label:s("settingsDialog.shortcuts.openSourceBrowserTitle"),description:s("settingsDialog.shortcuts.openSourceBrowserDescription"),mac:"⌘ ⇧ O",windows:"Ctrl + Shift + O"},{id:"open-diff-review",label:s("settingsDialog.shortcuts.openDiffReviewTitle"),description:s("settingsDialog.shortcuts.openDiffReviewDescription"),mac:"⌘ ⇧ D",windows:"Ctrl + Shift + D"},{id:"close-top-dialog",label:s("settingsDialog.shortcuts.closeTopDialogTitle"),description:s("settingsDialog.shortcuts.closeTopDialogDescription"),mac:"Esc",windows:"Esc"}]),ot=v(()=>{var t,n,o;return!f.value&&!_.value&&!C.value&&!((t=u.value)!=null&&t.lastError)&&!((n=u.value)!=null&&n.lastCloseReason)&&!((o=u.value)!=null&&o.lastConnectedAt)}),lt=v(()=>{const t=c.deviceToken?`${"*".repeat(Math.max(0,c.deviceToken.length-4))}${c.deviceToken.slice(-4)}`:"";return JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{enabled:c.enabled,relayUrl:c.relayUrl,deviceId:c.deviceId,deviceTokenMasked:t,managedByEnv:f.value},status:u.value||null},null,2)}),j=v(()=>{var t,n;return((n=(t=T.value)==null?void 0:t.runner)==null?void 0:n.runner)||null}),Y=v(()=>{var t,n;return!!((n=(t=T.value)==null?void 0:t.runner)!=null&&n.ok&&j.value)}),y=v(()=>{var t;return((t=j.value)==null?void 0:t.metrics)||null}),_e=v(()=>{var t;return((t=T.value)==null?void 0:t.recovery)||null}),fe=v(()=>{var t;return((t=T.value)==null?void 0:t.maintenance)||null}),rt=v(()=>{var t;return((t=T.value)==null?void 0:t.gitDiffWorker)||null}),ct=v(()=>JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{runner:{maxConcurrentRuns:H.runnerMaxConcurrentRuns,managedByEnv:A.runnerMaxConcurrentRuns}},diagnostics:T.value||null},null,2));function Z(t){const n=String(t||"").trim();if(!n)return s("common.notAvailable");const o=new Date(n);return Number.isNaN(o.getTime())?n:Nt(o.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const dt=v(()=>{var t,n,o,g,D,P,E,M;return[{key:"queued_cancelled",label:s("settingsDialog.system.stopReasons.queued_cancelled"),value:Math.max(0,Number((n=(t=y.value)==null?void 0:t.stopReasons)==null?void 0:n.queued_cancelled)||0)},{key:"user_requested",label:s("settingsDialog.system.stopReasons.user_requested"),value:Math.max(0,Number((g=(o=y.value)==null?void 0:o.stopReasons)==null?void 0:g.user_requested)||0)},{key:"user_requested_after_error",label:s("settingsDialog.system.stopReasons.user_requested_after_error"),value:Math.max(0,Number((P=(D=y.value)==null?void 0:D.stopReasons)==null?void 0:P.user_requested_after_error)||0)},{key:"stop_timeout",label:s("settingsDialog.system.stopReasons.stop_timeout"),value:Math.max(0,Number((M=(E=y.value)==null?void 0:E.stopReasons)==null?void 0:M.stop_timeout)||0)}]}),ut=v(()=>{var t,n,o,g,D,P,E,M,te,se;return[{key:"runner_timeout_without_stop_request",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_without_stop_request"),value:Math.max(0,Number((n=(t=y.value)==null?void 0:t.stopTimeoutPhases)==null?void 0:n.runner_timeout_without_stop_request)||0)},{key:"runner_timeout_before_cancel",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_before_cancel"),value:Math.max(0,Number((g=(o=y.value)==null?void 0:o.stopTimeoutPhases)==null?void 0:g.runner_timeout_before_cancel)||0)},{key:"cli_not_exiting",label:s("settingsDialog.system.stopTimeoutPhases.cli_not_exiting"),value:Math.max(0,Number((P=(D=y.value)==null?void 0:D.stopTimeoutPhases)==null?void 0:P.cli_not_exiting)||0)},{key:"os_kill_slow",label:s("settingsDialog.system.stopTimeoutPhases.os_kill_slow"),value:Math.max(0,Number((M=(E=y.value)==null?void 0:E.stopTimeoutPhases)==null?void 0:M.os_kill_slow)||0)},{key:"runner_finalize_after_exit",label:s("settingsDialog.system.stopTimeoutPhases.runner_finalize_after_exit"),value:Math.max(0,Number((se=(te=y.value)==null?void 0:te.stopTimeoutPhases)==null?void 0:se.runner_finalize_after_exit)||0)}]}),mt=v(()=>ge.value.map(t=>({value:t.value,label:t.value==="zh-CN"?s("locale.zhHans"):s("locale.enUs"),englishLabel:t.englishLabel})));async function gt(){F.value=!0,p.value="";try{const t=await Ut(),n=String((t==null?void 0:t.version)||"").trim();b.value=n,n||(p.value=s("settingsDialog.about.versionPending"))}catch(t){b.value="",p.value=(t==null?void 0:t.message)||s("settingsDialog.about.versionLoadFailed")}finally{F.value=!1}}function ve(t={}){c.enabled=!!(t!=null&&t.enabled),c.relayUrl=String((t==null?void 0:t.relayUrl)||""),c.deviceId=String((t==null?void 0:t.deviceId)||""),c.deviceToken=String((t==null?void 0:t.deviceToken)||"")}function be(t={}){var n;H.runnerMaxConcurrentRuns=Math.max(1,Number((n=t==null?void 0:t.runner)==null?void 0:n.maxConcurrentRuns)||3)}async function De(){x.value=!0,_.value="",C.value="";try{const t=await At();ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigLoadFailed"),u.value=null}finally{x.value=!1}}async function ht(){var t,n;ie.value=!0,q.value="",G.value="";try{const o=await Ot();be((o==null?void 0:o.config)||{}),A.runnerMaxConcurrentRuns=!!((n=(t=o==null?void 0:o.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),ee()}catch(o){q.value=(o==null?void 0:o.message)||s("settingsDialog.system.systemConfigLoadFailed")}finally{ie.value=!1}}async function ee(){V.value=!0,Q.value="";try{T.value=await Kt()}catch(t){Q.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsLoadFailed")}finally{V.value=!1}}async function vt(){k.value=!0,_.value="",C.value="";try{const t=await Qe({enabled:c.enabled,relayUrl:c.relayUrl,deviceId:c.deviceId,deviceToken:c.deviceToken});ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null,C.value=c.enabled?s("settingsDialog.relay.relayConfigSavedEnabled"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigSaveFailed")}finally{k.value=!1}}async function xt(){w.value=!0,_.value="",C.value="";try{const t=await Ht();u.value=(t==null?void 0:t.relay)||null,C.value=s("settingsDialog.relay.relayReconnectTriggered"),setTimeout(()=>{De()},1200)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayReconnectFailed")}finally{w.value=!1}}async function pt(){var t,n;I.value=!0,q.value="",G.value="";try{const o=await zt({runner:{maxConcurrentRuns:H.runnerMaxConcurrentRuns}});be((o==null?void 0:o.config)||{}),A.runnerMaxConcurrentRuns=!!((n=(t=o==null?void 0:o.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),G.value=s("settingsDialog.system.systemConfigSaved"),ee()}catch(o){q.value=(o==null?void 0:o.message)||s("settingsDialog.system.systemConfigSaveFailed")}finally{I.value=!1}}function yt(){return!!(String(c.relayUrl||"").trim()&&String(c.deviceId||"").trim()&&String(c.deviceToken||"").trim())}async function _t(){var t;if(!f.value){if(_.value="",C.value="",c.enabled&&!yt()){c.enabled=!1,_.value=s("settingsDialog.relay.relayFieldsRequired");return}X.value=!0;try{const n=await Qe({enabled:c.enabled,relayUrl:c.relayUrl,deviceId:c.deviceId,deviceToken:c.deviceToken});ve((n==null?void 0:n.config)||{}),f.value=!!(n!=null&&n.managedByEnv),u.value=(n==null?void 0:n.relay)||null,C.value=c.enabled?s("settingsDialog.relay.relayEnabledSaved"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(n){c.enabled=!!((t=u.value)!=null&&t.enabled),_.value=(n==null?void 0:n.message)||s("settingsDialog.relay.relayToggleFailed")}finally{X.value=!1}}}async function ke(t){var o;if((o=navigator.clipboard)!=null&&o.writeText&&window.isSecureContext){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.opacity="0",n.style.pointerEvents="none",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}async function ft(){try{await ke(lt.value),le.value=!0,B&&clearTimeout(B),B=setTimeout(()=>{le.value=!1,B=null},2e3)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayDiagnosticsCopyFailed")}}async function bt(){try{await ke(ct.value),re.value=!0,N&&clearTimeout(N),N=setTimeout(()=>{re.value=!1,N=null},2e3)}catch(t){Q.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsCopyFailed")}}function Dt(t){he(t)}function xe(){ce&&(clearInterval(ce),ce=null)}function kt(){xe(),!(!J.open||R.value!=="system")&&(ee(),ce=setInterval(()=>{ee()},5e3))}return Ke(()=>J.open,t=>{if(t){R.value="theme",gt(),De(),ht();return}},{immediate:!0}),Ke([()=>J.open,R],([t,n])=>{if(t&&n==="system"){kt();return}xe()},{immediate:!0}),Rt(()=>{B&&(clearTimeout(B),B=null),N&&(clearTimeout(N),N=null),xe()}),(t,n)=>(l(),$($t,{open:U.open,"stack-level":2,"panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-[42rem] sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body min-h-0 flex flex-1 flex-col sm:flex-row",onClose:n[7]||(n[7]=o=>ae("close"))},{title:ue(()=>[e("div",rs,[L(i(It),{class:"h-4 w-4"}),e("span",null,a(i(s)("common.settings")),1)])]),default:ue(()=>{var o,g,D,P,E,M,te,se,we,Ce,Te,Re,Se,Pe,Ee,Me,$e,Ue,Be,Ne,je,Le,Fe,Ie,qe,Ve,Ae,He,Oe,ze;return[L(Et,{modelValue:R.value,"onUpdate:modelValue":n[0]||(n[0]=d=>R.value=d),sections:Ze.value},null,8,["modelValue","sections"]),e("div",cs,[R.value==="theme"?(l(),r("section",ds,[e("div",null,[e("div",us,a(i(s)("theme.title")),1),e("p",ms,a(i(s)("theme.sectionDescription")),1)]),e("section",gs,[L(ls)]),e("section",hs,[e("div",null,[e("div",vs,a(i(s)("locale.title")),1),e("p",xs,a(i(s)("locale.description")),1)]),e("label",ps,[e("span",ys,a(i(s)("locale.field")),1),L(Mt,{"model-value":i(S),options:mt.value,"get-option-value":d=>d.value,"onUpdate:modelValue":Dt},{trigger:ue(({selectedOption:d})=>[e("div",_s,a((d==null?void 0:d.label)||i(s)("common.select")),1)]),option:ue(({option:d,selected:wt,select:Ct})=>[e("button",{type:"button",class:"workbench-select-option theme-filter-idle w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm",onClick:ui=>Ct()},[e("div",bs,[e("div",Ds,[e("div",ks,a(d.label),1),e("div",ws,a(d.englishLabel),1)]),wt?(l(),r("span",Cs,a(i(s)("common.enabled")),1)):h("",!0)])],8,fs)]),_:1},8,["model-value","options","get-option-value"])]),e("p",Ts,a(i(s)("locale.immediateHint")),1)])])):R.value==="relay"?(l(),r("section",Rs,[e("div",Ss,[e("div",null,[e("div",Ps,[L(i(We),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.relay.title")),1)])]),e("span",{class:Xe(["rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium",at.value])},a(nt.value),3)]),e("section",Es,[e("label",Ms,[e("div",null,[e("div",$s,a(i(s)("settingsDialog.relay.enableTitle")),1),e("p",Us,a(i(s)("settingsDialog.relay.enableDescription")),1)]),ne(e("input",{"onUpdate:modelValue":n[1]||(n[1]=d=>c.enabled=d),type:"checkbox",class:"h-4 w-4",disabled:f.value,onChange:_t},null,40,Bs),[[St,c.enabled]])]),e("div",Ns,[e("label",js,[e("span",Ls,a(i(s)("settingsDialog.relay.relayUrl")),1),ne(e("input",{"onUpdate:modelValue":n[2]||(n[2]=d=>c.relayUrl=d),type:"text",placeholder:"https://user1.promptx.example.com",class:"tool-input",disabled:f.value},null,8,Fs),[[pe,c.relayUrl]])]),e("label",Is,[e("span",qs,a(i(s)("settingsDialog.relay.deviceId")),1),ne(e("input",{"onUpdate:modelValue":n[3]||(n[3]=d=>c.deviceId=d),type:"text",placeholder:"my-macbook",class:"tool-input",disabled:f.value},null,8,Vs),[[pe,c.deviceId]])]),e("label",As,[e("span",Hs,a(i(s)("settingsDialog.relay.deviceToken")),1),e("div",Os,[ne(e("input",{"onUpdate:modelValue":n[4]||(n[4]=d=>c.deviceToken=d),type:oe.value?"text":"password",placeholder:i(s)("settingsDialog.relay.deviceTokenPlaceholder"),class:"tool-input pr-10",disabled:f.value},null,8,zs),[[Pt,c.deviceToken]]),e("button",{type:"button",class:"theme-icon-button absolute inset-y-1 right-1 flex h-auto w-8 items-center justify-center",disabled:f.value,onClick:n[5]||(n[5]=d=>oe.value=!oe.value)},[oe.value?(l(),$(i(Ft),{key:1,class:"h-4 w-4"})):(l(),$(i(Lt),{key:0,class:"h-4 w-4"}))],8,Ks)])])]),e("div",Ws,[e("div",Js,[(o=u.value)!=null&&o.reconnectPausedReason?(l(),r("p",Gs,a(i(s)("settingsDialog.relay.pausedReconnect",{reason:de(u.value.reconnectPausedReasonCode,u.value.reconnectPausedReason)})),1)):h("",!0),f.value?(l(),r("p",Qs,a(i(s)("settingsDialog.relay.managedByEnv")),1)):h("",!0),_.value?(l(),r("p",Xs,a(_.value),1)):C.value?(l(),r("p",Ys,a(C.value),1)):(g=u.value)!=null&&g.lastError?(l(),r("p",Zs,a(i(s)("settingsDialog.relay.lastError",{value:st(u.value)})),1)):(D=u.value)!=null&&D.lastCloseReason?(l(),r("p",en,a(i(s)("settingsDialog.relay.lastClosed",{reason:de(u.value.lastCloseReasonCode,u.value.lastCloseReason),code:u.value.lastCloseCode})),1)):(P=u.value)!=null&&P.lastConnectedAt?(l(),r("p",tn,a(i(s)("settingsDialog.relay.lastConnected",{value:Z(u.value.lastConnectedAt)})),1)):h("",!0),(M=(E=u.value)==null?void 0:E.recentEvents)!=null&&M.length?(l(),r("p",sn,a(i(s)("settingsDialog.relay.recentEvent",{value:tt(u.value.recentEvents[0])})),1)):h("",!0),le.value?(l(),r("p",nn,a(i(s)("settingsDialog.relay.copied")),1)):h("",!0),ot.value?(l(),r("p",an,a(i(s)("settingsDialog.relay.defaultHint")),1)):h("",!0)]),e("div",on,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:x.value||k.value||X.value||w.value||!(((te=u.value)==null?void 0:te.enabled)??c.enabled),onClick:xt},[w.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(w.value?i(s)("settingsDialog.relay.reconnecting"):i(s)("settingsDialog.relay.reconnectNow")),1)],8,ln),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:x.value||w.value,onClick:ft},[e("span",null,a(le.value?i(s)("settingsDialog.relay.diagnosticsCopied"):i(s)("settingsDialog.relay.copyDiagnostics")),1)],8,rn),e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:x.value||k.value||X.value||w.value||f.value,onClick:vt},[k.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(k.value?i(s)("common.saving"):i(s)("settingsDialog.relay.saveConfig")),1)],8,cn)])])])])):R.value==="system"?(l(),r("section",dn,[e("div",null,[e("div",un,[L(i(Je),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.system.title")),1)]),e("p",mn,a(i(s)("settingsDialog.system.intro")),1)]),e("section",gn,[e("label",hn,[e("span",vn,a(i(s)("settingsDialog.system.maxConcurrentRuns")),1),ne(e("input",{"onUpdate:modelValue":n[6]||(n[6]=d=>H.runnerMaxConcurrentRuns=d),type:"number",min:"1",max:"16",step:"1",class:"tool-input",disabled:A.runnerMaxConcurrentRuns||ie.value||I.value},null,8,xn),[[pe,H.runnerMaxConcurrentRuns,void 0,{number:!0}]]),e("p",pn,a(i(s)("settingsDialog.system.maxConcurrentRunsHint")),1)]),e("div",yn,[e("div",_n,[A.runnerMaxConcurrentRuns?(l(),r("p",fn,a(i(s)("settingsDialog.system.managedByEnv")),1)):q.value?(l(),r("p",bn,a(q.value),1)):G.value?(l(),r("p",Dn,a(G.value),1)):(l(),r("p",kn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),e("div",wn,[e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:A.runnerMaxConcurrentRuns||ie.value||I.value,onClick:pt},[I.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(I.value?i(s)("common.saving"):i(s)("settingsDialog.system.saveConfig")),1)],8,Cn)])])]),e("section",Tn,[e("div",Rn,[e("div",null,[e("div",Sn,a(i(s)("settingsDialog.system.runtimeDiagnostics")),1),e("p",Pn,a(i(s)("settingsDialog.system.runtimeDiagnosticsHint")),1)]),e("div",En,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:V.value,onClick:ee},[V.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(V.value?i(s)("settingsDialog.system.refreshingDiagnostics"):i(s)("settingsDialog.system.refreshDiagnostics")),1)],8,Mn),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:bt},[e("span",null,a(re.value?i(s)("settingsDialog.system.diagnosticsCopied"):i(s)("settingsDialog.system.copyDiagnostics")),1)])])]),e("div",$n,[Q.value?(l(),r("p",Un,a(Q.value),1)):re.value?(l(),r("p",Bn,a(i(s)("settingsDialog.system.diagnosticsCopiedHint")),1)):(l(),r("p",Nn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),Y.value?(l(),r("div",jn,[e("div",Ln,[n[8]||(n[8]=e("div",{class:"theme-muted-text text-xs"},"active",-1)),e("div",Fn,a(((se=j.value)==null?void 0:se.activeRunCount)||0),1),e("p",In,a(i(s)("settingsDialog.system.active")),1)]),e("div",qn,[n[9]||(n[9]=e("div",{class:"theme-muted-text text-xs"},"tracked",-1)),e("div",Vn,a(((we=j.value)==null?void 0:we.trackedRunCount)||0),1),e("p",An,a(i(s)("settingsDialog.system.tracked")),1)]),e("div",Hn,[n[10]||(n[10]=e("div",{class:"theme-muted-text text-xs"},"queued",-1)),e("div",On,a(((Ce=j.value)==null?void 0:Ce.queuedRunCount)||0),1),e("p",zn,a(i(s)("settingsDialog.system.queued")),1)]),e("div",Kn,[n[11]||(n[11]=e("div",{class:"theme-muted-text text-xs"},"maxConcurrent",-1)),e("div",Wn,a(((Re=(Te=j.value)==null?void 0:Te.config)==null?void 0:Re.maxConcurrentRuns)||H.runnerMaxConcurrentRuns),1),e("p",Jn,a(i(s)("settingsDialog.system.maxConcurrent")),1)])])):h("",!0),Y.value?(l(),r("div",Gn,[e("div",Qn,[n[12]||(n[12]=e("div",{class:"theme-muted-text text-xs"},"completed",-1)),e("div",Xn,a(((Se=y.value)==null?void 0:Se.totalCompleted)||0),1),e("p",Yn,a(i(s)("settingsDialog.system.completed")),1)]),e("div",Zn,[n[13]||(n[13]=e("div",{class:"theme-muted-text text-xs"},"stopped",-1)),e("div",ea,a(((Pe=y.value)==null?void 0:Pe.totalStopped)||0),1),e("p",ta,a(i(s)("settingsDialog.system.stopped")),1)]),e("div",sa,[n[14]||(n[14]=e("div",{class:"theme-muted-text text-xs"},"error",-1)),e("div",na,a(((Ee=y.value)==null?void 0:Ee.totalErrored)||0),1),e("p",aa,a(i(s)("settingsDialog.system.error")),1)]),e("div",ia,[n[15]||(n[15]=e("div",{class:"theme-muted-text text-xs"},"stop_timeout",-1)),e("div",oa,a(((Me=y.value)==null?void 0:Me.totalStopTimeout)||0),1),e("p",la,a(i(s)("settingsDialog.system.stopTimeout")),1)])])):h("",!0),Y.value?(l(),r("div",ra,[e("div",ca,[n[16]||(n[16]=e("div",{class:"theme-muted-text text-xs"},"event flush failures",-1)),e("div",da,a((($e=y.value)==null?void 0:$e.eventFlushFailureCount)||0),1),e("p",ua,a(i(s)("settingsDialog.system.eventWriteFailures")),1)]),e("div",ma,[n[17]||(n[17]=e("div",{class:"theme-muted-text text-xs"},"recovered runs",-1)),e("div",ga,a(((Be=(Ue=_e.value)==null?void 0:Ue.metrics)==null?void 0:Be.totalRecovered)||0),1),e("p",ha,a(i(s)("settingsDialog.system.recoveredRuns")),1)]),e("div",va,[n[18]||(n[18]=e("div",{class:"theme-muted-text text-xs"},"last cleanup",-1)),e("div",xa,a(Z((je=(Ne=fe.value)==null?void 0:Ne.lastCleanup)==null?void 0:je.finishedAt)),1),e("p",pa,a(i(s)("settingsDialog.system.lastMaintenanceAt")),1)])])):h("",!0),e("div",ya,[e("div",_a,[e("div",fa,a(i(s)("settingsDialog.system.baseStatus")),1),e("div",ba,[e("div",Da,[n[19]||(n[19]=e("span",{class:"theme-muted-text"},"runner baseUrl",-1)),e("span",ka,a(((Fe=(Le=T.value)==null?void 0:Le.runner)==null?void 0:Fe.baseUrl)||"-"),1)]),e("div",wa,[n[20]||(n[20]=e("span",{class:"theme-muted-text"},"runner startedAt",-1)),e("span",Ca,a(Z((Ie=j.value)==null?void 0:Ie.startedAt)),1)]),e("div",Ta,[n[21]||(n[21]=e("span",{class:"theme-muted-text"},"last sweep",-1)),e("span",Ra,a(Z((Ve=(qe=_e.value)==null?void 0:qe.metrics)==null?void 0:Ve.lastSweepFinishedAt)),1)]),e("div",Sa,[n[22]||(n[22]=e("span",{class:"theme-muted-text"},"git diff worker",-1)),e("span",Pa,a(rt.value?i(s)("settingsDialog.system.available"):i(s)("settingsDialog.system.unknown")),1)]),e("div",Ea,[n[23]||(n[23]=e("span",{class:"theme-muted-text"},"db vacuum",-1)),e("span",Ma,a(Z((Ae=fe.value)==null?void 0:Ae.lastVacuumAt)),1)])])]),e("div",$a,[e("div",Ua,a(i(s)("settingsDialog.system.stopReasonTitle")),1),e("div",Ba,[(l(!0),r(O,null,z(dt.value,d=>(l(),r("div",{key:d.key,class:"flex items-center justify-between gap-3"},[e("span",Na,a(d.label),1),e("span",ja,a(d.value),1)]))),128))])])]),Y.value?(l(),r("div",La,[e("div",Fa,a(i(s)("settingsDialog.system.stopTimeoutPhaseTitle")),1),e("div",Ia,[(l(!0),r(O,null,z(ut.value,d=>(l(),r("div",{key:d.key,class:"flex items-center justify-between gap-3 rounded-sm border border-dashed border-[var(--theme-borderMuted)] px-2.5 py-2"},[e("span",qa,a(d.label),1),e("span",Va,a(d.value),1)]))),128))])])):h("",!0),!Y.value&&!V.value?(l(),r("div",Aa,[e("div",Ha,a(i(s)("settingsDialog.system.runnerUnavailable")),1),e("p",Oa,a(et((He=T.value)==null?void 0:He.runner,"settingsDialog.system.runnerUnavailableDescription")),1),e("p",za," baseUrl: "+a(((ze=(Oe=T.value)==null?void 0:Oe.runner)==null?void 0:ze.baseUrl)||"-"),1)])):h("",!0)])])):R.value==="shortcuts"?(l(),r("section",Ka,[e("div",null,[e("div",Wa,[L(i(Ge),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.shortcuts.title")),1)]),e("p",Ja,a(i(s)("settingsDialog.shortcuts.intro")),1)]),e("section",Ga,[(l(!0),r(O,null,z(it.value,d=>(l(),r("div",{key:d.id,class:"settings-form-card flex flex-col justify-between gap-3 px-3 py-3 sm:flex-row sm:items-center"},[e("div",Qa,[e("div",Xa,a(d.label),1),e("p",Ya,a(d.description),1)]),e("div",Za,[e("span",ei,a(d.mac),1),e("span",ti,a(d.windows),1)])]))),128)),e("p",si,a(i(s)("settingsDialog.shortcuts.note")),1)])])):(l(),r("section",ni,[e("div",null,[e("div",ai,a(i(s)("settingsDialog.about.title")),1),e("p",ii,a(i(s)("settingsDialog.about.intro")),1)]),e("section",oi,[e("div",li,[e("div",null,[e("div",ri,a(i(s)("settingsDialog.about.versionTitle")),1),e("p",ci,a(p.value||i(s)("settingsDialog.about.versionDescription")),1)]),e("span",di,a(F.value?i(s)("common.loading"):b.value?`v${b.value}`:i(s)("common.unavailable")),1)])])]))])]}),_:1},8,["open"]))}};export{_i as default};
|
|
1
|
+
import{aD as l,aE as r,aF as e,aQ as a,u as i,aR as O,aS as z,aL as Xe,aV as Tt,aI as $,aN as h,c as v,w as Ke,ak as Rt,aJ as ue,aG as L,aW as ne,aY as St,aX as pe,b2 as Pt,b as m,r as ye}from"./vendor-misc-DxKJ95A9.js";import{d as K,f as Et,_ as Mt,c as $t,h as Ut}from"./WorkbenchView-CB2beALS.js";import{u as Ye,b as Bt,f as Nt}from"./index-By0kbUJQ.js";import{b as jt,D as We,E as Lt,g as Ft,L as me,H as Je,K as Ge,t as It,J as qt,x as Vt}from"./vendor-ui-DTqxu3Qf.js";import"./vendor-markdown-BENmzbO1.js";import"./vendor-tiptap-COqMdKic.js";import"./vendor-router-iukOUtEP.js";function At(){return K("/api/relay/config",{cache:"no-store"})}function Qe(U){return K("/api/relay/config",{method:"PUT",body:JSON.stringify(U)})}function Ht(){return K("/api/relay/reconnect",{method:"POST"})}function Ot(){return K("/api/system/config",{cache:"no-store"})}function zt(U){return K("/api/system/config",{method:"PUT",body:JSON.stringify(U)})}function Kt(){return K("/api/diagnostics/runtime",{cache:"no-store"})}const Wt={class:"space-y-4"},Jt={class:"flex items-center justify-between gap-3"},Gt={class:"theme-heading text-sm font-medium"},Qt={class:"theme-toggle-current theme-badge-muted theme-muted-text rounded-sm border border-dashed px-2 py-1 text-[11px]"},Xt={class:"theme-muted-text theme-note-text mt-1"},Yt={class:"space-y-4"},Zt={class:"theme-muted-text px-1 text-[10px] font-medium uppercase tracking-[0.16em]"},es=["onClick"],ts={class:"flex items-start gap-3"},ss={class:"mt-0.5 flex items-center gap-1.5"},ns={class:"min-w-0 flex-1"},as={class:"flex items-center justify-between gap-2"},is={class:"truncate text-sm font-medium"},os={class:"theme-muted-text theme-note-text mt-1"},ls={__name:"ThemeToggle",setup(U){const{currentTheme:W,setTheme:J,themes:ae}=Bt(),{t:S}=Ye(),ge=v(()=>{const b=ae.value.filter(p=>p.mode==="light"),F=ae.value.filter(p=>p.mode==="dark");return[{id:"light",label:S("theme.groupLight"),items:b},{id:"dark",label:S("theme.groupDark"),items:F}].filter(p=>p.items.length)});function he(b){J(b)}function s(b){return S(`theme.description.${b.id}`,{},b.description)}return(b,F)=>(l(),r("div",Wt,[e("div",null,[e("div",Jt,[e("div",Gt,a(i(S)("theme.heading")),1),e("div",Qt,a(i(S)("theme.currentTheme",{name:i(W).shortName})),1)]),e("div",Xt,a(i(S)("theme.helper")),1)]),e("div",Yt,[(l(!0),r(O,null,z(ge.value,p=>(l(),r("section",{key:p.id,class:"space-y-1.5"},[e("div",Zt,a(p.label),1),(l(!0),r(O,null,z(p.items,x=>(l(),r("button",{key:x.id,type:"button",class:Xe(["theme-option theme-toggle-card w-full rounded-sm border px-3 py-2 text-left transition",x.id===i(W).id?"theme-option-active":"theme-option-idle"]),onClick:k=>he(x.id)},[e("div",ts,[e("div",ss,[(l(!0),r(O,null,z(x.swatches,(k,w)=>(l(),r("span",{key:`${x.id}-${w}`,class:"h-3 w-3 rounded-full border border-black/10",style:Tt({backgroundColor:k})},null,4))),128))]),e("div",ns,[e("div",as,[e("span",is,a(x.shortName),1),x.id===i(W).id?(l(),$(i(jt),{key:0,class:"h-4 w-4 shrink-0"})):h("",!0)]),e("div",os,a(s(x)),1)])])],10,es))),128))]))),128))])]))}},rs={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},cs={class:"settings-dialog-content min-h-0 flex-1 overflow-y-auto px-5 py-5"},ds={key:0,class:"space-y-4"},us={class:"theme-heading text-base font-medium"},ms={class:"theme-muted-text mt-1 text-xs leading-5"},gs={class:"settings-section-card px-4 py-4"},hs={class:"settings-section-card space-y-4 px-4 py-4"},vs={class:"theme-heading text-sm font-medium"},xs={class:"theme-muted-text mt-1 text-xs leading-5"},ps={class:"block space-y-1.5"},ys={class:"theme-muted-text text-xs"},_s={class:"truncate text-sm text-[var(--theme-textPrimary)]"},fs=["onClick"],bs={class:"flex items-center justify-between gap-3"},Ds={class:"min-w-0"},ks={class:"truncate text-[var(--theme-textPrimary)]"},ws={class:"theme-muted-text mt-1 truncate text-xs"},Cs={key:0,class:"theme-status-success rounded-sm border border-dashed px-2 py-0.5 text-[10px]"},Ts={class:"theme-muted-text theme-note-text"},Rs={key:1,class:"space-y-4"},Ss={class:"flex items-start justify-between gap-3"},Ps={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Es={class:"settings-section-card space-y-4 px-4 py-4"},Ms={class:"settings-form-card flex items-center justify-between gap-3 px-3 py-2"},$s={class:"text-sm font-medium text-[var(--theme-textPrimary)]"},Us={class:"theme-muted-text mt-1 text-xs"},Bs=["disabled"],Ns={class:"grid gap-4 sm:grid-cols-2"},js={class:"space-y-1.5 sm:col-span-2"},Ls={class:"theme-muted-text text-xs"},Fs=["disabled"],Is={class:"space-y-1.5"},qs={class:"theme-muted-text text-xs"},Vs=["disabled"],As={class:"space-y-1.5"},Hs={class:"theme-muted-text text-xs"},Os={class:"relative"},zs=["type","placeholder","disabled"],Ks=["disabled"],Ws={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},Js={class:"min-w-0 space-y-1"},Gs={key:0,class:"theme-danger-text theme-note-text"},Qs={key:1,class:"theme-status-warning theme-note-text"},Xs={key:2,class:"theme-danger-text theme-note-text"},Ys={key:3,class:"theme-status-success theme-note-text"},Zs={key:4,class:"theme-danger-text theme-note-text"},en={key:5,class:"theme-muted-text theme-note-text"},tn={key:6,class:"theme-muted-text theme-note-text"},sn={key:7,class:"theme-muted-text theme-note-text"},nn={key:8,class:"theme-status-success theme-note-text"},an={key:9,class:"theme-muted-text theme-note-text"},on={class:"flex flex-wrap items-center gap-2"},ln=["disabled"],rn=["disabled"],cn=["disabled"],dn={key:2,class:"space-y-4"},un={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},mn={class:"theme-muted-text mt-1 text-xs leading-5"},gn={class:"settings-section-card space-y-4 px-4 py-4"},hn={class:"space-y-1.5"},vn={class:"theme-muted-text text-xs"},xn=["disabled"],pn={class:"theme-muted-text text-xs leading-5"},yn={class:"settings-form-footer flex flex-wrap items-center justify-between gap-3"},_n={class:"min-w-0 space-y-1"},fn={key:0,class:"theme-status-warning theme-note-text"},bn={key:1,class:"theme-danger-text theme-note-text"},Dn={key:2,class:"theme-status-success theme-note-text"},kn={key:3,class:"theme-muted-text theme-note-text"},wn={class:"flex flex-wrap items-center gap-2"},Cn=["disabled"],Tn={class:"settings-section-card space-y-4 px-4 py-4"},Rn={class:"flex flex-wrap items-start justify-between gap-3"},Sn={class:"theme-heading text-sm font-medium"},Pn={class:"theme-muted-text mt-1 text-xs leading-5"},En={class:"flex flex-wrap items-center gap-2"},Mn=["disabled"],$n={class:"min-w-0 space-y-1"},Un={key:0,class:"theme-danger-text theme-note-text"},Bn={key:1,class:"theme-status-success theme-note-text"},Nn={key:2,class:"theme-muted-text theme-note-text"},jn={key:0,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Ln={class:"settings-form-card space-y-1 px-3 py-3"},Fn={class:"theme-heading text-lg font-medium"},In={class:"theme-muted-text text-xs"},qn={class:"settings-form-card space-y-1 px-3 py-3"},Vn={class:"theme-heading text-lg font-medium"},An={class:"theme-muted-text text-xs"},Hn={class:"settings-form-card space-y-1 px-3 py-3"},On={class:"theme-heading text-lg font-medium"},zn={class:"theme-muted-text text-xs"},Kn={class:"settings-form-card space-y-1 px-3 py-3"},Wn={class:"theme-heading text-lg font-medium"},Jn={class:"theme-muted-text text-xs"},Gn={key:1,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4"},Qn={class:"settings-form-card space-y-1 px-3 py-3"},Xn={class:"theme-heading text-lg font-medium"},Yn={class:"theme-muted-text text-xs"},Zn={class:"settings-form-card space-y-1 px-3 py-3"},ea={class:"theme-heading text-lg font-medium"},ta={class:"theme-muted-text text-xs"},sa={class:"settings-form-card space-y-1 px-3 py-3"},na={class:"theme-heading text-lg font-medium"},aa={class:"theme-muted-text text-xs"},ia={class:"settings-form-card space-y-1 px-3 py-3"},oa={class:"theme-heading text-lg font-medium"},la={class:"theme-muted-text text-xs"},ra={key:2,class:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3"},ca={class:"settings-form-card space-y-1 px-3 py-3"},da={class:"theme-heading text-lg font-medium"},ua={class:"theme-muted-text text-xs"},ma={class:"settings-form-card space-y-1 px-3 py-3"},ga={class:"theme-heading text-lg font-medium"},ha={class:"theme-muted-text text-xs"},va={class:"settings-form-card space-y-1 px-3 py-3"},xa={class:"theme-heading text-sm font-medium"},pa={class:"theme-muted-text text-xs"},ya={class:"grid gap-4 lg:grid-cols-2"},_a={class:"settings-form-card space-y-3 px-3 py-3"},fa={class:"theme-heading text-sm font-medium"},ba={class:"space-y-2 text-xs"},Da={class:"flex items-center justify-between gap-3"},ka={class:"truncate text-right text-[var(--theme-textPrimary)]"},wa={class:"flex items-center justify-between gap-3"},Ca={class:"text-right text-[var(--theme-textPrimary)]"},Ta={class:"flex items-center justify-between gap-3"},Ra={class:"text-right text-[var(--theme-textPrimary)]"},Sa={class:"flex items-center justify-between gap-3"},Pa={class:"text-right text-[var(--theme-textPrimary)]"},Ea={class:"flex items-center justify-between gap-3"},Ma={class:"text-right text-[var(--theme-textPrimary)]"},$a={class:"settings-form-card space-y-3 px-3 py-3"},Ua={class:"theme-heading text-sm font-medium"},Ba={class:"space-y-2 text-xs"},Na={class:"theme-muted-text"},ja={class:"text-[var(--theme-textPrimary)]"},La={key:3,class:"settings-form-card space-y-3 px-3 py-3"},Fa={class:"theme-heading text-sm font-medium"},Ia={class:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3 text-xs"},qa={class:"theme-muted-text"},Va={class:"text-[var(--theme-textPrimary)]"},Aa={key:4,class:"settings-form-card space-y-2 px-3 py-3"},Ha={class:"theme-heading text-sm font-medium"},Oa={class:"theme-muted-text text-xs leading-5"},za={class:"theme-muted-text text-xs leading-5"},Ka={key:3,class:"space-y-4"},Wa={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Ja={class:"theme-muted-text mt-1 text-xs leading-5"},Ga={class:"settings-section-card space-y-3 px-4 py-4"},Qa={class:"min-w-0"},Xa={class:"text-sm font-medium text-[var(--theme-textPrimary)]"},Ya={class:"theme-muted-text mt-1 text-xs leading-5"},Za={class:"flex flex-wrap items-center gap-2"},ei={class:"rounded-sm border border-dashed border-[var(--theme-borderDefault)] px-2.5 py-1 text-xs font-medium text-[var(--theme-textPrimary)]"},ti={class:"rounded-sm border border-dashed border-[var(--theme-borderDefault)] px-2.5 py-1 text-xs font-medium text-[var(--theme-textPrimary)]"},si={class:"theme-muted-text theme-note-text"},ni={key:4,class:"space-y-4"},ai={class:"theme-heading text-base font-medium"},ii={class:"theme-muted-text mt-1 text-xs leading-5"},oi={class:"settings-section-card px-4 py-4"},li={class:"flex items-center justify-between gap-3"},ri={class:"theme-heading text-sm font-medium"},ci={class:"theme-muted-text mt-1 text-xs leading-5"},di={class:"theme-badge-strong rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium"},_i={__name:"WorkbenchSettingsDialog",props:{open:{type:Boolean,default:!1}},emits:["close"],setup(U,{emit:W}){const J=U,ae=W,{locale:S,localeOptions:ge,setLocale:he,t:s}=Ye(),b=m(""),F=m(!1),p=m(""),x=m(!1),k=m(!1),w=m(!1),_=m(""),C=m(""),ie=m(!1),I=m(!1),q=m(""),G=m(""),V=m(!1),Q=m(""),T=m(null),u=m(null),f=m(!1),A=ye({runnerMaxConcurrentRuns:!1}),X=m(!1),oe=m(!1),le=m(!1),re=m(!1),c=ye({enabled:!1,relayUrl:"",deviceId:"",deviceToken:""}),H=ye({runnerMaxConcurrentRuns:3}),R=m("theme");let B=null,N=null,ce=null;const Ze=v(()=>[{id:"theme",label:s("theme.title"),description:s("theme.sectionDescription"),icon:qt},{id:"relay",label:s("settingsDialog.relay.sectionLabel"),description:s("settingsDialog.relay.sectionDescription"),icon:We},{id:"system",label:s("settingsDialog.system.sectionLabel"),description:s("settingsDialog.system.sectionDescription"),icon:Je},{id:"shortcuts",label:s("settingsDialog.shortcuts.sectionLabel"),description:s("settingsDialog.shortcuts.sectionDescription"),icon:Ge},{id:"about",label:s("settingsDialog.about.sectionLabel"),description:s("settingsDialog.about.sectionDescription"),icon:Vt}]);function et(t=null,n=""){const o=String((t==null?void 0:t.messageKey)||"").trim();if(o){const g=s(o);if(g&&g!==o)return g}return String((t==null?void 0:t.message)||"").trim()||(n?s(n):"")}function de(t="",n=""){const o=String(t||"").trim();if(o){const g=`settingsDialog.relay.reason.${o}`,D=s(g);if(D!==g)return D}return String(n||"").trim()||s("common.notAvailable")}function tt(t=null){const n=String((t==null?void 0:t.type)||"").trim()||"unknown",o=`settingsDialog.relay.event.${n}`,g=s(o);return g!==o?g:n}function st(t=null){const n=String((t==null?void 0:t.lastErrorKey)||"").trim(),o=t!=null&&t.lastErrorParams&&typeof t.lastErrorParams=="object"?t.lastErrorParams:{};return n==="connect_failed"?s("settingsDialog.relay.error.connect_failed"):n==="disconnected"?s("settingsDialog.relay.error.disconnected",{reason:de(o.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="rejected"?s("settingsDialog.relay.error.rejected",{reason:de(o.reasonCode,t==null?void 0:t.lastCloseReason)}):n==="closed_with_code"?s("settingsDialog.relay.error.closedWithCode",{code:o.code||(t==null?void 0:t.lastCloseCode)||0}):String((t==null?void 0:t.lastError)||"").trim()}const nt=v(()=>{var t,n,o,g;return w.value?s("settingsDialog.relay.status.reconnecting"):k.value||X.value?s("settingsDialog.relay.status.saving"):x.value?s("settingsDialog.relay.status.loading"):(t=u.value)!=null&&t.reconnectPaused?s("settingsDialog.relay.status.paused"):(n=u.value)!=null&&n.connected?s("settingsDialog.relay.status.connected"):(((o=u.value)==null?void 0:o.enabled)??c.enabled)&&Number(((g=u.value)==null?void 0:g.nextReconnectDelayMs)||0)>0?s("settingsDialog.relay.status.waitingReconnect"):c.enabled?s("settingsDialog.relay.status.disconnected"):s("settingsDialog.relay.status.disabled")}),at=v(()=>{var t,n;return(t=u.value)!=null&&t.reconnectPaused?"theme-status-danger":(n=u.value)!=null&&n.connected?"theme-status-success":c.enabled?"theme-status-warning":"theme-status-neutral"}),it=v(()=>[{id:"open-settings",label:s("settingsDialog.shortcuts.openSettingsTitle"),description:s("settingsDialog.shortcuts.openSettingsDescription"),mac:"⌘ ⇧ ,",windows:"Ctrl + Shift + ,"},{id:"open-project-manager",label:s("settingsDialog.shortcuts.openProjectManagerTitle"),description:s("settingsDialog.shortcuts.openProjectManagerDescription"),mac:"⌘ ⇧ K",windows:"Ctrl + Shift + K"},{id:"open-source-browser",label:s("settingsDialog.shortcuts.openSourceBrowserTitle"),description:s("settingsDialog.shortcuts.openSourceBrowserDescription"),mac:"⌘ ⇧ O",windows:"Ctrl + Shift + O"},{id:"open-diff-review",label:s("settingsDialog.shortcuts.openDiffReviewTitle"),description:s("settingsDialog.shortcuts.openDiffReviewDescription"),mac:"⌘ ⇧ D",windows:"Ctrl + Shift + D"},{id:"close-top-dialog",label:s("settingsDialog.shortcuts.closeTopDialogTitle"),description:s("settingsDialog.shortcuts.closeTopDialogDescription"),mac:"Esc",windows:"Esc"}]),ot=v(()=>{var t,n,o;return!f.value&&!_.value&&!C.value&&!((t=u.value)!=null&&t.lastError)&&!((n=u.value)!=null&&n.lastCloseReason)&&!((o=u.value)!=null&&o.lastConnectedAt)}),lt=v(()=>{const t=c.deviceToken?`${"*".repeat(Math.max(0,c.deviceToken.length-4))}${c.deviceToken.slice(-4)}`:"";return JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{enabled:c.enabled,relayUrl:c.relayUrl,deviceId:c.deviceId,deviceTokenMasked:t,managedByEnv:f.value},status:u.value||null},null,2)}),j=v(()=>{var t,n;return((n=(t=T.value)==null?void 0:t.runner)==null?void 0:n.runner)||null}),Y=v(()=>{var t,n;return!!((n=(t=T.value)==null?void 0:t.runner)!=null&&n.ok&&j.value)}),y=v(()=>{var t;return((t=j.value)==null?void 0:t.metrics)||null}),_e=v(()=>{var t;return((t=T.value)==null?void 0:t.recovery)||null}),fe=v(()=>{var t;return((t=T.value)==null?void 0:t.maintenance)||null}),rt=v(()=>{var t;return((t=T.value)==null?void 0:t.gitDiffWorker)||null}),ct=v(()=>JSON.stringify({generatedAt:new Date().toISOString(),source:"local-settings",config:{runner:{maxConcurrentRuns:H.runnerMaxConcurrentRuns,managedByEnv:A.runnerMaxConcurrentRuns}},diagnostics:T.value||null},null,2));function Z(t){const n=String(t||"").trim();if(!n)return s("common.notAvailable");const o=new Date(n);return Number.isNaN(o.getTime())?n:Nt(o.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}const dt=v(()=>{var t,n,o,g,D,P,E,M;return[{key:"queued_cancelled",label:s("settingsDialog.system.stopReasons.queued_cancelled"),value:Math.max(0,Number((n=(t=y.value)==null?void 0:t.stopReasons)==null?void 0:n.queued_cancelled)||0)},{key:"user_requested",label:s("settingsDialog.system.stopReasons.user_requested"),value:Math.max(0,Number((g=(o=y.value)==null?void 0:o.stopReasons)==null?void 0:g.user_requested)||0)},{key:"user_requested_after_error",label:s("settingsDialog.system.stopReasons.user_requested_after_error"),value:Math.max(0,Number((P=(D=y.value)==null?void 0:D.stopReasons)==null?void 0:P.user_requested_after_error)||0)},{key:"stop_timeout",label:s("settingsDialog.system.stopReasons.stop_timeout"),value:Math.max(0,Number((M=(E=y.value)==null?void 0:E.stopReasons)==null?void 0:M.stop_timeout)||0)}]}),ut=v(()=>{var t,n,o,g,D,P,E,M,te,se;return[{key:"runner_timeout_without_stop_request",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_without_stop_request"),value:Math.max(0,Number((n=(t=y.value)==null?void 0:t.stopTimeoutPhases)==null?void 0:n.runner_timeout_without_stop_request)||0)},{key:"runner_timeout_before_cancel",label:s("settingsDialog.system.stopTimeoutPhases.runner_timeout_before_cancel"),value:Math.max(0,Number((g=(o=y.value)==null?void 0:o.stopTimeoutPhases)==null?void 0:g.runner_timeout_before_cancel)||0)},{key:"cli_not_exiting",label:s("settingsDialog.system.stopTimeoutPhases.cli_not_exiting"),value:Math.max(0,Number((P=(D=y.value)==null?void 0:D.stopTimeoutPhases)==null?void 0:P.cli_not_exiting)||0)},{key:"os_kill_slow",label:s("settingsDialog.system.stopTimeoutPhases.os_kill_slow"),value:Math.max(0,Number((M=(E=y.value)==null?void 0:E.stopTimeoutPhases)==null?void 0:M.os_kill_slow)||0)},{key:"runner_finalize_after_exit",label:s("settingsDialog.system.stopTimeoutPhases.runner_finalize_after_exit"),value:Math.max(0,Number((se=(te=y.value)==null?void 0:te.stopTimeoutPhases)==null?void 0:se.runner_finalize_after_exit)||0)}]}),mt=v(()=>ge.value.map(t=>({value:t.value,label:t.value==="zh-CN"?s("locale.zhHans"):s("locale.enUs"),englishLabel:t.englishLabel})));async function gt(){F.value=!0,p.value="";try{const t=await Ut(),n=String((t==null?void 0:t.version)||"").trim();b.value=n,n||(p.value=s("settingsDialog.about.versionPending"))}catch(t){b.value="",p.value=(t==null?void 0:t.message)||s("settingsDialog.about.versionLoadFailed")}finally{F.value=!1}}function ve(t={}){c.enabled=!!(t!=null&&t.enabled),c.relayUrl=String((t==null?void 0:t.relayUrl)||""),c.deviceId=String((t==null?void 0:t.deviceId)||""),c.deviceToken=String((t==null?void 0:t.deviceToken)||"")}function be(t={}){var n;H.runnerMaxConcurrentRuns=Math.max(1,Number((n=t==null?void 0:t.runner)==null?void 0:n.maxConcurrentRuns)||3)}async function De(){x.value=!0,_.value="",C.value="";try{const t=await At();ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigLoadFailed"),u.value=null}finally{x.value=!1}}async function ht(){var t,n;ie.value=!0,q.value="",G.value="";try{const o=await Ot();be((o==null?void 0:o.config)||{}),A.runnerMaxConcurrentRuns=!!((n=(t=o==null?void 0:o.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),ee()}catch(o){q.value=(o==null?void 0:o.message)||s("settingsDialog.system.systemConfigLoadFailed")}finally{ie.value=!1}}async function ee(){V.value=!0,Q.value="";try{T.value=await Kt()}catch(t){Q.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsLoadFailed")}finally{V.value=!1}}async function vt(){k.value=!0,_.value="",C.value="";try{const t=await Qe({enabled:c.enabled,relayUrl:c.relayUrl,deviceId:c.deviceId,deviceToken:c.deviceToken});ve((t==null?void 0:t.config)||{}),f.value=!!(t!=null&&t.managedByEnv),u.value=(t==null?void 0:t.relay)||null,C.value=c.enabled?s("settingsDialog.relay.relayConfigSavedEnabled"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayConfigSaveFailed")}finally{k.value=!1}}async function xt(){w.value=!0,_.value="",C.value="";try{const t=await Ht();u.value=(t==null?void 0:t.relay)||null,C.value=s("settingsDialog.relay.relayReconnectTriggered"),setTimeout(()=>{De()},1200)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayReconnectFailed")}finally{w.value=!1}}async function pt(){var t,n;I.value=!0,q.value="",G.value="";try{const o=await zt({runner:{maxConcurrentRuns:H.runnerMaxConcurrentRuns}});be((o==null?void 0:o.config)||{}),A.runnerMaxConcurrentRuns=!!((n=(t=o==null?void 0:o.managedByEnv)==null?void 0:t.runner)!=null&&n.maxConcurrentRuns),G.value=s("settingsDialog.system.systemConfigSaved"),ee()}catch(o){q.value=(o==null?void 0:o.message)||s("settingsDialog.system.systemConfigSaveFailed")}finally{I.value=!1}}function yt(){return!!(String(c.relayUrl||"").trim()&&String(c.deviceId||"").trim()&&String(c.deviceToken||"").trim())}async function _t(){var t;if(!f.value){if(_.value="",C.value="",c.enabled&&!yt()){c.enabled=!1,_.value=s("settingsDialog.relay.relayFieldsRequired");return}X.value=!0;try{const n=await Qe({enabled:c.enabled,relayUrl:c.relayUrl,deviceId:c.deviceId,deviceToken:c.deviceToken});ve((n==null?void 0:n.config)||{}),f.value=!!(n!=null&&n.managedByEnv),u.value=(n==null?void 0:n.relay)||null,C.value=c.enabled?s("settingsDialog.relay.relayEnabledSaved"):s("settingsDialog.relay.relayConfigSavedDisabled")}catch(n){c.enabled=!!((t=u.value)!=null&&t.enabled),_.value=(n==null?void 0:n.message)||s("settingsDialog.relay.relayToggleFailed")}finally{X.value=!1}}}async function ke(t){var o;if((o=navigator.clipboard)!=null&&o.writeText&&window.isSecureContext){await navigator.clipboard.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.opacity="0",n.style.pointerEvents="none",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}async function ft(){try{await ke(lt.value),le.value=!0,B&&clearTimeout(B),B=setTimeout(()=>{le.value=!1,B=null},2e3)}catch(t){_.value=(t==null?void 0:t.message)||s("settingsDialog.relay.relayDiagnosticsCopyFailed")}}async function bt(){try{await ke(ct.value),re.value=!0,N&&clearTimeout(N),N=setTimeout(()=>{re.value=!1,N=null},2e3)}catch(t){Q.value=(t==null?void 0:t.message)||s("settingsDialog.system.systemDiagnosticsCopyFailed")}}function Dt(t){he(t)}function xe(){ce&&(clearInterval(ce),ce=null)}function kt(){xe(),!(!J.open||R.value!=="system")&&(ee(),ce=setInterval(()=>{ee()},5e3))}return Ke(()=>J.open,t=>{if(t){R.value="theme",gt(),De(),ht();return}},{immediate:!0}),Ke([()=>J.open,R],([t,n])=>{if(t&&n==="system"){kt();return}xe()},{immediate:!0}),Rt(()=>{B&&(clearTimeout(B),B=null),N&&(clearTimeout(N),N=null),xe()}),(t,n)=>(l(),$($t,{open:U.open,"stack-level":2,"panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-[42rem] sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body min-h-0 flex flex-1 flex-col sm:flex-row",onClose:n[7]||(n[7]=o=>ae("close"))},{title:ue(()=>[e("div",rs,[L(i(It),{class:"h-4 w-4"}),e("span",null,a(i(s)("common.settings")),1)])]),default:ue(()=>{var o,g,D,P,E,M,te,se,we,Ce,Te,Re,Se,Pe,Ee,Me,$e,Ue,Be,Ne,je,Le,Fe,Ie,qe,Ve,Ae,He,Oe,ze;return[L(Et,{modelValue:R.value,"onUpdate:modelValue":n[0]||(n[0]=d=>R.value=d),sections:Ze.value},null,8,["modelValue","sections"]),e("div",cs,[R.value==="theme"?(l(),r("section",ds,[e("div",null,[e("div",us,a(i(s)("theme.title")),1),e("p",ms,a(i(s)("theme.sectionDescription")),1)]),e("section",gs,[L(ls)]),e("section",hs,[e("div",null,[e("div",vs,a(i(s)("locale.title")),1),e("p",xs,a(i(s)("locale.description")),1)]),e("label",ps,[e("span",ys,a(i(s)("locale.field")),1),L(Mt,{"model-value":i(S),options:mt.value,"get-option-value":d=>d.value,"onUpdate:modelValue":Dt},{trigger:ue(({selectedOption:d})=>[e("div",_s,a((d==null?void 0:d.label)||i(s)("common.select")),1)]),option:ue(({option:d,selected:wt,select:Ct})=>[e("button",{type:"button",class:"workbench-select-option theme-filter-idle w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm",onClick:ui=>Ct()},[e("div",bs,[e("div",Ds,[e("div",ks,a(d.label),1),e("div",ws,a(d.englishLabel),1)]),wt?(l(),r("span",Cs,a(i(s)("common.enabled")),1)):h("",!0)])],8,fs)]),_:1},8,["model-value","options","get-option-value"])]),e("p",Ts,a(i(s)("locale.immediateHint")),1)])])):R.value==="relay"?(l(),r("section",Rs,[e("div",Ss,[e("div",null,[e("div",Ps,[L(i(We),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.relay.title")),1)])]),e("span",{class:Xe(["rounded-sm border border-dashed px-2.5 py-1 text-xs font-medium",at.value])},a(nt.value),3)]),e("section",Es,[e("label",Ms,[e("div",null,[e("div",$s,a(i(s)("settingsDialog.relay.enableTitle")),1),e("p",Us,a(i(s)("settingsDialog.relay.enableDescription")),1)]),ne(e("input",{"onUpdate:modelValue":n[1]||(n[1]=d=>c.enabled=d),type:"checkbox",class:"h-4 w-4",disabled:f.value,onChange:_t},null,40,Bs),[[St,c.enabled]])]),e("div",Ns,[e("label",js,[e("span",Ls,a(i(s)("settingsDialog.relay.relayUrl")),1),ne(e("input",{"onUpdate:modelValue":n[2]||(n[2]=d=>c.relayUrl=d),type:"text",placeholder:"https://user1.promptx.example.com",class:"tool-input",disabled:f.value},null,8,Fs),[[pe,c.relayUrl]])]),e("label",Is,[e("span",qs,a(i(s)("settingsDialog.relay.deviceId")),1),ne(e("input",{"onUpdate:modelValue":n[3]||(n[3]=d=>c.deviceId=d),type:"text",placeholder:"my-macbook",class:"tool-input",disabled:f.value},null,8,Vs),[[pe,c.deviceId]])]),e("label",As,[e("span",Hs,a(i(s)("settingsDialog.relay.deviceToken")),1),e("div",Os,[ne(e("input",{"onUpdate:modelValue":n[4]||(n[4]=d=>c.deviceToken=d),type:oe.value?"text":"password",placeholder:i(s)("settingsDialog.relay.deviceTokenPlaceholder"),class:"tool-input pr-10",disabled:f.value},null,8,zs),[[Pt,c.deviceToken]]),e("button",{type:"button",class:"theme-icon-button absolute inset-y-1 right-1 flex h-auto w-8 items-center justify-center",disabled:f.value,onClick:n[5]||(n[5]=d=>oe.value=!oe.value)},[oe.value?(l(),$(i(Ft),{key:1,class:"h-4 w-4"})):(l(),$(i(Lt),{key:0,class:"h-4 w-4"}))],8,Ks)])])]),e("div",Ws,[e("div",Js,[(o=u.value)!=null&&o.reconnectPausedReason?(l(),r("p",Gs,a(i(s)("settingsDialog.relay.pausedReconnect",{reason:de(u.value.reconnectPausedReasonCode,u.value.reconnectPausedReason)})),1)):h("",!0),f.value?(l(),r("p",Qs,a(i(s)("settingsDialog.relay.managedByEnv")),1)):h("",!0),_.value?(l(),r("p",Xs,a(_.value),1)):C.value?(l(),r("p",Ys,a(C.value),1)):(g=u.value)!=null&&g.lastError?(l(),r("p",Zs,a(i(s)("settingsDialog.relay.lastError",{value:st(u.value)})),1)):(D=u.value)!=null&&D.lastCloseReason?(l(),r("p",en,a(i(s)("settingsDialog.relay.lastClosed",{reason:de(u.value.lastCloseReasonCode,u.value.lastCloseReason),code:u.value.lastCloseCode})),1)):(P=u.value)!=null&&P.lastConnectedAt?(l(),r("p",tn,a(i(s)("settingsDialog.relay.lastConnected",{value:Z(u.value.lastConnectedAt)})),1)):h("",!0),(M=(E=u.value)==null?void 0:E.recentEvents)!=null&&M.length?(l(),r("p",sn,a(i(s)("settingsDialog.relay.recentEvent",{value:tt(u.value.recentEvents[0])})),1)):h("",!0),le.value?(l(),r("p",nn,a(i(s)("settingsDialog.relay.copied")),1)):h("",!0),ot.value?(l(),r("p",an,a(i(s)("settingsDialog.relay.defaultHint")),1)):h("",!0)]),e("div",on,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:x.value||k.value||X.value||w.value||!(((te=u.value)==null?void 0:te.enabled)??c.enabled),onClick:xt},[w.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(w.value?i(s)("settingsDialog.relay.reconnecting"):i(s)("settingsDialog.relay.reconnectNow")),1)],8,ln),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:x.value||w.value,onClick:ft},[e("span",null,a(le.value?i(s)("settingsDialog.relay.diagnosticsCopied"):i(s)("settingsDialog.relay.copyDiagnostics")),1)],8,rn),e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:x.value||k.value||X.value||w.value||f.value,onClick:vt},[k.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(k.value?i(s)("common.saving"):i(s)("settingsDialog.relay.saveConfig")),1)],8,cn)])])])])):R.value==="system"?(l(),r("section",dn,[e("div",null,[e("div",un,[L(i(Je),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.system.title")),1)]),e("p",mn,a(i(s)("settingsDialog.system.intro")),1)]),e("section",gn,[e("label",hn,[e("span",vn,a(i(s)("settingsDialog.system.maxConcurrentRuns")),1),ne(e("input",{"onUpdate:modelValue":n[6]||(n[6]=d=>H.runnerMaxConcurrentRuns=d),type:"number",min:"1",max:"16",step:"1",class:"tool-input",disabled:A.runnerMaxConcurrentRuns||ie.value||I.value},null,8,xn),[[pe,H.runnerMaxConcurrentRuns,void 0,{number:!0}]]),e("p",pn,a(i(s)("settingsDialog.system.maxConcurrentRunsHint")),1)]),e("div",yn,[e("div",_n,[A.runnerMaxConcurrentRuns?(l(),r("p",fn,a(i(s)("settingsDialog.system.managedByEnv")),1)):q.value?(l(),r("p",bn,a(q.value),1)):G.value?(l(),r("p",Dn,a(G.value),1)):(l(),r("p",kn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),e("div",wn,[e("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:A.runnerMaxConcurrentRuns||ie.value||I.value,onClick:pt},[I.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(I.value?i(s)("common.saving"):i(s)("settingsDialog.system.saveConfig")),1)],8,Cn)])])]),e("section",Tn,[e("div",Rn,[e("div",null,[e("div",Sn,a(i(s)("settingsDialog.system.runtimeDiagnostics")),1),e("p",Pn,a(i(s)("settingsDialog.system.runtimeDiagnosticsHint")),1)]),e("div",En,[e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:V.value,onClick:ee},[V.value?(l(),$(i(me),{key:0,class:"h-4 w-4 animate-spin"})):h("",!0),e("span",null,a(V.value?i(s)("settingsDialog.system.refreshingDiagnostics"):i(s)("settingsDialog.system.refreshDiagnostics")),1)],8,Mn),e("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:bt},[e("span",null,a(re.value?i(s)("settingsDialog.system.diagnosticsCopied"):i(s)("settingsDialog.system.copyDiagnostics")),1)])])]),e("div",$n,[Q.value?(l(),r("p",Un,a(Q.value),1)):re.value?(l(),r("p",Bn,a(i(s)("settingsDialog.system.diagnosticsCopiedHint")),1)):(l(),r("p",Nn,a(i(s)("settingsDialog.system.diagnosticsHint")),1))]),Y.value?(l(),r("div",jn,[e("div",Ln,[n[8]||(n[8]=e("div",{class:"theme-muted-text text-xs"},"active",-1)),e("div",Fn,a(((se=j.value)==null?void 0:se.activeRunCount)||0),1),e("p",In,a(i(s)("settingsDialog.system.active")),1)]),e("div",qn,[n[9]||(n[9]=e("div",{class:"theme-muted-text text-xs"},"tracked",-1)),e("div",Vn,a(((we=j.value)==null?void 0:we.trackedRunCount)||0),1),e("p",An,a(i(s)("settingsDialog.system.tracked")),1)]),e("div",Hn,[n[10]||(n[10]=e("div",{class:"theme-muted-text text-xs"},"queued",-1)),e("div",On,a(((Ce=j.value)==null?void 0:Ce.queuedRunCount)||0),1),e("p",zn,a(i(s)("settingsDialog.system.queued")),1)]),e("div",Kn,[n[11]||(n[11]=e("div",{class:"theme-muted-text text-xs"},"maxConcurrent",-1)),e("div",Wn,a(((Re=(Te=j.value)==null?void 0:Te.config)==null?void 0:Re.maxConcurrentRuns)||H.runnerMaxConcurrentRuns),1),e("p",Jn,a(i(s)("settingsDialog.system.maxConcurrent")),1)])])):h("",!0),Y.value?(l(),r("div",Gn,[e("div",Qn,[n[12]||(n[12]=e("div",{class:"theme-muted-text text-xs"},"completed",-1)),e("div",Xn,a(((Se=y.value)==null?void 0:Se.totalCompleted)||0),1),e("p",Yn,a(i(s)("settingsDialog.system.completed")),1)]),e("div",Zn,[n[13]||(n[13]=e("div",{class:"theme-muted-text text-xs"},"stopped",-1)),e("div",ea,a(((Pe=y.value)==null?void 0:Pe.totalStopped)||0),1),e("p",ta,a(i(s)("settingsDialog.system.stopped")),1)]),e("div",sa,[n[14]||(n[14]=e("div",{class:"theme-muted-text text-xs"},"error",-1)),e("div",na,a(((Ee=y.value)==null?void 0:Ee.totalErrored)||0),1),e("p",aa,a(i(s)("settingsDialog.system.error")),1)]),e("div",ia,[n[15]||(n[15]=e("div",{class:"theme-muted-text text-xs"},"stop_timeout",-1)),e("div",oa,a(((Me=y.value)==null?void 0:Me.totalStopTimeout)||0),1),e("p",la,a(i(s)("settingsDialog.system.stopTimeout")),1)])])):h("",!0),Y.value?(l(),r("div",ra,[e("div",ca,[n[16]||(n[16]=e("div",{class:"theme-muted-text text-xs"},"event flush failures",-1)),e("div",da,a((($e=y.value)==null?void 0:$e.eventFlushFailureCount)||0),1),e("p",ua,a(i(s)("settingsDialog.system.eventWriteFailures")),1)]),e("div",ma,[n[17]||(n[17]=e("div",{class:"theme-muted-text text-xs"},"recovered runs",-1)),e("div",ga,a(((Be=(Ue=_e.value)==null?void 0:Ue.metrics)==null?void 0:Be.totalRecovered)||0),1),e("p",ha,a(i(s)("settingsDialog.system.recoveredRuns")),1)]),e("div",va,[n[18]||(n[18]=e("div",{class:"theme-muted-text text-xs"},"last cleanup",-1)),e("div",xa,a(Z((je=(Ne=fe.value)==null?void 0:Ne.lastCleanup)==null?void 0:je.finishedAt)),1),e("p",pa,a(i(s)("settingsDialog.system.lastMaintenanceAt")),1)])])):h("",!0),e("div",ya,[e("div",_a,[e("div",fa,a(i(s)("settingsDialog.system.baseStatus")),1),e("div",ba,[e("div",Da,[n[19]||(n[19]=e("span",{class:"theme-muted-text"},"runner baseUrl",-1)),e("span",ka,a(((Fe=(Le=T.value)==null?void 0:Le.runner)==null?void 0:Fe.baseUrl)||"-"),1)]),e("div",wa,[n[20]||(n[20]=e("span",{class:"theme-muted-text"},"runner startedAt",-1)),e("span",Ca,a(Z((Ie=j.value)==null?void 0:Ie.startedAt)),1)]),e("div",Ta,[n[21]||(n[21]=e("span",{class:"theme-muted-text"},"last sweep",-1)),e("span",Ra,a(Z((Ve=(qe=_e.value)==null?void 0:qe.metrics)==null?void 0:Ve.lastSweepFinishedAt)),1)]),e("div",Sa,[n[22]||(n[22]=e("span",{class:"theme-muted-text"},"git diff worker",-1)),e("span",Pa,a(rt.value?i(s)("settingsDialog.system.available"):i(s)("settingsDialog.system.unknown")),1)]),e("div",Ea,[n[23]||(n[23]=e("span",{class:"theme-muted-text"},"db vacuum",-1)),e("span",Ma,a(Z((Ae=fe.value)==null?void 0:Ae.lastVacuumAt)),1)])])]),e("div",$a,[e("div",Ua,a(i(s)("settingsDialog.system.stopReasonTitle")),1),e("div",Ba,[(l(!0),r(O,null,z(dt.value,d=>(l(),r("div",{key:d.key,class:"flex items-center justify-between gap-3"},[e("span",Na,a(d.label),1),e("span",ja,a(d.value),1)]))),128))])])]),Y.value?(l(),r("div",La,[e("div",Fa,a(i(s)("settingsDialog.system.stopTimeoutPhaseTitle")),1),e("div",Ia,[(l(!0),r(O,null,z(ut.value,d=>(l(),r("div",{key:d.key,class:"flex items-center justify-between gap-3 rounded-sm border border-dashed border-[var(--theme-borderMuted)] px-2.5 py-2"},[e("span",qa,a(d.label),1),e("span",Va,a(d.value),1)]))),128))])])):h("",!0),!Y.value&&!V.value?(l(),r("div",Aa,[e("div",Ha,a(i(s)("settingsDialog.system.runnerUnavailable")),1),e("p",Oa,a(et((He=T.value)==null?void 0:He.runner,"settingsDialog.system.runnerUnavailableDescription")),1),e("p",za," baseUrl: "+a(((ze=(Oe=T.value)==null?void 0:Oe.runner)==null?void 0:ze.baseUrl)||"-"),1)])):h("",!0)])])):R.value==="shortcuts"?(l(),r("section",Ka,[e("div",null,[e("div",Wa,[L(i(Ge),{class:"h-4 w-4"}),e("span",null,a(i(s)("settingsDialog.shortcuts.title")),1)]),e("p",Ja,a(i(s)("settingsDialog.shortcuts.intro")),1)]),e("section",Ga,[(l(!0),r(O,null,z(it.value,d=>(l(),r("div",{key:d.id,class:"settings-form-card flex flex-col justify-between gap-3 px-3 py-3 sm:flex-row sm:items-center"},[e("div",Qa,[e("div",Xa,a(d.label),1),e("p",Ya,a(d.description),1)]),e("div",Za,[e("span",ei,a(d.mac),1),e("span",ti,a(d.windows),1)])]))),128)),e("p",si,a(i(s)("settingsDialog.shortcuts.note")),1)])])):(l(),r("section",ni,[e("div",null,[e("div",ai,a(i(s)("settingsDialog.about.title")),1),e("p",ii,a(i(s)("settingsDialog.about.intro")),1)]),e("section",oi,[e("div",li,[e("div",null,[e("div",ri,a(i(s)("settingsDialog.about.versionTitle")),1),e("p",ci,a(p.value||i(s)("settingsDialog.about.versionDescription")),1)]),e("span",di,a(F.value?i(s)("common.loading"):b.value?`v${b.value}`:i(s)("common.unavailable")),1)])])]))])]}),_:1},8,["open"]))}};export{_i as default};
|