@alfadocs/ui-kit 0.45.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/alia-sidebar-CVIPrdc9.js +1125 -0
- package/dist/_chunks/{audio-recorder-C1rhKhSN.js → audio-recorder-DC-v9YFW.js} +81 -91
- package/dist/_chunks/{chat-input-CQe7nR_v.js → chat-input-CFwc7JxL.js} +2 -1
- package/dist/_chunks/{chat-message-ASgGtj-L.js → chat-message-B5JpFj0F.js} +79 -73
- package/dist/_chunks/code-block-HoddNOKJ.js +106 -0
- package/dist/_chunks/download-CDF1sbL9.js +16 -0
- package/dist/_chunks/{editable-currency-cell-renderer-BEBUQl9P.js → editable-currency-cell-renderer-CLil9B29.js} +283 -293
- package/dist/_chunks/{freemium-paywall-BYist2sJ.js → freemium-paywall-DzpD63WY.js} +2 -2
- package/dist/_chunks/mic-B4Gog3Gi.js +16 -0
- package/dist/_chunks/{payment-form-DqEiEJRO.js → payment-form-BNTx4876.js} +225 -196
- package/dist/_chunks/pencil-CfQX-0Qc.js +21 -0
- package/dist/_chunks/{streaming-text-GH07yIYh.js → streaming-text-CfhDqtIT.js} +49 -45
- package/dist/_chunks/{workflow-map-BFNpzTiw.js → workflow-map-Djn1QMJc.js} +135 -150
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/code-block.d.ts +39 -0
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/chat-message.d.ts +6 -0
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/payment-form/payment-form.d.ts +6 -0
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +15 -0
- package/dist/i18n/locales/ar.js +16 -1
- package/dist/i18n/locales/de.d.ts +15 -0
- package/dist/i18n/locales/de.js +16 -1
- package/dist/i18n/locales/el.d.ts +15 -0
- package/dist/i18n/locales/el.js +16 -1
- package/dist/i18n/locales/en.d.ts +15 -0
- package/dist/i18n/locales/en.js +16 -1
- package/dist/i18n/locales/es.d.ts +15 -0
- package/dist/i18n/locales/es.js +16 -1
- package/dist/i18n/locales/fr.d.ts +15 -0
- package/dist/i18n/locales/fr.js +16 -1
- package/dist/i18n/locales/hi.d.ts +15 -0
- package/dist/i18n/locales/hi.js +16 -1
- package/dist/i18n/locales/it.d.ts +15 -0
- package/dist/i18n/locales/it.js +16 -1
- package/dist/i18n/locales/ja.d.ts +15 -0
- package/dist/i18n/locales/ja.js +16 -1
- package/dist/i18n/locales/nl.d.ts +15 -0
- package/dist/i18n/locales/nl.js +16 -1
- package/dist/i18n/locales/pl.d.ts +15 -0
- package/dist/i18n/locales/pl.js +16 -1
- package/dist/i18n/locales/pt.d.ts +15 -0
- package/dist/i18n/locales/pt.js +16 -1
- package/dist/i18n/locales/ro.d.ts +15 -0
- package/dist/i18n/locales/ro.js +16 -1
- package/dist/i18n/locales/ru.d.ts +15 -0
- package/dist/i18n/locales/ru.js +16 -1
- package/dist/i18n/locales/sq.d.ts +15 -0
- package/dist/i18n/locales/sq.js +16 -1
- package/dist/i18n/locales/sv.d.ts +15 -0
- package/dist/i18n/locales/sv.js +16 -1
- package/dist/i18n/locales/tr.d.ts +15 -0
- package/dist/i18n/locales/tr.js +16 -1
- package/dist/i18n/locales/zh.d.ts +15 -0
- package/dist/i18n/locales/zh.js +16 -1
- package/dist/index.js +9 -9
- package/dist/locales/ar.json +16 -1
- package/dist/locales/de.json +16 -1
- package/dist/locales/el.json +16 -1
- package/dist/locales/en.json +16 -1
- package/dist/locales/es.json +16 -1
- package/dist/locales/fr.json +16 -1
- package/dist/locales/hi.json +16 -1
- package/dist/locales/it.json +16 -1
- package/dist/locales/ja.json +16 -1
- package/dist/locales/nl.json +16 -1
- package/dist/locales/pl.json +16 -1
- package/dist/locales/pt.json +16 -1
- package/dist/locales/ro.json +16 -1
- package/dist/locales/ru.json +16 -1
- package/dist/locales/sq.json +16 -1
- package/dist/locales/sv.json +16 -1
- package/dist/locales/tr.json +16 -1
- package/dist/locales/zh.json +16 -1
- package/dist/patterns/alia-assistant/alia-types.d.ts +61 -0
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/alia-sidebar-Be8FhKYd.js +0 -837
|
@@ -0,0 +1,1125 @@
|
|
|
1
|
+
import { jsx as e, jsxs as m, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as D, useState as L, useMemo as M, useCallback as U, useRef as Le, useEffect as de } from "react";
|
|
3
|
+
import * as Se from "@radix-ui/react-dialog";
|
|
4
|
+
import { useTranslation as x } from "react-i18next";
|
|
5
|
+
import { F as Te } from "./floating-action-button-pojvb9gG.js";
|
|
6
|
+
import { I as w } from "./icon-button-CKEOrN37.js";
|
|
7
|
+
import { S as J } from "./sheet-xbzu4YiY.js";
|
|
8
|
+
import { X as te } from "./x-CCcI3eJp.js";
|
|
9
|
+
import { S as Y } from "./sparkles-CuYXqQLg.js";
|
|
10
|
+
import { A as F } from "./avatar-BNQNhoyL.js";
|
|
11
|
+
import { B as S } from "./button-DD_0Xdmr.js";
|
|
12
|
+
import { C as Ie } from "./chat-container-ogB4OskO.js";
|
|
13
|
+
import { C as Ee } from "./chat-message-B5JpFj0F.js";
|
|
14
|
+
import { C as ne, P as _e } from "./chat-input-CFwc7JxL.js";
|
|
15
|
+
import { S as Re } from "./spinner-OjQNn8oN.js";
|
|
16
|
+
import { S as Pe } from "./streaming-text-CfhDqtIT.js";
|
|
17
|
+
import { a as le, S as oe } from "./suggestion-chip-C4kxWUIs.js";
|
|
18
|
+
import { T as Be } from "./typing-indicator-DHeVN4ob.js";
|
|
19
|
+
import { P as Ue } from "./progress-kzIRcdaq.js";
|
|
20
|
+
import { P as De } from "./pencil-CfQX-0Qc.js";
|
|
21
|
+
import { S as Fe } from "./square-CZoGU14v.js";
|
|
22
|
+
import { C as Oe } from "./check-DPdL_Sm7.js";
|
|
23
|
+
import { C as $e } from "./copy-B00HK7tj.js";
|
|
24
|
+
import { D as He } from "./download-CDF1sbL9.js";
|
|
25
|
+
import { R as We } from "./refresh-cw-CC8jSKMr.js";
|
|
26
|
+
import { c as Xe } from "./createLucideIcon-CrFbzy84.js";
|
|
27
|
+
import { M as qe } from "./mic-B4Gog3Gi.js";
|
|
28
|
+
import { P as Qe } from "./plus-CYKNmfuA.js";
|
|
29
|
+
import { U as Ke } from "./user-CPxpqFjJ.js";
|
|
30
|
+
import { a as Ze, C as Je } from "./chevrons-right-d9MwesPG.js";
|
|
31
|
+
/**
|
|
32
|
+
* @license lucide-react v1.8.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const Me = [
|
|
38
|
+
[
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
|
|
42
|
+
key: "oel41y"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
["path", { d: "m14.5 9.5-5 5", key: "17q4r4" }],
|
|
46
|
+
["path", { d: "m9.5 9.5 5 5", key: "18nt4w" }]
|
|
47
|
+
], Ye = Xe("shield-x", Me), ce = {
|
|
48
|
+
sm: {
|
|
49
|
+
box: "ds:size-[calc(var(--spacing-md)*2)]",
|
|
50
|
+
icon: "ds:size-4"
|
|
51
|
+
},
|
|
52
|
+
md: {
|
|
53
|
+
box: "ds:size-[calc(var(--spacing-md)*2.5)]",
|
|
54
|
+
icon: "ds:size-[1.125rem]"
|
|
55
|
+
},
|
|
56
|
+
xl: {
|
|
57
|
+
box: "ds:size-[calc(var(--spacing-md)*4)]",
|
|
58
|
+
icon: "ds:size-8"
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function T({
|
|
62
|
+
size: s,
|
|
63
|
+
label: i,
|
|
64
|
+
appearance: t = "sparkle",
|
|
65
|
+
loading: d = !1
|
|
66
|
+
}) {
|
|
67
|
+
const a = ce[s];
|
|
68
|
+
return t === "spinner" ? /* @__PURE__ */ e(
|
|
69
|
+
"span",
|
|
70
|
+
{
|
|
71
|
+
role: "img",
|
|
72
|
+
"aria-label": i,
|
|
73
|
+
className: "ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center ds:text-[color:var(--primary)]",
|
|
74
|
+
children: /* @__PURE__ */ e(
|
|
75
|
+
Re,
|
|
76
|
+
{
|
|
77
|
+
"aria-hidden": !0,
|
|
78
|
+
variant: d ? "pulse" : "static",
|
|
79
|
+
className: a.box
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
) : /* @__PURE__ */ e(
|
|
84
|
+
"span",
|
|
85
|
+
{
|
|
86
|
+
role: "img",
|
|
87
|
+
"aria-label": i,
|
|
88
|
+
className: [
|
|
89
|
+
"ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
90
|
+
"ds:rounded-[var(--radius-full)]",
|
|
91
|
+
// Subtle accent-tinted disc so the sparkle reads against both
|
|
92
|
+
// light and dark surfaces without a hard-coded literal colour.
|
|
93
|
+
"ds:bg-[color-mix(in_srgb,var(--accent)_14%,transparent)]",
|
|
94
|
+
"ds:text-[color:var(--accent)]",
|
|
95
|
+
// forced-colors: UA strips color-mix backgrounds; fall back to
|
|
96
|
+
// a bordered disc so the identity still reads in HCM.
|
|
97
|
+
"ds:forced-colors:bg-transparent ds:forced-colors:border ds:forced-colors:border-[CanvasText]",
|
|
98
|
+
a.box
|
|
99
|
+
].join(" "),
|
|
100
|
+
children: /* @__PURE__ */ e(Y, { "aria-hidden": "true", className: a.icon })
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function Ge({
|
|
105
|
+
size: s,
|
|
106
|
+
label: i
|
|
107
|
+
}) {
|
|
108
|
+
const t = ce[s];
|
|
109
|
+
return /* @__PURE__ */ e(
|
|
110
|
+
"span",
|
|
111
|
+
{
|
|
112
|
+
role: "img",
|
|
113
|
+
"aria-label": i,
|
|
114
|
+
className: [
|
|
115
|
+
"ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center",
|
|
116
|
+
"ds:rounded-[var(--radius-full)]",
|
|
117
|
+
"ds:bg-[color-mix(in_srgb,var(--muted-foreground)_14%,transparent)]",
|
|
118
|
+
"ds:text-[color:var(--muted-foreground)]",
|
|
119
|
+
"ds:forced-colors:bg-transparent ds:forced-colors:border ds:forced-colors:border-[CanvasText]",
|
|
120
|
+
t.box
|
|
121
|
+
].join(" "),
|
|
122
|
+
children: /* @__PURE__ */ e(Ke, { "aria-hidden": "true", className: t.icon })
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
function Ve({ note: s }) {
|
|
127
|
+
return /* @__PURE__ */ m(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
role: "status",
|
|
131
|
+
className: [
|
|
132
|
+
"ds:flex ds:w-full ds:flex-col ds:items-center ds:text-center",
|
|
133
|
+
"ds:gap-[var(--spacing-xs)]"
|
|
134
|
+
].join(" "),
|
|
135
|
+
"data-testid": "alia-ended-divider",
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ e(
|
|
138
|
+
Ye,
|
|
139
|
+
{
|
|
140
|
+
"aria-hidden": "true",
|
|
141
|
+
className: "ds:size-5 ds:text-[color:var(--destructive)]"
|
|
142
|
+
}
|
|
143
|
+
),
|
|
144
|
+
/* @__PURE__ */ e("span", { className: "type-body-sm ds:text-[color:var(--muted-foreground)]", children: s })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function Ae(s, i) {
|
|
150
|
+
return s ? s.slot ? { slot: s.slot } : { name: s.name, src: s.src } : { slot: /* @__PURE__ */ e(Ge, { size: "sm", label: i }) };
|
|
151
|
+
}
|
|
152
|
+
function es({
|
|
153
|
+
assistantName: s,
|
|
154
|
+
avatarSrc: i,
|
|
155
|
+
greeting: t,
|
|
156
|
+
subtitle: d,
|
|
157
|
+
suggestions: a,
|
|
158
|
+
onSuggestion: l
|
|
159
|
+
}) {
|
|
160
|
+
const { t: p } = x(), n = "alia-empty-state-heading";
|
|
161
|
+
return /* @__PURE__ */ m(
|
|
162
|
+
"section",
|
|
163
|
+
{
|
|
164
|
+
"aria-labelledby": n,
|
|
165
|
+
className: [
|
|
166
|
+
"ds:flex ds:flex-1 ds:min-h-0 ds:flex-col ds:items-center ds:justify-center",
|
|
167
|
+
"ds:text-center",
|
|
168
|
+
"ds:ps-[var(--spacing-lg)] ds:pe-[var(--spacing-lg)]",
|
|
169
|
+
"ds:pt-[var(--spacing-xl)] ds:pb-[var(--spacing-xl)]",
|
|
170
|
+
"ds:gap-[var(--spacing-md)]"
|
|
171
|
+
].join(" "),
|
|
172
|
+
"data-testid": "alia-empty-state",
|
|
173
|
+
children: [
|
|
174
|
+
i ? /* @__PURE__ */ e(F, { name: s, src: i, size: "xl" }) : /* @__PURE__ */ e(
|
|
175
|
+
T,
|
|
176
|
+
{
|
|
177
|
+
size: "xl",
|
|
178
|
+
label: s,
|
|
179
|
+
appearance: "spinner"
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:max-w-[32rem]", children: [
|
|
183
|
+
/* @__PURE__ */ e(
|
|
184
|
+
"h2",
|
|
185
|
+
{
|
|
186
|
+
id: n,
|
|
187
|
+
className: "type-title-section ds:m-0 ds:text-[color:var(--foreground)]",
|
|
188
|
+
children: t
|
|
189
|
+
}
|
|
190
|
+
),
|
|
191
|
+
/* @__PURE__ */ e("p", { className: "type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]", children: d })
|
|
192
|
+
] }),
|
|
193
|
+
a && a.length > 0 ? /* @__PURE__ */ e("div", { className: "ds:w-full ds:max-w-[40rem]", children: /* @__PURE__ */ e(
|
|
194
|
+
le,
|
|
195
|
+
{
|
|
196
|
+
label: p("alia.exampleQuestions"),
|
|
197
|
+
className: "ds:justify-center",
|
|
198
|
+
children: a.map((c) => /* @__PURE__ */ e(
|
|
199
|
+
oe,
|
|
200
|
+
{
|
|
201
|
+
intent: "suggestion",
|
|
202
|
+
startIcon: c.icon,
|
|
203
|
+
keepOnSelect: !0,
|
|
204
|
+
onSelect: () => l == null ? void 0 : l(c),
|
|
205
|
+
children: c.label
|
|
206
|
+
},
|
|
207
|
+
c.id
|
|
208
|
+
))
|
|
209
|
+
}
|
|
210
|
+
) }) : null
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
function ss({
|
|
216
|
+
message: s,
|
|
217
|
+
assistantName: i,
|
|
218
|
+
avatarSrc: t,
|
|
219
|
+
renderMarkdown: d
|
|
220
|
+
}) {
|
|
221
|
+
const { t: a, i18n: l } = x(), p = a("chat.message.role.assistant"), n = M(() => {
|
|
222
|
+
if (!s.timestamp) return null;
|
|
223
|
+
const o = s.timestamp instanceof Date ? s.timestamp : new Date(s.timestamp);
|
|
224
|
+
return Number.isNaN(o.getTime()) ? null : new Intl.DateTimeFormat(l.language, {
|
|
225
|
+
hour: "2-digit",
|
|
226
|
+
minute: "2-digit"
|
|
227
|
+
}).format(o);
|
|
228
|
+
}, [s.timestamp, l.language]), c = n ? a("chat.message.label", { role: p, time: n }) : a("chat.message.labelNoTime", { role: p });
|
|
229
|
+
return /* @__PURE__ */ m(
|
|
230
|
+
"article",
|
|
231
|
+
{
|
|
232
|
+
"aria-label": c,
|
|
233
|
+
className: "ds:flex ds:w-full ds:items-start ds:flex-row ds:gap-[var(--spacing-sm)]",
|
|
234
|
+
children: [
|
|
235
|
+
t ? /* @__PURE__ */ e(F, { name: i, src: t, size: "sm" }) : /* @__PURE__ */ e(
|
|
236
|
+
T,
|
|
237
|
+
{
|
|
238
|
+
size: "sm",
|
|
239
|
+
label: i,
|
|
240
|
+
appearance: "spinner",
|
|
241
|
+
loading: !0
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ e("div", { className: "ds:flex ds:flex-col ds:items-start", children: /* @__PURE__ */ e(
|
|
245
|
+
"div",
|
|
246
|
+
{
|
|
247
|
+
dir: "auto",
|
|
248
|
+
className: [
|
|
249
|
+
"ds:relative ds:max-w-[min(42rem,90%)]",
|
|
250
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
251
|
+
"ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
|
|
252
|
+
"type-body",
|
|
253
|
+
"ds:break-words",
|
|
254
|
+
"ds:bg-muted/40 ds:text-foreground",
|
|
255
|
+
"ds:rounded-[var(--radius-md)] ds:rounded-es-[var(--radius-sm)]"
|
|
256
|
+
].join(" "),
|
|
257
|
+
children: /* @__PURE__ */ e(
|
|
258
|
+
Pe,
|
|
259
|
+
{
|
|
260
|
+
content: s.content,
|
|
261
|
+
isStreaming: !0,
|
|
262
|
+
renderMarkdown: d
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
) })
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
function as({
|
|
272
|
+
assistantName: s,
|
|
273
|
+
avatarSrc: i,
|
|
274
|
+
onNewConversation: t,
|
|
275
|
+
headerEndSlot: d,
|
|
276
|
+
density: a
|
|
277
|
+
}) {
|
|
278
|
+
const { t: l } = x();
|
|
279
|
+
return /* @__PURE__ */ m(
|
|
280
|
+
"header",
|
|
281
|
+
{
|
|
282
|
+
"aria-label": l("alia.headerLabel"),
|
|
283
|
+
className: [
|
|
284
|
+
"ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
285
|
+
// Soft drop-shadow on the block-end edge in place of a `border-b`
|
|
286
|
+
// against `--border` — same rationale as the Alia sidebar's inline
|
|
287
|
+
// edge (see alia-sidebar.tsx).
|
|
288
|
+
"ds:shadow-[var(--shadow-chrome-down)]",
|
|
289
|
+
"ds:bg-[var(--background)]",
|
|
290
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
291
|
+
a === "compact" ? "ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]" : "ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]"
|
|
292
|
+
].join(" "),
|
|
293
|
+
"data-testid": "alia-header",
|
|
294
|
+
children: [
|
|
295
|
+
i ? /* @__PURE__ */ e(
|
|
296
|
+
F,
|
|
297
|
+
{
|
|
298
|
+
name: s,
|
|
299
|
+
src: i,
|
|
300
|
+
size: a === "compact" ? "sm" : "md"
|
|
301
|
+
}
|
|
302
|
+
) : /* @__PURE__ */ e(
|
|
303
|
+
T,
|
|
304
|
+
{
|
|
305
|
+
size: a === "compact" ? "sm" : "md",
|
|
306
|
+
label: s,
|
|
307
|
+
appearance: "spinner"
|
|
308
|
+
}
|
|
309
|
+
),
|
|
310
|
+
/* @__PURE__ */ e("span", { className: "type-title-item ds:text-[color:var(--foreground)]", children: s }),
|
|
311
|
+
/* @__PURE__ */ m("div", { className: "ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
312
|
+
t ? /* @__PURE__ */ e(
|
|
313
|
+
S,
|
|
314
|
+
{
|
|
315
|
+
intent: "ghost",
|
|
316
|
+
size: "sm",
|
|
317
|
+
startIcon: /* @__PURE__ */ e(Qe, { "aria-hidden": "true" }),
|
|
318
|
+
onClick: t,
|
|
319
|
+
children: l("alia.newConversation")
|
|
320
|
+
}
|
|
321
|
+
) : null,
|
|
322
|
+
d
|
|
323
|
+
] })
|
|
324
|
+
]
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
function is(s) {
|
|
329
|
+
var i;
|
|
330
|
+
return typeof navigator > "u" || typeof ((i = navigator.clipboard) == null ? void 0 : i.writeText) != "function" ? Promise.resolve(!1) : navigator.clipboard.writeText(s).then(() => !0).catch(() => !1);
|
|
331
|
+
}
|
|
332
|
+
function ds(s, i) {
|
|
333
|
+
if (typeof window > "u" || typeof URL > "u" || typeof URL.createObjectURL != "function")
|
|
334
|
+
return;
|
|
335
|
+
const t = new Blob([s], { type: "text/markdown;charset=utf-8" }), d = URL.createObjectURL(t), a = document.createElement("a");
|
|
336
|
+
a.href = d, a.download = i, document.body.appendChild(a), a.click(), a.remove(), URL.revokeObjectURL(d);
|
|
337
|
+
}
|
|
338
|
+
function rs(s) {
|
|
339
|
+
const i = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
340
|
+
return `${s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "assistant"}-prompt-${i}.md`;
|
|
341
|
+
}
|
|
342
|
+
const ts = () => {
|
|
343
|
+
var s;
|
|
344
|
+
return typeof navigator < "u" && typeof ((s = navigator.clipboard) == null ? void 0 : s.writeText) == "function";
|
|
345
|
+
};
|
|
346
|
+
function ns({
|
|
347
|
+
message: s,
|
|
348
|
+
actions: i,
|
|
349
|
+
assistantName: t,
|
|
350
|
+
canRegenerate: d,
|
|
351
|
+
onCopyMessage: a,
|
|
352
|
+
onDownloadMessage: l,
|
|
353
|
+
onRegenerate: p
|
|
354
|
+
}) {
|
|
355
|
+
const { t: n } = x(), [c, o] = L(!1), r = U(() => {
|
|
356
|
+
is(s.content).then((v) => {
|
|
357
|
+
v && (o(!0), setTimeout(() => o(!1), 2e3), a == null || a(s.id));
|
|
358
|
+
});
|
|
359
|
+
}, [s.content, s.id, a]), g = U(() => {
|
|
360
|
+
ds(s.content, rs(t)), l == null || l(s.id);
|
|
361
|
+
}, [s.content, s.id, t, l]);
|
|
362
|
+
return /* @__PURE__ */ m(re, { children: [
|
|
363
|
+
i.includes("copy") && ts() ? /* @__PURE__ */ e(
|
|
364
|
+
w,
|
|
365
|
+
{
|
|
366
|
+
icon: c ? /* @__PURE__ */ e(Oe, {}) : /* @__PURE__ */ e($e, {}),
|
|
367
|
+
"aria-label": n(c ? "alia.copied" : "alia.copyMessage"),
|
|
368
|
+
intent: "ghost",
|
|
369
|
+
size: "sm",
|
|
370
|
+
onClick: r
|
|
371
|
+
}
|
|
372
|
+
) : null,
|
|
373
|
+
i.includes("download") ? /* @__PURE__ */ e(
|
|
374
|
+
w,
|
|
375
|
+
{
|
|
376
|
+
icon: /* @__PURE__ */ e(He, {}),
|
|
377
|
+
"aria-label": n("alia.downloadMessage"),
|
|
378
|
+
intent: "ghost",
|
|
379
|
+
size: "sm",
|
|
380
|
+
onClick: g
|
|
381
|
+
}
|
|
382
|
+
) : null,
|
|
383
|
+
d && p ? /* @__PURE__ */ e(
|
|
384
|
+
w,
|
|
385
|
+
{
|
|
386
|
+
icon: /* @__PURE__ */ e(We, {}),
|
|
387
|
+
"aria-label": n("alia.regenerate"),
|
|
388
|
+
intent: "ghost",
|
|
389
|
+
size: "sm",
|
|
390
|
+
onClick: () => p(s.id)
|
|
391
|
+
}
|
|
392
|
+
) : null,
|
|
393
|
+
/* @__PURE__ */ e("span", { role: "status", "aria-live": "polite", className: "ds:sr-only", children: c ? n("alia.copied") : "" })
|
|
394
|
+
] });
|
|
395
|
+
}
|
|
396
|
+
function ls({
|
|
397
|
+
attachments: s,
|
|
398
|
+
onRemove: i
|
|
399
|
+
}) {
|
|
400
|
+
const { t } = x();
|
|
401
|
+
return s.length === 0 ? null : /* @__PURE__ */ e(
|
|
402
|
+
"ul",
|
|
403
|
+
{
|
|
404
|
+
"aria-label": t("alia.attachmentsLabel"),
|
|
405
|
+
className: "ds:m-0 ds:flex ds:list-none ds:flex-wrap ds:gap-[var(--spacing-xs)] ds:p-0",
|
|
406
|
+
children: s.map((d) => /* @__PURE__ */ m(
|
|
407
|
+
"li",
|
|
408
|
+
{
|
|
409
|
+
className: [
|
|
410
|
+
"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
411
|
+
"ds:rounded-[var(--radius-full)] ds:bg-[var(--muted)]",
|
|
412
|
+
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-xs)]",
|
|
413
|
+
"ds:pt-[var(--spacing-xs)] ds:pb-[var(--spacing-xs)]"
|
|
414
|
+
].join(" "),
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ e(
|
|
417
|
+
_e,
|
|
418
|
+
{
|
|
419
|
+
"aria-hidden": "true",
|
|
420
|
+
className: "ds:size-3.5 ds:text-[color:var(--muted-foreground)]"
|
|
421
|
+
}
|
|
422
|
+
),
|
|
423
|
+
/* @__PURE__ */ e("span", { dir: "auto", className: "type-meta ds:max-w-[12rem] ds:truncate", children: d.name }),
|
|
424
|
+
i ? /* @__PURE__ */ e(
|
|
425
|
+
w,
|
|
426
|
+
{
|
|
427
|
+
icon: /* @__PURE__ */ e(te, {}),
|
|
428
|
+
"aria-label": t("alia.removeAttachment", { name: d.name }),
|
|
429
|
+
intent: "ghost",
|
|
430
|
+
size: "sm",
|
|
431
|
+
onClick: () => i(d.id)
|
|
432
|
+
}
|
|
433
|
+
) : null
|
|
434
|
+
]
|
|
435
|
+
},
|
|
436
|
+
d.id
|
|
437
|
+
))
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
function me() {
|
|
442
|
+
if (typeof window > "u") return;
|
|
443
|
+
const s = window;
|
|
444
|
+
return s.SpeechRecognition ?? s.webkitSpeechRecognition;
|
|
445
|
+
}
|
|
446
|
+
function os({
|
|
447
|
+
lang: s,
|
|
448
|
+
disabled: i,
|
|
449
|
+
onTranscript: t
|
|
450
|
+
}) {
|
|
451
|
+
const { t: d } = x(), [a, l] = L(!1), p = Le(null), n = U(() => {
|
|
452
|
+
var o;
|
|
453
|
+
(o = p.current) == null || o.stop(), l(!1);
|
|
454
|
+
}, []), c = U(() => {
|
|
455
|
+
const o = me();
|
|
456
|
+
if (!o) return;
|
|
457
|
+
const r = new o();
|
|
458
|
+
r.lang = s, r.continuous = !1, r.interimResults = !1, r.onresult = (g) => {
|
|
459
|
+
let v = "";
|
|
460
|
+
for (let C = 0; C < g.results.length; C++)
|
|
461
|
+
v += g.results[C][0].transcript;
|
|
462
|
+
v && t(v);
|
|
463
|
+
}, r.onend = () => l(!1), r.onerror = () => l(!1), p.current = r, r.start(), l(!0);
|
|
464
|
+
}, [s, t]);
|
|
465
|
+
return de(() => {
|
|
466
|
+
if (!a) return;
|
|
467
|
+
const o = (r) => {
|
|
468
|
+
r.key === "Escape" && n();
|
|
469
|
+
};
|
|
470
|
+
return window.addEventListener("keydown", o), () => window.removeEventListener("keydown", o);
|
|
471
|
+
}, [a, n]), de(() => () => {
|
|
472
|
+
var o;
|
|
473
|
+
return (o = p.current) == null ? void 0 : o.stop();
|
|
474
|
+
}, []), /* @__PURE__ */ e(
|
|
475
|
+
w,
|
|
476
|
+
{
|
|
477
|
+
icon: /* @__PURE__ */ e(qe, {}),
|
|
478
|
+
"aria-label": d(a ? "alia.dictateStop" : "alia.dictate"),
|
|
479
|
+
"aria-pressed": a,
|
|
480
|
+
intent: a ? "primary" : "ghost",
|
|
481
|
+
size: "sm",
|
|
482
|
+
disabled: i,
|
|
483
|
+
onClick: () => a ? n() : c(),
|
|
484
|
+
className: a ? "ds:motion-safe:animate-pulse ds:motion-reduce:animate-none ds:[.theme-accessible_&]:animate-none" : void 0
|
|
485
|
+
}
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
function cs({
|
|
489
|
+
initialText: s,
|
|
490
|
+
onSave: i,
|
|
491
|
+
onCancel: t
|
|
492
|
+
}) {
|
|
493
|
+
const { t: d } = x(), [a, l] = L(s);
|
|
494
|
+
return /* @__PURE__ */ m(
|
|
495
|
+
"div",
|
|
496
|
+
{
|
|
497
|
+
className: "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
498
|
+
"data-testid": "alia-message-editor",
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ e(
|
|
501
|
+
ne,
|
|
502
|
+
{
|
|
503
|
+
label: d("alia.editMessage"),
|
|
504
|
+
value: a,
|
|
505
|
+
onChange: (p) => l(p.target.value),
|
|
506
|
+
submitOnEnter: !0,
|
|
507
|
+
onSubmit: (p) => i(p),
|
|
508
|
+
minRows: 2
|
|
509
|
+
}
|
|
510
|
+
),
|
|
511
|
+
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)]", children: [
|
|
512
|
+
/* @__PURE__ */ e(S, { intent: "ghost", size: "sm", onClick: t, children: d("alia.cancelEdit") }),
|
|
513
|
+
/* @__PURE__ */ e(
|
|
514
|
+
S,
|
|
515
|
+
{
|
|
516
|
+
intent: "primary",
|
|
517
|
+
size: "sm",
|
|
518
|
+
onClick: () => i(a),
|
|
519
|
+
disabled: a.trim().length === 0,
|
|
520
|
+
children: d("alia.saveEdit")
|
|
521
|
+
}
|
|
522
|
+
)
|
|
523
|
+
] })
|
|
524
|
+
]
|
|
525
|
+
}
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
const O = D(
|
|
529
|
+
({
|
|
530
|
+
messages: s,
|
|
531
|
+
onSend: i,
|
|
532
|
+
onRetry: t,
|
|
533
|
+
onSuggestion: d,
|
|
534
|
+
suggestions: a,
|
|
535
|
+
isGenerating: l = !1,
|
|
536
|
+
onStopGenerating: p,
|
|
537
|
+
usage: n,
|
|
538
|
+
onUpgrade: c,
|
|
539
|
+
assistantName: o,
|
|
540
|
+
assistantAvatar: r,
|
|
541
|
+
userAvatar: g,
|
|
542
|
+
greeting: v,
|
|
543
|
+
subtitle: C,
|
|
544
|
+
density: k = "default",
|
|
545
|
+
renderMarkdown: $ = !0,
|
|
546
|
+
onNewConversation: pe,
|
|
547
|
+
onAttach: ue,
|
|
548
|
+
acceptedFileTypes: fe,
|
|
549
|
+
headerEndSlot: he,
|
|
550
|
+
ended: I,
|
|
551
|
+
messageActions: E,
|
|
552
|
+
onCopyMessage: G,
|
|
553
|
+
onDownloadMessage: V,
|
|
554
|
+
voiceInput: ge,
|
|
555
|
+
onVoiceTranscript: H,
|
|
556
|
+
attachments: W,
|
|
557
|
+
onRemoveAttachment: ve,
|
|
558
|
+
showScrollToLatest: be,
|
|
559
|
+
onRegenerate: _,
|
|
560
|
+
onEditMessage: R
|
|
561
|
+
}, xe) => {
|
|
562
|
+
const { t: h, i18n: Ne } = x(), [A, X] = L(null), [we, q] = L(""), P = !!ge && me() != null, Q = M(() => {
|
|
563
|
+
for (let f = s.length - 1; f >= 0; f--) {
|
|
564
|
+
const b = s[f];
|
|
565
|
+
if (b.role === "assistant" && !b.streaming) return b.id;
|
|
566
|
+
}
|
|
567
|
+
}, [s]), j = I != null, N = o ?? h("alia.name"), ye = v ?? h("alia.greeting"), Ce = C ?? h("alia.subtitle"), y = s[s.length - 1], B = (y == null ? void 0 : y.role) === "assistant" && y.streaming === !0, ee = B ? s.slice(0, -1) : s, ke = M(() => {
|
|
568
|
+
const f = h("chat.message.role.user"), b = ee.map((u) => {
|
|
569
|
+
let K;
|
|
570
|
+
if (u.role === "assistant" ? K = r != null && r.src ? { name: N, src: r.src } : {
|
|
571
|
+
slot: /* @__PURE__ */ e(
|
|
572
|
+
T,
|
|
573
|
+
{
|
|
574
|
+
size: "sm",
|
|
575
|
+
label: N,
|
|
576
|
+
appearance: "spinner"
|
|
577
|
+
}
|
|
578
|
+
)
|
|
579
|
+
} : u.role === "user" && (K = Ae(g, f)), u.role === "user" && R && A === u.id)
|
|
580
|
+
return {
|
|
581
|
+
id: u.id,
|
|
582
|
+
node: /* @__PURE__ */ e(
|
|
583
|
+
cs,
|
|
584
|
+
{
|
|
585
|
+
initialText: u.content,
|
|
586
|
+
onSave: (je) => {
|
|
587
|
+
R(u.id, je), X(null);
|
|
588
|
+
},
|
|
589
|
+
onCancel: () => X(null)
|
|
590
|
+
}
|
|
591
|
+
)
|
|
592
|
+
};
|
|
593
|
+
let Z;
|
|
594
|
+
return u.role === "assistant" && (E && E.length > 0 || _ && u.id === Q) ? Z = /* @__PURE__ */ e(
|
|
595
|
+
ns,
|
|
596
|
+
{
|
|
597
|
+
message: u,
|
|
598
|
+
actions: E ?? [],
|
|
599
|
+
assistantName: N,
|
|
600
|
+
canRegenerate: !!_ && u.id === Q,
|
|
601
|
+
onCopyMessage: G,
|
|
602
|
+
onDownloadMessage: V,
|
|
603
|
+
onRegenerate: _
|
|
604
|
+
}
|
|
605
|
+
) : u.role === "user" && R && (Z = /* @__PURE__ */ e(
|
|
606
|
+
w,
|
|
607
|
+
{
|
|
608
|
+
icon: /* @__PURE__ */ e(De, {}),
|
|
609
|
+
"aria-label": h("alia.editMessage"),
|
|
610
|
+
intent: "ghost",
|
|
611
|
+
size: "sm",
|
|
612
|
+
onClick: () => X(u.id)
|
|
613
|
+
}
|
|
614
|
+
)), {
|
|
615
|
+
id: u.id,
|
|
616
|
+
node: /* @__PURE__ */ e(
|
|
617
|
+
Ee,
|
|
618
|
+
{
|
|
619
|
+
role: u.role,
|
|
620
|
+
content: u.content,
|
|
621
|
+
avatar: K,
|
|
622
|
+
timestamp: u.timestamp,
|
|
623
|
+
status: u.status,
|
|
624
|
+
renderMarkdown: $,
|
|
625
|
+
onRetry: t ? () => t(u.id) : void 0,
|
|
626
|
+
actions: Z
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
};
|
|
630
|
+
});
|
|
631
|
+
return B && y && b.push({
|
|
632
|
+
id: y.id,
|
|
633
|
+
node: /* @__PURE__ */ e(
|
|
634
|
+
ss,
|
|
635
|
+
{
|
|
636
|
+
message: y,
|
|
637
|
+
assistantName: N,
|
|
638
|
+
avatarSrc: r == null ? void 0 : r.src,
|
|
639
|
+
renderMarkdown: $
|
|
640
|
+
}
|
|
641
|
+
)
|
|
642
|
+
}), l && !B && b.push({
|
|
643
|
+
id: "__alia-typing__",
|
|
644
|
+
node: /* @__PURE__ */ m("div", { className: "ds:flex ds:w-full ds:items-start ds:gap-[var(--spacing-sm)]", children: [
|
|
645
|
+
r != null && r.src ? /* @__PURE__ */ e(
|
|
646
|
+
F,
|
|
647
|
+
{
|
|
648
|
+
name: N,
|
|
649
|
+
src: r.src,
|
|
650
|
+
size: "sm"
|
|
651
|
+
}
|
|
652
|
+
) : /* @__PURE__ */ e(
|
|
653
|
+
T,
|
|
654
|
+
{
|
|
655
|
+
size: "sm",
|
|
656
|
+
label: N,
|
|
657
|
+
appearance: "spinner"
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
/* @__PURE__ */ e(
|
|
661
|
+
"div",
|
|
662
|
+
{
|
|
663
|
+
className: [
|
|
664
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
665
|
+
"ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]",
|
|
666
|
+
"ds:rounded-[var(--radius-md)] ds:rounded-es-[var(--radius-sm)]",
|
|
667
|
+
"ds:bg-muted/40"
|
|
668
|
+
].join(" "),
|
|
669
|
+
children: /* @__PURE__ */ e(Be, { label: h("chat.typing"), density: k })
|
|
670
|
+
}
|
|
671
|
+
)
|
|
672
|
+
] })
|
|
673
|
+
}), I && b.push({
|
|
674
|
+
id: "__alia-ended__",
|
|
675
|
+
node: /* @__PURE__ */ e(Ve, { note: I.note })
|
|
676
|
+
}), b;
|
|
677
|
+
}, [
|
|
678
|
+
ee,
|
|
679
|
+
B,
|
|
680
|
+
y,
|
|
681
|
+
l,
|
|
682
|
+
N,
|
|
683
|
+
r == null ? void 0 : r.src,
|
|
684
|
+
g,
|
|
685
|
+
$,
|
|
686
|
+
t,
|
|
687
|
+
k,
|
|
688
|
+
I,
|
|
689
|
+
h,
|
|
690
|
+
A,
|
|
691
|
+
R,
|
|
692
|
+
E,
|
|
693
|
+
_,
|
|
694
|
+
Q,
|
|
695
|
+
G,
|
|
696
|
+
V
|
|
697
|
+
]), ze = n ? Math.min(
|
|
698
|
+
100,
|
|
699
|
+
Math.max(0, n.current / Math.max(1, n.limit) * 100)
|
|
700
|
+
) : 0, z = n ? n.current >= n.limit : !1, se = n ? n.label ?? h("alia.usageLabel", {
|
|
701
|
+
current: n.current,
|
|
702
|
+
limit: n.limit
|
|
703
|
+
}) : null, ae = s.length === 0 && !l && !j, ie = /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
704
|
+
n ? /* @__PURE__ */ m("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
705
|
+
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]", children: [
|
|
706
|
+
/* @__PURE__ */ e(
|
|
707
|
+
"span",
|
|
708
|
+
{
|
|
709
|
+
className: [
|
|
710
|
+
"type-meta",
|
|
711
|
+
z ? "ds:text-[color:var(--destructive)]" : "ds:text-[color:var(--muted-foreground)]"
|
|
712
|
+
].join(" "),
|
|
713
|
+
"data-testid": "alia-usage-label",
|
|
714
|
+
children: z ? h("alia.usageLimitReached") : se
|
|
715
|
+
}
|
|
716
|
+
),
|
|
717
|
+
z && c ? /* @__PURE__ */ e(S, { intent: "primary", size: "sm", onClick: c, children: h("alia.upgrade") }) : null
|
|
718
|
+
] }),
|
|
719
|
+
/* @__PURE__ */ e(
|
|
720
|
+
Ue,
|
|
721
|
+
{
|
|
722
|
+
value: ze,
|
|
723
|
+
max: 100,
|
|
724
|
+
size: "sm",
|
|
725
|
+
ariaLabel: se ?? h("alia.usageLabel", {
|
|
726
|
+
current: n.current,
|
|
727
|
+
limit: n.limit
|
|
728
|
+
}),
|
|
729
|
+
className: z ? "ds:[&_[role=progressbar]>*]:bg-[color:var(--destructive)]" : void 0,
|
|
730
|
+
"data-testid": "alia-usage-progress"
|
|
731
|
+
}
|
|
732
|
+
)
|
|
733
|
+
] }) : null,
|
|
734
|
+
!ae && a && a.length > 0 && !l && !j ? /* @__PURE__ */ e(
|
|
735
|
+
le,
|
|
736
|
+
{
|
|
737
|
+
label: h("alia.exampleQuestions"),
|
|
738
|
+
"data-testid": "alia-followup-suggestions",
|
|
739
|
+
children: a.map((f) => /* @__PURE__ */ e(
|
|
740
|
+
oe,
|
|
741
|
+
{
|
|
742
|
+
intent: "followup",
|
|
743
|
+
startIcon: f.icon,
|
|
744
|
+
keepOnSelect: !0,
|
|
745
|
+
onSelect: () => d == null ? void 0 : d(f),
|
|
746
|
+
children: f.label
|
|
747
|
+
},
|
|
748
|
+
f.id
|
|
749
|
+
))
|
|
750
|
+
}
|
|
751
|
+
) : null,
|
|
752
|
+
W && W.length > 0 ? /* @__PURE__ */ e(
|
|
753
|
+
ls,
|
|
754
|
+
{
|
|
755
|
+
attachments: W,
|
|
756
|
+
onRemove: ve
|
|
757
|
+
}
|
|
758
|
+
) : null,
|
|
759
|
+
/* @__PURE__ */ m("div", { className: "ds:flex ds:items-end ds:gap-[var(--spacing-sm)]", children: [
|
|
760
|
+
/* @__PURE__ */ e("div", { className: "ds:flex-1 ds:min-w-0", children: /* @__PURE__ */ e(
|
|
761
|
+
ne,
|
|
762
|
+
{
|
|
763
|
+
submitOnEnter: !0,
|
|
764
|
+
onSubmit: P ? (f) => {
|
|
765
|
+
i(f), q("");
|
|
766
|
+
} : i,
|
|
767
|
+
value: P ? we : void 0,
|
|
768
|
+
onChange: P ? (f) => q(f.target.value) : void 0,
|
|
769
|
+
onAttach: ue,
|
|
770
|
+
accept: fe,
|
|
771
|
+
disabled: z || j,
|
|
772
|
+
toolbar: P ? /* @__PURE__ */ e(
|
|
773
|
+
os,
|
|
774
|
+
{
|
|
775
|
+
lang: Ne.language,
|
|
776
|
+
disabled: z || j,
|
|
777
|
+
onTranscript: (f) => {
|
|
778
|
+
H == null || H(f), q(
|
|
779
|
+
(b) => b ? `${b} ${f}` : f
|
|
780
|
+
);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
) : void 0,
|
|
784
|
+
"data-testid": "alia-composer"
|
|
785
|
+
}
|
|
786
|
+
) }),
|
|
787
|
+
l && p && !j ? /* @__PURE__ */ e(
|
|
788
|
+
S,
|
|
789
|
+
{
|
|
790
|
+
intent: "outline",
|
|
791
|
+
size: "sm",
|
|
792
|
+
startIcon: /* @__PURE__ */ e(Fe, { "aria-hidden": "true" }),
|
|
793
|
+
onClick: p,
|
|
794
|
+
"aria-label": h("alia.stopGenerating"),
|
|
795
|
+
children: h("alia.stopGenerating")
|
|
796
|
+
}
|
|
797
|
+
) : null
|
|
798
|
+
] })
|
|
799
|
+
] });
|
|
800
|
+
return /* @__PURE__ */ m(
|
|
801
|
+
"div",
|
|
802
|
+
{
|
|
803
|
+
ref: xe,
|
|
804
|
+
className: [
|
|
805
|
+
"ds:flex ds:min-h-0 ds:flex-1 ds:flex-col",
|
|
806
|
+
"ds:bg-[var(--background)] ds:text-[color:var(--foreground)]"
|
|
807
|
+
].join(" "),
|
|
808
|
+
"data-testid": "alia-surface",
|
|
809
|
+
children: [
|
|
810
|
+
/* @__PURE__ */ e(
|
|
811
|
+
as,
|
|
812
|
+
{
|
|
813
|
+
assistantName: N,
|
|
814
|
+
avatarSrc: r == null ? void 0 : r.src,
|
|
815
|
+
onNewConversation: pe,
|
|
816
|
+
headerEndSlot: he,
|
|
817
|
+
density: k
|
|
818
|
+
}
|
|
819
|
+
),
|
|
820
|
+
ae ? /* @__PURE__ */ m(re, { children: [
|
|
821
|
+
/* @__PURE__ */ e(
|
|
822
|
+
es,
|
|
823
|
+
{
|
|
824
|
+
assistantName: N,
|
|
825
|
+
avatarSrc: r == null ? void 0 : r.src,
|
|
826
|
+
greeting: ye,
|
|
827
|
+
subtitle: Ce,
|
|
828
|
+
suggestions: a,
|
|
829
|
+
onSuggestion: d
|
|
830
|
+
}
|
|
831
|
+
),
|
|
832
|
+
/* @__PURE__ */ e(
|
|
833
|
+
"div",
|
|
834
|
+
{
|
|
835
|
+
className: [
|
|
836
|
+
// No top divider — the ChatInput's own soft shadow + the
|
|
837
|
+
// border-radius give it enough visual containment, and a
|
|
838
|
+
// surface-level separator here read as a sharp line at
|
|
839
|
+
// 1px-equivalent shadow blur. Keep the bg explicit so
|
|
840
|
+
// the chat-input chrome paints over the messages-area
|
|
841
|
+
// background instead of mixing with it.
|
|
842
|
+
"ds:shrink-0 ds:bg-[var(--background)]",
|
|
843
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]",
|
|
844
|
+
"ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]"
|
|
845
|
+
].join(" "),
|
|
846
|
+
children: ie
|
|
847
|
+
}
|
|
848
|
+
)
|
|
849
|
+
] }) : /* @__PURE__ */ e(
|
|
850
|
+
Ie,
|
|
851
|
+
{
|
|
852
|
+
messages: ke,
|
|
853
|
+
density: k,
|
|
854
|
+
composer: ie,
|
|
855
|
+
showScrollToLatest: be,
|
|
856
|
+
className: "ds:flex-1 ds:min-h-0"
|
|
857
|
+
}
|
|
858
|
+
)
|
|
859
|
+
]
|
|
860
|
+
}
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
);
|
|
864
|
+
O.displayName = "AliaChatSurface";
|
|
865
|
+
const ms = D(
|
|
866
|
+
({ headerSlot: s, ...i }, t) => /* @__PURE__ */ m(
|
|
867
|
+
"div",
|
|
868
|
+
{
|
|
869
|
+
ref: t,
|
|
870
|
+
className: [
|
|
871
|
+
"ds:flex ds:min-h-0 ds:flex-1 ds:flex-col",
|
|
872
|
+
"ds:bg-[var(--background)] ds:text-[color:var(--foreground)]",
|
|
873
|
+
"ds:h-full ds:w-full"
|
|
874
|
+
].join(" "),
|
|
875
|
+
"data-testid": "alia-embedded",
|
|
876
|
+
children: [
|
|
877
|
+
s ? /* @__PURE__ */ e(
|
|
878
|
+
"div",
|
|
879
|
+
{
|
|
880
|
+
className: [
|
|
881
|
+
"ds:shrink-0",
|
|
882
|
+
"ds:ps-[var(--spacing-lg)] ds:pe-[var(--spacing-lg)]",
|
|
883
|
+
"ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]"
|
|
884
|
+
].join(" "),
|
|
885
|
+
children: s
|
|
886
|
+
}
|
|
887
|
+
) : null,
|
|
888
|
+
/* @__PURE__ */ e("div", { className: "ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:items-stretch", children: /* @__PURE__ */ e(
|
|
889
|
+
"div",
|
|
890
|
+
{
|
|
891
|
+
className: [
|
|
892
|
+
"ds:flex ds:min-h-0 ds:w-full ds:flex-1 ds:flex-col",
|
|
893
|
+
"ds:ms-auto ds:me-auto",
|
|
894
|
+
"ds:[max-inline-size:48rem]",
|
|
895
|
+
"ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]"
|
|
896
|
+
].join(" "),
|
|
897
|
+
children: /* @__PURE__ */ e(O, { ...i })
|
|
898
|
+
}
|
|
899
|
+
) })
|
|
900
|
+
]
|
|
901
|
+
}
|
|
902
|
+
)
|
|
903
|
+
);
|
|
904
|
+
ms.displayName = "AliaEmbedded";
|
|
905
|
+
function ps(s) {
|
|
906
|
+
return s > 99 ? "99+" : String(s);
|
|
907
|
+
}
|
|
908
|
+
const us = D(
|
|
909
|
+
({
|
|
910
|
+
open: s,
|
|
911
|
+
onOpenChange: i,
|
|
912
|
+
position: t = "bottom-end",
|
|
913
|
+
unseenCount: d,
|
|
914
|
+
assistantName: a,
|
|
915
|
+
assistantAvatar: l,
|
|
916
|
+
...p
|
|
917
|
+
}, n) => {
|
|
918
|
+
const { t: c } = x(), o = a || c("alia.name"), r = typeof d == "number" && d > 0, g = r ? c("alia.unseenCount", { count: d }) : c("alia.open"), v = /* @__PURE__ */ e(Se.Close, { asChild: !0, children: /* @__PURE__ */ e(
|
|
919
|
+
w,
|
|
920
|
+
{
|
|
921
|
+
icon: /* @__PURE__ */ e(te, { "aria-hidden": "true" }),
|
|
922
|
+
intent: "ghost",
|
|
923
|
+
size: "sm",
|
|
924
|
+
"aria-label": c("alia.close"),
|
|
925
|
+
"data-testid": "alia-popout-close"
|
|
926
|
+
}
|
|
927
|
+
) });
|
|
928
|
+
return /* @__PURE__ */ m(J.Root, { open: s, onOpenChange: i, children: [
|
|
929
|
+
/* @__PURE__ */ e(
|
|
930
|
+
"div",
|
|
931
|
+
{
|
|
932
|
+
ref: n,
|
|
933
|
+
className: [
|
|
934
|
+
"ds:fixed ds:z-[var(--z-fixed)]",
|
|
935
|
+
"ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))]",
|
|
936
|
+
t === "bottom-end" ? "ds:end-[var(--spacing-lg)]" : "ds:start-[var(--spacing-lg)]"
|
|
937
|
+
].join(" "),
|
|
938
|
+
"data-testid": "alia-popout-fab-wrapper",
|
|
939
|
+
children: /* @__PURE__ */ m("div", { className: "ds:relative", children: [
|
|
940
|
+
/* @__PURE__ */ e(
|
|
941
|
+
Te,
|
|
942
|
+
{
|
|
943
|
+
icon: /* @__PURE__ */ e(Y, { "aria-hidden": "true" }),
|
|
944
|
+
"aria-label": g,
|
|
945
|
+
variant: "primary",
|
|
946
|
+
size: "md",
|
|
947
|
+
position: "static",
|
|
948
|
+
onClick: () => i(!0),
|
|
949
|
+
"data-testid": "alia-popout-fab"
|
|
950
|
+
}
|
|
951
|
+
),
|
|
952
|
+
r ? /* @__PURE__ */ e(
|
|
953
|
+
"span",
|
|
954
|
+
{
|
|
955
|
+
"aria-hidden": "true",
|
|
956
|
+
"data-testid": "alia-popout-badge",
|
|
957
|
+
className: [
|
|
958
|
+
"ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]",
|
|
959
|
+
"ds:inline-flex ds:items-center ds:justify-center",
|
|
960
|
+
"ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]",
|
|
961
|
+
"ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]",
|
|
962
|
+
"ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]",
|
|
963
|
+
"ds:rounded-[var(--radius-full)]",
|
|
964
|
+
"ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]",
|
|
965
|
+
"ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none",
|
|
966
|
+
"ds:pointer-events-none ds:select-none",
|
|
967
|
+
"ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]"
|
|
968
|
+
].join(" "),
|
|
969
|
+
children: ps(d)
|
|
970
|
+
}
|
|
971
|
+
) : null
|
|
972
|
+
] })
|
|
973
|
+
}
|
|
974
|
+
),
|
|
975
|
+
/* @__PURE__ */ m(
|
|
976
|
+
J.Content,
|
|
977
|
+
{
|
|
978
|
+
side: "end",
|
|
979
|
+
size: "md",
|
|
980
|
+
"aria-label": c("alia.panelLabel"),
|
|
981
|
+
className: "ds:flex ds:min-h-0 ds:flex-col ds:p-0",
|
|
982
|
+
"data-testid": "alia-popout-panel",
|
|
983
|
+
children: [
|
|
984
|
+
/* @__PURE__ */ e(J.Title, { className: "ds:sr-only", children: o }),
|
|
985
|
+
/* @__PURE__ */ e(
|
|
986
|
+
O,
|
|
987
|
+
{
|
|
988
|
+
...p,
|
|
989
|
+
assistantName: o,
|
|
990
|
+
assistantAvatar: l,
|
|
991
|
+
density: "compact",
|
|
992
|
+
headerEndSlot: v
|
|
993
|
+
}
|
|
994
|
+
)
|
|
995
|
+
]
|
|
996
|
+
}
|
|
997
|
+
)
|
|
998
|
+
] });
|
|
999
|
+
}
|
|
1000
|
+
);
|
|
1001
|
+
us.displayName = "AliaPopout";
|
|
1002
|
+
function fs(s) {
|
|
1003
|
+
return s > 99 ? "99+" : String(s);
|
|
1004
|
+
}
|
|
1005
|
+
const hs = "ds:[inline-size:22rem]", gs = "ds:[inline-size:3rem]", vs = D(
|
|
1006
|
+
({
|
|
1007
|
+
open: s,
|
|
1008
|
+
onOpenChange: i,
|
|
1009
|
+
side: t = "end",
|
|
1010
|
+
unseenCount: d,
|
|
1011
|
+
footerSlot: a,
|
|
1012
|
+
assistantName: l,
|
|
1013
|
+
assistantAvatar: p,
|
|
1014
|
+
...n
|
|
1015
|
+
}, c) => {
|
|
1016
|
+
const { t: o } = x(), r = l || o("alia.name"), g = typeof d == "number" && d > 0, v = t === "end" ? "ds:shadow-[var(--shadow-chrome-start)]" : "ds:shadow-[var(--shadow-chrome-end)]", C = g ? o("alia.unseenCount", { count: d }) : o("alia.open");
|
|
1017
|
+
if (!s)
|
|
1018
|
+
return /* @__PURE__ */ e(
|
|
1019
|
+
"aside",
|
|
1020
|
+
{
|
|
1021
|
+
ref: c,
|
|
1022
|
+
"aria-label": o("alia.panelLabel"),
|
|
1023
|
+
className: [
|
|
1024
|
+
"ds:flex ds:shrink-0 ds:flex-col ds:items-center",
|
|
1025
|
+
"ds:bg-[var(--background)]",
|
|
1026
|
+
v,
|
|
1027
|
+
"ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]",
|
|
1028
|
+
gs
|
|
1029
|
+
].join(" "),
|
|
1030
|
+
"data-testid": "alia-sidebar-rail",
|
|
1031
|
+
"data-alia-sidebar-state": "collapsed",
|
|
1032
|
+
children: /* @__PURE__ */ m("div", { className: "ds:relative ds:[&_svg]:text-[color:var(--accent)]", children: [
|
|
1033
|
+
/* @__PURE__ */ e(
|
|
1034
|
+
w,
|
|
1035
|
+
{
|
|
1036
|
+
icon: /* @__PURE__ */ e(Y, { "aria-hidden": "true" }),
|
|
1037
|
+
"aria-label": C,
|
|
1038
|
+
"aria-expanded": "false",
|
|
1039
|
+
intent: "ghost",
|
|
1040
|
+
size: "sm",
|
|
1041
|
+
onClick: () => i(!0),
|
|
1042
|
+
"data-testid": "alia-sidebar-rail-trigger"
|
|
1043
|
+
}
|
|
1044
|
+
),
|
|
1045
|
+
g ? /* @__PURE__ */ e(
|
|
1046
|
+
"span",
|
|
1047
|
+
{
|
|
1048
|
+
"aria-hidden": "true",
|
|
1049
|
+
"data-testid": "alia-sidebar-badge",
|
|
1050
|
+
className: [
|
|
1051
|
+
"ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]",
|
|
1052
|
+
"ds:inline-flex ds:items-center ds:justify-center",
|
|
1053
|
+
"ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]",
|
|
1054
|
+
"ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]",
|
|
1055
|
+
"ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]",
|
|
1056
|
+
"ds:rounded-[var(--radius-full)]",
|
|
1057
|
+
"ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]",
|
|
1058
|
+
"ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none",
|
|
1059
|
+
"ds:pointer-events-none ds:select-none",
|
|
1060
|
+
"ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]"
|
|
1061
|
+
].join(" "),
|
|
1062
|
+
children: fs(d)
|
|
1063
|
+
}
|
|
1064
|
+
) : null
|
|
1065
|
+
] })
|
|
1066
|
+
}
|
|
1067
|
+
);
|
|
1068
|
+
const k = /* @__PURE__ */ e(
|
|
1069
|
+
w,
|
|
1070
|
+
{
|
|
1071
|
+
icon: t === "end" ? /* @__PURE__ */ e(Ze, {}) : /* @__PURE__ */ e(Je, {}),
|
|
1072
|
+
intent: "ghost",
|
|
1073
|
+
size: "sm",
|
|
1074
|
+
"aria-label": o("alia.close"),
|
|
1075
|
+
"aria-expanded": "true",
|
|
1076
|
+
onClick: () => i(!1),
|
|
1077
|
+
"data-testid": "alia-sidebar-collapse"
|
|
1078
|
+
}
|
|
1079
|
+
);
|
|
1080
|
+
return /* @__PURE__ */ m(
|
|
1081
|
+
"aside",
|
|
1082
|
+
{
|
|
1083
|
+
ref: c,
|
|
1084
|
+
"aria-label": o("alia.panelLabel"),
|
|
1085
|
+
className: [
|
|
1086
|
+
"ds:flex ds:shrink-0 ds:flex-col ds:min-h-0",
|
|
1087
|
+
"ds:bg-[var(--background)]",
|
|
1088
|
+
v,
|
|
1089
|
+
hs,
|
|
1090
|
+
"ds:h-full"
|
|
1091
|
+
].join(" "),
|
|
1092
|
+
"data-testid": "alia-sidebar",
|
|
1093
|
+
"data-alia-sidebar-state": "expanded",
|
|
1094
|
+
children: [
|
|
1095
|
+
/* @__PURE__ */ e("div", { className: "ds:flex ds:min-h-0 ds:flex-1 ds:flex-col", children: /* @__PURE__ */ e(
|
|
1096
|
+
O,
|
|
1097
|
+
{
|
|
1098
|
+
...n,
|
|
1099
|
+
assistantName: r,
|
|
1100
|
+
assistantAvatar: p,
|
|
1101
|
+
density: "compact",
|
|
1102
|
+
headerEndSlot: k
|
|
1103
|
+
}
|
|
1104
|
+
) }),
|
|
1105
|
+
a ? /* @__PURE__ */ e(
|
|
1106
|
+
"div",
|
|
1107
|
+
{
|
|
1108
|
+
"data-testid": "alia-sidebar-footer-slot",
|
|
1109
|
+
className: "ds:shrink-0 ds:shadow-[var(--shadow-chrome-up)]",
|
|
1110
|
+
children: a
|
|
1111
|
+
}
|
|
1112
|
+
) : null
|
|
1113
|
+
]
|
|
1114
|
+
}
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
);
|
|
1118
|
+
vs.displayName = "AliaSidebar";
|
|
1119
|
+
export {
|
|
1120
|
+
O as A,
|
|
1121
|
+
ms as a,
|
|
1122
|
+
us as b,
|
|
1123
|
+
vs as c
|
|
1124
|
+
};
|
|
1125
|
+
//# sourceMappingURL=alia-sidebar-CVIPrdc9.js.map
|