@versini/sassysaint 1.0.7 → 1.0.9

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,3906 @@
1
+ import { jsx as c, jsxs as v, Fragment as le } from "react/jsx-runtime";
2
+ import G, { createContext as ur, useReducer as Et, useRef as F, useCallback as te, useEffect as j, useContext as vt, useSyncExternalStore as mr, useId as Tt, useMemo as hr, useState as J, useLayoutEffect as pr, lazy as St, Suspense as It } from "react";
3
+ import f from "clsx";
4
+ var gr = Object.defineProperty, fr = (e, t, r) => t in e ? gr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Le = (e, t, r) => fr(e, typeof t != "symbol" ? t + "" : t, r);
5
+ /*!
6
+ @versini/auth-provider v6.3.2
7
+ © 2024 gizmette.com
8
+ */
9
+ try {
10
+ window.__VERSINI_AUTH_CLIENT__ || (window.__VERSINI_AUTH_CLIENT__ = {
11
+ version: "6.3.2",
12
+ buildTime: "07/23/2024 01:37 PM EDT",
13
+ homepage: "https://github.com/aversini/auth-client",
14
+ license: "MIT"
15
+ });
16
+ } catch {
17
+ }
18
+ function M(e) {
19
+ const t = new Uint8Array(e);
20
+ let r = "";
21
+ for (const n of t)
22
+ r += String.fromCharCode(n);
23
+ return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
24
+ }
25
+ function Se(e) {
26
+ const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - t.length % 4) % 4, n = t.padEnd(t.length + r, "="), a = atob(n), o = new ArrayBuffer(a.length), s = new Uint8Array(o);
27
+ for (let i = 0; i < a.length; i++)
28
+ s[i] = a.charCodeAt(i);
29
+ return o;
30
+ }
31
+ function ze() {
32
+ return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
33
+ }
34
+ function At(e) {
35
+ const { id: t } = e;
36
+ return {
37
+ ...e,
38
+ id: Se(t),
39
+ transports: e.transports
40
+ };
41
+ }
42
+ function kt(e) {
43
+ return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
44
+ }
45
+ let R = class extends Error {
46
+ constructor({ message: t, code: r, cause: n, name: a }) {
47
+ super(t, { cause: n }), this.name = a ?? n.name, this.code = r;
48
+ }
49
+ };
50
+ function yr({ error: e, options: t }) {
51
+ var r, n;
52
+ const { publicKey: a } = t;
53
+ if (!a)
54
+ throw Error("options was missing required publicKey property");
55
+ if (e.name === "AbortError") {
56
+ if (t.signal instanceof AbortSignal)
57
+ return new R({
58
+ message: "Registration ceremony was sent an abort signal",
59
+ code: "ERROR_CEREMONY_ABORTED",
60
+ cause: e
61
+ });
62
+ } else if (e.name === "ConstraintError") {
63
+ if (((r = a.authenticatorSelection) == null ? void 0 : r.requireResidentKey) === !0)
64
+ return new R({
65
+ message: "Discoverable credentials were required but no available authenticator supported it",
66
+ code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
67
+ cause: e
68
+ });
69
+ if (((n = a.authenticatorSelection) == null ? void 0 : n.userVerification) === "required")
70
+ return new R({
71
+ message: "User verification was required but no available authenticator supported it",
72
+ code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
73
+ cause: e
74
+ });
75
+ } else {
76
+ if (e.name === "InvalidStateError")
77
+ return new R({
78
+ message: "The authenticator was previously registered",
79
+ code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
80
+ cause: e
81
+ });
82
+ if (e.name === "NotAllowedError")
83
+ return new R({
84
+ message: e.message,
85
+ code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
86
+ cause: e
87
+ });
88
+ if (e.name === "NotSupportedError")
89
+ return a.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new R({
90
+ message: 'No entry in pubKeyCredParams was of type "public-key"',
91
+ code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
92
+ cause: e
93
+ }) : new R({
94
+ message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
95
+ code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
96
+ cause: e
97
+ });
98
+ if (e.name === "SecurityError") {
99
+ const o = window.location.hostname;
100
+ if (kt(o)) {
101
+ if (a.rp.id !== o)
102
+ return new R({
103
+ message: `The RP ID "${a.rp.id}" is invalid for this domain`,
104
+ code: "ERROR_INVALID_RP_ID",
105
+ cause: e
106
+ });
107
+ } else return new R({
108
+ message: `${window.location.hostname} is an invalid domain`,
109
+ code: "ERROR_INVALID_DOMAIN",
110
+ cause: e
111
+ });
112
+ } else if (e.name === "TypeError") {
113
+ if (a.user.id.byteLength < 1 || a.user.id.byteLength > 64)
114
+ return new R({
115
+ message: "User ID was not between 1 and 64 characters",
116
+ code: "ERROR_INVALID_USER_ID_LENGTH",
117
+ cause: e
118
+ });
119
+ } else if (e.name === "UnknownError")
120
+ return new R({
121
+ message: "The authenticator was unable to process the specified options, or could not create a new credential",
122
+ code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
123
+ cause: e
124
+ });
125
+ }
126
+ return e;
127
+ }
128
+ class br {
129
+ createNewAbortSignal() {
130
+ if (this.controller) {
131
+ const r = new Error("Cancelling existing WebAuthn API call for new one");
132
+ r.name = "AbortError", this.controller.abort(r);
133
+ }
134
+ const t = new AbortController();
135
+ return this.controller = t, t.signal;
136
+ }
137
+ cancelCeremony() {
138
+ if (this.controller) {
139
+ const t = new Error("Manually cancelling existing WebAuthn API call");
140
+ t.name = "AbortError", this.controller.abort(t), this.controller = void 0;
141
+ }
142
+ }
143
+ }
144
+ const _t = new br(), wr = ["cross-platform", "platform"];
145
+ function Rt(e) {
146
+ if (e && !(wr.indexOf(e) < 0))
147
+ return e;
148
+ }
149
+ async function Er(e) {
150
+ var t;
151
+ if (!ze())
152
+ throw new Error("WebAuthn is not supported in this browser");
153
+ const r = { publicKey: {
154
+ ...e,
155
+ challenge: Se(e.challenge),
156
+ user: {
157
+ ...e.user,
158
+ id: Se(e.user.id)
159
+ },
160
+ excludeCredentials: (t = e.excludeCredentials) == null ? void 0 : t.map(At)
161
+ } };
162
+ r.signal = _t.createNewAbortSignal();
163
+ let n;
164
+ try {
165
+ n = await navigator.credentials.create(r);
166
+ } catch (l) {
167
+ throw yr({ error: l, options: r });
168
+ }
169
+ if (!n)
170
+ throw new Error("Registration was not completed");
171
+ const { id: a, rawId: o, response: s, type: i } = n;
172
+ let p;
173
+ typeof s.getTransports == "function" && (p = s.getTransports());
174
+ let m;
175
+ if (typeof s.getPublicKeyAlgorithm == "function")
176
+ try {
177
+ m = s.getPublicKeyAlgorithm();
178
+ } catch (l) {
179
+ Ue("getPublicKeyAlgorithm()", l);
180
+ }
181
+ let u;
182
+ if (typeof s.getPublicKey == "function")
183
+ try {
184
+ const l = s.getPublicKey();
185
+ l !== null && (u = M(l));
186
+ } catch (l) {
187
+ Ue("getPublicKey()", l);
188
+ }
189
+ let g;
190
+ if (typeof s.getAuthenticatorData == "function")
191
+ try {
192
+ g = M(s.getAuthenticatorData());
193
+ } catch (l) {
194
+ Ue("getAuthenticatorData()", l);
195
+ }
196
+ return {
197
+ id: a,
198
+ rawId: M(o),
199
+ response: {
200
+ attestationObject: M(s.attestationObject),
201
+ clientDataJSON: M(s.clientDataJSON),
202
+ transports: p,
203
+ publicKeyAlgorithm: m,
204
+ publicKey: u,
205
+ authenticatorData: g
206
+ },
207
+ type: i,
208
+ clientExtensionResults: n.getClientExtensionResults(),
209
+ authenticatorAttachment: Rt(n.authenticatorAttachment)
210
+ };
211
+ }
212
+ function Ue(e, t) {
213
+ console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
214
+ `, t);
215
+ }
216
+ function vr() {
217
+ if (!ze())
218
+ return new Promise((t) => t(!1));
219
+ const e = window.PublicKeyCredential;
220
+ return e.isConditionalMediationAvailable === void 0 ? new Promise((t) => t(!1)) : e.isConditionalMediationAvailable();
221
+ }
222
+ function Tr({ error: e, options: t }) {
223
+ const { publicKey: r } = t;
224
+ if (!r)
225
+ throw Error("options was missing required publicKey property");
226
+ if (e.name === "AbortError") {
227
+ if (t.signal instanceof AbortSignal)
228
+ return new R({
229
+ message: "Authentication ceremony was sent an abort signal",
230
+ code: "ERROR_CEREMONY_ABORTED",
231
+ cause: e
232
+ });
233
+ } else {
234
+ if (e.name === "NotAllowedError")
235
+ return new R({
236
+ message: e.message,
237
+ code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
238
+ cause: e
239
+ });
240
+ if (e.name === "SecurityError") {
241
+ const n = window.location.hostname;
242
+ if (kt(n)) {
243
+ if (r.rpId !== n)
244
+ return new R({
245
+ message: `The RP ID "${r.rpId}" is invalid for this domain`,
246
+ code: "ERROR_INVALID_RP_ID",
247
+ cause: e
248
+ });
249
+ } else return new R({
250
+ message: `${window.location.hostname} is an invalid domain`,
251
+ code: "ERROR_INVALID_DOMAIN",
252
+ cause: e
253
+ });
254
+ } else if (e.name === "UnknownError")
255
+ return new R({
256
+ message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
257
+ code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
258
+ cause: e
259
+ });
260
+ }
261
+ return e;
262
+ }
263
+ async function Sr(e, t = !1) {
264
+ var r, n;
265
+ if (!ze())
266
+ throw new Error("WebAuthn is not supported in this browser");
267
+ let a;
268
+ ((r = e.allowCredentials) == null ? void 0 : r.length) !== 0 && (a = (n = e.allowCredentials) == null ? void 0 : n.map(At));
269
+ const o = {
270
+ ...e,
271
+ challenge: Se(e.challenge),
272
+ allowCredentials: a
273
+ }, s = {};
274
+ if (t) {
275
+ if (!await vr())
276
+ throw Error("Browser does not support WebAuthn autofill");
277
+ if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1)
278
+ throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
279
+ s.mediation = "conditional", o.allowCredentials = [];
280
+ }
281
+ s.publicKey = o, s.signal = _t.createNewAbortSignal();
282
+ let i;
283
+ try {
284
+ i = await navigator.credentials.get(s);
285
+ } catch (d) {
286
+ throw Tr({ error: d, options: s });
287
+ }
288
+ if (!i)
289
+ throw new Error("Authentication was not completed");
290
+ const { id: p, rawId: m, response: u, type: g } = i;
291
+ let l;
292
+ return u.userHandle && (l = M(u.userHandle)), {
293
+ id: p,
294
+ rawId: M(m),
295
+ response: {
296
+ authenticatorData: M(u.authenticatorData),
297
+ clientDataJSON: M(u.clientDataJSON),
298
+ signature: M(u.signature),
299
+ userHandle: l
300
+ },
301
+ type: g,
302
+ clientExtensionResults: i.getClientExtensionResults(),
303
+ authenticatorAttachment: Rt(i.authenticatorAttachment)
304
+ };
305
+ }
306
+ /*!
307
+ @versini/auth-common v3.3.0
308
+ © 2024 gizmette.com
309
+ */
310
+ try {
311
+ window.__VERSINI_AUTH_COMMON__ || (window.__VERSINI_AUTH_COMMON__ = {
312
+ version: "3.3.0",
313
+ buildTime: "07/23/2024 01:36 PM EDT",
314
+ homepage: "https://github.com/aversini/auth-client",
315
+ license: "MIT"
316
+ });
317
+ } catch {
318
+ }
319
+ const re = {
320
+ ID_TOKEN: "id_token",
321
+ ACCESS_TOKEN: "token",
322
+ ID_AND_ACCESS_TOKEN: "id_token token",
323
+ CODE: "code",
324
+ REFRESH_TOKEN: "refresh_token",
325
+ PASSKEY: "passkey"
326
+ }, Nt = {
327
+ CLIENT_ID: "X-Auth-ClientId"
328
+ }, N = {
329
+ ALG: "RS256",
330
+ USER_ID_KEY: "sub",
331
+ TOKEN_ID_KEY: "__raw",
332
+ NONCE_KEY: "_nonce",
333
+ USERNAME_KEY: "username",
334
+ AUTH_TYPE_KEY: "auth_type",
335
+ EXPIRES_AT_KEY: "exp",
336
+ CREATED_AT_KEY: "iat",
337
+ SCOPES_KEY: "scopes",
338
+ ISSUER: "gizmette.com"
339
+ }, Ir = `-----BEGIN PUBLIC KEY-----
340
+ MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
341
+ w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
342
+ i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
343
+ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
344
+ l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
345
+ sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
346
+ awIDAQAB
347
+ -----END PUBLIC KEY-----`, Re = {
348
+ AUTHENTICATE: "authenticate",
349
+ CODE: "code",
350
+ LOGOUT: "logout"
351
+ }, Ne = crypto, xt = (e) => e instanceof CryptoKey, ue = new TextEncoder(), de = new TextDecoder();
352
+ function Ar(...e) {
353
+ const t = e.reduce((a, { length: o }) => a + o, 0), r = new Uint8Array(t);
354
+ let n = 0;
355
+ for (const a of e)
356
+ r.set(a, n), n += a.length;
357
+ return r;
358
+ }
359
+ const kr = (e) => {
360
+ const t = atob(e), r = new Uint8Array(t.length);
361
+ for (let n = 0; n < t.length; n++)
362
+ r[n] = t.charCodeAt(n);
363
+ return r;
364
+ }, ie = (e) => {
365
+ let t = e;
366
+ t instanceof Uint8Array && (t = de.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
367
+ try {
368
+ return kr(t);
369
+ } catch {
370
+ throw new TypeError("The input to be decoded is not correctly encoded.");
371
+ }
372
+ };
373
+ let Y = class extends Error {
374
+ static get code() {
375
+ return "ERR_JOSE_GENERIC";
376
+ }
377
+ constructor(t) {
378
+ var r;
379
+ super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
380
+ }
381
+ }, $ = class extends Y {
382
+ static get code() {
383
+ return "ERR_JWT_CLAIM_VALIDATION_FAILED";
384
+ }
385
+ constructor(t, r, n = "unspecified", a = "unspecified") {
386
+ super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = n, this.reason = a, this.payload = r;
387
+ }
388
+ }, rt = class extends Y {
389
+ static get code() {
390
+ return "ERR_JWT_EXPIRED";
391
+ }
392
+ constructor(e, t, r = "unspecified", n = "unspecified") {
393
+ super(e), this.code = "ERR_JWT_EXPIRED", this.claim = r, this.reason = n, this.payload = t;
394
+ }
395
+ };
396
+ class _r extends Y {
397
+ constructor() {
398
+ super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
399
+ }
400
+ static get code() {
401
+ return "ERR_JOSE_ALG_NOT_ALLOWED";
402
+ }
403
+ }
404
+ let V = class extends Y {
405
+ constructor() {
406
+ super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
407
+ }
408
+ static get code() {
409
+ return "ERR_JOSE_NOT_SUPPORTED";
410
+ }
411
+ }, _ = class extends Y {
412
+ constructor() {
413
+ super(...arguments), this.code = "ERR_JWS_INVALID";
414
+ }
415
+ static get code() {
416
+ return "ERR_JWS_INVALID";
417
+ }
418
+ }, K = class extends Y {
419
+ constructor() {
420
+ super(...arguments), this.code = "ERR_JWT_INVALID";
421
+ }
422
+ static get code() {
423
+ return "ERR_JWT_INVALID";
424
+ }
425
+ };
426
+ class Rr extends Y {
427
+ constructor() {
428
+ super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
429
+ }
430
+ static get code() {
431
+ return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
432
+ }
433
+ }
434
+ function H(e, t = "algorithm.name") {
435
+ return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
436
+ }
437
+ function me(e, t) {
438
+ return e.name === t;
439
+ }
440
+ function He(e) {
441
+ return parseInt(e.name.slice(4), 10);
442
+ }
443
+ function Nr(e) {
444
+ switch (e) {
445
+ case "ES256":
446
+ return "P-256";
447
+ case "ES384":
448
+ return "P-384";
449
+ case "ES512":
450
+ return "P-521";
451
+ default:
452
+ throw new Error("unreachable");
453
+ }
454
+ }
455
+ function xr(e, t) {
456
+ if (t.length && !t.some((r) => e.usages.includes(r))) {
457
+ let r = "CryptoKey does not support this operation, its usages must include ";
458
+ if (t.length > 2) {
459
+ const n = t.pop();
460
+ r += `one of ${t.join(", ")}, or ${n}.`;
461
+ } else t.length === 2 ? r += `one of ${t[0]} or ${t[1]}.` : r += `${t[0]}.`;
462
+ throw new TypeError(r);
463
+ }
464
+ }
465
+ function Cr(e, t, ...r) {
466
+ switch (t) {
467
+ case "HS256":
468
+ case "HS384":
469
+ case "HS512": {
470
+ if (!me(e.algorithm, "HMAC"))
471
+ throw H("HMAC");
472
+ const n = parseInt(t.slice(2), 10);
473
+ if (He(e.algorithm.hash) !== n)
474
+ throw H(`SHA-${n}`, "algorithm.hash");
475
+ break;
476
+ }
477
+ case "RS256":
478
+ case "RS384":
479
+ case "RS512": {
480
+ if (!me(e.algorithm, "RSASSA-PKCS1-v1_5"))
481
+ throw H("RSASSA-PKCS1-v1_5");
482
+ const n = parseInt(t.slice(2), 10);
483
+ if (He(e.algorithm.hash) !== n)
484
+ throw H(`SHA-${n}`, "algorithm.hash");
485
+ break;
486
+ }
487
+ case "PS256":
488
+ case "PS384":
489
+ case "PS512": {
490
+ if (!me(e.algorithm, "RSA-PSS"))
491
+ throw H("RSA-PSS");
492
+ const n = parseInt(t.slice(2), 10);
493
+ if (He(e.algorithm.hash) !== n)
494
+ throw H(`SHA-${n}`, "algorithm.hash");
495
+ break;
496
+ }
497
+ case "EdDSA": {
498
+ if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
499
+ throw H("Ed25519 or Ed448");
500
+ break;
501
+ }
502
+ case "ES256":
503
+ case "ES384":
504
+ case "ES512": {
505
+ if (!me(e.algorithm, "ECDSA"))
506
+ throw H("ECDSA");
507
+ const n = Nr(t);
508
+ if (e.algorithm.namedCurve !== n)
509
+ throw H(n, "algorithm.namedCurve");
510
+ break;
511
+ }
512
+ default:
513
+ throw new TypeError("CryptoKey does not support this operation");
514
+ }
515
+ xr(e, r);
516
+ }
517
+ function Ct(e, t, ...r) {
518
+ var n;
519
+ if (r.length > 2) {
520
+ const a = r.pop();
521
+ e += `one of type ${r.join(", ")}, or ${a}.`;
522
+ } else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
523
+ return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (n = t.constructor) != null && n.name && (e += ` Received an instance of ${t.constructor.name}`), e;
524
+ }
525
+ const nt = (e, ...t) => Ct("Key must be ", e, ...t);
526
+ function Ot(e, t, ...r) {
527
+ return Ct(`Key for the ${e} algorithm must be `, t, ...r);
528
+ }
529
+ const Pt = (e) => xt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ie = ["CryptoKey"], Or = (...e) => {
530
+ const t = e.filter(Boolean);
531
+ if (t.length === 0 || t.length === 1)
532
+ return !0;
533
+ let r;
534
+ for (const n of t) {
535
+ const a = Object.keys(n);
536
+ if (!r || r.size === 0) {
537
+ r = new Set(a);
538
+ continue;
539
+ }
540
+ for (const o of a) {
541
+ if (r.has(o))
542
+ return !1;
543
+ r.add(o);
544
+ }
545
+ }
546
+ return !0;
547
+ };
548
+ function Pr(e) {
549
+ return typeof e == "object" && e !== null;
550
+ }
551
+ function Ae(e) {
552
+ if (!Pr(e) || Object.prototype.toString.call(e) !== "[object Object]")
553
+ return !1;
554
+ if (Object.getPrototypeOf(e) === null)
555
+ return !0;
556
+ let t = e;
557
+ for (; Object.getPrototypeOf(t) !== null; )
558
+ t = Object.getPrototypeOf(t);
559
+ return Object.getPrototypeOf(e) === t;
560
+ }
561
+ const Dr = (e, t) => {
562
+ if (e.startsWith("RS") || e.startsWith("PS")) {
563
+ const { modulusLength: r } = t.algorithm;
564
+ if (typeof r != "number" || r < 2048)
565
+ throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
566
+ }
567
+ };
568
+ function $r(e) {
569
+ let t, r;
570
+ switch (e.kty) {
571
+ case "RSA": {
572
+ switch (e.alg) {
573
+ case "PS256":
574
+ case "PS384":
575
+ case "PS512":
576
+ t = { name: "RSA-PSS", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
577
+ break;
578
+ case "RS256":
579
+ case "RS384":
580
+ case "RS512":
581
+ t = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${e.alg.slice(-3)}` }, r = e.d ? ["sign"] : ["verify"];
582
+ break;
583
+ case "RSA-OAEP":
584
+ case "RSA-OAEP-256":
585
+ case "RSA-OAEP-384":
586
+ case "RSA-OAEP-512":
587
+ t = {
588
+ name: "RSA-OAEP",
589
+ hash: `SHA-${parseInt(e.alg.slice(-3), 10) || 1}`
590
+ }, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
591
+ break;
592
+ default:
593
+ throw new V('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
594
+ }
595
+ break;
596
+ }
597
+ case "EC": {
598
+ switch (e.alg) {
599
+ case "ES256":
600
+ t = { name: "ECDSA", namedCurve: "P-256" }, r = e.d ? ["sign"] : ["verify"];
601
+ break;
602
+ case "ES384":
603
+ t = { name: "ECDSA", namedCurve: "P-384" }, r = e.d ? ["sign"] : ["verify"];
604
+ break;
605
+ case "ES512":
606
+ t = { name: "ECDSA", namedCurve: "P-521" }, r = e.d ? ["sign"] : ["verify"];
607
+ break;
608
+ case "ECDH-ES":
609
+ case "ECDH-ES+A128KW":
610
+ case "ECDH-ES+A192KW":
611
+ case "ECDH-ES+A256KW":
612
+ t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
613
+ break;
614
+ default:
615
+ throw new V('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
616
+ }
617
+ break;
618
+ }
619
+ case "OKP": {
620
+ switch (e.alg) {
621
+ case "EdDSA":
622
+ t = { name: e.crv }, r = e.d ? ["sign"] : ["verify"];
623
+ break;
624
+ case "ECDH-ES":
625
+ case "ECDH-ES+A128KW":
626
+ case "ECDH-ES+A192KW":
627
+ case "ECDH-ES+A256KW":
628
+ t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
629
+ break;
630
+ default:
631
+ throw new V('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
632
+ }
633
+ break;
634
+ }
635
+ default:
636
+ throw new V('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
637
+ }
638
+ return { algorithm: t, keyUsages: r };
639
+ }
640
+ const Mr = async (e) => {
641
+ if (!e.alg)
642
+ throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
643
+ const { algorithm: t, keyUsages: r } = $r(e), n = [
644
+ t,
645
+ e.ext ?? !1,
646
+ e.key_ops ?? r
647
+ ], a = { ...e };
648
+ return delete a.alg, delete a.use, Ne.subtle.importKey("jwk", a, ...n);
649
+ }, Dt = (e) => ie(e);
650
+ let Ke, Ge;
651
+ const $t = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Mt = async (e, t, r, n) => {
652
+ let a = e.get(t);
653
+ if (a != null && a[n])
654
+ return a[n];
655
+ const o = await Mr({ ...r, alg: n });
656
+ return a ? a[n] = o : e.set(t, { [n]: o }), o;
657
+ }, Lr = (e, t) => {
658
+ if ($t(e)) {
659
+ let r = e.export({ format: "jwk" });
660
+ return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Dt(r.k) : (Ge || (Ge = /* @__PURE__ */ new WeakMap()), Mt(Ge, e, r, t));
661
+ }
662
+ return e;
663
+ }, Ur = (e, t) => {
664
+ if ($t(e)) {
665
+ let r = e.export({ format: "jwk" });
666
+ return r.k ? Dt(r.k) : (Ke || (Ke = /* @__PURE__ */ new WeakMap()), Mt(Ke, e, r, t));
667
+ }
668
+ return e;
669
+ }, Hr = { normalizePublicKey: Lr, normalizePrivateKey: Ur }, W = (e, t, r = 0) => {
670
+ r === 0 && (t.unshift(t.length), t.unshift(6));
671
+ const n = e.indexOf(t[0], r);
672
+ if (n === -1)
673
+ return !1;
674
+ const a = e.subarray(n, n + t.length);
675
+ return a.length !== t.length ? !1 : a.every((o, s) => o === t[s]) || W(e, t, n + 1);
676
+ }, at = (e) => {
677
+ switch (!0) {
678
+ case W(e, [42, 134, 72, 206, 61, 3, 1, 7]):
679
+ return "P-256";
680
+ case W(e, [43, 129, 4, 0, 34]):
681
+ return "P-384";
682
+ case W(e, [43, 129, 4, 0, 35]):
683
+ return "P-521";
684
+ case W(e, [43, 101, 110]):
685
+ return "X25519";
686
+ case W(e, [43, 101, 111]):
687
+ return "X448";
688
+ case W(e, [43, 101, 112]):
689
+ return "Ed25519";
690
+ case W(e, [43, 101, 113]):
691
+ return "Ed448";
692
+ default:
693
+ throw new V("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
694
+ }
695
+ }, Kr = async (e, t, r, n, a) => {
696
+ let o, s;
697
+ const i = new Uint8Array(atob(r.replace(e, "")).split("").map((p) => p.charCodeAt(0)));
698
+ switch (n) {
699
+ case "PS256":
700
+ case "PS384":
701
+ case "PS512":
702
+ o = { name: "RSA-PSS", hash: `SHA-${n.slice(-3)}` }, s = ["verify"];
703
+ break;
704
+ case "RS256":
705
+ case "RS384":
706
+ case "RS512":
707
+ o = { name: "RSASSA-PKCS1-v1_5", hash: `SHA-${n.slice(-3)}` }, s = ["verify"];
708
+ break;
709
+ case "RSA-OAEP":
710
+ case "RSA-OAEP-256":
711
+ case "RSA-OAEP-384":
712
+ case "RSA-OAEP-512":
713
+ o = {
714
+ name: "RSA-OAEP",
715
+ hash: `SHA-${parseInt(n.slice(-3), 10) || 1}`
716
+ }, s = ["encrypt", "wrapKey"];
717
+ break;
718
+ case "ES256":
719
+ o = { name: "ECDSA", namedCurve: "P-256" }, s = ["verify"];
720
+ break;
721
+ case "ES384":
722
+ o = { name: "ECDSA", namedCurve: "P-384" }, s = ["verify"];
723
+ break;
724
+ case "ES512":
725
+ o = { name: "ECDSA", namedCurve: "P-521" }, s = ["verify"];
726
+ break;
727
+ case "ECDH-ES":
728
+ case "ECDH-ES+A128KW":
729
+ case "ECDH-ES+A192KW":
730
+ case "ECDH-ES+A256KW": {
731
+ const p = at(i);
732
+ o = p.startsWith("P-") ? { name: "ECDH", namedCurve: p } : { name: p }, s = [];
733
+ break;
734
+ }
735
+ case "EdDSA":
736
+ o = { name: at(i) }, s = ["verify"];
737
+ break;
738
+ default:
739
+ throw new V('Invalid or unsupported "alg" (Algorithm) value');
740
+ }
741
+ return Ne.subtle.importKey(t, i, o, !1, s);
742
+ }, Gr = (e, t, r) => Kr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
743
+ async function Br(e, t, r) {
744
+ if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
745
+ throw new TypeError('"spki" must be SPKI formatted string');
746
+ return Gr(e, t);
747
+ }
748
+ const ve = (e) => e == null ? void 0 : e[Symbol.toStringTag], Wr = (e, t) => {
749
+ if (!(t instanceof Uint8Array)) {
750
+ if (!Pt(t))
751
+ throw new TypeError(Ot(e, t, ...Ie, "Uint8Array"));
752
+ if (t.type !== "secret")
753
+ throw new TypeError(`${ve(t)} instances for symmetric algorithms must be of type "secret"`);
754
+ }
755
+ }, Vr = (e, t, r) => {
756
+ if (!Pt(t))
757
+ throw new TypeError(Ot(e, t, ...Ie));
758
+ if (t.type === "secret")
759
+ throw new TypeError(`${ve(t)} instances for asymmetric algorithms must not be of type "secret"`);
760
+ if (t.algorithm && r === "verify" && t.type === "private")
761
+ throw new TypeError(`${ve(t)} instances for asymmetric algorithm verifying must be of type "public"`);
762
+ if (t.algorithm && r === "encrypt" && t.type === "private")
763
+ throw new TypeError(`${ve(t)} instances for asymmetric algorithm encryption must be of type "public"`);
764
+ }, Fr = (e, t, r) => {
765
+ e.startsWith("HS") || e === "dir" || e.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(e) ? Wr(e, t) : Vr(e, t, r);
766
+ };
767
+ function Jr(e, t, r, n, a) {
768
+ if (a.crit !== void 0 && (n == null ? void 0 : n.crit) === void 0)
769
+ throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
770
+ if (!n || n.crit === void 0)
771
+ return /* @__PURE__ */ new Set();
772
+ if (!Array.isArray(n.crit) || n.crit.length === 0 || n.crit.some((s) => typeof s != "string" || s.length === 0))
773
+ throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
774
+ let o;
775
+ r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
776
+ for (const s of n.crit) {
777
+ if (!o.has(s))
778
+ throw new V(`Extension Header Parameter "${s}" is not recognized`);
779
+ if (a[s] === void 0)
780
+ throw new e(`Extension Header Parameter "${s}" is missing`);
781
+ if (o.get(s) && n[s] === void 0)
782
+ throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`);
783
+ }
784
+ return new Set(n.crit);
785
+ }
786
+ const jr = (e, t) => {
787
+ if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
788
+ throw new TypeError(`"${e}" option must be an array of strings`);
789
+ if (t)
790
+ return new Set(t);
791
+ };
792
+ function Yr(e, t) {
793
+ const r = `SHA-${e.slice(-3)}`;
794
+ switch (e) {
795
+ case "HS256":
796
+ case "HS384":
797
+ case "HS512":
798
+ return { hash: r, name: "HMAC" };
799
+ case "PS256":
800
+ case "PS384":
801
+ case "PS512":
802
+ return { hash: r, name: "RSA-PSS", saltLength: e.slice(-3) >> 3 };
803
+ case "RS256":
804
+ case "RS384":
805
+ case "RS512":
806
+ return { hash: r, name: "RSASSA-PKCS1-v1_5" };
807
+ case "ES256":
808
+ case "ES384":
809
+ case "ES512":
810
+ return { hash: r, name: "ECDSA", namedCurve: t.namedCurve };
811
+ case "EdDSA":
812
+ return { name: t.name };
813
+ default:
814
+ throw new V(`alg ${e} is not supported either by JOSE or your javascript runtime`);
815
+ }
816
+ }
817
+ async function zr(e, t, r) {
818
+ if (t = await Hr.normalizePublicKey(t, e), xt(t))
819
+ return Cr(t, e, r), t;
820
+ if (t instanceof Uint8Array) {
821
+ if (!e.startsWith("HS"))
822
+ throw new TypeError(nt(t, ...Ie));
823
+ return Ne.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
824
+ }
825
+ throw new TypeError(nt(t, ...Ie, "Uint8Array"));
826
+ }
827
+ const qr = async (e, t, r, n) => {
828
+ const a = await zr(e, t, "verify");
829
+ Dr(e, a);
830
+ const o = Yr(e, a.algorithm);
831
+ try {
832
+ return await Ne.subtle.verify(o, a, r, n);
833
+ } catch {
834
+ return !1;
835
+ }
836
+ };
837
+ async function Qr(e, t, r) {
838
+ if (!Ae(e))
839
+ throw new _("Flattened JWS must be an object");
840
+ if (e.protected === void 0 && e.header === void 0)
841
+ throw new _('Flattened JWS must have either of the "protected" or "header" members');
842
+ if (e.protected !== void 0 && typeof e.protected != "string")
843
+ throw new _("JWS Protected Header incorrect type");
844
+ if (e.payload === void 0)
845
+ throw new _("JWS Payload missing");
846
+ if (typeof e.signature != "string")
847
+ throw new _("JWS Signature missing or incorrect type");
848
+ if (e.header !== void 0 && !Ae(e.header))
849
+ throw new _("JWS Unprotected Header incorrect type");
850
+ let n = {};
851
+ if (e.protected)
852
+ try {
853
+ const h = ie(e.protected);
854
+ n = JSON.parse(de.decode(h));
855
+ } catch {
856
+ throw new _("JWS Protected Header is invalid");
857
+ }
858
+ if (!Or(n, e.header))
859
+ throw new _("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
860
+ const a = {
861
+ ...n,
862
+ ...e.header
863
+ }, o = Jr(_, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, n, a);
864
+ let s = !0;
865
+ if (o.has("b64") && (s = n.b64, typeof s != "boolean"))
866
+ throw new _('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
867
+ const { alg: i } = a;
868
+ if (typeof i != "string" || !i)
869
+ throw new _('JWS "alg" (Algorithm) Header Parameter missing or invalid');
870
+ const p = r && jr("algorithms", r.algorithms);
871
+ if (p && !p.has(i))
872
+ throw new _r('"alg" (Algorithm) Header Parameter value not allowed');
873
+ if (s) {
874
+ if (typeof e.payload != "string")
875
+ throw new _("JWS Payload must be a string");
876
+ } else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
877
+ throw new _("JWS Payload must be a string or an Uint8Array instance");
878
+ let m = !1;
879
+ typeof t == "function" && (t = await t(n, e), m = !0), Fr(i, t, "verify");
880
+ const u = Ar(ue.encode(e.protected ?? ""), ue.encode("."), typeof e.payload == "string" ? ue.encode(e.payload) : e.payload);
881
+ let g;
882
+ try {
883
+ g = ie(e.signature);
884
+ } catch {
885
+ throw new _("Failed to base64url decode the signature");
886
+ }
887
+ if (!await qr(i, t, g, u))
888
+ throw new Rr();
889
+ let l;
890
+ if (s)
891
+ try {
892
+ l = ie(e.payload);
893
+ } catch {
894
+ throw new _("Failed to base64url decode the payload");
895
+ }
896
+ else typeof e.payload == "string" ? l = ue.encode(e.payload) : l = e.payload;
897
+ const d = { payload: l };
898
+ return e.protected !== void 0 && (d.protectedHeader = n), e.header !== void 0 && (d.unprotectedHeader = e.header), m ? { ...d, key: t } : d;
899
+ }
900
+ async function Xr(e, t, r) {
901
+ if (e instanceof Uint8Array && (e = de.decode(e)), typeof e != "string")
902
+ throw new _("Compact JWS must be a string or Uint8Array");
903
+ const { 0: n, 1: a, 2: o, length: s } = e.split(".");
904
+ if (s !== 3)
905
+ throw new _("Invalid Compact JWS");
906
+ const i = await Qr({ payload: a, protected: n, signature: o }, t, r), p = { payload: i.payload, protectedHeader: i.protectedHeader };
907
+ return typeof t == "function" ? { ...p, key: i.key } : p;
908
+ }
909
+ const Zr = (e) => Math.floor(e.getTime() / 1e3), Lt = 60, Ut = Lt * 60, qe = Ut * 24, en = qe * 7, tn = qe * 365.25, rn = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, ot = (e) => {
910
+ const t = rn.exec(e);
911
+ if (!t || t[4] && t[1])
912
+ throw new TypeError("Invalid time period format");
913
+ const r = parseFloat(t[2]), n = t[3].toLowerCase();
914
+ let a;
915
+ switch (n) {
916
+ case "sec":
917
+ case "secs":
918
+ case "second":
919
+ case "seconds":
920
+ case "s":
921
+ a = Math.round(r);
922
+ break;
923
+ case "minute":
924
+ case "minutes":
925
+ case "min":
926
+ case "mins":
927
+ case "m":
928
+ a = Math.round(r * Lt);
929
+ break;
930
+ case "hour":
931
+ case "hours":
932
+ case "hr":
933
+ case "hrs":
934
+ case "h":
935
+ a = Math.round(r * Ut);
936
+ break;
937
+ case "day":
938
+ case "days":
939
+ case "d":
940
+ a = Math.round(r * qe);
941
+ break;
942
+ case "week":
943
+ case "weeks":
944
+ case "w":
945
+ a = Math.round(r * en);
946
+ break;
947
+ default:
948
+ a = Math.round(r * tn);
949
+ break;
950
+ }
951
+ return t[1] === "-" || t[4] === "ago" ? -a : a;
952
+ }, st = (e) => e.toLowerCase().replace(/^application\//, ""), nn = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, an = (e, t, r = {}) => {
953
+ let n;
954
+ try {
955
+ n = JSON.parse(de.decode(t));
956
+ } catch {
957
+ }
958
+ if (!Ae(n))
959
+ throw new K("JWT Claims Set must be a top-level JSON object");
960
+ const { typ: a } = r;
961
+ if (a && (typeof e.typ != "string" || st(e.typ) !== st(a)))
962
+ throw new $('unexpected "typ" JWT header value', n, "typ", "check_failed");
963
+ const { requiredClaims: o = [], issuer: s, subject: i, audience: p, maxTokenAge: m } = r, u = [...o];
964
+ m !== void 0 && u.push("iat"), p !== void 0 && u.push("aud"), i !== void 0 && u.push("sub"), s !== void 0 && u.push("iss");
965
+ for (const h of new Set(u.reverse()))
966
+ if (!(h in n))
967
+ throw new $(`missing required "${h}" claim`, n, h, "missing");
968
+ if (s && !(Array.isArray(s) ? s : [s]).includes(n.iss))
969
+ throw new $('unexpected "iss" claim value', n, "iss", "check_failed");
970
+ if (i && n.sub !== i)
971
+ throw new $('unexpected "sub" claim value', n, "sub", "check_failed");
972
+ if (p && !nn(n.aud, typeof p == "string" ? [p] : p))
973
+ throw new $('unexpected "aud" claim value', n, "aud", "check_failed");
974
+ let g;
975
+ switch (typeof r.clockTolerance) {
976
+ case "string":
977
+ g = ot(r.clockTolerance);
978
+ break;
979
+ case "number":
980
+ g = r.clockTolerance;
981
+ break;
982
+ case "undefined":
983
+ g = 0;
984
+ break;
985
+ default:
986
+ throw new TypeError("Invalid clockTolerance option type");
987
+ }
988
+ const { currentDate: l } = r, d = Zr(l || /* @__PURE__ */ new Date());
989
+ if ((n.iat !== void 0 || m) && typeof n.iat != "number")
990
+ throw new $('"iat" claim must be a number', n, "iat", "invalid");
991
+ if (n.nbf !== void 0) {
992
+ if (typeof n.nbf != "number")
993
+ throw new $('"nbf" claim must be a number', n, "nbf", "invalid");
994
+ if (n.nbf > d + g)
995
+ throw new $('"nbf" claim timestamp check failed', n, "nbf", "check_failed");
996
+ }
997
+ if (n.exp !== void 0) {
998
+ if (typeof n.exp != "number")
999
+ throw new $('"exp" claim must be a number', n, "exp", "invalid");
1000
+ if (n.exp <= d - g)
1001
+ throw new rt('"exp" claim timestamp check failed', n, "exp", "check_failed");
1002
+ }
1003
+ if (m) {
1004
+ const h = d - n.iat, y = typeof m == "number" ? m : ot(m);
1005
+ if (h - g > y)
1006
+ throw new rt('"iat" claim timestamp check failed (too far in the past)', n, "iat", "check_failed");
1007
+ if (h < 0 - g)
1008
+ throw new $('"iat" claim timestamp check failed (it should be in the past)', n, "iat", "check_failed");
1009
+ }
1010
+ return n;
1011
+ };
1012
+ async function on(e, t, r) {
1013
+ var n;
1014
+ const a = await Xr(e, t, r);
1015
+ if ((n = a.protectedHeader.crit) != null && n.includes("b64") && a.protectedHeader.b64 === !1)
1016
+ throw new K("JWTs MUST NOT use unencoded payload");
1017
+ const o = { payload: an(a.protectedHeader, a.payload, r), protectedHeader: a.protectedHeader };
1018
+ return typeof t == "function" ? { ...o, key: a.key } : o;
1019
+ }
1020
+ const sn = ie;
1021
+ function cn(e) {
1022
+ if (typeof e != "string")
1023
+ throw new K("JWTs must use Compact JWS serialization, JWT must be a string");
1024
+ const { 1: t, length: r } = e.split(".");
1025
+ if (r === 5)
1026
+ throw new K("Only JWTs using Compact JWS serialization can be decoded");
1027
+ if (r !== 3)
1028
+ throw new K("Invalid JWT");
1029
+ if (!t)
1030
+ throw new K("JWTs must contain a payload");
1031
+ let n;
1032
+ try {
1033
+ n = sn(t);
1034
+ } catch {
1035
+ throw new K("Failed to base64url decode the payload");
1036
+ }
1037
+ let a;
1038
+ try {
1039
+ a = JSON.parse(de.decode(n));
1040
+ } catch {
1041
+ throw new K("Failed to parse the decoded payload as JSON");
1042
+ }
1043
+ if (!Ae(a))
1044
+ throw new K("Invalid JWT Claims Set");
1045
+ return a;
1046
+ }
1047
+ const ce = async (e) => {
1048
+ try {
1049
+ const t = N.ALG, r = await Br(Ir, t);
1050
+ return await on(e, r, {
1051
+ issuer: N.ISSUER
1052
+ });
1053
+ } catch {
1054
+ return;
1055
+ }
1056
+ }, ln = (e) => {
1057
+ try {
1058
+ return cn(e);
1059
+ } catch {
1060
+ return;
1061
+ }
1062
+ };
1063
+ var A = [];
1064
+ for (var Be = 0; Be < 256; ++Be)
1065
+ A.push((Be + 256).toString(16).slice(1));
1066
+ function dn(e, t = 0) {
1067
+ return (A[e[t + 0]] + A[e[t + 1]] + A[e[t + 2]] + A[e[t + 3]] + "-" + A[e[t + 4]] + A[e[t + 5]] + "-" + A[e[t + 6]] + A[e[t + 7]] + "-" + A[e[t + 8]] + A[e[t + 9]] + "-" + A[e[t + 10]] + A[e[t + 11]] + A[e[t + 12]] + A[e[t + 13]] + A[e[t + 14]] + A[e[t + 15]]).toLowerCase();
1068
+ }
1069
+ var he, un = new Uint8Array(16);
1070
+ function mn() {
1071
+ if (!he && (he = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !he))
1072
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1073
+ return he(un);
1074
+ }
1075
+ var hn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1076
+ const it = {
1077
+ randomUUID: hn
1078
+ };
1079
+ function ct(e, t, r) {
1080
+ if (it.randomUUID && !t && !e)
1081
+ return it.randomUUID();
1082
+ e = e || {};
1083
+ var n = e.random || (e.rng || mn)();
1084
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, dn(n);
1085
+ }
1086
+ const lt = globalThis.crypto, pn = (e) => `${ct()}${ct()}`.slice(0, e), gn = (e) => btoa(
1087
+ [...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
1088
+ );
1089
+ async function fn(e) {
1090
+ if (!lt.subtle)
1091
+ throw new Error(
1092
+ "crypto.subtle is available only in secure contexts (HTTPS)."
1093
+ );
1094
+ const t = new TextEncoder().encode(e), r = await lt.subtle.digest("SHA-256", t);
1095
+ return gn(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1096
+ }
1097
+ async function yn(e) {
1098
+ const t = pn(43), r = await fn(t);
1099
+ return {
1100
+ code_verifier: t,
1101
+ code_challenge: r
1102
+ };
1103
+ }
1104
+ function Ht(e, t) {
1105
+ window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
1106
+ }
1107
+ const dt = (e, t) => {
1108
+ const r = JSON.stringify(
1109
+ typeof t == "function" ? t() : t
1110
+ );
1111
+ window.localStorage.setItem(e, r), Ht(e, r);
1112
+ }, bn = (e) => {
1113
+ window.localStorage.removeItem(e), Ht(e, null);
1114
+ }, ut = (e) => window.localStorage.getItem(e), wn = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
1115
+ function pe({
1116
+ key: e,
1117
+ initialValue: t
1118
+ }) {
1119
+ const r = mr(wn, () => ut(e)), n = te(
1120
+ (s) => {
1121
+ try {
1122
+ const i = typeof s == "function" ? s(JSON.parse(r)) : s;
1123
+ i == null ? bn(e) : dt(e, i);
1124
+ } catch (i) {
1125
+ console.warn(i);
1126
+ }
1127
+ },
1128
+ [e, r]
1129
+ ), a = te(() => {
1130
+ n(t);
1131
+ }, [t, n]), o = te(() => {
1132
+ n(null);
1133
+ }, [n]);
1134
+ return j(() => {
1135
+ try {
1136
+ ut(e) === null && typeof t < "u" && dt(e, t);
1137
+ } catch (s) {
1138
+ console.warn(s);
1139
+ }
1140
+ }, [e, t]), [r ? JSON.parse(r) : null, n, a, o];
1141
+ }
1142
+ var k = [];
1143
+ for (var We = 0; We < 256; ++We)
1144
+ k.push((We + 256).toString(16).slice(1));
1145
+ function En(e, t = 0) {
1146
+ return (k[e[t + 0]] + k[e[t + 1]] + k[e[t + 2]] + k[e[t + 3]] + "-" + k[e[t + 4]] + k[e[t + 5]] + "-" + k[e[t + 6]] + k[e[t + 7]] + "-" + k[e[t + 8]] + k[e[t + 9]] + "-" + k[e[t + 10]] + k[e[t + 11]] + k[e[t + 12]] + k[e[t + 13]] + k[e[t + 14]] + k[e[t + 15]]).toLowerCase();
1147
+ }
1148
+ var ge, vn = new Uint8Array(16);
1149
+ function Tn() {
1150
+ if (!ge && (ge = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ge))
1151
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
1152
+ return ge(vn);
1153
+ }
1154
+ var Sn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1155
+ const mt = {
1156
+ randomUUID: Sn
1157
+ };
1158
+ function Ve(e, t, r) {
1159
+ if (mt.randomUUID && !t && !e)
1160
+ return mt.randomUUID();
1161
+ e = e || {};
1162
+ var n = e.random || (e.rng || Tn)();
1163
+ return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, En(n);
1164
+ }
1165
+ /*!
1166
+ @versini/ui-fingerprint v1.0.1
1167
+ © 2024 gizmette.com
1168
+ */
1169
+ try {
1170
+ window.__VERSINI_UI_FINGERPRINT__ || (window.__VERSINI_UI_FINGERPRINT__ = {
1171
+ version: "1.0.1",
1172
+ buildTime: "07/18/2024 09:17 AM EDT",
1173
+ homepage: "https://github.com/aversini/ui-components",
1174
+ license: "MIT"
1175
+ });
1176
+ } catch {
1177
+ }
1178
+ const In = (e) => Array.from(e).map((t) => t.toString(16).padStart(2, "0")).join(""), Kt = async (e) => {
1179
+ if (e === "")
1180
+ return "";
1181
+ const t = new TextEncoder().encode(e), r = await crypto.subtle.digest("SHA-256", t);
1182
+ return Array.from(new Uint8Array(r)).map((n) => n.toString(16).padStart(2, "0")).join("");
1183
+ };
1184
+ function ht(e, t) {
1185
+ return new Promise((r) => setTimeout(r, e, t));
1186
+ }
1187
+ async function An(e, t, r = 50) {
1188
+ var n, a, o;
1189
+ const s = document;
1190
+ for (; !s.body; )
1191
+ await ht(r);
1192
+ const i = s.createElement("iframe");
1193
+ try {
1194
+ for (await new Promise((p, m) => {
1195
+ let u = !1;
1196
+ const g = () => {
1197
+ u = !0, p();
1198
+ }, l = (y) => {
1199
+ u = !0, m(y);
1200
+ };
1201
+ i.onload = g, i.onerror = l;
1202
+ const { style: d } = i;
1203
+ d.setProperty("display", "block", "important"), d.position = "absolute", d.top = "0", d.left = "0", d.visibility = "hidden", i.src = "about:blank", s.body.appendChild(i);
1204
+ const h = () => {
1205
+ var y, w;
1206
+ u || (((w = (y = i.contentWindow) == null ? void 0 : y.document) == null ? void 0 : w.readyState) === "complete" ? g() : setTimeout(h, 10));
1207
+ };
1208
+ h();
1209
+ }); !((a = (n = i.contentWindow) == null ? void 0 : n.document) != null && a.body); )
1210
+ await ht(r);
1211
+ return await e(i, i.contentWindow);
1212
+ } finally {
1213
+ (o = i.parentNode) == null || o.removeChild(i);
1214
+ }
1215
+ }
1216
+ const kn = {
1217
+ audio: {
1218
+ sampleHash: "",
1219
+ oscillator: "",
1220
+ maxChannels: 0,
1221
+ channelCountMode: ""
1222
+ }
1223
+ }, _n = async (e) => new Promise((t) => {
1224
+ try {
1225
+ const r = new window.OfflineAudioContext(1, 5e3, 44100), n = r.createBufferSource(), a = r.createOscillator();
1226
+ a.frequency.value = 1e3;
1227
+ const o = r.createDynamicsCompressor();
1228
+ o.threshold.value = -50, o.knee.value = 40, o.ratio.value = 12, o.attack.value = 0, o.release.value = 0.2, a.connect(o), o.connect(r.destination), a.start(), r.startRendering(), r.oncomplete = (s) => {
1229
+ const i = s.renderedBuffer.getChannelData(0);
1230
+ a.disconnect(), o.disconnect(), t({
1231
+ audio: {
1232
+ sampleHash: In(i),
1233
+ oscillator: a.type,
1234
+ maxChannels: r.destination.maxChannelCount,
1235
+ channelCountMode: n.channelCountMode
1236
+ }
1237
+ });
1238
+ };
1239
+ } catch {
1240
+ t({
1241
+ audio: {
1242
+ sampleHash: "",
1243
+ oscillator: "",
1244
+ maxChannels: 0,
1245
+ channelCountMode: ""
1246
+ }
1247
+ });
1248
+ }
1249
+ }), Gt = { browser: "" }, Rn = async (e) => typeof navigator > "u" ? Gt : { browser: navigator.userAgent }, Bt = {
1250
+ canvas: {
1251
+ data: ""
1252
+ }
1253
+ }, Nn = async (e) => {
1254
+ try {
1255
+ const t = Array.from(
1256
+ { length: 3 },
1257
+ () => xn(300, 30)
1258
+ ), r = On(t, 300, 30);
1259
+ return {
1260
+ canvas: {
1261
+ data: (await Kt(r.data.toString())).toString()
1262
+ }
1263
+ };
1264
+ } catch {
1265
+ return Bt;
1266
+ }
1267
+ }, xn = (e, t) => {
1268
+ const r = document.createElement("canvas"), n = r.getContext("2d");
1269
+ if (!n)
1270
+ return new ImageData(1, 1);
1271
+ r.width = e, r.height = t;
1272
+ const a = n.createLinearGradient(0, 0, r.width, r.height);
1273
+ a.addColorStop(0, "red"), a.addColorStop(1 / 6, "orange"), a.addColorStop(2 / 6, "yellow"), a.addColorStop(3 / 6, "green"), a.addColorStop(4 / 6, "blue"), a.addColorStop(5 / 6, "indigo"), a.addColorStop(1, "violet"), n.fillStyle = a, n.fillRect(0, 0, r.width, r.height);
1274
+ const o = "mmMwWLliI0O&1 - Les sanglots longs des violons de l'automne blessent mon coeur d'une langueur monotone";
1275
+ return n.font = "26.321px Arial", n.fillStyle = "black", n.fillText(o, -5, 15), n.fillStyle = "rgba(0, 0, 255, 0.5)", n.fillText(o, -3.3, 17.7), n.beginPath(), n.moveTo(0, 0), n.lineTo(r.width * 2 / 7, r.height), n.strokeStyle = "white", n.lineWidth = 2, n.stroke(), n.getImageData(0, 0, r.width, r.height);
1276
+ }, Cn = (e) => {
1277
+ if (e.length === 0)
1278
+ return 0;
1279
+ const t = {};
1280
+ for (const n of e)
1281
+ t[n] = (t[n] || 0) + 1;
1282
+ let r = e[0];
1283
+ for (const n in t)
1284
+ t[n] > t[r] && (r = parseInt(n, 10));
1285
+ return r;
1286
+ }, On = (e, t, r) => {
1287
+ const n = [];
1288
+ for (let s = 0; s < e[0].data.length; s++) {
1289
+ const i = [];
1290
+ for (let p = 0; p < e.length; p++)
1291
+ i.push(e[p].data[s]);
1292
+ n.push(Cn(i));
1293
+ }
1294
+ const a = n, o = new Uint8ClampedArray(a);
1295
+ return new ImageData(o, t, r);
1296
+ }, Pn = [], Dn = "mmMwWLliI0O&1", $n = "48px", q = ["monospace", "sans-serif", "serif"], pt = [
1297
+ "sans-serif-thin",
1298
+ "ARNO PRO",
1299
+ "Agency FB",
1300
+ "Arabic Typesetting",
1301
+ "Arial Unicode MS",
1302
+ "AvantGarde Bk BT",
1303
+ "BankGothic Md BT",
1304
+ "Bitstream Vera Sans Mono",
1305
+ "Calibri",
1306
+ "Century",
1307
+ "Century Gothic",
1308
+ "Clarendon",
1309
+ "EUROSTILE",
1310
+ "Franklin Gothic",
1311
+ "GOTHAM",
1312
+ "Gill Sans",
1313
+ "Helvetica Neue",
1314
+ "Letter Gothic",
1315
+ "Menlo",
1316
+ "MS Outlook",
1317
+ "MS Reference Specialty",
1318
+ "MS UI Gothic",
1319
+ "MT Extra",
1320
+ "MYRIAD PRO",
1321
+ "Marlett",
1322
+ "Microsoft Uighur",
1323
+ "Minion Pro",
1324
+ "Monotype Corsiva",
1325
+ "PMingLiU",
1326
+ "Pristina",
1327
+ "SCRIPTINA",
1328
+ "SimHei",
1329
+ "Small Fonts",
1330
+ "Staccato222 BT",
1331
+ "TRAJAN PRO",
1332
+ "Univers CE 55 Medium",
1333
+ "ZWAdobeF"
1334
+ ], Mn = async (e) => An(async (t, { document: r }) => {
1335
+ const n = r.body;
1336
+ n.style.fontSize = $n;
1337
+ const a = r.createElement("div");
1338
+ a.style.setProperty("visibility", "hidden", "important");
1339
+ const o = {}, s = {}, i = (h) => {
1340
+ const y = r.createElement("span"), { style: w } = y;
1341
+ return w.position = "absolute", w.top = "0", w.left = "0", w.fontFamily = h, y.textContent = Dn, a.appendChild(y), y;
1342
+ }, p = (h, y) => i(`'${h}',${y}`), m = () => q.map(i), u = () => {
1343
+ const h = {};
1344
+ for (const y of pt)
1345
+ h[y] = q.map(
1346
+ (w) => p(y, w)
1347
+ );
1348
+ return h;
1349
+ }, g = (h) => q.some(
1350
+ (y, w) => h[w].offsetWidth !== o[y] || h[w].offsetHeight !== s[y]
1351
+ ), l = m(), d = u();
1352
+ n.appendChild(a);
1353
+ for (let h = 0; h < q.length; h++)
1354
+ o[q[h]] = l[h].offsetWidth, s[q[h]] = l[h].offsetHeight;
1355
+ return pt.filter((h) => g(d[h]));
1356
+ }), Wt = {
1357
+ vendor: "",
1358
+ vendorUnmasked: "",
1359
+ renderer: "",
1360
+ rendererUnmasked: "",
1361
+ version: "",
1362
+ shadingLanguageVersion: ""
1363
+ }, Vt = {
1364
+ hardware: {
1365
+ videocard: Wt,
1366
+ architecture: 0,
1367
+ deviceMemory: "undefined",
1368
+ jsHeapSizeLimit: 0
1369
+ }
1370
+ };
1371
+ function Ln() {
1372
+ const e = document.createElement("canvas"), t = e.getContext("webgl") ?? e.getContext("experimental-webgl");
1373
+ if (t && "getParameter" in t) {
1374
+ const r = t.getExtension("WEBGL_debug_renderer_info");
1375
+ return {
1376
+ vendor: (t.getParameter(t.VENDOR) || "").toString(),
1377
+ vendorUnmasked: r ? (t.getParameter(r.UNMASKED_VENDOR_WEBGL) || "").toString() : "",
1378
+ renderer: (t.getParameter(t.RENDERER) || "").toString(),
1379
+ rendererUnmasked: r ? (t.getParameter(r.UNMASKED_RENDERER_WEBGL) || "").toString() : "",
1380
+ version: (t.getParameter(t.VERSION) || "").toString(),
1381
+ shadingLanguageVersion: (t.getParameter(t.SHADING_LANGUAGE_VERSION) || "").toString()
1382
+ };
1383
+ }
1384
+ return Wt;
1385
+ }
1386
+ function Un() {
1387
+ const e = new Float32Array(1), t = new Uint8Array(e.buffer);
1388
+ return e[0] = 1 / 0, e[0] = e[0] - e[0], t[3];
1389
+ }
1390
+ const Hn = () => navigator.deviceMemory || 0, Kn = () => window.performance && window.performance.memory || {
1391
+ jsHeapSizeLimit: 0
1392
+ }, Gn = async (e) => new Promise((t) => {
1393
+ try {
1394
+ const r = Hn(), n = Kn();
1395
+ t({
1396
+ hardware: {
1397
+ videocard: Ln(),
1398
+ architecture: Un(),
1399
+ deviceMemory: r.toString() || "undefined",
1400
+ jsHeapSizeLimit: n.jsHeapSizeLimit || 0
1401
+ }
1402
+ });
1403
+ } catch {
1404
+ t(Vt);
1405
+ }
1406
+ }), Bn = {
1407
+ locales: {
1408
+ languages: "",
1409
+ timezone: ""
1410
+ }
1411
+ }, Wn = async (e) => new Promise((t) => {
1412
+ t({
1413
+ locales: {
1414
+ languages: navigator.language,
1415
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
1416
+ }
1417
+ });
1418
+ }), Ft = {
1419
+ screen: {
1420
+ colorDepth: 0,
1421
+ pixelDepth: 0,
1422
+ isTouchScreen: !1,
1423
+ maxTouchPoints: 0,
1424
+ mediaMatches: []
1425
+ }
1426
+ }, Vn = async (e) => new Promise((t) => {
1427
+ try {
1428
+ const r = window.screen, n = {
1429
+ screen: {
1430
+ colorDepth: r.colorDepth,
1431
+ pixelDepth: r.pixelDepth,
1432
+ isTouchScreen: navigator.maxTouchPoints > 0,
1433
+ maxTouchPoints: navigator.maxTouchPoints,
1434
+ mediaMatches: Fn()
1435
+ }
1436
+ };
1437
+ t(n);
1438
+ } catch {
1439
+ t(Ft);
1440
+ }
1441
+ });
1442
+ function Fn() {
1443
+ const e = [], t = {
1444
+ "prefers-contrast": [
1445
+ "high",
1446
+ "more",
1447
+ "low",
1448
+ "less",
1449
+ "forced",
1450
+ "no-preference"
1451
+ ],
1452
+ "any-hover": ["hover", "none"],
1453
+ "any-pointer": ["none", "coarse", "fine"],
1454
+ pointer: ["none", "coarse", "fine"],
1455
+ hover: ["hover", "none"],
1456
+ update: ["fast", "slow"],
1457
+ "inverted-colors": ["inverted", "none"],
1458
+ "prefers-reduced-motion": ["reduce", "no-preference"],
1459
+ "prefers-reduced-transparency": ["reduce", "no-preference"],
1460
+ scripting: ["none", "initial-only", "enabled"],
1461
+ "forced-colors": ["active", "none"],
1462
+ "color-gamut": ["srgb", "p3", "rec2020"]
1463
+ };
1464
+ return Object.keys(t).forEach((r) => {
1465
+ t[r].forEach((n) => {
1466
+ matchMedia(`(${r}: ${n})`).matches && e.push(`${r}: ${n}`);
1467
+ });
1468
+ }), e;
1469
+ }
1470
+ const Jn = async (e) => {
1471
+ try {
1472
+ return {
1473
+ system: {
1474
+ platform: navigator.platform,
1475
+ cookieEnabled: navigator.cookieEnabled,
1476
+ productSub: navigator.productSub,
1477
+ product: navigator.product
1478
+ }
1479
+ };
1480
+ } catch {
1481
+ return Jt;
1482
+ }
1483
+ }, Jt = {
1484
+ system: {
1485
+ platform: "",
1486
+ cookieEnabled: !1,
1487
+ productSub: "",
1488
+ product: ""
1489
+ }
1490
+ }, jn = async (e) => {
1491
+ try {
1492
+ return Promise.all([
1493
+ _n(),
1494
+ Rn(),
1495
+ Nn(),
1496
+ Mn(),
1497
+ Gn(),
1498
+ Wn(),
1499
+ Vn(),
1500
+ Jn()
1501
+ ]);
1502
+ } catch {
1503
+ return [
1504
+ kn,
1505
+ Gt,
1506
+ Bt,
1507
+ Pn,
1508
+ Vt,
1509
+ Bn,
1510
+ Ft,
1511
+ Jt
1512
+ ];
1513
+ }
1514
+ }, Yn = async (e) => {
1515
+ try {
1516
+ const t = await jn();
1517
+ return await Kt(JSON.stringify(t));
1518
+ } catch {
1519
+ return "";
1520
+ }
1521
+ }, fe = "Oops! It looks like your session has expired. For your security, please log in again to continue.", zn = "Your session has been successfully terminated.", ye = "Login failed. Please try again.", Fe = "Error getting access token, please re-authenticate.", qn = "You forgot to wrap your component in <AuthProvider>.", ke = {
1522
+ dev: "https://auth.gizmette.local.com:3003",
1523
+ prod: "https://mylogin.gizmette.com/auth"
1524
+ }, be = "@@auth@@", oe = "LOADING", se = "LOGIN", jt = "LOGOUT", Qn = process.env.NODE_ENV === "production", Yt = !Qn, Xn = (e) => {
1525
+ try {
1526
+ const t = ln(e);
1527
+ return t ? t[N.USER_ID_KEY] : "";
1528
+ } catch {
1529
+ return "";
1530
+ }
1531
+ }, xe = async ({
1532
+ type: e,
1533
+ clientId: t,
1534
+ params: r = {}
1535
+ }) => {
1536
+ try {
1537
+ const n = await fetch(
1538
+ Yt ? `${ke.dev}/${e}` : `${ke.prod}/${e}`,
1539
+ {
1540
+ credentials: "include",
1541
+ method: "POST",
1542
+ headers: {
1543
+ "Content-Type": "application/json",
1544
+ [Nt.CLIENT_ID]: `${t}`
1545
+ },
1546
+ body: JSON.stringify(r)
1547
+ }
1548
+ );
1549
+ if (n.status !== 200)
1550
+ return { status: n.status, data: [] };
1551
+ const { data: a, errors: o } = await n.json();
1552
+ return {
1553
+ status: n.status,
1554
+ data: a,
1555
+ errors: o
1556
+ };
1557
+ } catch (n) {
1558
+ return console.error(n), { status: 500, data: [] };
1559
+ }
1560
+ }, Zn = async ({
1561
+ userId: e,
1562
+ idToken: t,
1563
+ accessToken: r,
1564
+ refreshToken: n,
1565
+ clientId: a,
1566
+ domain: o
1567
+ }) => {
1568
+ try {
1569
+ return {
1570
+ status: (await xe({
1571
+ type: Re.LOGOUT,
1572
+ clientId: a,
1573
+ params: {
1574
+ userId: e,
1575
+ idToken: t,
1576
+ accessToken: r,
1577
+ refreshToken: n,
1578
+ domain: o
1579
+ }
1580
+ })).status === 200
1581
+ };
1582
+ } catch {
1583
+ return {
1584
+ status: !1
1585
+ };
1586
+ }
1587
+ }, gt = async ({
1588
+ username: e,
1589
+ password: t,
1590
+ clientId: r,
1591
+ nonce: n,
1592
+ type: a,
1593
+ sessionExpiration: o,
1594
+ code: s,
1595
+ code_verifier: i,
1596
+ domain: p,
1597
+ fingerprint: m
1598
+ }) => {
1599
+ try {
1600
+ const u = await xe({
1601
+ type: Re.AUTHENTICATE,
1602
+ clientId: r,
1603
+ params: {
1604
+ type: a || re.ID_AND_ACCESS_TOKEN,
1605
+ username: e,
1606
+ password: t,
1607
+ sessionExpiration: o,
1608
+ nonce: n,
1609
+ code: s,
1610
+ code_verifier: i,
1611
+ domain: p,
1612
+ fingerprint: m
1613
+ }
1614
+ }), g = await ce(u.data.idToken);
1615
+ return g && g.payload[N.USER_ID_KEY] !== "" && g.payload[N.NONCE_KEY] === n ? {
1616
+ idToken: u.data.idToken,
1617
+ accessToken: u.data.accessToken,
1618
+ refreshToken: u.data.refreshToken,
1619
+ userId: g.payload[N.USER_ID_KEY],
1620
+ status: !0
1621
+ } : {
1622
+ status: !1
1623
+ };
1624
+ } catch {
1625
+ return {
1626
+ status: !1
1627
+ };
1628
+ }
1629
+ }, ea = async ({
1630
+ nonce: e,
1631
+ clientId: t,
1632
+ code_challenge: r
1633
+ }) => {
1634
+ try {
1635
+ const n = await xe({
1636
+ type: Re.CODE,
1637
+ clientId: t,
1638
+ params: {
1639
+ type: re.CODE,
1640
+ nonce: e,
1641
+ code_challenge: r
1642
+ }
1643
+ });
1644
+ return n.data.code ? {
1645
+ status: !0,
1646
+ code: n.data.code
1647
+ } : {
1648
+ status: !1
1649
+ };
1650
+ } catch {
1651
+ return {
1652
+ status: !1
1653
+ };
1654
+ }
1655
+ }, ta = async ({
1656
+ clientId: e,
1657
+ userId: t,
1658
+ nonce: r,
1659
+ refreshToken: n,
1660
+ accessToken: a,
1661
+ domain: o
1662
+ }) => {
1663
+ try {
1664
+ const s = await xe({
1665
+ type: Re.AUTHENTICATE,
1666
+ clientId: e,
1667
+ params: {
1668
+ type: re.REFRESH_TOKEN,
1669
+ userId: t,
1670
+ nonce: r,
1671
+ refreshToken: n,
1672
+ accessToken: a,
1673
+ domain: o,
1674
+ fingerprint: await zt()
1675
+ }
1676
+ }), i = await ce(s.data.accessToken);
1677
+ return i && i.payload[N.USER_ID_KEY] !== "" && i.payload[N.NONCE_KEY] === r ? {
1678
+ accessToken: s.data.accessToken,
1679
+ refreshToken: s.data.refreshToken,
1680
+ userId: i.payload[N.USER_ID_KEY],
1681
+ status: !0
1682
+ } : {
1683
+ status: !1
1684
+ };
1685
+ } catch {
1686
+ return {
1687
+ status: !1
1688
+ };
1689
+ }
1690
+ }, we = {
1691
+ GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
1692
+ $clientId: String!,
1693
+ $username: String!,
1694
+ $id: String!) {
1695
+ getPasskeyRegistrationOptions(clientId: $clientId, username: $username, id: $id) {
1696
+ challenge
1697
+ rp {
1698
+ id
1699
+ name
1700
+ }
1701
+ user {
1702
+ id
1703
+ name
1704
+ displayName
1705
+ }
1706
+ pubKeyCredParams {
1707
+ type
1708
+ alg
1709
+ }
1710
+ timeout
1711
+ attestation
1712
+ }
1713
+ }`,
1714
+ VERIFY_REGISTRATION: `mutation VerifyPasskeyRegistration(
1715
+ $clientId: String!,
1716
+ $username: String!,
1717
+ $id: String!,
1718
+ $registration: RegistrationOptionsInput!) {
1719
+ verifyPasskeyRegistration(
1720
+ clientId: $clientId,
1721
+ username: $username,
1722
+ id: $id,
1723
+ registration: $registration) {
1724
+ status
1725
+ message
1726
+ }
1727
+ }`,
1728
+ GET_AUTHENTICATION_OPTIONS: `mutation GetPasskeyAuthenticationOptions(
1729
+ $id: String!,
1730
+ $clientId: String!,
1731
+ ) {
1732
+ getPasskeyAuthenticationOptions(
1733
+ id: $id,
1734
+ clientId: $clientId) {
1735
+ rpId,
1736
+ challenge,
1737
+ allowCredentials {
1738
+ id,
1739
+ type,
1740
+ transports
1741
+ }
1742
+ timeout,
1743
+ userVerification,
1744
+ }
1745
+ }`,
1746
+ VERIFY_AUTHENTICATION: `mutation VerifyPasskeyAuthentication(
1747
+ $clientId: String!,
1748
+ $id: String!,
1749
+ $authentication: AuthenticationOptionsInput!,
1750
+ $nonce: String!,
1751
+ $domain: String,
1752
+ $fingerprint: String) {
1753
+ verifyPasskeyAuthentication(
1754
+ clientId: $clientId,
1755
+ id: $id,
1756
+ authentication: $authentication,
1757
+ nonce: $nonce,
1758
+ domain: $domain,
1759
+ fingerprint: $fingerprint) {
1760
+ status,
1761
+ idToken,
1762
+ accessToken,
1763
+ refreshToken,
1764
+ userId,
1765
+ username,
1766
+ }
1767
+ }`
1768
+ }, Q = {
1769
+ GET_REGISTRATION_OPTIONS: {
1770
+ schema: we.GET_REGISTRATION_OPTIONS,
1771
+ method: "getPasskeyRegistrationOptions"
1772
+ },
1773
+ VERIFY_REGISTRATION: {
1774
+ schema: we.VERIFY_REGISTRATION,
1775
+ method: "verifyPasskeyRegistration"
1776
+ },
1777
+ GET_AUTHENTICATION_OPTIONS: {
1778
+ schema: we.GET_AUTHENTICATION_OPTIONS,
1779
+ method: "getPasskeyAuthenticationOptions"
1780
+ },
1781
+ VERIFY_AUTHENTICATION: {
1782
+ schema: we.VERIFY_AUTHENTICATION,
1783
+ method: "verifyPasskeyAuthentication"
1784
+ }
1785
+ }, X = async ({
1786
+ accessToken: e,
1787
+ type: t,
1788
+ clientId: r,
1789
+ params: n = {}
1790
+ }) => {
1791
+ try {
1792
+ const a = t != null && t.data ? t.data(n) : n, o = `Bearer ${e}`, s = await fetch(
1793
+ Yt ? `${ke.dev}/graphql` : `${ke.prod}/graphql`,
1794
+ {
1795
+ method: "POST",
1796
+ credentials: "include",
1797
+ headers: {
1798
+ authorization: o,
1799
+ "Content-Type": "application/json",
1800
+ Accept: "application/json",
1801
+ [Nt.CLIENT_ID]: `${r}`
1802
+ },
1803
+ body: JSON.stringify({
1804
+ query: t.schema,
1805
+ variables: a
1806
+ })
1807
+ }
1808
+ );
1809
+ if (s.status !== 200)
1810
+ return { status: s.status, data: [] };
1811
+ const { data: i, errors: p } = await s.json();
1812
+ return {
1813
+ status: s.status,
1814
+ data: i[t.method],
1815
+ errors: p
1816
+ };
1817
+ } catch (a) {
1818
+ return console.error(a), { status: 500, data: [] };
1819
+ }
1820
+ }, zt = async () => {
1821
+ try {
1822
+ return await Yn();
1823
+ } catch {
1824
+ return "";
1825
+ }
1826
+ };
1827
+ class ra {
1828
+ constructor(t = null, r = null) {
1829
+ Le(this, "refreshTokenPromise", null), Le(this, "accessToken"), Le(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
1830
+ }
1831
+ async refreshtoken({
1832
+ clientId: t,
1833
+ userId: r,
1834
+ nonce: n,
1835
+ domain: a
1836
+ }) {
1837
+ this.refreshTokenPromise || (this.refreshTokenPromise = this._refreshToken({
1838
+ clientId: t,
1839
+ userId: r,
1840
+ nonce: n,
1841
+ domain: a
1842
+ }));
1843
+ try {
1844
+ return await this.refreshTokenPromise;
1845
+ } finally {
1846
+ this.refreshTokenPromise = null;
1847
+ }
1848
+ }
1849
+ async _refreshToken({
1850
+ clientId: t,
1851
+ userId: r,
1852
+ nonce: n,
1853
+ domain: a
1854
+ }) {
1855
+ const o = await ce(this.refreshToken);
1856
+ if (o && o.payload[N.USER_ID_KEY] !== "") {
1857
+ const s = await ta({
1858
+ clientId: t,
1859
+ userId: r,
1860
+ nonce: n,
1861
+ refreshToken: this.refreshToken,
1862
+ accessToken: this.accessToken,
1863
+ domain: a
1864
+ });
1865
+ return s.status ? (this.accessToken = s.accessToken, this.refreshToken = s.refreshToken, {
1866
+ status: "success",
1867
+ newAccessToken: s.accessToken,
1868
+ newRefreshToken: s.refreshToken
1869
+ }) : {
1870
+ status: "failure"
1871
+ };
1872
+ } else
1873
+ return {
1874
+ status: "failure"
1875
+ };
1876
+ }
1877
+ }
1878
+ const na = (e) => te(
1879
+ (...t) => {
1880
+ e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
1881
+ },
1882
+ [e]
1883
+ ), Z = () => {
1884
+ throw new Error(qn);
1885
+ }, qt = ur({
1886
+ isAuthenticated: !1,
1887
+ isLoading: !1,
1888
+ authenticationType: null,
1889
+ login: Z,
1890
+ logout: Z,
1891
+ getAccessToken: Z,
1892
+ getIdToken: Z,
1893
+ registeringForPasskey: Z,
1894
+ loginWithPasskey: Z,
1895
+ logoutReason: ""
1896
+ }), aa = G.createContext({
1897
+ state: {
1898
+ isLoading: !0,
1899
+ isAuthenticated: !1,
1900
+ authenticationType: null,
1901
+ user: void 0,
1902
+ logoutReason: "",
1903
+ debug: !1
1904
+ },
1905
+ dispatch: () => {
1906
+ }
1907
+ }), oa = (e, t) => (t == null ? void 0 : t.type) === oe ? {
1908
+ ...e,
1909
+ isLoading: t.payload.isLoading
1910
+ } : (t == null ? void 0 : t.type) === se ? {
1911
+ ...e,
1912
+ isLoading: !1,
1913
+ isAuthenticated: !0,
1914
+ user: t.payload.user,
1915
+ authenticationType: t.payload.authenticationType,
1916
+ logoutReason: ""
1917
+ } : (t == null ? void 0 : t.type) === jt ? {
1918
+ ...e,
1919
+ isLoading: !1,
1920
+ isAuthenticated: !1,
1921
+ user: void 0,
1922
+ authenticationType: null,
1923
+ logoutReason: t.payload.logoutReason
1924
+ } : e, sa = ({
1925
+ children: e,
1926
+ sessionExpiration: t,
1927
+ clientId: r,
1928
+ domain: n = "",
1929
+ debug: a = !1
1930
+ }) => {
1931
+ const [o, s] = Et(oa, {
1932
+ isLoading: !0,
1933
+ isAuthenticated: !1,
1934
+ authenticationType: null,
1935
+ user: void 0,
1936
+ logoutReason: "",
1937
+ debug: a
1938
+ }), i = na(a), p = F(!1), m = F(""), [u, g, , l] = pe({
1939
+ key: `${be}::${r}::@@user@@`
1940
+ }), [d, h, , y] = pe({
1941
+ key: `${be}::${r}::@@access@@`
1942
+ }), [w, T, , x] = pe(
1943
+ {
1944
+ key: `${be}::${r}::@@refresh@@`
1945
+ }
1946
+ ), [P, B, , z] = pe({
1947
+ key: `${be}::${r}::@@nonce@@`
1948
+ }), C = new ra(d, w), D = te(
1949
+ (b) => {
1950
+ i(
1951
+ "removeStateAndLocalStorage: removing state and local storage with reason: ",
1952
+ b
1953
+ ), s({
1954
+ type: jt,
1955
+ payload: {
1956
+ logoutReason: b || fe
1957
+ }
1958
+ }), l(), y(), x(), z(), s({ type: oe, payload: { isLoading: !1 } });
1959
+ },
1960
+ [y, l, z, x, i]
1961
+ ), S = te(
1962
+ async (b) => {
1963
+ i("invalidateAndLogout: invalidating and logging out");
1964
+ const { user: I } = o, E = (I == null ? void 0 : I.userId) || Xn(u);
1965
+ E || i(
1966
+ "invalidateAndLogout: user cannot be identified, logging out without userId"
1967
+ ), await Zn({
1968
+ userId: E,
1969
+ idToken: u,
1970
+ accessToken: d,
1971
+ refreshToken: w,
1972
+ clientId: r,
1973
+ domain: n
1974
+ }), D(b || fe);
1975
+ },
1976
+ [
1977
+ d,
1978
+ o,
1979
+ r,
1980
+ n,
1981
+ u,
1982
+ w,
1983
+ D,
1984
+ i
1985
+ ]
1986
+ );
1987
+ j(() => ((async () => (i("useEffect: setting the fingerprint"), m.current = await zt()))(), () => {
1988
+ i("useEffect: cleaning up the fingerprint"), m.current = "";
1989
+ }), []), j(() => {
1990
+ if (!p.current)
1991
+ return o.isLoading && u !== null ? (async () => {
1992
+ try {
1993
+ const b = await ce(u);
1994
+ b && b.payload[N.USER_ID_KEY] !== "" ? (i("useEffect: setting the authentication state"), s({
1995
+ type: se,
1996
+ payload: {
1997
+ authenticationType: b.payload[N.AUTH_TYPE_KEY],
1998
+ user: {
1999
+ userId: b.payload[N.USER_ID_KEY],
2000
+ username: b.payload[N.USERNAME_KEY]
2001
+ }
2002
+ }
2003
+ })) : (i("useEffect: invalid JWT, invalidating and logging out"), await S(fe));
2004
+ } catch {
2005
+ i(
2006
+ "useEffect: exception validating JWT, invalidating and logging out"
2007
+ ), await S(fe);
2008
+ }
2009
+ })() : (i("useEffect: setting the loading state to false"), s({ type: oe, payload: { isLoading: !1 } })), () => {
2010
+ p.current = !0;
2011
+ };
2012
+ }, [o.isLoading, u, S, i]);
2013
+ const Pe = async (b, I, E) => {
2014
+ const U = Ve();
2015
+ if (B(U), s({ type: oe, payload: { isLoading: !0 } }), l(), y(), x(), i("login: Logging in with type: ", E), E === re.CODE) {
2016
+ const { code_verifier: lr, code_challenge: dr } = await yn(), tt = await ea({
2017
+ nonce: U,
2018
+ clientId: r,
2019
+ code_challenge: dr
2020
+ });
2021
+ if (tt.status) {
2022
+ const ae = await gt({
2023
+ username: b,
2024
+ password: I,
2025
+ clientId: r,
2026
+ sessionExpiration: t,
2027
+ nonce: U,
2028
+ type: E,
2029
+ code: tt.code,
2030
+ code_verifier: lr,
2031
+ domain: n,
2032
+ fingerprint: m.current
2033
+ });
2034
+ return ae.status ? (g(ae.idToken), h(ae.accessToken), T(ae.refreshToken), s({
2035
+ type: se,
2036
+ payload: {
2037
+ authenticationType: E,
2038
+ user: {
2039
+ userId: ae.userId,
2040
+ username: b
2041
+ }
2042
+ }
2043
+ }), !0) : (D(ye), !1);
2044
+ }
2045
+ return !1;
2046
+ }
2047
+ const ne = await gt({
2048
+ username: b,
2049
+ password: I,
2050
+ clientId: r,
2051
+ sessionExpiration: t,
2052
+ nonce: U,
2053
+ type: E,
2054
+ domain: n,
2055
+ fingerprint: m.current
2056
+ });
2057
+ return ne.status ? (g(ne.idToken), h(ne.accessToken), T(ne.refreshToken), s({
2058
+ type: se,
2059
+ payload: {
2060
+ authenticationType: E,
2061
+ user: {
2062
+ userId: ne.userId,
2063
+ username: b
2064
+ }
2065
+ }
2066
+ }), !0) : (D(ye), !1);
2067
+ }, De = async (b) => {
2068
+ b == null || b.preventDefault(), await S(zn);
2069
+ }, $e = async () => {
2070
+ const { isAuthenticated: b, user: I } = o;
2071
+ try {
2072
+ if (b && I && I.userId) {
2073
+ if (d) {
2074
+ i("getAccessToken");
2075
+ const U = await ce(d);
2076
+ if (U && U.payload[N.USER_ID_KEY] !== "")
2077
+ return d;
2078
+ }
2079
+ i("getAccessToken: invalid access token, refreshing it");
2080
+ const E = await C.refreshtoken({
2081
+ clientId: r,
2082
+ userId: I.userId,
2083
+ nonce: P,
2084
+ domain: n
2085
+ });
2086
+ return E.status && E.status === "success" ? (h(E.newAccessToken), T(E.newRefreshToken), E.newAccessToken) : (i("getAccessToken: invalid refresh token, re-authenticating user"), await S(Fe), "");
2087
+ }
2088
+ return i(
2089
+ "getAccessToken: user is not authenticated, cannot get access token"
2090
+ ), await S(Fe), "";
2091
+ } catch {
2092
+ return i(
2093
+ "getAccessToken: exception occurred, invalidating and logging out"
2094
+ ), await S(Fe), "";
2095
+ }
2096
+ }, O = () => {
2097
+ if (o.isAuthenticated && u)
2098
+ return u;
2099
+ }, L = async () => {
2100
+ const { user: b } = o;
2101
+ let I = await X({
2102
+ accessToken: d,
2103
+ clientId: r,
2104
+ type: Q.GET_REGISTRATION_OPTIONS,
2105
+ params: {
2106
+ clientId: r,
2107
+ id: b == null ? void 0 : b.userId,
2108
+ username: b == null ? void 0 : b.username
2109
+ }
2110
+ });
2111
+ if (I.status)
2112
+ try {
2113
+ const E = await Er(I.data);
2114
+ I = await X({
2115
+ accessToken: d,
2116
+ clientId: r,
2117
+ type: Q.VERIFY_REGISTRATION,
2118
+ params: {
2119
+ clientId: r,
2120
+ id: b == null ? void 0 : b.userId,
2121
+ username: b == null ? void 0 : b.username,
2122
+ registration: E
2123
+ }
2124
+ });
2125
+ } catch {
2126
+ return await X({
2127
+ accessToken: d,
2128
+ clientId: r,
2129
+ type: Q.VERIFY_REGISTRATION,
2130
+ params: {
2131
+ clientId: r,
2132
+ id: b == null ? void 0 : b.userId,
2133
+ username: b == null ? void 0 : b.username,
2134
+ registration: {}
2135
+ }
2136
+ }), !1;
2137
+ }
2138
+ }, Me = async () => {
2139
+ const b = Ve();
2140
+ B(b), s({ type: oe, payload: { isLoading: !0 } }), l(), y(), x(), i("loginWithPasskey");
2141
+ const I = Ve();
2142
+ let E = await X({
2143
+ accessToken: d,
2144
+ clientId: r,
2145
+ type: Q.GET_AUTHENTICATION_OPTIONS,
2146
+ params: {
2147
+ id: I,
2148
+ clientId: r
2149
+ }
2150
+ });
2151
+ if (E.status)
2152
+ try {
2153
+ const U = await Sr(E.data);
2154
+ return E = await X({
2155
+ accessToken: d,
2156
+ clientId: r,
2157
+ type: Q.VERIFY_AUTHENTICATION,
2158
+ params: {
2159
+ clientId: r,
2160
+ id: I,
2161
+ authentication: U,
2162
+ nonce: b,
2163
+ domain: n,
2164
+ fingerprint: m.current
2165
+ }
2166
+ }), E.data.status === "success" ? (g(E.data.idToken), h(E.data.accessToken), T(E.data.refreshToken), s({
2167
+ type: se,
2168
+ payload: {
2169
+ authenticationType: re.PASSKEY,
2170
+ user: {
2171
+ userId: E.data.userId,
2172
+ username: E.data.username
2173
+ }
2174
+ }
2175
+ }), !0) : (D(ye), !1);
2176
+ } catch {
2177
+ return await X({
2178
+ accessToken: d,
2179
+ clientId: r,
2180
+ type: Q.VERIFY_AUTHENTICATION,
2181
+ params: {
2182
+ clientId: r,
2183
+ id: I,
2184
+ authentication: {},
2185
+ nonce: b,
2186
+ domain: n
2187
+ }
2188
+ }), D(ye), !1;
2189
+ }
2190
+ };
2191
+ return /* @__PURE__ */ c(aa.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ c(
2192
+ qt.Provider,
2193
+ {
2194
+ value: {
2195
+ ...o,
2196
+ login: Pe,
2197
+ logout: De,
2198
+ getAccessToken: $e,
2199
+ getIdToken: O,
2200
+ registeringForPasskey: L,
2201
+ loginWithPasskey: Me
2202
+ },
2203
+ children: e
2204
+ }
2205
+ ) });
2206
+ }, Qe = (e = qt) => vt(e), Co = "user", Oo = "assistant", Po = "system", Do = "internal", $o = "hidden", Mo = "I'm having trouble right now. Please try again later.", Lo = "gpt-4", Uo = 128e3, Ho = "action-message", Ko = "action-reset", Go = "action-model", Bo = "action-restore", Wo = "action-location", Vo = "action-streaming", Fo = "action-search", Jo = "action-sort", jo = "sassy-saint-", Yo = "details", zo = "search", qo = "sort", Qo = "location", Xo = "==stats==", ia = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", ft = (e) => Number.isFinite(e) ? e : 0;
2207
+ function ca(e) {
2208
+ return {
2209
+ days: Math.trunc(e / 864e5),
2210
+ hours: Math.trunc(e / 36e5 % 24),
2211
+ minutes: Math.trunc(e / 6e4 % 60),
2212
+ seconds: Math.trunc(e / 1e3 % 60),
2213
+ milliseconds: Math.trunc(e % 1e3),
2214
+ microseconds: Math.trunc(ft(e * 1e3) % 1e3),
2215
+ nanoseconds: Math.trunc(ft(e * 1e6) % 1e3)
2216
+ };
2217
+ }
2218
+ function la(e) {
2219
+ return {
2220
+ days: e / 86400000n,
2221
+ hours: e / 3600000n % 24n,
2222
+ minutes: e / 60000n % 60n,
2223
+ seconds: e / 1000n % 60n,
2224
+ milliseconds: e % 1000n,
2225
+ microseconds: 0n,
2226
+ nanoseconds: 0n
2227
+ };
2228
+ }
2229
+ function da(e) {
2230
+ switch (typeof e) {
2231
+ case "number": {
2232
+ if (Number.isFinite(e))
2233
+ return ca(e);
2234
+ break;
2235
+ }
2236
+ case "bigint":
2237
+ return la(e);
2238
+ }
2239
+ throw new TypeError("Expected a finite number or bigint");
2240
+ }
2241
+ const ua = (e) => e === 0 || e === 0n, ma = (e, t) => t === 1 || t === 1n ? e : `${e}s`, ha = 1e-7, pa = 24n * 60n * 60n * 1000n;
2242
+ function ga(e, t) {
2243
+ const r = typeof e == "bigint";
2244
+ if (!r && !Number.isFinite(e))
2245
+ throw new TypeError("Expected a finite number or bigint");
2246
+ 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);
2247
+ let n = [];
2248
+ const a = (m, u) => {
2249
+ const g = Math.floor(m * 10 ** u + ha);
2250
+ return (Math.round(g) / 10 ** u).toFixed(u);
2251
+ }, o = (m, u, g, l) => {
2252
+ if (!((n.length === 0 || !t.colonNotation) && ua(m) && !(t.colonNotation && g === "m"))) {
2253
+ if (l = l ?? String(m), t.colonNotation) {
2254
+ const d = l.includes(".") ? l.split(".")[0].length : l.length, h = n.length > 0 ? 2 : 1;
2255
+ l = "0".repeat(Math.max(0, h - d)) + l;
2256
+ } else
2257
+ l += t.verbose ? " " + ma(u, m) : g;
2258
+ n.push(l);
2259
+ }
2260
+ }, s = da(e), i = BigInt(s.days);
2261
+ 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) {
2262
+ const m = Number(s.seconds), u = Number(s.milliseconds), g = Number(s.microseconds), l = Number(s.nanoseconds);
2263
+ if (o(m, "second", "s"), t.formatSubMilliseconds)
2264
+ o(u, "millisecond", "ms"), o(g, "microsecond", "µs"), o(l, "nanosecond", "ns");
2265
+ else {
2266
+ const d = u + g / 1e3 + l / 1e6, h = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, y = d >= 1 ? Math.round(d) : Math.ceil(d), w = h ? d.toFixed(h) : y;
2267
+ o(
2268
+ Number.parseFloat(w),
2269
+ "millisecond",
2270
+ "ms",
2271
+ w
2272
+ );
2273
+ }
2274
+ } else {
2275
+ const m = (r ? Number(e % pa) : e) / 1e3 % 60, u = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, g = a(m, u), l = t.keepDecimalsOnWholeSeconds ? g : g.replace(/\.0+$/, "");
2276
+ o(Number.parseFloat(l), "second", "s", l);
2277
+ }
2278
+ if (n.length === 0)
2279
+ return "0" + (t.verbose ? " milliseconds" : "ms");
2280
+ const p = t.colonNotation ? ":" : " ";
2281
+ return typeof t.unitCount == "number" && (n = n.slice(0, Math.max(t.unitCount, 1))), n.join(p);
2282
+ }
2283
+ const fa = process.env.NODE_ENV === "production", Xe = !fa, ya = Xe ? "gizmette.local.com" : "gizmette.com", Zo = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, Qt = (e, t) => {
2284
+ const r = e < 0 ? t ? "W" : "S" : t ? "E" : "N", n = 0 | Math.abs(e), a = 0 | Math.abs(e) * 60 % 60, o = (0 | Math.abs(e) * 60 % 1 * 6e3) / 100;
2285
+ return {
2286
+ dir: r,
2287
+ deg: n,
2288
+ min: a,
2289
+ sec: o
2290
+ };
2291
+ }, es = (e) => {
2292
+ if (!e && e !== 0)
2293
+ return "N/A";
2294
+ const t = Qt(e, !1);
2295
+ return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2296
+ }, ts = (e) => {
2297
+ if (!e && e !== 0)
2298
+ return "N/A";
2299
+ const t = Qt(e, !0);
2300
+ return `${t.deg}° ${t.min}' ${t.sec}" ${t.dir}`;
2301
+ }, rs = async () => {
2302
+ const e = {
2303
+ /**
2304
+ * A boolean value that indicates the application would
2305
+ * like to receive the best possible results. If true
2306
+ * and if the device is able to provide a more accurate
2307
+ * position, it will do so. Note that this can result in
2308
+ * slower response times or increased power consumption
2309
+ * (with a GPS chip on a mobile device for example). On
2310
+ * the other hand, if false, the device can take the
2311
+ * liberty to save resources by responding more quickly
2312
+ * and/or using less power. Default: false.
2313
+ */
2314
+ enableHighAccuracy: !1,
2315
+ /**
2316
+ * A positive long value representing the maximum length
2317
+ * of time (in milliseconds) the device is allowed to
2318
+ * take in order to return a position. The default value
2319
+ * is Infinity, meaning that getCurrentPosition() won't
2320
+ * return until the position is available.
2321
+ */
2322
+ timeout: 1e4,
2323
+ /**
2324
+ * A positive long value indicating the maximum age in
2325
+ * milliseconds of a possible cached position that is
2326
+ * acceptable to return. If set to 0, it means that the
2327
+ * device cannot use a cached position and must attempt
2328
+ * to retrieve the real current position. If set to
2329
+ * Infinity the device must return a cached position
2330
+ * regardless of its age. Default: 0.
2331
+ */
2332
+ maximumAge: 6e4
2333
+ };
2334
+ return new Promise((t, r) => {
2335
+ var n;
2336
+ (n = navigator == null ? void 0 : navigator.geolocation) == null || n.getCurrentPosition(
2337
+ (a) => {
2338
+ t({
2339
+ latitude: a.coords.latitude,
2340
+ longitude: a.coords.longitude,
2341
+ accuracy: a.coords.accuracy
2342
+ });
2343
+ },
2344
+ (a) => {
2345
+ r(a);
2346
+ },
2347
+ e
2348
+ );
2349
+ });
2350
+ }, ns = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */ v("div", { className: "flex items-center justify-between", children: [
2351
+ /* @__PURE__ */ c("dt", { className: "inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
2352
+ /* @__PURE__ */ c("dd", { className: "inline-block", children: t[r] })
2353
+ ] }) }, `${e}-${r}`)) : null;
2354
+ function as({
2355
+ data: e,
2356
+ formatter: t = (r) => r
2357
+ }) {
2358
+ const r = e.filter(
2359
+ (a) => typeof a == "number" && a > 0
2360
+ ), n = r.reduce(
2361
+ (a, o) => (a || 0) + (o || 0),
2362
+ 0
2363
+ );
2364
+ return t(n ? n / r.length : 0);
2365
+ }
2366
+ const os = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, ss = new Intl.NumberFormat("en", {
2367
+ style: "decimal",
2368
+ signDisplay: "never",
2369
+ minimumFractionDigits: 0,
2370
+ maximumFractionDigits: 0
2371
+ }), is = (e) => ga(e, {
2372
+ secondsDecimalDigits: 2,
2373
+ unitCount: 2
2374
+ }), ba = (e) => f(
2375
+ "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",
2376
+ e || Xe ? "pt-4" : "pt-10"
2377
+ ), cs = (e, t) => t === 1 ? e : `${e}s`, Ce = (e) => {
2378
+ let t = "";
2379
+ if (typeof e == "number" || typeof e == "string")
2380
+ t = "m-" + e;
2381
+ else {
2382
+ const r = [];
2383
+ (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(" ");
2384
+ }
2385
+ return t;
2386
+ }, ls = "av-bubble", yt = "av-button", Te = "av-card", wa = "av-footer", Ea = "av-main", ds = "av-messagebox", us = "av-panel", ms = "av-spinner", Xt = "icon", Zt = "button", va = "link", Ta = ({
2387
+ type: e,
2388
+ size: t,
2389
+ labelRight: r,
2390
+ labelLeft: n,
2391
+ align: a
2392
+ }) => {
2393
+ 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";
2394
+ switch (e) {
2395
+ case Zt:
2396
+ return f("px-4", {
2397
+ [o]: t === "small",
2398
+ [s]: t === "medium",
2399
+ [i]: t === "large"
2400
+ });
2401
+ case va:
2402
+ return f("px-4 text-center", {
2403
+ [o]: t === "small",
2404
+ [s]: t === "medium",
2405
+ [i]: t === "large"
2406
+ });
2407
+ case Xt:
2408
+ return f("inline-flex items-center", {
2409
+ "justify-center": a === "center",
2410
+ "justify-start": a === "left",
2411
+ "justify-end": a === "right",
2412
+ "h-6 w-6 p-0": t === "small" && !(r || n),
2413
+ "h-6 px-4 text-sm font-medium": t === "small" && (r || n),
2414
+ "h-8 w-8 p-1": t === "medium" && !(r || n),
2415
+ "h-8 px-4 text-base font-medium": t === "medium" && (r || n),
2416
+ "h-12 w-12 p-2": t === "large" && !(r || n),
2417
+ "h-12 px-4 text-lg font-medium": t === "large" && (r || n)
2418
+ });
2419
+ }
2420
+ }, Sa = ({
2421
+ mode: e,
2422
+ noBackground: t,
2423
+ noTruncate: r,
2424
+ variant: n
2425
+ }) => {
2426
+ if (t)
2427
+ return "not-prose rounded-full";
2428
+ if (n === "primary")
2429
+ return f("not-prose rounded-full", {
2430
+ truncate: !r,
2431
+ "bg-action-dark text-copy-light": e === "dark",
2432
+ "bg-action-light text-copy-lighter": e === "light",
2433
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "system",
2434
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
2435
+ });
2436
+ if (n === "secondary")
2437
+ return f("not-prose rounded-full", {
2438
+ truncate: !r,
2439
+ "bg-action-dark text-copy-light": e === "light",
2440
+ "bg-action-light text-copy-lighter": e === "dark",
2441
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "alt-system",
2442
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
2443
+ });
2444
+ if (n === "danger")
2445
+ return f("not-prose rounded-full", {
2446
+ truncate: !r,
2447
+ "bg-action-danger-dark text-copy-light": e === "dark",
2448
+ "bg-action-danger-light text-copy-lighter": e === "light",
2449
+ "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
2450
+ "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
2451
+ });
2452
+ }, Ia = ({
2453
+ mode: e,
2454
+ disabled: t,
2455
+ variant: r
2456
+ }) => {
2457
+ if (t)
2458
+ return "";
2459
+ if (r === "primary")
2460
+ return f("hover:text-copy-light-hover", {
2461
+ "hover:bg-action-dark-hover": e === "dark",
2462
+ "hover:bg-action-light-hover": e === "light",
2463
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
2464
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
2465
+ });
2466
+ if (r === "secondary")
2467
+ return f("hover:text-copy-light-hover", {
2468
+ "hover:bg-action-dark-hover": e === "light",
2469
+ "hover:bg-action-light-hover": e === "dark",
2470
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
2471
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
2472
+ });
2473
+ if (r === "danger")
2474
+ return f("hover:text-copy-light-hover", {
2475
+ "hover:bg-action-danger-dark-hover": e === "dark",
2476
+ "hover:bg-action-danger-light-hover": e === "light",
2477
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
2478
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
2479
+ });
2480
+ }, Aa = ({
2481
+ mode: e,
2482
+ disabled: t,
2483
+ variant: r
2484
+ }) => {
2485
+ if (t)
2486
+ return "";
2487
+ if (r === "primary")
2488
+ return f("active:text-copy-light-active", {
2489
+ "active:bg-action-dark-active": e === "dark",
2490
+ "active:bg-action-light-active": e === "light",
2491
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
2492
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
2493
+ });
2494
+ if (r === "secondary")
2495
+ return f("active:text-copy-light-active", {
2496
+ "active:bg-action-dark-active": e === "light",
2497
+ "active:bg-action-light-active": e === "dark",
2498
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
2499
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
2500
+ });
2501
+ if (r === "danger")
2502
+ return f("active:text-copy-lighter-active", {
2503
+ "active:bg-action-danger-dark-active": e === "dark",
2504
+ "active:bg-action-danger-light-active": e === "light",
2505
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
2506
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
2507
+ });
2508
+ }, ka = ({
2509
+ mode: e,
2510
+ noBorder: t,
2511
+ variant: r
2512
+ }) => {
2513
+ if (t)
2514
+ return "border border-transparent";
2515
+ if (r === "primary")
2516
+ return f("border", {
2517
+ "border-border-dark": e === "dark",
2518
+ "border-border-accent": e === "light",
2519
+ "border-border-dark dark:border-border-accent": e === "system",
2520
+ "border-border-accent dark:border-border-dark": e === "alt-system"
2521
+ });
2522
+ if (r === "secondary")
2523
+ return f("border", {
2524
+ "border-border-dark": e === "light",
2525
+ "border-border-accent": e === "dark",
2526
+ "border-border-dark dark:border-border-accent": e === "alt-system",
2527
+ "border-border-accent dark:border-border-dark": e === "system"
2528
+ });
2529
+ if (r === "danger")
2530
+ return f("border", {
2531
+ "border-border-danger-dark": e === "dark",
2532
+ "border-border-danger-medium": e === "light",
2533
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
2534
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
2535
+ });
2536
+ }, _a = ({ focusMode: e }) => f("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
2537
+ "focus:outline-focus-dark": e === "dark",
2538
+ "focus:outline-focus-light": e === "light",
2539
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
2540
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
2541
+ }), er = ({
2542
+ type: e,
2543
+ className: t,
2544
+ raw: r,
2545
+ mode: n,
2546
+ focusMode: a,
2547
+ disabled: o,
2548
+ fullWidth: s,
2549
+ size: i,
2550
+ noBorder: p,
2551
+ labelRight: m,
2552
+ labelLeft: u,
2553
+ spacing: g,
2554
+ noBackground: l,
2555
+ variant: d,
2556
+ noTruncate: h,
2557
+ align: y
2558
+ }) => (d || (d = "primary"), r ? f(yt, t) : f(
2559
+ yt,
2560
+ t,
2561
+ Ce(g),
2562
+ Sa({ mode: n, variant: d, noBackground: l, noTruncate: h }),
2563
+ Ta({ type: e, size: i, labelRight: m, labelLeft: u, align: y }),
2564
+ ka({ mode: n, variant: d, noBorder: p }),
2565
+ _a({ focusMode: a }),
2566
+ Ia({ mode: n, variant: d, disabled: o }),
2567
+ Aa({ mode: n, variant: d, disabled: o }),
2568
+ {
2569
+ "w-full": s,
2570
+ "disabled:cursor-not-allowed disabled:opacity-50": o
2571
+ }
2572
+ )), Ra = (e, t, r) => {
2573
+ var n;
2574
+ !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((n = e == null ? void 0 : e.currentTarget) == null ? void 0 : n.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
2575
+ }, Ze = G.forwardRef(
2576
+ (e, t) => {
2577
+ const { onClick: r, noInternalClick: n = !1, ...a } = e;
2578
+ return /* @__PURE__ */ c(
2579
+ "button",
2580
+ {
2581
+ ref: t,
2582
+ onClick: (o) => {
2583
+ Ra(o, n, r);
2584
+ },
2585
+ ...a
2586
+ }
2587
+ );
2588
+ }
2589
+ );
2590
+ Ze.displayName = "BaseButton";
2591
+ const Ye = G.forwardRef(
2592
+ ({
2593
+ children: e,
2594
+ disabled: t = !1,
2595
+ mode: r = "system",
2596
+ focusMode: n = "system",
2597
+ fullWidth: a = !1,
2598
+ className: o,
2599
+ type: s = "button",
2600
+ raw: i = !1,
2601
+ noBorder: p = !1,
2602
+ "aria-label": m,
2603
+ label: u,
2604
+ size: g = "medium",
2605
+ labelRight: l,
2606
+ labelLeft: d,
2607
+ spacing: h,
2608
+ noBackground: y = !1,
2609
+ align: w = "center",
2610
+ ...T
2611
+ }, x) => {
2612
+ const P = er({
2613
+ type: Xt,
2614
+ mode: r,
2615
+ focusMode: n,
2616
+ fullWidth: a,
2617
+ disabled: t,
2618
+ raw: i,
2619
+ className: o,
2620
+ noBorder: p,
2621
+ size: g,
2622
+ labelRight: l,
2623
+ labelLeft: d,
2624
+ spacing: h,
2625
+ noBackground: y,
2626
+ align: w
2627
+ }), B = f({
2628
+ "text-copy-accent-dark": r === "light" && !i,
2629
+ "text-copy-light": r === "dark" && !i,
2630
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
2631
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !i
2632
+ });
2633
+ return /* @__PURE__ */ v(
2634
+ Ze,
2635
+ {
2636
+ ref: x,
2637
+ className: P,
2638
+ disabled: t,
2639
+ type: s,
2640
+ "aria-label": m || u,
2641
+ ...T,
2642
+ children: [
2643
+ d && /* @__PURE__ */ c("span", { className: "pr-2", children: d }),
2644
+ /* @__PURE__ */ c("div", { className: B, children: e }),
2645
+ l && /* @__PURE__ */ c("span", { className: "pl-2", children: l })
2646
+ ]
2647
+ }
2648
+ );
2649
+ }
2650
+ );
2651
+ Ye.displayName = "ButtonIcon";
2652
+ const tr = G.forwardRef(
2653
+ ({
2654
+ children: e,
2655
+ disabled: t = !1,
2656
+ mode: r = "system",
2657
+ focusMode: n = "system",
2658
+ fullWidth: a = !1,
2659
+ className: o,
2660
+ size: s = "medium",
2661
+ raw: i = !1,
2662
+ noBorder: p = !1,
2663
+ spacing: m,
2664
+ variant: u = "primary",
2665
+ noTruncate: g = !1,
2666
+ ...l
2667
+ }, d) => {
2668
+ const h = er({
2669
+ type: Zt,
2670
+ mode: r,
2671
+ focusMode: n,
2672
+ fullWidth: a,
2673
+ disabled: t,
2674
+ raw: i,
2675
+ className: o,
2676
+ size: s,
2677
+ noBorder: p,
2678
+ spacing: m,
2679
+ variant: u,
2680
+ noTruncate: g
2681
+ });
2682
+ return /* @__PURE__ */ c(
2683
+ Ze,
2684
+ {
2685
+ ref: d,
2686
+ className: h,
2687
+ disabled: t,
2688
+ ...l,
2689
+ children: e
2690
+ }
2691
+ );
2692
+ }
2693
+ );
2694
+ tr.displayName = "Button";
2695
+ function Na(e) {
2696
+ const t = Tt();
2697
+ return `${e}${t}`;
2698
+ }
2699
+ const xa = ({
2700
+ className: e,
2701
+ headerClassName: t,
2702
+ bodyClassName: r,
2703
+ footerClassName: n,
2704
+ spacing: a,
2705
+ mode: o,
2706
+ compact: s,
2707
+ noBorder: i
2708
+ }) => {
2709
+ const p = f(
2710
+ Te,
2711
+ e,
2712
+ "rounded-md",
2713
+ Ce(a),
2714
+ {
2715
+ "border-none": i,
2716
+ "border-2": !i,
2717
+ "p-4": !s,
2718
+ "p-1 sm:p-2": s,
2719
+ "border-border-accent bg-surface-darker text-copy-light": o === "darker",
2720
+ "border-border-accent bg-surface-dark text-copy-light": o === "dark",
2721
+ "border-border-dark bg-surface-lighter text-copy-dark": o === "light",
2722
+ "border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": o === "system",
2723
+ "border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": o === "alt-system"
2724
+ }
2725
+ ), m = t || f(`${Te}__header mt-0 border-b-2`, {
2726
+ "text-copy-light border-border-accent": o === "darker",
2727
+ "border-border-accent": o === "dark",
2728
+ "border-border-medium": o === "light",
2729
+ "border-border-medium dark:border-border-accent": o === "system",
2730
+ "border-border-accent dark:border-border-medium": o === "alt-system",
2731
+ "mb-4": !s,
2732
+ "mb-2": s
2733
+ }), u = f(r), g = n || f(`${Te}__footer pt-2`);
2734
+ return {
2735
+ wrapper: p,
2736
+ header: m,
2737
+ body: u,
2738
+ footer: g
2739
+ };
2740
+ };
2741
+ function Ca({
2742
+ id: e,
2743
+ content: t,
2744
+ userAriaLabelledby: r,
2745
+ className: n
2746
+ }) {
2747
+ return typeof t == "string" ? /* @__PURE__ */ c("h2", { id: e, className: n, children: t }) : r ? /* @__PURE__ */ c("div", { className: n, children: t }) : t ? /* @__PURE__ */ c("div", { className: n, id: e, children: t }) : null;
2748
+ }
2749
+ const Oa = ({
2750
+ header: e,
2751
+ headerClassName: t,
2752
+ footer: r,
2753
+ footerClassName: n,
2754
+ children: a,
2755
+ className: o,
2756
+ bodyClassName: s,
2757
+ "aria-labelledby": i,
2758
+ spacing: p,
2759
+ mode: m = "system",
2760
+ compact: u = !1,
2761
+ noBorder: g = !1,
2762
+ ...l
2763
+ }) => {
2764
+ let d = null, h = null;
2765
+ const y = typeof e == "string", w = Na(Te), T = xa({
2766
+ className: o,
2767
+ headerClassName: t,
2768
+ bodyClassName: s,
2769
+ footerClassName: n,
2770
+ spacing: p,
2771
+ mode: m,
2772
+ compact: u,
2773
+ noBorder: g
2774
+ });
2775
+ return y ? (d = w, h = d) : !y && e && i ? (d = null, h = i) : !y && e && !i ? (d = w, h = d) : (d = null, h = i || null), /* @__PURE__ */ c("div", { className: T.wrapper, children: /* @__PURE__ */ v(
2776
+ "section",
2777
+ {
2778
+ ...h && {
2779
+ "aria-labelledby": h
2780
+ },
2781
+ className: T.body,
2782
+ ...l,
2783
+ children: [
2784
+ /* @__PURE__ */ c(
2785
+ Ca,
2786
+ {
2787
+ ...d && { id: d },
2788
+ content: e,
2789
+ className: T.header,
2790
+ userAriaLabelledby: i
2791
+ }
2792
+ ),
2793
+ /* @__PURE__ */ c("div", { children: a }),
2794
+ r ? /* @__PURE__ */ c("div", { className: T.footer, children: r }) : null
2795
+ ]
2796
+ }
2797
+ ) });
2798
+ }, Pa = ({
2799
+ className: e,
2800
+ mode: t = "system",
2801
+ row1: r,
2802
+ row2: n,
2803
+ noMargins: a = !1,
2804
+ spacing: o,
2805
+ raw: s = !1
2806
+ }) => {
2807
+ const i = f(wa, e, Ce(o), {
2808
+ "text-copy-dark": !s && t === "dark",
2809
+ "text-copy-lighter": !s && t === "light",
2810
+ "text-copy-dark dark:text-copy-lighter": !s && t === "system",
2811
+ "text-copy-lighter dark:text-copy-dark": !s && t === "alt-system",
2812
+ "mb-[100px]": !a && !s,
2813
+ "mt-0 flex w-full flex-col p-2 text-center text-xs sm:mt-3 md:mx-auto md:max-w-4xl": !s
2814
+ });
2815
+ return /* @__PURE__ */ v("footer", { className: i, children: [
2816
+ r && /* @__PURE__ */ c("div", { children: r }),
2817
+ n && /* @__PURE__ */ c("div", { children: n })
2818
+ ] });
2819
+ }, Da = ({
2820
+ children: e,
2821
+ className: t,
2822
+ raw: r = !1,
2823
+ spacing: n
2824
+ }) => {
2825
+ const a = f(t, Ea, Ce(n), {
2826
+ "mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
2827
+ });
2828
+ return /* @__PURE__ */ c("main", { className: a, children: e });
2829
+ };
2830
+ /*!
2831
+ @versini/ui-components v5.21.0
2832
+ © 2024 gizmette.com
2833
+ */
2834
+ try {
2835
+ window.__VERSINI_UI_GLOBAL__ || (window.__VERSINI_UI_GLOBAL__ = {
2836
+ version: "5.21.0",
2837
+ buildTime: "07/19/2024 08:17 PM EDT",
2838
+ homepage: "https://github.com/aversini/ui-components",
2839
+ license: "MIT"
2840
+ });
2841
+ } catch {
2842
+ }
2843
+ function $a(e) {
2844
+ return hr(() => e.every((t) => t == null) ? () => {
2845
+ } : (t) => {
2846
+ e.forEach((r) => {
2847
+ typeof r == "function" ? r(t) : r != null && (r.current = t);
2848
+ });
2849
+ }, e);
2850
+ }
2851
+ function Ma(e) {
2852
+ const t = Tt();
2853
+ if (!e)
2854
+ return t;
2855
+ if (typeof e == "number" || typeof e == "string")
2856
+ return `${e}${t}`;
2857
+ if (typeof e == "object") {
2858
+ const { id: r, prefix: n = "" } = e;
2859
+ return typeof r == "number" || typeof r == "string" ? `${n}${r}` : `${n}${t}`;
2860
+ }
2861
+ }
2862
+ const rr = "SET_ANNOUNCEMENT", nr = "CLEAR_ANNOUNCEMENT", La = {
2863
+ alert: null,
2864
+ alertdialog: null,
2865
+ log: "polite",
2866
+ marquee: null,
2867
+ progressbar: null,
2868
+ status: "polite",
2869
+ timer: "assertive"
2870
+ }, Ua = (e, t) => {
2871
+ switch (t == null ? void 0 : t.type) {
2872
+ case rr:
2873
+ return {
2874
+ ...e,
2875
+ announcement: t.payload
2876
+ };
2877
+ case nr:
2878
+ return {
2879
+ ...e,
2880
+ announcement: null
2881
+ };
2882
+ default:
2883
+ return e;
2884
+ }
2885
+ }, Ha = ({
2886
+ onAnnouncementClear: e,
2887
+ dispatch: t
2888
+ }) => {
2889
+ t({
2890
+ type: nr
2891
+ }), typeof e == "function" && e();
2892
+ }, bt = ({
2893
+ children: e,
2894
+ clearAnnouncementDelay: t,
2895
+ clearAnnouncementTimeoutRef: r,
2896
+ onAnnouncementClear: n,
2897
+ dispatch: a
2898
+ }) => {
2899
+ (r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && a({
2900
+ type: rr,
2901
+ payload: e
2902
+ }), t && (r.current = setTimeout(
2903
+ () => Ha({
2904
+ onAnnouncementClear: n,
2905
+ dispatch: a
2906
+ }),
2907
+ t
2908
+ ));
2909
+ }, Ka = ({
2910
+ children: e,
2911
+ announcementTimeoutRef: t,
2912
+ announcementDelay: r,
2913
+ clearAnnouncementDelay: n,
2914
+ clearAnnouncementTimeoutRef: a,
2915
+ onAnnouncementClear: o,
2916
+ dispatch: s
2917
+ }) => {
2918
+ clearTimeout(t.current), r ? t.current = setTimeout(bt, r, {
2919
+ children: e,
2920
+ clearAnnouncementDelay: n,
2921
+ clearAnnouncementTimeoutRef: a,
2922
+ onAnnouncementClear: o,
2923
+ dispatch: s
2924
+ }) : bt({
2925
+ children: e,
2926
+ clearAnnouncementDelay: n,
2927
+ clearAnnouncementTimeoutRef: a,
2928
+ onAnnouncementClear: o,
2929
+ dispatch: s
2930
+ });
2931
+ };
2932
+ function ar({
2933
+ children: e,
2934
+ className: t,
2935
+ politeness: r,
2936
+ role: n = null,
2937
+ announcementDelay: a,
2938
+ clearAnnouncementDelay: o,
2939
+ onAnnouncementClear: s,
2940
+ visible: i,
2941
+ ...p
2942
+ }) {
2943
+ const m = F(), u = F(), [g, l] = Et(Ua, {
2944
+ announcement: null
2945
+ });
2946
+ let d = r;
2947
+ typeof d > "u" && (d = n ? La[n] : "assertive"), j(() => {
2948
+ Ka({
2949
+ announcementTimeoutRef: m,
2950
+ announcementDelay: a,
2951
+ children: e,
2952
+ clearAnnouncementDelay: o,
2953
+ clearAnnouncementTimeoutRef: u,
2954
+ onAnnouncementClear: s,
2955
+ dispatch: l
2956
+ });
2957
+ }, [
2958
+ e,
2959
+ a,
2960
+ o,
2961
+ s
2962
+ ]);
2963
+ const h = f(t, {
2964
+ "sr-only": !i
2965
+ });
2966
+ return /* @__PURE__ */ c(
2967
+ "div",
2968
+ {
2969
+ "aria-live": d,
2970
+ ...n && { role: n },
2971
+ className: h,
2972
+ ...p,
2973
+ children: g.announcement
2974
+ }
2975
+ );
2976
+ }
2977
+ /*!
2978
+ @versini/ui-private v1.4.6
2979
+ © 2024 gizmette.com
2980
+ */
2981
+ try {
2982
+ window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
2983
+ version: "1.4.6",
2984
+ buildTime: "07/08/2024 04:31 PM EDT",
2985
+ homepage: "https://github.com/aversini/ui-components",
2986
+ license: "MIT"
2987
+ });
2988
+ } catch {
2989
+ }
2990
+ const Ga = (e) => {
2991
+ let t = "";
2992
+ if (typeof e == "number" || typeof e == "string")
2993
+ t = "m-" + e;
2994
+ else {
2995
+ const r = [];
2996
+ (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(" ");
2997
+ }
2998
+ return t;
2999
+ }, or = "av-text-input", Ba = "av-text-input-wrapper", Je = "av-text-input-helper-text", hs = "av-text-area", ps = "av-text-area-wrapper", gs = "av-text-area-helper-text", fs = "av-text-area__control--right", ys = "av-toggle", Wa = ({
3000
+ mode: e
3001
+ }) => f({
3002
+ "bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
3003
+ "bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
3004
+ "bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
3005
+ "bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
3006
+ }), Va = ({
3007
+ focusMode: e
3008
+ }) => f("focus:outline focus:outline-2 focus:outline-offset-2", {
3009
+ "focus:outline-focus-dark": e === "dark",
3010
+ "focus:outline-focus-light": e === "light",
3011
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
3012
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
3013
+ }), Fa = ({
3014
+ noBorder: e,
3015
+ error: t
3016
+ }) => f("border-2", {
3017
+ "border-border-dark": !e && !t,
3018
+ "focus:border-border-dark": !e && t,
3019
+ "border-border-error-dark": !e && t,
3020
+ "border-transparent": e
3021
+ }), Ja = ({
3022
+ disabled: e,
3023
+ raw: t,
3024
+ error: r,
3025
+ mode: n
3026
+ }) => {
3027
+ if (t)
3028
+ return "";
3029
+ if (e)
3030
+ return f("absolute px-2 cursor-not-allowed opacity-50 font-medium");
3031
+ if (!r)
3032
+ return f("absolute px-2 cursor-text font-medium", {
3033
+ "text-copy-lighter": n === "dark",
3034
+ "text-copy-dark": n === "light",
3035
+ "text-copy-dark dark:text-copy-lighter": n === "system",
3036
+ "text-copy-lighter dark:text-copy-dark": n === "alt-system"
3037
+ });
3038
+ if (r)
3039
+ return f("absolute px-2 cursor-text font-medium", {
3040
+ "text-copy-lighter": n === "dark",
3041
+ "text-copy-error-dark": n === "light",
3042
+ "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": n === "system",
3043
+ "text-copy-lighter dark:text-copy-error-dark": n === "alt-system"
3044
+ });
3045
+ }, ja = ({
3046
+ error: e,
3047
+ raw: t,
3048
+ mode: r,
3049
+ disabled: n
3050
+ }) => {
3051
+ if (t)
3052
+ return "";
3053
+ if (n)
3054
+ return f(
3055
+ Je,
3056
+ "absolute px-2 cursor-not-allowed opacity-50 font-medium"
3057
+ );
3058
+ if (!e)
3059
+ return f(Je, "absolute px-2 font-medium", {
3060
+ "text-copy-lighter": r === "dark",
3061
+ "text-copy-dark": r === "light",
3062
+ "text-copy-dark dark:text-copy-lighter": r === "system",
3063
+ "text-copy-lighter dark:text-copy-dark": r === "alt-system"
3064
+ });
3065
+ if (e)
3066
+ return f(Je, "absolute px-2 font-medium", {
3067
+ "text-copy-error-light bg-surface-darker": r === "dark",
3068
+ "text-copy-error-dark": r === "light",
3069
+ "text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
3070
+ "dark:text-copy-error-dark text-copy-error-light bg-surface-darker": r === "alt-system"
3071
+ });
3072
+ }, Ya = ({
3073
+ className: e,
3074
+ inputClassName: t,
3075
+ raw: r,
3076
+ disabled: n,
3077
+ noBorder: a,
3078
+ error: o,
3079
+ spacing: s,
3080
+ mode: i,
3081
+ focusMode: p
3082
+ }) => {
3083
+ const m = r ? e : f(
3084
+ "relative flex w-full flex-col justify-center",
3085
+ Ba,
3086
+ e,
3087
+ Ga(s)
3088
+ ), u = r ? f(t) : f(
3089
+ or,
3090
+ t,
3091
+ "h-12 rounded-md px-4 text-base",
3092
+ Wa({ mode: i }),
3093
+ Va({ focusMode: p }),
3094
+ Fa({ noBorder: a, error: o }),
3095
+ {
3096
+ "disabled:cursor-not-allowed disabled:opacity-50": n
3097
+ }
3098
+ ), g = r ? void 0 : "sr-only", l = Ja({
3099
+ disabled: n,
3100
+ raw: r,
3101
+ error: o,
3102
+ mode: i
3103
+ }), d = ja({
3104
+ error: o,
3105
+ raw: r,
3106
+ mode: i,
3107
+ disabled: n
3108
+ });
3109
+ return {
3110
+ wrapper: m,
3111
+ input: u,
3112
+ accessibleLabel: g,
3113
+ visibleLabel: l,
3114
+ helperText: d,
3115
+ rightElement: r ? void 0 : "absolute right-3"
3116
+ };
3117
+ }, et = G.forwardRef(
3118
+ ({
3119
+ id: e,
3120
+ name: t,
3121
+ label: r,
3122
+ error: n = !1,
3123
+ raw: a = !1,
3124
+ className: o,
3125
+ inputClassName: s,
3126
+ mode: i = "system",
3127
+ focusMode: p = "system",
3128
+ disabled: m = !1,
3129
+ noBorder: u = !1,
3130
+ labelId: g,
3131
+ labelHidden: l = !1,
3132
+ type: d = "text",
3133
+ helperText: h = "",
3134
+ rightElement: y,
3135
+ spacing: w,
3136
+ ...T
3137
+ }, x) => {
3138
+ const P = F(null), [B, z] = J(0), C = Ma({ id: e, prefix: `${or}-` }), D = `${t} error, ${h}`, S = Ya({
3139
+ className: o,
3140
+ inputClassName: s,
3141
+ error: n,
3142
+ raw: a,
3143
+ focusMode: p,
3144
+ disabled: m,
3145
+ noBorder: u,
3146
+ spacing: w,
3147
+ mode: i
3148
+ });
3149
+ return pr(() => {
3150
+ P.current && z(P.current.offsetWidth + 18 + 10);
3151
+ }, []), /* @__PURE__ */ v("div", { className: S.wrapper, children: [
3152
+ /* @__PURE__ */ c(
3153
+ "label",
3154
+ {
3155
+ htmlFor: C,
3156
+ id: g,
3157
+ className: S.accessibleLabel,
3158
+ children: r
3159
+ }
3160
+ ),
3161
+ /* @__PURE__ */ c(
3162
+ "input",
3163
+ {
3164
+ ref: x,
3165
+ id: C,
3166
+ name: t,
3167
+ type: d,
3168
+ disabled: m,
3169
+ placeholder: a ? void 0 : " ",
3170
+ className: S.input,
3171
+ ...h && { "aria-describedby": `${C}-helper` },
3172
+ ...n && { "aria-invalid": "true" },
3173
+ ...y && !a && { style: { paddingRight: B } },
3174
+ ...T
3175
+ }
3176
+ ),
3177
+ !a && !l && /* @__PURE__ */ c(
3178
+ "label",
3179
+ {
3180
+ "aria-hidden": !0,
3181
+ htmlFor: C,
3182
+ className: S.visibleLabel,
3183
+ children: r
3184
+ }
3185
+ ),
3186
+ h && /* @__PURE__ */ c(
3187
+ "div",
3188
+ {
3189
+ id: `${C}-helper`,
3190
+ className: S.helperText,
3191
+ children: h
3192
+ }
3193
+ ),
3194
+ y && /* @__PURE__ */ c(
3195
+ "div",
3196
+ {
3197
+ ref: P,
3198
+ className: S.rightElement,
3199
+ children: y
3200
+ }
3201
+ ),
3202
+ n && h && /* @__PURE__ */ c(ar, { politeness: "polite", clearAnnouncementDelay: 500, children: D })
3203
+ ] });
3204
+ }
3205
+ );
3206
+ et.displayName = "TextInput";
3207
+ const za = 500, qa = 5e3, Qa = 2e4, sr = G.forwardRef(
3208
+ ({
3209
+ name: e,
3210
+ disabled: t,
3211
+ label: r,
3212
+ labelHidden: n,
3213
+ onMaskChange: a,
3214
+ onChange: o,
3215
+ onBlur: s,
3216
+ onFocus: i,
3217
+ onTextInputMaskBlur: p,
3218
+ rightElement: m,
3219
+ spacing: u,
3220
+ ...g
3221
+ }, l) => {
3222
+ const [d, h] = J(!0), [y, w] = J({
3223
+ message: null,
3224
+ politeness: null
3225
+ }), T = F(!0), x = F(), P = F(null), B = $a([l, P]), z = d ? "Show" : "Hide", C = () => {
3226
+ clearTimeout(x.current), T.current || (x.current = window.setTimeout(() => {
3227
+ T.current = !0, h(!0), w({
3228
+ announcementTimeout: qa,
3229
+ politeness: "polite",
3230
+ message: `${r} hiding characters`
3231
+ }), a && a(!0);
3232
+ }, Qa));
3233
+ }, D = (O) => {
3234
+ O.preventDefault();
3235
+ const L = !T.current;
3236
+ T.current = L, C(), h(L), w({
3237
+ announcementTimeout: za,
3238
+ politeness: "assertive",
3239
+ message: L ? "Characters hidden" : "Characters showing"
3240
+ }), a && a(L);
3241
+ }, S = (O) => {
3242
+ var L;
3243
+ const { relatedTarget: Me } = O, b = (L = P.current) == null ? void 0 : L.parentElement;
3244
+ b != null && b.contains(Me) || p && p();
3245
+ }, Pe = (O) => {
3246
+ C(), s && s(O), S(O);
3247
+ }, De = (O) => {
3248
+ C(), i && i(O);
3249
+ }, $e = (O) => {
3250
+ C(), o && o(O);
3251
+ };
3252
+ return j(() => () => {
3253
+ clearTimeout(x.current);
3254
+ }, []), /* @__PURE__ */ v(le, { children: [
3255
+ /* @__PURE__ */ c(
3256
+ et,
3257
+ {
3258
+ ref: B,
3259
+ name: e,
3260
+ label: r,
3261
+ labelHidden: n,
3262
+ type: d ? "password" : "text",
3263
+ disabled: t,
3264
+ spacing: u,
3265
+ onBlur: Pe,
3266
+ onFocus: De,
3267
+ onChange: $e,
3268
+ rightElement: G.cloneElement(m, {
3269
+ ref: l,
3270
+ label: z,
3271
+ onClick: D,
3272
+ onBlur: S,
3273
+ disabled: t
3274
+ }),
3275
+ ...g
3276
+ }
3277
+ ),
3278
+ /* @__PURE__ */ c(
3279
+ ar,
3280
+ {
3281
+ role: "status",
3282
+ politeness: y.politeness,
3283
+ clearAnnouncementDelay: y.announcementTimeout,
3284
+ children: y.message
3285
+ }
3286
+ )
3287
+ ] });
3288
+ }
3289
+ );
3290
+ sr.displayName = "TextInputMask";
3291
+ /*!
3292
+ @versini/ui-form v1.3.6
3293
+ © 2024 gizmette.com
3294
+ */
3295
+ try {
3296
+ window.__VERSINI_UI_FORM__ || (window.__VERSINI_UI_FORM__ = {
3297
+ version: "1.3.6",
3298
+ buildTime: "07/08/2024 04:31 PM EDT",
3299
+ homepage: "https://github.com/aversini/ui-components",
3300
+ license: "MIT"
3301
+ });
3302
+ } catch {
3303
+ }
3304
+ const Xa = (e) => {
3305
+ let t = "";
3306
+ if (typeof e == "number" || typeof e == "string")
3307
+ t = "m-" + e;
3308
+ else {
3309
+ const r = [];
3310
+ (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(" ");
3311
+ }
3312
+ return t;
3313
+ }, Oe = ({
3314
+ children: e,
3315
+ fill: t,
3316
+ viewBox: r,
3317
+ className: n,
3318
+ defaultViewBox: a,
3319
+ defaultClassName: o,
3320
+ spacing: s,
3321
+ title: i,
3322
+ semantic: p = !1,
3323
+ ...m
3324
+ }) => {
3325
+ const u = Xa(s), g = f(
3326
+ u,
3327
+ n || o
3328
+ );
3329
+ return /* @__PURE__ */ v(le, { children: [
3330
+ /* @__PURE__ */ c(
3331
+ "svg",
3332
+ {
3333
+ xmlns: "http://www.w3.org/2000/svg",
3334
+ className: g,
3335
+ viewBox: r || a,
3336
+ fill: t || "currentColor",
3337
+ role: "img",
3338
+ "aria-hidden": !p,
3339
+ focusable: !1,
3340
+ ...m,
3341
+ children: e
3342
+ }
3343
+ ),
3344
+ i && p && /* @__PURE__ */ c("span", { className: "sr-only", children: i })
3345
+ ] });
3346
+ };
3347
+ /*!
3348
+ @versini/ui-private v1.4.6
3349
+ © 2024 gizmette.com
3350
+ */
3351
+ try {
3352
+ window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
3353
+ version: "1.4.6",
3354
+ buildTime: "07/14/2024 07:45 PM EDT",
3355
+ homepage: "https://github.com/aversini/ui-components",
3356
+ license: "MIT"
3357
+ });
3358
+ } catch {
3359
+ }
3360
+ const Za = ({
3361
+ className: e,
3362
+ viewBox: t,
3363
+ spacing: r,
3364
+ ...n
3365
+ }) => /* @__PURE__ */ c(
3366
+ Oe,
3367
+ {
3368
+ defaultViewBox: "0 0 1200 500",
3369
+ defaultClassName: "w-full",
3370
+ viewBox: t,
3371
+ className: e,
3372
+ spacing: r,
3373
+ title: "Sassy Dog",
3374
+ ...n,
3375
+ children: /* @__PURE__ */ c("g", { transform: "matrix(11.9092 0 0 11.9092 470.0017 250.0009)", id: "879221", children: /* @__PURE__ */ c(
3376
+ "path",
3377
+ {
3378
+ vectorEffect: "non-scaling-stroke",
3379
+ transform: " translate(-50.7473, -45.4051)",
3380
+ 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",
3381
+ strokeLinecap: "round"
3382
+ }
3383
+ ) })
3384
+ }
3385
+ ), eo = ({
3386
+ className: e,
3387
+ viewBox: t,
3388
+ spacing: r,
3389
+ title: n,
3390
+ monotone: a,
3391
+ ...o
3392
+ }) => /* @__PURE__ */ v(
3393
+ Oe,
3394
+ {
3395
+ defaultViewBox: "0 0 640 512",
3396
+ defaultClassName: "size-5",
3397
+ viewBox: t,
3398
+ className: e,
3399
+ spacing: r,
3400
+ title: n || "Hide",
3401
+ ...o,
3402
+ children: [
3403
+ /* @__PURE__ */ c(
3404
+ "path",
3405
+ {
3406
+ opacity: a ? "1" : "0.4",
3407
+ 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"
3408
+ }
3409
+ ),
3410
+ /* @__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" })
3411
+ ]
3412
+ }
3413
+ ), to = ({
3414
+ className: e,
3415
+ viewBox: t,
3416
+ spacing: r,
3417
+ title: n,
3418
+ monotone: a,
3419
+ ...o
3420
+ }) => /* @__PURE__ */ v(
3421
+ Oe,
3422
+ {
3423
+ defaultViewBox: "0 0 512 512",
3424
+ defaultClassName: "size-5",
3425
+ viewBox: t,
3426
+ className: e,
3427
+ spacing: r,
3428
+ title: n || "Key",
3429
+ ...o,
3430
+ children: [
3431
+ /* @__PURE__ */ c(
3432
+ "path",
3433
+ {
3434
+ className: "fa-secondary",
3435
+ opacity: a ? "1" : "0.4",
3436
+ d: "M168.3 229.7L282.3 343.7l0 0s0 0 0 0L249 377c-4.5 4.5-10.6 7-17 7H192v40c0 13.3-10.7 24-24 24H128v40c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V408c0-6.4 2.5-12.5 7-17L168.3 229.7s0 0 0 0l0 0z"
3437
+ }
3438
+ ),
3439
+ /* @__PURE__ */ c(
3440
+ "path",
3441
+ {
3442
+ className: "fa-primary",
3443
+ d: "M168.3 229.7L282.3 343.7l0 0c16.9 5.4 35 8.3 53.7 8.3c97.2 0 176-78.8 176-176S433.2 0 336 0S160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7l0 0zM336 136a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"
3444
+ }
3445
+ )
3446
+ ]
3447
+ }
3448
+ ), ro = ({
3449
+ className: e,
3450
+ viewBox: t,
3451
+ spacing: r,
3452
+ title: n,
3453
+ monotone: a,
3454
+ ...o
3455
+ }) => /* @__PURE__ */ v(
3456
+ Oe,
3457
+ {
3458
+ defaultViewBox: "0 0 576 512",
3459
+ defaultClassName: "size-5",
3460
+ viewBox: t,
3461
+ className: e,
3462
+ spacing: r,
3463
+ title: n || "Show",
3464
+ ...o,
3465
+ children: [
3466
+ /* @__PURE__ */ c(
3467
+ "path",
3468
+ {
3469
+ opacity: a ? "1" : "0.4",
3470
+ 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"
3471
+ }
3472
+ ),
3473
+ /* @__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" })
3474
+ ]
3475
+ }
3476
+ );
3477
+ /*!
3478
+ @versini/ui-icons v1.11.0
3479
+ © 2024 gizmette.com
3480
+ */
3481
+ try {
3482
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
3483
+ version: "1.11.0",
3484
+ buildTime: "07/14/2024 07:45 PM EDT",
3485
+ homepage: "https://github.com/aversini/ui-components",
3486
+ license: "MIT"
3487
+ });
3488
+ } catch {
3489
+ }
3490
+ const no = (e) => {
3491
+ let t = "";
3492
+ if (typeof e == "number" || typeof e == "string")
3493
+ t = "m-" + e;
3494
+ else {
3495
+ const r = [];
3496
+ (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(" ");
3497
+ }
3498
+ return t;
3499
+ }, ao = "av-flexgrid", Ee = "av-flexgrid-item", _e = 0.25, ir = G.createContext({
3500
+ columnGap: 0,
3501
+ rowGap: 0
3502
+ }), wt = ({
3503
+ children: e,
3504
+ className: t,
3505
+ columnGap: r = 1,
3506
+ rowGap: n = 0,
3507
+ height: a = "auto",
3508
+ width: o = "auto",
3509
+ direction: s = "row",
3510
+ alignHorizontal: i = "normal",
3511
+ alignVertical: p = "normal",
3512
+ spacing: m,
3513
+ ...u
3514
+ }) => {
3515
+ const g = {
3516
+ flexDirection: s,
3517
+ justifyContent: i,
3518
+ alignItems: p,
3519
+ height: a,
3520
+ width: o,
3521
+ /**
3522
+ * Trick to account for the extra space taken
3523
+ * by the columnGap and rowGap that will be applied
3524
+ * to all FlexgridItems (see context and paddings).
3525
+ */
3526
+ marginLeft: r * -1 * _e + "rem",
3527
+ marginTop: n * -1 * _e + "rem"
3528
+ }, l = f(
3529
+ ao,
3530
+ t,
3531
+ "box-border flex flex-wrap"
3532
+ ), d = { columnGap: r, rowGap: n }, h = m ? "div" : G.Fragment;
3533
+ return /* @__PURE__ */ c(h, { ...m ? { className: no(m) } : {}, children: /* @__PURE__ */ c("div", { className: l, style: g, ...u, children: /* @__PURE__ */ c(ir.Provider, { value: d, children: e }) }) });
3534
+ }, je = (e, t) => f({
3535
+ "basis-1/12": e === 1 && !t,
3536
+ "sm:basis-1/12": e === 1 && t === "sm",
3537
+ "md:basis-1/12": e === 1 && t === "md",
3538
+ "lg:basis-1/12": e === 1 && t === "lg",
3539
+ "xl:basis-1/12": e === 1 && t === "xl",
3540
+ "2xl:basis-1/12": e === 1 && t === "2xl",
3541
+ "basis-2/12": e === 2 && !t,
3542
+ "sm:basis-2/12": e === 2 && t === "sm",
3543
+ "md:basis-2/12": e === 2 && t === "md",
3544
+ "lg:basis-2/12": e === 2 && t === "lg",
3545
+ "xl:basis-2/12": e === 2 && t === "xl",
3546
+ "2xl:basis-2/12": e === 2 && t === "2xl",
3547
+ "basis-3/12": e === 3 && !t,
3548
+ "sm:basis-3/12": e === 3 && t === "sm",
3549
+ "md:basis-3/12": e === 3 && t === "md",
3550
+ "lg:basis-3/12": e === 3 && t === "lg",
3551
+ "xl:basis-3/12": e === 3 && t === "xl",
3552
+ "2xl:basis-3/12": e === 3 && t === "2xl",
3553
+ "basis-4/12": e === 4 && !t,
3554
+ "sm:basis-4/12": e === 4 && t === "sm",
3555
+ "md:basis-4/12": e === 4 && t === "md",
3556
+ "lg:basis-4/12": e === 4 && t === "lg",
3557
+ "xl:basis-4/12": e === 4 && t === "xl",
3558
+ "2xl:basis-4/12": e === 4 && t === "2xl",
3559
+ "basis-5/12": e === 5 && !t,
3560
+ "sm:basis-5/12": e === 5 && t === "sm",
3561
+ "md:basis-5/12": e === 5 && t === "md",
3562
+ "lg:basis-5/12": e === 5 && t === "lg",
3563
+ "xl:basis-5/12": e === 5 && t === "xl",
3564
+ "2xl:basis-5/12": e === 5 && t === "2xl",
3565
+ "basis-6/12": e === 6 && !t,
3566
+ "sm:basis-6/12": e === 6 && t === "sm",
3567
+ "md:basis-6/12": e === 6 && t === "md",
3568
+ "lg:basis-6/12": e === 6 && t === "lg",
3569
+ "xl:basis-6/12": e === 6 && t === "xl",
3570
+ "2xl:basis-6/12": e === 6 && t === "2xl",
3571
+ "basis-7/12": e === 7 && !t,
3572
+ "sm:basis-7/12": e === 7 && t === "sm",
3573
+ "md:basis-7/12": e === 7 && t === "md",
3574
+ "lg:basis-7/12": e === 7 && t === "lg",
3575
+ "xl:basis-7/12": e === 7 && t === "xl",
3576
+ "2xl:basis-7/12": e === 7 && t === "2xl",
3577
+ "basis-8/12": e === 8 && !t,
3578
+ "sm:basis-8/12": e === 8 && t === "sm",
3579
+ "md:basis-8/12": e === 8 && t === "md",
3580
+ "lg:basis-8/12": e === 8 && t === "lg",
3581
+ "xl:basis-8/12": e === 8 && t === "xl",
3582
+ "2xl:basis-8/12": e === 8 && t === "2xl",
3583
+ "basis-9/12": e === 9 && !t,
3584
+ "sm:basis-9/12": e === 9 && t === "sm",
3585
+ "md:basis-9/12": e === 9 && t === "md",
3586
+ "lg:basis-9/12": e === 9 && t === "lg",
3587
+ "xl:basis-9/12": e === 9 && t === "xl",
3588
+ "2xl:basis-9/12": e === 9 && t === "2xl",
3589
+ "basis-10/12": e === 10 && !t,
3590
+ "sm:basis-10/12": e === 10 && t === "sm",
3591
+ "md:basis-10/12": e === 10 && t === "md",
3592
+ "lg:basis-10/12": e === 10 && t === "lg",
3593
+ "xl:basis-10/12": e === 10 && t === "xl",
3594
+ "2xl:basis-10/12": e === 10 && t === "2xl",
3595
+ "basis-11/12": e === 11 && !t,
3596
+ "sm:basis-11/12": e === 11 && t === "sm",
3597
+ "md:basis-11/12": e === 11 && t === "md",
3598
+ "lg:basis-11/12": e === 11 && t === "lg",
3599
+ "xl:basis-11/12": e === 11 && t === "xl",
3600
+ "2xl:basis-11/12": e === 11 && t === "2xl",
3601
+ "basis-full": e === 12 && !t,
3602
+ "sm:basis-full": e === 12 && t === "sm",
3603
+ "md:basis-full": e === 12 && t === "md",
3604
+ "lg:basis-full": e === 12 && t === "lg",
3605
+ "xl:basis-full": e === 12 && t === "xl",
3606
+ "2xl:basis-full": e === 12 && t === "2xl"
3607
+ }), oo = ({
3608
+ className: e,
3609
+ span: t
3610
+ }) => {
3611
+ if (!t)
3612
+ return f(e, Ee, "box-border basis-auto");
3613
+ if (typeof t == "number")
3614
+ return f(e, Ee, "box-border max-w-full", {
3615
+ [`${je(t)}`]: !0
3616
+ });
3617
+ if (typeof t == "string")
3618
+ return f(e, Ee, "box-border basis-auto", {
3619
+ "max-w-full grow": t === "auto"
3620
+ });
3621
+ if (typeof t == "object") {
3622
+ const r = Object.entries(t).map(([n, a]) => n === "fallback" ? je(a) : je(a, n));
3623
+ return f(
3624
+ e,
3625
+ Ee,
3626
+ "box-border",
3627
+ r
3628
+ );
3629
+ }
3630
+ }, ee = ({
3631
+ children: e,
3632
+ className: t,
3633
+ span: r,
3634
+ ...n
3635
+ }) => {
3636
+ const { columnGap: a, rowGap: o } = vt(ir), s = {
3637
+ paddingLeft: a * _e + "rem",
3638
+ paddingTop: o * _e + "rem"
3639
+ }, i = oo({
3640
+ className: t,
3641
+ span: r
3642
+ });
3643
+ return /* @__PURE__ */ c("div", { className: i, style: s, ...n, children: e });
3644
+ };
3645
+ /*!
3646
+ @versini/ui-system v1.4.2
3647
+ © 2024 gizmette.com
3648
+ */
3649
+ try {
3650
+ window.__VERSINI_UI_SYSTEM__ || (window.__VERSINI_UI_SYSTEM__ = {
3651
+ version: "1.4.2",
3652
+ buildTime: "07/05/2024 05:27 PM EDT",
3653
+ homepage: "https://github.com/aversini/ui-components",
3654
+ license: "MIT"
3655
+ });
3656
+ } catch {
3657
+ }
3658
+ const so = "ASK! ME! ANYTHING!", cr = "Sassy Saint", io = "gizmette.com", co = "Log in", lo = "Sign in with a Passkey", bs = "Log out", uo = "Password", mo = "Powered by OpenAI", ws = "Send", Es = "Profile", vs = "Statistics", Ts = "Chat history", Ss = "About", Is = "Type your question here", As = "Clear chat", ks = "Cancel chat", _s = "N/A", Rs = {
3659
+ PREFERENCES: {
3660
+ TITLE: "User preferences",
3661
+ NAME: "Name",
3662
+ EMAIL: "Email",
3663
+ ENGINE_DETAILS: "Show message statistics",
3664
+ LOCATION: "Current location",
3665
+ MODEL_TYPE: "Use GPT model 4"
3666
+ },
3667
+ CURRENT_STATISTICS: {
3668
+ TITLE: "Current chat statistics",
3669
+ MODEL_NAME: "GPT model",
3670
+ TOKENS_USED: "Tokens used",
3671
+ REMAINING_TOKENS: "Remaining tokens",
3672
+ PROCESSING_TIME: "Average response time"
3673
+ },
3674
+ MAIN_STATISTICS: {
3675
+ TITLE: "Lifetime statistics",
3676
+ TOTAL: "Total chat session",
3677
+ PROCESSING_TIME: "Average response time"
3678
+ },
3679
+ HISTORY: {
3680
+ TITLE: "Chat history"
3681
+ },
3682
+ ABOUT: {
3683
+ TITLE_CLIENT: "Client details",
3684
+ TITLE_SERVER: "Server details",
3685
+ VERSION: "Version",
3686
+ BUILD_TIMESTAMP: "Build date",
3687
+ ENGINE: "OpenAI model",
3688
+ PLUGIN: "Plugin"
3689
+ }
3690
+ }, ho = ({
3691
+ serverStats: e
3692
+ }) => /* @__PURE__ */ c(
3693
+ Pa,
3694
+ {
3695
+ mode: "light",
3696
+ row1: /* @__PURE__ */ v("div", { children: [
3697
+ cr,
3698
+ " v",
3699
+ "3.4.3",
3700
+ " - ",
3701
+ mo,
3702
+ Xe && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
3703
+ ] }),
3704
+ row2: /* @__PURE__ */ v("div", { children: [
3705
+ "© ",
3706
+ (/* @__PURE__ */ new Date()).getFullYear(),
3707
+ " ",
3708
+ io
3709
+ ] })
3710
+ }
3711
+ ), po = St(() => import("./LazyHeader.p9mJYmhc.js")), go = () => {
3712
+ const { isAuthenticated: e } = Qe();
3713
+ return /* @__PURE__ */ v(le, { children: [
3714
+ e && /* @__PURE__ */ c(It, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(po, {}) }),
3715
+ /* @__PURE__ */ v("div", { className: "flex items-center justify-center", children: [
3716
+ /* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(Za, {}) }),
3717
+ /* @__PURE__ */ v("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
3718
+ /* @__PURE__ */ c("h1", { children: cr }),
3719
+ /* @__PURE__ */ c("h2", { children: so })
3720
+ ] })
3721
+ ] })
3722
+ ] });
3723
+ }, fo = () => {
3724
+ const { login: e, logoutReason: t, loginWithPasskey: r } = Qe(), [n, a] = J(""), [o, s] = J(""), [i, p] = J(!0), [m, u] = J({
3725
+ username: "",
3726
+ password: ""
3727
+ }), g = async (l) => {
3728
+ l.preventDefault(), await e(
3729
+ m.username,
3730
+ m.password,
3731
+ re.CODE
3732
+ ) || (s(""), a("Invalid username or password"));
3733
+ };
3734
+ return j(() => {
3735
+ var l;
3736
+ (l = document.getElementById("logo")) == null || l.classList.add("fadeOut"), setTimeout(() => {
3737
+ var d;
3738
+ (d = document.getElementById("root")) == null || d.classList.replace("app-hidden", "fadeIn");
3739
+ }, 500);
3740
+ }), j(() => {
3741
+ t && s(t);
3742
+ }, [t]), /* @__PURE__ */ v(le, { children: [
3743
+ /* @__PURE__ */ v(Da, { children: [
3744
+ /* @__PURE__ */ c("div", { className: ba(), children: /* @__PURE__ */ c(go, {}) }),
3745
+ /* @__PURE__ */ v("form", { className: "mt-5", onSubmit: g, children: [
3746
+ /* @__PURE__ */ c(wt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ c(ee, { span: 6, children: /* @__PURE__ */ v(Oa, { mode: "dark", children: [
3747
+ /* @__PURE__ */ c(ee, { span: 12, children: o && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
3748
+ /* @__PURE__ */ c(ee, { span: 12, children: /* @__PURE__ */ c(
3749
+ et,
3750
+ {
3751
+ required: !0,
3752
+ autoCapitalize: "off",
3753
+ autoComplete: "off",
3754
+ autoCorrect: "off",
3755
+ mode: "dark",
3756
+ focusMode: "light",
3757
+ name: "username",
3758
+ label: "Username",
3759
+ onChange: (l) => {
3760
+ u({
3761
+ ...m,
3762
+ username: l.target.value
3763
+ }), a("");
3764
+ },
3765
+ error: n !== ""
3766
+ }
3767
+ ) }),
3768
+ /* @__PURE__ */ c(ee, { span: 12, children: /* @__PURE__ */ c(
3769
+ sr,
3770
+ {
3771
+ required: !0,
3772
+ autoCapitalize: "off",
3773
+ autoComplete: "off",
3774
+ autoCorrect: "off",
3775
+ mode: "dark",
3776
+ focusMode: "light",
3777
+ name: "password",
3778
+ label: uo,
3779
+ rightElement: /* @__PURE__ */ c(Ye, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ c(ro, {}) : /* @__PURE__ */ c(eo, {}) }),
3780
+ onMaskChange: p,
3781
+ onChange: (l) => {
3782
+ u({
3783
+ ...m,
3784
+ password: l.target.value
3785
+ }), a("");
3786
+ },
3787
+ error: n !== "",
3788
+ helperText: n
3789
+ }
3790
+ ) }),
3791
+ /* @__PURE__ */ c(ee, { span: 12, children: /* @__PURE__ */ c(
3792
+ tr,
3793
+ {
3794
+ mode: "light",
3795
+ focusMode: "light",
3796
+ fullWidth: !0,
3797
+ noBorder: !0,
3798
+ type: "submit",
3799
+ className: "mb-4 mt-6",
3800
+ children: co
3801
+ }
3802
+ ) })
3803
+ ] }) }) }),
3804
+ /* @__PURE__ */ c("div", { className: "text-center text-copy-light", children: "or" }),
3805
+ /* @__PURE__ */ c(wt, { alignHorizontal: "center", children: /* @__PURE__ */ c(ee, { span: 6, children: /* @__PURE__ */ c(
3806
+ Ye,
3807
+ {
3808
+ mode: "dark",
3809
+ focusMode: "light",
3810
+ fullWidth: !0,
3811
+ noBorder: !0,
3812
+ className: "mb-4 mt-1",
3813
+ labelRight: lo,
3814
+ onClick: r,
3815
+ children: /* @__PURE__ */ c(to, { className: "size-4" })
3816
+ }
3817
+ ) }) })
3818
+ ] })
3819
+ ] }),
3820
+ /* @__PURE__ */ c(ho, {})
3821
+ ] });
3822
+ }, yo = new URL(document.location.href).searchParams, bo = !!yo.get("debug") || !1, wo = St(() => import("./App.C6D9sIPY.js").then((e) => e.App)), Eo = ({ isComponent: e }) => {
3823
+ const { isAuthenticated: t } = Qe();
3824
+ return t ? /* @__PURE__ */ c(It, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(wo, { isComponent: e }) }) : /* @__PURE__ */ c(fo, {});
3825
+ }, vo = ({
3826
+ isComponent: e = !1,
3827
+ domain: t = ya
3828
+ }) => /* @__PURE__ */ c(le, { children: /* @__PURE__ */ c(sa, { clientId: ia, domain: t, debug: bo, children: /* @__PURE__ */ c(Eo, { isComponent: e }) }) }), To = ({ domain: e }) => /* @__PURE__ */ c(vo, { isComponent: !0, domain: e });
3829
+ To.displayName = "SassySaint-3.4.3";
3830
+ export {
3831
+ er as A,
3832
+ Ss as ABOUT_TITLE,
3833
+ Wo as ACTION_LOCATION,
3834
+ Ho as ACTION_MESSAGE,
3835
+ Go as ACTION_MODEL,
3836
+ Ko as ACTION_RESET,
3837
+ Bo as ACTION_RESTORE,
3838
+ Fo as ACTION_SEARCH,
3839
+ Jo as ACTION_SORT,
3840
+ Vo as ACTION_STREAMING,
3841
+ ho as AppFooter,
3842
+ ks as CANCEL,
3843
+ Rs as CARDS,
3844
+ As as CLEAR,
3845
+ Mo as ERROR_MESSAGE,
3846
+ et as G,
3847
+ Uo as GPT4_MAX_TOKENS,
3848
+ Ts as HISTORY_TITLE,
3849
+ Yo as LOCAL_STORAGE_CHAT_DETAILS,
3850
+ Qo as LOCAL_STORAGE_LOCATION,
3851
+ jo as LOCAL_STORAGE_PREFIX,
3852
+ zo as LOCAL_STORAGE_SEARCH,
3853
+ qo as LOCAL_STORAGE_SORT,
3854
+ bs as LOG_OUT,
3855
+ Ma as M,
3856
+ Lo as MODEL_GPT4,
3857
+ go as MessagesContainerHeader,
3858
+ ds as N,
3859
+ Oa as N$1,
3860
+ _s as NA,
3861
+ Qe as Nr,
3862
+ Ye as O,
3863
+ Es as PROFILE_TITLE,
3864
+ Oo as ROLE_ASSISTANT,
3865
+ $o as ROLE_HIDDEN,
3866
+ Do as ROLE_INTERNAL,
3867
+ Po as ROLE_SYSTEM,
3868
+ Co as ROLE_USER,
3869
+ Ce as S,
3870
+ ws as SEND,
3871
+ vs as STATS,
3872
+ Xo as STATS_SEPARATOR,
3873
+ To as SassySaint,
3874
+ Is as TYPE_QUESTION,
3875
+ ar as U,
3876
+ gs as a,
3877
+ wt as b,
3878
+ Da as c,
3879
+ ms as c$1,
3880
+ es as convertLatitudeToDMS,
3881
+ ts as convertLongitudeToDMS,
3882
+ is as durationFormatter,
3883
+ as as extractAverage,
3884
+ Xt as f,
3885
+ $a as f$1,
3886
+ to as f$2,
3887
+ Oe as g,
3888
+ rs as getCurrentGeoLocation,
3889
+ ba as getMessageContaintWrapperClass,
3890
+ Ze as i,
3891
+ us as i$1,
3892
+ os as isLastMessageFromRole,
3893
+ ee as j,
3894
+ re as j$1,
3895
+ fs as l,
3896
+ hs as n,
3897
+ ss as numberFormatter,
3898
+ Ga as o,
3899
+ ys as p,
3900
+ cs as pluralize,
3901
+ ps as r,
3902
+ ns as renderDataAsList,
3903
+ ls as s,
3904
+ Zo as truncate,
3905
+ tr as x
3906
+ };