@automattic/agenttic-ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,2275 @@
1
+ import * as fn from "react";
2
+ import Ne, { useState as He, useEffect as se, useCallback as W, useId as At, memo as dn, useMemo as hn, useRef as J } from "react";
3
+ import { motion as te, AnimatePresence as Qe, useMotionValue as pt, useDragControls as pn, animate as vt } from "framer-motion";
4
+ import { useRef as vn, useCallback as Ge, useEffect as mn } from "@wordpress/element";
5
+ import { Slot as gn } from "@radix-ui/react-slot";
6
+ import yn from "react-markdown";
7
+ import './index.css';var Je = { exports: {} }, we = {};
8
+ /**
9
+ * @license React
10
+ * react-jsx-runtime.production.min.js
11
+ *
12
+ * Copyright (c) Facebook, Inc. and its affiliates.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+ var mt;
18
+ function _n() {
19
+ if (mt) return we;
20
+ mt = 1;
21
+ var t = Ne, n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
22
+ function l(p, u, d) {
23
+ var m, E = {}, b = null, R = null;
24
+ d !== void 0 && (b = "" + d), u.key !== void 0 && (b = "" + u.key), u.ref !== void 0 && (R = u.ref);
25
+ for (m in u) i.call(u, m) && !c.hasOwnProperty(m) && (E[m] = u[m]);
26
+ if (p && p.defaultProps) for (m in u = p.defaultProps, u) E[m] === void 0 && (E[m] = u[m]);
27
+ return { $$typeof: n, type: p, key: b, ref: R, props: E, _owner: o.current };
28
+ }
29
+ return we.Fragment = r, we.jsx = l, we.jsxs = l, we;
30
+ }
31
+ var Ee = {};
32
+ /**
33
+ * @license React
34
+ * react-jsx-runtime.development.js
35
+ *
36
+ * Copyright (c) Facebook, Inc. and its affiliates.
37
+ *
38
+ * This source code is licensed under the MIT license found in the
39
+ * LICENSE file in the root directory of this source tree.
40
+ */
41
+ var gt;
42
+ function Cn() {
43
+ return gt || (gt = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var t = Ne, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), p = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), F = Symbol.iterator, $ = "@@iterator";
45
+ function Y(e) {
46
+ if (e === null || typeof e != "object")
47
+ return null;
48
+ var s = F && e[F] || e[$];
49
+ return typeof s == "function" ? s : null;
50
+ }
51
+ var U = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
+ function L(e) {
53
+ {
54
+ for (var s = arguments.length, f = new Array(s > 1 ? s - 1 : 0), g = 1; g < s; g++)
55
+ f[g - 1] = arguments[g];
56
+ y("error", e, f);
57
+ }
58
+ }
59
+ function y(e, s, f) {
60
+ {
61
+ var g = U.ReactDebugCurrentFrame, T = g.getStackAddendum();
62
+ T !== "" && (s += "%s", f = f.concat([T]));
63
+ var j = f.map(function(w) {
64
+ return String(w);
65
+ });
66
+ j.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, j);
67
+ }
68
+ }
69
+ var v = !1, h = !1, _ = !1, A = !1, S = !1, B;
70
+ B = Symbol.for("react.module.reference");
71
+ function z(e) {
72
+ return !!(typeof e == "string" || typeof e == "function" || e === i || e === c || S || e === o || e === d || e === m || A || e === R || v || h || _ || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === E || e.$$typeof === l || e.$$typeof === p || e.$$typeof === u || // This needs to include all possible module reference object
73
+ // types supported by any Flight configuration anywhere since
74
+ // we don't know which Flight build this will end up being used
75
+ // with.
76
+ e.$$typeof === B || e.getModuleId !== void 0));
77
+ }
78
+ function ce(e, s, f) {
79
+ var g = e.displayName;
80
+ if (g)
81
+ return g;
82
+ var T = s.displayName || s.name || "";
83
+ return T !== "" ? f + "(" + T + ")" : f;
84
+ }
85
+ function K(e) {
86
+ return e.displayName || "Context";
87
+ }
88
+ function H(e) {
89
+ if (e == null)
90
+ return null;
91
+ if (typeof e.tag == "number" && L("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
92
+ return e.displayName || e.name || null;
93
+ if (typeof e == "string")
94
+ return e;
95
+ switch (e) {
96
+ case i:
97
+ return "Fragment";
98
+ case r:
99
+ return "Portal";
100
+ case c:
101
+ return "Profiler";
102
+ case o:
103
+ return "StrictMode";
104
+ case d:
105
+ return "Suspense";
106
+ case m:
107
+ return "SuspenseList";
108
+ }
109
+ if (typeof e == "object")
110
+ switch (e.$$typeof) {
111
+ case p:
112
+ var s = e;
113
+ return K(s) + ".Consumer";
114
+ case l:
115
+ var f = e;
116
+ return K(f._context) + ".Provider";
117
+ case u:
118
+ return ce(e, e.render, "ForwardRef");
119
+ case E:
120
+ var g = e.displayName || null;
121
+ return g !== null ? g : H(e.type) || "Memo";
122
+ case b: {
123
+ var T = e, j = T._payload, w = T._init;
124
+ try {
125
+ return H(w(j));
126
+ } catch {
127
+ return null;
128
+ }
129
+ }
130
+ }
131
+ return null;
132
+ }
133
+ var V = Object.assign, q = 0, Se, Q, Ae, Oe, Ce, le, ue;
134
+ function Ie() {
135
+ }
136
+ Ie.__reactDisabledLog = !0;
137
+ function fe() {
138
+ {
139
+ if (q === 0) {
140
+ Se = console.log, Q = console.info, Ae = console.warn, Oe = console.error, Ce = console.group, le = console.groupCollapsed, ue = console.groupEnd;
141
+ var e = {
142
+ configurable: !0,
143
+ enumerable: !0,
144
+ value: Ie,
145
+ writable: !0
146
+ };
147
+ Object.defineProperties(console, {
148
+ info: e,
149
+ log: e,
150
+ warn: e,
151
+ error: e,
152
+ group: e,
153
+ groupCollapsed: e,
154
+ groupEnd: e
155
+ });
156
+ }
157
+ q++;
158
+ }
159
+ }
160
+ function Ve() {
161
+ {
162
+ if (q--, q === 0) {
163
+ var e = {
164
+ configurable: !0,
165
+ enumerable: !0,
166
+ writable: !0
167
+ };
168
+ Object.defineProperties(console, {
169
+ log: V({}, e, {
170
+ value: Se
171
+ }),
172
+ info: V({}, e, {
173
+ value: Q
174
+ }),
175
+ warn: V({}, e, {
176
+ value: Ae
177
+ }),
178
+ error: V({}, e, {
179
+ value: Oe
180
+ }),
181
+ group: V({}, e, {
182
+ value: Ce
183
+ }),
184
+ groupCollapsed: V({}, e, {
185
+ value: le
186
+ }),
187
+ groupEnd: V({}, e, {
188
+ value: ue
189
+ })
190
+ });
191
+ }
192
+ q < 0 && L("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
+ }
194
+ }
195
+ var xe = U.ReactCurrentDispatcher, re;
196
+ function de(e, s, f) {
197
+ {
198
+ if (re === void 0)
199
+ try {
200
+ throw Error();
201
+ } catch (T) {
202
+ var g = T.stack.trim().match(/\n( *(at )?)/);
203
+ re = g && g[1] || "";
204
+ }
205
+ return `
206
+ ` + re + e;
207
+ }
208
+ }
209
+ var be = !1, C;
210
+ {
211
+ var M = typeof WeakMap == "function" ? WeakMap : Map;
212
+ C = new M();
213
+ }
214
+ function Z(e, s) {
215
+ if (!e || be)
216
+ return "";
217
+ {
218
+ var f = C.get(e);
219
+ if (f !== void 0)
220
+ return f;
221
+ }
222
+ var g;
223
+ be = !0;
224
+ var T = Error.prepareStackTrace;
225
+ Error.prepareStackTrace = void 0;
226
+ var j;
227
+ j = xe.current, xe.current = null, fe();
228
+ try {
229
+ if (s) {
230
+ var w = function() {
231
+ throw Error();
232
+ };
233
+ if (Object.defineProperty(w.prototype, "props", {
234
+ set: function() {
235
+ throw Error();
236
+ }
237
+ }), typeof Reflect == "object" && Reflect.construct) {
238
+ try {
239
+ Reflect.construct(w, []);
240
+ } catch (N) {
241
+ g = N;
242
+ }
243
+ Reflect.construct(e, [], w);
244
+ } else {
245
+ try {
246
+ w.call();
247
+ } catch (N) {
248
+ g = N;
249
+ }
250
+ e.call(w.prototype);
251
+ }
252
+ } else {
253
+ try {
254
+ throw Error();
255
+ } catch (N) {
256
+ g = N;
257
+ }
258
+ e();
259
+ }
260
+ } catch (N) {
261
+ if (N && g && typeof N.stack == "string") {
262
+ for (var x = N.stack.split(`
263
+ `), k = g.stack.split(`
264
+ `), O = x.length - 1, I = k.length - 1; O >= 1 && I >= 0 && x[O] !== k[I]; )
265
+ I--;
266
+ for (; O >= 1 && I >= 0; O--, I--)
267
+ if (x[O] !== k[I]) {
268
+ if (O !== 1 || I !== 1)
269
+ do
270
+ if (O--, I--, I < 0 || x[O] !== k[I]) {
271
+ var G = `
272
+ ` + x[O].replace(" at new ", " at ");
273
+ return e.displayName && G.includes("<anonymous>") && (G = G.replace("<anonymous>", e.displayName)), typeof e == "function" && C.set(e, G), G;
274
+ }
275
+ while (O >= 1 && I >= 0);
276
+ break;
277
+ }
278
+ }
279
+ } finally {
280
+ be = !1, xe.current = j, Ve(), Error.prepareStackTrace = T;
281
+ }
282
+ var me = e ? e.displayName || e.name : "", oe = me ? de(me) : "";
283
+ return typeof e == "function" && C.set(e, oe), oe;
284
+ }
285
+ function ee(e, s, f) {
286
+ return Z(e, !1);
287
+ }
288
+ function he(e) {
289
+ var s = e.prototype;
290
+ return !!(s && s.isReactComponent);
291
+ }
292
+ function ie(e, s, f) {
293
+ if (e == null)
294
+ return "";
295
+ if (typeof e == "function")
296
+ return Z(e, he(e));
297
+ if (typeof e == "string")
298
+ return de(e);
299
+ switch (e) {
300
+ case d:
301
+ return de("Suspense");
302
+ case m:
303
+ return de("SuspenseList");
304
+ }
305
+ if (typeof e == "object")
306
+ switch (e.$$typeof) {
307
+ case u:
308
+ return ee(e.render);
309
+ case E:
310
+ return ie(e.type, s, f);
311
+ case b: {
312
+ var g = e, T = g._payload, j = g._init;
313
+ try {
314
+ return ie(j(T), s, f);
315
+ } catch {
316
+ }
317
+ }
318
+ }
319
+ return "";
320
+ }
321
+ var X = Object.prototype.hasOwnProperty, ae = {}, De = U.ReactDebugCurrentFrame;
322
+ function pe(e) {
323
+ if (e) {
324
+ var s = e._owner, f = ie(e.type, e._source, s ? s.type : null);
325
+ De.setExtraStackFrame(f);
326
+ } else
327
+ De.setExtraStackFrame(null);
328
+ }
329
+ function Wt(e, s, f, g, T) {
330
+ {
331
+ var j = Function.call.bind(X);
332
+ for (var w in e)
333
+ if (j(e, w)) {
334
+ var x = void 0;
335
+ try {
336
+ if (typeof e[w] != "function") {
337
+ var k = Error((g || "React class") + ": " + f + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ throw k.name = "Invariant Violation", k;
339
+ }
340
+ x = e[w](s, w, g, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
+ } catch (O) {
342
+ x = O;
343
+ }
344
+ x && !(x instanceof Error) && (pe(T), L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", f, w, typeof x), pe(null)), x instanceof Error && !(x.message in ae) && (ae[x.message] = !0, pe(T), L("Failed %s type: %s", f, x.message), pe(null));
345
+ }
346
+ }
347
+ }
348
+ var Yt = Array.isArray;
349
+ function We(e) {
350
+ return Yt(e);
351
+ }
352
+ function Ut(e) {
353
+ {
354
+ var s = typeof Symbol == "function" && Symbol.toStringTag, f = s && e[Symbol.toStringTag] || e.constructor.name || "Object";
355
+ return f;
356
+ }
357
+ }
358
+ function Bt(e) {
359
+ try {
360
+ return nt(e), !1;
361
+ } catch {
362
+ return !0;
363
+ }
364
+ }
365
+ function nt(e) {
366
+ return "" + e;
367
+ }
368
+ function rt(e) {
369
+ if (Bt(e))
370
+ return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ut(e)), nt(e);
371
+ }
372
+ var it = U.ReactCurrentOwner, Zt = {
373
+ key: !0,
374
+ ref: !0,
375
+ __self: !0,
376
+ __source: !0
377
+ }, at, ot;
378
+ function Gt(e) {
379
+ if (X.call(e, "ref")) {
380
+ var s = Object.getOwnPropertyDescriptor(e, "ref").get;
381
+ if (s && s.isReactWarning)
382
+ return !1;
383
+ }
384
+ return e.ref !== void 0;
385
+ }
386
+ function Kt(e) {
387
+ if (X.call(e, "key")) {
388
+ var s = Object.getOwnPropertyDescriptor(e, "key").get;
389
+ if (s && s.isReactWarning)
390
+ return !1;
391
+ }
392
+ return e.key !== void 0;
393
+ }
394
+ function Xt(e, s) {
395
+ typeof e.ref == "string" && it.current;
396
+ }
397
+ function Jt(e, s) {
398
+ {
399
+ var f = function() {
400
+ at || (at = !0, L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
401
+ };
402
+ f.isReactWarning = !0, Object.defineProperty(e, "key", {
403
+ get: f,
404
+ configurable: !0
405
+ });
406
+ }
407
+ }
408
+ function qt(e, s) {
409
+ {
410
+ var f = function() {
411
+ ot || (ot = !0, L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
412
+ };
413
+ f.isReactWarning = !0, Object.defineProperty(e, "ref", {
414
+ get: f,
415
+ configurable: !0
416
+ });
417
+ }
418
+ }
419
+ var zt = function(e, s, f, g, T, j, w) {
420
+ var x = {
421
+ // This tag allows us to uniquely identify this as a React Element
422
+ $$typeof: n,
423
+ // Built-in properties that belong on the element
424
+ type: e,
425
+ key: s,
426
+ ref: f,
427
+ props: w,
428
+ // Record the component responsible for creating this element.
429
+ _owner: j
430
+ };
431
+ return x._store = {}, Object.defineProperty(x._store, "validated", {
432
+ configurable: !1,
433
+ enumerable: !1,
434
+ writable: !0,
435
+ value: !1
436
+ }), Object.defineProperty(x, "_self", {
437
+ configurable: !1,
438
+ enumerable: !1,
439
+ writable: !1,
440
+ value: g
441
+ }), Object.defineProperty(x, "_source", {
442
+ configurable: !1,
443
+ enumerable: !1,
444
+ writable: !1,
445
+ value: T
446
+ }), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
447
+ };
448
+ function Qt(e, s, f, g, T) {
449
+ {
450
+ var j, w = {}, x = null, k = null;
451
+ f !== void 0 && (rt(f), x = "" + f), Kt(s) && (rt(s.key), x = "" + s.key), Gt(s) && (k = s.ref, Xt(s, T));
452
+ for (j in s)
453
+ X.call(s, j) && !Zt.hasOwnProperty(j) && (w[j] = s[j]);
454
+ if (e && e.defaultProps) {
455
+ var O = e.defaultProps;
456
+ for (j in O)
457
+ w[j] === void 0 && (w[j] = O[j]);
458
+ }
459
+ if (x || k) {
460
+ var I = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
461
+ x && Jt(w, I), k && qt(w, I);
462
+ }
463
+ return zt(e, x, k, T, g, it.current, w);
464
+ }
465
+ }
466
+ var Ye = U.ReactCurrentOwner, st = U.ReactDebugCurrentFrame;
467
+ function ve(e) {
468
+ if (e) {
469
+ var s = e._owner, f = ie(e.type, e._source, s ? s.type : null);
470
+ st.setExtraStackFrame(f);
471
+ } else
472
+ st.setExtraStackFrame(null);
473
+ }
474
+ var Ue;
475
+ Ue = !1;
476
+ function Be(e) {
477
+ return typeof e == "object" && e !== null && e.$$typeof === n;
478
+ }
479
+ function ct() {
480
+ {
481
+ if (Ye.current) {
482
+ var e = H(Ye.current.type);
483
+ if (e)
484
+ return `
485
+
486
+ Check the render method of \`` + e + "`.";
487
+ }
488
+ return "";
489
+ }
490
+ }
491
+ function en(e) {
492
+ return "";
493
+ }
494
+ var lt = {};
495
+ function tn(e) {
496
+ {
497
+ var s = ct();
498
+ if (!s) {
499
+ var f = typeof e == "string" ? e : e.displayName || e.name;
500
+ f && (s = `
501
+
502
+ Check the top-level render call using <` + f + ">.");
503
+ }
504
+ return s;
505
+ }
506
+ }
507
+ function ut(e, s) {
508
+ {
509
+ if (!e._store || e._store.validated || e.key != null)
510
+ return;
511
+ e._store.validated = !0;
512
+ var f = tn(s);
513
+ if (lt[f])
514
+ return;
515
+ lt[f] = !0;
516
+ var g = "";
517
+ e && e._owner && e._owner !== Ye.current && (g = " It was passed a child from " + H(e._owner.type) + "."), ve(e), L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, g), ve(null);
518
+ }
519
+ }
520
+ function ft(e, s) {
521
+ {
522
+ if (typeof e != "object")
523
+ return;
524
+ if (We(e))
525
+ for (var f = 0; f < e.length; f++) {
526
+ var g = e[f];
527
+ Be(g) && ut(g, s);
528
+ }
529
+ else if (Be(e))
530
+ e._store && (e._store.validated = !0);
531
+ else if (e) {
532
+ var T = Y(e);
533
+ if (typeof T == "function" && T !== e.entries)
534
+ for (var j = T.call(e), w; !(w = j.next()).done; )
535
+ Be(w.value) && ut(w.value, s);
536
+ }
537
+ }
538
+ }
539
+ function nn(e) {
540
+ {
541
+ var s = e.type;
542
+ if (s == null || typeof s == "string")
543
+ return;
544
+ var f;
545
+ if (typeof s == "function")
546
+ f = s.propTypes;
547
+ else if (typeof s == "object" && (s.$$typeof === u || // Note: Memo only checks outer props here.
548
+ // Inner props are checked in the reconciler.
549
+ s.$$typeof === E))
550
+ f = s.propTypes;
551
+ else
552
+ return;
553
+ if (f) {
554
+ var g = H(s);
555
+ Wt(f, e.props, "prop", g, e);
556
+ } else if (s.PropTypes !== void 0 && !Ue) {
557
+ Ue = !0;
558
+ var T = H(s);
559
+ L("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
560
+ }
561
+ typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && L("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
562
+ }
563
+ }
564
+ function rn(e) {
565
+ {
566
+ for (var s = Object.keys(e.props), f = 0; f < s.length; f++) {
567
+ var g = s[f];
568
+ if (g !== "children" && g !== "key") {
569
+ ve(e), L("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), ve(null);
570
+ break;
571
+ }
572
+ }
573
+ e.ref !== null && (ve(e), L("Invalid attribute `ref` supplied to `React.Fragment`."), ve(null));
574
+ }
575
+ }
576
+ var dt = {};
577
+ function ht(e, s, f, g, T, j) {
578
+ {
579
+ var w = z(e);
580
+ if (!w) {
581
+ var x = "";
582
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (x += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
583
+ var k = en();
584
+ k ? x += k : x += ct();
585
+ var O;
586
+ e === null ? O = "null" : We(e) ? O = "array" : e !== void 0 && e.$$typeof === n ? (O = "<" + (H(e.type) || "Unknown") + " />", x = " Did you accidentally export a JSX literal instead of a component?") : O = typeof e, L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, x);
587
+ }
588
+ var I = Qt(e, s, f, T, j);
589
+ if (I == null)
590
+ return I;
591
+ if (w) {
592
+ var G = s.children;
593
+ if (G !== void 0)
594
+ if (g)
595
+ if (We(G)) {
596
+ for (var me = 0; me < G.length; me++)
597
+ ft(G[me], e);
598
+ Object.freeze && Object.freeze(G);
599
+ } else
600
+ L("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
601
+ else
602
+ ft(G, e);
603
+ }
604
+ if (X.call(s, "key")) {
605
+ var oe = H(e), N = Object.keys(s).filter(function(un) {
606
+ return un !== "key";
607
+ }), Ze = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
608
+ if (!dt[oe + Ze]) {
609
+ var ln = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
610
+ L(`A props object containing a "key" prop is being spread into JSX:
611
+ let props = %s;
612
+ <%s {...props} />
613
+ React keys must be passed directly to JSX without using spread:
614
+ let props = %s;
615
+ <%s key={someKey} {...props} />`, Ze, oe, ln, oe), dt[oe + Ze] = !0;
616
+ }
617
+ }
618
+ return e === i ? rn(I) : nn(I), I;
619
+ }
620
+ }
621
+ function an(e, s, f) {
622
+ return ht(e, s, f, !0);
623
+ }
624
+ function on(e, s, f) {
625
+ return ht(e, s, f, !1);
626
+ }
627
+ var sn = on, cn = an;
628
+ Ee.Fragment = i, Ee.jsx = sn, Ee.jsxs = cn;
629
+ }()), Ee;
630
+ }
631
+ process.env.NODE_ENV === "production" ? Je.exports = _n() : Je.exports = Cn();
632
+ var a = Je.exports;
633
+ function xn(t) {
634
+ const [n, r] = He(
635
+ t || "collapsed"
636
+ );
637
+ se(() => {
638
+ t !== void 0 && r(t);
639
+ }, [t]);
640
+ const i = n !== "collapsed", o = W(() => {
641
+ r("compact");
642
+ }, []), c = W(() => {
643
+ r("collapsed");
644
+ }, []), l = W(() => {
645
+ r(
646
+ (p) => p === "collapsed" ? "compact" : "collapsed"
647
+ );
648
+ }, []);
649
+ return {
650
+ state: n,
651
+ setState: r,
652
+ isOpen: i,
653
+ open: o,
654
+ close: c,
655
+ toggle: l
656
+ };
657
+ }
658
+ function bn({
659
+ value: t,
660
+ setValue: n,
661
+ onSubmit: r,
662
+ isProcessing: i
663
+ }) {
664
+ const o = vn(null), c = Ge(() => {
665
+ n(""), o.current && (o.current.style.height = "auto", setTimeout(() => {
666
+ var u;
667
+ (u = o.current) == null || u.focus();
668
+ }, 100));
669
+ }, [n]), l = Ge(() => {
670
+ const u = o.current;
671
+ if (!u)
672
+ return;
673
+ u.style.height = "auto";
674
+ const d = u.scrollHeight, m = 40, E = 200;
675
+ u.style.height = `${Math.min(
676
+ Math.max(d, m),
677
+ E
678
+ )}px`;
679
+ }, []), p = Ge(
680
+ (u) => {
681
+ u.key === "Enter" && !u.shiftKey && !i && t.trim() && (u.preventDefault(), r(t.trim()), c());
682
+ },
683
+ [t, i, r, c]
684
+ );
685
+ return mn(() => {
686
+ l();
687
+ }, [t, l]), {
688
+ value: t,
689
+ setValue: n,
690
+ clear: c,
691
+ textareaRef: o,
692
+ handleKeyDown: p,
693
+ adjustHeight: l
694
+ };
695
+ }
696
+ var qe, Ot, Le, It;
697
+ qe = {
698
+ "(": 9,
699
+ "!": 8,
700
+ "*": 7,
701
+ "/": 7,
702
+ "%": 7,
703
+ "+": 6,
704
+ "-": 6,
705
+ "<": 5,
706
+ "<=": 5,
707
+ ">": 5,
708
+ ">=": 5,
709
+ "==": 4,
710
+ "!=": 4,
711
+ "&&": 3,
712
+ "||": 2,
713
+ "?": 1,
714
+ "?:": 1
715
+ };
716
+ Ot = ["(", "?"];
717
+ Le = {
718
+ ")": ["("],
719
+ ":": ["?", "?:"]
720
+ };
721
+ It = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;
722
+ function wn(t) {
723
+ for (var n = [], r = [], i, o, c, l; i = t.match(It); ) {
724
+ for (o = i[0], c = t.substr(0, i.index).trim(), c && n.push(c); l = r.pop(); ) {
725
+ if (Le[o]) {
726
+ if (Le[o][0] === l) {
727
+ o = Le[o][1] || o;
728
+ break;
729
+ }
730
+ } else if (Ot.indexOf(l) >= 0 || qe[l] < qe[o]) {
731
+ r.push(l);
732
+ break;
733
+ }
734
+ n.push(l);
735
+ }
736
+ Le[o] || r.push(o), t = t.substr(i.index + o.length);
737
+ }
738
+ return t = t.trim(), t && n.push(t), n.concat(r.reverse());
739
+ }
740
+ var En = {
741
+ "!": function(t) {
742
+ return !t;
743
+ },
744
+ "*": function(t, n) {
745
+ return t * n;
746
+ },
747
+ "/": function(t, n) {
748
+ return t / n;
749
+ },
750
+ "%": function(t, n) {
751
+ return t % n;
752
+ },
753
+ "+": function(t, n) {
754
+ return t + n;
755
+ },
756
+ "-": function(t, n) {
757
+ return t - n;
758
+ },
759
+ "<": function(t, n) {
760
+ return t < n;
761
+ },
762
+ "<=": function(t, n) {
763
+ return t <= n;
764
+ },
765
+ ">": function(t, n) {
766
+ return t > n;
767
+ },
768
+ ">=": function(t, n) {
769
+ return t >= n;
770
+ },
771
+ "==": function(t, n) {
772
+ return t === n;
773
+ },
774
+ "!=": function(t, n) {
775
+ return t !== n;
776
+ },
777
+ "&&": function(t, n) {
778
+ return t && n;
779
+ },
780
+ "||": function(t, n) {
781
+ return t || n;
782
+ },
783
+ "?:": function(t, n, r) {
784
+ if (t)
785
+ throw n;
786
+ return r;
787
+ }
788
+ };
789
+ function Rn(t, n) {
790
+ var r = [], i, o, c, l, p, u;
791
+ for (i = 0; i < t.length; i++) {
792
+ if (p = t[i], l = En[p], l) {
793
+ for (o = l.length, c = Array(o); o--; )
794
+ c[o] = r.pop();
795
+ try {
796
+ u = l.apply(null, c);
797
+ } catch (d) {
798
+ return d;
799
+ }
800
+ } else n.hasOwnProperty(p) ? u = n[p] : u = +p;
801
+ r.push(u);
802
+ }
803
+ return r[0];
804
+ }
805
+ function Tn(t) {
806
+ var n = wn(t);
807
+ return function(r) {
808
+ return Rn(n, r);
809
+ };
810
+ }
811
+ function jn(t) {
812
+ var n = Tn(t);
813
+ return function(r) {
814
+ return +n({ n: r });
815
+ };
816
+ }
817
+ var yt = {
818
+ contextDelimiter: "",
819
+ onMissingKey: null
820
+ };
821
+ function Ln(t) {
822
+ var n, r, i;
823
+ for (n = t.split(";"), r = 0; r < n.length; r++)
824
+ if (i = n[r].trim(), i.indexOf("plural=") === 0)
825
+ return i.substr(7);
826
+ }
827
+ function et(t, n) {
828
+ var r;
829
+ this.data = t, this.pluralForms = {}, this.options = {};
830
+ for (r in yt)
831
+ this.options[r] = n !== void 0 && r in n ? n[r] : yt[r];
832
+ }
833
+ et.prototype.getPluralForm = function(t, n) {
834
+ var r = this.pluralForms[t], i, o, c;
835
+ return r || (i = this.data[t][""], c = i["Plural-Forms"] || i["plural-forms"] || // Ignore reason: As known, there's no way to document the empty
836
+ // string property on a key to guarantee this as metadata.
837
+ // @ts-ignore
838
+ i.plural_forms, typeof c != "function" && (o = Ln(
839
+ i["Plural-Forms"] || i["plural-forms"] || // Ignore reason: As known, there's no way to document the empty
840
+ // string property on a key to guarantee this as metadata.
841
+ // @ts-ignore
842
+ i.plural_forms
843
+ ), c = jn(o)), r = this.pluralForms[t] = c), r(n);
844
+ };
845
+ et.prototype.dcnpgettext = function(t, n, r, i, o) {
846
+ var c, l, p;
847
+ return o === void 0 ? c = 0 : c = this.getPluralForm(t, o), l = r, n && (l = n + this.options.contextDelimiter + r), p = this.data[t][l], p && p[c] ? p[c] : (this.options.onMissingKey && this.options.onMissingKey(r, t), c === 0 ? r : i);
848
+ };
849
+ const _t = {
850
+ "": {
851
+ plural_forms(t) {
852
+ return t === 1 ? 0 : 1;
853
+ }
854
+ }
855
+ }, Sn = /^i18n\.(n?gettext|has_translation)(_|$)/, An = (t, n, r) => {
856
+ const i = new et({}), o = /* @__PURE__ */ new Set(), c = () => {
857
+ o.forEach((v) => v());
858
+ }, l = (v) => (o.add(v), () => o.delete(v)), p = (v = "default") => i.data[v], u = (v, h = "default") => {
859
+ var _;
860
+ i.data[h] = {
861
+ ...i.data[h],
862
+ ...v
863
+ }, i.data[h][""] = {
864
+ ..._t[""],
865
+ ...(_ = i.data[h]) == null ? void 0 : _[""]
866
+ }, delete i.pluralForms[h];
867
+ }, d = (v, h) => {
868
+ u(v, h), c();
869
+ }, m = (v, h = "default") => {
870
+ var _;
871
+ i.data[h] = {
872
+ ...i.data[h],
873
+ ...v,
874
+ // Populate default domain configuration (supported locale date which omits
875
+ // a plural forms expression).
876
+ "": {
877
+ ..._t[""],
878
+ ...(_ = i.data[h]) == null ? void 0 : _[""],
879
+ ...v == null ? void 0 : v[""]
880
+ }
881
+ }, delete i.pluralForms[h], c();
882
+ }, E = (v, h) => {
883
+ i.data = {}, i.pluralForms = {}, d(v, h);
884
+ }, b = (v = "default", h, _, A, S) => (i.data[v] || u(void 0, v), i.dcnpgettext(v, h, _, A, S)), R = (v) => v || "default", F = (v, h) => {
885
+ let _ = b(h, void 0, v);
886
+ return r ? (_ = r.applyFilters("i18n.gettext", _, v, h), r.applyFilters("i18n.gettext_" + R(h), _, v, h)) : _;
887
+ }, $ = (v, h, _) => {
888
+ let A = b(_, h, v);
889
+ return r ? (A = r.applyFilters("i18n.gettext_with_context", A, v, h, _), r.applyFilters("i18n.gettext_with_context_" + R(_), A, v, h, _)) : A;
890
+ }, Y = (v, h, _, A) => {
891
+ let S = b(A, void 0, v, h, _);
892
+ return r ? (S = r.applyFilters("i18n.ngettext", S, v, h, _, A), r.applyFilters("i18n.ngettext_" + R(A), S, v, h, _, A)) : S;
893
+ }, U = (v, h, _, A, S) => {
894
+ let B = b(S, A, v, h, _);
895
+ return r ? (B = r.applyFilters("i18n.ngettext_with_context", B, v, h, _, A, S), r.applyFilters("i18n.ngettext_with_context_" + R(S), B, v, h, _, A, S)) : B;
896
+ }, L = () => $("ltr", "text direction") === "rtl", y = (v, h, _) => {
897
+ var B, z;
898
+ const A = h ? h + "" + v : v;
899
+ let S = !!((z = (B = i.data) == null ? void 0 : B[_ ?? "default"]) != null && z[A]);
900
+ return r && (S = r.applyFilters("i18n.has_translation", S, v, h, _), S = r.applyFilters("i18n.has_translation_" + R(_), S, v, h, _)), S;
901
+ };
902
+ if (r) {
903
+ const v = (h) => {
904
+ Sn.test(h) && c();
905
+ };
906
+ r.addAction("hookAdded", "core/i18n", v), r.addAction("hookRemoved", "core/i18n", v);
907
+ }
908
+ return {
909
+ getLocaleData: p,
910
+ setLocaleData: d,
911
+ addLocaleData: m,
912
+ resetLocaleData: E,
913
+ subscribe: l,
914
+ __: F,
915
+ _x: $,
916
+ _n: Y,
917
+ _nx: U,
918
+ isRTL: L,
919
+ hasTranslation: y
920
+ };
921
+ };
922
+ function Dt(t) {
923
+ return typeof t != "string" || t === "" ? (console.error("The namespace must be a non-empty string."), !1) : /^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t) ? !0 : (console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."), !1);
924
+ }
925
+ function tt(t) {
926
+ return typeof t != "string" || t === "" ? (console.error("The hook name must be a non-empty string."), !1) : /^__/.test(t) ? (console.error("The hook name cannot begin with `__`."), !1) : /^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t) ? !0 : (console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."), !1);
927
+ }
928
+ function Ct(t, n) {
929
+ return function(i, o, c, l = 10) {
930
+ const p = t[n];
931
+ if (!tt(i) || !Dt(o))
932
+ return;
933
+ if (typeof c != "function") {
934
+ console.error("The hook callback must be a function.");
935
+ return;
936
+ }
937
+ if (typeof l != "number") {
938
+ console.error("If specified, the hook priority must be a number.");
939
+ return;
940
+ }
941
+ const u = {
942
+ callback: c,
943
+ priority: l,
944
+ namespace: o
945
+ };
946
+ if (p[i]) {
947
+ const d = p[i].handlers;
948
+ let m;
949
+ for (m = d.length; m > 0 && !(l >= d[m - 1].priority); m--)
950
+ ;
951
+ m === d.length ? d[m] = u : d.splice(m, 0, u), p.__current.forEach((E) => {
952
+ E.name === i && E.currentIndex >= m && E.currentIndex++;
953
+ });
954
+ } else
955
+ p[i] = {
956
+ handlers: [u],
957
+ runs: 0
958
+ };
959
+ i !== "hookAdded" && t.doAction("hookAdded", i, o, c, l);
960
+ };
961
+ }
962
+ function Pe(t, n, r = !1) {
963
+ return function(o, c) {
964
+ const l = t[n];
965
+ if (!tt(o) || !r && !Dt(c))
966
+ return;
967
+ if (!l[o])
968
+ return 0;
969
+ let p = 0;
970
+ if (r)
971
+ p = l[o].handlers.length, l[o] = {
972
+ runs: l[o].runs,
973
+ handlers: []
974
+ };
975
+ else {
976
+ const u = l[o].handlers;
977
+ for (let d = u.length - 1; d >= 0; d--)
978
+ u[d].namespace === c && (u.splice(d, 1), p++, l.__current.forEach((m) => {
979
+ m.name === o && m.currentIndex >= d && m.currentIndex--;
980
+ }));
981
+ }
982
+ return o !== "hookRemoved" && t.doAction("hookRemoved", o, c), p;
983
+ };
984
+ }
985
+ function xt(t, n) {
986
+ return function(i, o) {
987
+ const c = t[n];
988
+ return typeof o < "u" ? i in c && c[i].handlers.some((l) => l.namespace === o) : i in c;
989
+ };
990
+ }
991
+ function Fe(t, n, r, i) {
992
+ return function(c, ...l) {
993
+ const p = t[n];
994
+ p[c] || (p[c] = {
995
+ handlers: [],
996
+ runs: 0
997
+ }), p[c].runs++;
998
+ const u = p[c].handlers;
999
+ if (process.env.NODE_ENV !== "production" && c !== "hookAdded" && p.all && u.push(...p.all.handlers), !u || !u.length)
1000
+ return r ? l[0] : void 0;
1001
+ const d = {
1002
+ name: c,
1003
+ currentIndex: 0
1004
+ };
1005
+ async function m() {
1006
+ try {
1007
+ p.__current.add(d);
1008
+ let b = r ? l[0] : void 0;
1009
+ for (; d.currentIndex < u.length; )
1010
+ b = await u[d.currentIndex].callback.apply(null, l), r && (l[0] = b), d.currentIndex++;
1011
+ return r ? b : void 0;
1012
+ } finally {
1013
+ p.__current.delete(d);
1014
+ }
1015
+ }
1016
+ function E() {
1017
+ try {
1018
+ p.__current.add(d);
1019
+ let b = r ? l[0] : void 0;
1020
+ for (; d.currentIndex < u.length; )
1021
+ b = u[d.currentIndex].callback.apply(null, l), r && (l[0] = b), d.currentIndex++;
1022
+ return r ? b : void 0;
1023
+ } finally {
1024
+ p.__current.delete(d);
1025
+ }
1026
+ }
1027
+ return (i ? m : E)();
1028
+ };
1029
+ }
1030
+ function bt(t, n) {
1031
+ return function() {
1032
+ var l;
1033
+ var i;
1034
+ const o = t[n];
1035
+ return (i = (l = Array.from(o.__current).at(-1)) == null ? void 0 : l.name) !== null && i !== void 0 ? i : null;
1036
+ };
1037
+ }
1038
+ function wt(t, n) {
1039
+ return function(i) {
1040
+ const o = t[n];
1041
+ return typeof i > "u" ? o.__current.size > 0 : Array.from(o.__current).some((c) => c.name === i);
1042
+ };
1043
+ }
1044
+ function Et(t, n) {
1045
+ return function(i) {
1046
+ const o = t[n];
1047
+ if (tt(i))
1048
+ return o[i] && o[i].runs ? o[i].runs : 0;
1049
+ };
1050
+ }
1051
+ class On {
1052
+ constructor() {
1053
+ this.actions = /* @__PURE__ */ Object.create(null), this.actions.__current = /* @__PURE__ */ new Set(), this.filters = /* @__PURE__ */ Object.create(null), this.filters.__current = /* @__PURE__ */ new Set(), this.addAction = Ct(this, "actions"), this.addFilter = Ct(this, "filters"), this.removeAction = Pe(this, "actions"), this.removeFilter = Pe(this, "filters"), this.hasAction = xt(this, "actions"), this.hasFilter = xt(this, "filters"), this.removeAllActions = Pe(this, "actions", !0), this.removeAllFilters = Pe(this, "filters", !0), this.doAction = Fe(this, "actions", !1, !1), this.doActionAsync = Fe(this, "actions", !1, !0), this.applyFilters = Fe(this, "filters", !0, !1), this.applyFiltersAsync = Fe(this, "filters", !0, !0), this.currentAction = bt(this, "actions"), this.currentFilter = bt(this, "filters"), this.doingAction = wt(this, "actions"), this.doingFilter = wt(this, "filters"), this.didAction = Et(this, "actions"), this.didFilter = Et(this, "filters");
1054
+ }
1055
+ }
1056
+ function In() {
1057
+ return new On();
1058
+ }
1059
+ const Pt = In(), {
1060
+ addAction: Vr,
1061
+ addFilter: Wr,
1062
+ removeAction: Yr,
1063
+ removeFilter: Ur,
1064
+ hasAction: Br,
1065
+ hasFilter: Zr,
1066
+ removeAllActions: Gr,
1067
+ removeAllFilters: Kr,
1068
+ doAction: Xr,
1069
+ doActionAsync: Jr,
1070
+ applyFilters: qr,
1071
+ applyFiltersAsync: zr,
1072
+ currentAction: Qr,
1073
+ currentFilter: ei,
1074
+ doingAction: ti,
1075
+ doingFilter: ni,
1076
+ didAction: ri,
1077
+ didFilter: ii,
1078
+ actions: ai,
1079
+ filters: oi
1080
+ } = Pt, D = An(void 0, void 0, Pt);
1081
+ D.getLocaleData.bind(D);
1082
+ D.setLocaleData.bind(D);
1083
+ D.resetLocaleData.bind(D);
1084
+ D.subscribe.bind(D);
1085
+ const ye = D.__.bind(D);
1086
+ D._x.bind(D);
1087
+ D._n.bind(D);
1088
+ D._nx.bind(D);
1089
+ D.isRTL.bind(D);
1090
+ D.hasTranslation.bind(D);
1091
+ const Ft = ye("Ask anything", "a8c-agenttic");
1092
+ function _e(...t) {
1093
+ return t.flat().filter(Boolean).map((n) => typeof n == "string" ? n : typeof n == "object" && !Array.isArray(n) && n !== null ? Object.entries(n).filter(([r, i]) => i).map(([r]) => r).join(" ") : "").join(" ").trim();
1094
+ }
1095
+ const Rt = {
1096
+ type: "spring",
1097
+ stiffness: 300,
1098
+ damping: 30
1099
+ }, Mt = {
1100
+ type: "spring",
1101
+ damping: 40,
1102
+ stiffness: 500,
1103
+ mass: 0.8
1104
+ }, ze = {
1105
+ ...Mt,
1106
+ stiffness: 1e3,
1107
+ damping: 90
1108
+ }, $t = {
1109
+ type: "spring",
1110
+ damping: 40,
1111
+ stiffness: 400,
1112
+ mass: 0.8
1113
+ }, Dn = {
1114
+ hidden: {
1115
+ opacity: 0
1116
+ },
1117
+ visible: {
1118
+ opacity: 1,
1119
+ transition: Rt
1120
+ },
1121
+ exit: {
1122
+ opacity: 0,
1123
+ transition: { ...Rt, duration: 0.1 }
1124
+ }
1125
+ }, Pn = "button-module_button", Fn = "button-module_primary", Mn = "button-module_ghost", $n = "button-module_outline", kn = "button-module_link", Hn = "button-module_icon", Nn = "button-module_sm", Vn = "button-module_withTextAndIcon", Me = {
1126
+ button: Pn,
1127
+ primary: Fn,
1128
+ ghost: Mn,
1129
+ outline: $n,
1130
+ link: kn,
1131
+ icon: Hn,
1132
+ sm: Nn,
1133
+ withTextAndIcon: Vn
1134
+ };
1135
+ function ne({
1136
+ className: t,
1137
+ variant: n = "primary",
1138
+ size: r,
1139
+ icon: i,
1140
+ children: o,
1141
+ asChild: c = !1,
1142
+ ...l
1143
+ }) {
1144
+ const p = c ? gn : "button", u = !!i, d = r || (u && !o ? "icon" : void 0);
1145
+ return /* @__PURE__ */ a.jsxs(
1146
+ p,
1147
+ {
1148
+ "data-slot": "button",
1149
+ className: _e(
1150
+ Me.button,
1151
+ Me[n],
1152
+ d && Me[d],
1153
+ u && o ? Me.withTextAndIcon : void 0,
1154
+ t
1155
+ ),
1156
+ ...l,
1157
+ children: [
1158
+ i,
1159
+ o
1160
+ ]
1161
+ }
1162
+ );
1163
+ }
1164
+ function kt({ className: t, size: n }) {
1165
+ const r = At();
1166
+ return /* @__PURE__ */ a.jsxs(
1167
+ "svg",
1168
+ {
1169
+ width: n || 24,
1170
+ height: n || 24,
1171
+ viewBox: "0 0 24 24",
1172
+ fill: "none",
1173
+ xmlns: "http://www.w3.org/2000/svg",
1174
+ className: t,
1175
+ children: [
1176
+ /* @__PURE__ */ a.jsx("g", { clipPath: `url(#${r})`, children: /* @__PURE__ */ a.jsx(
1177
+ "path",
1178
+ {
1179
+ d: "M23.4917 11.0137L18.5673 9.37361C16.6198 8.72751 15.0842 7.24482 14.415 5.36451L12.7163 0.609924C12.4847 -0.0444537 11.5153 -0.0444537 11.2837 0.609924L9.585 5.36451C8.91583 7.24482 7.38016 8.72751 5.43271 9.37361L0.508312 11.0137C-0.169437 11.2373 -0.169437 12.1733 0.508312 12.397L5.43271 14.0371C7.38016 14.6832 8.91583 16.1659 9.585 18.0462L11.2837 22.8008C11.5153 23.4552 12.4847 23.4552 12.7163 22.8008L14.415 18.0462C15.0842 16.1659 16.6198 14.6832 18.5673 14.0371L23.4917 12.397C24.1695 12.1733 24.1695 11.2373 23.4917 11.0137ZM17.7437 12.0574L15.2815 12.8774C14.3035 13.2004 13.5399 13.9459 13.2054 14.8819L12.3561 17.2593C12.2359 17.5906 11.7555 17.5906 11.6354 17.2593L10.786 14.8819C10.4515 13.9377 9.67937 13.2004 8.70994 12.8774L6.24772 12.0574C5.90456 11.9414 5.90456 11.4776 6.24772 11.3616L8.70994 10.5416C9.68794 10.2185 10.4515 9.473 10.786 8.537L11.6354 6.15971C11.7555 5.82838 12.2359 5.82838 12.3561 6.15971L13.2054 8.537C13.5399 9.48128 14.3121 10.2185 15.2815 10.5416L17.7437 11.3616C18.0868 11.4776 18.0868 11.9414 17.7437 12.0574Z",
1180
+ fill: "currentColor"
1181
+ }
1182
+ ) }),
1183
+ /* @__PURE__ */ a.jsx("defs", { children: /* @__PURE__ */ a.jsx("clipPath", { id: r, children: /* @__PURE__ */ a.jsx("rect", { width: "24", height: "24", fill: "currentColor" }) }) })
1184
+ ]
1185
+ }
1186
+ );
1187
+ }
1188
+ const Wn = "CollapsedView-module_button", Yn = {
1189
+ button: Wn
1190
+ };
1191
+ function Un({
1192
+ icon: t = /* @__PURE__ */ a.jsx(kt, { className: "size-6" }),
1193
+ onClick: n,
1194
+ onHover: r,
1195
+ fromExpanded: i = !1
1196
+ }) {
1197
+ return /* @__PURE__ */ a.jsx(
1198
+ te.div,
1199
+ {
1200
+ "data-slot": "collapsed-view",
1201
+ layout: "preserve-aspect",
1202
+ layoutId: "collapsed-button",
1203
+ initial: {
1204
+ opacity: 0,
1205
+ scale: 0.5
1206
+ },
1207
+ animate: {
1208
+ opacity: 1,
1209
+ scale: 1,
1210
+ transition: {
1211
+ ...$t,
1212
+ delay: 0.2
1213
+ }
1214
+ },
1215
+ exit: {
1216
+ opacity: 0,
1217
+ scale: 0,
1218
+ transition: {
1219
+ duration: 0.15
1220
+ }
1221
+ },
1222
+ children: /* @__PURE__ */ a.jsx(
1223
+ ne,
1224
+ {
1225
+ onClick: n,
1226
+ onMouseEnter: r,
1227
+ variant: "link",
1228
+ className: Yn.button,
1229
+ icon: t,
1230
+ "aria-label": ye("Open chat", "a8c-agenttic")
1231
+ }
1232
+ )
1233
+ }
1234
+ );
1235
+ }
1236
+ const Bn = "Textarea-module_textarea", Zn = {
1237
+ textarea: Bn
1238
+ }, Ht = fn.forwardRef(
1239
+ ({ className: t, ...n }, r) => /* @__PURE__ */ a.jsx(
1240
+ "textarea",
1241
+ {
1242
+ "data-slot": "textarea",
1243
+ className: Zn.textarea,
1244
+ ref: r,
1245
+ ...n
1246
+ }
1247
+ )
1248
+ );
1249
+ Ht.displayName = "Textarea";
1250
+ function Gn({ className: t, size: n = 24 }) {
1251
+ return /* @__PURE__ */ a.jsx(
1252
+ "svg",
1253
+ {
1254
+ width: n,
1255
+ height: n,
1256
+ viewBox: "0 0 24 24",
1257
+ fill: "none",
1258
+ xmlns: "http://www.w3.org/2000/svg",
1259
+ className: t,
1260
+ children: /* @__PURE__ */ a.jsx(
1261
+ "path",
1262
+ {
1263
+ d: "M12.2197 5C12.4186 5 12.6094 5.07902 12.75 5.21967L17 9.46967C17.2929 9.76256 17.2929 10.2374 17 10.5303C16.7071 10.8232 16.2322 10.8232 15.9393 10.5303L12.9697 7.56067V18.25C12.9697 18.6642 12.6339 19 12.2197 19C11.8055 19 11.4697 18.6642 11.4697 18.25V7.56065L8.5 10.5303C8.2071 10.8232 7.73223 10.8232 7.43934 10.5303C7.14644 10.2374 7.14645 9.76256 7.43934 9.46967L11.6894 5.21967C11.83 5.07902 12.0208 5 12.2197 5Z",
1264
+ fill: "currentColor"
1265
+ }
1266
+ )
1267
+ }
1268
+ );
1269
+ }
1270
+ function Kn({ className: t, size: n = 24 }) {
1271
+ return /* @__PURE__ */ a.jsx(
1272
+ "svg",
1273
+ {
1274
+ width: n,
1275
+ height: n,
1276
+ viewBox: "0 0 24 24",
1277
+ fill: "none",
1278
+ xmlns: "http://www.w3.org/2000/svg",
1279
+ className: t,
1280
+ children: /* @__PURE__ */ a.jsx(
1281
+ "rect",
1282
+ {
1283
+ x: "7",
1284
+ y: "7",
1285
+ width: "10",
1286
+ height: "10",
1287
+ rx: "2",
1288
+ fill: "currentColor"
1289
+ }
1290
+ )
1291
+ }
1292
+ );
1293
+ }
1294
+ const Xn = "ChatInput-module_container", Jn = "ChatInput-module_textareaContainer", qn = "ChatInput-module_actions", zn = "ChatInput-module_button", Re = {
1295
+ container: Xn,
1296
+ textareaContainer: Jn,
1297
+ actions: qn,
1298
+ button: zn
1299
+ };
1300
+ function Qn({ className: t, size: n = 24 }) {
1301
+ return /* @__PURE__ */ a.jsx(
1302
+ "svg",
1303
+ {
1304
+ className: t,
1305
+ width: n,
1306
+ height: n,
1307
+ viewBox: "0 0 24 24",
1308
+ fill: "none",
1309
+ xmlns: "http://www.w3.org/2000/svg",
1310
+ children: /* @__PURE__ */ a.jsx(
1311
+ "path",
1312
+ {
1313
+ fillRule: "evenodd",
1314
+ clipRule: "evenodd",
1315
+ d: "M18.0045 13.4451L12 7.9864L5.9955 13.4451L7.00451 14.5549L12 10.0136L16.9955 14.5549L18.0045 13.4451Z",
1316
+ fill: "currentColor"
1317
+ }
1318
+ )
1319
+ }
1320
+ );
1321
+ }
1322
+ function Nt({
1323
+ value: t,
1324
+ onChange: n,
1325
+ onSubmit: r,
1326
+ onKeyDown: i,
1327
+ textareaRef: o,
1328
+ placeholder: c = Ft,
1329
+ isProcessing: l,
1330
+ onBlur: p,
1331
+ fromCompact: u = !1,
1332
+ onExpand: d,
1333
+ showExpandButton: m = !0,
1334
+ focusOnMount: E = !1
1335
+ }) {
1336
+ const b = At(), R = t.trim() || l, F = c.endsWith("…") ? c : `${c}…`;
1337
+ return se(() => {
1338
+ E && o.current && o.current.focus();
1339
+ }, []), /* @__PURE__ */ a.jsxs("div", { "data-slot": "chat-input", className: Re.container, children: [
1340
+ /* @__PURE__ */ a.jsx(
1341
+ te.div,
1342
+ {
1343
+ className: Re.textareaContainer,
1344
+ initial: {
1345
+ opacity: 0
1346
+ },
1347
+ animate: {
1348
+ opacity: 1,
1349
+ scale: 1,
1350
+ transition: t.trim() ? { duration: 0 } : ze
1351
+ },
1352
+ children: /* @__PURE__ */ a.jsx(
1353
+ Ht,
1354
+ {
1355
+ id: b,
1356
+ ref: o,
1357
+ value: t,
1358
+ onChange: ($) => n($.target.value),
1359
+ onKeyDown: i,
1360
+ onBlur: p,
1361
+ placeholder: F,
1362
+ rows: 1
1363
+ }
1364
+ )
1365
+ }
1366
+ ),
1367
+ /* @__PURE__ */ a.jsxs(
1368
+ te.div,
1369
+ {
1370
+ className: Re.actions,
1371
+ initial: {
1372
+ opacity: u ? 1 : 0,
1373
+ scale: u ? 1 : 0.5
1374
+ },
1375
+ animate: {
1376
+ opacity: 1,
1377
+ scale: 1,
1378
+ transition: t.trim() ? { duration: 0 } : Mt
1379
+ },
1380
+ children: [
1381
+ m && d && /* @__PURE__ */ a.jsx(
1382
+ ne,
1383
+ {
1384
+ className: Re.button,
1385
+ onClick: d,
1386
+ variant: "ghost",
1387
+ icon: /* @__PURE__ */ a.jsx(Qn, {}),
1388
+ "aria-label": ye(
1389
+ "Expand conversation",
1390
+ "a8c-agenttic"
1391
+ )
1392
+ }
1393
+ ),
1394
+ /* @__PURE__ */ a.jsx(
1395
+ ne,
1396
+ {
1397
+ className: Re.button,
1398
+ onClick: r,
1399
+ disabled: !R,
1400
+ variant: "primary",
1401
+ icon: l ? /* @__PURE__ */ a.jsx(Kn, {}) : /* @__PURE__ */ a.jsx(Gn, {}),
1402
+ "aria-label": ye(l ? "Stop processing" : "Send message", "a8c-agenttic")
1403
+ }
1404
+ )
1405
+ ]
1406
+ }
1407
+ )
1408
+ ] });
1409
+ }
1410
+ function er({
1411
+ value: t,
1412
+ onChange: n,
1413
+ onSubmit: r,
1414
+ onKeyDown: i,
1415
+ textareaRef: o,
1416
+ placeholder: c,
1417
+ isProcessing: l,
1418
+ onBlur: p,
1419
+ onExpand: u,
1420
+ showExpandButton: d = !0,
1421
+ focusOnMount: m = !1
1422
+ }) {
1423
+ return /* @__PURE__ */ a.jsx(
1424
+ Nt,
1425
+ {
1426
+ value: t,
1427
+ onChange: n,
1428
+ onSubmit: r,
1429
+ onKeyDown: i,
1430
+ textareaRef: o,
1431
+ placeholder: c,
1432
+ isProcessing: l,
1433
+ onBlur: p,
1434
+ onExpand: u,
1435
+ showExpandButton: d,
1436
+ focusOnMount: m
1437
+ }
1438
+ );
1439
+ }
1440
+ function Vt({ className: t, size: n = 24 }) {
1441
+ return /* @__PURE__ */ a.jsx(
1442
+ "svg",
1443
+ {
1444
+ className: t,
1445
+ width: n,
1446
+ height: n,
1447
+ viewBox: "0 0 24 24",
1448
+ fill: "none",
1449
+ xmlns: "http://www.w3.org/2000/svg",
1450
+ children: /* @__PURE__ */ a.jsx(
1451
+ "path",
1452
+ {
1453
+ d: "M12.0001 13.0607L16.4697 17.5304L17.5304 16.4697L13.0607 12.0001L17.5304 7.53039L16.4697 6.46973L12.0001 10.9394L7.5304 6.46973L6.46973 7.53039L10.9394 12.0001L6.46974 16.4697L7.5304 17.5304L12.0001 13.0607Z",
1454
+ fill: "currentColor"
1455
+ }
1456
+ )
1457
+ }
1458
+ );
1459
+ }
1460
+ const tr = "ChatHeader-module_container", nr = {
1461
+ container: tr
1462
+ };
1463
+ function rr({ onClose: t }) {
1464
+ return /* @__PURE__ */ a.jsx(
1465
+ "div",
1466
+ {
1467
+ "data-slot": "chat-header",
1468
+ "data-draggable": "true",
1469
+ className: nr.container,
1470
+ children: t && /* @__PURE__ */ a.jsx(
1471
+ ne,
1472
+ {
1473
+ variant: "ghost",
1474
+ icon: /* @__PURE__ */ a.jsx(Vt, {}),
1475
+ onClick: t,
1476
+ "aria-label": ye("Close conversation", "a8c-agenttic")
1477
+ }
1478
+ )
1479
+ }
1480
+ );
1481
+ }
1482
+ const ir = "MessageActions-module_container", Tt = {
1483
+ container: ir
1484
+ };
1485
+ function jt({ message: t }) {
1486
+ return !t.actions || t.actions.length === 0 ? null : /* @__PURE__ */ a.jsx(
1487
+ "div",
1488
+ {
1489
+ className: Tt.container,
1490
+ "data-visible": "true",
1491
+ role: "toolbar",
1492
+ "aria-label": "Message actions",
1493
+ children: t.actions.map((n) => /* @__PURE__ */ a.jsx(
1494
+ ne,
1495
+ {
1496
+ className: Tt.button,
1497
+ icon: n.icon,
1498
+ onClick: () => n.onClick(t),
1499
+ variant: "ghost",
1500
+ size: "sm",
1501
+ type: "button",
1502
+ disabled: n.disabled,
1503
+ title: n.tooltip || n.label,
1504
+ "aria-label": n.label,
1505
+ ...n.tooltip && { title: n.tooltip }
1506
+ },
1507
+ n.id
1508
+ ))
1509
+ }
1510
+ );
1511
+ }
1512
+ const ar = "Message-module_message", or = "Message-module_user", sr = "Message-module_bubble", cr = "Message-module_error", lr = "Message-module_content", $e = {
1513
+ message: ar,
1514
+ user: or,
1515
+ bubble: sr,
1516
+ error: cr,
1517
+ content: lr
1518
+ }, ur = Ne.forwardRef(
1519
+ function({ message: n, messageRenderer: r = yn }, i) {
1520
+ const o = () => /* @__PURE__ */ a.jsx(a.Fragment, { children: n.content.map((c, l) => {
1521
+ if (c.type === "text" && c.text)
1522
+ return /* @__PURE__ */ a.jsx(r, { children: c.text }, l);
1523
+ if (c.type === "component" && c.component) {
1524
+ const p = c.component;
1525
+ return /* @__PURE__ */ a.jsx(
1526
+ p,
1527
+ {
1528
+ ...c.componentProps || {}
1529
+ },
1530
+ l
1531
+ );
1532
+ }
1533
+ return null;
1534
+ }) });
1535
+ return /* @__PURE__ */ a.jsxs(
1536
+ te.div,
1537
+ {
1538
+ ref: i,
1539
+ variants: Dn,
1540
+ initial: "hidden",
1541
+ animate: "visible",
1542
+ "data-slot": "message",
1543
+ "data-role": n.role,
1544
+ className: _e($e.message, $e[n.role]),
1545
+ children: [
1546
+ /* @__PURE__ */ a.jsxs("div", { className: $e.content, children: [
1547
+ /* @__PURE__ */ a.jsx("div", { className: $e.bubble, children: o() }),
1548
+ n.role !== "user" && /* @__PURE__ */ a.jsx(jt, { message: n })
1549
+ ] }),
1550
+ n.role === "user" && /* @__PURE__ */ a.jsx(jt, { message: n })
1551
+ ]
1552
+ }
1553
+ );
1554
+ }
1555
+ ), fr = "Messages-module_container", dr = "Messages-module_emptyState", Ke = {
1556
+ container: fr,
1557
+ emptyState: dr
1558
+ }, hr = "Thinking-module_container", pr = "Thinking-module_icon", vr = "Thinking-module_content", Xe = {
1559
+ container: hr,
1560
+ icon: pr,
1561
+ content: vr
1562
+ }, mr = dn(
1563
+ Ne.forwardRef(
1564
+ function({ content: n = "Thinking…" }, r) {
1565
+ const i = hn(() => /* @__PURE__ */ a.jsx(kt, {}), []);
1566
+ return /* @__PURE__ */ a.jsxs(
1567
+ "div",
1568
+ {
1569
+ ref: r,
1570
+ "data-slot": "thinking",
1571
+ className: Xe.container,
1572
+ children: [
1573
+ /* @__PURE__ */ a.jsx("div", { className: Xe.icon, children: i }),
1574
+ /* @__PURE__ */ a.jsx("span", { className: Xe.content, children: n })
1575
+ ]
1576
+ }
1577
+ );
1578
+ }
1579
+ )
1580
+ );
1581
+ function gr({
1582
+ messages: t,
1583
+ isProcessing: n,
1584
+ error: r,
1585
+ emptyView: i,
1586
+ fromCompact: o = !1,
1587
+ messageRenderer: c
1588
+ }) {
1589
+ const l = J(null), p = J([]), u = J(!0), d = J(null);
1590
+ return se(() => {
1591
+ const m = t.length > p.current.length;
1592
+ if (m && l.current) {
1593
+ const E = l.current.querySelectorAll(
1594
+ '[data-slot="message"]'
1595
+ ), b = E[E.length - 1];
1596
+ if (b) {
1597
+ const R = b.getBoundingClientRect().top - l.current.getBoundingClientRect().top + l.current.scrollTop, F = o && u.current ? "auto" : "smooth";
1598
+ l.current.scrollTo({
1599
+ top: R,
1600
+ behavior: F
1601
+ });
1602
+ }
1603
+ }
1604
+ if (m && d.current) {
1605
+ const b = t.slice(
1606
+ p.current.length
1607
+ ).filter(
1608
+ (R) => R.role === "agent"
1609
+ );
1610
+ if (b.length > 0) {
1611
+ const F = b[b.length - 1].content.filter(($) => $.type === "text").map(($) => $.text).join(" ");
1612
+ F && (d.current.textContent = F);
1613
+ }
1614
+ }
1615
+ u.current && (u.current = !1), p.current = t;
1616
+ }, [t, o]), t.length === 0 ? i ? /* @__PURE__ */ a.jsx(
1617
+ "div",
1618
+ {
1619
+ "data-slot": "messages",
1620
+ className: `${Ke.container} ${Ke.emptyState}`,
1621
+ ref: l,
1622
+ children: i
1623
+ }
1624
+ ) : null : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
1625
+ /* @__PURE__ */ a.jsx(
1626
+ "div",
1627
+ {
1628
+ ref: d,
1629
+ "aria-live": "polite",
1630
+ "aria-atomic": "true",
1631
+ style: {
1632
+ position: "absolute",
1633
+ left: "-10000px",
1634
+ width: "1px",
1635
+ height: "1px",
1636
+ overflow: "hidden"
1637
+ }
1638
+ }
1639
+ ),
1640
+ /* @__PURE__ */ a.jsx(
1641
+ "div",
1642
+ {
1643
+ "data-slot": "messages",
1644
+ className: Ke.container,
1645
+ ref: l,
1646
+ children: /* @__PURE__ */ a.jsxs(Qe, { mode: "popLayout", children: [
1647
+ t.map((m) => /* @__PURE__ */ a.jsx(
1648
+ ur,
1649
+ {
1650
+ message: m,
1651
+ messageRenderer: c
1652
+ },
1653
+ m.id
1654
+ )),
1655
+ n && /* @__PURE__ */ a.jsx(mr, {}),
1656
+ r && /* @__PURE__ */ a.jsx(
1657
+ "div",
1658
+ {
1659
+ className: "error-message",
1660
+ style: {
1661
+ color: "var(--color-destructive)",
1662
+ padding: "1rem",
1663
+ textAlign: "center"
1664
+ },
1665
+ children: r
1666
+ }
1667
+ )
1668
+ ] })
1669
+ }
1670
+ )
1671
+ ] });
1672
+ }
1673
+ const yr = "Notice-module_container", _r = "Notice-module_containerWithIcon", Cr = "Notice-module_content", xr = "Notice-module_actions", br = "Notice-module_icon", wr = "Notice-module_dismissible", ge = {
1674
+ container: yr,
1675
+ containerWithIcon: _r,
1676
+ content: Cr,
1677
+ actions: xr,
1678
+ icon: br,
1679
+ dismissible: wr
1680
+ };
1681
+ function Er({
1682
+ icon: t,
1683
+ message: n,
1684
+ action: r,
1685
+ dismissible: i = !0,
1686
+ onDismiss: o
1687
+ }) {
1688
+ return /* @__PURE__ */ a.jsxs(
1689
+ "div",
1690
+ {
1691
+ "data-slot": "notice",
1692
+ className: _e(ge.container, {
1693
+ [ge.containerWithIcon]: !!t
1694
+ }),
1695
+ children: [
1696
+ /* @__PURE__ */ a.jsxs("div", { className: ge.content, children: [
1697
+ t && /* @__PURE__ */ a.jsx("div", { className: ge.icon, children: t }),
1698
+ /* @__PURE__ */ a.jsx("span", { children: n })
1699
+ ] }),
1700
+ /* @__PURE__ */ a.jsxs("div", { className: ge.actions, children: [
1701
+ r && /* @__PURE__ */ a.jsx(ne, { onClick: r.onClick, variant: "link", children: r.label }),
1702
+ i && o && /* @__PURE__ */ a.jsx(
1703
+ ne,
1704
+ {
1705
+ className: ge.dismissible,
1706
+ onClick: o,
1707
+ variant: "ghost",
1708
+ size: "sm",
1709
+ icon: /* @__PURE__ */ a.jsx(Vt, {})
1710
+ }
1711
+ )
1712
+ ] })
1713
+ ]
1714
+ }
1715
+ );
1716
+ }
1717
+ const Rr = "Suggestions-module_container", Lt = {
1718
+ container: Rr
1719
+ }, Tr = ({
1720
+ className: t,
1721
+ suggestions: n,
1722
+ onSubmit: r
1723
+ }) => {
1724
+ const i = (o) => {
1725
+ r && r(o.prompt);
1726
+ };
1727
+ return !n || n.length === 0 ? null : /* @__PURE__ */ a.jsx(Qe, { children: n && n.length > 0 && /* @__PURE__ */ a.jsx(
1728
+ te.div,
1729
+ {
1730
+ className: _e(Lt.container, t),
1731
+ initial: { opacity: 0, y: "-80%" },
1732
+ animate: { opacity: 1, y: "-100%" },
1733
+ exit: { opacity: 0, y: "-80%" },
1734
+ transition: ze,
1735
+ children: n.map(
1736
+ (o, c) => /* @__PURE__ */ a.jsx(
1737
+ te.div,
1738
+ {
1739
+ initial: { opacity: 0, y: 10 },
1740
+ animate: { opacity: 1, y: 0 },
1741
+ transition: {
1742
+ ...ze,
1743
+ delay: c * 0.05
1744
+ },
1745
+ children: /* @__PURE__ */ a.jsx(
1746
+ ne,
1747
+ {
1748
+ onClick: () => i(o),
1749
+ variant: "outline",
1750
+ className: Lt.button,
1751
+ children: o.label
1752
+ }
1753
+ )
1754
+ },
1755
+ o.id
1756
+ )
1757
+ )
1758
+ }
1759
+ ) });
1760
+ }, jr = "ConversationView-module_container", Lr = "ConversationView-module_withHeader", Sr = "ConversationView-module_inputContainer", Ar = "ConversationView-module_inputContainerInner", ke = {
1761
+ container: jr,
1762
+ withHeader: Lr,
1763
+ inputContainer: Sr,
1764
+ inputContainerInner: Ar
1765
+ };
1766
+ function St({
1767
+ messages: t,
1768
+ error: n,
1769
+ inputValue: r,
1770
+ onInputChange: i,
1771
+ onSubmit: o,
1772
+ onKeyDown: c,
1773
+ textareaRef: l,
1774
+ placeholder: p,
1775
+ isProcessing: u,
1776
+ fromCompact: d = !1,
1777
+ showHeader: m = !1,
1778
+ onClose: E,
1779
+ onExpand: b,
1780
+ notice: R,
1781
+ emptyView: F,
1782
+ suggestions: $,
1783
+ clearSuggestions: Y,
1784
+ messageRenderer: U
1785
+ }) {
1786
+ return /* @__PURE__ */ a.jsxs(
1787
+ "div",
1788
+ {
1789
+ "data-slot": "conversation-view",
1790
+ className: `${ke.container}${m ? ` ${ke.withHeader}` : ""}`,
1791
+ children: [
1792
+ m && /* @__PURE__ */ a.jsx(rr, { onClose: E }),
1793
+ /* @__PURE__ */ a.jsx(
1794
+ gr,
1795
+ {
1796
+ messages: t,
1797
+ isProcessing: u,
1798
+ error: n,
1799
+ emptyView: F,
1800
+ fromCompact: d,
1801
+ messageRenderer: U
1802
+ }
1803
+ ),
1804
+ /* @__PURE__ */ a.jsxs(
1805
+ "div",
1806
+ {
1807
+ "data-slot": "input-container",
1808
+ className: ke.inputContainer,
1809
+ children: [
1810
+ /* @__PURE__ */ a.jsx(
1811
+ Tr,
1812
+ {
1813
+ suggestions: $,
1814
+ onSubmit: (L) => {
1815
+ i(L), Y == null || Y();
1816
+ }
1817
+ }
1818
+ ),
1819
+ /* @__PURE__ */ a.jsxs("div", { className: ke.inputContainerInner, children: [
1820
+ R && /* @__PURE__ */ a.jsx(
1821
+ Er,
1822
+ {
1823
+ icon: R.icon,
1824
+ message: R.message,
1825
+ action: R.action,
1826
+ dismissible: R.dismissible,
1827
+ onDismiss: R.onDismiss
1828
+ }
1829
+ ),
1830
+ /* @__PURE__ */ a.jsx(
1831
+ Nt,
1832
+ {
1833
+ value: r,
1834
+ onChange: i,
1835
+ onSubmit: o,
1836
+ onKeyDown: c,
1837
+ textareaRef: l,
1838
+ placeholder: p,
1839
+ isProcessing: u,
1840
+ fromCompact: d,
1841
+ onExpand: b,
1842
+ showExpandButton: !1
1843
+ }
1844
+ )
1845
+ ] })
1846
+ ]
1847
+ }
1848
+ )
1849
+ ]
1850
+ }
1851
+ );
1852
+ }
1853
+ const Or = "Chat-module_container", Ir = "Chat-module_embedded", Dr = "Chat-module_floating", Pr = "Chat-module_content", Te = {
1854
+ container: Or,
1855
+ embedded: Ir,
1856
+ floating: Dr,
1857
+ content: Pr
1858
+ }, P = {
1859
+ COLLAPSED_SIZE: 56,
1860
+ COMPACT_WIDTH: 372,
1861
+ EXPANDED_HEIGHT: 520,
1862
+ AUTO_COLLAPSE_DELAY: 1500,
1863
+ BORDER_RADIUS: 24,
1864
+ PADDING: 16,
1865
+ VIEWPORT_OFFSET: 16
1866
+ }, je = {
1867
+ SPRING_CONFIG: {
1868
+ type: "spring",
1869
+ damping: 25,
1870
+ stiffness: 300
1871
+ },
1872
+ VELOCITY_MULTIPLIER: 0.1,
1873
+ NON_DRAGGABLE_SELECTORS: [
1874
+ '[data-slot="message"]',
1875
+ '[data-slot="chat-input"]',
1876
+ '[data-slot="input-container"]'
1877
+ ].join(", ")
1878
+ };
1879
+ function Fr({
1880
+ messages: t,
1881
+ isProcessing: n,
1882
+ error: r,
1883
+ onSubmit: i,
1884
+ variant: o = "floating",
1885
+ triggerIcon: c,
1886
+ placeholder: l = Ft,
1887
+ notice: p,
1888
+ onOpen: u,
1889
+ onExpand: d,
1890
+ onClose: m,
1891
+ emptyView: E,
1892
+ floatingChatState: b,
1893
+ suggestions: R,
1894
+ clearSuggestions: F,
1895
+ messageRenderer: $
1896
+ }) {
1897
+ const [Y, U] = He(""), L = J(!1), y = xn(b), v = J(/* @__PURE__ */ new Set()), h = bn({
1898
+ value: Y,
1899
+ setValue: U,
1900
+ onSubmit: async (C) => {
1901
+ y.state !== "expanded" && (d == null || d()), y.setState("expanded"), await i(C);
1902
+ },
1903
+ isProcessing: n
1904
+ }), [_, A] = He(56), [S, B] = He(
1905
+ "left"
1906
+ ), z = J(null), ce = J(null), K = J(null), H = pt(0), V = pt(0), q = pn(), Se = W(() => {
1907
+ L.current = !0, y.open(), u == null || u();
1908
+ const C = setTimeout(() => {
1909
+ L.current = !1;
1910
+ }, 50);
1911
+ v.current.add(C);
1912
+ }, [y, u]), Q = W(() => {
1913
+ var M, Z, ee;
1914
+ const C = (Z = (M = K.current) == null ? void 0 : M.ownerDocument) == null ? void 0 : Z.activeElement;
1915
+ return !(C && ((ee = K.current) != null && ee.contains(C)) || Y.trim());
1916
+ }, [Y, h.textareaRef, K]), Ae = (C) => C === "collapsed" ? P.COLLAPSED_SIZE : C === "compact" ? _ : P.EXPANDED_HEIGHT, Oe = W(() => {
1917
+ if (y.state === "collapsed") {
1918
+ y.setState("compact");
1919
+ const C = setTimeout(() => {
1920
+ y.state === "compact" && Q() && y.setState("collapsed"), v.current.delete(C);
1921
+ }, P.AUTO_COLLAPSE_DELAY);
1922
+ v.current.add(C);
1923
+ }
1924
+ }, [y, Q]), Ce = W(() => {
1925
+ if (y.state === "compact" && Q()) {
1926
+ const C = setTimeout(() => {
1927
+ y.state === "compact" && Q() && y.setState("collapsed"), v.current.delete(C);
1928
+ }, P.AUTO_COLLAPSE_DELAY);
1929
+ v.current.add(C);
1930
+ }
1931
+ }, [y, Q]), le = W(async () => {
1932
+ if (h.value.trim()) {
1933
+ const C = h.value.trim();
1934
+ h.clear(), y.state !== "expanded" && (d == null || d()), y.setState("expanded"), await i(C);
1935
+ }
1936
+ }, [h, i, y, d]), ue = W(() => {
1937
+ d == null || d(), y.setState("expanded");
1938
+ }, [d, y]), Ie = W(() => {
1939
+ h.clear(), y.close(), m && m();
1940
+ }, [h, y, m]), fe = W(
1941
+ (C) => {
1942
+ if (!K.current || !ce.current)
1943
+ return null;
1944
+ const M = K.current.getBoundingClientRect(), Z = ce.current.getBoundingClientRect(), ee = window.getComputedStyle(K.current), he = new DOMMatrixReadOnly(ee.transform), ie = M.x - he.e, X = M.y - he.f, De = (C ?? S) === "left" ? Z.left : Z.right - P.COMPACT_WIDTH, pe = Z.bottom - P.EXPANDED_HEIGHT;
1945
+ return {
1946
+ x: De - ie,
1947
+ y: pe - X
1948
+ };
1949
+ },
1950
+ [S]
1951
+ ), Ve = W(
1952
+ (C) => {
1953
+ C.target.closest(
1954
+ je.NON_DRAGGABLE_SELECTORS
1955
+ ) || q.start(C.nativeEvent);
1956
+ },
1957
+ [q]
1958
+ ), xe = W(
1959
+ (C, M) => {
1960
+ const Z = M.point.x, ee = P.COMPACT_WIDTH, he = (window.innerWidth - ee) / 2, X = Z < he ? "left" : "right";
1961
+ B(X);
1962
+ const ae = fe(X);
1963
+ ae && (vt(H, ae.x, {
1964
+ ...je.SPRING_CONFIG,
1965
+ velocity: M.velocity.x * je.VELOCITY_MULTIPLIER
1966
+ }), vt(V, ae.y, {
1967
+ ...je.SPRING_CONFIG,
1968
+ velocity: M.velocity.y * je.VELOCITY_MULTIPLIER
1969
+ }));
1970
+ },
1971
+ [H, V, fe]
1972
+ ), re = J(y.state), de = re.current === "expanded" && y.state === "collapsed", be = re.current === "compact" && y.state === "expanded";
1973
+ return se(() => {
1974
+ re.current = y.state;
1975
+ }, [y.state]), se(() => {
1976
+ if (y.state !== "expanded")
1977
+ return;
1978
+ const C = () => {
1979
+ const M = fe();
1980
+ M && (H.set(M.x), V.set(M.y));
1981
+ };
1982
+ return window.addEventListener("resize", C), () => window.removeEventListener("resize", C);
1983
+ }, [y.state, H, V, fe]), se(() => {
1984
+ const C = v.current;
1985
+ return () => {
1986
+ C.forEach((M) => {
1987
+ clearTimeout(M);
1988
+ }), C.clear();
1989
+ };
1990
+ }, []), se(() => {
1991
+ if (y.state === "compact" && z.current) {
1992
+ const C = z.current.scrollHeight + P.PADDING;
1993
+ A(C);
1994
+ }
1995
+ }, [y.state, h.value]), o === "embedded" ? /* @__PURE__ */ a.jsx(
1996
+ "div",
1997
+ {
1998
+ "data-slot": "chat-embedded",
1999
+ className: _e(Te.container, Te.embedded),
2000
+ children: /* @__PURE__ */ a.jsx(
2001
+ St,
2002
+ {
2003
+ messages: t,
2004
+ inputValue: h.value,
2005
+ onInputChange: h.setValue,
2006
+ onSubmit: le,
2007
+ onKeyDown: h.handleKeyDown,
2008
+ textareaRef: h.textareaRef,
2009
+ placeholder: l,
2010
+ isProcessing: n,
2011
+ showHeader: !1,
2012
+ notice: p,
2013
+ suggestions: R,
2014
+ clearSuggestions: F,
2015
+ error: r,
2016
+ emptyView: E,
2017
+ messageRenderer: $,
2018
+ onExpand: ue
2019
+ }
2020
+ )
2021
+ }
2022
+ ) : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2023
+ /* @__PURE__ */ a.jsx(
2024
+ "div",
2025
+ {
2026
+ ref: ce,
2027
+ style: {
2028
+ position: "fixed",
2029
+ top: P.VIEWPORT_OFFSET,
2030
+ left: P.VIEWPORT_OFFSET,
2031
+ right: P.VIEWPORT_OFFSET,
2032
+ bottom: P.VIEWPORT_OFFSET,
2033
+ pointerEvents: "none"
2034
+ }
2035
+ }
2036
+ ),
2037
+ /* @__PURE__ */ a.jsx(
2038
+ te.div,
2039
+ {
2040
+ ref: K,
2041
+ "data-slot": "chat-floating",
2042
+ className: _e(Te.container, Te.floating),
2043
+ onMouseLeave: y.state === "compact" ? Ce : void 0,
2044
+ drag: y.state === "expanded",
2045
+ dragControls: q,
2046
+ dragListener: !1,
2047
+ dragConstraints: ce,
2048
+ dragMomentum: !1,
2049
+ dragElastic: 0.1,
2050
+ dragTransition: { power: 0.1, timeConstant: 100 },
2051
+ onDragEnd: xe,
2052
+ onPointerDown: Ve,
2053
+ style: {
2054
+ x: H,
2055
+ y: V,
2056
+ bottom: P.VIEWPORT_OFFSET,
2057
+ left: P.VIEWPORT_OFFSET
2058
+ },
2059
+ children: /* @__PURE__ */ a.jsx(
2060
+ te.div,
2061
+ {
2062
+ layout: !0,
2063
+ className: Te.content,
2064
+ initial: !1,
2065
+ animate: {
2066
+ width: y.state === "collapsed" ? P.COLLAPSED_SIZE : P.COMPACT_WIDTH,
2067
+ height: Ae(y.state),
2068
+ x: y.state === "collapsed" && S === "right" ? P.COMPACT_WIDTH - P.COLLAPSED_SIZE : 0,
2069
+ transition: h.value.trim() ? { duration: 0 } : $t
2070
+ },
2071
+ style: {
2072
+ borderRadius: P.BORDER_RADIUS
2073
+ },
2074
+ children: /* @__PURE__ */ a.jsxs(Qe, { mode: "wait", children: [
2075
+ y.state === "collapsed" && /* @__PURE__ */ a.jsx(
2076
+ Un,
2077
+ {
2078
+ icon: c,
2079
+ onClick: Se,
2080
+ onHover: Oe,
2081
+ fromExpanded: de
2082
+ },
2083
+ "collapsed"
2084
+ ),
2085
+ y.state === "compact" && /* @__PURE__ */ a.jsx("div", { ref: z, children: /* @__PURE__ */ a.jsx(
2086
+ er,
2087
+ {
2088
+ value: h.value,
2089
+ onChange: h.setValue,
2090
+ onSubmit: le,
2091
+ onKeyDown: h.handleKeyDown,
2092
+ textareaRef: h.textareaRef,
2093
+ placeholder: l,
2094
+ isProcessing: n,
2095
+ onBlur: Ce,
2096
+ onExpand: ue,
2097
+ showExpandButton: !h.value.trim(),
2098
+ focusOnMount: L.current
2099
+ },
2100
+ "compact"
2101
+ ) }),
2102
+ y.state === "expanded" && /* @__PURE__ */ a.jsx(
2103
+ St,
2104
+ {
2105
+ messages: t,
2106
+ inputValue: h.value,
2107
+ onInputChange: h.setValue,
2108
+ onSubmit: le,
2109
+ onKeyDown: h.handleKeyDown,
2110
+ textareaRef: h.textareaRef,
2111
+ placeholder: l,
2112
+ isProcessing: n,
2113
+ showHeader: !0,
2114
+ onClose: Ie,
2115
+ fromCompact: be,
2116
+ notice: p,
2117
+ suggestions: R,
2118
+ clearSuggestions: F,
2119
+ error: r,
2120
+ emptyView: E,
2121
+ messageRenderer: $,
2122
+ onExpand: ue
2123
+ },
2124
+ "expanded"
2125
+ )
2126
+ ] })
2127
+ }
2128
+ )
2129
+ }
2130
+ )
2131
+ ] });
2132
+ }
2133
+ const si = ({
2134
+ messages: t,
2135
+ isProcessing: n,
2136
+ error: r,
2137
+ onSubmit: i,
2138
+ variant: o = "floating",
2139
+ triggerIcon: c,
2140
+ placeholder: l,
2141
+ notice: p,
2142
+ emptyView: u,
2143
+ onOpen: d,
2144
+ onExpand: m,
2145
+ onClose: E,
2146
+ floatingChatState: b,
2147
+ suggestions: R,
2148
+ clearSuggestions: F,
2149
+ messageRenderer: $,
2150
+ className: Y
2151
+ }) => /* @__PURE__ */ a.jsx(
2152
+ Fr,
2153
+ {
2154
+ messages: t,
2155
+ isProcessing: n,
2156
+ error: r,
2157
+ onSubmit: i,
2158
+ variant: o,
2159
+ triggerIcon: c,
2160
+ placeholder: l,
2161
+ notice: p,
2162
+ emptyView: u,
2163
+ onOpen: d,
2164
+ onExpand: m,
2165
+ onClose: E,
2166
+ floatingChatState: b,
2167
+ suggestions: R,
2168
+ clearSuggestions: F,
2169
+ messageRenderer: $
2170
+ }
2171
+ );
2172
+ function ci({ className: t, size: n = 24 }) {
2173
+ return /* @__PURE__ */ a.jsx(
2174
+ "svg",
2175
+ {
2176
+ width: n,
2177
+ height: n,
2178
+ viewBox: "0 0 24 24",
2179
+ fill: "none",
2180
+ xmlns: "http://www.w3.org/2000/svg",
2181
+ className: t,
2182
+ "aria-hidden": "true",
2183
+ children: /* @__PURE__ */ a.jsx(
2184
+ "path",
2185
+ {
2186
+ d: "M6.97288 17.25C6.97288 17.3881 7.08481 17.5 7.22288 17.5L8.5 17.5L8.5 12.875L7.22288 12.875C7.08481 12.875 6.97288 12.9869 6.97288 13.125L6.97288 17.25ZM16.3725 17.5C17.1129 17.5 17.7434 16.9587 17.8549 16.2256L18.4819 13.1006C18.6199 12.1924 17.9175 11.3752 17.0004 11.375L14.0698 11.375C13.8509 11.3749 13.6429 11.2794 13.5004 11.1133C13.358 10.9469 13.2949 10.7261 13.3286 10.5098L13.7602 7.74023C13.8309 7.28511 13.4792 6.875 13.02 6.875L13.0141 6.87891L10 12.5L10 17.5L16.3725 17.5ZM5.47288 13.125C5.47288 12.1585 6.25638 11.375 7.22288 11.375L9.01216 11.375L11.6811 6.19238C11.9394 5.69079 12.4558 5.3751 13.02 5.375C14.4008 5.375 15.4552 6.6078 15.2426 7.97168L14.9458 9.875L17.0004 9.875C18.8366 9.87517 20.2413 11.511 19.9653 13.3262L19.3374 16.4512C19.1145 17.9166 17.8548 19 16.3725 19L7.22288 19C6.25638 19 5.47288 18.2165 5.47288 17.25L5.47288 13.125Z",
2187
+ fill: "currentColor"
2188
+ }
2189
+ )
2190
+ }
2191
+ );
2192
+ }
2193
+ function li({
2194
+ className: t,
2195
+ size: n = 24
2196
+ }) {
2197
+ return /* @__PURE__ */ a.jsx(
2198
+ "svg",
2199
+ {
2200
+ width: n,
2201
+ height: n,
2202
+ viewBox: "0 0 24 24",
2203
+ fill: "none",
2204
+ xmlns: "http://www.w3.org/2000/svg",
2205
+ className: t,
2206
+ "aria-hidden": "true",
2207
+ children: /* @__PURE__ */ a.jsx(
2208
+ "path",
2209
+ {
2210
+ d: "M6.97288 6.75C6.97288 6.61194 7.08481 6.5 7.22288 6.5L8.5 6.5L8.5 11.125L7.22288 11.125C7.08481 11.125 6.97288 11.0131 6.97288 10.875L6.97288 6.75ZM16.3725 6.5C17.1129 6.5 17.7434 7.0413 17.8549 7.77438L18.4819 10.8994C18.6199 11.8076 17.9175 12.6248 17.0004 12.625L14.0698 12.625C13.8509 12.6251 13.6429 12.7206 13.5004 12.8867C13.358 13.0531 13.2949 13.2739 13.3286 13.4902L13.7602 16.2598C13.8309 16.7149 13.4792 17.125 13.02 17.125L13.0141 17.1211L10 11.5L10 6.5L16.3725 6.5ZM5.47288 10.875C5.47288 11.8415 6.25638 12.625 7.22288 12.625L9.01216 12.625L11.6811 17.8076C11.9394 18.3092 12.4558 18.6249 13.02 18.625C14.4008 18.625 15.4552 17.3922 15.2426 16.0283L14.9458 14.125L17.0004 14.125C18.8366 14.1248 20.2413 12.489 19.9653 10.6738L19.3374 7.54883C19.1145 6.08344 17.8548 5 16.3725 5L7.22288 5C6.25638 5 5.47288 5.78348 5.47288 6.75L5.47288 10.875Z",
2211
+ fill: "currentColor"
2212
+ }
2213
+ )
2214
+ }
2215
+ );
2216
+ }
2217
+ function ui({ className: t, size: n = 24 }) {
2218
+ return /* @__PURE__ */ a.jsx(
2219
+ "svg",
2220
+ {
2221
+ width: n,
2222
+ height: n,
2223
+ viewBox: "0 0 24 24",
2224
+ fill: "none",
2225
+ xmlns: "http://www.w3.org/2000/svg",
2226
+ className: t,
2227
+ "aria-hidden": "true",
2228
+ children: /* @__PURE__ */ a.jsx(
2229
+ "path",
2230
+ {
2231
+ d: "M14.5 12C14.5 11.1716 13.8284 10.5 13 10.5H8C7.17157 10.5 6.5 11.1716 6.5 12V17C6.5 17.8284 7.17157 18.5 8 18.5H13C13.8284 18.5 14.5 17.8284 14.5 17V12ZM16 14.5H16.5C17.3284 14.5 18 13.8284 18 13V8C18 7.17157 17.3284 6.5 16.5 6.5H11C10.1716 6.5 9.5 7.17157 9.5 8V9H13C14.6569 9 16 10.3431 16 12V14.5ZM19.5 13C19.5 14.6569 18.1569 16 16.5 16H16V17C16 18.6569 14.6569 20 13 20H8C6.34315 20 5 18.6569 5 17V12C5 10.3431 6.34315 9 8 9V8C8 6.34315 9.34315 5 11 5H16.5C18.1569 5 19.5 6.34315 19.5 8V13Z",
2232
+ fill: "currentColor"
2233
+ }
2234
+ )
2235
+ }
2236
+ );
2237
+ }
2238
+ function fi({ className: t, size: n = 24 }) {
2239
+ return /* @__PURE__ */ a.jsx(
2240
+ "svg",
2241
+ {
2242
+ width: n,
2243
+ height: n,
2244
+ viewBox: "0 0 14 14",
2245
+ fill: "none",
2246
+ xmlns: "http://www.w3.org/2000/svg",
2247
+ className: t,
2248
+ children: /* @__PURE__ */ a.jsx(
2249
+ "path",
2250
+ {
2251
+ fillRule: "evenodd",
2252
+ clipRule: "evenodd",
2253
+ d: "M14 7C14 8.85652 13.2625 10.637 11.9497 11.9497C10.637 13.2625 8.85652 14 7 14C5.14348 14 3.36301 13.2625 2.05025 11.9497C0.737498 10.637 0 8.85652 0 7C0 5.14348 0.737498 3.36301 2.05025 2.05025C3.36301 0.737498 5.14348 0 7 0C8.85652 0 10.637 0.737498 11.9497 2.05025C13.2625 3.36301 14 5.14348 14 7ZM12.6875 7C12.6875 8.50842 12.0883 9.95506 11.0217 11.0217C9.95506 12.0883 8.50842 12.6875 7 12.6875V1.3125C8.50842 1.3125 9.95506 1.91172 11.0217 2.97833C12.0883 4.04494 12.6875 5.49158 12.6875 7Z",
2254
+ fill: "currentColor"
2255
+ }
2256
+ )
2257
+ }
2258
+ );
2259
+ }
2260
+ export {
2261
+ si as AgentUI,
2262
+ Gn as ArrowUpIcon,
2263
+ kt as BigSkyIcon,
2264
+ Fr as Chat,
2265
+ Nt as ChatInput,
2266
+ ui as CopyIcon,
2267
+ ur as Message,
2268
+ gr as Messages,
2269
+ Kn as StopIcon,
2270
+ fi as StylesIcon,
2271
+ Tr as Suggestions,
2272
+ li as ThumbsDownIcon,
2273
+ ci as ThumbsUpIcon,
2274
+ Vt as XIcon
2275
+ };