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