chordia-ui 3.9.2 → 3.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChatMessage.cjs.js +5 -5
- package/dist/ChatMessage.cjs.js.map +1 -1
- package/dist/ChatMessage.es.js +583 -353
- package/dist/ChatMessage.es.js.map +1 -1
- package/dist/MessageThread.cjs.js +15 -0
- package/dist/MessageThread.cjs.js.map +1 -0
- package/dist/MessageThread.es.js +1868 -0
- package/dist/MessageThread.es.js.map +1 -0
- package/dist/PerformancePanel.cjs.js +1 -1
- package/dist/PerformancePanel.cjs.js.map +1 -1
- package/dist/PerformancePanel.es.js +587 -749
- package/dist/PerformancePanel.es.js.map +1 -1
- package/dist/components/chat.cjs.js +1 -27
- package/dist/components/chat.cjs.js.map +1 -1
- package/dist/components/chat.es.js +276 -1617
- package/dist/components/chat.es.js.map +1 -1
- package/dist/components/layout.cjs.js +2 -2
- package/dist/components/layout.cjs.js.map +1 -1
- package/dist/components/layout.es.js +289 -272
- package/dist/components/layout.es.js.map +1 -1
- package/dist/components/media.cjs.js +1 -1
- package/dist/components/media.cjs.js.map +1 -1
- package/dist/components/media.es.js +4 -4
- package/dist/components/media.es.js.map +1 -1
- package/dist/components/reports.cjs.js +2 -2
- package/dist/components/reports.cjs.js.map +1 -1
- package/dist/components/reports.es.js +18 -18
- package/dist/components/reports.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +8 -8
- package/package.json +1 -1
- package/src/components/chat/ChatHistoryPanel.jsx +740 -388
- package/src/components/chat/ChatInterface.jsx +3 -3
- package/src/components/chat/ChatMessage.jsx +338 -48
- package/src/components/chat/ChatWelcome.jsx +386 -0
- package/src/components/chat/ThinkingIndicator.jsx +121 -275
- package/src/components/chat/index.js +1 -0
- package/src/components/layout/SplitPane.jsx +21 -13
- package/src/components/media/InteractionSummaryCard.jsx +1 -1
- package/src/components/performance/PerformanceDetailsPage.jsx +51 -52
- package/src/components/performance/performanceRangeFormat.js +3 -2
- package/src/components/reports/ReportsDetails.jsx +2 -2
package/dist/ChatMessage.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as y, jsx as
|
|
2
|
-
import
|
|
3
|
-
import { ResponsiveContainer as N, PieChart as
|
|
4
|
-
import { Wrench as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as y, jsx as e, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import re, { useRef as he, useCallback as ce, useState as G, useEffect as be } from "react";
|
|
3
|
+
import { ResponsiveContainer as N, PieChart as ve, Pie as we, Cell as ae, Tooltip as U, AreaChart as Se, CartesianGrid as Z, XAxis as J, YAxis as Q, Legend as ee, Area as ke, LineChart as Ce, Line as Ae, BarChart as de, Bar as pe } from "recharts";
|
|
4
|
+
import { Wrench as Re, Check as ge, Copy as ue, ThumbsUp as Be, ThumbsDown as ze, PanelRightOpen as Le } from "lucide-react";
|
|
5
|
+
const C = [
|
|
6
6
|
"#5E88B0",
|
|
7
7
|
// rail-discovery / rail-blue
|
|
8
8
|
"#9B7AA8",
|
|
@@ -23,7 +23,7 @@ const w = [
|
|
|
23
23
|
// rail-teal (warm gold)
|
|
24
24
|
"#A8C76B"
|
|
25
25
|
// green accent (complementary)
|
|
26
|
-
],
|
|
26
|
+
], se = { fill: "var(--text-muted, #666)", fontSize: 12 }, I = { stroke: "var(--border, #e0e0e0)" }, te = "var(--border, #e0e0e0)", X = {
|
|
27
27
|
// pointerEvents: 'none' is critical — without it, the tooltip steals hover from chart elements
|
|
28
28
|
// and flickers (especially noticeable on pie slices).
|
|
29
29
|
// transition: 'none' disables Recharts' default position-slide animation, so the tooltip
|
|
@@ -34,7 +34,7 @@ const w = [
|
|
|
34
34
|
outline: "none",
|
|
35
35
|
transition: "none"
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, Te = { color: "var(--text-ink, #1e2125)", fontSize: "12px" }, K = ({ active: l, payload: d, label: c }) => !l || !d || !d.length ? null : /* @__PURE__ */ y(
|
|
38
38
|
"div",
|
|
39
39
|
{
|
|
40
40
|
className: "chordia-chart-tooltip",
|
|
@@ -56,7 +56,7 @@ const w = [
|
|
|
56
56
|
pointerEvents: "auto"
|
|
57
57
|
},
|
|
58
58
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ e("style", { children: `
|
|
60
60
|
.chordia-chart-tooltip::-webkit-scrollbar { width: 8px; }
|
|
61
61
|
.chordia-chart-tooltip::-webkit-scrollbar-track { background: transparent; }
|
|
62
62
|
.chordia-chart-tooltip::-webkit-scrollbar-thumb {
|
|
@@ -67,7 +67,7 @@ const w = [
|
|
|
67
67
|
background: rgba(52, 58, 64, 0.4);
|
|
68
68
|
}
|
|
69
69
|
` }),
|
|
70
|
-
|
|
70
|
+
c !== void 0 && c !== "" && /* @__PURE__ */ e(
|
|
71
71
|
"div",
|
|
72
72
|
{
|
|
73
73
|
style: {
|
|
@@ -80,12 +80,12 @@ const w = [
|
|
|
80
80
|
paddingBottom: 6,
|
|
81
81
|
borderBottom: "1px solid rgba(52, 58, 64, 0.08)"
|
|
82
82
|
},
|
|
83
|
-
children:
|
|
83
|
+
children: c
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
var
|
|
88
|
-
const
|
|
86
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: d.map((o, a) => {
|
|
87
|
+
var p;
|
|
88
|
+
const f = o.color || ((p = o.payload) == null ? void 0 : p.fill) || "#9CA3AF";
|
|
89
89
|
return /* @__PURE__ */ y(
|
|
90
90
|
"div",
|
|
91
91
|
{
|
|
@@ -97,19 +97,19 @@ const w = [
|
|
|
97
97
|
},
|
|
98
98
|
children: [
|
|
99
99
|
/* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "center", gap: 8, minWidth: 0 }, children: [
|
|
100
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ e(
|
|
101
101
|
"span",
|
|
102
102
|
{
|
|
103
103
|
style: {
|
|
104
104
|
width: 8,
|
|
105
105
|
height: 8,
|
|
106
106
|
borderRadius: "50%",
|
|
107
|
-
background:
|
|
107
|
+
background: f,
|
|
108
108
|
flexShrink: 0
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ e(
|
|
113
113
|
"span",
|
|
114
114
|
{
|
|
115
115
|
style: {
|
|
@@ -118,93 +118,93 @@ const w = [
|
|
|
118
118
|
textOverflow: "ellipsis",
|
|
119
119
|
whiteSpace: "nowrap"
|
|
120
120
|
},
|
|
121
|
-
children:
|
|
121
|
+
children: o.name
|
|
122
122
|
}
|
|
123
123
|
)
|
|
124
124
|
] }),
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ e("span", { style: { color: "#111827", fontWeight: 600, marginLeft: 8 }, children: o.value })
|
|
126
126
|
]
|
|
127
127
|
},
|
|
128
|
-
|
|
128
|
+
a
|
|
129
129
|
);
|
|
130
130
|
}) })
|
|
131
131
|
]
|
|
132
132
|
}
|
|
133
|
-
),
|
|
134
|
-
if (!
|
|
133
|
+
), Me = (l, d) => {
|
|
134
|
+
if (!l)
|
|
135
135
|
return !1;
|
|
136
|
-
const
|
|
137
|
-
return
|
|
138
|
-
},
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
return
|
|
136
|
+
const c = l.toLowerCase();
|
|
137
|
+
return d.filter((a) => String(a).toLowerCase().includes(c)).length < d.length * 0.5;
|
|
138
|
+
}, $e = (l) => {
|
|
139
|
+
const d = Array.from(l.querySelectorAll(".recharts-wrapper")), c = d.length ? d.reduce((p, k) => {
|
|
140
|
+
const v = p.getBoundingClientRect(), g = k.getBoundingClientRect();
|
|
141
|
+
return g.width * g.height > v.width * v.height ? k : p;
|
|
142
142
|
}) : null;
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
const k =
|
|
143
|
+
if (c) {
|
|
144
|
+
const p = c.querySelector("svg.recharts-surface");
|
|
145
|
+
if (p) {
|
|
146
|
+
const k = p.getBoundingClientRect();
|
|
147
147
|
if (k.width >= 100 && k.height >= 100)
|
|
148
|
-
return
|
|
148
|
+
return p;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
151
|
+
const o = Array.from(l.querySelectorAll("svg"));
|
|
152
|
+
if (!o.length)
|
|
153
153
|
return null;
|
|
154
|
-
const
|
|
155
|
-
const
|
|
156
|
-
return
|
|
157
|
-
}),
|
|
158
|
-
return
|
|
159
|
-
},
|
|
160
|
-
const
|
|
161
|
-
let
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
}),
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
let
|
|
170
|
-
const
|
|
171
|
-
return
|
|
172
|
-
const
|
|
173
|
-
return
|
|
154
|
+
const a = o.reduce((p, k) => {
|
|
155
|
+
const v = p.getBoundingClientRect(), g = k.getBoundingClientRect();
|
|
156
|
+
return g.width * g.height > v.width * v.height ? k : p;
|
|
157
|
+
}), f = a.getBoundingClientRect();
|
|
158
|
+
return f.width < 100 || f.height < 100 ? null : a;
|
|
159
|
+
}, We = (l) => String(l).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), De = ({ chartSvg: l, width: d, height: c, legendItems: o = [] }) => {
|
|
160
|
+
const a = l.cloneNode(!0), f = 20, p = 16, v = d - 16, g = [];
|
|
161
|
+
let s = [], n = 0;
|
|
162
|
+
o.forEach(({ label: b, color: h }) => {
|
|
163
|
+
const u = Math.max(40, String(b).length * 7 + 34);
|
|
164
|
+
s.length && p + n + u > v && (g.push(s), s = [], n = 0), s.push({ label: b, color: h, itemWidth: u }), n += u;
|
|
165
|
+
}), s.length && g.push(s);
|
|
166
|
+
const t = g.length ? g.length * f + 20 : 0, r = c + t;
|
|
167
|
+
a.setAttribute("width", d), a.setAttribute("height", c), a.setAttribute("x", 0), a.setAttribute("y", 0);
|
|
168
|
+
const x = g.map((b, h) => {
|
|
169
|
+
let u = p;
|
|
170
|
+
const w = c + 20 + h * f;
|
|
171
|
+
return b.map(({ label: i, color: L, itemWidth: A }) => {
|
|
172
|
+
const F = `<line x1="${u}" y1="${w}" x2="${u + 10}" y2="${w}" stroke="${L}" stroke-width="2" />`, R = `<circle cx="${u + 5}" cy="${w}" r="2.5" fill="#fff" stroke="${L}" stroke-width="1.5" />`, T = `<text x="${u + 14}" y="${w + 4}" fill="#666" font-size="12">${We(i)}</text>`;
|
|
173
|
+
return u += A, `${F}${R}${T}`;
|
|
174
174
|
}).join("");
|
|
175
175
|
}).join("");
|
|
176
176
|
return [
|
|
177
|
-
`<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
177
|
+
`<svg xmlns="http://www.w3.org/2000/svg" width="${d}" height="${r}" viewBox="0 0 ${d} ${r}">`,
|
|
178
178
|
'<style>text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }</style>',
|
|
179
179
|
'<rect x="0" y="0" width="100%" height="100%" fill="#ffffff" />',
|
|
180
|
-
new XMLSerializer().serializeToString(
|
|
181
|
-
|
|
180
|
+
new XMLSerializer().serializeToString(a),
|
|
181
|
+
x,
|
|
182
182
|
"</svg>"
|
|
183
183
|
].join("");
|
|
184
|
-
},
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
184
|
+
}, Ee = async (l, d, c = []) => {
|
|
185
|
+
const o = $e(l);
|
|
186
|
+
if (!o)
|
|
187
187
|
return;
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
const n = document.createElement("canvas"),
|
|
191
|
-
n.width =
|
|
188
|
+
const a = o.getBoundingClientRect(), f = a.width || o.clientWidth || Number(o.getAttribute("width")) || 600, p = a.height || o.clientHeight || Number(o.getAttribute("height")) || 300, k = De({ chartSvg: o, width: f, height: p, legendItems: c }), v = new Blob([k], { type: "image/svg+xml;charset=utf-8" }), g = URL.createObjectURL(v), s = new Image();
|
|
189
|
+
s.onload = () => {
|
|
190
|
+
const n = document.createElement("canvas"), t = 2;
|
|
191
|
+
n.width = f * t, n.height = p * t;
|
|
192
192
|
const r = n.getContext("2d");
|
|
193
|
-
r.fillStyle = "#ffffff", r.fillRect(0, 0, n.width, n.height), r.scale(
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
const
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
return
|
|
193
|
+
r.fillStyle = "#ffffff", r.fillRect(0, 0, n.width, n.height), r.scale(t, t), r.drawImage(s, 0, 0, f, p), URL.revokeObjectURL(g);
|
|
194
|
+
const x = document.createElement("a");
|
|
195
|
+
x.download = `${(d || "chart").replace(/[^a-z0-9]+/gi, "_")}.png`, x.href = n.toDataURL("image/png"), x.click();
|
|
196
|
+
}, s.src = g;
|
|
197
|
+
}, Ie = (l, d) => {
|
|
198
|
+
const c = ["", ...l.map((f) => f.name)].join(","), o = d.map((f) => {
|
|
199
|
+
const p = l.map((k) => {
|
|
200
|
+
const v = k.data.find((g) => g.x === f);
|
|
201
|
+
return v ? v.y : "";
|
|
202
202
|
});
|
|
203
|
-
return [
|
|
204
|
-
}),
|
|
203
|
+
return [f, ...p].join(",");
|
|
204
|
+
}), a = [c, ...o].join(`
|
|
205
205
|
`);
|
|
206
|
-
navigator.clipboard.writeText(
|
|
207
|
-
},
|
|
206
|
+
navigator.clipboard.writeText(a);
|
|
207
|
+
}, Fe = ({ onDownloadPng: l, onCopy: d, copied: c }) => /* @__PURE__ */ y("div", { style: {
|
|
208
208
|
display: "flex",
|
|
209
209
|
gap: 6,
|
|
210
210
|
justifyContent: "flex-end",
|
|
@@ -212,7 +212,7 @@ const w = [
|
|
|
212
212
|
opacity: 0.7,
|
|
213
213
|
transition: "opacity 0.15s"
|
|
214
214
|
}, children: [
|
|
215
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ e("button", { onClick: d, title: "Copy data as CSV", style: {
|
|
216
216
|
background: "none",
|
|
217
217
|
border: "1px solid var(--border, #e0e0e0)",
|
|
218
218
|
borderRadius: "var(--radius-sm, 4px)",
|
|
@@ -223,8 +223,8 @@ const w = [
|
|
|
223
223
|
display: "flex",
|
|
224
224
|
alignItems: "center",
|
|
225
225
|
gap: 4
|
|
226
|
-
}, children:
|
|
227
|
-
/* @__PURE__ */
|
|
226
|
+
}, children: c ? "✓ Copied" : "📋 CSV" }),
|
|
227
|
+
/* @__PURE__ */ e("button", { onClick: l, title: "Download as PNG", style: {
|
|
228
228
|
background: "none",
|
|
229
229
|
border: "1px solid var(--border, #e0e0e0)",
|
|
230
230
|
borderRadius: "var(--radius-sm, 4px)",
|
|
@@ -236,154 +236,154 @@ const w = [
|
|
|
236
236
|
alignItems: "center",
|
|
237
237
|
gap: 4
|
|
238
238
|
}, children: "📥 PNG" })
|
|
239
|
-
] }),
|
|
240
|
-
const
|
|
241
|
-
if (!
|
|
239
|
+
] }), Ge = ({ chartType: l, title: d, xLabel: c, yLabel: o, series: a, compact: f = !1 }) => {
|
|
240
|
+
const p = he(null), [k, v] = re.useState(!1);
|
|
241
|
+
if (!a || a.length === 0)
|
|
242
242
|
return null;
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
return
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
}),
|
|
249
|
-
}), n =
|
|
243
|
+
const g = [...new Set(a.flatMap((m) => m.data.map((S) => S.x)))], s = g.map((m) => {
|
|
244
|
+
const S = { x: m };
|
|
245
|
+
return a.forEach((M) => {
|
|
246
|
+
const z = M.data.find(($) => $.x === m);
|
|
247
|
+
S[M.name] = z ? z.y : null;
|
|
248
|
+
}), S;
|
|
249
|
+
}), n = a.map((m) => m.name), t = n.length === 1, r = Me(c, g), b = Math.max(...g.map((m) => String(m).length)) > 12 || g.length > 8, w = (b ? 40 : 5) + (r ? 25 : 0), B = t ? 0 : Math.max(1, Math.ceil(n.length / 4)), i = B > 0 ? B * 24 + (r ? 24 : 12) : 0, A = (f ? 240 : 300) + Math.max(0, (B - 1) * 28), R = { ...Te, paddingTop: r ? 24 : 12, zIndex: 0 }, T = {
|
|
250
250
|
background: "var(--paper-elevated, #fff)",
|
|
251
251
|
border: "1px solid var(--border, #e0e0e0)",
|
|
252
252
|
borderRadius: "var(--radius-md, 8px)",
|
|
253
253
|
padding: "16px",
|
|
254
254
|
marginBottom: "16px"
|
|
255
|
-
},
|
|
255
|
+
}, ne = {
|
|
256
256
|
color: "var(--text-strong, #1e2125)",
|
|
257
257
|
fontSize: "14px",
|
|
258
258
|
fontWeight: "600",
|
|
259
259
|
marginBottom: "12px"
|
|
260
260
|
}, j = {
|
|
261
261
|
dataKey: "x",
|
|
262
|
-
tick:
|
|
262
|
+
tick: b ? { fill: "var(--text-muted, #666)", fontSize: 11, angle: -35, textAnchor: "end" } : se,
|
|
263
263
|
axisLine: I,
|
|
264
264
|
tickLine: I,
|
|
265
265
|
...r ? {
|
|
266
266
|
label: {
|
|
267
|
-
value:
|
|
267
|
+
value: c,
|
|
268
268
|
position: "insideBottom",
|
|
269
269
|
// Push label below rotated ticks (which take ~40px) when present
|
|
270
|
-
offset:
|
|
270
|
+
offset: b ? -45 : -10,
|
|
271
271
|
style: { textAnchor: "middle", fill: "var(--text-muted, #666)" }
|
|
272
272
|
}
|
|
273
273
|
} : {}
|
|
274
|
-
},
|
|
275
|
-
tick:
|
|
274
|
+
}, oe = {
|
|
275
|
+
tick: se,
|
|
276
276
|
axisLine: I,
|
|
277
277
|
tickLine: I,
|
|
278
|
-
...
|
|
278
|
+
...o ? {
|
|
279
279
|
width: 72,
|
|
280
280
|
label: {
|
|
281
|
-
value:
|
|
281
|
+
value: o,
|
|
282
282
|
angle: -90,
|
|
283
283
|
position: "insideLeft",
|
|
284
284
|
offset: 10,
|
|
285
285
|
style: { textAnchor: "middle", fill: "var(--text-muted, #666)" }
|
|
286
286
|
}
|
|
287
287
|
} : {}
|
|
288
|
-
},
|
|
289
|
-
switch (
|
|
288
|
+
}, fe = () => {
|
|
289
|
+
switch (l) {
|
|
290
290
|
case "bar":
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
!
|
|
296
|
-
n.map((
|
|
297
|
-
/* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ e(N, { width: "100%", height: A, children: /* @__PURE__ */ y(de, { data: s, margin: { top: 5, right: 30, left: o ? 10 : 20, bottom: w }, children: [
|
|
292
|
+
/* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
|
|
293
|
+
/* @__PURE__ */ e(J, { ...j }),
|
|
294
|
+
/* @__PURE__ */ e(Q, { ...oe }),
|
|
295
|
+
!t && /* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
|
|
296
|
+
n.map((m, S) => /* @__PURE__ */ e(pe, { dataKey: m, fill: C[S % C.length], radius: [2, 2, 0, 0], isAnimationActive: !1, children: t && s.map((M, z) => /* @__PURE__ */ e(ae, { fill: C[z % C.length] }, z)) }, m)),
|
|
297
|
+
/* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
|
|
298
298
|
] }) });
|
|
299
299
|
case "horizontal_bar":
|
|
300
|
-
return /* @__PURE__ */
|
|
301
|
-
/* @__PURE__ */
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
-
|
|
300
|
+
return /* @__PURE__ */ e(N, { width: "100%", height: Math.max(f ? 240 : 300, s.length * (f ? 32 : 40)), children: /* @__PURE__ */ y(de, { data: s, layout: "vertical", margin: { top: 5, right: 30, left: 100, bottom: 5 }, children: [
|
|
301
|
+
/* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
|
|
302
|
+
/* @__PURE__ */ e(
|
|
303
|
+
J,
|
|
304
304
|
{
|
|
305
305
|
type: "number",
|
|
306
|
-
tick:
|
|
306
|
+
tick: se,
|
|
307
307
|
axisLine: I,
|
|
308
308
|
tickLine: I,
|
|
309
|
-
...
|
|
309
|
+
...o ? { label: { value: o, position: "insideBottom", offset: -5, style: { textAnchor: "middle", fill: "var(--text-muted, #666)" } } } : {}
|
|
310
310
|
}
|
|
311
311
|
),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
!
|
|
314
|
-
n.map((
|
|
315
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ e(Q, { type: "category", dataKey: "x", tick: { fill: "var(--text-muted, #666)", fontSize: 11 }, width: 90, axisLine: I, tickLine: I }),
|
|
313
|
+
!t && /* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
|
|
314
|
+
n.map((m, S) => /* @__PURE__ */ e(pe, { dataKey: m, fill: C[S % C.length], radius: [0, 2, 2, 0], isAnimationActive: !1, children: t && s.map((M, z) => /* @__PURE__ */ e(ae, { fill: C[z % C.length] }, z)) }, m)),
|
|
315
|
+
/* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
|
|
316
316
|
] }) });
|
|
317
317
|
case "line":
|
|
318
|
-
return /* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
n.map((
|
|
324
|
-
|
|
318
|
+
return /* @__PURE__ */ e(N, { width: "100%", height: A, children: /* @__PURE__ */ y(Ce, { data: s, margin: { top: 5, right: 30, left: o ? 10 : 20, bottom: w }, children: [
|
|
319
|
+
/* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
|
|
320
|
+
/* @__PURE__ */ e(J, { ...j }),
|
|
321
|
+
/* @__PURE__ */ e(Q, { ...oe }),
|
|
322
|
+
/* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
|
|
323
|
+
n.map((m, S) => /* @__PURE__ */ e(
|
|
324
|
+
Ae,
|
|
325
325
|
{
|
|
326
326
|
type: "monotone",
|
|
327
|
-
dataKey:
|
|
328
|
-
stroke:
|
|
327
|
+
dataKey: m,
|
|
328
|
+
stroke: C[S % C.length],
|
|
329
329
|
strokeWidth: 2,
|
|
330
|
-
dot: { r: 4, fill:
|
|
331
|
-
activeDot: { r: 6, fill:
|
|
330
|
+
dot: { r: 4, fill: C[S % C.length] },
|
|
331
|
+
activeDot: { r: 6, fill: C[S % C.length] },
|
|
332
332
|
isAnimationActive: !1
|
|
333
333
|
},
|
|
334
|
-
|
|
334
|
+
m
|
|
335
335
|
)),
|
|
336
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
|
|
337
337
|
] }) });
|
|
338
338
|
case "area":
|
|
339
|
-
return /* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
n.map((
|
|
345
|
-
|
|
339
|
+
return /* @__PURE__ */ e(N, { width: "100%", height: A, children: /* @__PURE__ */ y(Se, { data: s, margin: { top: 5, right: 30, left: o ? 10 : 20, bottom: w }, children: [
|
|
340
|
+
/* @__PURE__ */ e(Z, { strokeDasharray: "3 3", stroke: te }),
|
|
341
|
+
/* @__PURE__ */ e(J, { ...j }),
|
|
342
|
+
/* @__PURE__ */ e(Q, { ...oe }),
|
|
343
|
+
/* @__PURE__ */ e(ee, { wrapperStyle: R, height: i }),
|
|
344
|
+
n.map((m, S) => /* @__PURE__ */ e(
|
|
345
|
+
ke,
|
|
346
346
|
{
|
|
347
347
|
type: "monotone",
|
|
348
|
-
dataKey:
|
|
349
|
-
stroke:
|
|
348
|
+
dataKey: m,
|
|
349
|
+
stroke: C[S % C.length],
|
|
350
350
|
strokeWidth: 2,
|
|
351
|
-
fill:
|
|
351
|
+
fill: C[S % C.length],
|
|
352
352
|
fillOpacity: 0.15,
|
|
353
353
|
isAnimationActive: !1
|
|
354
354
|
},
|
|
355
|
-
|
|
355
|
+
m
|
|
356
356
|
)),
|
|
357
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
|
|
358
358
|
] }) });
|
|
359
359
|
case "pie": {
|
|
360
|
-
const
|
|
361
|
-
name:
|
|
362
|
-
value:
|
|
363
|
-
fill:
|
|
364
|
-
})),
|
|
365
|
-
return /* @__PURE__ */
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
|
|
360
|
+
const m = a[0].data.map((z, $) => ({
|
|
361
|
+
name: z.x,
|
|
362
|
+
value: z.y,
|
|
363
|
+
fill: C[$ % C.length]
|
|
364
|
+
})), S = Math.PI / 180;
|
|
365
|
+
return /* @__PURE__ */ e(N, { width: "100%", height: f ? 260 : 320, children: /* @__PURE__ */ y(ve, { margin: { top: 16, right: 16, bottom: 16, left: 16 }, children: [
|
|
366
|
+
/* @__PURE__ */ e(
|
|
367
|
+
we,
|
|
368
368
|
{
|
|
369
|
-
data:
|
|
370
|
-
cx:
|
|
369
|
+
data: m,
|
|
370
|
+
cx: f ? "42%" : "38%",
|
|
371
371
|
cy: "50%",
|
|
372
|
-
outerRadius:
|
|
372
|
+
outerRadius: f ? 88 : 110,
|
|
373
373
|
dataKey: "value",
|
|
374
|
-
label: ({ cx:
|
|
375
|
-
const
|
|
374
|
+
label: ({ cx: z, cy: $, midAngle: _, innerRadius: P, outerRadius: ie, percent: H, name: O }) => {
|
|
375
|
+
const Y = ie + 20, q = z + Y * Math.cos(-_ * S), V = $ + Y * Math.sin(-_ * S);
|
|
376
376
|
return H < 0.04 ? null : /* @__PURE__ */ y(
|
|
377
377
|
"text",
|
|
378
378
|
{
|
|
379
|
-
x:
|
|
380
|
-
y:
|
|
379
|
+
x: q,
|
|
380
|
+
y: V,
|
|
381
381
|
fill: "var(--text-ink, #1e2125)",
|
|
382
382
|
fontSize: 11,
|
|
383
|
-
textAnchor:
|
|
383
|
+
textAnchor: q > z ? "start" : "end",
|
|
384
384
|
dominantBaseline: "central",
|
|
385
385
|
children: [
|
|
386
|
-
|
|
386
|
+
O,
|
|
387
387
|
" (",
|
|
388
388
|
(H * 100).toFixed(0),
|
|
389
389
|
"%)"
|
|
@@ -393,78 +393,78 @@ const w = [
|
|
|
393
393
|
},
|
|
394
394
|
labelLine: { stroke: "var(--text-muted, #666)" },
|
|
395
395
|
isAnimationActive: !1,
|
|
396
|
-
children:
|
|
396
|
+
children: m.map((z, $) => /* @__PURE__ */ e(ae, { fill: z.fill }, $))
|
|
397
397
|
}
|
|
398
398
|
),
|
|
399
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ e(U, { wrapperStyle: X.wrapperStyle, content: /* @__PURE__ */ e(K, {}), cursor: { fill: "rgba(94, 136, 176, 0.06)", stroke: "rgba(52, 58, 64, 0.18)", strokeDasharray: "3 3" }, isAnimationActive: !1, animationDuration: 0 })
|
|
400
400
|
] }) });
|
|
401
401
|
}
|
|
402
402
|
case "metric": {
|
|
403
|
-
const
|
|
403
|
+
const m = a[0], S = m.data[0], M = m.data.length > 1 ? m.data[1] : null, z = S.y, $ = S.x || "", _ = M !== null, P = _ ? z - M.y : 0, ie = _ && M.y !== 0 ? P / Math.abs(M.y) * 100 : 0, H = P > 0, O = P < 0, Y = H ? "#7BA89D" : O ? "#D17B6B" : "var(--text-muted, #666)", q = H ? "↑" : O ? "↓" : "→", V = (E) => Number.isInteger(E) && Math.abs(E) >= 1e3 ? E.toLocaleString() : typeof E == "number" ? E % 1 === 0 ? E.toString() : E.toFixed(E < 10 ? 2 : 1) : String(E);
|
|
404
404
|
return /* @__PURE__ */ y("div", { style: { display: "flex", alignItems: "baseline", gap: 12, padding: "8px 0" }, children: [
|
|
405
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ e("div", { style: {
|
|
406
406
|
fontSize: "36px",
|
|
407
407
|
fontWeight: 700,
|
|
408
408
|
lineHeight: 1,
|
|
409
409
|
color: "var(--text-strong, #1e2125)",
|
|
410
410
|
fontVariantNumeric: "tabular-nums"
|
|
411
|
-
}, children:
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
}, children: V(z) }),
|
|
412
|
+
$ && /* @__PURE__ */ e("div", { style: { fontSize: "14px", color: "var(--text-muted, #666)", fontWeight: 500 }, children: $ }),
|
|
413
|
+
_ && /* @__PURE__ */ y("div", { style: {
|
|
414
414
|
display: "flex",
|
|
415
415
|
alignItems: "center",
|
|
416
416
|
gap: 4,
|
|
417
417
|
fontSize: "13px",
|
|
418
418
|
fontWeight: 600,
|
|
419
|
-
color:
|
|
420
|
-
background: H ? "rgba(123,168,157,0.12)" :
|
|
419
|
+
color: Y,
|
|
420
|
+
background: H ? "rgba(123,168,157,0.12)" : O ? "rgba(209,123,107,0.12)" : "rgba(128,128,128,0.08)",
|
|
421
421
|
padding: "3px 8px",
|
|
422
422
|
borderRadius: "var(--radius-sm, 4px)"
|
|
423
423
|
}, children: [
|
|
424
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ e("span", { children: q }),
|
|
425
425
|
/* @__PURE__ */ y("span", { children: [
|
|
426
|
-
|
|
426
|
+
V(Math.abs(P)),
|
|
427
427
|
" (",
|
|
428
|
-
Math.abs(
|
|
428
|
+
Math.abs(ie).toFixed(1),
|
|
429
429
|
"%)"
|
|
430
430
|
] })
|
|
431
431
|
] }),
|
|
432
|
-
|
|
432
|
+
_ && /* @__PURE__ */ y("div", { style: { fontSize: "11px", color: "var(--text-faint, #999)" }, children: [
|
|
433
433
|
"vs ",
|
|
434
|
-
|
|
434
|
+
M.x || "previous"
|
|
435
435
|
] })
|
|
436
436
|
] });
|
|
437
437
|
}
|
|
438
438
|
default:
|
|
439
439
|
return /* @__PURE__ */ y("div", { style: { color: "var(--text-muted)", fontSize: 12, padding: 8 }, children: [
|
|
440
440
|
"Unsupported chart type: ",
|
|
441
|
-
|
|
441
|
+
l
|
|
442
442
|
] });
|
|
443
443
|
}
|
|
444
|
-
},
|
|
445
|
-
|
|
446
|
-
}, [
|
|
447
|
-
|
|
448
|
-
}, [
|
|
449
|
-
return /* @__PURE__ */ y("div", { style:
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
/* @__PURE__ */
|
|
444
|
+
}, le = l === "line" || l === "area" || (l === "bar" || l === "horizontal_bar") && !t ? n.map((m, S) => ({ label: m, color: C[S % C.length] })) : [], me = ce(() => {
|
|
445
|
+
p.current && Ee(p.current, d, le);
|
|
446
|
+
}, [d, le]), xe = ce(() => {
|
|
447
|
+
Ie(a, g), v(!0), setTimeout(() => v(!1), 2e3);
|
|
448
|
+
}, [a, g]);
|
|
449
|
+
return /* @__PURE__ */ y("div", { style: T, children: [
|
|
450
|
+
d && /* @__PURE__ */ e("div", { style: ne, children: d }),
|
|
451
|
+
l !== "metric" && /* @__PURE__ */ e(Fe, { onDownloadPng: me, onCopy: xe, copied: k }),
|
|
452
|
+
/* @__PURE__ */ e("div", { ref: p, children: fe() })
|
|
453
453
|
] });
|
|
454
|
-
},
|
|
455
|
-
const [
|
|
454
|
+
}, _e = ({ content: l, onCodeBlockClick: d, onFilePathClick: c }) => {
|
|
455
|
+
const [o, a] = G(/* @__PURE__ */ new Set()), f = async (s, n) => {
|
|
456
456
|
try {
|
|
457
|
-
await navigator.clipboard.writeText(
|
|
458
|
-
|
|
459
|
-
const r = new Set(
|
|
457
|
+
await navigator.clipboard.writeText(s), a((t) => /* @__PURE__ */ new Set([...t, n])), setTimeout(() => {
|
|
458
|
+
a((t) => {
|
|
459
|
+
const r = new Set(t);
|
|
460
460
|
return r.delete(n), r;
|
|
461
461
|
});
|
|
462
462
|
}, 2e3);
|
|
463
|
-
} catch (
|
|
464
|
-
console.error("Failed to copy text:",
|
|
463
|
+
} catch (t) {
|
|
464
|
+
console.error("Failed to copy text:", t);
|
|
465
465
|
}
|
|
466
|
-
},
|
|
467
|
-
const r =
|
|
466
|
+
}, p = (s, n, t) => {
|
|
467
|
+
const r = o.has(t);
|
|
468
468
|
return /* @__PURE__ */ y(
|
|
469
469
|
"div",
|
|
470
470
|
{
|
|
@@ -485,7 +485,7 @@ const w = [
|
|
|
485
485
|
background: "rgba(255,255,255,0.05)",
|
|
486
486
|
borderBottom: "1px solid rgba(255,255,255,0.1)"
|
|
487
487
|
}, children: [
|
|
488
|
-
/* @__PURE__ */
|
|
488
|
+
/* @__PURE__ */ e("span", { style: {
|
|
489
489
|
fontSize: "11px",
|
|
490
490
|
color: "rgba(255,255,255,0.7)",
|
|
491
491
|
fontFamily: "var(--font-mono, monospace)",
|
|
@@ -495,7 +495,7 @@ const w = [
|
|
|
495
495
|
/* @__PURE__ */ y(
|
|
496
496
|
"button",
|
|
497
497
|
{
|
|
498
|
-
onClick: () =>
|
|
498
|
+
onClick: () => f(s, t),
|
|
499
499
|
style: {
|
|
500
500
|
background: "none",
|
|
501
501
|
border: "none",
|
|
@@ -509,22 +509,22 @@ const w = [
|
|
|
509
509
|
fontSize: "11px",
|
|
510
510
|
transition: "all 0.15s ease"
|
|
511
511
|
},
|
|
512
|
-
onMouseEnter: (
|
|
513
|
-
|
|
512
|
+
onMouseEnter: (x) => {
|
|
513
|
+
x.target.style.background = "rgba(255,255,255,0.1)", x.target.style.color = "rgba(255,255,255,0.9)";
|
|
514
514
|
},
|
|
515
|
-
onMouseLeave: (
|
|
516
|
-
|
|
515
|
+
onMouseLeave: (x) => {
|
|
516
|
+
x.target.style.background = "none", x.target.style.color = "rgba(255,255,255,0.7)";
|
|
517
517
|
},
|
|
518
518
|
children: [
|
|
519
|
-
r ? /* @__PURE__ */
|
|
519
|
+
r ? /* @__PURE__ */ e(ge, { size: 12 }) : /* @__PURE__ */ e(ue, { size: 12 }),
|
|
520
520
|
r ? "Copied!" : "Copy"
|
|
521
521
|
]
|
|
522
522
|
}
|
|
523
523
|
),
|
|
524
|
-
|
|
524
|
+
d && /* @__PURE__ */ y(
|
|
525
525
|
"button",
|
|
526
526
|
{
|
|
527
|
-
onClick: () =>
|
|
527
|
+
onClick: () => d({ code: s, language: n }),
|
|
528
528
|
style: {
|
|
529
529
|
background: "none",
|
|
530
530
|
border: "none",
|
|
@@ -538,20 +538,20 @@ const w = [
|
|
|
538
538
|
fontSize: "11px",
|
|
539
539
|
transition: "all 0.15s ease"
|
|
540
540
|
},
|
|
541
|
-
onMouseEnter: (
|
|
542
|
-
|
|
541
|
+
onMouseEnter: (x) => {
|
|
542
|
+
x.currentTarget.style.background = "rgba(255,255,255,0.1)", x.currentTarget.style.color = "rgba(255,255,255,0.9)";
|
|
543
543
|
},
|
|
544
|
-
onMouseLeave: (
|
|
545
|
-
|
|
544
|
+
onMouseLeave: (x) => {
|
|
545
|
+
x.currentTarget.style.background = "none", x.currentTarget.style.color = "rgba(255,255,255,0.7)";
|
|
546
546
|
},
|
|
547
547
|
children: [
|
|
548
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ e(Le, { size: 12 }),
|
|
549
549
|
"Canvas"
|
|
550
550
|
]
|
|
551
551
|
}
|
|
552
552
|
)
|
|
553
553
|
] }),
|
|
554
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ e("pre", { style: {
|
|
555
555
|
margin: 0,
|
|
556
556
|
padding: "12px",
|
|
557
557
|
fontFamily: "var(--font-mono, monospace)",
|
|
@@ -561,46 +561,46 @@ const w = [
|
|
|
561
561
|
overflow: "auto",
|
|
562
562
|
whiteSpace: "pre-wrap",
|
|
563
563
|
wordBreak: "break-word"
|
|
564
|
-
}, children:
|
|
564
|
+
}, children: s })
|
|
565
565
|
]
|
|
566
566
|
},
|
|
567
|
-
|
|
567
|
+
t
|
|
568
568
|
);
|
|
569
|
-
}, k = (
|
|
570
|
-
const n = [],
|
|
569
|
+
}, k = (s) => {
|
|
570
|
+
const n = [], t = s.split(`
|
|
571
571
|
`);
|
|
572
|
-
let r = 0,
|
|
573
|
-
for (; r <
|
|
574
|
-
const
|
|
575
|
-
if (
|
|
576
|
-
const
|
|
577
|
-
let
|
|
578
|
-
for (r++; r <
|
|
579
|
-
|
|
580
|
-
r <
|
|
581
|
-
`),
|
|
572
|
+
let r = 0, x = 0;
|
|
573
|
+
for (; r < t.length; ) {
|
|
574
|
+
const b = t[r];
|
|
575
|
+
if (b.trim().startsWith("```")) {
|
|
576
|
+
const h = b.trim().slice(3);
|
|
577
|
+
let u = [];
|
|
578
|
+
for (r++; r < t.length && !t[r].trim().startsWith("```"); )
|
|
579
|
+
u.push(t[r]), r++;
|
|
580
|
+
r < t.length && r++, n.push(p(u.join(`
|
|
581
|
+
`), h, `code-${x++}`));
|
|
582
582
|
continue;
|
|
583
583
|
}
|
|
584
|
-
if (
|
|
585
|
-
const
|
|
584
|
+
if (b.startsWith("#")) {
|
|
585
|
+
const h = b.match(/^#+/)[0].length, u = b.slice(h).trim(), w = h === 1 ? "h2" : h === 2 ? "h3" : h === 3 ? "h4" : "h5";
|
|
586
586
|
n.push(
|
|
587
|
-
|
|
587
|
+
re.createElement(w, {
|
|
588
588
|
key: `header-${r}`,
|
|
589
589
|
style: {
|
|
590
|
-
fontSize:
|
|
590
|
+
fontSize: h === 1 ? "18px" : h === 2 ? "16px" : "14px",
|
|
591
591
|
fontWeight: 720,
|
|
592
592
|
color: "var(--text-strong, rgba(30,33,37,0.92))",
|
|
593
593
|
marginTop: n.length > 0 ? "20px" : "0",
|
|
594
594
|
marginBottom: "8px",
|
|
595
595
|
lineHeight: 1.3
|
|
596
596
|
}
|
|
597
|
-
},
|
|
597
|
+
}, u)
|
|
598
598
|
), r++;
|
|
599
599
|
continue;
|
|
600
600
|
}
|
|
601
|
-
if (
|
|
601
|
+
if (b.trim() === "---" || b.trim() === "***") {
|
|
602
602
|
n.push(
|
|
603
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ e("hr", { style: {
|
|
604
604
|
border: "none",
|
|
605
605
|
borderTop: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
|
|
606
606
|
margin: "16px 0"
|
|
@@ -608,39 +608,39 @@ const w = [
|
|
|
608
608
|
), r++;
|
|
609
609
|
continue;
|
|
610
610
|
}
|
|
611
|
-
if (
|
|
612
|
-
const
|
|
613
|
-
for (; r <
|
|
614
|
-
if (
|
|
615
|
-
const
|
|
616
|
-
|
|
611
|
+
if (b.match(/^(\s*)([-*+]|\d+\.)\s/)) {
|
|
612
|
+
const h = [], u = /^\s*\d+\./.test(b);
|
|
613
|
+
for (; r < t.length && (t[r].match(/^(\s*)([-*+]|\d+\.)\s/) || t[r].trim() === ""); ) {
|
|
614
|
+
if (t[r].trim() !== "") {
|
|
615
|
+
const B = t[r].match(/^(\s*)([-*+]|\d+\.)\s(.*)$/);
|
|
616
|
+
B && h.push(B[3]);
|
|
617
617
|
}
|
|
618
618
|
r++;
|
|
619
619
|
}
|
|
620
|
-
const
|
|
620
|
+
const w = u ? "ol" : "ul";
|
|
621
621
|
n.push(
|
|
622
|
-
|
|
622
|
+
re.createElement(w, {
|
|
623
623
|
key: `list-${r}`,
|
|
624
624
|
style: {
|
|
625
625
|
margin: "8px 0",
|
|
626
626
|
paddingLeft: "20px",
|
|
627
627
|
color: "var(--text-strong, rgba(30,33,37,0.92))"
|
|
628
628
|
}
|
|
629
|
-
},
|
|
630
|
-
(
|
|
631
|
-
key: `item-${
|
|
629
|
+
}, h.map(
|
|
630
|
+
(B, i) => re.createElement("li", {
|
|
631
|
+
key: `item-${i}`,
|
|
632
632
|
style: { marginBottom: "4px" }
|
|
633
|
-
},
|
|
633
|
+
}, g(B))
|
|
634
634
|
))
|
|
635
635
|
);
|
|
636
636
|
continue;
|
|
637
637
|
}
|
|
638
|
-
if (
|
|
639
|
-
const
|
|
640
|
-
for (; r <
|
|
641
|
-
|
|
642
|
-
if (
|
|
643
|
-
const
|
|
638
|
+
if (b.trim().startsWith("|") && b.trim().endsWith("|")) {
|
|
639
|
+
const h = [];
|
|
640
|
+
for (; r < t.length && t[r].trim().startsWith("|") && t[r].trim().endsWith("|"); )
|
|
641
|
+
h.push(t[r]), r++;
|
|
642
|
+
if (h.length >= 2) {
|
|
643
|
+
const u = (R) => R.trim().slice(1, -1).split("|").map((T) => T.trim()), w = u(h[0]), B = (R) => u(R).every((T) => /^[-:]+$/.test(T)), i = h.length >= 2 && B(h[1]), L = i ? 2 : 1, A = i ? u(h[1]).map((R) => R.startsWith(":") && R.endsWith(":") ? "center" : R.endsWith(":") ? "right" : "left") : w.map(() => "left"), F = {
|
|
644
644
|
padding: "6px 12px",
|
|
645
645
|
borderBottom: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
|
|
646
646
|
fontSize: "13px",
|
|
@@ -654,48 +654,48 @@ const w = [
|
|
|
654
654
|
overflowWrap: "normal"
|
|
655
655
|
};
|
|
656
656
|
n.push(
|
|
657
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ e("div", { style: { overflowX: "auto", margin: "8px 0" }, children: /* @__PURE__ */ y("table", { style: {
|
|
658
658
|
borderCollapse: "collapse",
|
|
659
659
|
width: "100%",
|
|
660
660
|
border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
|
|
661
661
|
borderRadius: "6px",
|
|
662
662
|
overflow: "hidden"
|
|
663
663
|
}, children: [
|
|
664
|
-
|
|
665
|
-
/* @__PURE__ */
|
|
664
|
+
i && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { style: { background: "var(--hover-warm-subtle, rgba(231,212,162,0.08))" }, children: w.map((R, T) => /* @__PURE__ */ e("th", { style: { ...F, fontWeight: 660, textAlign: A[T] || "left", whiteSpace: "nowrap" }, children: g(R) }, T)) }) }),
|
|
665
|
+
/* @__PURE__ */ e("tbody", { children: (i ? h.slice(L) : h).map((R, T) => /* @__PURE__ */ e("tr", { style: { background: T % 2 === 1 ? "var(--hover-warm-subtle, rgba(231,212,162,0.04))" : "transparent" }, children: u(R).map((ne, j) => /* @__PURE__ */ e("td", { style: { ...F, textAlign: A[j] || "left" }, children: g(ne) }, j)) }, T)) })
|
|
666
666
|
] }) }, `table-${r}`)
|
|
667
667
|
);
|
|
668
668
|
}
|
|
669
669
|
continue;
|
|
670
670
|
}
|
|
671
|
-
if (
|
|
672
|
-
const
|
|
673
|
-
for (; r <
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
/* @__PURE__ */
|
|
671
|
+
if (b.trim()) {
|
|
672
|
+
const h = [];
|
|
673
|
+
for (; r < t.length && t[r].trim() && !t[r].match(/^(#|```|---|\*\*\*|(\s*)([-*+]|\d+\.)\s)/) && !(t[r].trim().startsWith("|") && t[r].trim().endsWith("|")); )
|
|
674
|
+
h.push(t[r]), r++;
|
|
675
|
+
h.length > 0 && n.push(
|
|
676
|
+
/* @__PURE__ */ e("p", { style: {
|
|
677
677
|
margin: "8px 0",
|
|
678
678
|
lineHeight: 1.6,
|
|
679
679
|
color: "var(--text-strong, rgba(30,33,37,0.92))"
|
|
680
|
-
}, children:
|
|
680
|
+
}, children: g(h.join(" ")) }, `p-${r}`)
|
|
681
681
|
);
|
|
682
682
|
} else
|
|
683
683
|
r++;
|
|
684
684
|
}
|
|
685
685
|
return n;
|
|
686
|
-
},
|
|
686
|
+
}, v = (s) => {
|
|
687
687
|
const n = [];
|
|
688
|
-
let
|
|
689
|
-
for (;
|
|
690
|
-
if (
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
const
|
|
688
|
+
let t = s, r = 0;
|
|
689
|
+
for (; t.length > 0; ) {
|
|
690
|
+
if (c) {
|
|
691
|
+
const i = t.match(/^([^\s`*\[]+(?:\/src\/|\/components\/|\/packages\/)[^\s`*\[]*|[^\s`*\[]*\.(ts|tsx|js|jsx|py|css|scss|sass|json|md|yaml|yml|html|xml|sh|sql|go|rs|php|java|c|cpp|h|hpp)(?:\b|$))/);
|
|
692
|
+
if (i) {
|
|
693
|
+
const L = i[1];
|
|
694
694
|
n.push(
|
|
695
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ e(
|
|
696
696
|
"span",
|
|
697
697
|
{
|
|
698
|
-
onClick: () =>
|
|
698
|
+
onClick: () => c(L),
|
|
699
699
|
style: {
|
|
700
700
|
color: "var(--rail-discovery, #5E88B0)",
|
|
701
701
|
textDecoration: "underline",
|
|
@@ -711,24 +711,24 @@ const w = [
|
|
|
711
711
|
textDecorationStyle: "solid"
|
|
712
712
|
}
|
|
713
713
|
},
|
|
714
|
-
onMouseEnter: (
|
|
715
|
-
|
|
714
|
+
onMouseEnter: (A) => {
|
|
715
|
+
A.target.style.background = "var(--hover-warm-subtle, rgba(231,212,162,0.08))", A.target.style.textDecorationStyle = "solid";
|
|
716
716
|
},
|
|
717
|
-
onMouseLeave: (
|
|
718
|
-
|
|
717
|
+
onMouseLeave: (A) => {
|
|
718
|
+
A.target.style.background = "none", A.target.style.textDecorationStyle = "dotted";
|
|
719
719
|
},
|
|
720
|
-
children:
|
|
720
|
+
children: L
|
|
721
721
|
},
|
|
722
722
|
`file-path-${r++}`
|
|
723
723
|
)
|
|
724
|
-
),
|
|
724
|
+
), t = t.slice(i[0].length);
|
|
725
725
|
continue;
|
|
726
726
|
}
|
|
727
727
|
}
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
728
|
+
const x = t.match(/^`([^`]+)`/);
|
|
729
|
+
if (x) {
|
|
730
730
|
n.push(
|
|
731
|
-
/* @__PURE__ */
|
|
731
|
+
/* @__PURE__ */ e("code", { style: {
|
|
732
732
|
background: "var(--hover-warm-subtle, rgba(231,212,162,0.08))",
|
|
733
733
|
border: "1px solid var(--border-subtle, rgba(52,58,64,0.08))",
|
|
734
734
|
borderRadius: "3px",
|
|
@@ -736,33 +736,55 @@ const w = [
|
|
|
736
736
|
fontFamily: "var(--font-mono, monospace)",
|
|
737
737
|
fontSize: "12px",
|
|
738
738
|
color: "var(--text-strong, rgba(30,33,37,0.92))"
|
|
739
|
-
}, children:
|
|
740
|
-
),
|
|
739
|
+
}, children: x[1] }, `inline-code-${r++}`)
|
|
740
|
+
), t = t.slice(x[0].length);
|
|
741
741
|
continue;
|
|
742
742
|
}
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
743
|
+
const b = t.match(/^\*\*([^*]+)\*\*/);
|
|
744
|
+
if (b) {
|
|
745
745
|
n.push(
|
|
746
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ e("strong", { style: {
|
|
747
747
|
fontWeight: 720,
|
|
748
748
|
color: "var(--text-strong, rgba(30,33,37,0.92))"
|
|
749
|
-
}, children:
|
|
750
|
-
),
|
|
749
|
+
}, children: b[1] }, `bold-${r++}`)
|
|
750
|
+
), t = t.slice(b[0].length);
|
|
751
751
|
continue;
|
|
752
752
|
}
|
|
753
|
-
const
|
|
754
|
-
if (
|
|
753
|
+
const h = t.match(/^\*([^*]+)\*/);
|
|
754
|
+
if (h) {
|
|
755
755
|
n.push(
|
|
756
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ e("em", { style: {
|
|
757
757
|
fontStyle: "italic",
|
|
758
758
|
color: "var(--text-strong, rgba(30,33,37,0.92))"
|
|
759
|
-
}, children:
|
|
760
|
-
),
|
|
759
|
+
}, children: h[1] }, `italic-${r++}`)
|
|
760
|
+
), t = t.slice(h[0].length);
|
|
761
|
+
continue;
|
|
762
|
+
}
|
|
763
|
+
const u = t.match(/^!\[([^\]]*)\]\(([^)]+)\)/);
|
|
764
|
+
if (u) {
|
|
765
|
+
const i = u[1] || u[2], L = u[2];
|
|
766
|
+
n.push(
|
|
767
|
+
/* @__PURE__ */ e(
|
|
768
|
+
"a",
|
|
769
|
+
{
|
|
770
|
+
href: L,
|
|
771
|
+
target: "_blank",
|
|
772
|
+
rel: "noopener noreferrer",
|
|
773
|
+
style: {
|
|
774
|
+
color: "var(--rail-discovery, #5E88B0)",
|
|
775
|
+
textDecoration: "underline",
|
|
776
|
+
textUnderlineOffset: "2px"
|
|
777
|
+
},
|
|
778
|
+
children: i
|
|
779
|
+
},
|
|
780
|
+
`img-link-${r++}`
|
|
781
|
+
)
|
|
782
|
+
), t = t.slice(u[0].length);
|
|
761
783
|
continue;
|
|
762
784
|
}
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
785
|
+
const w = t.match(/^\[([^\]]+)\]\(([^)]+)\)/);
|
|
786
|
+
if (w) {
|
|
787
|
+
const i = w[1], L = w[2], A = i === "View", F = {
|
|
766
788
|
display: "inline-flex",
|
|
767
789
|
alignItems: "center",
|
|
768
790
|
padding: "3px 10px",
|
|
@@ -774,83 +796,279 @@ const w = [
|
|
|
774
796
|
fontWeight: 600,
|
|
775
797
|
whiteSpace: "nowrap",
|
|
776
798
|
cursor: "pointer"
|
|
777
|
-
},
|
|
799
|
+
}, R = {
|
|
778
800
|
color: "var(--rail-discovery, #5E88B0)",
|
|
779
801
|
textDecoration: "underline",
|
|
780
802
|
textUnderlineOffset: "2px"
|
|
781
803
|
};
|
|
782
804
|
n.push(
|
|
783
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ e(
|
|
784
806
|
"a",
|
|
785
807
|
{
|
|
786
|
-
href:
|
|
808
|
+
href: L,
|
|
787
809
|
target: "_blank",
|
|
788
810
|
rel: "noopener noreferrer",
|
|
789
|
-
style:
|
|
790
|
-
children:
|
|
811
|
+
style: A ? F : R,
|
|
812
|
+
children: i
|
|
791
813
|
},
|
|
792
814
|
`link-${r++}`
|
|
793
815
|
)
|
|
794
|
-
),
|
|
816
|
+
), t = t.slice(w[0].length);
|
|
795
817
|
continue;
|
|
796
818
|
}
|
|
797
|
-
const
|
|
798
|
-
if (
|
|
799
|
-
n.push(
|
|
819
|
+
const B = t.search(/[`*\[!]/);
|
|
820
|
+
if (B === -1) {
|
|
821
|
+
n.push(t);
|
|
800
822
|
break;
|
|
801
823
|
} else
|
|
802
|
-
|
|
824
|
+
B === 0 ? (n.push(t[0]), t = t.slice(1)) : (n.push(t.slice(0, B)), t = t.slice(B));
|
|
803
825
|
}
|
|
804
826
|
return n.length === 1 && typeof n[0] == "string" ? n[0] : n;
|
|
805
|
-
},
|
|
806
|
-
return /* @__PURE__ */
|
|
807
|
-
};
|
|
808
|
-
function
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
827
|
+
}, g = (s) => v(s);
|
|
828
|
+
return /* @__PURE__ */ e("div", { children: k(l) });
|
|
829
|
+
}, D = "#808183", W = "#2e3236";
|
|
830
|
+
function je(l) {
|
|
831
|
+
return l ? l.replace(/```[a-zA-Z0-9]*\n?([\s\S]*?)```/g, "$1").replace(/`([^`]+)`/g, "$1").replace(
|
|
832
|
+
/!\[([^\]]*)\]\(([^)]*)\)/g,
|
|
833
|
+
(d, c, o) => c.trim() && c.trim() !== o.trim() ? `${c} (${o})` : o
|
|
834
|
+
).replace(
|
|
835
|
+
/\[([^\]]+)\]\(([^)]*)\)/g,
|
|
836
|
+
(d, c, o) => c.trim() && c.trim() !== o.trim() ? `${c} (${o})` : o
|
|
837
|
+
).replace(/(\*\*|__)(.*?)\1/g, "$2").replace(/(\*|_)(.*?)\1/g, "$2").replace(/~~(.*?)~~/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/^\s{0,3}>\s?/gm, "").replace(/^\s*[-*+]\s+/gm, "• ").replace(/^\s*([-*_])\1{2,}\s*$/gm, "").trim() : "";
|
|
838
|
+
}
|
|
839
|
+
function He({ timestamp: l, content: d, showFeedback: c, align: o = "start", onFeedback: a, initialRating: f = null }) {
|
|
840
|
+
const [p, k] = G(!1), [v, g] = G(f), [s, n] = G(!1), [t, r] = G(""), x = he(null);
|
|
841
|
+
be(() => {
|
|
842
|
+
if (!s)
|
|
843
|
+
return;
|
|
844
|
+
const i = (A) => {
|
|
845
|
+
x.current && !x.current.contains(A.target) && n(!1);
|
|
846
|
+
}, L = (A) => {
|
|
847
|
+
A.key === "Escape" && n(!1);
|
|
848
|
+
};
|
|
849
|
+
return document.addEventListener("mousedown", i), document.addEventListener("keydown", L), () => {
|
|
850
|
+
document.removeEventListener("mousedown", i), document.removeEventListener("keydown", L);
|
|
851
|
+
};
|
|
852
|
+
}, [s]);
|
|
853
|
+
const b = async () => {
|
|
854
|
+
try {
|
|
855
|
+
await navigator.clipboard.writeText(je(d || "")), k(!0), setTimeout(() => k(!1), 1500);
|
|
856
|
+
} catch (i) {
|
|
857
|
+
console.error("Failed to copy message:", i);
|
|
858
|
+
}
|
|
859
|
+
}, h = () => {
|
|
860
|
+
n(!1), g("up"), a == null || a({ rating: "up" });
|
|
861
|
+
}, u = () => {
|
|
862
|
+
g("down"), n(!1), a == null || a({
|
|
863
|
+
rating: "down",
|
|
864
|
+
...t.trim() ? { reason: t.trim() } : {}
|
|
865
|
+
});
|
|
866
|
+
}, w = {
|
|
867
|
+
display: "inline-flex",
|
|
868
|
+
alignItems: "center",
|
|
869
|
+
justifyContent: "center",
|
|
870
|
+
padding: 0,
|
|
871
|
+
background: "transparent",
|
|
872
|
+
border: "none",
|
|
873
|
+
cursor: "pointer",
|
|
874
|
+
color: D,
|
|
875
|
+
transition: "color 0.12s ease"
|
|
876
|
+
}, B = /* @__PURE__ */ e("span", { style: { fontSize: "13px", color: D, lineHeight: "normal" }, children: "•" });
|
|
877
|
+
return /* @__PURE__ */ y(
|
|
878
|
+
"div",
|
|
879
|
+
{
|
|
880
|
+
style: {
|
|
881
|
+
position: "relative",
|
|
882
|
+
display: "flex",
|
|
883
|
+
alignItems: "center",
|
|
884
|
+
gap: "8px",
|
|
885
|
+
marginTop: "8px",
|
|
886
|
+
justifyContent: o === "end" ? "flex-end" : "flex-start"
|
|
887
|
+
},
|
|
888
|
+
children: [
|
|
889
|
+
l && /* @__PURE__ */ e("span", { style: { fontSize: "13px", color: D, whiteSpace: "nowrap" }, children: l }),
|
|
890
|
+
l && B,
|
|
891
|
+
/* @__PURE__ */ e(
|
|
892
|
+
"button",
|
|
893
|
+
{
|
|
894
|
+
type: "button",
|
|
895
|
+
title: p ? "Copied" : "Copy",
|
|
896
|
+
onClick: b,
|
|
897
|
+
style: { ...w, color: p ? "#1f9d57" : D },
|
|
898
|
+
onMouseEnter: (i) => {
|
|
899
|
+
p || (i.currentTarget.style.color = W);
|
|
900
|
+
},
|
|
901
|
+
onMouseLeave: (i) => {
|
|
902
|
+
p || (i.currentTarget.style.color = D);
|
|
903
|
+
},
|
|
904
|
+
children: p ? /* @__PURE__ */ e(ge, { size: 16 }) : /* @__PURE__ */ e(ue, { size: 16 })
|
|
905
|
+
}
|
|
906
|
+
),
|
|
907
|
+
c && /* @__PURE__ */ y(ye, { children: [
|
|
908
|
+
B,
|
|
909
|
+
/* @__PURE__ */ y("div", { style: { display: "inline-flex", alignItems: "center", gap: "16px" }, children: [
|
|
910
|
+
/* @__PURE__ */ e(
|
|
911
|
+
"button",
|
|
912
|
+
{
|
|
913
|
+
type: "button",
|
|
914
|
+
title: "Good response",
|
|
915
|
+
onClick: h,
|
|
916
|
+
style: { ...w, color: v === "up" ? W : D },
|
|
917
|
+
onMouseEnter: (i) => i.currentTarget.style.color = W,
|
|
918
|
+
onMouseLeave: (i) => i.currentTarget.style.color = v === "up" ? W : D,
|
|
919
|
+
children: /* @__PURE__ */ e(Be, { size: 16, fill: v === "up" ? "currentColor" : "none" })
|
|
920
|
+
}
|
|
921
|
+
),
|
|
922
|
+
/* @__PURE__ */ e(
|
|
923
|
+
"button",
|
|
924
|
+
{
|
|
925
|
+
type: "button",
|
|
926
|
+
title: "Bad response",
|
|
927
|
+
onClick: () => n((i) => !i),
|
|
928
|
+
style: {
|
|
929
|
+
...w,
|
|
930
|
+
color: v === "down" || s ? W : D
|
|
931
|
+
},
|
|
932
|
+
onMouseEnter: (i) => i.currentTarget.style.color = W,
|
|
933
|
+
onMouseLeave: (i) => i.currentTarget.style.color = v === "down" || s ? W : D,
|
|
934
|
+
children: /* @__PURE__ */ e(ze, { size: 16, fill: v === "down" ? "currentColor" : "none" })
|
|
935
|
+
}
|
|
936
|
+
)
|
|
937
|
+
] })
|
|
938
|
+
] }),
|
|
939
|
+
s && /* @__PURE__ */ y(
|
|
940
|
+
"div",
|
|
941
|
+
{
|
|
942
|
+
ref: x,
|
|
943
|
+
style: {
|
|
944
|
+
position: "absolute",
|
|
945
|
+
top: "calc(100% + 6px)",
|
|
946
|
+
[o === "end" ? "right" : "left"]: 0,
|
|
947
|
+
zIndex: 30,
|
|
948
|
+
width: "300px",
|
|
949
|
+
background: "#FFFFFF",
|
|
950
|
+
border: "1px solid #d9d9d9",
|
|
951
|
+
borderRadius: "10px",
|
|
952
|
+
boxShadow: "0 4px 16px rgba(0,0,0,0.12)",
|
|
953
|
+
padding: "12px",
|
|
954
|
+
display: "flex",
|
|
955
|
+
flexDirection: "column",
|
|
956
|
+
gap: "10px",
|
|
957
|
+
textAlign: "left"
|
|
958
|
+
},
|
|
959
|
+
children: [
|
|
960
|
+
/* @__PURE__ */ e("div", { style: { fontSize: "13px", fontWeight: 600, color: W }, children: "What was wrong with this response?" }),
|
|
961
|
+
/* @__PURE__ */ e(
|
|
962
|
+
"textarea",
|
|
963
|
+
{
|
|
964
|
+
value: t,
|
|
965
|
+
onChange: (i) => r(i.target.value),
|
|
966
|
+
placeholder: "Add details (optional)",
|
|
967
|
+
rows: 3,
|
|
968
|
+
style: {
|
|
969
|
+
width: "100%",
|
|
970
|
+
boxSizing: "border-box",
|
|
971
|
+
resize: "none",
|
|
972
|
+
border: "1px solid #d9d9d9",
|
|
973
|
+
borderRadius: "8px",
|
|
974
|
+
padding: "8px",
|
|
975
|
+
fontSize: "13px",
|
|
976
|
+
color: W,
|
|
977
|
+
fontFamily: "inherit",
|
|
978
|
+
outline: "none"
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
),
|
|
982
|
+
/* @__PURE__ */ y("div", { style: { display: "flex", justifyContent: "flex-end", gap: "8px" }, children: [
|
|
983
|
+
/* @__PURE__ */ e(
|
|
984
|
+
"button",
|
|
985
|
+
{
|
|
986
|
+
type: "button",
|
|
987
|
+
onClick: () => n(!1),
|
|
988
|
+
style: {
|
|
989
|
+
padding: "6px 12px",
|
|
990
|
+
fontSize: "12px",
|
|
991
|
+
fontWeight: 600,
|
|
992
|
+
color: W,
|
|
993
|
+
background: "#FFFFFF",
|
|
994
|
+
border: "1px solid #d9d9d9",
|
|
995
|
+
borderRadius: "6px",
|
|
996
|
+
cursor: "pointer"
|
|
997
|
+
},
|
|
998
|
+
children: "Cancel"
|
|
999
|
+
}
|
|
1000
|
+
),
|
|
1001
|
+
/* @__PURE__ */ e(
|
|
1002
|
+
"button",
|
|
1003
|
+
{
|
|
1004
|
+
type: "button",
|
|
1005
|
+
onClick: u,
|
|
1006
|
+
style: {
|
|
1007
|
+
padding: "6px 12px",
|
|
1008
|
+
fontSize: "12px",
|
|
1009
|
+
fontWeight: 600,
|
|
1010
|
+
color: "#f2f2f0",
|
|
1011
|
+
background: "#0B0B0B",
|
|
1012
|
+
border: "1px solid #0B0B0B",
|
|
1013
|
+
borderRadius: "6px",
|
|
1014
|
+
cursor: "pointer"
|
|
1015
|
+
},
|
|
1016
|
+
children: "Submit"
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
] })
|
|
1020
|
+
]
|
|
1021
|
+
}
|
|
1022
|
+
)
|
|
1023
|
+
]
|
|
1024
|
+
}
|
|
1025
|
+
);
|
|
1026
|
+
}
|
|
1027
|
+
function Ye({
|
|
1028
|
+
role: l,
|
|
1029
|
+
content: d,
|
|
1030
|
+
html: c,
|
|
1031
|
+
timestamp: o,
|
|
1032
|
+
toolBadges: a,
|
|
1033
|
+
isStreaming: f,
|
|
1034
|
+
onCodeBlockClick: p,
|
|
1035
|
+
onFilePathClick: k,
|
|
1036
|
+
onFeedback: v,
|
|
1037
|
+
feedbackRating: g,
|
|
1038
|
+
afterContent: s
|
|
817
1039
|
}) {
|
|
818
|
-
const
|
|
1040
|
+
const n = l === "user";
|
|
819
1041
|
return /* @__PURE__ */ y(
|
|
820
1042
|
"div",
|
|
821
1043
|
{
|
|
822
1044
|
style: {
|
|
823
1045
|
display: "flex",
|
|
824
1046
|
flexDirection: "column",
|
|
825
|
-
alignItems:
|
|
1047
|
+
alignItems: n ? "flex-end" : "flex-start",
|
|
826
1048
|
marginBottom: "16px",
|
|
827
1049
|
width: "100%",
|
|
828
1050
|
maxWidth: "100%"
|
|
829
1051
|
},
|
|
830
1052
|
children: [
|
|
831
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ e(
|
|
832
1054
|
"div",
|
|
833
1055
|
{
|
|
834
1056
|
style: {
|
|
835
|
-
fontSize: "
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
letterSpacing: "0.02em"
|
|
1057
|
+
fontSize: "13px",
|
|
1058
|
+
fontWeight: 400,
|
|
1059
|
+
color: D,
|
|
1060
|
+
marginBottom: "6px"
|
|
840
1061
|
},
|
|
841
|
-
children:
|
|
842
|
-
x ? "You" : "Compass",
|
|
843
|
-
u && !x && /* @__PURE__ */ t("span", { style: { marginLeft: "6px", color: "var(--rail-purple, #9B7AA8)" }, children: "●" })
|
|
844
|
-
]
|
|
1062
|
+
children: n ? "You" : "Compass"
|
|
845
1063
|
}
|
|
846
1064
|
),
|
|
847
|
-
|
|
1065
|
+
a && a.length > 0 && /* @__PURE__ */ e("div", { style: {
|
|
848
1066
|
marginBottom: "8px",
|
|
849
1067
|
display: "flex",
|
|
850
1068
|
flexWrap: "wrap",
|
|
851
1069
|
gap: "4px",
|
|
852
1070
|
maxWidth: "75%"
|
|
853
|
-
}, children:
|
|
1071
|
+
}, children: a.map((t, r) => /* @__PURE__ */ y(
|
|
854
1072
|
"span",
|
|
855
1073
|
{
|
|
856
1074
|
style: {
|
|
@@ -859,51 +1077,63 @@ function _t({
|
|
|
859
1077
|
padding: "2px 8px",
|
|
860
1078
|
borderRadius: "6px",
|
|
861
1079
|
background: "var(--paper-elevated, rgba(255,255,255,0.82))",
|
|
862
|
-
border: `1px solid ${
|
|
863
|
-
color:
|
|
1080
|
+
border: `1px solid ${t.pending ? "var(--rail-discovery, #5A8CC0)" : t.success !== !1 ? "var(--state-present, #5CB85C)" : "var(--rail-signal-churn, #C98A5A)"}`,
|
|
1081
|
+
color: t.pending ? "var(--rail-discovery, #5A8CC0)" : t.success !== !1 ? "var(--state-present, #5CB85C)" : "var(--rail-signal-churn, #C98A5A)"
|
|
864
1082
|
},
|
|
865
1083
|
children: [
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
|
|
868
|
-
|
|
1084
|
+
/* @__PURE__ */ e(Re, { size: 10, style: { marginRight: 3, verticalAlign: "middle" } }),
|
|
1085
|
+
t.name,
|
|
1086
|
+
t.pending ? "..." : t.success !== !1 ? " ✓" : " ✗"
|
|
869
1087
|
]
|
|
870
1088
|
},
|
|
871
|
-
|
|
1089
|
+
t.id || r
|
|
872
1090
|
)) }),
|
|
873
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ e(
|
|
874
1092
|
"div",
|
|
875
1093
|
{
|
|
876
|
-
style: {
|
|
1094
|
+
style: n ? {
|
|
1095
|
+
maxWidth: "85%",
|
|
1096
|
+
width: "fit-content",
|
|
1097
|
+
padding: "12px 16px",
|
|
1098
|
+
borderRadius: "8px",
|
|
1099
|
+
background: "#f3f7f7",
|
|
1100
|
+
// grey/hover
|
|
1101
|
+
fontSize: "14px",
|
|
1102
|
+
lineHeight: 1.6,
|
|
1103
|
+
color: "#2e3236",
|
|
1104
|
+
// grey/strong
|
|
1105
|
+
wordBreak: "break-word"
|
|
1106
|
+
} : {
|
|
877
1107
|
width: "100%",
|
|
878
1108
|
maxWidth: "100%",
|
|
879
|
-
padding: "
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
fontSize: "
|
|
1109
|
+
padding: "20px 24px",
|
|
1110
|
+
border: "1px solid #e6e6e6",
|
|
1111
|
+
borderRadius: "14px",
|
|
1112
|
+
background: "#FFFFFF",
|
|
1113
|
+
fontSize: "14px",
|
|
884
1114
|
lineHeight: 1.6,
|
|
885
|
-
color: "
|
|
1115
|
+
color: "#2e3236",
|
|
886
1116
|
wordBreak: "break-word"
|
|
887
1117
|
},
|
|
888
|
-
children:
|
|
1118
|
+
children: c ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: c } }) : n ? (
|
|
889
1119
|
// User messages stay plain text
|
|
890
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ e("div", { style: { whiteSpace: "pre-wrap" }, children: d })
|
|
891
1121
|
) : (
|
|
892
1122
|
// Assistant messages get markdown rendering
|
|
893
|
-
/* @__PURE__ */
|
|
1123
|
+
/* @__PURE__ */ e(_e, { content: d || "", onCodeBlockClick: p, onFilePathClick: k })
|
|
894
1124
|
)
|
|
895
1125
|
}
|
|
896
1126
|
),
|
|
897
|
-
|
|
898
|
-
|
|
1127
|
+
s && /* @__PURE__ */ e("div", { style: { width: "100%", marginTop: "10px" }, children: s }),
|
|
1128
|
+
!(f && !n) && /* @__PURE__ */ e(
|
|
1129
|
+
He,
|
|
899
1130
|
{
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
children: a
|
|
1131
|
+
timestamp: o,
|
|
1132
|
+
content: d,
|
|
1133
|
+
showFeedback: !n,
|
|
1134
|
+
align: n ? "end" : "start",
|
|
1135
|
+
onFeedback: v,
|
|
1136
|
+
initialRating: g
|
|
907
1137
|
}
|
|
908
1138
|
)
|
|
909
1139
|
]
|
|
@@ -911,7 +1141,7 @@ function _t({
|
|
|
911
1141
|
);
|
|
912
1142
|
}
|
|
913
1143
|
export {
|
|
914
|
-
|
|
915
|
-
|
|
1144
|
+
Ye as C,
|
|
1145
|
+
Ge as a
|
|
916
1146
|
};
|
|
917
1147
|
//# sourceMappingURL=ChatMessage.es.js.map
|