@versini/sassysaint 5.0.1 → 5.1.3

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.
@@ -0,0 +1,1466 @@
1
+ import T, { useSyncExternalStore as Ce, useCallback as D, useEffect as R, useContext as O, useRef as f, useState as $, useLayoutEffect as U, useMemo as ie, useId as Ie, useReducer as Se } from "react";
2
+ import { MODEL_GPT4 as Ee } from "./index.BuZgDoDD.js";
3
+ import l from "clsx";
4
+ import { jsx as c, jsxs as w, Fragment as Ae } from "react/jsx-runtime";
5
+ const _ = {
6
+ GET_LOCATION: `query GetLocation($latitude: Float!, $longitude: Float!) {
7
+ location(latitude: $latitude, longitude: $longitude) {
8
+ country
9
+ state
10
+ city
11
+ displayName
12
+ }
13
+ }`,
14
+ GET_CHATS: `query GetChats($userId: String!) {
15
+ chats(user: $userId) {
16
+ timestamp
17
+ id
18
+ messages {
19
+ content
20
+ }
21
+ }
22
+ }`,
23
+ GET_CHATS_STATS: `query GetChatsStats($userId: String!) {
24
+ chatsStats(user: $userId) {
25
+ totalChats
26
+ averageProcessingTimes
27
+ }
28
+ }`,
29
+ GET_CHAT: `query GetChatById($id: String!) {
30
+ chatById(id: $id) {
31
+ model
32
+ usage
33
+ messages {
34
+ content
35
+ role
36
+ name
37
+ processingTime
38
+ }
39
+ }
40
+ }`,
41
+ DELETE_CHAT: `mutation DeleteChat($id: String!, $userId: String!) {
42
+ deleteChat(id: $id, user: $userId) {
43
+ timestamp
44
+ id
45
+ messages {
46
+ content
47
+ }
48
+ }
49
+ }`,
50
+ ABOUT: `query About {
51
+ about {
52
+ version
53
+ models
54
+ plugins
55
+ }
56
+ }`,
57
+ GET_CUSTOM_INSTRUCTIONS: `query GetCustomInstructions($user: String!) {
58
+ getCustomInstructions(user: $user) {
59
+ instructions
60
+ location
61
+ }
62
+ }`,
63
+ SET_CUSTOM_INSTRUCTIONS: `mutation SetCustomInstructions(
64
+ $user: String!,
65
+ $instructions: String!,
66
+ $location: String) {
67
+ setCustomInstructions(
68
+ user: $user,
69
+ instructions: $instructions,
70
+ location: $location)
71
+ }`
72
+ }, Et = {
73
+ GET_LOCATION: {
74
+ schema: _.GET_LOCATION,
75
+ method: "location",
76
+ data: (e) => ({
77
+ latitude: e.latitude,
78
+ longitude: e.longitude
79
+ })
80
+ },
81
+ GET_CHATS: {
82
+ schema: _.GET_CHATS,
83
+ method: "chats",
84
+ data: (e) => ({
85
+ userId: e.userId
86
+ })
87
+ },
88
+ GET_CHATS_STATS: {
89
+ schema: _.GET_CHATS_STATS,
90
+ method: "chatsStats",
91
+ data: (e) => ({
92
+ userId: e.userId
93
+ })
94
+ },
95
+ GET_CHAT: {
96
+ schema: _.GET_CHAT,
97
+ method: "chatById",
98
+ data: (e) => ({
99
+ id: e.id
100
+ })
101
+ },
102
+ DELETE_CHAT: {
103
+ schema: _.DELETE_CHAT,
104
+ method: "deleteChat",
105
+ data: (e) => ({
106
+ id: e.id,
107
+ userId: e.userId
108
+ })
109
+ },
110
+ ABOUT: {
111
+ schema: _.ABOUT,
112
+ method: "about",
113
+ data: () => ({})
114
+ },
115
+ GET_CUSTOM_INSTRUCTIONS: {
116
+ schema: _.GET_CUSTOM_INSTRUCTIONS,
117
+ method: "getCustomInstructions",
118
+ data: (e) => ({
119
+ user: e.user
120
+ })
121
+ },
122
+ SET_CUSTOM_INSTRUCTIONS: {
123
+ schema: _.SET_CUSTOM_INSTRUCTIONS,
124
+ method: "setCustomInstructions",
125
+ data: (e) => ({
126
+ user: e.user,
127
+ instructions: e.instructions,
128
+ location: e.location
129
+ })
130
+ }
131
+ }, le = process.env.PUBLIC_SASSY_API_SERVER_URL, $e = async ({
132
+ query: e,
133
+ data: r,
134
+ headers: t = {}
135
+ }) => await fetch(`${le}/graphql`, {
136
+ method: "POST",
137
+ credentials: "include",
138
+ headers: {
139
+ ...t,
140
+ "Content-Type": "application/json",
141
+ Accept: "application/json"
142
+ },
143
+ body: JSON.stringify({
144
+ query: e,
145
+ variables: r
146
+ })
147
+ }), At = async ({
148
+ accessToken: e,
149
+ type: r,
150
+ params: t = {}
151
+ }) => {
152
+ const a = r != null && r.data ? r.data(t) : t;
153
+ try {
154
+ const o = `Bearer ${e}`, n = await $e({
155
+ headers: {
156
+ authorization: o
157
+ },
158
+ query: r.schema,
159
+ data: a
160
+ });
161
+ if (n.status !== 200)
162
+ return { status: n.status, data: [] };
163
+ const { data: i, errors: s } = await n.json();
164
+ return {
165
+ status: n.status,
166
+ data: i[r.method],
167
+ errors: s
168
+ };
169
+ } catch (o) {
170
+ return console.error(o), { status: 500, data: [] };
171
+ }
172
+ }, $t = async ({
173
+ accessToken: e,
174
+ name: r,
175
+ data: t,
176
+ method: a = "POST"
177
+ }) => {
178
+ const o = `Bearer ${e}`;
179
+ return await fetch(`${le}/api/${r}`, {
180
+ method: a,
181
+ credentials: "include",
182
+ headers: {
183
+ "Content-Type": "application/json",
184
+ authorization: o
185
+ },
186
+ body: JSON.stringify(t)
187
+ });
188
+ }, Rt = T.createContext({
189
+ state: {
190
+ id: "",
191
+ model: Ee,
192
+ usage: 0,
193
+ messages: [],
194
+ isComponent: !1
195
+ },
196
+ dispatch: () => {
197
+ },
198
+ serverStats: { version: "", models: [], plugins: [] }
199
+ }), Ot = T.createContext({
200
+ state: { searchString: "", sortedCell: "", sortDirection: "" },
201
+ dispatch: () => {
202
+ }
203
+ }), Bt = T.createContext({
204
+ state: { tag: "" },
205
+ dispatch: () => {
206
+ }
207
+ });
208
+ function se(e, r) {
209
+ window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: r }));
210
+ }
211
+ const re = (e, r) => {
212
+ const t = JSON.stringify(
213
+ typeof r == "function" ? r() : r
214
+ );
215
+ window.localStorage.setItem(e, t), se(e, t);
216
+ }, Re = (e) => {
217
+ window.localStorage.removeItem(e), se(e, null);
218
+ }, ae = (e) => window.localStorage.getItem(e), Oe = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
219
+ function Ht({
220
+ key: e,
221
+ initialValue: r
222
+ }) {
223
+ const t = Ce(Oe, () => ae(e)), a = D(
224
+ (i) => {
225
+ try {
226
+ const s = typeof i == "function" ? i(JSON.parse(t)) : i;
227
+ s == null ? Re(e) : re(e, s);
228
+ } catch (s) {
229
+ console.warn(s);
230
+ }
231
+ },
232
+ [e, t]
233
+ ), o = D(() => {
234
+ a(r);
235
+ }, [r, a]), n = D(() => {
236
+ a(null);
237
+ }, [a]);
238
+ return R(() => {
239
+ try {
240
+ ae(e) === null && typeof r < "u" && re(e, r);
241
+ } catch (i) {
242
+ console.warn(i);
243
+ }
244
+ }, [e, r]), [t ? JSON.parse(t) : null, a, o, n];
245
+ }
246
+ /*!
247
+ @versini/ui-table v1.0.10
248
+ © 2024 gizmette.com
249
+ */
250
+ try {
251
+ window.__VERSINI_UI_TABLE__ || (window.__VERSINI_UI_TABLE__ = {
252
+ version: "1.0.10",
253
+ buildTime: "09/28/2024 06:29 PM EDT",
254
+ homepage: "https://github.com/aversini/ui-components",
255
+ license: "MIT"
256
+ });
257
+ } catch {
258
+ }
259
+ const Be = (e) => {
260
+ let r = "";
261
+ if (typeof e == "number" || typeof e == "string")
262
+ r = "m-" + e;
263
+ else {
264
+ const t = [];
265
+ (e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), r = t.join(" ");
266
+ }
267
+ return r;
268
+ }, z = "thead", Y = "tfoot", C = "tbody", V = {
269
+ ASC: "asc",
270
+ DESC: "desc"
271
+ }, He = ({
272
+ mode: e,
273
+ className: r,
274
+ wrapperClassName: t,
275
+ stickyHeader: a,
276
+ stickyFooter: o,
277
+ spacing: n
278
+ }) => ({
279
+ wrapper: l(
280
+ "not-prose relative w-full rounded-lg shadow-md",
281
+ Be(n),
282
+ {
283
+ "overflow-x-auto": !a && !o,
284
+ "overflow-y-scroll": a || o,
285
+ "bg-surface-darker text-copy-light": e === "dark",
286
+ "bg-surface-light text-copy-dark": e === "light",
287
+ "bg-surface-darker text-copy-light dark:bg-surface-light dark:text-copy-dark": e === "system",
288
+ "bg-surface-light text-copy-dark dark:bg-surface-darker dark:text-copy-light": e === "alt-system"
289
+ },
290
+ t
291
+ ),
292
+ table: l("my-0 w-full text-left text-sm", r, {
293
+ "text-copy-light": e === "dark",
294
+ "text-copy-dark": e === "light",
295
+ "text-copy-light dark:text-copy-dark": e === "system",
296
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
297
+ }),
298
+ caption: l("py-2 text-sm font-bold", {
299
+ "text-copy-light": e === "dark",
300
+ "text-copy-dark": e === "light",
301
+ "text-copy-light dark:text-copy-dark": e === "system",
302
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
303
+ })
304
+ }), Me = ({
305
+ className: e,
306
+ stickyHeader: r,
307
+ mode: t
308
+ }) => l(e, {
309
+ "sticky top-0 z-10": r,
310
+ "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "dark",
311
+ "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "system",
312
+ "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "light",
313
+ "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "alt-system"
314
+ }), Le = ({
315
+ className: e,
316
+ stickyFooter: r,
317
+ mode: t
318
+ }) => l(e, {
319
+ "sticky bottom-0 z-10": r,
320
+ "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "dark",
321
+ "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "system",
322
+ "shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "light",
323
+ "shadow-[rgb(65_65_65_/30%)_-0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "alt-system"
324
+ }), Ue = ({
325
+ mode: e,
326
+ className: r,
327
+ cellWrapper: t
328
+ }) => t === z || t === Y ? l({
329
+ "bg-table-head-dark": e === "dark",
330
+ "bg-table-head-light": e === "light",
331
+ "bg-table-head-dark dark:bg-table-head-light": e === "system",
332
+ "bg-table-head-light dark:bg-table-head-dark": e === "alt-system"
333
+ }) : l("border-b last:border-0", r, {
334
+ "border-table-dark": e === "dark",
335
+ "odd:bg-table-dark-odd even:bg-table-dark-even": t === C && e === "dark",
336
+ "border-table-light": e === "light",
337
+ "odd:bg-table-light-odd even:bg-table-light-even": t === C && e === "light",
338
+ "border-table-dark dark:border-table-light": e === "system",
339
+ "odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": t === C && e === "system",
340
+ "border-table-light dark:border-table-dark": e === "alt-system",
341
+ "odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": t === C && e === "alt-system"
342
+ }), Ve = ({
343
+ cellWrapper: e,
344
+ className: r,
345
+ compact: t,
346
+ mode: a
347
+ }) => l(r, {
348
+ "text-copy-light": a === "dark",
349
+ "text-copy-dark": a === "light",
350
+ "text-copy-light dark:text-copy-dark": a === "system",
351
+ "text-copy-dark dark:text-copy-light": a === "alt-system",
352
+ "px-4 py-3": !t && (e === z || e === Y),
353
+ "p-4": !t && e === C,
354
+ "px-4 py-1": t
355
+ }), oe = "av-button", De = (e) => {
356
+ let r = "";
357
+ if (typeof e == "number" || typeof e == "string")
358
+ r = "m-" + e;
359
+ else {
360
+ const t = [];
361
+ (e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), r = t.join(" ");
362
+ }
363
+ return r;
364
+ }, ce = "icon", ze = "button", Ge = "link", Pe = ({
365
+ type: e,
366
+ size: r,
367
+ labelRight: t,
368
+ labelLeft: a,
369
+ align: o
370
+ }) => {
371
+ const n = "text-sm font-medium max-h-8 py-0", i = "text-base font-medium max-h-9 py-1", s = "text-lg font-medium max-h-12 py-2";
372
+ switch (e) {
373
+ case ze:
374
+ return l("px-4", {
375
+ [n]: r === "small",
376
+ [i]: r === "medium",
377
+ [s]: r === "large"
378
+ });
379
+ case Ge:
380
+ return l("px-4 text-center", {
381
+ [n]: r === "small",
382
+ [i]: r === "medium",
383
+ [s]: r === "large"
384
+ });
385
+ case ce:
386
+ return l("inline-flex items-center", {
387
+ "justify-center": o === "center",
388
+ "justify-start": o === "left",
389
+ "justify-end": o === "right",
390
+ "h-6 w-6 p-0": r === "small" && !(t || a),
391
+ "h-6 px-4 text-sm font-medium": r === "small" && (t || a),
392
+ "h-8 w-8 p-1": r === "medium" && !(t || a),
393
+ "h-8 px-4 text-base font-medium": r === "medium" && (t || a),
394
+ "h-12 w-12 p-2": r === "large" && !(t || a),
395
+ "h-12 px-4 text-lg font-medium": r === "large" && (t || a)
396
+ });
397
+ }
398
+ }, Fe = ({
399
+ mode: e,
400
+ noBackground: r,
401
+ noTruncate: t,
402
+ variant: a
403
+ }) => {
404
+ if (r)
405
+ return "not-prose rounded-full";
406
+ if (a === "primary")
407
+ return l("not-prose rounded-full", {
408
+ truncate: !t,
409
+ "bg-action-dark text-copy-light": e === "dark",
410
+ "bg-action-light text-copy-lighter": e === "light",
411
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "system",
412
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
413
+ });
414
+ if (a === "secondary")
415
+ return l("not-prose rounded-full", {
416
+ truncate: !t,
417
+ "bg-action-dark text-copy-light": e === "light",
418
+ "bg-action-light text-copy-lighter": e === "dark",
419
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "alt-system",
420
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
421
+ });
422
+ if (a === "danger")
423
+ return l("not-prose rounded-full", {
424
+ truncate: !t,
425
+ "bg-action-danger-dark text-copy-light": e === "dark",
426
+ "bg-action-danger-light text-copy-lighter": e === "light",
427
+ "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
428
+ "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
429
+ });
430
+ }, je = ({
431
+ mode: e,
432
+ disabled: r,
433
+ variant: t
434
+ }) => {
435
+ if (r)
436
+ return "";
437
+ if (t === "primary")
438
+ return l("hover:text-copy-light-hover", {
439
+ "hover:bg-action-dark-hover": e === "dark",
440
+ "hover:bg-action-light-hover": e === "light",
441
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
442
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
443
+ });
444
+ if (t === "secondary")
445
+ return l("hover:text-copy-light-hover", {
446
+ "hover:bg-action-dark-hover": e === "light",
447
+ "hover:bg-action-light-hover": e === "dark",
448
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
449
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
450
+ });
451
+ if (t === "danger")
452
+ return l("hover:text-copy-light-hover", {
453
+ "hover:bg-action-danger-dark-hover": e === "dark",
454
+ "hover:bg-action-danger-light-hover": e === "light",
455
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
456
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
457
+ });
458
+ }, We = ({
459
+ mode: e,
460
+ disabled: r,
461
+ variant: t
462
+ }) => {
463
+ if (r)
464
+ return "";
465
+ if (t === "primary")
466
+ return l("active:text-copy-light-active", {
467
+ "active:bg-action-dark-active": e === "dark",
468
+ "active:bg-action-light-active": e === "light",
469
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
470
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
471
+ });
472
+ if (t === "secondary")
473
+ return l("active:text-copy-light-active", {
474
+ "active:bg-action-dark-active": e === "light",
475
+ "active:bg-action-light-active": e === "dark",
476
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
477
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
478
+ });
479
+ if (t === "danger")
480
+ return l("active:text-copy-lighter-active", {
481
+ "active:bg-action-danger-dark-active": e === "dark",
482
+ "active:bg-action-danger-light-active": e === "light",
483
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
484
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
485
+ });
486
+ }, qe = ({
487
+ mode: e,
488
+ noBorder: r,
489
+ variant: t
490
+ }) => {
491
+ if (r)
492
+ return "border border-transparent";
493
+ if (t === "primary")
494
+ return l("border", {
495
+ "border-border-dark": e === "dark",
496
+ "border-border-accent": e === "light",
497
+ "border-border-dark dark:border-border-accent": e === "system",
498
+ "border-border-accent dark:border-border-dark": e === "alt-system"
499
+ });
500
+ if (t === "secondary")
501
+ return l("border", {
502
+ "border-border-dark": e === "light",
503
+ "border-border-accent": e === "dark",
504
+ "border-border-dark dark:border-border-accent": e === "alt-system",
505
+ "border-border-accent dark:border-border-dark": e === "system"
506
+ });
507
+ if (t === "danger")
508
+ return l("border", {
509
+ "border-border-danger-dark": e === "dark",
510
+ "border-border-danger-medium": e === "light",
511
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
512
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
513
+ });
514
+ }, Je = ({ focusMode: e }) => l("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
515
+ "focus:outline-focus-dark": e === "dark",
516
+ "focus:outline-focus-light": e === "light",
517
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
518
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
519
+ }), Qe = ({
520
+ type: e,
521
+ className: r,
522
+ raw: t,
523
+ mode: a,
524
+ focusMode: o,
525
+ disabled: n,
526
+ fullWidth: i,
527
+ size: s,
528
+ noBorder: d,
529
+ labelRight: u,
530
+ labelLeft: m,
531
+ spacing: b,
532
+ noBackground: g,
533
+ variant: h,
534
+ noTruncate: p,
535
+ align: x
536
+ }) => (h || (h = "primary"), t ? l(oe, r) : l(
537
+ oe,
538
+ r,
539
+ De(b),
540
+ Fe({ mode: a, variant: h, noBackground: g, noTruncate: p }),
541
+ Pe({ type: e, size: s, labelRight: u, labelLeft: m, align: x }),
542
+ qe({ mode: a, variant: h, noBorder: d }),
543
+ Je({ focusMode: o }),
544
+ je({ mode: a, variant: h, disabled: n }),
545
+ We({ mode: a, variant: h, disabled: n }),
546
+ {
547
+ "w-full": i,
548
+ "disabled:cursor-not-allowed disabled:opacity-50": n
549
+ }
550
+ )), Ye = (e, r, t) => {
551
+ var a;
552
+ !r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
553
+ }, de = T.forwardRef((e, r) => {
554
+ const { onClick: t, noInternalClick: a = !1, ...o } = e;
555
+ return /* @__PURE__ */ c(
556
+ "button",
557
+ {
558
+ ref: r,
559
+ onClick: (n) => {
560
+ Ye(n, a, t);
561
+ },
562
+ ...o
563
+ }
564
+ );
565
+ });
566
+ de.displayName = "BaseButton";
567
+ /*!
568
+ @versini/ui-button v1.1.10
569
+ © 2024 gizmette.com
570
+ */
571
+ try {
572
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
573
+ version: "1.1.10",
574
+ buildTime: "09/28/2024 06:29 PM EDT",
575
+ homepage: "https://github.com/aversini/ui-components",
576
+ license: "MIT"
577
+ });
578
+ } catch {
579
+ }
580
+ const ue = T.forwardRef(
581
+ ({
582
+ children: e,
583
+ disabled: r = !1,
584
+ mode: t = "system",
585
+ focusMode: a = "system",
586
+ fullWidth: o = !1,
587
+ className: n,
588
+ type: i = "button",
589
+ raw: s = !1,
590
+ noBorder: d = !1,
591
+ "aria-label": u,
592
+ label: m,
593
+ size: b = "medium",
594
+ labelRight: g,
595
+ labelLeft: h,
596
+ spacing: p,
597
+ noBackground: x = !1,
598
+ align: S = "center",
599
+ active: B = !1,
600
+ ...H
601
+ }, M) => {
602
+ const G = Qe({
603
+ type: ce,
604
+ mode: t,
605
+ focusMode: a,
606
+ fullWidth: o,
607
+ disabled: r,
608
+ raw: s,
609
+ className: n,
610
+ noBorder: d,
611
+ size: b,
612
+ labelRight: g,
613
+ labelLeft: h,
614
+ spacing: p,
615
+ noBackground: x,
616
+ align: S
617
+ }), P = l({
618
+ "text-copy-accent-dark": t === "light" && !s,
619
+ "text-copy-light": t === "dark" && !s,
620
+ "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !s,
621
+ "text-copy-light dark:text-copy-accent-dark": t === "system" && !s
622
+ }), F = B ? l(
623
+ "relative",
624
+ "focus-within:static",
625
+ "focus-within:after:border-transparent",
626
+ "after:absolute",
627
+ "after:content-['']",
628
+ "after:border-b-2",
629
+ "after:bottom-[-4px]",
630
+ "after:left-0",
631
+ "after:right-0",
632
+ {
633
+ "after:border-table-dark": t === "dark",
634
+ "after:border-table-light": t === "light",
635
+ "after:border-table-dark dark:after:border-table-light": t === "system",
636
+ "after:border-table-light dark:after:border-table-dark": t === "alt-system"
637
+ }
638
+ ) : "";
639
+ return /* @__PURE__ */ c("div", { className: F, children: /* @__PURE__ */ w(
640
+ de,
641
+ {
642
+ ref: M,
643
+ className: G,
644
+ disabled: r,
645
+ type: i,
646
+ "aria-label": u || m,
647
+ ...H,
648
+ children: [
649
+ h && /* @__PURE__ */ c("span", { className: "pr-2", children: h }),
650
+ /* @__PURE__ */ c("div", { className: P, children: e }),
651
+ g && /* @__PURE__ */ c("span", { className: "pl-2", children: g })
652
+ ]
653
+ }
654
+ ) });
655
+ }
656
+ );
657
+ ue.displayName = "ButtonSort";
658
+ const Xe = (e) => {
659
+ let r = "";
660
+ if (typeof e == "number" || typeof e == "string")
661
+ r = "m-" + e;
662
+ else {
663
+ const t = [];
664
+ (e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), r = t.join(" ");
665
+ }
666
+ return r;
667
+ }, X = ({
668
+ children: e,
669
+ fill: r,
670
+ viewBox: t,
671
+ className: a,
672
+ defaultViewBox: o,
673
+ defaultClassName: n,
674
+ spacing: i,
675
+ title: s,
676
+ semantic: d = !1,
677
+ ...u
678
+ }) => {
679
+ const m = Xe(i), b = l(
680
+ m,
681
+ a || n
682
+ );
683
+ return /* @__PURE__ */ w(Ae, { children: [
684
+ /* @__PURE__ */ c(
685
+ "svg",
686
+ {
687
+ xmlns: "http://www.w3.org/2000/svg",
688
+ className: b,
689
+ viewBox: t || o,
690
+ fill: r || "currentColor",
691
+ role: "img",
692
+ "aria-hidden": !d,
693
+ focusable: !1,
694
+ ...u,
695
+ children: e
696
+ }
697
+ ),
698
+ s && d && /* @__PURE__ */ c("span", { className: "sr-only", children: s })
699
+ ] });
700
+ };
701
+ /*!
702
+ @versini/ui-private v1.4.17
703
+ © 2024 gizmette.com
704
+ */
705
+ try {
706
+ window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
707
+ version: "1.4.17",
708
+ buildTime: "09/28/2024 06:29 PM EDT",
709
+ homepage: "https://github.com/aversini/ui-components",
710
+ license: "MIT"
711
+ });
712
+ } catch {
713
+ }
714
+ const Ke = ({
715
+ className: e,
716
+ viewBox: r,
717
+ spacing: t,
718
+ title: a,
719
+ monotone: o,
720
+ ...n
721
+ }) => /* @__PURE__ */ w(
722
+ X,
723
+ {
724
+ defaultViewBox: "0 0 576 512",
725
+ defaultClassName: "size-5",
726
+ viewBox: r,
727
+ className: e,
728
+ spacing: t,
729
+ title: a || "Sort",
730
+ ...n,
731
+ children: [
732
+ /* @__PURE__ */ c(
733
+ "path",
734
+ {
735
+ opacity: o ? "1" : "0.4",
736
+ d: "M393.4 41.4c12.5-12.5 32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L448 141.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V141.3l-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96z"
737
+ }
738
+ ),
739
+ /* @__PURE__ */ c("path", { d: "M137.4 470.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 370.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z" })
740
+ ]
741
+ }
742
+ ), Ze = ({
743
+ className: e,
744
+ viewBox: r,
745
+ spacing: t,
746
+ title: a,
747
+ monotone: o,
748
+ ...n
749
+ }) => /* @__PURE__ */ w(
750
+ X,
751
+ {
752
+ defaultViewBox: "0 0 576 512",
753
+ defaultClassName: "size-5",
754
+ viewBox: r,
755
+ className: e,
756
+ spacing: t,
757
+ title: a || "Sort Down",
758
+ ...n,
759
+ children: [
760
+ /* @__PURE__ */ c(
761
+ "path",
762
+ {
763
+ opacity: o ? "1" : "0.4",
764
+ d: "M288 448c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32z"
765
+ }
766
+ ),
767
+ /* @__PURE__ */ c("path", { d: "M128 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L160 365.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32V365.7L63.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C110.5 476.2 119 480 128 480z" })
768
+ ]
769
+ }
770
+ ), et = ({
771
+ className: e,
772
+ viewBox: r,
773
+ spacing: t,
774
+ title: a,
775
+ monotone: o,
776
+ ...n
777
+ }) => /* @__PURE__ */ w(
778
+ X,
779
+ {
780
+ defaultViewBox: "0 0 576 512",
781
+ defaultClassName: "size-5",
782
+ viewBox: r,
783
+ className: e,
784
+ spacing: t,
785
+ title: a || "Sort Up",
786
+ ...n,
787
+ children: [
788
+ /* @__PURE__ */ c(
789
+ "path",
790
+ {
791
+ opacity: o ? "1" : "0.4",
792
+ d: "M288 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32z"
793
+ }
794
+ ),
795
+ /* @__PURE__ */ c("path", { d: "M128 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L160 146.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V146.3L63.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32z" })
796
+ ]
797
+ }
798
+ );
799
+ /*!
800
+ @versini/ui-icons v1.13.1
801
+ © 2024 gizmette.com
802
+ */
803
+ try {
804
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
805
+ version: "1.13.1",
806
+ buildTime: "09/28/2024 06:29 PM EDT",
807
+ homepage: "https://github.com/aversini/ui-components",
808
+ license: "MIT"
809
+ });
810
+ } catch {
811
+ }
812
+ const I = T.createContext({
813
+ mode: "light",
814
+ cellWrapper: "thead",
815
+ stickyHeader: !1,
816
+ stickyFooter: !1,
817
+ compact: !1
818
+ }), Mt = ({
819
+ children: e,
820
+ mode: r = "system",
821
+ caption: t,
822
+ compact: a,
823
+ summary: o,
824
+ className: n,
825
+ wrapperClassName: i,
826
+ maxHeight: s,
827
+ stickyHeader: d,
828
+ stickyFooter: u,
829
+ spacing: m,
830
+ ...b
831
+ }) => {
832
+ const g = He({
833
+ mode: r,
834
+ className: n,
835
+ wrapperClassName: i,
836
+ stickyHeader: d,
837
+ stickyFooter: u,
838
+ spacing: m
839
+ });
840
+ return /* @__PURE__ */ c(
841
+ I.Provider,
842
+ {
843
+ value: { mode: r, stickyHeader: d, stickyFooter: u, compact: a },
844
+ children: /* @__PURE__ */ c(
845
+ "div",
846
+ {
847
+ className: g.wrapper,
848
+ ...s && {
849
+ style: { maxHeight: s }
850
+ },
851
+ children: /* @__PURE__ */ w("table", { className: g.table, summary: o, ...b, children: [
852
+ t && /* @__PURE__ */ c("caption", { className: g.caption, children: t }),
853
+ e
854
+ ] })
855
+ }
856
+ )
857
+ }
858
+ );
859
+ }, Lt = ({
860
+ children: e,
861
+ className: r,
862
+ ...t
863
+ }) => {
864
+ const a = O(I);
865
+ a.cellWrapper = z;
866
+ const o = Me({
867
+ className: r,
868
+ mode: a.mode,
869
+ stickyHeader: a.stickyHeader
870
+ });
871
+ return /* @__PURE__ */ c("thead", { className: o, ...t, children: e });
872
+ }, Ut = ({
873
+ children: e,
874
+ className: r,
875
+ ...t
876
+ }) => {
877
+ const a = O(I);
878
+ a.cellWrapper = Y;
879
+ const o = Le({
880
+ className: r,
881
+ mode: a.mode,
882
+ stickyFooter: a.stickyFooter
883
+ });
884
+ return /* @__PURE__ */ c("tfoot", { className: o, ...t, children: e });
885
+ }, Vt = ({ children: e, ...r }) => {
886
+ const t = O(I);
887
+ return t.cellWrapper = C, /* @__PURE__ */ c("tbody", { ...r, children: e });
888
+ }, Dt = ({
889
+ children: e,
890
+ className: r,
891
+ ...t
892
+ }) => {
893
+ const a = O(I), o = Ue({
894
+ mode: a.mode,
895
+ cellWrapper: a.cellWrapper,
896
+ className: r
897
+ });
898
+ return /* @__PURE__ */ c("tr", { className: o, ...t, children: e });
899
+ }, tt = ({
900
+ children: e,
901
+ component: r,
902
+ className: t,
903
+ ...a
904
+ }) => {
905
+ const o = O(I), n = r || (o.cellWrapper === z ? "th" : "td"), i = Ve({
906
+ cellWrapper: o.cellWrapper,
907
+ className: t,
908
+ mode: o.mode,
909
+ compact: o.compact
910
+ });
911
+ return /* @__PURE__ */ c(n, { className: i, ...a, children: e });
912
+ }, zt = ({
913
+ align: e,
914
+ children: r,
915
+ className: t,
916
+ component: a,
917
+ focusMode: o = "alt-system",
918
+ mode: n = "alt-system",
919
+ onClick: i,
920
+ sortDirection: s,
921
+ sortedCell: d,
922
+ cellId: u,
923
+ ...m
924
+ }) => /* @__PURE__ */ c(
925
+ tt,
926
+ {
927
+ component: a,
928
+ className: t,
929
+ role: "columnheader",
930
+ "aria-sort": s === V.ASC && d === u ? "ascending" : s === V.DESC && d === u ? "descending" : "other",
931
+ ...m,
932
+ children: /* @__PURE__ */ c(
933
+ ue,
934
+ {
935
+ active: d === u,
936
+ className: "rounded-none text-sm",
937
+ onClick: i,
938
+ align: e,
939
+ noBorder: !0,
940
+ focusMode: o,
941
+ mode: n,
942
+ fullWidth: !0,
943
+ labelRight: r,
944
+ children: s === V.ASC && d === u ? /* @__PURE__ */ c(et, { className: "size-4", monotone: !0 }) : s === V.DESC && d === u ? /* @__PURE__ */ c(Ze, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ c(Ke, { className: "size-4", monotone: !0 })
945
+ }
946
+ )
947
+ }
948
+ );
949
+ /*!
950
+ @versini/ui-textarea v1.0.7
951
+ © 2024 gizmette.com
952
+ */
953
+ try {
954
+ window.__VERSINI_UI_TEXTAREA__ || (window.__VERSINI_UI_TEXTAREA__ = {
955
+ version: "1.0.7",
956
+ buildTime: "09/27/2024 11:55 AM EDT",
957
+ homepage: "https://github.com/aversini/ui-components",
958
+ license: "MIT"
959
+ });
960
+ } catch {
961
+ }
962
+ const me = "av-text-area", rt = "av-text-area-wrapper", Q = "av-text-area-helper-text", at = "av-text-area__control--right";
963
+ function ot() {
964
+ const e = f(!1);
965
+ return R(() => (e.current = !0, () => {
966
+ e.current = !1;
967
+ }), []), D(() => e.current, []);
968
+ }
969
+ function nt(e) {
970
+ return ie(() => e.every((r) => r == null) ? () => {
971
+ } : (r) => {
972
+ e.forEach((t) => {
973
+ typeof t == "function" ? t(r) : t != null && (t.current = r);
974
+ });
975
+ }, e);
976
+ }
977
+ const it = {
978
+ x: 0,
979
+ y: 0,
980
+ width: 0,
981
+ height: 0,
982
+ top: 0,
983
+ left: 0,
984
+ bottom: 0,
985
+ right: 0
986
+ };
987
+ function lt(e) {
988
+ const r = ot(), t = f(0), a = f(null), [o, n] = $(it), i = ie(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((s) => {
989
+ const d = s[0];
990
+ d && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
991
+ a.current && r() && n(d.contentRect);
992
+ }));
993
+ }), [r]);
994
+ return R(() => (a.current && (i == null || i.observe(a.current, e)), () => {
995
+ i == null || i.disconnect(), t.current && cancelAnimationFrame(t.current);
996
+ }), [i, e]), [a, o];
997
+ }
998
+ function st({
999
+ value: e,
1000
+ defaultValue: r,
1001
+ finalValue: t,
1002
+ onChange: a = () => {
1003
+ },
1004
+ initialControlledDelay: o = 0
1005
+ }) {
1006
+ const [n, i] = $(!1), [s, d] = $(
1007
+ r !== void 0 ? r : t
1008
+ ), u = (m) => {
1009
+ d(m), a == null || a(m);
1010
+ };
1011
+ return R(() => {
1012
+ (async () => e !== void 0 && !n && o > 0 && (await new Promise(
1013
+ (m) => setTimeout(m, o)
1014
+ ), i(!0)))();
1015
+ }, [e, o, n]), e !== void 0 ? !n && o > 0 ? ["", a, !0] : [e, a, !0] : [s, u, !1];
1016
+ }
1017
+ function ct(e) {
1018
+ const r = Ie();
1019
+ if (!e)
1020
+ return r;
1021
+ if (typeof e == "number" || typeof e == "string")
1022
+ return `${e}${r}`;
1023
+ if (typeof e == "object") {
1024
+ const { id: t, prefix: a = "" } = e;
1025
+ return typeof t == "number" || typeof t == "string" ? `${a}${t}` : `${a}${r}`;
1026
+ }
1027
+ }
1028
+ const he = "SET_ANNOUNCEMENT", ge = "CLEAR_ANNOUNCEMENT", dt = {
1029
+ alert: null,
1030
+ alertdialog: null,
1031
+ log: "polite",
1032
+ marquee: null,
1033
+ progressbar: null,
1034
+ status: "polite",
1035
+ timer: "assertive"
1036
+ }, ut = (e, r) => {
1037
+ switch (r == null ? void 0 : r.type) {
1038
+ case he:
1039
+ return {
1040
+ ...e,
1041
+ announcement: r.payload
1042
+ };
1043
+ case ge:
1044
+ return {
1045
+ ...e,
1046
+ announcement: null
1047
+ };
1048
+ default:
1049
+ return e;
1050
+ }
1051
+ }, mt = ({
1052
+ onAnnouncementClear: e,
1053
+ dispatch: r
1054
+ }) => {
1055
+ r({
1056
+ type: ge
1057
+ }), typeof e == "function" && e();
1058
+ }, ne = ({
1059
+ children: e,
1060
+ clearAnnouncementDelay: r,
1061
+ clearAnnouncementTimeoutRef: t,
1062
+ onAnnouncementClear: a,
1063
+ dispatch: o
1064
+ }) => {
1065
+ (t == null ? void 0 : t.current) !== null && clearTimeout(t.current), e !== null && o({
1066
+ type: he,
1067
+ payload: e
1068
+ }), r && (t.current = setTimeout(
1069
+ () => mt({
1070
+ onAnnouncementClear: a,
1071
+ dispatch: o
1072
+ }),
1073
+ r
1074
+ ));
1075
+ }, ht = ({
1076
+ children: e,
1077
+ announcementTimeoutRef: r,
1078
+ announcementDelay: t,
1079
+ clearAnnouncementDelay: a,
1080
+ clearAnnouncementTimeoutRef: o,
1081
+ onAnnouncementClear: n,
1082
+ dispatch: i
1083
+ }) => {
1084
+ clearTimeout(r.current), t ? r.current = setTimeout(ne, t, {
1085
+ children: e,
1086
+ clearAnnouncementDelay: a,
1087
+ clearAnnouncementTimeoutRef: o,
1088
+ onAnnouncementClear: n,
1089
+ dispatch: i
1090
+ }) : ne({
1091
+ children: e,
1092
+ clearAnnouncementDelay: a,
1093
+ clearAnnouncementTimeoutRef: o,
1094
+ onAnnouncementClear: n,
1095
+ dispatch: i
1096
+ });
1097
+ };
1098
+ function gt({
1099
+ children: e,
1100
+ className: r,
1101
+ politeness: t,
1102
+ role: a = null,
1103
+ announcementDelay: o,
1104
+ clearAnnouncementDelay: n,
1105
+ onAnnouncementClear: i,
1106
+ visible: s,
1107
+ ...d
1108
+ }) {
1109
+ const u = f(), m = f(), [b, g] = Se(ut, {
1110
+ announcement: null
1111
+ });
1112
+ let h = t;
1113
+ typeof h > "u" && (h = a ? dt[a] : "assertive"), R(() => {
1114
+ ht({
1115
+ announcementTimeoutRef: u,
1116
+ announcementDelay: o,
1117
+ children: e,
1118
+ clearAnnouncementDelay: n,
1119
+ clearAnnouncementTimeoutRef: m,
1120
+ onAnnouncementClear: i,
1121
+ dispatch: g
1122
+ });
1123
+ }, [
1124
+ e,
1125
+ o,
1126
+ n,
1127
+ i
1128
+ ]);
1129
+ const p = l(r, {
1130
+ "sr-only": !s
1131
+ });
1132
+ return /* @__PURE__ */ c(
1133
+ "div",
1134
+ {
1135
+ "aria-live": h,
1136
+ ...a && { role: a },
1137
+ className: p,
1138
+ ...d,
1139
+ children: b.announcement
1140
+ }
1141
+ );
1142
+ }
1143
+ const pt = (e) => {
1144
+ let r = "";
1145
+ if (typeof e == "number" || typeof e == "string")
1146
+ r = "m-" + e;
1147
+ else {
1148
+ const t = [];
1149
+ (e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), r = t.join(" ");
1150
+ }
1151
+ return r;
1152
+ };
1153
+ /*!
1154
+ @versini/ui-private v1.4.17
1155
+ © 2024 gizmette.com
1156
+ */
1157
+ try {
1158
+ window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
1159
+ version: "1.4.17",
1160
+ buildTime: "09/27/2024 11:55 AM EDT",
1161
+ homepage: "https://github.com/aversini/ui-components",
1162
+ license: "MIT"
1163
+ });
1164
+ } catch {
1165
+ }
1166
+ const bt = () => "rounded-md text-base h-20 min-h-[80px] resize-none overflow-hidden px-4 py-7", yt = ({
1167
+ mode: e
1168
+ }) => l({
1169
+ "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
1170
+ "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
1171
+ "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
1172
+ "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
1173
+ }), ft = ({
1174
+ focusMode: e
1175
+ }) => l("focus:outline focus:outline-2 focus:outline-offset-2", {
1176
+ "focus:outline-focus-dark": e === "dark",
1177
+ "focus:outline-focus-light": e === "light",
1178
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1179
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1180
+ }), kt = ({
1181
+ noBorder: e,
1182
+ error: r
1183
+ }) => l("border-2", {
1184
+ "border-border-dark": !e && !r,
1185
+ "focus:border-border-dark": !e && r,
1186
+ "border-border-error-dark": !e && r,
1187
+ "border-transparent": e
1188
+ }), vt = ({
1189
+ disabled: e,
1190
+ raw: r,
1191
+ error: t,
1192
+ mode: a
1193
+ }) => {
1194
+ if (r)
1195
+ return "";
1196
+ if (e)
1197
+ return l("absolute px-2 cursor-not-allowed opacity-50 font-medium");
1198
+ if (!t)
1199
+ return l("absolute px-2 cursor-text font-medium", {
1200
+ "text-copy-medium": a === "dark",
1201
+ "text-copy-dark": a === "light",
1202
+ "text-copy-dark dark:text-copy-medium": a === "system",
1203
+ "text-copy-medium dark:text-copy-dark": a === "alt-system"
1204
+ });
1205
+ if (t)
1206
+ return l("absolute px-2 cursor-text font-medium", {
1207
+ "text-copy-medium": a === "dark",
1208
+ "text-copy-error-dark": a === "light",
1209
+ "text-copy-error-dark dark:text-copy-error-light": a === "system",
1210
+ "text-copy-medium dark:text-copy-error-dark": a === "alt-system"
1211
+ });
1212
+ }, _t = ({
1213
+ error: e,
1214
+ raw: r,
1215
+ mode: t,
1216
+ disabled: a
1217
+ }) => {
1218
+ if (r)
1219
+ return "";
1220
+ if (a)
1221
+ return l(
1222
+ Q,
1223
+ "absolute px-2 cursor-not-allowed opacity-50 font-medium"
1224
+ );
1225
+ if (!e)
1226
+ return l(Q, "absolute px-2 font-medium", {
1227
+ "text-copy-medium": t === "dark",
1228
+ "text-copy-dark": t === "light",
1229
+ "text-copy-dark dark:text-copy-medium": t === "system",
1230
+ "text-copy-medium dark:text-copy-dark": t === "alt-system"
1231
+ });
1232
+ if (e)
1233
+ return l(Q, "absolute px-2 font-medium", {
1234
+ "text-copy-error-light": t === "dark",
1235
+ "text-copy-error-dark": t === "light",
1236
+ "text-copy-error-dark dark:text-copy-error-light": t === "system",
1237
+ "dark:text-copy-error-dark text-copy-error-light": t === "alt-system"
1238
+ });
1239
+ }, xt = ({
1240
+ className: e,
1241
+ textAreaClassName: r,
1242
+ raw: t,
1243
+ focusMode: a,
1244
+ disabled: o,
1245
+ noBorder: n,
1246
+ error: i,
1247
+ spacing: s,
1248
+ mode: d
1249
+ }) => {
1250
+ const u = t ? e : l(
1251
+ "relative flex w-full flex-col justify-center",
1252
+ rt,
1253
+ e,
1254
+ pt(s)
1255
+ ), m = t ? l(r) : l(
1256
+ me,
1257
+ r,
1258
+ bt(),
1259
+ yt({ mode: d }),
1260
+ ft({ focusMode: a }),
1261
+ kt({
1262
+ noBorder: n,
1263
+ error: i
1264
+ }),
1265
+ {
1266
+ "disabled:cursor-not-allowed disabled:opacity-50": o
1267
+ }
1268
+ ), b = t ? void 0 : "sr-only", g = vt({
1269
+ disabled: o,
1270
+ raw: t,
1271
+ error: i,
1272
+ mode: d
1273
+ }), h = _t({
1274
+ error: i,
1275
+ raw: t,
1276
+ mode: d,
1277
+ disabled: o
1278
+ }), p = t ? void 0 : l(at, "absolute");
1279
+ return {
1280
+ wrapper: u,
1281
+ textArea: m,
1282
+ accessibleLabel: b,
1283
+ visibleLabel: g,
1284
+ helperText: h,
1285
+ rightElement: p
1286
+ };
1287
+ }, Tt = ({
1288
+ scrollHeight: e,
1289
+ currentHeight: r,
1290
+ currentLabelOffset: t = 0,
1291
+ currentHelperTextOffset: a = 0
1292
+ }) => {
1293
+ let o, n;
1294
+ if (e > 0 && e !== r) {
1295
+ const i = e - r, s = Math.abs(i / 24);
1296
+ o = t + -1 * Math.sign(i) * (12 * s), n = a + Math.sign(i) * (12 * s);
1297
+ }
1298
+ return {
1299
+ labelOffset: o,
1300
+ helperTextOffset: n,
1301
+ scrollHeight: e
1302
+ };
1303
+ }, wt = T.forwardRef(
1304
+ ({
1305
+ id: e,
1306
+ name: r,
1307
+ label: t,
1308
+ error: a = !1,
1309
+ raw: o = !1,
1310
+ className: n,
1311
+ textAreaClassName: i,
1312
+ mode: s = "system",
1313
+ focusMode: d = "system",
1314
+ value: u,
1315
+ defaultValue: m,
1316
+ disabled: b = !1,
1317
+ noBorder: g = !1,
1318
+ labelId: h,
1319
+ helperText: p = "",
1320
+ helperTextOnFocus: x = !1,
1321
+ rightElement: S,
1322
+ onChange: B,
1323
+ onFocus: H,
1324
+ onBlur: M,
1325
+ spacing: G,
1326
+ ...P
1327
+ }, F) => {
1328
+ const k = f(null), pe = nt([F, k]), [be, L] = lt(), j = f(80), K = f(-25), E = f(null), Z = f(30), W = f(null), A = ct({ id: e, prefix: `${me}-` }), [ye, fe] = $(0), [ke, ee] = $(
1329
+ !!(!x && p)
1330
+ ), ve = `${r} error, ${p}`, N = xt({
1331
+ className: n,
1332
+ textAreaClassName: i,
1333
+ error: a,
1334
+ raw: o,
1335
+ focusMode: d,
1336
+ disabled: b,
1337
+ noBorder: g,
1338
+ spacing: G,
1339
+ mode: s
1340
+ }), [v, _e] = st({
1341
+ value: u,
1342
+ initialControlledDelay: 20,
1343
+ defaultValue: m,
1344
+ onChange: (y) => {
1345
+ B && B({
1346
+ target: {
1347
+ value: y
1348
+ }
1349
+ });
1350
+ }
1351
+ }), xe = (y) => {
1352
+ _e(y.target.value);
1353
+ }, Te = (y) => {
1354
+ x && p && ee(!0), H && H(y);
1355
+ }, we = (y) => {
1356
+ x && p && !v && ee(!1), M && M(y);
1357
+ };
1358
+ return U(() => {
1359
+ L && L.width && fe(L.width + 18 + 10);
1360
+ }, [L]), U(() => {
1361
+ o || k && k.current && v !== void 0 && (k.current.style.height = "inherit", k.current.style.height = k.current.scrollHeight + "px");
1362
+ }, [v, o]), U(() => {
1363
+ o || setTimeout(() => {
1364
+ var y;
1365
+ (y = E == null ? void 0 : E.current) == null || y.style.setProperty(
1366
+ "--av-text-area-wrapper-transition",
1367
+ v ? "none" : "all 0.2s ease-out"
1368
+ );
1369
+ }, 0);
1370
+ }, [v, o]), U(() => {
1371
+ var y, te;
1372
+ if (!o && k && k.current && v !== void 0) {
1373
+ const { labelOffset: q, helperTextOffset: J, scrollHeight: Ne } = Tt({
1374
+ scrollHeight: k.current.scrollHeight,
1375
+ currentHeight: j.current,
1376
+ currentLabelOffset: K.current,
1377
+ currentHelperTextOffset: Z.current
1378
+ });
1379
+ q && (K.current = q, (y = E == null ? void 0 : E.current) == null || y.style.setProperty(
1380
+ "--av-text-area-label",
1381
+ `${q}px`
1382
+ )), J && (Z.current = J, (te = W == null ? void 0 : W.current) == null || te.style.setProperty(
1383
+ "--av-text-area-helper-text",
1384
+ `${J}px`
1385
+ )), j.current = Ne || j.current;
1386
+ }
1387
+ }, [v, o]), /* @__PURE__ */ w("div", { className: N.wrapper, children: [
1388
+ /* @__PURE__ */ c(
1389
+ "label",
1390
+ {
1391
+ htmlFor: A,
1392
+ id: h,
1393
+ className: N.accessibleLabel,
1394
+ children: t
1395
+ }
1396
+ ),
1397
+ /* @__PURE__ */ c(
1398
+ "textarea",
1399
+ {
1400
+ ref: pe,
1401
+ id: A,
1402
+ name: r,
1403
+ disabled: b,
1404
+ placeholder: o ? void 0 : " ",
1405
+ className: N.textArea,
1406
+ rows: 1,
1407
+ ...p && { "aria-describedby": `${A}-helper` },
1408
+ ...a && { "aria-invalid": "true" },
1409
+ ...S && !o && { style: { paddingRight: ye } },
1410
+ value: v,
1411
+ onChange: xe,
1412
+ onFocus: Te,
1413
+ onBlur: we,
1414
+ ...P
1415
+ }
1416
+ ),
1417
+ !o && /* @__PURE__ */ c(
1418
+ "label",
1419
+ {
1420
+ ref: E,
1421
+ "aria-hidden": !0,
1422
+ htmlFor: A,
1423
+ className: N.visibleLabel,
1424
+ children: t
1425
+ }
1426
+ ),
1427
+ ke && /* @__PURE__ */ c(
1428
+ "div",
1429
+ {
1430
+ ref: W,
1431
+ id: `${A}-helper`,
1432
+ className: N.helperText,
1433
+ children: p
1434
+ }
1435
+ ),
1436
+ S && /* @__PURE__ */ c(
1437
+ "div",
1438
+ {
1439
+ ref: be,
1440
+ className: N.rightElement,
1441
+ children: S
1442
+ }
1443
+ ),
1444
+ a && p && /* @__PURE__ */ c(gt, { politeness: "polite", clearAnnouncementDelay: 500, children: ve })
1445
+ ] });
1446
+ }
1447
+ );
1448
+ wt.displayName = "TextArea";
1449
+ export {
1450
+ Rt as AppContext,
1451
+ Ht as E,
1452
+ Ot as HistoryContext,
1453
+ Et as SERVICE_TYPES,
1454
+ Bt as TagsContext,
1455
+ Vt as be,
1456
+ Mt as ce,
1457
+ V as f,
1458
+ Lt as ge,
1459
+ Ut as he,
1460
+ tt as ie,
1461
+ Dt as me,
1462
+ $t as restCall,
1463
+ At as serviceCall,
1464
+ zt as ue,
1465
+ wt as we
1466
+ };