@epam/ai-dial-conversation-stages 1.3.0-dev.358 → 1.3.0-dev.364
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/index.js +324 -318
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, MarkdownCodeBlock as r, MarkdownRenderer as i, RequestStatus as a, StageStatus as o, buildCssVars as s, mergeClasses as c, messageAttachmentsToDisplayAttachments as l, normalizeMimeType as u } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { Accordion as
|
|
3
|
-
import { IconAlertCircle as T, IconCheck as E, IconClipboard as D, IconDownload as O, IconExternalLink as k, IconFile as A, IconFileTypeBmp as j, IconFileTypeCss as M, IconFileTypeCsv as N, IconFileTypeDoc as P, IconFileTypeDocx as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Fragment as
|
|
1
|
+
import { AttachmentErrorReason as e, AttachmentType as t, MIME_TYPE_EXT_MAP as n, MarkdownCodeBlock as r, MarkdownRenderer as i, RequestStatus as a, StageStatus as o, buildCssVars as s, mergeClasses as c, messageAttachmentsToDisplayAttachments as l, normalizeMimeType as u, useIsVerticallyClamped as d } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { Accordion as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, DialItemType as h, ElementSize as g, EllipsisTooltip as ee, FileIcon as _, Highlight as v, LiveRegion as y, LiveRegionElement as b, Skeleton as x, SkeletonVariant as S, Spinner as te, StaticIconButton as C, Tooltip as w } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconAlertCircle as T, IconCheck as E, IconClipboard as D, IconDownload as O, IconExternalLink as k, IconFile as A, IconFileTypeBmp as j, IconFileTypeCss as M, IconFileTypeCsv as N, IconFileTypeDoc as P, IconFileTypeDocx as ne, IconFileTypeHtml as F, IconFileTypeJpg as I, IconFileTypeJs as L, IconFileTypeJsx as R, IconFileTypePdf as z, IconFileTypePhp as B, IconFileTypePng as V, IconFileTypePpt as H, IconFileTypeRs as re, IconFileTypeSql as ie, IconFileTypeSvg as ae, IconFileTypeTs as oe, IconFileTypeTsx as se, IconFileTypeTxt as U, IconFileTypeVue as W, IconFileTypeXls as ce, IconFileTypeXml as le, IconFileTypeZip as ue, IconMusic as G, IconPhoto as de, IconReload as fe, IconTerminal2 as pe, IconVideo as me, IconX as he } from "@tabler/icons-react";
|
|
4
|
+
import { memo as ge, useCallback as K, useEffect as _e, useId as ve, useMemo as q, useRef as ye, useState as be } from "react";
|
|
5
|
+
import { Fragment as xe, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
6
6
|
//#region src/constants/public-class-names.ts
|
|
7
|
-
var
|
|
7
|
+
var Se = {
|
|
8
8
|
panel: "dial-conversation-stages-panel",
|
|
9
9
|
group: "dial-conversation-stages-group",
|
|
10
10
|
groupToggle: "dial-conversation-stages-group-toggle"
|
|
11
|
-
},
|
|
12
|
-
let [e, t] =
|
|
11
|
+
}, Ce = () => {
|
|
12
|
+
let [e, t] = be(() => /* @__PURE__ */ new Set()), n = K((e, n) => {
|
|
13
13
|
t((t) => {
|
|
14
14
|
if (t.has(e) === n) return t;
|
|
15
15
|
let r = new Set(t);
|
|
@@ -27,30 +27,30 @@ var be = {
|
|
|
27
27
|
n,
|
|
28
28
|
r
|
|
29
29
|
]);
|
|
30
|
-
},
|
|
30
|
+
}, we = /[([][^()[\]]*[)\]]/g, Te = /(\d+(?:\.\d+)?)\s*s\b/, Ee = (e) => {
|
|
31
31
|
let t = e.trimEnd();
|
|
32
32
|
return t.endsWith(":") ? t.slice(0, -1) : t;
|
|
33
|
-
},
|
|
34
|
-
|
|
33
|
+
}, De = (e) => {
|
|
34
|
+
we.lastIndex = 0;
|
|
35
35
|
let t;
|
|
36
|
-
for (; t =
|
|
37
|
-
let e = t[0].slice(1, -1), n =
|
|
36
|
+
for (; t = we.exec(e);) {
|
|
37
|
+
let e = t[0].slice(1, -1), n = Te.exec(e);
|
|
38
38
|
if (n) return {
|
|
39
39
|
durationLabel: `${n[1]}s`,
|
|
40
40
|
groupIndex: t.index,
|
|
41
41
|
groupLength: t[0].length
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
let t = e ?? "", n =
|
|
44
|
+
}, Oe = (e) => {
|
|
45
|
+
let t = e ?? "", n = De(t);
|
|
46
46
|
return {
|
|
47
|
-
name:
|
|
47
|
+
name: Ee(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
|
|
48
48
|
durationLabel: n?.durationLabel
|
|
49
49
|
};
|
|
50
|
-
},
|
|
50
|
+
}, ke = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), Ae = (e) => [...e].reverse().find((e) => e.status == null), je = (e, t) => {
|
|
51
51
|
let n = e.parent_stage_index;
|
|
52
52
|
if (!(n == null || !Number.isInteger(n) || n < 0 || n >= e.index)) return t.get(n);
|
|
53
|
-
},
|
|
53
|
+
}, Me = (e) => {
|
|
54
54
|
let t = e.map((e) => ({
|
|
55
55
|
stage: e,
|
|
56
56
|
children: []
|
|
@@ -58,15 +58,15 @@ var be = {
|
|
|
58
58
|
for (let e of t) n.has(e.stage.index) || n.set(e.stage.index, e);
|
|
59
59
|
let r = [];
|
|
60
60
|
for (let e of t) {
|
|
61
|
-
let t =
|
|
61
|
+
let t = je(e.stage, n);
|
|
62
62
|
t ? t.children.push(e) : r.push(e);
|
|
63
63
|
}
|
|
64
64
|
return r;
|
|
65
|
-
},
|
|
65
|
+
}, Ne = (e) => `stage:${e}`, Pe = (e) => `group:${e}`, Fe = "min-w-0 overflow-visible py-0", Ie = "min-w-0 justify-start gap-2 rounded-lg px-2 py-1.5 text-start mobile:min-h-11", Le = (e) => {
|
|
66
66
|
let t = [], n = 0;
|
|
67
67
|
for (; n < e.length;) {
|
|
68
|
-
let r = e[n], i =
|
|
69
|
-
for (; a < e.length &&
|
|
68
|
+
let r = e[n], i = Oe(r.stage.name).name, a = n + 1;
|
|
69
|
+
for (; a < e.length && Oe(e[a].stage.name).name === i;) a += 1;
|
|
70
70
|
let o = e.slice(n, a);
|
|
71
71
|
o.length > 1 ? t.push({
|
|
72
72
|
key: r.stage.index,
|
|
@@ -97,102 +97,102 @@ var be = {
|
|
|
97
97
|
codeInline: "_codeInline_msss2_76",
|
|
98
98
|
blockquote: "_blockquote_msss2_82",
|
|
99
99
|
tableCell: "_tableCell_msss2_87"
|
|
100
|
-
},
|
|
101
|
-
size:
|
|
100
|
+
}, Re = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */ Y(xe, { children: [/* @__PURE__ */ J(T, {
|
|
101
|
+
size: p.MD,
|
|
102
102
|
className: X.iconError,
|
|
103
103
|
"aria-hidden": !0,
|
|
104
|
-
stroke:
|
|
104
|
+
stroke: m
|
|
105
105
|
}), /* @__PURE__ */ J("span", {
|
|
106
106
|
className: "sr-only",
|
|
107
107
|
children: r
|
|
108
108
|
})] }) : e === o.Completed ? /* @__PURE__ */ J(E, {
|
|
109
|
-
size:
|
|
109
|
+
size: p.SM,
|
|
110
110
|
className: X.iconCompleted,
|
|
111
111
|
"aria-hidden": !0,
|
|
112
|
-
stroke:
|
|
113
|
-
}) : t ? /* @__PURE__ */ J(
|
|
112
|
+
stroke: m
|
|
113
|
+
}) : t ? /* @__PURE__ */ J(te, {
|
|
114
114
|
size: 16,
|
|
115
115
|
ariaLabel: n
|
|
116
|
-
}) : null,
|
|
116
|
+
}) : null, ze = (e) => {
|
|
117
117
|
if (e == null) return "";
|
|
118
118
|
let t = e.lastIndexOf(".");
|
|
119
119
|
return t > 0 ? e.slice(0, t) : e;
|
|
120
|
-
},
|
|
120
|
+
}, Be = (e) => {
|
|
121
121
|
if (!e) return A;
|
|
122
122
|
let t = u(e);
|
|
123
123
|
if (t.startsWith("image/")) switch (t) {
|
|
124
|
-
case "image/jpeg": return
|
|
125
|
-
case "image/png": return
|
|
126
|
-
case "image/svg+xml": return
|
|
124
|
+
case "image/jpeg": return I;
|
|
125
|
+
case "image/png": return V;
|
|
126
|
+
case "image/svg+xml": return ae;
|
|
127
127
|
case "image/bmp": return j;
|
|
128
|
-
default: return
|
|
128
|
+
default: return de;
|
|
129
129
|
}
|
|
130
|
-
if (t.startsWith("video/")) return
|
|
131
|
-
if (t.startsWith("audio/")) return
|
|
130
|
+
if (t.startsWith("video/")) return me;
|
|
131
|
+
if (t.startsWith("audio/")) return G;
|
|
132
132
|
switch (t) {
|
|
133
|
-
case "application/pdf": return
|
|
133
|
+
case "application/pdf": return z;
|
|
134
134
|
case "application/msword": return P;
|
|
135
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return
|
|
136
|
-
case "application/vnd.ms-powerpoint": return
|
|
137
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return
|
|
138
|
-
case "application/vnd.ms-excel": return
|
|
139
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return
|
|
135
|
+
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return ne;
|
|
136
|
+
case "application/vnd.ms-powerpoint": return H;
|
|
137
|
+
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return H;
|
|
138
|
+
case "application/vnd.ms-excel": return ce;
|
|
139
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return ce;
|
|
140
140
|
case "application/zip":
|
|
141
141
|
case "application/vnd.rar":
|
|
142
142
|
case "application/x-7z-compressed":
|
|
143
143
|
case "application/gzip":
|
|
144
|
-
case "application/x-tar": return
|
|
144
|
+
case "application/x-tar": return ue;
|
|
145
145
|
case "text/csv": return N;
|
|
146
|
-
case "text/plain": return
|
|
146
|
+
case "text/plain": return U;
|
|
147
147
|
case "text/html":
|
|
148
|
-
case "application/xhtml+xml": return
|
|
149
|
-
case "application/xml": return
|
|
150
|
-
case "application/sql": return
|
|
151
|
-
case "text/javascript": return
|
|
152
|
-
case "text/jsx": return
|
|
153
|
-
case "text/typescript": return
|
|
154
|
-
case "text/tsx": return
|
|
148
|
+
case "application/xhtml+xml": return F;
|
|
149
|
+
case "application/xml": return le;
|
|
150
|
+
case "application/sql": return ie;
|
|
151
|
+
case "text/javascript": return L;
|
|
152
|
+
case "text/jsx": return R;
|
|
153
|
+
case "text/typescript": return oe;
|
|
154
|
+
case "text/tsx": return se;
|
|
155
155
|
case "text/css": return M;
|
|
156
|
-
case "text/x-php": return
|
|
157
|
-
case "text/x-rustsrc": return
|
|
158
|
-
case "text/x-vue": return
|
|
156
|
+
case "text/x-php": return B;
|
|
157
|
+
case "text/x-rustsrc": return re;
|
|
158
|
+
case "text/x-vue": return W;
|
|
159
159
|
default: return A;
|
|
160
160
|
}
|
|
161
|
-
},
|
|
161
|
+
}, Ve = (e) => {
|
|
162
162
|
let { type: n, contentType: r } = e;
|
|
163
|
-
return n === t.Prompt ?
|
|
164
|
-
},
|
|
163
|
+
return n === t.Prompt ? pe : n === t.Pasted ? D : n === t.Image ? de : Be(r ?? "");
|
|
164
|
+
}, He = (e) => {
|
|
165
165
|
let t = u(e), r = n[t];
|
|
166
166
|
if (r) return r;
|
|
167
167
|
let i = t.split("/")[1];
|
|
168
168
|
if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
|
|
169
|
-
},
|
|
169
|
+
}, Ue = (e) => {
|
|
170
170
|
let { name: t, contentType: n } = e;
|
|
171
171
|
if (n) {
|
|
172
|
-
let e =
|
|
172
|
+
let e = He(n);
|
|
173
173
|
if (e) return e;
|
|
174
174
|
}
|
|
175
175
|
if (t == null) return;
|
|
176
176
|
let r = t.lastIndexOf(".");
|
|
177
177
|
if (r > 0 && r < t.length - 1) return t.slice(r + 1).toLowerCase();
|
|
178
|
-
},
|
|
178
|
+
}, We = (e) => e.type !== t.Prompt && e.type !== t.Pasted, Ge = (e, n) => {
|
|
179
179
|
let { type: r, name: i } = e;
|
|
180
180
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
181
181
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
182
182
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
183
|
-
let a =
|
|
183
|
+
let a = Ue(e);
|
|
184
184
|
return a ? `.${a}` : i ?? "";
|
|
185
|
-
},
|
|
185
|
+
}, Ke = (e, n = {}) => {
|
|
186
186
|
let { type: r, status: i, previewUrl: o, url: s } = e, c = i === a.Loading, l = i === a.Error, u = r === t.Image && !!(o ?? s) && !l, d = r === t.Link && !l;
|
|
187
187
|
return {
|
|
188
188
|
isLoading: c,
|
|
189
189
|
isError: l,
|
|
190
190
|
isImage: u,
|
|
191
191
|
isLink: d,
|
|
192
|
-
BottomIcon: d ? null :
|
|
193
|
-
typeLabel: d ? null :
|
|
192
|
+
BottomIcon: d ? null : Ve(e),
|
|
193
|
+
typeLabel: d ? null : Ge(e, n)
|
|
194
194
|
};
|
|
195
|
-
},
|
|
195
|
+
}, qe = "flex size-[100px] items-center justify-center rounded-xl border", Je = "outline-offset-1 focus-visible:outline-1", Z = {
|
|
196
196
|
tray: "dial-ai-attachment-tray",
|
|
197
197
|
trayItem: "dial-ai-attachment-tray-item",
|
|
198
198
|
tile: "dial-ai-attachment-tile",
|
|
@@ -215,156 +215,162 @@ var be = {
|
|
|
215
215
|
imageActionButton: "_imageActionButton_hb2mo_87",
|
|
216
216
|
tileAction: "_tileAction_hb2mo_99",
|
|
217
217
|
proxyFocus: "_proxyFocus_hb2mo_108"
|
|
218
|
-
},
|
|
218
|
+
}, Ye = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o, isAlwaysVisible: s }) => /* @__PURE__ */ J(C, {
|
|
219
219
|
icon: a,
|
|
220
|
-
size:
|
|
220
|
+
size: g.Small,
|
|
221
221
|
className: c(s ? "opacity-100" : "opacity-0 group-hover/attachment-tile:opacity-100 group-focus-visible/attachment-tile:opacity-100 group-has-focus-visible/attachment-tile:opacity-100", Q.actionButton, o, Z.tileAction),
|
|
222
222
|
"aria-label": e,
|
|
223
223
|
"aria-describedby": t ? n : void 0,
|
|
224
224
|
onClick: (e) => {
|
|
225
225
|
e.stopPropagation(), r(i);
|
|
226
226
|
}
|
|
227
|
-
}),
|
|
228
|
-
icon: /* @__PURE__ */ J(
|
|
229
|
-
size:
|
|
227
|
+
}), Xe = ({ ...e }) => /* @__PURE__ */ J(Ye, {
|
|
228
|
+
icon: /* @__PURE__ */ J(fe, {
|
|
229
|
+
size: p.SM,
|
|
230
230
|
"aria-hidden": !0,
|
|
231
|
-
stroke:
|
|
231
|
+
stroke: m
|
|
232
232
|
}),
|
|
233
233
|
className: Q.retryIcon,
|
|
234
234
|
...e
|
|
235
|
-
}),
|
|
235
|
+
}), Ze = ({ ...e }) => /* @__PURE__ */ J(Ye, {
|
|
236
236
|
icon: /* @__PURE__ */ J(O, {
|
|
237
|
-
size:
|
|
237
|
+
size: p.SM,
|
|
238
238
|
"aria-hidden": !0,
|
|
239
|
-
stroke:
|
|
239
|
+
stroke: m
|
|
240
240
|
}),
|
|
241
241
|
...e
|
|
242
|
-
}),
|
|
242
|
+
}), Qe = ({ ...e }) => /* @__PURE__ */ J(Ye, {
|
|
243
243
|
icon: /* @__PURE__ */ J(k, {
|
|
244
|
-
size:
|
|
244
|
+
size: p.SM,
|
|
245
245
|
"aria-hidden": !0,
|
|
246
|
-
stroke:
|
|
246
|
+
stroke: m
|
|
247
247
|
}),
|
|
248
248
|
...e
|
|
249
|
-
}),
|
|
250
|
-
icon: /* @__PURE__ */ J(
|
|
251
|
-
size:
|
|
249
|
+
}), $e = ({ className: e, ...t }) => /* @__PURE__ */ J(Ye, {
|
|
250
|
+
icon: /* @__PURE__ */ J(he, {
|
|
251
|
+
size: p.SM,
|
|
252
252
|
"aria-hidden": !0,
|
|
253
|
-
stroke:
|
|
253
|
+
stroke: m
|
|
254
254
|
}),
|
|
255
255
|
className: c("mobile:opacity-100", e),
|
|
256
256
|
...t
|
|
257
|
-
}),
|
|
257
|
+
}), et = {
|
|
258
258
|
[e.Network]: "Upload failed · network error",
|
|
259
259
|
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
260
260
|
[e.FileTooLarge]: "Upload failed · file too large"
|
|
261
|
-
},
|
|
262
|
-
let { clickLabel:
|
|
263
|
-
|
|
264
|
-
},
|
|
261
|
+
}, tt = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l, isLink: u, cssVars: f, onExpand: g, isExpandable: ee, onRemove: x, isSelected: S }) => {
|
|
262
|
+
let { clickLabel: C = "Download attachment", expandLabel: T = "Expand pasted text", downloadLabel: E = "Download attachment", retryLabel: D = "Retry upload", removeLabel: O = "Remove attachment", openInNewTabLabel: k = "Open in new tab", sizeLabel: A, uploadingLabel: j = "Uploading", errorReasonLabels: M, genericErrorLabel: N = "Upload failed" } = o ?? {}, { typography: P, className: ne } = s ?? {}, { id: F, name: I, status: L, errorReason: R } = t, z = L === a.Loading, B = L === a.Error, V = ve(), H = B ? R && (M?.[R] ?? et[R]) || N : "", { BottomIcon: re, typeLabel: ie } = Ke(t), ae = We(t), oe = !B && !z && l && !u, se = B && !!i && R !== e.UnsupportedType && R !== e.FileTooLarge, U = !!ee && g !== void 0, W = U || r !== void 0, ce = Number(!!oe) + Number(!!se) + Number(!!u) + Number(!!x), le = !W && ce === 1, ue = () => {
|
|
263
|
+
U ? g(F) : r?.(F);
|
|
264
|
+
}, G = q(() => ze(I), [I]), { ref: de, isClamped: fe } = d(G), pe = K(() => {
|
|
265
265
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
266
|
-
}, [t]),
|
|
267
|
-
|
|
266
|
+
}, [t]), me = c(qe, "group/attachment-tile relative flex-col justify-between items-start gap-2 overflow-hidden p-3", Q.tile, W && !B && !z && Q.hovered, z && Q.loading, S && Q.selected, B && Q.tileError, le && Q.proxyFocus, Z.tile, S && Z.tileSelected), he = /* @__PURE__ */ J("div", {
|
|
267
|
+
ref: de,
|
|
268
|
+
title: G,
|
|
268
269
|
className: c(P?.nameClassName ?? "dial-tiny-text", "line-clamp-2 w-full min-w-0 wrap-break-word", Q.nameText, Z.tileName),
|
|
269
270
|
children: n ? /* @__PURE__ */ J(v, {
|
|
270
|
-
text:
|
|
271
|
+
text: G,
|
|
271
272
|
query: n,
|
|
272
273
|
maxLines: 2
|
|
273
|
-
}) :
|
|
274
|
-
}),
|
|
274
|
+
}) : G
|
|
275
|
+
}), ge = re && /* @__PURE__ */ Y("div", {
|
|
275
276
|
className: c("flex w-full items-end gap-1", Z.tileType),
|
|
276
|
-
children: [
|
|
277
|
-
type:
|
|
278
|
-
name:
|
|
279
|
-
fileExtension:
|
|
280
|
-
size:
|
|
277
|
+
children: [ae ? /* @__PURE__ */ J(_, {
|
|
278
|
+
type: h.File,
|
|
279
|
+
name: I ?? "",
|
|
280
|
+
fileExtension: Ue(t),
|
|
281
|
+
size: p.MD,
|
|
281
282
|
decorative: !0
|
|
282
|
-
}) : /* @__PURE__ */ J(
|
|
283
|
-
size:
|
|
283
|
+
}) : /* @__PURE__ */ J(re, {
|
|
284
|
+
size: p.MD,
|
|
284
285
|
className: Q.typeText,
|
|
285
|
-
stroke:
|
|
286
|
+
stroke: m,
|
|
286
287
|
"aria-hidden": !0
|
|
287
288
|
}), /* @__PURE__ */ J("span", {
|
|
288
289
|
className: c(P?.metaClassName ?? "dial-tiny-text", "min-w-0 flex-1 truncate", Q.typeText),
|
|
289
|
-
children: A ? `${
|
|
290
|
+
children: A ? `${ie} · ${A}` : ie
|
|
290
291
|
})]
|
|
291
|
-
}),
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
292
|
+
}), _e = /* @__PURE__ */ Y(xe, { children: [
|
|
293
|
+
he,
|
|
294
|
+
ge,
|
|
295
|
+
W && /* @__PURE__ */ J(w, {
|
|
296
|
+
tooltip: I,
|
|
297
|
+
hideTooltip: !fe,
|
|
298
|
+
triggerClassName: "absolute inset-0",
|
|
299
|
+
children: /* @__PURE__ */ J("button", {
|
|
300
|
+
type: "button",
|
|
301
|
+
"aria-label": U ? T : C,
|
|
302
|
+
"aria-pressed": !U && r !== void 0 ? S : void 0,
|
|
303
|
+
onClick: ue,
|
|
304
|
+
className: c("absolute inset-0 cursor-pointer rounded-[11px]", Q.tileAction)
|
|
305
|
+
})
|
|
300
306
|
}),
|
|
301
|
-
|
|
307
|
+
z && /* @__PURE__ */ J("div", {
|
|
302
308
|
role: "progressbar",
|
|
303
309
|
"aria-label": j,
|
|
304
310
|
className: c("absolute inset-0 flex items-center justify-center rounded-[11px]", Q.track),
|
|
305
311
|
children: /* @__PURE__ */ J("span", {
|
|
306
312
|
"aria-hidden": !0,
|
|
307
313
|
className: "flex",
|
|
308
|
-
children: /* @__PURE__ */ J(
|
|
314
|
+
children: /* @__PURE__ */ J(te, { size: 32 })
|
|
309
315
|
})
|
|
310
316
|
}),
|
|
311
317
|
/* @__PURE__ */ Y("div", {
|
|
312
318
|
className: "absolute inset-e-1 top-1 flex",
|
|
313
319
|
children: [
|
|
314
|
-
|
|
320
|
+
oe && /* @__PURE__ */ J(Ze, {
|
|
315
321
|
ariaLabel: E,
|
|
316
|
-
errorTitle:
|
|
317
|
-
errorDescId:
|
|
322
|
+
errorTitle: H,
|
|
323
|
+
errorDescId: V,
|
|
318
324
|
onClick: l,
|
|
319
|
-
id:
|
|
325
|
+
id: F
|
|
320
326
|
}),
|
|
321
|
-
|
|
327
|
+
se && /* @__PURE__ */ J(Xe, {
|
|
322
328
|
ariaLabel: D,
|
|
323
|
-
errorTitle:
|
|
324
|
-
errorDescId:
|
|
329
|
+
errorTitle: H,
|
|
330
|
+
errorDescId: V,
|
|
325
331
|
onClick: i,
|
|
326
|
-
id:
|
|
332
|
+
id: F
|
|
327
333
|
}),
|
|
328
|
-
u && /* @__PURE__ */ J(
|
|
334
|
+
u && /* @__PURE__ */ J(Qe, {
|
|
329
335
|
ariaLabel: k,
|
|
330
|
-
errorTitle:
|
|
331
|
-
errorDescId:
|
|
332
|
-
onClick:
|
|
336
|
+
errorTitle: H,
|
|
337
|
+
errorDescId: V,
|
|
338
|
+
onClick: pe
|
|
333
339
|
}),
|
|
334
|
-
x && /* @__PURE__ */ J(
|
|
340
|
+
x && /* @__PURE__ */ J($e, {
|
|
335
341
|
ariaLabel: O,
|
|
336
|
-
errorTitle:
|
|
337
|
-
errorDescId:
|
|
342
|
+
errorTitle: H,
|
|
343
|
+
errorDescId: V,
|
|
338
344
|
onClick: x,
|
|
339
|
-
id:
|
|
340
|
-
isAlwaysVisible:
|
|
345
|
+
id: F,
|
|
346
|
+
isAlwaysVisible: z
|
|
341
347
|
})
|
|
342
348
|
]
|
|
343
349
|
}),
|
|
344
350
|
/* @__PURE__ */ J(y, {
|
|
345
|
-
id:
|
|
351
|
+
id: V,
|
|
346
352
|
visuallyHidden: !0,
|
|
347
353
|
as: b.Span,
|
|
348
|
-
children:
|
|
354
|
+
children: B ? H : ""
|
|
349
355
|
})
|
|
350
356
|
] });
|
|
351
357
|
return /* @__PURE__ */ J("div", {
|
|
352
|
-
style:
|
|
353
|
-
className: c("inline-flex",
|
|
358
|
+
style: f,
|
|
359
|
+
className: c("inline-flex", ne),
|
|
354
360
|
children: /* @__PURE__ */ J("div", {
|
|
355
|
-
"aria-busy":
|
|
356
|
-
style:
|
|
357
|
-
className: c(
|
|
358
|
-
children:
|
|
361
|
+
"aria-busy": z,
|
|
362
|
+
style: f,
|
|
363
|
+
className: c(me, W && "cursor-pointer", Je),
|
|
364
|
+
children: _e
|
|
359
365
|
})
|
|
360
366
|
});
|
|
361
|
-
},
|
|
367
|
+
}, nt = /* @__PURE__ */ function(e) {
|
|
362
368
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
363
|
-
}({}),
|
|
364
|
-
let n =
|
|
365
|
-
return
|
|
369
|
+
}({}), rt = ({ enabled: e, src: t }) => {
|
|
370
|
+
let n = ye(null), [r, i] = be("idle");
|
|
371
|
+
return _e(() => {
|
|
366
372
|
i(e && t ? "loading" : "idle");
|
|
367
|
-
}, [e, t]),
|
|
373
|
+
}, [e, t]), _e(() => {
|
|
368
374
|
let r = n.current;
|
|
369
375
|
if (!r || !e || !t) return;
|
|
370
376
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -375,77 +381,77 @@ var be = {
|
|
|
375
381
|
imageRef: n,
|
|
376
382
|
imageLoadStatus: r
|
|
377
383
|
};
|
|
378
|
-
},
|
|
379
|
-
let { clickLabel: d = "Open attachment", expandLabel:
|
|
380
|
-
enabled:
|
|
381
|
-
src:
|
|
382
|
-
}),
|
|
383
|
-
|
|
384
|
-
},
|
|
384
|
+
}, it = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
|
|
385
|
+
let { clickLabel: d = "Open attachment", expandLabel: f = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment", uploadingLabel: ee = "Uploading" } = i ?? {}, { className: _ } = l ?? {}, { id: v, name: y } = e, b = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } = q(() => Ke(e), [e]), D = r !== void 0 && !C && !w && !T, O = C || D, k = !!s && !w, A = !O && Number(!!a) + Number(k) === 1, { imageRef: j, imageLoadStatus: M } = rt({
|
|
386
|
+
enabled: E,
|
|
387
|
+
src: b
|
|
388
|
+
}), N = () => {
|
|
389
|
+
C && n ? n(v) : D && r && r(v);
|
|
390
|
+
}, P = c(qe, "group/attachment-tile", O && "cursor-pointer", Q.tile, u && Q.selected, w && Q.loading, A && Q.proxyFocus, Je, _, Z.tile, u && Z.tileSelected);
|
|
385
391
|
return /* @__PURE__ */ J("div", {
|
|
386
|
-
className:
|
|
387
|
-
"aria-busy":
|
|
392
|
+
className: P,
|
|
393
|
+
"aria-busy": w,
|
|
388
394
|
style: o,
|
|
389
395
|
children: /* @__PURE__ */ Y("div", {
|
|
390
396
|
className: "relative h-full w-full overflow-hidden",
|
|
391
397
|
children: [
|
|
392
398
|
/* @__PURE__ */ Y("div", {
|
|
393
399
|
className: "absolute inset-e-1 top-1 z-10 flex",
|
|
394
|
-
children: [a && /* @__PURE__ */ J(
|
|
400
|
+
children: [a && /* @__PURE__ */ J($e, {
|
|
395
401
|
ariaLabel: h,
|
|
396
402
|
onClick: a,
|
|
397
|
-
id:
|
|
403
|
+
id: v,
|
|
398
404
|
className: Q.imageActionButton,
|
|
399
|
-
isAlwaysVisible:
|
|
400
|
-
}),
|
|
405
|
+
isAlwaysVisible: w
|
|
406
|
+
}), k && /* @__PURE__ */ J(Ze, {
|
|
401
407
|
ariaLabel: g,
|
|
402
408
|
onClick: s,
|
|
403
|
-
id:
|
|
409
|
+
id: v,
|
|
404
410
|
className: Q.imageActionButton
|
|
405
411
|
})]
|
|
406
412
|
}),
|
|
407
|
-
|
|
413
|
+
M !== nt.Loaded && /* @__PURE__ */ J(x, {
|
|
408
414
|
variant: S.Rectangular,
|
|
409
415
|
width: "100%",
|
|
410
416
|
height: "100%",
|
|
411
|
-
active:
|
|
412
|
-
overlay: /* @__PURE__ */ J(
|
|
413
|
-
size:
|
|
417
|
+
active: M === nt.Loading,
|
|
418
|
+
overlay: /* @__PURE__ */ J(de, {
|
|
419
|
+
size: p.LG,
|
|
414
420
|
className: Q.placeholderIcon,
|
|
415
421
|
"aria-hidden": !0,
|
|
416
|
-
stroke:
|
|
422
|
+
stroke: m
|
|
417
423
|
}),
|
|
418
424
|
className: "absolute inset-0 rounded-xl"
|
|
419
425
|
}),
|
|
420
426
|
/* @__PURE__ */ J("img", {
|
|
421
|
-
ref:
|
|
422
|
-
src:
|
|
423
|
-
alt:
|
|
427
|
+
ref: j,
|
|
428
|
+
src: b,
|
|
429
|
+
alt: y,
|
|
424
430
|
loading: "lazy",
|
|
425
431
|
decoding: "async",
|
|
426
|
-
className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200",
|
|
432
|
+
className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", M === nt.Loaded ? "opacity-100" : "opacity-0")
|
|
427
433
|
}),
|
|
428
|
-
|
|
434
|
+
O && /* @__PURE__ */ J("button", {
|
|
429
435
|
type: "button",
|
|
430
|
-
"aria-label":
|
|
431
|
-
"aria-pressed":
|
|
432
|
-
onClick:
|
|
436
|
+
"aria-label": C ? f : d,
|
|
437
|
+
"aria-pressed": D ? u : void 0,
|
|
438
|
+
onClick: N,
|
|
433
439
|
className: c("absolute inset-0 cursor-pointer rounded-xl", Q.tileAction)
|
|
434
440
|
}),
|
|
435
|
-
|
|
441
|
+
w && /* @__PURE__ */ J("div", {
|
|
436
442
|
role: "progressbar",
|
|
437
|
-
"aria-label":
|
|
443
|
+
"aria-label": ee,
|
|
438
444
|
className: c("absolute inset-0 flex items-center justify-center rounded-xl", Q.track),
|
|
439
445
|
children: /* @__PURE__ */ J("span", {
|
|
440
446
|
"aria-hidden": !0,
|
|
441
447
|
className: "flex",
|
|
442
|
-
children: /* @__PURE__ */ J(
|
|
448
|
+
children: /* @__PURE__ */ J(te, { size: 32 })
|
|
443
449
|
})
|
|
444
450
|
})
|
|
445
451
|
]
|
|
446
452
|
})
|
|
447
453
|
});
|
|
448
|
-
},
|
|
454
|
+
}, at = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
|
|
449
455
|
let { colors: f } = u ?? {}, p = e.type === t.Pasted && a !== void 0, m = s({
|
|
450
456
|
"--ai-tile-bg": f?.background,
|
|
451
457
|
"--ai-tile-border": f?.border,
|
|
@@ -463,8 +469,8 @@ var be = {
|
|
|
463
469
|
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
464
470
|
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
465
471
|
"--ai-tile-progress-track": f?.trackBackground
|
|
466
|
-
}), { isImage: h, isLink: g } = q(() =>
|
|
467
|
-
return h ? /* @__PURE__ */ J(
|
|
472
|
+
}), { isImage: h, isLink: g } = q(() => Ke(e), [e]);
|
|
473
|
+
return h ? /* @__PURE__ */ J(it, {
|
|
468
474
|
attachment: e,
|
|
469
475
|
labels: l,
|
|
470
476
|
onClick: o,
|
|
@@ -474,7 +480,7 @@ var be = {
|
|
|
474
480
|
cssVars: m,
|
|
475
481
|
onDownload: c,
|
|
476
482
|
isSelected: d
|
|
477
|
-
}) : /* @__PURE__ */ J(
|
|
483
|
+
}) : /* @__PURE__ */ J(tt, {
|
|
478
484
|
attachment: e,
|
|
479
485
|
searchQuery: n,
|
|
480
486
|
onClick: o,
|
|
@@ -489,7 +495,7 @@ var be = {
|
|
|
489
495
|
isExpandable: p,
|
|
490
496
|
isSelected: d
|
|
491
497
|
});
|
|
492
|
-
},
|
|
498
|
+
}, ot = (e, t) => {
|
|
493
499
|
let n = l(e, t);
|
|
494
500
|
if (!e?.length) return n;
|
|
495
501
|
let r = /* @__PURE__ */ new Map();
|
|
@@ -504,7 +510,7 @@ var be = {
|
|
|
504
510
|
contentType: t
|
|
505
511
|
} : e;
|
|
506
512
|
});
|
|
507
|
-
},
|
|
513
|
+
}, st = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i, copiedLabel: a }) => {
|
|
508
514
|
let o = t?.replace(/^language-/, "") ?? "";
|
|
509
515
|
return /* @__PURE__ */ J(r, {
|
|
510
516
|
language: o,
|
|
@@ -515,9 +521,9 @@ var be = {
|
|
|
515
521
|
copiedLabel: a,
|
|
516
522
|
hideDownload: !0
|
|
517
523
|
});
|
|
518
|
-
},
|
|
524
|
+
}, ct = ge(({ content: e, typography: t, copyAriaLabel: n = "Copy", copiedLabel: r, tableScrollRegionAriaLabel: a, mathScrollRegionAriaLabel: o, renderCitation: s }) => {
|
|
519
525
|
let l = "mb-1.5 last:mb-0", u = c(t?.headingClassName ?? "dial-small-semi-text", X.stageContent, l), d = q(() => ({
|
|
520
|
-
code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ J(
|
|
526
|
+
code: ({ children: e, className: i }) => i?.includes("language-") ? /* @__PURE__ */ J(st, {
|
|
521
527
|
codeClassName: i,
|
|
522
528
|
blockClassName: t?.codeBlockClassName,
|
|
523
529
|
copyAriaLabel: n,
|
|
@@ -557,7 +563,7 @@ var be = {
|
|
|
557
563
|
},
|
|
558
564
|
components: d
|
|
559
565
|
});
|
|
560
|
-
}),
|
|
566
|
+
}), lt = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
|
|
561
567
|
let r = K((t) => {
|
|
562
568
|
let r = e.find((e) => e.id === t);
|
|
563
569
|
r && n?.(r);
|
|
@@ -567,75 +573,75 @@ var be = {
|
|
|
567
573
|
className: "flex flex-wrap gap-2",
|
|
568
574
|
children: e.map((e) => /* @__PURE__ */ J("div", {
|
|
569
575
|
role: "listitem",
|
|
570
|
-
children: /* @__PURE__ */ J(
|
|
576
|
+
children: /* @__PURE__ */ J(at, {
|
|
571
577
|
attachment: e,
|
|
572
578
|
onClick: n && r,
|
|
573
579
|
labels: { clickLabel: t }
|
|
574
580
|
})
|
|
575
581
|
}, e.id))
|
|
576
582
|
});
|
|
577
|
-
},
|
|
578
|
-
let [m, h] =
|
|
579
|
-
|
|
580
|
-
}, [
|
|
583
|
+
}, ut = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a, attachmentDisplayResolvers: s, renderCitation: l, childList: u, isExpanded: d, onToggle: p }) => {
|
|
584
|
+
let [m, h] = be(!1), g = d ?? m, _ = K((e) => {
|
|
585
|
+
d === void 0 && h(e), p?.(e);
|
|
586
|
+
}, [d, p]), { copyAriaLabel: v = "Copy stage content", codeBlockCopiedLabel: y, tableScrollRegionAriaLabel: b, mathScrollRegionAriaLabel: x, runningAriaLabel: S, failedAriaLabel: te, attachmentClickLabel: C = "Preview search result" } = r ?? {}, w = q(() => ot(e.attachments, s), [e.attachments, s]), { name: T, durationLabel: E } = Oe(e.name), D = i ?? T, O = !i && ke(T), k = e.status === o.Failed, A = !!e.content || !!e.attachments?.length, j = A || u != null, M = /* @__PURE__ */ Y(xe, { children: [
|
|
581
587
|
/* @__PURE__ */ J("span", {
|
|
582
588
|
className: "flex flex-none items-center",
|
|
583
|
-
children: /* @__PURE__ */ J(
|
|
589
|
+
children: /* @__PURE__ */ J(Re, {
|
|
584
590
|
status: e.status,
|
|
585
591
|
isLive: t,
|
|
586
|
-
runningLabel:
|
|
587
|
-
failedLabel:
|
|
592
|
+
runningLabel: S,
|
|
593
|
+
failedLabel: te
|
|
588
594
|
})
|
|
589
595
|
}),
|
|
590
596
|
/* @__PURE__ */ J("span", {
|
|
591
|
-
className: c("max-w-88 min-w-0 truncate",
|
|
592
|
-
children: /* @__PURE__ */ J(
|
|
597
|
+
className: c("max-w-88 min-w-0 truncate", O ? n?.monoFontClassName ?? "dial-code-text" : n?.fontClassName ?? "dial-small-text", X.stageName, k && X.stageNameFailed),
|
|
598
|
+
children: /* @__PURE__ */ J(ee, { text: D || e.status || "" })
|
|
593
599
|
}),
|
|
594
600
|
e.tag && /* @__PURE__ */ J("span", {
|
|
595
601
|
className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", X.tag),
|
|
596
602
|
children: e.tag
|
|
597
603
|
}),
|
|
598
|
-
|
|
604
|
+
E && /* @__PURE__ */ J("span", {
|
|
599
605
|
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", X.duration),
|
|
600
|
-
children:
|
|
606
|
+
children: E
|
|
601
607
|
})
|
|
602
608
|
] });
|
|
603
|
-
return
|
|
604
|
-
expanded:
|
|
605
|
-
onToggle:
|
|
609
|
+
return j ? /* @__PURE__ */ Y(f, {
|
|
610
|
+
expanded: g,
|
|
611
|
+
onToggle: _,
|
|
606
612
|
title: /* @__PURE__ */ J("span", {
|
|
607
613
|
className: "flex min-w-0 items-center gap-2",
|
|
608
|
-
children:
|
|
614
|
+
children: M
|
|
609
615
|
}),
|
|
610
|
-
className:
|
|
611
|
-
headerClassName: c(
|
|
616
|
+
className: Fe,
|
|
617
|
+
headerClassName: c(Ie, X.row, X.stageHeader),
|
|
612
618
|
contentClassName: c("-mt-1 flex min-w-0 flex-col gap-3 px-0 py-1", X.stageRegion),
|
|
613
|
-
children: [
|
|
619
|
+
children: [g && A && /* @__PURE__ */ Y("div", {
|
|
614
620
|
className: "flex min-w-0 flex-col gap-3 ps-8",
|
|
615
621
|
children: [e.content && /* @__PURE__ */ J("div", {
|
|
616
622
|
className: "max-h-[300px] min-w-0 overflow-y-auto",
|
|
617
|
-
children: /* @__PURE__ */ J(
|
|
623
|
+
children: /* @__PURE__ */ J(ct, {
|
|
618
624
|
content: e.content,
|
|
619
625
|
typography: n,
|
|
620
|
-
copyAriaLabel:
|
|
621
|
-
copiedLabel:
|
|
622
|
-
tableScrollRegionAriaLabel:
|
|
623
|
-
mathScrollRegionAriaLabel:
|
|
626
|
+
copyAriaLabel: v,
|
|
627
|
+
copiedLabel: y,
|
|
628
|
+
tableScrollRegionAriaLabel: b,
|
|
629
|
+
mathScrollRegionAriaLabel: x,
|
|
624
630
|
renderCitation: l
|
|
625
631
|
})
|
|
626
|
-
}),
|
|
627
|
-
attachments:
|
|
628
|
-
clickLabel:
|
|
632
|
+
}), w.length > 0 && /* @__PURE__ */ J(lt, {
|
|
633
|
+
attachments: w,
|
|
634
|
+
clickLabel: C,
|
|
629
635
|
onAttachmentClick: a
|
|
630
636
|
})]
|
|
631
|
-
}),
|
|
637
|
+
}), g && u]
|
|
632
638
|
}) : /* @__PURE__ */ J("div", {
|
|
633
639
|
className: c("flex w-full items-center gap-2 px-2 py-1.5", X.row),
|
|
634
|
-
children:
|
|
640
|
+
children: M
|
|
635
641
|
});
|
|
636
|
-
},
|
|
637
|
-
let u =
|
|
638
|
-
return /* @__PURE__ */ J(
|
|
642
|
+
}, dt = (e) => e <= 3 ? "ps-4" : "ps-0", ft = (e) => e <= 3 ? "ps-6" : "ps-0", pt = ({ node: e, depth: t, nameOverride: n, isStreaming: r, expansion: i, typography: a, labels: o, onAttachmentClick: s, attachmentDisplayResolvers: c, renderCitation: l }) => {
|
|
643
|
+
let u = Ne(e.stage.index), d = t + 1;
|
|
644
|
+
return /* @__PURE__ */ J(ut, {
|
|
639
645
|
stage: e.stage,
|
|
640
646
|
nameOverride: n,
|
|
641
647
|
isLive: r && e.stage.status == null,
|
|
@@ -646,10 +652,10 @@ var be = {
|
|
|
646
652
|
renderCitation: l,
|
|
647
653
|
isExpanded: i.isExpanded(u),
|
|
648
654
|
onToggle: (e) => i.onToggle(u, e),
|
|
649
|
-
childList: e.children.length > 0 ? /* @__PURE__ */ J(
|
|
655
|
+
childList: e.children.length > 0 ? /* @__PURE__ */ J(ht, {
|
|
650
656
|
nodes: e.children,
|
|
651
657
|
depth: d,
|
|
652
|
-
className:
|
|
658
|
+
className: dt(d),
|
|
653
659
|
isStreaming: r,
|
|
654
660
|
expansion: i,
|
|
655
661
|
typography: a,
|
|
@@ -659,24 +665,24 @@ var be = {
|
|
|
659
665
|
renderCitation: l
|
|
660
666
|
}) : void 0
|
|
661
667
|
});
|
|
662
|
-
},
|
|
663
|
-
let { runningAriaLabel:
|
|
664
|
-
|
|
665
|
-
let
|
|
668
|
+
}, mt = ({ row: e, depth: t, isStreaming: n, expansion: r, typography: i, labels: a, onAttachmentClick: s, attachmentDisplayResolvers: l, renderCitation: u }) => {
|
|
669
|
+
let { runningAriaLabel: d, failedAriaLabel: p, attemptLabel: m = (e) => `Attempt ${e}` } = a ?? {}, h = e.attempts ?? [], g = h.some((e) => e.stage.status == null), _ = h.some((e) => e.stage.status === o.Failed), v = o.Completed;
|
|
670
|
+
g ? v = null : _ && (v = o.Failed);
|
|
671
|
+
let y = Pe(e.key), b = r.isExpanded(y), x = t + 1, S = /* @__PURE__ */ Y("span", {
|
|
666
672
|
className: "flex min-w-0 items-center gap-2",
|
|
667
673
|
children: [
|
|
668
674
|
/* @__PURE__ */ J("span", {
|
|
669
675
|
className: "flex flex-none items-center",
|
|
670
|
-
children: /* @__PURE__ */ J(
|
|
671
|
-
status:
|
|
672
|
-
isLive: n &&
|
|
673
|
-
runningLabel:
|
|
676
|
+
children: /* @__PURE__ */ J(Re, {
|
|
677
|
+
status: v,
|
|
678
|
+
isLive: n && g,
|
|
679
|
+
runningLabel: d,
|
|
674
680
|
failedLabel: p
|
|
675
681
|
})
|
|
676
682
|
}),
|
|
677
683
|
/* @__PURE__ */ J("span", {
|
|
678
|
-
className: c("max-w-88 min-w-0 truncate", i?.fontClassName ?? "dial-small-text", X.stageName,
|
|
679
|
-
children: /* @__PURE__ */ J(
|
|
684
|
+
className: c("max-w-88 min-w-0 truncate", i?.fontClassName ?? "dial-small-text", X.stageName, _ && X.stageNameFailed),
|
|
685
|
+
children: /* @__PURE__ */ J(ee, { text: e.name })
|
|
680
686
|
}),
|
|
681
687
|
/* @__PURE__ */ Y("span", {
|
|
682
688
|
className: c("flex-none", i?.countFontClassName ?? "dial-tiny-text", X.count),
|
|
@@ -684,22 +690,22 @@ var be = {
|
|
|
684
690
|
})
|
|
685
691
|
]
|
|
686
692
|
});
|
|
687
|
-
return /* @__PURE__ */ J(
|
|
688
|
-
title:
|
|
689
|
-
expanded:
|
|
690
|
-
onToggle: (e) => r.onToggle(
|
|
691
|
-
className:
|
|
692
|
-
headerClassName: c(
|
|
693
|
-
contentClassName: c("-mt-2 min-w-0 px-0",
|
|
693
|
+
return /* @__PURE__ */ J(f, {
|
|
694
|
+
title: S,
|
|
695
|
+
expanded: b,
|
|
696
|
+
onToggle: (e) => r.onToggle(y, e),
|
|
697
|
+
className: Fe,
|
|
698
|
+
headerClassName: c(Ie, X.collapseButton, X.row, X.stageHeader),
|
|
699
|
+
contentClassName: c("-mt-2 min-w-0 px-0", ft(x), X.stageRegion),
|
|
694
700
|
children: /* @__PURE__ */ J("ul", {
|
|
695
701
|
role: "list",
|
|
696
702
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
697
|
-
children:
|
|
703
|
+
children: b && h.map((e, t) => /* @__PURE__ */ J("li", {
|
|
698
704
|
role: "listitem",
|
|
699
705
|
className: "min-w-0",
|
|
700
|
-
children: /* @__PURE__ */ J(
|
|
706
|
+
children: /* @__PURE__ */ J(pt, {
|
|
701
707
|
node: e,
|
|
702
|
-
depth:
|
|
708
|
+
depth: x,
|
|
703
709
|
nameOverride: m(t + 1),
|
|
704
710
|
isStreaming: n,
|
|
705
711
|
expansion: r,
|
|
@@ -712,23 +718,23 @@ var be = {
|
|
|
712
718
|
}, e.stage.index))
|
|
713
719
|
})
|
|
714
720
|
});
|
|
715
|
-
},
|
|
721
|
+
}, ht = ({ nodes: e, depth: t, className: n, ...r }) => /* @__PURE__ */ J("ul", {
|
|
716
722
|
role: "list",
|
|
717
723
|
className: c("flex min-w-0 flex-col gap-0.5", n),
|
|
718
|
-
children:
|
|
724
|
+
children: Le(e).map((e) => /* @__PURE__ */ J("li", {
|
|
719
725
|
role: "listitem",
|
|
720
726
|
className: "min-w-0",
|
|
721
|
-
children: e.node ? /* @__PURE__ */ J(
|
|
727
|
+
children: e.node ? /* @__PURE__ */ J(pt, {
|
|
722
728
|
node: e.node,
|
|
723
729
|
depth: t,
|
|
724
730
|
...r
|
|
725
|
-
}) : /* @__PURE__ */ J(
|
|
731
|
+
}) : /* @__PURE__ */ J(mt, {
|
|
726
732
|
row: e,
|
|
727
733
|
depth: t,
|
|
728
734
|
...r
|
|
729
735
|
})
|
|
730
736
|
}, e.key))
|
|
731
|
-
}),
|
|
737
|
+
}), gt = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a, attachmentDisplayResolvers: o, renderCitation: l, expansion: u }) => {
|
|
732
738
|
let { colors: d, typography: f } = r ?? {}, p = s({
|
|
733
739
|
"--cs-text": d?.text,
|
|
734
740
|
"--cs-row-hover": d?.rowHoverColor,
|
|
@@ -745,11 +751,11 @@ var be = {
|
|
|
745
751
|
"--cs-code-border": d?.codeBorderColor,
|
|
746
752
|
"--cs-code-text": d?.codeTextColor,
|
|
747
753
|
"--cs-border": d?.borderColor
|
|
748
|
-
}), m = q(() =>
|
|
754
|
+
}), m = q(() => Me(e), [e]);
|
|
749
755
|
return /* @__PURE__ */ J("div", {
|
|
750
756
|
style: p,
|
|
751
|
-
className: c("w-full min-w-0", X.panel, n,
|
|
752
|
-
children: /* @__PURE__ */ J(
|
|
757
|
+
className: c("w-full min-w-0", X.panel, n, Se.panel),
|
|
758
|
+
children: /* @__PURE__ */ J(ht, {
|
|
753
759
|
nodes: m,
|
|
754
760
|
depth: 0,
|
|
755
761
|
className: "w-full ps-5",
|
|
@@ -762,9 +768,9 @@ var be = {
|
|
|
762
768
|
renderCitation: l
|
|
763
769
|
})
|
|
764
770
|
});
|
|
765
|
-
},
|
|
766
|
-
let t =
|
|
767
|
-
return /* @__PURE__ */ J(
|
|
771
|
+
}, _t = (e) => {
|
|
772
|
+
let t = Ce();
|
|
773
|
+
return /* @__PURE__ */ J(gt, {
|
|
768
774
|
...e,
|
|
769
775
|
expansion: t
|
|
770
776
|
});
|
|
@@ -775,112 +781,112 @@ var be = {
|
|
|
775
781
|
doneIcon: "_doneIcon_16fae_36",
|
|
776
782
|
failedText: "_failedText_16fae_40",
|
|
777
783
|
liveName: "_liveName_16fae_44"
|
|
778
|
-
},
|
|
779
|
-
let { executedLabel:
|
|
780
|
-
|
|
781
|
-
|
|
784
|
+
}, vt = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a, attachmentDisplayResolvers: l, renderCitation: u }) => {
|
|
785
|
+
let { executedLabel: d = "Executed", stepsLabel: h = () => "steps", failedCountLabel: g = (e) => `${e} failed`, runningAriaLabel: _ = "Running", copyAriaLabel: v, codeBlockCopiedLabel: y, tableScrollRegionAriaLabel: b, mathScrollRegionAriaLabel: x, failedAriaLabel: S, attemptLabel: C, attachmentClickLabel: w } = n ?? {}, [T, D] = be(t), O = Ce(), { reset: k } = O, A = e.length > 1;
|
|
786
|
+
_e(() => {
|
|
787
|
+
A && !T && k();
|
|
782
788
|
}, [
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
789
|
+
A,
|
|
790
|
+
T,
|
|
791
|
+
k
|
|
786
792
|
]);
|
|
787
|
-
let
|
|
788
|
-
|
|
789
|
-
|
|
793
|
+
let j = ye(t);
|
|
794
|
+
_e(() => {
|
|
795
|
+
j.current && !t && D(!1), j.current = t;
|
|
790
796
|
}, [t]);
|
|
791
|
-
let { colors:
|
|
792
|
-
"--cs-cg-label":
|
|
793
|
-
"--cs-cg-label-hover":
|
|
794
|
-
"--cs-cg-done":
|
|
795
|
-
"--cs-cg-failed":
|
|
796
|
-
"--cs-text":
|
|
797
|
-
"--cs-row-hover":
|
|
798
|
-
"--cs-button-bg":
|
|
799
|
-
"--cs-stage-text":
|
|
800
|
-
"--cs-failed-text":
|
|
801
|
-
"--cs-tag-text":
|
|
802
|
-
"--cs-count-text":
|
|
803
|
-
"--cs-duration-text":
|
|
804
|
-
"--cs-icon-secondary":
|
|
805
|
-
"--cs-icon-completed":
|
|
806
|
-
"--cs-icon-error":
|
|
807
|
-
"--cs-code-bg":
|
|
808
|
-
"--cs-code-border":
|
|
809
|
-
"--cs-code-text":
|
|
810
|
-
"--cs-border":
|
|
797
|
+
let { colors: M, panel: N } = i ?? {}, P = i?.typography ?? { fontClassName: "dial-small-text" }, ne = s({
|
|
798
|
+
"--cs-cg-label": M?.labelColor,
|
|
799
|
+
"--cs-cg-label-hover": M?.labelHoverColor,
|
|
800
|
+
"--cs-cg-done": M?.doneColor,
|
|
801
|
+
"--cs-cg-failed": M?.failedColor,
|
|
802
|
+
"--cs-text": N?.text,
|
|
803
|
+
"--cs-row-hover": N?.rowHoverColor,
|
|
804
|
+
"--cs-button-bg": N?.collapsedButtonBg,
|
|
805
|
+
"--cs-stage-text": N?.stageTextColor,
|
|
806
|
+
"--cs-failed-text": N?.failedColor,
|
|
807
|
+
"--cs-tag-text": N?.tagTextColor,
|
|
808
|
+
"--cs-count-text": N?.countTextColor,
|
|
809
|
+
"--cs-duration-text": N?.durationTextColor,
|
|
810
|
+
"--cs-icon-secondary": N?.iconSecondaryColor,
|
|
811
|
+
"--cs-icon-completed": N?.iconCompletedColor,
|
|
812
|
+
"--cs-icon-error": N?.iconErrorColor,
|
|
813
|
+
"--cs-code-bg": N?.codeBg,
|
|
814
|
+
"--cs-code-border": N?.codeBorderColor,
|
|
815
|
+
"--cs-code-text": N?.codeTextColor,
|
|
816
|
+
"--cs-border": N?.borderColor
|
|
811
817
|
});
|
|
812
818
|
if (e.length === 0) return null;
|
|
813
|
-
let
|
|
814
|
-
copyAriaLabel:
|
|
815
|
-
codeBlockCopiedLabel:
|
|
816
|
-
tableScrollRegionAriaLabel:
|
|
817
|
-
mathScrollRegionAriaLabel:
|
|
818
|
-
runningAriaLabel:
|
|
819
|
-
failedAriaLabel:
|
|
820
|
-
attemptLabel:
|
|
821
|
-
attachmentClickLabel:
|
|
819
|
+
let F = {
|
|
820
|
+
copyAriaLabel: v,
|
|
821
|
+
codeBlockCopiedLabel: y,
|
|
822
|
+
tableScrollRegionAriaLabel: b,
|
|
823
|
+
mathScrollRegionAriaLabel: x,
|
|
824
|
+
runningAriaLabel: _,
|
|
825
|
+
failedAriaLabel: S,
|
|
826
|
+
attemptLabel: C,
|
|
827
|
+
attachmentClickLabel: w
|
|
822
828
|
};
|
|
823
|
-
if (e.length === 1) return /* @__PURE__ */ J(
|
|
829
|
+
if (e.length === 1) return /* @__PURE__ */ J(gt, {
|
|
824
830
|
stages: e,
|
|
825
831
|
isStreaming: t,
|
|
826
|
-
expansion:
|
|
832
|
+
expansion: O,
|
|
827
833
|
className: r,
|
|
828
834
|
styles: {
|
|
829
|
-
colors:
|
|
835
|
+
colors: N,
|
|
830
836
|
typography: i?.typography
|
|
831
837
|
},
|
|
832
|
-
labels:
|
|
838
|
+
labels: F,
|
|
833
839
|
onAttachmentClick: a,
|
|
834
840
|
attachmentDisplayResolvers: l,
|
|
835
841
|
renderCitation: u
|
|
836
842
|
});
|
|
837
|
-
let
|
|
843
|
+
let I = e.some((e) => e.status === o.Failed), L;
|
|
838
844
|
if (t) {
|
|
839
|
-
let t =
|
|
840
|
-
|
|
845
|
+
let t = Oe((Ae(e) ?? e[e.length - 1]).name).name;
|
|
846
|
+
L = /* @__PURE__ */ Y("span", {
|
|
841
847
|
role: "status",
|
|
842
848
|
"aria-live": "polite",
|
|
843
849
|
className: "flex min-w-0 items-center gap-2",
|
|
844
850
|
children: [/* @__PURE__ */ J("span", {
|
|
845
851
|
className: "flex flex-none items-center",
|
|
846
|
-
children: /* @__PURE__ */ J(
|
|
852
|
+
children: /* @__PURE__ */ J(te, {
|
|
847
853
|
size: 14,
|
|
848
|
-
ariaLabel:
|
|
854
|
+
ariaLabel: _
|
|
849
855
|
})
|
|
850
856
|
}), t && /* @__PURE__ */ J("span", {
|
|
851
|
-
className: c("max-w-88 min-w-0 truncate",
|
|
852
|
-
children: /* @__PURE__ */ J(
|
|
857
|
+
className: c("max-w-88 min-w-0 truncate", P.fontClassName, $.liveName),
|
|
858
|
+
children: /* @__PURE__ */ J(ee, { text: t })
|
|
853
859
|
})]
|
|
854
860
|
});
|
|
855
|
-
} else if (
|
|
861
|
+
} else if (I) {
|
|
856
862
|
let t = e.filter((e) => e.status === o.Failed).length;
|
|
857
|
-
|
|
863
|
+
L = /* @__PURE__ */ Y("span", {
|
|
858
864
|
className: "inline-flex items-center gap-1",
|
|
859
865
|
children: [/* @__PURE__ */ Y("span", {
|
|
860
|
-
className: c(
|
|
866
|
+
className: c(P.fontClassName, $.executedLabel),
|
|
861
867
|
children: [
|
|
862
|
-
|
|
868
|
+
d,
|
|
863
869
|
" ",
|
|
864
870
|
e.length,
|
|
865
871
|
" ",
|
|
866
872
|
h(e.length)
|
|
867
873
|
]
|
|
868
874
|
}), /* @__PURE__ */ J("span", {
|
|
869
|
-
className: c(
|
|
870
|
-
children:
|
|
875
|
+
className: c(P.fontClassName, $.failedText),
|
|
876
|
+
children: g(t)
|
|
871
877
|
})]
|
|
872
878
|
});
|
|
873
|
-
} else
|
|
879
|
+
} else L = /* @__PURE__ */ Y("span", {
|
|
874
880
|
className: "inline-flex items-center gap-1",
|
|
875
881
|
children: [/* @__PURE__ */ J(E, {
|
|
876
|
-
size:
|
|
882
|
+
size: p.SM,
|
|
877
883
|
className: $.doneIcon,
|
|
878
884
|
"aria-hidden": !0,
|
|
879
|
-
stroke:
|
|
885
|
+
stroke: m
|
|
880
886
|
}), /* @__PURE__ */ Y("span", {
|
|
881
|
-
className: c(
|
|
887
|
+
className: c(P.fontClassName, $.executedLabel),
|
|
882
888
|
children: [
|
|
883
|
-
|
|
889
|
+
d,
|
|
884
890
|
" ",
|
|
885
891
|
e.length,
|
|
886
892
|
" ",
|
|
@@ -889,24 +895,24 @@ var be = {
|
|
|
889
895
|
})]
|
|
890
896
|
});
|
|
891
897
|
return /* @__PURE__ */ J("div", {
|
|
892
|
-
style:
|
|
893
|
-
className: c("flex w-full flex-col gap-1", r,
|
|
894
|
-
children: /* @__PURE__ */ J(
|
|
895
|
-
title:
|
|
896
|
-
expanded:
|
|
897
|
-
onToggle:
|
|
898
|
+
style: ne,
|
|
899
|
+
className: c("flex w-full flex-col gap-1", r, Se.group),
|
|
900
|
+
children: /* @__PURE__ */ J(f, {
|
|
901
|
+
title: L,
|
|
902
|
+
expanded: T,
|
|
903
|
+
onToggle: D,
|
|
898
904
|
className: "overflow-visible py-0",
|
|
899
|
-
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton,
|
|
905
|
+
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, Se.groupToggle),
|
|
900
906
|
contentClassName: c("-mt-2 px-0", $.groupRegion),
|
|
901
|
-
children:
|
|
907
|
+
children: T && /* @__PURE__ */ J(gt, {
|
|
902
908
|
stages: e,
|
|
903
909
|
isStreaming: t,
|
|
904
|
-
expansion:
|
|
910
|
+
expansion: O,
|
|
905
911
|
styles: {
|
|
906
|
-
colors:
|
|
912
|
+
colors: N,
|
|
907
913
|
typography: i?.typography
|
|
908
914
|
},
|
|
909
|
-
labels:
|
|
915
|
+
labels: F,
|
|
910
916
|
className: "pt-1",
|
|
911
917
|
onAttachmentClick: a,
|
|
912
918
|
attachmentDisplayResolvers: l,
|
|
@@ -916,4 +922,4 @@ var be = {
|
|
|
916
922
|
});
|
|
917
923
|
};
|
|
918
924
|
//#endregion
|
|
919
|
-
export {
|
|
925
|
+
export { Se as CONVERSATION_STAGES_CLASS, vt as CollapsedGroup, _t as StagesPanel };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-conversation-stages",
|
|
3
3
|
"description": "Panel for displaying agent processing stages during LLM response streaming",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.364",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@tabler/icons-react": "^3.50.0",
|
|
21
|
-
"@epam/ai-dial-attachment-input": "1.3.0-dev.
|
|
21
|
+
"@epam/ai-dial-attachment-input": "1.3.0-dev.364"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^19.2.8",
|
|
25
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
25
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.364",
|
|
26
26
|
"@epam/ai-dial-ui-kit": "^0.16.0"
|
|
27
27
|
},
|
|
28
28
|
"repository": {
|