@epam/ai-dial-conversation-stages 1.2.0-dev.21 → 1.2.0-dev.213
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/components/CollapsedGroup/CollapsedGroup.d.ts.map +1 -1
- package/components/StageItem/StageItem.d.ts +3 -1
- package/components/StageItem/StageItem.d.ts.map +1 -1
- package/components/StageMarkdownContent/StageCodeBlock.d.ts +2 -2
- package/components/StageMarkdownContent/StageCodeBlock.d.ts.map +1 -1
- package/components/StagesPanel/StagesPanel.d.ts.map +1 -1
- package/constants/public-class-names.d.ts +9 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/constants/stage-accordion.d.ts +5 -0
- package/constants/stage-accordion.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +687 -371
- package/models/collapsed-group.d.ts +5 -3
- package/models/collapsed-group.d.ts.map +1 -1
- package/models/stages-props.d.ts +6 -2
- package/models/stages-props.d.ts.map +1 -1
- package/package.json +5 -4
- package/utils/stage-attachments.d.ts +11 -0
- package/utils/stage-attachments.d.ts.map +1 -0
- package/utils/stage-progress.d.ts +0 -2
- package/utils/stage-progress.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DIAL_ICON_SIZE as
|
|
3
|
-
import { IconAlertCircle as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
//#region src/
|
|
7
|
-
var
|
|
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 d, DIAL_ICON_SIZE as f, DIAL_KIT_ICON_STROKE as p, ElementSize as m, EllipsisTooltip as h, Highlight as g, Skeleton as _, SkeletonVariant as v, Spinner as y, StaticIconButton as b } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconAlertCircle as x, IconCheck as S, IconClipboard as C, IconDownload as w, IconExternalLink as T, IconFile as E, IconFileTypeBmp as D, IconFileTypeCss as O, IconFileTypeCsv as k, IconFileTypeDoc as A, IconFileTypeDocx as j, IconFileTypeHtml as M, IconFileTypeJpg as N, IconFileTypeJs as P, IconFileTypeJsx as F, IconFileTypePdf as I, IconFileTypePhp as L, IconFileTypePng as ee, IconFileTypePpt as R, IconFileTypeRs as z, IconFileTypeSql as te, IconFileTypeSvg as ne, IconFileTypeTs as re, IconFileTypeTsx as B, IconFileTypeTxt as ie, IconFileTypeVue as ae, IconFileTypeXls as oe, IconFileTypeXml as se, IconFileTypeZip as ce, IconMusic as le, IconPhoto as V, IconReload as ue, IconTerminal2 as de, IconVideo as fe, IconX as pe } from "@tabler/icons-react";
|
|
4
|
+
import { memo as me, useCallback as he, useEffect as H, useId as ge, useMemo as U, useRef as _e, useState as ve } from "react";
|
|
5
|
+
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
6
|
+
//#region src/constants/public-class-names.ts
|
|
7
|
+
var q = {
|
|
8
|
+
panel: "dial-conversation-stages-panel",
|
|
9
|
+
group: "dial-conversation-stages-group",
|
|
10
|
+
groupToggle: "dial-conversation-stages-group-toggle"
|
|
11
|
+
}, ye = /[([][^()[\]]*[)\]]/g, be = /(\d+(?:\.\d+)?)\s*s\b/, xe = /\bStart:\s*(\d{1,2}):([0-5]\d):([0-5]\d(?:\.\d+)?)\b/i, Se = (e) => {
|
|
8
12
|
let t = e.trimEnd();
|
|
9
13
|
return t.endsWith(":") ? t.slice(0, -1) : t;
|
|
10
|
-
},
|
|
11
|
-
let t =
|
|
14
|
+
}, Ce = 1440 * 60, we = Ce / 2, Te = (e) => {
|
|
15
|
+
let t = xe.exec(e);
|
|
12
16
|
if (!t) return;
|
|
13
17
|
let n = Number(t[1]);
|
|
14
18
|
if (!(n > 23)) return n * 60 * 60 + Number(t[2]) * 60 + Number(t[3]);
|
|
15
|
-
},
|
|
16
|
-
|
|
19
|
+
}, Ee = (e) => {
|
|
20
|
+
ye.lastIndex = 0;
|
|
17
21
|
let t;
|
|
18
|
-
for (; t =
|
|
19
|
-
let e = t[0].slice(1, -1), n =
|
|
22
|
+
for (; t = ye.exec(e);) {
|
|
23
|
+
let e = t[0].slice(1, -1), n = be.exec(e);
|
|
20
24
|
if (n) return {
|
|
21
25
|
durationLabel: `${n[1]}s`,
|
|
22
26
|
groupIndex: t.index,
|
|
23
27
|
groupLength: t[0].length,
|
|
24
|
-
startTimeSeconds:
|
|
28
|
+
startTimeSeconds: Te(e)
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
|
-
},
|
|
28
|
-
let t = e ?? "", n =
|
|
31
|
+
}, J = (e) => {
|
|
32
|
+
let t = e ?? "", n = Ee(t);
|
|
29
33
|
return {
|
|
30
|
-
name:
|
|
34
|
+
name: Se(n ? t.slice(0, n.groupIndex) + t.slice(n.groupIndex + n.groupLength) : t).trim().replace(/ {2,}/g, " "),
|
|
31
35
|
durationLabel: n?.durationLabel
|
|
32
36
|
};
|
|
33
|
-
},
|
|
37
|
+
}, De = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), Oe = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, ke = (e) => {
|
|
34
38
|
if (!e) return;
|
|
35
39
|
let t = /^(\d+(?:\.\d+)?)s$/.exec(e);
|
|
36
40
|
return t ? parseFloat(t[1]) : void 0;
|
|
37
|
-
},
|
|
41
|
+
}, Ae = (e) => {
|
|
38
42
|
let t = e.flatMap((e) => {
|
|
39
|
-
let t =
|
|
43
|
+
let t = Ee(e ?? ""), n = ke(t?.durationLabel);
|
|
40
44
|
return n == null ? [] : [{
|
|
41
45
|
durationSeconds: n,
|
|
42
46
|
startTimeSeconds: t?.startTimeSeconds
|
|
@@ -47,18 +51,18 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
47
51
|
let n = 0, r, i = t.flatMap(({ durationSeconds: e, startTimeSeconds: t }) => {
|
|
48
52
|
if (t == null) return [];
|
|
49
53
|
let i = t + n;
|
|
50
|
-
return r != null && r - i >
|
|
54
|
+
return r != null && r - i > we && (n += Ce, i += Ce), r = i, {
|
|
51
55
|
start: i,
|
|
52
56
|
end: i + e
|
|
53
57
|
};
|
|
54
58
|
}).sort((e, t) => e.start - t.start), a = 0, o = i[0].start, s = i[0].end;
|
|
55
59
|
for (let e of i.slice(1)) e.start <= s ? s = Math.max(s, e.end) : (a += s - o, o = e.start, s = e.end);
|
|
56
60
|
return a + s - o;
|
|
57
|
-
},
|
|
61
|
+
}, je = (e) => [...e].reverse().find((e) => e.status == null), Me = "overflow-visible py-0", Ne = "justify-start gap-2 rounded-lg px-2 py-1.5 text-start", Pe = (e) => {
|
|
58
62
|
let t = [], n = 0;
|
|
59
63
|
for (; n < e.length;) {
|
|
60
|
-
let r = e[n], i =
|
|
61
|
-
for (; a < e.length &&
|
|
64
|
+
let r = e[n], i = J(r.name).name, a = n + 1;
|
|
65
|
+
for (; a < e.length && J(e[a].name).name === i;) a += 1;
|
|
62
66
|
let o = e.slice(n, a);
|
|
63
67
|
o.length > 1 ? t.push({
|
|
64
68
|
key: r.index,
|
|
@@ -70,429 +74,741 @@ var T = /[([][^()[\]]*[)\]]/g, E = /(\d+(?:\.\d+)?)\s*s\b/, D = /\bStart:\s*(\d{
|
|
|
70
74
|
}), n = a;
|
|
71
75
|
}
|
|
72
76
|
return t;
|
|
73
|
-
},
|
|
74
|
-
panel: "
|
|
75
|
-
row: "
|
|
76
|
-
collapseButton: "
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
77
|
+
}, Y = {
|
|
78
|
+
panel: "_panel_8he9e_1",
|
|
79
|
+
row: "_row_8he9e_5",
|
|
80
|
+
collapseButton: "_collapseButton_8he9e_9",
|
|
81
|
+
stageHeader: "_stageHeader_8he9e_18",
|
|
82
|
+
stageRegion: "_stageRegion_8he9e_27",
|
|
83
|
+
stageName: "_stageName_8he9e_31",
|
|
84
|
+
stageNameFailed: "_stageNameFailed_8he9e_35",
|
|
85
|
+
monoName: "_monoName_8he9e_39",
|
|
86
|
+
tag: "_tag_8he9e_43",
|
|
87
|
+
count: "_count_8he9e_47",
|
|
88
|
+
duration: "_duration_8he9e_52",
|
|
89
|
+
iconSecondary: "_iconSecondary_8he9e_57",
|
|
90
|
+
iconCompleted: "_iconCompleted_8he9e_62",
|
|
91
|
+
iconError: "_iconError_8he9e_66",
|
|
92
|
+
stageContent: "_stageContent_8he9e_70",
|
|
93
|
+
codeBlock: "_codeBlock_8he9e_74",
|
|
94
|
+
codeInline: "_codeInline_8he9e_80",
|
|
95
|
+
blockquote: "_blockquote_8he9e_86",
|
|
96
|
+
tableCell: "_tableCell_8he9e_91"
|
|
97
|
+
}, Fe = ({ status: e, isLive: t, runningLabel: n = "Running", failedLabel: r = "Failed" }) => e === o.Failed ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(x, {
|
|
98
|
+
size: f.MD,
|
|
99
|
+
className: Y.iconError,
|
|
94
100
|
"aria-hidden": !0,
|
|
95
|
-
stroke:
|
|
96
|
-
}), /* @__PURE__ */
|
|
101
|
+
stroke: p
|
|
102
|
+
}), /* @__PURE__ */ G("span", {
|
|
97
103
|
className: "sr-only",
|
|
98
|
-
children:
|
|
99
|
-
})] }) : e ===
|
|
100
|
-
size:
|
|
101
|
-
className:
|
|
104
|
+
children: r
|
|
105
|
+
})] }) : e === o.Completed ? /* @__PURE__ */ G(S, {
|
|
106
|
+
size: f.SM,
|
|
107
|
+
className: Y.iconCompleted,
|
|
102
108
|
"aria-hidden": !0,
|
|
103
|
-
stroke:
|
|
104
|
-
}) :
|
|
109
|
+
stroke: p
|
|
110
|
+
}) : t ? /* @__PURE__ */ G(y, {
|
|
105
111
|
size: 16,
|
|
106
|
-
ariaLabel:
|
|
107
|
-
}) : null,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
112
|
+
ariaLabel: n
|
|
113
|
+
}) : null, Ie = (e) => {
|
|
114
|
+
if (e == null) return "";
|
|
115
|
+
let t = e.lastIndexOf(".");
|
|
116
|
+
return t > 0 ? e.slice(0, t) : e;
|
|
117
|
+
}, Le = (e) => {
|
|
118
|
+
if (!e) return E;
|
|
119
|
+
let t = u(e);
|
|
120
|
+
if (t.startsWith("image/")) switch (t) {
|
|
121
|
+
case "image/jpeg": return N;
|
|
122
|
+
case "image/png": return ee;
|
|
123
|
+
case "image/svg+xml": return ne;
|
|
124
|
+
case "image/bmp": return D;
|
|
125
|
+
default: return V;
|
|
126
|
+
}
|
|
127
|
+
if (t.startsWith("video/")) return fe;
|
|
128
|
+
if (t.startsWith("audio/")) return le;
|
|
129
|
+
switch (t) {
|
|
130
|
+
case "application/pdf": return I;
|
|
131
|
+
case "application/msword": return A;
|
|
132
|
+
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return j;
|
|
133
|
+
case "application/vnd.ms-powerpoint": return R;
|
|
134
|
+
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return R;
|
|
135
|
+
case "application/vnd.ms-excel": return oe;
|
|
136
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return oe;
|
|
137
|
+
case "application/zip":
|
|
138
|
+
case "application/vnd.rar":
|
|
139
|
+
case "application/x-7z-compressed":
|
|
140
|
+
case "application/gzip":
|
|
141
|
+
case "application/x-tar": return ce;
|
|
142
|
+
case "text/csv": return k;
|
|
143
|
+
case "text/plain": return ie;
|
|
144
|
+
case "text/html":
|
|
145
|
+
case "application/xhtml+xml": return M;
|
|
146
|
+
case "application/xml": return se;
|
|
147
|
+
case "application/sql": return te;
|
|
148
|
+
case "text/javascript": return P;
|
|
149
|
+
case "text/jsx": return F;
|
|
150
|
+
case "text/typescript": return re;
|
|
151
|
+
case "text/tsx": return B;
|
|
152
|
+
case "text/css": return O;
|
|
153
|
+
case "text/x-php": return L;
|
|
154
|
+
case "text/x-rustsrc": return z;
|
|
155
|
+
case "text/x-vue": return ae;
|
|
156
|
+
default: return E;
|
|
157
|
+
}
|
|
158
|
+
}, Re = (e) => {
|
|
159
|
+
let { type: n, contentType: r } = e;
|
|
160
|
+
return n === t.Prompt ? de : n === t.Pasted ? C : n === t.Image ? V : Le(r ?? "");
|
|
161
|
+
}, ze = (e) => {
|
|
162
|
+
let t = u(e), r = n[t];
|
|
163
|
+
if (r) return r;
|
|
164
|
+
let i = t.split("/")[1];
|
|
165
|
+
if (i && !i.startsWith("vnd.") && !i.includes("+")) return i;
|
|
166
|
+
}, Be = (e, n) => {
|
|
167
|
+
let { type: r, name: i, contentType: a } = e;
|
|
168
|
+
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
169
|
+
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
170
|
+
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
171
|
+
if (a) {
|
|
172
|
+
let e = ze(a);
|
|
173
|
+
if (e) return `.${e}`;
|
|
174
|
+
}
|
|
175
|
+
if (i == null) return "";
|
|
176
|
+
let o = i.lastIndexOf(".");
|
|
177
|
+
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
178
|
+
}, Ve = (e, n = {}) => {
|
|
179
|
+
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;
|
|
180
|
+
return {
|
|
181
|
+
isLoading: c,
|
|
182
|
+
isError: l,
|
|
183
|
+
isImage: u,
|
|
184
|
+
isLink: d,
|
|
185
|
+
BottomIcon: d ? null : Re(e),
|
|
186
|
+
typeLabel: d ? null : Be(e, n)
|
|
187
|
+
};
|
|
188
|
+
}, He = "flex size-[84px] items-center justify-center rounded-xl border", X = {
|
|
189
|
+
tray: "dial-ai-attachment-tray",
|
|
190
|
+
trayItem: "dial-ai-attachment-tray-item",
|
|
191
|
+
tile: "dial-ai-attachment-tile",
|
|
192
|
+
tileSelected: "dial-ai-attachment-tile-selected",
|
|
193
|
+
tileName: "dial-ai-attachment-tile-name",
|
|
194
|
+
tileType: "dial-ai-attachment-tile-type",
|
|
195
|
+
tileAction: "dial-ai-attachment-tile-action"
|
|
196
|
+
}, Z = {
|
|
197
|
+
tile: "_tile_s2es2_12",
|
|
198
|
+
hovered: "_hovered_s2es2_18",
|
|
199
|
+
selected: "_selected_s2es2_28",
|
|
200
|
+
tileError: "_tileError_s2es2_33",
|
|
201
|
+
nameText: "_nameText_s2es2_38",
|
|
202
|
+
typeText: "_typeText_s2es2_42",
|
|
203
|
+
retryIcon: "_retryIcon_s2es2_46",
|
|
204
|
+
track: "_track_s2es2_50",
|
|
205
|
+
actionButton: "_actionButton_s2es2_56",
|
|
206
|
+
imageActionButton: "_imageActionButton_s2es2_60"
|
|
207
|
+
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ G(b, {
|
|
208
|
+
icon: a,
|
|
209
|
+
size: m.Small,
|
|
210
|
+
className: c("opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o, X.tileAction),
|
|
211
|
+
"aria-label": e,
|
|
212
|
+
"aria-describedby": t ? n : void 0,
|
|
213
|
+
onClick: (e) => {
|
|
214
|
+
e.stopPropagation(), r(i);
|
|
215
|
+
}
|
|
216
|
+
}), Ue = ({ ...e }) => /* @__PURE__ */ G(Q, {
|
|
217
|
+
icon: /* @__PURE__ */ G(ue, {
|
|
218
|
+
size: f.SM,
|
|
219
|
+
"aria-hidden": !0,
|
|
220
|
+
stroke: p
|
|
221
|
+
}),
|
|
222
|
+
className: Z.retryIcon,
|
|
223
|
+
...e
|
|
224
|
+
}), We = ({ ...e }) => /* @__PURE__ */ G(Q, {
|
|
225
|
+
icon: /* @__PURE__ */ G(w, {
|
|
226
|
+
size: f.SM,
|
|
227
|
+
"aria-hidden": !0,
|
|
228
|
+
stroke: p
|
|
229
|
+
}),
|
|
230
|
+
...e
|
|
231
|
+
}), Ge = ({ ...e }) => /* @__PURE__ */ G(Q, {
|
|
232
|
+
icon: /* @__PURE__ */ G(T, {
|
|
233
|
+
size: f.SM,
|
|
234
|
+
"aria-hidden": !0,
|
|
235
|
+
stroke: p
|
|
236
|
+
}),
|
|
237
|
+
...e
|
|
238
|
+
}), Ke = ({ ...e }) => /* @__PURE__ */ G(Q, {
|
|
239
|
+
icon: /* @__PURE__ */ G(pe, {
|
|
240
|
+
size: f.SM,
|
|
241
|
+
"aria-hidden": !0,
|
|
242
|
+
stroke: p
|
|
243
|
+
}),
|
|
244
|
+
...e
|
|
245
|
+
}), qe = {
|
|
246
|
+
[e.Network]: "Upload failed · network error",
|
|
247
|
+
[e.UnsupportedType]: "Upload failed · unsupported file type",
|
|
248
|
+
[e.FileTooLarge]: "Upload failed · file too large"
|
|
249
|
+
}, Je = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: o, styles: s, onDownload: l, isPasted: u, isLink: d, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: _ }) => {
|
|
250
|
+
let { clickLabel: v = "Download attachment", retryLabel: b = "Retry upload", removeLabel: x = "Remove attachment", openInNewTabLabel: S = "Open in new tab", sizeLabel: C, uploadingLabel: w = "Uploading", errorReasonLabels: T, genericErrorLabel: E = "Upload failed" } = o ?? {}, { typography: D, className: O } = s ?? {}, { id: k, name: A, status: j, errorReason: M } = t, N = j === a.Loading, P = j === a.Error, F = ge(), I = P ? M && (T?.[M] ?? qe[M]) || E : "", { BottomIcon: L, typeLabel: ee } = Ve(t), R = !P && !N && l && !d, z = P && !!i && M !== e.UnsupportedType && M !== e.FileTooLarge, te = Number(!!R) + Number(!!z) + Number(!!d) + Number(!!h), ne = te > 1 ? "pe-11" : te === 1 ? "pe-5" : void 0, re = (e) => {
|
|
251
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
252
|
+
}, B = U(() => u ? A : Ie(A), [u, A]), ie = he(() => {
|
|
253
|
+
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
254
|
+
}, [t]), ae = c(He, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !P && Z.hovered, _ && Z.selected, P && Z.tileError, X.tile, _ && X.tileSelected), oe = /* @__PURE__ */ G("div", {
|
|
255
|
+
title: B,
|
|
256
|
+
className: c(D?.nameClassName ?? "dial-caption-text", "line-clamp-2 w-full min-w-0 break-words", Z.nameText, !P && ne, X.tileName),
|
|
257
|
+
children: n ? /* @__PURE__ */ G(g, {
|
|
258
|
+
text: B,
|
|
259
|
+
query: n,
|
|
260
|
+
maxLines: 2
|
|
261
|
+
}) : B
|
|
262
|
+
}), se = L && /* @__PURE__ */ K("div", {
|
|
263
|
+
className: c("flex w-full items-center gap-1", P && ne, X.tileType),
|
|
264
|
+
children: [/* @__PURE__ */ G(L, {
|
|
265
|
+
size: 16,
|
|
266
|
+
className: Z.typeText,
|
|
267
|
+
"aria-hidden": !0
|
|
268
|
+
}), /* @__PURE__ */ G("span", {
|
|
269
|
+
className: c(D?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
|
|
270
|
+
children: C ? `${ee} · ${C}` : ee
|
|
130
271
|
})]
|
|
272
|
+
}), ce = () => {
|
|
273
|
+
m && p ? p(k) : r && r(k);
|
|
274
|
+
}, le = /* @__PURE__ */ K(W, { children: [
|
|
275
|
+
oe,
|
|
276
|
+
se,
|
|
277
|
+
N && /* @__PURE__ */ G("div", {
|
|
278
|
+
role: "progressbar",
|
|
279
|
+
"aria-label": w,
|
|
280
|
+
className: c("absolute start-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
|
|
281
|
+
children: /* @__PURE__ */ G(y, { size: 32 })
|
|
282
|
+
}),
|
|
283
|
+
/* @__PURE__ */ K("div", {
|
|
284
|
+
className: "absolute end-1 top-1 flex gap-1",
|
|
285
|
+
children: [
|
|
286
|
+
R && /* @__PURE__ */ G(We, {
|
|
287
|
+
ariaLabel: v,
|
|
288
|
+
errorTitle: I,
|
|
289
|
+
errorDescId: F,
|
|
290
|
+
onClick: l,
|
|
291
|
+
id: k
|
|
292
|
+
}),
|
|
293
|
+
z && /* @__PURE__ */ G(Ue, {
|
|
294
|
+
ariaLabel: b,
|
|
295
|
+
errorTitle: I,
|
|
296
|
+
errorDescId: F,
|
|
297
|
+
onClick: i,
|
|
298
|
+
id: k
|
|
299
|
+
}),
|
|
300
|
+
d && /* @__PURE__ */ G(Ge, {
|
|
301
|
+
ariaLabel: S,
|
|
302
|
+
errorTitle: I,
|
|
303
|
+
errorDescId: F,
|
|
304
|
+
onClick: ie
|
|
305
|
+
}),
|
|
306
|
+
h && /* @__PURE__ */ G(Ke, {
|
|
307
|
+
ariaLabel: x,
|
|
308
|
+
errorTitle: I,
|
|
309
|
+
errorDescId: F,
|
|
310
|
+
onClick: h,
|
|
311
|
+
id: k
|
|
312
|
+
})
|
|
313
|
+
]
|
|
314
|
+
}),
|
|
315
|
+
P && /* @__PURE__ */ G("span", {
|
|
316
|
+
id: F,
|
|
317
|
+
role: "status",
|
|
318
|
+
"aria-live": "polite",
|
|
319
|
+
className: "sr-only",
|
|
320
|
+
children: I
|
|
321
|
+
})
|
|
322
|
+
] });
|
|
323
|
+
return /* @__PURE__ */ G("div", {
|
|
324
|
+
style: f,
|
|
325
|
+
className: c("inline-flex", O),
|
|
326
|
+
children: /* @__PURE__ */ G("div", {
|
|
327
|
+
role: "button",
|
|
328
|
+
tabIndex: 0,
|
|
329
|
+
"aria-label": v,
|
|
330
|
+
"aria-busy": N,
|
|
331
|
+
onClick: ce,
|
|
332
|
+
onKeyDown: re,
|
|
333
|
+
style: f,
|
|
334
|
+
className: c(ae, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
335
|
+
children: le
|
|
336
|
+
})
|
|
131
337
|
});
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
338
|
+
}, Ye = /* @__PURE__ */ function(e) {
|
|
339
|
+
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
340
|
+
}({}), Xe = ({ enabled: e, src: t }) => {
|
|
341
|
+
let n = _e(null), [r, i] = ve("idle");
|
|
342
|
+
return H(() => {
|
|
343
|
+
i(e && t ? "loading" : "idle");
|
|
344
|
+
}, [e, t]), H(() => {
|
|
345
|
+
let r = n.current;
|
|
346
|
+
if (!r || !e || !t) return;
|
|
347
|
+
let a = () => i("loaded"), o = () => i("error");
|
|
348
|
+
return r.addEventListener("load", a), r.addEventListener("error", o), r.complete && i(r.naturalWidth > 0 ? "loaded" : "error"), () => {
|
|
349
|
+
r.removeEventListener("load", a), r.removeEventListener("error", o);
|
|
350
|
+
};
|
|
351
|
+
}, [e, t]), {
|
|
352
|
+
imageRef: n,
|
|
353
|
+
imageLoadStatus: r
|
|
354
|
+
};
|
|
355
|
+
}, Ze = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: l, isSelected: u }) => {
|
|
356
|
+
let { clickLabel: d = "Open attachment", expandLabel: m = "Expand pasted text", removeLabel: h = "Remove attachment", downloadLabel: g = "Download attachment" } = i ?? {}, { className: y } = l ?? {}, { id: b, name: x } = e, S = e.previewUrl ?? e.url, C = e.type === t.Pasted && n !== void 0, { isLoading: w, isError: T, isImage: E } = U(() => Ve(e), [e]), D = r !== void 0 && !C && !w && !T, { imageRef: O, imageLoadStatus: k } = Xe({
|
|
357
|
+
enabled: E,
|
|
358
|
+
src: S
|
|
359
|
+
}), A = () => {
|
|
360
|
+
C && n ? n(b) : D && r && r(b);
|
|
361
|
+
};
|
|
362
|
+
return /* @__PURE__ */ G("div", {
|
|
363
|
+
className: c(He, "group/attachment-tile", D && "cursor-pointer", Z.tile, u && Z.selected, y, X.tile, u && X.tileSelected),
|
|
364
|
+
onClick: A,
|
|
365
|
+
onKeyDown: (e) => {
|
|
366
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), A());
|
|
367
|
+
},
|
|
368
|
+
tabIndex: 0,
|
|
369
|
+
role: "button",
|
|
370
|
+
style: o,
|
|
371
|
+
"aria-label": D ? d : C ? m : void 0,
|
|
372
|
+
children: /* @__PURE__ */ K("div", {
|
|
373
|
+
className: "relative h-full w-full overflow-hidden",
|
|
374
|
+
children: [
|
|
375
|
+
/* @__PURE__ */ K("div", {
|
|
376
|
+
className: "absolute end-1 top-1 z-10 flex gap-1",
|
|
377
|
+
children: [a && /* @__PURE__ */ G(Ke, {
|
|
378
|
+
ariaLabel: h,
|
|
379
|
+
onClick: a,
|
|
380
|
+
id: b,
|
|
381
|
+
className: Z.imageActionButton
|
|
382
|
+
}), s && /* @__PURE__ */ G(We, {
|
|
383
|
+
ariaLabel: g,
|
|
384
|
+
onClick: s,
|
|
385
|
+
id: b,
|
|
386
|
+
className: Z.imageActionButton
|
|
387
|
+
})]
|
|
388
|
+
}),
|
|
389
|
+
k !== Ye.Loaded && /* @__PURE__ */ G(_, {
|
|
390
|
+
variant: v.Rectangular,
|
|
391
|
+
width: "100%",
|
|
392
|
+
height: "100%",
|
|
393
|
+
active: k === Ye.Loading,
|
|
394
|
+
overlay: /* @__PURE__ */ G(V, {
|
|
395
|
+
size: f.LG,
|
|
396
|
+
className: Z.typeText,
|
|
397
|
+
"aria-hidden": !0,
|
|
398
|
+
stroke: p
|
|
399
|
+
}),
|
|
400
|
+
className: "absolute inset-0 rounded-xl"
|
|
401
|
+
}),
|
|
402
|
+
/* @__PURE__ */ G("img", {
|
|
403
|
+
ref: O,
|
|
404
|
+
src: S,
|
|
405
|
+
alt: x,
|
|
406
|
+
loading: "lazy",
|
|
407
|
+
decoding: "async",
|
|
408
|
+
className: c("h-full w-full rounded-xl object-cover transition-opacity duration-200", k === Ye.Loaded ? "opacity-100" : "opacity-0")
|
|
409
|
+
})
|
|
410
|
+
]
|
|
411
|
+
})
|
|
412
|
+
});
|
|
413
|
+
}, Qe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: c, labels: l, styles: u, isSelected: d }) => {
|
|
414
|
+
let { colors: f } = u ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = s({
|
|
415
|
+
"--ai-tile-bg": f?.background,
|
|
416
|
+
"--ai-tile-border": f?.border,
|
|
417
|
+
"--ai-tile-bg-hover": f?.backgroundHover,
|
|
418
|
+
"--ai-tile-border-hover": f?.borderHover,
|
|
419
|
+
"--ai-tile-bg-selected": f?.backgroundSelected,
|
|
420
|
+
"--ai-tile-border-selected": f?.borderSelected,
|
|
421
|
+
"--ai-tile-focus-outline": f?.focusOutline,
|
|
422
|
+
"--ai-tile-bg-error": f?.backgroundError,
|
|
423
|
+
"--ai-tile-border-error": f?.borderError,
|
|
424
|
+
"--ai-tile-error-text": f?.errorText,
|
|
425
|
+
"--ai-tile-name-text": f?.nameText,
|
|
426
|
+
"--ai-tile-type-text": f?.typeText,
|
|
427
|
+
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
428
|
+
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
429
|
+
"--ai-tile-progress-track": f?.trackBackground
|
|
430
|
+
}), { isImage: g, isLink: _ } = U(() => Ve(e), [e]);
|
|
431
|
+
return g ? /* @__PURE__ */ G(Ze, {
|
|
432
|
+
attachment: e,
|
|
433
|
+
labels: l,
|
|
434
|
+
onClick: o,
|
|
435
|
+
onExpand: a,
|
|
436
|
+
styles: u,
|
|
437
|
+
onRemove: r,
|
|
438
|
+
cssVars: h,
|
|
439
|
+
onDownload: c,
|
|
440
|
+
isSelected: d
|
|
441
|
+
}) : /* @__PURE__ */ G(Je, {
|
|
442
|
+
attachment: e,
|
|
443
|
+
searchQuery: n,
|
|
444
|
+
onClick: o,
|
|
445
|
+
onRetry: i,
|
|
446
|
+
onRemove: r,
|
|
447
|
+
onDownload: c,
|
|
448
|
+
isLink: _,
|
|
449
|
+
isPasted: p,
|
|
450
|
+
styles: u,
|
|
451
|
+
labels: l,
|
|
452
|
+
onExpand: a,
|
|
453
|
+
cssVars: h,
|
|
454
|
+
isExpandable: m,
|
|
455
|
+
isSelected: d
|
|
456
|
+
});
|
|
457
|
+
}, $e = (e) => {
|
|
458
|
+
let t = l(e);
|
|
459
|
+
if (!e?.length) return t;
|
|
460
|
+
let n = /* @__PURE__ */ new Map();
|
|
461
|
+
for (let t of e) {
|
|
462
|
+
let e = t.url ?? t.data ?? t.title;
|
|
463
|
+
n.has(e) || n.set(e, t.type);
|
|
464
|
+
}
|
|
465
|
+
return t.map((e) => {
|
|
466
|
+
let t = n.get(e.id);
|
|
467
|
+
return t ? {
|
|
468
|
+
...e,
|
|
469
|
+
contentType: t
|
|
470
|
+
} : e;
|
|
471
|
+
});
|
|
472
|
+
}, et = ({ children: e, codeClassName: t, blockClassName: n = "dial-code-text", copyAriaLabel: i }) => /* @__PURE__ */ G(r, {
|
|
473
|
+
language: t?.replace(/^language-/, "") ?? "",
|
|
474
|
+
value: typeof e == "string" ? e : String(e ?? ""),
|
|
475
|
+
codeClassName: n,
|
|
476
|
+
containerClassName: c(Y.codeBlock, n),
|
|
477
|
+
copyLabel: i,
|
|
478
|
+
hideDownload: !0
|
|
479
|
+
}), tt = me(({ content: e, typography: t, copyAriaLabel: n = "Copy" }) => {
|
|
480
|
+
let r = "mb-1.5 last:mb-0", a = c(t?.headingClassName ?? "dial-small-semi-text", Y.stageContent, r);
|
|
481
|
+
return /* @__PURE__ */ G(i, {
|
|
482
|
+
content: e,
|
|
136
483
|
classNames: {
|
|
137
|
-
h1:
|
|
138
|
-
h2:
|
|
139
|
-
h3:
|
|
140
|
-
h4:
|
|
141
|
-
h5:
|
|
142
|
-
h6:
|
|
143
|
-
p:
|
|
144
|
-
ul:
|
|
145
|
-
ol:
|
|
146
|
-
strong:
|
|
147
|
-
codeInline:
|
|
148
|
-
blockquote:
|
|
149
|
-
link:
|
|
150
|
-
tableCell:
|
|
484
|
+
h1: a,
|
|
485
|
+
h2: a,
|
|
486
|
+
h3: a,
|
|
487
|
+
h4: a,
|
|
488
|
+
h5: a,
|
|
489
|
+
h6: a,
|
|
490
|
+
p: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent, "mb-1.5"),
|
|
491
|
+
ul: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent, r),
|
|
492
|
+
ol: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent, r),
|
|
493
|
+
strong: c(t?.strongClassName ?? t?.contentClassName ?? "dial-tiny-text", Y.stageContent),
|
|
494
|
+
codeInline: Y.codeInline,
|
|
495
|
+
blockquote: c(t?.contentClassName ?? "dial-tiny-text", Y.blockquote, r),
|
|
496
|
+
link: c(t?.contentClassName ?? "dial-tiny-text", Y.stageContent),
|
|
497
|
+
tableCell: c(t?.contentClassName ?? "dial-tiny-text", Y.tableCell)
|
|
151
498
|
},
|
|
152
|
-
components: { code: ({ children: e, className:
|
|
153
|
-
codeClassName:
|
|
154
|
-
blockClassName:
|
|
155
|
-
copyAriaLabel:
|
|
499
|
+
components: { code: ({ children: e, className: r }) => r?.includes("language-") ? /* @__PURE__ */ G(et, {
|
|
500
|
+
codeClassName: r,
|
|
501
|
+
blockClassName: t?.codeBlockClassName,
|
|
502
|
+
copyAriaLabel: n,
|
|
156
503
|
children: e
|
|
157
|
-
}) : /* @__PURE__ */
|
|
158
|
-
className:
|
|
504
|
+
}) : /* @__PURE__ */ G("code", {
|
|
505
|
+
className: c("inline-block px-1.5 py-1", t?.codeClassName ?? "dial-code-text rounded-md", Y.codeInline),
|
|
159
506
|
children: e
|
|
160
507
|
}) }
|
|
161
508
|
});
|
|
162
|
-
}),
|
|
163
|
-
let
|
|
164
|
-
|
|
509
|
+
}), nt = ({ attachments: e, clickLabel: t, onAttachmentClick: n }) => {
|
|
510
|
+
let r = he((t) => {
|
|
511
|
+
let r = e.find((e) => e.id === t);
|
|
512
|
+
r && n?.(r);
|
|
513
|
+
}, [e, n]);
|
|
514
|
+
return /* @__PURE__ */ G("div", {
|
|
515
|
+
role: "list",
|
|
516
|
+
className: "flex flex-wrap gap-3",
|
|
517
|
+
children: e.map((e) => /* @__PURE__ */ G("div", {
|
|
518
|
+
role: "listitem",
|
|
519
|
+
children: /* @__PURE__ */ G(Qe, {
|
|
520
|
+
attachment: e,
|
|
521
|
+
onClick: n && r,
|
|
522
|
+
labels: { clickLabel: t }
|
|
523
|
+
})
|
|
524
|
+
}, e.id))
|
|
525
|
+
});
|
|
526
|
+
}, rt = ({ stage: e, isLive: t, typography: n, labels: r, nameOverride: i, onAttachmentClick: a }) => {
|
|
527
|
+
let { copyAriaLabel: s = "Copy stage content", runningAriaLabel: l, failedAriaLabel: u, attachmentClickLabel: f = "Preview search result" } = r ?? {}, p = U(() => $e(e.attachments), [e.attachments]), { name: m, durationLabel: g } = J(e.name), _ = i ?? m, v = !i && De(m), y = e.status === o.Failed, b = !!e.content || !!e.attachments?.length, x = /* @__PURE__ */ K(W, { children: [
|
|
528
|
+
/* @__PURE__ */ G("span", {
|
|
165
529
|
className: "flex flex-none items-center",
|
|
166
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ G(Fe, {
|
|
167
531
|
status: e.status,
|
|
168
|
-
isLive:
|
|
169
|
-
runningLabel:
|
|
170
|
-
failedLabel:
|
|
532
|
+
isLive: t,
|
|
533
|
+
runningLabel: l,
|
|
534
|
+
failedLabel: u
|
|
171
535
|
})
|
|
172
536
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
className:
|
|
175
|
-
children: /* @__PURE__ */
|
|
537
|
+
/* @__PURE__ */ G("span", {
|
|
538
|
+
className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text", Y.stageName, y && Y.stageNameFailed, v && Y.monoName),
|
|
539
|
+
children: /* @__PURE__ */ G(h, { text: _ || e.status || "" })
|
|
176
540
|
}),
|
|
177
|
-
e.tag && /* @__PURE__ */
|
|
178
|
-
className:
|
|
541
|
+
e.tag && /* @__PURE__ */ G("span", {
|
|
542
|
+
className: c("flex-none", n?.tagClassName ?? "dial-tiny-lead-text", Y.tag),
|
|
179
543
|
children: e.tag
|
|
180
544
|
}),
|
|
181
|
-
|
|
182
|
-
className:
|
|
183
|
-
children:
|
|
184
|
-
}),
|
|
185
|
-
E && /* @__PURE__ */ C("span", {
|
|
186
|
-
className: i("flex-none", V.iconSecondary),
|
|
187
|
-
children: u ? /* @__PURE__ */ C(m, {
|
|
188
|
-
size: a.SM,
|
|
189
|
-
"aria-hidden": !0,
|
|
190
|
-
stroke: o
|
|
191
|
-
}) : /* @__PURE__ */ C(h, {
|
|
192
|
-
size: a.SM,
|
|
193
|
-
className: "rtl:scale-x-[-1]",
|
|
194
|
-
"aria-hidden": !0,
|
|
195
|
-
stroke: o
|
|
196
|
-
})
|
|
197
|
-
})
|
|
198
|
-
] }), O = i("flex w-full items-center gap-2 px-2 py-1.5", V.row);
|
|
199
|
-
return E ? /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("div", {
|
|
200
|
-
className: O,
|
|
201
|
-
children: /* @__PURE__ */ C("button", {
|
|
202
|
-
type: "button",
|
|
203
|
-
onClick: () => d((e) => !e),
|
|
204
|
-
"aria-expanded": u,
|
|
205
|
-
className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-start",
|
|
206
|
-
children: D
|
|
545
|
+
g && /* @__PURE__ */ G("span", {
|
|
546
|
+
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", Y.duration),
|
|
547
|
+
children: g
|
|
207
548
|
})
|
|
208
|
-
})
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
className: "
|
|
212
|
-
children:
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
549
|
+
] });
|
|
550
|
+
return b ? /* @__PURE__ */ K(d, {
|
|
551
|
+
title: /* @__PURE__ */ G("span", {
|
|
552
|
+
className: "flex min-w-0 items-center gap-2",
|
|
553
|
+
children: x
|
|
554
|
+
}),
|
|
555
|
+
className: Me,
|
|
556
|
+
headerClassName: c(Ne, Y.row, Y.stageHeader),
|
|
557
|
+
contentClassName: c("-mt-1 flex flex-col gap-3 px-0 py-1 ps-8", Y.stageRegion),
|
|
558
|
+
children: [e.content && /* @__PURE__ */ G("div", {
|
|
559
|
+
className: "max-h-[300px] overflow-y-auto",
|
|
560
|
+
children: /* @__PURE__ */ G(tt, {
|
|
561
|
+
content: e.content,
|
|
562
|
+
typography: n,
|
|
563
|
+
copyAriaLabel: s
|
|
222
564
|
})
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
565
|
+
}), p.length > 0 && /* @__PURE__ */ G(nt, {
|
|
566
|
+
attachments: p,
|
|
567
|
+
clickLabel: f,
|
|
568
|
+
onAttachmentClick: a
|
|
569
|
+
})]
|
|
570
|
+
}) : /* @__PURE__ */ G("div", {
|
|
571
|
+
className: c("flex w-full items-center gap-2 px-2 py-1.5", Y.row),
|
|
572
|
+
children: x
|
|
227
573
|
});
|
|
228
|
-
},
|
|
229
|
-
let { runningAriaLabel:
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
574
|
+
}, it = ({ row: e, isLive: t, typography: n, labels: r, onAttachmentClick: i }) => {
|
|
575
|
+
let { runningAriaLabel: a, failedAriaLabel: s, attemptLabel: l = (e) => `Attempt ${e}` } = r ?? {}, u = e.attempts?.some((e) => e.status == null) ?? !1, f = e.attempts?.some((e) => e.status === o.Failed), p = u ? null : f ? o.Failed : o.Completed, m = Ae((e.attempts || []).map((e) => e.name)), g = m > 0 ? Oe(m) : void 0;
|
|
576
|
+
return /* @__PURE__ */ G(d, {
|
|
577
|
+
title: /* @__PURE__ */ K("span", {
|
|
578
|
+
className: "flex min-w-0 items-center gap-2",
|
|
579
|
+
children: [
|
|
580
|
+
/* @__PURE__ */ G("span", {
|
|
581
|
+
className: "flex flex-none items-center",
|
|
582
|
+
children: /* @__PURE__ */ G(Fe, {
|
|
583
|
+
status: p,
|
|
584
|
+
isLive: t,
|
|
585
|
+
runningLabel: a,
|
|
586
|
+
failedLabel: s
|
|
587
|
+
})
|
|
588
|
+
}),
|
|
589
|
+
/* @__PURE__ */ G("span", {
|
|
590
|
+
className: c("min-w-0 max-w-[22rem] truncate", n?.fontClassName ?? "dial-small-text", Y.stageName, f && Y.stageNameFailed),
|
|
591
|
+
children: /* @__PURE__ */ G(h, { text: e.name })
|
|
592
|
+
}),
|
|
593
|
+
/* @__PURE__ */ K("span", {
|
|
594
|
+
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", Y.count),
|
|
595
|
+
children: ["×", e.attempts?.length ?? 0]
|
|
596
|
+
}),
|
|
597
|
+
g && /* @__PURE__ */ G("span", {
|
|
598
|
+
className: c("flex-none", n?.countFontClassName ?? "dial-tiny-text", Y.duration),
|
|
599
|
+
children: g
|
|
243
600
|
})
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
"aria-hidden": !0,
|
|
262
|
-
stroke: o
|
|
263
|
-
}) : /* @__PURE__ */ C(h, {
|
|
264
|
-
size: a.SM,
|
|
265
|
-
className: "rtl:scale-x-[-1]",
|
|
266
|
-
"aria-hidden": !0,
|
|
267
|
-
stroke: o
|
|
601
|
+
]
|
|
602
|
+
}),
|
|
603
|
+
className: Me,
|
|
604
|
+
headerClassName: c(Ne, Y.collapseButton, Y.row, Y.stageHeader),
|
|
605
|
+
contentClassName: c("-mt-2 px-0 ps-6", Y.stageRegion),
|
|
606
|
+
children: /* @__PURE__ */ G("ul", {
|
|
607
|
+
role: "list",
|
|
608
|
+
className: "flex flex-col gap-0.5",
|
|
609
|
+
children: e.attempts?.map((e, a) => /* @__PURE__ */ G("li", {
|
|
610
|
+
role: "listitem",
|
|
611
|
+
children: /* @__PURE__ */ G(rt, {
|
|
612
|
+
stage: e,
|
|
613
|
+
nameOverride: l(a + 1),
|
|
614
|
+
isLive: t && e.status == null,
|
|
615
|
+
typography: n,
|
|
616
|
+
labels: r,
|
|
617
|
+
onAttachmentClick: i
|
|
268
618
|
})
|
|
269
|
-
})
|
|
270
|
-
]
|
|
271
|
-
}), /* @__PURE__ */ C("div", {
|
|
272
|
-
className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", f ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
273
|
-
children: /* @__PURE__ */ C("div", {
|
|
274
|
-
className: "overflow-hidden",
|
|
275
|
-
children: /* @__PURE__ */ C("ul", {
|
|
276
|
-
role: "list",
|
|
277
|
-
className: "mt-1 flex flex-col gap-0.5 ps-6",
|
|
278
|
-
children: e.attempts?.map((e, t) => /* @__PURE__ */ C("li", {
|
|
279
|
-
role: "listitem",
|
|
280
|
-
children: /* @__PURE__ */ C(G, {
|
|
281
|
-
stage: e,
|
|
282
|
-
nameOverride: d(t + 1),
|
|
283
|
-
isLive: n && e.status == null,
|
|
284
|
-
typography: r,
|
|
285
|
-
labels: s
|
|
286
|
-
})
|
|
287
|
-
}, e.index))
|
|
288
|
-
})
|
|
619
|
+
}, e.index))
|
|
289
620
|
})
|
|
290
|
-
})
|
|
291
|
-
},
|
|
292
|
-
let { colors:
|
|
293
|
-
"--cs-text":
|
|
294
|
-
"--cs-row-hover":
|
|
295
|
-
"--cs-button-bg":
|
|
296
|
-
"--cs-stage-text":
|
|
297
|
-
"--cs-failed-text":
|
|
298
|
-
"--cs-tag-text":
|
|
299
|
-
"--cs-count-text":
|
|
300
|
-
"--cs-duration-text":
|
|
301
|
-
"--cs-icon-secondary":
|
|
302
|
-
"--cs-icon-completed":
|
|
303
|
-
"--cs-icon-error":
|
|
304
|
-
"--cs-code-bg":
|
|
305
|
-
"--cs-code-border":
|
|
306
|
-
"--cs-code-text":
|
|
307
|
-
"--cs-border":
|
|
308
|
-
}),
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
-
style:
|
|
311
|
-
className:
|
|
312
|
-
children: /* @__PURE__ */
|
|
621
|
+
});
|
|
622
|
+
}, at = ({ stages: e, isStreaming: t, className: n, styles: r, labels: i, onAttachmentClick: a }) => {
|
|
623
|
+
let { colors: o, typography: l } = r ?? {}, u = s({
|
|
624
|
+
"--cs-text": o?.text,
|
|
625
|
+
"--cs-row-hover": o?.rowHoverColor,
|
|
626
|
+
"--cs-button-bg": o?.collapsedButtonBg,
|
|
627
|
+
"--cs-stage-text": o?.stageTextColor,
|
|
628
|
+
"--cs-failed-text": o?.failedColor,
|
|
629
|
+
"--cs-tag-text": o?.tagTextColor,
|
|
630
|
+
"--cs-count-text": o?.countTextColor,
|
|
631
|
+
"--cs-duration-text": o?.durationTextColor,
|
|
632
|
+
"--cs-icon-secondary": o?.iconSecondaryColor,
|
|
633
|
+
"--cs-icon-completed": o?.iconCompletedColor,
|
|
634
|
+
"--cs-icon-error": o?.iconErrorColor,
|
|
635
|
+
"--cs-code-bg": o?.codeBg,
|
|
636
|
+
"--cs-code-border": o?.codeBorderColor,
|
|
637
|
+
"--cs-code-text": o?.codeTextColor,
|
|
638
|
+
"--cs-border": o?.borderColor
|
|
639
|
+
}), d = Pe(e);
|
|
640
|
+
return /* @__PURE__ */ G("div", {
|
|
641
|
+
style: u,
|
|
642
|
+
className: c("w-full", Y.panel, n, q.panel),
|
|
643
|
+
children: /* @__PURE__ */ G("ul", {
|
|
313
644
|
role: "list",
|
|
314
645
|
className: "flex w-full flex-col gap-0.5 ps-5",
|
|
315
|
-
children:
|
|
646
|
+
children: d.map((e) => e.stage ? /* @__PURE__ */ G("li", {
|
|
316
647
|
role: "listitem",
|
|
317
|
-
children: /* @__PURE__ */
|
|
648
|
+
children: /* @__PURE__ */ G(rt, {
|
|
318
649
|
stage: e.stage,
|
|
319
650
|
isLive: t && e.stage.status == null,
|
|
320
|
-
typography:
|
|
321
|
-
labels:
|
|
651
|
+
typography: l,
|
|
652
|
+
labels: i,
|
|
653
|
+
onAttachmentClick: a
|
|
322
654
|
})
|
|
323
|
-
}, e.key) : /* @__PURE__ */
|
|
655
|
+
}, e.key) : /* @__PURE__ */ G("li", {
|
|
324
656
|
role: "listitem",
|
|
325
|
-
children: /* @__PURE__ */
|
|
657
|
+
children: /* @__PURE__ */ G(it, {
|
|
326
658
|
row: e,
|
|
327
659
|
isLive: t && (e.attempts?.some((e) => e.status == null) ?? !1),
|
|
328
|
-
typography:
|
|
329
|
-
labels:
|
|
660
|
+
typography: l,
|
|
661
|
+
labels: i,
|
|
662
|
+
onAttachmentClick: a
|
|
330
663
|
})
|
|
331
664
|
}, e.key))
|
|
332
665
|
})
|
|
333
666
|
});
|
|
334
|
-
},
|
|
335
|
-
toggleButton: "
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
"--cs-cg-label
|
|
349
|
-
"--cs-cg-
|
|
350
|
-
"--cs-cg-
|
|
351
|
-
"--cs-cg-
|
|
352
|
-
"--cs-
|
|
353
|
-
"--cs-
|
|
354
|
-
"--cs-
|
|
355
|
-
"--cs-
|
|
356
|
-
"--cs-
|
|
357
|
-
"--cs-
|
|
358
|
-
"--cs-
|
|
359
|
-
"--cs-
|
|
360
|
-
"--cs-
|
|
361
|
-
"--cs-icon-
|
|
362
|
-
"--cs-icon-
|
|
363
|
-
"--cs-
|
|
364
|
-
"--cs-code-
|
|
365
|
-
"--cs-code-
|
|
366
|
-
"--cs-
|
|
667
|
+
}, $ = {
|
|
668
|
+
toggleButton: "_toggleButton_1kyyc_7",
|
|
669
|
+
groupRegion: "_groupRegion_1kyyc_28",
|
|
670
|
+
executedLabel: "_executedLabel_1kyyc_32",
|
|
671
|
+
stepsCount: "_stepsCount_1kyyc_36",
|
|
672
|
+
doneIcon: "_doneIcon_1kyyc_41",
|
|
673
|
+
failedText: "_failedText_1kyyc_45",
|
|
674
|
+
liveName: "_liveName_1kyyc_49"
|
|
675
|
+
}, ot = ({ stages: e, isStreaming: t, labels: n, className: r, styles: i, onAttachmentClick: a }) => {
|
|
676
|
+
let { executedLabel: l = "Executed", stepsLabel: u = () => "steps", failedCountLabel: m = (e) => `${e} failed`, runningAriaLabel: g = "Running", copyAriaLabel: _, failedAriaLabel: v, attemptLabel: b, attachmentClickLabel: x } = n ?? {}, [C, w] = ve(t), T = _e(t);
|
|
677
|
+
H(() => {
|
|
678
|
+
T.current && !t && w(!1), T.current = t;
|
|
679
|
+
}, [t]);
|
|
680
|
+
let { colors: E, panel: D } = i ?? {}, O = i?.typography ?? { fontClassName: "dial-small-text" }, k = s({
|
|
681
|
+
"--cs-cg-label": E?.labelColor,
|
|
682
|
+
"--cs-cg-label-hover": E?.labelHoverColor,
|
|
683
|
+
"--cs-cg-steps-count": E?.stepsCountColor,
|
|
684
|
+
"--cs-cg-done": E?.doneColor,
|
|
685
|
+
"--cs-cg-failed": E?.failedColor,
|
|
686
|
+
"--cs-text": D?.text,
|
|
687
|
+
"--cs-row-hover": D?.rowHoverColor,
|
|
688
|
+
"--cs-button-bg": D?.collapsedButtonBg,
|
|
689
|
+
"--cs-stage-text": D?.stageTextColor,
|
|
690
|
+
"--cs-failed-text": D?.failedColor,
|
|
691
|
+
"--cs-tag-text": D?.tagTextColor,
|
|
692
|
+
"--cs-count-text": D?.countTextColor,
|
|
693
|
+
"--cs-duration-text": D?.durationTextColor,
|
|
694
|
+
"--cs-icon-secondary": D?.iconSecondaryColor,
|
|
695
|
+
"--cs-icon-completed": D?.iconCompletedColor,
|
|
696
|
+
"--cs-icon-error": D?.iconErrorColor,
|
|
697
|
+
"--cs-code-bg": D?.codeBg,
|
|
698
|
+
"--cs-code-border": D?.codeBorderColor,
|
|
699
|
+
"--cs-code-text": D?.codeTextColor,
|
|
700
|
+
"--cs-border": D?.borderColor
|
|
367
701
|
});
|
|
368
702
|
if (e.length === 0) return null;
|
|
369
|
-
let
|
|
370
|
-
copyAriaLabel:
|
|
371
|
-
runningAriaLabel:
|
|
372
|
-
failedAriaLabel:
|
|
373
|
-
attemptLabel:
|
|
703
|
+
let A = {
|
|
704
|
+
copyAriaLabel: _,
|
|
705
|
+
runningAriaLabel: g,
|
|
706
|
+
failedAriaLabel: v,
|
|
707
|
+
attemptLabel: b,
|
|
708
|
+
attachmentClickLabel: x
|
|
374
709
|
};
|
|
375
|
-
if (e.length === 1) return /* @__PURE__ */
|
|
710
|
+
if (e.length === 1) return /* @__PURE__ */ G(at, {
|
|
376
711
|
stages: e,
|
|
377
|
-
isStreaming:
|
|
378
|
-
className:
|
|
712
|
+
isStreaming: t,
|
|
713
|
+
className: r,
|
|
379
714
|
styles: {
|
|
380
|
-
colors:
|
|
381
|
-
typography:
|
|
715
|
+
colors: D,
|
|
716
|
+
typography: i?.typography
|
|
382
717
|
},
|
|
383
|
-
labels:
|
|
718
|
+
labels: A,
|
|
719
|
+
onAttachmentClick: a
|
|
384
720
|
});
|
|
385
|
-
let
|
|
386
|
-
if (
|
|
387
|
-
let t =
|
|
388
|
-
|
|
721
|
+
let j = e.some((e) => e.status === o.Failed), M = Ae(e.map((e) => e.name)), N = M > 0 ? Oe(M) : void 0, P;
|
|
722
|
+
if (t) {
|
|
723
|
+
let t = J((je(e) ?? e[e.length - 1]).name).name;
|
|
724
|
+
P = /* @__PURE__ */ K("span", {
|
|
389
725
|
role: "status",
|
|
390
726
|
"aria-live": "polite",
|
|
391
727
|
className: "flex min-w-0 items-center gap-2",
|
|
392
|
-
children: [
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
ariaLabel: T
|
|
398
|
-
})
|
|
399
|
-
}),
|
|
400
|
-
/* @__PURE__ */ C("span", {
|
|
401
|
-
className: i("flex-none whitespace-nowrap", I.fontClassName, J.liveName),
|
|
402
|
-
children: S(t, e.length)
|
|
403
|
-
}),
|
|
404
|
-
n && /* @__PURE__ */ C("span", {
|
|
405
|
-
className: i("min-w-0 max-w-[22rem] truncate", I.fontClassName, J.executedLabel),
|
|
406
|
-
children: /* @__PURE__ */ C(c, { text: n })
|
|
728
|
+
children: [/* @__PURE__ */ G("span", {
|
|
729
|
+
className: "flex flex-none items-center",
|
|
730
|
+
children: /* @__PURE__ */ G(y, {
|
|
731
|
+
size: 14,
|
|
732
|
+
ariaLabel: g
|
|
407
733
|
})
|
|
408
|
-
|
|
734
|
+
}), t && /* @__PURE__ */ G("span", {
|
|
735
|
+
className: c("min-w-0 max-w-[22rem] truncate", O.fontClassName, $.liveName),
|
|
736
|
+
children: /* @__PURE__ */ G(h, { text: t })
|
|
737
|
+
})]
|
|
409
738
|
});
|
|
410
|
-
} else if (
|
|
411
|
-
let
|
|
412
|
-
|
|
739
|
+
} else if (j) {
|
|
740
|
+
let t = e.filter((e) => e.status === o.Failed).length;
|
|
741
|
+
P = /* @__PURE__ */ K("span", {
|
|
413
742
|
className: "inline-flex items-center gap-1",
|
|
414
743
|
children: [
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
className:
|
|
744
|
+
/* @__PURE__ */ K("span", {
|
|
745
|
+
className: c(O.fontClassName, $.executedLabel),
|
|
417
746
|
children: [
|
|
418
|
-
|
|
747
|
+
l,
|
|
419
748
|
" ",
|
|
420
749
|
e.length,
|
|
421
750
|
" ",
|
|
422
|
-
|
|
751
|
+
u(e.length)
|
|
423
752
|
]
|
|
424
753
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
className:
|
|
427
|
-
children:
|
|
754
|
+
/* @__PURE__ */ G("span", {
|
|
755
|
+
className: c(O.fontClassName, $.failedText),
|
|
756
|
+
children: m(t)
|
|
428
757
|
}),
|
|
429
|
-
|
|
430
|
-
className:
|
|
431
|
-
children:
|
|
758
|
+
N && /* @__PURE__ */ G("span", {
|
|
759
|
+
className: c(O.fontClassName, $.stepsCount),
|
|
760
|
+
children: N
|
|
432
761
|
})
|
|
433
762
|
]
|
|
434
763
|
});
|
|
435
|
-
} else
|
|
764
|
+
} else P = /* @__PURE__ */ K("span", {
|
|
436
765
|
className: "inline-flex items-center gap-1",
|
|
437
766
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
size:
|
|
440
|
-
className:
|
|
767
|
+
/* @__PURE__ */ G(S, {
|
|
768
|
+
size: f.SM,
|
|
769
|
+
className: $.doneIcon,
|
|
441
770
|
"aria-hidden": !0,
|
|
442
|
-
stroke:
|
|
771
|
+
stroke: p
|
|
443
772
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
className:
|
|
773
|
+
/* @__PURE__ */ K("span", {
|
|
774
|
+
className: c(O.fontClassName, $.executedLabel),
|
|
446
775
|
children: [
|
|
447
|
-
|
|
776
|
+
l,
|
|
448
777
|
" ",
|
|
449
778
|
e.length,
|
|
450
779
|
" ",
|
|
451
|
-
|
|
780
|
+
u(e.length)
|
|
452
781
|
]
|
|
453
782
|
}),
|
|
454
|
-
|
|
455
|
-
className:
|
|
456
|
-
children:
|
|
783
|
+
N && /* @__PURE__ */ G("span", {
|
|
784
|
+
className: c(O.fontClassName, $.stepsCount),
|
|
785
|
+
children: N
|
|
457
786
|
})
|
|
458
787
|
]
|
|
459
788
|
});
|
|
460
|
-
return /* @__PURE__ */
|
|
461
|
-
style:
|
|
462
|
-
className:
|
|
463
|
-
children:
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
"
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
className: i("grid transition-[grid-template-rows] duration-300 ease-in-out", k ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
481
|
-
children: /* @__PURE__ */ C("div", {
|
|
482
|
-
className: "overflow-hidden",
|
|
483
|
-
children: /* @__PURE__ */ C(q, {
|
|
484
|
-
stages: e,
|
|
485
|
-
isStreaming: r,
|
|
486
|
-
styles: {
|
|
487
|
-
colors: P,
|
|
488
|
-
typography: f?.typography
|
|
489
|
-
},
|
|
490
|
-
labels: V,
|
|
491
|
-
className: "pt-1"
|
|
492
|
-
})
|
|
789
|
+
return /* @__PURE__ */ G("div", {
|
|
790
|
+
style: k,
|
|
791
|
+
className: c("flex w-full flex-col gap-1", r, q.group),
|
|
792
|
+
children: /* @__PURE__ */ G(d, {
|
|
793
|
+
title: P,
|
|
794
|
+
expanded: C,
|
|
795
|
+
onToggle: w,
|
|
796
|
+
className: "overflow-visible py-0",
|
|
797
|
+
headerClassName: c("justify-start gap-1 rounded-none px-0", $.toggleButton, q.groupToggle),
|
|
798
|
+
contentClassName: c("-mt-2 px-0", $.groupRegion),
|
|
799
|
+
children: /* @__PURE__ */ G(at, {
|
|
800
|
+
stages: e,
|
|
801
|
+
isStreaming: t,
|
|
802
|
+
styles: {
|
|
803
|
+
colors: D,
|
|
804
|
+
typography: i?.typography
|
|
805
|
+
},
|
|
806
|
+
labels: A,
|
|
807
|
+
className: "pt-1",
|
|
808
|
+
onAttachmentClick: a
|
|
493
809
|
})
|
|
494
|
-
})
|
|
810
|
+
})
|
|
495
811
|
});
|
|
496
812
|
};
|
|
497
813
|
//#endregion
|
|
498
|
-
export {
|
|
814
|
+
export { q as CONVERSATION_STAGES_CLASS, ot as CollapsedGroup, at as StagesPanel };
|