@versini/sassysaint 0.0.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.
@@ -0,0 +1,2749 @@
1
+ import { jsx as c, jsxs as S, Fragment as q } from "react/jsx-runtime";
2
+ import * as F from "react";
3
+ import K, { createContext as It, useRef as B, useState as U, useCallback as Me, useEffect as z, useContext as Xe, useMemo as xt, useId as Nt, useReducer as Ct, useLayoutEffect as Rt, lazy as Ze, Suspense as et } from "react";
4
+ import g from "clsx";
5
+ var Ot = Object.defineProperty, Dt = (e, t, r) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ye = (e, t, r) => (Dt(e, typeof t != "symbol" ? t + "" : t, r), r);
6
+ /*!
7
+ @versini/auth-provider v5.0.5
8
+ © 2024 gizmette.com
9
+ */
10
+ try {
11
+ window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
12
+ version: "5.0.5",
13
+ buildTime: "07/05/2024 02:22 PM EDT",
14
+ homepage: "https://github.com/aversini/auth-client",
15
+ license: "MIT"
16
+ });
17
+ } catch {
18
+ }
19
+ /*!
20
+ @versini/auth-common v2.10.1
21
+ © 2024 gizmette.com
22
+ */
23
+ try {
24
+ window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
25
+ version: "2.10.1",
26
+ buildTime: "07/05/2024 02:22 PM EDT",
27
+ homepage: "https://github.com/aversini/auth-client",
28
+ license: "MIT"
29
+ });
30
+ } catch {
31
+ }
32
+ const Q = {
33
+ ID_TOKEN: "id_token",
34
+ ACCESS_TOKEN: "token",
35
+ ID_AND_ACCESS_TOKEN: "id_token token",
36
+ CODE: "code",
37
+ REFRESH_TOKEN: "refresh_token"
38
+ }, Mt = {
39
+ CLIENT_ID: "X-Auth-ClientId"
40
+ }, N = {
41
+ ALG: "RS256",
42
+ USER_ID_KEY: "sub",
43
+ TOKEN_ID_KEY: "__raw",
44
+ NONCE_KEY: "_nonce",
45
+ USERNAME_KEY: "username",
46
+ ISSUER: "gizmette.com"
47
+ }, $t = `-----BEGIN PUBLIC KEY-----
48
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
49
+ w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
50
+ i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
51
+ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
52
+ l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
53
+ sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
54
+ awIDAQAB
55
+ -----END PUBLIC KEY-----`, he = {
56
+ AUTHENTICATE: "authenticate",
57
+ CODE: "code",
58
+ LOGOUT: "logout"
59
+ }, pe = crypto, tt = (e) => e instanceof CryptoKey, Z = new TextEncoder(), ge = new TextDecoder();
60
+ function Lt(...e) {
61
+ const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
62
+ let a = 0;
63
+ for (const n of e)
64
+ r.set(n, a), a += n.length;
65
+ return r;
66
+ }
67
+ const Pt = (e) => {
68
+ const t = atob(e), r = new Uint8Array(t.length);
69
+ for (let a = 0; a < t.length; a++)
70
+ r[a] = t.charCodeAt(a);
71
+ return r;
72
+ }, le = (e) => {
73
+ let t = e;
74
+ t instanceof Uint8Array && (t = ge.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
75
+ try {
76
+ return Pt(t);
77
+ } catch {
78
+ throw new TypeError("The input to be decoded is not correctly encoded.");
79
+ }
80
+ };
81
+ let W = class extends Error {
82
+ static get code() {
83
+ return "ERR_JOSE_GENERIC";
84
+ }
85
+ constructor(t) {
86
+ var r;
87
+ super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
88
+ }
89
+ }, $ = class extends W {
90
+ static get code() {
91
+ return "ERR_JWT_CLAIM_VALIDATION_FAILED";
92
+ }
93
+ constructor(t, r, a = "unspecified", n = "unspecified") {
94
+ super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
95
+ }
96
+ };
97
+ class $e extends W {
98
+ static get code() {
99
+ return "ERR_JWT_EXPIRED";
100
+ }
101
+ constructor(t, r, a = "unspecified", n = "unspecified") {
102
+ super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
103
+ }
104
+ }
105
+ class Ut extends W {
106
+ constructor() {
107
+ super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
108
+ }
109
+ static get code() {
110
+ return "ERR_JOSE_ALG_NOT_ALLOWED";
111
+ }
112
+ }
113
+ let H = class extends W {
114
+ constructor() {
115
+ super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
116
+ }
117
+ static get code() {
118
+ return "ERR_JOSE_NOT_SUPPORTED";
119
+ }
120
+ }, k = class extends W {
121
+ constructor() {
122
+ super(...arguments), this.code = "ERR_JWS_INVALID";
123
+ }
124
+ static get code() {
125
+ return "ERR_JWS_INVALID";
126
+ }
127
+ };
128
+ class rt extends W {
129
+ constructor() {
130
+ super(...arguments), this.code = "ERR_JWT_INVALID";
131
+ }
132
+ static get code() {
133
+ return "ERR_JWT_INVALID";
134
+ }
135
+ }
136
+ class Ht extends W {
137
+ constructor() {
138
+ super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
139
+ }
140
+ static get code() {
141
+ return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
142
+ }
143
+ }
144
+ function L(e, t = "algorithm.name") {
145
+ return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
146
+ }
147
+ function ee(e, t) {
148
+ return e.name === t;
149
+ }
150
+ function be(e) {
151
+ return parseInt(e.name.slice(4), 10);
152
+ }
153
+ function Kt(e) {
154
+ switch (e) {
155
+ case "ES256":
156
+ return "P-256";
157
+ case "ES384":
158
+ return "P-384";
159
+ case "ES512":
160
+ return "P-521";
161
+ default:
162
+ throw new Error("unreachable");
163
+ }
164
+ }
165
+ function Bt(e, t) {
166
+ if (t.length && !t.some((r) => e.usages.includes(r))) {
167
+ let r = "CryptoKey does not support this operation, its usages must include ";
168
+ if (t.length > 2) {
169
+ const a = t.pop();
170
+ r += `one of ${t.join(", ")}, or ${a}.`;
171
+ } else
172
+ t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
173
+ throw new TypeError(r);
174
+ }
175
+ }
176
+ function Wt(e, t, ...r) {
177
+ switch (t) {
178
+ case "HS256":
179
+ case "HS384":
180
+ case "HS512": {
181
+ if (!ee(e.algorithm, "HMAC"))
182
+ throw L("HMAC");
183
+ const a = parseInt(t.slice(2), 10);
184
+ if (be(e.algorithm.hash) !== a)
185
+ throw L(`SHA-${a}`, "algorithm.hash");
186
+ break;
187
+ }
188
+ case "RS256":
189
+ case "RS384":
190
+ case "RS512": {
191
+ if (!ee(e.algorithm, "RSASSA-PKCS1-v1_5"))
192
+ throw L("RSASSA-PKCS1-v1_5");
193
+ const a = parseInt(t.slice(2), 10);
194
+ if (be(e.algorithm.hash) !== a)
195
+ throw L(`SHA-${a}`, "algorithm.hash");
196
+ break;
197
+ }
198
+ case "PS256":
199
+ case "PS384":
200
+ case "PS512": {
201
+ if (!ee(e.algorithm, "RSA-PSS"))
202
+ throw L("RSA-PSS");
203
+ const a = parseInt(t.slice(2), 10);
204
+ if (be(e.algorithm.hash) !== a)
205
+ throw L(`SHA-${a}`, "algorithm.hash");
206
+ break;
207
+ }
208
+ case "EdDSA": {
209
+ if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
210
+ throw L("Ed25519 or Ed448");
211
+ break;
212
+ }
213
+ case "ES256":
214
+ case "ES384":
215
+ case "ES512": {
216
+ if (!ee(e.algorithm, "ECDSA"))
217
+ throw L("ECDSA");
218
+ const a = Kt(t);
219
+ if (e.algorithm.namedCurve !== a)
220
+ throw L(a, "algorithm.namedCurve");
221
+ break;
222
+ }
223
+ default:
224
+ throw new TypeError("CryptoKey does not support this operation");
225
+ }
226
+ Bt(e, r);
227
+ }
228
+ function at(e, t, ...r) {
229
+ var a;
230
+ if (r.length > 2) {
231
+ const n = r.pop();
232
+ e += `one of type ${r.join(", ")}, or ${n}.`;
233
+ } else
234
+ r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
235
+ return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (a = t.constructor) != null && a.name && (e += ` Received an instance of ${t.constructor.name}`), e;
236
+ }
237
+ const Le = (e, ...t) => at("Key must be ", e, ...t);
238
+ function nt(e, t, ...r) {
239
+ return at(`Key for the ${e} algorithm must be `, t, ...r);
240
+ }
241
+ const ot = (e) => tt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", ue = ["CryptoKey"], jt = (...e) => {
242
+ const t = e.filter(Boolean);
243
+ if (t.length === 0 || t.length === 1)
244
+ return !0;
245
+ let r;
246
+ for (const a of t) {
247
+ const n = Object.keys(a);
248
+ if (!r || r.size === 0) {
249
+ r = new Set(n);
250
+ continue;
251
+ }
252
+ for (const o of n) {
253
+ if (r.has(o))
254
+ return !1;
255
+ r.add(o);
256
+ }
257
+ }
258
+ return !0;
259
+ };
260
+ function Gt(e) {
261
+ return typeof e == "object" && e !== null;
262
+ }
263
+ function _e(e) {
264
+ if (!Gt(e) || Object.prototype.toString.call(e) !== "[object Object]")
265
+ return !1;
266
+ if (Object.getPrototypeOf(e) === null)
267
+ return !0;
268
+ let t = e;
269
+ for (; Object.getPrototypeOf(t) !== null; )
270
+ t = Object.getPrototypeOf(t);
271
+ return Object.getPrototypeOf(e) === t;
272
+ }
273
+ const Vt = (e, t) => {
274
+ if (e.startsWith("RS") || e.startsWith("PS")) {
275
+ const { modulusLength: r } = t.algorithm;
276
+ if (typeof r != "number" || r < 2048)
277
+ throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
278
+ }
279
+ };
280
+ function Jt(e) {
281
+ let t, r;
282
+ switch (e.kty) {
283
+ case "RSA": {
284
+ switch (e.alg) {
285
+ case "PS256":
286
+ case "PS384":
287
+ case "PS512":
288
+ t = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
289
+ break;
290
+ case "RS256":
291
+ case "RS384":
292
+ case "RS512":
293
+ t = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
294
+ break;
295
+ case "RSA-OAEP":
296
+ case "RSA-OAEP-256":
297
+ case "RSA-OAEP-384":
298
+ case "RSA-OAEP-512":
299
+ t = {
300
+ name: "RSA-OAEP",
301
+ hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
302
+ }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
303
+ break;
304
+ default:
305
+ throw new H('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
306
+ }
307
+ break;
308
+ }
309
+ case "EC": {
310
+ switch (e.alg) {
311
+ case "ES256":
312
+ t = { name: "ECDSA", namedCurve: "P-256" }, r = e.d ? ["sign"] : ["verify"];
313
+ break;
314
+ case "ES384":
315
+ t = { name: "ECDSA", namedCurve: "P-384" }, r = e.d ? ["sign"] : ["verify"];
316
+ break;
317
+ case "ES512":
318
+ t = { name: "ECDSA", namedCurve: "P-521" }, r = e.d ? ["sign"] : ["verify"];
319
+ break;
320
+ case "ECDH-ES":
321
+ case "ECDH-ES+A128KW":
322
+ case "ECDH-ES+A192KW":
323
+ case "ECDH-ES+A256KW":
324
+ t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
325
+ break;
326
+ default:
327
+ throw new H('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
328
+ }
329
+ break;
330
+ }
331
+ case "OKP": {
332
+ switch (e.alg) {
333
+ case "EdDSA":
334
+ t = { name: e.crv }, r = e.d ? ["sign"] : ["verify"];
335
+ break;
336
+ case "ECDH-ES":
337
+ case "ECDH-ES+A128KW":
338
+ case "ECDH-ES+A192KW":
339
+ case "ECDH-ES+A256KW":
340
+ t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
341
+ break;
342
+ default:
343
+ throw new H('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
344
+ }
345
+ break;
346
+ }
347
+ default:
348
+ throw new H('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
349
+ }
350
+ return { algorithm: t, keyUsages: r };
351
+ }
352
+ const Ft = async (e) => {
353
+ if (!e.alg)
354
+ throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
355
+ const { algorithm: t, keyUsages: r } = Jt(e), a = [
356
+ t,
357
+ e.ext ?? !1,
358
+ e.key_ops ?? r
359
+ ], n = { ...e };
360
+ return delete n.alg, delete n.use, pe.subtle.importKey("jwk", n, ...a);
361
+ }, st = (e) => le(e);
362
+ let we, Ee;
363
+ const it = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", ct = async (e, t, r, a) => {
364
+ let n = e.get(t);
365
+ if (n != null && n[a])
366
+ return n[a];
367
+ const o = await Ft({ ...r, alg: a });
368
+ return n ? n[a] = o : e.set(t, { [a]: o }), o;
369
+ }, zt = (e, t) => {
370
+ if (it(e)) {
371
+ let r = e.export({ format: "jwk" });
372
+ return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? st(r.k) : (Ee || (Ee = /* @__PURE__ */ new WeakMap()), ct(Ee, e, r, t));
373
+ }
374
+ return e;
375
+ }, Yt = (e, t) => {
376
+ if (it(e)) {
377
+ let r = e.export({ format: "jwk" });
378
+ return r.k ? st(r.k) : (we || (we = /* @__PURE__ */ new WeakMap()), ct(we, e, r, t));
379
+ }
380
+ return e;
381
+ }, qt = { normalizePublicKey: zt, normalizePrivateKey: Yt }, P = (e, t, r = 0) => {
382
+ r === 0 && (t.unshift(t.length), t.unshift(6));
383
+ const a = e.indexOf(t[0], r);
384
+ if (a === -1)
385
+ return !1;
386
+ const n = e.subarray(a, a + t.length);
387
+ return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || P(e, t, a + 1);
388
+ }, Pe = (e) => {
389
+ switch (!0) {
390
+ case P(e, [42, 134, 72, 206, 61, 3, 1, 7]):
391
+ return "P-256";
392
+ case P(e, [43, 129, 4, 0, 34]):
393
+ return "P-384";
394
+ case P(e, [43, 129, 4, 0, 35]):
395
+ return "P-521";
396
+ case P(e, [43, 101, 110]):
397
+ return "X25519";
398
+ case P(e, [43, 101, 111]):
399
+ return "X448";
400
+ case P(e, [43, 101, 112]):
401
+ return "Ed25519";
402
+ case P(e, [43, 101, 113]):
403
+ return "Ed448";
404
+ default:
405
+ throw new H("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
406
+ }
407
+ }, Qt = async (e, t, r, a, n) => {
408
+ let o, s;
409
+ const i = new Uint8Array(atob(r.replace(e, "")).split("").map((l) => l.charCodeAt(0)));
410
+ switch (a) {
411
+ case "PS256":
412
+ case "PS384":
413
+ case "PS512":
414
+ o = { name: "RSA-PSS", hash: `SHA-${a.slice(-3)}` }, s = ["verify"];
415
+ break;
416
+ case "RS256":
417
+ case "RS384":
418
+ case "RS512":
419
+ o = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${a.slice(-3)}` }, s = ["verify"];
420
+ break;
421
+ case "RSA-OAEP":
422
+ case "RSA-OAEP-256":
423
+ case "RSA-OAEP-384":
424
+ case "RSA-OAEP-512":
425
+ o = {
426
+ name: "RSA-OAEP",
427
+ hash: `SHA-${parseInt(a.slice(-3), 10) || 1}`
428
+ }, s = ["encrypt", "wrapKey"];
429
+ break;
430
+ case "ES256":
431
+ o = { name: "ECDSA", namedCurve: "P-256" }, s = ["verify"];
432
+ break;
433
+ case "ES384":
434
+ o = { name: "ECDSA", namedCurve: "P-384" }, s = ["verify"];
435
+ break;
436
+ case "ES512":
437
+ o = { name: "ECDSA", namedCurve: "P-521" }, s = ["verify"];
438
+ break;
439
+ case "ECDH-ES":
440
+ case "ECDH-ES+A128KW":
441
+ case "ECDH-ES+A192KW":
442
+ case "ECDH-ES+A256KW": {
443
+ const l = Pe(i);
444
+ o = l.startsWith("P-") ? { name: "ECDH", namedCurve: l } : { name: l }, s = [];
445
+ break;
446
+ }
447
+ case "EdDSA":
448
+ o = { name: Pe(i) }, s = ["verify"];
449
+ break;
450
+ default:
451
+ throw new H('Invalid or unsupported "alg" (Algorithm) value');
452
+ }
453
+ return pe.subtle.importKey(t, i, o, !1, s);
454
+ }, Xt = (e, t, r) => Qt(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
455
+ async function Zt(e, t, r) {
456
+ if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
457
+ throw new TypeError('"spki" must be SPKI formatted string');
458
+ return Xt(e, t);
459
+ }
460
+ const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], er = (e, t) => {
461
+ if (!(t instanceof Uint8Array)) {
462
+ if (!ot(t))
463
+ throw new TypeError(nt(e, t, ...ue, "Uint8Array"));
464
+ if (t.type !== "secret")
465
+ throw new TypeError(`${de(t)} instances for symmetric algorithms must be of type "secret"`);
466
+ }
467
+ }, tr = (e, t, r) => {
468
+ if (!ot(t))
469
+ throw new TypeError(nt(e, t, ...ue));
470
+ if (t.type === "secret")
471
+ throw new TypeError(`${de(t)} instances for asymmetric algorithms must not be of type "secret"`);
472
+ if (t.algorithm && r === "verify" && t.type === "private")
473
+ throw new TypeError(`${de(t)} instances for asymmetric algorithm verifying must be of type "public"`);
474
+ if (t.algorithm && r === "encrypt" && t.type === "private")
475
+ throw new TypeError(`${de(t)} instances for asymmetric algorithm encryption must be of type "public"`);
476
+ }, rr = (e, t, r) => {
477
+ e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? er(e, t) : tr(e, t, r);
478
+ };
479
+ function ar(e, t, r, a, n) {
480
+ if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
481
+ throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
482
+ if (!a || a.crit === void 0)
483
+ return /* @__PURE__ */ new Set();
484
+ if (!Array.isArray(a.crit) || a.crit.length === 0 || a.crit.some((s) => typeof s != "string" || s.length === 0))
485
+ throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
486
+ let o;
487
+ r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
488
+ for (const s of a.crit) {
489
+ if (!o.has(s))
490
+ throw new H(`Extension Header Parameter "${s}" is not recognized`);
491
+ if (n[s] === void 0)
492
+ throw new e(`Extension Header Parameter "${s}" is missing`);
493
+ if (o.get(s) && a[s] === void 0)
494
+ throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`);
495
+ }
496
+ return new Set(a.crit);
497
+ }
498
+ const nr = (e, t) => {
499
+ if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
500
+ throw new TypeError(`"${e}" option must be an array of strings`);
501
+ if (t)
502
+ return new Set(t);
503
+ };
504
+ function or(e, t) {
505
+ const r = `SHA-${e.slice(-3)}`;
506
+ switch (e) {
507
+ case "HS256":
508
+ case "HS384":
509
+ case "HS512":
510
+ return { hash: r, name: "HMAC" };
511
+ case "PS256":
512
+ case "PS384":
513
+ case "PS512":
514
+ return { hash: r, name: "RSA-PSS", saltLength: e.slice(-3) >> 3 };
515
+ case "RS256":
516
+ case "RS384":
517
+ case "RS512":
518
+ return { hash: r, name: "RSASSA-PKCS1-v1_5" };
519
+ case "ES256":
520
+ case "ES384":
521
+ case "ES512":
522
+ return { hash: r, name: "ECDSA", namedCurve: t.namedCurve };
523
+ case "EdDSA":
524
+ return { name: t.name };
525
+ default:
526
+ throw new H(`alg ${e} is not supported either by JOSE or your javascript runtime`);
527
+ }
528
+ }
529
+ async function sr(e, t, r) {
530
+ if (t = await qt.normalizePublicKey(t, e), tt(t))
531
+ return Wt(t, e, r), t;
532
+ if (t instanceof Uint8Array) {
533
+ if (!e.startsWith("HS"))
534
+ throw new TypeError(Le(t, ...ue));
535
+ return pe.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
536
+ }
537
+ throw new TypeError(Le(t, ...ue, "Uint8Array"));
538
+ }
539
+ const ir = async (e, t, r, a) => {
540
+ const n = await sr(e, t, "verify");
541
+ Vt(e, n);
542
+ const o = or(e, n.algorithm);
543
+ try {
544
+ return await pe.subtle.verify(o, n, r, a);
545
+ } catch {
546
+ return !1;
547
+ }
548
+ };
549
+ async function cr(e, t, r) {
550
+ if (!_e(e))
551
+ throw new k("Flattened JWS must be an object");
552
+ if (e.protected === void 0 && e.header === void 0)
553
+ throw new k('Flattened JWS must have either of the "protected" or "header" members');
554
+ if (e.protected !== void 0 && typeof e.protected != "string")
555
+ throw new k("JWS Protected Header incorrect type");
556
+ if (e.payload === void 0)
557
+ throw new k("JWS Payload missing");
558
+ if (typeof e.signature != "string")
559
+ throw new k("JWS Signature missing or incorrect type");
560
+ if (e.header !== void 0 && !_e(e.header))
561
+ throw new k("JWS Unprotected Header incorrect type");
562
+ let a = {};
563
+ if (e.protected)
564
+ try {
565
+ const f = le(e.protected);
566
+ a = JSON.parse(ge.decode(f));
567
+ } catch {
568
+ throw new k("JWS Protected Header is invalid");
569
+ }
570
+ if (!jt(a, e.header))
571
+ throw new k("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
572
+ const n = {
573
+ ...a,
574
+ ...e.header
575
+ }, o = ar(k, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
576
+ let s = !0;
577
+ if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
578
+ throw new k('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
579
+ const { alg: i } = n;
580
+ if (typeof i != "string" || !i)
581
+ throw new k('JWS "alg" (Algorithm) Header Parameter missing or invalid');
582
+ const l = r && nr("algorithms", r.algorithms);
583
+ if (l && !l.has(i))
584
+ throw new Ut('"alg" (Algorithm) Header Parameter value not allowed');
585
+ if (s) {
586
+ if (typeof e.payload != "string")
587
+ throw new k("JWS Payload must be a string");
588
+ } else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
589
+ throw new k("JWS Payload must be a string or an Uint8Array instance");
590
+ let u = !1;
591
+ typeof t == "function" && (t = await t(a, e), u = !0), rr(i, t, "verify");
592
+ const p = Lt(Z.encode(e.protected ?? ""), Z.encode("."), typeof e.payload == "string" ? Z.encode(e.payload) : e.payload);
593
+ let d;
594
+ try {
595
+ d = le(e.signature);
596
+ } catch {
597
+ throw new k("Failed to base64url decode the signature");
598
+ }
599
+ if (!await ir(i, t, d, p))
600
+ throw new Ht();
601
+ let m;
602
+ if (s)
603
+ try {
604
+ m = le(e.payload);
605
+ } catch {
606
+ throw new k("Failed to base64url decode the payload");
607
+ }
608
+ else
609
+ typeof e.payload == "string" ? m = Z.encode(e.payload) : m = e.payload;
610
+ const h = { payload: m };
611
+ return e.protected !== void 0 && (h.protectedHeader = a), e.header !== void 0 && (h.unprotectedHeader = e.header), u ? { ...h, key: t } : h;
612
+ }
613
+ async function lr(e, t, r) {
614
+ if (e instanceof Uint8Array && (e = ge.decode(e)), typeof e != "string")
615
+ throw new k("Compact JWS must be a string or Uint8Array");
616
+ const { 0: a, 1: n, 2: o, length: s } = e.split(".");
617
+ if (s !== 3)
618
+ throw new k("Invalid Compact JWS");
619
+ const i = await cr({ payload: n, protected: a, signature: o }, t, r), l = { payload: i.payload, protectedHeader: i.protectedHeader };
620
+ return typeof t == "function" ? { ...l, key: i.key } : l;
621
+ }
622
+ const dr = (e) => Math.floor(e.getTime() / 1e3), lt = 60, dt = lt * 60, Ie = dt * 24, ur = Ie * 7, mr = Ie * 365.25, hr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, Ue = (e) => {
623
+ const t = hr.exec(e);
624
+ if (!t || t[4] && t[1])
625
+ throw new TypeError("Invalid time period format");
626
+ const r = parseFloat(t[2]), a = t[3].toLowerCase();
627
+ let n;
628
+ switch (a) {
629
+ case "sec":
630
+ case "secs":
631
+ case "second":
632
+ case "seconds":
633
+ case "s":
634
+ n = Math.round(r);
635
+ break;
636
+ case "minute":
637
+ case "minutes":
638
+ case "min":
639
+ case "mins":
640
+ case "m":
641
+ n = Math.round(r * lt);
642
+ break;
643
+ case "hour":
644
+ case "hours":
645
+ case "hr":
646
+ case "hrs":
647
+ case "h":
648
+ n = Math.round(r * dt);
649
+ break;
650
+ case "day":
651
+ case "days":
652
+ case "d":
653
+ n = Math.round(r * Ie);
654
+ break;
655
+ case "week":
656
+ case "weeks":
657
+ case "w":
658
+ n = Math.round(r * ur);
659
+ break;
660
+ default:
661
+ n = Math.round(r * mr);
662
+ break;
663
+ }
664
+ return t[1] === "-" || t[4] === "ago" ? -n : n;
665
+ }, He = (e) => e.toLowerCase().replace(/^application\//, ""), pr = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, gr = (e, t, r = {}) => {
666
+ let a;
667
+ try {
668
+ a = JSON.parse(ge.decode(t));
669
+ } catch {
670
+ }
671
+ if (!_e(a))
672
+ throw new rt("JWT Claims Set must be a top-level JSON object");
673
+ const { typ: n } = r;
674
+ if (n && (typeof e.typ != "string" || He(e.typ) !== He(n)))
675
+ throw new $('unexpected "typ" JWT header value', a, "typ", "check_failed");
676
+ const { requiredClaims: o = [], issuer: s, subject: i, audience: l, maxTokenAge: u } = r, p = [...o];
677
+ u !== void 0 && p.push("iat"), l !== void 0 && p.push("aud"), i !== void 0 && p.push("sub"), s !== void 0 && p.push("iss");
678
+ for (const f of new Set(p.reverse()))
679
+ if (!(f in a))
680
+ throw new $(`missing required "${f}" claim`, a, f, "missing");
681
+ if (s && !(Array.isArray(s) ? s : [s]).includes(a.iss))
682
+ throw new $('unexpected "iss" claim value', a, "iss", "check_failed");
683
+ if (i && a.sub !== i)
684
+ throw new $('unexpected "sub" claim value', a, "sub", "check_failed");
685
+ if (l && !pr(a.aud, typeof l == "string" ? [l] : l))
686
+ throw new $('unexpected "aud" claim value', a, "aud", "check_failed");
687
+ let d;
688
+ switch (typeof r.clockTolerance) {
689
+ case "string":
690
+ d = Ue(r.clockTolerance);
691
+ break;
692
+ case "number":
693
+ d = r.clockTolerance;
694
+ break;
695
+ case "undefined":
696
+ d = 0;
697
+ break;
698
+ default:
699
+ throw new TypeError("Invalid clockTolerance option type");
700
+ }
701
+ const { currentDate: m } = r, h = dr(m || /* @__PURE__ */ new Date());
702
+ if ((a.iat !== void 0 || u) && typeof a.iat != "number")
703
+ throw new $('"iat" claim must be a number', a, "iat", "invalid");
704
+ if (a.nbf !== void 0) {
705
+ if (typeof a.nbf != "number")
706
+ throw new $('"nbf" claim must be a number', a, "nbf", "invalid");
707
+ if (a.nbf > h + d)
708
+ throw new $('"nbf" claim timestamp check failed', a, "nbf", "check_failed");
709
+ }
710
+ if (a.exp !== void 0) {
711
+ if (typeof a.exp != "number")
712
+ throw new $('"exp" claim must be a number', a, "exp", "invalid");
713
+ if (a.exp <= h - d)
714
+ throw new $e('"exp" claim timestamp check failed', a, "exp", "check_failed");
715
+ }
716
+ if (u) {
717
+ const f = h - a.iat, b = typeof u == "number" ? u : Ue(u);
718
+ if (f - d > b)
719
+ throw new $e('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
720
+ if (f < 0 - d)
721
+ throw new $('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
722
+ }
723
+ return a;
724
+ };
725
+ async function fr(e, t, r) {
726
+ var a;
727
+ const n = await lr(e, t, r);
728
+ if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
729
+ throw new rt("JWTs MUST NOT use unencoded payload");
730
+ const o = { payload: gr(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
731
+ return typeof t == "function" ? { ...o, key: n.key } : o;
732
+ }
733
+ const Y = async (e) => {
734
+ try {
735
+ const t = N.ALG, r = await Zt($t, t);
736
+ return await fr(e, r, {
737
+ issuer: N.ISSUER
738
+ });
739
+ } catch {
740
+ return;
741
+ }
742
+ };
743
+ var E = [];
744
+ for (var ve = 0; ve < 256; ++ve)
745
+ E.push((ve + 256).toString(16).slice(1));
746
+ function yr(e, t = 0) {
747
+ return (E[e[t + 0]] + E[e[t + 1]] + E[e[t + 2]] + E[e[t + 3]] + "-" + E[e[t + 4]] + E[e[t + 5]] + "-" + E[e[t + 6]] + E[e[t + 7]] + "-" + E[e[t + 8]] + E[e[t + 9]] + "-" + E[e[t + 10]] + E[e[t + 11]] + E[e[t + 12]] + E[e[t + 13]] + E[e[t + 14]] + E[e[t + 15]]).toLowerCase();
748
+ }
749
+ var te, br = new Uint8Array(16);
750
+ function wr() {
751
+ if (!te && (te = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !te))
752
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
753
+ return te(br);
754
+ }
755
+ var Er = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
756
+ const Ke = {
757
+ randomUUID: Er
758
+ };
759
+ function Be(e, t, r) {
760
+ if (Ke.randomUUID && !t && !e)
761
+ return Ke.randomUUID();
762
+ e = e || {};
763
+ var a = e.random || (e.rng || wr)();
764
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, yr(a);
765
+ }
766
+ const We = globalThis.crypto, vr = (e) => `${Be()}${Be()}`.slice(0, e), kr = (e) => btoa(
767
+ [...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
768
+ );
769
+ async function Sr(e) {
770
+ if (!We.subtle)
771
+ throw new Error(
772
+ "crypto.subtle is available only in secure contexts (HTTPS)."
773
+ );
774
+ const t = new TextEncoder().encode(e), r = await We.subtle.digest("SHA-256", t);
775
+ return kr(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
776
+ }
777
+ async function Tr(e) {
778
+ const t = vr(43), r = await Sr(t);
779
+ return {
780
+ code_verifier: t,
781
+ code_challenge: r
782
+ };
783
+ }
784
+ function ut(e, t) {
785
+ window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
786
+ }
787
+ const je = (e, t) => {
788
+ const r = JSON.stringify(
789
+ typeof t == "function" ? t() : t
790
+ );
791
+ window.localStorage.setItem(e, r), ut(e, r);
792
+ }, Ar = (e) => {
793
+ window.localStorage.removeItem(e), ut(e, null);
794
+ }, Ge = (e) => window.localStorage.getItem(e), _r = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
795
+ function re({
796
+ key: e,
797
+ initialValue: t
798
+ }) {
799
+ const r = () => Ge(e), a = F.useSyncExternalStore(
800
+ _r,
801
+ r
802
+ ), n = F.useCallback(
803
+ (i) => {
804
+ try {
805
+ const l = typeof i == "function" ? i(JSON.parse(a)) : i;
806
+ l == null ? Ar(e) : je(e, l);
807
+ } catch (l) {
808
+ console.warn(l);
809
+ }
810
+ },
811
+ [e, a]
812
+ ), o = F.useCallback(() => {
813
+ n(t);
814
+ }, [t, n]), s = F.useCallback(() => {
815
+ n(null);
816
+ }, [n]);
817
+ return F.useEffect(() => {
818
+ try {
819
+ Ge(e) === null && typeof t < "u" && je(e, t);
820
+ } catch (i) {
821
+ console.warn(i);
822
+ }
823
+ }, [e, t]), [a ? JSON.parse(a) : null, n, o, s];
824
+ }
825
+ var v = [];
826
+ for (var ke = 0; ke < 256; ++ke)
827
+ v.push((ke + 256).toString(16).slice(1));
828
+ function Ir(e, t = 0) {
829
+ return (v[e[t + 0]] + v[e[t + 1]] + v[e[t + 2]] + v[e[t + 3]] + "-" + v[e[t + 4]] + v[e[t + 5]] + "-" + v[e[t + 6]] + v[e[t + 7]] + "-" + v[e[t + 8]] + v[e[t + 9]] + "-" + v[e[t + 10]] + v[e[t + 11]] + v[e[t + 12]] + v[e[t + 13]] + v[e[t + 14]] + v[e[t + 15]]).toLowerCase();
830
+ }
831
+ var ae, xr = new Uint8Array(16);
832
+ function Nr() {
833
+ if (!ae && (ae = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ae))
834
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
835
+ return ae(xr);
836
+ }
837
+ var Cr = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
838
+ const Ve = {
839
+ randomUUID: Cr
840
+ };
841
+ function Rr(e, t, r) {
842
+ if (Ve.randomUUID && !t && !e)
843
+ return Ve.randomUUID();
844
+ e = e || {};
845
+ var a = e.random || (e.rng || Nr)();
846
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Ir(a);
847
+ }
848
+ const ne = "Oops! It looks like your session has expired. For your security, please log in again to continue.", Or = "Your session has been successfully terminated.", Je = "Login failed. Please try again.", Se = "Error getting access token, please re-authenticate.", Dr = "You forgot to wrap your component in <AuthProvider>.", Fe = {
849
+ dev: "https://auth.gizmette.local.com:3003",
850
+ prod: "https://mylogin.gizmette.com"
851
+ }, oe = "@@auth@@", Mr = process.env.NODE_ENV === "production", $r = !Mr, fe = async ({
852
+ type: e,
853
+ clientId: t,
854
+ params: r = {}
855
+ }) => {
856
+ try {
857
+ const a = await fetch(
858
+ $r ? `${Fe.dev}/${e}` : `${Fe.prod}/${e}`,
859
+ {
860
+ credentials: "include",
861
+ method: "POST",
862
+ headers: {
863
+ "Content-Type": "application/json",
864
+ [Mt.CLIENT_ID]: `${t}`
865
+ },
866
+ body: JSON.stringify(r)
867
+ }
868
+ );
869
+ if (a.status !== 200)
870
+ return { status: a.status, data: [] };
871
+ const { data: n, errors: o } = await a.json();
872
+ return {
873
+ status: a.status,
874
+ data: n,
875
+ errors: o
876
+ };
877
+ } catch (a) {
878
+ return console.error(a), { status: 500, data: [] };
879
+ }
880
+ }, Lr = async ({
881
+ idToken: e,
882
+ accessToken: t,
883
+ refreshToken: r,
884
+ clientId: a
885
+ }) => {
886
+ try {
887
+ return {
888
+ status: (await fe({
889
+ type: he.LOGOUT,
890
+ clientId: a,
891
+ params: {
892
+ idToken: e,
893
+ accessToken: t,
894
+ refreshToken: r
895
+ }
896
+ })).status === 200
897
+ };
898
+ } catch {
899
+ return {
900
+ status: !1
901
+ };
902
+ }
903
+ }, ze = async ({
904
+ username: e,
905
+ password: t,
906
+ clientId: r,
907
+ nonce: a,
908
+ type: n,
909
+ sessionExpiration: o,
910
+ code: s,
911
+ code_verifier: i
912
+ }) => {
913
+ try {
914
+ const l = await fe({
915
+ type: he.AUTHENTICATE,
916
+ clientId: r,
917
+ params: {
918
+ type: n || Q.ID_AND_ACCESS_TOKEN,
919
+ username: e,
920
+ password: t,
921
+ sessionExpiration: o,
922
+ nonce: a,
923
+ code: s,
924
+ code_verifier: i
925
+ }
926
+ }), u = await Y(l.data.idToken);
927
+ return u && u.payload[N.USER_ID_KEY] !== "" && u.payload[N.NONCE_KEY] === a ? {
928
+ idToken: l.data.idToken,
929
+ accessToken: l.data.accessToken,
930
+ refreshToken: l.data.refreshToken,
931
+ userId: u.payload[N.USER_ID_KEY],
932
+ status: !0
933
+ } : {
934
+ status: !1
935
+ };
936
+ } catch {
937
+ return {
938
+ status: !1
939
+ };
940
+ }
941
+ }, Pr = async ({
942
+ nonce: e,
943
+ clientId: t,
944
+ code_challenge: r
945
+ }) => {
946
+ try {
947
+ const a = await fe({
948
+ type: he.CODE,
949
+ clientId: t,
950
+ params: {
951
+ type: Q.CODE,
952
+ nonce: e,
953
+ code_challenge: r
954
+ }
955
+ });
956
+ return a.data.code ? {
957
+ status: !0,
958
+ code: a.data.code
959
+ } : {
960
+ status: !1
961
+ };
962
+ } catch {
963
+ return {
964
+ status: !1
965
+ };
966
+ }
967
+ }, Ur = async ({
968
+ clientId: e,
969
+ userId: t,
970
+ nonce: r,
971
+ refreshToken: a,
972
+ accessToken: n
973
+ }) => {
974
+ try {
975
+ const o = await fe({
976
+ type: he.AUTHENTICATE,
977
+ clientId: e,
978
+ params: {
979
+ type: Q.REFRESH_TOKEN,
980
+ userId: t,
981
+ nonce: r,
982
+ refreshToken: a,
983
+ accessToken: n
984
+ }
985
+ }), s = await Y(o.data.accessToken);
986
+ return s && s.payload[N.USER_ID_KEY] !== "" && s.payload[N.NONCE_KEY] === r ? {
987
+ accessToken: o.data.accessToken,
988
+ refreshToken: o.data.refreshToken,
989
+ userId: s.payload[N.USER_ID_KEY],
990
+ status: !0
991
+ } : {
992
+ status: !1
993
+ };
994
+ } catch {
995
+ return {
996
+ status: !1
997
+ };
998
+ }
999
+ };
1000
+ class Hr {
1001
+ constructor(t = null, r = null) {
1002
+ ye(this, "refreshTokenPromise", null), ye(this, "accessToken"), ye(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1003
+ }
1004
+ async refreshtoken({
1005
+ clientId: t,
1006
+ userId: r,
1007
+ nonce: a
1008
+ }) {
1009
+ this.refreshTokenPromise || (this.refreshTokenPromise = this._refreshToken({
1010
+ clientId: t,
1011
+ userId: r,
1012
+ nonce: a
1013
+ }));
1014
+ try {
1015
+ return await this.refreshTokenPromise;
1016
+ } finally {
1017
+ this.refreshTokenPromise = null;
1018
+ }
1019
+ }
1020
+ async _refreshToken({
1021
+ clientId: t,
1022
+ userId: r,
1023
+ nonce: a
1024
+ }) {
1025
+ const n = await Y(this.refreshToken);
1026
+ if (n && n.payload[N.USER_ID_KEY] !== "") {
1027
+ const o = await Ur({
1028
+ clientId: t,
1029
+ userId: r,
1030
+ nonce: a,
1031
+ refreshToken: this.refreshToken,
1032
+ accessToken: this.accessToken
1033
+ });
1034
+ return o.status ? (this.accessToken = o.accessToken, this.refreshToken = o.refreshToken, {
1035
+ status: "success",
1036
+ newAccessToken: o.accessToken,
1037
+ newRefreshToken: o.refreshToken
1038
+ }) : {
1039
+ status: "failure"
1040
+ };
1041
+ } else
1042
+ return {
1043
+ status: "failure"
1044
+ };
1045
+ }
1046
+ }
1047
+ const se = () => {
1048
+ throw new Error(Dr);
1049
+ }, mt = It({
1050
+ isAuthenticated: !1,
1051
+ isLoading: !1,
1052
+ login: se,
1053
+ logout: se,
1054
+ getAccessToken: se,
1055
+ getIdToken: se,
1056
+ logoutReason: ""
1057
+ }), Kr = ({
1058
+ children: e,
1059
+ sessionExpiration: t,
1060
+ clientId: r
1061
+ }) => {
1062
+ const a = B(!1), [n, o, , s] = re({
1063
+ key: `${oe}::${r}::@@user@@`
1064
+ }), [i, l, , u] = re({
1065
+ key: `${oe}::${r}::@@access@@`
1066
+ }), [p, d, , m] = re(
1067
+ {
1068
+ key: `${oe}::${r}::@@refresh@@`
1069
+ }
1070
+ ), [h, f, , b] = re({
1071
+ key: `${oe}::${r}::@@nonce@@`
1072
+ }), R = new Hr(i, p), [A, T] = U({
1073
+ isLoading: !0,
1074
+ isAuthenticated: !1,
1075
+ user: void 0,
1076
+ logoutReason: ""
1077
+ }), _ = Me(
1078
+ (y) => {
1079
+ console.warn(y), T({
1080
+ isLoading: !0,
1081
+ isAuthenticated: !1,
1082
+ user: void 0,
1083
+ logoutReason: y || ne
1084
+ }), s(), u(), m(), b();
1085
+ },
1086
+ [s, u, b, m]
1087
+ ), I = Me(
1088
+ async (y) => {
1089
+ _(y || ne), await Lr({
1090
+ idToken: n,
1091
+ accessToken: i,
1092
+ refreshToken: p,
1093
+ clientId: r
1094
+ }), T((M) => ({
1095
+ ...M,
1096
+ isLoading: !1
1097
+ }));
1098
+ },
1099
+ [i, r, n, _, p]
1100
+ );
1101
+ z(() => {
1102
+ if (!a.current)
1103
+ return A.isLoading && n !== null ? (async () => {
1104
+ try {
1105
+ const y = await Y(n);
1106
+ y && y.payload[N.USER_ID_KEY] !== "" ? T({
1107
+ isLoading: !1,
1108
+ isAuthenticated: !0,
1109
+ user: {
1110
+ userId: y.payload[N.USER_ID_KEY],
1111
+ username: y.payload[N.USERNAME_KEY]
1112
+ },
1113
+ logoutReason: ""
1114
+ }) : await I(ne);
1115
+ } catch {
1116
+ await I(ne);
1117
+ }
1118
+ })() : T((y) => ({
1119
+ ...y,
1120
+ isLoading: !1
1121
+ })), () => {
1122
+ a.current = !0;
1123
+ };
1124
+ }, [A.isLoading, n, I]);
1125
+ const j = async (y, M, D) => {
1126
+ const w = Rr();
1127
+ if (f(w), T((V) => ({
1128
+ ...V,
1129
+ isLoading: !0
1130
+ })), D === Q.CODE) {
1131
+ const { code_verifier: V, code_challenge: X } = await Tr(), De = await Pr({
1132
+ nonce: w,
1133
+ clientId: r,
1134
+ code_challenge: X
1135
+ });
1136
+ if (De.status) {
1137
+ const J = await ze({
1138
+ username: y,
1139
+ password: M,
1140
+ clientId: r,
1141
+ sessionExpiration: t,
1142
+ nonce: w,
1143
+ type: D,
1144
+ code: De.code,
1145
+ code_verifier: V
1146
+ });
1147
+ return J.status ? (o(J.idToken), l(J.accessToken), d(J.refreshToken), T({
1148
+ isLoading: !1,
1149
+ isAuthenticated: !0,
1150
+ user: {
1151
+ userId: J.userId,
1152
+ username: y
1153
+ },
1154
+ logoutReason: ""
1155
+ }), !0) : (_(Je), !1);
1156
+ }
1157
+ return !1;
1158
+ }
1159
+ const x = await ze({
1160
+ username: y,
1161
+ password: M,
1162
+ clientId: r,
1163
+ sessionExpiration: t,
1164
+ nonce: w,
1165
+ type: D
1166
+ });
1167
+ return x.status ? (o(x.idToken), l(x.accessToken), d(x.refreshToken), T({
1168
+ isLoading: !1,
1169
+ isAuthenticated: !0,
1170
+ user: {
1171
+ userId: x.userId,
1172
+ username: y
1173
+ }
1174
+ }), !0) : (_(Je), !1);
1175
+ }, C = async (y) => {
1176
+ y == null || y.preventDefault(), await I(Or);
1177
+ }, G = async () => {
1178
+ const { isAuthenticated: y, user: M } = A;
1179
+ try {
1180
+ if (y && M && M.userId) {
1181
+ if (i) {
1182
+ const w = await Y(i);
1183
+ if (w && w.payload[N.USER_ID_KEY] !== "")
1184
+ return i;
1185
+ }
1186
+ const D = await R.refreshtoken({
1187
+ clientId: r,
1188
+ userId: M.userId,
1189
+ nonce: h
1190
+ });
1191
+ return D.status && D.status === "success" ? (l(D.newAccessToken), d(D.newRefreshToken), D.newAccessToken) : (await I(Se), "");
1192
+ }
1193
+ return await I(Se), "";
1194
+ } catch {
1195
+ return await I(Se), "";
1196
+ }
1197
+ }, O = () => {
1198
+ if (A.isAuthenticated && n)
1199
+ return n;
1200
+ };
1201
+ return /* @__PURE__ */ c(
1202
+ mt.Provider,
1203
+ {
1204
+ value: { ...A, login: j, logout: C, getAccessToken: G, getIdToken: O },
1205
+ children: e
1206
+ }
1207
+ );
1208
+ }, xe = (e = mt) => Xe(e), en = "user", tn = "assistant", rn = "system", an = "internal", nn = "hidden", on = "I'm having trouble right now. Please try again later.", sn = "gpt-4", cn = 128e3, ln = "action-message", dn = "action-reset", un = "action-model", mn = "action-restore", hn = "action-location", pn = "action-streaming", gn = "action-search", fn = "action-sort", yn = "sassy-saint-", bn = "details", wn = "search", En = "sort", vn = "location", kn = "==stats==", Br = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Ne = (e) => {
1209
+ let t = "";
1210
+ if (typeof e == "number" || typeof e == "string")
1211
+ t = "m-" + e;
1212
+ else {
1213
+ const r = [];
1214
+ (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
1215
+ }
1216
+ return t;
1217
+ }, Sn = "av-bubble", Ye = "av-button", Tn = "av-card", Wr = "av-footer", jr = "av-main", An = "av-messagebox", _n = "av-panel", In = "av-spinner", ht = "icon", pt = "button", Gr = "link", Vr = ({
1218
+ type: e,
1219
+ size: t,
1220
+ labelRight: r,
1221
+ labelLeft: a,
1222
+ align: n
1223
+ }) => {
1224
+ const o = "text-sm font-medium max-h-8 py-0", s = "text-base font-medium max-h-9 py-1", i = "text-lg font-medium max-h-12 py-2";
1225
+ switch (e) {
1226
+ case pt:
1227
+ return g("px-4", {
1228
+ [o]: t === "small",
1229
+ [s]: t === "medium",
1230
+ [i]: t === "large"
1231
+ });
1232
+ case Gr:
1233
+ return g("px-4 text-center", {
1234
+ [o]: t === "small",
1235
+ [s]: t === "medium",
1236
+ [i]: t === "large"
1237
+ });
1238
+ case ht:
1239
+ return g("inline-flex items-center", {
1240
+ "justify-center": n === "center",
1241
+ "justify-start": n === "left",
1242
+ "justify-end": n === "right",
1243
+ "h-6 w-6 p-0": t === "small" && !(r || a),
1244
+ "h-6 px-4 text-sm font-medium": t === "small" && (r || a),
1245
+ "h-8 w-8 p-1": t === "medium" && !(r || a),
1246
+ "h-8 px-4 text-base font-medium": t === "medium" && (r || a),
1247
+ "h-12 w-12 p-2": t === "large" && !(r || a),
1248
+ "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
1249
+ });
1250
+ }
1251
+ }, Jr = ({
1252
+ mode: e,
1253
+ noBackground: t,
1254
+ noTruncate: r,
1255
+ variant: a
1256
+ }) => {
1257
+ if (t)
1258
+ return "not-prose rounded-full";
1259
+ if (a === "primary")
1260
+ return g("not-prose rounded-full", {
1261
+ truncate: !r,
1262
+ "bg-action-dark text-copy-light": e === "dark",
1263
+ "bg-action-light text-copy-lighter": e === "light",
1264
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "system",
1265
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
1266
+ });
1267
+ if (a === "secondary")
1268
+ return g("not-prose rounded-full", {
1269
+ truncate: !r,
1270
+ "bg-action-dark text-copy-light": e === "light",
1271
+ "bg-action-light text-copy-lighter": e === "dark",
1272
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "alt-system",
1273
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
1274
+ });
1275
+ if (a === "danger")
1276
+ return g("not-prose rounded-full", {
1277
+ truncate: !r,
1278
+ "bg-action-danger-dark text-copy-light": e === "dark",
1279
+ "bg-action-danger-light text-copy-lighter": e === "light",
1280
+ "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
1281
+ "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
1282
+ });
1283
+ }, Fr = ({
1284
+ mode: e,
1285
+ disabled: t,
1286
+ variant: r
1287
+ }) => {
1288
+ if (t)
1289
+ return "";
1290
+ if (r === "primary")
1291
+ return g("hover:text-copy-light-hover", {
1292
+ "hover:bg-action-dark-hover": e === "dark",
1293
+ "hover:bg-action-light-hover": e === "light",
1294
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
1295
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
1296
+ });
1297
+ if (r === "secondary")
1298
+ return g("hover:text-copy-light-hover", {
1299
+ "hover:bg-action-dark-hover": e === "light",
1300
+ "hover:bg-action-light-hover": e === "dark",
1301
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
1302
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
1303
+ });
1304
+ if (r === "danger")
1305
+ return g("hover:text-copy-light-hover", {
1306
+ "hover:bg-action-danger-dark-hover": e === "dark",
1307
+ "hover:bg-action-danger-light-hover": e === "light",
1308
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
1309
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
1310
+ });
1311
+ }, zr = ({
1312
+ mode: e,
1313
+ disabled: t,
1314
+ variant: r
1315
+ }) => {
1316
+ if (t)
1317
+ return "";
1318
+ if (r === "primary")
1319
+ return g("active:text-copy-light-active", {
1320
+ "active:bg-action-dark-active": e === "dark",
1321
+ "active:bg-action-light-active": e === "light",
1322
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
1323
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
1324
+ });
1325
+ if (r === "secondary")
1326
+ return g("active:text-copy-light-active", {
1327
+ "active:bg-action-dark-active": e === "light",
1328
+ "active:bg-action-light-active": e === "dark",
1329
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
1330
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
1331
+ });
1332
+ if (r === "danger")
1333
+ return g("active:text-copy-lighter-active", {
1334
+ "active:bg-action-danger-dark-active": e === "dark",
1335
+ "active:bg-action-danger-light-active": e === "light",
1336
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
1337
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
1338
+ });
1339
+ }, Yr = ({
1340
+ mode: e,
1341
+ noBorder: t,
1342
+ variant: r
1343
+ }) => {
1344
+ if (t)
1345
+ return "border border-transparent";
1346
+ if (r === "primary")
1347
+ return g("border", {
1348
+ "border-border-dark": e === "dark",
1349
+ "border-border-accent": e === "light",
1350
+ "border-border-dark dark:border-border-accent": e === "system",
1351
+ "border-border-accent dark:border-border-dark": e === "alt-system"
1352
+ });
1353
+ if (r === "secondary")
1354
+ return g("border", {
1355
+ "border-border-dark": e === "light",
1356
+ "border-border-accent": e === "dark",
1357
+ "border-border-dark dark:border-border-accent": e === "alt-system",
1358
+ "border-border-accent dark:border-border-dark": e === "system"
1359
+ });
1360
+ if (r === "danger")
1361
+ return g("border", {
1362
+ "border-border-danger-dark": e === "dark",
1363
+ "border-border-danger-medium": e === "light",
1364
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
1365
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
1366
+ });
1367
+ }, qr = ({ focusMode: e }) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
1368
+ "focus:outline-focus-dark": e === "dark",
1369
+ "focus:outline-focus-light": e === "light",
1370
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1371
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1372
+ }), gt = ({
1373
+ type: e,
1374
+ className: t,
1375
+ raw: r,
1376
+ mode: a,
1377
+ focusMode: n,
1378
+ disabled: o,
1379
+ fullWidth: s,
1380
+ size: i,
1381
+ noBorder: l,
1382
+ labelRight: u,
1383
+ labelLeft: p,
1384
+ spacing: d,
1385
+ noBackground: m,
1386
+ variant: h,
1387
+ noTruncate: f,
1388
+ align: b
1389
+ }) => (h || (h = "primary"), r ? g(Ye, t) : g(
1390
+ Ye,
1391
+ t,
1392
+ Ne(d),
1393
+ Jr({ mode: a, variant: h, noBackground: m, noTruncate: f }),
1394
+ Vr({ type: e, size: i, labelRight: u, labelLeft: p, align: b }),
1395
+ Yr({ mode: a, variant: h, noBorder: l }),
1396
+ qr({ focusMode: n }),
1397
+ Fr({ mode: a, variant: h, disabled: o }),
1398
+ zr({ mode: a, variant: h, disabled: o }),
1399
+ {
1400
+ "w-full": s,
1401
+ "disabled:cursor-not-allowed disabled:opacity-50": o
1402
+ }
1403
+ )), Qr = (e, t, r) => {
1404
+ var a;
1405
+ !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);
1406
+ }, Ce = K.forwardRef(
1407
+ (e, t) => {
1408
+ const { onClick: r, noInternalClick: a = !1, ...n } = e;
1409
+ return /* @__PURE__ */ c(
1410
+ "button",
1411
+ {
1412
+ ref: t,
1413
+ onClick: (o) => {
1414
+ Qr(o, a, r);
1415
+ },
1416
+ ...n
1417
+ }
1418
+ );
1419
+ }
1420
+ );
1421
+ Ce.displayName = "BaseButton";
1422
+ const ft = K.forwardRef(
1423
+ ({
1424
+ children: e,
1425
+ disabled: t = !1,
1426
+ mode: r = "system",
1427
+ focusMode: a = "system",
1428
+ fullWidth: n = !1,
1429
+ className: o,
1430
+ type: s = "button",
1431
+ raw: i = !1,
1432
+ noBorder: l = !1,
1433
+ "aria-label": u,
1434
+ label: p,
1435
+ size: d = "medium",
1436
+ labelRight: m,
1437
+ labelLeft: h,
1438
+ spacing: f,
1439
+ noBackground: b = !1,
1440
+ align: R = "center",
1441
+ ...A
1442
+ }, T) => {
1443
+ const _ = gt({
1444
+ type: ht,
1445
+ mode: r,
1446
+ focusMode: a,
1447
+ fullWidth: n,
1448
+ disabled: t,
1449
+ raw: i,
1450
+ className: o,
1451
+ noBorder: l,
1452
+ size: d,
1453
+ labelRight: m,
1454
+ labelLeft: h,
1455
+ spacing: f,
1456
+ noBackground: b,
1457
+ align: R
1458
+ }), I = g({
1459
+ "text-copy-accent-dark": r === "light" && !i,
1460
+ "text-copy-light": r === "dark" && !i,
1461
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
1462
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !i
1463
+ });
1464
+ return /* @__PURE__ */ S(
1465
+ Ce,
1466
+ {
1467
+ ref: T,
1468
+ className: _,
1469
+ disabled: t,
1470
+ type: s,
1471
+ "aria-label": u || p,
1472
+ ...A,
1473
+ children: [
1474
+ h && /* @__PURE__ */ c("span", { className: "pr-2", children: h }),
1475
+ /* @__PURE__ */ c("div", { className: I, children: e }),
1476
+ m && /* @__PURE__ */ c("span", { className: "pl-2", children: m })
1477
+ ]
1478
+ }
1479
+ );
1480
+ }
1481
+ );
1482
+ ft.displayName = "ButtonIcon";
1483
+ const yt = K.forwardRef(
1484
+ ({
1485
+ children: e,
1486
+ disabled: t = !1,
1487
+ mode: r = "system",
1488
+ focusMode: a = "system",
1489
+ fullWidth: n = !1,
1490
+ className: o,
1491
+ size: s = "medium",
1492
+ raw: i = !1,
1493
+ noBorder: l = !1,
1494
+ spacing: u,
1495
+ variant: p = "primary",
1496
+ noTruncate: d = !1,
1497
+ ...m
1498
+ }, h) => {
1499
+ const f = gt({
1500
+ type: pt,
1501
+ mode: r,
1502
+ focusMode: a,
1503
+ fullWidth: n,
1504
+ disabled: t,
1505
+ raw: i,
1506
+ className: o,
1507
+ size: s,
1508
+ noBorder: l,
1509
+ spacing: u,
1510
+ variant: p,
1511
+ noTruncate: d
1512
+ });
1513
+ return /* @__PURE__ */ c(
1514
+ Ce,
1515
+ {
1516
+ ref: h,
1517
+ className: f,
1518
+ disabled: t,
1519
+ ...m,
1520
+ children: e
1521
+ }
1522
+ );
1523
+ }
1524
+ );
1525
+ yt.displayName = "Button";
1526
+ const Xr = ({
1527
+ className: e,
1528
+ mode: t = "system",
1529
+ row1: r,
1530
+ row2: a,
1531
+ noMargins: n = !1,
1532
+ spacing: o,
1533
+ raw: s = !1
1534
+ }) => {
1535
+ const i = g(Wr, e, Ne(o), {
1536
+ "text-copy-dark": !s && t === "dark",
1537
+ "text-copy-lighter": !s && t === "light",
1538
+ "text-copy-dark dark:text-copy-lighter": !s && t === "system",
1539
+ "text-copy-lighter dark:text-copy-dark": !s && t === "alt-system",
1540
+ "mb-[100px]": !n && !s,
1541
+ "mt-0 flex w-full flex-col p-2 text-center text-xs sm:mt-3 md:mx-auto md:max-w-4xl": !s
1542
+ });
1543
+ return /* @__PURE__ */ S("footer", { className: i, children: [
1544
+ r && /* @__PURE__ */ c("div", { children: r }),
1545
+ a && /* @__PURE__ */ c("div", { children: a })
1546
+ ] });
1547
+ }, Zr = ({
1548
+ children: e,
1549
+ className: t,
1550
+ raw: r = !1,
1551
+ spacing: a
1552
+ }) => {
1553
+ const n = g(t, jr, Ne(a), {
1554
+ "mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
1555
+ });
1556
+ return /* @__PURE__ */ c("main", { className: n, children: e });
1557
+ };
1558
+ /*!
1559
+ @versini/ui-components v5.20.0
1560
+ © 2024 gizmette.com
1561
+ */
1562
+ try {
1563
+ window.__VERSINI_UI_GLOBAL__ || (window.__VERSINI_UI_GLOBAL__ = {
1564
+ version: "5.20.0",
1565
+ buildTime: "07/06/2024 10:24 AM EDT",
1566
+ homepage: "https://github.com/aversini/ui-components",
1567
+ license: "MIT"
1568
+ });
1569
+ } catch {
1570
+ }
1571
+ function ea(e) {
1572
+ return xt(() => e.every((t) => t == null) ? () => {
1573
+ } : (t) => {
1574
+ e.forEach((r) => {
1575
+ typeof r == "function" ? r(t) : r != null && (r.current = t);
1576
+ });
1577
+ }, e);
1578
+ }
1579
+ function ta(e) {
1580
+ const t = Nt();
1581
+ if (!e)
1582
+ return t;
1583
+ if (typeof e == "number" || typeof e == "string")
1584
+ return `${e}${t}`;
1585
+ if (typeof e == "object") {
1586
+ const { id: r, prefix: a = "" } = e;
1587
+ return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
1588
+ }
1589
+ }
1590
+ const bt = "SET_ANNOUNCEMENT", wt = "CLEAR_ANNOUNCEMENT", ra = {
1591
+ alert: null,
1592
+ alertdialog: null,
1593
+ log: "polite",
1594
+ marquee: null,
1595
+ progressbar: null,
1596
+ status: "polite",
1597
+ timer: "assertive"
1598
+ }, aa = (e, t) => {
1599
+ switch (t == null ? void 0 : t.type) {
1600
+ case bt:
1601
+ return {
1602
+ ...e,
1603
+ announcement: t.payload
1604
+ };
1605
+ case wt:
1606
+ return {
1607
+ ...e,
1608
+ announcement: null
1609
+ };
1610
+ default:
1611
+ return e;
1612
+ }
1613
+ }, na = ({
1614
+ onAnnouncementClear: e,
1615
+ dispatch: t
1616
+ }) => {
1617
+ t({
1618
+ type: wt
1619
+ }), typeof e == "function" && e();
1620
+ }, qe = ({
1621
+ children: e,
1622
+ clearAnnouncementDelay: t,
1623
+ clearAnnouncementTimeoutRef: r,
1624
+ onAnnouncementClear: a,
1625
+ dispatch: n
1626
+ }) => {
1627
+ (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
1628
+ type: bt,
1629
+ payload: e
1630
+ }), t && (r.current = setTimeout(
1631
+ () => na({
1632
+ onAnnouncementClear: a,
1633
+ dispatch: n
1634
+ }),
1635
+ t
1636
+ ));
1637
+ }, oa = ({
1638
+ children: e,
1639
+ announcementTimeoutRef: t,
1640
+ announcementDelay: r,
1641
+ clearAnnouncementDelay: a,
1642
+ clearAnnouncementTimeoutRef: n,
1643
+ onAnnouncementClear: o,
1644
+ dispatch: s
1645
+ }) => {
1646
+ clearTimeout(t.current), r ? t.current = setTimeout(qe, r, {
1647
+ children: e,
1648
+ clearAnnouncementDelay: a,
1649
+ clearAnnouncementTimeoutRef: n,
1650
+ onAnnouncementClear: o,
1651
+ dispatch: s
1652
+ }) : qe({
1653
+ children: e,
1654
+ clearAnnouncementDelay: a,
1655
+ clearAnnouncementTimeoutRef: n,
1656
+ onAnnouncementClear: o,
1657
+ dispatch: s
1658
+ });
1659
+ };
1660
+ function Et({
1661
+ children: e,
1662
+ className: t,
1663
+ politeness: r,
1664
+ role: a = null,
1665
+ announcementDelay: n,
1666
+ clearAnnouncementDelay: o,
1667
+ onAnnouncementClear: s,
1668
+ visible: i,
1669
+ ...l
1670
+ }) {
1671
+ const u = B(), p = B(), [d, m] = Ct(aa, {
1672
+ announcement: null
1673
+ });
1674
+ let h = r;
1675
+ typeof h > "u" && (h = a ? ra[a] : "assertive"), z(() => {
1676
+ oa({
1677
+ announcementTimeoutRef: u,
1678
+ announcementDelay: n,
1679
+ children: e,
1680
+ clearAnnouncementDelay: o,
1681
+ clearAnnouncementTimeoutRef: p,
1682
+ onAnnouncementClear: s,
1683
+ dispatch: m
1684
+ });
1685
+ }, [
1686
+ e,
1687
+ n,
1688
+ o,
1689
+ s
1690
+ ]);
1691
+ const f = g(t, {
1692
+ "sr-only": !i
1693
+ });
1694
+ return /* @__PURE__ */ c(
1695
+ "div",
1696
+ {
1697
+ "aria-live": h,
1698
+ ...a && { role: a },
1699
+ className: f,
1700
+ ...l,
1701
+ children: d.announcement
1702
+ }
1703
+ );
1704
+ }
1705
+ /*!
1706
+ @versini/ui-private v1.4.5
1707
+ © 2024 gizmette.com
1708
+ */
1709
+ try {
1710
+ window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
1711
+ version: "1.4.5",
1712
+ buildTime: "07/01/2024 11:35 AM EDT",
1713
+ homepage: "https://github.com/aversini/ui-components",
1714
+ license: "MIT"
1715
+ });
1716
+ } catch {
1717
+ }
1718
+ const sa = (e) => {
1719
+ let t = "";
1720
+ if (typeof e == "number" || typeof e == "string")
1721
+ t = "m-" + e;
1722
+ else {
1723
+ const r = [];
1724
+ (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
1725
+ }
1726
+ return t;
1727
+ }, vt = "av-text-input", ia = "av-text-input-wrapper", Te = "av-text-input-helper-text", xn = "av-text-area", Nn = "av-text-area-wrapper", Cn = "av-text-area-helper-text", Rn = "av-text-area__control--right", On = "av-toggle", ca = ({
1728
+ mode: e
1729
+ }) => g({
1730
+ "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
1731
+ "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
1732
+ "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
1733
+ "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
1734
+ }), la = ({
1735
+ focusMode: e
1736
+ }) => g("focus:outline focus:outline-2 focus:outline-offset-2", {
1737
+ "focus:outline-focus-dark": e === "dark",
1738
+ "focus:outline-focus-light": e === "light",
1739
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
1740
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
1741
+ }), da = ({
1742
+ noBorder: e,
1743
+ error: t
1744
+ }) => g("border-2", {
1745
+ "border-border-dark": !e && !t,
1746
+ "focus:border-border-dark": !e && t,
1747
+ "border-border-error-dark": !e && t,
1748
+ "border-transparent": e
1749
+ }), ua = ({
1750
+ disabled: e,
1751
+ raw: t,
1752
+ error: r,
1753
+ mode: a
1754
+ }) => {
1755
+ if (t)
1756
+ return "";
1757
+ if (e)
1758
+ return g("absolute px-2 cursor-not-allowed opacity-50 font-medium");
1759
+ if (!r)
1760
+ return g("absolute px-2 cursor-text font-medium", {
1761
+ "text-copy-lighter": a === "dark",
1762
+ "text-copy-dark": a === "light",
1763
+ "text-copy-dark dark:text-copy-lighter": a === "system",
1764
+ "text-copy-lighter dark:text-copy-dark": a === "alt-system"
1765
+ });
1766
+ if (r)
1767
+ return g("absolute px-2 cursor-text font-medium", {
1768
+ "text-copy-lighter": a === "dark",
1769
+ "text-copy-error-dark": a === "light",
1770
+ "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
1771
+ "text-copy-lighter dark:text-copy-error-dark": a === "alt-system"
1772
+ });
1773
+ }, ma = ({
1774
+ error: e,
1775
+ raw: t,
1776
+ mode: r,
1777
+ disabled: a
1778
+ }) => {
1779
+ if (t)
1780
+ return "";
1781
+ if (a)
1782
+ return g(
1783
+ Te,
1784
+ "absolute px-2 cursor-not-allowed opacity-50 font-medium"
1785
+ );
1786
+ if (!e)
1787
+ return g(Te, "absolute px-2 font-medium", {
1788
+ "text-copy-lighter": r === "dark",
1789
+ "text-copy-dark": r === "light",
1790
+ "text-copy-dark dark:text-copy-lighter": r === "system",
1791
+ "text-copy-lighter dark:text-copy-dark": r === "alt-system"
1792
+ });
1793
+ if (e)
1794
+ return g(Te, "absolute px-2 font-medium", {
1795
+ "text-copy-error-light bg-surface-darker": r === "dark",
1796
+ "text-copy-error-dark": r === "light",
1797
+ "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
1798
+ "dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
1799
+ });
1800
+ }, ha = ({
1801
+ className: e,
1802
+ inputClassName: t,
1803
+ raw: r,
1804
+ disabled: a,
1805
+ noBorder: n,
1806
+ error: o,
1807
+ spacing: s,
1808
+ mode: i,
1809
+ focusMode: l
1810
+ }) => {
1811
+ const u = r ? e : g(
1812
+ "relative flex w-full flex-col justify-center",
1813
+ ia,
1814
+ e,
1815
+ sa(s)
1816
+ ), p = r ? g(t) : g(
1817
+ vt,
1818
+ t,
1819
+ "h-12 rounded-md px-4 text-base",
1820
+ ca({ mode: i }),
1821
+ la({ focusMode: l }),
1822
+ da({ noBorder: n, error: o }),
1823
+ {
1824
+ "disabled:cursor-not-allowed disabled:opacity-50": a
1825
+ }
1826
+ ), d = r ? void 0 : "sr-only", m = ua({
1827
+ disabled: a,
1828
+ raw: r,
1829
+ error: o,
1830
+ mode: i
1831
+ }), h = ma({
1832
+ error: o,
1833
+ raw: r,
1834
+ mode: i,
1835
+ disabled: a
1836
+ });
1837
+ return {
1838
+ wrapper: u,
1839
+ input: p,
1840
+ accessibleLabel: d,
1841
+ visibleLabel: m,
1842
+ helperText: h,
1843
+ rightElement: r ? void 0 : "absolute right-3"
1844
+ };
1845
+ }, Re = K.forwardRef(
1846
+ ({
1847
+ id: e,
1848
+ name: t,
1849
+ label: r,
1850
+ error: a = !1,
1851
+ raw: n = !1,
1852
+ className: o,
1853
+ inputClassName: s,
1854
+ mode: i = "system",
1855
+ focusMode: l = "system",
1856
+ disabled: u = !1,
1857
+ noBorder: p = !1,
1858
+ labelId: d,
1859
+ labelHidden: m = !1,
1860
+ type: h = "text",
1861
+ helperText: f = "",
1862
+ rightElement: b,
1863
+ spacing: R,
1864
+ ...A
1865
+ }, T) => {
1866
+ const _ = B(null), [I, j] = U(0), C = ta({ id: e, prefix: `${vt}-` }), G = `${t} error, ${f}`, O = ha({
1867
+ className: o,
1868
+ inputClassName: s,
1869
+ error: a,
1870
+ raw: n,
1871
+ focusMode: l,
1872
+ disabled: u,
1873
+ noBorder: p,
1874
+ spacing: R,
1875
+ mode: i
1876
+ });
1877
+ return Rt(() => {
1878
+ _.current && j(_.current.offsetWidth + 18 + 10);
1879
+ }, []), /* @__PURE__ */ S("div", { className: O.wrapper, children: [
1880
+ /* @__PURE__ */ c(
1881
+ "label",
1882
+ {
1883
+ htmlFor: C,
1884
+ id: d,
1885
+ className: O.accessibleLabel,
1886
+ children: r
1887
+ }
1888
+ ),
1889
+ /* @__PURE__ */ c(
1890
+ "input",
1891
+ {
1892
+ ref: T,
1893
+ id: C,
1894
+ name: t,
1895
+ type: h,
1896
+ disabled: u,
1897
+ placeholder: n ? void 0 : " ",
1898
+ className: O.input,
1899
+ ...f && { "aria-describedby": `${C}-helper` },
1900
+ ...a && { "aria-invalid": "true" },
1901
+ ...b && !n && { style: { paddingRight: I } },
1902
+ ...A
1903
+ }
1904
+ ),
1905
+ !n && !m && /* @__PURE__ */ c(
1906
+ "label",
1907
+ {
1908
+ "aria-hidden": !0,
1909
+ htmlFor: C,
1910
+ className: O.visibleLabel,
1911
+ children: r
1912
+ }
1913
+ ),
1914
+ f && /* @__PURE__ */ c(
1915
+ "div",
1916
+ {
1917
+ id: `${C}-helper`,
1918
+ className: O.helperText,
1919
+ children: f
1920
+ }
1921
+ ),
1922
+ b && /* @__PURE__ */ c(
1923
+ "div",
1924
+ {
1925
+ ref: _,
1926
+ className: O.rightElement,
1927
+ children: b
1928
+ }
1929
+ ),
1930
+ a && f && /* @__PURE__ */ c(Et, { politeness: "polite", clearAnnouncementDelay: 500, children: G })
1931
+ ] });
1932
+ }
1933
+ );
1934
+ Re.displayName = "TextInput";
1935
+ const pa = 500, ga = 5e3, fa = 2e4, kt = K.forwardRef(
1936
+ ({
1937
+ name: e,
1938
+ disabled: t,
1939
+ label: r,
1940
+ labelHidden: a,
1941
+ onMaskChange: n,
1942
+ onChange: o,
1943
+ onBlur: s,
1944
+ onFocus: i,
1945
+ onTextInputMaskBlur: l,
1946
+ rightElement: u,
1947
+ spacing: p,
1948
+ ...d
1949
+ }, m) => {
1950
+ const [h, f] = U(!0), [b, R] = U({
1951
+ message: null,
1952
+ politeness: null
1953
+ }), A = B(!0), T = B(), _ = B(null), I = ea([m, _]), j = h ? "Show" : "Hide", C = () => {
1954
+ clearTimeout(T.current), A.current || (T.current = window.setTimeout(() => {
1955
+ A.current = !0, f(!0), R({
1956
+ announcementTimeout: ga,
1957
+ politeness: "polite",
1958
+ message: `${r} hiding characters`
1959
+ }), n && n(!0);
1960
+ }, fa));
1961
+ }, G = (w) => {
1962
+ w.preventDefault();
1963
+ const x = !A.current;
1964
+ A.current = x, C(), f(x), R({
1965
+ announcementTimeout: pa,
1966
+ politeness: "assertive",
1967
+ message: x ? "Characters hidden" : "Characters showing"
1968
+ }), n && n(x);
1969
+ }, O = (w) => {
1970
+ var x;
1971
+ const { relatedTarget: V } = w, X = (x = _.current) == null ? void 0 : x.parentElement;
1972
+ X != null && X.contains(V) || l && l();
1973
+ }, y = (w) => {
1974
+ C(), s && s(w), O(w);
1975
+ }, M = (w) => {
1976
+ C(), i && i(w);
1977
+ }, D = (w) => {
1978
+ C(), o && o(w);
1979
+ };
1980
+ return z(() => () => {
1981
+ clearTimeout(T.current);
1982
+ }, []), /* @__PURE__ */ S(q, { children: [
1983
+ /* @__PURE__ */ c(
1984
+ Re,
1985
+ {
1986
+ ref: I,
1987
+ name: e,
1988
+ label: r,
1989
+ labelHidden: a,
1990
+ type: h ? "password" : "text",
1991
+ disabled: t,
1992
+ spacing: p,
1993
+ onBlur: y,
1994
+ onFocus: M,
1995
+ onChange: D,
1996
+ rightElement: K.cloneElement(u, {
1997
+ ref: m,
1998
+ label: j,
1999
+ onClick: G,
2000
+ onBlur: O,
2001
+ disabled: t
2002
+ }),
2003
+ ...d
2004
+ }
2005
+ ),
2006
+ /* @__PURE__ */ c(
2007
+ Et,
2008
+ {
2009
+ role: "status",
2010
+ politeness: b.politeness,
2011
+ clearAnnouncementDelay: b.announcementTimeout,
2012
+ children: b.message
2013
+ }
2014
+ )
2015
+ ] });
2016
+ }
2017
+ );
2018
+ kt.displayName = "TextInputMask";
2019
+ /*!
2020
+ @versini/ui-form v1.3.5
2021
+ © 2024 gizmette.com
2022
+ */
2023
+ try {
2024
+ window.__VERSINI_UI_FORM__ || (window.__VERSINI_UI_FORM__ = {
2025
+ version: "1.3.5",
2026
+ buildTime: "07/01/2024 11:36 AM EDT",
2027
+ homepage: "https://github.com/aversini/ui-components",
2028
+ license: "MIT"
2029
+ });
2030
+ } catch {
2031
+ }
2032
+ const ya = (e) => {
2033
+ let t = "";
2034
+ if (typeof e == "number" || typeof e == "string")
2035
+ t = "m-" + e;
2036
+ else {
2037
+ const r = [];
2038
+ (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
2039
+ }
2040
+ return t;
2041
+ }, Oe = ({
2042
+ children: e,
2043
+ fill: t,
2044
+ viewBox: r,
2045
+ className: a,
2046
+ defaultViewBox: n,
2047
+ defaultClassName: o,
2048
+ spacing: s,
2049
+ title: i,
2050
+ semantic: l = !1,
2051
+ ...u
2052
+ }) => {
2053
+ const p = ya(s), d = g(
2054
+ p,
2055
+ a || o
2056
+ );
2057
+ return /* @__PURE__ */ S(q, { children: [
2058
+ /* @__PURE__ */ c(
2059
+ "svg",
2060
+ {
2061
+ xmlns: "http://www.w3.org/2000/svg",
2062
+ className: d,
2063
+ viewBox: r || n,
2064
+ fill: t || "currentColor",
2065
+ role: "img",
2066
+ "aria-hidden": !l,
2067
+ focusable: !1,
2068
+ ...u,
2069
+ children: e
2070
+ }
2071
+ ),
2072
+ i && l && /* @__PURE__ */ c("span", { className: "sr-only", children: i })
2073
+ ] });
2074
+ };
2075
+ /*!
2076
+ @versini/ui-private v1.4.6
2077
+ © 2024 gizmette.com
2078
+ */
2079
+ try {
2080
+ window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
2081
+ version: "1.4.6",
2082
+ buildTime: "07/05/2024 05:27 PM EDT",
2083
+ homepage: "https://github.com/aversini/ui-components",
2084
+ license: "MIT"
2085
+ });
2086
+ } catch {
2087
+ }
2088
+ const ba = ({
2089
+ className: e,
2090
+ viewBox: t,
2091
+ spacing: r,
2092
+ ...a
2093
+ }) => /* @__PURE__ */ c(
2094
+ Oe,
2095
+ {
2096
+ defaultViewBox: "0 0 1200 500",
2097
+ defaultClassName: "w-full",
2098
+ viewBox: t,
2099
+ className: e,
2100
+ spacing: r,
2101
+ title: "Sassy Dog",
2102
+ ...a,
2103
+ children: /* @__PURE__ */ c("g", { transform: "matrix(11.9092 0 0 11.9092 470.0017 250.0009)", id: "879221", children: /* @__PURE__ */ c(
2104
+ "path",
2105
+ {
2106
+ vectorEffect: "non-scaling-stroke",
2107
+ transform: " translate(-50.7473, -45.4051)",
2108
+ d: "M 89.2 27 c 0 -0.2 -0.1 -0.5 -0.3 -0.6 c -0.6 -0.4 -1.6 -0.1 -2.2 0 c -1.5 0.2 -2.9 0.4 -4.5 0.4 c -2.2 0 -4.5 -0.1 -6.7 -0.4 c -2 -0.3 -3.7 -0.9 -5.8 -0.3 c -3 0.8 -4.9 3.2 -4.8 6.3 c 0.1 1.8 -0.2 3.2 -0.8 4.8 c -0.6 1.5 -1.3 1.7 -2.7 1.7 c -9.7 0 -19.3 -0.1 -29 0 c -1.7 0 -3.5 0 -5.3 0 c -2.5 0 -5 0.5 -7.5 0 c -1.8 -0.4 -3.6 -1.3 -4.9 -2.6 c -0.3 -0.3 -0.9 -1.2 -1.2 -1.2 c -0.4 0.1 -0.4 1.3 -0.4 1.6 c 0 1.3 0.5 2.6 0.5 3.9 c 0 1.3 -0.6 2.4 -1 3.6 c -0.4 1.4 -0.4 2.8 -0.2 4.2 c 0.4 2.3 0.8 4.7 1 7.1 c 0.2 2.1 0.2 4.1 0.4 6.2 c 0.2 1.7 0.3 2.5 2.5 2.8 c 2.6 0.4 2.6 -0.5 3.2 -2.2 c 0.8 -2.1 1.5 -4.3 2.3 -6.4 c 0.7 -1.6 1.3 -5.1 5.7 -3.4 c 2.4 0.9 4.9 1.4 7.4 2.1 c 2.7 0.7 5.5 1.4 8.2 1.9 c 5.5 1.1 11.1 1.7 16.8 2 c 0.6 0 1 0 1.4 0.5 c 1.5 1.9 -0.3 5.3 3.5 5.9 c 3.4 0.5 3.4 -1.9 3.8 -4 c 0.2 -1.2 0.4 -2.3 0.7 -3.4 c 0.1 -0.5 0.5 -1 0.9 -1.3 c 4.7 -2.8 7.4 -8.3 6.6 -13.8 c -0.1 -0.9 -0.4 -1.8 -0.3 -2.8 c 0.2 -2 2.7 -2.8 4.2 -3.6 c 1.9 -1.1 4 -2.1 5.6 -3.6 c 1.1 -1 2 -2.3 2.5 -3.7 C 89.1 28.2 89.3 27.5 89.2 27 z M 73.2 40.4 c -0.2 2.1 -1.1 3.1 -3 3.5 c -3.4 0.7 -5.6 -1.6 -4.6 -4.9 c 0.7 -2.2 1.5 -4.3 2.5 -6.3 c 1 -2 1.9 -2 3.1 -0.1 C 72.7 35 73.5 37.6 73.2 40.4 z M 76.4 31.2 c -0.6 0 -1.1 -0.5 -1.1 -1.1 c 0 -0.6 0.5 -1.1 1.1 -1.1 c 0.6 0 1.1 0.5 1.1 1.1 C 77.5 30.7 77 31.2 76.4 31.2 z",
2109
+ strokeLinecap: "round"
2110
+ }
2111
+ ) })
2112
+ }
2113
+ ), wa = ({
2114
+ className: e,
2115
+ viewBox: t,
2116
+ spacing: r,
2117
+ title: a,
2118
+ monotone: n,
2119
+ ...o
2120
+ }) => /* @__PURE__ */ S(
2121
+ Oe,
2122
+ {
2123
+ defaultViewBox: "0 0 640 512",
2124
+ defaultClassName: "size-5",
2125
+ viewBox: t,
2126
+ className: e,
2127
+ spacing: r,
2128
+ title: a || "Hide",
2129
+ ...o,
2130
+ children: [
2131
+ /* @__PURE__ */ c(
2132
+ "path",
2133
+ {
2134
+ opacity: n ? "1" : "0.4",
2135
+ d: "M360.8 380.3C339.4 392.8 314.6 400 288 400c-79.5 0-144-64.5-144-144c0-14.5 2.1-28.5 6.1-41.7L63.5 146c-29.4 34.7-49.9 70.8-61.1 97.6c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480c56.1 0 104.4-17.8 144.5-43.2l-71.7-56.5zM198.5 252.4c-3.7 .8-6.7 3.7-6.5 7.7c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9c1.9-.5 3.9-1.1 5.7-1.7l-120-94.6zm89-52.4l94.8 74.3c2.7-13.9 2.4-28.6-1.5-43.2c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 2.7-.2 5.4-.5 8zM432 256c0 17.7-3.2 34.6-9 50.2l84.1 65.9c32.3-36.6 54.6-75.4 66.4-103.9c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32c-60 0-111.1 20.3-152.8 48.7L207 136.9c23.1-15.7 51-24.9 81-24.9c79.5 0 144 64.5 144 144z"
2136
+ }
2137
+ ),
2138
+ /* @__PURE__ */ c("path", { d: "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z" })
2139
+ ]
2140
+ }
2141
+ ), Ea = ({
2142
+ className: e,
2143
+ viewBox: t,
2144
+ spacing: r,
2145
+ title: a,
2146
+ monotone: n,
2147
+ ...o
2148
+ }) => /* @__PURE__ */ S(
2149
+ Oe,
2150
+ {
2151
+ defaultViewBox: "0 0 576 512",
2152
+ defaultClassName: "size-5",
2153
+ viewBox: t,
2154
+ className: e,
2155
+ spacing: r,
2156
+ title: a || "Show",
2157
+ ...o,
2158
+ children: [
2159
+ /* @__PURE__ */ c(
2160
+ "path",
2161
+ {
2162
+ opacity: n ? "1" : "0.4",
2163
+ d: "M95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 400a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"
2164
+ }
2165
+ ),
2166
+ /* @__PURE__ */ c("path", { d: "M224 256c35.3 0 64-28.7 64-64c0-7.1-1.2-13.9-3.3-20.3c-1.8-5.5 1.6-11.9 7.4-11.7c40.8 1.7 77.5 29.6 88.6 71.1c13.7 51.2-16.7 103.9-67.9 117.6s-103.9-16.7-117.6-67.9c-1.9-6.9-2.9-13.9-3.2-20.7c-.3-5.8 6.1-9.2 11.7-7.4c6.4 2.1 13.2 3.3 20.3 3.3z" })
2167
+ ]
2168
+ }
2169
+ );
2170
+ /*!
2171
+ @versini/ui-icons v1.10.0
2172
+ © 2024 gizmette.com
2173
+ */
2174
+ try {
2175
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
2176
+ version: "1.10.0",
2177
+ buildTime: "07/05/2024 05:27 PM EDT",
2178
+ homepage: "https://github.com/aversini/ui-components",
2179
+ license: "MIT"
2180
+ });
2181
+ } catch {
2182
+ }
2183
+ const va = (e) => {
2184
+ let t = "";
2185
+ if (typeof e == "number" || typeof e == "string")
2186
+ t = "m-" + e;
2187
+ else {
2188
+ const r = [];
2189
+ (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
2190
+ }
2191
+ return t;
2192
+ }, ka = "av-flexgrid", ie = "av-flexgrid-item", me = 0.25, St = K.createContext({
2193
+ columnGap: 0,
2194
+ rowGap: 0
2195
+ }), Sa = ({
2196
+ children: e,
2197
+ className: t,
2198
+ columnGap: r = 1,
2199
+ rowGap: a = 0,
2200
+ height: n = "auto",
2201
+ width: o = "auto",
2202
+ direction: s = "row",
2203
+ alignHorizontal: i = "normal",
2204
+ alignVertical: l = "normal",
2205
+ spacing: u,
2206
+ ...p
2207
+ }) => {
2208
+ const d = {
2209
+ flexDirection: s,
2210
+ justifyContent: i,
2211
+ alignItems: l,
2212
+ height: n,
2213
+ width: o,
2214
+ /**
2215
+ * Trick to account for the extra space taken
2216
+ * by the columnGap and rowGap that will be applied
2217
+ * to all FlexgridItems (see context and paddings).
2218
+ */
2219
+ marginLeft: r * -1 * me + "rem",
2220
+ marginTop: a * -1 * me + "rem"
2221
+ }, m = g(
2222
+ ka,
2223
+ t,
2224
+ "box-border flex flex-wrap"
2225
+ ), h = { columnGap: r, rowGap: a }, f = u ? "div" : K.Fragment;
2226
+ return /* @__PURE__ */ c(f, { ...u ? { className: va(u) } : {}, children: /* @__PURE__ */ c("div", { className: m, style: d, ...p, children: /* @__PURE__ */ c(St.Provider, { value: h, children: e }) }) });
2227
+ }, Ae = (e, t) => g({
2228
+ "basis-1/12": e === 1 && !t,
2229
+ "sm:basis-1/12": e === 1 && t === "sm",
2230
+ "md:basis-1/12": e === 1 && t === "md",
2231
+ "lg:basis-1/12": e === 1 && t === "lg",
2232
+ "xl:basis-1/12": e === 1 && t === "xl",
2233
+ "2xl:basis-1/12": e === 1 && t === "2xl",
2234
+ "basis-2/12": e === 2 && !t,
2235
+ "sm:basis-2/12": e === 2 && t === "sm",
2236
+ "md:basis-2/12": e === 2 && t === "md",
2237
+ "lg:basis-2/12": e === 2 && t === "lg",
2238
+ "xl:basis-2/12": e === 2 && t === "xl",
2239
+ "2xl:basis-2/12": e === 2 && t === "2xl",
2240
+ "basis-3/12": e === 3 && !t,
2241
+ "sm:basis-3/12": e === 3 && t === "sm",
2242
+ "md:basis-3/12": e === 3 && t === "md",
2243
+ "lg:basis-3/12": e === 3 && t === "lg",
2244
+ "xl:basis-3/12": e === 3 && t === "xl",
2245
+ "2xl:basis-3/12": e === 3 && t === "2xl",
2246
+ "basis-4/12": e === 4 && !t,
2247
+ "sm:basis-4/12": e === 4 && t === "sm",
2248
+ "md:basis-4/12": e === 4 && t === "md",
2249
+ "lg:basis-4/12": e === 4 && t === "lg",
2250
+ "xl:basis-4/12": e === 4 && t === "xl",
2251
+ "2xl:basis-4/12": e === 4 && t === "2xl",
2252
+ "basis-5/12": e === 5 && !t,
2253
+ "sm:basis-5/12": e === 5 && t === "sm",
2254
+ "md:basis-5/12": e === 5 && t === "md",
2255
+ "lg:basis-5/12": e === 5 && t === "lg",
2256
+ "xl:basis-5/12": e === 5 && t === "xl",
2257
+ "2xl:basis-5/12": e === 5 && t === "2xl",
2258
+ "basis-6/12": e === 6 && !t,
2259
+ "sm:basis-6/12": e === 6 && t === "sm",
2260
+ "md:basis-6/12": e === 6 && t === "md",
2261
+ "lg:basis-6/12": e === 6 && t === "lg",
2262
+ "xl:basis-6/12": e === 6 && t === "xl",
2263
+ "2xl:basis-6/12": e === 6 && t === "2xl",
2264
+ "basis-7/12": e === 7 && !t,
2265
+ "sm:basis-7/12": e === 7 && t === "sm",
2266
+ "md:basis-7/12": e === 7 && t === "md",
2267
+ "lg:basis-7/12": e === 7 && t === "lg",
2268
+ "xl:basis-7/12": e === 7 && t === "xl",
2269
+ "2xl:basis-7/12": e === 7 && t === "2xl",
2270
+ "basis-8/12": e === 8 && !t,
2271
+ "sm:basis-8/12": e === 8 && t === "sm",
2272
+ "md:basis-8/12": e === 8 && t === "md",
2273
+ "lg:basis-8/12": e === 8 && t === "lg",
2274
+ "xl:basis-8/12": e === 8 && t === "xl",
2275
+ "2xl:basis-8/12": e === 8 && t === "2xl",
2276
+ "basis-9/12": e === 9 && !t,
2277
+ "sm:basis-9/12": e === 9 && t === "sm",
2278
+ "md:basis-9/12": e === 9 && t === "md",
2279
+ "lg:basis-9/12": e === 9 && t === "lg",
2280
+ "xl:basis-9/12": e === 9 && t === "xl",
2281
+ "2xl:basis-9/12": e === 9 && t === "2xl",
2282
+ "basis-10/12": e === 10 && !t,
2283
+ "sm:basis-10/12": e === 10 && t === "sm",
2284
+ "md:basis-10/12": e === 10 && t === "md",
2285
+ "lg:basis-10/12": e === 10 && t === "lg",
2286
+ "xl:basis-10/12": e === 10 && t === "xl",
2287
+ "2xl:basis-10/12": e === 10 && t === "2xl",
2288
+ "basis-11/12": e === 11 && !t,
2289
+ "sm:basis-11/12": e === 11 && t === "sm",
2290
+ "md:basis-11/12": e === 11 && t === "md",
2291
+ "lg:basis-11/12": e === 11 && t === "lg",
2292
+ "xl:basis-11/12": e === 11 && t === "xl",
2293
+ "2xl:basis-11/12": e === 11 && t === "2xl",
2294
+ "basis-full": e === 12 && !t,
2295
+ "sm:basis-full": e === 12 && t === "sm",
2296
+ "md:basis-full": e === 12 && t === "md",
2297
+ "lg:basis-full": e === 12 && t === "lg",
2298
+ "xl:basis-full": e === 12 && t === "xl",
2299
+ "2xl:basis-full": e === 12 && t === "2xl"
2300
+ }), Ta = ({
2301
+ className: e,
2302
+ span: t
2303
+ }) => {
2304
+ if (!t)
2305
+ return g(e, ie, "box-border basis-auto");
2306
+ if (typeof t == "number")
2307
+ return g(e, ie, "box-border max-w-full", {
2308
+ [`${Ae(t)}`]: !0
2309
+ });
2310
+ if (typeof t == "string")
2311
+ return g(e, ie, "box-border basis-auto", {
2312
+ "max-w-full grow": t === "auto"
2313
+ });
2314
+ if (typeof t == "object") {
2315
+ const r = Object.entries(t).map(([a, n]) => a === "fallback" ? Ae(n) : Ae(n, a));
2316
+ return g(
2317
+ e,
2318
+ ie,
2319
+ "box-border",
2320
+ r
2321
+ );
2322
+ }
2323
+ }, ce = ({
2324
+ children: e,
2325
+ className: t,
2326
+ span: r,
2327
+ ...a
2328
+ }) => {
2329
+ const { columnGap: n, rowGap: o } = Xe(St), s = {
2330
+ paddingLeft: n * me + "rem",
2331
+ paddingTop: o * me + "rem"
2332
+ }, i = Ta({
2333
+ className: t,
2334
+ span: r
2335
+ });
2336
+ return /* @__PURE__ */ c("div", { className: i, style: s, ...a, children: e });
2337
+ };
2338
+ /*!
2339
+ @versini/ui-system v1.4.2
2340
+ © 2024 gizmette.com
2341
+ */
2342
+ try {
2343
+ window.__VERSINI_UI_SYSTEM__ || (window.__VERSINI_UI_SYSTEM__ = {
2344
+ version: "1.4.2",
2345
+ buildTime: "07/05/2024 05:27 PM EDT",
2346
+ homepage: "https://github.com/aversini/ui-components",
2347
+ license: "MIT"
2348
+ });
2349
+ } catch {
2350
+ }
2351
+ const Aa = "ASK! ME! ANYTHING!", Tt = "Sassy Saint", _a = "gizmette.com", Ia = "Log in", Dn = "Log out", xa = "Password", Na = "Powered by OpenAI", Mn = "Send", $n = "Profile", Ln = "Statistics", Pn = "Chat history", Un = "About", Hn = "Type your question here", Kn = "Clear chat", Bn = "Cancel chat", Wn = "N/A", jn = {
2352
+ PREFERENCES: {
2353
+ TITLE: "User preferences",
2354
+ NAME: "Name",
2355
+ EMAIL: "Email",
2356
+ ENGINE_DETAILS: "Show message statistics",
2357
+ LOCATION: "Current location",
2358
+ MODEL_TYPE: "Use GPT model 4"
2359
+ },
2360
+ CURRENT_STATISTICS: {
2361
+ TITLE: "Current chat statistics",
2362
+ MODEL_NAME: "GPT model",
2363
+ TOKENS_USED: "Tokens used",
2364
+ REMAINING_TOKENS: "Remaining tokens",
2365
+ PROCESSING_TIME: "Average response time"
2366
+ },
2367
+ MAIN_STATISTICS: {
2368
+ TITLE: "Lifetime statistics",
2369
+ TOTAL: "Total chat session",
2370
+ PROCESSING_TIME: "Average response time"
2371
+ },
2372
+ HISTORY: {
2373
+ TITLE: "Chat history"
2374
+ },
2375
+ ABOUT: {
2376
+ TITLE_CLIENT: "Client details",
2377
+ TITLE_SERVER: "Server details",
2378
+ VERSION: "Version",
2379
+ BUILD_TIMESTAMP: "Build date",
2380
+ ENGINE: "OpenAI model",
2381
+ PLUGIN: "Plugin"
2382
+ }
2383
+ }, Qe = (e) => Number.isFinite(e) ? e : 0;
2384
+ function Ca(e) {
2385
+ return {
2386
+ days: Math.trunc(e / 864e5),
2387
+ hours: Math.trunc(e / 36e5 % 24),
2388
+ minutes: Math.trunc(e / 6e4 % 60),
2389
+ seconds: Math.trunc(e / 1e3 % 60),
2390
+ milliseconds: Math.trunc(e % 1e3),
2391
+ microseconds: Math.trunc(Qe(e * 1e3) % 1e3),
2392
+ nanoseconds: Math.trunc(Qe(e * 1e6) % 1e3)
2393
+ };
2394
+ }
2395
+ function Ra(e) {
2396
+ return {
2397
+ days: e / 86400000n,
2398
+ hours: e / 3600000n % 24n,
2399
+ minutes: e / 60000n % 60n,
2400
+ seconds: e / 1000n % 60n,
2401
+ milliseconds: e % 1000n,
2402
+ microseconds: 0n,
2403
+ nanoseconds: 0n
2404
+ };
2405
+ }
2406
+ function Oa(e) {
2407
+ switch (typeof e) {
2408
+ case "number": {
2409
+ if (Number.isFinite(e))
2410
+ return Ca(e);
2411
+ break;
2412
+ }
2413
+ case "bigint":
2414
+ return Ra(e);
2415
+ }
2416
+ throw new TypeError("Expected a finite number or bigint");
2417
+ }
2418
+ const Da = (e) => e === 0 || e === 0n, Ma = (e, t) => t === 1 || t === 1n ? e : `${e}s`, $a = 1e-7, La = 24n * 60n * 60n * 1000n;
2419
+ function Pa(e, t) {
2420
+ const r = typeof e == "bigint";
2421
+ if (!r && !Number.isFinite(e))
2422
+ throw new TypeError("Expected a finite number or bigint");
2423
+ t = { ...t }, t.colonNotation && (t.compact = !1, t.formatSubMilliseconds = !1, t.separateMilliseconds = !1, t.verbose = !1), t.compact && (t.unitCount = 1, t.secondsDecimalDigits = 0, t.millisecondsDecimalDigits = 0);
2424
+ let a = [];
2425
+ const n = (u, p) => {
2426
+ const d = Math.floor(u * 10 ** p + $a);
2427
+ return (Math.round(d) / 10 ** p).toFixed(p);
2428
+ }, o = (u, p, d, m) => {
2429
+ if (!((a.length === 0 || !t.colonNotation) && Da(u) && !(t.colonNotation && d === "m"))) {
2430
+ if (m = m ?? String(u), t.colonNotation) {
2431
+ const h = m.includes(".") ? m.split(".")[0].length : m.length, f = a.length > 0 ? 2 : 1;
2432
+ m = "0".repeat(Math.max(0, f - h)) + m;
2433
+ } else
2434
+ m += t.verbose ? " " + Ma(p, u) : d;
2435
+ a.push(m);
2436
+ }
2437
+ }, s = Oa(e), i = BigInt(s.days);
2438
+ if (o(i / 365n, "year", "y"), o(i % 365n, "day", "d"), o(Number(s.hours), "hour", "h"), o(Number(s.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
2439
+ const u = Number(s.seconds), p = Number(s.milliseconds), d = Number(s.microseconds), m = Number(s.nanoseconds);
2440
+ if (o(u, "second", "s"), t.formatSubMilliseconds)
2441
+ o(p, "millisecond", "ms"), o(d, "microsecond", "µs"), o(m, "nanosecond", "ns");
2442
+ else {
2443
+ const h = p + d / 1e3 + m / 1e6, f = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, b = h >= 1 ? Math.round(h) : Math.ceil(h), R = f ? h.toFixed(f) : b;
2444
+ o(
2445
+ Number.parseFloat(R),
2446
+ "millisecond",
2447
+ "ms",
2448
+ R
2449
+ );
2450
+ }
2451
+ } else {
2452
+ const u = (r ? Number(e % La) : e) / 1e3 % 60, p = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, d = n(u, p), m = t.keepDecimalsOnWholeSeconds ? d : d.replace(/\.0+$/, "");
2453
+ o(Number.parseFloat(m), "second", "s", m);
2454
+ }
2455
+ if (a.length === 0)
2456
+ return "0" + (t.verbose ? " milliseconds" : "ms");
2457
+ const l = t.colonNotation ? ":" : " ";
2458
+ return typeof t.unitCount == "number" && (a = a.slice(0, Math.max(t.unitCount, 1))), a.join(l);
2459
+ }
2460
+ const Ua = process.env.NODE_ENV === "production", At = !Ua, Gn = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, _t = (e, t) => {
2461
+ const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", a = 0 | Math.abs(e), n = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
2462
+ return {
2463
+ dir: r,
2464
+ deg: a,
2465
+ min: n,
2466
+ sec: o
2467
+ };
2468
+ }, Vn = (e) => {
2469
+ if (!e && e !== 0)
2470
+ return "N/A";
2471
+ const t = _t(e, !1);
2472
+ return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2473
+ }, Jn = (e) => {
2474
+ if (!e && e !== 0)
2475
+ return "N/A";
2476
+ const t = _t(e, !0);
2477
+ return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2478
+ }, Fn = async () => {
2479
+ const e = {
2480
+ /**
2481
+ * A boolean value that indicates the application would
2482
+ * like to receive the best possible results. If true
2483
+ * and if the device is able to provide a more accurate
2484
+ * position, it will do so. Note that this can result in
2485
+ * slower response times or increased power consumption
2486
+ * (with a GPS chip on a mobile device for example). On
2487
+ * the other hand, if false, the device can take the
2488
+ * liberty to save resources by responding more quickly
2489
+ * and/or using less power. Default: false.
2490
+ */
2491
+ enableHighAccuracy: !1,
2492
+ /**
2493
+ * A positive long value representing the maximum length
2494
+ * of time (in milliseconds) the device is allowed to
2495
+ * take in order to return a position. The default value
2496
+ * is Infinity, meaning that getCurrentPosition() won't
2497
+ * return until the position is available.
2498
+ */
2499
+ timeout: 1e4,
2500
+ /**
2501
+ * A positive long value indicating the maximum age in
2502
+ * milliseconds of a possible cached position that is
2503
+ * acceptable to return. If set to 0, it means that the
2504
+ * device cannot use a cached position and must attempt
2505
+ * to retrieve the real current position. If set to
2506
+ * Infinity the device must return a cached position
2507
+ * regardless of its age. Default: 0.
2508
+ */
2509
+ maximumAge: 6e4
2510
+ };
2511
+ return new Promise((t, r) => {
2512
+ var a;
2513
+ (a = navigator == null ? void 0 : navigator.geolocation) == null || a.getCurrentPosition(
2514
+ (n) => {
2515
+ t({
2516
+ latitude: n.coords.latitude,
2517
+ longitude: n.coords.longitude,
2518
+ accuracy: n.coords.accuracy
2519
+ });
2520
+ },
2521
+ (n) => {
2522
+ r(n);
2523
+ },
2524
+ e
2525
+ );
2526
+ });
2527
+ }, zn = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ S("div", { className: "flex items-center justify-between", children: [
2528
+ /* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
2529
+ /* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
2530
+ ] }) }, `${e}-${r}`)) : null;
2531
+ function Yn({
2532
+ data: e,
2533
+ formatter: t = (r) => r
2534
+ }) {
2535
+ const r = e.filter(
2536
+ (n) => typeof n == "number" && n > 0
2537
+ ), a = r.reduce(
2538
+ (n, o) => (n || 0) + (o || 0),
2539
+ 0
2540
+ );
2541
+ return t(a ? a / r.length : 0);
2542
+ }
2543
+ const qn = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Qn = new Intl.NumberFormat("en", {
2544
+ style: "decimal",
2545
+ signDisplay: "never",
2546
+ minimumFractionDigits: 0,
2547
+ maximumFractionDigits: 0
2548
+ }), Xn = (e) => Pa(e, {
2549
+ secondsDecimalDigits: 2,
2550
+ unitCount: 2
2551
+ }), Ha = (e) => g(
2552
+ "flex-1 space-y-6 overflow-y-auto rounded-md bg-slate-900 px-4 pb-10 text-base leading-6 text-slate-300 shadow-sm sm:text-base sm:leading-7",
2553
+ e || At ? "pt-4" : "pt-10"
2554
+ ), Zn = (e, t) => t === 1 ? e : `${e}s`, Ka = ({
2555
+ serverStats: e
2556
+ }) => /* @__PURE__ */ c(
2557
+ Xr,
2558
+ {
2559
+ mode: "light",
2560
+ row1: /* @__PURE__ */ S("div", { children: [
2561
+ Tt,
2562
+ " v",
2563
+ "3.0.2",
2564
+ " - ",
2565
+ Na,
2566
+ At && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
2567
+ ] }),
2568
+ row2: /* @__PURE__ */ S("div", { children: [
2569
+ "© ",
2570
+ (/* @__PURE__ */ new Date()).getFullYear(),
2571
+ " ",
2572
+ _a
2573
+ ] })
2574
+ }
2575
+ ), Ba = Ze(() => import("./LazyHeader.DicV3qjN.js")), Wa = () => {
2576
+ const { isAuthenticated: e } = xe();
2577
+ return /* @__PURE__ */ S(q, { children: [
2578
+ e && /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ba, {}) }),
2579
+ /* @__PURE__ */ S("div", { className: "flex items-center justify-center", children: [
2580
+ /* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(ba, {}) }),
2581
+ /* @__PURE__ */ S("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
2582
+ /* @__PURE__ */ c("h1", { children: Tt }),
2583
+ /* @__PURE__ */ c("h2", { children: Aa })
2584
+ ] })
2585
+ ] })
2586
+ ] });
2587
+ }, ja = () => {
2588
+ const { login: e, logoutReason: t } = xe(), [r, a] = U(""), [n, o] = U(""), [s, i] = U(!0), [l, u] = U({
2589
+ username: "",
2590
+ password: ""
2591
+ }), p = async (d) => {
2592
+ d.preventDefault(), await e(
2593
+ l.username,
2594
+ l.password,
2595
+ Q.CODE
2596
+ ) || (o(""), a("Invalid username or password"));
2597
+ };
2598
+ return z(() => {
2599
+ var d;
2600
+ (d = document.getElementById("logo")) == null || d.classList.add("fadeOut"), setTimeout(() => {
2601
+ var m;
2602
+ (m = document.getElementById("root")) == null || m.classList.replace("app-hidden", "fadeIn");
2603
+ }, 500);
2604
+ }), z(() => {
2605
+ t && o(t);
2606
+ }, [t]), /* @__PURE__ */ S(q, { children: [
2607
+ /* @__PURE__ */ S(Zr, { children: [
2608
+ /* @__PURE__ */ c("div", { className: Ha(), children: /* @__PURE__ */ c(Wa, {}) }),
2609
+ /* @__PURE__ */ c("form", { className: "mx-auto mt-5", onSubmit: p, children: /* @__PURE__ */ S(Sa, { rowGap: 7, width: "350px", children: [
2610
+ /* @__PURE__ */ c(ce, { span: 12, children: n && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: n }) }),
2611
+ /* @__PURE__ */ c(ce, { span: 12, children: /* @__PURE__ */ c(
2612
+ Re,
2613
+ {
2614
+ required: !0,
2615
+ autoCapitalize: "off",
2616
+ autoComplete: "off",
2617
+ autoCorrect: "off",
2618
+ mode: "dark",
2619
+ focusMode: "light",
2620
+ name: "username",
2621
+ label: "Username",
2622
+ onChange: (d) => {
2623
+ u({
2624
+ ...l,
2625
+ username: d.target.value
2626
+ }), a("");
2627
+ },
2628
+ error: r !== ""
2629
+ }
2630
+ ) }),
2631
+ /* @__PURE__ */ c(ce, { span: 12, children: /* @__PURE__ */ c(
2632
+ kt,
2633
+ {
2634
+ required: !0,
2635
+ autoCapitalize: "off",
2636
+ autoComplete: "off",
2637
+ autoCorrect: "off",
2638
+ mode: "dark",
2639
+ focusMode: "light",
2640
+ name: "password",
2641
+ label: xa,
2642
+ rightElement: /* @__PURE__ */ c(ft, { focusMode: "light", children: s ? /* @__PURE__ */ c(Ea, {}) : /* @__PURE__ */ c(wa, {}) }),
2643
+ onMaskChange: i,
2644
+ onChange: (d) => {
2645
+ u({
2646
+ ...l,
2647
+ password: d.target.value
2648
+ }), a("");
2649
+ },
2650
+ error: r !== "",
2651
+ helperText: r
2652
+ }
2653
+ ) }),
2654
+ /* @__PURE__ */ c(ce, { span: 12, children: /* @__PURE__ */ c(
2655
+ yt,
2656
+ {
2657
+ focusMode: "light",
2658
+ fullWidth: !0,
2659
+ noBorder: !0,
2660
+ type: "submit",
2661
+ className: "mb-4 mt-6",
2662
+ children: Ia
2663
+ }
2664
+ ) })
2665
+ ] }) })
2666
+ ] }),
2667
+ /* @__PURE__ */ c(Ka, {})
2668
+ ] });
2669
+ }, Ga = Ze(() => import("./App.BvO5AYgu.js").then((e) => e.App)), Va = ({ isComponent: e }) => {
2670
+ const { isAuthenticated: t } = xe();
2671
+ return t ? /* @__PURE__ */ c(et, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(Ga, { isComponent: e }) }) : /* @__PURE__ */ c(ja, {});
2672
+ }, Ja = ({
2673
+ isComponent: e = !1
2674
+ }) => /* @__PURE__ */ c(q, { children: /* @__PURE__ */ c(Kr, { clientId: Br, children: /* @__PURE__ */ c(Va, { isComponent: e }) }) }), eo = () => /* @__PURE__ */ c(Ja, { isComponent: !0 });
2675
+ export {
2676
+ gt as A,
2677
+ Un as ABOUT_TITLE,
2678
+ hn as ACTION_LOCATION,
2679
+ ln as ACTION_MESSAGE,
2680
+ un as ACTION_MODEL,
2681
+ dn as ACTION_RESET,
2682
+ mn as ACTION_RESTORE,
2683
+ gn as ACTION_SEARCH,
2684
+ fn as ACTION_SORT,
2685
+ pn as ACTION_STREAMING,
2686
+ Ka as AppFooter,
2687
+ Bn as CANCEL,
2688
+ jn as CARDS,
2689
+ Kn as CLEAR,
2690
+ Tn as E,
2691
+ on as ERROR_MESSAGE,
2692
+ Re as G,
2693
+ cn as GPT4_MAX_TOKENS,
2694
+ Pn as HISTORY_TITLE,
2695
+ bn as LOCAL_STORAGE_CHAT_DETAILS,
2696
+ vn as LOCAL_STORAGE_LOCATION,
2697
+ yn as LOCAL_STORAGE_PREFIX,
2698
+ wn as LOCAL_STORAGE_SEARCH,
2699
+ En as LOCAL_STORAGE_SORT,
2700
+ Dn as LOG_OUT,
2701
+ ta as M,
2702
+ sn as MODEL_GPT4,
2703
+ Wa as MessagesContainerHeader,
2704
+ An as N,
2705
+ Wn as NA,
2706
+ ft as O,
2707
+ $n as PROFILE_TITLE,
2708
+ tn as ROLE_ASSISTANT,
2709
+ nn as ROLE_HIDDEN,
2710
+ an as ROLE_INTERNAL,
2711
+ rn as ROLE_SYSTEM,
2712
+ en as ROLE_USER,
2713
+ Ne as S,
2714
+ Mn as SEND,
2715
+ Ln as STATS,
2716
+ kn as STATS_SEPARATOR,
2717
+ eo as SassySaint,
2718
+ Hn as TYPE_QUESTION,
2719
+ Et as U,
2720
+ Cn as a,
2721
+ Sa as b,
2722
+ Zr as c,
2723
+ In as c$1,
2724
+ Vn as convertLatitudeToDMS,
2725
+ Jn as convertLongitudeToDMS,
2726
+ Xn as durationFormatter,
2727
+ Yn as extractAverage,
2728
+ ht as f,
2729
+ ea as f$1,
2730
+ Oe as g,
2731
+ Fn as getCurrentGeoLocation,
2732
+ Ha as getMessageContaintWrapperClass,
2733
+ Ce as i,
2734
+ _n as i$1,
2735
+ qn as isLastMessageFromRole,
2736
+ ce as j,
2737
+ Rn as l,
2738
+ xn as n,
2739
+ Qn as numberFormatter,
2740
+ sa as o,
2741
+ On as p,
2742
+ Zn as pluralize,
2743
+ Nn as r,
2744
+ zn as renderDataAsList,
2745
+ Sn as s,
2746
+ Gn as truncate,
2747
+ xe as ur,
2748
+ yt as x
2749
+ };