@aalis/plugin-webui-client 0.10.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/assets/{AuthorityPage-GbF3xg8H.js → AuthorityPage-D3c_GhYg.js} +1 -1
  2. package/dist/assets/{DynamicPage-GeSfxddk.js → DynamicPage-B5APLJwu.js} +1 -1
  3. package/dist/assets/{FilesPage-B5C5zWo5.js → FilesPage-BYyEd_Xb.js} +1 -1
  4. package/dist/assets/LogPage-BTvnnjEI.js +1 -0
  5. package/dist/assets/{MarketplacePage-DKs-PwSt.js → MarketplacePage-DXmX9rkf.js} +1 -1
  6. package/dist/assets/{PlatformPage-U3Xx3yvM.js → PlatformPage-D8vZKsvZ.js} +1 -1
  7. package/dist/assets/{PluginConfigPage-Ci_WRMHk.js → PluginConfigPage-DIn8fL_h.js} +1 -1
  8. package/dist/assets/{SessionsPage-AmYhJ75Q.js → SessionsPage-CYFjpcjv.js} +1 -1
  9. package/dist/assets/{arc-DAUQCUxy.js → arc-CClRoqMj.js} +1 -1
  10. package/dist/assets/{architectureDiagram-3BPJPVTR-dq-zfwZp.js → architectureDiagram-3BPJPVTR-B0b6Rywx.js} +1 -1
  11. package/dist/assets/{blockDiagram-GPEHLZMM-DEMq0qb2.js → blockDiagram-GPEHLZMM-DipJsGay.js} +1 -1
  12. package/dist/assets/{c4Diagram-AAUBKEIU-CwB1zAbW.js → c4Diagram-AAUBKEIU-BNmshTOF.js} +1 -1
  13. package/dist/assets/channel-BwqmVsV7.js +1 -0
  14. package/dist/assets/{chunk-2J33WTMH-9OXRlLBg.js → chunk-2J33WTMH-BsV69ANT.js} +1 -1
  15. package/dist/assets/{chunk-4BX2VUAB-HzQmwn3M.js → chunk-4BX2VUAB-CPyTKCGx.js} +1 -1
  16. package/dist/assets/{chunk-55IACEB6-DraZNS76.js → chunk-55IACEB6-C6vq6z-8.js} +1 -1
  17. package/dist/assets/{chunk-727SXJPM-Cs0FCref.js → chunk-727SXJPM-DY5QI4An.js} +1 -1
  18. package/dist/assets/{chunk-AQP2D5EJ-DtANEAYx.js → chunk-AQP2D5EJ-EW0y4bga.js} +1 -1
  19. package/dist/assets/{chunk-FMBD7UC4-C6aipBu7.js → chunk-FMBD7UC4-Bq1b7ZFm.js} +1 -1
  20. package/dist/assets/{chunk-ND2GUHAM-BLOj0kQ3.js → chunk-ND2GUHAM-C-4E9LgY.js} +1 -1
  21. package/dist/assets/{chunk-QZHKN3VN-5Vi8brX2.js → chunk-QZHKN3VN-Cggh32SU.js} +1 -1
  22. package/dist/assets/classDiagram-4FO5ZUOK-a3IT83pw.js +1 -0
  23. package/dist/assets/classDiagram-v2-Q7XG4LA2-a3IT83pw.js +1 -0
  24. package/dist/assets/{clock-ChZ95JZD.js → clock-cMoARLnL.js} +1 -1
  25. package/dist/assets/{cose-bilkent-S5V4N54A-yeJ_9DnK.js → cose-bilkent-S5V4N54A-C2aXl7NK.js} +1 -1
  26. package/dist/assets/{dagre-BM42HDAG-D6s4-9TX.js → dagre-BM42HDAG-DsE9mxP1.js} +1 -1
  27. package/dist/assets/{diagram-2AECGRRQ-pq6EwjXz.js → diagram-2AECGRRQ-Cf9NZrCh.js} +1 -1
  28. package/dist/assets/{diagram-5GNKFQAL-CEAvTn_s.js → diagram-5GNKFQAL-BSz3SaT4.js} +1 -1
  29. package/dist/assets/{diagram-KO2AKTUF-dqURbX4F.js → diagram-KO2AKTUF-LKkBjvQa.js} +1 -1
  30. package/dist/assets/{diagram-LMA3HP47-DXmUzg2O.js → diagram-LMA3HP47-v-hSdx7w.js} +1 -1
  31. package/dist/assets/{diagram-OG6HWLK6-CJWJiQGO.js → diagram-OG6HWLK6-B5GTKRKU.js} +1 -1
  32. package/dist/assets/{erDiagram-TEJ5UH35-D1ZEPbEZ.js → erDiagram-TEJ5UH35-B2dZ6G20.js} +1 -1
  33. package/dist/assets/{flowDiagram-I6XJVG4X-BTEcDPXo.js → flowDiagram-I6XJVG4X-mjVJSamX.js} +1 -1
  34. package/dist/assets/{ganttDiagram-6RSMTGT7-DWcwiv0T.js → ganttDiagram-6RSMTGT7-DSB_yERs.js} +1 -1
  35. package/dist/assets/{gitGraphDiagram-PVQCEYII-CzSr3JTx.js → gitGraphDiagram-PVQCEYII-B4kiZGq7.js} +1 -1
  36. package/dist/assets/{globe-iNYeYXM9.js → globe-wo3CIehr.js} +1 -1
  37. package/dist/assets/index-BwjDBPnu.css +1 -0
  38. package/dist/assets/index-DvV80Yu7.js +212 -0
  39. package/dist/assets/{infoDiagram-5YYISTIA-BrJvNyiN.js → infoDiagram-5YYISTIA-XfWMHpBx.js} +1 -1
  40. package/dist/assets/{ishikawaDiagram-YF4QCWOH-CLLORvW4.js → ishikawaDiagram-YF4QCWOH-BhftoIFL.js} +1 -1
  41. package/dist/assets/{journeyDiagram-JHISSGLW-DJERFHoN.js → journeyDiagram-JHISSGLW-BdPhXJS9.js} +1 -1
  42. package/dist/assets/{kanban-definition-UN3LZRKU-nfSKPg95.js → kanban-definition-UN3LZRKU-DP9dT66v.js} +1 -1
  43. package/dist/assets/{linear-svZpQC-M.js → linear-BY9Cpx0t.js} +1 -1
  44. package/dist/assets/{mermaid.core-BK17wB8Y.js → mermaid.core-DfVdcmTH.js} +4 -4
  45. package/dist/assets/{mindmap-definition-RKZ34NQL-BbKyklJL.js → mindmap-definition-RKZ34NQL-k2Cztpqe.js} +1 -1
  46. package/dist/assets/{pieDiagram-4H26LBE5-BdVEjZ3k.js → pieDiagram-4H26LBE5-D5-0D-FK.js} +1 -1
  47. package/dist/assets/{quadrantDiagram-W4KKPZXB-pwCe-4m9.js → quadrantDiagram-W4KKPZXB-w2-y8vBx.js} +1 -1
  48. package/dist/assets/{requirementDiagram-4Y6WPE33-CBHbb4_y.js → requirementDiagram-4Y6WPE33-D9jaSbpQ.js} +1 -1
  49. package/dist/assets/{sankeyDiagram-5OEKKPKP-DnxugXFe.js → sankeyDiagram-5OEKKPKP-BGBVb173.js} +1 -1
  50. package/dist/assets/{sequenceDiagram-3UESZ5HK-CXqwCzG2.js → sequenceDiagram-3UESZ5HK-BOKbRyZK.js} +1 -1
  51. package/dist/assets/{stateDiagram-AJRCARHV-Byw3Daq8.js → stateDiagram-AJRCARHV-DxRi0tDI.js} +1 -1
  52. package/dist/assets/{stateDiagram-v2-BHNVJYJU-ClKN4qlq.js → stateDiagram-v2-BHNVJYJU-BxVQEu32.js} +1 -1
  53. package/dist/assets/{timeline-definition-PNZ67QCA-spYDyHEq.js → timeline-definition-PNZ67QCA-fa76cb2Y.js} +1 -1
  54. package/dist/assets/{vennDiagram-CIIHVFJN-Cg2-3zjD.js → vennDiagram-CIIHVFJN-Cfu9ZGNx.js} +1 -1
  55. package/dist/assets/{wardley-L42UT6IY-ER1LeunS.js → wardley-L42UT6IY-C7UmKZUS.js} +1 -1
  56. package/dist/assets/{wardleyDiagram-YWT4CUSO-qaTMbUZm.js → wardleyDiagram-YWT4CUSO-HGHaCD-i.js} +1 -1
  57. package/dist/assets/{xychartDiagram-2RQKCTM6-D4K0NriZ.js → xychartDiagram-2RQKCTM6-Dn8PxDor.js} +1 -1
  58. package/dist/index.html +3 -3
  59. package/package.json +1 -1
  60. package/dist/assets/LogPage-C_Z3RA5T.js +0 -1
  61. package/dist/assets/channel-kaxpMS0k.js +0 -1
  62. package/dist/assets/classDiagram-4FO5ZUOK-B8NX94jI.js +0 -1
  63. package/dist/assets/classDiagram-v2-Q7XG4LA2-B8NX94jI.js +0 -1
  64. package/dist/assets/index-BiAVUpil.css +0 -1
  65. package/dist/assets/index-D56FVdMY.js +0 -207
@@ -0,0 +1,212 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-DfVdcmTH.js","assets/react-vendor-BPQixOLZ.js","assets/PluginConfigPage-DIn8fL_h.js","assets/SchemaForm-YVQZ6Keg.js","assets/ConfirmDialog-DbV-E1Nd.js","assets/highlight-DJvvuuwd.js","assets/highlight-BPWJwfct.css","assets/katex-Bq6vt64r.js","assets/katex-CIHdCL6t.css","assets/markdown-B2G8c9k5.js","assets/MarketplacePage-DXmX9rkf.js","assets/clock-cMoARLnL.js","assets/PlatformPage-D8vZKsvZ.js","assets/globe-wo3CIehr.js","assets/AuthorityPage-D3c_GhYg.js","assets/LogPage-BTvnnjEI.js","assets/SessionsPage-CYFjpcjv.js","assets/FilesPage-BYyEd_Xb.js","assets/DynamicPage-B5APLJwu.js","assets/cytoscape.esm-LDYqcvCF.js","assets/cytoscape-fcose-DXAQNCkb.js"])))=>i.map(i=>d[i]);
2
+ import{r as a,j as e,c as st}from"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import{r as tt,b as nt,a as at,c as rt,d as ot,M as $e}from"./markdown-B2G8c9k5.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const d of i)if(d.type==="childList")for(const u of d.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(i){const d={};return i.integrity&&(d.integrity=i.integrity),i.referrerPolicy&&(d.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?d.credentials="include":i.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function r(i){if(i.ep)return;i.ep=!0;const d=n(i);fetch(i.href,d)}})();const it="modulepreload",lt=function(t){return"/"+t},ds={},fe=function(s,n,r){let i=Promise.resolve();if(n&&n.length>0){let u=function(l){return Promise.all(l.map(y=>Promise.resolve(y).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),f=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));i=u(n.map(l=>{if(l=lt(l),l in ds)return;ds[l]=!0;const y=l.endsWith(".css"),p=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${p}`))return;const j=document.createElement("link");if(j.rel=y?"stylesheet":it,y||(j.as="script"),j.crossOrigin="",j.href=l,f&&j.setAttribute("nonce",f),document.head.appendChild(j),y)return new Promise((b,c)=>{j.addEventListener("load",b),j.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})}))}function d(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return i.then(u=>{for(const h of u||[])h.status==="rejected"&&d(h.reason);return s().catch(d)})};/**
3
+ * @license lucide-react v1.7.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 vs=(...t)=>t.filter((s,n,r)=>!!s&&s.trim()!==""&&r.indexOf(s)===n).join(" ").trim();/**
8
+ * @license lucide-react v1.7.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 ct=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
13
+ * @license lucide-react v1.7.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 dt=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(s,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
18
+ * @license lucide-react v1.7.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 us=t=>{const s=dt(t);return s.charAt(0).toUpperCase()+s.slice(1)};/**
23
+ * @license lucide-react v1.7.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
+ */var Ke={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
28
+ * @license lucide-react v1.7.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 ut=t=>{for(const s in t)if(s.startsWith("aria-")||s==="role"||s==="title")return!0;return!1},ht=a.createContext({}),mt=()=>a.useContext(ht),ft=a.forwardRef(({color:t,size:s,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:d,iconNode:u,...h},f)=>{const{size:l=24,strokeWidth:y=2,absoluteStrokeWidth:p=!1,color:j="currentColor",className:b=""}=mt()??{},c=r??p?Number(n??y)*24/Number(s??l):n??y;return a.createElement("svg",{ref:f,...Ke,width:s??l??Ke.width,height:s??l??Ke.height,stroke:t??j,strokeWidth:c,className:vs("lucide",b,i),...!d&&!ut(h)&&{"aria-hidden":"true"},...h},[...u.map(([S,E])=>a.createElement(S,E)),...Array.isArray(d)?d:[d]])});/**
33
+ * @license lucide-react v1.7.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
+ */const B=(t,s)=>{const n=a.forwardRef(({className:r,...i},d)=>a.createElement(ft,{ref:d,iconNode:s,className:vs(`lucide-${ct(us(t))}`,`lucide-${t}`,r),...i}));return n.displayName=us(t),n};/**
38
+ * @license lucide-react v1.7.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 pt=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],ys=B("archive",pt);/**
43
+ * @license lucide-react v1.7.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 xt=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],gt=B("bot",xt);/**
48
+ * @license lucide-react v1.7.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 jt=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],hs=B("brain-circuit",jt);/**
53
+ * @license lucide-react v1.7.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 vt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ws=B("chevron-down",vt);/**
58
+ * @license lucide-react v1.7.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 yt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ns=B("chevron-right",yt);/**
63
+ * @license lucide-react v1.7.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 wt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],bs=B("circle-check",wt);/**
68
+ * @license lucide-react v1.7.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 Nt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],bt=B("circle",Nt);/**
73
+ * @license lucide-react v1.7.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 kt=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],Ct=B("command",kt);/**
78
+ * @license lucide-react v1.7.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 St=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],_t=B("download",St);/**
83
+ * @license lucide-react v1.7.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 $t=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],es=B("file-text",$t);/**
88
+ * @license lucide-react v1.7.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 Mt=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],It=B("file",Mt);/**
93
+ * @license lucide-react v1.7.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 Tt=[["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"}]],Et=B("folder-open",Tt);/**
98
+ * @license lucide-react v1.7.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 Lt=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Ue=B("history",Lt);/**
103
+ * @license lucide-react v1.7.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 Rt=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Dt=B("list-todo",Rt);/**
108
+ * @license lucide-react v1.7.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 Pt=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],ss=B("loader",Pt);/**
113
+ * @license lucide-react v1.7.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 At=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],ks=B("menu",At);/**
118
+ * @license lucide-react v1.7.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 zt=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],ze=B("message-square",zt);/**
123
+ * @license lucide-react v1.7.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 Ot=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Cs=B("paperclip",Ot);/**
128
+ * @license lucide-react v1.7.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 Ft=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Wt=B("refresh-cw",Ft);/**
133
+ * @license lucide-react v1.7.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 Bt=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],qt=B("sparkles",Bt);/**
138
+ * @license lucide-react v1.7.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 Vt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ht=B("square",Vt);/**
143
+ * @license lucide-react v1.7.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 Jt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Gt=B("trash-2",Jt);/**
148
+ * @license lucide-react v1.7.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 Kt=[["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"}]],Oe=B("triangle-alert",Kt);/**
153
+ * @license lucide-react v1.7.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 Ut=[["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"}]],os=B("wrench",Ut);/**
158
+ * @license lucide-react v1.7.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 Yt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ss=B("x",Yt);/**
163
+ * @license lucide-react v1.7.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 Xt=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],_s=B("zap",Xt),$s="aalis:activeSessionId";function Zt(){try{return window.localStorage.getItem($s)||"__new_chat__"}catch{return"__new_chat__"}}let ts=Zt();const ns=new Set;function ae(){return ts}function Ye(t){if(ts!==t){ts=t;try{window.localStorage.setItem($s,t)}catch{}for(const s of ns)s(t)}}function Qt(t){return ns.add(t),()=>ns.delete(t)}function Ms(t){return t!==401?!1:(window.location.replace("/"),!0)}async function se(t,s){const n=await fetch(t,{headers:{"Content-Type":"application/json"},...s});if(Ms(n.status))throw new Error("会话已失效,正在跳转登录");return n.json()}async function he(t,s,n={}){const r=await fetch(`/api/page-action/${encodeURIComponent(t)}/${encodeURIComponent(s)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(Ms(r.status))throw new Error("会话已失效,正在跳转登录");const i=await r.json();if(!r.ok)throw new Error(i.error||"请求失败");return i.data}function ke(t){return t?t.startsWith("http://")||t.startsWith("https://")?`/api/proxy/image?url=${encodeURIComponent(t)}`:t:""}function en(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}function sn(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"9",cy:"21",r:"1"}),e.jsx("circle",{cx:"20",cy:"21",r:"1"}),e.jsx("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]})}function tn(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function nn(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14,2 14,8 20,8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),e.jsx("line",{x1:"10",y1:"9",x2:"8",y2:"9"})]})}function an(){return e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),e.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}function rn(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})})}function on(){return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function ln(t){const s=a.useRef(t);s.current=t;const n=a.useRef(null),[r,i]=a.useState(!1),d=a.useRef(ae());a.useEffect(()=>{let f,l,y=!1;function p(){if(y)return;const j=location.protocol==="https:"?"wss:":"ws:";f=new WebSocket(`${j}//${location.host}/ws`),n.current=f,f.onopen=()=>{y||(i(!0),f.send(JSON.stringify({type:"subscribe_logs"})),f.send(JSON.stringify({type:"subscribe_session",sessionId:ae()})),d.current=ae())},f.onclose=()=>{y||(i(!1),l=setTimeout(p,3e3))},f.onmessage=b=>{var c,S,E,C,O,q,w,V,K,R,ie,N,L;try{const m=JSON.parse(b.data),x=s.current;m.type==="stream"?(x.onStream(m.contentDelta,m.reasoningDelta,m.done,m.toolLimitReached),m.toolCallProgress&&((c=x.onToolCallProgress)==null||c.call(x,m.toolCallProgress)),m.done&&((S=x.onToolCallProgressClear)==null||S.call(x))):m.type==="message"&&(m.content||(E=m.attachments)!=null&&E.length)?x.onMessage(m.content??"",m.reasoningContent,m.segments,m.attachments,m.modelInfo):m.type==="tool_call"&&m.toolName?x.onToolCall(m.toolName,m.toolArgs??{},m.toolPhase,m.toolResult):m.type==="log"&&m.log?x.onLog(m.log):m.type==="state_changed"?(C=x.onStateChanged)==null||C.call(x):m.type==="restarting"?(O=x.onRestarting)==null||O.call(x):m.type==="reload"?(q=x.onReload)==null||q.call(x):m.type==="sessions_changed"?(w=x.onSessionsChanged)==null||w.call(x):m.type==="todo_updated"&&m.todoItems?(V=x.onTodoUpdated)==null||V.call(x,m.todoItems):m.type==="stream_resume"?(K=x.onStreamResume)==null||K.call(x,m.content??"",m.reasoningContent??"",m.segments??[],!!m.done,m.toolCallsProgress):m.type==="confirm"&&m.content?(R=x.onConfirm)==null||R.call(x,m.content):m.type==="token_usage"&&m.tokenUsage?(ie=x.onTokenUsage)==null||ie.call(x,m.tokenUsage):m.type==="compressing"&&m.sessionId?(N=x.onCompressing)==null||N.call(x,m.sessionId,m.content??"start"):m.type==="history_changed"&&m.sessionId?(L=x.onHistoryChanged)==null||L.call(x,m.sessionId):m.type==="page_refresh"&&window.dispatchEvent(new CustomEvent("aalis:page-refresh",{detail:{pluginName:m.pluginName}}))}catch{}}}return p(),()=>{y=!0,clearTimeout(l),f==null||f.close()}},[]),a.useEffect(()=>Qt(l=>{const y=n.current;(y==null?void 0:y.readyState)===WebSocket.OPEN&&(y.send(JSON.stringify({type:"unsubscribe_session",sessionId:d.current})),y.send(JSON.stringify({type:"subscribe_session",sessionId:l})),d.current=l)}),[]);const u=a.useCallback((f,l)=>{var y;if(((y=n.current)==null?void 0:y.readyState)===WebSocket.OPEN){const p={type:"message",content:f,sessionId:ae()};l&&l.length>0&&(p.attachments=l),n.current.send(JSON.stringify(p))}},[]),h=a.useCallback(f=>{var l;((l=n.current)==null?void 0:l.readyState)===WebSocket.OPEN&&n.current.send(JSON.stringify(f))},[]);return{send:u,sendRaw:h,connected:r}}function cn(){const t=new Date,s=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),r=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return`会话 ${s}-${n} ${r}:${i}`}function dn(t){const s=[];let n=t.replace(/\n?\[文件: ([^\n(]+?)\s*\(ID:[^)]+\)\]\n--- 文件内容 ---[\s\S]*?--- 文件内容结束 ---/g,(r,i)=>(s.push(i.trim()),""));return n=n.replace(/\n?\[文件: ([^\n(]+?)\s*\(ID:[^,\n)]+[,\n][\s\S]*?\)\]/g,(r,i)=>(s.push(i.trim()),"")),n=n.replace(/\n?\[文件: ([^\]-]+?) - [^\]]+\]/g,(r,i)=>(s.push(i.trim()),"")),n=n.replace(/\n?\[文件: ([^\]]+?)\s*(?:\(ID:[^)]+\))?\]/g,(r,i)=>(s.push(i.trim()),"")),{displayContent:n.trim(),fileNames:s}}function un(t){var r,i,d,u;const s=[];let n=0;for(;n<t.length;){const h=t[n];if(h.role==="user"){const f=h.content??"",l=Array.isArray((r=h.metadata)==null?void 0:r.fileNames)?h.metadata.fileNames:null,{displayContent:y,fileNames:p}=dn(f),j=(l??p).filter(Boolean);s.push({role:"user",content:y,fileNames:j.length>0?j:void 0,timestamp:h.timestamp??0}),n++;continue}if(h.role==="system"){h.kind==="event-marker"&&s.push({role:"system",content:h.content??"",timestamp:h.timestamp??0}),n++;continue}if(h.role==="notice"){s.push({role:"system",content:h.content??"",timestamp:h.timestamp??0}),n++;continue}if(h.role==="assistant"){const f=[],l=[];let y=h.timestamp??0,p="",j=!1,b;for(;n<t.length&&(t[n].role==="assistant"||t[n].role==="tool");){const C=t[n];if(C.role==="assistant"){const O=(i=C.metadata)==null?void 0:i.modelInfo;O&&(b=O)}if(C.role==="assistant"&&C.segments&&C.segments.length>0){j=!0,f.length=0,l.length=0;for(const O of C.segments)f.push(O);y=C.timestamp??y,n++;continue}if(C.role==="assistant"&&C.toolCalls&&C.toolCalls.length>0){C.reasoningContent&&l.push({type:"reasoning_text",content:C.reasoningContent}),C.content&&f.push({type:"text",content:C.content});for(const O of C.toolCalls){let q={};try{q=JSON.parse(O.function.arguments)}catch{}f.push({type:"tool_call",name:O.function.name,args:q})}y=C.timestamp??y,n++}else if(C.role==="tool"&&C.toolCallId){for(let O=f.length-1;O>=0;O--){const q=f[O];if(q.type==="tool_call"&&q.result===void 0){q.result=C.content??"";break}}n++}else if(C.role==="assistant"){if(n===t.length-1||((d=t[n+1])==null?void 0:d.role)==="user"||((u=t[n+1])==null?void 0:u.role)==="system"){C.reasoningContent&&l.push({type:"reasoning_text",content:C.reasoningContent}),p=C.content??"",y=C.timestamp??y,n++;break}C.reasoningContent&&l.push({type:"reasoning_text",content:C.reasoningContent}),C.content&&f.push({type:"text",content:C.content}),y=C.timestamp??y,n++}else break}let c;j?c=f:(c=[...l,...f],p&&c.push({type:"text",content:p}));let S="",E="";for(const C of c)C.type==="reasoning_text"?S+=C.content:C.type==="text"&&(E+=C.content);s.push({role:"assistant",content:E||p||h.content||"",segments:c.length>0?c:void 0,reasoningContent:S||void 0,timestamp:y,modelInfo:b});continue}n++}return s}function hn(t){const[s,n]=a.useState([]),[r,i]=a.useState(ae()),[d,u]=a.useState([]),[h,f]=a.useState(!1),l=a.useRef(!1),y=a.useRef(new Map),p=a.useMemo(()=>{const N=t.find(L=>L.key==="sessions");return(N==null?void 0:N.plugin)??null},[t]),j=a.useRef(p);j.current=p;const b=a.useRef(r);b.current=r;const c=a.useRef(d);c.current=d;const S=a.useRef(s);S.current=s;const E=a.useMemo(()=>p?s.length===0||!s.some(N=>N.id===r):!1,[p,s,r]),C=a.useMemo(()=>{const N=s.find(L=>L.id===r);return(N==null?void 0:N.title)||(N==null?void 0:N.displayTitle)||(N==null?void 0:N.name)||""},[s,r]),O=a.useCallback(()=>{const N=j.current;N&&he(N,"listSessions").then(L=>{Array.isArray(L)&&n(L)}).catch(()=>{})},[]),q=a.useCallback(()=>{c.current.length>0&&y.current.set(b.current,c.current);const N="__new_chat__";i(N),Ye(N),u([]),f(!1),l.current=!1},[]),w=a.useCallback(async N=>{const L=j.current;if(!L)return null;const m=cn();try{const x=await he(L,"createSession",{name:m,...N?{parentId:N}:{}});if(!(x!=null&&x.id))return null;const H=x.id;return n(U=>{if(U.some(_=>_.id===H))return U;const Q={id:H,name:x.name||m,title:x.title,displayTitle:x.title||x.name||m,status:"active",children:[],childCount:0,parentId:N,createdAt:Date.now()};return[...U,Q]}),N&&n(U=>U.map(Q=>Q.id===N?{...Q,children:[...Q.children,H],childCount:Q.childCount+1}:Q)),c.current.length>0&&y.current.set(b.current,c.current),i(H),Ye(H),u([]),f(!1),l.current=!1,he(L,"listSessions").then(U=>{Array.isArray(U)&&n(U)}).catch(()=>{}),H}catch{return null}},[]),V=a.useCallback(async()=>!j.current||S.current.some(m=>m.id===b.current)?b.current:await w()||b.current,[w]),K=a.useCallback((N,L)=>{he(L,"getSessionDetail",{id:N}).then(m=>{if(m!=null&&m.messages&&b.current===N){const x=un(m.messages);if(l.current){for(;x.length>0&&x[x.length-1].role==="assistant";)x.pop();const H=c.current,U=H[H.length-1];U&&U.role==="assistant"&&x.push(U)}u(x),y.current.set(N,x)}}).catch(()=>{})},[]),R=a.useCallback(N=>{const L=N===b.current;if(L&&c.current.length>0)return;!L&&c.current.length>0&&y.current.set(b.current,c.current),i(N),Ye(N),f(!1),l.current=!1;const m=j.current,x=y.current.get(N);u(x??[]),!x&&m&&K(N,m),O()},[K,O]),ie=a.useCallback(N=>{if(N!==b.current)return;const L=j.current;L&&(y.current.delete(N),K(N,L))},[K]);return a.useEffect(()=>{p&&he(p,"listSessions").then(N=>{if(!Array.isArray(N))return;n(N);const L=ae();L&&L!=="__new_chat__"&&N.some(m=>m.id===L)&&(i(L),K(L,p))}).catch(()=>{})},[p,K]),{pluginName:p,sessionList:s,activeSessionId:r,activeSessionTitle:C,isNewChat:E,messages:d,setMessages:u,refresh:O,startNewChat:q,createSession:w,ensureSession:V,switchSession:R,handleHistoryChanged:ie,loading:h,setLoading:f,streamingRef:l}}function Xe({name:t,info:s,onPreferChanged:n}){var j;const[r,i]=a.useState(!1),d=s.providers,u=d.length>0,h=d.length>1,f=s.preferred??((j=d[0])==null?void 0:j.contextId)??"",l=d.find(b=>b.contextId===f),y=async b=>{if(!r){i(!0);try{await se(`/api/services/${encodeURIComponent(t)}/prefer`,{method:"POST",body:JSON.stringify({contextId:b})}),n==null||n()}finally{i(!1)}}},p=async()=>{if(!r){i(!0);try{await se(`/api/services/${encodeURIComponent(t)}/prefer`,{method:"DELETE"}),n==null||n()}finally{i(!1)}}};return e.jsxs("div",{className:"service-slot-card",children:[e.jsxs("div",{className:"service-slot-header",children:[e.jsx("span",{className:"service-slot-name",children:t}),e.jsxs("div",{className:"service-slot-header-badges",children:[s.preferred&&e.jsx("span",{className:"service-winner-badge preferred",children:"偏好"}),e.jsx("span",{className:`badge ${u?"active":"error"}`,children:u?h?`${d.length} 个提供者`:"就绪":"未就绪"})]})]}),u?h?e.jsxs("div",{className:"service-slot-select-row",children:[e.jsx("span",{className:"service-slot-label",children:"活跃提供者"}),e.jsx("select",{className:"service-select",value:f,disabled:r,onChange:b=>y(b.target.value),children:d.map(b=>{const c=b.displayName||b.label||b.contextId,S=c!==b.contextId?`${c} · p${b.priority} (${b.contextId})`:`${b.contextId} · p${b.priority}`;return e.jsx("option",{value:b.contextId,children:S},b.contextId)})}),s.preferred&&e.jsx("button",{type:"button",className:"service-clear-prefer",onClick:p,disabled:r,title:"清除偏好,恢复 priority 默认顺序",children:"恢复默认"})]}):e.jsxs("div",{className:"service-slot-single",children:[e.jsx("span",{className:"service-slot-label",children:"提供者"}),e.jsxs("span",{className:"service-slot-provider-name",children:[(l==null?void 0:l.displayName)||(l==null?void 0:l.label)||(l==null?void 0:l.contextId),((l==null?void 0:l.displayName)||(l==null?void 0:l.label))&&e.jsxs("span",{className:"service-slot-context-id",children:[" ",l==null?void 0:l.contextId]})]})]}):e.jsx("div",{className:"service-slot-single",children:e.jsx("span",{className:"empty-hint",children:"无提供者"})})]})}function mn({status:t,connected:s,plugins:n,servicesData:r,onRefreshServices:i}){var q;const d=n.filter(w=>w.state==="active").length,u=n.filter(w=>w.state==="error").length,h=n.length,[f,l]=a.useState([]),[y,p]=a.useState([]),[j,b]=a.useState([]);a.useEffect(()=>{se("/api/tool-groups").then(w=>l(w.groups??[])).catch(()=>{})},[n]),a.useEffect(()=>{se("/api/service-groups").then(w=>p(w.groups??[])).catch(()=>{})},[n]),a.useEffect(()=>{se("/api/llm-models").then(w=>b(w.models??[])).catch(()=>{})},[n]);const c=r?Object.entries(r):[],S=y.map(w=>({label:w.label,entries:c.filter(([V])=>w.services.includes(V))})),E=S.some(w=>w.entries.length>0),C=new Set(y.flatMap(w=>w.services)),O=c.filter(([w])=>!C.has(w));return e.jsxs("div",{className:"page-content page-dashboard",children:[e.jsx("div",{className:"section-label",children:"概览"}),e.jsxs("div",{className:"overview-grid",children:[e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx("span",{className:`status-dot-lg ${s?"online":"offline"}`})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"连接状态"}),e.jsx("div",{className:"overview-card-value",children:s?"已连接":"离线"})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(qt,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"应用名称"}),e.jsx("div",{className:"overview-card-value",children:(t==null?void 0:t.name)??"-"})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(_s,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"活跃插件"}),e.jsxs("div",{className:"overview-card-value",children:[d," / ",h]})]})]}),u>0&&e.jsxs("div",{className:"overview-card overview-card-error",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(Oe,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"错误插件"}),e.jsx("div",{className:"overview-card-value",children:u})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(os,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"已注册工具"}),e.jsx("div",{className:"overview-card-value",children:(t==null?void 0:t.tools.length)??0})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(Ct,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"已注册指令"}),e.jsx("div",{className:"overview-card-value",children:((q=t==null?void 0:t.commands)==null?void 0:q.length)??0})]})]}),e.jsxs("div",{className:"overview-card",children:[e.jsx("div",{className:"overview-card-icon",children:e.jsx(gt,{size:20})}),e.jsxs("div",{className:"overview-card-body",children:[e.jsx("div",{className:"overview-card-label",children:"可用模型"}),e.jsx("div",{className:"overview-card-value",children:j.length})]})]})]}),E?e.jsxs(e.Fragment,{children:[S.map(w=>w.entries.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"section-label",children:w.label}),e.jsx("div",{className:"services-grid",children:w.entries.map(([V,K])=>e.jsx(Xe,{name:V,info:K,onPreferChanged:i},V))})]},w.label)),O.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"section-label",children:"其他"}),e.jsx("div",{className:"services-grid",children:O.map(([w,V])=>e.jsx(Xe,{name:w,info:V,onPreferChanged:i},w))})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"section-label",children:"服务"}),e.jsxs("div",{className:"services-grid",children:[c.length===0&&e.jsx("div",{className:"empty-hint",children:"加载中..."}),c.map(([w,V])=>e.jsx(Xe,{name:w,info:V,onPreferChanged:i},w))]})]}),e.jsx("div",{className:"section-label",children:"工具分组"}),f.length>0?e.jsx("div",{className:"tool-groups-grid",children:f.map(w=>{const V=w.contributingPlugins??[],K=[w.pluginName,...V.filter(R=>R!==w.pluginName)];return e.jsxs("div",{className:"tool-group-card",children:[e.jsxs("div",{className:"tool-group-header",children:[e.jsx("span",{className:"tool-group-name",children:w.label}),e.jsxs("span",{className:"tool-group-count",children:[w.toolCount," 工具"]})]}),w.description&&e.jsx("div",{className:"tool-group-desc",children:w.description}),e.jsxs("div",{className:"tool-group-meta",children:[e.jsx("span",{className:"tool-group-id",children:w.name}),e.jsx("span",{className:"tool-group-plugin",title:K.join(", "),children:K.join(" · ")})]})]},w.name)})}):e.jsx("div",{className:"tools-grid",children:!t||t.tools.length===0?e.jsx("div",{className:"empty-hint",children:"无工具"}):t.tools.map(w=>e.jsx("span",{className:"tool-chip",children:w},w))}),e.jsx("div",{className:"section-label",children:"已注册指令"}),e.jsx("div",{className:"tools-grid",children:!t||!t.commands||t.commands.length===0?e.jsx("div",{className:"empty-hint",children:"无指令"}):t.commands.map(w=>e.jsxs("span",{className:"tool-chip cmd-chip",title:w.description,children:["/",w.name]},w.name))})]})}function ms(t){const n=t.trim().split("|"),r=n[0].trim()===""?1:0,i=n[n.length-1].trim()===""?n.length-1:n.length;return Math.max(0,i-r)}function fn(t,s){const n=t.trim(),r=n.startsWith("|")?"|":"",i=n.endsWith("|")?"|":"",u=n.slice(r.length,i?n.length-1:void 0).split("|").map(h=>h.trim()).filter(h=>/^:?-+:?$/.test(h));for(;u.length<s;)u.push("---");return u.length=s,r+u.join("|")+i}function pn(t){return/^\|?[ \t]*:?-+:?[ \t]*(\|[ \t]*:?-+:?[ \t]*)*\|?\s*$/.test(t)}function xn(t){return t&&t.split(/(```[\s\S]*?```|`[^`\n]*`)/g).map((n,r)=>{if(r%2===1)return n;const i=n.split(`
168
+ `),d=[];for(let u=0;u<i.length;u++){const h=i[u];if(u>0&&pn(h)){const f=i[u-1];if(f.includes("|")&&f.trim()){const l=ms(f),y=ms(h);if(l>0&&y>0&&l!==y){d.push(fn(h,l));continue}}}d.push(h)}return d.join(`
169
+ `)}).join("")}function Me(t){return t=xn(t),t.split(/(```[\s\S]*?```|`[^`]*`)/g).map((n,r)=>(r%2===1||(n=n.replace(/\\\[([\s\S]*?)\\\]/g,(d,u)=>`$$${u.replace(/\|/g,"\\vert ")}$$`),n=n.replace(/\\\((.*?)\\\)/g,(d,u)=>`$${u.replace(/\|/g,"\\vert ")}$`),n=n.replace(/\$\$([\s\S]+?)\$\$/g,(d,u)=>u.includes(`
170
+ `)?`
171
+
172
+ $$
173
+ ${u.replace(/^[ \t]*\n?/,"").replace(/\n?[ \t]*$/,"")}
174
+ $$
175
+
176
+ `:d),(n.match(/\$\$/g)??[]).length%2===1&&(n=n.replace(/\$\$((?:(?!\$\$)[\s\S])+)$/,(d,u)=>{const h=u.replace(/^[ \t]*\n?/,"").replace(/\n?[ \t]*$/,"");return!h||!u.includes(`
177
+ `)?`$$${u}`:`
178
+
179
+ $$
180
+ ${h}
181
+ $$
182
+
183
+ `}))),n)).join("")}function gn(t){if(!t||!Number.isFinite(t))return"";const s=new Date(t);if(Number.isNaN(s.getTime()))return"";const n=new Date,r=f=>f.toString().padStart(2,"0"),i=`${r(s.getHours())}:${r(s.getMinutes())}`,d=s.getFullYear()===n.getFullYear();if(d&&s.getMonth()===n.getMonth()&&s.getDate()===n.getDate())return i;const h=`${s.getMonth()+1}-${s.getDate()} ${i}`;return d?h:`${s.getFullYear()}-${h}`}let Ze=null;function jn(){return Ze||(Ze=fe(()=>import("./mermaid.core-DfVdcmTH.js").then(t=>t.bm),__vite__mapDeps([0,1])).then(t=>{var r;const s=t.default,n=typeof window<"u"&&((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches);return s.initialize({startOnLoad:!1,theme:n?"dark":"default",securityLevel:"strict",fontFamily:"inherit"}),s})),Ze}function fs(t){if(!(typeof document>"u"))for(const s of[`#${t}`,`#d${t}`,`#${t}-temp`])document.querySelectorAll(s).forEach(n=>n.remove())}let vn=0;function yn({chart:t}){const[s,n]=a.useState(null),[r,i]=a.useState(null),d=a.useRef(`mermaid-${++vn}`);return a.useEffect(()=>{let u=!1;const h=d.current,f=t.trim();if(!f){n(null),i(null);return}return jn().then(async l=>(await l.parse(f),l.render(h,f))).then(({svg:l})=>{u||(n(l),i(null))}).catch(l=>{if(fs(h),u)return;const y=l instanceof Error?l.message:String(l);i(y),n(null)}),()=>{u=!0,fs(h)}},[t]),r?e.jsxs("div",{className:"mermaid-block mermaid-block-error",children:[e.jsxs("div",{className:"mermaid-error-banner",children:["⚠ Mermaid 渲染失败:",r]}),e.jsx("pre",{children:e.jsx("code",{className:"language-mermaid",children:t})})]}):s?e.jsx("div",{className:"mermaid-block",dangerouslySetInnerHTML:{__html:s}}):e.jsx("pre",{className:"mermaid-block mermaid-block-loading",children:e.jsx("code",{className:"language-mermaid",children:t})})}const wn=a.memo(yn),Ie=[at,rt,ot],Nn={strict:"ignore",throwOnError:!1,errorColor:"inherit",output:"htmlAndMathml"},Te=[tt,[nt,Nn]];function bn({className:t,children:s,...n}){const r=/language-(\w+)/.exec(t??"");if((r==null?void 0:r[1])==="mermaid"){const d=Array.isArray(s)?s.join(""):String(s??"");return e.jsx(wn,{chart:d.replace(/\n$/,"")})}return e.jsx("code",{className:t,...n,children:s})}const Ee={code:bn};function kn(t){if(t===0)return"—";const s=["B","KB","MB","GB"];let n=0,r=t;for(;r>=1024&&n<s.length-1;)r/=1024,n++;return`${r.toFixed(n===0?0:1)} ${s[n]}`}function Cn(t){return new Date(t).toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function Sn({open:t,onClose:s,sessionId:n}){const[r,i]=a.useState([]),[d,u]=a.useState(!1),[h,f]=a.useState(null),[l,y]=a.useState(null),p=a.useCallback(async()=>{if(!n||n==="__new_chat__"){i([]);return}u(!0),f(null);try{const c=await se(`/api/uploaded-files?sessionId=${encodeURIComponent(n)}`);if(c.error)throw new Error(c.error);i(c.files||[])}catch(c){f(c instanceof Error?c.message:String(c)),i([])}finally{u(!1)}},[n]);a.useEffect(()=>{t&&p()},[t,p]);const j=a.useCallback(async c=>{if(window.confirm(`确定删除文件 "${c.name}"?删除后无法恢复。`)){y(c.id);try{const E=await fetch("/api/uploaded-files/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:c.sessionId,fileId:c.id})}),C=await E.json();if(!E.ok||C.error)throw new Error(C.error||`HTTP ${E.status}`);await p()}catch(E){window.alert(`删除失败:${E instanceof Error?E.message:String(E)}`)}finally{y(null)}}},[p]),b=a.useCallback(c=>{const S=`/api/uploaded-files/download?sessionId=${encodeURIComponent(c.sessionId)}&fileId=${encodeURIComponent(c.id)}`;window.open(S,"_blank")},[]);return t?e.jsxs("div",{className:"uploaded-files-drawer",children:[e.jsxs("div",{className:"uploaded-files-drawer-header",children:[e.jsx("span",{className:"uploaded-files-drawer-title",children:"已上传的文件"}),e.jsxs("div",{className:"uploaded-files-drawer-actions",children:[e.jsx("button",{type:"button",className:"uploaded-files-drawer-btn",onClick:p,title:"刷新",disabled:d,children:e.jsx(Wt,{size:14,className:d?"spin":""})}),e.jsx("button",{type:"button",className:"uploaded-files-drawer-btn",onClick:s,title:"关闭",children:e.jsx(Ss,{size:14})})]})]}),e.jsxs("div",{className:"uploaded-files-drawer-body",children:[h&&e.jsxs("div",{className:"uploaded-files-drawer-error",children:["加载失败:",h]}),!h&&r.length===0&&!d&&e.jsx("div",{className:"uploaded-files-drawer-empty",children:"当前会话没有已上传的文件"}),r.map(c=>e.jsxs("div",{className:"uploaded-files-drawer-item",children:[e.jsx(It,{size:16,className:"uploaded-files-drawer-icon"}),e.jsxs("div",{className:"uploaded-files-drawer-info",children:[e.jsx("div",{className:"uploaded-files-drawer-name",title:c.name,children:c.name}),e.jsxs("div",{className:"uploaded-files-drawer-meta",children:[kn(c.size)," · ",c.mimeType," · ",Cn(c.uploadedAt)]}),e.jsxs("div",{className:"uploaded-files-drawer-id",title:c.id,children:["ID: ",c.id]})]}),e.jsx("button",{type:"button",className:"uploaded-files-drawer-btn",onClick:()=>b(c),title:"下载",children:e.jsx(_t,{size:14})}),e.jsx("button",{type:"button",className:"uploaded-files-drawer-btn danger",onClick:()=>j(c),disabled:l===c.id,title:"删除",children:e.jsx(Gt,{size:14})})]},c.id))]})]}):null}function ps(t){return new Promise((s,n)=>{const r=new FileReader;r.onload=()=>s(r.result),r.onerror=n,r.readAsDataURL(t)})}const _n=a.memo(a.forwardRef(function({loading:s,connected:n,canUpload:r,canUploadImage:i,canUploadFile:d,acceptAttr:u,onSend:h,onAbort:f},l){const[y,p]=a.useState(""),[j,b]=a.useState([]),[c,S]=a.useState([]),E=a.useRef([]),C=a.useRef(null),O=a.useRef(null),q=a.useCallback(()=>{const _=C.current;_&&(_.style.height="auto",_.style.height=`${_.scrollHeight}px`)},[]),w=a.useCallback(async _=>{const M=[],P=[],W=[];for(const J of Array.from(_))if(J.type.startsWith("image/")&&i){if(J.size>10*1024*1024)continue;const Z=await ps(J);M.push(Z),W.push("image")}else if(d){if(J.size>20*1024*1024)continue;const Z=await ps(J);P.push({name:J.name,data:Z,mimeType:J.type||void 0}),W.push("file")}M.length>0&&b(J=>[...J,...M]),P.length>0&&S(J=>[...J,...P]),W.length>0&&(E.current=[...E.current,...W])},[i,d]);a.useImperativeHandle(l,()=>({addFiles:w}),[w]);const V=a.useCallback(async()=>{await h(y,c,j,E.current),p(""),b([]),S([]),E.current=[],C.current&&(C.current.style.height="auto")},[y,c,j,h]),K=_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),V())},R=async _=>{_.target.files&&await w(_.target.files),_.target.value=""},ie=async _=>{var W;if(!i)return;const M=(W=_.clipboardData)==null?void 0:W.items;if(!M)return;const P=[];for(const J of Array.from(M)){if(!J.type.startsWith("image/"))continue;const Z=J.getAsFile();Z&&P.push(Z)}P.length>0&&await w(P)},N=_=>{b(W=>W.filter((J,Z)=>Z!==_));const M=[...E.current];let P=0;for(let W=0;W<M.length;W++)if(M[W]==="image"){if(P===_){M.splice(W,1);break}P++}E.current=M},L=_=>{S(W=>W.filter((J,Z)=>Z!==_));const M=[...E.current];let P=0;for(let W=0;W<M.length;W++)if(M[W]==="file"){if(P===_){M.splice(W,1);break}P++}E.current=M},m=E.current,x=new Array(j.length),H=new Array(c.length);{let _=0,M=0;for(let P=0;P<m.length;P++)m[P]==="image"?(_<x.length&&(x[_]=P+1),_++):m[P]==="file"&&(M<H.length&&(H[M]=P+1),M++)}const U=!!(y.trim()||j.length>0||c.length>0),Q=s&&!U;return e.jsxs(e.Fragment,{children:[j.length>0&&e.jsx("div",{className:"pending-images",children:j.map((_,M)=>e.jsxs("div",{className:"pending-image-item",children:[e.jsx("img",{src:_,alt:`pending-${M}`}),e.jsx("button",{className:"pending-image-remove",onClick:()=>N(M),children:"×"}),x[M]>0&&e.jsxs("span",{className:"pending-order-badge",children:["#",x[M]]})]},M))}),c.length>0&&e.jsx("div",{className:"pending-files",children:c.map((_,M)=>e.jsxs("div",{className:"pending-file-item",children:[H[M]>0&&e.jsxs("span",{className:"pending-file-order",children:["#",H[M]]}),e.jsx("span",{className:"pending-file-icon",children:e.jsx(es,{size:14})}),e.jsx("span",{className:"pending-file-name",children:_.name}),e.jsx("button",{className:"pending-file-remove",onClick:()=>L(M),children:"×"})]},M))}),e.jsxs("div",{className:"input-area",children:[e.jsx("input",{ref:O,type:"file",accept:u,multiple:!0,style:{display:"none"},onChange:R}),r&&e.jsx("button",{className:"upload-btn",onClick:()=>{var _;return(_=O.current)==null?void 0:_.click()},disabled:!n,title:i&&d?"上传图片或文件":i?"上传图片":"上传文件",children:e.jsx(Cs,{size:18})}),e.jsx("textarea",{ref:C,value:y,onChange:_=>{p(_.target.value),q()},onKeyDown:K,onPaste:ie,placeholder:"输入消息... (Enter 发送, Shift+Enter 换行)",disabled:!n,rows:1}),Q?e.jsx("button",{className:"send-btn stop-mode",onClick:f,title:"停止生成",children:e.jsx(Ht,{size:16})}):e.jsx("button",{className:"send-btn",onClick:()=>{V()},disabled:!n||!U,children:"↑"})]})]})}));function $n({startTime:t,endTime:s}){const[n,r]=a.useState(Date.now());if(a.useEffect(()=>{if(s||!t)return;const d=setInterval(()=>r(Date.now()),100);return()=>clearInterval(d)},[t,s]),!t)return null;const i=((s||n)-t)/1e3;return e.jsxs("span",{className:"tool-call-timer",children:[i.toFixed(1),"s"]})}function xs({startTime:t,endTime:s}){const[n,r]=a.useState(Date.now());a.useEffect(()=>{if(s)return;let d;const u=()=>{r(Date.now()),d=requestAnimationFrame(u)};return d=requestAnimationFrame(u),()=>cancelAnimationFrame(d)},[s]);const i=((s||n)-t)/1e3;return e.jsxs("span",{className:"compress-timer",children:[i.toFixed(1),"s"]})}function Mn({seg:t,index:s}){return e.jsxs("details",{className:"tool-call-block",children:[e.jsxs("summary",{className:"tool-call-summary",children:[e.jsx(os,{size:14})," ",t.name,t.result==null?" …":"",e.jsx($n,{startTime:t.startTime,endTime:t.endTime})]}),e.jsxs("div",{className:"tool-call-content",children:[e.jsxs("div",{className:"tool-call-args",children:[e.jsx("strong",{children:"参数"}),e.jsx("pre",{children:JSON.stringify(t.args,null,2)})]}),t.result!=null&&e.jsxs("div",{className:"tool-call-result",children:[e.jsx("strong",{children:"结果"}),e.jsx("pre",{children:t.result})]})]})]},s)}const In=[".txt",".md",".csv",".json",".xml",".html",".htm",".css",".js",".ts",".yaml",".yml",".ini",".cfg",".conf",".log",".sh",".py",".java",".c",".cpp",".h",".rs",".go",".rb",".php",".sql",".pdf",".docx"],Tn=In.join(",")+",text/*,application/pdf,application/vnd.openxmlformats-officedocument.wordprocessingml.document";function En(t){const s=t.trim();if(!s.startsWith("{"))return null;try{const n=JSON.parse(s);return typeof n!="object"||n===null||Array.isArray(n)?null:n}catch{return null}}function Ln(t){const s=t.trim();if(!s.startsWith("{"))return null;const n=[];let r=1;const i=()=>{for(;r<s.length&&/[\s,]/.test(s[r]);)r++};for(;r<s.length&&(i(),!(r>=s.length||s[r]==="}"||s[r]!=='"'));){r++;let d="",u=!1;for(;r<s.length;)if(s[r]==="\\"&&r+1<s.length)d+=s[r+1],r+=2;else if(s[r]==='"'){u=!0,r++;break}else d+=s[r],r++;if(!u){n.push({key:d,keyDone:!1,value:"",valueDone:!1,valueType:"unknown"});break}if(i(),r>=s.length||s[r]!==":"){n.push({key:d,keyDone:!0,value:"",valueDone:!1,valueType:"unknown"});break}if(r++,i(),r>=s.length){n.push({key:d,keyDone:!0,value:"",valueDone:!1,valueType:"unknown"});break}if(s[r]==='"'){r++;let h="",f=!1;for(;r<s.length;)if(s[r]==="\\"&&r+1<s.length){const l=s[r+1];h+=l==="n"?`
184
+ `:l==="t"?" ":l==='"'?'"':l==="\\"?"\\":l,r+=2}else if(s[r]==='"'){f=!0,r++;break}else h+=s[r],r++;n.push({key:d,keyDone:!0,value:h,valueDone:f,valueType:"string"})}else if(s[r]==="{"||s[r]==="["){const h=s[r],f=h==="{"?"}":"]";let l=1;const y=r;r++;let p=!1;for(;r<s.length&&l>0;)p?s[r]==="\\"?r++:s[r]==='"'&&(p=!1):s[r]==='"'?p=!0:s[r]===h?l++:s[r]===f&&l--,r++;n.push({key:d,keyDone:!0,value:s.slice(y,r),valueDone:l===0,valueType:h==="{"?"object":"array"})}else{let h="";for(;r<s.length&&!/[,\s}]/.test(s[r]);)h+=s[r],r++;const f=r<s.length&&/[,}]/.test(s[r]),l=/^(true|false)$/.test(h)?"boolean":h==="null"?"null":"number";n.push({key:d,keyDone:!0,value:h,valueDone:f,valueType:l})}}return n.length>0?n:null}const Is={mood:"心情",state:"状态",desire:"发言欲望",current_action:"当前动作",think:"思考",message:"回复",response:"回复",reply:"回复",content:"内容",analysis:"分析",file_analysis:"文件分析",image_analysis:"图片分析"},Ts=new Set(["message","response","reply","content","answer","text","msg"]);function Rn({label:t,data:s}){const[n,r]=a.useState(!0);return e.jsxs("div",{className:"json-field json-field-group",children:[e.jsxs("div",{className:"json-field-header json-field-toggle",onClick:()=>r(!n),children:[n?e.jsx(ws,{size:14}):e.jsx(Ns,{size:14}),e.jsx("span",{className:"json-field-label",children:t})]}),n&&e.jsx("div",{className:"json-field-children",children:Object.entries(s).map(([i,d])=>e.jsx(Es,{fieldKey:i,value:d},i))})]})}function Es({fieldKey:t,value:s}){const n=Is[t]||t;if(s==null||s==="")return null;if(typeof s=="object"&&!Array.isArray(s))return e.jsx(Rn,{label:n,data:s});if(Array.isArray(s))return e.jsxs("div",{className:"json-field",children:[e.jsx("span",{className:"json-field-label",children:n}),e.jsx("span",{className:"json-field-value",children:s.map(String).join(", ")})]});const r=String(s),i=Ts.has(t);return e.jsxs("div",{className:`json-field${i?" json-field-reply":""}`,children:[e.jsx("span",{className:"json-field-label",children:n}),i?e.jsx("div",{className:"json-field-value json-field-value-md",children:e.jsx($e,{remarkPlugins:Ie,rehypePlugins:Te,components:Ee,children:Me(r)})}):e.jsx("span",{className:"json-field-value",children:r})]})}function Dn({data:t}){return e.jsx("div",{className:"json-message-view",children:Object.entries(t).map(([s,n])=>e.jsx(Es,{fieldKey:s,value:n},s))})}function Pn({fields:t}){return e.jsx("div",{className:"json-message-view",children:t.map((s,n)=>{const i=n===t.length-1&&(!s.valueDone||!s.keyDone),d=s.keyDone&&Is[s.key]||s.key,u=s.keyDone&&Ts.has(s.key);return e.jsxs("div",{className:`json-field${u?" json-field-reply":""}`,children:[e.jsxs("span",{className:`json-field-label${s.keyDone?"":" json-field-partial"}`,children:[d,!s.keyDone&&i&&e.jsx("span",{className:"streaming-cursor"})]}),s.keyDone&&(u&&s.value?e.jsxs("div",{className:"json-field-value json-field-value-md",children:[e.jsx($e,{remarkPlugins:Ie,rehypePlugins:Te,components:Ee,children:Me(s.value)}),i&&e.jsx("span",{className:"streaming-cursor"})]}):e.jsxs("span",{className:"json-field-value",children:[s.value,i&&e.jsx("span",{className:"streaming-cursor"})]}))]},n)})})}const Qe=a.memo(function({content:s}){const n=En(s);if(n)return e.jsx(Dn,{data:n});if(s.trim().startsWith("{")){const i=Ln(s);return i?e.jsx(Pn,{fields:i}):null}return e.jsx($e,{remarkPlugins:Ie,rehypePlugins:Te,components:Ee,children:Me(s)})});function An(t){if(!t)return"";const s=[];return t.image&&s.push("image/*"),t.file&&s.push(Tn),s.push("audio/*"),s.push("video/*"),s.join(",")}function zn({status:t}){switch(t){case"completed":return e.jsx(bs,{size:14,className:"todo-icon todo-icon-done"});case"in-progress":return e.jsx(ss,{size:14,className:"todo-icon todo-icon-active"});default:return e.jsx(bt,{size:14,className:"todo-icon todo-icon-pending"})}}function On({items:t,onClear:s,loading:n}){const[r,i]=a.useState(!0),d=t.filter(l=>l.status==="completed").length,u=t.length,h=d===u,f=!h&&n;return e.jsxs("div",{className:`todo-bar ${h?"todo-bar-done":""}`,children:[e.jsxs("div",{className:"todo-bar-header",onClick:()=>i(!r),children:[e.jsx(Dt,{size:15,className:"todo-bar-icon"}),e.jsx("span",{className:"todo-bar-title",children:"任务计划"}),e.jsxs("span",{className:"todo-bar-count",children:[d,"/",u]}),e.jsx("div",{className:"todo-bar-progress",children:e.jsx("div",{className:"todo-bar-progress-fill",style:{width:`${u>0?d/u*100:0}%`}})}),e.jsx("button",{className:"todo-bar-toggle",title:r?"收起":"展开",children:r?e.jsx(ws,{size:14}):e.jsx(Ns,{size:14})}),e.jsx("button",{className:"todo-bar-clear",onClick:l=>{l.stopPropagation(),f||s()},disabled:f,title:f?"任务执行中,无法清除":"清除计划",children:e.jsx(Ss,{size:14})})]}),r&&e.jsx("div",{className:"todo-bar-list",children:t.map(l=>e.jsxs("div",{className:`todo-item todo-item-${l.status}`,children:[e.jsx(zn,{status:l.status}),e.jsx("span",{className:"todo-item-title",children:l.title})]},l.id))})]})}const as="aalis:open-lightbox";function gs(t){window.dispatchEvent(new CustomEvent(as,{detail:t}))}const Fn=a.memo(function({msg:s,senderName:n,isLast:r,isGenerating:i,onAbort:d,checkpoint:u,rolledBack:h,onRollback:f,onRollbackWithChat:l,toolCallsProgress:y}){return s.role==="system"?e.jsxs("div",{className:"system-event-separator",children:[e.jsx("span",{className:"system-event-line"}),e.jsxs("span",{className:"system-event-text",children:[e.jsx(ys,{size:12})," ",s.content]}),e.jsx("span",{className:"system-event-line"})]}):e.jsxs("div",{className:`message-group ${s.role}`,children:[e.jsxs("div",{className:"message-sender",children:[e.jsx("span",{className:"message-sender-name",children:s.role==="user"?"You":n}),s.timestamp?e.jsx("span",{className:"message-time",title:new Date(s.timestamp).toLocaleString(),children:gn(s.timestamp)}):null,s.role==="assistant"&&s.modelInfo&&(s.modelInfo.model||s.modelInfo.completionTokens!=null)?e.jsxs("span",{className:"message-model-badge",title:[s.modelInfo.provider&&s.modelInfo.model?`${s.modelInfo.provider} / ${s.modelInfo.model}`:s.modelInfo.model,s.modelInfo.completionTokens!=null?`本次生成 ${s.modelInfo.completionTokens} tok`:null,s.modelInfo.promptTokens!=null?`上下文 ${s.modelInfo.promptTokens} tok`:null,s.modelInfo.elapsedMs!=null?`耗时 ${(s.modelInfo.elapsedMs/1e3).toFixed(1)}s`:null].filter(Boolean).join(" · "),children:[s.modelInfo.model??"",s.modelInfo.completionTokens!=null?` · ${(s.modelInfo.completionTokens/1e3).toFixed(1)}k`:"",s.modelInfo.elapsedMs!=null?` · ${(s.modelInfo.elapsedMs/1e3).toFixed(1)}s`:""]}):null]}),s.role==="user"&&s.images&&s.images.length>0&&e.jsx("div",{className:"message-images",children:s.images.map((p,j)=>e.jsx("div",{className:"message-image-wrap",children:e.jsx("img",{src:ke(p),alt:`attached-${j}`,className:"message-image",onClick:()=>gs(ke(p))})},j))}),s.role==="user"&&s.fileNames&&s.fileNames.length>0&&e.jsx("div",{className:"message-files",children:s.fileNames.map((p,j)=>e.jsxs("div",{className:"message-file-item",children:[e.jsx(es,{size:14})," ",p]},j))}),s.role==="assistant"&&s.attachments&&s.attachments.length>0&&e.jsx("div",{className:"message-images",children:s.attachments.map((p,j)=>p.kind==="image"?e.jsx("div",{className:"message-image-wrap",children:e.jsx("img",{src:ke(p.data),alt:p.name??`attachment-${j}`,className:"message-image",onClick:()=>gs(ke(p.data))})},`a-${j}`):p.kind==="video"?e.jsx("video",{controls:!0,src:ke(p.data),className:"message-image"},`a-${j}`):p.kind==="audio"?e.jsx("audio",{controls:!0,src:ke(p.data)},`a-${j}`):e.jsxs("div",{className:"message-file-item",children:[e.jsx(es,{size:14})," ",p.name??"attachment"]},`a-${j}`))}),s.role==="assistant"&&s.segments&&s.segments.length>0?e.jsx("div",{className:"message-bubble",children:(()=>{const p=[];let j=0;for(;j<s.segments.length;){const b=s.segments[j];if(b.type==="reasoning_text"){const c=[];for(;j<s.segments.length&&s.segments[j].type==="reasoning_text";)c.push(s.segments[j]),j++;const S=c.filter(E=>E.type==="reasoning_text").map(E=>E.content).join("");S&&p.push(e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(hs,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx($e,{remarkPlugins:Ie,rehypePlugins:Te,components:Ee,children:Me(S)})})]},`r-${j}`));continue}if(b.type==="text"){b.content&&p.push(e.jsx(Qe,{content:b.content},`t-${j}`)),j++;continue}p.push(e.jsx(Mn,{seg:b,index:j},`tc-${j}`)),j++}return p})()}):s.role==="assistant"&&s.reasoningContent?e.jsxs(e.Fragment,{children:[e.jsxs("details",{className:"thinking-block",children:[e.jsxs("summary",{className:"thinking-summary",children:[e.jsx(hs,{size:14})," 思考过程"]}),e.jsx("div",{className:"thinking-content",children:e.jsx($e,{remarkPlugins:Ie,rehypePlugins:Te,components:Ee,children:Me(s.reasoningContent)})})]}),e.jsx("div",{className:"message-bubble",children:e.jsx(Qe,{content:s.content})})]}):e.jsx("div",{className:"message-bubble",children:s.role==="assistant"?e.jsx(Qe,{content:s.content}):s.content}),s.role==="assistant"&&y&&y.size>0&&e.jsx("div",{className:"tool-call-progress-bubble",children:[...y.entries()].sort((p,j)=>p[0]-j[0]).map(([p,j])=>e.jsx(Ls,{name:j.name,charsAccumulated:j.charsAccumulated,startedAt:j.startedAt},`pending-${p}`))}),r&&i&&s.role==="assistant"&&e.jsx("button",{className:"stop-generate-btn",onClick:d,title:"停止生成",children:"■ 停止生成"}),s.role==="assistant"&&u&&!i&&(h?e.jsxs("span",{className:"checkpoint-rolled-back",children:[e.jsx(Ue,{size:12})," 此次修改已回滚"]}):e.jsxs("div",{className:"checkpoint-rollback-actions",children:[u.fileCount>0&&e.jsxs("button",{className:"checkpoint-rollback-btn",onClick:()=>f==null?void 0:f(u),title:`仅回滚本回合的 ${u.fileCount} 个文件改动(保留对话)${u.execUsed?`
185
+ 注意:本回合调用过 exec/shell,命令副作用无法回滚`:""}`,children:[e.jsx(Ue,{size:12})," 回滚文件改动",u.execUsed&&e.jsxs("span",{className:"checkpoint-warn",children:[e.jsx(Oe,{size:11})," exec"]})]}),e.jsxs("button",{className:"checkpoint-rollback-btn",onClick:()=>l==null?void 0:l(u),title:`回滚本轮对话(含 ${u.fileCount} 处文件改动):删除本轮的用户提问、回复和工具调用记录,并恢复文件${u.execUsed?`
186
+ 注意:本回合调用过 exec/shell,命令副作用无法回滚`:""}`,children:[e.jsx(Ue,{size:12})," 回滚本轮对话(含文件)",u.execUsed&&e.jsxs("span",{className:"checkpoint-warn",children:[e.jsx(Oe,{size:11})," exec"]})]})]}))]})});function Ls({name:t,charsAccumulated:s,startedAt:n}){const[r,i]=a.useState(Date.now()-n);a.useEffect(()=>{const u=window.setInterval(()=>i(Date.now()-n),100);return()=>window.clearInterval(u)},[n]);const d=(r/1e3).toFixed(1);return e.jsx("div",{className:"tool-call-block tool-call-block-pending","aria-live":"polite",children:e.jsxs("div",{className:"tool-call-summary",children:[e.jsx("span",{className:"tool-call-progress-icon",children:e.jsx(os,{size:14})}),e.jsx("span",{children:t||"正在生成…"}),e.jsxs("span",{className:"tool-call-progress-meta",children:[s," 字符 · ",d,"s"]})]})})}function Wn({messages:t,loading:s,connected:n,status:r,onSend:i,onAbort:d,width:u,sessionTitle:h,onNewSession:f,todoItems:l,onClearTodos:y,toolLimitReached:p,onContinueTools:j,toolCallsProgress:b,tokenUsage:c,compressingStatus:S,onCompress:E,onOpenNav:C}){const O=a.useRef(null),q=a.useRef(null),w=a.useRef(null),V=a.useRef(!1),[K,R]=a.useState([]),[ie,N]=a.useState(new Set),L=a.useRef(s);a.useEffect(()=>{let g=!1;async function D(){try{const F=ae();if(!F||F==="__new_chat__"){g||R([]);return}const Y=await he("@aalis/plugin-checkpoint","listTurns",{sessionId:F});!g&&Array.isArray(Y)&&R(Y)}catch{}}return L.current&&!s?D():t.length===0?R([]):D(),L.current=s,()=>{g=!0}},[s,h,t.length]);const m=a.useMemo(()=>g=>{for(const D of K){const F=D.startedAt-1e3,Y=(D.endedAt??D.startedAt+6e4)+5e3;if(g>=F&&g<=Y)return D}},[K]),x=a.useCallback(async g=>{const D=g.filesPreview.slice(0,3).join(`
187
+ `),F=g.fileCount>g.filesPreview.length?`
188
+ ... 共 ${g.fileCount} 个文件`:"",Y=g.execUsed?`
189
+
190
+ ⚠ 本回合调用过 exec/shell,命令的副作用无法回滚!`:"";if(window.confirm(`将回滚此回合的文件改动:
191
+
192
+ ${D}${F}${Y}
193
+
194
+ 确定继续?`))try{const de=await he("@aalis/plugin-checkpoint","rollback",{sessionId:ae(),turnId:g.turnId}),ne=`回滚完成:恢复 ${de.restored.length} 个,删除 ${de.deleted.length} 个`;de.errors.length>0?window.alert(`${ne}
195
+ 失败 ${de.errors.length} 个(如有新建文件在不可删除的根下,需手动删除):
196
+ `+de.errors.map(X=>`${X.uri}: ${X.reason}`).join(`
197
+ `)):window.alert(ne),N(X=>new Set([...X,g.turnId]))}catch(de){window.alert(`回滚失败:${de.message}`)}},[]),H=a.useCallback(async g=>{const D=g.filesPreview.slice(0,3).join(`
198
+ `),F=g.fileCount>g.filesPreview.length?`
199
+ ... 共 ${g.fileCount} 个文件`:"",Y=g.execUsed?`
200
+
201
+ ⚠ 本回合调用过 exec/shell,命令的副作用无法回滚!`:"",Ne=g.fileCount>0?`
202
+
203
+ 同时恢复以下文件:
204
+ ${D}${F}`:"";if(window.confirm(`将回滚本轮对话:
205
+
206
+ · 删除本轮的用户提问、AI 回复和工具调用记录
207
+ · 清除对应的向量记忆条目${Ne}${Y}
208
+
209
+ 此操作不可撤销。确定继续?`))try{const ne=await he("@aalis/plugin-checkpoint","rollbackWithChat",{sessionId:ae(),turnId:g.turnId}),X=[];ne.chatDeleted&&X.push(`删除 ${ne.deletedMessages} 条消息`),g.fileCount>0&&X.push(`恢复 ${ne.restored.length} 个文件,删除 ${ne.deleted.length} 个新建文件`);const Se=X.length>0?`回滚完成:${X.join(";")}`:"回滚完成";ne.errors.length>0&&window.alert(`${Se}
210
+ 失败 ${ne.errors.length} 项:
211
+ `+ne.errors.map(oe=>`${oe.uri||"(memory)"}: ${oe.reason}`).join(`
212
+ `)),N(oe=>new Set([...oe,g.turnId]))}catch(ne){window.alert(`回滚失败:${ne.message}`)}},[]),U=a.useRef(null),Q=a.useRef(!1),[_,M]=a.useState(!1),P=a.useRef(0),[W,J]=a.useState(!1),[Z,Le]=a.useState(!1),[le,ce]=a.useState(null),je=a.useRef(0),ye=a.useRef(0);a.useEffect(()=>{const g=F=>{const Y=F.detail;typeof Y=="string"&&ce(Y)},D=F=>{F.key==="Escape"&&ce(null)};return window.addEventListener(as,g),window.addEventListener("keydown",D),()=>{window.removeEventListener(as,g),window.removeEventListener("keydown",D)}},[]);const re=r==null?void 0:r.uploadCapabilities,ve=(re==null?void 0:re.image)??!1,Re=(re==null?void 0:re.file)??!1,Ce=ve||Re,pe=An(re);a.useEffect(()=>{S==="start"?(je.current=Date.now(),ye.current=0):(S==="done"||S==="error")&&(ye.current=Date.now())},[S]),a.useEffect(()=>{const g=w.current;if(!g)return;const D=()=>{const{scrollTop:F,scrollHeight:Y,clientHeight:Ne}=g;V.current=Y-F-Ne>200,Q.current=!0,U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{Q.current=!1},300)};return g.addEventListener("scroll",D,{passive:!0}),()=>g.removeEventListener("scroll",D)},[]),a.useEffect(()=>{const g=w.current;if(!g)return;const D=new ResizeObserver(()=>{var F;!V.current&&!Q.current&&((F=q.current)==null||F.scrollIntoView({behavior:s?"instant":"smooth"}))});return D.observe(g),()=>D.disconnect()},[t.length]),a.useEffect(()=>{var g;!V.current&&!Q.current&&((g=q.current)==null||g.scrollIntoView({behavior:"smooth"}))},[t]);const De=a.useCallback((g,D,F,Y)=>i(g,D,F,Y),[i]),Pe=g=>{g.preventDefault(),g.stopPropagation(),P.current++,Ce&&g.dataTransfer.types.includes("Files")&&M(!0)},Fe=g=>{g.preventDefault(),g.stopPropagation(),P.current--,P.current<=0&&(P.current=0,M(!1))},We=g=>{g.preventDefault(),g.stopPropagation()},Be=async g=>{var D;g.preventDefault(),g.stopPropagation(),P.current=0,M(!1),!(!Ce||!g.dataTransfer.files.length)&&await((D=O.current)==null?void 0:D.addFiles(g.dataTransfer.files))},me=t[t.length-1],we=(me==null?void 0:me.role)==="assistant"&&s;return e.jsxs("div",{className:`chat-panel${_?" drag-over":""}`,style:{width:u},onDragEnter:Pe,onDragLeave:Fe,onDragOver:We,onDrop:Be,children:[_&&e.jsx("div",{className:"drag-overlay",children:e.jsxs("div",{className:"drag-overlay-content",children:[e.jsx(Cs,{size:16})," 松开以上传文件"]})}),e.jsxs("div",{className:"chat-panel-header",children:[C&&e.jsx("button",{className:"chat-panel-nav-btn",onClick:C,"aria-label":"打开菜单",children:e.jsx(ks,{size:19})}),e.jsxs("span",{className:"chat-panel-title",children:[e.jsx(ze,{size:16})," ",h||(r==null?void 0:r.name)||"Aalis"]}),e.jsxs("div",{className:"chat-panel-header-actions",children:[e.jsxs("div",{className:"token-usage-badge",onMouseEnter:C?void 0:()=>J(!0),onMouseLeave:C?void 0:()=>J(!1),onClick:C?()=>J(g=>!g):void 0,children:[e.jsx(_s,{size:12}),e.jsx("span",{className:`token-usage-number${c&&c.usageRatio>.85?" warn":c&&c.usageRatio>.7?" caution":""}`,children:c?c.used.toLocaleString():"--"}),W&&e.jsxs("div",{className:"token-usage-panel",children:[e.jsx("div",{className:"token-panel-title",children:"Token 使用情况"}),c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"token-panel-bar",children:e.jsx("div",{className:`token-panel-bar-fill${c.usageRatio>.85?" warn":c.usageRatio>.7?" caution":""}`,style:{width:`${Math.min(100,c.usageRatio*100)}%`}})}),e.jsxs("div",{className:"token-panel-ratio",children:[(c.usageRatio*100).toFixed(1),"% 已使用"]}),e.jsxs("div",{className:"token-panel-rows",children:[e.jsxs("div",{className:"token-panel-row",children:[e.jsx("span",{children:"上下文窗口"}),e.jsx("span",{children:c.contextWindow.toLocaleString()})]}),e.jsxs("div",{className:"token-panel-section-header",children:["系统提示词 ",e.jsx("span",{className:"token-panel-section-total",children:c.breakdown.system.toLocaleString()})]}),e.jsxs("div",{className:"token-panel-row sub",children:[e.jsx("span",{children:"人设 / Persona"}),e.jsx("span",{children:c.breakdown.persona.toLocaleString()})]}),c.breakdown.memorySummary>0&&e.jsxs("div",{className:"token-panel-row sub",children:[e.jsx("span",{children:"对话摘要"}),e.jsx("span",{children:c.breakdown.memorySummary.toLocaleString()})]}),c.breakdown.memoryVector>0&&e.jsxs("div",{className:"token-panel-row sub",children:[e.jsx("span",{children:"向量记忆"}),e.jsx("span",{children:c.breakdown.memoryVector.toLocaleString()})]}),c.breakdown.skills>0&&e.jsxs("div",{className:"token-panel-row sub",children:[e.jsx("span",{children:"技能描述"}),e.jsx("span",{children:c.breakdown.skills.toLocaleString()})]}),c.breakdown.platform>0&&e.jsxs("div",{className:"token-panel-row sub",children:[e.jsx("span",{children:"平台提示"}),e.jsx("span",{children:c.breakdown.platform.toLocaleString()})]}),c.breakdown.subtask>0&&e.jsxs("div",{className:"token-panel-row sub",children:[e.jsx("span",{children:"子任务上下文"}),e.jsx("span",{children:c.breakdown.subtask.toLocaleString()})]}),c.breakdown.systemOther>0&&e.jsxs("div",{className:"token-panel-row sub",children:[e.jsx("span",{children:"其他系统提示"}),e.jsx("span",{children:c.breakdown.systemOther.toLocaleString()})]}),e.jsxs("div",{className:"token-panel-row",children:[e.jsx("span",{children:"历史消息"}),e.jsx("span",{children:c.breakdown.history.toLocaleString()})]}),e.jsxs("div",{className:"token-panel-row",children:[e.jsx("span",{children:"工具结果"}),e.jsx("span",{children:c.breakdown.toolResults.toLocaleString()})]}),e.jsxs("div",{className:"token-panel-row",children:[e.jsx("span",{children:"工具定义"}),e.jsx("span",{children:c.breakdown.toolDefs.toLocaleString()})]}),e.jsxs("div",{className:"token-panel-row",children:[e.jsx("span",{children:"回复保留量"}),e.jsx("span",{children:c.breakdown.reservedForReply.toLocaleString()})]})]}),E&&e.jsx("button",{className:"token-panel-compress-btn",onClick:g=>{g.stopPropagation(),E()},disabled:S==="start",children:S==="start"?e.jsxs(e.Fragment,{children:[e.jsx(ss,{size:12,className:"compress-spinner"})," 压缩中…"]}):e.jsxs(e.Fragment,{children:[e.jsx(ys,{size:12})," 压缩对话"]})})]}):e.jsx("div",{className:"token-panel-empty",children:"发送消息后将显示 Token 用量统计"})]})]}),f&&e.jsx("button",{className:"chat-panel-new-btn",onClick:f,title:"新对话",children:"+"}),e.jsx("button",{className:"chat-panel-new-btn",onClick:()=>Le(g=>!g),title:"已上传的文件","aria-label":"已上传的文件",children:e.jsx(Et,{size:14})})]})]}),e.jsx(Sn,{open:Z,onClose:()=>Le(!1),sessionId:ae()}),e.jsxs("div",{className:"messages",ref:w,children:[t.length===0&&e.jsxs("div",{className:"empty",children:[e.jsx("div",{className:"empty-icon",children:e.jsx(ze,{size:40})}),"开始和 ",(r==null?void 0:r.name)??"Aalis"," 对话吧"]}),t.map((g,D)=>{const F=D===t.length-1;return e.jsx(Fn,{msg:g,senderName:(r==null?void 0:r.name)??"Aalis",isLast:F,isGenerating:we,onAbort:d,checkpoint:g.role==="assistant"?m(g.timestamp):void 0,rolledBack:g.role==="assistant"?(()=>{const Y=m(g.timestamp);return Y?ie.has(Y.turnId):!1})():!1,onRollback:x,onRollbackWithChat:H,toolCallsProgress:F&&g.role==="assistant"&&we?b:void 0},D)}),s&&(!me||me.role!=="assistant")&&e.jsxs("div",{className:"message-group assistant",children:[e.jsx("div",{className:"message-sender",children:(r==null?void 0:r.name)??"Aalis"}),e.jsx("div",{className:"message-bubble",children:b&&b.size>0?[...b.entries()].sort((g,D)=>g[0]-D[0]).map(([g,D])=>e.jsx(Ls,{name:D.name,charsAccumulated:D.charsAccumulated,startedAt:D.startedAt},`pending-${g}`)):e.jsxs("div",{className:"typing-indicator",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}),e.jsx("button",{className:"stop-generate-btn",onClick:d,title:"停止生成",children:"■ 停止生成"})]}),p&&!s&&e.jsxs("div",{className:"tool-limit-bar",children:[e.jsx("span",{className:"tool-limit-text",children:"⚠ 工具调用次数已达上限"}),e.jsxs("div",{className:"tool-limit-actions",children:[j&&e.jsx("button",{className:"tool-limit-btn continue",onClick:j,children:"继续迭代"}),e.jsx("span",{className:"tool-limit-hint",children:"或输入新内容引导模型"})]})]}),S==="start"&&e.jsxs("div",{className:"system-event-separator compressing",children:[e.jsx("span",{className:"system-event-line"}),e.jsxs("span",{className:"system-event-text",children:[e.jsx(ss,{size:12,className:"compress-spinner"})," 压缩对话中 ",e.jsx(xs,{startTime:je.current})]}),e.jsx("span",{className:"system-event-line"})]}),S==="done"&&e.jsxs("div",{className:"system-event-separator compress-done",children:[e.jsx("span",{className:"system-event-line"}),e.jsxs("span",{className:"system-event-text",children:[e.jsx(bs,{size:12})," 已压缩对话 ",e.jsx(xs,{startTime:je.current,endTime:ye.current})]}),e.jsx("span",{className:"system-event-line"})]}),S==="error"&&e.jsxs("div",{className:"system-event-separator compress-error",children:[e.jsx("span",{className:"system-event-line"}),e.jsxs("span",{className:"system-event-text",children:[e.jsx(Oe,{size:12})," 压缩失败"]}),e.jsx("span",{className:"system-event-line"})]}),e.jsx("div",{ref:q})]}),l&&l.length>0&&y&&e.jsx(On,{items:l,onClear:y,loading:s}),e.jsx(_n,{ref:O,loading:s,connected:n,canUpload:Ce,canUploadImage:ve,canUploadFile:Re,acceptAttr:pe,onSend:De,onAbort:d}),le&&e.jsxs("div",{className:"image-lightbox",onClick:()=>ce(null),children:[e.jsx("img",{src:le,alt:"预览",className:"image-lightbox-content",onClick:g=>g.stopPropagation()}),e.jsx("button",{type:"button",className:"image-lightbox-close",onClick:()=>ce(null),"aria-label":"关闭",children:"×"})]})]})}const Bn=a.lazy(()=>fe(()=>import("./PluginConfigPage-DIn8fL_h.js"),__vite__mapDeps([2,1,3,4,5,6,7,8,9])).then(t=>({default:t.PluginConfigPage}))),qn=a.lazy(()=>fe(()=>import("./MarketplacePage-DXmX9rkf.js"),__vite__mapDeps([10,1,4,11,5,6,7,8,9])).then(t=>({default:t.MarketplacePage}))),Vn=a.lazy(()=>fe(()=>import("./PlatformPage-D8vZKsvZ.js"),__vite__mapDeps([12,1,13,5,6,7,8,9])).then(t=>({default:t.PlatformPage}))),Hn=a.lazy(()=>fe(()=>import("./AuthorityPage-D3c_GhYg.js"),__vite__mapDeps([14,1,11,5,6,7,8,9])).then(t=>({default:t.AuthorityPage}))),Jn=a.lazy(()=>fe(()=>import("./LogPage-BTvnnjEI.js"),__vite__mapDeps([15,1])).then(t=>({default:t.LogPage}))),Gn=a.lazy(()=>fe(()=>import("./SessionsPage-CYFjpcjv.js"),__vite__mapDeps([16,1,9,7,8,5,6])).then(t=>({default:t.SessionsPage}))),Kn=a.lazy(()=>fe(()=>import("./FilesPage-BYyEd_Xb.js"),__vite__mapDeps([17,1,5,6,7,8,9])).then(t=>({default:t.FilesPage}))),Un=a.lazy(()=>fe(()=>import("./DynamicPage-B5APLJwu.js"),__vite__mapDeps([18,1,3,19,20,13,11,9,7,8,5,6])).then(t=>({default:t.DynamicPage}))),js=2e3,rs="(max-width: 768px)";function Yn(){const[t,s]=a.useState(()=>typeof window<"u"&&window.matchMedia(rs).matches);return a.useEffect(()=>{const n=window.matchMedia(rs),r=i=>s(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),t}function Xn(){var ls,cs;const[t,s]=a.useState(()=>location.hash.replace("#","")||"dashboard"),n=Yn(),[r,i]=a.useState("chat"),[d,u]=a.useState(!1);a.useEffect(()=>{n||u(!1)},[n]);const[h,f]=a.useState(null),[l,y]=a.useState([]);a.useEffect(()=>{location.hash=t},[t]),a.useEffect(()=>{h&&!h.has(t)&&s("dashboard")},[h,t]);const[p,j]=a.useState([]),[b,c]=a.useState(null),[S,E]=a.useState(null),[C,O]=a.useState(null),[q,w]=a.useState([]),[V,K]=a.useState(null),R=hn(l),{messages:ie,setMessages:N,loading:L,setLoading:m,streamingRef:x}=R,H=a.useRef({pending:[],raf:0}),[U,Q]=a.useState(0),[_,M]=a.useState([]),[P,W]=a.useState(()=>{if(typeof window>"u")return 420;const o=Number(window.localStorage.getItem("aalis:chatWidth"));return Number.isFinite(o)&&o>=280?o:420});a.useEffect(()=>{try{window.localStorage.setItem("aalis:chatWidth",String(P))}catch{}},[P]),a.useEffect(()=>{const o=document.querySelector(".app-layout");if(!o||typeof ResizeObserver>"u")return;const v=360,k=240,T=()=>{var ee;if(window.matchMedia(rs).matches)return;const $=o.clientWidth,z=((ee=document.querySelector(".nav-rail"))==null?void 0:ee.getBoundingClientRect().width)??56,A=Math.max(k,$-z-v);W(G=>Math.min(Math.max(G,k),A))},I=new ResizeObserver(T);return I.observe(o),()=>I.disconnect()},[]);const[J,Z]=a.useState(!1),[Le,le]=a.useState(new Map),[ce,je]=a.useState(!1),[ye,re]=a.useState(!1),[ve,Re]=a.useState(!1),[Ce,pe]=a.useState("正在重启…"),[De,Pe]=a.useState(!1),[Fe,We]=a.useState(null),[Be,me]=a.useState(null),we=(o,v)=>{const k=o?[...o]:[],T=k[k.length-1];return v.type==="text"&&T&&T.type==="text"?k[k.length-1]={type:"text",content:T.content+v.content}:v.type==="reasoning_text"&&T&&T.type==="reasoning_text"?k[k.length-1]={type:"reasoning_text",content:T.content+v.content}:k.push(v),k},g=o=>{let v="",k="";for(const T of o??[])T.type==="text"?v+=T.content:T.type==="reasoning_text"&&(k+=T.content);return{content:v,reasoning:k}},D=a.useCallback((o,v,k,T,I)=>{H.current.raf&&(cancelAnimationFrame(H.current.raf),H.current.raf=0),H.current.pending=[],N($=>{const z=$[$.length-1],A=k&&k.length>0?k:v?[{type:"reasoning_text",content:v},{type:"text",content:o}]:[{type:"text",content:o}];return z&&z.role==="assistant"&&x.current?(x.current=!1,[...$.slice(0,-1),{...z,content:o,reasoningContent:v??z.reasoningContent,segments:A,attachments:T??z.attachments,modelInfo:I??z.modelInfo}]):(x.current=!1,[...$,{role:"assistant",content:o,reasoningContent:v,segments:A,attachments:T,modelInfo:I,timestamp:Date.now()}])}),m(!1)},[]),F=a.useCallback(()=>{const o=H.current;if(o.raf&&(cancelAnimationFrame(o.raf),o.raf=0),o.pending.length===0)return;const v=o.pending;o.pending=[],N(k=>{const T=k[k.length-1];if(T&&T.role==="assistant"&&x.current){let A=T.segments??[];for(const te of v)A=we(A,{type:te.kind==="content"?"text":"reasoning_text",content:te.text});const{content:ee,reasoning:G}=g(A);return[...k.slice(0,-1),{...T,content:ee,reasoningContent:G||void 0,segments:A}]}x.current=!0;let I=[];for(const A of v)I=we(I,{type:A.kind==="content"?"text":"reasoning_text",content:A.text});const{content:$,reasoning:z}=g(I);return[...k,{role:"assistant",content:$,reasoningContent:z||void 0,segments:I,timestamp:Date.now()}]})},[N,x]),Y=a.useCallback((o,v,k,T)=>{if(k){F(),m(!1),Z(!!T),le(new Map);return}(o||v)&&le($=>$.size===0?$:new Map);const I=H.current;v&&I.pending.push({kind:"reasoning",text:v}),o&&I.pending.push({kind:"content",text:o}),!I.raf&&(I.raf=requestAnimationFrame(F))},[F,m]),Ne=a.useCallback(o=>{j(v=>{if(v.length>0&&v[v.length-1].seq>=o.seq&&v.some(T=>T.seq===o.seq))return v;const k=[...v,o];return k.length>js?k.slice(-js):k})},[]),de=a.useCallback(async()=>{const o=p[0];if(!o)return 0;try{const v=await se(`/api/logs/range?before=${o.seq}&limit=200`);return!v||v.length===0?0:(j(k=>{const T=new Set(k.map($=>$.seq));return[...v.filter($=>!T.has($.seq)),...k]}),v.length)}catch{return 0}},[p]),ne=a.useCallback((o,v,k,T)=>{F(),k==="start"&&le(I=>I.size===0?I:new Map),N(I=>{const $=I[I.length-1];if(k==="start"){const z=Date.now();if($&&$.role==="assistant"){const A=we($.segments,{type:"tool_call",name:o,args:v,startTime:z});return[...I.slice(0,-1),{...$,segments:A}]}return x.current=!0,[...I,{role:"assistant",content:"",segments:[{type:"tool_call",name:o,args:v,startTime:z}],timestamp:Date.now()}]}if($&&$.role==="assistant"&&$.segments){const z=Date.now(),A=[...$.segments];for(let ee=A.length-1;ee>=0;ee--){const G=A[ee];if(G.type==="tool_call"&&G.name===o&&G.result==null)return A[ee]={...G,result:T,endTime:z},[...I.slice(0,-1),{...$,segments:A}]}}return I})},[F]),X=a.useCallback(()=>{se("/api/plugins").then(o=>w(o.plugins??[])).catch(()=>{})},[]),Se=a.useCallback(()=>{se("/api/config").then(O).catch(()=>{})},[]),oe=a.useCallback(()=>{se("/api/services").then(o=>K(o.services??null)).catch(()=>{})},[]),be=a.useCallback(()=>{se("/api/pages").then(o=>{y(o),f(new Set(o.map(v=>v.key)))}).catch(()=>{})},[]),Rs=a.useCallback(()=>{X(),oe(),be(),R.refresh(),se("/api/status").then(c).catch(()=>{})},[X,oe,be,R.refresh]),Ds=a.useCallback(()=>{je(!0),re(!1),pe("正在重启…")},[]),Ps=a.useCallback(()=>{Re(!0),pe("正在切换前端,即将刷新…")},[]),As=a.useCallback(()=>{R.refresh(),Q(o=>o+1)},[R.refresh]),zs=a.useCallback(o=>{M(o)},[]),Os=a.useCallback((o,v,k,T,I)=>{N($=>{let z=k&&k.length>0?k:[];z.length===0&&(v&&z.push({type:"reasoning_text",content:v}),o&&z.push({type:"text",content:o}));const A=$[$.length-1];return A&&A.role==="assistant"?[...$.slice(0,-1),{...A,content:o,reasoningContent:v||A.reasoningContent,segments:z}]:[...$,{role:"assistant",content:o,reasoningContent:v||void 0,segments:z,timestamp:Date.now()}]}),T||(x.current=!0,m(!0)),I&&I.length>0?le(new Map(I.map($=>[$.index,{name:$.name,charsAccumulated:$.charsAccumulated,startedAt:$.startedAt}]))):le($=>$.size===0?$:new Map)},[]),Fs=a.useCallback(o=>{le(v=>{const k=new Map(v),T=k.get(o.index);return k.set(o.index,{name:o.name,charsAccumulated:o.charsAccumulated,startedAt:(T==null?void 0:T.startedAt)??Date.now()}),k})},[]),Ws=a.useCallback(()=>{le(o=>o.size===0?o:new Map)},[]),Bs=a.useCallback(o=>{Pe(!0),N(v=>[...v,{role:"assistant",content:o,segments:[{type:"text",content:o}],timestamp:Date.now()}])},[]),qs=a.useCallback(o=>{We(o)},[]),Vs=a.useCallback((o,v)=>{o===ae()&&(me(v),v==="done"?setTimeout(()=>me(null),1500):v==="error"&&setTimeout(()=>me(null),3e3))},[]),{send:_e,sendRaw:Ae,connected:xe}=ln({onMessage:D,onStream:Y,onLog:Ne,onToolCall:ne,onStateChanged:Rs,onRestarting:Ds,onReload:Ps,onSessionsChanged:As,onTodoUpdated:zs,onStreamResume:Os,onConfirm:Bs,onTokenUsage:qs,onCompressing:Vs,onHistoryChanged:R.handleHistoryChanged,onToolCallProgress:Fs,onToolCallProgressClear:Ws}),Hs=a.useCallback(()=>{Ae({type:"compress",sessionId:ae()})},[Ae]);a.useEffect(()=>{ce&&!xe&&(re(!0),pe("等待服务器重启…"))},[ce,xe]),a.useEffect(()=>{if(ce&&ye&&xe){pe("服务器已就绪,即将刷新…");const o=setTimeout(()=>window.location.reload(),800);return()=>clearTimeout(o)}},[ce,ye,xe]),a.useEffect(()=>{if(ve){const o=setTimeout(()=>window.location.reload(),1500);return()=>clearTimeout(o)}},[ve]),a.useEffect(()=>{se("/api/status").then(c).catch(()=>{}),se("/api/auth/status").then(o=>E(o.authed&&o.identity?{identity:o.identity,isOwner:!0}:null)).catch(()=>{}),Se(),X(),oe(),be(),R.refresh(),se("/api/logs/tail?limit=200").then(j).catch(()=>{})},[X,Se,oe,be,R.refresh]),a.useEffect(()=>{const o=R.activeSessionId;if(!o||o==="__new_chat__"){M([]);return}he("@aalis/plugin-todo-list","getTodos",{sessionId:o}).then(v=>M(v??[])).catch(()=>M([]))},[R.activeSessionId]),a.useEffect(()=>{const o=setInterval(()=>{se("/api/status").then(c).catch(()=>{}),X(),oe(),be(),R.refresh()},3e4);return()=>clearInterval(o)},[X,oe,be,R.refresh]);const qe=a.useCallback(()=>{Ae({type:"abort",sessionId:ae()}),m(!1),Z(!1),x.current=!1},[Ae]),Js=a.useCallback(()=>{N(o=>[...o,{role:"user",content:"[请继续执行未完成的工具调用]",timestamp:Date.now()}]),_e("[请继续执行未完成的工具调用]"),Z(!1),m(!0)},[_e]),Gs=a.useCallback(()=>{const o=R.activeSessionId;!o||o==="__new_chat__"||(he("@aalis/plugin-todo-list","clearTodos",{sessionId:o}).catch(()=>{}),M([]))},[R.activeSessionId]),Ks=a.useCallback(async(o,v,k,T)=>{const I=o.trim();if(De){if(!I)return;Pe(!1),N(G=>[...G,{role:"user",content:I,timestamp:Date.now()}]),_e(I);return}if(L&&qe(),!I&&k.length===0&&v.length===0)return;await R.ensureSession();const $=k.length>0?[...k]:void 0,z=[];let A=0,ee=0;if(T.length>0){for(const G of T)if(G==="image"&&A<k.length)z.push({kind:"image",data:k[A++]});else if(G==="file"&&ee<v.length){const te=v[ee++],ge=te.mimeType??"",Ge=ge.startsWith("audio/")?"audio":ge.startsWith("video/")?"video":"file";z.push({kind:Ge,data:te.data,mimeType:ge,name:te.name})}}for(;A<k.length;)z.push({kind:"image",data:k[A++]});for(;ee<v.length;){const G=v[ee++],te=G.mimeType??"",ge=te.startsWith("audio/")?"audio":te.startsWith("video/")?"video":"file";z.push({kind:ge,data:G.data,mimeType:te,name:G.name})}N(G=>[...G,{role:"user",content:I,images:$,fileNames:v.map(te=>te.name),timestamp:Date.now()}]),Z(!1),m(!0),_e(I,z.length>0?z:void 0)},[De,L,_e,qe,R]),Ve={dashboard:e.jsx(en,{}),marketplace:e.jsx(sn,{}),"plugin-config":e.jsx(tn,{}),platforms:e.jsx(an,{}),authority:e.jsx(rn,{}),files:e.jsx(on,{}),logs:e.jsx(nn,{})},Us=e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M9 3v18M3 9h18"})]}),Ys=(o,v)=>Ve[o]?Ve[o]:v&&v.trimStart().startsWith("<svg")?e.jsx("span",{className:"nav-item-svg",dangerouslySetInnerHTML:{__html:v}}):Us,He=a.useMemo(()=>h?l.filter(o=>h.has(o.key)).map(o=>({key:o.key,label:o.label,pluginDisplayName:o.pluginDisplayName,icon:Ys(o.key,o.icon),order:o.order??99})).sort((o,v)=>o.order-v.order):Object.entries(Ve).map(([o,v],k)=>({key:o,label:o,icon:v,order:(k+1)*10})),[h,l]),Xs=(o,v)=>{switch(o){case"dashboard":return e.jsx(mn,{status:b,connected:xe,plugins:q,servicesData:V,onRefreshServices:oe});case"marketplace":return e.jsx(qn,{plugins:q,onRefresh:X,onRestart:k=>{je(!0),re(!1),pe(k)}});case"plugin-config":return e.jsx(Bn,{plugins:q,config:C,onRefresh:X,onConfigSaved:Se,onRestart:()=>{je(!0),re(!1),pe("正在重启…")}});case"platforms":return e.jsx(Vn,{});case"authority":return e.jsx(Hn,{});case"logs":return e.jsx(Jn,{logs:p,onLoadOlder:de});case"files":return e.jsx(Kn,{});case"sessions":return e.jsx(Gn,{pluginName:v,activeSessionId:R.activeSessionId,onSwitchSession:k=>{R.switchSession(k)},onStartNewChat:()=>R.startNewChat(),refreshSignal:U});default:return null}},ue=l.find(o=>o.key===t),Je=ue!=null&&ue.content?ue:void 0,is=a.useCallback(async()=>{await fetch("/api/auth/logout",{method:"POST"}),window.location.reload()},[]),Zs=o=>{s(o),n&&(i("page"),u(!1))},Qs=o=>n?r==="page"&&t===o:t===o;return e.jsxs("div",{className:`app-layout${n?` mobile mobile-view-${r}`:""}`,children:[n&&r==="page"&&e.jsxs("header",{className:"mobile-topbar",children:[e.jsx("button",{className:"mobile-topbar-btn",onClick:()=>u(!0),"aria-label":"打开菜单",children:e.jsx(ks,{size:20})}),e.jsx("span",{className:"mobile-topbar-title",children:(ls=He.find(o=>o.key===t))==null?void 0:ls.label}),e.jsx("button",{className:"mobile-topbar-btn",onClick:()=>i("chat"),"aria-label":"返回对话",children:e.jsx(ze,{size:19})})]}),n&&d&&e.jsx("div",{className:"nav-backdrop",onClick:()=>u(!1)}),e.jsxs("nav",{className:`nav-rail${d?" drawer-open":""}`,children:[e.jsxs("div",{className:"nav-rail-top",children:[e.jsx("div",{className:"nav-logo",children:"A"}),n&&e.jsxs("button",{className:`nav-item ${r==="chat"?"active":""}`,onClick:()=>{i("chat"),u(!1)},children:[e.jsx("span",{className:"nav-item-icon",children:e.jsx(ze,{size:20})}),e.jsx("span",{className:"nav-item-label",children:"对话"})]}),He.map(o=>e.jsxs("button",{className:`nav-item ${Qs(o.key)?"active":""}`,onClick:()=>Zs(o.key),children:[e.jsx("span",{className:"nav-item-icon",children:o.icon}),e.jsx("span",{className:"nav-item-label",children:o.label})]},o.key))]}),e.jsxs("div",{className:"nav-rail-bottom",children:[n&&S&&e.jsxs("span",{className:"drawer-user",title:`${S.identity.platform}:${S.identity.userId}`,children:[e.jsxs("span",{className:"drawer-user-id",children:[S.identity.platform,":",S.identity.userId]}),S.isOwner&&e.jsx("span",{className:"content-user-level",children:"owner"}),e.jsx("button",{className:"btn-sm",onClick:is,children:"退出"})]}),e.jsx("div",{className:`nav-status ${xe?"online":"offline"}`,title:xe?"已连接":"离线"})]})]}),e.jsxs("main",{className:"content-area",children:[e.jsxs("div",{className:"content-header",children:[e.jsx("span",{className:"content-title",children:(cs=He.find(o=>o.key===t))==null?void 0:cs.label}),S&&e.jsxs("span",{className:"content-user",title:`${S.identity.platform}:${S.identity.userId}`,children:[e.jsxs("span",{style:{fontSize:12,opacity:.7},children:[S.identity.platform,":",S.identity.userId]}),S.isOwner&&e.jsx("span",{className:"content-user-level",children:"owner"}),e.jsx("button",{className:"btn-sm",onClick:is,children:"退出"})]})]}),e.jsx("div",{className:"content-body",children:e.jsxs(a.Suspense,{fallback:e.jsx("div",{className:"empty-hint",style:{padding:24},children:"加载中…"}),children:[Je&&e.jsx(Un,{page:Je}),!Je&&(ue==null?void 0:ue.renderer)&&(Xs(ue.renderer,ue.plugin)||e.jsxs("div",{className:"empty-hint",style:{padding:24},children:["此客户端不支持渲染器「",ue.renderer,"」"]}))]})})]}),!n&&e.jsx("div",{className:"resize-handle",onMouseDown:o=>{var ge;o.preventDefault();const v=o.clientX,k=P,T=((ge=document.querySelector(".app-layout"))==null?void 0:ge.clientWidth)??window.innerWidth,I=document.querySelector(".nav-rail"),$=(I==null?void 0:I.getBoundingClientRect().width)??56,z=360,A=280,ee=Math.max(A,T-$-z);document.body.classList.add("is-dragging-chat");const G=Ge=>{const et=k-(Ge.clientX-v);W(Math.max(A,Math.min(ee,et)))},te=()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",te),document.body.style.cursor="",document.body.style.userSelect="",document.body.classList.remove("is-dragging-chat")};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",G),document.addEventListener("mouseup",te)}}),e.jsx("div",{className:"chat-column",style:n?void 0:{width:P},children:e.jsx(Wn,{messages:ie,loading:L,connected:xe,status:b,onSend:Ks,onAbort:qe,width:n?void 0:P,onOpenNav:n?()=>u(!0):void 0,sessionTitle:R.isNewChat?"新对话":R.activeSessionTitle,onNewSession:R.pluginName?()=>R.startNewChat():void 0,todoItems:_,onClearTodos:Gs,toolLimitReached:J,onContinueTools:Js,toolCallsProgress:Le,tokenUsage:Fe,compressingStatus:Be,onCompress:Hs})}),(ce||ve)&&e.jsx("div",{className:"restart-overlay",children:e.jsxs("div",{className:"restart-dialog",children:[e.jsx("div",{className:"restart-spinner"}),e.jsx("h3",{children:ve?"切换前端":"正在重启…"}),e.jsx("p",{className:"restart-desc",children:Ce})]})})]})}st.createRoot(document.getElementById("root")).render(e.jsx(Xn,{}));export{hs as B,Ns as C,_t as D,Et as F,Ee as M,Te as R,qt as S,Oe as T,os as W,Ss as X,fe as _,se as a,un as b,B as c,Ie as d,Me as e,Wt as f,It as g,Gt as h,he as p};
@@ -1,2 +1,2 @@
1
- import{_ as a,l as o,I as i,e as n}from"./mermaid.core-BK17wB8Y.js";import{p}from"./wardley-L42UT6IY-ER1LeunS.js";import"./index-D56FVdMY.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var g={parse:a(async r=>{const e=await p("info",r);o.debug(e)},"parse")},m={version:"11.15.0"},v=a(()=>m.version,"getVersion"),d={getVersion:v},c=a((r,e,s)=>{o.debug(`rendering info diagram
1
+ import{_ as a,l as o,I as i,e as n}from"./mermaid.core-DfVdcmTH.js";import{p}from"./wardley-L42UT6IY-C7UmKZUS.js";import"./index-DvV80Yu7.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var g={parse:a(async r=>{const e=await p("info",r);o.debug(e)},"parse")},m={version:"11.15.0"},v=a(()=>m.version,"getVersion"),d={getVersion:v},c=a((r,e,s)=>{o.debug(`rendering info diagram
2
2
  `+r);const t=i(e);n(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${s}`)},"draw"),l={draw:c},z={parser:g,db:d,renderer:l};export{z as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,N as ut,I as dt,ap as yt,z as pt,k as ft,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-BK17wB8Y.js";import"./index-D56FVdMY.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],p=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,f,n,v){var w=n.length-1;switch(f){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:p,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:p,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],f=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,f.length=f.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,N as ut,I as dt,ap as yt,z as pt,k as ft,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./mermaid.core-DfVdcmTH.js";import"./index-DvV80Yu7.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],p=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,f,n,v){var w=n.length-1;switch(f){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:p,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:p,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],f=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,f.length=f.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(P[0]){case 1:i.push(A),f.push(b.yytext),n.push(b.yylloc),i.push(P[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[P[1]][1],H.$=f[f.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,P[1],f,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),f=f.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[P[1]][0]),f.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-FMBD7UC4-C6aipBu7.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-BLOj0kQ3.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as X,e as $t,z as Mt}from"./mermaid.core-BK17wB8Y.js";import{d as it}from"./arc-DAUQCUxy.js";import"./index-D56FVdMY.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-FMBD7UC4-Bq1b7ZFm.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-C-4E9LgY.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as X,e as $t,z as Mt}from"./mermaid.core-DfVdcmTH.js";import{d as it}from"./arc-CClRoqMj.js";import"./index-DvV80Yu7.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-BK17wB8Y.js";import{g as Ne}from"./chunk-FMBD7UC4-C6aipBu7.js";import"./index-D56FVdMY.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./mermaid.core-DfVdcmTH.js";import{g as Ne}from"./chunk-FMBD7UC4-Bq1b7ZFm.js";import"./index-DvV80Yu7.js";import"./react-vendor-BPQixOLZ.js";import"./highlight-DJvvuuwd.js";import"./katex-Bq6vt64r.js";import"./markdown-B2G8c9k5.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./mermaid.core-BK17wB8Y.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
1
+ import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./mermaid.core-DfVdcmTH.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};