@automattic/agenttic-ui 0.1.76 → 0.1.77
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/{DiffCard-eat_q_SY.js → DiffCard-WlOKTIaG.js} +455 -435
- package/dist/DiffCard.css +1 -1
- package/dist/components/chat/ChatInput.d.ts +2 -1
- package/dist/components/chat/ChatInput.d.ts.map +1 -1
- package/dist/components/chat/ChatInput.stories.d.ts +2 -0
- package/dist/components/chat/ChatInput.stories.d.ts.map +1 -1
- package/dist/components/chat/ImageUploader.d.ts +2 -1
- package/dist/components/chat/ImageUploader.d.ts.map +1 -1
- package/dist/components/composable/AgentUIInput.d.ts +3 -1
- package/dist/components/composable/AgentUIInput.d.ts.map +1 -1
- package/dist/embedded-agent-ui.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.js +1818 -1770
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as p, Fragment as Y } from "react/jsx-runtime";
|
|
2
2
|
import { __ as w } from "@wordpress/i18n";
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import { AnimatePresence as
|
|
6
|
-
import { Slot as
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
3
|
+
import * as it from "react";
|
|
4
|
+
import k, { createContext as pt, useContext as ht, useState as ft, useEffect as tt, useId as gt, useCallback as et, useRef as bt, useMemo as st } from "react";
|
|
5
|
+
import { AnimatePresence as lt, motion as W } from "framer-motion";
|
|
6
|
+
import { Slot as Ct } from "@radix-ui/react-slot";
|
|
7
|
+
import * as O from "@radix-ui/react-popover";
|
|
8
|
+
import vt from "react-markdown";
|
|
9
9
|
import './DiffCard.css';function v(...t) {
|
|
10
10
|
return t.flat().filter(Boolean).map((n) => typeof n == "string" ? n : typeof n == "object" && !Array.isArray(n) && n !== null ? Object.entries(n).filter(([o, a]) => a).map(([o]) => o).join(" ") : "").join(" ").trim();
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const J = {
|
|
13
13
|
type: "spring",
|
|
14
14
|
stiffness: 300,
|
|
15
15
|
damping: 30
|
|
@@ -22,24 +22,24 @@ const Y = {
|
|
|
22
22
|
...U,
|
|
23
23
|
stiffness: 1e3,
|
|
24
24
|
damping: 90
|
|
25
|
-
},
|
|
25
|
+
}, wt = {
|
|
26
26
|
type: "spring",
|
|
27
27
|
damping: 40,
|
|
28
28
|
stiffness: 500,
|
|
29
29
|
mass: 0.8
|
|
30
|
-
},
|
|
30
|
+
}, yt = {
|
|
31
31
|
hidden: {
|
|
32
32
|
opacity: 0
|
|
33
33
|
},
|
|
34
34
|
visible: {
|
|
35
35
|
opacity: 1,
|
|
36
|
-
transition:
|
|
36
|
+
transition: J
|
|
37
37
|
},
|
|
38
38
|
exit: {
|
|
39
39
|
opacity: 0,
|
|
40
|
-
transition: { ...
|
|
40
|
+
transition: { ...J, duration: 0.1 }
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, _t = () => {
|
|
43
43
|
if (typeof window > "u")
|
|
44
44
|
return { left: 0, right: 0, top: 0, bottom: 0 };
|
|
45
45
|
const t = 20;
|
|
@@ -51,81 +51,81 @@ const Y = {
|
|
|
51
51
|
bottom: window.innerHeight - 60 - t
|
|
52
52
|
// Assuming collapsed height of 60px
|
|
53
53
|
};
|
|
54
|
-
},
|
|
54
|
+
}, Nt = {
|
|
55
55
|
"0%": { backgroundPosition: "-200% 0" },
|
|
56
56
|
"100%": { backgroundPosition: "200% 0" }
|
|
57
|
-
},
|
|
57
|
+
}, wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
58
58
|
__proto__: null,
|
|
59
|
-
fadeVariants:
|
|
59
|
+
fadeVariants: yt,
|
|
60
60
|
fastSpring: U,
|
|
61
61
|
fastSpringWithDelay: Q,
|
|
62
|
-
getDragConstraints:
|
|
63
|
-
morphSpring:
|
|
64
|
-
springConfig:
|
|
65
|
-
thinkingGradientKeyframes:
|
|
66
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
67
|
-
function
|
|
68
|
-
const t = ht(
|
|
62
|
+
getDragConstraints: _t,
|
|
63
|
+
morphSpring: wt,
|
|
64
|
+
springConfig: J,
|
|
65
|
+
thinkingGradientKeyframes: Nt
|
|
66
|
+
}, Symbol.toStringTag, { value: "Module" })), rt = pt(null);
|
|
67
|
+
function Z() {
|
|
68
|
+
const t = ht(rt);
|
|
69
69
|
if (!t)
|
|
70
70
|
throw new Error(
|
|
71
71
|
"useAgentUIContext must be used within an AgentUIContainer"
|
|
72
72
|
);
|
|
73
73
|
return t;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return /* @__PURE__ */ e(
|
|
75
|
+
function yn({ children: t, value: n }) {
|
|
76
|
+
return /* @__PURE__ */ e(rt.Provider, { value: n, children: t });
|
|
77
77
|
}
|
|
78
|
-
const
|
|
79
|
-
button:
|
|
80
|
-
pressed:
|
|
78
|
+
const xt = "button-module_button", It = "button-module_pressed", St = "button-module_primary", $t = "button-module_ghost", Lt = "button-module_outline", kt = "button-module_transparent", Dt = "button-module_link", At = "button-module_icon", Rt = "button-module_sm", Bt = "button-module_lg", Wt = "button-module_withTextAndIcon", T = {
|
|
79
|
+
button: xt,
|
|
80
|
+
pressed: It,
|
|
81
81
|
primary: St,
|
|
82
|
-
ghost:
|
|
83
|
-
outline:
|
|
84
|
-
transparent:
|
|
85
|
-
link:
|
|
82
|
+
ghost: $t,
|
|
83
|
+
outline: Lt,
|
|
84
|
+
transparent: kt,
|
|
85
|
+
link: Dt,
|
|
86
86
|
icon: At,
|
|
87
|
-
sm:
|
|
88
|
-
lg:
|
|
89
|
-
withTextAndIcon:
|
|
90
|
-
},
|
|
87
|
+
sm: Rt,
|
|
88
|
+
lg: Bt,
|
|
89
|
+
withTextAndIcon: Wt
|
|
90
|
+
}, D = it.forwardRef(
|
|
91
91
|
function({
|
|
92
92
|
className: n,
|
|
93
93
|
variant: o = "primary",
|
|
94
94
|
size: a,
|
|
95
95
|
icon: i,
|
|
96
|
-
children:
|
|
97
|
-
asChild:
|
|
98
|
-
pressed:
|
|
99
|
-
...
|
|
96
|
+
children: s,
|
|
97
|
+
asChild: r = !1,
|
|
98
|
+
pressed: f,
|
|
99
|
+
...g
|
|
100
100
|
}, d) {
|
|
101
|
-
const u =
|
|
102
|
-
return /* @__PURE__ */
|
|
101
|
+
const u = r ? Ct : "button", c = !!i, b = a || (c && !s ? "icon" : void 0);
|
|
102
|
+
return /* @__PURE__ */ p(
|
|
103
103
|
u,
|
|
104
104
|
{
|
|
105
105
|
ref: d,
|
|
106
106
|
"data-slot": "button",
|
|
107
107
|
className: v(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
T.button,
|
|
109
|
+
T[o],
|
|
110
|
+
b && T[b],
|
|
111
|
+
c && s ? T.withTextAndIcon : void 0,
|
|
112
|
+
f ? T.pressed : void 0,
|
|
113
113
|
n
|
|
114
114
|
),
|
|
115
|
-
"aria-pressed":
|
|
116
|
-
...
|
|
115
|
+
"aria-pressed": f,
|
|
116
|
+
...g,
|
|
117
117
|
children: [
|
|
118
118
|
i,
|
|
119
|
-
|
|
119
|
+
s
|
|
120
120
|
]
|
|
121
121
|
}
|
|
122
122
|
);
|
|
123
123
|
}
|
|
124
124
|
);
|
|
125
|
-
|
|
125
|
+
D.displayName = "Button";
|
|
126
126
|
const Mt = "Textarea-module_textarea", jt = {
|
|
127
127
|
textarea: Mt
|
|
128
|
-
},
|
|
128
|
+
}, ct = it.forwardRef(
|
|
129
129
|
({ className: t, ...n }, o) => /* @__PURE__ */ e(
|
|
130
130
|
"textarea",
|
|
131
131
|
{
|
|
@@ -136,7 +136,7 @@ const Mt = "Textarea-module_textarea", jt = {
|
|
|
136
136
|
}
|
|
137
137
|
)
|
|
138
138
|
);
|
|
139
|
-
|
|
139
|
+
ct.displayName = "Textarea";
|
|
140
140
|
function Et({ className: t, size: n = 24 }) {
|
|
141
141
|
return /* @__PURE__ */ e(
|
|
142
142
|
"svg",
|
|
@@ -181,14 +181,16 @@ function Pt({ className: t, size: n = 24 }) {
|
|
|
181
181
|
}
|
|
182
182
|
);
|
|
183
183
|
}
|
|
184
|
-
const Vt = "ChatInput-module_container", Ht = "ChatInput-module_textareaContainer",
|
|
184
|
+
const Vt = "ChatInput-module_container", Ht = "ChatInput-module_textareaContainer", Tt = "ChatInput-module_actions", Ut = "ChatInput-module_containerStacked", Zt = "ChatInput-module_button", Ot = "ChatInput-module_actionWrapper", Qt = "ChatInput-module_actionWrapperDisabled", I = {
|
|
185
185
|
container: Vt,
|
|
186
186
|
textareaContainer: Ht,
|
|
187
|
-
actions:
|
|
188
|
-
containerStacked:
|
|
189
|
-
button: Zt
|
|
187
|
+
actions: Tt,
|
|
188
|
+
containerStacked: Ut,
|
|
189
|
+
button: Zt,
|
|
190
|
+
actionWrapper: Ot,
|
|
191
|
+
actionWrapperDisabled: Qt
|
|
190
192
|
};
|
|
191
|
-
function
|
|
193
|
+
function Ft({ className: t, size: n = 24 }) {
|
|
192
194
|
return /* @__PURE__ */ e(
|
|
193
195
|
"svg",
|
|
194
196
|
{
|
|
@@ -210,27 +212,27 @@ function Ot({ className: t, size: n = 24 }) {
|
|
|
210
212
|
}
|
|
211
213
|
);
|
|
212
214
|
}
|
|
213
|
-
const
|
|
214
|
-
container:
|
|
215
|
+
const Gt = "AnimatedPlaceholder-module_container", qt = {
|
|
216
|
+
container: Gt
|
|
215
217
|
};
|
|
216
|
-
function
|
|
218
|
+
function Kt({
|
|
217
219
|
texts: t,
|
|
218
220
|
interval: n = 3e3,
|
|
219
221
|
className: o = ""
|
|
220
222
|
}) {
|
|
221
|
-
const [a, i] =
|
|
222
|
-
return
|
|
223
|
-
const
|
|
223
|
+
const [a, i] = ft(0);
|
|
224
|
+
return tt(() => {
|
|
225
|
+
const s = setInterval(() => {
|
|
224
226
|
i(
|
|
225
|
-
(
|
|
227
|
+
(r) => (r + 1) % t.length
|
|
226
228
|
);
|
|
227
229
|
}, n);
|
|
228
|
-
return () => clearInterval(
|
|
229
|
-
}, [t.length, n]), /* @__PURE__ */ e(
|
|
230
|
-
|
|
230
|
+
return () => clearInterval(s);
|
|
231
|
+
}, [t.length, n]), /* @__PURE__ */ e(lt, { mode: "wait", children: /* @__PURE__ */ e(
|
|
232
|
+
W.span,
|
|
231
233
|
{
|
|
232
234
|
"data-slot": "animated-placeholder",
|
|
233
|
-
className: v(
|
|
235
|
+
className: v(qt.container, o),
|
|
234
236
|
initial: { opacity: 0, y: 8 },
|
|
235
237
|
animate: { opacity: 1, y: 0 },
|
|
236
238
|
exit: { opacity: 0, y: -8 },
|
|
@@ -244,104 +246,117 @@ function Ft({
|
|
|
244
246
|
a
|
|
245
247
|
) });
|
|
246
248
|
}
|
|
247
|
-
function
|
|
249
|
+
function Xt({
|
|
248
250
|
value: t,
|
|
249
251
|
onChange: n,
|
|
250
252
|
onSubmit: o,
|
|
251
253
|
onKeyDown: a,
|
|
252
254
|
textareaRef: i,
|
|
253
|
-
placeholder:
|
|
254
|
-
isProcessing:
|
|
255
|
-
onBlur:
|
|
256
|
-
onFocus:
|
|
255
|
+
placeholder: s = w("Ask anything", "a8c-agenttic"),
|
|
256
|
+
isProcessing: r,
|
|
257
|
+
onBlur: f,
|
|
258
|
+
onFocus: g,
|
|
257
259
|
onClick: d,
|
|
258
260
|
fromCompact: u = !1,
|
|
259
|
-
onExpand:
|
|
260
|
-
showExpandButton:
|
|
261
|
+
onExpand: c,
|
|
262
|
+
showExpandButton: b = !0,
|
|
261
263
|
focusOnMount: m = !1,
|
|
262
264
|
customActions: N = [],
|
|
263
265
|
actionOrder: y = "before-submit",
|
|
264
266
|
onStop: x,
|
|
265
267
|
disabled: A,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
268
|
+
readOnly: h,
|
|
269
|
+
onMouseEnter: R,
|
|
270
|
+
onMouseLeave: $,
|
|
271
|
+
expandOnClick: P = !1,
|
|
272
|
+
layout: F = "inline"
|
|
270
273
|
}) {
|
|
271
|
-
const
|
|
274
|
+
const G = gt(), { variant: q, floatingChatState: nt, isInputOverLimit: M } = Z(), j = (
|
|
272
275
|
// If the consumer actively sets `disabled` to `false` (vs undefined), that takes precedence.
|
|
273
|
-
A !== void 0 ? !A : (t.trim() ||
|
|
274
|
-
),
|
|
275
|
-
(
|
|
276
|
-
const
|
|
277
|
-
if (
|
|
278
|
-
|
|
276
|
+
A !== void 0 ? !A : (t.trim() || r) && !M
|
|
277
|
+
), dt = et(
|
|
278
|
+
(l) => {
|
|
279
|
+
const H = l.key.toLowerCase();
|
|
280
|
+
if (H === "enter" && !l.shiftKey && (l.nativeEvent.isComposing || l.keyCode === 229)) {
|
|
281
|
+
l.preventDefault();
|
|
279
282
|
return;
|
|
280
283
|
}
|
|
281
|
-
if (
|
|
282
|
-
|
|
284
|
+
if (H === "enter" && !l.shiftKey && !j) {
|
|
285
|
+
l.preventDefault();
|
|
283
286
|
return;
|
|
284
287
|
}
|
|
285
|
-
(
|
|
288
|
+
if (h && H === "enter" && !l.shiftKey) {
|
|
289
|
+
l.preventDefault();
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
((l.metaKey || l.ctrlKey) && H === "z" || l.ctrlKey && H === "y") && l.stopPropagation(), a(l);
|
|
286
293
|
},
|
|
287
|
-
[
|
|
288
|
-
),
|
|
294
|
+
[j, a, h]
|
|
295
|
+
), ot = (l) => l.endsWith("…") ? l : `${l}…`, K = Array.isArray(s);
|
|
289
296
|
let V;
|
|
290
|
-
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}, [
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
+
K ? V = s.map(ot) : s ? V = ot(s) : V = "";
|
|
298
|
+
const X = bt(m);
|
|
299
|
+
tt(() => {
|
|
300
|
+
X.current && i.current && i.current.focus(), X.current = !1;
|
|
301
|
+
}, [X, i]);
|
|
302
|
+
const at = () => N.map((l) => /* @__PURE__ */ e(
|
|
303
|
+
"span",
|
|
297
304
|
{
|
|
298
|
-
className:
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
305
|
+
className: v(I.actionWrapper, {
|
|
306
|
+
[I.actionWrapperDisabled]: l.disabled
|
|
307
|
+
}),
|
|
308
|
+
children: /* @__PURE__ */ e(
|
|
309
|
+
D,
|
|
310
|
+
{
|
|
311
|
+
className: l.className || I.button,
|
|
312
|
+
onClick: l.onClick,
|
|
313
|
+
disabled: l.disabled,
|
|
314
|
+
variant: l.variant || "ghost",
|
|
315
|
+
icon: l.icon,
|
|
316
|
+
"aria-label": l["aria-label"]
|
|
317
|
+
}
|
|
318
|
+
)
|
|
304
319
|
},
|
|
305
|
-
|
|
306
|
-
)),
|
|
307
|
-
|
|
320
|
+
l.id
|
|
321
|
+
)), ut = () => q === "embedded" || nt === "expanded" || P ? null : b && c ? /* @__PURE__ */ e(
|
|
322
|
+
D,
|
|
308
323
|
{
|
|
309
|
-
className:
|
|
310
|
-
onClick:
|
|
324
|
+
className: I.button,
|
|
325
|
+
onClick: c,
|
|
311
326
|
variant: "ghost",
|
|
312
|
-
icon: /* @__PURE__ */ e(
|
|
327
|
+
icon: /* @__PURE__ */ e(Ft, {}),
|
|
313
328
|
"aria-label": w("Expand conversation", "a8c-agenttic")
|
|
314
329
|
}
|
|
315
|
-
) : null,
|
|
316
|
-
if (
|
|
330
|
+
) : null, mt = () => {
|
|
331
|
+
if (r && !x)
|
|
317
332
|
return null;
|
|
318
|
-
const
|
|
319
|
-
|
|
333
|
+
const l = () => {
|
|
334
|
+
r && x ? x() : o();
|
|
320
335
|
};
|
|
321
336
|
return /* @__PURE__ */ e(
|
|
322
|
-
|
|
337
|
+
D,
|
|
323
338
|
{
|
|
324
|
-
className:
|
|
325
|
-
onClick:
|
|
326
|
-
disabled: !
|
|
339
|
+
className: I.button,
|
|
340
|
+
onClick: l,
|
|
341
|
+
disabled: !j,
|
|
327
342
|
variant: "primary",
|
|
328
|
-
icon:
|
|
329
|
-
"aria-label":
|
|
343
|
+
icon: r ? /* @__PURE__ */ e(Pt, {}) : /* @__PURE__ */ e(Et, {}),
|
|
344
|
+
"aria-label": r ? w("Stop processing", "a8c-agenttic") : w("Send message", "a8c-agenttic")
|
|
330
345
|
}
|
|
331
346
|
);
|
|
332
347
|
};
|
|
333
|
-
return /* @__PURE__ */
|
|
348
|
+
return /* @__PURE__ */ p(
|
|
334
349
|
"div",
|
|
335
350
|
{
|
|
336
351
|
"data-slot": "chat-input",
|
|
337
|
-
className: `${
|
|
338
|
-
onMouseEnter:
|
|
339
|
-
onMouseLeave:
|
|
352
|
+
className: `${I.container}${F === "stacked" ? ` ${I.containerStacked}` : ""}`,
|
|
353
|
+
onMouseEnter: R,
|
|
354
|
+
onMouseLeave: $,
|
|
340
355
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
|
|
356
|
+
/* @__PURE__ */ p(
|
|
357
|
+
W.div,
|
|
343
358
|
{
|
|
344
|
-
className:
|
|
359
|
+
className: I.textareaContainer,
|
|
345
360
|
initial: {
|
|
346
361
|
opacity: 0
|
|
347
362
|
},
|
|
@@ -351,24 +366,25 @@ function Gt({
|
|
|
351
366
|
transition: t.trim() ? { duration: 0 } : Q
|
|
352
367
|
},
|
|
353
368
|
children: [
|
|
354
|
-
!t &&
|
|
355
|
-
|
|
369
|
+
!t && K && /* @__PURE__ */ e(
|
|
370
|
+
Kt,
|
|
356
371
|
{
|
|
357
372
|
texts: V
|
|
358
373
|
}
|
|
359
374
|
),
|
|
360
375
|
/* @__PURE__ */ e(
|
|
361
|
-
|
|
376
|
+
ct,
|
|
362
377
|
{
|
|
363
|
-
id:
|
|
378
|
+
id: G,
|
|
364
379
|
ref: i,
|
|
365
380
|
value: t,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
381
|
+
readOnly: h,
|
|
382
|
+
onChange: (l) => n(l.target.value),
|
|
383
|
+
onKeyDown: dt,
|
|
384
|
+
onBlur: f,
|
|
385
|
+
onFocus: g,
|
|
370
386
|
onClick: d,
|
|
371
|
-
placeholder:
|
|
387
|
+
placeholder: K ? "" : V,
|
|
372
388
|
rows: 1,
|
|
373
389
|
"aria-label": w("Chat input", "a8c-agenttic")
|
|
374
390
|
}
|
|
@@ -376,10 +392,10 @@ function Gt({
|
|
|
376
392
|
]
|
|
377
393
|
}
|
|
378
394
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
380
|
-
|
|
395
|
+
/* @__PURE__ */ p(
|
|
396
|
+
W.div,
|
|
381
397
|
{
|
|
382
|
-
className:
|
|
398
|
+
className: I.actions,
|
|
383
399
|
initial: {
|
|
384
400
|
opacity: u ? 1 : 0,
|
|
385
401
|
scale: u ? 1 : 0.5
|
|
@@ -390,10 +406,10 @@ function Gt({
|
|
|
390
406
|
transition: t.trim() ? { duration: 0 } : U
|
|
391
407
|
},
|
|
392
408
|
children: [
|
|
393
|
-
dt(),
|
|
394
|
-
y === "before-submit" && ot(),
|
|
395
409
|
ut(),
|
|
396
|
-
y === "
|
|
410
|
+
y === "before-submit" && at(),
|
|
411
|
+
mt(),
|
|
412
|
+
y === "after-submit" && at()
|
|
397
413
|
]
|
|
398
414
|
}
|
|
399
415
|
)
|
|
@@ -401,7 +417,7 @@ function Gt({
|
|
|
401
417
|
}
|
|
402
418
|
);
|
|
403
419
|
}
|
|
404
|
-
function
|
|
420
|
+
function Yt({ className: t, size: n = 24 }) {
|
|
405
421
|
return /* @__PURE__ */ e(
|
|
406
422
|
"svg",
|
|
407
423
|
{
|
|
@@ -423,22 +439,22 @@ function qt({ className: t, size: n = 24 }) {
|
|
|
423
439
|
}
|
|
424
440
|
);
|
|
425
441
|
}
|
|
426
|
-
const
|
|
427
|
-
container:
|
|
428
|
-
labelRow:
|
|
429
|
-
chevron:
|
|
430
|
-
chevronOpen:
|
|
431
|
-
dropdown:
|
|
432
|
-
option:
|
|
433
|
-
},
|
|
434
|
-
container:
|
|
435
|
-
vertical:
|
|
436
|
-
button:
|
|
442
|
+
const Jt = "SuggestionDropdown-module_container", zt = "SuggestionDropdown-module_labelRow", te = "SuggestionDropdown-module_chevron", ee = "SuggestionDropdown-module_chevronOpen", ne = "SuggestionDropdown-module_dropdown", oe = "SuggestionDropdown-module_option", E = {
|
|
443
|
+
container: Jt,
|
|
444
|
+
labelRow: zt,
|
|
445
|
+
chevron: te,
|
|
446
|
+
chevronOpen: ee,
|
|
447
|
+
dropdown: ne,
|
|
448
|
+
option: oe
|
|
449
|
+
}, ae = "Suggestions-module_container", ie = "Suggestions-module_vertical", se = "Suggestions-module_button", le = "Suggestions-module_label", re = "Suggestions-module_description", ce = "Suggestions-module_floating", _ = {
|
|
450
|
+
container: ae,
|
|
451
|
+
vertical: ie,
|
|
452
|
+
button: se,
|
|
437
453
|
"suggestion-content--with-description": "Suggestions-module_suggestion-content--with-description",
|
|
438
|
-
label:
|
|
439
|
-
description:
|
|
440
|
-
floating:
|
|
441
|
-
},
|
|
454
|
+
label: le,
|
|
455
|
+
description: re,
|
|
456
|
+
floating: ce
|
|
457
|
+
}, de = (t, n) => !t || !n ? `${t}${n}` : /\s$/.test(t) || /^\s/.test(n) ? `${t}${n}` : `${t} ${n}`, ue = ({
|
|
442
458
|
suggestion: t,
|
|
443
459
|
onSelect: n,
|
|
444
460
|
availableSuggestions: o,
|
|
@@ -446,51 +462,51 @@ const Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-modul
|
|
|
446
462
|
showDescription: i
|
|
447
463
|
}) => {
|
|
448
464
|
var A;
|
|
449
|
-
const [
|
|
450
|
-
(
|
|
451
|
-
if (
|
|
452
|
-
d(null),
|
|
465
|
+
const [s, r] = k.useState(!1), f = k.useRef(null), [g, d] = k.useState(null), [u, c] = k.useState(null), [b, m] = k.useState(void 0), N = k.useCallback(
|
|
466
|
+
(h) => {
|
|
467
|
+
if (f.current = h, !h) {
|
|
468
|
+
d(null), c(null);
|
|
453
469
|
return;
|
|
454
470
|
}
|
|
455
471
|
d(
|
|
456
|
-
|
|
457
|
-
),
|
|
458
|
-
|
|
472
|
+
h.closest(".agenttic") ?? h
|
|
473
|
+
), c(
|
|
474
|
+
h.closest(
|
|
459
475
|
'[data-slot="conversation-view"]'
|
|
460
476
|
) ?? null
|
|
461
477
|
);
|
|
462
478
|
},
|
|
463
479
|
[]
|
|
464
|
-
), y =
|
|
465
|
-
(
|
|
466
|
-
var
|
|
467
|
-
if (
|
|
468
|
-
const
|
|
480
|
+
), y = k.useCallback(
|
|
481
|
+
(h) => {
|
|
482
|
+
var R;
|
|
483
|
+
if (h) {
|
|
484
|
+
const $ = (R = f.current) == null ? void 0 : R.closest(
|
|
469
485
|
'[data-slot="suggestions"]'
|
|
470
486
|
);
|
|
471
|
-
|
|
487
|
+
$ && m($.clientWidth * 0.9);
|
|
472
488
|
}
|
|
473
|
-
|
|
489
|
+
r(h), a == null || a(h);
|
|
474
490
|
},
|
|
475
491
|
[a]
|
|
476
|
-
), x = (
|
|
477
|
-
const { options:
|
|
478
|
-
|
|
479
|
-
prompt:
|
|
492
|
+
), x = (h) => {
|
|
493
|
+
const { options: R, ...$ } = t, P = {
|
|
494
|
+
...$,
|
|
495
|
+
prompt: de(
|
|
480
496
|
t.prompt ?? t.label,
|
|
481
|
-
|
|
497
|
+
h.value
|
|
482
498
|
),
|
|
483
|
-
label: `${t.label} ${
|
|
499
|
+
label: `${t.label} ${h.label}`
|
|
484
500
|
};
|
|
485
501
|
n == null || n(P, o), y(!1);
|
|
486
502
|
};
|
|
487
|
-
return /* @__PURE__ */ e("div", { ref: N, className: E.container, children: /* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */ e(
|
|
489
|
-
|
|
503
|
+
return /* @__PURE__ */ e("div", { ref: N, className: E.container, children: /* @__PURE__ */ p(O.Root, { open: s, onOpenChange: y, children: [
|
|
504
|
+
/* @__PURE__ */ e(O.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
|
|
505
|
+
D,
|
|
490
506
|
{
|
|
491
507
|
variant: "outline",
|
|
492
508
|
className: _.button,
|
|
493
|
-
children: /* @__PURE__ */
|
|
509
|
+
children: /* @__PURE__ */ p(
|
|
494
510
|
"div",
|
|
495
511
|
{
|
|
496
512
|
className: v(
|
|
@@ -498,13 +514,13 @@ const Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-modul
|
|
|
498
514
|
i ? _["suggestion-content--with-description"] : ""
|
|
499
515
|
),
|
|
500
516
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ p("span", { className: E.labelRow, children: [
|
|
502
518
|
/* @__PURE__ */ e("span", { className: _.label, children: t.label }),
|
|
503
519
|
/* @__PURE__ */ e(
|
|
504
|
-
|
|
520
|
+
Yt,
|
|
505
521
|
{
|
|
506
522
|
size: 14,
|
|
507
|
-
className: `${E.chevron} ${
|
|
523
|
+
className: `${E.chevron} ${s ? E.chevronOpen : ""}`
|
|
508
524
|
}
|
|
509
525
|
)
|
|
510
526
|
] }),
|
|
@@ -520,8 +536,8 @@ const Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-modul
|
|
|
520
536
|
)
|
|
521
537
|
}
|
|
522
538
|
) }),
|
|
523
|
-
|
|
524
|
-
|
|
539
|
+
g && /* @__PURE__ */ e(O.Portal, { container: g, children: /* @__PURE__ */ e(
|
|
540
|
+
O.Content,
|
|
525
541
|
{
|
|
526
542
|
className: E.dropdown,
|
|
527
543
|
side: "top",
|
|
@@ -529,45 +545,45 @@ const Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-modul
|
|
|
529
545
|
sideOffset: 4,
|
|
530
546
|
collisionBoundary: u,
|
|
531
547
|
"aria-label": t.label,
|
|
532
|
-
style:
|
|
533
|
-
children: (A = t.options) == null ? void 0 : A.map((
|
|
548
|
+
style: b ? { width: b } : void 0,
|
|
549
|
+
children: (A = t.options) == null ? void 0 : A.map((h) => /* @__PURE__ */ e(
|
|
534
550
|
"button",
|
|
535
551
|
{
|
|
536
552
|
type: "button",
|
|
537
553
|
"data-slot": "suggestion-option",
|
|
538
554
|
className: E.option,
|
|
539
|
-
onClick: () => x(
|
|
540
|
-
children:
|
|
555
|
+
onClick: () => x(h),
|
|
556
|
+
children: h.label
|
|
541
557
|
},
|
|
542
|
-
|
|
558
|
+
h.id
|
|
543
559
|
))
|
|
544
560
|
}
|
|
545
561
|
) })
|
|
546
562
|
] }) });
|
|
547
|
-
},
|
|
563
|
+
}, me = ({
|
|
548
564
|
className: t,
|
|
549
565
|
suggestions: n,
|
|
550
566
|
onSubmit: o,
|
|
551
567
|
layout: a = "horizontal",
|
|
552
568
|
visible: i = !0,
|
|
553
|
-
onMouseEnter:
|
|
554
|
-
onMouseLeave:
|
|
555
|
-
onDropdownOpenChange:
|
|
556
|
-
translateY:
|
|
569
|
+
onMouseEnter: s,
|
|
570
|
+
onMouseLeave: r,
|
|
571
|
+
onDropdownOpenChange: f,
|
|
572
|
+
translateY: g = "-100%"
|
|
557
573
|
}) => {
|
|
558
|
-
const { variant: d, reportSuggestionsRendered: u } =
|
|
574
|
+
const { variant: d, reportSuggestionsRendered: u } = Z(), c = st(
|
|
559
575
|
() => d === "floating" ? n == null ? void 0 : n.slice(0, 3) : n,
|
|
560
576
|
[n, d]
|
|
561
577
|
);
|
|
562
|
-
|
|
563
|
-
i && (
|
|
564
|
-
}, [i,
|
|
565
|
-
const
|
|
578
|
+
tt(() => {
|
|
579
|
+
i && (c != null && c.length) && (u == null || u(c));
|
|
580
|
+
}, [i, c, u]);
|
|
581
|
+
const b = async (m, N) => {
|
|
566
582
|
let y = !0;
|
|
567
583
|
m.action && (y = await m.action()), y && o && m.prompt && o(m, N);
|
|
568
584
|
};
|
|
569
|
-
return !
|
|
570
|
-
|
|
585
|
+
return !c || c.length === 0 ? null : /* @__PURE__ */ e(lt, { children: i && /* @__PURE__ */ e(
|
|
586
|
+
W.div,
|
|
571
587
|
{
|
|
572
588
|
"data-slot": "suggestions",
|
|
573
589
|
className: v(
|
|
@@ -576,16 +592,16 @@ const Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-modul
|
|
|
576
592
|
t
|
|
577
593
|
),
|
|
578
594
|
initial: { opacity: 0, y: "-80%" },
|
|
579
|
-
animate: { opacity: 1, y:
|
|
595
|
+
animate: { opacity: 1, y: g },
|
|
580
596
|
exit: { opacity: 0, y: "-80%" },
|
|
581
597
|
transition: Q,
|
|
582
|
-
onMouseEnter:
|
|
583
|
-
onMouseLeave:
|
|
584
|
-
children:
|
|
598
|
+
onMouseEnter: s,
|
|
599
|
+
onMouseLeave: r,
|
|
600
|
+
children: c.map(
|
|
585
601
|
(m, N) => {
|
|
586
602
|
const y = !!m.description && a !== "horizontal";
|
|
587
603
|
return /* @__PURE__ */ e(
|
|
588
|
-
|
|
604
|
+
W.div,
|
|
589
605
|
{
|
|
590
606
|
initial: { opacity: 0, y: 10 },
|
|
591
607
|
animate: { opacity: 1, y: 0 },
|
|
@@ -595,26 +611,26 @@ const Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-modul
|
|
|
595
611
|
delay: N * 0.05
|
|
596
612
|
},
|
|
597
613
|
children: m.options && m.options.length > 0 ? /* @__PURE__ */ e(
|
|
598
|
-
|
|
614
|
+
ue,
|
|
599
615
|
{
|
|
600
616
|
suggestion: m,
|
|
601
|
-
onSelect:
|
|
602
|
-
availableSuggestions:
|
|
603
|
-
onOpenChange:
|
|
617
|
+
onSelect: b,
|
|
618
|
+
availableSuggestions: c,
|
|
619
|
+
onOpenChange: f,
|
|
604
620
|
showDescription: y
|
|
605
621
|
}
|
|
606
622
|
) : /* @__PURE__ */ e(
|
|
607
|
-
|
|
623
|
+
D,
|
|
608
624
|
{
|
|
609
625
|
onClick: (x) => {
|
|
610
|
-
x.stopPropagation(),
|
|
626
|
+
x.stopPropagation(), b(
|
|
611
627
|
m,
|
|
612
|
-
|
|
628
|
+
c
|
|
613
629
|
);
|
|
614
630
|
},
|
|
615
631
|
variant: "outline",
|
|
616
632
|
className: _.button,
|
|
617
|
-
children: /* @__PURE__ */
|
|
633
|
+
children: /* @__PURE__ */ p(
|
|
618
634
|
"div",
|
|
619
635
|
{
|
|
620
636
|
className: v(
|
|
@@ -649,7 +665,7 @@ const Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-modul
|
|
|
649
665
|
}
|
|
650
666
|
) });
|
|
651
667
|
};
|
|
652
|
-
function
|
|
668
|
+
function pe({ className: t, size: n = 24 }) {
|
|
653
669
|
return /* @__PURE__ */ e(
|
|
654
670
|
"svg",
|
|
655
671
|
{
|
|
@@ -669,16 +685,16 @@ function de({ className: t, size: n = 24 }) {
|
|
|
669
685
|
}
|
|
670
686
|
);
|
|
671
687
|
}
|
|
672
|
-
const
|
|
673
|
-
card:
|
|
674
|
-
heading:
|
|
675
|
-
list:
|
|
676
|
-
item:
|
|
677
|
-
title:
|
|
678
|
-
label:
|
|
688
|
+
const he = "SourcesCard-module_card", fe = "SourcesCard-module_heading", ge = "SourcesCard-module_list", be = "SourcesCard-module_item", Ce = "SourcesCard-module_title", ve = "SourcesCard-module_label", B = {
|
|
689
|
+
card: he,
|
|
690
|
+
heading: fe,
|
|
691
|
+
list: ge,
|
|
692
|
+
item: be,
|
|
693
|
+
title: Ce,
|
|
694
|
+
label: ve
|
|
679
695
|
};
|
|
680
|
-
function
|
|
681
|
-
return t != null && t.length ? /* @__PURE__ */
|
|
696
|
+
function _n({ sources: t, className: n }) {
|
|
697
|
+
return t != null && t.length ? /* @__PURE__ */ p(
|
|
682
698
|
"section",
|
|
683
699
|
{
|
|
684
700
|
className: v(B.card, n),
|
|
@@ -687,8 +703,8 @@ function vn({ sources: t, className: n }) {
|
|
|
687
703
|
children: [
|
|
688
704
|
/* @__PURE__ */ e("p", { className: B.heading, "data-slot": "heading", children: w("Sources", "a8c-agenttic") }),
|
|
689
705
|
/* @__PURE__ */ e("ul", { className: B.list, "data-slot": "list", children: t.map((o, a) => {
|
|
690
|
-
const i = o.title || o.url || o.label || w("Untitled source", "a8c-agenttic"),
|
|
691
|
-
return /* @__PURE__ */
|
|
706
|
+
const i = o.title || o.url || o.label || w("Untitled source", "a8c-agenttic"), s = o.id || o.url || `${i}-${a}`;
|
|
707
|
+
return /* @__PURE__ */ p(
|
|
692
708
|
"li",
|
|
693
709
|
{
|
|
694
710
|
className: B.item,
|
|
@@ -722,14 +738,14 @@ function vn({ sources: t, className: n }) {
|
|
|
722
738
|
) : null
|
|
723
739
|
]
|
|
724
740
|
},
|
|
725
|
-
|
|
741
|
+
s
|
|
726
742
|
);
|
|
727
743
|
}) })
|
|
728
744
|
]
|
|
729
745
|
}
|
|
730
746
|
) : null;
|
|
731
747
|
}
|
|
732
|
-
function
|
|
748
|
+
function we({ className: t, size: n = 24 }) {
|
|
733
749
|
return /* @__PURE__ */ e(
|
|
734
750
|
"svg",
|
|
735
751
|
{
|
|
@@ -749,68 +765,72 @@ function be({ className: t, size: n = 24 }) {
|
|
|
749
765
|
}
|
|
750
766
|
);
|
|
751
767
|
}
|
|
752
|
-
function
|
|
768
|
+
function ye({
|
|
753
769
|
className: t,
|
|
754
770
|
disabled: n,
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
771
|
+
readOnly: o,
|
|
772
|
+
customActions: a,
|
|
773
|
+
actionOrder: i,
|
|
774
|
+
onKeyDown: s,
|
|
775
|
+
layout: r,
|
|
776
|
+
imageUploaderRef: f,
|
|
777
|
+
imageUploadDisabled: g
|
|
760
778
|
} = {}) {
|
|
761
779
|
const {
|
|
762
|
-
inputValue:
|
|
763
|
-
setInputValue:
|
|
764
|
-
handleSubmit:
|
|
765
|
-
handleKeyDown:
|
|
766
|
-
textareaRef:
|
|
767
|
-
placeholder:
|
|
768
|
-
isProcessing:
|
|
769
|
-
onStop:
|
|
770
|
-
fromCompact:
|
|
771
|
-
onExpand:
|
|
772
|
-
showExpandButton:
|
|
773
|
-
focusOnMount:
|
|
774
|
-
onInputFocus:
|
|
775
|
-
onInputBlur:
|
|
776
|
-
} =
|
|
777
|
-
|
|
778
|
-
},
|
|
780
|
+
inputValue: d,
|
|
781
|
+
setInputValue: u,
|
|
782
|
+
handleSubmit: c,
|
|
783
|
+
handleKeyDown: b,
|
|
784
|
+
textareaRef: m,
|
|
785
|
+
placeholder: N,
|
|
786
|
+
isProcessing: y,
|
|
787
|
+
onStop: x,
|
|
788
|
+
fromCompact: A,
|
|
789
|
+
onExpand: h,
|
|
790
|
+
showExpandButton: R,
|
|
791
|
+
focusOnMount: $,
|
|
792
|
+
onInputFocus: P,
|
|
793
|
+
onInputBlur: F
|
|
794
|
+
} = Z(), G = (M) => {
|
|
795
|
+
s == null || s(M), !M.defaultPrevented && b(M);
|
|
796
|
+
}, q = st(() => f ? [{
|
|
779
797
|
id: "image-upload",
|
|
780
|
-
icon: /* @__PURE__ */ e(
|
|
798
|
+
icon: /* @__PURE__ */ e(we, {}),
|
|
781
799
|
onClick: () => {
|
|
782
|
-
var
|
|
783
|
-
return (
|
|
800
|
+
var j;
|
|
801
|
+
return (j = f.current) == null ? void 0 : j.openFileDialog();
|
|
784
802
|
},
|
|
785
803
|
variant: "ghost",
|
|
804
|
+
disabled: g,
|
|
786
805
|
"aria-label": w("Upload image", "a8c-agenttic")
|
|
787
|
-
}, ...
|
|
806
|
+
}, ...a || []] : a, [f, a, g]);
|
|
788
807
|
return /* @__PURE__ */ e(
|
|
789
|
-
|
|
808
|
+
Xt,
|
|
790
809
|
{
|
|
791
|
-
value:
|
|
792
|
-
onChange:
|
|
793
|
-
onSubmit:
|
|
794
|
-
onKeyDown:
|
|
795
|
-
onFocus:
|
|
796
|
-
onBlur:
|
|
797
|
-
textareaRef:
|
|
798
|
-
placeholder:
|
|
799
|
-
isProcessing:
|
|
800
|
-
onStop:
|
|
801
|
-
fromCompact:
|
|
802
|
-
onExpand:
|
|
803
|
-
showExpandButton:
|
|
804
|
-
focusOnMount:
|
|
810
|
+
value: d,
|
|
811
|
+
onChange: u,
|
|
812
|
+
onSubmit: c,
|
|
813
|
+
onKeyDown: G,
|
|
814
|
+
onFocus: P,
|
|
815
|
+
onBlur: F,
|
|
816
|
+
textareaRef: m,
|
|
817
|
+
placeholder: N,
|
|
818
|
+
isProcessing: y,
|
|
819
|
+
onStop: x,
|
|
820
|
+
fromCompact: A,
|
|
821
|
+
onExpand: h,
|
|
822
|
+
showExpandButton: R,
|
|
823
|
+
focusOnMount: $,
|
|
805
824
|
disabled: n,
|
|
806
|
-
|
|
807
|
-
|
|
825
|
+
readOnly: o,
|
|
826
|
+
customActions: q,
|
|
827
|
+
actionOrder: i,
|
|
808
828
|
className: t,
|
|
809
|
-
layout:
|
|
829
|
+
layout: r ?? (f ? "stacked" : "inline")
|
|
810
830
|
}
|
|
811
831
|
);
|
|
812
832
|
}
|
|
813
|
-
function
|
|
833
|
+
function _e({
|
|
814
834
|
className: t,
|
|
815
835
|
showSuggestions: n,
|
|
816
836
|
onSelect: o
|
|
@@ -818,24 +838,24 @@ function ve({
|
|
|
818
838
|
const {
|
|
819
839
|
suggestions: a,
|
|
820
840
|
handleSuggestionSubmit: i,
|
|
821
|
-
inputValue:
|
|
822
|
-
messages:
|
|
823
|
-
variant:
|
|
824
|
-
emptyView:
|
|
825
|
-
} =
|
|
826
|
-
(u,
|
|
841
|
+
inputValue: s,
|
|
842
|
+
messages: r,
|
|
843
|
+
variant: f,
|
|
844
|
+
emptyView: g
|
|
845
|
+
} = Z(), d = et(
|
|
846
|
+
(u, c) => {
|
|
827
847
|
try {
|
|
828
|
-
const
|
|
829
|
-
o == null || o(
|
|
830
|
-
} catch (
|
|
831
|
-
console.warn("Suggestions onSelect callback failed:",
|
|
848
|
+
const b = u.prompt ?? u.label;
|
|
849
|
+
o == null || o(b);
|
|
850
|
+
} catch (b) {
|
|
851
|
+
console.warn("Suggestions onSelect callback failed:", b);
|
|
832
852
|
}
|
|
833
|
-
i(u,
|
|
853
|
+
i(u, c);
|
|
834
854
|
},
|
|
835
855
|
[o, i]
|
|
836
856
|
);
|
|
837
|
-
return
|
|
838
|
-
|
|
857
|
+
return s && !n || g && ["floating", "embedded"].includes(f) && r.length === 0 && !s ? null : /* @__PURE__ */ e(
|
|
858
|
+
me,
|
|
839
859
|
{
|
|
840
860
|
suggestions: a,
|
|
841
861
|
onSubmit: d,
|
|
@@ -843,8 +863,8 @@ function ve({
|
|
|
843
863
|
}
|
|
844
864
|
);
|
|
845
865
|
}
|
|
846
|
-
function
|
|
847
|
-
return /* @__PURE__ */
|
|
866
|
+
function Ne({ className: t, size: n = 18 }) {
|
|
867
|
+
return /* @__PURE__ */ p(
|
|
848
868
|
"svg",
|
|
849
869
|
{
|
|
850
870
|
width: n,
|
|
@@ -877,8 +897,8 @@ function we({ className: t, size: n = 18 }) {
|
|
|
877
897
|
}
|
|
878
898
|
);
|
|
879
899
|
}
|
|
880
|
-
function
|
|
881
|
-
return /* @__PURE__ */
|
|
900
|
+
function xe({ className: t, size: n = 18 }) {
|
|
901
|
+
return /* @__PURE__ */ p(
|
|
882
902
|
"svg",
|
|
883
903
|
{
|
|
884
904
|
width: n,
|
|
@@ -917,58 +937,58 @@ function ye({ className: t, size: n = 18 }) {
|
|
|
917
937
|
}
|
|
918
938
|
);
|
|
919
939
|
}
|
|
920
|
-
const
|
|
921
|
-
container:
|
|
922
|
-
isSuccess:
|
|
923
|
-
icon:
|
|
924
|
-
isWarning:
|
|
925
|
-
isError:
|
|
926
|
-
content:
|
|
927
|
-
actions:
|
|
928
|
-
action:
|
|
929
|
-
dismissible:
|
|
940
|
+
const Ie = "Notice-module_container", Se = "Notice-module_isSuccess", $e = "Notice-module_icon", Le = "Notice-module_isWarning", ke = "Notice-module_isError", De = "Notice-module_content", Ae = "Notice-module_actions", Re = "Notice-module_action", Be = "Notice-module_dismissible", S = {
|
|
941
|
+
container: Ie,
|
|
942
|
+
isSuccess: Se,
|
|
943
|
+
icon: $e,
|
|
944
|
+
isWarning: Le,
|
|
945
|
+
isError: ke,
|
|
946
|
+
content: De,
|
|
947
|
+
actions: Ae,
|
|
948
|
+
action: Re,
|
|
949
|
+
dismissible: Be
|
|
930
950
|
};
|
|
931
|
-
function
|
|
951
|
+
function We({
|
|
932
952
|
icon: t,
|
|
933
953
|
message: n,
|
|
934
954
|
action: o,
|
|
935
955
|
dismissible: a = !0,
|
|
936
956
|
onDismiss: i,
|
|
937
|
-
className:
|
|
938
|
-
status:
|
|
957
|
+
className: s,
|
|
958
|
+
status: r
|
|
939
959
|
}) {
|
|
940
|
-
const
|
|
941
|
-
if (
|
|
960
|
+
const g = et(() => {
|
|
961
|
+
if (k.isValidElement(t))
|
|
942
962
|
return t;
|
|
943
963
|
if (t === !1 || t === null)
|
|
944
964
|
return null;
|
|
945
|
-
switch (
|
|
965
|
+
switch (r) {
|
|
946
966
|
case "warning":
|
|
947
|
-
return /* @__PURE__ */ e(
|
|
967
|
+
return /* @__PURE__ */ e(Ne, {});
|
|
948
968
|
case "error":
|
|
949
|
-
return /* @__PURE__ */ e(
|
|
969
|
+
return /* @__PURE__ */ e(xe, {});
|
|
950
970
|
default:
|
|
951
971
|
return null;
|
|
952
972
|
}
|
|
953
|
-
}, [t,
|
|
954
|
-
return /* @__PURE__ */
|
|
973
|
+
}, [t, r])();
|
|
974
|
+
return /* @__PURE__ */ p(
|
|
955
975
|
"div",
|
|
956
976
|
{
|
|
957
977
|
"data-slot": "notice",
|
|
958
978
|
className: v(
|
|
959
979
|
S.container,
|
|
960
980
|
{
|
|
961
|
-
[S.isSuccess]:
|
|
962
|
-
[S.isWarning]:
|
|
963
|
-
[S.isError]:
|
|
981
|
+
[S.isSuccess]: r === "success",
|
|
982
|
+
[S.isWarning]: r === "warning",
|
|
983
|
+
[S.isError]: r === "error"
|
|
964
984
|
},
|
|
965
|
-
|
|
985
|
+
s
|
|
966
986
|
),
|
|
967
987
|
children: [
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
|
|
988
|
+
/* @__PURE__ */ p("div", { className: S.content, children: [
|
|
989
|
+
g && /* @__PURE__ */ e("div", { className: S.icon, children: g }),
|
|
970
990
|
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
|
|
971
|
-
|
|
991
|
+
vt,
|
|
972
992
|
{
|
|
973
993
|
allowedElements: ["p", "strong", "em", "a", "br"],
|
|
974
994
|
unwrapDisallowed: !0,
|
|
@@ -987,9 +1007,9 @@ function De({
|
|
|
987
1007
|
}
|
|
988
1008
|
) })
|
|
989
1009
|
] }),
|
|
990
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ p("div", { className: S.actions, children: [
|
|
991
1011
|
o && /* @__PURE__ */ e(
|
|
992
|
-
|
|
1012
|
+
D,
|
|
993
1013
|
{
|
|
994
1014
|
className: S.action,
|
|
995
1015
|
onClick: o.onClick,
|
|
@@ -998,13 +1018,13 @@ function De({
|
|
|
998
1018
|
}
|
|
999
1019
|
),
|
|
1000
1020
|
a && i && /* @__PURE__ */ e(
|
|
1001
|
-
|
|
1021
|
+
D,
|
|
1002
1022
|
{
|
|
1003
1023
|
className: S.dismissible,
|
|
1004
1024
|
onClick: i,
|
|
1005
1025
|
variant: "ghost",
|
|
1006
1026
|
size: "sm",
|
|
1007
|
-
icon: /* @__PURE__ */ e(
|
|
1027
|
+
icon: /* @__PURE__ */ e(pe, {})
|
|
1008
1028
|
}
|
|
1009
1029
|
)
|
|
1010
1030
|
] })
|
|
@@ -1012,10 +1032,10 @@ function De({
|
|
|
1012
1032
|
}
|
|
1013
1033
|
);
|
|
1014
1034
|
}
|
|
1015
|
-
function
|
|
1016
|
-
const { notice: n } =
|
|
1035
|
+
function Me({ className: t } = {}) {
|
|
1036
|
+
const { notice: n } = Z();
|
|
1017
1037
|
return n ? /* @__PURE__ */ e(
|
|
1018
|
-
|
|
1038
|
+
We,
|
|
1019
1039
|
{
|
|
1020
1040
|
icon: n.icon,
|
|
1021
1041
|
message: n.message,
|
|
@@ -1027,21 +1047,21 @@ function Re({ className: t } = {}) {
|
|
|
1027
1047
|
}
|
|
1028
1048
|
) : null;
|
|
1029
1049
|
}
|
|
1030
|
-
const
|
|
1031
|
-
container:
|
|
1032
|
-
disclosure:
|
|
1033
|
-
},
|
|
1034
|
-
function
|
|
1050
|
+
const je = "ChatFooter-module_container", Ee = "ChatFooter-module_disclosure", z = {
|
|
1051
|
+
container: je,
|
|
1052
|
+
disclosure: Ee
|
|
1053
|
+
}, Pe = "https://automattic.com/ai-guidelines/";
|
|
1054
|
+
function Ve() {
|
|
1035
1055
|
const t = (
|
|
1036
1056
|
/* translators: %s: the linked label "Guidelines" (links to Automattic's AI guidelines). */
|
|
1037
1057
|
w("You’re chatting with AI. %s.", "a8c-agenttic")
|
|
1038
1058
|
), [n, o] = t.split("%s");
|
|
1039
|
-
return /* @__PURE__ */
|
|
1059
|
+
return /* @__PURE__ */ p(Y, { children: [
|
|
1040
1060
|
n,
|
|
1041
1061
|
/* @__PURE__ */ e(
|
|
1042
1062
|
"a",
|
|
1043
1063
|
{
|
|
1044
|
-
href:
|
|
1064
|
+
href: Pe,
|
|
1045
1065
|
target: "_blank",
|
|
1046
1066
|
rel: "noopener noreferrer",
|
|
1047
1067
|
"aria-label": w(
|
|
@@ -1054,30 +1074,30 @@ function Ee() {
|
|
|
1054
1074
|
o
|
|
1055
1075
|
] });
|
|
1056
1076
|
}
|
|
1057
|
-
function
|
|
1077
|
+
function He({
|
|
1058
1078
|
children: t
|
|
1059
1079
|
}) {
|
|
1060
1080
|
return t === !1 || t === null || t === void 0 ? null : /* @__PURE__ */ e(
|
|
1061
1081
|
"div",
|
|
1062
1082
|
{
|
|
1063
1083
|
"data-slot": "chat-compliance-disclosure",
|
|
1064
|
-
className:
|
|
1084
|
+
className: z.disclosure,
|
|
1065
1085
|
children: t
|
|
1066
1086
|
}
|
|
1067
1087
|
);
|
|
1068
1088
|
}
|
|
1069
|
-
function
|
|
1089
|
+
function Nn({
|
|
1070
1090
|
children: t,
|
|
1071
1091
|
className: n,
|
|
1072
|
-
complianceDisclosure: o = /* @__PURE__ */ e(
|
|
1092
|
+
complianceDisclosure: o = /* @__PURE__ */ e(Ve, {})
|
|
1073
1093
|
} = {}) {
|
|
1074
|
-
const a = /* @__PURE__ */ e(
|
|
1075
|
-
return t ? /* @__PURE__ */
|
|
1094
|
+
const a = /* @__PURE__ */ e(He, { children: o });
|
|
1095
|
+
return t ? /* @__PURE__ */ p(Y, { children: [
|
|
1076
1096
|
/* @__PURE__ */ e(
|
|
1077
|
-
|
|
1097
|
+
W.div,
|
|
1078
1098
|
{
|
|
1079
1099
|
"data-slot": "chat-footer",
|
|
1080
|
-
className: v(
|
|
1100
|
+
className: v(z.container, n),
|
|
1081
1101
|
initial: { opacity: 0, scale: 1 },
|
|
1082
1102
|
animate: { opacity: 1, scale: 1 },
|
|
1083
1103
|
transition: { ...U },
|
|
@@ -1085,86 +1105,86 @@ function wn({
|
|
|
1085
1105
|
}
|
|
1086
1106
|
),
|
|
1087
1107
|
a
|
|
1088
|
-
] }) : /* @__PURE__ */
|
|
1089
|
-
/* @__PURE__ */
|
|
1090
|
-
|
|
1108
|
+
] }) : /* @__PURE__ */ p(Y, { children: [
|
|
1109
|
+
/* @__PURE__ */ p(
|
|
1110
|
+
W.div,
|
|
1091
1111
|
{
|
|
1092
1112
|
"data-slot": "chat-footer",
|
|
1093
|
-
className: v(
|
|
1113
|
+
className: v(z.container, n),
|
|
1094
1114
|
initial: { opacity: 0, scale: 1 },
|
|
1095
1115
|
animate: { opacity: 1, scale: 1 },
|
|
1096
1116
|
transition: { ...U },
|
|
1097
1117
|
children: [
|
|
1098
|
-
/* @__PURE__ */ e(
|
|
1099
|
-
/* @__PURE__ */ e(
|
|
1100
|
-
/* @__PURE__ */ e(
|
|
1118
|
+
/* @__PURE__ */ e(_e, {}),
|
|
1119
|
+
/* @__PURE__ */ e(Me, {}),
|
|
1120
|
+
/* @__PURE__ */ e(ye, {})
|
|
1101
1121
|
]
|
|
1102
1122
|
}
|
|
1103
1123
|
),
|
|
1104
1124
|
a
|
|
1105
1125
|
] });
|
|
1106
1126
|
}
|
|
1107
|
-
const
|
|
1108
|
-
card:
|
|
1109
|
-
question:
|
|
1110
|
-
choices:
|
|
1111
|
-
choicesGrid:
|
|
1112
|
-
choice:
|
|
1113
|
-
answered:
|
|
1114
|
-
label:
|
|
1115
|
-
description:
|
|
1127
|
+
const Te = "QuestionCard-module_card", Ue = "QuestionCard-module_question", Ze = "QuestionCard-module_choices", Oe = "QuestionCard-module_choicesGrid", Qe = "QuestionCard-module_choice", Fe = "QuestionCard-module_answered", Ge = "QuestionCard-module_label", qe = "QuestionCard-module_description", L = {
|
|
1128
|
+
card: Te,
|
|
1129
|
+
question: Ue,
|
|
1130
|
+
choices: Ze,
|
|
1131
|
+
choicesGrid: Oe,
|
|
1132
|
+
choice: Qe,
|
|
1133
|
+
answered: Fe,
|
|
1134
|
+
label: Ge,
|
|
1135
|
+
description: qe
|
|
1116
1136
|
};
|
|
1117
|
-
function
|
|
1137
|
+
function xn({
|
|
1118
1138
|
prompt: t,
|
|
1119
1139
|
onAnswer: n,
|
|
1120
1140
|
disabled: o = !1,
|
|
1121
1141
|
answered: a = !1,
|
|
1122
1142
|
answeredChoice: i,
|
|
1123
|
-
className:
|
|
1124
|
-
renderChoiceContent:
|
|
1143
|
+
className: s,
|
|
1144
|
+
renderChoiceContent: r
|
|
1125
1145
|
}) {
|
|
1126
|
-
const
|
|
1127
|
-
return /* @__PURE__ */
|
|
1146
|
+
const f = o || a, g = t.choices.slice(0, 4);
|
|
1147
|
+
return /* @__PURE__ */ p(
|
|
1128
1148
|
"section",
|
|
1129
1149
|
{
|
|
1130
|
-
className: v(
|
|
1150
|
+
className: v(L.card, s),
|
|
1131
1151
|
"data-agenttic-question-card": !0,
|
|
1132
1152
|
"data-slot": "card",
|
|
1133
1153
|
children: [
|
|
1134
|
-
/* @__PURE__ */ e("p", { className:
|
|
1154
|
+
/* @__PURE__ */ e("p", { className: L.question, "data-slot": "question", children: t.question }),
|
|
1135
1155
|
/* @__PURE__ */ e(
|
|
1136
1156
|
"div",
|
|
1137
1157
|
{
|
|
1138
1158
|
className: v(
|
|
1139
|
-
|
|
1140
|
-
|
|
1159
|
+
L.choices,
|
|
1160
|
+
g.length === 4 ? L.choicesGrid : void 0
|
|
1141
1161
|
),
|
|
1142
1162
|
"data-slot": "choices",
|
|
1143
|
-
children:
|
|
1144
|
-
const
|
|
1145
|
-
return /* @__PURE__ */
|
|
1163
|
+
children: g.map((d, u) => {
|
|
1164
|
+
const c = d.message ?? d.label, b = i === c;
|
|
1165
|
+
return /* @__PURE__ */ p(
|
|
1146
1166
|
"button",
|
|
1147
1167
|
{
|
|
1148
1168
|
type: "button",
|
|
1149
1169
|
"data-slot": "choice",
|
|
1150
1170
|
className: v(
|
|
1151
|
-
|
|
1152
|
-
|
|
1171
|
+
L.choice,
|
|
1172
|
+
b ? L.answered : void 0
|
|
1153
1173
|
),
|
|
1154
|
-
disabled:
|
|
1155
|
-
"aria-pressed":
|
|
1156
|
-
onClick: () => n(
|
|
1174
|
+
disabled: f,
|
|
1175
|
+
"aria-pressed": b || void 0,
|
|
1176
|
+
onClick: () => n(c, d),
|
|
1157
1177
|
children: [
|
|
1158
|
-
/* @__PURE__ */ e("span", { className:
|
|
1178
|
+
/* @__PURE__ */ e("span", { className: L.label, "data-slot": "label", children: d.label }),
|
|
1159
1179
|
d.description ? /* @__PURE__ */ e(
|
|
1160
1180
|
"span",
|
|
1161
1181
|
{
|
|
1162
|
-
className:
|
|
1182
|
+
className: L.description,
|
|
1163
1183
|
"data-slot": "description",
|
|
1164
1184
|
children: d.description
|
|
1165
1185
|
}
|
|
1166
1186
|
) : null,
|
|
1167
|
-
|
|
1187
|
+
r == null ? void 0 : r(d)
|
|
1168
1188
|
]
|
|
1169
1189
|
},
|
|
1170
1190
|
`${d.label}-${u}`
|
|
@@ -1176,29 +1196,29 @@ function yn({
|
|
|
1176
1196
|
}
|
|
1177
1197
|
);
|
|
1178
1198
|
}
|
|
1179
|
-
const
|
|
1180
|
-
card:
|
|
1181
|
-
isResolved:
|
|
1182
|
-
title:
|
|
1183
|
-
summary:
|
|
1184
|
-
body:
|
|
1185
|
-
change:
|
|
1186
|
-
changeLabel:
|
|
1187
|
-
diff:
|
|
1188
|
-
removed:
|
|
1189
|
-
added:
|
|
1190
|
-
resolution:
|
|
1191
|
-
actions:
|
|
1192
|
-
action:
|
|
1193
|
-
accept:
|
|
1194
|
-
reject:
|
|
1199
|
+
const Ke = "DiffCard-module_card", Xe = "DiffCard-module_isResolved", Ye = "DiffCard-module_title", Je = "DiffCard-module_summary", ze = "DiffCard-module_body", tn = "DiffCard-module_change", en = "DiffCard-module_changeLabel", nn = "DiffCard-module_diff", on = "DiffCard-module_removed", an = "DiffCard-module_added", sn = "DiffCard-module_resolution", ln = "DiffCard-module_actions", rn = "DiffCard-module_action", cn = "DiffCard-module_accept", dn = "DiffCard-module_reject", C = {
|
|
1200
|
+
card: Ke,
|
|
1201
|
+
isResolved: Xe,
|
|
1202
|
+
title: Ye,
|
|
1203
|
+
summary: Je,
|
|
1204
|
+
body: ze,
|
|
1205
|
+
change: tn,
|
|
1206
|
+
changeLabel: en,
|
|
1207
|
+
diff: nn,
|
|
1208
|
+
removed: on,
|
|
1209
|
+
added: an,
|
|
1210
|
+
resolution: sn,
|
|
1211
|
+
actions: ln,
|
|
1212
|
+
action: rn,
|
|
1213
|
+
accept: cn,
|
|
1214
|
+
reject: dn
|
|
1195
1215
|
};
|
|
1196
|
-
function
|
|
1216
|
+
function un(t) {
|
|
1197
1217
|
return typeof t == "string" ? [] : Array.isArray(t) ? t : [t];
|
|
1198
1218
|
}
|
|
1199
|
-
function
|
|
1219
|
+
function mn(t, n) {
|
|
1200
1220
|
const o = typeof t.original == "string" && t.original.length > 0, a = typeof t.replacement == "string" && t.replacement.length > 0;
|
|
1201
|
-
return /* @__PURE__ */
|
|
1221
|
+
return /* @__PURE__ */ p("div", { className: C.change, "data-slot": "change", children: [
|
|
1202
1222
|
t.label ? /* @__PURE__ */ e("span", { className: C.changeLabel, "data-slot": "change-label", children: t.label }) : null,
|
|
1203
1223
|
o ? /* @__PURE__ */ e(
|
|
1204
1224
|
"pre",
|
|
@@ -1218,27 +1238,27 @@ function cn(t, n) {
|
|
|
1218
1238
|
) : null
|
|
1219
1239
|
] }, n);
|
|
1220
1240
|
}
|
|
1221
|
-
function
|
|
1241
|
+
function In({
|
|
1222
1242
|
diff: t,
|
|
1223
1243
|
title: n,
|
|
1224
1244
|
summary: o,
|
|
1225
1245
|
onResolve: a,
|
|
1226
1246
|
disabled: i = !1,
|
|
1227
|
-
resolved:
|
|
1228
|
-
acceptLabel:
|
|
1229
|
-
rejectLabel:
|
|
1230
|
-
className:
|
|
1247
|
+
resolved: s,
|
|
1248
|
+
acceptLabel: r,
|
|
1249
|
+
rejectLabel: f,
|
|
1250
|
+
className: g,
|
|
1231
1251
|
renderDiff: d
|
|
1232
1252
|
}) {
|
|
1233
|
-
const u = !!
|
|
1253
|
+
const u = !!s, c = i || u, b = un(t);
|
|
1234
1254
|
let m;
|
|
1235
|
-
return d ? m = d(t) : typeof t == "string" ? m = /* @__PURE__ */ e("pre", { className: C.diff, "data-slot": "diff", children: t }) : m =
|
|
1255
|
+
return d ? m = d(t) : typeof t == "string" ? m = /* @__PURE__ */ e("pre", { className: C.diff, "data-slot": "diff", children: t }) : m = b.map(mn), /* @__PURE__ */ p(
|
|
1236
1256
|
"section",
|
|
1237
1257
|
{
|
|
1238
1258
|
className: v(
|
|
1239
1259
|
C.card,
|
|
1240
1260
|
u ? C.isResolved : void 0,
|
|
1241
|
-
|
|
1261
|
+
g
|
|
1242
1262
|
),
|
|
1243
1263
|
"data-agenttic-diff-card": !0,
|
|
1244
1264
|
"data-slot": "card",
|
|
@@ -1246,16 +1266,16 @@ function _n({
|
|
|
1246
1266
|
n ? /* @__PURE__ */ e("p", { className: C.title, "data-slot": "title", children: n }) : null,
|
|
1247
1267
|
o ? /* @__PURE__ */ e("p", { className: C.summary, "data-slot": "summary", children: o }) : null,
|
|
1248
1268
|
/* @__PURE__ */ e("div", { className: C.body, "data-slot": "body", children: m }),
|
|
1249
|
-
u ? /* @__PURE__ */ e("p", { className: C.resolution, "data-slot": "resolution", children:
|
|
1269
|
+
u ? /* @__PURE__ */ e("p", { className: C.resolution, "data-slot": "resolution", children: s === "accepted" ? w("Accepted", "a8c-agenttic") : w("Rejected", "a8c-agenttic") }) : /* @__PURE__ */ p("div", { className: C.actions, "data-slot": "actions", children: [
|
|
1250
1270
|
/* @__PURE__ */ e(
|
|
1251
1271
|
"button",
|
|
1252
1272
|
{
|
|
1253
1273
|
type: "button",
|
|
1254
1274
|
"data-slot": "accept",
|
|
1255
1275
|
className: v(C.action, C.accept),
|
|
1256
|
-
disabled:
|
|
1276
|
+
disabled: c,
|
|
1257
1277
|
onClick: () => a("accepted"),
|
|
1258
|
-
children:
|
|
1278
|
+
children: r ?? w("Accept", "a8c-agenttic")
|
|
1259
1279
|
}
|
|
1260
1280
|
),
|
|
1261
1281
|
/* @__PURE__ */ e(
|
|
@@ -1264,9 +1284,9 @@ function _n({
|
|
|
1264
1284
|
type: "button",
|
|
1265
1285
|
"data-slot": "reject",
|
|
1266
1286
|
className: v(C.action, C.reject),
|
|
1267
|
-
disabled:
|
|
1287
|
+
disabled: c,
|
|
1268
1288
|
onClick: () => a("rejected"),
|
|
1269
|
-
children:
|
|
1289
|
+
children: f ?? w("Reject", "a8c-agenttic")
|
|
1270
1290
|
}
|
|
1271
1291
|
)
|
|
1272
1292
|
] })
|
|
@@ -1275,31 +1295,31 @@ function _n({
|
|
|
1275
1295
|
);
|
|
1276
1296
|
}
|
|
1277
1297
|
export {
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1298
|
+
yn as A,
|
|
1299
|
+
D as B,
|
|
1300
|
+
Xt as C,
|
|
1301
|
+
Ve as D,
|
|
1302
|
+
We as N,
|
|
1303
|
+
we as P,
|
|
1304
|
+
xn as Q,
|
|
1305
|
+
me as S,
|
|
1306
|
+
pe as X,
|
|
1307
|
+
Ft as a,
|
|
1308
|
+
yt as b,
|
|
1289
1309
|
v as c,
|
|
1290
|
-
|
|
1291
|
-
|
|
1310
|
+
_n as d,
|
|
1311
|
+
Nn as e,
|
|
1292
1312
|
U as f,
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1313
|
+
Me as g,
|
|
1314
|
+
_e as h,
|
|
1315
|
+
ye as i,
|
|
1316
|
+
He as j,
|
|
1317
|
+
Kt as k,
|
|
1318
|
+
In as l,
|
|
1319
|
+
wt as m,
|
|
1320
|
+
wn as n,
|
|
1301
1321
|
Pt as o,
|
|
1302
1322
|
Et as p,
|
|
1303
|
-
|
|
1304
|
-
|
|
1323
|
+
z as s,
|
|
1324
|
+
Z as u
|
|
1305
1325
|
};
|