@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.
@@ -1,15 +1,15 @@
1
- import { jsx as e, jsxs as h, Fragment as X } from "react/jsx-runtime";
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 at from "react";
4
- import L, { createContext as mt, useContext as ht, useState as pt, useEffect as z, useId as ft, useCallback as tt, useRef as gt, useMemo as it } from "react";
5
- import { AnimatePresence as st, motion as M } from "framer-motion";
6
- import { Slot as bt } from "@radix-ui/react-slot";
7
- import * as W from "@radix-ui/react-popover";
8
- import Ct from "react-markdown";
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 Y = {
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
- }, vt = {
25
+ }, wt = {
26
26
  type: "spring",
27
27
  damping: 40,
28
28
  stiffness: 500,
29
29
  mass: 0.8
30
- }, wt = {
30
+ }, yt = {
31
31
  hidden: {
32
32
  opacity: 0
33
33
  },
34
34
  visible: {
35
35
  opacity: 1,
36
- transition: Y
36
+ transition: J
37
37
  },
38
38
  exit: {
39
39
  opacity: 0,
40
- transition: { ...Y, duration: 0.1 }
40
+ transition: { ...J, duration: 0.1 }
41
41
  }
42
- }, yt = () => {
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
- }, _t = {
54
+ }, Nt = {
55
55
  "0%": { backgroundPosition: "-200% 0" },
56
56
  "100%": { backgroundPosition: "200% 0" }
57
- }, bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
57
+ }, wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
58
58
  __proto__: null,
59
- fadeVariants: wt,
59
+ fadeVariants: yt,
60
60
  fastSpring: U,
61
61
  fastSpringWithDelay: Q,
62
- getDragConstraints: yt,
63
- morphSpring: vt,
64
- springConfig: Y,
65
- thinkingGradientKeyframes: _t
66
- }, Symbol.toStringTag, { value: "Module" })), lt = mt(null);
67
- function T() {
68
- const t = ht(lt);
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 Cn({ children: t, value: n }) {
76
- return /* @__PURE__ */ e(lt.Provider, { value: n, children: t });
75
+ function yn({ children: t, value: n }) {
76
+ return /* @__PURE__ */ e(rt.Provider, { value: n, children: t });
77
77
  }
78
- const Nt = "button-module_button", xt = "button-module_pressed", St = "button-module_primary", It = "button-module_ghost", $t = "button-module_outline", Lt = "button-module_transparent", kt = "button-module_link", At = "button-module_icon", Dt = "button-module_sm", Rt = "button-module_lg", Bt = "button-module_withTextAndIcon", H = {
79
- button: Nt,
80
- pressed: xt,
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: It,
83
- outline: $t,
84
- transparent: Lt,
85
- link: kt,
82
+ ghost: $t,
83
+ outline: Lt,
84
+ transparent: kt,
85
+ link: Dt,
86
86
  icon: At,
87
- sm: Dt,
88
- lg: Rt,
89
- withTextAndIcon: Bt
90
- }, k = at.forwardRef(
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: l,
97
- asChild: s = !1,
98
- pressed: b,
99
- ...f
96
+ children: s,
97
+ asChild: r = !1,
98
+ pressed: f,
99
+ ...g
100
100
  }, d) {
101
- const u = s ? bt : "button", r = !!i, p = a || (r && !l ? "icon" : void 0);
102
- return /* @__PURE__ */ h(
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
- H.button,
109
- H[o],
110
- p && H[p],
111
- r && l ? H.withTextAndIcon : void 0,
112
- b ? H.pressed : void 0,
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": b,
116
- ...f,
115
+ "aria-pressed": f,
116
+ ...g,
117
117
  children: [
118
118
  i,
119
- l
119
+ s
120
120
  ]
121
121
  }
122
122
  );
123
123
  }
124
124
  );
125
- k.displayName = "Button";
125
+ D.displayName = "Button";
126
126
  const Mt = "Textarea-module_textarea", jt = {
127
127
  textarea: Mt
128
- }, rt = at.forwardRef(
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
- rt.displayName = "Textarea";
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", Ut = "ChatInput-module_actions", Tt = "ChatInput-module_containerStacked", Zt = "ChatInput-module_button", R = {
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: Ut,
188
- containerStacked: Tt,
189
- button: Zt
187
+ actions: Tt,
188
+ containerStacked: Ut,
189
+ button: Zt,
190
+ actionWrapper: Ot,
191
+ actionWrapperDisabled: Qt
190
192
  };
191
- function Ot({ className: t, size: n = 24 }) {
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 Wt = "AnimatedPlaceholder-module_container", Qt = {
214
- container: Wt
215
+ const Gt = "AnimatedPlaceholder-module_container", qt = {
216
+ container: Gt
215
217
  };
216
- function Ft({
218
+ function Kt({
217
219
  texts: t,
218
220
  interval: n = 3e3,
219
221
  className: o = ""
220
222
  }) {
221
- const [a, i] = pt(0);
222
- return z(() => {
223
- const l = setInterval(() => {
223
+ const [a, i] = ft(0);
224
+ return tt(() => {
225
+ const s = setInterval(() => {
224
226
  i(
225
- (s) => (s + 1) % t.length
227
+ (r) => (r + 1) % t.length
226
228
  );
227
229
  }, n);
228
- return () => clearInterval(l);
229
- }, [t.length, n]), /* @__PURE__ */ e(st, { mode: "wait", children: /* @__PURE__ */ e(
230
- M.span,
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(Qt.container, o),
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 Gt({
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: l = w("Ask anything", "a8c-agenttic"),
254
- isProcessing: s,
255
- onBlur: b,
256
- onFocus: f,
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: r,
260
- showExpandButton: p = !0,
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
- onMouseEnter: g,
267
- onMouseLeave: D,
268
- expandOnClick: I = !1,
269
- layout: P = "inline"
268
+ readOnly: h,
269
+ onMouseEnter: R,
270
+ onMouseLeave: $,
271
+ expandOnClick: P = !1,
272
+ layout: F = "inline"
270
273
  }) {
271
- const F = ft(), { variant: et, floatingChatState: j, isInputOverLimit: Z } = T(), G = (
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() || s) && !Z
274
- ), ct = tt(
275
- (c) => {
276
- const O = c.key.toLowerCase();
277
- if (O === "enter" && !c.shiftKey && (c.nativeEvent.isComposing || c.keyCode === 229)) {
278
- c.preventDefault();
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 (O === "enter" && !c.shiftKey && !G) {
282
- c.preventDefault();
284
+ if (H === "enter" && !l.shiftKey && !j) {
285
+ l.preventDefault();
283
286
  return;
284
287
  }
285
- ((c.metaKey || c.ctrlKey) && O === "z" || c.ctrlKey && O === "y") && c.stopPropagation(), a(c);
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
- [G, a]
288
- ), nt = (c) => c.endsWith("…") ? c : `${c}…`, q = Array.isArray(l);
294
+ [j, a, h]
295
+ ), ot = (l) => l.endsWith("…") ? l : `${l}…`, K = Array.isArray(s);
289
296
  let V;
290
- q ? V = l.map(nt) : l ? V = nt(l) : V = "";
291
- const K = gt(m);
292
- z(() => {
293
- K.current && i.current && i.current.focus(), K.current = !1;
294
- }, [K, i]);
295
- const ot = () => N.map((c) => /* @__PURE__ */ e(
296
- k,
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: c.className || R.button,
299
- onClick: c.onClick,
300
- disabled: c.disabled,
301
- variant: c.variant || "ghost",
302
- icon: c.icon,
303
- "aria-label": c["aria-label"]
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
- c.id
306
- )), dt = () => et === "embedded" || j === "expanded" || I ? null : p && r ? /* @__PURE__ */ e(
307
- k,
320
+ l.id
321
+ )), ut = () => q === "embedded" || nt === "expanded" || P ? null : b && c ? /* @__PURE__ */ e(
322
+ D,
308
323
  {
309
- className: R.button,
310
- onClick: r,
324
+ className: I.button,
325
+ onClick: c,
311
326
  variant: "ghost",
312
- icon: /* @__PURE__ */ e(Ot, {}),
327
+ icon: /* @__PURE__ */ e(Ft, {}),
313
328
  "aria-label": w("Expand conversation", "a8c-agenttic")
314
329
  }
315
- ) : null, ut = () => {
316
- if (s && !x)
330
+ ) : null, mt = () => {
331
+ if (r && !x)
317
332
  return null;
318
- const c = () => {
319
- s && x ? x() : o();
333
+ const l = () => {
334
+ r && x ? x() : o();
320
335
  };
321
336
  return /* @__PURE__ */ e(
322
- k,
337
+ D,
323
338
  {
324
- className: R.button,
325
- onClick: c,
326
- disabled: !G,
339
+ className: I.button,
340
+ onClick: l,
341
+ disabled: !j,
327
342
  variant: "primary",
328
- icon: s ? /* @__PURE__ */ e(Pt, {}) : /* @__PURE__ */ e(Et, {}),
329
- "aria-label": s ? w("Stop processing", "a8c-agenttic") : w("Send message", "a8c-agenttic")
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__ */ h(
348
+ return /* @__PURE__ */ p(
334
349
  "div",
335
350
  {
336
351
  "data-slot": "chat-input",
337
- className: `${R.container}${P === "stacked" ? ` ${R.containerStacked}` : ""}`,
338
- onMouseEnter: g,
339
- onMouseLeave: D,
352
+ className: `${I.container}${F === "stacked" ? ` ${I.containerStacked}` : ""}`,
353
+ onMouseEnter: R,
354
+ onMouseLeave: $,
340
355
  children: [
341
- /* @__PURE__ */ h(
342
- M.div,
356
+ /* @__PURE__ */ p(
357
+ W.div,
343
358
  {
344
- className: R.textareaContainer,
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 && q && /* @__PURE__ */ e(
355
- Ft,
369
+ !t && K && /* @__PURE__ */ e(
370
+ Kt,
356
371
  {
357
372
  texts: V
358
373
  }
359
374
  ),
360
375
  /* @__PURE__ */ e(
361
- rt,
376
+ ct,
362
377
  {
363
- id: F,
378
+ id: G,
364
379
  ref: i,
365
380
  value: t,
366
- onChange: (c) => n(c.target.value),
367
- onKeyDown: ct,
368
- onBlur: b,
369
- onFocus: f,
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: q ? "" : V,
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__ */ h(
380
- M.div,
395
+ /* @__PURE__ */ p(
396
+ W.div,
381
397
  {
382
- className: R.actions,
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 === "after-submit" && ot()
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 qt({ className: t, size: n = 24 }) {
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 Kt = "SuggestionDropdown-module_container", Xt = "SuggestionDropdown-module_labelRow", Yt = "SuggestionDropdown-module_chevron", Jt = "SuggestionDropdown-module_chevronOpen", zt = "SuggestionDropdown-module_dropdown", te = "SuggestionDropdown-module_option", E = {
427
- container: Kt,
428
- labelRow: Xt,
429
- chevron: Yt,
430
- chevronOpen: Jt,
431
- dropdown: zt,
432
- option: te
433
- }, ee = "Suggestions-module_container", ne = "Suggestions-module_vertical", oe = "Suggestions-module_button", ae = "Suggestions-module_label", ie = "Suggestions-module_description", se = "Suggestions-module_floating", _ = {
434
- container: ee,
435
- vertical: ne,
436
- button: oe,
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: ae,
439
- description: ie,
440
- floating: se
441
- }, le = (t, n) => !t || !n ? `${t}${n}` : /\s$/.test(t) || /^\s/.test(n) ? `${t}${n}` : `${t} ${n}`, re = ({
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 [l, s] = L.useState(!1), b = L.useRef(null), [f, d] = L.useState(null), [u, r] = L.useState(null), [p, m] = L.useState(void 0), N = L.useCallback(
450
- (g) => {
451
- if (b.current = g, !g) {
452
- d(null), r(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
- g.closest(".agenttic") ?? g
457
- ), r(
458
- g.closest(
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 = L.useCallback(
465
- (g) => {
466
- var D;
467
- if (g) {
468
- const I = (D = b.current) == null ? void 0 : D.closest(
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
- I && m(I.clientWidth * 0.9);
487
+ $ && m($.clientWidth * 0.9);
472
488
  }
473
- s(g), a == null || a(g);
489
+ r(h), a == null || a(h);
474
490
  },
475
491
  [a]
476
- ), x = (g) => {
477
- const { options: D, ...I } = t, P = {
478
- ...I,
479
- prompt: le(
492
+ ), x = (h) => {
493
+ const { options: R, ...$ } = t, P = {
494
+ ...$,
495
+ prompt: de(
480
496
  t.prompt ?? t.label,
481
- g.value
497
+ h.value
482
498
  ),
483
- label: `${t.label} ${g.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__ */ h(W.Root, { open: l, onOpenChange: y, children: [
488
- /* @__PURE__ */ e(W.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
489
- k,
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__ */ h(
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__ */ h("span", { className: E.labelRow, children: [
517
+ /* @__PURE__ */ p("span", { className: E.labelRow, children: [
502
518
  /* @__PURE__ */ e("span", { className: _.label, children: t.label }),
503
519
  /* @__PURE__ */ e(
504
- qt,
520
+ Yt,
505
521
  {
506
522
  size: 14,
507
- className: `${E.chevron} ${l ? E.chevronOpen : ""}`
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
- f && /* @__PURE__ */ e(W.Portal, { container: f, children: /* @__PURE__ */ e(
524
- W.Content,
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: p ? { width: p } : void 0,
533
- children: (A = t.options) == null ? void 0 : A.map((g) => /* @__PURE__ */ e(
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(g),
540
- children: g.label
555
+ onClick: () => x(h),
556
+ children: h.label
541
557
  },
542
- g.id
558
+ h.id
543
559
  ))
544
560
  }
545
561
  ) })
546
562
  ] }) });
547
- }, ce = ({
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: l,
554
- onMouseLeave: s,
555
- onDropdownOpenChange: b,
556
- translateY: f = "-100%"
569
+ onMouseEnter: s,
570
+ onMouseLeave: r,
571
+ onDropdownOpenChange: f,
572
+ translateY: g = "-100%"
557
573
  }) => {
558
- const { variant: d, reportSuggestionsRendered: u } = T(), r = it(
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
- z(() => {
563
- i && (r != null && r.length) && (u == null || u(r));
564
- }, [i, r, u]);
565
- const p = async (m, N) => {
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 !r || r.length === 0 ? null : /* @__PURE__ */ e(st, { children: i && /* @__PURE__ */ e(
570
- M.div,
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: f },
595
+ animate: { opacity: 1, y: g },
580
596
  exit: { opacity: 0, y: "-80%" },
581
597
  transition: Q,
582
- onMouseEnter: l,
583
- onMouseLeave: s,
584
- children: r.map(
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
- M.div,
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
- re,
614
+ ue,
599
615
  {
600
616
  suggestion: m,
601
- onSelect: p,
602
- availableSuggestions: r,
603
- onOpenChange: b,
617
+ onSelect: b,
618
+ availableSuggestions: c,
619
+ onOpenChange: f,
604
620
  showDescription: y
605
621
  }
606
622
  ) : /* @__PURE__ */ e(
607
- k,
623
+ D,
608
624
  {
609
625
  onClick: (x) => {
610
- x.stopPropagation(), p(
626
+ x.stopPropagation(), b(
611
627
  m,
612
- r
628
+ c
613
629
  );
614
630
  },
615
631
  variant: "outline",
616
632
  className: _.button,
617
- children: /* @__PURE__ */ h(
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 de({ className: t, size: n = 24 }) {
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 ue = "SourcesCard-module_card", me = "SourcesCard-module_heading", he = "SourcesCard-module_list", pe = "SourcesCard-module_item", fe = "SourcesCard-module_title", ge = "SourcesCard-module_label", B = {
673
- card: ue,
674
- heading: me,
675
- list: he,
676
- item: pe,
677
- title: fe,
678
- label: ge
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 vn({ sources: t, className: n }) {
681
- return t != null && t.length ? /* @__PURE__ */ h(
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"), l = o.id || o.url || `${i}-${a}`;
691
- return /* @__PURE__ */ h(
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
- l
741
+ s
726
742
  );
727
743
  }) })
728
744
  ]
729
745
  }
730
746
  ) : null;
731
747
  }
732
- function be({ className: t, size: n = 24 }) {
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 Ce({
768
+ function ye({
753
769
  className: t,
754
770
  disabled: n,
755
- customActions: o,
756
- actionOrder: a,
757
- onKeyDown: i,
758
- layout: l,
759
- imageUploaderRef: s
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: b,
763
- setInputValue: f,
764
- handleSubmit: d,
765
- handleKeyDown: u,
766
- textareaRef: r,
767
- placeholder: p,
768
- isProcessing: m,
769
- onStop: N,
770
- fromCompact: y,
771
- onExpand: x,
772
- showExpandButton: A,
773
- focusOnMount: g,
774
- onInputFocus: D,
775
- onInputBlur: I
776
- } = T(), P = (j) => {
777
- i == null || i(j), !j.defaultPrevented && u(j);
778
- }, F = it(() => s ? [{
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(be, {}),
798
+ icon: /* @__PURE__ */ e(we, {}),
781
799
  onClick: () => {
782
- var Z;
783
- return (Z = s.current) == null ? void 0 : Z.openFileDialog();
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
- }, ...o || []] : o, [s, o]);
806
+ }, ...a || []] : a, [f, a, g]);
788
807
  return /* @__PURE__ */ e(
789
- Gt,
808
+ Xt,
790
809
  {
791
- value: b,
792
- onChange: f,
793
- onSubmit: d,
794
- onKeyDown: P,
795
- onFocus: D,
796
- onBlur: I,
797
- textareaRef: r,
798
- placeholder: p,
799
- isProcessing: m,
800
- onStop: N,
801
- fromCompact: y,
802
- onExpand: x,
803
- showExpandButton: A,
804
- focusOnMount: g,
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
- customActions: F,
807
- actionOrder: a,
825
+ readOnly: o,
826
+ customActions: q,
827
+ actionOrder: i,
808
828
  className: t,
809
- layout: l ?? (s ? "stacked" : "inline")
829
+ layout: r ?? (f ? "stacked" : "inline")
810
830
  }
811
831
  );
812
832
  }
813
- function ve({
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: l,
822
- messages: s,
823
- variant: b,
824
- emptyView: f
825
- } = T(), d = tt(
826
- (u, r) => {
841
+ inputValue: s,
842
+ messages: r,
843
+ variant: f,
844
+ emptyView: g
845
+ } = Z(), d = et(
846
+ (u, c) => {
827
847
  try {
828
- const p = u.prompt ?? u.label;
829
- o == null || o(p);
830
- } catch (p) {
831
- console.warn("Suggestions onSelect callback failed:", p);
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, r);
853
+ i(u, c);
834
854
  },
835
855
  [o, i]
836
856
  );
837
- return l && !n || f && ["floating", "embedded"].includes(b) && s.length === 0 && !l ? null : /* @__PURE__ */ e(
838
- ce,
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 we({ className: t, size: n = 18 }) {
847
- return /* @__PURE__ */ h(
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 ye({ className: t, size: n = 18 }) {
881
- return /* @__PURE__ */ h(
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 _e = "Notice-module_container", Ne = "Notice-module_isSuccess", xe = "Notice-module_icon", Se = "Notice-module_isWarning", Ie = "Notice-module_isError", $e = "Notice-module_content", Le = "Notice-module_actions", ke = "Notice-module_action", Ae = "Notice-module_dismissible", S = {
921
- container: _e,
922
- isSuccess: Ne,
923
- icon: xe,
924
- isWarning: Se,
925
- isError: Ie,
926
- content: $e,
927
- actions: Le,
928
- action: ke,
929
- dismissible: Ae
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 De({
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: l,
938
- status: s
957
+ className: s,
958
+ status: r
939
959
  }) {
940
- const f = tt(() => {
941
- if (L.isValidElement(t))
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 (s) {
965
+ switch (r) {
946
966
  case "warning":
947
- return /* @__PURE__ */ e(we, {});
967
+ return /* @__PURE__ */ e(Ne, {});
948
968
  case "error":
949
- return /* @__PURE__ */ e(ye, {});
969
+ return /* @__PURE__ */ e(xe, {});
950
970
  default:
951
971
  return null;
952
972
  }
953
- }, [t, s])();
954
- return /* @__PURE__ */ h(
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]: s === "success",
962
- [S.isWarning]: s === "warning",
963
- [S.isError]: s === "error"
981
+ [S.isSuccess]: r === "success",
982
+ [S.isWarning]: r === "warning",
983
+ [S.isError]: r === "error"
964
984
  },
965
- l
985
+ s
966
986
  ),
967
987
  children: [
968
- /* @__PURE__ */ h("div", { className: S.content, children: [
969
- f && /* @__PURE__ */ e("div", { className: S.icon, children: f }),
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
- Ct,
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__ */ h("div", { className: S.actions, children: [
1010
+ /* @__PURE__ */ p("div", { className: S.actions, children: [
991
1011
  o && /* @__PURE__ */ e(
992
- k,
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
- k,
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(de, {})
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 Re({ className: t } = {}) {
1016
- const { notice: n } = T();
1035
+ function Me({ className: t } = {}) {
1036
+ const { notice: n } = Z();
1017
1037
  return n ? /* @__PURE__ */ e(
1018
- De,
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 Be = "ChatFooter-module_container", Me = "ChatFooter-module_disclosure", J = {
1031
- container: Be,
1032
- disclosure: Me
1033
- }, je = "https://automattic.com/ai-guidelines/";
1034
- function Ee() {
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__ */ h(X, { children: [
1059
+ return /* @__PURE__ */ p(Y, { children: [
1040
1060
  n,
1041
1061
  /* @__PURE__ */ e(
1042
1062
  "a",
1043
1063
  {
1044
- href: je,
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 Pe({
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: J.disclosure,
1084
+ className: z.disclosure,
1065
1085
  children: t
1066
1086
  }
1067
1087
  );
1068
1088
  }
1069
- function wn({
1089
+ function Nn({
1070
1090
  children: t,
1071
1091
  className: n,
1072
- complianceDisclosure: o = /* @__PURE__ */ e(Ee, {})
1092
+ complianceDisclosure: o = /* @__PURE__ */ e(Ve, {})
1073
1093
  } = {}) {
1074
- const a = /* @__PURE__ */ e(Pe, { children: o });
1075
- return t ? /* @__PURE__ */ h(X, { children: [
1094
+ const a = /* @__PURE__ */ e(He, { children: o });
1095
+ return t ? /* @__PURE__ */ p(Y, { children: [
1076
1096
  /* @__PURE__ */ e(
1077
- M.div,
1097
+ W.div,
1078
1098
  {
1079
1099
  "data-slot": "chat-footer",
1080
- className: v(J.container, n),
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__ */ h(X, { children: [
1089
- /* @__PURE__ */ h(
1090
- M.div,
1108
+ ] }) : /* @__PURE__ */ p(Y, { children: [
1109
+ /* @__PURE__ */ p(
1110
+ W.div,
1091
1111
  {
1092
1112
  "data-slot": "chat-footer",
1093
- className: v(J.container, n),
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(ve, {}),
1099
- /* @__PURE__ */ e(Re, {}),
1100
- /* @__PURE__ */ e(Ce, {})
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 Ve = "QuestionCard-module_card", He = "QuestionCard-module_question", Ue = "QuestionCard-module_choices", Te = "QuestionCard-module_choicesGrid", Ze = "QuestionCard-module_choice", Oe = "QuestionCard-module_answered", We = "QuestionCard-module_label", Qe = "QuestionCard-module_description", $ = {
1108
- card: Ve,
1109
- question: He,
1110
- choices: Ue,
1111
- choicesGrid: Te,
1112
- choice: Ze,
1113
- answered: Oe,
1114
- label: We,
1115
- description: Qe
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 yn({
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: l,
1124
- renderChoiceContent: s
1143
+ className: s,
1144
+ renderChoiceContent: r
1125
1145
  }) {
1126
- const b = o || a, f = t.choices.slice(0, 4);
1127
- return /* @__PURE__ */ h(
1146
+ const f = o || a, g = t.choices.slice(0, 4);
1147
+ return /* @__PURE__ */ p(
1128
1148
  "section",
1129
1149
  {
1130
- className: v($.card, l),
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: $.question, "data-slot": "question", children: t.question }),
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
- $.choices,
1140
- f.length === 4 ? $.choicesGrid : void 0
1159
+ L.choices,
1160
+ g.length === 4 ? L.choicesGrid : void 0
1141
1161
  ),
1142
1162
  "data-slot": "choices",
1143
- children: f.map((d, u) => {
1144
- const r = d.message ?? d.label, p = i === r;
1145
- return /* @__PURE__ */ h(
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
- $.choice,
1152
- p ? $.answered : void 0
1171
+ L.choice,
1172
+ b ? L.answered : void 0
1153
1173
  ),
1154
- disabled: b,
1155
- "aria-pressed": p || void 0,
1156
- onClick: () => n(r, d),
1174
+ disabled: f,
1175
+ "aria-pressed": b || void 0,
1176
+ onClick: () => n(c, d),
1157
1177
  children: [
1158
- /* @__PURE__ */ e("span", { className: $.label, "data-slot": "label", children: d.label }),
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: $.description,
1182
+ className: L.description,
1163
1183
  "data-slot": "description",
1164
1184
  children: d.description
1165
1185
  }
1166
1186
  ) : null,
1167
- s == null ? void 0 : s(d)
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 Fe = "DiffCard-module_card", Ge = "DiffCard-module_isResolved", qe = "DiffCard-module_title", Ke = "DiffCard-module_summary", Xe = "DiffCard-module_body", Ye = "DiffCard-module_change", Je = "DiffCard-module_changeLabel", ze = "DiffCard-module_diff", tn = "DiffCard-module_removed", en = "DiffCard-module_added", nn = "DiffCard-module_resolution", on = "DiffCard-module_actions", an = "DiffCard-module_action", sn = "DiffCard-module_accept", ln = "DiffCard-module_reject", C = {
1180
- card: Fe,
1181
- isResolved: Ge,
1182
- title: qe,
1183
- summary: Ke,
1184
- body: Xe,
1185
- change: Ye,
1186
- changeLabel: Je,
1187
- diff: ze,
1188
- removed: tn,
1189
- added: en,
1190
- resolution: nn,
1191
- actions: on,
1192
- action: an,
1193
- accept: sn,
1194
- reject: ln
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 rn(t) {
1216
+ function un(t) {
1197
1217
  return typeof t == "string" ? [] : Array.isArray(t) ? t : [t];
1198
1218
  }
1199
- function cn(t, n) {
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__ */ h("div", { className: C.change, "data-slot": "change", children: [
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 _n({
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: l,
1228
- acceptLabel: s,
1229
- rejectLabel: b,
1230
- className: f,
1247
+ resolved: s,
1248
+ acceptLabel: r,
1249
+ rejectLabel: f,
1250
+ className: g,
1231
1251
  renderDiff: d
1232
1252
  }) {
1233
- const u = !!l, r = i || u, p = rn(t);
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 = p.map(cn), /* @__PURE__ */ h(
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
- f
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: l === "accepted" ? w("Accepted", "a8c-agenttic") : w("Rejected", "a8c-agenttic") }) : /* @__PURE__ */ h("div", { className: C.actions, "data-slot": "actions", 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: r,
1276
+ disabled: c,
1257
1277
  onClick: () => a("accepted"),
1258
- children: s ?? w("Accept", "a8c-agenttic")
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: r,
1287
+ disabled: c,
1268
1288
  onClick: () => a("rejected"),
1269
- children: b ?? w("Reject", "a8c-agenttic")
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
- Cn as A,
1279
- k as B,
1280
- Gt as C,
1281
- Ee as D,
1282
- De as N,
1283
- be as P,
1284
- yn as Q,
1285
- ce as S,
1286
- de as X,
1287
- Ot as a,
1288
- wt as b,
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
- vn as d,
1291
- wn as e,
1310
+ _n as d,
1311
+ Nn as e,
1292
1312
  U as f,
1293
- Re as g,
1294
- ve as h,
1295
- Ce as i,
1296
- Pe as j,
1297
- Ft as k,
1298
- _n as l,
1299
- vt as m,
1300
- bn as n,
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
- J as s,
1304
- T as u
1323
+ z as s,
1324
+ Z as u
1305
1325
  };