@epam/ai-dial-conversation-messages 1.1.0-dev.18 → 1.1.0-dev.182
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/MessageActions/MessageActions.d.ts.map +1 -1
- package/components/MessageBubble/AssistantMessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/StatusMessageBubble.d.ts +1 -5
- package/components/MessageBubble/StatusMessageBubble.d.ts.map +1 -1
- package/components/MessageBubble/UserMessageBubble.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +0 -1
- package/index.d.ts.map +1 -1
- package/index.js +465 -597
- package/models/message-actions.d.ts +29 -22
- package/models/message-actions.d.ts.map +1 -1
- package/models/message-bubble.d.ts +41 -69
- package/models/message-bubble.d.ts.map +1 -1
- package/models/message-source.d.ts +8 -8
- package/models/message-source.d.ts.map +1 -1
- package/package.json +5 -5
- package/types/bubble-position.d.ts +3 -3
- package/types/bubble-position.d.ts.map +1 -1
- package/components/MessageSource/MessageSource.d.ts +0 -5
- package/components/MessageSource/MessageSource.d.ts.map +0 -1
package/index.js
CHANGED
|
@@ -1,286 +1,234 @@
|
|
|
1
|
-
import { AttachmentErrorReason as e, AttachmentType as t,
|
|
2
|
-
import { DIAL_ICON_SIZE as p,
|
|
3
|
-
import {
|
|
1
|
+
import { AttachmentErrorReason as e, AttachmentType as t, CopyIconButton as n, DeploymentIcon as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { DIAL_ICON_SIZE as p, DialRadioGroup as m, DialSlider as h, DialTooltip as g, ElementSize as _, GhostIconButton as v, Highlight as y, InfoMessageNotification as b, Input as x, LinkButton as S, NeutralButton as C, Popup as w, PopupSize as T, PrimaryButton as E, RadioGroupOrientation as D, Skeleton as O, SkeletonVariant as k, Spinner as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconChevronDown as M, IconChevronUp as N, IconClipboard as P, IconDownload as F, IconExternalLink as I, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as V, IconFileTypeDocx as H, IconFileTypeHtml as U, IconFileTypeJpg as W, IconFileTypeJs as ee, IconFileTypeJsx as te, IconFileTypePdf as ne, IconFileTypePhp as re, IconFileTypePng as ie, IconFileTypePpt as ae, IconFileTypeRs as oe, IconFileTypeSql as se, IconFileTypeSvg as ce, IconFileTypeTs as le, IconFileTypeTsx as ue, IconFileTypeTxt as de, IconFileTypeVue as fe, IconFileTypeXls as pe, IconFileTypeXml as me, IconFileTypeZip as he, IconMarkdown as ge, IconMusic as _e, IconPaperclip as ve, IconPencilMinus as ye, IconPhoto as G, IconRefresh as be, IconReload as xe, IconTerminal2 as Se, IconThumbDown as Ce, IconThumbUp as we, IconTrashX as Te, IconVideo as Ee, IconX as De } from "@tabler/icons-react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
import { memo as
|
|
6
|
-
import { Fragment as
|
|
5
|
+
import { memo as Oe, useCallback as K, useEffect as ke, useId as Ae, useMemo as je, useRef as Me, useState as q } from "react";
|
|
6
|
+
import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
|
|
7
7
|
//#region ../attachment-input/dist/index.js
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
}({}), Ie = (e) => {
|
|
8
|
+
var Ne = (e) => {
|
|
9
|
+
if (e == null) return "";
|
|
11
10
|
let t = e.lastIndexOf(".");
|
|
12
11
|
return t > 0 ? e.slice(0, t) : e;
|
|
13
|
-
},
|
|
12
|
+
}, Pe = (e) => {
|
|
14
13
|
if (!e) return L;
|
|
15
14
|
if (e.startsWith("image/")) switch (e) {
|
|
16
15
|
case "image/jpeg":
|
|
17
|
-
case "image/jpg": return
|
|
18
|
-
case "image/png": return
|
|
19
|
-
case "image/svg+xml": return
|
|
16
|
+
case "image/jpg": return W;
|
|
17
|
+
case "image/png": return ie;
|
|
18
|
+
case "image/svg+xml": return ce;
|
|
20
19
|
case "image/bmp": return R;
|
|
21
|
-
default: return
|
|
20
|
+
default: return G;
|
|
22
21
|
}
|
|
23
|
-
if (e.startsWith("video/")) return
|
|
24
|
-
if (e.startsWith("audio/")) return
|
|
22
|
+
if (e.startsWith("video/")) return Ee;
|
|
23
|
+
if (e.startsWith("audio/")) return _e;
|
|
25
24
|
switch (e) {
|
|
26
|
-
case "application/pdf": return
|
|
25
|
+
case "application/pdf": return ne;
|
|
27
26
|
case "application/msword":
|
|
28
27
|
case "application/vnd.ms-word": return V;
|
|
29
|
-
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return
|
|
30
|
-
case "application/vnd.ms-powerpoint": return
|
|
31
|
-
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return
|
|
32
|
-
case "application/vnd.ms-excel": return
|
|
33
|
-
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return
|
|
28
|
+
case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return H;
|
|
29
|
+
case "application/vnd.ms-powerpoint": return ae;
|
|
30
|
+
case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ae;
|
|
31
|
+
case "application/vnd.ms-excel": return pe;
|
|
32
|
+
case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return pe;
|
|
34
33
|
case "application/zip":
|
|
35
34
|
case "application/x-zip-compressed":
|
|
36
35
|
case "application/x-rar-compressed":
|
|
37
36
|
case "application/x-7z-compressed":
|
|
38
37
|
case "application/gzip":
|
|
39
|
-
case "application/x-tar": return
|
|
38
|
+
case "application/x-tar": return he;
|
|
40
39
|
case "text/csv": return B;
|
|
41
|
-
case "text/plain": return
|
|
40
|
+
case "text/plain": return de;
|
|
42
41
|
case "text/html":
|
|
43
|
-
case "application/xhtml+xml": return
|
|
42
|
+
case "application/xhtml+xml": return U;
|
|
44
43
|
case "text/xml":
|
|
45
|
-
case "application/xml": return
|
|
44
|
+
case "application/xml": return me;
|
|
46
45
|
case "application/sql":
|
|
47
|
-
case "text/x-sql": return
|
|
46
|
+
case "text/x-sql": return se;
|
|
48
47
|
case "text/javascript":
|
|
49
|
-
case "application/javascript": return
|
|
50
|
-
case "text/jsx": return
|
|
48
|
+
case "application/javascript": return ee;
|
|
49
|
+
case "text/jsx": return te;
|
|
51
50
|
case "application/typescript":
|
|
52
|
-
case "text/typescript": return
|
|
53
|
-
case "text/tsx": return
|
|
51
|
+
case "text/typescript": return le;
|
|
52
|
+
case "text/tsx": return ue;
|
|
54
53
|
case "text/css": return z;
|
|
55
54
|
case "text/x-php":
|
|
56
|
-
case "application/x-php": return
|
|
55
|
+
case "application/x-php": return re;
|
|
57
56
|
case "text/x-rustsrc":
|
|
58
|
-
case "application/x-rust": return
|
|
59
|
-
case "text/x-vue": return
|
|
57
|
+
case "application/x-rust": return oe;
|
|
58
|
+
case "text/x-vue": return fe;
|
|
60
59
|
default: return L;
|
|
61
60
|
}
|
|
62
|
-
},
|
|
61
|
+
}, Fe = (e) => {
|
|
63
62
|
let { type: n, contentType: r } = e;
|
|
64
|
-
return n === t.Prompt ?
|
|
65
|
-
},
|
|
63
|
+
return n === t.Prompt ? Se : n === t.Pasted ? P : n === t.Image ? G : Pe(r ?? "");
|
|
64
|
+
}, Ie = (e) => {
|
|
66
65
|
let t = e.toLowerCase().split(";")[0].trim(), n = a[t];
|
|
67
66
|
if (n) return n;
|
|
68
67
|
let r = t.split("/")[1];
|
|
69
68
|
if (r && !r.startsWith("vnd.") && !r.includes("+")) return r;
|
|
70
|
-
},
|
|
69
|
+
}, Le = (e, n) => {
|
|
71
70
|
let { type: r, name: i, contentType: a } = e;
|
|
72
71
|
if (r === t.Prompt) return n.promptLabel ?? "Prompt";
|
|
73
72
|
if (r === t.Pasted) return n.pastedLabel ?? "Pasted";
|
|
74
73
|
if (r === t.Image) return n.imageLabel ?? "Image";
|
|
75
74
|
if (a) {
|
|
76
|
-
let e =
|
|
75
|
+
let e = Ie(a);
|
|
77
76
|
if (e) return `.${e}`;
|
|
78
77
|
}
|
|
79
78
|
let o = i.lastIndexOf(".");
|
|
80
79
|
return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
|
|
81
|
-
},
|
|
82
|
-
let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.
|
|
80
|
+
}, Re = (e, n = {}) => {
|
|
81
|
+
let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Link && !l;
|
|
83
82
|
return {
|
|
84
83
|
isLoading: s,
|
|
85
84
|
isError: l,
|
|
86
85
|
isImage: u,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
typeLabel: f ? null : Be(e, n)
|
|
86
|
+
isLink: d,
|
|
87
|
+
BottomIcon: d ? null : Fe(e),
|
|
88
|
+
typeLabel: d ? null : Le(e, n)
|
|
91
89
|
};
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}, X = {
|
|
105
|
-
tile: "_tile_3x6ks_1",
|
|
106
|
-
tileLight: "_tileLight_3x6ks_12",
|
|
107
|
-
tileError: "_tileError_3x6ks_16",
|
|
108
|
-
nameText: "_nameText_3x6ks_23",
|
|
109
|
-
typeText: "_typeText_3x6ks_24",
|
|
110
|
-
retryIcon: "_retryIcon_3x6ks_36",
|
|
111
|
-
hoverIcon: "_hoverIcon_3x6ks_40",
|
|
112
|
-
track: "_track_3x6ks_48",
|
|
113
|
-
indeterminateFill: "_indeterminateFill_3x6ks_52",
|
|
114
|
-
"attachment-tile-indeterminate": "_attachment-tile-indeterminate_3x6ks_1"
|
|
115
|
-
}, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(m, {
|
|
90
|
+
}, ze = "flex size-[84px] items-center justify-center rounded-xl border", Z = {
|
|
91
|
+
tile: "_tile_3jao2_1",
|
|
92
|
+
hovered: "_hovered_3jao2_5",
|
|
93
|
+
selected: "_selected_3jao2_15",
|
|
94
|
+
tileError: "_tileError_3jao2_20",
|
|
95
|
+
nameText: "_nameText_3jao2_25",
|
|
96
|
+
typeText: "_typeText_3jao2_29",
|
|
97
|
+
retryIcon: "_retryIcon_3jao2_33",
|
|
98
|
+
track: "_track_3jao2_37",
|
|
99
|
+
actionButton: "_actionButton_3jao2_43",
|
|
100
|
+
imageActionButton: "_imageActionButton_3jao2_47"
|
|
101
|
+
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(j, {
|
|
116
102
|
icon: a,
|
|
117
|
-
size:
|
|
118
|
-
className: d("absolute end-1 top-1
|
|
103
|
+
size: _.Small,
|
|
104
|
+
className: d("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o),
|
|
119
105
|
"aria-label": e,
|
|
120
106
|
"aria-describedby": t ? n : void 0,
|
|
121
107
|
onClick: (e) => {
|
|
122
108
|
e.stopPropagation(), r(i);
|
|
123
109
|
}
|
|
124
|
-
}),
|
|
125
|
-
icon: /* @__PURE__ */
|
|
110
|
+
}), Be = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
111
|
+
icon: /* @__PURE__ */ Y(xe, {
|
|
126
112
|
size: p.SM,
|
|
127
113
|
"aria-hidden": !0
|
|
128
114
|
}),
|
|
129
|
-
className:
|
|
115
|
+
className: Z.retryIcon,
|
|
130
116
|
...e
|
|
131
|
-
}),
|
|
132
|
-
icon: /* @__PURE__ */
|
|
117
|
+
}), Ve = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
118
|
+
icon: /* @__PURE__ */ Y(F, {
|
|
133
119
|
size: p.SM,
|
|
134
120
|
"aria-hidden": !0
|
|
135
121
|
}),
|
|
136
122
|
...e
|
|
137
|
-
}),
|
|
138
|
-
icon: /* @__PURE__ */
|
|
123
|
+
}), He = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
124
|
+
icon: /* @__PURE__ */ Y(I, {
|
|
139
125
|
size: p.SM,
|
|
140
126
|
"aria-hidden": !0
|
|
141
127
|
}),
|
|
142
128
|
...e
|
|
143
|
-
}),
|
|
144
|
-
icon: /* @__PURE__ */
|
|
129
|
+
}), Ue = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
130
|
+
icon: /* @__PURE__ */ Y(De, {
|
|
145
131
|
size: p.SM,
|
|
146
132
|
"aria-hidden": !0
|
|
147
133
|
}),
|
|
148
|
-
className: X.hoverIcon,
|
|
149
134
|
...e
|
|
150
|
-
}),
|
|
151
|
-
let { clickLabel: l = "Open attachment", downloadLabel: u = "Download attachment", removeLabel: f = "Remove attachment" } = o ?? {}, { typography: p, className: m } = s ?? {}, h = () => {
|
|
152
|
-
n?.(e.id);
|
|
153
|
-
};
|
|
154
|
-
return /* @__PURE__ */ J("div", {
|
|
155
|
-
style: c,
|
|
156
|
-
...n == null ? {} : {
|
|
157
|
-
role: "button",
|
|
158
|
-
tabIndex: 0,
|
|
159
|
-
"aria-label": l,
|
|
160
|
-
onClick: h,
|
|
161
|
-
onKeyDown: (e) => {
|
|
162
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
className: d("group relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", n && "cursor-pointer", (i || a) && "pe-8", m),
|
|
166
|
-
children: [
|
|
167
|
-
/* @__PURE__ */ q("span", {
|
|
168
|
-
title: e.name,
|
|
169
|
-
className: d(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
|
|
170
|
-
children: t ? /* @__PURE__ */ q(r, {
|
|
171
|
-
text: e.name,
|
|
172
|
-
query: t,
|
|
173
|
-
maxLines: 1
|
|
174
|
-
}) : e.name
|
|
175
|
-
}),
|
|
176
|
-
e.playUrl && /* @__PURE__ */ q("audio", {
|
|
177
|
-
controls: !0,
|
|
178
|
-
src: e.playUrl,
|
|
179
|
-
"aria-label": e.name,
|
|
180
|
-
className: "w-full",
|
|
181
|
-
preload: "metadata",
|
|
182
|
-
onClick: (e) => e.stopPropagation()
|
|
183
|
-
}),
|
|
184
|
-
i && /* @__PURE__ */ q(We, {
|
|
185
|
-
ariaLabel: u,
|
|
186
|
-
onClick: i,
|
|
187
|
-
id: e.id
|
|
188
|
-
}),
|
|
189
|
-
a && /* @__PURE__ */ q(Ke, {
|
|
190
|
-
ariaLabel: f,
|
|
191
|
-
onClick: a,
|
|
192
|
-
id: e.id
|
|
193
|
-
})
|
|
194
|
-
]
|
|
195
|
-
});
|
|
196
|
-
}, Je = {
|
|
135
|
+
}), We = {
|
|
197
136
|
[e.Network]: "Upload failed · network error",
|
|
198
137
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
199
|
-
},
|
|
200
|
-
let { clickLabel:
|
|
201
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
202
|
-
},
|
|
138
|
+
}, Ge = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: a, styles: o, onDownload: s, isPasted: l, isLink: u, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: g }) => {
|
|
139
|
+
let { clickLabel: _ = "Download attachment", retryLabel: v = "Retry upload", sizeLabel: b, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: w, className: T } = o ?? {}, { id: E, name: D, status: O, errorReason: k } = t, j = O === c.Loading, M = O === c.Error, N = Ae(), P = M ? k && (S?.[k] ?? We[k]) || C : "", { BottomIcon: F, typeLabel: I } = Re(t), L = !M && !j && s && !u, R = M && !!i && k !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
|
|
140
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
141
|
+
}, V = je(() => l ? D : Ne(D), [l, D]), H = K(() => {
|
|
203
142
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
204
|
-
}, [t]),
|
|
205
|
-
title:
|
|
206
|
-
className: d(
|
|
207
|
-
children:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
143
|
+
}, [t]), U = d(ze, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !M && Z.hovered, g && Z.selected, M && Z.tileError), W = /* @__PURE__ */ Y("div", {
|
|
144
|
+
title: V,
|
|
145
|
+
className: d(w?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !M && z),
|
|
146
|
+
children: n ? /* @__PURE__ */ Y(y, {
|
|
147
|
+
text: V,
|
|
148
|
+
query: n,
|
|
149
|
+
maxLines: 2
|
|
150
|
+
}) : V
|
|
151
|
+
}), ee = F && /* @__PURE__ */ X("div", {
|
|
152
|
+
className: d("flex w-full items-center gap-1", M && z),
|
|
153
|
+
children: [/* @__PURE__ */ Y(F, {
|
|
211
154
|
size: 16,
|
|
212
|
-
className:
|
|
155
|
+
className: Z.typeText,
|
|
213
156
|
"aria-hidden": !0
|
|
214
|
-
}), /* @__PURE__ */
|
|
215
|
-
className: d(
|
|
216
|
-
children:
|
|
157
|
+
}), /* @__PURE__ */ Y("span", {
|
|
158
|
+
className: d(w?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
|
|
159
|
+
children: b ? `${I} · ${b}` : I
|
|
217
160
|
})]
|
|
218
161
|
}), te = () => {
|
|
219
|
-
|
|
220
|
-
}, ne = /* @__PURE__ */ J
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
"aria-label":
|
|
225
|
-
className: d("absolute
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
-
}),
|
|
228
|
-
P && /* @__PURE__ */ q(We, {
|
|
229
|
-
ariaLabel: h,
|
|
230
|
-
errorTitle: j,
|
|
231
|
-
errorDescId: A,
|
|
232
|
-
onClick: o,
|
|
233
|
-
id: w
|
|
234
|
-
}),
|
|
235
|
-
F && /* @__PURE__ */ q(Ue, {
|
|
236
|
-
ariaLabel: g,
|
|
237
|
-
errorTitle: j,
|
|
238
|
-
errorDescId: A,
|
|
239
|
-
onClick: r,
|
|
240
|
-
id: w
|
|
162
|
+
m && p ? p(E) : r && r(E);
|
|
163
|
+
}, ne = /* @__PURE__ */ X(J, { children: [
|
|
164
|
+
W,
|
|
165
|
+
ee,
|
|
166
|
+
j && /* @__PURE__ */ Y("div", {
|
|
167
|
+
"aria-label": x,
|
|
168
|
+
className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
|
|
169
|
+
children: /* @__PURE__ */ Y(A, { size: 32 })
|
|
241
170
|
}),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
171
|
+
/* @__PURE__ */ X("div", {
|
|
172
|
+
className: d("absolute right-0 top-0 flex gap-1"),
|
|
173
|
+
children: [
|
|
174
|
+
L && /* @__PURE__ */ Y(Ve, {
|
|
175
|
+
ariaLabel: _,
|
|
176
|
+
errorTitle: P,
|
|
177
|
+
errorDescId: N,
|
|
178
|
+
onClick: s,
|
|
179
|
+
id: E
|
|
180
|
+
}),
|
|
181
|
+
R && /* @__PURE__ */ Y(Be, {
|
|
182
|
+
ariaLabel: v,
|
|
183
|
+
errorTitle: P,
|
|
184
|
+
errorDescId: N,
|
|
185
|
+
onClick: i,
|
|
186
|
+
id: E
|
|
187
|
+
}),
|
|
188
|
+
u && /* @__PURE__ */ Y(He, {
|
|
189
|
+
ariaLabel: v,
|
|
190
|
+
errorTitle: P,
|
|
191
|
+
errorDescId: N,
|
|
192
|
+
onClick: H
|
|
193
|
+
}),
|
|
194
|
+
h && /* @__PURE__ */ Y(Ue, {
|
|
195
|
+
ariaLabel: v,
|
|
196
|
+
errorTitle: P,
|
|
197
|
+
errorDescId: N,
|
|
198
|
+
onClick: h,
|
|
199
|
+
id: E
|
|
200
|
+
})
|
|
201
|
+
]
|
|
254
202
|
}),
|
|
255
|
-
|
|
256
|
-
id:
|
|
203
|
+
M && /* @__PURE__ */ Y("span", {
|
|
204
|
+
id: N,
|
|
257
205
|
role: "status",
|
|
258
206
|
"aria-live": "polite",
|
|
259
207
|
className: "sr-only",
|
|
260
|
-
children:
|
|
208
|
+
children: P
|
|
261
209
|
})
|
|
262
210
|
] });
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
style:
|
|
265
|
-
className: d("inline-flex",
|
|
266
|
-
children: /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ Y("div", {
|
|
212
|
+
style: f,
|
|
213
|
+
className: d("inline-flex", T),
|
|
214
|
+
children: /* @__PURE__ */ Y("div", {
|
|
267
215
|
role: "button",
|
|
268
216
|
tabIndex: 0,
|
|
269
|
-
"aria-label":
|
|
217
|
+
"aria-label": _,
|
|
270
218
|
onClick: te,
|
|
271
|
-
onKeyDown:
|
|
272
|
-
style:
|
|
273
|
-
className: d(
|
|
219
|
+
onKeyDown: B,
|
|
220
|
+
style: f,
|
|
221
|
+
className: d(U, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
274
222
|
children: ne
|
|
275
223
|
})
|
|
276
224
|
});
|
|
277
|
-
},
|
|
225
|
+
}, Ke = /* @__PURE__ */ function(e) {
|
|
278
226
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
279
|
-
}({}),
|
|
280
|
-
let n =
|
|
281
|
-
return
|
|
227
|
+
}({}), qe = ({ enabled: e, src: t }) => {
|
|
228
|
+
let n = Me(null), [r, i] = q("idle");
|
|
229
|
+
return ke(() => {
|
|
282
230
|
i(e && t ? "loading" : "idle");
|
|
283
|
-
}, [e, t]),
|
|
231
|
+
}, [e, t]), ke(() => {
|
|
284
232
|
let r = n.current;
|
|
285
233
|
if (!r || !e || !t) return;
|
|
286
234
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -291,240 +239,169 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
291
239
|
imageRef: n,
|
|
292
240
|
imageLoadStatus: r
|
|
293
241
|
};
|
|
294
|
-
},
|
|
295
|
-
let { clickLabel:
|
|
242
|
+
}, Je = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
|
|
243
|
+
let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = je(() => Re(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = qe({
|
|
296
244
|
enabled: x,
|
|
297
245
|
src: _
|
|
298
|
-
}),
|
|
299
|
-
v && n ? n(h) :
|
|
246
|
+
}), T = () => {
|
|
247
|
+
v && n ? n(h) : S && r && r(h);
|
|
300
248
|
};
|
|
301
|
-
return /* @__PURE__ */
|
|
302
|
-
className: d(
|
|
303
|
-
onClick:
|
|
249
|
+
return /* @__PURE__ */ Y("div", {
|
|
250
|
+
className: d(ze, "group/attachment-tile", S && "cursor-pointer", Z.tile, l && Z.selected, m),
|
|
251
|
+
onClick: T,
|
|
304
252
|
onKeyDown: (e) => {
|
|
305
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
253
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), T());
|
|
306
254
|
},
|
|
307
255
|
tabIndex: 0,
|
|
308
256
|
role: "button",
|
|
309
257
|
style: o,
|
|
310
|
-
"aria-label":
|
|
311
|
-
children: /* @__PURE__ */
|
|
258
|
+
"aria-label": S ? u : v ? f : void 0,
|
|
259
|
+
children: /* @__PURE__ */ X("div", {
|
|
312
260
|
className: "relative h-full w-full overflow-hidden",
|
|
313
261
|
children: [
|
|
314
|
-
a && /* @__PURE__ */
|
|
262
|
+
a && /* @__PURE__ */ Y(Ue, {
|
|
315
263
|
onClick: a,
|
|
316
|
-
id: h
|
|
264
|
+
id: h,
|
|
265
|
+
className: Z.imageActionButton
|
|
317
266
|
}),
|
|
318
|
-
s && /* @__PURE__ */
|
|
267
|
+
s && /* @__PURE__ */ Y(Ve, {
|
|
319
268
|
onClick: s,
|
|
320
|
-
id: h
|
|
269
|
+
id: h,
|
|
270
|
+
className: Z.imageActionButton
|
|
321
271
|
}),
|
|
322
|
-
|
|
323
|
-
variant:
|
|
272
|
+
w !== Ke.Loaded && /* @__PURE__ */ Y(O, {
|
|
273
|
+
variant: k.Rectangular,
|
|
324
274
|
width: "100%",
|
|
325
275
|
height: "100%",
|
|
326
|
-
active:
|
|
327
|
-
overlay: /* @__PURE__ */
|
|
276
|
+
active: w === Ke.Loading,
|
|
277
|
+
overlay: /* @__PURE__ */ Y(G, {
|
|
328
278
|
size: p.LG,
|
|
329
|
-
className:
|
|
279
|
+
className: Z.typeText,
|
|
330
280
|
"aria-hidden": !0
|
|
331
281
|
}),
|
|
332
282
|
className: "absolute inset-0 rounded-xl"
|
|
333
283
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
ref:
|
|
284
|
+
/* @__PURE__ */ Y("img", {
|
|
285
|
+
ref: C,
|
|
336
286
|
src: _,
|
|
337
287
|
alt: g,
|
|
338
288
|
loading: "lazy",
|
|
339
289
|
decoding: "async",
|
|
340
|
-
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200",
|
|
290
|
+
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === Ke.Loaded ? "opacity-100" : "opacity-0")
|
|
341
291
|
})
|
|
342
292
|
]
|
|
343
293
|
})
|
|
344
294
|
});
|
|
345
|
-
},
|
|
346
|
-
let { colors:
|
|
347
|
-
"--
|
|
348
|
-
"--
|
|
349
|
-
"--
|
|
350
|
-
"--
|
|
351
|
-
"--
|
|
352
|
-
"--
|
|
353
|
-
"--
|
|
354
|
-
"--
|
|
355
|
-
"--
|
|
356
|
-
"--
|
|
357
|
-
"--
|
|
358
|
-
"--
|
|
359
|
-
"--
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
onClick: o,
|
|
365
|
-
onDownload: s,
|
|
366
|
-
onRemove: r,
|
|
367
|
-
searchQuery: n,
|
|
368
|
-
styles: l,
|
|
369
|
-
cssVars: m
|
|
370
|
-
}) : h ? /* @__PURE__ */ q(Qe, {
|
|
295
|
+
}, Ye = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l, isSelected: d }) => {
|
|
296
|
+
let { colors: f } = l ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = u({
|
|
297
|
+
"--ai-tile-bg": f?.background,
|
|
298
|
+
"--ai-tile-border": f?.border,
|
|
299
|
+
"--ai-tile-bg-hover": f?.backgroundHover,
|
|
300
|
+
"--ai-tile-border-hover": f?.borderHover,
|
|
301
|
+
"--ai-tile-bg-selected": f?.backgroundSelected,
|
|
302
|
+
"--ai-tile-border-selected": f?.borderSelected,
|
|
303
|
+
"--ai-tile-focus-outline": f?.focusOutline,
|
|
304
|
+
"--ai-tile-bg-error": f?.backgroundError,
|
|
305
|
+
"--ai-tile-border-error": f?.borderError,
|
|
306
|
+
"--ai-tile-error-text": f?.errorText,
|
|
307
|
+
"--ai-tile-name-text": f?.nameText,
|
|
308
|
+
"--ai-tile-type-text": f?.typeText,
|
|
309
|
+
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
310
|
+
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
311
|
+
"--ai-tile-progress-track": f?.trackBackground
|
|
312
|
+
}), { isImage: g, isLink: _ } = je(() => Re(e), [e]);
|
|
313
|
+
return g ? /* @__PURE__ */ Y(Je, {
|
|
371
314
|
attachment: e,
|
|
372
315
|
labels: c,
|
|
373
316
|
onClick: o,
|
|
374
317
|
onExpand: a,
|
|
375
318
|
styles: l,
|
|
376
319
|
onRemove: r,
|
|
377
|
-
cssVars:
|
|
378
|
-
onDownload: s
|
|
379
|
-
|
|
320
|
+
cssVars: h,
|
|
321
|
+
onDownload: s,
|
|
322
|
+
isSelected: d
|
|
323
|
+
}) : /* @__PURE__ */ Y(Ge, {
|
|
380
324
|
attachment: e,
|
|
325
|
+
searchQuery: n,
|
|
381
326
|
onClick: o,
|
|
382
327
|
onRetry: i,
|
|
383
328
|
onRemove: r,
|
|
384
329
|
onDownload: s,
|
|
385
330
|
isLink: _,
|
|
386
|
-
isPasted:
|
|
331
|
+
isPasted: p,
|
|
387
332
|
styles: l,
|
|
388
333
|
labels: c,
|
|
389
334
|
onExpand: a,
|
|
390
|
-
cssVars:
|
|
391
|
-
isExpandable:
|
|
335
|
+
cssVars: h,
|
|
336
|
+
isExpandable: m,
|
|
337
|
+
isSelected: d
|
|
392
338
|
});
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
"--ci-more-tile-bg-hover": c?.backgroundHover,
|
|
399
|
-
"--ci-more-tile-color-hover": c?.colorHover,
|
|
400
|
-
"--ci-more-tile-border-hover": c?.borderHover,
|
|
401
|
-
"--ci-more-tile-focus-outline": c?.focusOutline
|
|
402
|
-
});
|
|
403
|
-
return /* @__PURE__ */ q("button", {
|
|
404
|
-
type: "button",
|
|
405
|
-
onClick: t,
|
|
406
|
-
"aria-label": a ?? `Show ${e} more attachments`,
|
|
407
|
-
style: l,
|
|
408
|
-
className: d(Fe, o, et.tile, s),
|
|
409
|
-
children: r ?? /* @__PURE__ */ q("bdi", {
|
|
410
|
-
dir: "ltr",
|
|
411
|
-
children: `+${e}`
|
|
412
|
-
})
|
|
413
|
-
});
|
|
414
|
-
}, Q = {
|
|
415
|
-
container: "_container_7fktb_1",
|
|
416
|
-
headerIcon: "_headerIcon_7fktb_6",
|
|
417
|
-
headerLabel: "_headerLabel_7fktb_7",
|
|
418
|
-
downloadAllButton: "_downloadAllButton_7fktb_8",
|
|
419
|
-
imageTile: "_imageTile_7fktb_12"
|
|
420
|
-
}, nt = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, rt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o }) => {
|
|
421
|
-
let { ariaLabel: s = "Attachments", clickLabel: l = "Download attachment", retryLabel: f = "Retry upload", showLessLabel: h = "Show less", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => nt(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = a ?? {}, { typography: { headerLabelClassName: S = "dial-tiny-semi-text" } = {}, colors: C, className: w } = o ?? {}, T = u({
|
|
422
|
-
"--ci-group-bg": C?.background,
|
|
423
|
-
"--ci-group-border": C?.border,
|
|
424
|
-
"--ci-group-text": C?.text
|
|
425
|
-
}), [E, D] = G(!1), O = W(() => He(e.length, E), [e.length, E]);
|
|
339
|
+
}, Xe = {
|
|
340
|
+
headerIcon: "_headerIcon_1dmgi_1",
|
|
341
|
+
headerLabel: "_headerLabel_1dmgi_2"
|
|
342
|
+
}, Ze = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Qe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: s }) => {
|
|
343
|
+
let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: m = "Retry upload", downloadAllLabel: h = "Download all", openInNewTabLabel: g, getHeaderLabel: y = (e) => Ze(e, "attachment"), promptLabel: b, pastedLabel: x, imageLabel: S } = a ?? {}, { typography: C, colors: w, className: T } = o ?? {}, E = u({ "--ai-group-text": w?.text });
|
|
426
344
|
if (e.length === 0) return null;
|
|
427
|
-
let
|
|
345
|
+
let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? ve : D ? G : L, M = y(e.length), N = () => {
|
|
428
346
|
let t = e.filter((e) => e.status === c.Idle);
|
|
429
347
|
r ? r(t) : t.forEach((e) => n?.(e.id));
|
|
430
|
-
},
|
|
348
|
+
}, P = (t) => {
|
|
431
349
|
let n = e.find((e) => e.id === t);
|
|
432
350
|
n && r?.([n]);
|
|
433
351
|
};
|
|
434
|
-
return /* @__PURE__ */
|
|
352
|
+
return /* @__PURE__ */ X("div", {
|
|
435
353
|
role: "group",
|
|
436
|
-
"aria-label":
|
|
437
|
-
style:
|
|
438
|
-
className: d("
|
|
439
|
-
children: [/* @__PURE__ */
|
|
440
|
-
className: "
|
|
441
|
-
children: [
|
|
442
|
-
|
|
354
|
+
"aria-label": l,
|
|
355
|
+
style: E,
|
|
356
|
+
className: d("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Xe.container, T),
|
|
357
|
+
children: [/* @__PURE__ */ X("div", {
|
|
358
|
+
className: "flex items-center justify-between",
|
|
359
|
+
children: [/* @__PURE__ */ X("div", {
|
|
360
|
+
className: "flex items-center gap-1",
|
|
361
|
+
children: [/* @__PURE__ */ Y(j, {
|
|
362
|
+
size: p.SM,
|
|
363
|
+
className: d("shrink-0", Xe.headerIcon),
|
|
364
|
+
"aria-hidden": !0
|
|
365
|
+
}), /* @__PURE__ */ Y("span", {
|
|
366
|
+
className: d(C?.headerLabelClassName ?? "dial-tiny-semi-text", Xe.headerLabel),
|
|
367
|
+
children: M
|
|
368
|
+
})]
|
|
369
|
+
}), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(v, {
|
|
370
|
+
icon: /* @__PURE__ */ Y(F, {
|
|
443
371
|
size: p.SM,
|
|
444
|
-
className: d("shrink-0", Q.headerIcon),
|
|
445
372
|
"aria-hidden": !0
|
|
446
373
|
}),
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
icon: /* @__PURE__ */ q(F, {
|
|
453
|
-
size: p.SM,
|
|
454
|
-
"aria-hidden": !0
|
|
455
|
-
}),
|
|
456
|
-
className: d("ms-auto h-6 w-6 rounded-lg", Q.downloadAllButton),
|
|
457
|
-
"aria-label": g,
|
|
458
|
-
onClick: z
|
|
459
|
-
})
|
|
460
|
-
]
|
|
461
|
-
}), /* @__PURE__ */ J("div", {
|
|
374
|
+
size: _.Small,
|
|
375
|
+
"aria-label": h,
|
|
376
|
+
onClick: N
|
|
377
|
+
})]
|
|
378
|
+
}), /* @__PURE__ */ Y("div", {
|
|
462
379
|
role: "list",
|
|
463
|
-
"aria-label":
|
|
464
|
-
className: d("gap-3",
|
|
465
|
-
children:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
})
|
|
482
|
-
}, e.id)),
|
|
483
|
-
O.layout === Y.Collapsed && /* @__PURE__ */ q("div", {
|
|
484
|
-
role: "listitem",
|
|
485
|
-
children: /* @__PURE__ */ q(tt, {
|
|
486
|
-
count: O.hiddenCount,
|
|
487
|
-
onClick: () => D(!0)
|
|
488
|
-
})
|
|
489
|
-
}),
|
|
490
|
-
N && E && /* @__PURE__ */ q("div", {
|
|
491
|
-
role: "listitem",
|
|
492
|
-
children: /* @__PURE__ */ q(tt, {
|
|
493
|
-
count: 0,
|
|
494
|
-
onClick: () => D(!1),
|
|
495
|
-
labels: { ariaLabel: h },
|
|
496
|
-
children: /* @__PURE__ */ q(M, {
|
|
497
|
-
size: p.MD,
|
|
498
|
-
"aria-hidden": !0
|
|
499
|
-
})
|
|
500
|
-
})
|
|
380
|
+
"aria-label": M,
|
|
381
|
+
className: d("gap-3", A ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
|
|
382
|
+
children: e.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
383
|
+
role: "listitem",
|
|
384
|
+
children: /* @__PURE__ */ Y(Ye, {
|
|
385
|
+
attachment: e,
|
|
386
|
+
onClick: n,
|
|
387
|
+
onDownload: P,
|
|
388
|
+
onRetry: i,
|
|
389
|
+
labels: {
|
|
390
|
+
clickLabel: f,
|
|
391
|
+
retryLabel: m,
|
|
392
|
+
promptLabel: b,
|
|
393
|
+
pastedLabel: x,
|
|
394
|
+
imageLabel: S,
|
|
395
|
+
openInNewTabLabel: g
|
|
396
|
+
},
|
|
397
|
+
isSelected: e.id === s
|
|
501
398
|
})
|
|
502
|
-
|
|
399
|
+
}, `${e.id}-${t}`))
|
|
503
400
|
})]
|
|
504
401
|
});
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
};
|
|
509
|
-
je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
510
|
-
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
511
|
-
return /* @__PURE__ */ q("div", {
|
|
512
|
-
className: "flex flex-nowrap gap-1",
|
|
513
|
-
children: e.map((e) => {
|
|
514
|
-
let r = t === e.id;
|
|
515
|
-
return /* @__PURE__ */ q(T, {
|
|
516
|
-
label: e.label,
|
|
517
|
-
selected: r,
|
|
518
|
-
onClick: () => n(e.id),
|
|
519
|
-
"aria-selected": r,
|
|
520
|
-
className: d("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, it.tabContainer, r && it.tabActive)
|
|
521
|
-
}, e.id);
|
|
522
|
-
})
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
526
|
-
let [s, c] = G(t), [l, u] = G(n), [d, f] = G(r), p = Pe(o);
|
|
527
|
-
Me(() => {
|
|
402
|
+
}, $e = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
403
|
+
let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = Me(o);
|
|
404
|
+
ke(() => {
|
|
528
405
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
529
406
|
}, [
|
|
530
407
|
o,
|
|
@@ -541,7 +418,7 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
|
|
|
541
418
|
setResponseFormat: c,
|
|
542
419
|
setSystemPrompt: u,
|
|
543
420
|
setTemperature: f,
|
|
544
|
-
handleSubmit:
|
|
421
|
+
handleSubmit: K(() => {
|
|
545
422
|
if (!m) return;
|
|
546
423
|
let t = {};
|
|
547
424
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -555,55 +432,59 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
|
|
|
555
432
|
a
|
|
556
433
|
])
|
|
557
434
|
};
|
|
558
|
-
},
|
|
435
|
+
}, et = { label: "_label_14i7c_1" }, tt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
|
|
559
436
|
"Precise",
|
|
560
437
|
"Neutral",
|
|
561
438
|
"Creative"
|
|
562
|
-
], temperatureHint:
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
439
|
+
], temperatureHint: b, labelClassName: S = "!dial-small-semi-text", colors: C }) => {
|
|
440
|
+
let w = u({ "--csf-label-text": C?.labelText }), T = d(S, et.label, "gap-1");
|
|
441
|
+
return /* @__PURE__ */ X("div", {
|
|
442
|
+
className: "flex flex-col gap-4 px-6 py-3",
|
|
443
|
+
style: w,
|
|
444
|
+
children: [
|
|
445
|
+
e.responseFormat && /* @__PURE__ */ Y(m, {
|
|
446
|
+
fieldTitle: s,
|
|
447
|
+
labelClassName: T,
|
|
448
|
+
elementId: "response-format",
|
|
449
|
+
orientation: D.Column,
|
|
450
|
+
activeRadioButton: t ?? l.Markdown,
|
|
451
|
+
labelDescription: c,
|
|
452
|
+
radioButtons: [{
|
|
453
|
+
id: l.Markdown,
|
|
454
|
+
name: f
|
|
455
|
+
}, {
|
|
456
|
+
id: l.PlainText,
|
|
457
|
+
name: p
|
|
458
|
+
}],
|
|
459
|
+
onChange: (e) => i(e)
|
|
460
|
+
}),
|
|
461
|
+
e.systemPrompt && /* @__PURE__ */ Y(x, {
|
|
462
|
+
value: n,
|
|
463
|
+
placeholder: _,
|
|
464
|
+
labelProps: {
|
|
465
|
+
className: T,
|
|
466
|
+
label: g
|
|
467
|
+
},
|
|
468
|
+
onChange: (e) => a(e ?? "")
|
|
469
|
+
}),
|
|
470
|
+
e.temperature && /* @__PURE__ */ Y(h, {
|
|
471
|
+
labelProps: {
|
|
472
|
+
label: v,
|
|
473
|
+
className: T,
|
|
474
|
+
caption: b
|
|
475
|
+
},
|
|
476
|
+
value: r,
|
|
477
|
+
min: 0,
|
|
478
|
+
max: 1,
|
|
479
|
+
step: .1,
|
|
480
|
+
labels: y,
|
|
481
|
+
onChange: o
|
|
482
|
+
})
|
|
483
|
+
]
|
|
484
|
+
});
|
|
485
|
+
}, nt = { modal: "_modal_od073_1" };
|
|
486
|
+
Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = nt.modal }) => {
|
|
487
|
+
let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = $e({
|
|
607
488
|
features: e,
|
|
608
489
|
initialResponseFormat: t,
|
|
609
490
|
initialSystemPrompt: n,
|
|
@@ -611,32 +492,32 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
611
492
|
onSave: i,
|
|
612
493
|
onClose: a
|
|
613
494
|
});
|
|
614
|
-
return /* @__PURE__ */
|
|
495
|
+
return /* @__PURE__ */ Y(w, {
|
|
615
496
|
open: !0,
|
|
616
497
|
header: o,
|
|
617
|
-
size:
|
|
498
|
+
size: T.Sm,
|
|
618
499
|
onClose: a,
|
|
619
|
-
className:
|
|
620
|
-
footer: /* @__PURE__ */
|
|
500
|
+
className: y,
|
|
501
|
+
footer: /* @__PURE__ */ Y("div", {
|
|
621
502
|
className: "flex justify-end px-6 py-4",
|
|
622
|
-
children: /* @__PURE__ */
|
|
623
|
-
tooltip:
|
|
624
|
-
hideTooltip:
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
label:
|
|
627
|
-
onClick:
|
|
628
|
-
disabled: !
|
|
503
|
+
children: /* @__PURE__ */ Y(g, {
|
|
504
|
+
tooltip: v,
|
|
505
|
+
hideTooltip: C || !v,
|
|
506
|
+
children: /* @__PURE__ */ Y(E, {
|
|
507
|
+
label: _,
|
|
508
|
+
onClick: A,
|
|
509
|
+
disabled: !C
|
|
629
510
|
})
|
|
630
511
|
})
|
|
631
512
|
}),
|
|
632
|
-
children: /* @__PURE__ */
|
|
513
|
+
children: /* @__PURE__ */ Y(tt, {
|
|
633
514
|
features: e,
|
|
634
|
-
responseFormat:
|
|
635
|
-
systemPrompt:
|
|
636
|
-
temperature:
|
|
637
|
-
onResponseFormatChange:
|
|
638
|
-
onSystemPromptChange:
|
|
639
|
-
onTemperatureChange:
|
|
515
|
+
responseFormat: b,
|
|
516
|
+
systemPrompt: x,
|
|
517
|
+
temperature: S,
|
|
518
|
+
onResponseFormatChange: D,
|
|
519
|
+
onSystemPromptChange: O,
|
|
520
|
+
onTemperatureChange: k,
|
|
640
521
|
responseFormatLabel: s,
|
|
641
522
|
responseFormatHint: c,
|
|
642
523
|
responseFormatMarkdownLabel: l,
|
|
@@ -649,167 +530,169 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
649
530
|
})
|
|
650
531
|
});
|
|
651
532
|
});
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, [
|
|
658
|
-
|
|
659
|
-
}, [c, y?.copiedMarkdownStatus]);
|
|
660
|
-
return /* @__PURE__ */ J("div", {
|
|
533
|
+
var rt = { activeRating: "_activeRating_7jito_1" }, it = 2e3, at = ({ role: e = s.User, onEdit: t, onEditHover: r, onDelete: i, onRegenerate: a, onCopy: c, onCopyMarkdown: l, onLike: f, onDislike: m, activeRating: h, isAlwaysVisible: g, className: y, labels: b, colors: x }) => {
|
|
534
|
+
let { tooltips: S, ariaLabels: C } = b ?? {}, [w, T] = q(null), [E, D] = q(""), O = u({ "--ma-active-rating-text": x?.activeRatingText }), k = K(() => {
|
|
535
|
+
c?.(), T("copy"), D(C?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => T(null), it);
|
|
536
|
+
}, [c, C?.copiedStatus]), A = K(() => {
|
|
537
|
+
l?.(), T("markdown"), D(C?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => T(null), it);
|
|
538
|
+
}, [l, C?.copiedMarkdownStatus]);
|
|
539
|
+
return /* @__PURE__ */ X("div", {
|
|
661
540
|
role: "toolbar",
|
|
662
|
-
"aria-label":
|
|
663
|
-
|
|
664
|
-
|
|
541
|
+
"aria-label": C?.actionsGroup ?? "Message actions",
|
|
542
|
+
style: O,
|
|
543
|
+
className: d("flex gap-1", !g && "opacity-0 group-hover:opacity-100", y),
|
|
544
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
665
545
|
role: "status",
|
|
666
546
|
"aria-live": "polite",
|
|
667
547
|
className: "sr-only",
|
|
668
|
-
children:
|
|
669
|
-
}), e === s.User ? /* @__PURE__ */ J
|
|
670
|
-
icon: /* @__PURE__ */
|
|
548
|
+
children: E
|
|
549
|
+
}), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(v, {
|
|
550
|
+
icon: /* @__PURE__ */ Y(ye, {
|
|
671
551
|
size: p.SM,
|
|
672
552
|
"aria-hidden": !0
|
|
673
553
|
}),
|
|
674
|
-
size:
|
|
675
|
-
"aria-label":
|
|
676
|
-
tooltipProps: { tooltip:
|
|
554
|
+
size: _.Small,
|
|
555
|
+
"aria-label": C?.editMessage ?? "Edit message",
|
|
556
|
+
tooltipProps: { tooltip: S?.edit ?? "Edit" },
|
|
677
557
|
onClick: t,
|
|
678
|
-
onMouseEnter:
|
|
679
|
-
onFocus:
|
|
680
|
-
}),
|
|
681
|
-
icon: /* @__PURE__ */
|
|
558
|
+
onMouseEnter: r,
|
|
559
|
+
onFocus: r
|
|
560
|
+
}), i && /* @__PURE__ */ Y(v, {
|
|
561
|
+
icon: /* @__PURE__ */ Y(Te, {
|
|
682
562
|
size: p.SM,
|
|
683
563
|
"aria-hidden": !0
|
|
684
564
|
}),
|
|
685
|
-
size:
|
|
686
|
-
"aria-label":
|
|
687
|
-
tooltipProps: { tooltip:
|
|
688
|
-
onClick:
|
|
689
|
-
})] }) : /* @__PURE__ */ J
|
|
690
|
-
|
|
691
|
-
icon: /* @__PURE__ */
|
|
565
|
+
size: _.Small,
|
|
566
|
+
"aria-label": C?.deleteMessage ?? "Delete message",
|
|
567
|
+
tooltipProps: { tooltip: S?.delete ?? "Delete" },
|
|
568
|
+
onClick: i
|
|
569
|
+
})] }) : /* @__PURE__ */ X(J, { children: [
|
|
570
|
+
a && /* @__PURE__ */ Y(v, {
|
|
571
|
+
icon: /* @__PURE__ */ Y(be, {
|
|
692
572
|
size: p.SM,
|
|
693
573
|
"aria-hidden": !0
|
|
694
574
|
}),
|
|
695
|
-
size:
|
|
696
|
-
"aria-label":
|
|
697
|
-
tooltipProps: { tooltip:
|
|
698
|
-
onClick:
|
|
575
|
+
size: _.Small,
|
|
576
|
+
"aria-label": C?.regenerateResponse ?? "Regenerate response",
|
|
577
|
+
tooltipProps: { tooltip: S?.regenerate ?? "Regenerate" },
|
|
578
|
+
onClick: a
|
|
699
579
|
}),
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
onClick: w
|
|
580
|
+
c && /* @__PURE__ */ Y(n, {
|
|
581
|
+
iconSize: p.SM,
|
|
582
|
+
onClick: k,
|
|
583
|
+
size: _.Small,
|
|
584
|
+
isCopied: w === "copy",
|
|
585
|
+
copyLabel: S?.copy ?? "Copy",
|
|
586
|
+
copiedLabel: S?.copied ?? "Copied!",
|
|
587
|
+
ariaLabel: C?.copyResponse ?? "Copy response"
|
|
709
588
|
}),
|
|
710
|
-
|
|
711
|
-
|
|
589
|
+
l && /* @__PURE__ */ Y(n, {
|
|
590
|
+
iconSize: p.SM,
|
|
591
|
+
onClick: A,
|
|
592
|
+
size: _.Small,
|
|
593
|
+
isCopied: w === "markdown",
|
|
594
|
+
iconCopy: /* @__PURE__ */ Y(ge, {
|
|
712
595
|
size: p.SM,
|
|
713
596
|
"aria-hidden": !0
|
|
714
597
|
}),
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
onClick: T
|
|
598
|
+
copyLabel: S?.copyMarkdown ?? "Copy as Markdown",
|
|
599
|
+
copiedLabel: S?.copiedMarkdown ?? "Copied!",
|
|
600
|
+
ariaLabel: C?.copyAsMarkdown ?? "Copy as markdown"
|
|
719
601
|
}),
|
|
720
|
-
|
|
721
|
-
icon: /* @__PURE__ */
|
|
602
|
+
f && /* @__PURE__ */ Y(v, {
|
|
603
|
+
icon: /* @__PURE__ */ Y(we, {
|
|
722
604
|
size: p.SM,
|
|
723
605
|
"aria-hidden": !0
|
|
724
606
|
}),
|
|
725
|
-
size:
|
|
726
|
-
"aria-label":
|
|
727
|
-
"aria-pressed":
|
|
728
|
-
className:
|
|
729
|
-
tooltipProps: { tooltip:
|
|
730
|
-
onClick:
|
|
607
|
+
size: _.Small,
|
|
608
|
+
"aria-label": C?.likeResponse ?? "Like response",
|
|
609
|
+
"aria-pressed": h === o.Like,
|
|
610
|
+
className: h === o.Like ? rt.activeRating : void 0,
|
|
611
|
+
tooltipProps: { tooltip: S?.like ?? "Like" },
|
|
612
|
+
onClick: f
|
|
731
613
|
}),
|
|
732
|
-
|
|
733
|
-
icon: /* @__PURE__ */
|
|
614
|
+
m && /* @__PURE__ */ Y(v, {
|
|
615
|
+
icon: /* @__PURE__ */ Y(Ce, {
|
|
734
616
|
size: p.SM,
|
|
735
617
|
"aria-hidden": !0
|
|
736
618
|
}),
|
|
737
|
-
size:
|
|
738
|
-
"aria-label":
|
|
739
|
-
"aria-pressed":
|
|
740
|
-
className:
|
|
741
|
-
tooltipProps: { tooltip:
|
|
742
|
-
onClick:
|
|
619
|
+
size: _.Small,
|
|
620
|
+
"aria-label": C?.dislikeResponse ?? "Dislike response",
|
|
621
|
+
"aria-pressed": h === o.Dislike,
|
|
622
|
+
className: h === o.Dislike ? rt.activeRating : void 0,
|
|
623
|
+
tooltipProps: { tooltip: S?.dislike ?? "Dislike" },
|
|
624
|
+
onClick: m
|
|
743
625
|
})
|
|
744
626
|
] })]
|
|
745
627
|
});
|
|
746
628
|
}, $ = {
|
|
747
|
-
userBubble: "
|
|
748
|
-
collapsibleText: "
|
|
749
|
-
expandedText: "
|
|
750
|
-
collapsedText: "
|
|
751
|
-
startersDivider: "
|
|
752
|
-
text: "
|
|
753
|
-
},
|
|
754
|
-
let { colors:
|
|
755
|
-
"--cm-bubble-text":
|
|
756
|
-
"--cm-starters-divider":
|
|
757
|
-
}),
|
|
758
|
-
return /* @__PURE__ */
|
|
629
|
+
userBubble: "_userBubble_ovjc1_1",
|
|
630
|
+
collapsibleText: "_collapsibleText_ovjc1_6",
|
|
631
|
+
expandedText: "_expandedText_ovjc1_11",
|
|
632
|
+
collapsedText: "_collapsedText_ovjc1_15",
|
|
633
|
+
startersDivider: "_startersDivider_ovjc1_26",
|
|
634
|
+
text: "_text_ovjc1_30"
|
|
635
|
+
}, ot = ({ text: e, styles: n, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, codeBlockTheme: x, labels: S, selectedAttachmentId: w }) => {
|
|
636
|
+
let { colors: T, typography: E, className: D, bubbleClassName: O } = n ?? {}, { attachmentClickLabel: k, attachmentRetryLabel: A, attachmentOpenInNewTabLabel: j, startersAriaLabel: M = "Quick reply buttons", thinkingLabel: N, codeBlockCopyLabel: P, codeBlockCopiedLabel: F, assistantMessageAriaLabel: I = "Assistant message", deploymentIconFallbackLabel: L = "AI" } = S ?? {}, R = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], z = u({
|
|
637
|
+
"--cm-bubble-text": T?.text,
|
|
638
|
+
"--cm-starters-divider": T?.startersDivider
|
|
639
|
+
}), B = d($.text, E?.fontClassName), V = !!(h || g);
|
|
640
|
+
return /* @__PURE__ */ X("div", {
|
|
759
641
|
role: "group",
|
|
760
|
-
"aria-label":
|
|
761
|
-
style:
|
|
762
|
-
className: d("flex w-full items-start gap-3",
|
|
763
|
-
children: [
|
|
642
|
+
"aria-label": I,
|
|
643
|
+
style: z,
|
|
644
|
+
className: d("flex w-full items-start gap-3", D),
|
|
645
|
+
children: [V && /* @__PURE__ */ Y(r, {
|
|
764
646
|
src: h,
|
|
765
647
|
size: 28,
|
|
766
|
-
initialsName: g ||
|
|
767
|
-
labels: { tooltip: g ??
|
|
768
|
-
}), /* @__PURE__ */
|
|
648
|
+
initialsName: g || L,
|
|
649
|
+
labels: { tooltip: g ?? L }
|
|
650
|
+
}), /* @__PURE__ */ X("div", {
|
|
769
651
|
className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
|
|
770
|
-
children: [/* @__PURE__ */
|
|
771
|
-
className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4",
|
|
652
|
+
children: [/* @__PURE__ */ X("div", {
|
|
653
|
+
className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", O),
|
|
772
654
|
children: [
|
|
773
|
-
(e || c) && /* @__PURE__ */
|
|
655
|
+
(e || c) && /* @__PURE__ */ Y("div", {
|
|
774
656
|
"aria-live": "polite",
|
|
775
657
|
"aria-atomic": "false",
|
|
776
|
-
className: d(
|
|
777
|
-
children: /* @__PURE__ */
|
|
658
|
+
className: d(B, "min-w-0 max-w-full text-start"),
|
|
659
|
+
children: /* @__PURE__ */ Y(i, {
|
|
778
660
|
content: e,
|
|
779
661
|
isStreaming: c,
|
|
780
|
-
thinkingLabel:
|
|
662
|
+
thinkingLabel: N,
|
|
781
663
|
components: _,
|
|
782
|
-
codeBlockCopyLabel:
|
|
783
|
-
codeBlockCopiedLabel:
|
|
784
|
-
codeBlockTheme:
|
|
664
|
+
codeBlockCopyLabel: P,
|
|
665
|
+
codeBlockCopiedLabel: F,
|
|
666
|
+
codeBlockTheme: x
|
|
785
667
|
})
|
|
786
668
|
}),
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
attachments:
|
|
669
|
+
/* @__PURE__ */ Y(Qe, {
|
|
670
|
+
attachments: R,
|
|
789
671
|
onAttachmentClick: (e) => v?.(l?.find((t) => t.id === e)),
|
|
790
672
|
onDownloadAll: y,
|
|
791
673
|
onRetry: b,
|
|
792
674
|
labels: {
|
|
793
|
-
clickLabel:
|
|
794
|
-
retryLabel:
|
|
795
|
-
openInNewTabLabel:
|
|
796
|
-
}
|
|
675
|
+
clickLabel: k,
|
|
676
|
+
retryLabel: A,
|
|
677
|
+
openInNewTabLabel: j
|
|
678
|
+
},
|
|
679
|
+
selectedAttachmentId: w
|
|
797
680
|
}),
|
|
798
681
|
f,
|
|
799
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ Y(at, {
|
|
800
683
|
...a,
|
|
801
684
|
isAlwaysVisible: o,
|
|
802
685
|
role: s.Assistant
|
|
803
686
|
})
|
|
804
687
|
]
|
|
805
|
-
}), p && p.length > 0 && m && /* @__PURE__ */
|
|
688
|
+
}), p && p.length > 0 && m && /* @__PURE__ */ Y("div", {
|
|
806
689
|
role: "list",
|
|
807
|
-
"aria-label":
|
|
690
|
+
"aria-label": M,
|
|
808
691
|
className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
809
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
692
|
+
children: p.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
810
693
|
role: "listitem",
|
|
811
694
|
className: "min-w-[40px]",
|
|
812
|
-
children: /* @__PURE__ */
|
|
695
|
+
children: /* @__PURE__ */ Y(C, {
|
|
813
696
|
label: e.title,
|
|
814
697
|
className: "min-w-[40px]",
|
|
815
698
|
onClick: () => m(e)
|
|
@@ -818,77 +701,77 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
818
701
|
})]
|
|
819
702
|
})]
|
|
820
703
|
});
|
|
821
|
-
},
|
|
704
|
+
}, st = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
|
|
822
705
|
role: "status",
|
|
823
706
|
"aria-live": "polite",
|
|
824
|
-
|
|
825
|
-
children: /* @__PURE__ */ q(_, {
|
|
707
|
+
children: /* @__PURE__ */ Y(b, {
|
|
826
708
|
title: e,
|
|
827
709
|
message: t,
|
|
828
710
|
textClassName: "flex-row flex-wrap gap-1"
|
|
829
711
|
})
|
|
830
|
-
}),
|
|
712
|
+
}), ct = /* @__PURE__ */ function(e) {
|
|
831
713
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
832
|
-
}({}),
|
|
833
|
-
let { colors:
|
|
714
|
+
}({}), lt = 10, ut = ({ text: e, position: t = ct.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = lt, labels: c, onAttachmentClick: l, onDownloadAll: m, onAttachmentRetry: h, selectedAttachmentId: g }) => {
|
|
715
|
+
let { colors: v, typography: y, className: b, bubbleClassName: x } = n ?? {}, { showMoreLabel: C = "Show more", showLessLabel: w = "Show less", showMoreAriaLabel: T, showLessAriaLabel: E, attachmentClickLabel: D, attachmentRetryLabel: O, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef: j, isTextCollapsed: P, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = f({
|
|
834
716
|
text: e,
|
|
835
717
|
collapsedLineCount: o
|
|
836
|
-
}),
|
|
837
|
-
"--cm-bubble-user-bg":
|
|
838
|
-
"--cm-bubble-user-border":
|
|
839
|
-
"--cm-bubble-fade-start":
|
|
840
|
-
"--cm-bubble-text":
|
|
841
|
-
"--cm-bubble-collapsed-height":
|
|
842
|
-
"--cm-bubble-expanded-height":
|
|
843
|
-
}),
|
|
844
|
-
return /* @__PURE__ */
|
|
718
|
+
}), B = u({
|
|
719
|
+
"--cm-bubble-user-bg": v?.userBackground,
|
|
720
|
+
"--cm-bubble-user-border": v?.userBorder,
|
|
721
|
+
"--cm-bubble-fade-start": v?.fadeStart,
|
|
722
|
+
"--cm-bubble-text": v?.text,
|
|
723
|
+
"--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
|
|
724
|
+
"--cm-bubble-expanded-height": F ? `${L}px` : void 0
|
|
725
|
+
}), V = t === ct.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", H = d($.text, y?.fontClassName), U = T ?? C, W = E ?? w, ee = R ? C : w, te = R ? U : W, ne = R ? M : N, re = Ae();
|
|
726
|
+
return /* @__PURE__ */ Y("div", {
|
|
845
727
|
role: "group",
|
|
846
|
-
"aria-label":
|
|
847
|
-
style:
|
|
848
|
-
className: d("flex w-full",
|
|
849
|
-
children: /* @__PURE__ */
|
|
728
|
+
"aria-label": A,
|
|
729
|
+
style: B,
|
|
730
|
+
className: d("flex w-full", b),
|
|
731
|
+
children: /* @__PURE__ */ X("div", {
|
|
850
732
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
851
733
|
children: [
|
|
852
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ Y(Qe, {
|
|
853
735
|
attachments: a ?? [],
|
|
854
736
|
onAttachmentClick: (e) => l?.(a?.find((t) => t.id === e)),
|
|
855
737
|
onDownloadAll: m,
|
|
856
738
|
onRetry: h,
|
|
857
739
|
labels: {
|
|
858
|
-
clickLabel:
|
|
859
|
-
retryLabel:
|
|
860
|
-
openInNewTabLabel:
|
|
740
|
+
clickLabel: D,
|
|
741
|
+
retryLabel: O,
|
|
742
|
+
openInNewTabLabel: k
|
|
861
743
|
},
|
|
862
|
-
styles: { className: "max-w-[640px]" }
|
|
744
|
+
styles: { className: "max-w-[640px]" },
|
|
745
|
+
selectedAttachmentId: g
|
|
863
746
|
}),
|
|
864
|
-
e && /* @__PURE__ */
|
|
865
|
-
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4",
|
|
866
|
-
children: /* @__PURE__ */
|
|
747
|
+
e && /* @__PURE__ */ Y("div", {
|
|
748
|
+
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, x),
|
|
749
|
+
children: /* @__PURE__ */ X("div", {
|
|
867
750
|
className: "flex min-w-0 flex-col items-start",
|
|
868
|
-
children: [/* @__PURE__ */
|
|
869
|
-
id:
|
|
870
|
-
className: d("relative overflow-hidden",
|
|
871
|
-
children: /* @__PURE__ */
|
|
872
|
-
ref:
|
|
873
|
-
className: d(
|
|
751
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
752
|
+
id: re,
|
|
753
|
+
className: d("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, P && $.collapsedText),
|
|
754
|
+
children: /* @__PURE__ */ Y("p", {
|
|
755
|
+
ref: j,
|
|
756
|
+
className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
874
757
|
children: e
|
|
875
758
|
})
|
|
876
|
-
}),
|
|
877
|
-
label: /* @__PURE__ */
|
|
878
|
-
iconBefore: /* @__PURE__ */
|
|
759
|
+
}), F && /* @__PURE__ */ Y(S, {
|
|
760
|
+
label: /* @__PURE__ */ Y(J, { children: ee }),
|
|
761
|
+
iconBefore: /* @__PURE__ */ Y(ne, {
|
|
879
762
|
size: p.SM,
|
|
880
763
|
"aria-hidden": "true"
|
|
881
764
|
}),
|
|
882
|
-
"aria-label":
|
|
883
|
-
"aria-expanded": !
|
|
884
|
-
"aria-controls":
|
|
765
|
+
"aria-label": te,
|
|
766
|
+
"aria-expanded": !R,
|
|
767
|
+
"aria-controls": re,
|
|
885
768
|
className: "mt-3",
|
|
886
|
-
onClick:
|
|
887
|
-
size:
|
|
769
|
+
onClick: z,
|
|
770
|
+
size: _.Small
|
|
888
771
|
})]
|
|
889
772
|
})
|
|
890
773
|
}),
|
|
891
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ Y(at, {
|
|
892
775
|
...r,
|
|
893
776
|
isAlwaysVisible: i,
|
|
894
777
|
role: s.User
|
|
@@ -896,31 +779,16 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
896
779
|
]
|
|
897
780
|
})
|
|
898
781
|
});
|
|
899
|
-
},
|
|
782
|
+
}, dt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ Y(st, { labels: {
|
|
900
783
|
titleText: r.labels?.statusTitleText,
|
|
901
784
|
bodyText: r.labels?.statusBodyText ?? ""
|
|
902
|
-
} }) : e === s.User ? /* @__PURE__ */
|
|
785
|
+
} }) : e === s.User ? /* @__PURE__ */ Y(ut, {
|
|
903
786
|
...r,
|
|
904
787
|
onAttachmentClick: t
|
|
905
|
-
}) : /* @__PURE__ */
|
|
788
|
+
}) : /* @__PURE__ */ Y(ot, {
|
|
906
789
|
...r,
|
|
907
790
|
markdownComponents: n,
|
|
908
791
|
onAttachmentClick: t
|
|
909
|
-
})
|
|
910
|
-
let { colors: r, typography: i, className: a } = n ?? {};
|
|
911
|
-
return /* @__PURE__ */ q("button", {
|
|
912
|
-
type: "button",
|
|
913
|
-
onClick: t,
|
|
914
|
-
style: u({
|
|
915
|
-
"--cm-source-bg": r?.background,
|
|
916
|
-
"--cm-source-border": r?.border,
|
|
917
|
-
"--cm-source-text": r?.text,
|
|
918
|
-
"--cm-source-bg-hover": r?.backgroundHover,
|
|
919
|
-
"--cm-source-border-hover": r?.borderHover
|
|
920
|
-
}),
|
|
921
|
-
className: d(_t.button, "relative flex h-6 items-center justify-center px-2", "border border-solid", "outline-none focus-visible:outline focus-visible:outline-1", "focus-visible:outline-offset-[3px]", "cursor-pointer whitespace-nowrap", i?.fontClassName, a),
|
|
922
|
-
children: e
|
|
923
|
-
});
|
|
924
|
-
};
|
|
792
|
+
});
|
|
925
793
|
//#endregion
|
|
926
|
-
export {
|
|
794
|
+
export { ot as AssistantMessageBubble, ct as BubblePosition, at as MessageActions, dt as MessageBubble, st as StatusMessageBubble, ut as UserMessageBubble };
|