dimcode-web 0.1.0-alpha.21 → 0.1.0-alpha.23
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/package.json +1 -1
- package/release-manifest.json +94 -94
- package/web/assets/AccountSettings-DF5hf1Ti.css +1 -0
- package/web/assets/AccountSettings-KJxLwnAQ.js +1 -0
- package/web/assets/{AgentSettings-C6opxYYo.js → AgentSettings-AtjhW1u9.js} +1 -1
- package/web/assets/{AppearanceSettings-BoOhVnFz.js → AppearanceSettings-B2hfRF8G.js} +1 -1
- package/web/assets/{ArchivedSettings-D5tDripk.js → ArchivedSettings-zfBiREJC.js} +1 -1
- package/web/assets/{CodeBlockNode-BigXVQAf.js → CodeBlockNode-C0MXs3Mw.js} +2 -2
- package/web/assets/{DiagnosticsSettings-DJcBCpEy.js → DiagnosticsSettings-3WeumMYl.js} +1 -1
- package/web/assets/{McpSettings-rHDDYrKl.js → McpSettings-8O2EQkfU.js} +1 -1
- package/web/assets/{ModalitySettings-DprOf77o.js → ModalitySettings-qp9qr-DE.js} +1 -1
- package/web/assets/{PermissionsSettings-DtADZ5dp.js → PermissionsSettings-DRaeZ5ry.js} +1 -1
- package/web/assets/{PluginSettings-DvJj4pme.js → PluginSettings-B_YwUXUy.js} +1 -1
- package/web/assets/{PreCodeBlock-Cs_v_zn2.js → PreCodeBlock-ChATSWPq.js} +1 -1
- package/web/assets/ProviderAuthFlow.vue_vue_type_script_setup_true_lang-BwVv780g.js +6 -0
- package/web/assets/ProviderSettings-CxnpSWBK.js +1 -0
- package/web/assets/ProviderSettings-Dem0jfRB.css +1 -0
- package/web/assets/ScheduledSettings-CNSQQAYZ.js +1 -0
- package/web/assets/{ScheduledSettings-voX1TYx5.css → ScheduledSettings-CPLRSMxF.css} +1 -1
- package/web/assets/{SettingsPage-B76s7xMI.js → SettingsPage-DIs3PPbX.js} +1 -1
- package/web/assets/{SkillSettings-BQ774cUK.js → SkillSettings-BI01BTVt.js} +1 -1
- package/web/assets/{Tooltip-B5X1Lr7y.js → Tooltip-ObkSf90_.js} +1 -1
- package/web/assets/{abnfDiagram-N423BO3Z-Budr7LDr.js → abnfDiagram-N423BO3Z-pIlACrRT.js} +1 -1
- package/web/assets/{arc-DmLVSho5.js → arc-agS2EdKv.js} +1 -1
- package/web/assets/{architectureDiagram-T3A2C74G-CZ9twOWw.js → architectureDiagram-T3A2C74G-hrd9AvKA.js} +1 -1
- package/web/assets/{arrow-left-Q8O22LEf.js → arrow-left-DMez556f.js} +1 -1
- package/web/assets/{blockDiagram-VBNYF7ZC-B6vsATAl.js → blockDiagram-VBNYF7ZC-BuKPFjea.js} +1 -1
- package/web/assets/{c4Diagram-5PPSVZJV-ZbBXLah8.js → c4Diagram-5PPSVZJV-BXJhp8Sw.js} +1 -1
- package/web/assets/channel-BWOS3_Qf.js +1 -0
- package/web/assets/{chunk-2GRJ4B5K-DCbPHDn9.js → chunk-2GRJ4B5K-Cm6dqK-Y.js} +1 -1
- package/web/assets/{chunk-2Q5K7J3B-q-A4RCdp.js → chunk-2Q5K7J3B-C_-X-KAN.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-B-mGURLT.js → chunk-5RXB4S5H-D-NnfZGZ.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-DFGchYlp.js → chunk-5VM5RSS4-IJ_i-zuI.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-0FNBovJD.js → chunk-6Q2QTUOP-D3VQN0jj.js} +1 -1
- package/web/assets/{chunk-GF5L2VYU-wi5f-cDY.js → chunk-GF5L2VYU-C2uoEo9L.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-C5DYyLY7.js → chunk-JWPE2WC7-B3JrwNpe.js} +1 -1
- package/web/assets/{chunk-KBJHAD2P-CoHVmRnB.js → chunk-KBJHAD2P-D0hr5xrP.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-DrN39PnO.js → chunk-RYQCIY6F-SwL94E05.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-CbRCRbeQ.js → chunk-XXDRQBXY-Cwup4DJz.js} +1 -1
- package/web/assets/classDiagram-JCYQIIEL-BEjQaM9K.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-BEjQaM9K.js +1 -0
- package/web/assets/{clock-3-CEcFQuW4.js → clock-3-ZiStq2y-.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-BqViSKnD.js → cose-bilkent-JH36ORCC-DFrmUkID.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-rMAZpWdi.js → cynefin-OW5HDTMX-Co06-7f6.js} +1 -1
- package/web/assets/{cynefinDiagram-MW4NZA55-BYSCyLEg.js → cynefinDiagram-MW4NZA55-Bu536scJ.js} +1 -1
- package/web/assets/{dagre-VZM6K2ZE-DMCK3aFx.js → dagre-VZM6K2ZE-D4cHzDFq.js} +1 -1
- package/web/assets/{diagram-7IWD3JNH-BFKte3Xm.js → diagram-7IWD3JNH-oovM8Sc7.js} +1 -1
- package/web/assets/{diagram-B4RE2ZJO-D9EupTSG.js → diagram-B4RE2ZJO-BdOdIOgB.js} +1 -1
- package/web/assets/{diagram-LBJQPF4R-DKIeq9be.js → diagram-LBJQPF4R-CjfEUzok.js} +1 -1
- package/web/assets/{diagram-Q27KOJAE-BOrnx2ed.js → diagram-Q27KOJAE-C6AZJ1Do.js} +1 -1
- package/web/assets/{diagram-UB23O5K3-D8lvv7G0.js → diagram-UB23O5K3-BUVY_zgS.js} +1 -1
- package/web/assets/{ebnfDiagram-BXEA7PRR-CGeZxtxl.js → ebnfDiagram-BXEA7PRR-Bl_DPMOL.js} +1 -1
- package/web/assets/{erDiagram-JOGREHBK-eGGkPfnP.js → erDiagram-JOGREHBK-CjrdFPg3.js} +1 -1
- package/web/assets/{flowDiagram-UKHOOZJN-p09UM-22.js → flowDiagram-UKHOOZJN-D9YAMCtz.js} +1 -1
- package/web/assets/{ganttDiagram-PKOTCBZU-SqulGI3A.js → ganttDiagram-PKOTCBZU-BZjsjDEI.js} +1 -1
- package/web/assets/{gitGraphDiagram-DS77QQ5N-DVBfe-CW.js → gitGraphDiagram-DS77QQ5N-DmJzxq0N.js} +1 -1
- package/web/assets/{index-lSaCQ5HQ.js → index-6bKx5FLu.js} +5 -5
- package/web/assets/{index-CTaNCPit.js → index-BEYRi-K7.js} +1 -1
- package/web/assets/{index-B0IMqptZ.css → index-Bkes3xCC.css} +1 -1
- package/web/assets/index-Dx0dig4j.js +251 -0
- package/web/assets/{index10-B9YpVOxp.js → index10-BwtjQn99.js} +1 -1
- package/web/assets/{index5-ZFdL0BRF.js → index5-7Gb8JgnB.js} +1 -1
- package/web/assets/{index6-DwYIp71E.js → index6-CtKexy1_.js} +1 -1
- package/web/assets/{index8-DNs0laJT.js → index8-VR16_ODJ.js} +1 -1
- package/web/assets/{index9-C76POzlM.js → index9-_nJa0ns1.js} +1 -1
- package/web/assets/{infoDiagram-6WML65LV-ClGQXzPV.js → infoDiagram-6WML65LV-BRlxsenA.js} +1 -1
- package/web/assets/{ishikawaDiagram-WSZJBQD7-kaFUTkwb.js → ishikawaDiagram-WSZJBQD7-Dn2JFwxS.js} +1 -1
- package/web/assets/{journeyDiagram-NVQOT4AX-BRpajxRG.js → journeyDiagram-NVQOT4AX-B6oYvZJd.js} +1 -1
- package/web/assets/{kanban-definition-27J2QSJJ-QTf_fpBx.js → kanban-definition-27J2QSJJ-Bv0r7KvM.js} +1 -1
- package/web/assets/{linear-BH8Hio3w.js → linear-tKjbaK9-.js} +1 -1
- package/web/assets/{markstream-9drg_IpK.js → markstream-BjjYM-oL.js} +2 -2
- package/web/assets/{mermaid.core-C9VqvILU.js → mermaid.core-B51U-Fe_.js} +4 -4
- package/web/assets/{mindmap-definition-FAOFIHXS-A67fKlRw.js → mindmap-definition-FAOFIHXS-7Mnvm5Ff.js} +1 -1
- package/web/assets/{pegDiagram-VL7TDLO6-BBjPwAwO.js → pegDiagram-VL7TDLO6-D_NG6zax.js} +1 -1
- package/web/assets/{pieDiagram-7S7Q4E2Y-B2O2_6Ql.js → pieDiagram-7S7Q4E2Y-CjKiVkku.js} +1 -1
- package/web/assets/{quadrantDiagram-CIZ2JOQS-9BnbLmnp.js → quadrantDiagram-CIZ2JOQS-CJUGbKH_.js} +1 -1
- package/web/assets/{railroadDiagram-AXF67PYL-4jnaEanA.js → railroadDiagram-AXF67PYL-DG1bLqc1.js} +1 -1
- package/web/assets/{refresh-cw-CdGjCYEi.js → refresh-cw-DjhCdimB.js} +1 -1
- package/web/assets/{requirementDiagram-LRYGKXZP-CE9rGQ5I.js → requirementDiagram-LRYGKXZP-D56CPqbp.js} +1 -1
- package/web/assets/{sankeyDiagram-W5VNT64P-BTub3bJG.js → sankeyDiagram-W5VNT64P-DZ2GHKGE.js} +1 -1
- package/web/assets/{sequenceDiagram-SI44F4Z6-CpY_fBT6.js → sequenceDiagram-SI44F4Z6-J_TEZjUz.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-DnJ1KeP_.js → sizeCapture-X5ZJPWSS-Cz7_0YL6.js} +1 -1
- package/web/assets/{stateDiagram-OKZ733FA-_5PCQD6y.js → stateDiagram-OKZ733FA-DXh9K0Bi.js} +1 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-iBah7iBd.js +1 -0
- package/web/assets/{swimlanes-SLNWSIFB-YeAoXX44.js → swimlanes-SLNWSIFB-I9_WGhlP.js} +2 -2
- package/web/assets/swimlanesDiagram-ULZ7WXOC-Bh3nmJRl.js +8 -0
- package/web/assets/{timeline-definition-Z64GVDOM-BLxnm5xB.js → timeline-definition-Z64GVDOM-BFlT-0N5.js} +1 -1
- package/web/assets/{vennDiagram-T6HMQDX7-SZnCg-5k.js → vennDiagram-T6HMQDX7-C8ase2Ip.js} +1 -1
- package/web/assets/{wardleyDiagram-T6FBY63Y-Cv3hfuMY.js → wardleyDiagram-T6FBY63Y-mTJRmNI-.js} +1 -1
- package/web/assets/{xychartDiagram-ELKLHX3M-Myh9al5x.js → xychartDiagram-ELKLHX3M-DnizrE8y.js} +1 -1
- package/web/assets/{zh-CN-CJTbN_T1.js → zh-CN-C34hOQsk.js} +1 -1
- package/web/dimcode-web.json +3 -3
- package/web/index.html +2 -2
- package/web/assets/AccountSettings-DnfPPG7u.css +0 -1
- package/web/assets/AccountSettings-nyVX4bl3.js +0 -1
- package/web/assets/ProviderAuthFlow.vue_vue_type_script_setup_true_lang-t8Pt_gCk.js +0 -6
- package/web/assets/ProviderSettings-Cc10ophS.css +0 -1
- package/web/assets/ProviderSettings-DwxeUHLU.js +0 -2
- package/web/assets/ScheduledSettings-D9YosCWp.js +0 -1
- package/web/assets/channel-S4MqItxT.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-DUDCefSy.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-DUDCefSy.js +0 -1
- package/web/assets/index-NdaMpp0K.js +0 -249
- package/web/assets/stateDiagram-v2-UEYNNEHI-CUP19cPR.js +0 -1
- package/web/assets/swimlanesDiagram-ULZ7WXOC-BmGPOH52.js +0 -8
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-6bKx5FLu.js","assets/vendor-vue-BSuwZuJF.js","assets/SettingsPage-DIs3PPbX.js","assets/context-B95juZL3.js","assets/arrow-left-DMez556f.js","assets/clock-3-ZiStq2y-.js","assets/AccountSettings-KJxLwnAQ.js","assets/settings-general-qm23fkZo.js","assets/ProviderAuthFlow.vue_vue_type_script_setup_true_lang-BwVv780g.js","assets/refresh-cw-DjhCdimB.js","assets/AccountSettings-DF5hf1Ti.css","assets/AppearanceSettings-B2hfRF8G.js","assets/AppearanceSettings-WVGDYAhR.css","assets/AgentSettings-AtjhW1u9.js","assets/GeneralSettingsStatus.vue_vue_type_script_setup_true_lang-C2v20RcN.js","assets/ProviderSettings-CxnpSWBK.js","assets/ProviderSettings-Dem0jfRB.css","assets/ModalitySettings-qp9qr-DE.js","assets/McpSettings-8O2EQkfU.js","assets/McpSettings-Dl7iog2J.css","assets/PluginSettings-B_YwUXUy.js","assets/PluginSettings-DziS_TZL.css","assets/SkillSettings-BI01BTVt.js","assets/SkillSettings-OqERafmE.css","assets/PermissionsSettings-DRaeZ5ry.js","assets/PermissionsSettings-aVsQzgZQ.css","assets/ScheduledSettings-CNSQQAYZ.js","assets/ScheduledSettings-CPLRSMxF.css","assets/ArchivedSettings-zfBiREJC.js","assets/ArchivedSettings-CbpGcugQ.css","assets/DiagnosticsSettings-3WeumMYl.js","assets/DiagnosticsSettings-Bf1nv4em.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var jn=Object.defineProperty;var Bn=(s,t,e)=>t in s?jn(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var ve=(s,t,e)=>Bn(s,typeof t!="symbol"?t+"":t,e);import{$ as ss,d as _e,c,m as je,F as ne,C as pe,o as d,e as u,n as Mt,a7 as Fn,a8 as vt,r as P,z as E,w as $e,a9 as Is,H as Wt,f as ye,u as a,h as ae,t as h,aa as ft,B as Ee,j as G,a as z,l as Ne,R as ut,k as We,b as be,P as Vt,x as ot,g as it,K as At,ab as Wn,q as He,Q as rs,a3 as ns,y as Vn,O as Ut,V as $s,W as Un,a1 as xs,T as Hn,a6 as Kn,ac as Cs,ad as Qn,ae as Gn,af as Jn,ag as Yn}from"./vendor-vue-BSuwZuJF.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function e(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=e(o);fetch(o.href,i)}})();/**
|
|
3
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const Xn=s=>{for(const t in s)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
8
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/const Ss=s=>s==="";/**
|
|
13
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/const Zn=(...s)=>s.filter((t,e,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===e).join(" ").trim();/**
|
|
18
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
19
|
+
*
|
|
20
|
+
* This source code is licensed under the ISC license.
|
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
+
*/const Es=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
23
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the ISC license.
|
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/const eo=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,e,n)=>n?n.toUpperCase():e.toLowerCase());/**
|
|
28
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
29
|
+
*
|
|
30
|
+
* This source code is licensed under the ISC license.
|
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
+
*/const to=s=>{const t=eo(s);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
33
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*/var Et={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
38
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the ISC license.
|
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/const so=({name:s,iconNode:t,absoluteStrokeWidth:e,"absolute-stroke-width":n,strokeWidth:o,"stroke-width":i,size:r=Et.width,color:l=Et.stroke,...m},{slots:v})=>ss("svg",{...Et,...m,width:r,height:r,stroke:l,"stroke-width":Ss(e)||Ss(n)||e===!0||n===!0?Number(o||i||Et["stroke-width"])*24/Number(r):o||i||Et["stroke-width"],class:Zn("lucide",m.class,...s?[`lucide-${Es(to(s))}-icon`,`lucide-${Es(s)}`]:["lucide-icon"]),...!v.default&&!Xn(m)&&{"aria-hidden":"true"}},[...t.map(_=>ss(..._)),...v.default?[v.default()]:[]]);/**
|
|
43
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/const fe=(s,t)=>(e,{slots:n,attrs:o})=>ss(so,{...o,...e,iconNode:t,name:s},n);/**
|
|
48
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
49
|
+
*
|
|
50
|
+
* This source code is licensed under the ISC license.
|
|
51
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
+
*/const no=fe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
53
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the ISC license.
|
|
56
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/const $t=fe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
58
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the ISC license.
|
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/const Dt=fe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
63
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const Nt=fe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
68
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const oo=fe("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
73
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const io=fe("circle-slash-2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}]]);/**
|
|
78
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const an=fe("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
83
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const ao=fe("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);/**
|
|
88
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const ro=fe("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
93
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const os=fe("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
98
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const gt=fe("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);/**
|
|
103
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const lo=fe("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
|
|
108
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const co=fe("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
113
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const uo=fe("list-tree",[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]);/**
|
|
118
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const Ht=fe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
123
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const po=fe("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);/**
|
|
128
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const rn=fe("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);/**
|
|
133
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const ho=fe("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]);/**
|
|
138
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const mo=fe("panel-left-close",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
143
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const vo=fe("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
148
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const ls=fe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
153
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const fo=fe("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]);/**
|
|
158
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const go=fe("quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
|
|
163
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const bo=fe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
168
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const ds=fe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/**
|
|
173
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const yo=fe("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
178
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const ko=fe("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
183
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const wo=fe("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
188
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const _o=fe("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);/**
|
|
193
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const Io=fe("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
198
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const $o=fe("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
203
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const xo=fe("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
|
|
208
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Co=fe("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]);/**
|
|
213
|
+
* @license lucide-vue-next v0.577.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const yt=fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),cs={en:{confirm:"Confirm",providerName:"Provider name",apiProtocol:"API protocol",providerAuth:{bearer:"Bearer token",api_key:"API key header",custom_header:"Custom header",anonymous:"No authentication",aws_bedrock:"AWS credentials"},enableProvider:"Enable provider",signedIn:"Signed in",providerSaved:"Saved {name}.",saveProvider:"Save provider",providerModelCount:"{count} model | {count} models",addCustomProvider:"Add custom provider",searchProvider:"Search providers",storedKeyAtNewUrl:"The new API URL can receive your stored credential when you test or save this change.",providerProbeResult:"Connection succeeded. Found {count} model. | Connection succeeded. Found {count} models.",noModelsRefresh:"No models yet. Refresh the model list to fetch them.",noModelsAdd:"No models yet. Add a model by its ID.",noProviderModels:"This provider has no models.",refreshModelList:"Refresh model list",modelListRefreshed:"Model list refreshed",modelRefreshFailed:"Model list refresh failed: {reason}",scheduled:"Scheduled tasks",settings:"Settings",account:"Account",appearance:"Appearance",agent:"Agent defaults",providers:"Providers",modality:"Modality",mcp:"MCP",plugins:"Plugins",skills:"Skills",permissions:"Permissions",archived:"Archived sessions",diagnostics:"Diagnostics",back:"Back",cancel:"Cancel",save:"Save changes",saving:"Saving…",loading:"Loading…",refresh:"Refresh",retry:"Retry",close:"Close",search:"Search providers or models",add:"Add provider",custom:"Custom provider",configured:"Configured",connected:"Connected",signedOut:"Not signed in",enabled:"Enabled",disabled:"Disabled",enable:"Enable",disable:"Disable",remove:"Delete",edit:"Edit",reset:"Reset",name:"Name",id:"ID",models:"Models",noModels:"No models. Refresh the catalog or add a model.",noProviders:"No providers configured. Add one to get started.",noResults:"No matches",connection:"Connection",driver:"Adapter",baseUrl:"Base URL",apiKey:"API key",keepSecret:"Leave blank to keep the existing secret",clearSecret:"Remove stored credential",headers:"Headers",headerName:"Header name",headerValue:"New header value",addHeader:"Add header",proxy:"Proxy URL",timeout:"Timeout (ms)",default:"Default",probe:"Test connection",probeResult:"Connection succeeded. Models found:",create:"Create",modelIds:"Model IDs (one per line)",addModel:"Add model",modelId:"Model ID",context:"Context window",output:"Max output tokens",tools:"Tool calling",vision:"Vision",reasoning:"Reasoning",effort:"Reasoning effort",tier:"Service tier",endpoint:"Endpoint override",inherit:"Use provider default",preferences:"Model preferences",unavailable:"Unavailable",knownProviders:"Available providers",authType:"Authentication",headerPrefix:"Header prefix",secretRequired:"A credential is required before enabling this provider.",conflict:"The provider changed. Reload before saving again; your draft has been preserved.",discard:"Discard unsaved changes?",deleteConfirm:"Delete this provider and its saved configuration?",modelDeleteConfirm:"Delete this model?",resetConfirm:"Reset this model to the provider defaults?",signOutConfirm:"Sign out of this provider on the CLI host?",accountDescription:"Your Dim account is shared with the CLI on this host.",providerDescription:"Connect accounts and API providers, and manage the models available in chat.",signIn:"Sign in to Dim",login:"Sign in",enterprise:"Enterprise sign-in",email:"Enterprise email",browser:"Browser",device:"Device code",openAuth:"Open authorization page",copy:"Copy",copied:"Copied",callback:"Authorization callback URL",callbackHint:"After authorization, copy the full localhost redirect URL from your browser and paste it here. It also works when the browser and CLI are on different machines.",finish:"Complete sign-in",waiting:"Waiting for authorization…",expired:"This sign-in attempt expired. Start again.",cancelled:"Sign-in cancelled.",failed:"Sign-in failed. Try again.",expires:"Expires",signOut:"Sign out",plan:"Plan and usage",credits:"Credits",unlimited:"Unlimited",remaining:"Remaining",usageUnavailable:"Usage could not be loaded",viewPlan:"View plan",choosePlan:"Choose a plan",region:"Account region",cn:"China",global:"Global",uid:"User ID",accountUnavailable:"This CLI build has no Dim account provider. Use an account-enabled build to sign in.",missingMethod:"This server does not support this settings action. Update the CLI and reconnect.",reload:"Reload",unknownLimits:"Not declared",advanced:"Advanced",modelDescription:"Changes apply to future model selections; existing sessions retain their configuration.",status:"Status",working:"Working…",referral:"Invite friends",resetCredits:"Usage reset credits"},"zh-CN":{confirm:"确认",providerName:"提供商名称",apiProtocol:"API 协议",providerAuth:{bearer:"Bearer 令牌",api_key:"API 密钥请求头",custom_header:"自定义请求头",anonymous:"无需认证",aws_bedrock:"AWS 凭据"},enableProvider:"启用提供商",signedIn:"已登录",providerSaved:"已保存 {name}。",saveProvider:"保存提供商",providerModelCount:"{count} 个模型",addCustomProvider:"添加自定义提供商",searchProvider:"搜索提供商",storedKeyAtNewUrl:"测试或保存此更改时,已存储的凭据可能会发送到新的 API 地址。",providerProbeResult:"连接成功,找到 {count} 个模型。",noModelsRefresh:"暂无模型。选择「刷新模型列表」从提供商拉取。",noModelsAdd:"暂无模型。可通过模型 ID 添加。",noProviderModels:"此提供商暂无模型。",refreshModelList:"刷新模型列表",modelListRefreshed:"模型列表已刷新",modelRefreshFailed:"刷新模型列表失败:{reason}",scheduled:"定时任务",settings:"设置",account:"账户",appearance:"外观",agent:"Agent 默认设置",providers:"模型提供商",modality:"多模态",mcp:"MCP",plugins:"插件",skills:"技能",permissions:"权限",archived:"已归档会话",diagnostics:"诊断",back:"返回",cancel:"取消",save:"保存更改",saving:"保存中…",loading:"加载中…",refresh:"刷新",retry:"重试",close:"关闭",search:"搜索提供商或模型",add:"添加提供商",custom:"自定义提供商",configured:"已配置",connected:"已连接",signedOut:"未登录",enabled:"已启用",disabled:"已禁用",enable:"启用",disable:"禁用",remove:"删除",edit:"编辑",reset:"重置",name:"名称",id:"ID",models:"模型",noModels:"暂无模型,请刷新模型列表或手动添加。",noProviders:"尚未配置提供商,添加一个即可开始使用。",noResults:"没有匹配项",connection:"连接配置",driver:"适配器",baseUrl:"接口地址",apiKey:"API 密钥",keepSecret:"留空保留已有密钥",clearSecret:"移除已存储的凭据",headers:"请求头",headerName:"请求头名称",headerValue:"新的请求头值",addHeader:"添加请求头",proxy:"代理地址",timeout:"超时时间(毫秒)",default:"默认",probe:"测试连接",probeResult:"连接成功,发现模型:",create:"创建",modelIds:"模型 ID(每行一个)",addModel:"添加模型",modelId:"模型 ID",context:"上下文窗口",output:"最大输出 Token",tools:"工具调用",vision:"视觉",reasoning:"推理",effort:"推理强度",tier:"服务等级",endpoint:"端点覆盖",inherit:"使用提供商默认值",preferences:"模型偏好",unavailable:"不可用",knownProviders:"可用提供商",authType:"认证方式",headerPrefix:"请求头前缀",secretRequired:"启用此提供商前需要配置凭据。",conflict:"提供商配置已变更。请重新加载后再保存,当前草稿已保留。",discard:"放弃未保存的更改?",deleteConfirm:"删除此提供商及其已保存的配置?",modelDeleteConfirm:"删除此模型?",resetConfirm:"将此模型重置为提供商默认配置?",signOutConfirm:"退出 CLI 主机上此提供商的登录?",accountDescription:"Dim 账户与此主机上的 CLI 共享。",providerDescription:"连接账户和 API 提供商,管理聊天中可用的模型。",signIn:"登录 Dim",login:"登录",enterprise:"企业登录",email:"企业邮箱",browser:"浏览器",device:"设备码",openAuth:"打开授权页面",copy:"复制",copied:"已复制",callback:"授权回调 URL",callbackHint:"授权后,从浏览器地址栏复制完整的 localhost 回调地址并粘贴到这里。浏览器和 CLI 不在同一台机器时也可使用。",finish:"完成登录",waiting:"等待授权…",expired:"本次登录已过期,请重新开始。",cancelled:"已取消登录。",failed:"登录失败,请重试。",expires:"到期时间",signOut:"退出登录",plan:"套餐与用量",credits:"额度",unlimited:"无限制",remaining:"剩余",usageUnavailable:"无法加载用量",viewPlan:"查看套餐",choosePlan:"选择套餐",region:"账户区域",cn:"中国",global:"全球",uid:"用户 ID",accountUnavailable:"当前 CLI 构建未包含 Dim 账户提供商,请使用支持账户登录的构建。",missingMethod:"服务端不支持此设置操作,请更新 CLI 后重新连接。",reload:"重新加载",unknownLimits:"未声明",advanced:"高级设置",modelDescription:"更改在之后选择模型时生效,已有会话保留其配置。",status:"状态",working:"处理中…",referral:"邀请好友",resetCredits:"用量重置额度"}},So=["d"],Eo=_e({__name:"BrandMark",props:{animated:{type:Boolean,default:!1}},setup(s){const t=[{delay:"-1.6s",d:"M52.042 34C50.8561 34.0001 49.8945 34.9615 49.8945 36.1475V46.1689C49.8946 47.3549 50.8561 48.3163 52.042 48.3164H77.958C79.144 48.3164 80.1054 47.3549 80.1055 46.1689V36.1475C80.1055 34.9615 79.144 34 77.958 34H52.042Z"},{delay:"-1.333s",d:"M83.8311 49.8945C82.6452 49.8947 81.6836 50.8561 81.6836 52.042V62.0635C81.6838 63.2493 82.6453 64.2108 83.8311 64.2109H93.8525C95.0384 64.2109 95.9998 63.2493 96 62.0635V52.042C96 50.856 95.0385 49.8945 93.8525 49.8945H83.8311Z"},{delay:"-1.067s",d:"M83.8311 65.7891C82.6453 65.7892 81.6838 66.7508 81.6836 67.9365V77.958C81.6836 79.1439 82.6452 80.1053 83.8311 80.1055H93.8525C95.0385 80.1055 96 79.144 96 77.958V67.9365C95.9998 66.7507 95.0384 65.7891 93.8525 65.7891H83.8311Z"},{delay:"-0.8s",d:"M52.042 81.6836C50.8561 81.6837 49.8946 82.6452 49.8945 83.8311V93.8525C49.8945 95.0385 50.8561 95.9999 52.042 96H77.958C79.144 96 80.1055 95.0385 80.1055 93.8525V83.8311C80.1054 82.6451 79.1439 81.6836 77.958 81.6836H52.042Z"},{delay:"-0.533s",d:"M36.1475 65.7891C34.9616 65.7891 34.0002 66.7507 34 67.9365V77.958C34 79.144 34.9615 80.1055 36.1475 80.1055H46.1689C47.3548 80.1054 48.3164 79.1439 48.3164 77.958V67.9365C48.3162 66.7507 47.3547 65.7892 46.1689 65.7891H36.1475Z"},{delay:"-0.267s",d:"M36.1475 49.8945C34.9615 49.8945 34 50.856 34 52.042V62.0635C34.0002 63.2493 34.9616 64.2109 36.1475 64.2109H46.1689C47.3547 64.2108 48.3162 63.2493 48.3164 62.0635V52.042C48.3164 50.8561 47.3548 49.8946 46.1689 49.8945H36.1475Z"}];return(e,n)=>(d(),c("svg",{viewBox:"34 34 62 62","aria-hidden":"true",class:je(["brand-mark",{"is-animated":s.animated}])},[(d(),c(ne,null,pe(t,o=>u("path",{key:o.d,fill:"currentColor",d:o.d,style:Mt({animationDelay:o.delay})},null,12,So)),64))],2))}}),Re=(s,t)=>{const e=s.__vccOpts||s;for(const[n,o]of t)e[n]=o;return e},Kt=Re(Eo,[["__scopeId","data-v-44bc694b"]]),Ms=4,ue="main";class Ae extends Error{constructor(){super(...arguments);ve(this,"name","ProtocolError")}}function xe(s,t){throw new Ae(`Invalid ${s}: expected ${t}`)}function N(s,t){return(s===null||typeof s!="object"||Array.isArray(s))&&xe(t,"an object"),s}function ke(s,t){return Array.isArray(s)||xe(t,"an array"),s}function S(s,t,e){const n=s[t];return typeof n!="string"&&xe(`${e}.${t}`,"a string"),n}function Pe(s,t,e){return s[t]===void 0||s[t]===null?void 0:S(s,t,e)}function re(s,t,e){const n=s[t];return(typeof n!="number"||!Number.isSafeInteger(n)||n<0)&&xe(`${e}.${t}`,"a nonnegative safe integer"),n}function Mo(s,t,e){return s[t]===void 0||s[t]===null?void 0:re(s,t,e)}function Lt(s,t,e){const n=s[t];return(typeof n!="number"||!Number.isFinite(n)||n<0)&&xe(`${e}.${t}`,"a nonnegative number"),n}function Qe(s,t,e){const n=s[t];return typeof n!="boolean"&&xe(`${e}.${t}`,"a boolean"),n}function Qt(s,t){const e=N(s,t);return{providerId:S(e,"providerId",t),modelId:S(e,"modelId",t)}}function To(s,t){if(s==null)return;const e=N(s,t),n=Pe(e,"serverMessage",t),o=Pe(e,"requestId",t),i=Pe(e,"action",t);return{source:S(e,"source",t),reason:S(e,"reason",t),...n===void 0?{}:{serverMessage:n},...o===void 0?{}:{requestId:o},...i===void 0?{}:{action:i}}}function qo(s,t){if(s==null)return;const e=N(s,t),n=e.status===void 0||e.status===null?void 0:re(e,"status",t),o=Pe(e,"providerCode",t),i=Pe(e,"requestId",t),r=Pe(e,"reason",t),l=e.retryAfterMs===void 0||e.retryAfterMs===null?void 0:re(e,"retryAfterMs",t),m=e.cause===void 0||e.cause===null?[]:ke(e.cause,`${t}.cause`).map((v,_)=>(typeof v!="string"&&xe(`${t}.cause[${_}]`,"a string"),v));return{kind:S(e,"kind",t),...n===void 0?{}:{status:n},...o===void 0?{}:{providerCode:o},...i===void 0?{}:{requestId:i},...r===void 0?{}:{reason:r},cause:m,attempts:re(e,"attempts",t),waitedMs:re(e,"waitedMs",t),...l===void 0?{}:{retryAfterMs:l}}}function Ao(s,t){if(s==null)return;const e=N(s,t),n=Pe(e,"reason",t);return{attempt:re(e,"attempt",t),maxAttempts:re(e,"maxAttempts",t),retryAtMs:re(e,"retryAtMs",t),kind:S(e,"kind",t),...n===void 0?{}:{reason:n}}}function Lo(s){const t=N(s,"hello");return{instanceId:S(t,"instanceId","hello"),serverVersion:S(t,"serverVersion","hello"),protocolVersion:re(t,"protocolVersion","hello"),features:ke(t.features,"hello.features").map((e,n)=>(typeof e!="string"&&xe(`hello.features[${n}]`,"a string"),e))}}function mt(s){N(s,"reply")}function us(s){const t="session.methods";return ke(N(s,t).methods,`${t}.methods`).map((e,n)=>S(N(e,`${t}.methods[${n}]`),"name",`${t}.methods[${n}]`))}function Ro(s){const t="session.context.compact",e=N(s,t),n=S(e,"status",t);if(n==="completed")return{status:n};if(n==="skipped")return{status:n,reason:S(e,"reason",t)};xe(`${t}.status`,"completed or skipped")}function Oo(s){const t="session.context.usage",e=N(s,t);return{contextWindow:Lt(e,"contextWindow",t),outputTokens:Lt(e,"outputTokens",t),thresholdTokens:Lt(e,"thresholdTokens",t),estimatedInputTokens:Lt(e,"estimatedInputTokens",t),baselineSource:S(e,"baselineSource",t)}}function Po(s){return S(N(s,"session.fork"),"sessionId","session.fork")}function ln(s,t){const e=s.title===null?null:S(s,"title",t),n=s.titleSource;return n!==null&&n!=="auto"&&n!=="manual"&&xe(`${t}.titleSource`,"auto, manual or null"),e===null!=(n===null)&&xe(`${t}.titleSource`,"null exactly when title is null"),{title:e,titleSource:n,titleRevision:re(s,"titleRevision",t)}}function dn(s){return ke(s,"session.summaries").map((t,e)=>{const n=`session.summaries[${e}]`,o=N(t,n),i=Pe(o,"preview",n),r=Pe(o,"origin",n);r!==void 0&&r!=="client"&&r!=="acp"&&r!=="internal"&&r!=="unknown"&&r!=="automation"&&xe(`${n}.origin`,"client, acp, internal, unknown or automation");const l=Pe(o,"parentSessionId",n);return{...ln(o,n),sessionId:S(o,"sessionId",n),cwd:S(o,"cwd",n),model:Qt(o.model,`${n}.model`),createdAt:re(o,"createdAt",n),running:Qe(o,"running",n),sequence:re(o,"sequence",n),...i===void 0?{}:{preview:i},...r===void 0?{}:{origin:r},...l===void 0?{}:{parentSessionId:l},updatedAt:re(o,"updatedAt",n)}})}function zo(s){const t=N(s,"session.create");return{sessionId:S(t,"sessionId","session.create"),model:Qt(t.model,"session.create.model"),sequence:re(t,"sequence","session.create")}}function Do(s){const t=N(s,"session.branch_create"),e=N(t.branch,"session.branch_create.branch"),n="session.branch_create.branch";return{branchId:S(e,"branchId",n),...e.parentBranchId===void 0||e.parentBranchId===null?{}:{parentBranchId:S(e,"parentBranchId",n)},...e.branchPoint===void 0||e.branchPoint===null?{}:{branchPoint:re(e,"branchPoint",n)},...e.createEvent===void 0||e.createEvent===null?{}:{createEvent:re(e,"createEvent",n)}}}function No(s){const t=N(s,"session.history");return{events:ke(t.events,"session.history.events").map((e,n)=>jt(e,`session.history.events[${n}]`)),through:re(t,"through","session.history"),nextAfter:re(t,"nextAfter","session.history"),done:Qe(t,"done","session.history"),...t.nextBefore===void 0?{}:{nextBefore:re(t,"nextBefore","session.history")},...t.turnStart===void 0?{}:{turnStart:re(t,"turnStart","session.history")}}}function jo(s){const t="session.history.display",e=N(s,t);return{events:ke(e.items,`${t}.items`).map((n,o)=>jt(n,`${t}.items[${o}]`)),through:re(e,"through",t),nextAfter:re(e,"nextAfter",t),done:Qe(e,"done",t),...e.nextBefore===void 0?{}:{nextBefore:re(e,"nextBefore",t)},...e.turnStart===void 0?{}:{turnStart:re(e,"turnStart",t)}}}function Bo(s){const t=N(s,"session.model.update");return{model:Qt(t.model,"session.model.update.model"),outcome:S(t,"outcome","session.model.update")}}function Fo(s,t){return s==="read-only"||s==="workspace-write"||s==="full-access"?s:xe(t,"a permission preset")}function cn(s,t){const e=N(s,t),n=o=>ke(e[o],`${t}.${o}`).map((i,r)=>(typeof i!="string"&&xe(`${t}.${o}[${r}]`,"a string"),i));return{preset:Fo(e.preset,`${t}.preset`),allowedTools:n("allowedTools"),disallowedTools:n("disallowedTools")}}function Ts(s){const t="session.permission.get",e=N(s,t);return{version:re(e,"version",t),policy:cn(e.policy,`${t}.policy`)}}function Wo(s){return re(N(s,"session.permission.update"),"version","session.permission.update")}function Vo(s){const t="session.files.search";return ke(N(s,t).candidates,`${t}.candidates`).map((e,n)=>{const o=`${t}.candidates[${n}]`,i=N(e,o);return{relativePath:S(i,"relativePath",o),absolutePath:S(i,"absolutePath",o),dir:Qe(i,"dir",o)}})}function Uo(s){return S(N(s,"attachment.put"),"path","attachment.put")}function Ho(s){return S(N(s,"session.model.update"),"outcome","session.model.update")}function Ko(s){const t=N(s,"provider.list");return ke(t.providers,"provider.list.providers").map((e,n)=>{const o=`provider.list.providers[${n}]`,i=N(e,o);return{providerId:S(i,"providerId",o),displayName:S(i,"displayName",o),enabled:Qe(i,"enabled",o),credentialConfigured:Qe(i,"credentialConfigured",o)}})}function Qo(s){return ke(s,"account.providers").map((t,e)=>{const n=`account.providers[${e}]`,o=N(t,n);return{providerId:S(o,"providerId",n),displayName:S(o,"displayName",n)}})}function Go(s,t){const e=s.metadata===void 0||s.metadata===null?void 0:N(s.metadata,`${t}.metadata`),n=(e==null?void 0:e.reasoning)===void 0||e.reasoning===null?void 0:N(e.reasoning,`${t}.metadata.reasoning`);if(n===void 0||n.supported!==!0||N(s.capabilities,`${t}.capabilities`).reasoning!==!0)return;const i=n.effortOptions===void 0||n.effortOptions===null?[]:ke(n.effortOptions,`${t}.metadata.reasoning.effortOptions`).map((r,l)=>(typeof r!="string"&&xe(`${t}.metadata.reasoning.effortOptions[${l}]`,"a string"),r));return n.off!==void 0&&n.off!==null&&!i.includes("none")&&i.push("none"),i}function Jo(s){const t=N(s,"provider.catalog");if(t.catalog===null)return;const e=N(t.catalog,"provider.catalog.catalog");return{models:ke(e.models,"provider.catalog.models").map((n,o)=>{const i=`provider.catalog.models[${o}]`,r=N(n,i),l=Pe(r,"unavailableReason",i),m=Go(r,i);return{id:S(r,"id",i),name:S(r,"name",i),...l===void 0?{}:{unavailableReason:l},...m===void 0?{}:{reasoningEfforts:m}}}),disabledModelIds:ke(e.disabledModelIds,"provider.catalog.disabledModelIds").map((n,o)=>(typeof n!="string"&&xe(`provider.catalog.disabledModelIds[${o}]`,"a string"),n))}}function Yo(s){const t=N(s,"provider.selection");if(t.selection===null)return;const e=N(t.selection,"provider.selection.selection");return{providerId:S(e,"provider_id","provider.selection"),modelId:S(e,"model_id","provider.selection")}}function un(s,t){return{content:ke(s.content,`${t}.content`).map((e,n)=>N(e,`${t}.content[${n}]`))}}function Xo(s){const t="session.input.withdraw",e=S(N(s,t),"status",t);if(e==="deleted"||e==="notHeld")return{status:e};xe(`${t}.status`,"deleted or notHeld")}const Yt='<dim-skill name="';function Zo(s){if(!s.startsWith(Yt))return;const t=s.indexOf('"',Yt.length);if(!(t<0))return s.slice(Yt.length,t).replaceAll("<","<").replaceAll(">",">").replaceAll(""",'"').replaceAll("&","&")}const ei=["dim-hooks","dim-skill"];function ti(s,t){if(!(s===0||!t.startsWith("<")))return ei.find(e=>{if(!t.startsWith(`<${e}`))return!1;const n=t.slice(e.length+1);return n.startsWith(">")||/^\s/.test(n)})}function pn(s,t){const e=[],n=[];let o=0;return ke(s,t).forEach((i,r)=>{const l=N(i,`${t}[${r}]`);if(l.type!=="text"||typeof l.text!="string")return;const m=ti(r,l.text);if(m==="dim-skill"){const v=Zo(l.text);if(v!==void 0){n.push(v);return}}if(m==="dim-hooks"){o+=1;return}e.push(l.text)}),{text:e.join(`
|
|
218
|
+
`),skills:n,hooks:o}}function si(s,t){return ke(s,t).flatMap((e,n)=>{const o=N(e,`${t}[${n}]`);return o.type==="text"?[S(o,"text",`${t}[${n}]`)]:[]}).join(`
|
|
219
|
+
`)}function qs(s,t){const e=N(s,t),n=typeof e.content=="string"?e.content:si(e.content,`${t}.content`),o=e.structuredContent===void 0||e.structuredContent===null?void 0:N(e.structuredContent,`${t}.structuredContent`),i=typeof(o==null?void 0:o.diff)=="string"?o.diff:void 0;return{text:n,isError:e.isError===!0,...i===void 0?{}:{diff:i}}}function ni(s,t){return s==null?[]:ke(s,t).flatMap((e,n)=>{const o=N(e,`${t}[${n}]`);if(o.type!=="raw")return[];const i=Pe(o,"key",`${t}[${n}]`);return[{text:S(o,"text",`${t}[${n}]`),...i===void 0?{}:{key:i},retire:o.retire===!0}]})}function Xt(s,t){const e=N(s,t),n=S(e,"kind",t);return n==="tool"?{kind:n,turnId:S(e,"turn_id",t),requestId:S(e,"request_id",t),callId:S(e,"call_id",t)}:n==="host"?{kind:n,operationId:S(e,"operation_id",t)}:xe(t,"a branch source")}function oi(s,t){const e=N(s,t);switch(S(e,"kind",t)){case"sequence":return re(e,"sequence",t);case"create":return;default:return xe(t,"a branch cut")}}function ii(s,t,e,n){switch(`${s}/${t}`){case"input/message":{const o=ni(e.blocks,`${n}.blocks`);if(e.user===void 0||e.user===null){if(o.length===0)return{kind:"input",blocks:o};const v=Pe(e,"mode",n);return{kind:"source-input",text:o.map(f=>f.text).find(f=>f.startsWith("<dim-branch-"))??o[0].text,blocks:o,...v===void 0?{}:{mode:v}}}const i=N(e.user,`${n}.user`),{text:r,skills:l,hooks:m}=pn(i.content,`${n}.user.content`);return{kind:"input",text:r,user:un(i,`${n}.user`),skills:l.length===0?void 0:l,...m===0?{}:{hooks:m},blocks:o}}case"input/applied":return{kind:"input-applied",inputId:S(e,"input_id",n)};case"input/consumed":return{kind:"input-consumed",inputId:S(e,"input_id",n)};case"permission/changed":return{kind:"permission-changed",policy:cn(e.policy,`${n}.policy`)};case"input/deleted":return{kind:"input-deleted",inputId:S(e,"input_id",n)};case"branch/start":return{kind:"branch-start"};case"session/forked":return{kind:"session-forked"};case"branch/create":return{kind:"branch-create",branchId:S(e,"branch",n),at:oi(e.at,`${n}.at`),prompt:S(e,"prompt",n),source:Xt(e.source,`${n}.source`)};case"branch/create-failed":{const o=S(e,"status",n);return o!=="failed"&&o!=="cancelled"&&xe(`${n}.status`,"a creation outcome"),{kind:"branch-create-failed",branchId:S(e,"branch",n),status:o,error:S(e,o==="failed"?"error":"reason",n)}}case"branch/end":return{kind:"branch-end",source:Xt(e.source,`${n}.source`),...e.ancestor===void 0||e.ancestor===null?{}:{ancestor:S(e,"ancestor",n)}};case"branch/ended":return{kind:"branch-ended",branchId:S(e,"branch",n),source:Xt(e.source,`${n}.source`),...e.ancestor===void 0||e.ancestor===null?{}:{ancestor:S(e,"ancestor",n)}};case"turn/end":{const o=S(e,"status",n);o!=="completed"&&o!=="failed"&&o!=="cancelled"&&xe(`${n}.status`,"a turn outcome");const i=o==="failed"?S(e,"error",n):void 0;return{kind:"turn-end",outcome:o,...i===void 0?{}:{error:i}}}case"step/model-start":return{kind:"model-start",requestId:S(e,"request_id",n)};case"step/thinking":return{kind:"thinking",requestId:S(e,"request_id",n),delta:S(e,"delta",n)};case"step/text":return{kind:"text",requestId:S(e,"request_id",n),delta:S(e,"delta",n)};case"step/tool-use-start":return{kind:"tool-use-start",requestId:S(e,"request_id",n),callId:S(e,"call_id",n),name:S(e,"name",n)};case"step/tool-call":return{kind:"tool-call",requestId:S(e,"request_id",n),asks:hn(ke(e.calls,`${n}.calls`),`${n}.calls`)};case"step/tool-use":{const o=N(e.call,`${n}.call`);return{kind:"tool-use",requestId:S(e,"request_id",n),callId:S(o,"id",`${n}.call`),name:S(o,"name",`${n}.call`),input:N(o.input,`${n}.call.input`)}}case"step/tool-completed":return{kind:"tool-completed",requestId:S(e,"request_id",n),callId:S(e,"call_id",n),result:qs(e.result,`${n}.result`)};case"step/tool-result":return{kind:"tool-result",requestId:S(e,"request_id",n),results:ke(e.results,`${n}.results`).map((o,i)=>{const r=N(o,`${n}.results[${i}]`);return{callId:S(r,"call_id",`${n}.results[${i}]`),result:qs(r.result,`${n}.results[${i}].result`)}})};case"step/model-output-end":{const o=S(e,"status",n)==="failed",i=o?S(e,"error",n):void 0,r=o?To(e.presentation,`${n}.presentation`):void 0,l=o?qo(e.failure,`${n}.failure`):void 0;return{kind:"model-end",requestId:S(e,"request_id",n),...i===void 0?{}:{error:i},...r===void 0?{}:{presentation:r},...l===void 0?{}:{failure:l}}}case"context/configured":return{kind:"context-configured",model:{providerId:S(e,"provider_id",n),modelId:S(e,"model_id",n)}};default:return{kind:"other"}}}function ai(s){if(!Array.isArray(s.questions)||s.questions.length<1||s.questions.length>4)return;const t=new Set,e=[];for(const[n,o]of s.questions.entries()){const i=ri(o,String(n+1));if(i===void 0||t.has(i.id))return;t.add(i.id),e.push(i)}return e}function ri(s,t){if(s===null||typeof s!="object"||Array.isArray(s))return;const e=s,n=e.id??t;if(typeof n!="string"||n===""||e.header!==void 0&&typeof e.header!="string"||typeof e.header=="string"&&[...e.header].length>40||typeof e.question!="string"||e.question.trim()===""||!Array.isArray(e.options)||e.options.length<2||e.options.length>6)return;const o=new Set,i=[];for(const r of e.options){if(r===null||typeof r!="object"||Array.isArray(r))return;const l=r;if(typeof l.label!="string"||l.label.trim()===""||o.has(l.label)||l.description!==void 0&&typeof l.description!="string")return;o.add(l.label),i.push({label:l.label,...typeof l.description=="string"?{description:l.description}:{}})}if(!(e.multiSelect!==void 0&&typeof e.multiSelect!="boolean"||e.allowCustom!==void 0&&typeof e.allowCustom!="boolean"))return{id:n,...typeof e.header=="string"?{header:e.header}:{},question:e.question,options:i,multiSelect:e.multiSelect===!0,allowCustom:e.allowCustom!==!1}}function hn(s,t){const e=[];for(const[n,o]of s.entries()){const i=N(o,`${t}[${n}]`);if(S(i,"name",`${t}[${n}]`)!=="ask_user")continue;const r=ai(N(i.input,`${t}[${n}].input`));r!==void 0&&e.push({callId:S(i,"id",`${t}[${n}]`),questions:r})}return e}function jt(s,t){const e=N(s,t),n=S(e,"type",t),o=S(e,"name",t),i=e.parent_call_id===void 0||e.parent_call_id===null?void 0:S(e,"parent_call_id",t);return{id:S(e,"id",t),sequence:re(e,"sequence",t),createAt:re(e,"create_at",t),...i===void 0?{}:{parentCallId:i},content:ii(n,o,N(e.data,`${t}.data`),`${t}.data`)}}function li(s){const t="approval.request",e=N(s.call,`${t}.call`),n=N(s.source,`${t}.source`),o=n.kind==="tool"?S(n,"call_id",`${t}.source`):void 0;return{sessionId:S(s,"sessionId",t),branchId:S(s,"branchId",t),requestId:S(s,"requestId",t),...o===void 0?{}:{callId:o},call:{name:S(e,"name",`${t}.call`),input:N(e.input,`${t}.call.input`)},reason:S(s,"reason",t)}}function di(s){const t="session.collaboration.approval.get",e=N(s,t);if(e.state==="ended")return{state:"ended"};e.state!=="pending"&&xe(t,"pending or ended");const n=N(e.descriptor,`${t}.descriptor`),o=N(n.member,`${t}.member`),i=N(n.call,`${t}.call`);return{state:"pending",approvalId:S(e,"approvalId",t),descriptor:{delegationId:S(n,"delegationId",t),requestId:S(n,"requestId",t),reason:S(n,"reason",t),member:{agentId:S(o,"agentId",t),sessionId:S(o,"sessionId",t),branchId:S(o,"branchId",t)},call:{name:S(i,"name",t),input:N(i.input,t)}}}}function ci(s,t){const e=N(t??{},s);switch(s){case"ui.extensions.changed":return{method:s,revision:re(e,"revision",s)};case"session.event":return{method:s,sessionId:S(e,"sessionId",s),branchId:S(e,"branchId",s),event:jt(e.event,`${s}.event`)};case"session.display":return{method:s,sessionId:S(e,"sessionId",s),branchId:S(e,"branchId",s),event:jt(e.item,`${s}.item`)};case"session.state":return{method:s,sessionId:S(e,"sessionId",s),branchId:S(e,"branchId",s),running:Qe(e,"running",s),stopping:Qe(e,"stopping",s)};case"session.model.progress":{const n=Pe(e,"requestId",s),o=Ao(e.retry,`${s}.retry`),i=Mo(e,"thinkingStartedAt",s);return{method:s,progress:{sessionId:S(e,"sessionId",s),branchId:S(e,"branchId",s),...n===void 0?{}:{requestId:n},text:S(e,"text",s),textOffset:re(e,"textOffset",s),thinking:S(e,"thinking",s),thinkingOffset:re(e,"thinkingOffset",s),...i===void 0?{}:{thinkingStartedAt:i},...o===void 0?{}:{retry:o}}}}case"approval.request":return{method:s,request:li(e)};case"approval.resolved":case"approval.cancelled":return{method:s,sessionId:S(e,"sessionId",s),branchId:S(e,"branchId",s),requestId:S(e,"requestId",s)};case"session.notice":{if(e.source==="SessionStore"&&e.kind==="title")return{method:"session.title",sessionId:S(e,"sessionId",s),data:ln(N(e.data,`${s}.data`),`${s}.data`)};if(e.source!=="Collaboration"||e.kind!=="memberApprovalEnded")return;const n=N(e.data,s);return{method:"memberApprovalEnded",sessionId:S(e,"sessionId",s),branchId:S(n,"branchId",s),approvalId:S(n,"approvalId",s)}}case"session.closed":{const n=Pe(e,"reason",s);return{method:s,sessionId:S(e,"sessionId",s),...n===void 0?{}:{reason:n}}}default:return}}function ui(s){const t=N(s,"ui.extensions.list");return{revision:re(t,"revision","ui.extensions.list"),extensions:ke(t.extensions,"extensions").map(e=>{const n=N(e,"extension");return{pluginName:S(n,"pluginName","extension"),generation:S(n,"generation","extension"),panels:ke(n.panels,"panels").map(o=>{const i=N(o,"panel"),r=N(i.title,"title"),l=r.translations===void 0?void 0:N(r.translations,"translations");return{id:S(i,"id","panel"),title:{default:S(r,"default","title"),translations:l===void 0?void 0:Object.fromEntries(Object.entries(l).map(([m])=>[m,S(l,m,"translations")]))},icon:Pe(i,"icon","panel"),entry:S(i,"entry","panel"),placement:S(i,"placement","panel"),requires:ke(i.requires,"requires").map(m=>typeof m=="string"?m:xe("requires","strings")),methods:ke(i.methods,"methods").map(m=>{const v=N(m,"method"),_=v.scope;return _!=="session"&&_!=="branch"&&xe("scope","session or branch"),{name:S(v,"name","method"),scope:_}})}})}}),errors:ke(t.errors,"errors").map(e=>{const n=N(e,"error");return{pluginName:S(n,"pluginName","error"),message:S(n,"message","error")}})}}function mn(s){const t=N(s,"event");return{id:S(t,"id","event"),sequence:re(t,"sequence","event"),create_at:re(t,"create_at","event"),type:S(t,"type","event"),name:S(t,"name","event"),data:N(t.data,"event.data"),...t.tags===void 0?{}:{tags:ke(t.tags,"event.tags").map(e=>typeof e=="string"?e:xe("event.tags","strings"))},...t.context_render===void 0?{}:{context_render:Qe(t,"context_render","event")},...t.context_state===void 0?{}:{context_state:Qe(t,"context_state","event")}}}function pi(s){const t=N(s,"session.history");return{events:ke(t.events,"events").map(mn),through:re(t,"through","history"),nextAfter:re(t,"nextAfter","history"),done:Qe(t,"done","history")}}function hi(s){return{event:mn(N(s,"session.submit").event)}}function mi(s){return{sequence:re(N(s,"session.stop"),"sequence","session.stop")}}function vn(s){const t="branch",e=N(s,t),n=S(e,"branchId",t),o=e.end===void 0||e.end===null?void 0:N(e.end,`${t}.end`);return{branchId:n,parentBranchId:n==="main"?void 0:S(e,"parentBranchId",t),branchPoint:n==="main"?void 0:re(e,"branchPoint",t),state:S(e,"state",t),head:re(e,"head",t),purpose:Pe(e,"purpose",t),cutMessages:e.cutMessages===void 0||e.cutMessages===null?void 0:re(e,"cutMessages",t),end:o===void 0?void 0:{source:{kind:S(N(o.source,`${t}.end.source`),"kind",`${t}.end.source`)},ancestor:Pe(o,"ancestor",`${t}.end`)}}}function vi(s){return ke(N(s,"session.branches").branches,"session.branches.branches").map(vn)}function fi(s){return vn(s)}function gi(s){return Qt(N(s,"session.attach").model,"session.attach.model")}function bi(s){const t="session.input.pending",e=N(s,t),n=ke(e.inputs,`${t}.inputs`).flatMap((o,i)=>{const r=`${t}.inputs[${i}]`,l=N(o,r);if(l.user===null)return[];const m=un(N(l.user,`${r}.user`),`${r}.user`),v=pn(m.content,`${r}.user.content`);return[{id:S(l,"inputId",r),text:v.text,skills:v.skills,...v.hooks===0?{}:{hooks:v.hooks},user:m}]});return{branchId:S(e,"branchId",t),through:re(e,"through",t),inputs:n,next:e.next}}function yi(s){const t="session.question.pending",e=N(s,t),n=ke(e.batches,`${t}.batches`).flatMap((o,i)=>{const r=`${t}.batches[${i}]`,l=N(o,r);return hn(ke(l.calls,`${r}.calls`),`${r}.calls`).map(m=>({requestId:S(l,"requestId",r),...m}))});return{branchId:S(e,"branchId",t),through:re(e,"through",t),asks:n,next:e.next}}function ki(s){const t="session.turn.get",e=N(s,t),n=e.turn===null?void 0:N(e.turn,`${t}.turn`),o=e.output===null?void 0:N(e.output,`${t}.output`);return{branchId:S(e,"branchId",t),through:re(e,"through",t),turn:n===void 0?void 0:{sequence:re(n,"sequence",`${t}.turn`),ended:Qe(n,"ended",`${t}.turn`)},output:o===void 0?void 0:{requestId:S(o,"requestId",`${t}.output`),textCharacters:re(o,"textCharacters",`${t}.output`),thinkingCharacters:re(o,"thinkingCharacters",`${t}.output`)}}}function wi(s){const t="session.goal.get",e=N(s,t);if(e.goal===null)return;const n=N(e.goal,`${t}.goal`),o=N(n.status,`${t}.goal.status`),i=S(o,"kind",`${t}.goal.status`);return["active","paused","completed","blocked","none"].includes(i)?{objective:S(n,"objective",`${t}.goal`),evaluator:Qe(n,"evaluator",`${t}.goal`),status:i==="paused"?{kind:i,reason:S(o,"reason",`${t}.goal.status`)}:{kind:i}}:xe(`${t}.goal.status.kind`,"a goal status")}function _i(s){const t="session.tool.get",e=N(s,t);if(e.call===null)return;const n=N(e.call,`${t}.call`),o=N(n.call,`${t}.call.call`);return{requestId:S(n,"request_id",`${t}.call`),callId:S(o,"id",`${t}.call.call`),name:S(o,"name",`${t}.call.call`),input:N(o.input,`${t}.call.call.input`)}}class ct extends Error{constructor(e,n,o){super(n);ve(this,"name","RpcError");this.code=e,this.appError=o}}class Bt extends Error{constructor(){super(...arguments);ve(this,"name","ConnectionLost")}}const Ii=3e4,$i=2e4,xi=1e4,As=[500,1e3,2e3,4e3,8e3,15e3];class Ci{constructor(t){ve(this,"socket");ve(this,"nextId",1);ve(this,"pending",new Map);ve(this,"heartbeat");ve(this,"retry");ve(this,"attempt",0);ve(this,"connectedOnce",!1);ve(this,"stopped",!1);this.handlers=t}start(){this.stopped=!1,this.open()}stop(){var t;this.stopped=!0,clearTimeout(this.retry),(t=this.socket)==null||t.close()}retryNow(){this.socket!==void 0||this.stopped||(clearTimeout(this.retry),this.open())}call(t,e,n,o=Ii){const i=this.socket;if(i===void 0||i.readyState!==WebSocket.OPEN)return Promise.reject(new Bt("Not connected"));const r=this.nextId++;return new Promise((l,m)=>{const v=setTimeout(()=>{this.pending.delete(r),m(new Error(`${t} timed out; the outcome is unknown`))},o);this.pending.set(r,{resolve:l,reject:m,timer:v}),i.send(JSON.stringify({jsonrpc:"2.0",id:r,method:t,params:e}))}).then(n)}open(){this.handlers.phase(this.connectedOnce?"reconnecting":"connecting");const t=location.protocol==="https:"?"wss:":"ws:",e=new WebSocket(`${t}//${location.host}/ws`);this.socket=e;let n=!1;e.onopen=()=>{n=!0,this.handshake()},e.onmessage=o=>this.receive(o.data),e.onclose=()=>{if(this.socket===e){this.socket=void 0,clearInterval(this.heartbeat);for(const[o,i]of this.pending)clearTimeout(i.timer),i.reject(new Bt("Connection closed")),this.pending.delete(o);this.stopped||(n?this.schedule():this.diagnoseRefusal())}}}async handshake(){var n,o;let t;try{t=await this.call("hello",{protocolVersion:Ms,clientKind:"web",clientName:"dim-web"},Lo)}catch(i){i instanceof ct&&i.appError==="protocol_version"&&(this.stopped=!0,this.handlers.phase("version-mismatch")),(n=this.socket)==null||n.close();return}if(t.protocolVersion!==Ms){this.stopped=!0,this.handlers.phase("version-mismatch"),(o=this.socket)==null||o.close();return}const e=this.connectedOnce;this.connectedOnce=!0,this.attempt=0,this.heartbeat=setInterval(()=>{this.call("daemon.ping",{},()=>{},xi).catch(()=>{var i;return(i=this.socket)==null?void 0:i.close()})},$i),this.handlers.phase("connected"),this.handlers.ready(t,e)}async diagnoseRefusal(){let t=!1;try{t=(await fetch("/api/auth/session",{cache:"no-store"})).status===401}catch{t=!1}this.stopped||(t?(this.stopped=!0,this.handlers.phase("unauthenticated")):this.schedule())}schedule(){this.handlers.phase(this.connectedOnce?"reconnecting":"connecting");const t=As[Math.min(this.attempt,As.length-1)];this.attempt+=1,this.retry=setTimeout(()=>this.open(),t)}receive(t){let e;try{const o=JSON.parse(String(t));if(o===null||typeof o!="object"||Array.isArray(o))throw new Ae("Expected a JSON-RPC object");e=o}catch(o){this.handlers.invalid(o instanceof Ae?o:new Ae("Invalid JSON frame"));return}if(typeof e.id=="number"){const o=this.pending.get(e.id);if(o===void 0)return;this.pending.delete(e.id),clearTimeout(o.timer),"error"in e?o.reject(Si(e.error)):o.resolve(e.result);return}if(typeof e.method!="string")return;let n;try{n=ci(e.method,e.params)}catch(o){this.handlers.invalid(o instanceof Ae?o:new Ae(String(o)));return}n!==void 0&&this.handlers.notification(n)}}function Si(s){const t=s!==null&&typeof s=="object"?s:{},e=t.data!==null&&typeof t.data=="object"?t.data:{};return new ct(typeof t.code=="number"?t.code:-32603,typeof t.message=="string"?t.message:"Request failed",typeof e.appError=="string"?e.appError:void 0)}async function Ei(){const s=new URLSearchParams(location.hash.slice(1)).get("bootstrap");if(s!==null){history.replaceState(history.state,"",`${location.pathname}${location.search}`);try{await fetch("/api/auth/exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:s})})}catch{}}}const Mi=/[;&|`()<>$\r\n]/;function fn(s){if(s.call.name!=="exec"&&s.call.name!=="execute")return;const t=s.call.input.command;if(!(typeof t!="string"||Mi.test(t)||t.trim()===""))return t}function Ti(s){return{command:s.split(/\s+/).filter(t=>t!=="").join(" "),match:"exact",decision:"allow"}}function qi(s,t){return s.decision===t.decision&&s.match===t.match&&s.command.split(/\s+/).filter(e=>e!=="").join(" ")===t.command}function gn(s){const t=s.call.name;if(t!=="read"&&t!=="write"&&t!=="edit")return;const e=s.call.input.path;if(typeof e=="string")return{path:e,kind:"file",mode:t==="read"?"read":"write"}}const Ai="modulepreload",Li=function(s){return"/"+s},Ls={},Te=function(t,e,n){let o=Promise.resolve();if(e&&e.length>0){let r=function(v){return Promise.all(v.map(_=>Promise.resolve(_).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),m=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=r(e.map(v=>{if(v=Li(v),v in Ls)return;Ls[v]=!0;const _=v.endsWith(".css"),f=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${f}`))return;const I=document.createElement("link");if(I.rel=_?"stylesheet":Ai,_||(I.as="script"),I.crossOrigin="",I.href=v,m&&I.setAttribute("nonce",m),document.head.appendChild(I),_)return new Promise((b,w)=>{I.addEventListener("load",b),I.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${v}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return o.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Ri={"a11y.mainContent":"Main content","a11y.primaryNavigation":"Primary navigation","a11y.workspaceSessionIndex":"Workspace and session index","auth.connectingTitle":"Connecting to Dim…","auth.expiredTitle":"This link has expired","auth.expiredBefore":"This browser is not signed in to the web workspace, or the workspace was reopened. Run ","auth.expiredAfter":" to get a fresh link.","auth.versionTitle":"Update the browser page","auth.versionDescription":"This page and the App Server speak different protocol versions. Reload the page; if it persists, run dimcode web again.","brand.product":"Dim","brand.webHost":"Web workspace","chat.assistant":"Dim","chat.composer":"Message composer","chat.copyFailed":"Clipboard access failed.","chat.emptyTimeline":"Send a message to begin.","chat.pathCopied":"Path copied","chat.removedDescription":"This session is closed or no longer exists on the App Server.","chat.removedTitle":"Session closed","chat.you":"You","common.cancel":"Cancel","common.close":"Close","common.loading":"Loading…","common.search":"Search","common.skipToContent":"Skip to content","composer.category.model":"Model","composer.category.session":"Session","composer.branchUnavailable":"Branch creation is not available here","composer.command.branch":"Open a line here","composer.command.compact":"Compact the context","composer.command.fork":"Fork at the last finished turn","composer.command.usage":"Show the context window usage","composer.command.lines":"Show session lines","command.basisEstimated":"estimated","command.basisProvider":"counted by the provider","command.compactSkipped":"Compaction skipped","command.compacted":"Context compacted","command.failed":"Command failed","command.effortChoices":"Reasoning effort choices: {choices}","command.effortSet":"Reasoning effort configuration {outcome}: {value}","command.effortUnavailable":"This model does not advertise reasoning effort choices.","command.effortUnknown":"Reasoning effort is not advertised by this model.","command.effortUsage":"Usage: /effort [VALUE]","composer.command.effort":"Show or set the reasoning effort","queue.notHeld":"That message was already adopted by the run.","queue.remove":"Remove","queue.steer":"Steer","queue.title":"Queued messages","command.usage":"Context: {input} / {window} tokens ({percent}%), {basis} · output up to {output} · compacts at {threshold}","command.usageTitle":"Context usage","fork.confirm":"Fork this session at its last finished turn? The new session copies main up to that point.","fork.confirmLabel":"Fork","composer.command.goal":"Show or change the goal","goal.action.clear":"cleared","goal.action.edit":"edited","goal.action.pause":"paused","goal.action.resume":"resumed","goal.action.set":"set","goal.evaluator":"evaluator judge","goal.line":"Goal on main · {status}","goal.none":"No goal on main.","goal.sent":"Goal {action} on main","goal.status.active":"active","goal.status.blocked":"blocked","goal.status.completed":"completed","goal.status.none":"no status","goal.status.paused":"paused ({reason})","goal.usage":"Usage: /goal [objective | set objective | edit objective | pause | resume | clear]","composer.command.models":"Choose a model","composer.command.new":"New session","composer.command.scheduled":"Manage scheduled tasks on the CLI host","composer.commandKeys":"↑↓ select · Enter confirm · Esc close","composer.command.permissions":"Show or change the session permissions","composer.permission.label":"Permissions","composer.permission.preset.read-only":"Read only","composer.permission.preset.workspace-write":"Workspace write","composer.permission.preset.full-access":"Full access","composer.permission.description.read-only":"Read files; deny writes and process commands.","composer.permission.description.workspace-write":"Write inside the workspace; ask for paths outside it and other risks.","composer.permission.description.full-access":"No path limit; skip tool questions. Explicit denies still apply.","composer.permission.fullAccessConfirm":"Allow unrestricted file access and skip tool questions? Explicit denies and process isolation still apply.","composer.permission.allowedTools":"Allowed tools","composer.permission.disallowedTools":"Denied tools","composer.permission.isolation":"The preset does not change process isolation.","composer.permission.processIsolation":"Process isolation settings","permission.conflict":"The permissions changed elsewhere. The current setting is shown.","timeline.rail":"Messages","composer.files":"Files","composer.mentionKeys":"↑↓ select · Enter insert · Esc close","composer.imageAttachment":"Attached image","composer.imageLimit":"A message takes up to 20 images.","question.selectMany":"Choose one or more","composer.imageReadFailed":"This image could not be read.","composer.onlyImages":"Only images can be attached here yet.","composer.pastedText":"Pasted text · {lines} lines","composer.pasteTooLarge":"This paste is larger than 10 MB.","composer.removeAttachment":"Remove attachment","composer.commands":"Commands","composer.modelLoadRetry":"Load failed · Retry","composer.modelLoading":"Loading models…","composer.noModels":"No models available","composer.notConfigured":"Default model","composer.searchModels":"Search models...","composer.send":"Send","composer.sendMessage":"Send a message...","composer.stopResponse":"Stop response","failure.details":"Details","failure.details.cause":"cause:","failure.details.kind":"kind: {kind}","failure.details.providerCode":"provider code: {code}","failure.details.requestId":"request id: {id}","failure.details.retryAfter":"the provider asked to wait {seconds} s","failure.details.status":"status: {status}","failure.details.tried":"tried {count} times over {seconds} s","failure.incomplete":"The response above is incomplete.","failure.retryAnnouncement":"Retrying, attempt {attempt} of {max}: {reason}","failure.tried":"Tried {count} times over {seconds} s.","failure.kind.network.meaning":"Could not reach the provider, or the connection dropped","failure.kind.rate_limited.meaning":"The provider is rate limiting requests","failure.kind.server_error.meaning":"The provider reported a server error","failure.kind.malformed_response.meaning":"The provider sent a response Dim could not use","failure.kind.auth_rejected.meaning":"The provider rejected the credentials","failure.kind.quota_exhausted.meaning":"The account has no quota left","failure.kind.not_found.meaning":"The provider did not find the model or endpoint","failure.kind.context_too_long.meaning":"The conversation is longer than the model accepts","failure.kind.content_filtered.meaning":"The provider's content filter blocked the response","failure.kind.invalid_request.meaning":"The provider rejected the request","failure.kind.output_limit.meaning":"The model stopped at its output limit","failure.kind.unknown.meaning":"The model request failed","failure.kind.network.action":"Check the network or proxy.","failure.kind.rate_limited.action":"Wait and try again.","failure.kind.server_error.action":"Try again later or choose another model.","failure.kind.malformed_response.action":"Try again; if it repeats, choose another model or check the proxy or gateway.","failure.kind.auth_rejected.action":"Sign in again or check the API key.","failure.kind.quota_exhausted.action":"Check the plan or billing.","failure.kind.not_found.action":"Check the model and the provider's base URL.","failure.kind.context_too_long.action":"Compact the conversation or start a new session.","failure.kind.content_filtered.action":"Rephrase the request.","failure.kind.invalid_request.action":"See the details.","failure.kind.output_limit.action":"Increase the output token limit and retry.","failure.kind.unknown.action":"See the details.","connection.accessRequired":"Access required","connection.connecting":"Connecting","connection.host":"App Server","connection.live":"Live","connection.protocolError":"Unexpected data from the App Server","connection.reconnecting":"Reconnecting","connection.versionMismatch":"Version mismatch","detail.output":"Output","timeline.loadEarlier":"Earlier content not loaded · Load earlier","timeline.loadingEarlier":"Loading earlier content…","lines.state.ending":"Ending","lines.state.ended":"Ended","lines.afterMessage":"after message {count}","lines.atEnd":"at the end of the line","lines.beforeMessage":"before “{message}”","lines.closePanel":"Close lines panel","lines.closeTab":"Close line tab","lines.collapse":"Restore panel width","lines.create":"Create line","lines.empty":"This line has no messages yet.","lines.emptyHint":"Branch from a message to work in parallel.","lines.emptyTitle":"No lines yet","lines.end":"End","lines.endDescription":"The line stops and becomes read-only. This cannot be undone.","lines.endLine":"End line {name}","lines.endTitle":"End line “{name}”?","lines.expand":"Expand panel","lines.from":"from {name}","lines.lineAria":"Line {name}","lines.loadFailed":"Could not load this line.","lines.main":"main","lines.mainHint":"the session itself","lines.newChild":"New child line","lines.newLine":"New line","lines.newLineFrom":"From {name}","lines.newLineTitle":"New line","lines.noFinishedTurn":"No finished turn to cut at yet","lines.open":"Open lines","lines.openLine":"Open line {name}","lines.panelAria":"Session lines","lines.placeholder":"Message this line…","lines.promptLabel":"Opening message","lines.promptPlaceholder":"What should this line do?","lines.promptRequired":"Write the line's opening message.","lines.readOnly":"This line is read-only.","lines.resize":"Resize lines panel","lines.retry":"Retry","lines.state.creationFailed":"creation failed","lines.state.endedByOperation":"ended by an operation","lines.state.endedItself":"ended itself","lines.state.endedWith":"ended with {id}","lines.state.main":"the session itself","lines.state.waiting":"waiting","lines.state.working":"working","lines.title":"Lines","message.branch":"Branch from here","message.collapse":"Collapse message","message.copy":"Copy entire message","message.skillLoaded":"Skill loaded: {name}","message.hookContext":"Hook context","message.expand":"Show full message","message.quote":"Quote in the composer","newThread.pathLabel":"Absolute directory path","newThread.pathPlaceholder":"/path/to/project","newThread.selectWorkspace":"Select workspace...","newThread.title":"Start Build","newThread.usePath":"Use","newThread.workspaceRequired":"Choose a workspace or type an absolute directory.","page.notFoundDescription":"There is nothing at this address.","page.reconnecting":"Connection lost. Reconnecting…","prompt.actionRequest":"Dim wants to: {action}","prompt.allowOnce":"Allow once","prompt.allowAlways":"Always allow","prompt.allowSession":"Allow for this session","question.awaitingAnswer":"Awaiting answer","question.decline":"Decline","question.failed":"Failed to send the answer","question.notPending":"This question is no longer waiting for an answer. Send again once the run continues.","question.other":"Other answer","question.otherPlaceholder":"Type your own answer","question.steps":"Questions","question.number":"Question {number}","question.previous":"Previous","question.next":"Next","question.review":"Review answers","question.edit":"Edit","question.editAnswer":"Edit answer: {question}","question.unanswered":"Not answered","question.sent":"Answer sent","question.submit":"Send answers","question.title":"Dim has a question","prompt.awaitingApproval":"Awaiting approval","prompt.input":"Input","prompt.permissionSubmitFailed":"Failed to submit tool permission","prompt.reject":"Reject","prompt.useTool":"Use a tool","route.newSession":"New session","route.notFound":"Page not found","route.session":"Session","sidebar.closeMenu":"Close navigation","sidebar.collapseWorkspace":"Collapse {name}","sidebar.expandWorkspace":"Expand {name}","sidebar.newInWorkspace":"New session in {name}","sidebar.newSession":"New session","sidebar.noMatches":"No workspaces or sessions match.","sidebar.noWorkspaces":"No sessions yet.","sidebar.openMenu":"Open navigation","sidebar.searchPlaceholder":"Search workspaces and sessions","sidebar.showLess":"Show less","sidebar.showMore":"Show more","sidebar.untitled":"New session","session.parent":"Parent session: {title}","session.children":"Child sessions ({count})","sidebar.workspaces":"Workspaces","status.running":"Running","status.stopping":"Stopping","timeline.beforeMessage":"before “{message}”","timeline.copied":"Copied","timeline.copy":"Copy","timeline.final":"final","timeline.fromLine":"◂ from {id}","timeline.hookFollowUp":"Stop hook follow-up · {count} line | Stop hook follow-up · {count} lines","timeline.lineEnded":"◂ {id} ended","timeline.lineEndedByOperation":"This line ended (an operation)","timeline.lineEndedItself":"This line ended (itself)","timeline.lineEndedWith":"This line ended (with {id})","timeline.lineWaiting":"◂ {id} is waiting ({status})","timeline.noticeStopped":"Stopped","timeline.scrollToBottom":"Scroll to bottom","timeline.steer":"(steer)","tool.edit":"Edit","tool.glob":"Find","tool.grep":"Search content","tool.listFiles":"List files","tool.read":"Read","tool.run":"Run","tool.runBackground":"Run (background)","tool.webFetch":"Fetch webpage","tool.webSearch":"Search web","tool.write":"Write","work.actionSeparator":", ","work.command":"{count} command | {count} commands","work.edit":"{count} edit | {count} edits","work.processing":"Processing","work.read":"{count} read | {count} reads","work.search":"{count} search | {count} searches","work.separator":" · ","work.retrying":"Retrying {attempt}/{max} in {seconds} s · {reason} · {stop}","work.waiting":"Waiting for the provider · {reason} · {stop}","work.thinking":"Thinking","work.thinkingSteps":"Thought once | Thought {count} times","work.thoughtFor":"Thought for {duration}","work.unknown":"{count} tool | {count} tools","work.webFetch":"{count} fetch | {count} fetches","work.webSearch":"{count} web search | {count} web searches"},Oi=()=>Te(()=>import("./zh-CN-C34hOQsk.js"),[]),It=Fn({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:Ri}});function Pi(s){return s.toLowerCase().startsWith("zh")?"zh-CN":"en"}async function bn(s){const t=Pi(s);t==="zh-CN"&&!It.global.availableLocales.includes(t)&&It.global.setLocaleMessage(t,(await Oi()).default),It.global.locale.value=t}function Oe(s,t){return It.global.t(s,t??{})}function ps(s){return`failure.kind.${s}.meaning`}function zi(s){return`failure.kind.${s}.action`}function yn(s){const t=s==null?void 0:s.trim();if(!(t===void 0||t===""))return t.replace(/\.$/u,"")}function Di(s,t){const e=yn(s.reason),n=Oe(ps(s.kind)),o=e===void 0?n:`${n}: ${e}.`,i=t?`${Oe("failure.incomplete")} `:"",r=s.attempts>1?` ${Oe("failure.tried",{count:s.attempts,seconds:Math.floor((s.waitedMs+500)/1e3)})}`:"";return`${i}${o} ${Oe(zi(s.kind))}${r}`}function Ni(s){const t=[Oe("failure.details.kind",{kind:s.kind})];return s.status!==void 0&&t.push(Oe("failure.details.status",{status:s.status})),s.providerCode!==void 0&&t.push(Oe("failure.details.providerCode",{code:s.providerCode})),s.requestId!==void 0&&t.push(Oe("failure.details.requestId",{id:s.requestId})),s.attempts>1&&t.push(Oe("failure.details.tried",{count:s.attempts,seconds:(s.waitedMs/1e3).toFixed(1)})),s.retryAfterMs!==void 0&&t.push(Oe("failure.details.retryAfter",{seconds:Math.floor(s.retryAfterMs/1e3)})),s.cause.length>0&&(t.push(Oe("failure.details.cause")),t.push(...s.cause)),t}function ji(s,t){return Math.max(0,Math.ceil((s-t)/1e3))}function Bi(s,t){const e=yn(s.reason),n=Oe(ps(s.kind)),o=e===void 0?n:`${n}: ${e}`,i=Oe("composer.stopResponse");return t<=0?Oe("work.waiting",{reason:o,stop:i}):Oe("work.retrying",{attempt:s.attempt,max:s.maxAttempts,seconds:t,reason:o,stop:i})}function Fi(s){return s===void 0?"":Oe("failure.retryAnnouncement",{attempt:s.attempt,max:s.maxAttempts,reason:Oe(ps(s.kind))})}class is{constructor(){ve(this,"rows",[]);ve(this,"cursor",0);ve(this,"lastTurnEnd");ve(this,"model");ve(this,"answers",new Map);ve(this,"thoughts",new Map);ve(this,"thoughtStarts",new Map);ve(this,"tools",new Map);ve(this,"lines",new Map);ve(this,"asks",[]);ve(this,"held",new Map);ve(this,"goal");ve(this,"controlCursor",0);ve(this,"output");ve(this,"showedOutput",new Set);ve(this,"shownFailure")}queued(){return[...this.held.values()]}waiting(){return this.asks}restoreControls(t,e,n){this.held=new Map(t.map(o=>[o.id,o])),this.asks=e,this.controlCursor=n}applyControl(t){if(t.sequence<=this.controlCursor)return;this.controlCursor=t.sequence;const e=t.content;switch(e.kind){case"input":e.user!==void 0&&this.held.set(t.id,{id:t.id,text:e.text??"",skills:e.skills,hooks:e.hooks,user:e.user});break;case"input-consumed":case"input-deleted":this.held.delete(e.inputId);break;case"tool-call":for(const n of e.asks)this.asks.push({requestId:e.requestId,callId:n.callId,questions:n.questions});break;case"tool-result":this.asks=this.asks.filter(n=>n.requestId!==e.requestId||!e.results.some(o=>o.callId===n.callId));break}}activeOutput(t){this.output=t;const e=this.answers.get(t.requestId),n=this.thoughts.get(t.requestId);e!==void 0&&(e.writtenChars=t.textCharacters),n!==void 0&&(n.writtenChars=t.thinkingCharacters)}apply(t){if(t.sequence<=this.cursor)return!1;this.cursor=t.sequence,this.applyControl(t);const e=t.content;switch(e.kind){case"input":e.text!==void 0&&this.push({kind:"user",key:`user-${t.sequence}`,text:e.text,skills:e.skills,...e.hooks===void 0?{}:{hooks:e.hooks},at:t.createAt,sequence:t.sequence,cut:Math.max(0,t.sequence-1)});break;case"input-applied":case"input-consumed":case"input-deleted":break;case"source-input":{const n=Wi(e.text,e.mode);n!==void 0&&this.push({...n,key:`notice-${t.sequence}`});break}case"branch-create":{const n=e.at??t.sequence,o=this.rows.find(r=>r.kind==="user"&&r.cut===n),i=(o==null?void 0:o.kind)==="user"?Ki(o.text):void 0;this.lines.set(e.branchId,this.push({kind:"line",key:`line-${t.sequence}`,branchId:e.branchId,purpose:kn(e.prompt),...i===void 0?{}:{before:i}}));break}case"branch-create-failed":{const n=this.lines.get(e.branchId);n!==void 0&&this.update(n,{failed:!0});break}case"branch-end":{const n=e.ancestor;this.push({kind:"line-ended",key:`line-ended-${t.sequence}`,issuer:n!==void 0?"ancestor":e.source.kind==="tool"?"itself":"operation",...n===void 0?{}:{ancestor:n}});break}case"model-start":break;case"thinking":{this.showedOutput.add(e.requestId),this.thoughts.has(e.requestId)||this.thoughtStarts.set(e.requestId,t.createAt);const n=this.openThinking(e.requestId);Ps(n,e.delta),this.update(n.index,{text:Rt(n)});break}case"text":{this.showedOutput.add(e.requestId),this.closeThinking(e.requestId,t.createAt);const n=this.openAnswer(e.requestId);Ps(n,e.delta),this.update(n.index,{text:Rt(n)});break}case"tool-use":this.showedOutput.add(e.requestId),this.closeThinking(e.requestId,t.createAt),this.closeAnswer(e.requestId),this.tools.set(e.callId,this.push({kind:"tool",key:`tool-${e.callId}`,callId:e.callId,name:e.name,input:e.input,pending:!0}));break;case"tool-use-start":this.closeThinking(e.requestId,t.createAt);break;case"tool-call":break;case"tool-completed":this.completeTool(e.callId,e.result);break;case"tool-result":for(const n of e.results)this.completeTool(n.callId,n.result);break;case"model-end":{const n=this.showedOutput.delete(e.requestId);if(this.closeThinking(e.requestId,t.createAt),this.closeAnswer(e.requestId),e.error!==void 0){const o=e.failure,i=e.presentation!==void 0?Hi(e.presentation,e.error):o!==void 0?Di(o,n):e.error;this.push({kind:"error",key:`error-${t.sequence}`,text:i,...o===void 0?{}:{details:o}}),this.shownFailure=e.error}break}case"turn-end":{this.lastTurnEnd=t.sequence;for(const o of[...this.thoughts.keys()])this.closeThinking(o,t.createAt);for(const o of[...this.answers.keys()])this.closeAnswer(o);const n=this.shownFailure;if(this.shownFailure=void 0,e.outcome==="failed"){const o=e.error??"";n!==o&&this.push({kind:"error",key:`error-${t.sequence}`,text:o})}e.outcome==="cancelled"&&this.push({kind:"stopped",key:`stopped-${t.sequence}`});break}case"context-configured":this.model=e.model;break}return!0}progress(t){const e=t.requestId;if(e!==void 0){if(t.thinking!==""){this.showedOutput.add(e);const n=this.openThinking(e);t.thinkingStartedAt!==void 0&&!this.thoughtStarts.has(e)&&this.thoughtStarts.set(e,t.thinkingStartedAt),n.progress={text:t.thinking,offset:t.thinkingOffset},this.update(n.index,{text:Rt(n)})}if(t.text!==""){this.showedOutput.add(e);const n=this.openAnswer(e);n.progress={text:t.text,offset:t.textOffset},this.update(n.index,{text:Rt(n)})}}}prepend(t,e){const n=t.length;for(const o of[...this.answers.values(),...this.thoughts.values()])o.index+=n;for(const[o,i]of this.tools)this.tools.set(o,i+n);for(const[o,i]of this.lines)this.lines.set(o,i+n);this.rows=t.map(o=>({...o,key:`${e}:${o.key}`,...o.kind==="assistant"||o.kind==="thinking"?{streaming:!1}:{}})).concat(this.rows)}push(t){return this.rows.push(t),this.rows.length-1}update(t,e){this.rows[t]={...this.rows[t],...e}}openThinking(t){var n;let e=this.thoughts.get(t);return e===void 0&&(e={index:this.push({kind:"thinking",key:`thinking-${t}-${this.rows.length}`,text:"",streaming:!0}),written:"",writtenChars:((n=this.output)==null?void 0:n.requestId)===t?this.output.thinkingCharacters:0},this.thoughts.set(t,e)),e}openAnswer(t){var n;let e=this.answers.get(t);return e===void 0&&(e={index:this.push({kind:"assistant",key:`assistant-${t}-${this.rows.length}`,text:"",streaming:!0}),written:"",writtenChars:((n=this.output)==null?void 0:n.requestId)===t?this.output.textCharacters:0},this.answers.set(t,e)),e}closeThinking(t,e){const n=this.thoughts.get(t);if(n===void 0)return;this.thoughts.delete(t);const o=this.thoughtStarts.get(t);this.thoughtStarts.delete(t),this.update(n.index,{text:n.written,streaming:!1,...o===void 0?{}:{elapsedMs:Math.max(0,e-o)}})}closeAnswer(t){const e=this.answers.get(t);e!==void 0&&(this.answers.delete(t),this.update(e.index,{text:e.written,streaming:!1}))}completeTool(t,e){const n=this.tools.get(t);n!==void 0&&(this.tools.delete(t),this.update(n,{pending:!1,result:e}))}}function Wi(s,t){if(s.startsWith("<dim-branch-message")){const e=_t(s,"from");return e===void 0?void 0:{kind:"source-message",from:e,steer:t==="steer",final:_t(s,"final")!==void 0,body:Qi(Rs(Os(s,"</dim-branch-message>")))}}if(s.startsWith("<dim-branch-idle")){const e=_t(s,"branch");return e===void 0?void 0:{kind:"source-idle",branch:e,status:_t(s,"status")??"idle"}}if(s.startsWith("<dim-branch-ended")){const e=_t(s,"branch");return e===void 0?void 0:{kind:"source-ended",branch:e}}if(Vi(s,"dim-hooks")&&Ui(s)==="follow-up"){const e=Rs(Os(s,"</dim-hooks>")).trim();return{kind:"hook-follow-up",body:e,lines:Math.max(1,e.split(`
|
|
220
|
+
`).length)}}}function Vi(s,t){if(!s.startsWith(`<${t}`))return!1;const e=s.charAt(t.length+1);return e===">"||/\s/u.test(e)}function Ui(s){const t=s.slice(0,s.indexOf(">")+1);return _t(t,"kind")}function Hi(s,t){const e=s.serverMessage??t;return s.action===void 0?`model failed: ${e}`:`model failed: ${e}. ${s.action}`}function kn(s){var t;return((t=s.split(`
|
|
221
|
+
`)[0])==null?void 0:t.trim())??""}function Ki(s){const t=kn(s),e=[...t];return e.length<=40?t:`${e.slice(0,40).join("")}…`}function Qi(s){return s.split(/\s+/u).filter(Boolean).join(" ")}function Rs(s){return s.replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}function _t(s,t){const e=`${t}="`,n=s.indexOf(e);if(n<0)return;const o=n+e.length,i=s.indexOf('"',o);return i<0?void 0:s.slice(o,i)}function Os(s,t){const e=s.indexOf(`
|
|
222
|
+
`),n=e<0?"":s.slice(e+1),o=n.indexOf(t);return o<0?n:n.slice(0,o)}function Ps(s,t){s.written+=t,s.writtenChars+=[...t].length}function Rt(s){const t=s.progress;if(t===void 0)return s.written;const e=s.writtenChars-t.offset;if(e<0)return s.written;const n=[...t.text];return e>=n.length?(s.progress=void 0,s.written):s.written+n.slice(e).join("")}function zs(s){const t=new Set;for(const e of s){const n=e.content;switch(n.kind){case"input":t.add(`input:${e.id}`);break;case"text":n.delta!==""&&t.add(`reply:${n.requestId}`);break;case"tool-use":t.add(`tool:${n.requestId}:${n.callId}`);break;case"tool-completed":t.add(`tool:${n.requestId}:${n.callId}`);break;case"tool-result":for(const o of n.results)t.add(`tool:${n.requestId}:${o.callId}`);break}}return t}class Gi{constructor(t,e){ve(this,"pages",[]);ve(this,"through");ve(this,"before");this.before=t,this.through=e}params(t,e){return{sessionId:t,branchId:e,limit:256,...this.before===void 0?{latestTurn:!0}:{before:this.before,through:this.through}}}push(t){if(this.through!==void 0&&t.through!==this.through||t.nextBefore!==void 0&&(t.nextBefore<1||t.nextBefore>t.through||this.before!==void 0&&t.nextBefore>=this.before)||t.events.some(e=>e.sequence>t.through||this.before!==void 0&&e.sequence>=this.before))throw new Ae("Invalid history window cursor");return this.through=t.through,this.before=t.nextBefore!==void 0&&t.nextBefore>1?t.nextBefore:void 0,this.pages.unshift(t),this.before===void 0||this.pages.length>=4||zs(this.pages.flatMap(e=>e.events)).size>=100}take(){var i;const t=new Set;let e=0;for(const r of[...this.pages].reverse()){const l=t.size;for(const m of zs(r.events))t.add(m);if(l>0&&t.size>300)break;e++}this.pages.splice(0,this.pages.length-e);const n=(i=this.pages[0])==null?void 0:i.nextBefore;this.before=n!==void 0&&n>1?n:void 0;const o=this.pages.flatMap(r=>r.events);return this.pages=[],o}}const Ji={kind:"ended-itself"},Yi={kind:"ended-by-operation"};class Xi{constructor(){ve(this,"nodes",new Map);ve(this,"running",new Set)}directory(t){this.nodes.clear();for(const e of t)this.detail(e)}detail(t){if(t.branchId==="main")return;const e=this.nodes.get(t.branchId);this.nodes.set(t.branchId,{id:t.branchId,parentId:t.parentBranchId,at:t.branchPoint,purpose:t.purpose===void 0?(e==null?void 0:e.purpose)??"":Ds(t.purpose),cutMessages:t.cutMessages??(e==null?void 0:e.cutMessages),order:(e==null?void 0:e.order)??this.nodes.size,failed:t.state==="creation_failed",ended:t.state==="ending"?{kind:"ending"}:t.end===void 0?t.state==="ended"?{kind:"ended"}:e==null?void 0:e.ended:Ns(t.end.source,t.end.ancestor)})}apply(t,e){const n=e.content;switch(n.kind){case"branch-create":{if(this.nodes.has(n.branchId))return;this.nodes.set(n.branchId,{id:n.branchId,parentId:t,purpose:Ds(n.prompt),at:n.at??e.sequence,order:this.nodes.size,failed:!1,ended:void 0});break}case"branch-create-failed":{const o=this.nodes.get(n.branchId)??{id:n.branchId,parentId:t,purpose:"",at:e.sequence,order:this.nodes.size,failed:!1,ended:void 0};o.failed=!0,this.nodes.set(o.id,o);break}case"branch-end":{const o=this.nodes.get(t);o!==void 0&&(o.ended={kind:"ending"});break}case"branch-ended":{const o=this.nodes.get(n.branchId);o!==void 0&&(o.ended=Ns(n.source,n.ancestor));break}}}setRunning(t,e){e?this.running.add(t):this.running.delete(t)}has(t){return this.nodes.has(t)}views(){const t=[{id:"main",parentId:null,purpose:"",state:{kind:"main"},cut:null,depth:0}],e=new Map;for(const i of this.nodes.values()){const r=e.get(i.parentId)??[];r.push(i),e.set(i.parentId,r)}for(const i of e.values())i.sort((r,l)=>r.at-l.at||r.order-l.order);const n=new Set,o=(i,r)=>{for(const l of e.get(i)??[])n.has(l.id)||(n.add(l.id),t.push({id:l.id,parentId:l.parentId,purpose:l.purpose,state:this.stateOf(l),cut:{sequence:l.at,messages:l.cutMessages},depth:r}),o(l.id,r+1))};o("main",1);for(const i of this.nodes.values())n.has(i.id)||(n.add(i.id),t.push({id:i.id,parentId:i.parentId,purpose:i.purpose,state:this.stateOf(i),cut:{sequence:i.at,messages:i.cutMessages},depth:1}),o(i.id,2));return t}stateOf(t){return t.failed?{kind:"creation-failed"}:t.ended!==void 0?t.ended:this.running.has(t.id)?{kind:"working"}:{kind:"waiting"}}}function Ds(s){var t;return((t=s.split(`
|
|
223
|
+
`)[0])==null?void 0:t.trim())??""}function Ns(s,t){return t!==void 0?{kind:"ended-with",ancestor:t}:s.kind==="tool"?Ji:Yi}function oe(s){if(s===null||typeof s!="object"||Array.isArray(s))throw new Ae("Invalid settings reply: expected object");return s}function H(s){if(typeof s!="string")throw new Ae("Invalid settings reply: expected string");return s}function Le(s){if(typeof s!="boolean")throw new Ae("Invalid settings reply: expected boolean");return s}function et(s){if(typeof s!="number"||!Number.isSafeInteger(s)||s<0)throw new Ae("Invalid settings reply: expected nonnegative integer");return s}function we(s,t){if(!Array.isArray(s))throw new Ae("Invalid settings reply: expected array");return s.map(t)}function Se(s){return s==null?void 0:H(s)}function Zi(s){return s==null?void 0:Le(s)}function Xe(s,t){const e=H(s);if(!t.includes(e))throw new Ae("Invalid settings reply: unknown option");return e}function Fm(s){const t=oe(s);return t.selection===null?void 0:ea(t.selection)}function ea(s){const t=oe(s);return{providerId:H(t.provider_id),modelId:H(t.model_id),version:et(t.version)}}function Wm(s){const t=oe(s),e=oe(t.policy),n=Xe(e.mode,["agent","inherit","fixed"]);if(n!=="fixed")return{revision:H(t.revision),policy:{mode:n}};const o=oe(e.model);return{revision:H(t.revision),policy:{mode:n,model:{providerId:H(o.providerId),modelId:H(o.modelId)}}}}function Vm(s){const t=oe(s);return{revision:H(t.revision),executablePath:Se(t.executablePath),configError:Se(t.configError),shells:we(t.shells,e=>{const n=oe(e);return{executablePath:H(n.executablePath),name:H(n.name)}})}}function ta(s){const t=oe(s);return{revision:H(t.revision),commandRules:we(t.commandRules,e=>{const n=oe(e);return{command:H(n.command),match:Xe(n.match,["exact","prefix"]),decision:Xe(n.decision,["allow","deny"])}})}}function sa(s){return H(oe(s).revision)}function Um(s){const t=oe(s);return{version:et(t.version),entries:we(t.entries,e=>{const n=oe(e);return{id:H(n.id),name:H(n.name),description:H(n.description),filePath:H(n.filePath),allowedTools:we(n.allowedTools,H),enabled:Le(n.enabled),shadowedBy:Se(n.shadowedBy)}}),issues:we(t.issues,e=>{const n=oe(e);return{path:H(n.path),message:H(n.message)}})}}function Hm(s){return we(s,t=>{const e=oe(t);return{name:H(e.name),use:Se(e.use),off:Le(e.off),locked:Le(e.locked),status:Se(e.status),error:Se(e.error),optional:Zi(e.optional),candidates:we(e.candidates,n=>{const o=oe(n),i=o.source===void 0?void 0:oe(o.source);return{id:H(o.id),kinds:we(o.kinds,H),git:i===void 0?void 0:Se(i.git)}}),refused:e.refused===void 0?[]:we(e.refused,n=>{const o=oe(n);return{kind:H(o.kind),error:H(o.error)}})}})}function Km(s){const t=oe(s);return{userRevision:H(t.userRevision),projectRevision:Se(t.projectRevision),servers:we(t.servers,e=>{const n=oe(e),o=i=>i===void 0?[]:we(i,H);return{id:H(n.id),source:Xe(n.source,["user","project","plugin"]),enabled:Le(n.enabled),transport:H(n.transport),auth:n.auth===void 0?void 0:H(oe(n.auth).status),referencedVariables:o(n.referencedVariables),unsetVariables:o(n.unsetVariables)}}),invalid:t.invalid===void 0?[]:we(t.invalid,e=>{const n=oe(e);return{id:H(n.id),source:Xe(n.source,["user","project","plugin"]),error:H(n.error)}}),errors:[t.userApplication,t.pluginApplication,t.projectApplication].flatMap(e=>{if(e===null)return[];const n=oe(e);return[Se(n.error),Se(n.cleanupError)].filter(o=>o!==void 0)})}}function wn(s){const t=oe(s),e=Xe(t.type,["stdio","http","sse"]),n=t.referencedVariables===void 0?[]:we(t.referencedVariables,H),o=t.unsetVariables===void 0?[]:we(t.unsetVariables,H),i=t.timeout===void 0||t.timeout===null?void 0:et(t.timeout);if(e==="stdio")return{type:e,command:H(t.command),argsCount:et(t.argsCount),cwd:Se(t.cwd),envNames:we(t.envNames,H),timeout:i,referencedVariables:n,unsetVariables:o};const r=t.oauth===null?void 0:oe(t.oauth);return{type:e,endpoint:H(t.endpoint),headerNames:we(t.headerNames,H),authConfigured:Le(t.authConfigured),oauthConfigured:Le(t.oauthConfigured),oauth:r===void 0?void 0:{clientId:Se(r.clientId),callbackPort:r.callbackPort===null?void 0:et(r.callbackPort),scopes:Se(r.scopes),metadataConfigured:Le(r.metadataConfigured)},timeout:i,referencedVariables:n,unsetVariables:o}}function Qm(s){const t=oe(s);return{revision:Se(t.revision),enabled:Le(t.enabled),secretsInUserScope:t.secretsInUserScope===!0,configuration:wn(t.configuration)}}function _n(s){const t=oe(s);return{name:H(t.name),description:Se(t.description)}}function Gm(s){const t=oe(s);return{enabled:Le(t.enabled),configuration:wn(t.configuration),connections:we(t.connections,e=>{const n=oe(e),o=oe(n.state),i=Xe(o.status,["disconnected","connecting","connected","failed","closed","auth_required"]);return{state:i,expired:i==="auth_required"?Le(o.expired):void 0,tools:n.tools===null?void 0:we(n.tools,_n)}})}}function Jm(s){const t=oe(s);return{status:Xe(t.status,["connected","authRequired","failed"]),latencyMs:et(t.latencyMs),tools:t.tools===null?void 0:we(t.tools,_n),expired:t.expired===void 0?void 0:Le(t.expired),missingScopes:t.missingScopes===void 0?void 0:we(t.missingScopes,H),reason:Se(t.reason),message:Se(t.message)}}function Ym(s){const t=oe(s),e=H(t.authorizationUrl),n=new URL(e);if(!["https:","http:"].includes(n.protocol)||n.username||n.password)throw new Ae("Invalid MCP authorization URL");return{attemptId:H(t.attemptId),authorizationUrl:e,redirectUri:H(t.redirectUri),expiresAt:et(t.expiresAt)}}function Xm(s){const t=oe(s);return we(t.sources,e=>{const n=oe(e);return{id:H(n.id),client:H(n.client),scope:H(n.scope),path:H(n.path),state:Xe(n.state,["ready","absent","unreadable","too-large","malformed"]),entries:n.entries===void 0?void 0:et(n.entries),error:Se(n.error)}})}function Zm(s){const t=oe(s);return{revision:H(t.revision),sourceRevision:Se(t.sourceRevision),store:t.store===void 0?void 0:(()=>{const e=oe(t.store);return{id:H(e.id),client:H(e.client),scope:H(e.scope),path:H(e.path)}})(),entries:we(t.entries,e=>{const n=oe(e);return{id:H(n.id),transport:Se(n.transport),status:Xe(n.status,["identical","changed","conflict","invalid"]),changes:we(n.changes,o=>{const i=oe(o);return{field:H(i.field),kind:H(i.kind)}}),unsupported:we(n.unsupported,o=>{const i=oe(o);return{field:H(i.field),effect:Xe(i.effect,["kept-unused","dropped"])}}),omitted:et(n.omitted),error:Se(n.error)}}),unknownTopLevel:we(t.unknownTopLevel,H)}}function ev(s){return H(oe(s).revision)}function tv(s){const t=oe(s);return{sessions:dn(t.sessions),nextCursor:Se(t.nextCursor)}}function sv(s){const t=oe(s);return{sessions:et(t.sessions),connections:et(t.connections),serverVersion:H(t.serverVersion)}}function nv(s){const t=oe(s);return{revision:H(t.revision),enabled:Le(oe(t.document).enabled)}}function ov(s){const t=oe(s),e=oe(t.document);return{revision:H(t.revision),sandbox:Le(e.sandbox),network:Le(e.network)}}function iv(s){const t=oe(s);return Le(t.available)?{available:!0}:{available:!1,reason:H(t.reason)}}function hs(s){const t=oe(s);return{dimension:H(t.dimension),detail:H(t.detail)}}function js(s){const t=oe(s),e=t.reason===null||t.reason===void 0?void 0:hs(t.reason);return{providerId:H(t.providerId),modelId:H(t.modelId),available:Le(t.available),...e===void 0?{}:{reason:e}}}function na(s){const t=oe(s),e=Se(t.key),n=t.effective===null||t.effective===void 0?void 0:oe(t.effective);return{operation:H(t.operation),...e===void 0?{}:{key:e},available:Le(t.available),reasons:we(t.reasons,hs),...t.default===null||t.default===void 0?{}:{default:js(t.default)},...n===void 0?{}:{effective:{providerId:H(n.providerId),modelId:H(n.modelId),source:Xe(n.source,["default","automatic"])}},options:we(t.options,js)}}function av(s){const t=oe(s);return{revision:H(t.revision),categories:we(t.categories,e=>{const n=oe(e);return{category:H(n.category),available:Le(n.available),reasons:we(n.reasons,hs),operations:we(n.operations,na)}})}}const Ke=vt("sessions",()=>{const s=P([]),t=P(!1),e=P("");let n;const o=new Map,i=E(()=>new Map(s.value.map(I=>[I.sessionId,I]))),r=E(()=>{const I=new Map;for(const b of s.value){if(b.origin==="internal"||b.origin==="automation")continue;const w=I.get(b.cwd);w===void 0?I.set(b.cwd,[b]):w.push(b)}return[...I].map(([b,w])=>(w.sort((k,C)=>C.updatedAt-k.updatedAt),{cwd:b,name:Gt(b),sessions:w,updatedAt:w[0].updatedAt})).sort((b,w)=>w.updatedAt-b.updatedAt)});function l(){return n??(n=Ce().client.call("session.summaries",{},dn).then(I=>{for(const b of I){const w=i.value.get(b.sessionId)??o.get(b.sessionId);w!==void 0&&w.titleRevision>=b.titleRevision&&(b.title=w.title,b.titleSource=w.titleSource,b.titleRevision=w.titleRevision),o.delete(b.sessionId)}s.value=I,t.value=!0,e.value=""}).catch(I=>{e.value=I instanceof Error?I.message:String(I)}).finally(()=>{n=void 0})),n}async function m(I,b){const w={cwd:I};b!==void 0&&(w.model={provider:b.providerId,modelId:b.modelId});const k=await Ce().client.call("session.create",w,zo);return l(),k.sessionId}function v(I,b){const w=i.value.get(I);w!==void 0&&w.running!==b&&(w.running=b)}function _(I,b){const w=i.value.get(I),k=w??o.get(I);k!==void 0&&b.titleRevision<=k.titleRevision||(w===void 0?o.set(I,b):Object.assign(w,b))}function f(I){o.delete(I),s.value=s.value.filter(b=>b.sessionId!==I)}return{summaries:s,loaded:t,error:e,byId:i,workspaces:r,refresh:l,create:m,setRunning:v,setTitle:_,forget:f}});function Gt(s){return s.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)||s}const oa=1100;function kt(s){return s.slice(0,8)}function Pt(s,t){switch(t.kind){case"main":return s("lines.state.main");case"working":return s("lines.state.working");case"waiting":return s("lines.state.waiting");case"ending":return s("lines.state.ending");case"ended":return s("lines.state.ended");case"ended-itself":return s("lines.state.endedItself");case"ended-by-operation":return s("lines.state.endedByOperation");case"ended-with":return s("lines.state.endedWith",{id:t.ancestor});case"creation-failed":return s("lines.state.creationFailed")}}function ms(s){if(s.kind==="working")return"primary";if(s.kind==="creation-failed")return"danger";if(s.kind==="ended-with")return"warning"}function dt(s,t,e){const n=(t==null?void 0:t.purpose.trim())??"";return n===""?kt(e):n}function ia(s,t){const e=!t.detailOpen||!t.detailExpanded&&t.shellWidth>=oa,n=t.detailOpen?t.activeLine:void 0,o=e&&s.some(r=>r.branchId===ue),i=n!==void 0&&s.some(r=>r.branchId===n);if(o&&i)return t.detailFocused?n:ue;if(i)return n;if(o)return ue}function aa(s,t={}){if(t.keyboard===!1||t.pending||s.defaultPrevented||t.dialogOpen)return;const e=s.target;if(!(e!==null&&typeof e=="object"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable===!0))){if(s.key==="Enter"||s.key==="y"||s.key==="Y")return"allow";if(s.key==="Escape"||s.key==="n"||s.key==="N")return"deny"}}const Bs="dim-web.appearance.v1",vs=vt("appearance",()=>{const s=P("system"),t=P(14),e=P(""),n=P("");try{const m=JSON.parse(localStorage.getItem(Bs)??"null");if(m!==null&&typeof m=="object"&&!Array.isArray(m)){const v=m;(v.theme==="light"||v.theme==="dark"||v.theme==="system")&&(s.value=v.theme),typeof v.fontSize=="number"&&[12,13,14,15,16,18].includes(v.fontSize)&&(t.value=v.fontSize),(v.language==="en"||v.language==="zh-CN")&&(e.value=v.language)}}catch{n.value="Browser appearance preferences could not be read."}const o=P("light"),i=matchMedia("(prefers-color-scheme: dark)");function r(){o.value=s.value==="dark"||s.value==="system"&&i.matches?"dark":"light",document.documentElement.classList.toggle("dark",o.value==="dark"),document.documentElement.style.setProperty("--ui-font-size",String(t.value))}r(),i.addEventListener("change",r),$e([s,t,e],()=>{r(),n.value="";try{localStorage.setItem(Bs,JSON.stringify({theme:s.value,fontSize:t.value,language:e.value}))}catch{n.value="Browser storage is unavailable. Appearance changes will not survive a reload."}},{flush:"sync"});async function l(m){try{await bn(m||navigator.language),e.value=m}catch{n.value="The selected language could not be loaded."}}return{theme:s,resolvedTheme:o,fontSize:t,language:e,selectLanguage:l,error:n}}),In="dim-web.ui.v1",$n=320,xn=720;function ra(){const s={sidebarCollapsed:!1,collapsedWorkspaces:[],lastSessionId:void 0,detailOpen:!1,detailWidth:420};try{const t=JSON.parse(localStorage.getItem(In)??"null");if(t===null||typeof t!="object")return s;const e=t,n=typeof e.detailWidth=="number"&&Number.isFinite(e.detailWidth)?Math.min(xn,Math.max($n,e.detailWidth)):s.detailWidth;return{sidebarCollapsed:e.sidebarCollapsed===!0,collapsedWorkspaces:Array.isArray(e.collapsedWorkspaces)?e.collapsedWorkspaces.filter(o=>typeof o=="string"):[],lastSessionId:typeof e.lastSessionId=="string"?e.lastSessionId:void 0,detailOpen:e.detailOpen===!0,extension:e.extension!==null&&typeof e.extension=="object"&&"pluginName"in e.extension&&"panelId"in e.extension&&typeof e.extension.pluginName=="string"&&typeof e.extension.panelId=="string"?{pluginName:e.extension.pluginName,panelId:e.extension.panelId}:void 0,detailWidth:n}}catch{return s}}const Ve=vt("ui",()=>{const s=ra(),t=P(s.sidebarCollapsed),e=P(s.collapsedWorkspaces),n=P(s.lastSessionId),o=P(!1),i=P(typeof window<"u"&&window.innerWidth>0?window.innerWidth:1200),r=E(()=>i.value<720?"compact":i.value<960?"regular":"wide"),l=P(s.extension),m=P(s.detailOpen),v=P(s.detailWidth),_=P(!1),f=P(!1),I=P({}),b=P({}),w=P(),k=P();$e([t,e,n,m,v,l],()=>{try{localStorage.setItem(In,JSON.stringify({sidebarCollapsed:t.value,collapsedWorkspaces:e.value,lastSessionId:n.value,detailOpen:m.value,extension:l.value,detailWidth:v.value}))}catch{}},{deep:!0}),vs();function C(D){i.value=D,r.value!=="compact"&&(o.value=!1)}function x(D){return!e.value.includes(D)}function J(D){e.value=x(D)?[...e.value,D]:e.value.filter(L=>L!==D)}function X(D){v.value=Math.min(xn,Math.max($n,Math.round(D)))}function W(D){l.value=void 0,m.value=!0,f.value=!0,b.value={...b.value,[D]:void 0}}function O(D){m.value&&l.value===void 0&&b.value[D]===void 0?(m.value=!1,f.value=!1):W(D)}function j(D,L){l.value=void 0;const K=I.value[D]??[];K.includes(L)||(I.value={...I.value,[D]:[...K,L]}),b.value={...b.value,[D]:L},m.value=!0,f.value=!0}function $(D,L){if(l.value=void 0,!(I.value[D]??[]).includes(L)){j(D,L);return}b.value={...b.value,[D]:L},m.value=!0,f.value=!0}function M(D,L){const K=(I.value[D]??[]).filter(me=>me!==L);I.value={...I.value,[D]:K},b.value[D]===L&&(b.value={...b.value,[D]:K.at(-1)})}function T(){m.value=!1,_.value=!1,f.value=!1}function V(D,L,K){return l.value!==void 0&&m.value&&f.value?!1:ia(K,{detailOpen:m.value,detailExpanded:_.value,shellWidth:i.value,activeLine:b.value[D],detailFocused:f.value})===L}function se(D){w.value=D}function de(){w.value=void 0}function ge(D){k.value=D}function Y(){k.value=void 0}function le(D){var L,K;I.value={...I.value,[D]:[]},b.value={...b.value,[D]:void 0},((L=w.value)==null?void 0:L.sessionId)===D&&(w.value=void 0),((K=k.value)==null?void 0:K.sessionId)===D&&(k.value=void 0),m.value&&(m.value=!1),f.value=!1}return{sidebarCollapsed:t,lastSessionId:n,drawerOpen:o,shellWidth:i,shellMode:r,setShellWidth:C,isWorkspaceExpanded:x,toggleWorkspace:J,extension:l,detailOpen:m,detailWidth:v,detailExpanded:_,detailFocused:f,lineTabs:I,activeLineTab:b,newLine:w,endingLine:k,setDetailWidth:X,openLines:W,toggleLines:O,openLine:j,activateLine:$,closeLineTab:M,closeDetail:T,approvalKeyboard:V,requestNewLine:se,closeNewLine:de,requestEndLine:ge,closeEndLine:Y,resetSessionTabs:le}}),la=6e4,da=16;function Fs(){return{projection:new is,opened:!1,before:void 0,through:0,loadingEarlier:!1,historyError:"",liveTask:void 0,progress:void 0,syncing:!1,done:!1,error:"",queued:[]}}function ca(){return{running:!1,stopping:!1}}const Ge=vt("chat",()=>{const s=Is({}),t=new Map;let e;function n(){return Ce().client}function o(p){if(t.has(p))return;const g=Ke().byId.get(p),y=Is({sessionId:p,status:"loading",error:"",rows:[],running:(g==null?void 0:g.running)??!1,stopping:!1,retry:void 0,sessionRunning:(g==null?void 0:g.running)??!1,approvals:[],questions:[],methods:[],permission:void 0,goal:void 0,queued:[],model:g==null?void 0:g.model,lines:[],branches:{},lastTurnEnd:void 0,earlier:!1,loadingEarlier:!1,historyError:""}),q={view:y,main:Fs(),branches:new Map,lines:new Xi,states:new Map,syncing:!1,queued:[],historyQueue:[],historyRunning:!1,goalRefreshing:!1,goalDirty:!1,publishTimer:void 0};q.main.opened=!0,t.set(p,q),s[p]=y,r(q)}async function i(){await Promise.all([...t.values()].filter(p=>p.view.status!=="closed").map(r))}async function r(p){if(p.syncing)return;const{view:g}=p;p.syncing=!0,p.view.status="loading",p.states.clear(),p.queued=[],g.approvals=[],p.main.syncing=!0,p.main.done=!1,p.main.error="",p.main.queued=[],p.main.progress=void 0;for(const[y,q]of p.branches)q.syncing=q.opened,q.done=!1,q.error="",q.queued=[],q.progress=void 0,q.opened&&!p.historyQueue.includes(y)&&p.historyQueue.push(y);try{const y=await n().call("session.attach",{sessionId:g.sessionId,...Ce().supports("session.history.display")&&Ce().supports("session.history.detail")?{display:!0}:{}},gi);if(!Ce().supports("session.history.latestTurn"))throw new Ae("This server does not support bounded conversation history");g.methods=await qe(g.sessionId);for(const U of["session.input.pending","session.question.pending","session.turn.get"])if(!g.methods.includes(U))throw new Ae(`This Session does not provide ${U}`);const q=await n().call("session.branches",{sessionId:g.sessionId},vi);p.lines.directory(q);for(const U of q){if(U.branchId===ue)continue;const ie=I(p,U.branchId);if(!ie.opened){const Me=await b(p,U.branchId,U.head);ie.projection=new is,ie.projection.restoreControls([],Me,U.head)}}const B=await x(p,ue);if(B!=="ok"){B==="failed"&&g.status!=="closed"&&(g.status="failed",g.error=p.main.error);return}if(p.main.projection.model=y,await k(p),g.status==="failed")return;const ee=p.queued;p.queued=[],p.syncing=!1;for(const U of ee)l(U);g.status!=="closed"&&(g.permission=await at(g.sessionId)),g.status!=="closed"&&(g.status="ready",g.error=""),T(p),g.status!=="closed"&&W(p)}catch(y){y instanceof ct&&y.appError==="session_closed"?g.status="closed":y instanceof Bt||(g.status="failed",g.error=y instanceof Error?y.message:String(y))}finally{if(p.syncing=!1,p.main.syncing=!p.main.done||p.main.error!=="",p.main.syncing)for(const y of p.queued)m(p,y);p.queued=[],T(p)}}function l(p){if(p.method==="ui.extensions.changed")return;const g=p.method==="session.model.progress"?p.progress.sessionId:p.method==="approval.request"?p.request.sessionId:p.sessionId,y=t.get(g);if(y!==void 0){if(y.syncing){y.queued.push(p);return}m(y,p)}}function m(p,g){var q;const y=p.view;switch(g.method){case"session.event":case"session.display":{const B=g.branchId,ee=I(p,B);if(ee.syncing){p.lines.apply(B,g.event);const U=g.event.content;(U.kind==="turn-end"||(U.kind==="model-end"||U.kind==="tool-use-start"||U.kind==="tool-use")&&U.requestId===((q=ee.progress)==null?void 0:q.requestId))&&(ee.progress=void 0),ee.queued.push(g.event)}else ee.opened?(ee.queued.push(g.event),f(p,B).catch(U=>{ee.error=U instanceof Error?U.message:String(U),ee.syncing=!0,M(p)})):v(p,B,g.event);break}case"session.model.progress":{const B=g.progress.branchId,ee=I(p,B);if(ee.progress=g.progress,ee.syncing||!ee.opened||ee.liveTask!==void 0)break;ee.projection.progress(g.progress),M(p);break}case"session.state":{g.branchId===ue&&y.running&&!g.running&&V(),p.states.set(g.branchId,{running:g.running,stopping:g.stopping}),p.lines.setRunning(g.branchId,g.running),g.branchId!==ue&&I(p,g.branchId);const B=$(p);y.running=j(p,ue).running,y.stopping=j(p,ue).stopping,y.sessionRunning=B,Ke().setRunning(y.sessionId,B),M(p);break}case"approval.request":y.approvals.some(B=>B.requestId===g.request.requestId&&B.branchId===g.request.branchId)||(y.approvals=[...y.approvals,g.request]);break;case"approval.resolved":case"approval.cancelled":y.approvals.some(B=>B.branchId===g.branchId&&B.requestId===g.requestId)&&se(y,g.branchId,g.requestId);break;case"memberApprovalEnded":{const B=y.approvals.filter(ee=>ee.branchId===g.branchId&&ee.call.name==="member_approval_allow"&&ee.call.input.approvalId===g.approvalId);for(const ee of B)se(y,ee.branchId,ee.requestId),K(y.sessionId,ee,"deny").catch(()=>{});break}case"session.closed":y.status="closed",y.running=!1,y.stopping=!1,y.sessionRunning=!1,y.approvals=[],y.questions=[],Ke().forget(y.sessionId),Ve().resetSessionTabs(y.sessionId);break}}function v(p,g,y){var ee;p.lines.apply(g,y);const q=I(p,g);if(!q.opened){q.projection.applyControl(y),M(p);return}if(!q.projection.apply(y))return;const B=y.content;(B.kind==="turn-end"||(B.kind==="model-end"||B.kind==="tool-use-start"||B.kind==="tool-use")&&B.requestId===((ee=q.progress)==null?void 0:ee.requestId))&&(q.progress=void 0),y.content.kind==="branch-create"&&I(p,y.content.branchId),g===ue&&y.content.kind==="permission-changed"&&(p.view.permission=y.content.policy),g===ue&&(B.kind==="input-deleted"||(B.kind==="input"||B.kind==="source-input")&&B.blocks.some(U=>{var ie;return(ie=U.key)==null?void 0:ie.startsWith("goal:")}))&&k(p),M(p)}async function _(p,g,y,q){if(q.parentCallId!==void 0)return;const B=q.content;if(B.kind!=="tool-completed"&&B.kind!=="tool-result")return;const ee=B.kind==="tool-result"?B.results:[{callId:B.callId,result:B.result}];for(const U of ee){if(y.rows.some(Me=>Me.kind==="tool"&&Me.callId===U.callId))continue;const ie=await n().call("session.tool.get",{sessionId:p.view.sessionId,branchId:g,requestId:B.requestId,callId:U.callId,through:q.sequence},_i);ie!==void 0&&y.rows.push({kind:"tool",key:`tool-${ie.callId}`,callId:ie.callId,name:ie.name,input:ie.input,pending:!1,result:U.result})}}function f(p,g){const y=I(p,g);if(y.liveTask!==void 0)return y.liveTask;const q=y.projection;return y.liveTask=(async()=>{for(;!y.syncing&&y.queued.length>0;){const B=y.queued[0];if(B.sequence>q.cursor&&await _(p,g,q,B),y.projection!==q||y.syncing)return;y.queued.shift(),v(p,g,B)}!y.syncing&&y.progress!==void 0&&q.progress(y.progress)})().then(()=>{if(y.liveTask=void 0,!y.syncing&&y.queued.length>0)return f(p,g)},B=>{throw y.liveTask=void 0,y.syncing=!0,B}).finally(()=>M(p)),y.liveTask}function I(p,g){if(g===ue)return p.main;let y=p.branches.get(g);return y===void 0&&(y=Fs(),p.branches.set(g,y),M(p)),y}async function b(p,g,y){const q=[];let B;do{const ee=await n().call("session.question.pending",{sessionId:p.view.sessionId,branchId:g,through:y,...B==null?{}:{after:B}},yi);if(ee.branchId!==g||ee.through!==y)throw new Ae("Question snapshot changed");q.push(...ee.asks),B=ee.next}while(B!=null);return q}async function w(p,g,y,q){var Me;const B=await b(p,g,q),ee=[];let U;do{const A=await n().call("session.input.pending",{sessionId:p.view.sessionId,branchId:g,through:q,...U==null?{}:{after:U}},bi);if(A.branchId!==g||A.through!==q)throw new Ae("Input snapshot changed");ee.push(...A.inputs),U=A.next}while(U!=null);y.restoreControls(ee,B,q);const ie=await n().call("session.turn.get",{sessionId:p.view.sessionId,branchId:g,through:q},ki);if(ie.branchId!==g||ie.through!==q)throw new Ae("Turn snapshot changed");ie.output!==void 0&&y.activeOutput(ie.output),(Me=ie.turn)!=null&&Me.ended&&(y.lastTurnEnd=Math.max(y.lastTurnEnd??0,ie.turn.sequence)),p.states.has(g)||p.states.set(g,{running:ie.turn!==void 0&&!ie.turn.ended,stopping:!1})}async function k(p){if(p.view.methods.includes("session.goal.get")&&(p.goalDirty=!0,!p.goalRefreshing)){p.goalRefreshing=!0;try{for(;p.goalDirty;)p.goalDirty=!1,p.main.projection.goal=await n().call("session.goal.get",{sessionId:p.view.sessionId,branchId:ue},wi),M(p)}catch(g){p.view.status="failed",p.view.error=g instanceof Error?g.message:String(g)}finally{p.goalRefreshing=!1}}}async function C(p,g,y,q){const B=new Gi(y,q);for(;;){const ie=Ce().supports("session.history.display")&&Ce().supports("session.history.detail"),Me=await n().call(ie?"session.history.display":"session.history",B.params(p.view.sessionId,g),ie?jo:No,la);if(B.push(Me))break}const ee=B.take(),U=new is;for(const ie of ee)await _(p,g,U,ie),U.apply(ie);return{window:B,events:ee,projection:U}}async function x(p,g){var q,B;const y=I(p,g);y.syncing=!0,y.error="",y.done=!1;for(let ee=0;;ee++)try{const U=await C(p,g),ie=U.window.through;await w(p,g,U.projection,ie),g!==ue&&p.lines.detail(await n().call("session.branch.get",{sessionId:p.view.sessionId,branchId:g},fi)),await((q=y.liveTask)==null?void 0:q.catch(()=>{})),U.projection.cursor=ie,y.projection=U.projection,y.before=U.window.before,y.through=ie;for(const Me of U.events){const A=Me.content;(A.kind==="turn-end"||(A.kind==="model-end"||A.kind==="tool-use-start"||A.kind==="tool-use")&&A.requestId===((B=y.progress)==null?void 0:B.requestId))&&(y.progress=void 0)}return y.queued=y.queued.filter(Me=>Me.sequence>ie),y.syncing=!1,await f(p,g),y.done=!0,M(p),"ok"}catch(U){if(g!==ue&&ee<10&&X(U)){await new Promise(ie=>setTimeout(ie,100));continue}return U instanceof Bt?"lost":(y.done=!0,y.syncing=!0,y.error=U instanceof Error?U.message:String(U),U instanceof ct&&U.appError==="session_closed"&&(p.view.status="closed"),M(p),"failed")}}async function J(p,g){const y=t.get(p);if(y===void 0)return;const q=I(y,g);if(q.before===void 0||q.loadingEarlier||q.syncing)return;q.loadingEarlier=!0,q.historyError="";const B=q.before,ee=q.projection;T(y);try{const U=await C(y,g,B,q.through);if(q.projection!==ee)return;ee.prepend(U.projection.rows,`before-${B}`),q.before=U.window.before}catch(U){q.historyError=U instanceof Error?U.message:String(U)}finally{q.loadingEarlier=!1,T(y)}}function X(p){return p instanceof ct&&(p.appError==="branch_missing"||p.appError==="unknown_branch"||p.message.startsWith("unknown branch"))}async function W(p){if(!(p.historyRunning||p.syncing)){p.historyRunning=!0;try{for(;p.historyQueue.length>0;){const g=p.historyQueue.shift();g===ue||!p.branches.has(g)||await x(p,g)}}finally{p.historyRunning=!1,T(p)}}}function O(p,g){const y=t.get(p);if(y===void 0||g===ue)return;const q=y.branches.get(g);q!==void 0&&(q.error="",q.done=!1,q.syncing=!0,y.historyQueue.includes(g)||y.historyQueue.push(g),T(y),W(y))}function j(p,g){return p.states.get(g)??ca()}function $(p){const g=new Set(p.lines.views().filter(y=>y.state.kind.startsWith("ended")||y.state.kind==="creation-failed").map(y=>y.id));return[...p.states].some(([y,q])=>!g.has(y)&&(q.running||q.stopping))}function M(p){p.publishTimer??(p.publishTimer=setTimeout(()=>T(p),da))}function T(p){var B,ee;clearTimeout(p.publishTimer),p.publishTimer=void 0;const g=p.view,y=j(p,ue);g.rows=p.main.projection.rows.slice(),g.lastTurnEnd=p.main.projection.lastTurnEnd,g.earlier=p.main.before!==void 0,g.loadingEarlier=p.main.loadingEarlier,g.historyError=p.main.historyError,g.running=y.running,g.stopping=y.stopping,g.retry=(B=p.main.progress)==null?void 0:B.retry,g.sessionRunning=$(p),g.model=p.main.projection.model??((ee=Ke().byId.get(g.sessionId))==null?void 0:ee.model),g.lines=p.lines.views(),g.goal=p.main.projection.goal,g.queued=p.main.projection.queued(),g.questions=[...p.main.projection.waiting().map(U=>({branchId:ue,...U})),...[...p.branches].flatMap(([U,ie])=>ie.projection.waiting().map(Me=>({branchId:U,...Me})))];const q={};for(const[U,ie]of p.branches){const Me=j(p,U);q[U]={rows:ie.projection.rows.slice(),running:Me.running,stopping:Me.stopping,status:ie.error!==""?"failed":ie.done?"ready":"loading",error:ie.error,lastTurnEnd:ie.projection.lastTurnEnd,earlier:ie.before!==void 0,loadingEarlier:ie.loadingEarlier,historyError:ie.historyError}}g.branches=q}function V(){clearTimeout(e),e=setTimeout(()=>void Ke().refresh(),500)}function se(p,g,y){p.approvals=p.approvals.filter(q=>q.branchId!==g||q.requestId!==y)}function de(p,g){const y=t.get(p);if(y===void 0||g!==ue&&!y.lines.has(g))return;const q=I(y,g);q.opened||(q.opened=!0,q.syncing=!0,y.historyQueue.includes(g)||y.historyQueue.push(g),W(y)),T(y)}async function ge(p,g,y,q={images:[],pastes:[]}){let B=y;for(const U of q.pastes){const ie=await n().call("attachment.put",{sessionId:p,text:U},Uo);B=`${B}${B===""?"":`
|
|
224
|
+
`}[Pasted text: ${ie} (${U.split(`
|
|
225
|
+
`).length} lines)]`}const ee={sessionId:p,branchId:g,submissionId:crypto.randomUUID(),mode:"queue"};q.images.length===0?ee.text=B:ee.user={content:[...B===""?[]:[{type:"text",text:B}],...q.images]},await n().call("session.submit",ee,mt)}async function Y(p,g){await n().call("session.stop",{sessionId:p,branchId:g,reason:"Stopped from the web workspace"},mt)}async function le(p,g,y,q){return(await n().call("session.branch_create",{sessionId:p,parentBranchId:g,at:y,prompt:q},Do)).branchId}async function D(p,g){await n().call("session.branch_end",{sessionId:p,branchId:g},mt)}async function L(p,g){return n().call("session.collaboration.approval.get",{sessionId:p,branchId:g.branchId,requestId:g.requestId},di)}async function K(p,g,y){await n().call("approval.respond",{sessionId:p,branchId:g.branchId,requestId:g.requestId,decision:y},mt);const q=s[p];q!==void 0&&se(q,g.branchId,g.requestId)}async function me(p,g){const y=fn(g);if(y===void 0)throw new Error("This approval has no simple command to allow");const q=Ti(y),B=await n().call("permission.rules",{},ta);B.commandRules.some(ee=>qi(ee,q))||await n().call("permission.set_rules",{expectedRevision:B.revision,commandRules:[...B.commandRules,q]},sa),await K(p,g,"allow")}async function F(p,g){const y=gn(g);if(y===void 0)throw new Error("This approval names no file to allow");await n().call("session.grants.add",{sessionId:p,...y},mt),await K(p,g,"allow")}async function ce(p,g,y){await n().call("session.question.respond",{sessionId:p,branchId:g.branchId,requestId:g.requestId,callId:g.callId,...y===void 0?{declined:!0}:{answers:y}},mt)}async function qe(p){return Ce().supports("session.methods")?n().call("session.methods",{sessionId:p},us).catch(()=>[]):[]}async function Ze(p){return n().call("session.context.compact",{sessionId:p,branchId:ue},Ro)}async function Je(p,g,y){await n().call(`session.goal.${g}`,{sessionId:p,branchId:ue,...y===void 0?{}:{objective:y}},mt);const q=t.get(p);if(q!==void 0&&(await k(q),q.view.status==="failed"))throw new Error(q.view.error)}async function tt(p){return n().call("session.context.usage",{sessionId:p,branchId:ue},Oo)}async function ze(p,g){return n().call("session.fork",{sessionId:p,at:g},Po)}async function Ue(p,g){return n().call("session.files.search",{sessionId:p,query:g,limit:20},Vo)}async function Be(p,g,y){return n().call("session.input.withdraw",{sessionId:p,branchId:ue,inputId:g,...y===void 0?{}:{steer:y}},Xo)}async function at(p){if(Ce().supports("session.permission.get"))return n().call("session.permission.get",{sessionId:p,branchId:ue},Ts).then(g=>g.policy,()=>{})}async function ht(p,g){const y=await n().call("session.permission.get",{sessionId:p,branchId:ue},Ts),q=s[p];if(q!==void 0&&(q.permission=y.policy),y.policy.preset===g)return"unchanged";const B={...y.policy,preset:g};try{await n().call("session.permission.update",{sessionId:p,branchId:ue,expectedVersion:y.version,policy:B},Wo)}catch(ee){if(ee instanceof ct&&ee.appError==="permission_conflict")return q!==void 0&&(q.permission=await at(p)),"conflict";throw ee}return q!==void 0&&(q.permission=B),"updated"}async function R(p,g){return n().call("session.model.update",{sessionId:p,branchId:ue,modelPreferences:{reasoningEffort:g}},Ho)}async function Z(p,g){const y=await n().call("session.model.update",{sessionId:p,branchId:ue,providerId:g.providerId,modelId:g.modelId},Bo),q=t.get(p);q!==void 0&&(q.main.projection.model=y.model,T(q))}return{views:s,open:o,resync:i,receive:l,ensureLine:de,loadEarlier:J,retryLine:O,submit:ge,stop:Y,createLine:le,endLine:D,respond:K,allowAlways:me,allowForSession:F,answerQuestion:ce,compact:Ze,usage:tt,fork:ze,writeGoal:Je,setEffort:R,setPermission:ht,withdrawInput:Be,searchFiles:Ue,memberApproval:L,setModel:Z}}),ua=4e3,xt=vt("toast",()=>{const s=P([]),t=new Map;let e=0;function n(l){clearTimeout(t.get(l)),t.delete(l),s.value=s.value.filter(m=>m.id!==l)}function o(l){clearTimeout(t.get(l)),t.set(l,setTimeout(()=>n(l),ua))}function i(l){clearTimeout(t.get(l)),t.delete(l)}function r(l){const m=++e,v=[...s.value,{...l,id:m}];for(const _ of v.slice(0,-3))i(_.id);s.value=v.slice(-3),o(m)}return{toasts:s,push:r,dismiss:n,pause:i,resume:o}}),Tt=vt("extensions",()=>{const s=Wt(),t=P("");let e=0;function n(){e++,s.value=void 0,t.value=""}async function o(i=!1){const r=Ce();if(r.phase!=="connected")return;if(!i&&!r.supports("ui.extensions.list")){n();return}const l=++e;try{const m=await r.client.call("ui.extensions.list",{},ui);if(l!==e)return;s.value=m,t.value=""}catch(m){if(l!==e)return;s.value=void 0,t.value=m instanceof Error?m.message:String(m)}}return{directory:s,error:t,clear:n,refresh:o}}),Ce=vt("connection",()=>{const s=P("connecting"),t=Wt(),e=P(!1),n=new Ci({phase(i){s.value=i,i!=="connected"&&Tt().clear()},async ready(i,r){t.value=i,e.value=!0,Tt().refresh(),r&&await Ge().resync(),Ke().refresh()},notification(i){if(i.method==="ui.extensions.changed"){Tt().refresh(!0);return}i.method==="session.title"?Ke().setTitle(i.sessionId,i.data):Ge().receive(i)},invalid(i){console.error(i),xt().push({tone:"danger",title:Oe("connection.protocolError"),description:i.message})}});function o(i){var r;return((r=t.value)==null?void 0:r.features.includes(i))??!1}return{phase:s,hello:t,everConnected:e,client:n,supports:o}}),pa=["data-state"],ha=_e({__name:"ConnectionBadge",setup(s){const t=Ce(),{t:e}=ye(),n=E(()=>({connecting:e("connection.connecting"),connected:e("connection.live"),reconnecting:e("connection.reconnecting"),unauthenticated:e("connection.accessRequired"),"version-mismatch":e("connection.versionMismatch")})[t.phase]);return(o,i)=>(d(),c("div",{class:"connection-badge","aria-live":"polite","data-state":a(t).phase},[a(t).phase==="connected"?(d(),ae(a(xo),{key:0,size:14,"aria-hidden":"true"})):(d(),ae(a($o),{key:1,size:14,"aria-hidden":"true"})),u("span",null,[u("strong",null,h(n.value),1),u("small",null,h(a(e)("connection.host")),1)])],8,pa))}}),ma=1440*60*1e3;function Ws(s){const t=new Date(s);return t.setHours(0,0,0,0),t.getTime()}function va(s,t,e=new Date){const n=new Intl.DateTimeFormat(t,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(s);return Ws(e)-Ws(s)<7*ma?`${new Intl.DateTimeFormat(t,{weekday:"long"}).format(s)} ${n}`:`${new Intl.DateTimeFormat(t,{...s.getFullYear()===e.getFullYear()?{}:{year:"numeric"},month:"short",day:"numeric"}).format(s)} ${n}`}function fa(s,t=Date.now()){const e=Math.max(0,t-s.getTime());return e<6e4?"now":e<36e5?`${Math.floor(e/6e4)}m`:e<864e5?`${Math.floor(e/36e5)}h`:`${Math.floor(e/864e5)}d`}function ga(s){const t=Math.max(s,0),e=Math.floor(t/1e3);if(e<60)return e===0&&t>0?`${Math.round(t/100)/10}s`:`${e}s`;const n=Math.floor(e/60),o=e%60;return o>0?`${n}m ${o}s`:`${n}m`}const ba={class:"workspace-group"},ya=["aria-expanded","aria-label"],ka={class:"workspace-disclosure","aria-hidden":"true"},wa=["data-open"],_a={class:"workspace-disclosure-icon"},Ia=["title"],$a={key:0,class:"workspace-running","aria-hidden":"true"},xa={key:0,class:"session-list"},Ca=["data-state"],Sa={key:0},Zt=5,Ea=20,Ma=_e({__name:"SidebarWorkspaceGroup",props:{workspace:{},expanded:{type:Boolean},activeSessionId:{},nowMs:{}},emits:["toggle","navigate"],setup(s,{emit:t}){const e=s,n=t,{t:o}=ye(),i=P(Zt),r=E(()=>e.workspace.sessions.slice(0,i.value)),l=E(()=>e.workspace.sessions.length>i.value),m=E(()=>!e.expanded&&e.workspace.sessions.some(_=>_.running));function v(){i.value=l.value?i.value+Ea:Zt}return(_,f)=>{const I=ft("tooltip");return d(),c("section",ba,[u("div",{class:"workspace-row",onClick:f[3]||(f[3]=b=>n("toggle"))},[u("button",{class:"workspace-toggle",type:"button","aria-expanded":s.expanded,"aria-label":a(o)(s.expanded?"sidebar.collapseWorkspace":"sidebar.expandWorkspace",{name:s.workspace.name}),onClick:f[0]||(f[0]=Ee(b=>n("toggle"),["stop"]))},[u("span",ka,[u("span",{class:"workspace-disclosure-chevron","data-open":s.expanded?"true":void 0},[G(a(Nt),{size:14})],8,wa),u("span",_a,[s.expanded?(d(),ae(a(ro),{key:0,size:14})):(d(),ae(a(os),{key:1,size:14}))])]),u("strong",{title:s.workspace.cwd},h(s.workspace.name),9,Ia)],8,ya),m.value?(d(),c("span",$a,[G(a(Ht),{size:14,class:"is-spinning"})])):z("",!0),u("div",{class:"workspace-row-actions",onClick:f[2]||(f[2]=Ee(()=>{},["stop"]))},[Ne((d(),ae(a(ut),{class:"ui-icon-button workspace-add","data-variant":"ghost","data-size":"sm",to:{name:"chat-new",query:{cwd:s.workspace.cwd}},"aria-label":a(o)("sidebar.newInWorkspace",{name:s.workspace.name}),onClick:f[1]||(f[1]=b=>n("navigate"))},{default:We(()=>[G(a(ls),{"aria-hidden":"true"})]),_:1},8,["to","aria-label"])),[[I,a(o)("sidebar.newInWorkspace",{name:s.workspace.name})]])])]),s.expanded?(d(),c("ul",xa,[(d(!0),c(ne,null,pe(r.value,b=>(d(),c("li",{key:b.sessionId},[G(a(ut),{class:"session-open",to:{name:"chat-session",params:{sessionId:b.sessionId}},"data-open":b.sessionId===s.activeSessionId?"true":void 0,"aria-current":b.sessionId===s.activeSessionId?"page":void 0,title:b.title??b.preview,onClick:f[4]||(f[4]=w=>n("navigate"))},{default:We(()=>[u("span",{class:"status-dot","data-state":b.running?"running":"idle","aria-hidden":"true"},null,8,Ca),u("strong",null,h(b.title??b.preview??a(o)("sidebar.untitled")),1),u("small",null,h(a(fa)(new Date(b.updatedAt),s.nowMs)),1)]),_:2},1032,["to","data-open","aria-current","title"])]))),128)),s.workspace.sessions.length>Zt?(d(),c("li",Sa,[u("button",{class:"ui-button reveal-more","data-variant":"ghost","data-size":"sm",type:"button",onClick:v},[G(a(Nt),{"data-open":l.value?void 0:"true","aria-hidden":"true"},null,8,["data-open"]),be(" "+h(a(o)(l.value?"sidebar.showMore":"sidebar.showLess")),1)])])):z("",!0)])):z("",!0)])}}}),Ta=Re(Ma,[["__scopeId","data-v-6abef294"]]),qa=["aria-label"],Aa={class:"brand-row"},La={class:"brand-copy"},Ra=["aria-label"],Oa=["aria-label"],Pa={class:"sidebar-new-label"},za={class:"ui-field-wrap sidebar-search"},Da=["placeholder","aria-label"],Na={class:"workspace-scroll app-scroll-viewport"},ja={class:"section-label"},Ba={key:0,class:"sidebar-empty",role:"alert"},Fa={key:1,class:"sidebar-empty"},Wa={class:"sidebar-footer"},Va=_e({__name:"AppSidebar",emits:["navigate"],setup(s){const{t}=ye(),{t:e}=ye({messages:cs}),n=Vt(),o=Ke(),i=Ve(),r=P(""),l=P(Date.now());let m;ot(()=>{m=setInterval(()=>{l.value=Date.now()},6e4)}),it(()=>clearInterval(m));const v=E(()=>typeof n.params.sessionId=="string"?n.params.sessionId:void 0),_=E(()=>{var w;return v.value===void 0||(w=o.byId.get(v.value))==null?void 0:w.cwd}),f=E(()=>({name:"chat-new",..._.value===void 0?{}:{query:{cwd:_.value}}})),I=E(()=>r.value.trim().toLocaleLowerCase()),b=E(()=>o.workspaces.flatMap(w=>{if(I.value==="")return[w];const C=w.name.toLocaleLowerCase().includes(I.value)||w.cwd.toLocaleLowerCase().includes(I.value)?w.sessions:w.sessions.filter(x=>[x.title,x.preview].some(J=>J==null?void 0:J.toLocaleLowerCase().includes(I.value)));return C.length===0?[]:[{...w,sessions:C}]}));return(w,k)=>(d(),c("aside",{class:"app-sidebar","aria-label":a(t)("a11y.workspaceSessionIndex")},[u("header",Aa,[G(Kt,{class:"brand-logo"}),u("strong",La,h(a(t)("brand.product")),1),u("button",{class:"ui-icon-button sidebar-collapse","data-variant":"ghost","data-size":"sm",type:"button","aria-label":a(t)("sidebar.closeMenu"),onClick:k[0]||(k[0]=C=>a(i).sidebarCollapsed=!0)},[G(a(mo),{"aria-hidden":"true"})],8,Ra)]),u("nav",{class:"primary-actions","aria-label":a(t)("a11y.primaryNavigation")},[G(a(ut),{class:"ui-button sidebar-new","data-variant":"secondary","data-size":"md",to:f.value,onClick:k[1]||(k[1]=C=>w.$emit("navigate"))},{default:We(()=>[G(a(ls),{"aria-hidden":"true"}),u("span",Pa,h(a(t)("sidebar.newSession")),1)]),_:1},8,["to"])],8,Oa),u("div",za,[G(a(ds),{"aria-hidden":"true"}),Ne(u("input",{"onUpdate:modelValue":k[2]||(k[2]=C=>r.value=C),class:"ui-field","data-size":"md",type:"search",placeholder:a(t)("sidebar.searchPlaceholder"),"aria-label":a(t)("common.search")},null,8,Da),[[At,r.value]])]),u("div",Na,[u("p",ja,h(a(t)("sidebar.workspaces")),1),a(o).error&&!a(o).loaded?(d(),c("p",Ba,h(a(o).error),1)):a(o).loaded&&b.value.length===0?(d(),c("p",Fa,h(a(t)(I.value?"sidebar.noMatches":"sidebar.noWorkspaces")),1)):z("",!0),(d(!0),c(ne,null,pe(b.value,C=>(d(),ae(Ta,{key:C.cwd,workspace:C,expanded:I.value!==""||a(i).isWorkspaceExpanded(C.cwd),"active-session-id":v.value,"now-ms":l.value,onToggle:x=>a(i).toggleWorkspace(C.cwd),onNavigate:k[3]||(k[3]=x=>w.$emit("navigate"))},null,8,["workspace","expanded","active-session-id","now-ms","onToggle"]))),128))]),u("footer",Wa,[G(a(ut),{class:"ui-button","data-variant":"ghost","data-size":"md",to:"/settings",onClick:k[4]||(k[4]=C=>w.$emit("navigate"))},{default:We(()=>[G(a(yo),{"aria-hidden":"true"}),be(h(a(e)("settings")),1)]),_:1}),G(ha)])],8,qa))}}),Vs=Re(Va,[["__scopeId","data-v-c8d45ab0"]]),Ua=["role","onMouseenter","onMouseleave","onFocusin","onFocusout"],Ha=["data-tone"],Ka={class:"ui-toast-title"},Qa={key:0,class:"ui-toast-description"},Ga=["onClick"],Ja=["aria-label","onClick"],Ya=_e({__name:"ToastRegion",setup(s){const{t}=ye(),e=xt();function n(o){var i;e.dismiss(o.id),(i=o.action)==null||i.run()}return(o,i)=>(d(),ae(Wn,{name:"ui-toast",tag:"div",class:"ui-toast-region","aria-live":"polite"},{default:We(()=>[(d(!0),c(ne,null,pe(a(e).toasts,r=>(d(),c("div",{key:r.id,class:"ui-toast",role:r.tone==="danger"?"alert":"status",onMouseenter:l=>a(e).pause(r.id),onMouseleave:l=>a(e).resume(r.id),onFocusin:l=>a(e).pause(r.id),onFocusout:l=>a(e).resume(r.id)},[u("span",{class:"ui-toast-icon","data-tone":r.tone},[r.tone==="danger"?(d(),ae(a(yt),{key:0,"aria-hidden":"true"})):r.tone==="info"?(d(),ae(a(co),{key:1,"aria-hidden":"true"})):(d(),ae(a($t),{key:2,"aria-hidden":"true"}))],8,Ha),u("div",null,[u("p",Ka,h(r.title),1),r.description?(d(),c("p",Qa,h(r.description),1)):z("",!0)]),r.action?(d(),c("button",{key:0,type:"button",class:"ui-button","data-variant":"ghost","data-size":"xs",onClick:l=>n(r)},h(r.action.label),9,Ga)):(d(),c("button",{key:1,type:"button",class:"ui-icon-button","data-variant":"close","data-size":"xs","aria-label":a(t)("common.close"),onClick:l=>a(e).dismiss(r.id)},[G(a(yt),{"aria-hidden":"true"})],8,Ja))],40,Ua))),128))]),_:1}))}}),Xa={key:0},Za={class:"ui-dialog-header"},er={class:"ui-dialog-icon","data-tone":"danger"},tr={class:"ui-dialog-title"},sr={class:"ui-dialog-description"},nr=["aria-label"],or={key:0,class:"ui-banner","data-tone":"danger",role:"alert"},ir={class:"ui-dialog-footer"},ar=["disabled"],rr=["disabled"],lr=_e({__name:"EndLineDialog",setup(s){const{t}=ye(),e=Ge(),n=Ve(),o=P(),i=P(""),r=P(!1),l=E(()=>n.endingLine);ot(()=>{var _;return(_=o.value)==null?void 0:_.showModal()});function m(){var _;(_=o.value)==null||_.close()}async function v(){const _=l.value;if(!(_===void 0||r.value)){r.value=!0,i.value="";try{await e.endLine(_.sessionId,_.branchId),m()}catch(f){i.value=f instanceof Error?f.message:String(f)}finally{r.value=!1}}}return(_,f)=>(d(),c("dialog",{ref_key:"dialog",ref:o,class:"ui-dialog",onCancel:Ee(m,["prevent"]),onClose:f[0]||(f[0]=I=>a(n).closeEndLine())},[l.value?(d(),c("div",Xa,[u("header",Za,[u("span",er,[G(a(gt),{size:16,"aria-hidden":"true"})]),u("div",null,[u("h2",tr,h(a(t)("lines.endTitle",{name:l.value.purpose})),1),u("p",sr,h(a(t)("lines.endDescription")),1)]),u("button",{type:"button",class:"ui-icon-button ui-dialog-close","data-variant":"close","data-size":"sm","aria-label":a(t)("common.close"),onClick:m},[...f[1]||(f[1]=[u("span",{"aria-hidden":"true"},"×",-1)])],8,nr)]),i.value?(d(),c("p",or,h(i.value),1)):z("",!0),u("footer",ir,[u("button",{type:"button",class:"ui-button","data-variant":"ghost","data-size":"md",disabled:r.value,onClick:m},h(a(t)("common.cancel")),9,ar),u("button",{type:"button",class:"ui-button","data-variant":"danger","data-size":"md",disabled:r.value,onClick:v},h(a(t)("lines.end")),9,rr)])])):z("",!0)],544))}}),dr=["session.state","session.history","session.submit","session.interrupt","resources"];function Cn(s,t,e){if(s.placement!=="session-panel")return`Unsupported placement: ${s.placement}`;for(const n of s.requires){if(!dr.includes(n))return`Unsupported capability: ${n}`;const o={"session.history":"session.history","session.submit":"session.submit","session.interrupt":"session.stop"}[n];if(o&&!t(o))return`Unavailable capability: ${n}`}for(const n of s.methods)if(!e.includes(n.name))return`Unavailable method: ${n.name}`}class Ot extends Error{constructor(e,n){super(n);ve(this,"name","PanelError");this.code=e}}function cr(s,t){const e=new AbortController,n=new Set,{sessionId:o,branchId:i}=t.environment,r=Object.freeze({sessionId:o,branchId:i});function l(){if(e.signal.aborted)throw new Ot("binding_closed","This panel binding has ended")}function m(b,w){l();const k=b(C=>{e.signal.aborted||w(C)});return n.add(k),()=>{n.delete(k),k()}}async function v(b,w,k,C){if(l(),"sessionId"in w||"branchId"in w)throw new Ot("invalid_binding","Panel arguments cannot override their bound target");try{const x=await t.client.call(b,{...w,sessionId:o,...C?{branchId:i}:{}},k);return l(),x}catch(x){throw!e.signal.aborted&&x instanceof ct&&["service_reloading","service_unavailable","unknown_method","session_closed","branch_ended"].includes(x.appError??"")&&t.unavailable(x),x}}const _={};for(const b of s.requires)switch(b){case"session.state":(_.session??(_.session={})).state={observe:w=>m(t.observeActivity,w)};break;case"session.history":(_.session??(_.session={})).history={read:w=>v("session.history",w,pi,!0)};break;case"session.submit":(_.session??(_.session={})).submit=w=>v("session.submit",w,hi,!0);break;case"session.interrupt":(_.session??(_.session={})).interrupt=()=>v("session.stop",{},mi,!0);break;case"resources":_.resources={url(w){if(l(),w.sessionId!==r.sessionId||!/^[a-zA-Z0-9_-]+$/.test(w.id))throw new Ot("invalid_binding","Resource must belong to this Session");return`/api/ui/sessions/${encodeURIComponent(r.sessionId)}/resources/${encodeURIComponent(w.id)}`}};break;default:throw new Ot("missing_capability",`Unsupported capability: ${b}`)}const f=Object.fromEntries(s.methods.map(b=>[b.name,w=>v(b.name,w,k=>k,b.scope==="branch")]));return{context:Object.freeze({signal:e.signal,environment:Object.freeze({...t.environment}),observeEnvironment:b=>m(t.observeEnvironment,b),services:Object.freeze(_),methods:Object.freeze(f)}),dispose(){e.abort();for(const b of n)try{b()}catch(w){console.error("Extension observer cleanup failed",w)}n.clear()}}}function Us(s,t){return`/api/ui/extensions/${encodeURIComponent(s)}/${t.split("/").map(encodeURIComponent).join("/")}`}function Sn(s,t){var e,n;return((e=s.title.translations)==null?void 0:e[t])??((n=s.title.translations)==null?void 0:n[t.split("-")[0]])??s.title.default}const En={en:{extensions:"Extensions",choose:"Choose an extension",checking:"Checking Session methods…",session:"Select a conversation to open extensions",empty:"No extensions installed",close:"Close extension",retry:"Retry",loading:"Loading extension…",unavailable:"This extension is unavailable",syncing:"Waiting for the conversation to sync…",disconnected:"Connection lost",ended:"This conversation or line has ended",lines:"Lines",branch:"Line"},"zh-CN":{extensions:"扩展",choose:"选择扩展",checking:"正在检查会话方法…",session:"选择会话后可打开扩展",empty:"未安装扩展",close:"关闭扩展",retry:"重试",loading:"正在加载扩展…",unavailable:"此扩展不可用",syncing:"正在等待会话同步…",disconnected:"连接已断开",ended:"此会话或分支已结束",lines:"分支",branch:"当前分支"}},ur={class:"extension-header"},pr=["src"],hr=["aria-label"],mr={class:"extension-branch"},vr=["value"],fr=["value"],gr={key:0,class:"extension-status",role:"status"},br=["aria-label","hidden"],yr=_e({__name:"ExtensionPanel",props:{sessionId:{}},setup(s){const t=s,{t:e,locale:n}=ye({messages:En}),o=Ce(),i=Tt(),r=Ge(),l=Ve(),m=vs(),v=P(),_=P(),f=P(""),I=P(!1),b=P(0),w=E(()=>l.activeLineTab[t.sessionId]??"main"),k=E(()=>r.views[t.sessionId]),C=E(()=>{var Y;return(Y=i.directory)==null?void 0:Y.extensions.find(le=>{var D;return le.pluginName===((D=l.extension)==null?void 0:D.pluginName)})}),x=E(()=>{var Y;return(Y=C.value)==null?void 0:Y.panels.find(le=>{var D;return le.id===((D=l.extension)==null?void 0:D.panelId)})}),J=E(()=>{var Y;return(Y=x.value)!=null&&Y.icon&&C.value?Us(C.value.generation,x.value.icon):void 0}),X=P(),W=E(()=>x.value?Sn(x.value,n.value):e("extensions")),O=E(()=>{var Y,le;return((Y=k.value)==null?void 0:Y.status)==="closed"||((le=k.value)==null?void 0:le.lines.some(D=>D.id===w.value&&(D.state.kind.startsWith("ended")||D.state.kind==="creation-failed")))}),j=E(()=>{var Y,le;return((Y=k.value)==null?void 0:Y.status)==="ready"&&(w.value==="main"||((le=k.value.branches[w.value])==null?void 0:le.status)==="ready")}),$=E(()=>o.phase!=="connected"?e("disconnected"):O.value?e("ended"):j.value?x.value?f.value||(I.value?e("loading"):""):e("unavailable"):e("syncing")),M=E(()=>{const Y=k.value,le=w.value==="main"?Y:Y.branches[w.value];return Object.freeze({branch:Object.freeze({running:le.running,stopping:le.stopping}),sessionRunning:Y.sessionRunning})}),T=E(()=>Object.freeze({sessionId:t.sessionId,branchId:w.value,theme:m.resolvedTheme,locale:n.value}));let V;$e([()=>t.sessionId,w],([Y,le])=>{le!=="main"&&r.ensureLine(Y,le)},{immediate:!0}),$e(_,async Y=>{Y instanceof HTMLDialogElement&&!Y.open&&Y.showModal(),await He(),Y==null||Y.focus()},{flush:"post"}),$e([v,()=>{var Y;return(Y=C.value)==null?void 0:Y.generation},()=>{var Y;return(Y=x.value)==null?void 0:Y.id},()=>t.sessionId,w,j,O,()=>o.phase,b],async(Y,le,D)=>{let L=!0,K;D(()=>{L=!1,K==null||K(),V=void 0}),f.value="",I.value=!1;const me=v.value,F=x.value,ce=C.value;if(!me||!F||!ce||!j.value||O.value||o.phase!=="connected")return;const qe=t.sessionId,Ze=w.value,Je=T.value,tt=me.shadowRoot??me.attachShadow({mode:"open"});tt.replaceChildren();let ze,Ue;K=()=>{ze==null||ze.dispose();try{Ue==null||Ue()}catch(Be){console.error("Extension cleanup failed",Be)}Ue=void 0,tt.replaceChildren()},V=()=>{L=!1,K==null||K()},I.value=!0;try{const Be=F.methods.length===0?[]:await o.client.call("session.methods",{sessionId:qe},us);if(!L)return;const at=Cn(F,o.supports,Be);if(at)throw new Error(at);const ht=await import(Us(ce.generation,F.entry));if(!L)return;if(typeof ht.mount!="function")throw new Error("The extension does not export mount");if(ze=cr(F,{client:o.client,environment:Je,observeEnvironment:R=>$e(T,Z=>R(Z),{immediate:!0,flush:"sync"}),observeActivity:R=>$e(M,Z=>R(Z),{immediate:!0,flush:"sync"}),unavailable(R){f.value=R.message,K==null||K()}}),Ue=ht.mount(tt,ze.context),typeof Ue!="function")throw Ue=void 0,new Error("mount must return a cleanup function");(qe!==t.sessionId||Ze!==w.value)&&K()}catch(Be){L&&(f.value=Be instanceof Error?Be.message:String(Be),K())}finally{L&&(I.value=!1)}},{immediate:!0,flush:"post"}),$e([()=>t.sessionId,w,()=>{var Y;return(Y=C.value)==null?void 0:Y.generation},()=>{var Y;return(Y=x.value)==null?void 0:Y.id},j,O,()=>o.phase,b],()=>V==null?void 0:V(),{flush:"sync"});function se(){V==null||V(),l.closeDetail(),He(()=>{var Y;return(Y=document.querySelector("[data-extension-trigger]"))==null?void 0:Y.focus()})}function de(Y){l.activeLineTab={...l.activeLineTab,[t.sessionId]:Y.target.value}}async function ge(){await i.refresh(!0),b.value++}return it(()=>V==null?void 0:V()),(Y,le)=>(d(),ae(rs(a(l).shellMode==="compact"?"dialog":"section"),{ref_key:"surface",ref:_,class:"extension-panel","aria-label":W.value,tabindex:"-1",onCancel:Ee(se,["prevent"]),onKeydown:le[2]||(le[2]=Ee(()=>{},["stop"])),onPointerdown:le[3]||(le[3]=Ee(D=>a(l).detailFocused=!0,["stop"])),onFocusin:le[4]||(le[4]=D=>a(l).detailFocused=!0)},{default:We(()=>{var D;return[u("header",ur,[J.value&&X.value!==J.value?(d(),c("img",{key:0,src:J.value,alt:"",width:"20",height:"20",onError:le[0]||(le[0]=L=>X.value=J.value)},null,40,pr)):(d(),ae(a(fo),{key:1,size:20,"aria-hidden":"true"})),u("strong",null,h(W.value),1),u("button",{type:"button",class:"ui-button","data-variant":"ghost","data-size":"sm",onClick:le[1]||(le[1]=L=>a(l).openLines(s.sessionId))},h(a(e)("lines")),1),u("button",{type:"button",class:"ui-button","data-variant":"ghost","data-size":"sm","aria-label":a(e)("close"),onClick:se},"×",8,hr)]),u("label",mr,[be(h(a(e)("branch"))+" ",1),u("select",{value:w.value,onChange:de},[(d(!0),c(ne,null,pe((D=k.value)==null?void 0:D.lines,L=>(d(),c("option",{key:L.id,value:L.id},h(L.purpose||L.id),9,fr))),128))],40,vr)]),$.value?(d(),c("div",gr,[be(h($.value)+" ",1),f.value||!x.value?(d(),c("button",{key:0,type:"button",class:"ui-button","data-size":"sm",onClick:ge},h(a(e)("retry")),1)):z("",!0)])):z("",!0),u("div",{ref_key:"container",ref:v,class:"extension-root","aria-label":W.value,tabindex:"-1",hidden:!!$.value},null,8,br)]}),_:1},40,["aria-label"]))}}),kr=Re(yr,[["__scopeId","data-v-ddd975e8"]]),Hs={read:"tool.read",read_file:"tool.read",write:"tool.write",write_file:"tool.write",edit:"tool.edit",edit_file:"tool.edit",apply_patch:"tool.edit",grep:"tool.grep",rg:"tool.grep",glob:"tool.glob"};function wr(s){const t=s.trim().toLowerCase();return t.split(/(?:__|[./\s:-])+/).filter(Boolean).at(-1)??t}function fs(s,t){const e=s.trim().toLowerCase();if(e.startsWith("mcp__"))return{renderer:"generic",labelKey:"prompt.useTool"};const n=wr(s);if(["exec","bash","shell","run_command","exec_command"].includes(n))return{renderer:"command",labelKey:t.runInBackground===!0?"tool.runBackground":"tool.run"};if(["grep","rg","glob","find","ls","list_files"].includes(n)){const o=typeof t.pattern=="string"?t.pattern:void 0;return{renderer:"search",labelKey:n==="glob"&&(!o||o==="*")?"tool.listFiles":Hs[n]??"tool.grep"}}return["read","read_file","write","write_file","edit","edit_file","apply_patch"].includes(n)?{renderer:"file",labelKey:Hs[n]??"tool.edit"}:e.includes("web_search")||n==="websearch"?{renderer:"web",labelKey:"tool.webSearch"}:e.includes("web_fetch")||n==="webfetch"?{renderer:"web",labelKey:"tool.webFetch"}:{renderer:"generic",labelKey:"prompt.useTool"}}function Mn(s,t){if(t!==void 0)return t.split(`
|
|
226
|
+
`).filter(o=>!o.startsWith("---")&&!o.startsWith("+++")&&!o.startsWith("@@")).map(o=>{const i=o.startsWith("+")?"+":o.startsWith("-")?"-":" ";return{sign:i,text:i===" "?o.replace(/^ /,""):o.slice(1)}});const e=typeof s.oldText=="string"?s.oldText:void 0,n=typeof s.newText=="string"?s.newText:void 0;return e===void 0||n===void 0?[]:[...e.split(`
|
|
227
|
+
`).map(o=>({sign:"-",text:o})),...n.split(`
|
|
228
|
+
`).map(o=>({sign:"+",text:o}))]}const _r={class:"prompt-card","data-inline-interaction-prompt":""},Ir={class:"prompt-header"},$r={class:"prompt-icon","aria-hidden":"true"},xr={class:"prompt-title"},Cr={class:"ui-badge","data-tone":"warning"},Sr={key:0,class:"prompt-subtitle"},Er={key:1,class:"approval-panel"},Mr={class:"approval-panel-header"},Tr={class:"approval-panel-body"},qr={key:1},Ar={key:2,class:"approval-command"},Lr={key:0,class:"approval-muted"},Rr={key:3,class:"approval-panel"},Or={class:"approval-panel-header"},Pr={key:0,class:"approval-panel-body"},zr={key:1,class:"approval-panel-body"},Dr={class:"approval-line-number"},Nr={key:4,class:"approval-panel"},jr={class:"approval-panel-header"},Br={class:"approval-panel-body"},Fr={key:0},Wr={key:1},Vr={key:2},Ur={key:3,class:"approval-muted"},Hr={key:5,class:"approval-panel"},Kr={class:"approval-panel-header is-mono"},Qr={class:"approval-panel-body"},Gr={key:6,class:"approval-panel"},Jr={class:"approval-panel-body approval-muted"},Yr={key:7,class:"prompt-error",role:"alert"},Xr={class:"prompt-buttons"},Zr=["disabled"],el=["disabled"],tl=["disabled"],sl=["disabled"],nl=["disabled"],Tn=_e({__name:"ApprovalPrompt",props:{sessionId:{},request:{},keyboard:{type:Boolean},rulesAvailable:{type:Boolean}},setup(s){const t=s,{t:e}=ye(),n=Ge(),o=P(!1),i=P(""),r=E(()=>t.request.call.name==="member_approval_allow"),l=E(()=>!r.value&&gn(t.request)!==void 0),m=E(()=>!r.value&&t.rulesAvailable===!0&&fn(t.request)!==void 0),v=P(),_=P(!1),f=P(!0);async function I(){_.value=!0,i.value="";try{const se=await n.memberApproval(t.sessionId,t.request);return se.state==="ended"?(await n.respond(t.sessionId,t.request,"deny"),!1):(v.value=se.descriptor,!0)}catch(se){return v.value=void 0,f.value=!(se instanceof ct&&se.code===-32601),i.value=se instanceof Error?se.message:"Cannot review member action",!1}finally{_.value=!1}}const b=E(()=>{var se;return((se=v.value)==null?void 0:se.call)??t.request.call}),w=E(()=>b.value.input),k=E(()=>fs(b.value.name,w.value)),C={command:_o,search:ds,file:ao,web:lo,generic:Co};function x(se){const de=w.value[se];return typeof de=="string"&&de.trim()!==""?de:void 0}const J=E(()=>b.value.name.trim().toLowerCase()),X=E(()=>J.value==="edit"?Mn(w.value,void 0):[]),W=E(()=>J.value==="write"?x("content"):void 0),O=E(()=>Object.entries(w.value).filter(([se])=>!["command","cwd","path","pattern","oldText","newText","content","query","url"].includes(se)).map(([se,de])=>({key:se,value:typeof de=="string"?de:JSON.stringify(de)})));async function j(se){if(!(o.value||se==="allow"&&r.value&&(_.value||v.value===void 0))){o.value=!0,i.value="";try{if(se==="allow"&&r.value&&!await I()){o.value=!1;return}se==="always"?await n.allowAlways(t.sessionId,t.request):se==="session"?await n.allowForSession(t.sessionId,t.request):await n.respond(t.sessionId,t.request,se)}catch(de){i.value=de instanceof Error&&de.message?de.message:e("prompt.permissionSubmitFailed"),o.value=!1}}}function $(se){const de=aa(se,{keyboard:t.keyboard,pending:o.value,dialogOpen:document.querySelector("dialog[open]")!==null});de!==void 0&&(se.preventDefault(),j(de))}let M=!1;function T(){M||t.keyboard===!1||(window.addEventListener("keydown",$),M=!0)}function V(){M&&(window.removeEventListener("keydown",$),M=!1)}return ot(()=>{T(),r.value&&I()}),it(V),$e(()=>t.keyboard,()=>t.keyboard===!1?V():T()),(se,de)=>(d(),c("article",_r,[u("header",Ir,[u("span",$r,[(d(),ae(rs(C[k.value.renderer]),{size:12,"stroke-width":2.25}))]),u("h2",xr,h(a(e)("prompt.actionRequest",{action:k.value.renderer==="generic"?s.request.call.name:a(e)(k.value.labelKey)})),1),u("span",Cr,h(a(e)("prompt.awaitingApproval")),1)]),s.request.reason?(d(),c("p",Sr,h(s.request.reason),1)):z("",!0),r.value?(d(),c("div",Er,[u("div",Mr,"Subagent tool approval · Leader branch: "+h(s.request.branchId),1),v.value?(d(),c(ne,{key:0},[u("p",null,"Member: "+h(v.value.member.agentId)+" · Session: "+h(v.value.member.sessionId)+" · Branch: "+h(v.value.member.branchId),1),u("p",null,h(v.value.call.name)+": "+h(v.value.reason),1),u("pre",Tr,h(JSON.stringify(v.value.call.input,null,2)),1)],64)):(d(),c("p",qr,h(_.value?"Loading member action...":"Cannot review member action"),1))])):k.value.renderer==="command"?(d(),c("div",Ar,[u("div",null,[de[5]||(de[5]=u("span",{class:"approval-muted"},"$",-1)),be(" "+h(x("command")),1)]),x("cwd")?(d(),c("div",Lr," cwd: "+h(x("cwd")),1)):z("",!0)])):k.value.renderer==="file"?(d(),c("div",Rr,[u("div",Or,h(x("path")??s.request.call.name),1),X.value.length?(d(),c("div",Pr,[(d(!0),c(ne,null,pe(X.value,(ge,Y)=>(d(),c("div",{key:Y,class:je(ge.sign==="-"?"approval-diff-del":"approval-diff-add")},h(ge.sign)+" "+h(ge.text),3))),128))])):W.value!==void 0?(d(),c("div",zr,[(d(!0),c(ne,null,pe(W.value.split(`
|
|
229
|
+
`),(ge,Y)=>(d(),c("div",{key:Y,class:"approval-code-line"},[u("span",Dr,h(Y+1),1),be(h(ge),1)]))),128))])):z("",!0)])):k.value.renderer==="search"||k.value.renderer==="web"?(d(),c("div",Nr,[u("div",jr,h(a(e)("prompt.input")),1),u("div",Br,[x("pattern")?(d(),c("div",Fr,"pattern: "+h(x("pattern")),1)):z("",!0),x("query")?(d(),c("div",Wr,"query: "+h(x("query")),1)):z("",!0),x("url")?(d(),c("div",Vr,"url: "+h(x("url")),1)):z("",!0),x("path")?(d(),c("div",Ur,"path: "+h(x("path")),1)):z("",!0)])])):(d(),c("div",Hr,[u("div",Kr,h(s.request.call.name),1),u("pre",Qr,h(JSON.stringify(w.value,null,2)),1)])),!r.value&&k.value.renderer!=="generic"&&O.value.length?(d(),c("div",Gr,[u("div",Jr,[(d(!0),c(ne,null,pe(O.value,ge=>(d(),c("div",{key:ge.key},h(ge.key)+": "+h(ge.value),1))),128))])])):z("",!0),i.value?(d(),c("p",Yr,h(i.value),1)):z("",!0),u("div",Xr,[u("button",{type:"button",class:"ui-button","data-size":"md","data-variant":"ghost",disabled:o.value,onClick:de[0]||(de[0]=ge=>j("deny"))},h(a(e)("prompt.reject")),9,Zr),r.value&&i.value&&f.value?(d(),c("button",{key:0,type:"button",class:"ui-button",disabled:_.value,onClick:de[1]||(de[1]=ge=>I())},"Retry",8,el)):z("",!0),l.value?(d(),c("button",{key:1,type:"button",class:"ui-button","data-size":"md","data-variant":"secondary",disabled:o.value,onClick:de[2]||(de[2]=ge=>j("session"))},h(a(e)("prompt.allowSession")),9,tl)):z("",!0),m.value?(d(),c("button",{key:2,type:"button",class:"ui-button","data-size":"md","data-variant":"secondary",disabled:o.value,onClick:de[3]||(de[3]=ge=>j("always"))},h(a(e)("prompt.allowAlways")),9,sl)):z("",!0),u("button",{type:"button",class:"ui-button","data-size":"md","data-variant":"primary",disabled:o.value||r.value&&(_.value||!v.value),onClick:de[4]||(de[4]=ge=>j("allow"))},h(a(e)("prompt.allowOnce")),9,nl)])]))}}),ol=/[\s,;:!?,。!?、()[\]{}<>]/,qn=/[\p{L}\p{N}_./~\\:-]/u;function il(s,t){const e=s.slice(0,t);for(let n=e.length-1;n>=0;n--){const o=e[n];if(o==="@"){const i=n===0?void 0:e[n-1];return i!==void 0&&!ol.test(i)?void 0:{start:n,query:e.slice(n+1)}}if(!qn.test(o))return}}function al(s,t){const e=s.replace(/[[\]\\]/g,n=>`\\${n}`);return/[\s()<>]/.test(t)?`[${e}](<${t.replaceAll("<","%3C").replaceAll(">","%3E")}>)`:`[${e}](${t})`}function rl(s,t){const e=[];for(const i of t){let r=0;for(;;){const l=s.indexOf(i.label,r);if(l===-1)break;const m=l+i.label.length,v=s[m];(v===void 0||!qn.test(v))&&e.push({start:l,end:m,link:al(i.label,i.path)}),r=m}}e.sort((i,r)=>i.start-r.start||r.end-i.end);let n="",o=0;for(const i of e)i.start<o||(n+=s.slice(o,i.start)+i.link,o=i.end);return n+s.slice(o)}const Jt=vt("models",()=>{const s=P(),t=P("");let e;const n=E(()=>{const v=Ce();return v.supports("provider.list")&&v.supports("provider.catalog")});function o(){return e??(e=r().finally(()=>{e=void 0})),e}async function i(v){try{await Ce().client.call("provider.refresh",{providerId:v},mt)}finally{await e,await o()}}async function r(){const v=Ce(),_=v.client;t.value="";const I=(await Promise.allSettled([_.call("provider.list",{},Ko).then(k=>k.filter(C=>C.enabled)),v.supports("account.providers")?_.call("account.providers",{},Qo):[]])).flatMap(k=>k.status==="rejected"?(t.value=k.reason instanceof Error?k.reason.message:String(k.reason),[]):k.value),b=[...new Map(I.map(k=>[k.providerId,k])).values()],w=await Promise.allSettled(b.map(k=>_.call("provider.catalog",{providerId:k.providerId},Jo)));s.value=b.flatMap((k,C)=>{const x=w[C];if(x.status==="rejected")return t.value=x.reason instanceof Error?x.reason.message:String(x.reason),[];const J=x.value;if(J===void 0)return[];const X=new Set(J.disabledModelIds),W=J.models.filter(O=>O.unavailableReason===void 0&&!X.has(O.id));return W.length===0?[]:[{providerId:k.providerId,name:k.displayName,models:W}]})}async function l(v){if(Ce().supports("provider.selection"))return Ce().client.call("provider.selection",{cwd:v},Yo).catch(()=>{})}function m(v){var f,I;const _=(f=s.value)==null?void 0:f.find(b=>b.providerId===v.providerId);return((I=_==null?void 0:_.models.find(b=>b.id===v.modelId))==null?void 0:I.name)??v.modelId}return{providers:s,error:t,available:n,load:o,refresh:i,defaultFor:l,nameOf:m}}),ll={key:0,class:"ui-button model-trigger","data-variant":"ghost","data-size":"sm","aria-disabled":"true"},dl={class:"model-trigger-label"},cl={class:"ui-button model-trigger","data-variant":"ghost","data-size":"sm"},ul={key:0,class:"provider-badge","aria-hidden":"true"},pl={class:"model-trigger-label"},hl={class:"composer-popover-content is-end ui-popover model-content","data-width":"xl"},ml={class:"ui-menu-search model-search"},vl=["placeholder","aria-label"],fl={key:0,class:"menu-empty"},gl={key:1,class:"menu-empty"},bl={key:2,class:"model-panes"},yl={key:0,class:"provider-pane"},kl=["aria-current","onClick"],wl={class:"provider-badge","aria-hidden":"true"},_l=["aria-label"],Il={key:0,class:"menu-empty"},$l=["aria-selected","data-highlighted","title","onMouseenter","onClick"],xl={class:"model-check"},Cl={key:0,class:"provider-badge","aria-hidden":"true"},Sl={class:"model-name"},El=_e({__name:"ComposerModelMenu",props:{model:{},selectable:{type:Boolean},disabled:{type:Boolean}},emits:["select"],setup(s,{expose:t,emit:e}){const n=s,o=e,{t:i}=ye(),r=Jt(),l=P(),m=P(),v=P(""),_=P(),f=P(0),I=E(()=>r.providers??[]),b=E(()=>{var $,M,T;return(($=I.value.find(V=>V.providerId===_.value))==null?void 0:$.providerId)??((M=I.value.find(V=>{var se;return V.providerId===((se=n.model)==null?void 0:se.providerId)}))==null?void 0:M.providerId)??((T=I.value[0])==null?void 0:T.providerId)}),w=E(()=>I.value.flatMap($=>$.models.map(M=>({providerId:$.providerId,providerName:$.name,modelId:M.id,name:M.name})))),k=E(()=>v.value.trim()!==""),C=E(()=>{if(!k.value)return w.value.filter(M=>M.providerId===b.value);const $=v.value.trim().toLocaleLowerCase();return w.value.filter(M=>[M.name,M.modelId,M.providerName].some(T=>T.toLocaleLowerCase().includes($)))}),x=E(()=>n.model===void 0?i("composer.notConfigured"):r.nameOf(n.model));ot(()=>{n.selectable&&r.available&&r.providers===void 0&&r.load()});function J($){var M;return $.providerId===((M=n.model)==null?void 0:M.providerId)&&$.modelId===n.model.modelId}function X($){return $.trim().charAt(0).toLocaleUpperCase()}async function W(){var $,M,T,V;(($=l.value)==null?void 0:$.open)===!0&&(r.providers===void 0&&await r.load(),v.value="",_.value=((M=n.model)==null?void 0:M.providerId)??((T=I.value[0])==null?void 0:T.providerId),f.value=Math.max(0,C.value.findIndex(J)),await He(),matchMedia("(pointer: coarse)").matches||(V=m.value)==null||V.focus())}function O($){l.value&&(l.value.open=!1),J($)||o("select",{providerId:$.providerId,modelId:$.modelId})}function j($){var M,T;if(!($.isComposing||$.keyCode===229)){if($.key==="Escape"){$.preventDefault(),l.value&&(l.value.open=!1),(T=(M=l.value)==null?void 0:M.querySelector("summary"))==null||T.focus();return}if($.key==="ArrowDown")$.preventDefault(),f.value=Math.min(C.value.length-1,f.value+1);else if($.key==="ArrowUp")$.preventDefault(),f.value=Math.max(0,f.value-1);else if($.key==="Enter"){$.preventDefault();const V=C.value[f.value];V!==void 0&&O(V)}}}return t({open:()=>{n.selectable&&r.available&&!n.disabled&&l.value&&(l.value.open=!0)}}),($,M)=>{const T=ft("tooltip");return!s.selectable||!a(r).available?(d(),c("span",ll,[u("span",dl,h(x.value),1)])):(d(),c("details",{key:1,ref_key:"details",ref:l,class:je(["composer-popover model-menu",{"is-disabled":s.disabled}]),onToggle:W},[Ne((d(),c("summary",cl,[s.model?(d(),c("span",ul,h(X(s.model.providerId)),1)):z("",!0),u("span",pl,h(x.value),1)])),[[T,s.model?`${x.value} · ${s.model.providerId}`:void 0]]),u("div",hl,[u("label",ml,[G(a(ds),{"aria-hidden":"true"}),Ne(u("input",{ref_key:"searchInput",ref:m,"onUpdate:modelValue":M[0]||(M[0]=V=>v.value=V),type:"text",placeholder:a(i)("composer.searchModels"),"aria-label":a(i)("composer.searchModels"),onKeydown:j,onInput:M[1]||(M[1]=V=>f.value=0)},null,40,vl),[[At,v.value]])]),a(r).providers===void 0&&!a(r).error?(d(),c("p",fl,[G(a(Ht),{class:"is-spinning","aria-hidden":"true"}),be(h(a(i)("composer.modelLoading")),1)])):a(r).error?(d(),c("p",gl,[u("button",{type:"button",class:"ui-button","data-variant":"danger-ghost","data-size":"sm",onClick:M[2]||(M[2]=V=>a(r).load())},h(a(i)("composer.modelLoadRetry")),1)])):z("",!0),a(r).providers!==void 0&&(!a(r).error||I.value.length>0)?(d(),c("div",bl,[k.value?z("",!0):(d(),c("div",yl,[(d(!0),c(ne,null,pe(I.value,V=>(d(),c("button",{key:V.providerId,type:"button",class:"ui-menu-item","aria-current":b.value===V.providerId,onClick:se=>{_.value=V.providerId,f.value=0}},[u("span",wl,h(X(V.name)),1),u("span",null,h(V.name),1)],8,kl))),128))])),u("div",{class:"model-pane",role:"listbox","aria-label":a(i)("composer.searchModels")},[C.value.length===0?(d(),c("p",Il,h(a(i)("composer.noModels")),1)):z("",!0),(d(!0),c(ne,null,pe(C.value,(V,se)=>(d(),c("button",{key:`${V.providerId}:${V.modelId}`,type:"button",role:"option",class:"ui-menu-item","aria-selected":J(V),"data-highlighted":se===f.value?"":void 0,title:`${V.name} · ${V.providerName}`,onMouseenter:de=>f.value=se,onClick:de=>O(V)},[u("span",xl,[J(V)?(d(),ae(a($t),{key:0,"aria-hidden":"true"})):z("",!0)]),k.value?(d(),c("span",Cl,h(X(V.providerName)),1)):z("",!0),u("span",Sl,h(V.name),1)],40,$l))),128))],8,_l)])):z("",!0)])],34))}}}),Ml=Re(El,[["__scopeId","data-v-65d27c07"]]),Tl=["aria-labelledby"],ql={class:"ui-dialog-header"},Al={class:"ui-dialog-icon","data-tone":"warning"},Ll=["id"],Rl={class:"ui-dialog-footer"},An=_e({__name:"ConfirmDialog",setup(s,{expose:t}){const{t:e}=ye({messages:cs}),n=ns(),o=P(),i=P(""),r=P("");let l;function m(_,f={}){return l==null||l(!1),i.value=_,r.value=f.confirmLabel??e("confirm"),new Promise(I=>{var b;l=I,(b=o.value)==null||b.showModal()})}function v(_){var I;const f=l;l=void 0,(I=o.value)==null||I.close(),f==null||f(_)}return it(()=>l==null?void 0:l(!1)),t({open:m}),(_,f)=>(d(),c("dialog",{ref_key:"dialog",ref:o,class:"ui-dialog","data-size":"md","aria-labelledby":a(n),onCancel:f[2]||(f[2]=Ee(I=>v(!1),["prevent"])),onClose:f[3]||(f[3]=I=>v(!1))},[u("header",ql,[u("span",Al,[G(a(Io),{"aria-hidden":"true"})]),u("h2",{id:a(n),class:"ui-dialog-title"},h(i.value),9,Ll)]),u("footer",Rl,[u("button",{class:"ui-button","data-variant":"secondary",type:"button",autofocus:"",onClick:f[0]||(f[0]=I=>v(!1))},h(a(e)("cancel")),1),u("button",{class:"ui-button","data-variant":"danger",type:"button",onClick:f[1]||(f[1]=I=>v(!0))},h(r.value),1)])],40,Tl))}}),Ol=["aria-label"],Pl={class:"permission-trigger-label"},zl={class:"composer-popover-content ui-popover permission-content","data-width":"lg"},Dl=["disabled"],Nl=["aria-pressed","onClick"],jl={class:"permission-option-text"},Bl={key:0,class:"permission-note"},Fl={key:1,class:"permission-note"},Wl={class:"permission-note"},Vl=_e({__name:"ComposerPermissionMenu",props:{policy:{}},emits:["select"],setup(s,{expose:t,emit:e}){const n=s,o=e,{t:i}=ye(),r=P(),l=P(),m=["read-only","workspace-write","full-access"];async function v(f){var I;n.policy===void 0||f===n.policy.preset||f==="full-access"&&!await((I=l.value)==null?void 0:I.open(i("composer.permission.fullAccessConfirm")))||o("select",f)}function _(){r.value&&(r.value.open=!0)}return t({open:_}),(f,I)=>{var b,w;return d(),c("details",{ref_key:"details",ref:r,class:"composer-popover permission-menu"},[u("summary",{class:"ui-button permission-trigger","data-variant":"ghost","data-size":"sm","aria-label":a(i)("composer.permission.label")},[G(a(ko),{size:14,"aria-hidden":"true"}),u("span",Pl,h(s.policy?a(i)(`composer.permission.preset.${s.policy.preset}`):a(i)("composer.permission.label")),1)],8,Ol),u("div",zl,[u("fieldset",{class:"permission-group",disabled:!s.policy},[u("legend",null,h(a(i)("composer.permission.label")),1),(d(),c(ne,null,pe(m,k=>{var C,x;return u("button",{key:k,type:"button",class:"ui-menu-item permission-option","aria-pressed":k===((C=s.policy)==null?void 0:C.preset),onClick:J=>v(k)},[u("span",jl,[u("span",null,h(a(i)(`composer.permission.preset.${k}`)),1),u("small",null,h(a(i)(`composer.permission.description.${k}`)),1)]),k===((x=s.policy)==null?void 0:x.preset)?(d(),ae(a($t),{key:0,size:14,"aria-hidden":"true"})):z("",!0)],8,Nl)}),64))],8,Dl),(b=s.policy)!=null&&b.allowedTools.length?(d(),c("p",Bl,h(a(i)("composer.permission.allowedTools"))+": "+h(s.policy.allowedTools.join(", ")),1)):z("",!0),(w=s.policy)!=null&&w.disallowedTools.length?(d(),c("p",Fl,h(a(i)("composer.permission.disallowedTools"))+": "+h(s.policy.disallowedTools.join(", ")),1)):z("",!0),u("p",Wl,h(a(i)("composer.permission.isolation")),1),G(a(ut),{class:"ui-menu-item",to:{name:"settings-permissions"}},{default:We(()=>[be(h(a(i)("composer.permission.processIsolation")),1)]),_:1})]),G(An,{ref_key:"confirm",ref:l},null,512)],512)}}}),Ul=Re(Vl,[["__scopeId","data-v-f15bf42f"]]);function Hl(s,t){let e=t.replaceAll(`\r
|
|
230
|
+
`,`
|
|
231
|
+
`);if(e.endsWith(`
|
|
232
|
+
`)&&(e=e.slice(0,-1)),e==="")return s;const n=e.split(`
|
|
233
|
+
`).map(i=>i===""?`>
|
|
234
|
+
`:`> ${i}
|
|
235
|
+
`).join(""),o=s===""||s.endsWith(`
|
|
236
|
+
|
|
237
|
+
`)?"":s.endsWith(`
|
|
238
|
+
`)?`
|
|
239
|
+
`:`
|
|
240
|
+
|
|
241
|
+
`;return`${s}${o}${n}
|
|
242
|
+
`}const Kl=["data-variant","aria-label"],Ql={key:0,class:"inline-error",role:"alert"},Gl={key:0,class:"draft-attachments"},Jl=["src","alt"],Yl=["aria-label","onClick"],Xl=["aria-label","onClick"],Zl=["id","aria-label"],ed=["id","aria-selected","data-highlighted","onMouseenter","onClick"],td={class:"command-category"},sd={class:"command-name"},nd={key:0,class:"command-argument"},od={key:1,class:"command-argument"},id={class:"command-description"},ad={class:"command-keys"},rd=["id","aria-label"],ld=["aria-selected","data-highlighted","onMouseenter","onClick"],dd={class:"command-name"},cd={class:"command-keys"},ud=["placeholder","aria-label","aria-controls","aria-expanded","aria-activedescendant"],pd={class:"composer-toolbar"},hd={class:"composer-tool-group"},md={class:"composer-run-group"},vd=["data-variant","aria-label","disabled"],fd={key:1,class:"composer-statusbar"},gd={class:"composer-status-start"},bd=16*1024,yd=10*1024*1024,kd=20,wd=_e({__name:"ComposerPanel",props:{running:{type:Boolean},stopping:{type:Boolean},model:{},modelSelectable:{type:Boolean},send:{},attachments:{type:Boolean,default:!0},storesPastes:{type:Boolean},searchFiles:{},permission:{},stop:{},selectModel:{},variant:{},placeholder:{},createBranch:{},openLines:{},sessionCommands:{}},setup(s,{expose:t}){const e=s,{t:n}=ye(),o=Vt(),i=Ut(),r=Jt(),l=Ke(),m=Ce(),v=P(),_=P(),f=P(),I=ns(),b=P(""),w=P(!1),k=P(!1),C=P(""),x=P(!1),J=P(!1),X=P(!1),W=P([]),O=P(),j=P(),$=P([]),M=P(0);let T=0,V;const se=E(()=>O.value===void 0?void 0:`${O.value.start}:${O.value.query}`),de=E(()=>J.value&&e.searchFiles!==void 0&&O.value!==void 0&&se.value!==j.value),ge=E(()=>de.value&&$.value.length>0),Y=ns(),le=P(0),D=P([]),L=P([]);let K=0;const me=E(()=>{var A,Q,Ie,te,he;return[{category:"model",name:"models",available:e.modelSelectable&&r.available&&!k.value},{category:"session",name:"branch",available:e.createBranch!==void 0},{category:"session",name:"compact",available:((A=e.sessionCommands)==null?void 0:A.compact)!==void 0},{category:"session",name:"usage",available:((Q=e.sessionCommands)==null?void 0:Q.usage)!==void 0},{category:"session",name:"fork",available:((Ie=e.sessionCommands)==null?void 0:Ie.fork)!==void 0},{category:"session",name:"goal",available:((te=e.sessionCommands)==null?void 0:te.goal)!==void 0},{category:"model",name:"effort",available:((he=e.sessionCommands)==null?void 0:he.effort)!==void 0},{category:"model",name:"permissions",available:e.permission!==void 0&&e.variant!=="panel"},{category:"session",name:"lines",available:e.openLines!==void 0},{category:"session",name:"new",available:!0},{category:"session",name:"scheduled",available:m.supports("schedule.list")}].filter(De=>De.available)}),F=E(()=>/^\/[a-z]*$/i.test(b.value)?b.value.slice(1).toLowerCase():void 0),ce=E(()=>{const A=F.value;return A===void 0?[]:me.value.filter(Q=>Q.name.startsWith(A))}),qe=E(()=>!x.value&&!X.value&&ce.value.length>0),Ze=E(()=>J.value&&qe.value);$e(b,()=>{b.value.startsWith("/")||(X.value=!1)},{flush:"sync"}),$e(ce,()=>{le.value=0},{flush:"sync"});const Je=E(()=>e.running&&e.stop!==void 0&&b.value.trim()===""&&D.value.length===0&&L.value.length===0),tt=E(()=>(b.value.trim()!==""||D.value.length>0||L.value.length>0)&&!w.value);function ze(){const A=v.value;A!==void 0&&(A.style.height="auto",A.style.height=`${Math.min(A.scrollHeight,300)}px`)}function Ue(A){return new Promise((Q,Ie)=>{const te=new FileReader;te.onload=()=>{const he=String(te.result);Q({url:he,block:{type:"image",source:{type:"base64",mediaType:A.type,data:he.slice(he.indexOf(",")+1)}}})},te.onerror=()=>Ie(te.error??new Error(n("composer.imageReadFailed"))),te.readAsDataURL(A)})}async function Be(A){for(const Q of A)try{const Ie=await Ue(Q);if(D.value.length>=kd){C.value=n("composer.imageLimit");return}D.value=[...D.value,{id:++K,...Ie}]}catch{C.value=n("composer.imageReadFailed")}}function at(A){if(new TextEncoder().encode(A).length>yd){C.value=n("composer.pasteTooLarge");return}L.value=[...L.value,{id:++K,text:A}]}function ht(A){var te,he;if(!e.attachments)return;const Q=[...((te=A.clipboardData)==null?void 0:te.files)??[]].filter(De=>De.type.startsWith("image/"));if(Q.length>0){A.preventDefault(),Be(Q);return}const Ie=((he=A.clipboardData)==null?void 0:he.getData("text/plain"))??"";e.storesPastes&&new TextEncoder().encode(Ie).length>bd&&(A.preventDefault(),at(Ie))}function R(A){var te;if(A.preventDefault(),!e.attachments)return;const Q=[...((te=A.dataTransfer)==null?void 0:te.files)??[]],Ie=Q.filter(he=>he.type.startsWith("image/"));Ie.length<Q.length&&(C.value=n("composer.onlyImages")),Be(Ie)}function Z(A){D.value=D.value.filter(Q=>Q.id!==A)}function p(A){L.value=L.value.filter(Q=>Q.id!==A)}function g(){const A=v.value;O.value=A===void 0||e.searchFiles===void 0?void 0:il(A.value,A.selectionStart)}$e(()=>{var A;return(A=O.value)==null?void 0:A.query},A=>{clearTimeout(V),M.value=0;const Q=e.searchFiles;if(A===void 0||Q===void 0){$.value=[];return}const Ie=++T;V=setTimeout(()=>{Q(A).then(te=>{Ie===T&&($.value=te)},te=>{Ie===T&&($.value=[],C.value=te instanceof Error?te.message:String(te))})},80)});function y(A){const Q=v.value,Ie=O.value;if(Q===void 0||Ie===void 0)return;const te=Q.selectionStart,he=`@${A.relativePath}${A.dir?"/":""}`,De=A.dir?"":" ";b.value=`${b.value.slice(0,Ie.start)}${he}${De}${b.value.slice(te)}`,A.dir||(W.value=[...W.value,{label:`@${A.relativePath}`,path:A.absolutePath}]);const st=Ie.start+he.length+De.length;He(()=>{Q.setSelectionRange(st,st),ze(),g()})}async function q(){var st,Ct,bt,St,Ye;if(!tt.value||x.value)return;if(qe.value){const rt=ce.value[le.value];rt!==void 0&&await U(rt.name);return}const A=b.value;if(!X.value&&m.supports("schedule.list")&&/^\/schedule(?:d)?\s*$/i.test(A)){await U("scheduled");return}const Q=!X.value&&/^\/branch(?:\s+([\s\S]*))?$/i.exec(A);if(Q&&!((st=Q[1])!=null&&st.trim())){await U("branch");return}const Ie=(Ct=e.sessionCommands)==null?void 0:Ct.goal,te=!X.value&&Ie!==void 0?/^\/goal(?:\s+([\s\S]*))?$/i.exec(A):null;if(Ie&&te){b.value="",await He(),ze(),await Ie(((bt=te[1])==null?void 0:bt.trim())??"");return}const he=(St=e.sessionCommands)==null?void 0:St.effort,De=!X.value&&he!==void 0?/^\/effort(?:\s+([\s\S]*))?$/i.exec(A):null;if(he&&De){b.value="",await He(),ze(),await he(((Ye=De[1])==null?void 0:Ye.trim())??"");return}w.value=!0,C.value="";try{if(Q){if(!e.createBranch)throw new Error(n("composer.branchUnavailable"));await e.createBranch(Q[1].trim())}else{const rt=W.value,ws=D.value,_s=L.value;await e.send(rl(A,rt),{images:ws.map(lt=>lt.block),pastes:_s.map(lt=>lt.text)}),W.value=W.value.filter(lt=>!rt.includes(lt)),D.value=D.value.filter(lt=>!ws.includes(lt)),L.value=L.value.filter(lt=>!_s.includes(lt))}b.value===A&&(b.value=""),await He(),ze()}catch(rt){C.value=rt instanceof Error?rt.message:String(rt)}finally{w.value=!1}}async function B(){var A;C.value="";try{await((A=e.stop)==null?void 0:A.call(e))}catch(Q){C.value=Q instanceof Error?Q.message:String(Q)}}async function ee(A){k.value=!0,C.value="";try{await e.selectModel(A)}catch(Q){C.value=Q instanceof Error?Q.message:String(Q)}finally{k.value=!1}}async function U(A){var Ie,te,he,De,st,Ct,bt,St;if(x.value)return;C.value="";const Q=A==="branch"||A==="goal"||A==="effort";if(b.value=Q?`/${A} `:"",await He(),ze(),Q)(Ie=v.value)==null||Ie.focus();else if(A==="models")(te=_.value)==null||te.open();else if(A==="lines")(he=e.openLines)==null||he.call(e);else if(A==="scheduled"){const Ye=typeof o.params.sessionId=="string"?(De=l.byId.get(o.params.sessionId))==null?void 0:De.cwd:void 0;await i.push({name:"settings-scheduled",...Ye===void 0?{}:{query:{cwd:Ye}}})}else if(A==="new")try{const Ye=typeof o.params.sessionId=="string"?(st=l.byId.get(o.params.sessionId))==null?void 0:st.cwd:void 0;await i.push({name:"chat-new",...Ye===void 0?{}:{query:{cwd:Ye}}})}catch(Ye){C.value=Ye instanceof Error?Ye.message:String(Ye)}else A==="permissions"?(Ct=f.value)==null||Ct.open():(A==="compact"||A==="usage"||A==="fork")&&await((St=(bt=e.sessionCommands)==null?void 0:bt[A])==null?void 0:St.call(bt))}function ie(A){if(!(A.isComposing||x.value||A.keyCode===229)){if(de.value&&$.value.length>0){if(A.key==="ArrowDown"||A.key==="ArrowUp"){A.preventDefault(),M.value=(M.value+(A.key==="ArrowDown"?1:-1)+$.value.length)%$.value.length;return}if(A.key==="Enter"&&!A.shiftKey&&!A.altKey||A.key==="Tab"){A.preventDefault(),y($.value[M.value]);return}}if(de.value&&A.key==="Escape"){A.preventDefault(),A.stopPropagation(),j.value=se.value;return}if(A.key==="Escape"&&b.value.startsWith("/")&&!X.value){A.preventDefault(),A.stopPropagation(),X.value=!0;return}if(Ze.value&&(A.key==="ArrowDown"||A.key==="ArrowUp")){A.preventDefault(),le.value=(le.value+(A.key==="ArrowDown"?1:-1)+ce.value.length)%ce.value.length;return}A.key==="Enter"&&!A.shiftKey&&!A.altKey&&(A.preventDefault(),q())}}async function Me(A){b.value=Hl(b.value,A),await He(),ze();const Q=v.value;Q==null||Q.focus(),Q==null||Q.setSelectionRange(b.value.length,b.value.length)}return ot(()=>{var A;return(A=v.value)==null?void 0:A.focus()}),t({focus:()=>{var A;return(A=v.value)==null?void 0:A.focus()},quote:Me}),(A,Q)=>{const Ie=ft("tooltip");return d(),c("section",{class:"composer-panel","data-variant":s.variant??"main","aria-label":a(n)("chat.composer")},[C.value?(d(),c("p",Ql,h(C.value),1)):z("",!0),u("div",{class:"composer-surface",onClick:Q[9]||(Q[9]=Ee(te=>{var he;return(he=v.value)==null?void 0:he.focus()},["self"])),onDragover:Q[10]||(Q[10]=Ee(()=>{},["prevent"])),onDrop:R},[D.value.length>0||L.value.length>0?(d(),c("div",Gl,[(d(!0),c(ne,null,pe(D.value,te=>(d(),c("span",{key:te.id,class:"draft-chip"},[u("img",{src:te.url,alt:a(n)("composer.imageAttachment"),class:"draft-thumb"},null,8,Jl),u("button",{type:"button",class:"ui-icon-button","data-variant":"ghost","data-size":"xs","aria-label":a(n)("composer.removeAttachment"),onClick:he=>Z(te.id)},[G(a(yt),{"aria-hidden":"true"})],8,Yl)]))),128)),(d(!0),c(ne,null,pe(L.value,te=>(d(),c("span",{key:te.id,class:"draft-chip"},[u("span",null,h(a(n)("composer.pastedText",{lines:te.text.split(`
|
|
243
|
+
`).length})),1),u("button",{type:"button",class:"ui-icon-button","data-variant":"ghost","data-size":"xs","aria-label":a(n)("composer.removeAttachment"),onClick:he=>p(te.id)},[G(a(yt),{"aria-hidden":"true"})],8,Xl)]))),128))])):z("",!0),Ze.value?(d(),c("div",{key:1,id:a(I),class:"command-menu ui-popover",role:"listbox","aria-label":a(n)("composer.commands")},[(d(!0),c(ne,null,pe(ce.value,(te,he)=>{var De;return d(),c("button",{id:`${a(I)}-${he}`,key:te.name,type:"button",role:"option",class:"ui-menu-item command-item","aria-selected":he===le.value,"data-highlighted":he===le.value?"":void 0,onMousedown:Q[0]||(Q[0]=Ee(()=>{},["prevent"])),onMouseenter:st=>le.value=he,onClick:Ee(st=>U(te.name),["stop"])},[u("span",td,h(he===0||((De=ce.value[he-1])==null?void 0:De.category)!==te.category?a(n)(`composer.category.${te.category}`):""),1),u("span",sd,[be("/"+h(te.name),1),te.name==="branch"?(d(),c("span",nd," <prompt>")):te.name==="goal"||te.name==="effort"?(d(),c("span",od," [args]")):z("",!0)]),u("span",id,h(a(n)(`composer.command.${te.name}`)),1)],40,ed)}),128)),u("p",ad,h(a(n)("composer.commandKeys")),1)],8,Zl)):z("",!0),ge.value?(d(),c("div",{key:2,id:a(Y),class:"command-menu ui-popover",role:"listbox","aria-label":a(n)("composer.files")},[(d(!0),c(ne,null,pe($.value,(te,he)=>(d(),c("button",{key:te.absolutePath,type:"button",role:"option",class:"ui-menu-item command-item","aria-selected":he===M.value,"data-highlighted":he===M.value?"":void 0,onMousedown:Q[1]||(Q[1]=Ee(()=>{},["prevent"])),onMouseenter:De=>M.value=he,onClick:Ee(De=>y(te),["stop"])},[u("span",dd,[be(h(te.relativePath),1),te.dir?(d(),c(ne,{key:0},[be("/")],64)):z("",!0)])],40,ld))),128)),u("p",cd,h(a(n)("composer.mentionKeys")),1)],8,rd)):z("",!0),Ne(u("textarea",{ref_key:"field",ref:v,"onUpdate:modelValue":Q[2]||(Q[2]=te=>b.value=te),class:"composer-input",rows:"2",placeholder:s.placeholder??a(n)("composer.sendMessage"),"aria-label":s.placeholder??a(n)("composer.sendMessage"),"aria-controls":Ze.value?a(I):ge.value?a(Y):void 0,"aria-expanded":Ze.value||ge.value,"aria-activedescendant":Ze.value?`${a(I)}-${le.value}`:void 0,onInput:Q[3]||(Q[3]=te=>{ze(),g()}),onKeydown:ie,onKeyup:g,onClick:g,onPaste:ht,onFocus:Q[4]||(Q[4]=te=>J.value=!0),onBlur:Q[5]||(Q[5]=te=>J.value=!1),onCompositionstart:Q[6]||(Q[6]=te=>x.value=!0),onCompositionend:Q[7]||(Q[7]=te=>x.value=!1)},null,40,ud),[[At,b.value]]),u("footer",pd,[u("div",hd,[s.permission&&s.variant!=="panel"?(d(),ae(Ul,{key:0,ref_key:"permissionMenu",ref:f,policy:s.permission.policy,onSelect:s.permission.select},null,8,["policy","onSelect"])):z("",!0)]),u("div",md,[s.variant!=="panel"?(d(),ae(Ml,{key:0,ref_key:"modelMenu",ref:_,model:s.model,selectable:s.modelSelectable,disabled:k.value,onSelect:ee},null,8,["model","selectable","disabled"])):z("",!0),Ne((d(),c("button",{class:"ui-icon-button","data-variant":Je.value?"contrast":"primary","data-size":"sm",type:"button","aria-label":Je.value?a(n)("composer.stopResponse"):a(n)("composer.send"),disabled:Je.value?s.stopping:!tt.value,onClick:Q[8]||(Q[8]=Ee(te=>Je.value?B():q(),["stop"]))},[Je.value?(d(),ae(a(wo),{key:0,fill:"currentColor","aria-hidden":"true"})):(d(),ae(a(no),{key:1,"stroke-width":2.25,"aria-hidden":"true"}))],8,vd)),[[Ie,Je.value?a(n)("composer.stopResponse"):a(n)("composer.send")]])])])],32),A.$slots.status?(d(),c("div",fd,[u("div",gd,[Vn(A.$slots,"status",{},void 0,!0)])])):z("",!0)],8,Kl)}}}),gs=Re(wd,[["__scopeId","data-v-3d5c7eee"]]),_d={class:"prompt-card question-card","data-inline-interaction-prompt":""},Id={class:"prompt-header"},$d={class:"prompt-icon","aria-hidden":"true"},xd={class:"prompt-title"},Cd={class:"ui-badge","data-tone":"warning"},Sd=["aria-label"],Ed=["aria-current","disabled","onClick"],Md={key:0,"aria-hidden":"true"},Td=["aria-current","disabled"],qd=["aria-label"],Ad=["disabled"],Ld={key:0,class:"question-header"},Rd={key:1,class:"question-hint"},Od=["type","name","checked","onChange"],Pd={class:"question-option-text"},zd={key:0,class:"question-option-description"},Dd=["value","placeholder","aria-label"],Nd={key:1,class:"question-review"},jd=["disabled","aria-label","onClick"],Bd={key:0,class:"prompt-error",role:"alert"},Fd={class:"prompt-buttons"},Wd=["disabled"],Vd=["disabled"],Ud=["disabled"],Hd=["disabled"],Kd=_e({__name:"QuestionPrompt",props:{sessionId:{},question:{}},setup(s){const t=s,{t:e}=ye(),n=Ge(),o=P(!1),i=P(!1),r=P(""),l=$s({}),m=$s({}),v=P(0),_=P(),f=E(()=>t.question.questions[v.value]),I=E(()=>t.question.questions.length>1),b=$=>`question-${t.question.callId}-${$.id}`;function w($){const M=(m[$.id]??"").trim();return $.allowCustom&&M!==""?M:void 0}function k($){var M;return(((M=l[$.id])==null?void 0:M.length)??0)>0||w($)!==void 0}const C=E(()=>t.question.questions.every(k));async function x($){var M,T;v.value=$,await He(),(M=_.value)==null||M.scrollTo({top:0}),(T=_.value)==null||T.focus()}function J(){o.value||i.value||(f.value&&I.value?k(f.value)&&x(v.value+1):j(!1))}function X($,M){const T=l[$.id]??[];$.multiSelect?l[$.id]=T.includes(M)?T.filter(V=>V!==M):[...T,M]:(l[$.id]=[M],m[$.id]="")}function W($,M){m[$.id]=M,!$.multiSelect&&M.trim()!==""&&(l[$.id]=[])}function O(){return t.question.questions.map($=>{const M=w($);return{questionId:$.id,selected:l[$.id]??[],...M===void 0?{}:{custom:M}}})}async function j($){if(!(o.value||i.value||!$&&!C.value)){o.value=!0,r.value="";try{await n.answerQuestion(t.sessionId,t.question,$?void 0:O()),i.value=!0}catch(M){r.value=M instanceof ct&&M.appError==="question_not_pending"?e("question.notPending"):M instanceof Error&&M.message?M.message:e("question.failed")}finally{o.value=!1}}}return($,M)=>(d(),c("article",_d,[u("header",Id,[u("span",$d,[G(a(oo),{size:12,"stroke-width":2.25})]),u("h2",xd,h(a(e)("question.title")),1),u("span",Cd,h(i.value?a(e)("question.sent"):a(e)("question.awaitingAnswer")),1)]),I.value?(d(),c("nav",{key:0,class:"question-steps","aria-label":a(e)("question.steps")},[(d(!0),c(ne,null,pe(t.question.questions,(T,V)=>(d(),c("button",{key:T.id,type:"button",class:"ui-button","data-size":"sm","data-variant":"ghost","aria-current":v.value===V?"step":void 0,disabled:o.value||i.value,onClick:se=>x(V)},[be(h(V+1)+". "+h(T.header||a(e)("question.number",{number:V+1})),1),k(T)?(d(),c("span",Md," ✓")):z("",!0)],8,Ed))),128)),u("button",{type:"button",class:"ui-button","data-size":"sm","data-variant":"ghost","aria-current":f.value?void 0:"step",disabled:o.value||i.value,onClick:M[0]||(M[0]=T=>x(t.question.questions.length))},h(a(e)("question.review")),9,Td)],8,Sd)):z("",!0),u("form",{class:"question-form",onSubmit:Ee(J,["prevent"])},[u("div",{ref_key:"body",ref:_,class:"question-body",tabindex:"-1","aria-label":f.value?f.value.question:a(e)("question.review")},[f.value?(d(),c("fieldset",{key:f.value.id,class:"question-item",disabled:o.value||i.value},[u("legend",null,[f.value.header?(d(),c("span",Ld,h(f.value.header),1)):z("",!0),be(" "+h(f.value.question)+" ",1),f.value.multiSelect?(d(),c("small",Rd,h(a(e)("question.selectMany")),1)):z("",!0)]),(d(!0),c(ne,null,pe(f.value.options,T=>(d(),c("label",{key:T.label,class:"question-option"},[u("input",{type:f.value.multiSelect?"checkbox":"radio",name:b(f.value),checked:(l[f.value.id]??[]).includes(T.label),onChange:V=>X(f.value,T.label)},null,40,Od),u("span",Pd,[u("span",null,h(T.label),1),T.description?(d(),c("small",zd,h(T.description),1)):z("",!0)])]))),128)),f.value.allowCustom?(d(),c("input",{key:0,class:"ui-field question-other","data-size":"md",type:"text",value:m[f.value.id]??"",placeholder:a(e)("question.otherPlaceholder"),"aria-label":a(e)("question.other"),onInput:M[1]||(M[1]=T=>W(f.value,T.target.value))},null,40,Dd)):z("",!0)],8,Ad)):(d(),c("ol",Nd,[(d(!0),c(ne,null,pe(t.question.questions,(T,V)=>(d(),c("li",{key:T.id},[u("strong",null,h(T.question),1),u("p",null,h([...l[T.id]??[],...w(T)?[w(T)]:[]].join(", ")||a(e)("question.unanswered")),1),u("button",{type:"button",class:"ui-button","data-size":"sm","data-variant":"ghost",disabled:o.value||i.value,"aria-label":a(e)("question.editAnswer",{question:T.question}),onClick:se=>x(V)},h(a(e)("question.edit")),9,jd)]))),128))]))],8,qd),r.value?(d(),c("p",Bd,h(r.value),1)):z("",!0),u("div",Fd,[u("button",{type:"button",class:"ui-button question-decline","data-size":"md","data-variant":"ghost",disabled:o.value||i.value,onClick:M[2]||(M[2]=T=>j(!0))},h(a(e)("question.decline")),9,Wd),I.value&&v.value>0?(d(),c("button",{key:0,type:"button",class:"ui-button","data-size":"md","data-variant":"secondary",disabled:o.value||i.value,onClick:M[3]||(M[3]=T=>x(v.value-1))},h(a(e)("question.previous")),9,Vd)):z("",!0),I.value&&f.value?(d(),c("button",{key:1,type:"submit",class:"ui-button","data-size":"md","data-variant":"primary",disabled:o.value||i.value||!k(f.value)},h(v.value===t.question.questions.length-1?a(e)("question.review"):a(e)("question.next")),9,Ud)):(d(),c("button",{key:2,type:"submit",class:"ui-button","data-size":"md","data-variant":"primary",disabled:o.value||i.value||!C.value},h(a(e)("question.submit")),9,Hd))])],32)]))}}),Ln=Re(Kd,[["__scopeId","data-v-d6970f39"]]);function wt(s,t,e){let n=e.initialDeps??[],o,i=!0;function r(){var l,m,v;let _;e.key&&((l=e.debug)!=null&&l.call(e))&&(_=Date.now());const f=s();if(!(f.length!==n.length||f.some((w,k)=>n[k]!==w)))return o;n=f;let b;if(e.key&&((m=e.debug)!=null&&m.call(e))&&(b=Date.now()),o=t(...f),e.key&&((v=e.debug)!=null&&v.call(e))){const w=Math.round((Date.now()-_)*100)/100,k=Math.round((Date.now()-b)*100)/100,C=k/16,x=(J,X)=>{for(J=String(J);J.length<X;)J=" "+J;return J};console.info(`%c⏱ ${x(k,5)} /${x(w,5)} ms`,`
|
|
244
|
+
font-size: .6rem;
|
|
245
|
+
font-weight: bold;
|
|
246
|
+
color: hsl(${Math.max(0,Math.min(120-120*C,120))}deg 100% 31%);`,e==null?void 0:e.key)}return e!=null&&e.onChange&&!(i&&e.skipInitialOnChange)&&e.onChange(o),i=!1,o}return r.updateDeps=l=>{n=l},r}function Ks(s,t){if(s===void 0)throw new Error("Unexpected undefined");return s}const Qd=(s,t)=>Math.abs(s-t)<1.01,Gd=(s,t,e)=>{let n;return function(...o){s.clearTimeout(n),n=s.setTimeout(()=>t.apply(this,o),e)}},Qs=s=>{const{offsetWidth:t,offsetHeight:e}=s;return{width:t,height:e}},Jd=s=>s,Yd=s=>{const t=Math.max(s.startIndex-s.overscan,0),e=Math.min(s.endIndex+s.overscan,s.count-1),n=[];for(let o=t;o<=e;o++)n.push(o);return n},Xd=(s,t)=>{const e=s.scrollElement;if(!e)return;const n=s.targetWindow;if(!n)return;const o=r=>{const{width:l,height:m}=r;t({width:Math.round(l),height:Math.round(m)})};if(o(Qs(e)),!n.ResizeObserver)return()=>{};const i=new n.ResizeObserver(r=>{const l=()=>{const m=r[0];if(m!=null&&m.borderBoxSize){const v=m.borderBoxSize[0];if(v){o({width:v.inlineSize,height:v.blockSize});return}}o(Qs(e))};s.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return i.observe(e,{box:"border-box"}),()=>{i.unobserve(e)}},Gs={passive:!0},Js=typeof window>"u"?!0:"onscrollend"in window,Zd=(s,t)=>{const e=s.scrollElement;if(!e)return;const n=s.targetWindow;if(!n)return;let o=0;const i=s.options.useScrollendEvent&&Js?()=>{}:Gd(n,()=>{t(o,!1)},s.options.isScrollingResetDelay),r=_=>()=>{const{horizontal:f,isRtl:I}=s.options;o=f?e.scrollLeft*(I&&-1||1):e.scrollTop,i(),t(o,_)},l=r(!0),m=r(!1);e.addEventListener("scroll",l,Gs);const v=s.options.useScrollendEvent&&Js;return v&&e.addEventListener("scrollend",m,Gs),()=>{e.removeEventListener("scroll",l),v&&e.removeEventListener("scrollend",m)}},ec=(s,t,e)=>{if(t!=null&&t.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return s[e.options.horizontal?"offsetWidth":"offsetHeight"]},tc=(s,{adjustments:t=0,behavior:e},n)=>{var o,i;const r=s+t;(i=(o=n.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[n.options.horizontal?"left":"top"]:r,behavior:e})};class sc{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e,n,o;return((o=(n=(e=this.targetWindow)==null?void 0:e.performance)==null?void 0:n.now)==null?void 0:o.call(n))??Date.now()},this.observer=(()=>{let e=null;const n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const r=()=>{const l=i.target,m=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l),this.elementsCache.delete(this.options.getItemKey(m));return}this.shouldMeasureDuringScroll(m)&&this.resizeItem(m,this.options.measureElement(l,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var o;(o=n())==null||o.disconnect(),e=null},observe:o=>{var i;return(i=n())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=n())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,o])=>{typeof o>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Jd,rangeExtractor:Yd,onChange:()=>{},measureElement:ec,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var n,o;(o=(n=this.options).onChange)==null||o.call(n,this,e)},this.maybeNotify=wt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{const o=new Map,i=new Map;for(let r=n-1;r>=0;r--){const l=e[r];if(o.has(l.lane))continue;const m=i.get(l.lane);if(m==null||l.end>m.end?i.set(l.lane,l):l.end<m.end&&o.set(l.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((r,l)=>r.end===l.end?r.index-l.index:r.end-l.end)[0]:void 0},this.getMeasurementOptions=wt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,n,o,i,r,l)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:o,getItemKey:i,enabled:r,lanes:l}),{key:!1}),this.getMeasurements=wt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:o,getItemKey:i,enabled:r,lanes:l},m)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const I of this.laneAssignments.keys())I>=e&&this.laneAssignments.delete(I);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(I=>{this.itemSizeCache.set(I.key,I.size)}));const v=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const _=this.measurementsCache.slice(0,v),f=new Array(l).fill(void 0);for(let I=0;I<v;I++){const b=_[I];b&&(f[b.lane]=I)}for(let I=v;I<e;I++){const b=i(I),w=this.laneAssignments.get(I);let k,C;if(w!==void 0&&this.options.lanes>1){k=w;const W=f[k],O=W!==void 0?_[W]:void 0;C=O?O.end+this.options.gap:n+o}else{const W=this.options.lanes===1?_[I-1]:this.getFurthestMeasurement(_,I);C=W?W.end+this.options.gap:n+o,k=W?W.lane:I%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(I,k)}const x=m.get(b),J=typeof x=="number"?x:this.options.estimateSize(I),X=C+J;_[I]={index:I,start:C,size:J,end:X,key:b,lane:k},f[k]=I}return this.measurementsCache=_,_},{key:!1,debug:()=>this.options.debug}),this.calculateRange=wt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,o,i)=>this.range=e.length>0&&n>0?nc({measurements:e,outerSize:n,scrollOffset:o,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=wt(()=>{let e=null,n=null;const o=this.calculateRange();return o&&(e=o.startIndex,n=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,o,i,r)=>i===null||r===null?[]:e({startIndex:i,endIndex:r,overscan:n,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const n=this.options.indexAttribute,o=e.getAttribute(n);return o?parseInt(o,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(o!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,o-i),l=Math.min(this.options.count-1,o+i);return e>=r&&e<=l}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((r,l)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(l))});return}const n=this.indexFromElement(e),o=this.options.getItemKey(n),i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,n)=>{var o;const i=this.measurementsCache[e];if(!i)return;const r=this.itemSizeCache.get(i.key)??i.size,l=n-r;l!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,l,this):i.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(i.index),this.itemSizeCache=new Map(this.itemSizeCache.set(i.key,n)),this.notify(!1))},this.getVirtualItems=wt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{const o=[];for(let i=0,r=e.length;i<r;i++){const l=e[i],m=n[l];o.push(m)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const n=this.getMeasurements();if(n.length!==0)return Ks(n[Rn(0,n.length-1,o=>Ks(n[o]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,n,o=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=e>=r+i?"end":"start"),n==="center"?e+=(o-i)/2:n==="end"&&(e-=i);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const o=this.getSize(),i=this.getScrollOffset(),r=this.measurementsCache[e];if(!r)return;if(n==="auto")if(r.end>=i+o-this.options.scrollPaddingEnd)n="end";else if(r.start<=i+this.options.scrollPaddingStart)n="start";else return[i,n];if(n==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),n];const l=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,n,r.size),n]},this.scrollToOffset=(e,{align:n="start",behavior:o="auto"}={})=>{const i=this.getOffsetForAlignment(e,n),r=this.now();this.scrollState={index:null,align:n,behavior:o,startedAt:r,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:n="auto",behavior:o="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const i=this.getOffsetForIndex(e,n);if(!i)return;const[r,l]=i,m=this.now();this.scrollState={index:e,align:l,behavior:o,startedAt:m,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:n="auto"}={})=>{const o=this.getScrollOffset()+e,i=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:i,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var e;const n=this.getMeasurements();let o;if(n.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((e=n[n.length-1])==null?void 0:e.end)??0;else{const i=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&i.some(l=>l===null);){const l=n[r];i[l.lane]===null&&(i[l.lane]=l.end),r--}o=Math.max(...i.filter(l=>l!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:o})=>{this.options.scrollToFn(e,{behavior:o,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=n?n[0]:this.scrollState.lastTargetOffset,i=1,r=o!==this.scrollState.lastTargetOffset;if(!r&&Qd(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.scrollState=null;return}}else this.scrollState.stableFrames=0,r&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const Rn=(s,t,e,n)=>{for(;s<=t;){const o=(s+t)/2|0,i=e(o);if(i<n)s=o+1;else if(i>n)t=o-1;else return o}return s>0?s-1:0};function nc({measurements:s,outerSize:t,scrollOffset:e,lanes:n}){const o=s.length-1,i=m=>s[m].start;if(s.length<=n)return{startIndex:0,endIndex:o};let r=Rn(0,o,i,e),l=r;if(n===1)for(;l<o&&s[l].end<e+t;)l++;else if(n>1){const m=Array(n).fill(0);for(;l<o&&m.some(_=>_<e+t);){const _=s[l];m[_.lane]=_.end,l++}const v=Array(n).fill(e+t);for(;r>=0&&v.some(_=>_>=e);){const _=s[r];v[_.lane]=_.start,r--}r=Math.max(0,r-r%n),l=Math.min(o,l+(n-1-l%n))}return{startIndex:r,endIndex:l}}function oc(s){const t=new sc(a(s)),e=Wt(t),n=t._didMount();return $e(()=>a(s).getScrollElement(),o=>{o&&t._willUpdate()},{immediate:!0}),$e(()=>a(s),o=>{t.setOptions({...o,onChange:(i,r)=>{var l;xs(e),(l=o.onChange)==null||l.call(o,i,r)}}),t._willUpdate(),xs(e)},{immediate:!0}),Un(n),e}function ic(s){return oc(E(()=>({observeElementRect:Xd,observeElementOffset:Zd,scrollToFn:tc,...a(s)})))}async function bs(s){if(window.isSecureContext)return navigator.clipboard.writeText(s);const t=document.activeElement instanceof HTMLElement?document.activeElement:null,e=document.createElement("textarea");e.value=s,e.setAttribute("readonly",""),e.style.cssText="position:fixed;top:0;left:-9999px;font-size:16px;opacity:0",document.body.append(e),e.select(),e.setSelectionRange(0,s.length);const n=document.execCommand("copy");if(e.remove(),t==null||t.focus({preventScroll:!0}),!n)throw new Error("Copy to clipboard failed")}let ac;function On(){return ac??(ac=Te(async()=>{const{default:s}=await import("./index-6bKx5FLu.js").then(t=>t.a4);return{default:s}},__vite__mapDeps([0,1])).then(({default:s})=>s))}const rc=/^[a-z][a-z\d+.-]*:/i;function Ys(s){try{return decodeURIComponent(s)}catch{return s}}function lc(s){if(!(s===""||s.startsWith("#"))){if(s.startsWith("file:"))return Ys(s.replace(/^file:(\/\/)?/,""));if(!rc.test(s))return Ys(s.split(/[?#]/)[0]??s)}}const dc={key:1,class:"chat-markdown chat-markdown--pending"};let es;const cc=_e({__name:"ChatMarkdown",props:{content:{},final:{type:Boolean},messageId:{}},setup(s){const{t}=ye(),e=xt(),n={fontSize:13,lineHeight:20},o=Wt(es),i=P(!1);let r;function l(){i.value=document.documentElement.dataset.theme==="dark"||document.documentElement.classList.contains("dark")}ot(async()=>{l(),r=new MutationObserver(l),r.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),es??(es=await On()),o.value=es}),it(()=>r==null?void 0:r.disconnect());async function m(v){const _=v.target instanceof Element?v.target.closest("a[href]"):null,f=_===null?void 0:lc(_.getAttribute("href")??"");if(f!==void 0){v.preventDefault();try{await bs(f),e.push({tone:"success",title:t("chat.pathCopied"),description:f})}catch{e.push({tone:"danger",title:t("chat.copyFailed")})}}}return(v,_)=>o.value?(d(),ae(rs(o.value),{key:0,class:je(["chat-markdown",{dark:i.value}]),content:s.content,final:s.final,"index-key":s.messageId,"is-dark":i.value,"code-block-options":n,"html-policy":"escape",mode:"chat","node-virtual":!1,onClick:m},null,8,["class","content","final","index-key","is-dark"])):(d(),c("div",dc,h(s.content),1))}}),uc={class:"user-message","data-role":"user"},pc={class:"sr-only"},hc={class:"user-bubble"},mc=["aria-expanded"],vc={key:0,class:"user-skills"},fc={class:"user-actions"},gc={class:"user-sent-time timestamp"},bc=["aria-label"],yc=["aria-label"],kc=["aria-label"],wc=_e({__name:"TimelineUserMessage",props:{text:{},skills:{},hooks:{},at:{},quotable:{type:Boolean},branchable:{type:Boolean}},emits:["quote","branch"],setup(s,{emit:t}){const e=s,n=t,{t:o,locale:i}=ye(),r=P(),l=P(!1),m=P(!1),v=P(!1);let _;const f=E(()=>va(new Date(e.at),i.value));ot(async()=>{var b;await He(),l.value=(((b=r.value)==null?void 0:b.scrollHeight)??0)>300}),it(()=>clearTimeout(_));async function I(){await bs(e.text),v.value=!0,clearTimeout(_),_=setTimeout(()=>{v.value=!1},1500)}return(b,w)=>{var C;const k=ft("tooltip");return d(),c("article",uc,[u("strong",pc,h(a(o)("chat.you")),1),u("div",hc,[u("div",{ref_key:"content",ref:r,class:je(["user-bubble-content",{"is-clipped":l.value&&!m.value}])},h(s.text),3),l.value?(d(),c("button",{key:0,type:"button",class:"ui-button user-bubble-expand","data-variant":"ghost","data-size":"xs","aria-expanded":m.value,onClick:w[0]||(w[0]=x=>m.value=!m.value)},[G(a(Dt),{"aria-hidden":"true",class:je({"is-expanded":m.value})},null,8,["class"]),u("span",null,h(m.value?a(o)("message.collapse"):a(o)("message.expand")),1)],8,mc)):z("",!0)]),(C=s.skills)!=null&&C.length?(d(),c("div",vc,[(d(!0),c(ne,null,pe(s.skills,x=>(d(),c("div",{key:x,class:"user-skill"},h(a(o)("message.skillLoaded",{name:x})),1))),128))])):z("",!0),(d(!0),c(ne,null,pe(s.hooks??0,x=>(d(),c("div",{key:x,class:"user-hook"},h(a(o)("message.hookContext")),1))),128)),u("div",fc,[u("span",gc,h(f.value),1),Ne((d(),c("button",{class:"ui-icon-button","data-variant":"ghost","data-size":"sm",type:"button","aria-label":a(o)("message.copy"),onClick:I},[v.value?(d(),ae(a($t),{key:0,class:"is-copied","aria-hidden":"true"})):(d(),ae(a(an),{key:1,"aria-hidden":"true"}))],8,bc)),[[k,a(o)("message.copy")]]),s.branchable?Ne((d(),c("button",{key:0,class:"ui-icon-button","data-variant":"ghost","data-size":"sm",type:"button","aria-label":a(o)("message.branch"),onClick:w[1]||(w[1]=x=>n("branch",s.text))},[G(a(gt),{"aria-hidden":"true"})],8,yc)),[[k,a(o)("message.branch")]]):z("",!0),s.quotable?Ne((d(),c("button",{key:1,class:"ui-icon-button","data-variant":"ghost","data-size":"sm",type:"button","aria-label":a(o)("message.quote"),onClick:w[2]||(w[2]=x=>n("quote",s.text))},[G(a(go),{"aria-hidden":"true"})],8,kc)),[[k,a(o)("message.quote")]]):z("",!0)])])}}}),_c=Re(wc,[["__scopeId","data-v-d9ef091c"]]),Ic={class:"timeline-work-item"},$c=["aria-expanded"],xc=["title"],Cc={key:0},Sc={key:1,class:"timeline-work-item-summary"},Ec={class:"timeline-work-stat","data-tone":"success"},Mc={key:0,class:"timeline-work-stat","data-tone":"danger"},Tc={key:0,class:"timeline-work-item-details"},qc={key:0,class:"timeline-thinking-quote"},Ac={key:1,class:"tool-panel"},Lc={class:"tool-panel-label"},Rc=["title"],Oc=["onClick"],Pc={key:0,class:"tool-panel-code"},zc={class:"is-strong"},Dc={key:0,class:"is-faint"},Nc={key:1,class:"tool-panel-code"},jc={class:"is-strong"},Bc={key:0,class:"is-faint"},Fc={key:2,class:"tool-panel-diff"},Wc=["data-sign"],Vc={class:"tool-panel-sign","aria-hidden":"true"},Uc={key:3,class:"tool-panel-lines"},Hc={class:"tool-panel-line-number","aria-hidden":"true"},Kc={class:"tool-panel-line"},Xs=2e4,Qc=_e({__name:"TimelineWorkItem",props:{item:{},expanded:{type:Boolean}},emits:["toggle"],setup(s,{emit:t}){const e=s,n=t,{t:o}=ye(),i=E(()=>e.item.kind==="tool"?e.item:void 0),r=E(()=>i.value===void 0?void 0:fs(i.value.name,i.value.input)),l=E(()=>{const $=r.value;return $===void 0||i.value===void 0?"":$.renderer==="generic"?i.value.name:o($.labelKey)}),m=E(()=>e.item.kind!=="thinking"?"":e.item.running?o("work.thinking"):o("work.thoughtFor",{duration:e.item.durationMs===void 0?"…":ga(e.item.durationMs)})),v=E(()=>e.item.kind==="thinking"?e.item.content.trim():"");function _($){return $.length<=Xs?$:`${$.slice(0,Xs)}…`}function f($){var T;const M=(T=i.value)==null?void 0:T.input[$];return typeof M=="string"&&M!==""?M:void 0}const I=E(()=>{var $,M;return _((((M=($=i.value)==null?void 0:$.result)==null?void 0:M.text)??"").replace(/\s+$/u,""))}),b=E(()=>{var $;return(($=i.value)==null?void 0:$.status)==="error"}),w=E(()=>{var $;return(($=i.value)==null?void 0:$.name.trim().toLowerCase())??""}),k=E(()=>{var $,M,T;return w.value==="edit"?Mn((($=i.value)==null?void 0:$.input)??{},(T=(M=i.value)==null?void 0:M.result)==null?void 0:T.diff):[]}),C=E(()=>w.value==="write"?_(f("content")??""):""),x=E(()=>{if(k.value.length>0)return{added:k.value.filter($=>$.sign==="+").length,removed:k.value.filter($=>$.sign==="-").length};if(C.value!=="")return{added:C.value.split(`
|
|
247
|
+
`).length,removed:0}}),J=E(()=>{const $=i.value;if($===void 0||r.value===void 0)return[];const M=I.value?[{id:"output",label:o("detail.output"),copy:I.value,body:"pre"}]:[];switch(r.value.renderer){case"command":{const T=f("command");return[...T===void 0?[]:[{id:"input",label:o("prompt.input"),copy:T,body:"command"}],...M]}case"search":{const T=f("pattern")??f("path");return[...T===void 0?[]:[{id:"input",label:o("prompt.input"),copy:T,body:"search"}],...M]}case"file":{const T=f("path")??$.name;return k.value.length>0?[{id:"file",label:T,copy:k.value.map(V=>`${V.sign}${V.text}`).join(`
|
|
248
|
+
`),body:"diff"},...b.value?M:[]]:C.value!==""?[{id:"file",label:T,copy:C.value,body:"lines"},...b.value?M:[]]:b.value?M:[]}default:{const T=Object.keys($.input).length===0?"":_(JSON.stringify($.input,null,2));return[...T?[{id:"input",label:o("prompt.input"),copy:T,body:"pre"}]:[],...M]}}}),X=E(()=>e.item.kind==="thinking"?v.value!=="":J.value.length>0),W=P();let O;it(()=>clearTimeout(O));async function j($){await bs($.copy),W.value=$.id,clearTimeout(O),O=setTimeout(()=>{W.value=void 0},1500)}return($,M)=>(d(),c("div",Ic,[u("button",{type:"button",class:je(["timeline-work-item-toggle",{"is-running":s.item.kind==="thinking"?s.item.running:s.item.status==="running","is-error":b.value,"is-static":!X.value}]),"aria-expanded":X.value?s.expanded:void 0,onClick:M[0]||(M[0]=T=>X.value&&n("toggle"))},[G(a(Nt),{size:14,"aria-hidden":"true",class:je({"is-expanded":s.expanded&&X.value})},null,8,["class"]),i.value?(d(),c("span",{key:0,class:"timeline-work-item-summary",title:[l.value,i.value.primary].filter(Boolean).join(" ")},[u("span",null,h(l.value),1),i.value.primary?(d(),c("small",Cc,h(i.value.primary),1)):z("",!0)],8,xc)):(d(),c("span",Sc,[u("span",null,h(m.value),1)])),x.value?(d(),c(ne,{key:2},[u("span",Ec,"+"+h(x.value.added),1),x.value.removed?(d(),c("span",Mc,"−"+h(x.value.removed),1)):z("",!0)],64)):z("",!0)],10,$c),s.expanded&&X.value?(d(),c("div",Tc,[s.item.kind==="thinking"?(d(),c("div",qc,h(v.value),1)):(d(),c("div",Ac,[(d(!0),c(ne,null,pe(J.value,T=>(d(),c(ne,{key:T.id},[u("div",Lc,[u("span",{title:T.label},h(T.label),9,Rc),u("button",{type:"button",class:"ui-button","data-variant":"ghost","data-size":"xs",onClick:V=>j(T)},[W.value===T.id?(d(),ae(a($t),{key:0,"aria-hidden":"true"})):(d(),ae(a(an),{key:1,"aria-hidden":"true"})),be(h(a(o)(W.value===T.id?"timeline.copied":"timeline.copy")),1)],8,Oc)]),T.body==="command"?(d(),c("div",Pc,[u("div",zc,[M[1]||(M[1]=u("span",{class:"is-muted"},"$",-1)),be(" "+h(T.copy),1)]),f("cwd")?(d(),c("div",Dc," cwd: "+h(f("cwd")),1)):z("",!0)])):T.body==="search"?(d(),c("div",Nc,[u("div",jc,h(T.copy),1),f("pattern")&&f("path")?(d(),c("div",Bc," path: "+h(f("path")),1)):z("",!0)])):T.body==="diff"?(d(),c("div",Fc,[(d(!0),c(ne,null,pe(k.value,(V,se)=>(d(),c("div",{key:se,class:"tool-panel-diff-line","data-sign":V.sign},[u("span",Vc,h(V.sign),1),be(h(V.text),1)],8,Wc))),128))])):T.body==="lines"?(d(),c("div",Uc,[(d(!0),c(ne,null,pe(C.value.split(`
|
|
249
|
+
`),(V,se)=>(d(),c(ne,{key:se},[u("span",Hc,h(se+1),1),u("span",Kc,h(V),1)],64))),128))])):(d(),c("pre",{key:4,class:je(["tool-panel-pre",{"is-error":b.value&&T.id==="output"}])},h(T.copy),3))],64))),128))]))])):z("",!0)]))}}),Zs=Re(Qc,[["__scopeId","data-v-e3447865"]]),Gc={class:"timeline-work-row"},Jc=["aria-expanded"],Yc={key:0,class:"timeline-work-group-content"},Xc=_e({__name:"TimelineWorkRow",props:{items:{},expanded:{type:Boolean},expandedItemIds:{}},emits:["toggle","toggleItem"],setup(s,{emit:t}){const e=s,n=t,{t:o}=ye(),i={read:"work.read",edit:"work.edit",command:"work.command",search:"work.search",web_search:"work.webSearch",web_fetch:"work.webFetch",unknown:"work.unknown"},r=Object.keys(i),l=E(()=>{let v="",_;const f=e.items.filter(b=>b.kind==="thinking").length;f>0&&(v=o("work.thinkingSteps",{count:f},f),_="thinking");const I=new Map;for(const b of e.items)b.kind==="tool"&&I.set(b.category,(I.get(b.category)??0)+1);for(const b of r){const w=I.get(b);w!==void 0&&(_!==void 0&&(v+=o(_==="thinking"?"work.separator":"work.actionSeparator")),v+=o(i[b],{count:w},w),_=b)}return v}),m=E(()=>e.items.some(v=>v.kind==="thinking"?v.running:v.status==="running"));return(v,_)=>(d(),c("div",Gc,[s.items.length>1?(d(),c(ne,{key:0},[u("button",{type:"button",class:je(["timeline-work-group-toggle",{"is-running":m.value}]),"aria-expanded":s.expanded,onClick:_[0]||(_[0]=f=>n("toggle"))},[G(a(Nt),{size:14,"aria-hidden":"true",class:je({"is-expanded":s.expanded})},null,8,["class"]),u("span",null,h(l.value),1)],10,Jc),s.expanded?(d(),c("div",Yc,[(d(!0),c(ne,null,pe(s.items,f=>(d(),ae(Zs,{key:f.id,item:f,expanded:s.expandedItemIds[f.id]===!0,onToggle:I=>n("toggleItem",f.id)},null,8,["item","expanded","onToggle"]))),128))])):z("",!0)],64)):s.items[0]?(d(),ae(Zs,{key:1,item:s.items[0],expanded:s.expandedItemIds[s.items[0].id]===!0,onToggle:_[1]||(_[1]=f=>n("toggleItem",s.items[0].id))},null,8,["item","expanded"])):z("",!0)]))}});function Zc(s){var o;const t=[];let e=[];const n=()=>{e.length>0&&t.push({key:`work-${e[0].id}`,kind:"work",items:e}),e=[]};for(const i of s)if(i.kind==="thinking"){if(i.text===""&&!i.streaming)continue;e.push({id:i.key,kind:"thinking",content:i.text,running:i.streaming,...i.elapsedMs===void 0?{}:{durationMs:i.elapsedMs}})}else if(i.kind==="tool"){const r=eu(i.name,i.input),l=tu(r,i.input);e.push({id:i.key,kind:"tool",name:i.name,category:r,...l===void 0?{}:{primary:l},status:i.pending?"running":((o=i.result)==null?void 0:o.isError)===!0?"error":"complete",input:i.input,...i.result===void 0?{}:{result:i.result}})}else n(),t.push({key:i.key,kind:"row",row:i});return n(),t}function eu(s,t){const{renderer:e,labelKey:n}=fs(s,t);switch(e){case"command":return"command";case"search":return"search";case"file":return n==="tool.read"?"read":"edit";case"web":return n==="tool.webSearch"?"web_search":"web_fetch";case"generic":return"unknown"}}function tu(s,t){const n=(s==="command"?["command"]:s==="web_search"?["query"]:s==="web_fetch"?["url"]:s==="search"?["pattern","path"]:["path"]).map(i=>t[i]).find(i=>typeof i=="string"&&i.trim()!=="");if(n===void 0)return;const o=s==="read"||s==="edit"?n.replaceAll("\\","/").split("/").at(-1)??n:n;return o.length<=80?o:`${o.slice(0,79)}…`}const su=3,nu=180;function en(s){return s.replace(/\s+/g," ").trim().slice(0,nu)}function ou(s){const t=[];return s.forEach((e,n)=>{if(e.kind!=="row")return;const o=e.row;if(o.kind==="user"){t.push({key:e.key,index:n,prompt:en(o.text)});return}const i=t.at(-1);o.kind==="assistant"&&i!==void 0&&i.reply===void 0&&o.text.trim()!==""&&(i.reply=en(o.text))}),t}const iu=["data-variant"],au=["disabled"],ru={key:1,role:"alert"},lu={key:2,class:"timeline-empty"},du=["data-index"],cu={key:2,class:"timeline-row","data-role":"assistant"},uu={class:"sr-only"},pu=["disabled","aria-label","onClick"],hu={class:"timeline-line-name"},mu={key:0,class:"timeline-line-failed"},vu={key:1,class:"timeline-line-cut"},fu={key:4,class:"timeline-notice"},gu={key:5,class:"timeline-line-notice"},bu={class:"timeline-line-from"},yu={key:6,class:"timeline-line-notice"},ku={key:7,class:"timeline-line-notice"},wu={key:8,class:"timeline-hook"},_u=["aria-expanded","onClick"],Iu={key:0,class:"timeline-hook-body"},$u={key:9,class:"notice-row error-row",role:"alert"},xu=["aria-expanded","onClick"],Cu={key:0,class:"error-details"},Su={key:10,class:"timeline-notice"},Eu={key:3,class:"processing-row",role:"status"},Mu=["aria-hidden"],Tu={class:"sr-only"},qu=["aria-label"],Au=["aria-label","onClick"],Lu={class:"timeline-marker-card"},Ru={class:"timeline-marker-prompt"},Ou={key:0,class:"timeline-marker-reply"},Pu=["aria-label"],zu=96,Du=420,Nu=_e({__name:"TimelineView",props:{earlier:{type:Boolean},loadingEarlier:{type:Boolean},historyError:{},rows:{},running:{type:Boolean},retry:{},quotable:{type:Boolean},branchable:{type:Boolean},empty:{},variant:{}},emits:["earlier","quote","branch","openLine"],setup(s,{emit:t}){const e=s,n=t,{t:o}=ye(),i=P(),r=P(),l=P(!0),m=P({}),v=P({}),_=E(()=>Zc(e.rows)),f=P({}),I=P(Date.now());let b;$e(()=>e.retry,D=>{clearInterval(b),b=void 0,D!==void 0&&(I.value=Date.now(),b=setInterval(()=>{I.value=Date.now()},500))},{immediate:!0}),it(()=>clearInterval(b));const w=E(()=>e.retry===void 0?"":Bi(e.retry,ji(e.retry.retryAtMs,I.value))),k=E(()=>Fi(e.retry));function C(D){f.value[D]=f.value[D]!==!0}function x(D){return D.slice(0,8)}function J(D,L){D.kind==="user"&&n("branch",L,D.cut)}const X=ic(E(()=>({count:_.value.length,getScrollElement:()=>i.value??null,estimateSize:()=>72,overscan:6,getItemKey:D=>_.value[D].key})));X.value.shouldAdjustScrollPositionOnItemSizeChange=(D,L,K)=>{var ce;const me=i.value;return me===void 0||r.value===void 0?!1:(K.getTotalSize(),(((ce=K.measurementsCache[D.index])==null?void 0:ce.start)??D.start)<me.scrollTop-r.value.offsetTop)};const W=E(()=>X.value.getVirtualItems()),O=E(()=>X.value.getTotalSize()),j=E(()=>ou(_.value)),$=E(()=>e.variant!=="panel"&&j.value.length>=su),M=E(()=>Math.min(12,(Du-12)/Math.max(1,j.value.length-1))),T=P();let V;function se(D){l.value=!1,X.value.scrollToIndex(D,{align:"center",behavior:"smooth"}),T.value=D,clearTimeout(V),V=setTimeout(()=>{T.value=void 0},1600)}function de(D){D instanceof Element&&X.value.measureElement(D)}function ge(){const D=i.value;D!==void 0&&(l.value=D.scrollHeight-D.scrollTop-D.clientHeight<=zu)}async function Y(){await He();const D=i.value;D!==void 0&&(D.scrollTop=D.scrollHeight)}function le(){l.value=!0,Y()}return $e([()=>_.value.length,O,()=>e.rows.at(-1),()=>e.running],()=>{l.value&&Y()}),ot(()=>void Y()),(D,L)=>{const K=ft("tooltip");return d(),c("div",{class:"timeline-shell","data-variant":s.variant??"main"},[u("div",{ref_key:"viewport",ref:i,class:"timeline app-scroll-viewport",onScrollPassive:ge},[s.earlier?(d(),c("button",{key:0,type:"button",class:"ui-button",disabled:s.loadingEarlier,onClick:L[0]||(L[0]=me=>{l.value=!1,n("earlier")})},h(s.loadingEarlier?a(o)("timeline.loadingEarlier"):a(o)("timeline.loadEarlier")),9,au)):z("",!0),s.historyError?(d(),c("p",ru,h(s.historyError),1)):z("",!0),_.value.length===0&&!s.running?(d(),c("p",lu,h(s.empty??a(o)("chat.emptyTimeline")),1)):z("",!0),u("div",{ref_key:"list",ref:r,class:"virtual-timeline",style:Mt({height:`${O.value}px`,position:"relative"})},[(d(!0),c(ne,null,pe(W.value,me=>(d(),c("div",{key:String(me.key),ref_for:!0,ref:de,class:je(["virtual-timeline-row",{"is-jump-target":me.index===T.value}]),"data-index":me.index,style:Mt({position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${me.start}px)`})},[(d(!0),c(ne,null,pe([_.value[me.index]],F=>(d(),c(ne,{key:F.key},[F.kind==="work"?(d(),ae(Xc,{key:0,items:F.items,expanded:m.value[F.key]===!0,"expanded-item-ids":v.value,onToggle:ce=>m.value[F.key]=!m.value[F.key],onToggleItem:L[1]||(L[1]=ce=>v.value[ce]=!v.value[ce])},null,8,["items","expanded","expanded-item-ids","onToggle"])):F.row.kind==="user"?(d(),ae(_c,{key:1,text:F.row.text,skills:F.row.skills,hooks:F.row.hooks,at:F.row.at,quotable:s.quotable,branchable:s.branchable===!0,onBranch:ce=>J(F.row,ce),onQuote:L[2]||(L[2]=ce=>n("quote",ce))},null,8,["text","skills","hooks","at","quotable","branchable","onBranch"])):F.row.kind==="assistant"?(d(),c("article",cu,[u("strong",uu,h(a(o)("chat.assistant")),1),G(cc,{content:F.row.text,final:!F.row.streaming,"message-id":F.row.key},null,8,["content","final","message-id"])])):F.row.kind==="line"?(d(),c("button",{key:3,type:"button",class:"timeline-line-marker",disabled:F.row.failed===!0,"aria-label":a(o)("lines.openLine",{name:F.row.purpose||x(F.row.branchId)}),onClick:ce=>F.row.failed!==!0&&n("openLine",F.row.branchId)},[G(a(gt),{size:14,"aria-hidden":"true"}),u("span",hu,h(F.row.purpose||x(F.row.branchId)),1),u("code",null,h(x(F.row.branchId)),1),F.row.failed?(d(),c("span",mu,h(a(o)("lines.state.creationFailed")),1)):F.row.before?(d(),c("span",vu,h(a(o)("timeline.beforeMessage",{message:F.row.before})),1)):z("",!0)],8,pu)):F.row.kind==="line-ended"?(d(),c("p",fu,h(F.row.issuer==="itself"?a(o)("timeline.lineEndedItself"):F.row.issuer==="operation"?a(o)("timeline.lineEndedByOperation"):a(o)("timeline.lineEndedWith",{id:F.row.ancestor??""})),1)):F.row.kind==="source-message"?(d(),c("p",gu,[u("span",bu,[be(h(a(o)("timeline.fromLine",{id:F.row.from})),1),F.row.steer?(d(),c(ne,{key:0},[be(h(a(o)("timeline.steer")),1)],64)):z("",!0),F.row.final?(d(),c(ne,{key:1},[be(", "+h(a(o)("timeline.final")),1)],64)):z("",!0)]),u("span",null,h(F.row.body),1)])):F.row.kind==="source-idle"?(d(),c("p",yu,h(a(o)("timeline.lineWaiting",{id:F.row.branch,status:F.row.status})),1)):F.row.kind==="source-ended"?(d(),c("p",ku,h(a(o)("timeline.lineEnded",{id:F.row.branch})),1)):F.row.kind==="hook-follow-up"?(d(),c("div",wu,[u("button",{type:"button",class:"timeline-hook-row","aria-expanded":f.value[F.row.key]===!0,onClick:ce=>C(F.row.key)},[u("span",null,h(a(o)("timeline.hookFollowUp",{count:F.row.lines},F.row.lines)),1),G(a(Dt),{size:14,class:je({"is-expanded":f.value[F.row.key]===!0}),"aria-hidden":"true"},null,8,["class"])],8,_u),f.value[F.row.key]?(d(),c("div",Iu,[(d(!0),c(ne,null,pe(F.row.body.split(`
|
|
250
|
+
`),(ce,qe)=>(d(),c("div",{key:qe},h(ce),1))),128))])):z("",!0)])):F.row.kind==="error"?(d(),c("div",$u,[u("span",null,h(F.row.text),1),F.row.details?(d(),c(ne,{key:0},[u("button",{type:"button",class:"error-details-toggle","aria-expanded":f.value[F.row.key]===!0,onClick:ce=>C(F.row.key)},h(a(o)("failure.details")),9,xu),f.value[F.row.key]?(d(),c("div",Cu,[(d(!0),c(ne,null,pe(a(Ni)(F.row.details),(ce,qe)=>(d(),c("div",{key:qe},h(ce),1))),128))])):z("",!0)],64)):z("",!0)])):(d(),c("p",Su,h(a(o)("timeline.noticeStopped")),1))],64))),128))],14,du))),128))],4),s.running?(d(),c("div",Eu,[G(a(Ht),{size:14,class:"is-spinning","aria-hidden":"true"}),u("span",{"aria-hidden":s.retry===void 0?!1:"true"},h(s.retry===void 0?a(o)("work.processing"):w.value),9,Mu),u("span",Tu,h(k.value),1)])):z("",!0)],544),$.value?(d(),c("nav",{key:0,class:"timeline-rail","aria-label":a(o)("timeline.rail")},[(d(!0),c(ne,null,pe(j.value,(me,F)=>(d(),c("button",{key:me.key,type:"button",class:"timeline-marker",style:Mt({top:`${F*M.value}px`}),"aria-label":me.prompt,onClick:ce=>se(me.index)},[u("span",Lu,[u("span",Ru,h(me.prompt),1),me.reply?(d(),c("span",Ou,h(me.reply),1)):z("",!0)])],12,Au))),128))],8,qu)):z("",!0),G(Hn,{name:"jump-latest"},{default:We(()=>[l.value?z("",!0):Ne((d(),c("button",{key:0,class:"ui-icon-button jump-latest","data-variant":"secondary","data-size":"md",type:"button","aria-label":a(o)("timeline.scrollToBottom"),onClick:le},[G(a(Dt),{"aria-hidden":"true"})],8,Pu)),[[K,a(o)("timeline.scrollToBottom")]])]),_:1})],8,iu)}}}),Pn=Re(Nu,[["__scopeId","data-v-fc31dba1"]]),ju=["aria-label"],Bu={class:"line-crumb"},Fu={class:"line-crumb-main"},Wu=["data-tone"],Vu={class:"line-crumb-meta"},Uu={key:0},Hu={key:1},Ku={key:0,class:"line-loading",role:"status"},Qu={key:1,class:"line-loading line-error",role:"alert"},Gu={key:0,class:"line-approval"},Ju={key:1,class:"line-approval question-prompts"},Yu={class:"line-status"},Xu={key:3,class:"line-readonly"},Zu=_e({__name:"LineConversation",props:{sessionId:{},branchId:{}},setup(s){const t=s,{t:e}=ye(),n=Ge(),o=Ce(),i=Ve(),r=P(),l=E(()=>n.views[t.sessionId]),m=E(()=>{var L;return(L=l.value)==null?void 0:L.branches[t.branchId]}),v=E(()=>{var L;return(L=l.value)==null?void 0:L.lines.find(K=>K.id===t.branchId)}),_=E(()=>{var L;return(L=l.value)==null?void 0:L.approvals.find(K=>K.branchId===t.branchId)}),f=E(()=>{var L;return i.approvalKeyboard(t.sessionId,t.branchId,((L=l.value)==null?void 0:L.approvals)??[])}),I=E(()=>{var L;return((L=l.value)==null?void 0:L.questions.filter(K=>K.branchId===t.branchId))??[]}),b=E(()=>o.supports("permission.rules")&&o.supports("permission.set_rules")),w=E(()=>{var L;return(L=l.value)!=null&&L.methods.includes("session.files.search")?K=>n.searchFiles(t.sessionId,K):void 0}),k=E(()=>{var L;return v.value===void 0?((L=m.value)==null?void 0:L.status)!=="failed":v.value.state.kind==="working"||v.value.state.kind==="waiting"}),C=E(()=>dt(e,v.value,t.branchId)),x=E(()=>{var L,K;return((L=v.value)==null?void 0:L.state)??((K=m.value)!=null&&K.running?{kind:"working"}:{kind:"waiting"})}),J=E(()=>{var me,F;const L=(me=v.value)==null?void 0:me.parentId;if(L==null)return"";if(L===ue)return e("lines.main");const K=(F=l.value)==null?void 0:F.lines.find(ce=>ce.id===L);return K===void 0?kt(L):dt(e,K,L)}),X=E(()=>{var L,K;return((L=v.value)==null?void 0:L.cut)===null||((K=v.value)==null?void 0:K.cut)===void 0?"":e("lines.afterMessage",{count:v.value.cut.messages})}),W=E(()=>{var L;return((L=m.value)==null?void 0:L.rows)??[]}),O=E(()=>{var L;return((L=m.value)==null?void 0:L.running)??!1}),j=E(()=>{var L;return((L=m.value)==null?void 0:L.stopping)??!1});$e(()=>[t.sessionId,t.branchId],()=>n.ensureLine(t.sessionId,t.branchId),{immediate:!0});function $(L,K){return n.submit(t.sessionId,t.branchId,L,K)}function M(L){var K;(K=r.value)==null||K.quote(L)}function T(){return n.stop(t.sessionId,t.branchId)}function V(L,K){i.requestNewLine({sessionId:t.sessionId,parentBranchId:t.branchId,at:K,text:L})}function se(L){n.ensureLine(t.sessionId,L),i.openLine(t.sessionId,L)}function de(){i.requestEndLine({sessionId:t.sessionId,branchId:t.branchId,purpose:C.value})}function ge(){var K;const L=(K=m.value)==null?void 0:K.lastTurnEnd;L!==void 0&&i.requestNewLine({sessionId:t.sessionId,parentBranchId:t.branchId,at:L,text:""})}async function Y(L){var F;const K=(F=m.value)==null?void 0:F.lastTurnEnd;if(K===void 0)throw new Error(e("lines.noFinishedTurn"));const me=await n.createLine(t.sessionId,t.branchId,K,L);i.openLine(t.sessionId,me)}function le(){n.retryLine(t.sessionId,t.branchId)}function D(){}return(L,K)=>{var me,F,ce;return d(),c("section",{class:"line-conversation","aria-label":a(e)("lines.lineAria",{name:C.value})},[u("header",Bu,[u("div",Fu,[G(a(gt),{size:14,"aria-hidden":"true"}),u("strong",null,h(C.value),1),u("code",null,h(a(kt)(s.branchId)),1),u("span",{class:"line-state","data-tone":a(ms)(x.value)},h(a(Pt)(a(e),x.value)),9,Wu)]),u("div",Vu,[J.value?(d(),c("span",Uu,[be(h(a(e)("lines.from",{name:J.value})),1),X.value?(d(),c(ne,{key:0},[be(" · "+h(X.value),1)],64)):z("",!0)])):(d(),c("span",Hu,h(a(e)("lines.main")),1)),k.value&&((me=m.value)==null?void 0:me.lastTurnEnd)!==void 0?(d(),c("button",{key:2,type:"button",class:"ui-button","data-variant":"ghost","data-size":"xs",onClick:ge},h(a(e)("lines.newChild")),1)):z("",!0),k.value&&((F=v.value)==null?void 0:F.id)!=="main"?(d(),c("button",{key:3,type:"button",class:"ui-button","data-variant":"ghost","data-size":"xs",onClick:de},h(a(e)("lines.end")),1)):z("",!0)])]),!l.value||!m.value||m.value.status==="loading"?(d(),c("div",Ku,[G(a(Ht),{size:16,class:"is-spinning","aria-hidden":"true"}),u("span",null,h(a(e)("common.loading")),1)])):m.value.status==="failed"?(d(),c("div",Qu,[u("p",null,h(m.value.error||a(e)("lines.loadFailed")),1),u("button",{type:"button",class:"ui-button","data-variant":"secondary","data-size":"sm",onClick:le},[G(a(bo),{"aria-hidden":"true"}),be(h(a(e)("lines.retry")),1)])])):(d(),c(ne,{key:2},[G(Pn,{rows:W.value,earlier:m.value.earlier,"loading-earlier":m.value.loadingEarlier,"history-error":m.value.historyError,onEarlier:K[0]||(K[0]=qe=>a(n).loadEarlier(s.sessionId,s.branchId)),running:O.value,quotable:k.value&&!_.value&&I.value.length===0,branchable:k.value&&!_.value&&I.value.length===0,empty:a(e)("lines.empty"),variant:"panel",onBranch:V,onOpenLine:se,onQuote:M},null,8,["rows","earlier","loading-earlier","history-error","running","quotable","branchable","empty"]),_.value?(d(),c("div",Gu,[(d(),ae(Tn,{key:JSON.stringify([_.value.branchId,_.value.requestId]),"session-id":s.sessionId,request:_.value,keyboard:f.value,"rules-available":b.value},null,8,["session-id","request","keyboard","rules-available"]))])):I.value.length?(d(),c("div",Ju,[(d(!0),c(ne,null,pe(I.value,qe=>(d(),ae(Ln,{key:JSON.stringify([qe.branchId,qe.requestId,qe.callId]),"session-id":s.sessionId,question:qe},null,8,["session-id","question"]))),128))])):k.value?(d(),ae(gs,{key:2,ref_key:"composer",ref:r,running:O.value,stopping:j.value,model:l.value.model,send:$,"stores-pastes":((ce=l.value)==null?void 0:ce.methods.includes("attachment.put"))===!0,"search-files":w.value,stop:T,"model-selectable":!1,"select-model":D,placeholder:a(e)("lines.placeholder"),"create-branch":a(o).supports("session.branch_create")?Y:void 0,"open-lines":()=>a(i).openLines(s.sessionId),variant:"panel"},{status:We(()=>[u("span",Yu,"⑂ "+h(a(Pt)(a(e),x.value)),1)]),_:1},8,["running","stopping","model","stores-pastes","search-files","placeholder","create-branch","open-lines"])):(d(),c("div",Xu,[u("span",null,"⑂ "+h(a(Pt)(a(e),x.value)),1),u("span",null,h(a(e)("lines.readOnly")),1)]))],64))],8,ju)}}}),ep=Re(Zu,[["__scopeId","data-v-d0c8b107"]]),tp={class:"lines-tree"},sp={key:0,class:"lines-empty"},np={class:"lines-empty-icon","aria-hidden":"true"},op=["aria-label"],ip=["data-depth","data-active"],ap=["data-tone"],rp={class:"lines-name"},lp={class:"lines-meta"},dp=["aria-label","disabled","onClick"],cp=["data-tone"],up={class:"lines-name"},pp={class:"lines-meta"},hp={key:0},mp={class:"lines-id"},vp={key:1},fp=["aria-label","onClick"],gp=_e({__name:"LinesTree",props:{sessionId:{}},setup(s){const t=s,{t:e}=ye(),n=Ge(),o=Ve(),i=E(()=>n.views[t.sessionId]),r=E(()=>{var k;return((k=i.value)==null?void 0:k.lines)??[]}),l=E(()=>r.value.some(k=>k.id!=="main"));function m(k){k.id==="main"||k.state.kind==="creation-failed"||(n.ensureLine(t.sessionId,k.id),o.openLine(t.sessionId,k.id))}function v(k){return k.id!=="main"&&(k.state.kind==="working"||k.state.kind==="waiting")}function _(k){var C;return((C=i.value)==null?void 0:C.approvals.some(x=>x.branchId===k.id))===!0}function f(k){return _(k)?"warning":ms(k.state)}function I(k){o.requestEndLine({sessionId:t.sessionId,branchId:k.id,purpose:dt(e,k,k.id)})}function b(k){return k.cut===null||k.cut.messages===void 0?"":e("lines.afterMessage",{count:k.cut.messages})}function w(k){if(k.parentId===null)return"";const C=r.value.find(x=>x.id===k.parentId);return C===void 0?kt(k.parentId):dt(e,C,k.parentId)}return(k,C)=>(d(),c("div",tp,[l.value?(d(),c("ol",{key:1,class:"lines-list","aria-label":a(e)("lines.title")},[(d(!0),c(ne,null,pe(r.value,x=>(d(),c("li",{key:x.id,class:"lines-row","data-depth":x.depth,"data-active":x.id!=="main"&&a(o).activeLineTab[s.sessionId]===x.id},[x.id==="main"?(d(),c(ne,{key:0},[u("span",{class:"lines-state","data-tone":f(x),"aria-hidden":"true"},null,8,ap),u("span",rp,h(a(e)("lines.main")),1),u("span",lp,h(a(e)("lines.mainHint")),1)],64)):(d(),c(ne,{key:1},[u("button",{type:"button",class:"lines-open","aria-label":a(e)("lines.openLine",{name:a(dt)(a(e),x,x.id)}),disabled:x.state.kind==="creation-failed",onClick:J=>m(x)},[u("span",{class:"lines-state","data-tone":f(x),"aria-hidden":"true"},null,8,cp),u("span",up,h(a(dt)(a(e),x,x.id)),1),u("span",pp,[x.cut!==null?(d(),c("span",hp,h(b(x))+" · ",1)):z("",!0),u("span",mp,h(a(kt)(x.id)),1),x.parentId!=="main"?(d(),c("span",vp," · "+h(a(e)("lines.from",{name:w(x)})),1)):z("",!0),u("span",null," · "+h(a(Pt)(a(e),x.state)),1)])],8,dp),v(x)?(d(),c("button",{key:0,type:"button",class:"ui-button lines-end","data-variant":"ghost","data-size":"xs","aria-label":a(e)("lines.endLine",{name:a(dt)(a(e),x,x.id)}),onClick:J=>I(x)},h(a(e)("lines.end")),9,fp)):z("",!0)],64))],8,ip))),128))],8,op)):(d(),c("div",sp,[u("span",np,[G(a(gt),{size:28})]),u("strong",null,h(a(e)("lines.emptyTitle")),1),u("p",null,h(a(e)("lines.emptyHint")),1)]))]))}}),bp=Re(gp,[["__scopeId","data-v-a371ceb3"]]),yp=["aria-label"],kp={class:"lines-tabs"},wp=["aria-label"],_p=["aria-selected"],Ip={class:"lines-tab-title"},$p={key:0,class:"ui-badge","data-size":"sm"},xp=["aria-selected","onClick"],Cp={class:"lines-tab-title"},Sp={class:"lines-tab-id"},Ep=["data-tone"],Mp=["aria-label","onClick"],Tp={class:"lines-tab-actions"},qp=["aria-label"],Ap=["aria-label"],Lp=["aria-label"],Rp={class:"lines-body"},Op={key:0,class:"lines-loading",role:"status"},Pp=_e({__name:"LinesPanel",props:{sessionId:{}},setup(s){const t=s,{t:e}=ye(),n=Ge(),o=Ve(),i=xt(),r=E(()=>n.views[t.sessionId]),l=E(()=>o.lineTabs[t.sessionId]??[]),m=E(()=>o.activeLineTab[t.sessionId]),v=E(()=>{var W;return((W=r.value)==null?void 0:W.lines.filter(O=>O.id!==ue).length)??0});function _(W){var O;return(O=r.value)==null?void 0:O.lines.find(j=>j.id===W)}function f(W){return dt(e,_(W),W)}function I(W){var j;if(((j=r.value)==null?void 0:j.approvals.some($=>$.branchId===W))===!0)return"warning";const O=_(W);return O===void 0?void 0:ms(O.state)}function b(W){var j,$;const O=(j=r.value)==null?void 0:j.branches[W];return(O==null?void 0:O.running)===!0||(($=r.value)==null?void 0:$.approvals.some(M=>M.branchId===W))===!0}function w(W){var j;const O=(j=_(W))==null?void 0:j.state.kind;return b(W)||O==="ending"||O==="ended"||O==="ended-itself"||O==="ended-by-operation"||O==="ended-with"||O==="creation-failed"}function k(){o.openLines(t.sessionId)}function C(W){n.ensureLine(t.sessionId,W),o.activateLine(t.sessionId,W)}function x(W){o.closeLineTab(t.sessionId,W)}function J(){var O;const W=(O=r.value)==null?void 0:O.lastTurnEnd;if(W===void 0){i.push({tone:"info",title:e("lines.noFinishedTurn")});return}o.requestNewLine({sessionId:t.sessionId,parentBranchId:ue,at:W,text:""})}function X(W){if(W.key!=="ArrowLeft"&&W.key!=="ArrowRight")return;const O=[void 0,...l.value],j=O.findIndex(M=>M===m.value),$=O[(j+(W.key==="ArrowRight"?1:-1)+O.length)%O.length];W.preventDefault(),$===void 0?k():C($)}return(W,O)=>{const j=ft("tooltip");return d(),c("div",{class:"lines-panel",role:"region","aria-label":a(e)("lines.panelAria")},[u("header",kp,[u("div",{class:"lines-tablist",role:"tablist","aria-label":a(e)("lines.title"),onKeydown:X},[u("button",{type:"button",class:je(["lines-tab",{"is-active":m.value===void 0}]),role:"tab","aria-selected":m.value===void 0,onClick:k},[G(a(uo),{size:14,"aria-hidden":"true"}),u("span",Ip,h(a(e)("lines.title")),1),v.value>0?(d(),c("span",$p,h(v.value),1)):z("",!0)],10,_p),(d(!0),c(ne,null,pe(l.value,$=>(d(),c("div",{key:$,class:je(["lines-tab-wrap",{"is-active":m.value===$}])},[u("button",{type:"button",class:"lines-tab",role:"tab","aria-selected":m.value===$,onClick:M=>C($)},[G(a(gt),{size:14,"aria-hidden":"true",class:je({"is-running":b($)})},null,8,["class"]),u("span",Cp,h(f($)),1),u("span",Sp,h(a(kt)($)),1),w($)?(d(),c("span",{key:0,class:"lines-tab-dot","data-tone":I($),"aria-hidden":"true"},null,8,Ep)):z("",!0)],8,xp),u("button",{type:"button",class:"lines-tab-close","aria-label":a(e)("lines.closeTab"),onClick:Ee(M=>x($),["stop"])},[G(a(yt),{size:12,"aria-hidden":"true"})],8,Mp)],2))),128))],40,wp),u("div",Tp,[Ne((d(),c("button",{type:"button",class:"ui-icon-button","data-variant":"ghost","data-size":"sm","aria-label":a(e)("lines.newLine"),onClick:J},[G(a(ls),{"aria-hidden":"true"})],8,qp)),[[j,a(e)("lines.newLine")]]),Ne((d(),c("button",{type:"button",class:"ui-icon-button","data-variant":"ghost","data-size":"sm","aria-label":a(o).detailExpanded?a(e)("lines.collapse"):a(e)("lines.expand"),onClick:O[0]||(O[0]=$=>a(o).detailExpanded=!a(o).detailExpanded)},[a(o).detailExpanded?(d(),ae(a(ho),{key:0,"aria-hidden":"true"})):(d(),ae(a(po),{key:1,"aria-hidden":"true"}))],8,Ap)),[[j,a(o).detailExpanded?a(e)("lines.collapse"):a(e)("lines.expand")]]),Ne((d(),c("button",{type:"button",class:"ui-icon-button","data-variant":"ghost","data-size":"sm","aria-label":a(e)("lines.closePanel"),onClick:O[1]||(O[1]=(...$)=>a(o).closeDetail&&a(o).closeDetail(...$))},[G(a(yt),{"aria-hidden":"true"})],8,Lp)),[[j,a(e)("lines.closePanel")]])])]),u("div",Rp,[!r.value||r.value.status==="loading"?(d(),c("div",Op,h(a(e)("common.loading")),1)):m.value===void 0?(d(),ae(bp,{key:1,"session-id":s.sessionId},null,8,["session-id"])):(d(),ae(ep,{key:m.value,"session-id":s.sessionId,"branch-id":m.value},null,8,["session-id","branch-id"]))])],8,yp)}}}),zp=Re(Pp,[["__scopeId","data-v-7751cb0a"]]),Dp={class:"ui-dialog-header"},Np={class:"ui-dialog-icon","data-tone":"primary"},jp={class:"ui-dialog-title"},Bp={class:"ui-dialog-description"},Fp={class:"new-line-cut"},Wp=["aria-label"],Vp={class:"new-line-label",for:"new-line-prompt"},Up=["placeholder"],Hp={key:0,class:"ui-banner","data-tone":"danger",role:"alert"},Kp={class:"ui-dialog-footer"},Qp=["disabled"],Gp=["disabled"],Jp=_e({__name:"NewLineDialog",setup(s){const{t}=ye(),e=Ge(),n=Ve(),o=P(),i=P(""),r=P(""),l=P(!1),m=E(()=>n.newLine),v=E(()=>{var C;const w=m.value;if(w===void 0)return"";if(w.parentBranchId===ue)return t("lines.main");const k=(C=e.views[w.sessionId])==null?void 0:C.lines.find(x=>x.id===w.parentBranchId);return k===void 0?kt(w.parentBranchId):dt(t,k,w.parentBranchId)}),_=E(()=>{var C;const w=m.value;if(w===void 0)return"";const k=w.before??((C=w.text.split(`
|
|
251
|
+
`)[0])==null?void 0:C.trim())??"";return k===""?t("lines.atEnd"):t("lines.beforeMessage",{message:k})});function f(){var w;i.value=((w=m.value)==null?void 0:w.text)??"",r.value="",l.value=!1}$e(m,f,{immediate:!0}),ot(()=>{var w;return(w=o.value)==null?void 0:w.showModal()});function I(){var w;(w=o.value)==null||w.close()}async function b(){const w=m.value;if(w===void 0||l.value)return;const k=i.value.trim();if(k===""){r.value=t("lines.promptRequired");return}l.value=!0,r.value="";try{const C=await e.createLine(w.sessionId,w.parentBranchId,w.at,k);n.openLine(w.sessionId,C),I()}catch(C){r.value=C instanceof Error?C.message:String(C)}finally{l.value=!1}}return(w,k)=>(d(),c("dialog",{ref_key:"dialog",ref:o,class:"ui-dialog","data-size":"md",onCancel:Ee(I,["prevent"]),onClose:k[1]||(k[1]=C=>a(n).closeNewLine())},[m.value?(d(),c("form",{key:0,onSubmit:Ee(b,["prevent"])},[u("header",Dp,[u("span",Np,[G(a(gt),{size:16,"aria-hidden":"true"})]),u("div",null,[u("h2",jp,h(a(t)("lines.newLineTitle")),1),u("p",Bp,[be(h(a(t)("lines.newLineFrom",{name:v.value})),1),k[2]||(k[2]=u("br",null,null,-1)),u("span",Fp,h(_.value),1)])]),u("button",{type:"button",class:"ui-icon-button ui-dialog-close","data-variant":"close","data-size":"sm","aria-label":a(t)("common.close"),onClick:I},[...k[3]||(k[3]=[u("span",{"aria-hidden":"true"},"×",-1)])],8,Wp)]),u("label",Vp,h(a(t)("lines.promptLabel")),1),Ne(u("textarea",{id:"new-line-prompt","onUpdate:modelValue":k[0]||(k[0]=C=>i.value=C),class:"ui-field new-line-input",rows:"4",placeholder:a(t)("lines.promptPlaceholder"),autofocus:""},null,8,Up),[[At,i.value]]),r.value?(d(),c("p",Hp,h(r.value),1)):z("",!0),u("footer",Kp,[u("button",{type:"button",class:"ui-button","data-variant":"ghost","data-size":"md",disabled:l.value,onClick:I},h(a(t)("common.cancel")),9,Qp),u("button",{type:"submit",class:"ui-button","data-variant":"primary","data-size":"md",disabled:l.value||i.value.trim()===""},h(l.value?a(t)("common.loading"):a(t)("lines.create")),9,Gp)])],32)):z("",!0)],544))}}),Yp=Re(Jp,[["__scopeId","data-v-dd14ac7e"]]),Xp=["data-mode","data-sidebar-collapsed","data-chat-route","data-settings-route"],Zp={key:0,class:"compact-header"},eh=["aria-label"],th={class:"compact-title"},sh={class:"sr-only"},nh=["aria-label"],oh=["data-has-detail","data-detail-expanded"],ih=["aria-label"],ah=["aria-label"],rh={key:1,class:"main-header"},lh={key:2,class:"reconnect-banner",role:"status"},dh=["aria-label","aria-valuenow"],ch=["aria-label"],tn="details.session-menu[open], details.composer-popover[open]",uh=_e({__name:"AppShell",setup(s){const t=Vt(),{t:e}=ye(),{t:n}=ye({messages:cs}),o=Ce(),i=Ke(),r=Ve(),l=P(),m=P();let v;const _=E(()=>t.path==="/settings"||t.path.startsWith("/settings/")),f=E(()=>t.name==="chat-new"||t.name==="chat-session"),I=E(()=>typeof t.params.sessionId=="string"?t.params.sessionId:void 0),b=E(()=>r.detailOpen&&t.name==="chat-session"&&I.value!==void 0),w=E(()=>{if(_.value)return n("settings");if(t.name==="chat-session"&&typeof t.params.sessionId=="string"){const O=i.byId.get(t.params.sessionId);return(O==null?void 0:O.title)??(O==null?void 0:O.preview)??(O===void 0?e("route.session"):Gt(O.cwd))}return t.name==="not-found"?e("route.notFound"):e("route.newSession")});$e(w,O=>{document.title=`${O} — Dim`},{immediate:!0}),$e(()=>r.drawerOpen,async O=>{await He();const j=m.value;j!==void 0&&(O&&!j.open?j.showModal():!O&&j.open&&j.close())});function k(O){const j=O.target instanceof Node?O.target:void 0;for(const $ of document.querySelectorAll(tn))(j===void 0||!$.contains(j))&&($.open=!1)}function C(O){if(O.key==="Escape"){for(const $ of document.querySelectorAll(tn))$.open=!1;return}(navigator.userAgent.includes("Mac")?O.metaKey:O.ctrlKey)&&!O.altKey&&!O.shiftKey&&O.key.toLowerCase()==="b"&&(O.preventDefault(),r.shellMode==="compact"?r.drawerOpen=!r.drawerOpen:r.sidebarCollapsed=!r.sidebarCollapsed)}function x(){o.phase==="connected"&&i.refresh()}ot(()=>{l.value!==void 0&&(v=new ResizeObserver(([O])=>{O!==void 0&&r.setShellWidth(O.contentRect.width)}),v.observe(l.value)),window.addEventListener("keydown",C),window.addEventListener("focus",x),document.addEventListener("pointerdown",k,!0)}),it(()=>{v==null||v.disconnect(),window.removeEventListener("keydown",C),window.removeEventListener("focus",x),document.removeEventListener("pointerdown",k,!0)});function J(O){O.target===m.value&&(r.drawerOpen=!1)}function X(O){if(r.shellMode==="compact")return;const j=O.clientX,$=r.detailWidth,M=V=>{r.setDetailWidth($+j-V.clientX)},T=()=>{window.removeEventListener("pointermove",M),window.removeEventListener("pointerup",T)};window.addEventListener("pointermove",M),window.addEventListener("pointerup",T,{once:!0})}function W(O){r.setDetailWidth(r.detailWidth+O)}return(O,j)=>{var M;const $=ft("tooltip");return d(),c("div",{ref_key:"root",ref:l,class:"app-shell","data-mode":a(r).shellMode,"data-sidebar-collapsed":a(r).sidebarCollapsed,"data-chat-route":f.value,"data-settings-route":_.value,style:{"--sidebar-width":"280px"}},[G(Ya),a(r).shellMode==="compact"&&!_.value?(d(),c("header",Zp,[u("button",{class:"ui-icon-button","data-variant":"ghost","data-size":"md",type:"button","aria-label":a(e)("sidebar.openMenu"),onClick:j[0]||(j[0]=T=>a(r).drawerOpen=!0)},[G(a(rn),{"aria-hidden":"true"})],8,eh),u("span",th,h(w.value),1)])):z("",!0),a(r).shellMode==="compact"?(d(),c("dialog",{key:1,ref_key:"drawer",ref:m,class:"drawer-content",onClick:J,onClose:j[3]||(j[3]=T=>a(r).drawerOpen=!1)},[u("h2",sh,h(a(e)("sidebar.workspaces")),1),u("button",{autofocus:"",class:"ui-icon-button drawer-close","data-variant":"ghost","data-size":"md",type:"button","aria-label":a(e)("sidebar.closeMenu"),onClick:j[1]||(j[1]=T=>a(r).drawerOpen=!1)},[G(a(yt),{"aria-hidden":"true"})],8,nh),G(Vs,{onNavigate:j[2]||(j[2]=T=>a(r).drawerOpen=!1)})],544)):z("",!0),a(r).shellMode!=="compact"&&!a(r).sidebarCollapsed&&!_.value?(d(),ae(Vs,{key:2,class:"inline-sidebar"})):z("",!0),u("div",{class:"content-region","data-has-detail":b.value,"data-detail-expanded":a(r).detailExpanded,style:Mt({"--detail-width":`${a(r).detailWidth}px`})},[u("main",{id:"main",class:"main-region","aria-label":a(e)("a11y.mainContent"),onPointerdown:j[5]||(j[5]=T=>a(r).detailFocused=!1),onFocusin:j[6]||(j[6]=T=>a(r).detailFocused=!1)},[a(r).sidebarCollapsed&&a(r).shellMode!=="compact"&&!_.value?Ne((d(),c("button",{key:0,class:"ui-icon-button sidebar-reopen","data-variant":"ghost","data-size":"md",type:"button","aria-label":a(e)("sidebar.openMenu"),onClick:j[4]||(j[4]=T=>a(r).sidebarCollapsed=!1)},[G(a(vo),{"aria-hidden":"true"})],8,ah)),[[$,a(e)("sidebar.openMenu")]]):z("",!0),_.value?z("",!0):(d(),c("header",rh,[u("div",null,[u("p",null,"Dim "+h((M=a(o).hello)==null?void 0:M.serverVersion),1),u("strong",null,h(w.value),1)])])),a(o).phase==="reconnecting"?(d(),c("p",lh,h(a(e)("page.reconnecting")),1)):z("",!0),(d(),ae(a(Kn),{key:_.value?"settings":a(t).fullPath}))],40,ih),b.value?(d(),c("div",{key:0,class:"detail-resizer",role:"separator","aria-orientation":"vertical","aria-label":a(e)("lines.resize"),"aria-valuenow":a(r).detailWidth,"aria-valuemin":320,"aria-valuemax":720,tabindex:"0",onPointerdown:Ee(X,["prevent"]),onKeydown:[j[7]||(j[7]=Cs(Ee(T=>W(-16),["prevent"]),["left"])),j[8]||(j[8]=Cs(Ee(T=>W(16),["prevent"]),["right"]))]},null,40,dh)):z("",!0),b.value&&I.value?(d(),c("aside",{key:1,class:"detail-region","data-active":"true","aria-label":a(r).extension?void 0:a(e)("lines.panelAria"),onPointerdown:j[9]||(j[9]=T=>a(r).detailFocused=!0),onFocusin:j[10]||(j[10]=T=>a(r).detailFocused=!0)},[a(r).extension?(d(),ae(kr,{key:0,"session-id":I.value},null,8,["session-id"])):(d(),ae(zp,{key:1,"session-id":I.value},null,8,["session-id"]))],40,ch)):z("",!0)],12,oh),a(r).newLine?(d(),ae(Yp,{key:3})):z("",!0),a(r).endingLine?(d(),ae(lr,{key:4})):z("",!0)],8,Xp)}}}),ph={class:"skip-link",href:"#main"},hh={key:1,id:"main",class:"boot-page",tabindex:"-1","aria-busy":"true"},mh={class:"sr-only"},vh={key:2,id:"main",class:"auth-page",tabindex:"-1"},fh={class:"eyebrow"},gh={key:0},bh={key:1},yh=_e({__name:"AppRoot",setup(s){const{t}=ye(),e=Ce(),n=E(()=>e.everConnected&&e.phase!=="unauthenticated"&&e.phase!=="version-mismatch"),o=E(()=>e.phase==="unauthenticated"?t("auth.expiredTitle"):e.phase==="version-mismatch"?t("auth.versionTitle"):t("auth.connectingTitle"));return $e([n,o],([i,r])=>{i||(document.title=`${r} — Dim`)},{immediate:!0}),(i,r)=>(d(),c(ne,null,[u("a",ph,h(a(t)("common.skipToContent")),1),n.value?(d(),ae(uh,{key:0})):a(e).phase==="connecting"||a(e).phase==="reconnecting"?(d(),c("main",hh,[G(Kt,{animated:"",class:"boot-mark"}),u("h1",mh,h(o.value),1)])):(d(),c("main",vh,[r[1]||(r[1]=u("span",{class:"auth-signal","aria-hidden":"true"},null,-1)),u("p",fh,h(a(t)("brand.webHost")),1),u("h1",null,h(o.value),1),a(e).phase==="unauthenticated"?(d(),c("p",gh,[be(h(a(t)("auth.expiredBefore")),1),r[0]||(r[0]=u("code",null,"dimcode web",-1)),be(h(a(t)("auth.expiredAfter")),1)])):(d(),c("p",bh,h(a(t)("auth.versionDescription")),1))]))],64))}}),kh=400,wh=300,sn=6,ts=8,ys="ui-tooltip";let Fe,nt,qt,zn=0,as=null,ks=!1;function _h(){return Fe!==void 0||(Fe=document.createElement("div"),Fe.id=ys,Fe.className="ui-tooltip",Fe.setAttribute("role","tooltip"),Fe.popover="manual",Object.assign(Fe.style,{position:"fixed",inset:"auto",margin:"0",border:"0",overflow:"visible"}),document.body.append(Fe)),Fe}function Ft(s){clearTimeout(qt);const t=s._tooltip;if(!t||!s.isConnected)return;const e=_h();e.textContent=t,e.matches(":popover-open")||e.showPopover(),nt=s,s.getAttribute("aria-label")!==t&&s.setAttribute("aria-describedby",ys),Ih(s,e)}function Ih(s,t){const e=s.getBoundingClientRect(),n=t.getBoundingClientRect(),o=e.top-sn-n.height,i=o>=ts?o:e.bottom+sn,r=e.left+e.width/2-n.width/2,l=Math.min(Math.max(r,ts),window.innerWidth-ts-n.width);t.style.left=`${Math.round(l)}px`,t.style.top=`${Math.round(i)}px`}function pt(){clearTimeout(qt),qt=void 0,nt!==void 0&&(nt.getAttribute("aria-describedby")===ys&&nt.removeAttribute("aria-describedby"),nt=void 0,Fe!=null&&Fe.matches(":popover-open")&&Fe.hidePopover())}function $h(s){const t=s.currentTarget;clearTimeout(qt),!ks&&(performance.now()<zn?Ft(t):qt=setTimeout(()=>Ft(t),kh))}function xh(){nt!==void 0&&(zn=performance.now()+wh),pt()}function Ch(s){const t=s.currentTarget;if(t===as){as=null;return}t.matches(":focus-visible")&&Ft(t)}function Sh(s){ks=s.pointerType==="touch",nt!==void 0&&!(s.target instanceof Node&&nt.contains(s.target))&&pt()}function Eh(){as=document.activeElement,pt()}function Mh(s){s.key==="Escape"&&pt()}const nn=[["mouseenter",$h],["mouseleave",xh],["focus",Ch],["blur",pt],["pointerdown",pt],["keydown",Mh]];let on=!1;function Th(){on||(on=!0,window.addEventListener("scroll",pt,{capture:!0,passive:!0}),window.addEventListener("blur",Eh),document.addEventListener("pointermove",Sh,{passive:!0}),document.addEventListener("pointerdown",s=>{ks=s.pointerType==="touch"},{capture:!0,passive:!0}))}const qh={mounted(s,t){s._tooltip=t.value;for(const[e,n]of nn)s.addEventListener(e,n);Th()},updated(s,t){s._tooltip=t.value,nt===s&&(t.value?Ft(s):pt())},beforeUnmount(s){nt===s&&pt();for(const[t,e]of nn)s.removeEventListener(t,e)}},Ah=["aria-label"],Lh={class:"queued-title"},Rh={class:"queued-list"},Oh={class:"queued-index"},Ph={class:"queued-text"},zh=["disabled","onClick"],Dh=["disabled","onClick"],Nh=_e({__name:"QueuedInputs",props:{sessionId:{},items:{}},setup(s){const t=s,{t:e}=ye(),n=Ge(),o=xt(),i=P(!1);async function r(l,m){if(!i.value){i.value=!0;try{(await n.withdrawInput(t.sessionId,l.id,m?l.user:void 0)).status==="notHeld"&&o.push({tone:"info",title:e("queue.notHeld")})}catch(v){o.push({tone:"danger",title:e("command.failed"),description:v instanceof Error?v.message:String(v)})}finally{i.value=!1}}}return(l,m)=>(d(),c("section",{class:"queued-inputs","aria-label":a(e)("queue.title")},[u("h2",Lh,h(a(e)("queue.title")),1),u("ol",Rh,[(d(!0),c(ne,null,pe(s.items,(v,_)=>(d(),c("li",{key:v.id,class:"queued-item"},[u("span",Oh,h(_+1),1),u("span",Ph,h(v.text),1),(d(!0),c(ne,null,pe(v.skills,f=>(d(),c("span",{key:f,class:"queued-skill"},h(a(e)("message.skillLoaded",{name:f})),1))),128)),(d(!0),c(ne,null,pe(v.hooks??0,f=>(d(),c("span",{key:f,class:"queued-hook"},h(a(e)("message.hookContext")),1))),128)),_===0?(d(),c("button",{key:0,type:"button",class:"ui-button","data-size":"sm","data-variant":"secondary",disabled:i.value,onClick:f=>r(v,!0)},h(a(e)("queue.steer")),9,zh)):z("",!0),u("button",{type:"button",class:"ui-button","data-size":"sm","data-variant":"ghost",disabled:i.value,onClick:f=>r(v,!1)},h(a(e)("queue.remove")),9,Dh)]))),128))])],8,Ah))}}),jh=Re(Nh,[["__scopeId","data-v-d5573dbb"]]),Bh={class:"extension-picker"},Fh={class:"sr-only"},Wh=["aria-label","title","disabled","value"],Vh={value:""},Uh=["value","disabled"],Hh={key:0,role:"status"},Kh=_e({__name:"ExtensionMenu",props:{sessionId:{}},setup(s){const t=s,{t:e,locale:n}=ye({messages:En}),o=Tt(),i=Ve(),r=Ce(),l=P(),m=P("");let v=0;const _=E(()=>{var b;return(((b=o.directory)==null?void 0:b.extensions)??[]).flatMap(w=>w.panels.map(k=>({extension:w,panel:k,reason:r.phase!=="connected"?e("disconnected"):k.methods.length&&l.value===void 0?m.value||e("checking"):Cn(k,r.supports,l.value??[])}))).sort((w,k)=>w.extension.pluginName.localeCompare(k.extension.pluginName)||w.panel.id.localeCompare(k.panel.id))});async function f(){const b=++v;if(l.value=void 0,m.value="",!(!t.sessionId||r.phase!=="connected"||!_.value.some(({panel:w})=>w.methods.length)))try{const w=await r.client.call("session.methods",{sessionId:t.sessionId},us);b===v&&(l.value=w)}catch(w){b===v&&(m.value=w instanceof Error?w.message:String(w))}}$e([()=>t.sessionId,()=>r.phase,()=>{var b;return(b=o.directory)==null?void 0:b.revision}],f,{immediate:!0}),it(()=>{v++});function I(b){const w=b.target.value,k=_.value.find(C=>JSON.stringify([C.extension.pluginName,C.panel.id])===w);k===void 0||k.reason||(i.extension={pluginName:k.extension.pluginName,panelId:k.panel.id},i.detailExpanded=!1,i.detailOpen=!0,i.detailFocused=!0)}return(b,w)=>{var k;return d(),c("label",Bh,[u("span",Fh,h(a(e)("extensions")),1),u("select",{"data-extension-trigger":"","aria-label":a(e)("extensions"),title:s.sessionId?a(e)("choose"):a(e)("session"),disabled:!s.sessionId,value:a(i).extension&&a(i).detailOpen?JSON.stringify([a(i).extension.pluginName,a(i).extension.panelId]):"",onFocus:f,onChange:I},[u("option",Vh,h(_.value.length?a(e)("choose"):a(e)("empty")),1),(d(!0),c(ne,null,pe(_.value,({extension:C,panel:x,reason:J})=>(d(),c("option",{key:JSON.stringify([C.pluginName,x.id]),value:JSON.stringify([C.pluginName,x.id]),disabled:!!J},h(a(Sn)(x,a(n)))+" · "+h(C.pluginName)+h(J?` — ${J}`:""),9,Uh))),128)),(d(!0),c(ne,null,pe((k=a(o).directory)==null?void 0:k.errors,C=>(d(),c("option",{key:C.pluginName,disabled:""},h(C.pluginName)+": "+h(C.message),1))),128))],40,Wh),a(o).error?(d(),c("span",Hh,h(a(o).error),1)):z("",!0)])}}}),Dn=Re(Kh,[["__scopeId","data-v-9c4c5caa"]]);function Qh(s){const t=s.trim();if(t==="")return{form:"show"};const e=t.search(/\s/),n=e===-1?t:t.slice(0,e),o=e===-1?"":t.slice(e).trim();switch(n){case"pause":case"resume":case"clear":if(o==="")return{form:n};break;case"set":case"edit":return o===""?void 0:{form:n,objective:o}}return{form:"objective",objective:t}}function Gh(s){switch(s.form){case"show":case"pause":case"resume":case"clear":return;default:return s.objective}}function Jh(s,t){switch(s.form){case"show":return;case"objective":return t!==void 0&&(t.status.kind==="active"||t.status.kind==="paused")?"edit":"set";default:return s.form}}const Yh={key:0,class:"removed-state route-page"},Xh={"data-route-heading":"",tabindex:"-1"},Zh={key:1,class:"removed-state route-page"},em={"data-route-heading":"",tabindex:"-1"},tm={role:"alert"},sm={key:2,class:"chat-loading","aria-busy":"true"},nm={class:"sr-only"},om={key:3,class:"chat-page"},im={class:"chat-page-top"},am={class:"session-header"},rm=["aria-label"],lm={class:"session-heading"},dm=["title"],cm=["title"],um=["aria-label"],pm=["data-tone"],hm={key:2,class:"ui-badge session-running","data-tone":"primary"},mm={key:0,class:"session-relations"},vm={key:0,class:"composer-panel"},fm={key:1,class:"composer-panel"},gm={key:2,class:"composer-panel question-prompts"},bm=_e({__name:"ChatPage",props:{sessionId:{}},setup(s){const t=s,{t:e}=ye(),n=Jt(),o=Ge(),i=Ce(),r=Ke(),l=Ve(),m=xt(),v=Ut(),_=P();$e(()=>t.sessionId,R=>o.open(R),{immediate:!0});const f=E(()=>o.views[t.sessionId]),I=E(()=>r.byId.get(t.sessionId)),b=E(()=>{var R,Z;return((R=I.value)==null?void 0:R.title)??((Z=I.value)==null?void 0:Z.preview)??e("sidebar.untitled")}),w=E(()=>{var R;return(R=I.value)==null?void 0:R.parentSessionId}),k=E(()=>w.value===void 0?void 0:r.byId.get(w.value)),C=E(()=>r.summaries.filter(R=>R.parentSessionId===t.sessionId)),x=E(()=>{var R;return(R=f.value)==null?void 0:R.approvals.find(Z=>Z.branchId===ue)}),J=E(()=>{var R;return((R=f.value)==null?void 0:R.questions.filter(Z=>Z.branchId===ue))??[]}),X=E(()=>i.supports("permission.rules")&&i.supports("permission.set_rules")),W=E(()=>{var R;return((R=f.value)==null?void 0:R.methods.includes("attachment.put"))===!0}),O=E(()=>{var R;return(R=f.value)!=null&&R.methods.includes("session.files.search")?Z=>o.searchFiles(t.sessionId,Z):void 0}),j=E(()=>{const R=f.value;if(!((R==null?void 0:R.status)!=="ready"||!R.methods.includes("session.permission.get")||!R.methods.includes("session.permission.update")))return{policy:R.permission,select:at}}),$=E(()=>{var R;return l.approvalKeyboard(t.sessionId,ue,((R=f.value)==null?void 0:R.approvals)??[])}),M=P(),T=E(()=>{var R;return((R=f.value)==null?void 0:R.lines.filter(Z=>Z.id!==ue).length)??0}),V=E(()=>{var Z,p;const R=((Z=f.value)==null?void 0:Z.approvals)??[];return((p=f.value)==null?void 0:p.lines.some(g=>g.id!==ue&&(g.state.kind==="working"||R.some(y=>y.branchId===g.id))))??!1}),se=E(()=>{var R;return i.supports("session.branch_end")&&((R=f.value)==null?void 0:R.status)==="ready"}),de=E(()=>{var R;return i.supports("session.branch_create")&&((R=f.value)==null?void 0:R.status)==="ready"}),ge=E(()=>{var p,g,y;const R=(p=f.value)==null?void 0:p.model;if(R===void 0)return;const Z=(y=(g=n.providers)==null?void 0:g.find(q=>q.providerId===R.providerId))==null?void 0:y.models.find(q=>q.id===R.modelId);return Z==null?void 0:Z.reasoningEfforts});$e(()=>{var R;return(R=f.value)==null?void 0:R.status},R=>{R==="ready"&&n.load()},{immediate:!0});const Y=E(()=>{const R=f.value;if((R==null?void 0:R.status)==="ready")return{compact:R.methods.includes("session.context.compact")?qe:void 0,usage:R.methods.includes("session.context.usage")?Je:void 0,fork:i.supports("session.fork")&&R.lastTurnEnd!==void 0?ht:void 0,goal:R.methods.includes("session.goal.set")?Ue:void 0,effort:ge.value!==void 0&&ge.value.length>0?Be:void 0}});function le(R,Z){return o.submit(t.sessionId,ue,R,Z)}function D(){return o.stop(t.sessionId,ue)}function L(R){return o.setModel(t.sessionId,R)}function K(R){o.ensureLine(t.sessionId,R),l.openLine(t.sessionId,R)}function me(R,Z){l.requestNewLine({sessionId:t.sessionId,parentBranchId:ue,at:Z,text:R})}async function F(R){var g;const Z=(g=f.value)==null?void 0:g.lastTurnEnd;if(Z===void 0)throw new Error(e("lines.noFinishedTurn"));const p=await o.createLine(t.sessionId,ue,Z,R);l.openLine(t.sessionId,p)}function ce(R){m.push({tone:"danger",title:e("command.failed"),description:R instanceof Error?R.message:String(R)})}async function qe(){try{const R=await o.compact(t.sessionId);R.status==="completed"?m.push({tone:"success",title:e("command.compacted")}):m.push({tone:"info",title:e("command.compactSkipped"),description:R.reason})}catch(R){ce(R)}}function Ze(R){const Z=Math.round(R.estimatedInputTokens),p=Math.round(R.contextWindow);return e("command.usage",{input:Z.toLocaleString(),window:p.toLocaleString(),percent:p>0?Math.floor(Z*100/p):0,basis:R.baselineSource==="provider_baseline"?e("command.basisProvider"):e("command.basisEstimated"),output:Math.round(R.outputTokens).toLocaleString(),threshold:Math.round(R.thresholdTokens).toLocaleString()})}async function Je(){try{m.push({tone:"info",title:e("command.usageTitle"),description:Ze(await o.usage(t.sessionId))})}catch(R){ce(R)}}function tt(R){switch(R.kind){case"active":return e("goal.status.active");case"paused":return e("goal.status.paused",{reason:R.reason.replaceAll("_"," ")});case"completed":return e("goal.status.completed");case"blocked":return e("goal.status.blocked");case"none":return e("goal.status.none")}}function ze(R){if(R===void 0){m.push({tone:"info",title:e("goal.none")});return}m.push({tone:"info",title:`${e("goal.line",{status:tt(R.status)})}${R.evaluator?` · ${e("goal.evaluator")}`:""}`,description:R.objective})}async function Ue(R){var y;const Z=Qh(R);if(Z===void 0){m.push({tone:"info",title:e("goal.usage")});return}const p=(y=f.value)==null?void 0:y.goal,g=Jh(Z,p);if(g===void 0){ze(p);return}try{await o.writeGoal(t.sessionId,g,Gh(Z)),m.push({tone:"success",title:e("goal.sent",{action:e(`goal.action.${g}`)})})}catch(q){ce(q)}}async function Be(R){const Z=ge.value,p=R.trim();if(Z===void 0){m.push({tone:"info",title:e("command.effortUnavailable")});return}if(p===""){m.push({tone:"info",title:e("command.effortChoices",{choices:Z.join(", ")})});return}if(/\s/.test(p)){m.push({tone:"info",title:e("command.effortUsage")});return}if(!Z.includes(p)){m.push({tone:"danger",title:e("command.effortUnknown")});return}try{const g=await o.setEffort(t.sessionId,p);m.push({tone:"success",title:e("command.effortSet",{outcome:g,value:p})})}catch(g){ce(g)}}async function at(R){try{await o.setPermission(t.sessionId,R)==="conflict"&&m.push({tone:"info",title:e("permission.conflict")})}catch(Z){ce(Z)}}async function ht(){var Z,p;const R=(Z=f.value)==null?void 0:Z.lastTurnEnd;if(R!==void 0&&await((p=_.value)==null?void 0:p.open(e("fork.confirm"),{confirmLabel:e("fork.confirmLabel")})))try{const g=await o.fork(t.sessionId,R);r.refresh(),await v.push({name:"chat-session",params:{sessionId:g}})}catch(g){ce(g)}}return(R,Z)=>{var p,g;return((p=f.value)==null?void 0:p.status)==="closed"?(d(),c("section",Yh,[u("h1",Xh,h(a(e)("chat.removedTitle")),1),u("p",null,h(a(e)("chat.removedDescription")),1),G(a(ut),{to:"/chat/new"},{default:We(()=>[be(h(a(e)("sidebar.newSession")),1)]),_:1})])):((g=f.value)==null?void 0:g.status)==="failed"?(d(),c("section",Zh,[u("h1",em,h(b.value),1),u("p",tm,h(f.value.error),1)])):!f.value||f.value.status==="loading"?(d(),c("section",sm,[u("h1",nm,h(a(e)("route.session")),1),G(Kt,{animated:"",class:"boot-mark"}),u("p",null,h(a(e)("common.loading")),1)])):(d(),c("section",om,[G(An,{ref_key:"forkConfirm",ref:_},null,512),u("div",im,[u("header",am,[a(l).shellMode==="compact"?(d(),c("button",{key:0,class:"ui-icon-button session-nav","data-variant":"ghost","data-size":"md",type:"button","aria-label":a(e)("sidebar.openMenu"),onClick:Z[0]||(Z[0]=y=>a(l).drawerOpen=!0)},[G(a(rn),{"aria-hidden":"true"})],8,rm)):z("",!0),u("div",lm,[I.value?(d(),c(ne,{key:0},[u("span",{class:"workspace-crumb",title:I.value.cwd},h(a(Gt)(I.value.cwd)),9,dm),Z[4]||(Z[4]=u("span",{class:"workspace-crumb-separator","aria-hidden":"true"},"/",-1))],64)):z("",!0),u("h1",{"data-route-heading":"",tabindex:"-1",title:b.value},h(b.value),9,cm)]),G(Dn,{"session-id":s.sessionId},null,8,["session-id"]),a(i).supports("session.branch_end")?(d(),c("button",{key:1,class:"ui-button session-lines","data-variant":"ghost","data-size":"sm",type:"button","aria-label":a(e)("lines.open"),onClick:Z[1]||(Z[1]=y=>a(l).toggleLines(s.sessionId))},[G(a(gt),{"aria-hidden":"true"}),u("span",null,h(a(e)("lines.title")),1),T.value>0?(d(),c("span",{key:0,class:"ui-badge","data-size":"sm","data-tone":V.value?"warning":void 0},h(T.value),9,pm)):z("",!0)],8,um)):z("",!0),f.value.sessionRunning?(d(),c("span",hm,[Z[5]||(Z[5]=u("span",{class:"status-dot","data-state":"running","aria-hidden":"true"},null,-1)),be(h(a(e)(f.value.stopping?"status.stopping":"status.running")),1)])):z("",!0)]),w.value||C.value.length?(d(),c("div",mm,[w.value?(d(),ae(a(ut),{key:0,to:{name:"chat-session",params:{sessionId:w.value}}},{default:We(()=>{var y,q;return[be(h(a(e)("session.parent",{title:((y=k.value)==null?void 0:y.title)??((q=k.value)==null?void 0:q.preview)??w.value})),1)]}),_:1},8,["to"])):z("",!0),C.value.length?(d(),c("details",{key:s.sessionId},[u("summary",null,h(a(e)("session.children",{count:C.value.length})),1),u("ul",null,[(d(!0),c(ne,null,pe(C.value,y=>(d(),c("li",{key:y.sessionId},[G(a(ut),{to:{name:"chat-session",params:{sessionId:y.sessionId}}},{default:We(()=>[be(h(y.title??y.preview??y.sessionId),1)]),_:2},1032,["to"])]))),128))])])):z("",!0)])):z("",!0)]),G(Pn,{rows:f.value.rows,earlier:f.value.earlier,"loading-earlier":f.value.loadingEarlier,"history-error":f.value.historyError,onEarlier:Z[2]||(Z[2]=y=>a(o).loadEarlier(s.sessionId,"main")),running:f.value.running,retry:f.value.retry,quotable:!x.value&&J.value.length===0,branchable:se.value&&!x.value&&J.value.length===0,onBranch:me,onOpenLine:K,onQuote:Z[3]||(Z[3]=y=>{var q;return(q=M.value)==null?void 0:q.quote(y)})},null,8,["rows","earlier","loading-earlier","history-error","running","retry","quotable","branchable"]),f.value.running&&f.value.queued.length?(d(),c("div",vm,[G(jh,{"session-id":s.sessionId,items:f.value.queued},null,8,["session-id","items"])])):z("",!0),x.value?(d(),c("div",fm,[(d(),ae(Tn,{key:JSON.stringify([x.value.branchId,x.value.requestId]),"session-id":s.sessionId,request:x.value,keyboard:$.value,"rules-available":X.value},null,8,["session-id","request","keyboard","rules-available"]))])):J.value.length?(d(),c("div",gm,[(d(!0),c(ne,null,pe(J.value,y=>(d(),ae(Ln,{key:JSON.stringify([y.branchId,y.requestId,y.callId]),"session-id":s.sessionId,question:y},null,8,["session-id","question"]))),128))])):(d(),ae(gs,{key:3,ref_key:"composer",ref:M,running:f.value.running,stopping:f.value.stopping,model:f.value.model,send:le,"stores-pastes":W.value,"search-files":O.value,permission:j.value,stop:D,"model-selectable":a(i).supports("session.model.update"),"select-model":L,"create-branch":de.value?F:void 0,"open-lines":se.value?()=>a(l).openLines(s.sessionId):void 0,"session-commands":Y.value},null,8,["running","stopping","model","stores-pastes","search-files","permission","model-selectable","create-branch","open-lines","session-commands"]))]))}}}),ym=Re(bm,[["__scopeId","data-v-af9bf5bd"]]),km={class:"new-session-page"},wm={class:"new-session-hero"},_m={"data-route-heading":"",tabindex:"-1"},Im={class:"ui-button","data-variant":"ghost","data-size":"xs","data-trailing":""},$m={class:"workspace-trigger-label"},xm={class:"composer-popover-content workspace-menu-content ui-popover","data-width":"lg"},Cm=["placeholder","aria-label"],Sm=["disabled"],Em={key:0,class:"ui-menu-separator"},Mm=["aria-label"],Tm=["aria-selected","onClick"],qm={class:"ui-menu-desc workspace-path"},Am=_e({__name:"NewSessionPage",setup(s){const{t}=ye(),e=Vt(),n=Ut(),o=Ke(),i=Ge(),r=Jt(),l=P(),m=P(typeof e.query.cwd=="string"?e.query.cwd:""),v=P("");$e(()=>o.workspaces,C=>{m.value===""&&C[0]!==void 0&&(m.value=C[0].cwd)},{immediate:!0});const _=P(),f=P();$e(m,async C=>{if(f.value=void 0,C==="")return;const x=await r.defaultFor(C);m.value===C&&(f.value=x)},{immediate:!0});const I=E(()=>_.value??f.value);function b(C){m.value=C,l.value&&(l.value.open=!1)}function w(){const C=v.value.trim();C!==""&&(b(C),v.value="")}async function k(C){if(m.value==="")throw new Error(t("newThread.workspaceRequired"));const x=await o.create(m.value,_.value);i.open(x),await i.submit(x,ue,C),await n.push({name:"chat-session",params:{sessionId:x}})}return(C,x)=>{const J=ft("tooltip");return d(),c("section",km,[u("div",wm,[G(Kt,{class:"new-session-mark"}),u("h1",_m,h(a(t)("newThread.title")),1),G(Dn)]),G(gs,{class:"is-new-thread",running:!1,model:I.value,"model-selectable":!0,send:k,attachments:!1,"select-model":X=>{_.value=X}},{status:We(()=>[u("details",{ref_key:"menu",ref:l,class:"composer-popover workspace-menu"},[Ne((d(),c("summary",Im,[G(a(os),{"aria-hidden":"true"}),u("span",$m,h(m.value?a(Gt)(m.value):a(t)("newThread.selectWorkspace")),1),G(a(Dt),{class:"workspace-chevron","aria-hidden":"true"})])),[[J,m.value||void 0]]),u("div",xm,[u("form",{class:"workspace-path-form",onSubmit:Ee(w,["prevent"])},[Ne(u("input",{"onUpdate:modelValue":x[0]||(x[0]=X=>v.value=X),class:"ui-field","data-size":"sm",type:"text",spellcheck:"false",autocapitalize:"off",placeholder:a(t)("newThread.pathPlaceholder"),"aria-label":a(t)("newThread.pathLabel")},null,8,Cm),[[At,v.value]]),u("button",{type:"submit",class:"ui-button","data-variant":"secondary","data-size":"sm",disabled:v.value.trim()===""},h(a(t)("newThread.usePath")),9,Sm)],32),a(o).workspaces.length?(d(),c("hr",Em)):z("",!0),u("div",{class:"workspace-list",role:"listbox","aria-label":a(t)("sidebar.workspaces")},[(d(!0),c(ne,null,pe(a(o).workspaces,X=>(d(),c("button",{key:X.cwd,type:"button",role:"option",class:"ui-menu-item","data-two-line":"","aria-selected":X.cwd===m.value,onClick:W=>b(X.cwd)},[G(a(os),{"aria-hidden":"true"}),u("span",null,[be(h(X.name),1),u("span",qm,h(X.cwd),1)]),X.cwd===m.value?(d(),ae(a($t),{key:0,class:"ui-menu-check","aria-hidden":"true"})):z("",!0)],8,Tm))),128))],8,Mm)])],512)]),_:1},8,["model","select-model"])])}}}),Lm=Re(Am,[["__scopeId","data-v-eebc871b"]]),Rm={class:"chat-loading","aria-busy":"true"},Om=_e({__name:"RootRedirect",setup(s){const{t}=ye(),e=Ut(),n=Ke(),o=Ve();return $e(()=>n.loaded||n.error!=="",i=>{if(!i)return;const r=o.lastSessionId;e.replace(r!==void 0&&n.byId.has(r)?{name:"chat-session",params:{sessionId:r}}:{name:"chat-new"})},{immediate:!0}),(i,r)=>(d(),c("section",Rm,[u("p",null,h(a(t)("common.loading")),1)]))}}),Pm={class:"route-page app-scroll-viewport"},zm={"data-route-heading":"",tabindex:"-1"},Dm={class:"page-description"},Nm=_e({__name:"NotFoundView",setup(s){const{t}=ye();return(e,n)=>(d(),c("section",Pm,[G(a(io),{size:20,class:"state-icon","aria-hidden":"true"}),u("h1",zm,h(a(t)("route.notFound")),1),u("p",Dm,h(a(t)("page.notFoundDescription")),1),G(a(ut),{to:"/chat/new"},{default:We(()=>[be(h(a(t)("sidebar.newSession")),1)]),_:1})]))}}),Nn=Qn({history:Gn(),routes:[{path:"/",name:"root",component:Om},{path:"/chat/new",name:"chat-new",component:Lm},{path:"/chat/:sessionId",name:"chat-session",component:ym,props:!0},{path:"/settings",component:()=>Te(()=>import("./SettingsPage-DIs3PPbX.js"),__vite__mapDeps([2,1,3,4,5])),children:[{path:"",name:"settings-index",component:{render:()=>null}},{path:"account",name:"settings-account",component:()=>Te(()=>import("./AccountSettings-KJxLwnAQ.js"),__vite__mapDeps([6,1,7,8,3,9,10]))},{path:"appearance",name:"settings-appearance",component:()=>Te(()=>import("./AppearanceSettings-B2hfRF8G.js"),__vite__mapDeps([11,7,1,12]))},{path:"agent",name:"settings-agent",component:()=>Te(()=>import("./AgentSettings-AtjhW1u9.js"),__vite__mapDeps([13,1,7,14,3]))},{path:"providers",name:"settings-providers",component:()=>Te(()=>import("./ProviderSettings-CxnpSWBK.js"),__vite__mapDeps([15,1,8,3,4,9,16]))},{path:"providers/new",name:"settings-provider-new",component:()=>Te(()=>import("./ProviderSettings-CxnpSWBK.js"),__vite__mapDeps([15,1,8,3,4,9,16]))},{path:"providers/:providerId",name:"settings-provider-detail",component:()=>Te(()=>import("./ProviderSettings-CxnpSWBK.js"),__vite__mapDeps([15,1,8,3,4,9,16]))},{path:"modality",name:"settings-modality",component:()=>Te(()=>import("./ModalitySettings-qp9qr-DE.js"),__vite__mapDeps([17,1,7,14,3,9]))},{path:"mcp/:serverId?",name:"settings-mcp",component:()=>Te(()=>import("./McpSettings-8O2EQkfU.js"),__vite__mapDeps([18,1,7,14,3,19]))},{path:"plugins/:pluginId?",name:"settings-plugins",component:()=>Te(()=>import("./PluginSettings-B_YwUXUy.js"),__vite__mapDeps([20,1,7,14,3,21]))},{path:"skills/:skillId?",name:"settings-skills",component:()=>Te(()=>import("./SkillSettings-BI01BTVt.js"),__vite__mapDeps([22,1,7,14,3,9,23]))},{path:"permissions/:page?",name:"settings-permissions",component:()=>Te(()=>import("./PermissionsSettings-DRaeZ5ry.js"),__vite__mapDeps([24,1,7,14,3,25]))},{path:"scheduled",name:"settings-scheduled",component:()=>Te(()=>import("./ScheduledSettings-CNSQQAYZ.js"),__vite__mapDeps([26,1,7,3,5,9,4,27]))},{path:"scheduled/new",name:"settings-scheduled-new",component:()=>Te(()=>import("./ScheduledSettings-CNSQQAYZ.js"),__vite__mapDeps([26,1,7,3,5,9,4,27]))},{path:"scheduled/:jobId",name:"settings-scheduled-detail",component:()=>Te(()=>import("./ScheduledSettings-CNSQQAYZ.js"),__vite__mapDeps([26,1,7,3,5,9,4,27]))},{path:"scheduled/:jobId/edit",name:"settings-scheduled-edit",component:()=>Te(()=>import("./ScheduledSettings-CNSQQAYZ.js"),__vite__mapDeps([26,1,7,3,5,9,4,27]))},{path:"archived",name:"settings-archived",component:()=>Te(()=>import("./ArchivedSettings-zfBiREJC.js"),__vite__mapDeps([28,1,7,14,3,29]))},{path:"diagnostics",name:"settings-diagnostics",component:()=>Te(()=>import("./DiagnosticsSettings-3WeumMYl.js"),__vite__mapDeps([30,1,7,14,3,31]))}]},{path:"/:pathMatch(.*)*",name:"not-found",component:Nm}]});Nn.afterEach(s=>{s.name==="chat-session"&&typeof s.params.sessionId=="string"&&(Ve().lastSessionId=s.params.sessionId)});$e(It.global.locale,s=>{document.documentElement.lang=s},{immediate:!0});const zt=Jn();Ve(zt);Promise.all([Ei(),bn(vs(zt).language||navigator.language)]).then(()=>{Ce(zt).client.start(),Yn(yh).use(zt).use(It).use(Nn).directive("tooltip",qh).mount("#app"),setTimeout(()=>void On(),0)});export{Zm as A,Kt as B,an as C,ev as D,Jm as E,Ym as F,Qm as G,ls as H,Nt as I,vs as J,Dt as K,$t as L,cn as M,Ve as N,xt as O,Ae as P,ct as R,ds as S,Co as W,yt as X,Te as _,Jt as a,Ke as b,fe as c,Wm as d,Vm as e,ea as f,sa as g,av as h,An as i,mt as j,bs as k,Re as l,Hm as m,Um as n,ta as o,ov as p,iv as q,Fm as r,cs as s,tv as t,Ce as u,sv as v,nv as w,Gm as x,Km as y,Xm as z};
|