@epam/ai-dial-conversation-messages 1.1.0-dev.21 → 1.1.0-dev.211
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 +479 -606
- 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,235 @@
|
|
|
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, LinkButton as x, NeutralButton as S, Popup as C, PopupSize as w, PrimaryButton as T, RadioGroupOrientation as E, Skeleton as D, SkeletonVariant as O, Spinner as k, StaticIconButton as A, Textarea 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
|
}
|
|
78
|
+
if (i == null) return "";
|
|
79
79
|
let o = i.lastIndexOf(".");
|
|
80
80
|
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.
|
|
81
|
+
}, Re = (e, n = {}) => {
|
|
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.Link && !l;
|
|
83
83
|
return {
|
|
84
84
|
isLoading: s,
|
|
85
85
|
isError: l,
|
|
86
86
|
isImage: u,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
typeLabel: f ? null : Be(e, n)
|
|
87
|
+
isLink: d,
|
|
88
|
+
BottomIcon: d ? null : Fe(e),
|
|
89
|
+
typeLabel: d ? null : Le(e, n)
|
|
91
90
|
};
|
|
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, {
|
|
91
|
+
}, ze = "flex size-[84px] items-center justify-center rounded-xl border", Z = {
|
|
92
|
+
tile: "_tile_3jao2_1",
|
|
93
|
+
hovered: "_hovered_3jao2_5",
|
|
94
|
+
selected: "_selected_3jao2_15",
|
|
95
|
+
tileError: "_tileError_3jao2_20",
|
|
96
|
+
nameText: "_nameText_3jao2_25",
|
|
97
|
+
typeText: "_typeText_3jao2_29",
|
|
98
|
+
retryIcon: "_retryIcon_3jao2_33",
|
|
99
|
+
track: "_track_3jao2_37",
|
|
100
|
+
actionButton: "_actionButton_3jao2_43",
|
|
101
|
+
imageActionButton: "_imageActionButton_3jao2_47"
|
|
102
|
+
}, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(A, {
|
|
116
103
|
icon: a,
|
|
117
|
-
size:
|
|
118
|
-
className: d("absolute end-1 top-1
|
|
104
|
+
size: _.Small,
|
|
105
|
+
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
106
|
"aria-label": e,
|
|
120
107
|
"aria-describedby": t ? n : void 0,
|
|
121
108
|
onClick: (e) => {
|
|
122
109
|
e.stopPropagation(), r(i);
|
|
123
110
|
}
|
|
124
|
-
}),
|
|
125
|
-
icon: /* @__PURE__ */
|
|
111
|
+
}), Be = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
112
|
+
icon: /* @__PURE__ */ Y(xe, {
|
|
126
113
|
size: p.SM,
|
|
127
114
|
"aria-hidden": !0
|
|
128
115
|
}),
|
|
129
|
-
className:
|
|
116
|
+
className: Z.retryIcon,
|
|
130
117
|
...e
|
|
131
|
-
}),
|
|
132
|
-
icon: /* @__PURE__ */
|
|
118
|
+
}), Ve = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
119
|
+
icon: /* @__PURE__ */ Y(F, {
|
|
133
120
|
size: p.SM,
|
|
134
121
|
"aria-hidden": !0
|
|
135
122
|
}),
|
|
136
123
|
...e
|
|
137
|
-
}),
|
|
138
|
-
icon: /* @__PURE__ */
|
|
124
|
+
}), He = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
125
|
+
icon: /* @__PURE__ */ Y(I, {
|
|
139
126
|
size: p.SM,
|
|
140
127
|
"aria-hidden": !0
|
|
141
128
|
}),
|
|
142
129
|
...e
|
|
143
|
-
}),
|
|
144
|
-
icon: /* @__PURE__ */
|
|
130
|
+
}), Ue = ({ ...e }) => /* @__PURE__ */ Y(Q, {
|
|
131
|
+
icon: /* @__PURE__ */ Y(De, {
|
|
145
132
|
size: p.SM,
|
|
146
133
|
"aria-hidden": !0
|
|
147
134
|
}),
|
|
148
|
-
className: X.hoverIcon,
|
|
149
135
|
...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 = {
|
|
136
|
+
}), We = {
|
|
197
137
|
[e.Network]: "Upload failed · network error",
|
|
198
138
|
[e.UnsupportedType]: "Upload failed · unsupported file type"
|
|
199
|
-
},
|
|
200
|
-
let { clickLabel:
|
|
201
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
202
|
-
},
|
|
139
|
+
}, 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 }) => {
|
|
140
|
+
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: A } = t, j = O === c.Loading, M = O === c.Error, N = Ae(), P = M ? A && (S?.[A] ?? We[A]) || C : "", { BottomIcon: F, typeLabel: I } = Re(t), L = !M && !j && s && !u, R = M && !!i && A !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
|
|
141
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
|
|
142
|
+
}, V = je(() => l ? D : Ne(D), [l, D]), H = K(() => {
|
|
203
143
|
window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
|
|
204
|
-
}, [t]),
|
|
205
|
-
title:
|
|
206
|
-
className: d(
|
|
207
|
-
children:
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
144
|
+
}, [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", {
|
|
145
|
+
title: V,
|
|
146
|
+
className: d(w?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !M && z),
|
|
147
|
+
children: n ? /* @__PURE__ */ Y(y, {
|
|
148
|
+
text: V,
|
|
149
|
+
query: n,
|
|
150
|
+
maxLines: 2
|
|
151
|
+
}) : V
|
|
152
|
+
}), ee = F && /* @__PURE__ */ X("div", {
|
|
153
|
+
className: d("flex w-full items-center gap-1", M && z),
|
|
154
|
+
children: [/* @__PURE__ */ Y(F, {
|
|
211
155
|
size: 16,
|
|
212
|
-
className:
|
|
156
|
+
className: Z.typeText,
|
|
213
157
|
"aria-hidden": !0
|
|
214
|
-
}), /* @__PURE__ */
|
|
215
|
-
className: d(
|
|
216
|
-
children:
|
|
158
|
+
}), /* @__PURE__ */ Y("span", {
|
|
159
|
+
className: d(w?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
|
|
160
|
+
children: b ? `${I} · ${b}` : I
|
|
217
161
|
})]
|
|
218
162
|
}), 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
|
|
163
|
+
m && p ? p(E) : r && r(E);
|
|
164
|
+
}, ne = /* @__PURE__ */ X(J, { children: [
|
|
165
|
+
W,
|
|
166
|
+
ee,
|
|
167
|
+
j && /* @__PURE__ */ Y("div", {
|
|
168
|
+
"aria-label": x,
|
|
169
|
+
className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
|
|
170
|
+
children: /* @__PURE__ */ Y(k, { size: 32 })
|
|
241
171
|
}),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
172
|
+
/* @__PURE__ */ X("div", {
|
|
173
|
+
className: d("absolute right-0 top-0 flex gap-1"),
|
|
174
|
+
children: [
|
|
175
|
+
L && /* @__PURE__ */ Y(Ve, {
|
|
176
|
+
ariaLabel: _,
|
|
177
|
+
errorTitle: P,
|
|
178
|
+
errorDescId: N,
|
|
179
|
+
onClick: s,
|
|
180
|
+
id: E
|
|
181
|
+
}),
|
|
182
|
+
R && /* @__PURE__ */ Y(Be, {
|
|
183
|
+
ariaLabel: v,
|
|
184
|
+
errorTitle: P,
|
|
185
|
+
errorDescId: N,
|
|
186
|
+
onClick: i,
|
|
187
|
+
id: E
|
|
188
|
+
}),
|
|
189
|
+
u && /* @__PURE__ */ Y(He, {
|
|
190
|
+
ariaLabel: v,
|
|
191
|
+
errorTitle: P,
|
|
192
|
+
errorDescId: N,
|
|
193
|
+
onClick: H
|
|
194
|
+
}),
|
|
195
|
+
h && /* @__PURE__ */ Y(Ue, {
|
|
196
|
+
ariaLabel: v,
|
|
197
|
+
errorTitle: P,
|
|
198
|
+
errorDescId: N,
|
|
199
|
+
onClick: h,
|
|
200
|
+
id: E
|
|
201
|
+
})
|
|
202
|
+
]
|
|
254
203
|
}),
|
|
255
|
-
|
|
256
|
-
id:
|
|
204
|
+
M && /* @__PURE__ */ Y("span", {
|
|
205
|
+
id: N,
|
|
257
206
|
role: "status",
|
|
258
207
|
"aria-live": "polite",
|
|
259
208
|
className: "sr-only",
|
|
260
|
-
children:
|
|
209
|
+
children: P
|
|
261
210
|
})
|
|
262
211
|
] });
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
style:
|
|
265
|
-
className: d("inline-flex",
|
|
266
|
-
children: /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ Y("div", {
|
|
213
|
+
style: f,
|
|
214
|
+
className: d("inline-flex", T),
|
|
215
|
+
children: /* @__PURE__ */ Y("div", {
|
|
267
216
|
role: "button",
|
|
268
217
|
tabIndex: 0,
|
|
269
|
-
"aria-label":
|
|
218
|
+
"aria-label": _,
|
|
270
219
|
onClick: te,
|
|
271
|
-
onKeyDown:
|
|
272
|
-
style:
|
|
273
|
-
className: d(
|
|
220
|
+
onKeyDown: B,
|
|
221
|
+
style: f,
|
|
222
|
+
className: d(U, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
|
|
274
223
|
children: ne
|
|
275
224
|
})
|
|
276
225
|
});
|
|
277
|
-
},
|
|
226
|
+
}, Ke = /* @__PURE__ */ function(e) {
|
|
278
227
|
return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
|
|
279
|
-
}({}),
|
|
280
|
-
let n =
|
|
281
|
-
return
|
|
228
|
+
}({}), qe = ({ enabled: e, src: t }) => {
|
|
229
|
+
let n = Me(null), [r, i] = q("idle");
|
|
230
|
+
return ke(() => {
|
|
282
231
|
i(e && t ? "loading" : "idle");
|
|
283
|
-
}, [e, t]),
|
|
232
|
+
}, [e, t]), ke(() => {
|
|
284
233
|
let r = n.current;
|
|
285
234
|
if (!r || !e || !t) return;
|
|
286
235
|
let a = () => i("loaded"), o = () => i("error");
|
|
@@ -291,240 +240,169 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
|
|
|
291
240
|
imageRef: n,
|
|
292
241
|
imageLoadStatus: r
|
|
293
242
|
};
|
|
294
|
-
},
|
|
295
|
-
let { clickLabel:
|
|
243
|
+
}, Je = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
|
|
244
|
+
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
245
|
enabled: x,
|
|
297
246
|
src: _
|
|
298
|
-
}),
|
|
299
|
-
v && n ? n(h) :
|
|
247
|
+
}), T = () => {
|
|
248
|
+
v && n ? n(h) : S && r && r(h);
|
|
300
249
|
};
|
|
301
|
-
return /* @__PURE__ */
|
|
302
|
-
className: d(
|
|
303
|
-
onClick:
|
|
250
|
+
return /* @__PURE__ */ Y("div", {
|
|
251
|
+
className: d(ze, "group/attachment-tile", S && "cursor-pointer", Z.tile, l && Z.selected, m),
|
|
252
|
+
onClick: T,
|
|
304
253
|
onKeyDown: (e) => {
|
|
305
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
254
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), T());
|
|
306
255
|
},
|
|
307
256
|
tabIndex: 0,
|
|
308
257
|
role: "button",
|
|
309
258
|
style: o,
|
|
310
|
-
"aria-label":
|
|
311
|
-
children: /* @__PURE__ */
|
|
259
|
+
"aria-label": S ? u : v ? f : void 0,
|
|
260
|
+
children: /* @__PURE__ */ X("div", {
|
|
312
261
|
className: "relative h-full w-full overflow-hidden",
|
|
313
262
|
children: [
|
|
314
|
-
a && /* @__PURE__ */
|
|
263
|
+
a && /* @__PURE__ */ Y(Ue, {
|
|
315
264
|
onClick: a,
|
|
316
|
-
id: h
|
|
265
|
+
id: h,
|
|
266
|
+
className: Z.imageActionButton
|
|
317
267
|
}),
|
|
318
|
-
s && /* @__PURE__ */
|
|
268
|
+
s && /* @__PURE__ */ Y(Ve, {
|
|
319
269
|
onClick: s,
|
|
320
|
-
id: h
|
|
270
|
+
id: h,
|
|
271
|
+
className: Z.imageActionButton
|
|
321
272
|
}),
|
|
322
|
-
|
|
323
|
-
variant:
|
|
273
|
+
w !== Ke.Loaded && /* @__PURE__ */ Y(D, {
|
|
274
|
+
variant: O.Rectangular,
|
|
324
275
|
width: "100%",
|
|
325
276
|
height: "100%",
|
|
326
|
-
active:
|
|
327
|
-
overlay: /* @__PURE__ */
|
|
277
|
+
active: w === Ke.Loading,
|
|
278
|
+
overlay: /* @__PURE__ */ Y(G, {
|
|
328
279
|
size: p.LG,
|
|
329
|
-
className:
|
|
280
|
+
className: Z.typeText,
|
|
330
281
|
"aria-hidden": !0
|
|
331
282
|
}),
|
|
332
283
|
className: "absolute inset-0 rounded-xl"
|
|
333
284
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
ref:
|
|
285
|
+
/* @__PURE__ */ Y("img", {
|
|
286
|
+
ref: C,
|
|
336
287
|
src: _,
|
|
337
288
|
alt: g,
|
|
338
289
|
loading: "lazy",
|
|
339
290
|
decoding: "async",
|
|
340
|
-
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200",
|
|
291
|
+
className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === Ke.Loaded ? "opacity-100" : "opacity-0")
|
|
341
292
|
})
|
|
342
293
|
]
|
|
343
294
|
})
|
|
344
295
|
});
|
|
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, {
|
|
296
|
+
}, Ye = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l, isSelected: d }) => {
|
|
297
|
+
let { colors: f } = l ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = u({
|
|
298
|
+
"--ai-tile-bg": f?.background,
|
|
299
|
+
"--ai-tile-border": f?.border,
|
|
300
|
+
"--ai-tile-bg-hover": f?.backgroundHover,
|
|
301
|
+
"--ai-tile-border-hover": f?.borderHover,
|
|
302
|
+
"--ai-tile-bg-selected": f?.backgroundSelected,
|
|
303
|
+
"--ai-tile-border-selected": f?.borderSelected,
|
|
304
|
+
"--ai-tile-focus-outline": f?.focusOutline,
|
|
305
|
+
"--ai-tile-bg-error": f?.backgroundError,
|
|
306
|
+
"--ai-tile-border-error": f?.borderError,
|
|
307
|
+
"--ai-tile-error-text": f?.errorText,
|
|
308
|
+
"--ai-tile-name-text": f?.nameText,
|
|
309
|
+
"--ai-tile-type-text": f?.typeText,
|
|
310
|
+
"--ai-tile-hover-icon-bg": f?.hoverIconBackground,
|
|
311
|
+
"--ai-tile-hover-icon-color": f?.hoverIconColor,
|
|
312
|
+
"--ai-tile-progress-track": f?.trackBackground
|
|
313
|
+
}), { isImage: g, isLink: _ } = je(() => Re(e), [e]);
|
|
314
|
+
return g ? /* @__PURE__ */ Y(Je, {
|
|
371
315
|
attachment: e,
|
|
372
316
|
labels: c,
|
|
373
317
|
onClick: o,
|
|
374
318
|
onExpand: a,
|
|
375
319
|
styles: l,
|
|
376
320
|
onRemove: r,
|
|
377
|
-
cssVars:
|
|
378
|
-
onDownload: s
|
|
379
|
-
|
|
321
|
+
cssVars: h,
|
|
322
|
+
onDownload: s,
|
|
323
|
+
isSelected: d
|
|
324
|
+
}) : /* @__PURE__ */ Y(Ge, {
|
|
380
325
|
attachment: e,
|
|
326
|
+
searchQuery: n,
|
|
381
327
|
onClick: o,
|
|
382
328
|
onRetry: i,
|
|
383
329
|
onRemove: r,
|
|
384
330
|
onDownload: s,
|
|
385
331
|
isLink: _,
|
|
386
|
-
isPasted:
|
|
332
|
+
isPasted: p,
|
|
387
333
|
styles: l,
|
|
388
334
|
labels: c,
|
|
389
335
|
onExpand: a,
|
|
390
|
-
cssVars:
|
|
391
|
-
isExpandable:
|
|
336
|
+
cssVars: h,
|
|
337
|
+
isExpandable: m,
|
|
338
|
+
isSelected: d
|
|
392
339
|
});
|
|
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]);
|
|
340
|
+
}, Xe = {
|
|
341
|
+
headerIcon: "_headerIcon_1dmgi_1",
|
|
342
|
+
headerLabel: "_headerLabel_1dmgi_2"
|
|
343
|
+
}, Ze = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Qe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: s }) => {
|
|
344
|
+
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
345
|
if (e.length === 0) return null;
|
|
427
|
-
let
|
|
346
|
+
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
347
|
let t = e.filter((e) => e.status === c.Idle);
|
|
429
348
|
r ? r(t) : t.forEach((e) => n?.(e.id));
|
|
430
|
-
},
|
|
349
|
+
}, P = (t) => {
|
|
431
350
|
let n = e.find((e) => e.id === t);
|
|
432
351
|
n && r?.([n]);
|
|
433
352
|
};
|
|
434
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ X("div", {
|
|
435
354
|
role: "group",
|
|
436
|
-
"aria-label":
|
|
437
|
-
style:
|
|
438
|
-
className: d("
|
|
439
|
-
children: [/* @__PURE__ */
|
|
440
|
-
className: "
|
|
441
|
-
children: [
|
|
442
|
-
|
|
355
|
+
"aria-label": l,
|
|
356
|
+
style: E,
|
|
357
|
+
className: d("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Xe.container, T),
|
|
358
|
+
children: [/* @__PURE__ */ X("div", {
|
|
359
|
+
className: "flex items-center justify-between",
|
|
360
|
+
children: [/* @__PURE__ */ X("div", {
|
|
361
|
+
className: "flex items-center gap-1",
|
|
362
|
+
children: [/* @__PURE__ */ Y(j, {
|
|
363
|
+
size: p.SM,
|
|
364
|
+
className: d("shrink-0", Xe.headerIcon),
|
|
365
|
+
"aria-hidden": !0
|
|
366
|
+
}), /* @__PURE__ */ Y("span", {
|
|
367
|
+
className: d(C?.headerLabelClassName ?? "dial-tiny-semi-text", Xe.headerLabel),
|
|
368
|
+
children: M
|
|
369
|
+
})]
|
|
370
|
+
}), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(v, {
|
|
371
|
+
icon: /* @__PURE__ */ Y(F, {
|
|
443
372
|
size: p.SM,
|
|
444
|
-
className: d("shrink-0", Q.headerIcon),
|
|
445
373
|
"aria-hidden": !0
|
|
446
374
|
}),
|
|
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", {
|
|
375
|
+
size: _.Small,
|
|
376
|
+
"aria-label": h,
|
|
377
|
+
onClick: N
|
|
378
|
+
})]
|
|
379
|
+
}), /* @__PURE__ */ Y("div", {
|
|
462
380
|
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
|
-
})
|
|
381
|
+
"aria-label": M,
|
|
382
|
+
className: d("gap-3", A ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
|
|
383
|
+
children: e.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
384
|
+
role: "listitem",
|
|
385
|
+
children: /* @__PURE__ */ Y(Ye, {
|
|
386
|
+
attachment: e,
|
|
387
|
+
onClick: n,
|
|
388
|
+
onDownload: P,
|
|
389
|
+
onRetry: i,
|
|
390
|
+
labels: {
|
|
391
|
+
clickLabel: f,
|
|
392
|
+
retryLabel: m,
|
|
393
|
+
promptLabel: b,
|
|
394
|
+
pastedLabel: x,
|
|
395
|
+
imageLabel: S,
|
|
396
|
+
openInNewTabLabel: g
|
|
397
|
+
},
|
|
398
|
+
isSelected: e.id === s
|
|
501
399
|
})
|
|
502
|
-
|
|
400
|
+
}, `${e.id}-${t}`))
|
|
503
401
|
})]
|
|
504
402
|
});
|
|
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(() => {
|
|
403
|
+
}, $e = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
404
|
+
let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = Me(o);
|
|
405
|
+
ke(() => {
|
|
528
406
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
529
407
|
}, [
|
|
530
408
|
o,
|
|
@@ -541,7 +419,7 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
|
|
|
541
419
|
setResponseFormat: c,
|
|
542
420
|
setSystemPrompt: u,
|
|
543
421
|
setTemperature: f,
|
|
544
|
-
handleSubmit:
|
|
422
|
+
handleSubmit: K(() => {
|
|
545
423
|
if (!m) return;
|
|
546
424
|
let t = {};
|
|
547
425
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -555,55 +433,62 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
|
|
|
555
433
|
a
|
|
556
434
|
])
|
|
557
435
|
};
|
|
558
|
-
},
|
|
436
|
+
}, 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
437
|
"Precise",
|
|
560
438
|
"Neutral",
|
|
561
439
|
"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
|
-
|
|
440
|
+
], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: S }) => {
|
|
441
|
+
let C = u({ "--csf-label-text": S?.labelText }), w = d(x, et.label, "gap-1");
|
|
442
|
+
return /* @__PURE__ */ X("div", {
|
|
443
|
+
className: "flex flex-col gap-4 px-6 pb-3",
|
|
444
|
+
style: C,
|
|
445
|
+
children: [
|
|
446
|
+
e.responseFormat && /* @__PURE__ */ Y(m, {
|
|
447
|
+
fieldTitle: s,
|
|
448
|
+
groupLabelClassName: w,
|
|
449
|
+
containerClassName: "!gap-2",
|
|
450
|
+
formItemChildrenClassName: "mb-2",
|
|
451
|
+
elementId: "response-format",
|
|
452
|
+
orientation: E.Column,
|
|
453
|
+
activeRadioButton: t ?? l.Markdown,
|
|
454
|
+
labelDescription: c,
|
|
455
|
+
radioButtons: [{
|
|
456
|
+
id: l.Markdown,
|
|
457
|
+
name: f
|
|
458
|
+
}, {
|
|
459
|
+
id: l.PlainText,
|
|
460
|
+
name: p
|
|
461
|
+
}],
|
|
462
|
+
onChange: (e) => i(e)
|
|
463
|
+
}),
|
|
464
|
+
e.systemPrompt && /* @__PURE__ */ Y(j, {
|
|
465
|
+
value: n,
|
|
466
|
+
placeholder: _,
|
|
467
|
+
resize: !0,
|
|
468
|
+
labelProps: {
|
|
469
|
+
className: w,
|
|
470
|
+
label: g
|
|
471
|
+
},
|
|
472
|
+
onChange: (e) => a(e ?? "")
|
|
473
|
+
}),
|
|
474
|
+
e.temperature && /* @__PURE__ */ Y(h, {
|
|
475
|
+
labelProps: {
|
|
476
|
+
label: v,
|
|
477
|
+
className: w,
|
|
478
|
+
caption: b
|
|
479
|
+
},
|
|
480
|
+
value: r,
|
|
481
|
+
min: 0,
|
|
482
|
+
max: 1,
|
|
483
|
+
step: .1,
|
|
484
|
+
labels: y,
|
|
485
|
+
onChange: o
|
|
486
|
+
})
|
|
487
|
+
]
|
|
488
|
+
});
|
|
489
|
+
}, nt = { modal: "_modal_kl0h0_1" };
|
|
490
|
+
Oe(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = nt.modal }) => {
|
|
491
|
+
let { responseFormat: x, systemPrompt: S, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = $e({
|
|
607
492
|
features: e,
|
|
608
493
|
initialResponseFormat: t,
|
|
609
494
|
initialSystemPrompt: n,
|
|
@@ -611,205 +496,208 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
|
|
|
611
496
|
onSave: i,
|
|
612
497
|
onClose: a
|
|
613
498
|
});
|
|
614
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ Y(C, {
|
|
615
500
|
open: !0,
|
|
616
501
|
header: o,
|
|
617
|
-
|
|
502
|
+
titleClassName: s,
|
|
503
|
+
size: w.Sm,
|
|
618
504
|
onClose: a,
|
|
619
|
-
className:
|
|
620
|
-
footer: /* @__PURE__ */
|
|
505
|
+
className: b,
|
|
506
|
+
footer: /* @__PURE__ */ Y("div", {
|
|
621
507
|
className: "flex justify-end px-6 py-4",
|
|
622
|
-
children: /* @__PURE__ */
|
|
623
|
-
tooltip:
|
|
624
|
-
hideTooltip:
|
|
625
|
-
children: /* @__PURE__ */
|
|
626
|
-
label:
|
|
627
|
-
onClick:
|
|
628
|
-
disabled: !
|
|
508
|
+
children: /* @__PURE__ */ Y(g, {
|
|
509
|
+
tooltip: y,
|
|
510
|
+
hideTooltip: D || !y,
|
|
511
|
+
children: /* @__PURE__ */ Y(T, {
|
|
512
|
+
label: v,
|
|
513
|
+
onClick: j,
|
|
514
|
+
disabled: !D
|
|
629
515
|
})
|
|
630
516
|
})
|
|
631
517
|
}),
|
|
632
|
-
children: /* @__PURE__ */
|
|
518
|
+
children: /* @__PURE__ */ Y(tt, {
|
|
633
519
|
features: e,
|
|
634
|
-
responseFormat:
|
|
635
|
-
systemPrompt:
|
|
636
|
-
temperature:
|
|
637
|
-
onResponseFormatChange:
|
|
638
|
-
onSystemPromptChange:
|
|
639
|
-
onTemperatureChange:
|
|
640
|
-
responseFormatLabel:
|
|
641
|
-
responseFormatHint:
|
|
642
|
-
responseFormatMarkdownLabel:
|
|
643
|
-
responseFormatPlainTextLabel:
|
|
644
|
-
systemPromptLabel:
|
|
645
|
-
systemPromptTooltip:
|
|
646
|
-
temperatureLabel:
|
|
647
|
-
temperatureLabels:
|
|
648
|
-
temperatureHint:
|
|
520
|
+
responseFormat: x,
|
|
521
|
+
systemPrompt: S,
|
|
522
|
+
temperature: E,
|
|
523
|
+
onResponseFormatChange: O,
|
|
524
|
+
onSystemPromptChange: k,
|
|
525
|
+
onTemperatureChange: A,
|
|
526
|
+
responseFormatLabel: c,
|
|
527
|
+
responseFormatHint: l,
|
|
528
|
+
responseFormatMarkdownLabel: u,
|
|
529
|
+
responseFormatPlainTextLabel: d,
|
|
530
|
+
systemPromptLabel: f,
|
|
531
|
+
systemPromptTooltip: p,
|
|
532
|
+
temperatureLabel: m,
|
|
533
|
+
temperatureLabels: h,
|
|
534
|
+
temperatureHint: _
|
|
649
535
|
})
|
|
650
536
|
});
|
|
651
537
|
});
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}, [
|
|
658
|
-
|
|
659
|
-
}, [c, y?.copiedMarkdownStatus]);
|
|
660
|
-
return /* @__PURE__ */ J("div", {
|
|
538
|
+
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 }) => {
|
|
539
|
+
let { tooltips: S, ariaLabels: C } = b ?? {}, [w, T] = q(null), [E, D] = q(""), O = u({ "--ma-active-rating-text": x?.activeRatingText }), k = K(() => {
|
|
540
|
+
c?.(), T("copy"), D(C?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => T(null), it);
|
|
541
|
+
}, [c, C?.copiedStatus]), A = K(() => {
|
|
542
|
+
l?.(), T("markdown"), D(C?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => T(null), it);
|
|
543
|
+
}, [l, C?.copiedMarkdownStatus]);
|
|
544
|
+
return /* @__PURE__ */ X("div", {
|
|
661
545
|
role: "toolbar",
|
|
662
|
-
"aria-label":
|
|
663
|
-
|
|
664
|
-
|
|
546
|
+
"aria-label": C?.actionsGroup ?? "Message actions",
|
|
547
|
+
style: O,
|
|
548
|
+
className: d("flex gap-1", !g && "opacity-0 group-hover:opacity-100", y),
|
|
549
|
+
children: [/* @__PURE__ */ Y("span", {
|
|
665
550
|
role: "status",
|
|
666
551
|
"aria-live": "polite",
|
|
667
552
|
className: "sr-only",
|
|
668
|
-
children:
|
|
669
|
-
}), e === s.User ? /* @__PURE__ */ J
|
|
670
|
-
icon: /* @__PURE__ */
|
|
553
|
+
children: E
|
|
554
|
+
}), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(v, {
|
|
555
|
+
icon: /* @__PURE__ */ Y(ye, {
|
|
671
556
|
size: p.SM,
|
|
672
557
|
"aria-hidden": !0
|
|
673
558
|
}),
|
|
674
|
-
size:
|
|
675
|
-
"aria-label":
|
|
676
|
-
tooltipProps: { tooltip:
|
|
559
|
+
size: _.Small,
|
|
560
|
+
"aria-label": C?.editMessage ?? "Edit message",
|
|
561
|
+
tooltipProps: { tooltip: S?.edit ?? "Edit" },
|
|
677
562
|
onClick: t,
|
|
678
|
-
onMouseEnter:
|
|
679
|
-
onFocus:
|
|
680
|
-
}),
|
|
681
|
-
icon: /* @__PURE__ */
|
|
563
|
+
onMouseEnter: r,
|
|
564
|
+
onFocus: r
|
|
565
|
+
}), i && /* @__PURE__ */ Y(v, {
|
|
566
|
+
icon: /* @__PURE__ */ Y(Te, {
|
|
682
567
|
size: p.SM,
|
|
683
568
|
"aria-hidden": !0
|
|
684
569
|
}),
|
|
685
|
-
size:
|
|
686
|
-
"aria-label":
|
|
687
|
-
tooltipProps: { tooltip:
|
|
688
|
-
onClick:
|
|
689
|
-
})] }) : /* @__PURE__ */ J
|
|
690
|
-
|
|
691
|
-
icon: /* @__PURE__ */
|
|
570
|
+
size: _.Small,
|
|
571
|
+
"aria-label": C?.deleteMessage ?? "Delete message",
|
|
572
|
+
tooltipProps: { tooltip: S?.delete ?? "Delete" },
|
|
573
|
+
onClick: i
|
|
574
|
+
})] }) : /* @__PURE__ */ X(J, { children: [
|
|
575
|
+
a && /* @__PURE__ */ Y(v, {
|
|
576
|
+
icon: /* @__PURE__ */ Y(be, {
|
|
692
577
|
size: p.SM,
|
|
693
578
|
"aria-hidden": !0
|
|
694
579
|
}),
|
|
695
|
-
size:
|
|
696
|
-
"aria-label":
|
|
697
|
-
tooltipProps: { tooltip:
|
|
698
|
-
onClick:
|
|
580
|
+
size: _.Small,
|
|
581
|
+
"aria-label": C?.regenerateResponse ?? "Regenerate response",
|
|
582
|
+
tooltipProps: { tooltip: S?.regenerate ?? "Regenerate" },
|
|
583
|
+
onClick: a
|
|
699
584
|
}),
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
onClick: w
|
|
585
|
+
c && /* @__PURE__ */ Y(n, {
|
|
586
|
+
iconSize: p.SM,
|
|
587
|
+
onClick: k,
|
|
588
|
+
size: _.Small,
|
|
589
|
+
isCopied: w === "copy",
|
|
590
|
+
copyLabel: S?.copy ?? "Copy",
|
|
591
|
+
copiedLabel: S?.copied ?? "Copied!",
|
|
592
|
+
ariaLabel: C?.copyResponse ?? "Copy response"
|
|
709
593
|
}),
|
|
710
|
-
|
|
711
|
-
|
|
594
|
+
l && /* @__PURE__ */ Y(n, {
|
|
595
|
+
iconSize: p.SM,
|
|
596
|
+
onClick: A,
|
|
597
|
+
size: _.Small,
|
|
598
|
+
isCopied: w === "markdown",
|
|
599
|
+
iconCopy: /* @__PURE__ */ Y(ge, {
|
|
712
600
|
size: p.SM,
|
|
713
601
|
"aria-hidden": !0
|
|
714
602
|
}),
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
onClick: T
|
|
603
|
+
copyLabel: S?.copyMarkdown ?? "Copy as Markdown",
|
|
604
|
+
copiedLabel: S?.copiedMarkdown ?? "Copied!",
|
|
605
|
+
ariaLabel: C?.copyAsMarkdown ?? "Copy as markdown"
|
|
719
606
|
}),
|
|
720
|
-
|
|
721
|
-
icon: /* @__PURE__ */
|
|
607
|
+
f && /* @__PURE__ */ Y(v, {
|
|
608
|
+
icon: /* @__PURE__ */ Y(we, {
|
|
722
609
|
size: p.SM,
|
|
723
610
|
"aria-hidden": !0
|
|
724
611
|
}),
|
|
725
|
-
size:
|
|
726
|
-
"aria-label":
|
|
727
|
-
"aria-pressed":
|
|
728
|
-
className:
|
|
729
|
-
tooltipProps: { tooltip:
|
|
730
|
-
onClick:
|
|
612
|
+
size: _.Small,
|
|
613
|
+
"aria-label": C?.likeResponse ?? "Like response",
|
|
614
|
+
"aria-pressed": h === o.Like,
|
|
615
|
+
className: h === o.Like ? rt.activeRating : void 0,
|
|
616
|
+
tooltipProps: { tooltip: S?.like ?? "Like" },
|
|
617
|
+
onClick: f
|
|
731
618
|
}),
|
|
732
|
-
|
|
733
|
-
icon: /* @__PURE__ */
|
|
619
|
+
m && /* @__PURE__ */ Y(v, {
|
|
620
|
+
icon: /* @__PURE__ */ Y(Ce, {
|
|
734
621
|
size: p.SM,
|
|
735
622
|
"aria-hidden": !0
|
|
736
623
|
}),
|
|
737
|
-
size:
|
|
738
|
-
"aria-label":
|
|
739
|
-
"aria-pressed":
|
|
740
|
-
className:
|
|
741
|
-
tooltipProps: { tooltip:
|
|
742
|
-
onClick:
|
|
624
|
+
size: _.Small,
|
|
625
|
+
"aria-label": C?.dislikeResponse ?? "Dislike response",
|
|
626
|
+
"aria-pressed": h === o.Dislike,
|
|
627
|
+
className: h === o.Dislike ? rt.activeRating : void 0,
|
|
628
|
+
tooltipProps: { tooltip: S?.dislike ?? "Dislike" },
|
|
629
|
+
onClick: m
|
|
743
630
|
})
|
|
744
631
|
] })]
|
|
745
632
|
});
|
|
746
633
|
}, $ = {
|
|
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__ */
|
|
634
|
+
userBubble: "_userBubble_ovjc1_1",
|
|
635
|
+
collapsibleText: "_collapsibleText_ovjc1_6",
|
|
636
|
+
expandedText: "_expandedText_ovjc1_11",
|
|
637
|
+
collapsedText: "_collapsedText_ovjc1_15",
|
|
638
|
+
startersDivider: "_startersDivider_ovjc1_26",
|
|
639
|
+
text: "_text_ovjc1_30"
|
|
640
|
+
}, 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: C, selectedAttachmentId: w }) => {
|
|
641
|
+
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" } = C ?? {}, R = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], z = u({
|
|
642
|
+
"--cm-bubble-text": T?.text,
|
|
643
|
+
"--cm-starters-divider": T?.startersDivider
|
|
644
|
+
}), B = d($.text, E?.fontClassName), V = !!(h || g);
|
|
645
|
+
return /* @__PURE__ */ X("div", {
|
|
759
646
|
role: "group",
|
|
760
|
-
"aria-label":
|
|
761
|
-
style:
|
|
762
|
-
className: d("flex w-full items-start gap-3",
|
|
763
|
-
children: [
|
|
647
|
+
"aria-label": I,
|
|
648
|
+
style: z,
|
|
649
|
+
className: d("flex w-full items-start gap-3", D),
|
|
650
|
+
children: [V && /* @__PURE__ */ Y(r, {
|
|
764
651
|
src: h,
|
|
765
652
|
size: 28,
|
|
766
|
-
initialsName: g ||
|
|
767
|
-
labels: { tooltip: g ??
|
|
768
|
-
}), /* @__PURE__ */
|
|
653
|
+
initialsName: g || L,
|
|
654
|
+
labels: { tooltip: g ?? L }
|
|
655
|
+
}), /* @__PURE__ */ X("div", {
|
|
769
656
|
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",
|
|
657
|
+
children: [/* @__PURE__ */ X("div", {
|
|
658
|
+
className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", O),
|
|
772
659
|
children: [
|
|
773
|
-
(e || c) && /* @__PURE__ */
|
|
660
|
+
(e || c) && /* @__PURE__ */ Y("div", {
|
|
774
661
|
"aria-live": "polite",
|
|
775
662
|
"aria-atomic": "false",
|
|
776
|
-
className: d(
|
|
777
|
-
children: /* @__PURE__ */
|
|
663
|
+
className: d(B, "min-w-0 max-w-full text-start"),
|
|
664
|
+
children: /* @__PURE__ */ Y(i, {
|
|
778
665
|
content: e,
|
|
779
666
|
isStreaming: c,
|
|
780
|
-
thinkingLabel:
|
|
667
|
+
thinkingLabel: N,
|
|
781
668
|
components: _,
|
|
782
|
-
codeBlockCopyLabel:
|
|
783
|
-
codeBlockCopiedLabel:
|
|
784
|
-
codeBlockTheme:
|
|
669
|
+
codeBlockCopyLabel: P,
|
|
670
|
+
codeBlockCopiedLabel: F,
|
|
671
|
+
codeBlockTheme: x
|
|
785
672
|
})
|
|
786
673
|
}),
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
attachments:
|
|
674
|
+
/* @__PURE__ */ Y(Qe, {
|
|
675
|
+
attachments: R,
|
|
789
676
|
onAttachmentClick: (e) => v?.(l?.find((t) => t.id === e)),
|
|
790
677
|
onDownloadAll: y,
|
|
791
678
|
onRetry: b,
|
|
792
679
|
labels: {
|
|
793
|
-
clickLabel:
|
|
794
|
-
retryLabel:
|
|
795
|
-
openInNewTabLabel:
|
|
796
|
-
}
|
|
680
|
+
clickLabel: k,
|
|
681
|
+
retryLabel: A,
|
|
682
|
+
openInNewTabLabel: j
|
|
683
|
+
},
|
|
684
|
+
selectedAttachmentId: w
|
|
797
685
|
}),
|
|
798
686
|
f,
|
|
799
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ Y(at, {
|
|
800
688
|
...a,
|
|
801
689
|
isAlwaysVisible: o,
|
|
802
690
|
role: s.Assistant
|
|
803
691
|
})
|
|
804
692
|
]
|
|
805
|
-
}), p && p.length > 0 && m && /* @__PURE__ */
|
|
693
|
+
}), p && p.length > 0 && m && /* @__PURE__ */ Y("div", {
|
|
806
694
|
role: "list",
|
|
807
|
-
"aria-label":
|
|
695
|
+
"aria-label": M,
|
|
808
696
|
className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
|
|
809
|
-
children: p.map((e, t) => /* @__PURE__ */
|
|
697
|
+
children: p.map((e, t) => /* @__PURE__ */ Y("div", {
|
|
810
698
|
role: "listitem",
|
|
811
699
|
className: "min-w-[40px]",
|
|
812
|
-
children: /* @__PURE__ */
|
|
700
|
+
children: /* @__PURE__ */ Y(S, {
|
|
813
701
|
label: e.title,
|
|
814
702
|
className: "min-w-[40px]",
|
|
815
703
|
onClick: () => m(e)
|
|
@@ -818,77 +706,77 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
818
706
|
})]
|
|
819
707
|
})]
|
|
820
708
|
});
|
|
821
|
-
},
|
|
709
|
+
}, st = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
|
|
822
710
|
role: "status",
|
|
823
711
|
"aria-live": "polite",
|
|
824
|
-
|
|
825
|
-
children: /* @__PURE__ */ q(_, {
|
|
712
|
+
children: /* @__PURE__ */ Y(b, {
|
|
826
713
|
title: e,
|
|
827
714
|
message: t,
|
|
828
715
|
textClassName: "flex-row flex-wrap gap-1"
|
|
829
716
|
})
|
|
830
|
-
}),
|
|
717
|
+
}), ct = /* @__PURE__ */ function(e) {
|
|
831
718
|
return e.Bottom = "Bottom", e.Top = "Top", e;
|
|
832
|
-
}({}),
|
|
833
|
-
let { colors:
|
|
719
|
+
}({}), 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 }) => {
|
|
720
|
+
let { colors: v, typography: y, className: b, bubbleClassName: S } = 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
721
|
text: e,
|
|
835
722
|
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__ */
|
|
723
|
+
}), B = u({
|
|
724
|
+
"--cm-bubble-user-bg": v?.userBackground,
|
|
725
|
+
"--cm-bubble-user-border": v?.userBorder,
|
|
726
|
+
"--cm-bubble-fade-start": v?.fadeStart,
|
|
727
|
+
"--cm-bubble-text": v?.text,
|
|
728
|
+
"--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
|
|
729
|
+
"--cm-bubble-expanded-height": F ? `${L}px` : void 0
|
|
730
|
+
}), 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();
|
|
731
|
+
return /* @__PURE__ */ Y("div", {
|
|
845
732
|
role: "group",
|
|
846
|
-
"aria-label":
|
|
847
|
-
style:
|
|
848
|
-
className: d("flex w-full",
|
|
849
|
-
children: /* @__PURE__ */
|
|
733
|
+
"aria-label": A,
|
|
734
|
+
style: B,
|
|
735
|
+
className: d("flex w-full", b),
|
|
736
|
+
children: /* @__PURE__ */ X("div", {
|
|
850
737
|
className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
|
|
851
738
|
children: [
|
|
852
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ Y(Qe, {
|
|
853
740
|
attachments: a ?? [],
|
|
854
741
|
onAttachmentClick: (e) => l?.(a?.find((t) => t.id === e)),
|
|
855
742
|
onDownloadAll: m,
|
|
856
743
|
onRetry: h,
|
|
857
744
|
labels: {
|
|
858
|
-
clickLabel:
|
|
859
|
-
retryLabel:
|
|
860
|
-
openInNewTabLabel:
|
|
745
|
+
clickLabel: D,
|
|
746
|
+
retryLabel: O,
|
|
747
|
+
openInNewTabLabel: k
|
|
861
748
|
},
|
|
862
|
-
styles: { className: "max-w-[640px]" }
|
|
749
|
+
styles: { className: "max-w-[640px]" },
|
|
750
|
+
selectedAttachmentId: g
|
|
863
751
|
}),
|
|
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__ */
|
|
752
|
+
e && /* @__PURE__ */ Y("div", {
|
|
753
|
+
className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, S),
|
|
754
|
+
children: /* @__PURE__ */ X("div", {
|
|
867
755
|
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(
|
|
756
|
+
children: [/* @__PURE__ */ Y("div", {
|
|
757
|
+
id: re,
|
|
758
|
+
className: d("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, P && $.collapsedText),
|
|
759
|
+
children: /* @__PURE__ */ Y("p", {
|
|
760
|
+
ref: j,
|
|
761
|
+
className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
|
|
874
762
|
children: e
|
|
875
763
|
})
|
|
876
|
-
}),
|
|
877
|
-
label: /* @__PURE__ */
|
|
878
|
-
iconBefore: /* @__PURE__ */
|
|
764
|
+
}), F && /* @__PURE__ */ Y(x, {
|
|
765
|
+
label: /* @__PURE__ */ Y(J, { children: ee }),
|
|
766
|
+
iconBefore: /* @__PURE__ */ Y(ne, {
|
|
879
767
|
size: p.SM,
|
|
880
768
|
"aria-hidden": "true"
|
|
881
769
|
}),
|
|
882
|
-
"aria-label":
|
|
883
|
-
"aria-expanded": !
|
|
884
|
-
"aria-controls":
|
|
770
|
+
"aria-label": te,
|
|
771
|
+
"aria-expanded": !R,
|
|
772
|
+
"aria-controls": re,
|
|
885
773
|
className: "mt-3",
|
|
886
|
-
onClick:
|
|
887
|
-
size:
|
|
774
|
+
onClick: z,
|
|
775
|
+
size: _.Small
|
|
888
776
|
})]
|
|
889
777
|
})
|
|
890
778
|
}),
|
|
891
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ Y(at, {
|
|
892
780
|
...r,
|
|
893
781
|
isAlwaysVisible: i,
|
|
894
782
|
role: s.User
|
|
@@ -896,31 +784,16 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
|
|
|
896
784
|
]
|
|
897
785
|
})
|
|
898
786
|
});
|
|
899
|
-
},
|
|
787
|
+
}, dt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ Y(st, { labels: {
|
|
900
788
|
titleText: r.labels?.statusTitleText,
|
|
901
789
|
bodyText: r.labels?.statusBodyText ?? ""
|
|
902
|
-
} }) : e === s.User ? /* @__PURE__ */
|
|
790
|
+
} }) : e === s.User ? /* @__PURE__ */ Y(ut, {
|
|
903
791
|
...r,
|
|
904
792
|
onAttachmentClick: t
|
|
905
|
-
}) : /* @__PURE__ */
|
|
793
|
+
}) : /* @__PURE__ */ Y(ot, {
|
|
906
794
|
...r,
|
|
907
795
|
markdownComponents: n,
|
|
908
796
|
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
|
-
};
|
|
797
|
+
});
|
|
925
798
|
//#endregion
|
|
926
|
-
export {
|
|
799
|
+
export { ot as AssistantMessageBubble, ct as BubblePosition, at as MessageActions, dt as MessageBubble, st as StatusMessageBubble, ut as UserMessageBubble };
|