@versini/sassysaint 5.3.8 → 5.3.10

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,137 +1,156 @@
1
- import { jsxs as v, Fragment as H, jsx as n } from "react/jsx-runtime";
2
- import { AppContext as j, TagsContext as Y, LOCAL_STORAGE_PREFIX as M, b as _e, j as G, R as B, TAG_CONTENT as O, TAGS as C, isLastMessageFromRole as de, CANCEL as Ne, CLEAR as we, ACTION_RESET as le, ACTION_TOGGLE_TAG as ce, ROLE_ASSISTANT as I, ROLE_INTERNAL as q, ROLE_USER as K, rn as Z, ROLE_SYSTEM as Ee, ROLE_HIDDEN as Ce, DEFAULT_AI_ENGINE as z, STATS_SEPARATOR as te, ACTION_MODEL as ge, ACTION_MESSAGE as L, ACTION_RESET_TAGS as ue, TYPE_QUESTION as Ie, SEND as Re, ACTION_STREAMING as me, ERROR_MESSAGE as Se, getMessageContaintWrapperClass as Ae, MessagesContainerHeader as Be, ACTION_SEARCH as Me, ACTION_SORT as Oe, ACTION_RESTORE as Le, ACTION_ENGINE as he, HistoryContext as $e, d as Ue, AppFooter as Ve, LOCAL_STORAGE_SEARCH as ze, LOCAL_STORAGE_SORT as De } from "./index.BsmLg4en.js";
3
- import { E as $, restCall as He, we as je, serviceCall as Pe, SERVICE_TYPES as Ge, f as Fe } from "./index.C8-dCwmB.js";
4
- import S, { useContext as U, useRef as R, useEffect as E, useState as P, lazy as We, Suspense as re, useReducer as F } from "react";
5
- import d from "clsx";
6
- function Ke(e) {
1
+ import { jsx as i, jsxs as v, Fragment as O } from "react/jsx-runtime";
2
+ import { g as _e, AppContext as $, TagsContext as j, rn as U, ACTION_SET_TAGS as oe, b as Ne, j as we, R as ne, isLastMessageFromRole as ie, O as Ee, TOOLBOX as Y, ACTION_RESET as se, ACTION_TOGGLE_TAG as de, ROLE_ASSISTANT as I, ROLE_INTERNAL as G, ROLE_USER as H, ROLE_SYSTEM as Ie, ROLE_HIDDEN as Ce, DEFAULT_AI_ENGINE as M, STATS_SEPARATOR as q, ACTION_MODEL as le, ACTION_MESSAGE as S, ACTION_RESET_TAGS as ce, TYPE_QUESTION as Se, SEND as Re, ACTION_STREAMING as ge, ERROR_MESSAGE as Be, getMessageContaintWrapperClass as Ae, MessagesContainerHeader as Me, ACTION_SEARCH as Le, ACTION_SORT as Oe, ACTION_RESTORE as $e, ACTION_ENGINE as ue, HistoryContext as Ue, d as ze, AppFooter as Ve, LOCAL_STORAGE_PREFIX as X, LOCAL_STORAGE_SEARCH as De, LOCAL_STORAGE_SORT as He } from "./index.BduqxN2L.js";
3
+ import { serviceCall as me, SERVICE_TYPES as he, n as je, restCall as Ge, we as Pe, E as J, f as We } from "./index.B5_RXEo-.js";
4
+ import C, { useContext as R, useState as A, useRef as B, useEffect as _, lazy as Fe, Suspense as Q, useReducer as V } from "react";
5
+ import l from "clsx";
6
+ const Ke = ({
7
+ className: e,
8
+ viewBox: t,
9
+ spacing: r,
10
+ title: a,
11
+ monotone: n,
12
+ ...o
13
+ }) => /* @__PURE__ */ i(
14
+ _e,
15
+ {
16
+ defaultViewBox: "0 0 384 512",
17
+ defaultClassName: "size-5",
18
+ viewBox: t,
19
+ className: e,
20
+ spacing: r,
21
+ title: a || "Close",
22
+ ...o,
23
+ children: /* @__PURE__ */ i("path", { d: "M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256l105.3-105.4z" })
24
+ }
25
+ );
26
+ function Ye(e) {
7
27
  const t = e.toLowerCase().split("+").map((o) => o.trim()), r = {
8
28
  alt: t.includes("alt"),
9
29
  ctrl: t.includes("ctrl"),
10
30
  meta: t.includes("meta"),
11
31
  mod: t.includes("mod"),
12
32
  shift: t.includes("shift")
13
- }, a = ["alt", "ctrl", "meta", "shift", "mod"], i = t.find((o) => !a.includes(o));
33
+ }, a = ["alt", "ctrl", "meta", "shift", "mod"], n = t.find((o) => !a.includes(o));
14
34
  return {
15
35
  ...r,
16
- key: i
36
+ key: n
17
37
  };
18
38
  }
19
- function Ye(e, t) {
20
- const { alt: r, ctrl: a, meta: i, mod: o, shift: l, key: s } = e, { altKey: b, ctrlKey: u, metaKey: m, shiftKey: c, key: g } = t;
21
- if (r !== b)
39
+ function qe(e, t) {
40
+ const { alt: r, ctrl: a, meta: n, mod: o, shift: c, key: d } = e, { altKey: m, ctrlKey: g, metaKey: p, shiftKey: u, key: b } = t;
41
+ if (r !== m)
22
42
  return !1;
23
43
  if (o) {
24
- if (!u && !m)
44
+ if (!g && !p)
25
45
  return !1;
26
- } else if (a !== u || i !== m)
46
+ } else if (a !== g || n !== p)
27
47
  return !1;
28
- return l !== c ? !1 : !!(s && (g.toLowerCase() === s.toLowerCase() || t.code.replace("Key", "").toLowerCase() === s.toLowerCase()));
48
+ return c !== u ? !1 : !!(d && (b.toLowerCase() === d.toLowerCase() || t.code.replace("Key", "").toLowerCase() === d.toLowerCase()));
29
49
  }
30
- function qe(e) {
31
- return (t) => Ye(Ke(e), t);
50
+ function Xe(e) {
51
+ return (t) => qe(Ye(e), t);
32
52
  }
33
- function Ze(e) {
53
+ function Je(e) {
34
54
  return (t) => {
35
55
  const r = "nativeEvent" in t ? t.nativeEvent : t;
36
- e.forEach(([a, i, o = { preventDefault: !0 }]) => {
37
- qe(a)(r) && (o.preventDefault && t.preventDefault(), i(r));
56
+ e.forEach(([a, n, o = { preventDefault: !0 }]) => {
57
+ Xe(a)(r) && (o.preventDefault && t.preventDefault(), n(r));
38
58
  });
39
59
  };
40
60
  }
41
- var f = [];
42
- for (var W = 0; W < 256; ++W)
43
- f.push((W + 256).toString(16).slice(1));
44
- function Je(e, t = 0) {
61
+ const f = [];
62
+ for (let e = 0; e < 256; ++e)
63
+ f.push((e + 256).toString(16).slice(1));
64
+ function Qe(e, t = 0) {
45
65
  return (f[e[t + 0]] + f[e[t + 1]] + f[e[t + 2]] + f[e[t + 3]] + "-" + f[e[t + 4]] + f[e[t + 5]] + "-" + f[e[t + 6]] + f[e[t + 7]] + "-" + f[e[t + 8]] + f[e[t + 9]] + "-" + f[e[t + 10]] + f[e[t + 11]] + f[e[t + 12]] + f[e[t + 13]] + f[e[t + 14]] + f[e[t + 15]]).toLowerCase();
46
66
  }
47
- var V, Qe = new Uint8Array(16);
48
- function Xe() {
49
- if (!V && (V = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !V))
50
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
51
- return V(Qe);
67
+ let D;
68
+ const Ze = new Uint8Array(16);
69
+ function et() {
70
+ if (!D) {
71
+ if (typeof crypto > "u" || !crypto.getRandomValues)
72
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
73
+ D = crypto.getRandomValues.bind(crypto);
74
+ }
75
+ return D(Ze);
52
76
  }
53
- var et = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
54
- const ae = {
55
- randomUUID: et
56
- };
57
- function J(e, t, r) {
58
- if (ae.randomUUID && !t && !e)
59
- return ae.randomUUID();
77
+ const tt = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Z = { randomUUID: tt };
78
+ function P(e, t, r) {
79
+ if (Z.randomUUID && !t && !e)
80
+ return Z.randomUUID();
60
81
  e = e || {};
61
- var a = e.random || (e.rng || Xe)();
62
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Je(a);
82
+ const a = e.random || (e.rng || et)();
83
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Qe(a);
63
84
  }
64
- const tt = () => {
65
- const { dispatch: e, state: t } = U(j), { dispatch: r } = U(Y), a = "mt-2 flex justify-center rounded-md", i = R(null), o = R(!1), [l] = $({
66
- key: M + "summarize-article",
67
- initialValue: !1
68
- }), [s] = $({
69
- key: M + "proofread-content",
70
- initialValue: !1
71
- }), [b] = $({
72
- key: M + "rephrase-content",
73
- initialValue: !1
74
- }), u = (c) => {
75
- c.preventDefault(), e({
76
- type: le
85
+ const rt = () => {
86
+ const { dispatch: e, state: t } = R($), { dispatch: r, state: a } = R(j), { getAccessToken: n, user: o } = U(), [c, d] = A({
87
+ loaded: !1
88
+ }), m = "mt-2 flex justify-center rounded-md", g = B(null), p = B(!1), u = (s) => {
89
+ s.preventDefault(), e({
90
+ type: se
77
91
  });
78
92
  };
79
- E(() => {
80
- (t == null ? void 0 : t.streaming) === !0 && !o.current && i.current && (o.current = !0, i.current.focus()), (t == null ? void 0 : t.streaming) === !1 && (o.current = !1);
93
+ _(() => {
94
+ var s;
95
+ (t == null ? void 0 : t.streaming) === !0 && !p.current && g.current && (p.current = !0, g.current.focus()), (t == null ? void 0 : t.streaming) === !1 && (p.current = !1, (s = g.current) == null || s.blur());
81
96
  }, [t]);
82
- const m = (c, g) => {
83
- c.preventDefault(), r({
84
- type: ce,
97
+ const b = (s, h) => {
98
+ s.preventDefault(), r({
99
+ type: de,
85
100
  payload: {
86
- tag: g
101
+ tag: h
87
102
  }
88
103
  });
89
104
  };
90
- return /* @__PURE__ */ v(H, { children: [
91
- /* @__PURE__ */ v(_e, { alignHorizontal: "center", columnGap: 2, children: [
92
- /* @__PURE__ */ n(G, { children: l && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
93
- B,
94
- {
95
- noBorder: !0,
96
- mode: "dark",
97
- focusMode: "light",
98
- size: "small",
99
- onClick: (c) => m(c, C.SUMMARIZE_ARTICLE),
100
- children: O[C.SUMMARIZE_ARTICLE].label
101
- }
102
- ) }) }),
103
- /* @__PURE__ */ n(G, { children: s && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
104
- B,
105
- {
106
- noBorder: !0,
107
- mode: "dark",
108
- focusMode: "light",
109
- size: "small",
110
- onClick: (c) => m(c, C.PROOFREAD_CONTENT),
111
- children: O[C.PROOFREAD_CONTENT].label
112
- }
113
- ) }) }),
114
- /* @__PURE__ */ n(G, { children: b && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
115
- B,
116
- {
117
- noBorder: !0,
118
- mode: "dark",
119
- focusMode: "light",
120
- size: "small",
121
- onClick: (c) => m(c, C.REPHRASE_CONTENT),
122
- children: O[C.REPHRASE_CONTENT].label
123
- }
124
- ) }) })
125
- ] }),
126
- de(I, t) && /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(
127
- B,
105
+ return _(() => {
106
+ if (!o) {
107
+ d({
108
+ loaded: !1
109
+ });
110
+ return;
111
+ }
112
+ c.loaded || (async () => {
113
+ try {
114
+ const s = await me({
115
+ accessToken: await n(),
116
+ type: he.GET_USER_PREFERENCES,
117
+ params: {
118
+ user: o.username
119
+ }
120
+ });
121
+ s.status === 200 && (r({
122
+ type: oe,
123
+ payload: {
124
+ tags: s.data.tags || []
125
+ }
126
+ }), d({
127
+ loaded: !0
128
+ }));
129
+ } catch {
130
+ }
131
+ })();
132
+ }, [o]), /* @__PURE__ */ v(O, { children: [
133
+ /* @__PURE__ */ i(Ne, { alignHorizontal: "center", columnGap: 2, children: c && c.loaded && a.tags && a.tags.map((s) => s.enabled && s.label && s.content && /* @__PURE__ */ i(we, { children: /* @__PURE__ */ i("div", { className: m, children: /* @__PURE__ */ i(
134
+ ne,
135
+ {
136
+ noBorder: !0,
137
+ mode: "dark",
138
+ focusMode: "light",
139
+ size: "small",
140
+ onClick: (h) => b(h, s.content),
141
+ children: s.label
142
+ }
143
+ ) }) }, `tag-button-${s.slot}`)) }),
144
+ ie(I, t) && /* @__PURE__ */ i("div", { className: m, children: /* @__PURE__ */ i(
145
+ Ee,
128
146
  {
129
147
  noBorder: !0,
130
148
  mode: "dark",
131
149
  focusMode: "light",
132
- ref: i,
150
+ ref: g,
133
151
  onClick: u,
134
- children: t != null && t.streaming ? Ne : we
152
+ labelRight: t != null && t.streaming ? Y.ACTION_WHILE_STREAMING.content : Y.ACTION_WHILE_NOT_STREAMING.content,
153
+ children: t != null && t.streaming ? /* @__PURE__ */ i(Ke, { className: "size-4" }) : /* @__PURE__ */ i(je, { className: "size-4" })
135
154
  }
136
155
  ) })
137
156
  ] });
@@ -149,7 +168,7 @@ try {
149
168
  });
150
169
  } catch {
151
170
  }
152
- const rt = "av-bubble", oe = "av-button", at = (e) => {
171
+ const at = "av-bubble", ee = "av-button", ot = (e) => {
153
172
  let t = "";
154
173
  if (typeof e == "number" || typeof e == "string")
155
174
  t = "m-" + e;
@@ -158,32 +177,32 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
158
177
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
159
178
  }
160
179
  return t;
161
- }, Q = "icon", ot = "button", it = "link", nt = ({
180
+ }, W = "icon", nt = "button", it = "link", st = ({
162
181
  type: e,
163
182
  size: t,
164
183
  labelRight: r,
165
184
  labelLeft: a,
166
- align: i
185
+ align: n
167
186
  }) => {
168
- const o = "text-sm font-medium max-h-8 py-0", l = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
187
+ const o = "text-sm font-medium max-h-8 py-0", c = "text-base font-medium max-h-9 py-1", d = "text-lg font-medium max-h-12 py-2";
169
188
  switch (e) {
170
- case ot:
171
- return d("px-4", {
189
+ case nt:
190
+ return l("px-4", {
172
191
  [o]: t === "small",
173
- [l]: t === "medium",
174
- [s]: t === "large"
192
+ [c]: t === "medium",
193
+ [d]: t === "large"
175
194
  });
176
195
  case it:
177
- return d("px-4 text-center", {
196
+ return l("px-4 text-center", {
178
197
  [o]: t === "small",
179
- [l]: t === "medium",
180
- [s]: t === "large"
198
+ [c]: t === "medium",
199
+ [d]: t === "large"
181
200
  });
182
- case Q:
183
- return d("inline-flex items-center", {
184
- "justify-center": i === "center",
185
- "justify-start": i === "left",
186
- "justify-end": i === "right",
201
+ case W:
202
+ return l("inline-flex items-center", {
203
+ "justify-center": n === "center",
204
+ "justify-start": n === "left",
205
+ "justify-end": n === "right",
187
206
  "h-6 w-6 p-0": t === "small" && !(r || a),
188
207
  "h-6 px-4 text-sm font-medium": t === "small" && (r || a),
189
208
  "h-8 w-8 p-1": t === "medium" && !(r || a),
@@ -192,7 +211,7 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
192
211
  "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
193
212
  });
194
213
  }
195
- }, st = ({
214
+ }, dt = ({
196
215
  mode: e,
197
216
  noBackground: t,
198
217
  noTruncate: r,
@@ -201,7 +220,7 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
201
220
  if (t)
202
221
  return "not-prose rounded-full";
203
222
  if (a === "primary")
204
- return d("not-prose rounded-full", {
223
+ return l("not-prose rounded-full", {
205
224
  truncate: !r,
206
225
  "bg-action-dark text-copy-light": e === "dark",
207
226
  "bg-action-light text-copy-lighter": e === "light",
@@ -209,7 +228,7 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
209
228
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
210
229
  });
211
230
  if (a === "secondary")
212
- return d("not-prose rounded-full", {
231
+ return l("not-prose rounded-full", {
213
232
  truncate: !r,
214
233
  "bg-action-dark text-copy-light": e === "light",
215
234
  "bg-action-light text-copy-lighter": e === "dark",
@@ -217,14 +236,14 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
217
236
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
218
237
  });
219
238
  if (a === "danger")
220
- return d("not-prose rounded-full", {
239
+ return l("not-prose rounded-full", {
221
240
  truncate: !r,
222
241
  "bg-action-danger-dark text-copy-light": e === "dark",
223
242
  "bg-action-danger-light text-copy-lighter": e === "light",
224
243
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
225
244
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
226
245
  });
227
- }, dt = ({
246
+ }, lt = ({
228
247
  mode: e,
229
248
  disabled: t,
230
249
  variant: r
@@ -232,27 +251,27 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
232
251
  if (t)
233
252
  return "";
234
253
  if (r === "primary")
235
- return d("hover:text-copy-light-hover", {
254
+ return l("hover:text-copy-light-hover", {
236
255
  "hover:bg-action-dark-hover": e === "dark",
237
256
  "hover:bg-action-light-hover": e === "light",
238
257
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
239
258
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
240
259
  });
241
260
  if (r === "secondary")
242
- return d("hover:text-copy-light-hover", {
261
+ return l("hover:text-copy-light-hover", {
243
262
  "hover:bg-action-dark-hover": e === "light",
244
263
  "hover:bg-action-light-hover": e === "dark",
245
264
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
246
265
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
247
266
  });
248
267
  if (r === "danger")
249
- return d("hover:text-copy-light-hover", {
268
+ return l("hover:text-copy-light-hover", {
250
269
  "hover:bg-action-danger-dark-hover": e === "dark",
251
270
  "hover:bg-action-danger-light-hover": e === "light",
252
271
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
253
272
  "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
254
273
  });
255
- }, lt = ({
274
+ }, ct = ({
256
275
  mode: e,
257
276
  disabled: t,
258
277
  variant: r
@@ -260,27 +279,27 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
260
279
  if (t)
261
280
  return "";
262
281
  if (r === "primary")
263
- return d("active:text-copy-light-active", {
282
+ return l("active:text-copy-light-active", {
264
283
  "active:bg-action-dark-active": e === "dark",
265
284
  "active:bg-action-light-active": e === "light",
266
285
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
267
286
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
268
287
  });
269
288
  if (r === "secondary")
270
- return d("active:text-copy-light-active", {
289
+ return l("active:text-copy-light-active", {
271
290
  "active:bg-action-dark-active": e === "light",
272
291
  "active:bg-action-light-active": e === "dark",
273
292
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
274
293
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
275
294
  });
276
295
  if (r === "danger")
277
- return d("active:text-copy-lighter-active", {
296
+ return l("active:text-copy-lighter-active", {
278
297
  "active:bg-action-danger-dark-active": e === "dark",
279
298
  "active:bg-action-danger-light-active": e === "light",
280
299
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
281
300
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
282
301
  });
283
- }, ct = ({
302
+ }, gt = ({
284
303
  mode: e,
285
304
  noBorder: t,
286
305
  variant: r
@@ -288,27 +307,27 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
288
307
  if (t)
289
308
  return "border border-transparent";
290
309
  if (r === "primary")
291
- return d("border", {
310
+ return l("border", {
292
311
  "border-border-dark": e === "dark",
293
312
  "border-border-accent": e === "light",
294
313
  "border-border-dark dark:border-border-accent": e === "system",
295
314
  "border-border-accent dark:border-border-dark": e === "alt-system"
296
315
  });
297
316
  if (r === "secondary")
298
- return d("border", {
317
+ return l("border", {
299
318
  "border-border-dark": e === "light",
300
319
  "border-border-accent": e === "dark",
301
320
  "border-border-dark dark:border-border-accent": e === "alt-system",
302
321
  "border-border-accent dark:border-border-dark": e === "system"
303
322
  });
304
323
  if (r === "danger")
305
- return d("border", {
324
+ return l("border", {
306
325
  "border-border-danger-dark": e === "dark",
307
326
  "border-border-danger-medium": e === "light",
308
327
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
309
328
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
310
329
  });
311
- }, gt = ({ focusMode: e }) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
330
+ }, ut = ({ focusMode: e }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
312
331
  "focus:outline-focus-dark": e === "dark",
313
332
  "focus:outline-focus-light": e === "light",
314
333
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
@@ -318,104 +337,104 @@ const rt = "av-bubble", oe = "av-button", at = (e) => {
318
337
  className: t,
319
338
  raw: r,
320
339
  mode: a,
321
- focusMode: i,
340
+ focusMode: n,
322
341
  disabled: o,
323
- fullWidth: l,
324
- size: s,
325
- noBorder: b,
326
- labelRight: u,
327
- labelLeft: m,
328
- spacing: c,
329
- noBackground: g,
330
- variant: h,
331
- noTruncate: p,
342
+ fullWidth: c,
343
+ size: d,
344
+ noBorder: m,
345
+ labelRight: g,
346
+ labelLeft: p,
347
+ spacing: u,
348
+ noBackground: b,
349
+ variant: s,
350
+ noTruncate: h,
332
351
  align: y
333
- }) => (h || (h = "primary"), r ? d(oe, t) : d(
334
- oe,
352
+ }) => (s || (s = "primary"), r ? l(ee, t) : l(
353
+ ee,
335
354
  t,
336
- at(c),
337
- st({ mode: a, variant: h, noBackground: g, noTruncate: p }),
338
- nt({ type: e, size: s, labelRight: u, labelLeft: m, align: y }),
339
- ct({ mode: a, variant: h, noBorder: b }),
340
- gt({ focusMode: i }),
341
- dt({ mode: a, variant: h, disabled: o }),
342
- lt({ mode: a, variant: h, disabled: o }),
355
+ ot(u),
356
+ dt({ mode: a, variant: s, noBackground: b, noTruncate: h }),
357
+ st({ type: e, size: d, labelRight: g, labelLeft: p, align: y }),
358
+ gt({ mode: a, variant: s, noBorder: m }),
359
+ ut({ focusMode: n }),
360
+ lt({ mode: a, variant: s, disabled: o }),
361
+ ct({ mode: a, variant: s, disabled: o }),
343
362
  {
344
- "w-full": l,
363
+ "w-full": c,
345
364
  "disabled:cursor-not-allowed disabled:opacity-50": o
346
365
  }
347
- )), ut = (e, t, r) => {
366
+ )), mt = (e, t, r) => {
348
367
  var a;
349
368
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
350
- }, X = S.forwardRef((e, t) => {
351
- const { onClick: r, noInternalClick: a = !1, ...i } = e;
352
- return /* @__PURE__ */ n(
369
+ }, F = C.forwardRef((e, t) => {
370
+ const { onClick: r, noInternalClick: a = !1, ...n } = e;
371
+ return /* @__PURE__ */ i(
353
372
  "button",
354
373
  {
355
374
  ref: t,
356
375
  onClick: (o) => {
357
- ut(o, a, r);
376
+ mt(o, a, r);
358
377
  },
359
- ...i
378
+ ...n
360
379
  }
361
380
  );
362
381
  });
363
- X.displayName = "BaseButton";
364
- const be = S.forwardRef(
382
+ F.displayName = "BaseButton";
383
+ const be = C.forwardRef(
365
384
  ({
366
385
  children: e,
367
386
  disabled: t = !1,
368
387
  mode: r = "system",
369
388
  focusMode: a = "system",
370
- fullWidth: i = !1,
389
+ fullWidth: n = !1,
371
390
  className: o,
372
- type: l = "button",
373
- raw: s = !1,
374
- noBorder: b = !1,
375
- "aria-label": u,
376
- label: m,
377
- size: c = "medium",
378
- labelRight: g,
379
- labelLeft: h,
380
- spacing: p,
391
+ type: c = "button",
392
+ raw: d = !1,
393
+ noBorder: m = !1,
394
+ "aria-label": g,
395
+ label: p,
396
+ size: u = "medium",
397
+ labelRight: b,
398
+ labelLeft: s,
399
+ spacing: h,
381
400
  noBackground: y = !1,
382
- align: _ = "center",
383
- ...N
384
- }, w) => {
385
- const k = pe({
386
- type: Q,
401
+ align: N = "center",
402
+ ...w
403
+ }, k) => {
404
+ const x = pe({
405
+ type: W,
387
406
  mode: r,
388
407
  focusMode: a,
389
- fullWidth: i,
408
+ fullWidth: n,
390
409
  disabled: t,
391
- raw: s,
410
+ raw: d,
392
411
  className: o,
393
- noBorder: b,
394
- size: c,
395
- labelRight: g,
396
- labelLeft: h,
397
- spacing: p,
412
+ noBorder: m,
413
+ size: u,
414
+ labelRight: b,
415
+ labelLeft: s,
416
+ spacing: h,
398
417
  noBackground: y,
399
- align: _
400
- }), x = d({
401
- "text-copy-accent-dark": r === "light" && !s,
402
- "text-copy-light": r === "dark" && !s,
403
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
404
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !s
418
+ align: N
419
+ }), E = l({
420
+ "text-copy-accent-dark": r === "light" && !d,
421
+ "text-copy-light": r === "dark" && !d,
422
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !d,
423
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !d
405
424
  });
406
425
  return /* @__PURE__ */ v(
407
- X,
426
+ F,
408
427
  {
409
- ref: w,
410
- className: k,
428
+ ref: k,
429
+ className: x,
411
430
  disabled: t,
412
- type: l,
413
- "aria-label": u || m,
414
- ...N,
431
+ type: c,
432
+ "aria-label": g || p,
433
+ ...w,
415
434
  children: [
416
- h && /* @__PURE__ */ n("span", { className: "pr-2", children: h }),
417
- /* @__PURE__ */ n("div", { className: x, children: e }),
418
- g && /* @__PURE__ */ n("span", { className: "pl-2", children: g })
435
+ s && /* @__PURE__ */ i("span", { className: "pr-2", children: s }),
436
+ /* @__PURE__ */ i("div", { className: E, children: e }),
437
+ b && /* @__PURE__ */ i("span", { className: "pl-2", children: b })
419
438
  ]
420
439
  }
421
440
  );
@@ -435,49 +454,49 @@ try {
435
454
  });
436
455
  } catch {
437
456
  }
438
- const mt = S.forwardRef(
457
+ const ht = C.forwardRef(
439
458
  ({
440
459
  children: e,
441
460
  disabled: t = !1,
442
461
  mode: r = "system",
443
462
  focusMode: a = "system",
444
- fullWidth: i = !1,
463
+ fullWidth: n = !1,
445
464
  className: o,
446
- type: l = "button",
447
- raw: s = !1,
448
- noBorder: b = !1,
449
- "aria-label": u,
450
- label: m,
451
- size: c = "medium",
452
- labelRight: g,
453
- labelLeft: h,
454
- spacing: p,
465
+ type: c = "button",
466
+ raw: d = !1,
467
+ noBorder: m = !1,
468
+ "aria-label": g,
469
+ label: p,
470
+ size: u = "medium",
471
+ labelRight: b,
472
+ labelLeft: s,
473
+ spacing: h,
455
474
  noBackground: y = !1,
456
- align: _ = "center",
457
- active: N = !1,
458
- ...w
459
- }, k) => {
460
- const x = pe({
461
- type: Q,
475
+ align: N = "center",
476
+ active: w = !1,
477
+ ...k
478
+ }, x) => {
479
+ const E = pe({
480
+ type: W,
462
481
  mode: r,
463
482
  focusMode: a,
464
- fullWidth: i,
483
+ fullWidth: n,
465
484
  disabled: t,
466
- raw: s,
485
+ raw: d,
467
486
  className: o,
468
- noBorder: b,
469
- size: c,
470
- labelRight: g,
471
- labelLeft: h,
472
- spacing: p,
487
+ noBorder: m,
488
+ size: u,
489
+ labelRight: b,
490
+ labelLeft: s,
491
+ spacing: h,
473
492
  noBackground: y,
474
- align: _
475
- }), A = d({
476
- "text-copy-accent-dark": r === "light" && !s,
477
- "text-copy-light": r === "dark" && !s,
478
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
479
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !s
480
- }), T = N ? d(
493
+ align: N
494
+ }), T = l({
495
+ "text-copy-accent-dark": r === "light" && !d,
496
+ "text-copy-light": r === "dark" && !d,
497
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !d,
498
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !d
499
+ }), z = w ? l(
481
500
  "relative",
482
501
  "focus-within:static",
483
502
  "focus-within:after:border-transparent",
@@ -494,26 +513,26 @@ const mt = S.forwardRef(
494
513
  "after:border-table-light dark:after:border-table-dark": r === "alt-system"
495
514
  }
496
515
  ) : "";
497
- return /* @__PURE__ */ n("div", { className: T, children: /* @__PURE__ */ v(
498
- X,
516
+ return /* @__PURE__ */ i("div", { className: z, children: /* @__PURE__ */ v(
517
+ F,
499
518
  {
500
- ref: k,
501
- className: x,
519
+ ref: x,
520
+ className: E,
502
521
  disabled: t,
503
- type: l,
504
- "aria-label": u || m,
505
- ...w,
522
+ type: c,
523
+ "aria-label": g || p,
524
+ ...k,
506
525
  children: [
507
- h && /* @__PURE__ */ n("span", { className: "pr-2", children: h }),
508
- /* @__PURE__ */ n("div", { className: A, children: e }),
509
- g && /* @__PURE__ */ n("span", { className: "pl-2", children: g })
526
+ s && /* @__PURE__ */ i("span", { className: "pr-2", children: s }),
527
+ /* @__PURE__ */ i("div", { className: T, children: e }),
528
+ b && /* @__PURE__ */ i("span", { className: "pl-2", children: b })
510
529
  ]
511
530
  }
512
531
  ) });
513
532
  }
514
533
  );
515
- mt.displayName = "ButtonSort";
516
- const ht = (e) => {
534
+ ht.displayName = "ButtonSort";
535
+ const pt = (e) => {
517
536
  let t = "";
518
537
  if (typeof e == "number" || typeof e == "string")
519
538
  t = "m-" + e;
@@ -527,33 +546,33 @@ const ht = (e) => {
527
546
  fill: t,
528
547
  viewBox: r,
529
548
  className: a,
530
- defaultViewBox: i,
549
+ defaultViewBox: n,
531
550
  defaultClassName: o,
532
- spacing: l,
533
- title: s,
534
- semantic: b = !1,
535
- ...u
551
+ spacing: c,
552
+ title: d,
553
+ semantic: m = !1,
554
+ ...g
536
555
  }) => {
537
- const m = ht(l), c = d(
538
- m,
556
+ const p = pt(c), u = l(
557
+ p,
539
558
  a || o
540
559
  );
541
- return /* @__PURE__ */ v(H, { children: [
542
- /* @__PURE__ */ n(
560
+ return /* @__PURE__ */ v(O, { children: [
561
+ /* @__PURE__ */ i(
543
562
  "svg",
544
563
  {
545
564
  xmlns: "http://www.w3.org/2000/svg",
546
- className: c,
547
- viewBox: r || i,
565
+ className: u,
566
+ viewBox: r || n,
548
567
  fill: t || "currentColor",
549
568
  role: "img",
550
- "aria-hidden": !b,
569
+ "aria-hidden": !m,
551
570
  focusable: !1,
552
- ...u,
571
+ ...g,
553
572
  children: e
554
573
  }
555
574
  ),
556
- s && b && /* @__PURE__ */ n("span", { className: "sr-only", children: s })
575
+ d && m && /* @__PURE__ */ i("span", { className: "sr-only", children: d })
557
576
  ] });
558
577
  };
559
578
  /*!
@@ -569,12 +588,12 @@ try {
569
588
  });
570
589
  } catch {
571
590
  }
572
- const pt = ({
591
+ const bt = ({
573
592
  className: e,
574
593
  viewBox: t,
575
594
  spacing: r,
576
595
  title: a,
577
- monotone: i,
596
+ monotone: n,
578
597
  ...o
579
598
  }) => /* @__PURE__ */ v(
580
599
  fe,
@@ -587,24 +606,24 @@ const pt = ({
587
606
  title: a || "Copied",
588
607
  ...o,
589
608
  children: [
590
- /* @__PURE__ */ n(
609
+ /* @__PURE__ */ i(
591
610
  "path",
592
611
  {
593
612
  opacity: "0.4",
594
613
  d: "M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"
595
614
  }
596
615
  ),
597
- /* @__PURE__ */ n("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
616
+ /* @__PURE__ */ i("path", { d: "M337 175c9.4 9.4 9.4 24.6 0 33.9L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0z" })
598
617
  ]
599
618
  }
600
- ), bt = ({
619
+ ), ft = ({
601
620
  className: e,
602
621
  viewBox: t,
603
622
  spacing: r,
604
623
  title: a,
605
- monotone: i,
624
+ monotone: n,
606
625
  ...o
607
- }) => /* @__PURE__ */ n(
626
+ }) => /* @__PURE__ */ i(
608
627
  fe,
609
628
  {
610
629
  defaultViewBox: "0 0 512 512",
@@ -614,7 +633,7 @@ const pt = ({
614
633
  spacing: r,
615
634
  title: a || "Copy",
616
635
  ...o,
617
- children: /* @__PURE__ */ n("path", { d: "M64 464H288c8.8 0 16-7.2 16-16V384h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM224 304H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16V288c0 8.8 7.2 16 16 16zm-64-16V64c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V288c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64z" })
636
+ children: /* @__PURE__ */ i("path", { d: "M64 464H288c8.8 0 16-7.2 16-16V384h48v64c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h64v48H64c-8.8 0-16 7.2-16 16V448c0 8.8 7.2 16 16 16zM224 304H448c8.8 0 16-7.2 16-16V64c0-8.8-7.2-16-16-16H224c-8.8 0-16 7.2-16 16V288c0 8.8 7.2 16 16 16zm-64-16V64c0-35.3 28.7-64 64-64H448c35.3 0 64 28.7 64 64V288c0 35.3-28.7 64-64 64H224c-35.3 0-64-28.7-64-64z" })
618
637
  }
619
638
  );
620
639
  /*!
@@ -630,7 +649,7 @@ try {
630
649
  });
631
650
  } catch {
632
651
  }
633
- const ft = (e) => {
652
+ const yt = (e) => {
634
653
  let t = "";
635
654
  if (typeof e == "number" || typeof e == "string")
636
655
  t = "m-" + e;
@@ -639,93 +658,93 @@ const ft = (e) => {
639
658
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
640
659
  }
641
660
  return t;
642
- }, yt = () => "p-4 sm:max-w-md md:max-w-2xl", vt = ({ kind: e }) => d({
661
+ }, vt = () => "p-4 sm:max-w-md md:max-w-2xl", kt = ({ kind: e }) => l({
643
662
  "bg-surface-lighter dark:bg-surface-dark": e === "left",
644
663
  "bg-surface-accent": e === "right"
645
- }), kt = ({ kind: e }) => d(
664
+ }), xt = ({ kind: e }) => l(
646
665
  "prose prose-dark dark:prose-lighter prose-p:my-3 prose-blockquote:my-3 prose-ol:my-3 prose-ul:my-3 prose-ul:prose-li:marker:text-black",
647
666
  {
648
667
  "text-copy-lighter": e === "right"
649
668
  }
650
- ), xt = ({ kind: e }) => d("rounded-b-xl", {
669
+ ), Tt = ({ kind: e }) => l("rounded-b-xl", {
651
670
  "rounded-tr-xl": e === "left",
652
671
  "rounded-tl-xl": e === "right"
653
- }), Tt = ({
672
+ }), _t = ({
654
673
  kind: e,
655
674
  className: t,
656
675
  spacing: r
657
676
  }) => {
658
- const a = d(
677
+ const a = l(
659
678
  t,
660
- rt,
679
+ at,
661
680
  "flex items-start",
662
- ft(r),
681
+ yt(r),
663
682
  {
664
683
  "flex-row-reverse": e === "right"
665
684
  }
666
- ), i = d(
685
+ ), n = l(
667
686
  "flex flex-col empty:hidden",
668
- yt(),
687
+ vt(),
688
+ xt({ kind: e }),
669
689
  kt({ kind: e }),
670
- vt({ kind: e }),
671
- xt({ kind: e })
672
- ), o = "pr-2 pt-1 text-end text-xs text-copy-light", l = d("flex flex-col-reverse gap-2 sm:flex-row", {
690
+ Tt({ kind: e })
691
+ ), o = "pr-2 pt-1 text-end text-xs text-copy-light", c = l("flex flex-col-reverse gap-2 sm:flex-row", {
673
692
  "ml-2": e === "left",
674
693
  "mr-2": e === "right"
675
694
  });
676
695
  return {
677
696
  wrapper: a,
678
- main: i,
697
+ main: n,
679
698
  footer: o,
680
- copyButton: l
699
+ copyButton: c
681
700
  };
682
- }, _t = ({
701
+ }, Nt = ({
683
702
  children: e,
684
703
  kind: t = "left",
685
704
  className: r,
686
705
  footer: a,
687
- rawFooter: i,
706
+ rawFooter: n,
688
707
  copyToClipboard: o,
689
- copyToClipboardFocusMode: l = "system",
690
- copyToClipboardMode: s = "system",
691
- spacing: b
708
+ copyToClipboardFocusMode: c = "system",
709
+ copyToClipboardMode: d = "system",
710
+ spacing: m
692
711
  }) => {
693
- const [u, m] = P(!1), c = Tt({ kind: t, className: r, spacing: b }), g = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), h = () => {
694
- m(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
712
+ const [g, p] = A(!1), u = _t({ kind: t, className: r, spacing: m }), b = !!o && (typeof o == "function" || typeof o == "string" || typeof e == "string"), s = () => {
713
+ p(!0), typeof o == "function" ? o(e) : typeof o == "string" ? navigator.clipboard.writeText(o) : typeof e == "string" && navigator.clipboard.writeText(e);
695
714
  };
696
- return E(() => {
697
- let p;
698
- return u && (p = window.setTimeout(() => {
699
- m(!1);
715
+ return _(() => {
716
+ let h;
717
+ return g && (h = window.setTimeout(() => {
718
+ p(!1);
700
719
  }, 3e3)), () => {
701
- clearTimeout(p);
720
+ clearTimeout(h);
702
721
  };
703
- }, [u]), /* @__PURE__ */ v("div", { className: c.wrapper, children: [
722
+ }, [g]), /* @__PURE__ */ v("div", { className: u.wrapper, children: [
704
723
  /* @__PURE__ */ v("div", { children: [
705
- /* @__PURE__ */ n("div", { className: c.main, children: e }),
706
- a && Object.keys(a).map((p) => a[p] ? /* @__PURE__ */ n("div", { className: "prose-p:m-0", children: /* @__PURE__ */ v("p", { className: c.footer, children: [
707
- p,
724
+ /* @__PURE__ */ i("div", { className: u.main, children: e }),
725
+ a && Object.keys(a).map((h) => a[h] ? /* @__PURE__ */ i("div", { className: "prose-p:m-0", children: /* @__PURE__ */ v("p", { className: u.footer, children: [
726
+ h,
708
727
  ": ",
709
- a[p]
710
- ] }) }, `-${p}`) : null),
711
- i && i
728
+ a[h]
729
+ ] }) }, `-${h}`) : null),
730
+ n && n
712
731
  ] }),
713
- g && /* @__PURE__ */ n("div", { className: c.copyButton, children: /* @__PURE__ */ n(
732
+ b && /* @__PURE__ */ i("div", { className: u.copyButton, children: /* @__PURE__ */ i(
714
733
  be,
715
734
  {
716
735
  noBorder: !0,
717
736
  noBackground: !0,
718
737
  size: "small",
719
- mode: s,
720
- focusMode: l,
721
- label: u ? "Copied to clipboard" : "Copy to clipboard",
722
- onClick: h,
723
- disabled: u,
724
- children: u ? /* @__PURE__ */ n(pt, { className: "size-3" }) : /* @__PURE__ */ n(bt, { className: "size-3" })
738
+ mode: d,
739
+ focusMode: c,
740
+ label: g ? "Copied to clipboard" : "Copy to clipboard",
741
+ onClick: s,
742
+ disabled: g,
743
+ children: g ? /* @__PURE__ */ i(bt, { className: "size-3" }) : /* @__PURE__ */ i(ft, { className: "size-3" })
725
744
  }
726
745
  ) })
727
746
  ] });
728
- }, ie = "av-button", Nt = (e) => {
747
+ }, te = "av-button", wt = (e) => {
729
748
  let t = "";
730
749
  if (typeof e == "number" || typeof e == "string")
731
750
  t = "m-" + e;
@@ -734,32 +753,32 @@ const ft = (e) => {
734
753
  (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
735
754
  }
736
755
  return t;
737
- }, ye = "icon", ve = "button", wt = "link", Et = ({
756
+ }, ye = "icon", ve = "button", Et = "link", It = ({
738
757
  type: e,
739
758
  size: t,
740
759
  labelRight: r,
741
760
  labelLeft: a,
742
- align: i
761
+ align: n
743
762
  }) => {
744
- const o = "text-sm font-medium max-h-8 py-0", l = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
763
+ const o = "text-sm font-medium max-h-8 py-0", c = "text-base font-medium max-h-9 py-1", d = "text-lg font-medium max-h-12 py-2";
745
764
  switch (e) {
746
765
  case ve:
747
- return d("px-4", {
766
+ return l("px-4", {
748
767
  [o]: t === "small",
749
- [l]: t === "medium",
750
- [s]: t === "large"
768
+ [c]: t === "medium",
769
+ [d]: t === "large"
751
770
  });
752
- case wt:
753
- return d("px-4 text-center", {
771
+ case Et:
772
+ return l("px-4 text-center", {
754
773
  [o]: t === "small",
755
- [l]: t === "medium",
756
- [s]: t === "large"
774
+ [c]: t === "medium",
775
+ [d]: t === "large"
757
776
  });
758
777
  case ye:
759
- return d("inline-flex items-center", {
760
- "justify-center": i === "center",
761
- "justify-start": i === "left",
762
- "justify-end": i === "right",
778
+ return l("inline-flex items-center", {
779
+ "justify-center": n === "center",
780
+ "justify-start": n === "left",
781
+ "justify-end": n === "right",
763
782
  "h-6 w-6 p-0": t === "small" && !(r || a),
764
783
  "h-6 px-4 text-sm font-medium": t === "small" && (r || a),
765
784
  "h-8 w-8 p-1": t === "medium" && !(r || a),
@@ -777,7 +796,7 @@ const ft = (e) => {
777
796
  if (t)
778
797
  return "not-prose rounded-full";
779
798
  if (a === "primary")
780
- return d("not-prose rounded-full", {
799
+ return l("not-prose rounded-full", {
781
800
  truncate: !r,
782
801
  "bg-action-dark text-copy-light": e === "dark",
783
802
  "bg-action-light text-copy-lighter": e === "light",
@@ -785,7 +804,7 @@ const ft = (e) => {
785
804
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
786
805
  });
787
806
  if (a === "secondary")
788
- return d("not-prose rounded-full", {
807
+ return l("not-prose rounded-full", {
789
808
  truncate: !r,
790
809
  "bg-action-dark text-copy-light": e === "light",
791
810
  "bg-action-light text-copy-lighter": e === "dark",
@@ -793,14 +812,14 @@ const ft = (e) => {
793
812
  "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
794
813
  });
795
814
  if (a === "danger")
796
- return d("not-prose rounded-full", {
815
+ return l("not-prose rounded-full", {
797
816
  truncate: !r,
798
817
  "bg-action-danger-dark text-copy-light": e === "dark",
799
818
  "bg-action-danger-light text-copy-lighter": e === "light",
800
819
  "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
801
820
  "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
802
821
  });
803
- }, It = ({
822
+ }, St = ({
804
823
  mode: e,
805
824
  disabled: t,
806
825
  variant: r
@@ -808,21 +827,21 @@ const ft = (e) => {
808
827
  if (t)
809
828
  return "";
810
829
  if (r === "primary")
811
- return d("hover:text-copy-light-hover", {
830
+ return l("hover:text-copy-light-hover", {
812
831
  "hover:bg-action-dark-hover": e === "dark",
813
832
  "hover:bg-action-light-hover": e === "light",
814
833
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
815
834
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
816
835
  });
817
836
  if (r === "secondary")
818
- return d("hover:text-copy-light-hover", {
837
+ return l("hover:text-copy-light-hover", {
819
838
  "hover:bg-action-dark-hover": e === "light",
820
839
  "hover:bg-action-light-hover": e === "dark",
821
840
  "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
822
841
  "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
823
842
  });
824
843
  if (r === "danger")
825
- return d("hover:text-copy-light-hover", {
844
+ return l("hover:text-copy-light-hover", {
826
845
  "hover:bg-action-danger-dark-hover": e === "dark",
827
846
  "hover:bg-action-danger-light-hover": e === "light",
828
847
  "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
@@ -836,27 +855,27 @@ const ft = (e) => {
836
855
  if (t)
837
856
  return "";
838
857
  if (r === "primary")
839
- return d("active:text-copy-light-active", {
858
+ return l("active:text-copy-light-active", {
840
859
  "active:bg-action-dark-active": e === "dark",
841
860
  "active:bg-action-light-active": e === "light",
842
861
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
843
862
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
844
863
  });
845
864
  if (r === "secondary")
846
- return d("active:text-copy-light-active", {
865
+ return l("active:text-copy-light-active", {
847
866
  "active:bg-action-dark-active": e === "light",
848
867
  "active:bg-action-light-active": e === "dark",
849
868
  "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
850
869
  "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
851
870
  });
852
871
  if (r === "danger")
853
- return d("active:text-copy-lighter-active", {
872
+ return l("active:text-copy-lighter-active", {
854
873
  "active:bg-action-danger-dark-active": e === "dark",
855
874
  "active:bg-action-danger-light-active": e === "light",
856
875
  "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
857
876
  "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
858
877
  });
859
- }, St = ({
878
+ }, Bt = ({
860
879
  mode: e,
861
880
  noBorder: t,
862
881
  variant: r
@@ -864,27 +883,27 @@ const ft = (e) => {
864
883
  if (t)
865
884
  return "border border-transparent";
866
885
  if (r === "primary")
867
- return d("border", {
886
+ return l("border", {
868
887
  "border-border-dark": e === "dark",
869
888
  "border-border-accent": e === "light",
870
889
  "border-border-dark dark:border-border-accent": e === "system",
871
890
  "border-border-accent dark:border-border-dark": e === "alt-system"
872
891
  });
873
892
  if (r === "secondary")
874
- return d("border", {
893
+ return l("border", {
875
894
  "border-border-dark": e === "light",
876
895
  "border-border-accent": e === "dark",
877
896
  "border-border-dark dark:border-border-accent": e === "alt-system",
878
897
  "border-border-accent dark:border-border-dark": e === "system"
879
898
  });
880
899
  if (r === "danger")
881
- return d("border", {
900
+ return l("border", {
882
901
  "border-border-danger-dark": e === "dark",
883
902
  "border-border-danger-medium": e === "light",
884
903
  "border-border-danger-dark dark:border-border-danger-medium": e === "system",
885
904
  "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
886
905
  });
887
- }, At = ({ focusMode: e }) => d("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
906
+ }, At = ({ focusMode: e }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
888
907
  "focus:outline-focus-dark": e === "dark",
889
908
  "focus:outline-focus-light": e === "light",
890
909
  "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
@@ -894,86 +913,86 @@ const ft = (e) => {
894
913
  className: t,
895
914
  raw: r,
896
915
  mode: a,
897
- focusMode: i,
916
+ focusMode: n,
898
917
  disabled: o,
899
- fullWidth: l,
900
- size: s,
901
- noBorder: b,
902
- labelRight: u,
903
- labelLeft: m,
904
- spacing: c,
905
- noBackground: g,
906
- variant: h,
907
- noTruncate: p,
918
+ fullWidth: c,
919
+ size: d,
920
+ noBorder: m,
921
+ labelRight: g,
922
+ labelLeft: p,
923
+ spacing: u,
924
+ noBackground: b,
925
+ variant: s,
926
+ noTruncate: h,
908
927
  align: y
909
- }) => (h || (h = "primary"), r ? d(ie, t) : d(
910
- ie,
928
+ }) => (s || (s = "primary"), r ? l(te, t) : l(
929
+ te,
911
930
  t,
912
- Nt(c),
913
- Ct({ mode: a, variant: h, noBackground: g, noTruncate: p }),
914
- Et({ type: e, size: s, labelRight: u, labelLeft: m, align: y }),
915
- St({ mode: a, variant: h, noBorder: b }),
916
- At({ focusMode: i }),
917
- It({ mode: a, variant: h, disabled: o }),
918
- Rt({ mode: a, variant: h, disabled: o }),
931
+ wt(u),
932
+ Ct({ mode: a, variant: s, noBackground: b, noTruncate: h }),
933
+ It({ type: e, size: d, labelRight: g, labelLeft: p, align: y }),
934
+ Bt({ mode: a, variant: s, noBorder: m }),
935
+ At({ focusMode: n }),
936
+ St({ mode: a, variant: s, disabled: o }),
937
+ Rt({ mode: a, variant: s, disabled: o }),
919
938
  {
920
- "w-full": l,
939
+ "w-full": c,
921
940
  "disabled:cursor-not-allowed disabled:opacity-50": o
922
941
  }
923
- )), Bt = (e, t, r) => {
942
+ )), Mt = (e, t, r) => {
924
943
  var a;
925
944
  !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
926
- }, ee = S.forwardRef((e, t) => {
927
- const { onClick: r, noInternalClick: a = !1, ...i } = e;
928
- return /* @__PURE__ */ n(
945
+ }, K = C.forwardRef((e, t) => {
946
+ const { onClick: r, noInternalClick: a = !1, ...n } = e;
947
+ return /* @__PURE__ */ i(
929
948
  "button",
930
949
  {
931
950
  ref: t,
932
951
  onClick: (o) => {
933
- Bt(o, a, r);
952
+ Mt(o, a, r);
934
953
  },
935
- ...i
954
+ ...n
936
955
  }
937
956
  );
938
957
  });
939
- ee.displayName = "BaseButton";
940
- const xe = S.forwardRef(
958
+ K.displayName = "BaseButton";
959
+ const xe = C.forwardRef(
941
960
  ({
942
961
  children: e,
943
962
  disabled: t = !1,
944
963
  mode: r = "system",
945
964
  focusMode: a = "system",
946
- fullWidth: i = !1,
965
+ fullWidth: n = !1,
947
966
  className: o,
948
- size: l = "medium",
949
- raw: s = !1,
950
- noBorder: b = !1,
951
- spacing: u,
952
- variant: m = "primary",
953
- noTruncate: c = !1,
954
- ...g
955
- }, h) => {
956
- const p = ke({
967
+ size: c = "medium",
968
+ raw: d = !1,
969
+ noBorder: m = !1,
970
+ spacing: g,
971
+ variant: p = "primary",
972
+ noTruncate: u = !1,
973
+ ...b
974
+ }, s) => {
975
+ const h = ke({
957
976
  type: ve,
958
977
  mode: r,
959
978
  focusMode: a,
960
- fullWidth: i,
979
+ fullWidth: n,
961
980
  disabled: t,
962
- raw: s,
981
+ raw: d,
963
982
  className: o,
964
- size: l,
965
- noBorder: b,
966
- spacing: u,
967
- variant: m,
968
- noTruncate: c
983
+ size: c,
984
+ noBorder: m,
985
+ spacing: g,
986
+ variant: p,
987
+ noTruncate: u
969
988
  });
970
- return /* @__PURE__ */ n(
971
- ee,
989
+ return /* @__PURE__ */ i(
990
+ K,
972
991
  {
973
- ref: h,
974
- className: p,
992
+ ref: s,
993
+ className: h,
975
994
  disabled: t,
976
- ...g,
995
+ ...b,
977
996
  children: e
978
997
  }
979
998
  );
@@ -993,49 +1012,49 @@ try {
993
1012
  });
994
1013
  } catch {
995
1014
  }
996
- const Mt = S.forwardRef(
1015
+ const Lt = C.forwardRef(
997
1016
  ({
998
1017
  children: e,
999
1018
  disabled: t = !1,
1000
1019
  mode: r = "system",
1001
1020
  focusMode: a = "system",
1002
- fullWidth: i = !1,
1021
+ fullWidth: n = !1,
1003
1022
  className: o,
1004
- type: l = "button",
1005
- raw: s = !1,
1006
- noBorder: b = !1,
1007
- "aria-label": u,
1008
- label: m,
1009
- size: c = "medium",
1010
- labelRight: g,
1011
- labelLeft: h,
1012
- spacing: p,
1023
+ type: c = "button",
1024
+ raw: d = !1,
1025
+ noBorder: m = !1,
1026
+ "aria-label": g,
1027
+ label: p,
1028
+ size: u = "medium",
1029
+ labelRight: b,
1030
+ labelLeft: s,
1031
+ spacing: h,
1013
1032
  noBackground: y = !1,
1014
- align: _ = "center",
1015
- active: N = !1,
1016
- ...w
1017
- }, k) => {
1018
- const x = ke({
1033
+ align: N = "center",
1034
+ active: w = !1,
1035
+ ...k
1036
+ }, x) => {
1037
+ const E = ke({
1019
1038
  type: ye,
1020
1039
  mode: r,
1021
1040
  focusMode: a,
1022
- fullWidth: i,
1041
+ fullWidth: n,
1023
1042
  disabled: t,
1024
- raw: s,
1043
+ raw: d,
1025
1044
  className: o,
1026
- noBorder: b,
1027
- size: c,
1028
- labelRight: g,
1029
- labelLeft: h,
1030
- spacing: p,
1045
+ noBorder: m,
1046
+ size: u,
1047
+ labelRight: b,
1048
+ labelLeft: s,
1049
+ spacing: h,
1031
1050
  noBackground: y,
1032
- align: _
1033
- }), A = d({
1034
- "text-copy-accent-dark": r === "light" && !s,
1035
- "text-copy-light": r === "dark" && !s,
1036
- "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !s,
1037
- "text-copy-light dark:text-copy-accent-dark": r === "system" && !s
1038
- }), T = N ? d(
1051
+ align: N
1052
+ }), T = l({
1053
+ "text-copy-accent-dark": r === "light" && !d,
1054
+ "text-copy-light": r === "dark" && !d,
1055
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !d,
1056
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !d
1057
+ }), z = w ? l(
1039
1058
  "relative",
1040
1059
  "focus-within:static",
1041
1060
  "focus-within:after:border-transparent",
@@ -1052,26 +1071,26 @@ const Mt = S.forwardRef(
1052
1071
  "after:border-table-light dark:after:border-table-dark": r === "alt-system"
1053
1072
  }
1054
1073
  ) : "";
1055
- return /* @__PURE__ */ n("div", { className: T, children: /* @__PURE__ */ v(
1056
- ee,
1074
+ return /* @__PURE__ */ i("div", { className: z, children: /* @__PURE__ */ v(
1075
+ K,
1057
1076
  {
1058
- ref: k,
1059
- className: x,
1077
+ ref: x,
1078
+ className: E,
1060
1079
  disabled: t,
1061
- type: l,
1062
- "aria-label": u || m,
1063
- ...w,
1080
+ type: c,
1081
+ "aria-label": g || p,
1082
+ ...k,
1064
1083
  children: [
1065
- h && /* @__PURE__ */ n("span", { className: "pr-2", children: h }),
1066
- /* @__PURE__ */ n("div", { className: A, children: e }),
1067
- g && /* @__PURE__ */ n("span", { className: "pl-2", children: g })
1084
+ s && /* @__PURE__ */ i("span", { className: "pr-2", children: s }),
1085
+ /* @__PURE__ */ i("div", { className: T, children: e }),
1086
+ b && /* @__PURE__ */ i("span", { className: "pl-2", children: b })
1068
1087
  ]
1069
1088
  }
1070
1089
  ) });
1071
1090
  }
1072
1091
  );
1073
- Mt.displayName = "ButtonSort";
1074
- const Ot = 200, Lt = ({
1092
+ Lt.displayName = "ButtonSort";
1093
+ const Ot = 200, $t = ({
1075
1094
  string: e,
1076
1095
  idealLength: t = Ot
1077
1096
  }) => {
@@ -1084,32 +1103,32 @@ const Ot = 200, Lt = ({
1084
1103
  string: e.slice(0, t + r),
1085
1104
  isTruncated: !0
1086
1105
  };
1087
- }, $t = ({
1106
+ }, Ut = ({
1088
1107
  children: e,
1089
1108
  length: t = 200,
1090
1109
  mode: r = "system",
1091
1110
  focusMode: a = "system"
1092
1111
  }) => {
1093
- const [i, o] = P(!1);
1112
+ const [n, o] = A(!1);
1094
1113
  if (typeof e != "string")
1095
1114
  return e;
1096
- const { string: l, isTruncated: s } = Lt({
1115
+ const { string: c, isTruncated: d } = $t({
1097
1116
  string: e,
1098
1117
  idealLength: t
1099
1118
  });
1100
1119
  return /* @__PURE__ */ v("span", { children: [
1101
- i ? e : l,
1102
- s && /* @__PURE__ */ n(
1120
+ n ? e : c,
1121
+ d && /* @__PURE__ */ i(
1103
1122
  xe,
1104
1123
  {
1105
1124
  mode: r,
1106
1125
  focusMode: a,
1107
1126
  spacing: { l: 2 },
1108
1127
  size: "small",
1109
- onClick: (b) => {
1110
- b.preventDefault(), o(!i);
1128
+ onClick: (m) => {
1129
+ m.preventDefault(), o(!n);
1111
1130
  },
1112
- children: i ? "less..." : "more..."
1131
+ children: n ? "less..." : "more..."
1113
1132
  }
1114
1133
  )
1115
1134
  ] });
@@ -1127,165 +1146,165 @@ try {
1127
1146
  });
1128
1147
  } catch {
1129
1148
  }
1130
- const ne = We(
1149
+ const re = Fe(
1131
1150
  () => import(
1132
1151
  /* webpackChunkName: "LazyMessageAssistant" */
1133
- "./LazyMessageAssistant.CI97mVOI.js"
1152
+ "./LazyMessageAssistant.WIuSwbN3.js"
1134
1153
  ).then((e) => e.LazyMessageAssistant)
1135
- ), Ut = () => {
1136
- const { state: e } = U(j);
1137
- return /* @__PURE__ */ v(H, { children: [
1154
+ ), zt = () => {
1155
+ const { state: e } = R($);
1156
+ return /* @__PURE__ */ v(O, { children: [
1138
1157
  e && e.messages.length > 0 && e.messages.map((t, r) => {
1139
- const { role: a, content: i, name: o, processingTime: l } = t.message;
1140
- return (a === I || a === q) && i ? /* @__PURE__ */ n(re, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(
1141
- ne,
1158
+ const { role: a, content: n, name: o, processingTime: c } = t.message;
1159
+ return (a === I || a === G) && n ? /* @__PURE__ */ i(Q, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(
1160
+ re,
1142
1161
  {
1143
1162
  name: o,
1144
- processingTime: l,
1145
- children: i
1163
+ processingTime: c,
1164
+ children: n
1146
1165
  }
1147
- ) }, `${r}-${a}`) : a === K && i ? /* @__PURE__ */ n(
1148
- _t,
1166
+ ) }, `${r}-${a}`) : a === H && n ? /* @__PURE__ */ i(
1167
+ Nt,
1149
1168
  {
1150
1169
  kind: "right",
1151
- copyToClipboard: i,
1170
+ copyToClipboard: n,
1152
1171
  copyToClipboardFocusMode: "light",
1153
- children: /* @__PURE__ */ n($t, { mode: "light", focusMode: "light", children: i })
1172
+ children: /* @__PURE__ */ i(Ut, { mode: "light", focusMode: "light", children: n })
1154
1173
  },
1155
1174
  `${r}-${a}`
1156
1175
  ) : null;
1157
1176
  }),
1158
- de(K, e) && /* @__PURE__ */ n(re, { fallback: /* @__PURE__ */ n("span", {}), children: /* @__PURE__ */ n(ne, { loading: !0 }) })
1177
+ ie(H, e) && /* @__PURE__ */ i(Q, { fallback: /* @__PURE__ */ i("span", {}), children: /* @__PURE__ */ i(re, { loading: !0 }) })
1159
1178
  ] });
1160
- }, D = (e, t) => {
1179
+ }, L = (e, t) => {
1161
1180
  e({
1162
- type: me,
1181
+ type: ge,
1163
1182
  payload: {
1164
1183
  streaming: t
1165
1184
  }
1166
1185
  });
1167
- }, se = (e) => {
1168
- D(e, !1), e({
1169
- type: L,
1186
+ }, ae = (e) => {
1187
+ L(e, !1), e({
1188
+ type: S,
1170
1189
  payload: {
1171
1190
  message: {
1172
- role: q,
1173
- content: Se
1191
+ role: G,
1192
+ content: Be
1174
1193
  }
1175
1194
  }
1176
1195
  });
1177
1196
  }, Vt = () => {
1178
- const { state: e, dispatch: t } = U(j), { state: r, dispatch: a } = U(Y), [i, o] = P(""), { getAccessToken: l, user: s } = Z(), b = R(!1), u = R(null), m = R(
1197
+ const { state: e, dispatch: t } = R($), { state: r, dispatch: a } = R(j), [n, o] = A(""), { getAccessToken: c, user: d } = U(), m = B(null), g = B(
1179
1198
  null
1180
1199
  );
1181
- E(() => {
1200
+ _(() => {
1182
1201
  (async () => {
1183
- var h;
1202
+ var b;
1184
1203
  if (!e || e.messages.length === 0) {
1185
- (h = m == null ? void 0 : m.current) == null || h.cancel();
1204
+ (b = g == null ? void 0 : g.current) == null || b.cancel();
1186
1205
  return;
1187
1206
  }
1188
- const g = e.messages[e.messages.length - 1];
1189
- if (!(e.messages.length === 0 || g.message.role === I || g.message.role === Ee || g.message.role === q || g.message.role === Ce))
1207
+ const u = e.messages[e.messages.length - 1];
1208
+ if (!(e.messages.length === 0 || u.message.role === I || u.message.role === Ie || u.message.role === G || u.message.role === Ce))
1190
1209
  try {
1191
- const p = await He({
1192
- accessToken: await l(),
1210
+ const s = await Ge({
1211
+ accessToken: await c(),
1193
1212
  name: "generate",
1194
1213
  data: {
1195
1214
  messages: e.messages,
1196
- model: e.engine || z,
1197
- user: (s == null ? void 0 : s.username) || "",
1215
+ model: e.engine || M,
1216
+ user: (d == null ? void 0 : d.username) || "",
1198
1217
  id: e.id,
1199
1218
  usage: e.usage
1200
1219
  }
1201
1220
  });
1202
- if (p && p.ok) {
1203
- const y = J();
1204
- m.current = p.body.getReader();
1205
- const _ = new TextDecoder();
1221
+ if (s && s.ok) {
1222
+ const h = P();
1223
+ g.current = s.body.getReader();
1224
+ const y = new TextDecoder();
1206
1225
  for (; ; ) {
1207
- D(t, !0);
1208
- const { done: N, value: w } = await m.current.read();
1226
+ L(t, !0);
1227
+ const { done: N, value: w } = await g.current.read();
1209
1228
  if (N) {
1210
- D(t, !1);
1229
+ L(t, !1);
1211
1230
  break;
1212
1231
  }
1213
- const k = _.decode(w, { stream: !0 }), x = k.indexOf(te);
1232
+ const k = y.decode(w, { stream: !0 }), x = k.indexOf(q);
1214
1233
  if (x !== -1) {
1215
- const A = k.substring(0, x), T = JSON.parse(
1216
- k.substring(x + te.length)
1234
+ const E = k.substring(0, x), T = JSON.parse(
1235
+ k.substring(x + q.length)
1217
1236
  );
1218
1237
  t({
1219
- type: ge,
1238
+ type: le,
1220
1239
  payload: {
1221
1240
  model: T.model,
1222
1241
  usage: T.usage
1223
1242
  }
1224
1243
  }), t({
1225
- type: L,
1244
+ type: S,
1226
1245
  payload: {
1227
1246
  message: {
1228
- content: A,
1247
+ content: E,
1229
1248
  role: I,
1230
- messageId: y,
1249
+ messageId: h,
1231
1250
  processingTime: T.processingTime,
1232
1251
  name: T.name
1233
1252
  }
1234
1253
  }
1235
- }), D(t, !1);
1254
+ }), L(t, !1);
1236
1255
  break;
1237
1256
  } else
1238
1257
  t({
1239
- type: L,
1258
+ type: S,
1240
1259
  payload: {
1241
1260
  message: {
1242
1261
  content: k,
1243
1262
  role: I,
1244
- messageId: y
1263
+ messageId: h
1245
1264
  }
1246
1265
  }
1247
1266
  });
1248
1267
  }
1249
1268
  } else
1250
- se(t);
1251
- } catch (p) {
1252
- console.error(p), se(t);
1269
+ ae(t);
1270
+ } catch (s) {
1271
+ console.error(s), ae(t);
1253
1272
  }
1254
1273
  })();
1255
1274
  }, [e == null ? void 0 : e.messages]);
1256
- const c = async (g) => {
1257
- g.preventDefault(), t({
1258
- type: L,
1275
+ const p = async (u) => {
1276
+ u.preventDefault(), t({
1277
+ type: S,
1259
1278
  payload: {
1260
1279
  message: {
1261
- role: K,
1262
- content: i
1280
+ role: H,
1281
+ content: n
1263
1282
  }
1264
1283
  }
1265
1284
  }), o("");
1266
1285
  };
1267
- return E(() => {
1268
- (e == null ? void 0 : e.streaming) === !1 && !b.current && u.current && (b.current = !0, u.current.focus()), (e == null ? void 0 : e.streaming) === !0 && b.current === !0 && (b.current = !1);
1269
- }, [e]), E(() => {
1270
- r.tag !== "" && O[r.tag] && (o(O[r.tag].content), u.current && u.current.focus(), a({
1271
- type: ue
1286
+ return _(() => {
1287
+ r.tag !== "" && (o(r.tag), m.current && m.current.focus(), a({
1288
+ type: ce
1272
1289
  }));
1273
- }, [r, a]), /* @__PURE__ */ n("form", { className: "mt-2", onSubmit: c, children: /* @__PURE__ */ n(
1274
- je,
1290
+ }, [r, a]), _(() => {
1291
+ e && e.usage === 0 && e.messages.length === 0 && m.current && m.current.focus();
1292
+ }, [e]), /* @__PURE__ */ i("form", { className: "mt-2", onSubmit: p, children: /* @__PURE__ */ i(
1293
+ Pe,
1275
1294
  {
1276
1295
  mode: "dark",
1277
1296
  focusMode: "light",
1278
- ref: u,
1297
+ ref: m,
1279
1298
  name: "chat-input",
1280
- label: Ie,
1299
+ label: Se,
1281
1300
  helperText: "Press ENTER to add a new line",
1282
1301
  helperTextOnFocus: !0,
1283
1302
  required: !0,
1284
- value: i,
1285
- onChange: (g) => o(g.target.value),
1286
- onKeyDown: Ze([["mod+Enter", c]]),
1287
- rightElement: /* @__PURE__ */ n(
1288
- B,
1303
+ value: n,
1304
+ onChange: (u) => o(u.target.value),
1305
+ onKeyDown: Je([["mod+Enter", p]]),
1306
+ rightElement: /* @__PURE__ */ i(
1307
+ ne,
1289
1308
  {
1290
1309
  disabled: e == null ? void 0 : e.streaming,
1291
1310
  noBorder: !0,
@@ -1297,21 +1316,26 @@ const ne = We(
1297
1316
  )
1298
1317
  }
1299
1318
  ) });
1300
- }, zt = () => {
1301
- const { isAuthenticated: e } = Z(), t = Ae(e);
1302
- return /* @__PURE__ */ v(H, { children: [
1319
+ }, Dt = () => {
1320
+ const { isAuthenticated: e } = U(), t = Ae(e);
1321
+ return /* @__PURE__ */ v(O, { children: [
1303
1322
  /* @__PURE__ */ v("div", { className: t, children: [
1304
- /* @__PURE__ */ n(Be, {}),
1305
- /* @__PURE__ */ n(Ut, {})
1323
+ /* @__PURE__ */ i(Me, {}),
1324
+ /* @__PURE__ */ i(zt, {})
1306
1325
  ] }),
1307
- /* @__PURE__ */ n(tt, {}),
1308
- /* @__PURE__ */ n(Vt, {})
1326
+ /* @__PURE__ */ i(rt, {}),
1327
+ /* @__PURE__ */ i(Vt, {})
1309
1328
  ] });
1310
- }, Dt = (e, t) => (t == null ? void 0 : t.type) === ce ? {
1329
+ }, Ht = (e, t) => (t == null ? void 0 : t.type) === de ? {
1330
+ tags: e.tags,
1311
1331
  tag: t.payload.tag
1312
- } : (t == null ? void 0 : t.type) === ue ? {
1332
+ } : (t == null ? void 0 : t.type) === ce ? {
1333
+ tags: e.tags,
1334
+ tag: ""
1335
+ } : (t == null ? void 0 : t.type) === oe ? {
1336
+ tags: t.payload.tags,
1313
1337
  tag: ""
1314
- } : e, Ht = (e, t) => (t == null ? void 0 : t.type) === Me ? {
1338
+ } : e, jt = (e, t) => (t == null ? void 0 : t.type) === Le ? {
1315
1339
  searchString: t.payload.searchString,
1316
1340
  sortedCell: e.sortedCell,
1317
1341
  sortDirection: e.sortDirection
@@ -1319,8 +1343,8 @@ const ne = We(
1319
1343
  searchString: e.searchString,
1320
1344
  sortedCell: t.payload.sortedCell,
1321
1345
  sortDirection: t.payload.sortDirection
1322
- } : e, jt = (e, t) => {
1323
- if ((t == null ? void 0 : t.type) === Le) {
1346
+ } : e, Gt = (e, t) => {
1347
+ if ((t == null ? void 0 : t.type) === $e) {
1324
1348
  const r = t.payload.messages.map((a) => ({
1325
1349
  message: {
1326
1350
  role: a.role,
@@ -1335,39 +1359,41 @@ const ne = We(
1335
1359
  usage: t.payload.usage,
1336
1360
  isComponent: e.isComponent,
1337
1361
  messages: r,
1338
- engine: e.engine
1362
+ engine: e.engine,
1363
+ tags: e.tags
1339
1364
  };
1340
1365
  }
1341
- if ((t == null ? void 0 : t.type) === L) {
1342
- const r = t.payload.message.role, a = t.payload.message.content, i = t.payload.message.name, o = t.payload.message.processingTime, l = t.payload.message.messageId;
1366
+ if ((t == null ? void 0 : t.type) === S) {
1367
+ const r = t.payload.message.role, a = t.payload.message.content, n = t.payload.message.name, o = t.payload.message.processingTime, c = t.payload.message.messageId;
1343
1368
  if (r !== "") {
1344
- const s = {
1369
+ const d = {
1345
1370
  role: r,
1346
1371
  content: a,
1347
- name: i,
1372
+ name: n,
1348
1373
  processingTime: o,
1349
- messageId: l
1374
+ messageId: c
1350
1375
  };
1351
1376
  if (r === I) {
1352
- const b = e.messages.findIndex(
1353
- (u) => u.message.messageId === l
1377
+ const m = e.messages.findIndex(
1378
+ (g) => g.message.messageId === c
1354
1379
  );
1355
- if (b !== -1) {
1356
- const u = e.messages.map((m, c) => c === b ? {
1380
+ if (m !== -1) {
1381
+ const g = e.messages.map((p, u) => u === m ? {
1357
1382
  message: {
1358
- ...m.message,
1359
- content: `${m.message.content}${a}`,
1383
+ ...p.message,
1384
+ content: `${p.message.content}${a}`,
1360
1385
  processingTime: o,
1361
- name: i
1386
+ name: n
1362
1387
  }
1363
- } : m);
1388
+ } : p);
1364
1389
  return {
1365
1390
  id: e.id,
1366
1391
  model: e.model,
1367
1392
  usage: e.usage,
1368
1393
  isComponent: e.isComponent,
1369
- messages: u,
1370
- engine: e.engine
1394
+ messages: g,
1395
+ engine: e.engine,
1396
+ tags: e.tags
1371
1397
  };
1372
1398
  }
1373
1399
  }
@@ -1375,106 +1401,110 @@ const ne = We(
1375
1401
  id: e.id,
1376
1402
  model: e.model,
1377
1403
  engine: e.engine,
1404
+ tags: e.tags,
1378
1405
  usage: e.usage,
1379
1406
  isComponent: e.isComponent,
1380
1407
  messages: [
1381
1408
  ...e.messages,
1382
1409
  {
1383
- message: s
1410
+ message: d
1384
1411
  }
1385
1412
  ]
1386
1413
  };
1387
1414
  }
1388
1415
  }
1389
- return (t == null ? void 0 : t.type) === le ? {
1390
- id: J(),
1416
+ return (t == null ? void 0 : t.type) === se ? {
1417
+ id: P(),
1391
1418
  model: e.model,
1392
1419
  engine: e.engine,
1393
1420
  usage: 0,
1394
1421
  messages: [],
1395
- isComponent: e.isComponent
1396
- } : (t == null ? void 0 : t.type) === ge ? {
1422
+ isComponent: e.isComponent,
1423
+ tags: e.tags
1424
+ } : (t == null ? void 0 : t.type) === le ? {
1397
1425
  id: e.id,
1398
1426
  model: t.payload.model,
1399
1427
  engine: e.engine,
1428
+ tags: e.tags,
1400
1429
  usage: t.payload.usage,
1401
1430
  messages: e.messages,
1402
1431
  isComponent: e.isComponent
1403
- } : (t == null ? void 0 : t.type) === he ? {
1432
+ } : (t == null ? void 0 : t.type) === ue ? {
1404
1433
  ...e,
1405
1434
  engine: t.payload.engine
1406
- } : (t == null ? void 0 : t.type) === me ? {
1435
+ } : (t == null ? void 0 : t.type) === ge ? {
1407
1436
  ...e,
1408
1437
  streaming: t.payload.streaming
1409
1438
  } : e;
1410
1439
  };
1411
1440
  function Te({ isComponent: e = !1 }) {
1412
- const t = R(!1), { getAccessToken: r, user: a } = Z(), [i] = $({
1413
- key: M + ze,
1441
+ const t = B(!1), { getAccessToken: r, user: a } = U(), [n] = J({
1442
+ key: X + De,
1414
1443
  initialValue: ""
1415
- }), [o] = $({
1416
- key: M + De,
1417
- initialValue: Fe.ASC
1418
- }), [l, s] = F(jt, {
1419
- id: J(),
1420
- model: z,
1421
- engine: z,
1444
+ }), [o] = J({
1445
+ key: X + He,
1446
+ initialValue: We.ASC
1447
+ }), [c, d] = V(Gt, {
1448
+ id: P(),
1449
+ model: M,
1450
+ engine: M,
1422
1451
  usage: 0,
1423
1452
  messages: [],
1453
+ tags: [],
1424
1454
  isComponent: e
1425
- }), [b, u] = F(Ht, {
1426
- searchString: i,
1455
+ }), [m, g] = V(jt, {
1456
+ searchString: n,
1427
1457
  sortedCell: "timestamp",
1428
1458
  sortDirection: o
1429
- }), [m, c] = F(Dt, {
1459
+ }), [p, u] = V(Ht, {
1430
1460
  tag: ""
1431
- }), [g, h] = P({
1461
+ }), [b, s] = A({
1432
1462
  version: "",
1433
1463
  models: [],
1434
1464
  plugins: [],
1435
- engine: z,
1465
+ engine: M,
1436
1466
  engines: []
1437
1467
  });
1438
- return E(() => {
1439
- g.version !== "" || t.current || (async () => {
1468
+ return _(() => {
1469
+ b.version !== "" || t.current || (async () => {
1440
1470
  try {
1441
1471
  t.current = !0;
1442
- const p = await Pe({
1472
+ const h = await me({
1443
1473
  accessToken: await r(),
1444
- type: Ge.ABOUT,
1474
+ type: he.ABOUT,
1445
1475
  params: {
1446
1476
  user: a == null ? void 0 : a.username
1447
1477
  }
1448
1478
  });
1449
- t.current = !1, p.status === 200 && (h(p.data), s({
1450
- type: he,
1479
+ t.current = !1, h.status === 200 && (s(h.data), d({
1480
+ type: ue,
1451
1481
  payload: {
1452
- engine: p.data.engine
1482
+ engine: h.data.engine
1453
1483
  }
1454
1484
  }));
1455
1485
  } catch {
1456
1486
  }
1457
1487
  })();
1458
- }, [g, r, a]), E(() => {
1459
- var p;
1460
- (p = document.getElementById("logo")) == null || p.classList.add("fadeOut"), setTimeout(() => {
1488
+ }, [b, r, a]), _(() => {
1489
+ var h;
1490
+ (h = document.getElementById("logo")) == null || h.classList.add("fadeOut"), setTimeout(() => {
1461
1491
  var y;
1462
1492
  (y = document.getElementById("root")) == null || y.classList.replace("app-hidden", "fadeIn");
1463
1493
  }, 500);
1464
- }), /* @__PURE__ */ n(j.Provider, { value: { state: l, dispatch: s, serverStats: g }, children: /* @__PURE__ */ n(
1465
- $e.Provider,
1494
+ }), /* @__PURE__ */ i($.Provider, { value: { state: c, dispatch: d, serverStats: b }, children: /* @__PURE__ */ i(
1495
+ Ue.Provider,
1466
1496
  {
1467
1497
  value: {
1468
- state: b,
1469
- dispatch: u
1498
+ state: m,
1499
+ dispatch: g
1470
1500
  },
1471
1501
  children: /* @__PURE__ */ v(
1472
- Y.Provider,
1502
+ j.Provider,
1473
1503
  {
1474
- value: { state: m, dispatch: c },
1504
+ value: { state: p, dispatch: u },
1475
1505
  children: [
1476
- /* @__PURE__ */ n(Ue, { children: /* @__PURE__ */ n(zt, {}) }),
1477
- /* @__PURE__ */ n(Ve, { serverStats: g })
1506
+ /* @__PURE__ */ i(ze, { children: /* @__PURE__ */ i(Dt, {}) }),
1507
+ /* @__PURE__ */ i(Ve, { serverStats: b })
1478
1508
  ]
1479
1509
  }
1480
1510
  )
@@ -1482,8 +1512,8 @@ function Te({ isComponent: e = !1 }) {
1482
1512
  ) });
1483
1513
  }
1484
1514
  Te.displayName = "App";
1485
- const Yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Te }, Symbol.toStringTag, { value: "Module" }));
1515
+ const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: Te }, Symbol.toStringTag, { value: "Module" }));
1486
1516
  export {
1487
- Yt as App,
1488
- _t as le
1517
+ qt as App,
1518
+ Nt as le
1489
1519
  };