@versini/sassysaint 5.1.2 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{App.Doru-B7k.js → App.Da6BVUYy.js} +45 -45
- package/dist/chunks/{LazyHeader.DClUfXqp.js → LazyHeader.rYQgZPSI.js} +299 -297
- package/dist/chunks/{LazyMarkdownWithExtra.CxcZ95uu.js → LazyMarkdownWithExtra.8gJ4kHmJ.js} +1 -1
- package/dist/chunks/{LazyMessageAssistant.KLzNh6WV.js → LazyMessageAssistant.CDMHbVPp.js} +306 -306
- package/dist/chunks/{index.DY3Gz5Cp.DIHttQr7.js → index.BV7w1tBT.B-qjwzFk.js} +51 -54
- package/dist/chunks/{index.B5Wp8y85.js → index.BuZgDoDD.js} +717 -679
- package/dist/chunks/{index.B5nDJSgt.js → index.lZ9DXn26.js} +19 -19
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as c, jsxs as v, Fragment as ye } from "react/jsx-runtime";
|
|
2
|
+
import W, { createContext as cr, useReducer as It, useRef as $, useCallback as z, useEffect as q, useContext as kt, useSyncExternalStore as lr, useId as At, useState as F, useLayoutEffect as st, useMemo as St, lazy as _t, Suspense as Rt } from "react";
|
|
3
|
+
import y from "clsx";
|
|
4
4
|
var dr = Object.defineProperty, ur = (e, t, r) => t in e ? dr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, He = (e, t, r) => ur(e, typeof t != "symbol" ? t + "" : t, r);
|
|
5
5
|
/*!
|
|
6
6
|
@versini/auth-provider v7.3.2
|
|
@@ -22,7 +22,7 @@ function K(e) {
|
|
|
22
22
|
r += String.fromCharCode(a);
|
|
23
23
|
return btoa(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function xe(e) {
|
|
26
26
|
const t = e.replace(/-/g, "+").replace(/_/g, "/"), r = (4 - t.length % 4) % 4, a = t.padEnd(t.length + r, "="), n = atob(a), o = new ArrayBuffer(n.length), s = new Uint8Array(o);
|
|
27
27
|
for (let i = 0; i < n.length; i++)
|
|
28
28
|
s[i] = n.charCodeAt(i);
|
|
@@ -31,18 +31,18 @@ function _e(e) {
|
|
|
31
31
|
function Qe() {
|
|
32
32
|
return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Nt(e) {
|
|
35
35
|
const { id: t } = e;
|
|
36
36
|
return {
|
|
37
37
|
...e,
|
|
38
|
-
id:
|
|
38
|
+
id: xe(t),
|
|
39
39
|
transports: e.transports
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function xt(e) {
|
|
43
43
|
return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
|
|
44
44
|
}
|
|
45
|
-
class
|
|
45
|
+
class x extends Error {
|
|
46
46
|
constructor({ message: t, code: r, cause: a, name: n }) {
|
|
47
47
|
super(t, { cause: a }), this.name = n ?? a.name, this.code = r;
|
|
48
48
|
}
|
|
@@ -54,70 +54,70 @@ function mr({ error: e, options: t }) {
|
|
|
54
54
|
throw Error("options was missing required publicKey property");
|
|
55
55
|
if (e.name === "AbortError") {
|
|
56
56
|
if (t.signal instanceof AbortSignal)
|
|
57
|
-
return new
|
|
57
|
+
return new x({
|
|
58
58
|
message: "Registration ceremony was sent an abort signal",
|
|
59
59
|
code: "ERROR_CEREMONY_ABORTED",
|
|
60
60
|
cause: e
|
|
61
61
|
});
|
|
62
62
|
} else if (e.name === "ConstraintError") {
|
|
63
63
|
if (((a = r.authenticatorSelection) == null ? void 0 : a.requireResidentKey) === !0)
|
|
64
|
-
return new
|
|
64
|
+
return new x({
|
|
65
65
|
message: "Discoverable credentials were required but no available authenticator supported it",
|
|
66
66
|
code: "ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",
|
|
67
67
|
cause: e
|
|
68
68
|
});
|
|
69
69
|
if (((n = r.authenticatorSelection) == null ? void 0 : n.userVerification) === "required")
|
|
70
|
-
return new
|
|
70
|
+
return new x({
|
|
71
71
|
message: "User verification was required but no available authenticator supported it",
|
|
72
72
|
code: "ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",
|
|
73
73
|
cause: e
|
|
74
74
|
});
|
|
75
75
|
} else {
|
|
76
76
|
if (e.name === "InvalidStateError")
|
|
77
|
-
return new
|
|
77
|
+
return new x({
|
|
78
78
|
message: "The authenticator was previously registered",
|
|
79
79
|
code: "ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",
|
|
80
80
|
cause: e
|
|
81
81
|
});
|
|
82
82
|
if (e.name === "NotAllowedError")
|
|
83
|
-
return new
|
|
83
|
+
return new x({
|
|
84
84
|
message: e.message,
|
|
85
85
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
86
86
|
cause: e
|
|
87
87
|
});
|
|
88
88
|
if (e.name === "NotSupportedError")
|
|
89
|
-
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new
|
|
89
|
+
return r.pubKeyCredParams.filter((o) => o.type === "public-key").length === 0 ? new x({
|
|
90
90
|
message: 'No entry in pubKeyCredParams was of type "public-key"',
|
|
91
91
|
code: "ERROR_MALFORMED_PUBKEYCREDPARAMS",
|
|
92
92
|
cause: e
|
|
93
|
-
}) : new
|
|
93
|
+
}) : new x({
|
|
94
94
|
message: "No available authenticator supported any of the specified pubKeyCredParams algorithms",
|
|
95
95
|
code: "ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",
|
|
96
96
|
cause: e
|
|
97
97
|
});
|
|
98
98
|
if (e.name === "SecurityError") {
|
|
99
99
|
const o = window.location.hostname;
|
|
100
|
-
if (
|
|
100
|
+
if (xt(o)) {
|
|
101
101
|
if (r.rp.id !== o)
|
|
102
|
-
return new
|
|
102
|
+
return new x({
|
|
103
103
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
104
104
|
code: "ERROR_INVALID_RP_ID",
|
|
105
105
|
cause: e
|
|
106
106
|
});
|
|
107
|
-
} else return new
|
|
107
|
+
} else return new x({
|
|
108
108
|
message: `${window.location.hostname} is an invalid domain`,
|
|
109
109
|
code: "ERROR_INVALID_DOMAIN",
|
|
110
110
|
cause: e
|
|
111
111
|
});
|
|
112
112
|
} else if (e.name === "TypeError") {
|
|
113
113
|
if (r.user.id.byteLength < 1 || r.user.id.byteLength > 64)
|
|
114
|
-
return new
|
|
114
|
+
return new x({
|
|
115
115
|
message: "User ID was not between 1 and 64 characters",
|
|
116
116
|
code: "ERROR_INVALID_USER_ID_LENGTH",
|
|
117
117
|
cause: e
|
|
118
118
|
});
|
|
119
119
|
} else if (e.name === "UnknownError")
|
|
120
|
-
return new
|
|
120
|
+
return new x({
|
|
121
121
|
message: "The authenticator was unable to process the specified options, or could not create a new credential",
|
|
122
122
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
123
123
|
cause: e
|
|
@@ -142,7 +142,7 @@ class hr {
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
const Ct = new hr(), pr = ["cross-platform", "platform"];
|
|
145
|
-
function
|
|
145
|
+
function Ot(e) {
|
|
146
146
|
if (e && !(pr.indexOf(e) < 0))
|
|
147
147
|
return e;
|
|
148
148
|
}
|
|
@@ -152,12 +152,12 @@ async function gr(e) {
|
|
|
152
152
|
throw new Error("WebAuthn is not supported in this browser");
|
|
153
153
|
const t = { publicKey: {
|
|
154
154
|
...e,
|
|
155
|
-
challenge:
|
|
155
|
+
challenge: xe(e.challenge),
|
|
156
156
|
user: {
|
|
157
157
|
...e.user,
|
|
158
|
-
id:
|
|
158
|
+
id: xe(e.user.id)
|
|
159
159
|
},
|
|
160
|
-
excludeCredentials: (m = e.excludeCredentials) == null ? void 0 : m.map(
|
|
160
|
+
excludeCredentials: (m = e.excludeCredentials) == null ? void 0 : m.map(Nt)
|
|
161
161
|
} };
|
|
162
162
|
t.signal = Ct.createNewAbortSignal();
|
|
163
163
|
let r;
|
|
@@ -206,7 +206,7 @@ async function gr(e) {
|
|
|
206
206
|
},
|
|
207
207
|
type: s,
|
|
208
208
|
clientExtensionResults: r.getClientExtensionResults(),
|
|
209
|
-
authenticatorAttachment:
|
|
209
|
+
authenticatorAttachment: Ot(r.authenticatorAttachment)
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
function We(e, t) {
|
|
@@ -225,34 +225,34 @@ function yr({ error: e, options: t }) {
|
|
|
225
225
|
throw Error("options was missing required publicKey property");
|
|
226
226
|
if (e.name === "AbortError") {
|
|
227
227
|
if (t.signal instanceof AbortSignal)
|
|
228
|
-
return new
|
|
228
|
+
return new x({
|
|
229
229
|
message: "Authentication ceremony was sent an abort signal",
|
|
230
230
|
code: "ERROR_CEREMONY_ABORTED",
|
|
231
231
|
cause: e
|
|
232
232
|
});
|
|
233
233
|
} else {
|
|
234
234
|
if (e.name === "NotAllowedError")
|
|
235
|
-
return new
|
|
235
|
+
return new x({
|
|
236
236
|
message: e.message,
|
|
237
237
|
code: "ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",
|
|
238
238
|
cause: e
|
|
239
239
|
});
|
|
240
240
|
if (e.name === "SecurityError") {
|
|
241
241
|
const a = window.location.hostname;
|
|
242
|
-
if (
|
|
242
|
+
if (xt(a)) {
|
|
243
243
|
if (r.rpId !== a)
|
|
244
|
-
return new
|
|
244
|
+
return new x({
|
|
245
245
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
246
246
|
code: "ERROR_INVALID_RP_ID",
|
|
247
247
|
cause: e
|
|
248
248
|
});
|
|
249
|
-
} else return new
|
|
249
|
+
} else return new x({
|
|
250
250
|
message: `${window.location.hostname} is an invalid domain`,
|
|
251
251
|
code: "ERROR_INVALID_DOMAIN",
|
|
252
252
|
cause: e
|
|
253
253
|
});
|
|
254
254
|
} else if (e.name === "UnknownError")
|
|
255
|
-
return new
|
|
255
|
+
return new x({
|
|
256
256
|
message: "The authenticator was unable to process the specified options, or could not create a new assertion signature",
|
|
257
257
|
code: "ERROR_AUTHENTICATOR_GENERAL_ERROR",
|
|
258
258
|
cause: e
|
|
@@ -265,10 +265,10 @@ async function br(e, t = !1) {
|
|
|
265
265
|
if (!Qe())
|
|
266
266
|
throw new Error("WebAuthn is not supported in this browser");
|
|
267
267
|
let r;
|
|
268
|
-
((m = e.allowCredentials) == null ? void 0 : m.length) !== 0 && (r = (l = e.allowCredentials) == null ? void 0 : l.map(
|
|
268
|
+
((m = e.allowCredentials) == null ? void 0 : m.length) !== 0 && (r = (l = e.allowCredentials) == null ? void 0 : l.map(Nt));
|
|
269
269
|
const a = {
|
|
270
270
|
...e,
|
|
271
|
-
challenge:
|
|
271
|
+
challenge: xe(e.challenge),
|
|
272
272
|
allowCredentials: r
|
|
273
273
|
}, n = {};
|
|
274
274
|
if (t) {
|
|
@@ -300,7 +300,7 @@ async function br(e, t = !1) {
|
|
|
300
300
|
},
|
|
301
301
|
type: h,
|
|
302
302
|
clientExtensionResults: o.getClientExtensionResults(),
|
|
303
|
-
authenticatorAttachment:
|
|
303
|
+
authenticatorAttachment: Ot(o.authenticatorAttachment)
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
/*!
|
|
@@ -316,14 +316,14 @@ try {
|
|
|
316
316
|
});
|
|
317
317
|
} catch {
|
|
318
318
|
}
|
|
319
|
-
const
|
|
319
|
+
const ue = {
|
|
320
320
|
ID_TOKEN: "id_token",
|
|
321
321
|
ACCESS_TOKEN: "token",
|
|
322
322
|
ID_AND_ACCESS_TOKEN: "id_token token",
|
|
323
323
|
CODE: "code",
|
|
324
324
|
REFRESH_TOKEN: "refresh_token",
|
|
325
325
|
PASSKEY: "passkey"
|
|
326
|
-
},
|
|
326
|
+
}, Pt = {
|
|
327
327
|
CLIENT_ID: "X-Auth-ClientId"
|
|
328
328
|
}, _ = {
|
|
329
329
|
ALG: "RS256",
|
|
@@ -346,12 +346,12 @@ aMwPFOIcJH+rKfFgNcHLcaS5syp7zU1ANwZ+trgR+DifBr8TLVkBynmNeTyhDm2+
|
|
|
346
346
|
l0haqjMk0UoNPPE8iYBWUHQJJE1Dqstj65d6Eh5g64Pao25y4cmYJbKjiblIGEkE
|
|
347
347
|
sjqybA9mARAqh9k/eiIopecWSiffNQTwVQVd2I9ZH3BalhEXHlqFgrjz51kFqg81
|
|
348
348
|
awIDAQAB
|
|
349
|
-
-----END PUBLIC KEY-----`,
|
|
349
|
+
-----END PUBLIC KEY-----`, $e = {
|
|
350
350
|
CODE: "code",
|
|
351
351
|
LOGOUT: "logout",
|
|
352
352
|
LOGIN: "login",
|
|
353
353
|
REFRESH: "refresh"
|
|
354
|
-
},
|
|
354
|
+
}, Le = crypto, Dt = (e) => e instanceof CryptoKey, we = new TextEncoder(), be = new TextDecoder();
|
|
355
355
|
function wr(...e) {
|
|
356
356
|
const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
|
|
357
357
|
let a = 0;
|
|
@@ -366,14 +366,14 @@ const Tr = (e) => {
|
|
|
366
366
|
return r;
|
|
367
367
|
}, j = (e) => {
|
|
368
368
|
let t = e;
|
|
369
|
-
t instanceof Uint8Array && (t =
|
|
369
|
+
t instanceof Uint8Array && (t = be.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
370
370
|
try {
|
|
371
371
|
return Tr(t);
|
|
372
372
|
} catch {
|
|
373
373
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
374
374
|
}
|
|
375
375
|
};
|
|
376
|
-
let
|
|
376
|
+
let Z = class extends Error {
|
|
377
377
|
static get code() {
|
|
378
378
|
return "ERR_JOSE_GENERIC";
|
|
379
379
|
}
|
|
@@ -381,7 +381,7 @@ let Q = class extends Error {
|
|
|
381
381
|
var r;
|
|
382
382
|
super(t), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
|
|
383
383
|
}
|
|
384
|
-
}, U = class extends
|
|
384
|
+
}, U = class extends Z {
|
|
385
385
|
static get code() {
|
|
386
386
|
return "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
387
387
|
}
|
|
@@ -389,7 +389,7 @@ let Q = class extends Error {
|
|
|
389
389
|
super(t), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
|
-
class
|
|
392
|
+
class it extends Z {
|
|
393
393
|
static get code() {
|
|
394
394
|
return "ERR_JWT_EXPIRED";
|
|
395
395
|
}
|
|
@@ -397,7 +397,7 @@ class st extends Q {
|
|
|
397
397
|
super(t), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
class
|
|
400
|
+
class vr extends Z {
|
|
401
401
|
constructor() {
|
|
402
402
|
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
403
403
|
}
|
|
@@ -405,21 +405,21 @@ class Ir extends Q {
|
|
|
405
405
|
return "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
let
|
|
408
|
+
let H = class extends Z {
|
|
409
409
|
constructor() {
|
|
410
410
|
super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
411
411
|
}
|
|
412
412
|
static get code() {
|
|
413
413
|
return "ERR_JOSE_NOT_SUPPORTED";
|
|
414
414
|
}
|
|
415
|
-
},
|
|
415
|
+
}, S = class extends Z {
|
|
416
416
|
constructor() {
|
|
417
417
|
super(...arguments), this.code = "ERR_JWS_INVALID";
|
|
418
418
|
}
|
|
419
419
|
static get code() {
|
|
420
420
|
return "ERR_JWS_INVALID";
|
|
421
421
|
}
|
|
422
|
-
},
|
|
422
|
+
}, J = class extends Z {
|
|
423
423
|
constructor() {
|
|
424
424
|
super(...arguments), this.code = "ERR_JWT_INVALID";
|
|
425
425
|
}
|
|
@@ -427,7 +427,7 @@ let $ = class extends Q {
|
|
|
427
427
|
return "ERR_JWT_INVALID";
|
|
428
428
|
}
|
|
429
429
|
};
|
|
430
|
-
class
|
|
430
|
+
class Ir extends Z {
|
|
431
431
|
constructor() {
|
|
432
432
|
super(...arguments), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED", this.message = "signature verification failed";
|
|
433
433
|
}
|
|
@@ -435,16 +435,16 @@ class vr extends Q {
|
|
|
435
435
|
return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function V(e, t = "algorithm.name") {
|
|
439
439
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function Te(e, t) {
|
|
442
442
|
return e.name === t;
|
|
443
443
|
}
|
|
444
444
|
function Be(e) {
|
|
445
445
|
return parseInt(e.name.slice(4), 10);
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function kr(e) {
|
|
448
448
|
switch (e) {
|
|
449
449
|
case "ES256":
|
|
450
450
|
return "P-256";
|
|
@@ -456,7 +456,7 @@ function Sr(e) {
|
|
|
456
456
|
throw new Error("unreachable");
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function Ar(e, t) {
|
|
460
460
|
if (t.length && !t.some((r) => e.usages.includes(r))) {
|
|
461
461
|
let r = "CryptoKey does not support this operation, its usages must include ";
|
|
462
462
|
if (t.length > 2) {
|
|
@@ -466,59 +466,59 @@ function kr(e, t) {
|
|
|
466
466
|
throw new TypeError(r);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Sr(e, t, ...r) {
|
|
470
470
|
switch (t) {
|
|
471
471
|
case "HS256":
|
|
472
472
|
case "HS384":
|
|
473
473
|
case "HS512": {
|
|
474
|
-
if (!
|
|
475
|
-
throw
|
|
474
|
+
if (!Te(e.algorithm, "HMAC"))
|
|
475
|
+
throw V("HMAC");
|
|
476
476
|
const a = parseInt(t.slice(2), 10);
|
|
477
477
|
if (Be(e.algorithm.hash) !== a)
|
|
478
|
-
throw
|
|
478
|
+
throw V(`SHA-${a}`, "algorithm.hash");
|
|
479
479
|
break;
|
|
480
480
|
}
|
|
481
481
|
case "RS256":
|
|
482
482
|
case "RS384":
|
|
483
483
|
case "RS512": {
|
|
484
|
-
if (!
|
|
485
|
-
throw
|
|
484
|
+
if (!Te(e.algorithm, "RSASSA-PKCS1-v1_5"))
|
|
485
|
+
throw V("RSASSA-PKCS1-v1_5");
|
|
486
486
|
const a = parseInt(t.slice(2), 10);
|
|
487
487
|
if (Be(e.algorithm.hash) !== a)
|
|
488
|
-
throw
|
|
488
|
+
throw V(`SHA-${a}`, "algorithm.hash");
|
|
489
489
|
break;
|
|
490
490
|
}
|
|
491
491
|
case "PS256":
|
|
492
492
|
case "PS384":
|
|
493
493
|
case "PS512": {
|
|
494
|
-
if (!
|
|
495
|
-
throw
|
|
494
|
+
if (!Te(e.algorithm, "RSA-PSS"))
|
|
495
|
+
throw V("RSA-PSS");
|
|
496
496
|
const a = parseInt(t.slice(2), 10);
|
|
497
497
|
if (Be(e.algorithm.hash) !== a)
|
|
498
|
-
throw
|
|
498
|
+
throw V(`SHA-${a}`, "algorithm.hash");
|
|
499
499
|
break;
|
|
500
500
|
}
|
|
501
501
|
case "EdDSA": {
|
|
502
502
|
if (e.algorithm.name !== "Ed25519" && e.algorithm.name !== "Ed448")
|
|
503
|
-
throw
|
|
503
|
+
throw V("Ed25519 or Ed448");
|
|
504
504
|
break;
|
|
505
505
|
}
|
|
506
506
|
case "ES256":
|
|
507
507
|
case "ES384":
|
|
508
508
|
case "ES512": {
|
|
509
|
-
if (!
|
|
510
|
-
throw
|
|
511
|
-
const a =
|
|
509
|
+
if (!Te(e.algorithm, "ECDSA"))
|
|
510
|
+
throw V("ECDSA");
|
|
511
|
+
const a = kr(t);
|
|
512
512
|
if (e.algorithm.namedCurve !== a)
|
|
513
|
-
throw
|
|
513
|
+
throw V(a, "algorithm.namedCurve");
|
|
514
514
|
break;
|
|
515
515
|
}
|
|
516
516
|
default:
|
|
517
517
|
throw new TypeError("CryptoKey does not support this operation");
|
|
518
518
|
}
|
|
519
|
-
|
|
519
|
+
Ar(e, r);
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function $t(e, t, ...r) {
|
|
522
522
|
var a;
|
|
523
523
|
if (r = r.filter(Boolean), r.length > 2) {
|
|
524
524
|
const n = r.pop();
|
|
@@ -526,11 +526,11 @@ function Dt(e, t, ...r) {
|
|
|
526
526
|
} else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
|
|
527
527
|
return t == null ? e += ` Received ${t}` : typeof t == "function" && t.name ? e += ` Received function ${t.name}` : typeof t == "object" && t != null && (a = t.constructor) != null && a.name && (e += ` Received an instance of ${t.constructor.name}`), e;
|
|
528
528
|
}
|
|
529
|
-
const
|
|
529
|
+
const ct = (e, ...t) => $t("Key must be ", e, ...t);
|
|
530
530
|
function Lt(e, t, ...r) {
|
|
531
|
-
return
|
|
531
|
+
return $t(`Key for the ${e} algorithm must be `, t, ...r);
|
|
532
532
|
}
|
|
533
|
-
const Mt = (e) =>
|
|
533
|
+
const Mt = (e) => Dt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ce = ["CryptoKey"], _r = (...e) => {
|
|
534
534
|
const t = e.filter(Boolean);
|
|
535
535
|
if (t.length === 0 || t.length === 1)
|
|
536
536
|
return !0;
|
|
@@ -552,7 +552,7 @@ const Mt = (e) => Pt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
|
|
|
552
552
|
function Rr(e) {
|
|
553
553
|
return typeof e == "object" && e !== null;
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function me(e) {
|
|
556
556
|
if (!Rr(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
557
557
|
return !1;
|
|
558
558
|
if (Object.getPrototypeOf(e) === null)
|
|
@@ -569,17 +569,17 @@ const Nr = (e, t) => {
|
|
|
569
569
|
throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`);
|
|
570
570
|
}
|
|
571
571
|
};
|
|
572
|
-
function
|
|
573
|
-
return
|
|
572
|
+
function he(e) {
|
|
573
|
+
return me(e) && typeof e.kty == "string";
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function xr(e) {
|
|
576
576
|
return e.kty !== "oct" && typeof e.d == "string";
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Cr(e) {
|
|
579
579
|
return e.kty !== "oct" && typeof e.d > "u";
|
|
580
580
|
}
|
|
581
581
|
function Or(e) {
|
|
582
|
-
return
|
|
582
|
+
return he(e) && e.kty === "oct" && typeof e.k == "string";
|
|
583
583
|
}
|
|
584
584
|
function Pr(e) {
|
|
585
585
|
let t, r;
|
|
@@ -606,7 +606,7 @@ function Pr(e) {
|
|
|
606
606
|
}, r = e.d ? ["decrypt", "unwrapKey"] : ["encrypt", "wrapKey"];
|
|
607
607
|
break;
|
|
608
608
|
default:
|
|
609
|
-
throw new
|
|
609
|
+
throw new H('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
610
610
|
}
|
|
611
611
|
break;
|
|
612
612
|
}
|
|
@@ -628,7 +628,7 @@ function Pr(e) {
|
|
|
628
628
|
t = { name: "ECDH", namedCurve: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
629
629
|
break;
|
|
630
630
|
default:
|
|
631
|
-
throw new
|
|
631
|
+
throw new H('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
632
632
|
}
|
|
633
633
|
break;
|
|
634
634
|
}
|
|
@@ -644,12 +644,12 @@ function Pr(e) {
|
|
|
644
644
|
t = { name: e.crv }, r = e.d ? ["deriveBits"] : [];
|
|
645
645
|
break;
|
|
646
646
|
default:
|
|
647
|
-
throw new
|
|
647
|
+
throw new H('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
648
648
|
}
|
|
649
649
|
break;
|
|
650
650
|
}
|
|
651
651
|
default:
|
|
652
|
-
throw new
|
|
652
|
+
throw new H('Invalid or unsupported JWK "kty" (Key Type) Parameter value');
|
|
653
653
|
}
|
|
654
654
|
return { algorithm: t, keyUsages: r };
|
|
655
655
|
}
|
|
@@ -661,35 +661,35 @@ const Ut = async (e) => {
|
|
|
661
661
|
e.ext ?? !1,
|
|
662
662
|
e.key_ops ?? r
|
|
663
663
|
], n = { ...e };
|
|
664
|
-
return delete n.alg, delete n.use,
|
|
664
|
+
return delete n.alg, delete n.use, Le.subtle.importKey("jwk", n, ...a);
|
|
665
665
|
}, Kt = (e) => j(e);
|
|
666
|
-
let
|
|
667
|
-
const
|
|
666
|
+
let ae, ne;
|
|
667
|
+
const Ht = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Oe = async (e, t, r, a, n = !1) => {
|
|
668
668
|
let o = e.get(t);
|
|
669
669
|
if (o != null && o[a])
|
|
670
670
|
return o[a];
|
|
671
671
|
const s = await Ut({ ...r, alg: a });
|
|
672
672
|
return n && Object.freeze(t), o ? o[a] = s : e.set(t, { [a]: s }), s;
|
|
673
673
|
}, Dr = (e, t) => {
|
|
674
|
-
if (
|
|
674
|
+
if (Ht(e)) {
|
|
675
675
|
let r = e.export({ format: "jwk" });
|
|
676
|
-
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Kt(r.k) : (
|
|
676
|
+
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? Kt(r.k) : (ne || (ne = /* @__PURE__ */ new WeakMap()), Oe(ne, e, r, t));
|
|
677
677
|
}
|
|
678
|
-
return
|
|
679
|
-
},
|
|
680
|
-
if (
|
|
678
|
+
return he(e) ? e.k ? j(e.k) : (ne || (ne = /* @__PURE__ */ new WeakMap()), Oe(ne, e, e, t, !0)) : e;
|
|
679
|
+
}, $r = (e, t) => {
|
|
680
|
+
if (Ht(e)) {
|
|
681
681
|
let r = e.export({ format: "jwk" });
|
|
682
|
-
return r.k ? Kt(r.k) : (
|
|
682
|
+
return r.k ? Kt(r.k) : (ae || (ae = /* @__PURE__ */ new WeakMap()), Oe(ae, e, r, t));
|
|
683
683
|
}
|
|
684
|
-
return
|
|
685
|
-
},
|
|
684
|
+
return he(e) ? e.k ? j(e.k) : (ae || (ae = /* @__PURE__ */ new WeakMap()), Oe(ae, e, e, t, !0)) : e;
|
|
685
|
+
}, Lr = { normalizePublicKey: Dr, normalizePrivateKey: $r }, Y = (e, t, r = 0) => {
|
|
686
686
|
r === 0 && (t.unshift(t.length), t.unshift(6));
|
|
687
687
|
const a = e.indexOf(t[0], r);
|
|
688
688
|
if (a === -1)
|
|
689
689
|
return !1;
|
|
690
690
|
const n = e.subarray(a, a + t.length);
|
|
691
691
|
return n.length !== t.length ? !1 : n.every((o, s) => o === t[s]) || Y(e, t, a + 1);
|
|
692
|
-
},
|
|
692
|
+
}, lt = (e) => {
|
|
693
693
|
switch (!0) {
|
|
694
694
|
case Y(e, [42, 134, 72, 206, 61, 3, 1, 7]):
|
|
695
695
|
return "P-256";
|
|
@@ -706,9 +706,9 @@ const $t = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
706
706
|
case Y(e, [43, 101, 113]):
|
|
707
707
|
return "Ed448";
|
|
708
708
|
default:
|
|
709
|
-
throw new
|
|
709
|
+
throw new H("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
710
710
|
}
|
|
711
|
-
},
|
|
711
|
+
}, Mr = async (e, t, r, a, n) => {
|
|
712
712
|
let o, s;
|
|
713
713
|
const i = new Uint8Array(atob(r.replace(e, "")).split("").map((u) => u.charCodeAt(0)));
|
|
714
714
|
switch (a) {
|
|
@@ -744,25 +744,25 @@ const $t = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
744
744
|
case "ECDH-ES+A128KW":
|
|
745
745
|
case "ECDH-ES+A192KW":
|
|
746
746
|
case "ECDH-ES+A256KW": {
|
|
747
|
-
const u =
|
|
747
|
+
const u = lt(i);
|
|
748
748
|
o = u.startsWith("P-") ? { name: "ECDH", namedCurve: u } : { name: u }, s = [];
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
751
|
case "EdDSA":
|
|
752
|
-
o = { name:
|
|
752
|
+
o = { name: lt(i) }, s = ["verify"];
|
|
753
753
|
break;
|
|
754
754
|
default:
|
|
755
|
-
throw new
|
|
755
|
+
throw new H('Invalid or unsupported "alg" (Algorithm) value');
|
|
756
756
|
}
|
|
757
|
-
return
|
|
758
|
-
},
|
|
759
|
-
async function
|
|
757
|
+
return Le.subtle.importKey(t, i, o, !1, s);
|
|
758
|
+
}, Ur = (e, t, r) => Mr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
|
759
|
+
async function Kr(e, t, r) {
|
|
760
760
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
761
761
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
762
|
-
return
|
|
762
|
+
return Ur(e, t);
|
|
763
763
|
}
|
|
764
764
|
async function Hr(e, t) {
|
|
765
|
-
if (!
|
|
765
|
+
if (!me(e))
|
|
766
766
|
throw new TypeError("JWK must be an object");
|
|
767
767
|
switch (t || (t = e.alg), e.kty) {
|
|
768
768
|
case "oct":
|
|
@@ -771,15 +771,15 @@ async function Hr(e, t) {
|
|
|
771
771
|
return j(e.k);
|
|
772
772
|
case "RSA":
|
|
773
773
|
if (e.oth !== void 0)
|
|
774
|
-
throw new
|
|
774
|
+
throw new H('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
|
|
775
775
|
case "EC":
|
|
776
776
|
case "OKP":
|
|
777
777
|
return Ut({ ...e, alg: t });
|
|
778
778
|
default:
|
|
779
|
-
throw new
|
|
779
|
+
throw new H('Unsupported "kty" (Key Type) Parameter value');
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
const
|
|
782
|
+
const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], qe = (e, t, r) => {
|
|
783
783
|
var a, n;
|
|
784
784
|
if (t.use !== void 0 && t.use !== "sig")
|
|
785
785
|
throw new TypeError("Invalid key for this operation, when present its use must be sig");
|
|
@@ -790,46 +790,46 @@ const ce = (e) => e == null ? void 0 : e[Symbol.toStringTag], qe = (e, t, r) =>
|
|
|
790
790
|
return !0;
|
|
791
791
|
}, Wr = (e, t, r, a) => {
|
|
792
792
|
if (!(t instanceof Uint8Array)) {
|
|
793
|
-
if (a &&
|
|
793
|
+
if (a && he(t)) {
|
|
794
794
|
if (Or(t) && qe(e, t, r))
|
|
795
795
|
return;
|
|
796
796
|
throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present');
|
|
797
797
|
}
|
|
798
798
|
if (!Mt(t))
|
|
799
|
-
throw new TypeError(Lt(e, t, ...
|
|
799
|
+
throw new TypeError(Lt(e, t, ...Ce, "Uint8Array", a ? "JSON Web Key" : null));
|
|
800
800
|
if (t.type !== "secret")
|
|
801
|
-
throw new TypeError(`${
|
|
801
|
+
throw new TypeError(`${de(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
802
802
|
}
|
|
803
803
|
}, Br = (e, t, r, a) => {
|
|
804
|
-
if (a &&
|
|
804
|
+
if (a && he(t))
|
|
805
805
|
switch (r) {
|
|
806
806
|
case "sign":
|
|
807
|
-
if (
|
|
807
|
+
if (xr(t) && qe(e, t, r))
|
|
808
808
|
return;
|
|
809
809
|
throw new TypeError("JSON Web Key for this operation be a private JWK");
|
|
810
810
|
case "verify":
|
|
811
|
-
if (
|
|
811
|
+
if (Cr(t) && qe(e, t, r))
|
|
812
812
|
return;
|
|
813
813
|
throw new TypeError("JSON Web Key for this operation be a public JWK");
|
|
814
814
|
}
|
|
815
815
|
if (!Mt(t))
|
|
816
|
-
throw new TypeError(Lt(e, t, ...
|
|
816
|
+
throw new TypeError(Lt(e, t, ...Ce, a ? "JSON Web Key" : null));
|
|
817
817
|
if (t.type === "secret")
|
|
818
|
-
throw new TypeError(`${
|
|
818
|
+
throw new TypeError(`${de(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
819
819
|
if (r === "sign" && t.type === "public")
|
|
820
|
-
throw new TypeError(`${
|
|
820
|
+
throw new TypeError(`${de(t)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
821
821
|
if (r === "decrypt" && t.type === "public")
|
|
822
|
-
throw new TypeError(`${
|
|
822
|
+
throw new TypeError(`${de(t)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
823
823
|
if (t.algorithm && r === "verify" && t.type === "private")
|
|
824
|
-
throw new TypeError(`${
|
|
824
|
+
throw new TypeError(`${de(t)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
825
825
|
if (t.algorithm && r === "encrypt" && t.type === "private")
|
|
826
|
-
throw new TypeError(`${
|
|
826
|
+
throw new TypeError(`${de(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
827
827
|
};
|
|
828
|
-
function
|
|
828
|
+
function Wt(e, t, r, a) {
|
|
829
829
|
t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ? Wr(t, r, a, e) : Br(t, r, a, e);
|
|
830
830
|
}
|
|
831
|
-
|
|
832
|
-
const
|
|
831
|
+
Wt.bind(void 0, !1);
|
|
832
|
+
const dt = Wt.bind(void 0, !0);
|
|
833
833
|
function Gr(e, t, r, a, n) {
|
|
834
834
|
if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
|
|
835
835
|
throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
@@ -841,7 +841,7 @@ function Gr(e, t, r, a, n) {
|
|
|
841
841
|
r !== void 0 ? o = new Map([...Object.entries(r), ...t.entries()]) : o = t;
|
|
842
842
|
for (const s of a.crit) {
|
|
843
843
|
if (!o.has(s))
|
|
844
|
-
throw new
|
|
844
|
+
throw new H(`Extension Header Parameter "${s}" is not recognized`);
|
|
845
845
|
if (n[s] === void 0)
|
|
846
846
|
throw new e(`Extension Header Parameter "${s}" is missing`);
|
|
847
847
|
if (o.get(s) && a[s] === void 0)
|
|
@@ -877,102 +877,102 @@ function Jr(e, t) {
|
|
|
877
877
|
case "EdDSA":
|
|
878
878
|
return { name: t.name };
|
|
879
879
|
default:
|
|
880
|
-
throw new
|
|
880
|
+
throw new H(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
async function Yr(e, t, r) {
|
|
884
|
-
if (t = await
|
|
885
|
-
return
|
|
884
|
+
if (t = await Lr.normalizePublicKey(t, e), Dt(t))
|
|
885
|
+
return Sr(t, e, r), t;
|
|
886
886
|
if (t instanceof Uint8Array) {
|
|
887
887
|
if (!e.startsWith("HS"))
|
|
888
|
-
throw new TypeError(
|
|
889
|
-
return
|
|
888
|
+
throw new TypeError(ct(t, ...Ce));
|
|
889
|
+
return Le.subtle.importKey("raw", t, { hash: `SHA-${e.slice(-3)}`, name: "HMAC" }, !1, [r]);
|
|
890
890
|
}
|
|
891
|
-
throw new TypeError(
|
|
891
|
+
throw new TypeError(ct(t, ...Ce, "Uint8Array", "JSON Web Key"));
|
|
892
892
|
}
|
|
893
893
|
const Fr = async (e, t, r, a) => {
|
|
894
894
|
const n = await Yr(e, t, "verify");
|
|
895
895
|
Nr(e, n);
|
|
896
896
|
const o = Jr(e, n.algorithm);
|
|
897
897
|
try {
|
|
898
|
-
return await
|
|
898
|
+
return await Le.subtle.verify(o, n, r, a);
|
|
899
899
|
} catch {
|
|
900
900
|
return !1;
|
|
901
901
|
}
|
|
902
902
|
};
|
|
903
903
|
async function zr(e, t, r) {
|
|
904
|
-
if (!
|
|
905
|
-
throw new
|
|
904
|
+
if (!me(e))
|
|
905
|
+
throw new S("Flattened JWS must be an object");
|
|
906
906
|
if (e.protected === void 0 && e.header === void 0)
|
|
907
|
-
throw new
|
|
907
|
+
throw new S('Flattened JWS must have either of the "protected" or "header" members');
|
|
908
908
|
if (e.protected !== void 0 && typeof e.protected != "string")
|
|
909
|
-
throw new
|
|
909
|
+
throw new S("JWS Protected Header incorrect type");
|
|
910
910
|
if (e.payload === void 0)
|
|
911
|
-
throw new
|
|
911
|
+
throw new S("JWS Payload missing");
|
|
912
912
|
if (typeof e.signature != "string")
|
|
913
|
-
throw new
|
|
914
|
-
if (e.header !== void 0 && !
|
|
915
|
-
throw new
|
|
913
|
+
throw new S("JWS Signature missing or incorrect type");
|
|
914
|
+
if (e.header !== void 0 && !me(e.header))
|
|
915
|
+
throw new S("JWS Unprotected Header incorrect type");
|
|
916
916
|
let a = {};
|
|
917
917
|
if (e.protected)
|
|
918
918
|
try {
|
|
919
919
|
const f = j(e.protected);
|
|
920
|
-
a = JSON.parse(
|
|
920
|
+
a = JSON.parse(be.decode(f));
|
|
921
921
|
} catch {
|
|
922
|
-
throw new
|
|
922
|
+
throw new S("JWS Protected Header is invalid");
|
|
923
923
|
}
|
|
924
924
|
if (!_r(a, e.header))
|
|
925
|
-
throw new
|
|
925
|
+
throw new S("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
926
926
|
const n = {
|
|
927
927
|
...a,
|
|
928
928
|
...e.header
|
|
929
|
-
}, o = Gr(
|
|
929
|
+
}, o = Gr(S, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
|
|
930
930
|
let s = !0;
|
|
931
931
|
if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
|
|
932
|
-
throw new
|
|
932
|
+
throw new S('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
933
933
|
const { alg: i } = n;
|
|
934
934
|
if (typeof i != "string" || !i)
|
|
935
|
-
throw new
|
|
935
|
+
throw new S('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
936
936
|
const u = r && Vr("algorithms", r.algorithms);
|
|
937
937
|
if (u && !u.has(i))
|
|
938
|
-
throw new
|
|
938
|
+
throw new vr('"alg" (Algorithm) Header Parameter value not allowed');
|
|
939
939
|
if (s) {
|
|
940
940
|
if (typeof e.payload != "string")
|
|
941
|
-
throw new
|
|
941
|
+
throw new S("JWS Payload must be a string");
|
|
942
942
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
943
|
-
throw new
|
|
943
|
+
throw new S("JWS Payload must be a string or an Uint8Array instance");
|
|
944
944
|
let h = !1;
|
|
945
|
-
typeof t == "function" ? (t = await t(a, e), h = !0,
|
|
946
|
-
const p = wr(
|
|
945
|
+
typeof t == "function" ? (t = await t(a, e), h = !0, dt(i, t, "verify"), he(t) && (t = await Hr(t, i))) : dt(i, t, "verify");
|
|
946
|
+
const p = wr(we.encode(e.protected ?? ""), we.encode("."), typeof e.payload == "string" ? we.encode(e.payload) : e.payload);
|
|
947
947
|
let m;
|
|
948
948
|
try {
|
|
949
949
|
m = j(e.signature);
|
|
950
950
|
} catch {
|
|
951
|
-
throw new
|
|
951
|
+
throw new S("Failed to base64url decode the signature");
|
|
952
952
|
}
|
|
953
953
|
if (!await Fr(i, t, m, p))
|
|
954
|
-
throw new
|
|
954
|
+
throw new Ir();
|
|
955
955
|
let l;
|
|
956
956
|
if (s)
|
|
957
957
|
try {
|
|
958
958
|
l = j(e.payload);
|
|
959
959
|
} catch {
|
|
960
|
-
throw new
|
|
960
|
+
throw new S("Failed to base64url decode the payload");
|
|
961
961
|
}
|
|
962
|
-
else typeof e.payload == "string" ? l =
|
|
962
|
+
else typeof e.payload == "string" ? l = we.encode(e.payload) : l = e.payload;
|
|
963
963
|
const d = { payload: l };
|
|
964
964
|
return e.protected !== void 0 && (d.protectedHeader = a), e.header !== void 0 && (d.unprotectedHeader = e.header), h ? { ...d, key: t } : d;
|
|
965
965
|
}
|
|
966
966
|
async function jr(e, t, r) {
|
|
967
|
-
if (e instanceof Uint8Array && (e =
|
|
968
|
-
throw new
|
|
967
|
+
if (e instanceof Uint8Array && (e = be.decode(e)), typeof e != "string")
|
|
968
|
+
throw new S("Compact JWS must be a string or Uint8Array");
|
|
969
969
|
const { 0: a, 1: n, 2: o, length: s } = e.split(".");
|
|
970
970
|
if (s !== 3)
|
|
971
|
-
throw new
|
|
971
|
+
throw new S("Invalid Compact JWS");
|
|
972
972
|
const i = await zr({ payload: n, protected: a, signature: o }, t, r), u = { payload: i.payload, protectedHeader: i.protectedHeader };
|
|
973
973
|
return typeof t == "function" ? { ...u, key: i.key } : u;
|
|
974
974
|
}
|
|
975
|
-
const qr = (e) => Math.floor(e.getTime() / 1e3),
|
|
975
|
+
const qr = (e) => Math.floor(e.getTime() / 1e3), Bt = 60, Gt = Bt * 60, Ze = Gt * 24, Xr = Ze * 7, Qr = Ze * 365.25, Zr = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, ut = (e) => {
|
|
976
976
|
const t = Zr.exec(e);
|
|
977
977
|
if (!t || t[4] && t[1])
|
|
978
978
|
throw new TypeError("Invalid time period format");
|
|
@@ -991,14 +991,14 @@ const qr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Bt = Wt * 60, Ze = Bt
|
|
|
991
991
|
case "min":
|
|
992
992
|
case "mins":
|
|
993
993
|
case "m":
|
|
994
|
-
n = Math.round(r *
|
|
994
|
+
n = Math.round(r * Bt);
|
|
995
995
|
break;
|
|
996
996
|
case "hour":
|
|
997
997
|
case "hours":
|
|
998
998
|
case "hr":
|
|
999
999
|
case "hrs":
|
|
1000
1000
|
case "h":
|
|
1001
|
-
n = Math.round(r *
|
|
1001
|
+
n = Math.round(r * Gt);
|
|
1002
1002
|
break;
|
|
1003
1003
|
case "day":
|
|
1004
1004
|
case "days":
|
|
@@ -1015,16 +1015,16 @@ const qr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Bt = Wt * 60, Ze = Bt
|
|
|
1015
1015
|
break;
|
|
1016
1016
|
}
|
|
1017
1017
|
return t[1] === "-" || t[4] === "ago" ? -n : n;
|
|
1018
|
-
},
|
|
1018
|
+
}, mt = (e) => e.toLowerCase().replace(/^application\//, ""), ea = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, ta = (e, t, r = {}) => {
|
|
1019
1019
|
let a;
|
|
1020
1020
|
try {
|
|
1021
|
-
a = JSON.parse(
|
|
1021
|
+
a = JSON.parse(be.decode(t));
|
|
1022
1022
|
} catch {
|
|
1023
1023
|
}
|
|
1024
|
-
if (!
|
|
1025
|
-
throw new
|
|
1024
|
+
if (!me(a))
|
|
1025
|
+
throw new J("JWT Claims Set must be a top-level JSON object");
|
|
1026
1026
|
const { typ: n } = r;
|
|
1027
|
-
if (n && (typeof e.typ != "string" ||
|
|
1027
|
+
if (n && (typeof e.typ != "string" || mt(e.typ) !== mt(n)))
|
|
1028
1028
|
throw new U('unexpected "typ" JWT header value', a, "typ", "check_failed");
|
|
1029
1029
|
const { requiredClaims: o = [], issuer: s, subject: i, audience: u, maxTokenAge: h } = r, p = [...o];
|
|
1030
1030
|
h !== void 0 && p.push("iat"), u !== void 0 && p.push("aud"), i !== void 0 && p.push("sub"), s !== void 0 && p.push("iss");
|
|
@@ -1040,7 +1040,7 @@ const qr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Bt = Wt * 60, Ze = Bt
|
|
|
1040
1040
|
let m;
|
|
1041
1041
|
switch (typeof r.clockTolerance) {
|
|
1042
1042
|
case "string":
|
|
1043
|
-
m =
|
|
1043
|
+
m = ut(r.clockTolerance);
|
|
1044
1044
|
break;
|
|
1045
1045
|
case "number":
|
|
1046
1046
|
m = r.clockTolerance;
|
|
@@ -1064,12 +1064,12 @@ const qr = (e) => Math.floor(e.getTime() / 1e3), Wt = 60, Bt = Wt * 60, Ze = Bt
|
|
|
1064
1064
|
if (typeof a.exp != "number")
|
|
1065
1065
|
throw new U('"exp" claim must be a number', a, "exp", "invalid");
|
|
1066
1066
|
if (a.exp <= d - m)
|
|
1067
|
-
throw new
|
|
1067
|
+
throw new it('"exp" claim timestamp check failed', a, "exp", "check_failed");
|
|
1068
1068
|
}
|
|
1069
1069
|
if (h) {
|
|
1070
|
-
const f = d - a.iat, b = typeof h == "number" ? h :
|
|
1070
|
+
const f = d - a.iat, b = typeof h == "number" ? h : ut(h);
|
|
1071
1071
|
if (f - m > b)
|
|
1072
|
-
throw new
|
|
1072
|
+
throw new it('"iat" claim timestamp check failed (too far in the past)', a, "iat", "check_failed");
|
|
1073
1073
|
if (f < 0 - m)
|
|
1074
1074
|
throw new U('"iat" claim timestamp check failed (it should be in the past)', a, "iat", "check_failed");
|
|
1075
1075
|
}
|
|
@@ -1079,40 +1079,40 @@ async function ra(e, t, r) {
|
|
|
1079
1079
|
var a;
|
|
1080
1080
|
const n = await jr(e, t, r);
|
|
1081
1081
|
if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
|
|
1082
|
-
throw new
|
|
1082
|
+
throw new J("JWTs MUST NOT use unencoded payload");
|
|
1083
1083
|
const o = { payload: ta(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
|
|
1084
1084
|
return typeof t == "function" ? { ...o, key: n.key } : o;
|
|
1085
1085
|
}
|
|
1086
1086
|
const aa = j;
|
|
1087
1087
|
function na(e) {
|
|
1088
1088
|
if (typeof e != "string")
|
|
1089
|
-
throw new
|
|
1089
|
+
throw new J("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
1090
1090
|
const { 1: t, length: r } = e.split(".");
|
|
1091
1091
|
if (r === 5)
|
|
1092
|
-
throw new
|
|
1092
|
+
throw new J("Only JWTs using Compact JWS serialization can be decoded");
|
|
1093
1093
|
if (r !== 3)
|
|
1094
|
-
throw new
|
|
1094
|
+
throw new J("Invalid JWT");
|
|
1095
1095
|
if (!t)
|
|
1096
|
-
throw new
|
|
1096
|
+
throw new J("JWTs must contain a payload");
|
|
1097
1097
|
let a;
|
|
1098
1098
|
try {
|
|
1099
1099
|
a = aa(t);
|
|
1100
1100
|
} catch {
|
|
1101
|
-
throw new
|
|
1101
|
+
throw new J("Failed to base64url decode the payload");
|
|
1102
1102
|
}
|
|
1103
1103
|
let n;
|
|
1104
1104
|
try {
|
|
1105
|
-
n = JSON.parse(
|
|
1105
|
+
n = JSON.parse(be.decode(a));
|
|
1106
1106
|
} catch {
|
|
1107
|
-
throw new
|
|
1107
|
+
throw new J("Failed to parse the decoded payload as JSON");
|
|
1108
1108
|
}
|
|
1109
|
-
if (!
|
|
1110
|
-
throw new
|
|
1109
|
+
if (!me(n))
|
|
1110
|
+
throw new J("Invalid JWT Claims Set");
|
|
1111
1111
|
return n;
|
|
1112
1112
|
}
|
|
1113
|
-
const
|
|
1113
|
+
const fe = async (e) => {
|
|
1114
1114
|
try {
|
|
1115
|
-
const t = _.ALG, r = await
|
|
1115
|
+
const t = _.ALG, r = await Kr(Er, t);
|
|
1116
1116
|
return await ra(e, r, {
|
|
1117
1117
|
issuer: _.ISSUER
|
|
1118
1118
|
});
|
|
@@ -1126,38 +1126,38 @@ const he = async (e) => {
|
|
|
1126
1126
|
return;
|
|
1127
1127
|
}
|
|
1128
1128
|
};
|
|
1129
|
-
var
|
|
1129
|
+
var k = [];
|
|
1130
1130
|
for (var Ge = 0; Ge < 256; ++Ge)
|
|
1131
|
-
|
|
1131
|
+
k.push((Ge + 256).toString(16).slice(1));
|
|
1132
1132
|
function sa(e, t = 0) {
|
|
1133
|
-
return (
|
|
1133
|
+
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();
|
|
1134
1134
|
}
|
|
1135
|
-
var
|
|
1135
|
+
var ve, ia = new Uint8Array(16);
|
|
1136
1136
|
function ca() {
|
|
1137
|
-
if (!
|
|
1137
|
+
if (!ve && (ve = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ve))
|
|
1138
1138
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1139
|
-
return
|
|
1139
|
+
return ve(ia);
|
|
1140
1140
|
}
|
|
1141
1141
|
var la = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1142
|
-
const
|
|
1142
|
+
const ht = {
|
|
1143
1143
|
randomUUID: la
|
|
1144
1144
|
};
|
|
1145
|
-
function
|
|
1146
|
-
if (
|
|
1147
|
-
return
|
|
1145
|
+
function pt(e, t, r) {
|
|
1146
|
+
if (ht.randomUUID && !t && !e)
|
|
1147
|
+
return ht.randomUUID();
|
|
1148
1148
|
e = e || {};
|
|
1149
1149
|
var a = e.random || (e.rng || ca)();
|
|
1150
1150
|
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, sa(a);
|
|
1151
1151
|
}
|
|
1152
|
-
const
|
|
1152
|
+
const gt = globalThis.crypto, da = (e) => `${pt()}${pt()}`.slice(0, e), ua = (e) => btoa(
|
|
1153
1153
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
1154
1154
|
);
|
|
1155
1155
|
async function ma(e) {
|
|
1156
|
-
if (!
|
|
1156
|
+
if (!gt.subtle)
|
|
1157
1157
|
throw new Error(
|
|
1158
1158
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
1159
1159
|
);
|
|
1160
|
-
const t = new TextEncoder().encode(e), r = await
|
|
1160
|
+
const t = new TextEncoder().encode(e), r = await gt.subtle.digest("SHA-256", t);
|
|
1161
1161
|
return ua(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
1162
1162
|
}
|
|
1163
1163
|
async function ha(e) {
|
|
@@ -1167,26 +1167,26 @@ async function ha(e) {
|
|
|
1167
1167
|
code_challenge: r
|
|
1168
1168
|
};
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function Vt(e, t) {
|
|
1171
1171
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
1172
1172
|
}
|
|
1173
|
-
const
|
|
1173
|
+
const ft = (e, t) => {
|
|
1174
1174
|
const r = JSON.stringify(
|
|
1175
1175
|
typeof t == "function" ? t() : t
|
|
1176
1176
|
);
|
|
1177
|
-
window.localStorage.setItem(e, r),
|
|
1177
|
+
window.localStorage.setItem(e, r), Vt(e, r);
|
|
1178
1178
|
}, pa = (e) => {
|
|
1179
|
-
window.localStorage.removeItem(e),
|
|
1180
|
-
},
|
|
1181
|
-
function
|
|
1179
|
+
window.localStorage.removeItem(e), Vt(e, null);
|
|
1180
|
+
}, yt = (e) => window.localStorage.getItem(e), ga = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
1181
|
+
function Ie({
|
|
1182
1182
|
key: e,
|
|
1183
1183
|
initialValue: t
|
|
1184
1184
|
}) {
|
|
1185
|
-
const r =
|
|
1185
|
+
const r = lr(ga, () => yt(e)), a = z(
|
|
1186
1186
|
(s) => {
|
|
1187
1187
|
try {
|
|
1188
1188
|
const i = typeof s == "function" ? s(JSON.parse(r)) : s;
|
|
1189
|
-
i == null ? pa(e) :
|
|
1189
|
+
i == null ? pa(e) : ft(e, i);
|
|
1190
1190
|
} catch (i) {
|
|
1191
1191
|
console.warn(i);
|
|
1192
1192
|
}
|
|
@@ -1199,39 +1199,39 @@ function we({
|
|
|
1199
1199
|
}, [a]);
|
|
1200
1200
|
return q(() => {
|
|
1201
1201
|
try {
|
|
1202
|
-
|
|
1202
|
+
yt(e) === null && typeof t < "u" && ft(e, t);
|
|
1203
1203
|
} catch (s) {
|
|
1204
1204
|
console.warn(s);
|
|
1205
1205
|
}
|
|
1206
1206
|
}, [e, t]), [r ? JSON.parse(r) : null, a, n, o];
|
|
1207
1207
|
}
|
|
1208
|
-
var
|
|
1208
|
+
var A = [];
|
|
1209
1209
|
for (var Ve = 0; Ve < 256; ++Ve)
|
|
1210
|
-
|
|
1210
|
+
A.push((Ve + 256).toString(16).slice(1));
|
|
1211
1211
|
function fa(e, t = 0) {
|
|
1212
|
-
return (
|
|
1212
|
+
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();
|
|
1213
1213
|
}
|
|
1214
|
-
var
|
|
1214
|
+
var ke, ya = new Uint8Array(16);
|
|
1215
1215
|
function ba() {
|
|
1216
|
-
if (!
|
|
1216
|
+
if (!ke && (ke = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !ke))
|
|
1217
1217
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1218
|
-
return
|
|
1218
|
+
return ke(ya);
|
|
1219
1219
|
}
|
|
1220
1220
|
var Ea = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1221
|
-
const
|
|
1221
|
+
const bt = {
|
|
1222
1222
|
randomUUID: Ea
|
|
1223
1223
|
};
|
|
1224
1224
|
function Je(e, t, r) {
|
|
1225
|
-
if (
|
|
1226
|
-
return
|
|
1225
|
+
if (bt.randomUUID && !t && !e)
|
|
1226
|
+
return bt.randomUUID();
|
|
1227
1227
|
e = e || {};
|
|
1228
1228
|
var a = e.random || (e.rng || ba)();
|
|
1229
1229
|
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, fa(a);
|
|
1230
1230
|
}
|
|
1231
|
-
const
|
|
1231
|
+
const oe = "Your session has expired. For your security, please log in again to continue.", wa = "Your session has been successfully terminated.", Ye = "Login failed. Please try again.", Ta = "Error getting access token, please re-authenticate.", va = "You forgot to wrap your component in <AuthProvider>.", Pe = {
|
|
1232
1232
|
dev: "https://auth.gizmette.local.com:3003",
|
|
1233
1233
|
prod: "https://mylogin.gizmette.com/auth"
|
|
1234
|
-
},
|
|
1234
|
+
}, Ae = "@@auth@@", ge = "LOADING", Re = "LOGIN", Jt = "LOGOUT", Ee = "success", B = "failure", Yt = "include", Ft = "POST", zt = "application/json", Se = {
|
|
1235
1235
|
GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
|
|
1236
1236
|
$clientId: String!,
|
|
1237
1237
|
$username: String!,
|
|
@@ -1312,24 +1312,24 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1312
1312
|
email
|
|
1313
1313
|
}
|
|
1314
1314
|
}`
|
|
1315
|
-
},
|
|
1315
|
+
}, se = {
|
|
1316
1316
|
GET_REGISTRATION_OPTIONS: {
|
|
1317
|
-
schema:
|
|
1317
|
+
schema: Se.GET_REGISTRATION_OPTIONS,
|
|
1318
1318
|
method: "getPasskeyRegistrationOptions"
|
|
1319
1319
|
},
|
|
1320
1320
|
VERIFY_REGISTRATION: {
|
|
1321
|
-
schema:
|
|
1321
|
+
schema: Se.VERIFY_REGISTRATION,
|
|
1322
1322
|
method: "verifyPasskeyRegistration"
|
|
1323
1323
|
},
|
|
1324
1324
|
GET_AUTHENTICATION_OPTIONS: {
|
|
1325
|
-
schema:
|
|
1325
|
+
schema: Se.GET_AUTHENTICATION_OPTIONS,
|
|
1326
1326
|
method: "getPasskeyAuthenticationOptions"
|
|
1327
1327
|
},
|
|
1328
1328
|
VERIFY_AUTHENTICATION: {
|
|
1329
|
-
schema:
|
|
1329
|
+
schema: Se.VERIFY_AUTHENTICATION,
|
|
1330
1330
|
method: "verifyPasskeyAuthentication"
|
|
1331
1331
|
}
|
|
1332
|
-
},
|
|
1332
|
+
}, ie = async ({
|
|
1333
1333
|
accessToken: e,
|
|
1334
1334
|
type: t,
|
|
1335
1335
|
clientId: r,
|
|
@@ -1337,14 +1337,14 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1337
1337
|
}) => {
|
|
1338
1338
|
try {
|
|
1339
1339
|
const n = `Bearer ${e}`, o = await fetch(
|
|
1340
|
-
|
|
1340
|
+
jt ? `${Pe.dev}/graphql` : `${Pe.prod}/graphql`,
|
|
1341
1341
|
{
|
|
1342
|
-
credentials:
|
|
1343
|
-
method:
|
|
1342
|
+
credentials: Yt,
|
|
1343
|
+
method: Ft,
|
|
1344
1344
|
headers: {
|
|
1345
1345
|
authorization: n,
|
|
1346
|
-
"Content-Type":
|
|
1347
|
-
[
|
|
1346
|
+
"Content-Type": zt,
|
|
1347
|
+
[Pt.CLIENT_ID]: `${r}`
|
|
1348
1348
|
},
|
|
1349
1349
|
body: JSON.stringify({
|
|
1350
1350
|
query: t.schema,
|
|
@@ -1353,58 +1353,58 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1353
1353
|
}
|
|
1354
1354
|
);
|
|
1355
1355
|
if (o.status !== 200)
|
|
1356
|
-
return { status:
|
|
1356
|
+
return { status: B, data: [] };
|
|
1357
1357
|
const { data: s } = await o.json();
|
|
1358
1358
|
return {
|
|
1359
|
-
status:
|
|
1359
|
+
status: Ee,
|
|
1360
1360
|
data: s[t.method]
|
|
1361
1361
|
};
|
|
1362
1362
|
} catch (n) {
|
|
1363
|
-
return console.error(n), { status:
|
|
1363
|
+
return console.error(n), { status: B, data: [] };
|
|
1364
1364
|
}
|
|
1365
|
-
},
|
|
1365
|
+
}, Me = async ({
|
|
1366
1366
|
type: e,
|
|
1367
1367
|
clientId: t,
|
|
1368
1368
|
params: r = {}
|
|
1369
1369
|
}) => {
|
|
1370
1370
|
try {
|
|
1371
1371
|
const a = await fetch(
|
|
1372
|
-
|
|
1372
|
+
jt ? `${Pe.dev}/${e}` : `${Pe.prod}/${e}`,
|
|
1373
1373
|
{
|
|
1374
|
-
credentials:
|
|
1375
|
-
method:
|
|
1374
|
+
credentials: Yt,
|
|
1375
|
+
method: Ft,
|
|
1376
1376
|
headers: {
|
|
1377
|
-
"Content-Type":
|
|
1378
|
-
[
|
|
1377
|
+
"Content-Type": zt,
|
|
1378
|
+
[Pt.CLIENT_ID]: `${t}`
|
|
1379
1379
|
},
|
|
1380
1380
|
body: JSON.stringify(r)
|
|
1381
1381
|
}
|
|
1382
1382
|
);
|
|
1383
1383
|
if (a.status !== 200)
|
|
1384
|
-
return { status:
|
|
1384
|
+
return { status: B, data: [] };
|
|
1385
1385
|
const { data: n } = await a.json();
|
|
1386
1386
|
return {
|
|
1387
|
-
status:
|
|
1387
|
+
status: Ee,
|
|
1388
1388
|
data: n || []
|
|
1389
1389
|
};
|
|
1390
1390
|
} catch (a) {
|
|
1391
|
-
return console.error(a), { status:
|
|
1391
|
+
return console.error(a), { status: B, data: [] };
|
|
1392
1392
|
}
|
|
1393
|
-
},
|
|
1393
|
+
}, Ia = process.env.NODE_ENV === "production", jt = !Ia, qt = {
|
|
1394
1394
|
isLoading: !0,
|
|
1395
1395
|
isAuthenticated: !1,
|
|
1396
1396
|
user: void 0,
|
|
1397
1397
|
logoutReason: "",
|
|
1398
1398
|
debug: !1,
|
|
1399
1399
|
authenticationType: ""
|
|
1400
|
-
},
|
|
1400
|
+
}, ka = (e) => {
|
|
1401
1401
|
try {
|
|
1402
1402
|
const t = oa(e);
|
|
1403
1403
|
return t ? t[_.USER_ID_KEY] : "";
|
|
1404
1404
|
} catch {
|
|
1405
1405
|
return "";
|
|
1406
1406
|
}
|
|
1407
|
-
},
|
|
1407
|
+
}, Aa = async ({
|
|
1408
1408
|
userId: e,
|
|
1409
1409
|
clientId: t,
|
|
1410
1410
|
domain: r,
|
|
@@ -1413,22 +1413,22 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1413
1413
|
var n;
|
|
1414
1414
|
try {
|
|
1415
1415
|
return {
|
|
1416
|
-
status: ((n = await
|
|
1417
|
-
type:
|
|
1416
|
+
status: ((n = await Me({
|
|
1417
|
+
type: $e.LOGOUT,
|
|
1418
1418
|
clientId: t,
|
|
1419
1419
|
params: {
|
|
1420
1420
|
userId: e,
|
|
1421
1421
|
domain: r,
|
|
1422
1422
|
idToken: a
|
|
1423
1423
|
}
|
|
1424
|
-
})) == null ? void 0 : n.status) ||
|
|
1424
|
+
})) == null ? void 0 : n.status) || B
|
|
1425
1425
|
};
|
|
1426
1426
|
} catch {
|
|
1427
1427
|
return {
|
|
1428
|
-
status:
|
|
1428
|
+
status: B
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
|
-
},
|
|
1431
|
+
}, Sa = async ({
|
|
1432
1432
|
username: e,
|
|
1433
1433
|
password: t,
|
|
1434
1434
|
clientId: r,
|
|
@@ -1442,11 +1442,11 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1442
1442
|
}) => {
|
|
1443
1443
|
var p;
|
|
1444
1444
|
try {
|
|
1445
|
-
const m = await
|
|
1446
|
-
type:
|
|
1445
|
+
const m = await Me({
|
|
1446
|
+
type: $e.LOGIN,
|
|
1447
1447
|
clientId: r,
|
|
1448
1448
|
params: {
|
|
1449
|
-
type: n ||
|
|
1449
|
+
type: n || ue.ID_AND_ACCESS_TOKEN,
|
|
1450
1450
|
username: e,
|
|
1451
1451
|
password: t,
|
|
1452
1452
|
sessionExpiration: o,
|
|
@@ -1456,7 +1456,7 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1456
1456
|
domain: u,
|
|
1457
1457
|
ua: h
|
|
1458
1458
|
}
|
|
1459
|
-
}), l = await
|
|
1459
|
+
}), l = await fe((p = m == null ? void 0 : m.data) == null ? void 0 : p.idToken);
|
|
1460
1460
|
return l && l.payload[_.USER_ID_KEY] !== "" && l.payload[_.NONCE_KEY] === a ? {
|
|
1461
1461
|
idToken: m.data.idToken,
|
|
1462
1462
|
accessToken: m.data.accessToken,
|
|
@@ -1479,25 +1479,25 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1479
1479
|
}) => {
|
|
1480
1480
|
var a;
|
|
1481
1481
|
try {
|
|
1482
|
-
const n = await
|
|
1483
|
-
type:
|
|
1482
|
+
const n = await Me({
|
|
1483
|
+
type: $e.CODE,
|
|
1484
1484
|
clientId: t,
|
|
1485
1485
|
params: {
|
|
1486
|
-
type:
|
|
1486
|
+
type: ue.CODE,
|
|
1487
1487
|
nonce: e,
|
|
1488
1488
|
code_challenge: r
|
|
1489
1489
|
}
|
|
1490
1490
|
});
|
|
1491
1491
|
return (a = n == null ? void 0 : n.data) != null && a.code ? {
|
|
1492
|
-
status:
|
|
1492
|
+
status: Ee,
|
|
1493
1493
|
data: n.data.code
|
|
1494
1494
|
} : {
|
|
1495
|
-
status:
|
|
1495
|
+
status: B,
|
|
1496
1496
|
data: ""
|
|
1497
1497
|
};
|
|
1498
1498
|
} catch {
|
|
1499
1499
|
return {
|
|
1500
|
-
status:
|
|
1500
|
+
status: B,
|
|
1501
1501
|
data: ""
|
|
1502
1502
|
};
|
|
1503
1503
|
}
|
|
@@ -1511,18 +1511,18 @@ const ae = "Your session has expired. For your security, please log in again to
|
|
|
1511
1511
|
}) => {
|
|
1512
1512
|
var s;
|
|
1513
1513
|
try {
|
|
1514
|
-
const i = await
|
|
1515
|
-
type:
|
|
1514
|
+
const i = await Me({
|
|
1515
|
+
type: $e.REFRESH,
|
|
1516
1516
|
clientId: e,
|
|
1517
1517
|
params: {
|
|
1518
|
-
type:
|
|
1518
|
+
type: ue.REFRESH_TOKEN,
|
|
1519
1519
|
userId: t,
|
|
1520
1520
|
nonce: r,
|
|
1521
1521
|
refreshToken: a,
|
|
1522
1522
|
accessToken: n,
|
|
1523
1523
|
domain: o
|
|
1524
1524
|
}
|
|
1525
|
-
}), u = await
|
|
1525
|
+
}), u = await fe((s = i == null ? void 0 : i.data) == null ? void 0 : s.accessToken);
|
|
1526
1526
|
return u && u.payload[_.USER_ID_KEY] !== "" && u.payload[_.NONCE_KEY] === r ? {
|
|
1527
1527
|
accessToken: i.data.accessToken,
|
|
1528
1528
|
refreshToken: i.data.refreshToken,
|
|
@@ -1565,7 +1565,7 @@ class Na {
|
|
|
1565
1565
|
nonce: a,
|
|
1566
1566
|
domain: n
|
|
1567
1567
|
}) {
|
|
1568
|
-
const o = await
|
|
1568
|
+
const o = await fe(this.refreshToken);
|
|
1569
1569
|
if (o && o.payload[_.USER_ID_KEY] !== "") {
|
|
1570
1570
|
const s = await Ra({
|
|
1571
1571
|
clientId: t,
|
|
@@ -1576,51 +1576,51 @@ class Na {
|
|
|
1576
1576
|
domain: n
|
|
1577
1577
|
});
|
|
1578
1578
|
return s.status ? (this.accessToken = s.accessToken, this.refreshToken = s.refreshToken, {
|
|
1579
|
-
status:
|
|
1579
|
+
status: Ee,
|
|
1580
1580
|
newAccessToken: s.accessToken,
|
|
1581
1581
|
newRefreshToken: s.refreshToken
|
|
1582
1582
|
}) : {
|
|
1583
|
-
status:
|
|
1583
|
+
status: B
|
|
1584
1584
|
};
|
|
1585
1585
|
} else
|
|
1586
1586
|
return {
|
|
1587
|
-
status:
|
|
1587
|
+
status: B
|
|
1588
1588
|
};
|
|
1589
1589
|
}
|
|
1590
1590
|
}
|
|
1591
|
-
const
|
|
1591
|
+
const xa = (e) => z(
|
|
1592
1592
|
(...t) => {
|
|
1593
1593
|
e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
|
|
1594
1594
|
},
|
|
1595
1595
|
[e]
|
|
1596
|
-
),
|
|
1597
|
-
throw new Error(
|
|
1598
|
-
},
|
|
1596
|
+
), ce = () => {
|
|
1597
|
+
throw new Error(va);
|
|
1598
|
+
}, Xt = cr({
|
|
1599
1599
|
isAuthenticated: !1,
|
|
1600
1600
|
isLoading: !1,
|
|
1601
|
-
login:
|
|
1602
|
-
logout:
|
|
1603
|
-
getAccessToken:
|
|
1604
|
-
getIdToken:
|
|
1605
|
-
registeringForPasskey:
|
|
1606
|
-
loginWithPasskey:
|
|
1601
|
+
login: ce,
|
|
1602
|
+
logout: ce,
|
|
1603
|
+
getAccessToken: ce,
|
|
1604
|
+
getIdToken: ce,
|
|
1605
|
+
registeringForPasskey: ce,
|
|
1606
|
+
loginWithPasskey: ce,
|
|
1607
1607
|
logoutReason: "",
|
|
1608
1608
|
authenticationType: ""
|
|
1609
|
-
}),
|
|
1610
|
-
state:
|
|
1609
|
+
}), Ca = W.createContext({
|
|
1610
|
+
state: qt,
|
|
1611
1611
|
dispatch: () => {
|
|
1612
1612
|
}
|
|
1613
|
-
}), Oa = (e, t) => (t == null ? void 0 : t.type) ===
|
|
1613
|
+
}), Oa = (e, t) => (t == null ? void 0 : t.type) === ge ? {
|
|
1614
1614
|
...e,
|
|
1615
1615
|
isLoading: t.payload.isLoading
|
|
1616
|
-
} : (t == null ? void 0 : t.type) ===
|
|
1616
|
+
} : (t == null ? void 0 : t.type) === Re ? {
|
|
1617
1617
|
...e,
|
|
1618
1618
|
isLoading: !1,
|
|
1619
1619
|
isAuthenticated: !0,
|
|
1620
1620
|
user: t.payload.user,
|
|
1621
1621
|
authenticationType: t.payload.authenticationType,
|
|
1622
1622
|
logoutReason: ""
|
|
1623
|
-
} : (t == null ? void 0 : t.type) ===
|
|
1623
|
+
} : (t == null ? void 0 : t.type) === Jt ? {
|
|
1624
1624
|
...e,
|
|
1625
1625
|
isLoading: !1,
|
|
1626
1626
|
isAuthenticated: !1,
|
|
@@ -1635,259 +1635,259 @@ const Ca = (e) => z(
|
|
|
1635
1635
|
debug: n = !1
|
|
1636
1636
|
}) => {
|
|
1637
1637
|
const [o, s] = It(Oa, {
|
|
1638
|
-
...
|
|
1638
|
+
...qt,
|
|
1639
1639
|
debug: n
|
|
1640
|
-
}), i =
|
|
1641
|
-
key: `${
|
|
1642
|
-
}), [l, d, , f] =
|
|
1643
|
-
key: `${
|
|
1644
|
-
}), [b,
|
|
1640
|
+
}), i = xa(n), u = $(!1), [h, p, , m] = Ie({
|
|
1641
|
+
key: `${Ae}::${r}::@@user@@`
|
|
1642
|
+
}), [l, d, , f] = Ie({
|
|
1643
|
+
key: `${Ae}::${r}::@@access@@`
|
|
1644
|
+
}), [b, I, , w] = Ie(
|
|
1645
1645
|
{
|
|
1646
|
-
key: `${
|
|
1646
|
+
key: `${Ae}::${r}::@@refresh@@`
|
|
1647
1647
|
}
|
|
1648
|
-
), [
|
|
1649
|
-
key: `${
|
|
1650
|
-
}),
|
|
1651
|
-
i("removeLocalStorage: removing local storage"), m(), f(), w(),
|
|
1648
|
+
), [P, D, , L] = Ie({
|
|
1649
|
+
key: `${Ae}::${r}::@@nonce@@`
|
|
1650
|
+
}), M = new Na(l, b), O = z(() => {
|
|
1651
|
+
i("removeLocalStorage: removing local storage"), m(), f(), w(), L();
|
|
1652
1652
|
}, [
|
|
1653
1653
|
f,
|
|
1654
1654
|
m,
|
|
1655
|
-
|
|
1655
|
+
L,
|
|
1656
1656
|
w,
|
|
1657
1657
|
i
|
|
1658
|
-
]),
|
|
1659
|
-
(
|
|
1658
|
+
]), G = z(
|
|
1659
|
+
(g) => {
|
|
1660
1660
|
i(
|
|
1661
1661
|
"removeStateAndLocalStorage: removing state and local storage with reason: ",
|
|
1662
|
-
|
|
1662
|
+
g
|
|
1663
1663
|
), s({
|
|
1664
|
-
type:
|
|
1664
|
+
type: Jt,
|
|
1665
1665
|
payload: {
|
|
1666
|
-
logoutReason:
|
|
1666
|
+
logoutReason: g || oe
|
|
1667
1667
|
}
|
|
1668
|
-
}),
|
|
1668
|
+
}), O(), s({ type: ge, payload: { isLoading: !1 } });
|
|
1669
1669
|
},
|
|
1670
|
-
[
|
|
1671
|
-
),
|
|
1672
|
-
async (
|
|
1670
|
+
[O, i]
|
|
1671
|
+
), R = z(
|
|
1672
|
+
async (g) => {
|
|
1673
1673
|
i("invalidateAndLogout: invalidating and logging out");
|
|
1674
|
-
const { user:
|
|
1674
|
+
const { user: T } = o, E = (T == null ? void 0 : T.userId) || ka(h);
|
|
1675
1675
|
E || i(
|
|
1676
1676
|
"invalidateAndLogout: user cannot be identified, logging out without userId"
|
|
1677
|
-
), await
|
|
1677
|
+
), await Aa({
|
|
1678
1678
|
userId: E,
|
|
1679
1679
|
clientId: r,
|
|
1680
1680
|
domain: a,
|
|
1681
1681
|
idToken: h
|
|
1682
|
-
}),
|
|
1682
|
+
}), G(g || oe);
|
|
1683
1683
|
},
|
|
1684
|
-
[h, o, r, a,
|
|
1684
|
+
[h, o, r, a, G, i]
|
|
1685
1685
|
);
|
|
1686
1686
|
q(() => {
|
|
1687
1687
|
if (!u.current)
|
|
1688
1688
|
return o.isLoading && h !== null ? (async () => {
|
|
1689
1689
|
try {
|
|
1690
|
-
const
|
|
1691
|
-
|
|
1692
|
-
type:
|
|
1690
|
+
const g = await fe(h);
|
|
1691
|
+
g && g.payload[_.USER_ID_KEY] !== "" ? (i("useEffect: setting the authentication state"), s({
|
|
1692
|
+
type: Re,
|
|
1693
1693
|
payload: {
|
|
1694
|
-
authenticationType:
|
|
1694
|
+
authenticationType: g.payload[_.AUTH_TYPE_KEY],
|
|
1695
1695
|
user: {
|
|
1696
|
-
userId:
|
|
1697
|
-
username:
|
|
1698
|
-
email:
|
|
1696
|
+
userId: g.payload[_.USER_ID_KEY],
|
|
1697
|
+
username: g.payload[_.USERNAME_KEY],
|
|
1698
|
+
email: g.payload[_.EMAIL_KEY]
|
|
1699
1699
|
}
|
|
1700
1700
|
}
|
|
1701
|
-
})) : (i("useEffect: invalid JWT, invalidating and logging out"), await
|
|
1701
|
+
})) : (i("useEffect: invalid JWT, invalidating and logging out"), await R(oe));
|
|
1702
1702
|
} catch {
|
|
1703
1703
|
i(
|
|
1704
1704
|
"useEffect: exception validating JWT, invalidating and logging out"
|
|
1705
|
-
), await
|
|
1705
|
+
), await R(oe);
|
|
1706
1706
|
}
|
|
1707
|
-
})() : (i("useEffect: setting the loading state to false"), s({ type:
|
|
1707
|
+
})() : (i("useEffect: setting the loading state to false"), s({ type: ge, payload: { isLoading: !1 } })), () => {
|
|
1708
1708
|
u.current = !0;
|
|
1709
1709
|
};
|
|
1710
|
-
}, [o.isLoading, h,
|
|
1711
|
-
const
|
|
1712
|
-
s({ type:
|
|
1710
|
+
}, [o.isLoading, h, R, i]);
|
|
1711
|
+
const pe = async (g, T) => {
|
|
1712
|
+
s({ type: ge, payload: { isLoading: !0 } }), O();
|
|
1713
1713
|
const E = Je();
|
|
1714
|
-
|
|
1715
|
-
const { code_verifier:
|
|
1714
|
+
D(E), i("login: Logging in with password");
|
|
1715
|
+
const { code_verifier: te, code_challenge: ir } = await ha(), ot = await _a({
|
|
1716
1716
|
nonce: E,
|
|
1717
1717
|
clientId: r,
|
|
1718
|
-
code_challenge:
|
|
1718
|
+
code_challenge: ir
|
|
1719
1719
|
});
|
|
1720
1720
|
if (ot.status) {
|
|
1721
|
-
const
|
|
1722
|
-
username:
|
|
1723
|
-
password:
|
|
1721
|
+
const re = await Sa({
|
|
1722
|
+
username: g,
|
|
1723
|
+
password: T,
|
|
1724
1724
|
clientId: r,
|
|
1725
1725
|
sessionExpiration: t,
|
|
1726
1726
|
nonce: E,
|
|
1727
|
-
type:
|
|
1727
|
+
type: ue.CODE,
|
|
1728
1728
|
code: ot.data,
|
|
1729
|
-
code_verifier:
|
|
1729
|
+
code_verifier: te,
|
|
1730
1730
|
domain: a,
|
|
1731
1731
|
ua: navigator.userAgent
|
|
1732
1732
|
});
|
|
1733
|
-
return
|
|
1734
|
-
type:
|
|
1733
|
+
return re.status ? (p(re.idToken), d(re.accessToken), I(re.refreshToken), s({
|
|
1734
|
+
type: Re,
|
|
1735
1735
|
payload: {
|
|
1736
|
-
authenticationType:
|
|
1736
|
+
authenticationType: ue.CODE,
|
|
1737
1737
|
user: {
|
|
1738
|
-
userId:
|
|
1739
|
-
username:
|
|
1740
|
-
email:
|
|
1738
|
+
userId: re.userId,
|
|
1739
|
+
username: g,
|
|
1740
|
+
email: re.email
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
1743
|
-
}), !0) : (
|
|
1743
|
+
}), !0) : (G(Ye), !1);
|
|
1744
1744
|
}
|
|
1745
1745
|
return !1;
|
|
1746
|
-
},
|
|
1747
|
-
|
|
1748
|
-
},
|
|
1749
|
-
const { isAuthenticated:
|
|
1746
|
+
}, X = async (g) => {
|
|
1747
|
+
g == null || g.preventDefault(), await R(wa);
|
|
1748
|
+
}, Q = async () => {
|
|
1749
|
+
const { isAuthenticated: g, user: T } = o;
|
|
1750
1750
|
try {
|
|
1751
|
-
if (
|
|
1751
|
+
if (g && T && T.userId) {
|
|
1752
1752
|
if (l) {
|
|
1753
1753
|
i("getAccessToken");
|
|
1754
|
-
const
|
|
1755
|
-
if (
|
|
1754
|
+
const te = await fe(l);
|
|
1755
|
+
if (te && te.payload[_.USER_ID_KEY] !== "")
|
|
1756
1756
|
return l;
|
|
1757
1757
|
}
|
|
1758
1758
|
i("getAccessToken: invalid access token, trying to refresh it");
|
|
1759
|
-
const E = await
|
|
1759
|
+
const E = await M.refreshtoken({
|
|
1760
1760
|
clientId: r,
|
|
1761
|
-
userId:
|
|
1762
|
-
nonce:
|
|
1761
|
+
userId: T.userId,
|
|
1762
|
+
nonce: P,
|
|
1763
1763
|
domain: a
|
|
1764
1764
|
});
|
|
1765
|
-
return E.status && E.status === "success" && E.newAccessToken ? (d(E.newAccessToken),
|
|
1765
|
+
return E.status && E.status === "success" && E.newAccessToken ? (d(E.newAccessToken), I(E.newRefreshToken), E.newAccessToken) : (i(
|
|
1766
1766
|
"getAccessToken: invalid refresh token, need to re-authenticate"
|
|
1767
|
-
), await
|
|
1767
|
+
), await R(oe), "");
|
|
1768
1768
|
}
|
|
1769
1769
|
return i(
|
|
1770
1770
|
"getAccessToken: user is not authenticated, cannot get access token"
|
|
1771
|
-
), await
|
|
1771
|
+
), await R(oe), "";
|
|
1772
1772
|
} catch {
|
|
1773
1773
|
return i(
|
|
1774
1774
|
"getAccessToken: exception occurred, invalidating and logging out"
|
|
1775
|
-
), await
|
|
1775
|
+
), await R(Ta), "";
|
|
1776
1776
|
}
|
|
1777
|
-
},
|
|
1778
|
-
const { user:
|
|
1779
|
-
let
|
|
1777
|
+
}, C = () => o.isAuthenticated && h ? h : "", N = async () => {
|
|
1778
|
+
const { user: g } = o;
|
|
1779
|
+
let T = await ie({
|
|
1780
1780
|
accessToken: l,
|
|
1781
1781
|
clientId: r,
|
|
1782
|
-
type:
|
|
1782
|
+
type: se.GET_REGISTRATION_OPTIONS,
|
|
1783
1783
|
params: {
|
|
1784
1784
|
clientId: r,
|
|
1785
|
-
id:
|
|
1786
|
-
username:
|
|
1785
|
+
id: g == null ? void 0 : g.userId,
|
|
1786
|
+
username: g == null ? void 0 : g.username
|
|
1787
1787
|
}
|
|
1788
1788
|
});
|
|
1789
|
-
if (
|
|
1789
|
+
if (T.status)
|
|
1790
1790
|
try {
|
|
1791
|
-
const E = await gr(
|
|
1792
|
-
return
|
|
1791
|
+
const E = await gr(T.data);
|
|
1792
|
+
return T = await ie({
|
|
1793
1793
|
accessToken: l,
|
|
1794
1794
|
clientId: r,
|
|
1795
|
-
type:
|
|
1795
|
+
type: se.VERIFY_REGISTRATION,
|
|
1796
1796
|
params: {
|
|
1797
1797
|
clientId: r,
|
|
1798
|
-
id:
|
|
1799
|
-
username:
|
|
1798
|
+
id: g == null ? void 0 : g.userId,
|
|
1799
|
+
username: g == null ? void 0 : g.username,
|
|
1800
1800
|
registration: E
|
|
1801
1801
|
}
|
|
1802
|
-
}), !!(
|
|
1802
|
+
}), !!(T.status && T.data.length > 0);
|
|
1803
1803
|
} catch {
|
|
1804
|
-
return await
|
|
1804
|
+
return await ie({
|
|
1805
1805
|
accessToken: l,
|
|
1806
1806
|
clientId: r,
|
|
1807
|
-
type:
|
|
1807
|
+
type: se.VERIFY_REGISTRATION,
|
|
1808
1808
|
params: {
|
|
1809
1809
|
clientId: r,
|
|
1810
|
-
id:
|
|
1811
|
-
username:
|
|
1810
|
+
id: g == null ? void 0 : g.userId,
|
|
1811
|
+
username: g == null ? void 0 : g.username,
|
|
1812
1812
|
registration: {}
|
|
1813
1813
|
}
|
|
1814
1814
|
}), !1;
|
|
1815
1815
|
}
|
|
1816
1816
|
return !1;
|
|
1817
|
-
},
|
|
1818
|
-
s({ type:
|
|
1819
|
-
const
|
|
1820
|
-
|
|
1821
|
-
const
|
|
1822
|
-
let E = await
|
|
1817
|
+
}, ee = async () => {
|
|
1818
|
+
s({ type: ge, payload: { isLoading: !0 } }), O();
|
|
1819
|
+
const g = Je();
|
|
1820
|
+
D(g), i("loginWithPasskey");
|
|
1821
|
+
const T = Je();
|
|
1822
|
+
let E = await ie({
|
|
1823
1823
|
accessToken: l,
|
|
1824
1824
|
clientId: r,
|
|
1825
|
-
type:
|
|
1825
|
+
type: se.GET_AUTHENTICATION_OPTIONS,
|
|
1826
1826
|
params: {
|
|
1827
|
-
id:
|
|
1827
|
+
id: T,
|
|
1828
1828
|
clientId: r
|
|
1829
1829
|
}
|
|
1830
1830
|
});
|
|
1831
1831
|
if (E.status)
|
|
1832
1832
|
try {
|
|
1833
|
-
const
|
|
1834
|
-
return E = await
|
|
1833
|
+
const te = await br(E.data);
|
|
1834
|
+
return E = await ie({
|
|
1835
1835
|
accessToken: l,
|
|
1836
1836
|
clientId: r,
|
|
1837
|
-
type:
|
|
1837
|
+
type: se.VERIFY_AUTHENTICATION,
|
|
1838
1838
|
params: {
|
|
1839
1839
|
clientId: r,
|
|
1840
|
-
id:
|
|
1841
|
-
authentication:
|
|
1842
|
-
nonce:
|
|
1840
|
+
id: T,
|
|
1841
|
+
authentication: te,
|
|
1842
|
+
nonce: g,
|
|
1843
1843
|
domain: a,
|
|
1844
1844
|
sessionExpiration: t,
|
|
1845
1845
|
ua: navigator.userAgent
|
|
1846
1846
|
}
|
|
1847
|
-
}), E.data.status ===
|
|
1848
|
-
type:
|
|
1847
|
+
}), E.data.status === Ee ? (p(E.data.idToken), d(E.data.accessToken), I(E.data.refreshToken), s({
|
|
1848
|
+
type: Re,
|
|
1849
1849
|
payload: {
|
|
1850
|
-
authenticationType:
|
|
1850
|
+
authenticationType: ue.PASSKEY,
|
|
1851
1851
|
user: {
|
|
1852
1852
|
userId: E.data.userId,
|
|
1853
1853
|
username: E.data.username,
|
|
1854
1854
|
email: E.data.email
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
|
-
}), !0) : (
|
|
1857
|
+
}), !0) : (G(Ye), !1);
|
|
1858
1858
|
} catch {
|
|
1859
|
-
return await
|
|
1859
|
+
return await ie({
|
|
1860
1860
|
accessToken: l,
|
|
1861
1861
|
clientId: r,
|
|
1862
|
-
type:
|
|
1862
|
+
type: se.VERIFY_AUTHENTICATION,
|
|
1863
1863
|
params: {
|
|
1864
1864
|
clientId: r,
|
|
1865
|
-
id:
|
|
1865
|
+
id: T,
|
|
1866
1866
|
authentication: {},
|
|
1867
|
-
nonce:
|
|
1867
|
+
nonce: g,
|
|
1868
1868
|
domain: a,
|
|
1869
1869
|
sessionExpiration: t
|
|
1870
1870
|
}
|
|
1871
|
-
}),
|
|
1871
|
+
}), G(Ye), !1;
|
|
1872
1872
|
}
|
|
1873
1873
|
return !1;
|
|
1874
1874
|
};
|
|
1875
|
-
return /* @__PURE__ */ c(
|
|
1876
|
-
|
|
1875
|
+
return /* @__PURE__ */ c(Ca.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ c(
|
|
1876
|
+
Xt.Provider,
|
|
1877
1877
|
{
|
|
1878
1878
|
value: {
|
|
1879
1879
|
...o,
|
|
1880
|
-
login:
|
|
1881
|
-
logout:
|
|
1882
|
-
getAccessToken:
|
|
1883
|
-
getIdToken:
|
|
1884
|
-
registeringForPasskey:
|
|
1885
|
-
loginWithPasskey:
|
|
1880
|
+
login: pe,
|
|
1881
|
+
logout: X,
|
|
1882
|
+
getAccessToken: Q,
|
|
1883
|
+
getIdToken: C,
|
|
1884
|
+
registeringForPasskey: N,
|
|
1885
|
+
loginWithPasskey: ee
|
|
1886
1886
|
},
|
|
1887
1887
|
children: e
|
|
1888
1888
|
}
|
|
1889
1889
|
) });
|
|
1890
|
-
}, et = (e =
|
|
1890
|
+
}, et = (e = Xt) => kt(e), mo = "user", ho = "assistant", po = "system", go = "internal", fo = "hidden", yo = "I'm having trouble right now. Please try again later.", bo = "gpt-4", Eo = 128e3, wo = "action-message", To = "action-reset", vo = "action-model", Io = "action-restore", ko = "action-streaming", Ao = "action-search", So = "action-sort", _o = "action-toggle-tag", Ro = "action-reset-tags", Fe = {
|
|
1891
1891
|
SUMMARIZE_ARTICLE: "summarize-article",
|
|
1892
1892
|
PROOFREAD_CONTENT: "proofread-content",
|
|
1893
1893
|
REPHRASE_CONTENT: "rephrase-content"
|
|
@@ -1901,19 +1901,19 @@ const Ca = (e) => z(
|
|
|
1901
1901
|
content: "Proofread this: "
|
|
1902
1902
|
},
|
|
1903
1903
|
[Fe.REPHRASE_CONTENT]: { label: "Rephrase...", content: "Rephrase this: " }
|
|
1904
|
-
},
|
|
1905
|
-
function
|
|
1904
|
+
}, xo = "sassy-saint-", Co = "details", Oo = "search", Po = "sort", Do = "summarize-article", $o = "proofread-content", Lo = "rephrase-content", Mo = "==stats==", Da = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Et = (e) => Number.isFinite(e) ? e : 0;
|
|
1905
|
+
function $a(e) {
|
|
1906
1906
|
return {
|
|
1907
1907
|
days: Math.trunc(e / 864e5),
|
|
1908
1908
|
hours: Math.trunc(e / 36e5 % 24),
|
|
1909
1909
|
minutes: Math.trunc(e / 6e4 % 60),
|
|
1910
1910
|
seconds: Math.trunc(e / 1e3 % 60),
|
|
1911
1911
|
milliseconds: Math.trunc(e % 1e3),
|
|
1912
|
-
microseconds: Math.trunc(
|
|
1913
|
-
nanoseconds: Math.trunc(
|
|
1912
|
+
microseconds: Math.trunc(Et(e * 1e3) % 1e3),
|
|
1913
|
+
nanoseconds: Math.trunc(Et(e * 1e6) % 1e3)
|
|
1914
1914
|
};
|
|
1915
1915
|
}
|
|
1916
|
-
function
|
|
1916
|
+
function La(e) {
|
|
1917
1917
|
return {
|
|
1918
1918
|
days: e / 86400000n,
|
|
1919
1919
|
hours: e / 3600000n % 24n,
|
|
@@ -1924,19 +1924,19 @@ function Ma(e) {
|
|
|
1924
1924
|
nanoseconds: 0n
|
|
1925
1925
|
};
|
|
1926
1926
|
}
|
|
1927
|
-
function
|
|
1927
|
+
function Ma(e) {
|
|
1928
1928
|
switch (typeof e) {
|
|
1929
1929
|
case "number": {
|
|
1930
1930
|
if (Number.isFinite(e))
|
|
1931
|
-
return
|
|
1931
|
+
return $a(e);
|
|
1932
1932
|
break;
|
|
1933
1933
|
}
|
|
1934
1934
|
case "bigint":
|
|
1935
|
-
return
|
|
1935
|
+
return La(e);
|
|
1936
1936
|
}
|
|
1937
1937
|
throw new TypeError("Expected a finite number or bigint");
|
|
1938
1938
|
}
|
|
1939
|
-
const
|
|
1939
|
+
const Ua = (e) => e === 0 || e === 0n, Ka = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Ha = 1e-7, Wa = 24n * 60n * 60n * 1000n;
|
|
1940
1940
|
function Ba(e, t) {
|
|
1941
1941
|
const r = typeof e == "bigint";
|
|
1942
1942
|
if (!r && !Number.isFinite(e))
|
|
@@ -1949,21 +1949,21 @@ function Ba(e, t) {
|
|
|
1949
1949
|
const l = Math.floor(p * 10 ** m + Ha);
|
|
1950
1950
|
return (Math.round(l) / 10 ** m).toFixed(m);
|
|
1951
1951
|
}, s = (p, m, l, d) => {
|
|
1952
|
-
if (!((n.length === 0 || !t.colonNotation) &&
|
|
1952
|
+
if (!((n.length === 0 || !t.colonNotation) && Ua(p) && !(t.colonNotation && l === "m"))) {
|
|
1953
1953
|
if (d ?? (d = String(p)), t.colonNotation) {
|
|
1954
1954
|
const f = d.includes(".") ? d.split(".")[0].length : d.length, b = n.length > 0 ? 2 : 1;
|
|
1955
1955
|
d = "0".repeat(Math.max(0, b - f)) + d;
|
|
1956
1956
|
} else
|
|
1957
|
-
d += t.verbose ? " " +
|
|
1957
|
+
d += t.verbose ? " " + Ka(m, p) : l;
|
|
1958
1958
|
n.push(d);
|
|
1959
1959
|
}
|
|
1960
|
-
}, i =
|
|
1960
|
+
}, i = Ma(e), u = BigInt(i.days);
|
|
1961
1961
|
if (s(u / 365n, "year", "y"), s(u % 365n, "day", "d"), s(Number(i.hours), "hour", "h"), s(Number(i.minutes), "minute", "m"), t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
|
|
1962
1962
|
const p = Number(i.seconds), m = Number(i.milliseconds), l = Number(i.microseconds), d = Number(i.nanoseconds);
|
|
1963
1963
|
if (s(p, "second", "s"), t.formatSubMilliseconds)
|
|
1964
1964
|
s(m, "millisecond", "ms"), s(l, "microsecond", "µs"), s(d, "nanosecond", "ns");
|
|
1965
1965
|
else {
|
|
1966
|
-
const f = m + l / 1e3 + d / 1e6, b = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0,
|
|
1966
|
+
const f = m + l / 1e3 + d / 1e6, b = typeof t.millisecondsDecimalDigits == "number" ? t.millisecondsDecimalDigits : 0, I = f >= 1 ? Math.round(f) : Math.ceil(f), w = b ? f.toFixed(b) : I;
|
|
1967
1967
|
s(
|
|
1968
1968
|
Number.parseFloat(w),
|
|
1969
1969
|
"millisecond",
|
|
@@ -1980,7 +1980,7 @@ function Ba(e, t) {
|
|
|
1980
1980
|
const h = t.colonNotation ? ":" : " ";
|
|
1981
1981
|
return typeof t.unitCount == "number" && (n = n.slice(0, Math.max(t.unitCount, 1))), a + n.join(h);
|
|
1982
1982
|
}
|
|
1983
|
-
const Ga = process.env.NODE_ENV === "production", tt = !Ga, Va = tt ? "gizmette.local.com" : "gizmette.com",
|
|
1983
|
+
const Ga = process.env.NODE_ENV === "production", tt = !Ga, Va = tt ? "gizmette.local.com" : "gizmette.com", Uo = (e, t) => e.length > t ? e.substring(0, t) + "..." : e, Ko = async () => {
|
|
1984
1984
|
const e = {
|
|
1985
1985
|
/**
|
|
1986
1986
|
* A boolean value that indicates the application would
|
|
@@ -2029,7 +2029,7 @@ const Ga = process.env.NODE_ENV === "production", tt = !Ga, Va = tt ? "gizmette.
|
|
|
2029
2029
|
e
|
|
2030
2030
|
);
|
|
2031
2031
|
});
|
|
2032
|
-
}, Ho = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ c("dl", { className: "my-0", children: /* @__PURE__ */
|
|
2032
|
+
}, Ho = (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: [
|
|
2033
2033
|
/* @__PURE__ */ c("dt", { className: "my-1 inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
|
|
2034
2034
|
/* @__PURE__ */ c("dd", { className: "my-1 inline-block", children: t[r] })
|
|
2035
2035
|
] }) }, `${e}-${r}`)) : null;
|
|
@@ -2053,10 +2053,10 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2053
2053
|
}), Vo = (e) => e > 0 ? Ba(e, {
|
|
2054
2054
|
secondsDecimalDigits: 2,
|
|
2055
2055
|
unitCount: 2
|
|
2056
|
-
}) : "N/A", Ja = (e) =>
|
|
2056
|
+
}) : "N/A", Ja = (e) => y(
|
|
2057
2057
|
"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",
|
|
2058
2058
|
e || tt ? "pt-4" : "pt-10"
|
|
2059
|
-
), Jo = (e, t) => t === 1 ? e : `${e}s`,
|
|
2059
|
+
), Jo = (e, t) => t === 1 ? e : `${e}s`, wt = "av-button", Ya = (e) => {
|
|
2060
2060
|
let t = "";
|
|
2061
2061
|
if (typeof e == "number" || typeof e == "string")
|
|
2062
2062
|
t = "m-" + e;
|
|
@@ -2065,7 +2065,7 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2065
2065
|
(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(" ");
|
|
2066
2066
|
}
|
|
2067
2067
|
return t;
|
|
2068
|
-
}, rt = "icon",
|
|
2068
|
+
}, rt = "icon", Qt = "button", Fa = "link", za = ({
|
|
2069
2069
|
type: e,
|
|
2070
2070
|
size: t,
|
|
2071
2071
|
labelRight: r,
|
|
@@ -2074,20 +2074,20 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2074
2074
|
}) => {
|
|
2075
2075
|
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";
|
|
2076
2076
|
switch (e) {
|
|
2077
|
-
case
|
|
2078
|
-
return
|
|
2077
|
+
case Qt:
|
|
2078
|
+
return y("px-4", {
|
|
2079
2079
|
[o]: t === "small",
|
|
2080
2080
|
[s]: t === "medium",
|
|
2081
2081
|
[i]: t === "large"
|
|
2082
2082
|
});
|
|
2083
2083
|
case Fa:
|
|
2084
|
-
return
|
|
2084
|
+
return y("px-4 text-center", {
|
|
2085
2085
|
[o]: t === "small",
|
|
2086
2086
|
[s]: t === "medium",
|
|
2087
2087
|
[i]: t === "large"
|
|
2088
2088
|
});
|
|
2089
2089
|
case rt:
|
|
2090
|
-
return
|
|
2090
|
+
return y("inline-flex items-center", {
|
|
2091
2091
|
"justify-center": n === "center",
|
|
2092
2092
|
"justify-start": n === "left",
|
|
2093
2093
|
"justify-end": n === "right",
|
|
@@ -2108,7 +2108,7 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2108
2108
|
if (t)
|
|
2109
2109
|
return "not-prose rounded-full";
|
|
2110
2110
|
if (a === "primary")
|
|
2111
|
-
return
|
|
2111
|
+
return y("not-prose rounded-full", {
|
|
2112
2112
|
truncate: !r,
|
|
2113
2113
|
"bg-action-dark text-copy-light": e === "dark",
|
|
2114
2114
|
"bg-action-light text-copy-lighter": e === "light",
|
|
@@ -2116,7 +2116,7 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2116
2116
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
|
|
2117
2117
|
});
|
|
2118
2118
|
if (a === "secondary")
|
|
2119
|
-
return
|
|
2119
|
+
return y("not-prose rounded-full", {
|
|
2120
2120
|
truncate: !r,
|
|
2121
2121
|
"bg-action-dark text-copy-light": e === "light",
|
|
2122
2122
|
"bg-action-light text-copy-lighter": e === "dark",
|
|
@@ -2124,7 +2124,7 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2124
2124
|
"bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
|
|
2125
2125
|
});
|
|
2126
2126
|
if (a === "danger")
|
|
2127
|
-
return
|
|
2127
|
+
return y("not-prose rounded-full", {
|
|
2128
2128
|
truncate: !r,
|
|
2129
2129
|
"bg-action-danger-dark text-copy-light": e === "dark",
|
|
2130
2130
|
"bg-action-danger-light text-copy-lighter": e === "light",
|
|
@@ -2139,21 +2139,21 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2139
2139
|
if (t)
|
|
2140
2140
|
return "";
|
|
2141
2141
|
if (r === "primary")
|
|
2142
|
-
return
|
|
2142
|
+
return y("hover:text-copy-light-hover", {
|
|
2143
2143
|
"hover:bg-action-dark-hover": e === "dark",
|
|
2144
2144
|
"hover:bg-action-light-hover": e === "light",
|
|
2145
2145
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
|
|
2146
2146
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
|
|
2147
2147
|
});
|
|
2148
2148
|
if (r === "secondary")
|
|
2149
|
-
return
|
|
2149
|
+
return y("hover:text-copy-light-hover", {
|
|
2150
2150
|
"hover:bg-action-dark-hover": e === "light",
|
|
2151
2151
|
"hover:bg-action-light-hover": e === "dark",
|
|
2152
2152
|
"hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
|
|
2153
2153
|
"hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
|
|
2154
2154
|
});
|
|
2155
2155
|
if (r === "danger")
|
|
2156
|
-
return
|
|
2156
|
+
return y("hover:text-copy-light-hover", {
|
|
2157
2157
|
"hover:bg-action-danger-dark-hover": e === "dark",
|
|
2158
2158
|
"hover:bg-action-danger-light-hover": e === "light",
|
|
2159
2159
|
"hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
|
|
@@ -2167,21 +2167,21 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2167
2167
|
if (t)
|
|
2168
2168
|
return "";
|
|
2169
2169
|
if (r === "primary")
|
|
2170
|
-
return
|
|
2170
|
+
return y("active:text-copy-light-active", {
|
|
2171
2171
|
"active:bg-action-dark-active": e === "dark",
|
|
2172
2172
|
"active:bg-action-light-active": e === "light",
|
|
2173
2173
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
|
|
2174
2174
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
|
|
2175
2175
|
});
|
|
2176
2176
|
if (r === "secondary")
|
|
2177
|
-
return
|
|
2177
|
+
return y("active:text-copy-light-active", {
|
|
2178
2178
|
"active:bg-action-dark-active": e === "light",
|
|
2179
2179
|
"active:bg-action-light-active": e === "dark",
|
|
2180
2180
|
"active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
|
|
2181
2181
|
"active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
|
|
2182
2182
|
});
|
|
2183
2183
|
if (r === "danger")
|
|
2184
|
-
return
|
|
2184
|
+
return y("active:text-copy-lighter-active", {
|
|
2185
2185
|
"active:bg-action-danger-dark-active": e === "dark",
|
|
2186
2186
|
"active:bg-action-danger-light-active": e === "light",
|
|
2187
2187
|
"active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
|
|
@@ -2195,27 +2195,27 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2195
2195
|
if (t)
|
|
2196
2196
|
return "border border-transparent";
|
|
2197
2197
|
if (r === "primary")
|
|
2198
|
-
return
|
|
2198
|
+
return y("border", {
|
|
2199
2199
|
"border-border-dark": e === "dark",
|
|
2200
2200
|
"border-border-accent": e === "light",
|
|
2201
2201
|
"border-border-dark dark:border-border-accent": e === "system",
|
|
2202
2202
|
"border-border-accent dark:border-border-dark": e === "alt-system"
|
|
2203
2203
|
});
|
|
2204
2204
|
if (r === "secondary")
|
|
2205
|
-
return
|
|
2205
|
+
return y("border", {
|
|
2206
2206
|
"border-border-dark": e === "light",
|
|
2207
2207
|
"border-border-accent": e === "dark",
|
|
2208
2208
|
"border-border-dark dark:border-border-accent": e === "alt-system",
|
|
2209
2209
|
"border-border-accent dark:border-border-dark": e === "system"
|
|
2210
2210
|
});
|
|
2211
2211
|
if (r === "danger")
|
|
2212
|
-
return
|
|
2212
|
+
return y("border", {
|
|
2213
2213
|
"border-border-danger-dark": e === "dark",
|
|
2214
2214
|
"border-border-danger-medium": e === "light",
|
|
2215
2215
|
"border-border-danger-dark dark:border-border-danger-medium": e === "system",
|
|
2216
2216
|
"border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
|
|
2217
2217
|
});
|
|
2218
|
-
}, Za = ({ focusMode: e }) =>
|
|
2218
|
+
}, Za = ({ focusMode: e }) => y("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
2219
2219
|
"focus:outline-focus-dark": e === "dark",
|
|
2220
2220
|
"focus:outline-focus-light": e === "light",
|
|
2221
2221
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
@@ -2237,8 +2237,8 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2237
2237
|
variant: d,
|
|
2238
2238
|
noTruncate: f,
|
|
2239
2239
|
align: b
|
|
2240
|
-
}) => (d || (d = "primary"), r ?
|
|
2241
|
-
|
|
2240
|
+
}) => (d || (d = "primary"), r ? y(wt, t) : y(
|
|
2241
|
+
wt,
|
|
2242
2242
|
t,
|
|
2243
2243
|
Ya(m),
|
|
2244
2244
|
ja({ mode: a, variant: d, noBackground: l, noTruncate: f }),
|
|
@@ -2254,7 +2254,7 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2254
2254
|
)), en = (e, t, r) => {
|
|
2255
2255
|
var a;
|
|
2256
2256
|
!t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
|
|
2257
|
-
},
|
|
2257
|
+
}, Ue = W.forwardRef((e, t) => {
|
|
2258
2258
|
const { onClick: r, noInternalClick: a = !1, ...n } = e;
|
|
2259
2259
|
return /* @__PURE__ */ c(
|
|
2260
2260
|
"button",
|
|
@@ -2267,8 +2267,8 @@ const Bo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length
|
|
|
2267
2267
|
}
|
|
2268
2268
|
);
|
|
2269
2269
|
});
|
|
2270
|
-
|
|
2271
|
-
const
|
|
2270
|
+
Ue.displayName = "BaseButton";
|
|
2271
|
+
const Zt = W.forwardRef(
|
|
2272
2272
|
({
|
|
2273
2273
|
children: e,
|
|
2274
2274
|
disabled: t = !1,
|
|
@@ -2285,7 +2285,7 @@ const Qt = H.forwardRef(
|
|
|
2285
2285
|
...l
|
|
2286
2286
|
}, d) => {
|
|
2287
2287
|
const f = at({
|
|
2288
|
-
type:
|
|
2288
|
+
type: Qt,
|
|
2289
2289
|
mode: r,
|
|
2290
2290
|
focusMode: a,
|
|
2291
2291
|
fullWidth: n,
|
|
@@ -2299,7 +2299,7 @@ const Qt = H.forwardRef(
|
|
|
2299
2299
|
noTruncate: m
|
|
2300
2300
|
});
|
|
2301
2301
|
return /* @__PURE__ */ c(
|
|
2302
|
-
|
|
2302
|
+
Ue,
|
|
2303
2303
|
{
|
|
2304
2304
|
ref: d,
|
|
2305
2305
|
className: f,
|
|
@@ -2310,8 +2310,8 @@ const Qt = H.forwardRef(
|
|
|
2310
2310
|
);
|
|
2311
2311
|
}
|
|
2312
2312
|
);
|
|
2313
|
-
|
|
2314
|
-
const Xe =
|
|
2313
|
+
Zt.displayName = "Button";
|
|
2314
|
+
const Xe = W.forwardRef(
|
|
2315
2315
|
({
|
|
2316
2316
|
children: e,
|
|
2317
2317
|
disabled: t = !1,
|
|
@@ -2329,10 +2329,10 @@ const Xe = H.forwardRef(
|
|
|
2329
2329
|
labelLeft: d,
|
|
2330
2330
|
spacing: f,
|
|
2331
2331
|
noBackground: b = !1,
|
|
2332
|
-
align:
|
|
2332
|
+
align: I = "center",
|
|
2333
2333
|
...w
|
|
2334
|
-
},
|
|
2335
|
-
const
|
|
2334
|
+
}, P) => {
|
|
2335
|
+
const D = at({
|
|
2336
2336
|
type: rt,
|
|
2337
2337
|
mode: r,
|
|
2338
2338
|
focusMode: a,
|
|
@@ -2346,25 +2346,25 @@ const Xe = H.forwardRef(
|
|
|
2346
2346
|
labelLeft: d,
|
|
2347
2347
|
spacing: f,
|
|
2348
2348
|
noBackground: b,
|
|
2349
|
-
align:
|
|
2350
|
-
}),
|
|
2349
|
+
align: I
|
|
2350
|
+
}), L = y({
|
|
2351
2351
|
"text-copy-accent-dark": r === "light" && !i,
|
|
2352
2352
|
"text-copy-light": r === "dark" && !i,
|
|
2353
2353
|
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
|
|
2354
2354
|
"text-copy-light dark:text-copy-accent-dark": r === "system" && !i
|
|
2355
2355
|
});
|
|
2356
|
-
return /* @__PURE__ */
|
|
2357
|
-
|
|
2356
|
+
return /* @__PURE__ */ v(
|
|
2357
|
+
Ue,
|
|
2358
2358
|
{
|
|
2359
|
-
ref:
|
|
2360
|
-
className:
|
|
2359
|
+
ref: P,
|
|
2360
|
+
className: D,
|
|
2361
2361
|
disabled: t,
|
|
2362
2362
|
type: s,
|
|
2363
2363
|
"aria-label": h || p,
|
|
2364
2364
|
...w,
|
|
2365
2365
|
children: [
|
|
2366
2366
|
d && /* @__PURE__ */ c("span", { className: "pr-2", children: d }),
|
|
2367
|
-
/* @__PURE__ */ c("div", { className:
|
|
2367
|
+
/* @__PURE__ */ c("div", { className: L, children: e }),
|
|
2368
2368
|
l && /* @__PURE__ */ c("span", { className: "pl-2", children: l })
|
|
2369
2369
|
]
|
|
2370
2370
|
}
|
|
@@ -2373,19 +2373,19 @@ const Xe = H.forwardRef(
|
|
|
2373
2373
|
);
|
|
2374
2374
|
Xe.displayName = "ButtonIcon";
|
|
2375
2375
|
/*!
|
|
2376
|
-
@versini/ui-button v1.1.
|
|
2376
|
+
@versini/ui-button v1.1.10
|
|
2377
2377
|
© 2024 gizmette.com
|
|
2378
2378
|
*/
|
|
2379
2379
|
try {
|
|
2380
2380
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
2381
|
-
version: "1.1.
|
|
2382
|
-
buildTime: "09/
|
|
2381
|
+
version: "1.1.10",
|
|
2382
|
+
buildTime: "09/28/2024 06:29 PM EDT",
|
|
2383
2383
|
homepage: "https://github.com/aversini/ui-components",
|
|
2384
2384
|
license: "MIT"
|
|
2385
2385
|
});
|
|
2386
2386
|
} catch {
|
|
2387
2387
|
}
|
|
2388
|
-
const tn =
|
|
2388
|
+
const tn = W.forwardRef(
|
|
2389
2389
|
({
|
|
2390
2390
|
children: e,
|
|
2391
2391
|
disabled: t = !1,
|
|
@@ -2403,11 +2403,11 @@ const tn = H.forwardRef(
|
|
|
2403
2403
|
labelLeft: d,
|
|
2404
2404
|
spacing: f,
|
|
2405
2405
|
noBackground: b = !1,
|
|
2406
|
-
align:
|
|
2406
|
+
align: I = "center",
|
|
2407
2407
|
active: w = !1,
|
|
2408
|
-
...
|
|
2409
|
-
},
|
|
2410
|
-
const
|
|
2408
|
+
...P
|
|
2409
|
+
}, D) => {
|
|
2410
|
+
const L = at({
|
|
2411
2411
|
type: rt,
|
|
2412
2412
|
mode: r,
|
|
2413
2413
|
focusMode: a,
|
|
@@ -2421,13 +2421,13 @@ const tn = H.forwardRef(
|
|
|
2421
2421
|
labelLeft: d,
|
|
2422
2422
|
spacing: f,
|
|
2423
2423
|
noBackground: b,
|
|
2424
|
-
align:
|
|
2425
|
-
}),
|
|
2424
|
+
align: I
|
|
2425
|
+
}), M = y({
|
|
2426
2426
|
"text-copy-accent-dark": r === "light" && !i,
|
|
2427
2427
|
"text-copy-light": r === "dark" && !i,
|
|
2428
2428
|
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
|
|
2429
2429
|
"text-copy-light dark:text-copy-accent-dark": r === "system" && !i
|
|
2430
|
-
}),
|
|
2430
|
+
}), O = w ? y(
|
|
2431
2431
|
"relative",
|
|
2432
2432
|
"focus-within:static",
|
|
2433
2433
|
"focus-within:after:border-transparent",
|
|
@@ -2444,18 +2444,18 @@ const tn = H.forwardRef(
|
|
|
2444
2444
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
2445
2445
|
}
|
|
2446
2446
|
) : "";
|
|
2447
|
-
return /* @__PURE__ */ c("div", { className:
|
|
2448
|
-
|
|
2447
|
+
return /* @__PURE__ */ c("div", { className: O, children: /* @__PURE__ */ v(
|
|
2448
|
+
Ue,
|
|
2449
2449
|
{
|
|
2450
|
-
ref:
|
|
2451
|
-
className:
|
|
2450
|
+
ref: D,
|
|
2451
|
+
className: L,
|
|
2452
2452
|
disabled: t,
|
|
2453
2453
|
type: s,
|
|
2454
2454
|
"aria-label": h || p,
|
|
2455
|
-
...
|
|
2455
|
+
...P,
|
|
2456
2456
|
children: [
|
|
2457
2457
|
d && /* @__PURE__ */ c("span", { className: "pr-2", children: d }),
|
|
2458
|
-
/* @__PURE__ */ c("div", { className:
|
|
2458
|
+
/* @__PURE__ */ c("div", { className: M, children: e }),
|
|
2459
2459
|
l && /* @__PURE__ */ c("span", { className: "pl-2", children: l })
|
|
2460
2460
|
]
|
|
2461
2461
|
}
|
|
@@ -2464,21 +2464,21 @@ const tn = H.forwardRef(
|
|
|
2464
2464
|
);
|
|
2465
2465
|
tn.displayName = "ButtonSort";
|
|
2466
2466
|
/*!
|
|
2467
|
-
@versini/ui-card v1.0.
|
|
2467
|
+
@versini/ui-card v1.0.8
|
|
2468
2468
|
© 2024 gizmette.com
|
|
2469
2469
|
*/
|
|
2470
2470
|
try {
|
|
2471
2471
|
window.__VERSINI_UI_CARD__ || (window.__VERSINI_UI_CARD__ = {
|
|
2472
|
-
version: "1.0.
|
|
2473
|
-
buildTime: "09/
|
|
2472
|
+
version: "1.0.8",
|
|
2473
|
+
buildTime: "09/27/2024 11:55 AM EDT",
|
|
2474
2474
|
homepage: "https://github.com/aversini/ui-components",
|
|
2475
2475
|
license: "MIT"
|
|
2476
2476
|
});
|
|
2477
2477
|
} catch {
|
|
2478
2478
|
}
|
|
2479
|
-
const
|
|
2479
|
+
const Ne = "av-card";
|
|
2480
2480
|
function rn(e) {
|
|
2481
|
-
const t =
|
|
2481
|
+
const t = At();
|
|
2482
2482
|
return `${e}${t}`;
|
|
2483
2483
|
}
|
|
2484
2484
|
const an = (e) => {
|
|
@@ -2500,8 +2500,8 @@ const an = (e) => {
|
|
|
2500
2500
|
compact: s,
|
|
2501
2501
|
noBorder: i
|
|
2502
2502
|
}) => {
|
|
2503
|
-
const u =
|
|
2504
|
-
|
|
2503
|
+
const u = y(
|
|
2504
|
+
Ne,
|
|
2505
2505
|
e,
|
|
2506
2506
|
"rounded-md",
|
|
2507
2507
|
an(n),
|
|
@@ -2516,7 +2516,7 @@ const an = (e) => {
|
|
|
2516
2516
|
"border-border-dark bg-surface-lighter text-copy-dark dark:border-border-accent dark:bg-surface-dark dark:text-copy-light": o === "system",
|
|
2517
2517
|
"border-border-accent bg-surface-dark text-copy-light dark:border-border-dark dark:bg-surface-lighter dark:text-copy-dark": o === "alt-system"
|
|
2518
2518
|
}
|
|
2519
|
-
), h = t ||
|
|
2519
|
+
), h = t || y(`${Ne}__header mt-0 border-b-2`, {
|
|
2520
2520
|
"text-copy-light border-border-accent": o === "darker",
|
|
2521
2521
|
"border-border-accent": o === "dark",
|
|
2522
2522
|
"border-border-medium": o === "light",
|
|
@@ -2524,7 +2524,7 @@ const an = (e) => {
|
|
|
2524
2524
|
"border-border-accent dark:border-border-medium": o === "alt-system",
|
|
2525
2525
|
"mb-4": !s,
|
|
2526
2526
|
"mb-2": s
|
|
2527
|
-
}), p =
|
|
2527
|
+
}), p = y(r), m = a || y(`${Ne}__footer pt-2`);
|
|
2528
2528
|
return {
|
|
2529
2529
|
wrapper: u,
|
|
2530
2530
|
header: h,
|
|
@@ -2556,7 +2556,7 @@ const sn = ({
|
|
|
2556
2556
|
...l
|
|
2557
2557
|
}) => {
|
|
2558
2558
|
let d = null, f = null;
|
|
2559
|
-
const b = typeof e == "string",
|
|
2559
|
+
const b = typeof e == "string", I = rn(Ne), w = nn({
|
|
2560
2560
|
className: o,
|
|
2561
2561
|
headerClassName: t,
|
|
2562
2562
|
bodyClassName: s,
|
|
@@ -2566,7 +2566,7 @@ const sn = ({
|
|
|
2566
2566
|
compact: p,
|
|
2567
2567
|
noBorder: m
|
|
2568
2568
|
});
|
|
2569
|
-
return b ? (d =
|
|
2569
|
+
return b ? (d = I, f = d) : !b && e && i ? (d = null, f = i) : !b && e && !i ? (d = I, f = d) : (d = null, f = i || null), /* @__PURE__ */ c("div", { className: w.wrapper, children: /* @__PURE__ */ v(
|
|
2570
2570
|
"section",
|
|
2571
2571
|
{
|
|
2572
2572
|
...f && {
|
|
@@ -2598,7 +2598,7 @@ const sn = ({
|
|
|
2598
2598
|
(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(" ");
|
|
2599
2599
|
}
|
|
2600
2600
|
return t;
|
|
2601
|
-
},
|
|
2601
|
+
}, Ke = ({
|
|
2602
2602
|
children: e,
|
|
2603
2603
|
fill: t,
|
|
2604
2604
|
viewBox: r,
|
|
@@ -2610,11 +2610,11 @@ const sn = ({
|
|
|
2610
2610
|
semantic: u = !1,
|
|
2611
2611
|
...h
|
|
2612
2612
|
}) => {
|
|
2613
|
-
const p = cn(s), m =
|
|
2613
|
+
const p = cn(s), m = y(
|
|
2614
2614
|
p,
|
|
2615
2615
|
a || o
|
|
2616
2616
|
);
|
|
2617
|
-
return /* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ v(ye, { children: [
|
|
2618
2618
|
/* @__PURE__ */ c(
|
|
2619
2619
|
"svg",
|
|
2620
2620
|
{
|
|
@@ -2633,13 +2633,13 @@ const sn = ({
|
|
|
2633
2633
|
] });
|
|
2634
2634
|
};
|
|
2635
2635
|
/*!
|
|
2636
|
-
@versini/ui-private v1.4.
|
|
2636
|
+
@versini/ui-private v1.4.17
|
|
2637
2637
|
© 2024 gizmette.com
|
|
2638
2638
|
*/
|
|
2639
2639
|
try {
|
|
2640
2640
|
window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
|
|
2641
|
-
version: "1.4.
|
|
2642
|
-
buildTime: "09/
|
|
2641
|
+
version: "1.4.17",
|
|
2642
|
+
buildTime: "09/27/2024 11:55 AM EDT",
|
|
2643
2643
|
homepage: "https://github.com/aversini/ui-components",
|
|
2644
2644
|
license: "MIT"
|
|
2645
2645
|
});
|
|
@@ -2651,7 +2651,7 @@ const ln = ({
|
|
|
2651
2651
|
spacing: r,
|
|
2652
2652
|
...a
|
|
2653
2653
|
}) => /* @__PURE__ */ c(
|
|
2654
|
-
|
|
2654
|
+
Ke,
|
|
2655
2655
|
{
|
|
2656
2656
|
defaultViewBox: "0 0 1200 500",
|
|
2657
2657
|
defaultClassName: "w-full",
|
|
@@ -2677,8 +2677,8 @@ const ln = ({
|
|
|
2677
2677
|
title: a,
|
|
2678
2678
|
monotone: n,
|
|
2679
2679
|
...o
|
|
2680
|
-
}) => /* @__PURE__ */
|
|
2681
|
-
|
|
2680
|
+
}) => /* @__PURE__ */ v(
|
|
2681
|
+
Ke,
|
|
2682
2682
|
{
|
|
2683
2683
|
defaultViewBox: "0 0 640 512",
|
|
2684
2684
|
defaultClassName: "size-5",
|
|
@@ -2707,10 +2707,10 @@ const ln = ({
|
|
|
2707
2707
|
...o
|
|
2708
2708
|
}) => {
|
|
2709
2709
|
const s = n ? "1" : "0.4";
|
|
2710
|
-
return /* @__PURE__ */
|
|
2711
|
-
|
|
2710
|
+
return /* @__PURE__ */ v(
|
|
2711
|
+
Ke,
|
|
2712
2712
|
{
|
|
2713
|
-
defaultViewBox: "0 0
|
|
2713
|
+
defaultViewBox: "0 0 190 190",
|
|
2714
2714
|
defaultClassName: "size-5",
|
|
2715
2715
|
viewBox: t,
|
|
2716
2716
|
className: e,
|
|
@@ -2744,8 +2744,8 @@ const ln = ({
|
|
|
2744
2744
|
title: a,
|
|
2745
2745
|
monotone: n,
|
|
2746
2746
|
...o
|
|
2747
|
-
}) => /* @__PURE__ */
|
|
2748
|
-
|
|
2747
|
+
}) => /* @__PURE__ */ v(
|
|
2748
|
+
Ke,
|
|
2749
2749
|
{
|
|
2750
2750
|
defaultViewBox: "0 0 576 512",
|
|
2751
2751
|
defaultClassName: "size-5",
|
|
@@ -2767,26 +2767,26 @@ const ln = ({
|
|
|
2767
2767
|
}
|
|
2768
2768
|
);
|
|
2769
2769
|
/*!
|
|
2770
|
-
@versini/ui-icons v1.
|
|
2770
|
+
@versini/ui-icons v1.13.1
|
|
2771
2771
|
© 2024 gizmette.com
|
|
2772
2772
|
*/
|
|
2773
2773
|
try {
|
|
2774
2774
|
window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
|
|
2775
|
-
version: "1.
|
|
2776
|
-
buildTime: "09/
|
|
2775
|
+
version: "1.13.1",
|
|
2776
|
+
buildTime: "09/27/2024 11:55 AM EDT",
|
|
2777
2777
|
homepage: "https://github.com/aversini/ui-components",
|
|
2778
2778
|
license: "MIT"
|
|
2779
2779
|
});
|
|
2780
2780
|
} catch {
|
|
2781
2781
|
}
|
|
2782
2782
|
/*!
|
|
2783
|
-
@versini/ui-main v1.0.
|
|
2783
|
+
@versini/ui-main v1.0.8
|
|
2784
2784
|
© 2024 gizmette.com
|
|
2785
2785
|
*/
|
|
2786
2786
|
try {
|
|
2787
2787
|
window.__VERSINI_UI_MAIN__ || (window.__VERSINI_UI_MAIN__ = {
|
|
2788
|
-
version: "1.0.
|
|
2789
|
-
buildTime: "09/
|
|
2788
|
+
version: "1.0.8",
|
|
2789
|
+
buildTime: "09/27/2024 11:55 AM EDT",
|
|
2790
2790
|
homepage: "https://github.com/aversini/ui-components",
|
|
2791
2791
|
license: "MIT"
|
|
2792
2792
|
});
|
|
@@ -2807,7 +2807,7 @@ const hn = "av-main", pn = (e) => {
|
|
|
2807
2807
|
raw: r = !1,
|
|
2808
2808
|
spacing: a
|
|
2809
2809
|
}) => {
|
|
2810
|
-
const n =
|
|
2810
|
+
const n = y(t, hn, pn(a), {
|
|
2811
2811
|
"mt-2 flex w-full flex-col p-2 sm:mt-3 md:mx-auto md:max-w-4xl": !r
|
|
2812
2812
|
});
|
|
2813
2813
|
return /* @__PURE__ */ c("main", { className: n, children: e });
|
|
@@ -2820,10 +2820,10 @@ const hn = "av-main", pn = (e) => {
|
|
|
2820
2820
|
(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(" ");
|
|
2821
2821
|
}
|
|
2822
2822
|
return t;
|
|
2823
|
-
}, yn = "av-flexgrid",
|
|
2823
|
+
}, yn = "av-flexgrid", _e = "av-flexgrid-item", De = 0.25, er = W.createContext({
|
|
2824
2824
|
columnGap: 0,
|
|
2825
2825
|
rowGap: 0
|
|
2826
|
-
}),
|
|
2826
|
+
}), Tt = ({
|
|
2827
2827
|
children: e,
|
|
2828
2828
|
className: t,
|
|
2829
2829
|
columnGap: r = 1,
|
|
@@ -2847,15 +2847,15 @@ const hn = "av-main", pn = (e) => {
|
|
|
2847
2847
|
* by the columnGap and rowGap that will be applied
|
|
2848
2848
|
* to all FlexgridItems (see context and paddings).
|
|
2849
2849
|
*/
|
|
2850
|
-
marginLeft: r * -1 *
|
|
2851
|
-
marginTop: a * -1 *
|
|
2852
|
-
}, l =
|
|
2850
|
+
marginLeft: r * -1 * De + "rem",
|
|
2851
|
+
marginTop: a * -1 * De + "rem"
|
|
2852
|
+
}, l = y(
|
|
2853
2853
|
yn,
|
|
2854
2854
|
t,
|
|
2855
2855
|
"box-border flex flex-wrap"
|
|
2856
|
-
), d = { columnGap: r, rowGap: a }, f = h ? "div" :
|
|
2857
|
-
return /* @__PURE__ */ c(f, { ...h ? { className: fn(h) } : {}, children: /* @__PURE__ */ c("div", { className: l, style: m, ...p, children: /* @__PURE__ */ c(
|
|
2858
|
-
}, ze = (e, t) =>
|
|
2856
|
+
), d = { columnGap: r, rowGap: a }, f = h ? "div" : W.Fragment;
|
|
2857
|
+
return /* @__PURE__ */ c(f, { ...h ? { className: fn(h) } : {}, children: /* @__PURE__ */ c("div", { className: l, style: m, ...p, children: /* @__PURE__ */ c(er.Provider, { value: d, children: e }) }) });
|
|
2858
|
+
}, ze = (e, t) => y({
|
|
2859
2859
|
"basis-1/12": e === 1 && !t,
|
|
2860
2860
|
"sm:basis-1/12": e === 1 && t === "sm",
|
|
2861
2861
|
"md:basis-1/12": e === 1 && t === "md",
|
|
@@ -2933,33 +2933,33 @@ const hn = "av-main", pn = (e) => {
|
|
|
2933
2933
|
span: t
|
|
2934
2934
|
}) => {
|
|
2935
2935
|
if (!t)
|
|
2936
|
-
return
|
|
2936
|
+
return y(e, _e, "box-border basis-auto");
|
|
2937
2937
|
if (typeof t == "number")
|
|
2938
|
-
return
|
|
2938
|
+
return y(e, _e, "box-border max-w-full", {
|
|
2939
2939
|
[`${ze(t)}`]: !0
|
|
2940
2940
|
});
|
|
2941
2941
|
if (typeof t == "string")
|
|
2942
|
-
return
|
|
2942
|
+
return y(e, _e, "box-border basis-auto", {
|
|
2943
2943
|
"max-w-full grow": t === "auto"
|
|
2944
2944
|
});
|
|
2945
2945
|
if (typeof t == "object") {
|
|
2946
2946
|
const r = Object.entries(t).map(([a, n]) => a === "fallback" ? ze(n) : ze(n, a));
|
|
2947
|
-
return
|
|
2947
|
+
return y(
|
|
2948
2948
|
e,
|
|
2949
|
-
|
|
2949
|
+
_e,
|
|
2950
2950
|
"box-border",
|
|
2951
2951
|
r
|
|
2952
2952
|
);
|
|
2953
2953
|
}
|
|
2954
|
-
},
|
|
2954
|
+
}, le = ({
|
|
2955
2955
|
children: e,
|
|
2956
2956
|
className: t,
|
|
2957
2957
|
span: r,
|
|
2958
2958
|
...a
|
|
2959
2959
|
}) => {
|
|
2960
|
-
const { columnGap: n, rowGap: o } =
|
|
2961
|
-
paddingLeft: n *
|
|
2962
|
-
paddingTop: o *
|
|
2960
|
+
const { columnGap: n, rowGap: o } = kt(er), s = {
|
|
2961
|
+
paddingLeft: n * De + "rem",
|
|
2962
|
+
paddingTop: o * De + "rem"
|
|
2963
2963
|
}, i = bn({
|
|
2964
2964
|
className: t,
|
|
2965
2965
|
span: r
|
|
@@ -2967,21 +2967,21 @@ const hn = "av-main", pn = (e) => {
|
|
|
2967
2967
|
return /* @__PURE__ */ c("div", { className: i, style: s, ...a, children: e });
|
|
2968
2968
|
};
|
|
2969
2969
|
/*!
|
|
2970
|
-
@versini/ui-system v1.4.
|
|
2970
|
+
@versini/ui-system v1.4.19
|
|
2971
2971
|
© 2024 gizmette.com
|
|
2972
2972
|
*/
|
|
2973
2973
|
try {
|
|
2974
2974
|
window.__VERSINI_UI_SYSTEM__ || (window.__VERSINI_UI_SYSTEM__ = {
|
|
2975
|
-
version: "1.4.
|
|
2976
|
-
buildTime: "09/
|
|
2975
|
+
version: "1.4.19",
|
|
2976
|
+
buildTime: "09/27/2024 11:56 AM EDT",
|
|
2977
2977
|
homepage: "https://github.com/aversini/ui-components",
|
|
2978
2978
|
license: "MIT"
|
|
2979
2979
|
});
|
|
2980
2980
|
} catch {
|
|
2981
2981
|
}
|
|
2982
|
-
const
|
|
2982
|
+
const tr = "av-text-input", En = "av-text-input-wrapper", je = "av-text-input-helper-text";
|
|
2983
2983
|
function wn() {
|
|
2984
|
-
const e =
|
|
2984
|
+
const e = $(!1);
|
|
2985
2985
|
return q(() => (e.current = !0, () => {
|
|
2986
2986
|
e.current = !1;
|
|
2987
2987
|
}), []), z(() => e.current, []);
|
|
@@ -2996,8 +2996,8 @@ const Tn = {
|
|
|
2996
2996
|
bottom: 0,
|
|
2997
2997
|
right: 0
|
|
2998
2998
|
};
|
|
2999
|
-
function
|
|
3000
|
-
const t = wn(), r =
|
|
2999
|
+
function vn(e) {
|
|
3000
|
+
const t = wn(), r = $(0), a = $(null), [n, o] = F(Tn), s = St(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
|
|
3001
3001
|
const u = i[0];
|
|
3002
3002
|
u && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
3003
3003
|
a.current && t() && o(u.contentRect);
|
|
@@ -3007,8 +3007,8 @@ function In(e) {
|
|
|
3007
3007
|
s == null || s.disconnect(), r.current && cancelAnimationFrame(r.current);
|
|
3008
3008
|
}), [s, e]), [a, n];
|
|
3009
3009
|
}
|
|
3010
|
-
function
|
|
3011
|
-
const t =
|
|
3010
|
+
function In(e) {
|
|
3011
|
+
const t = At();
|
|
3012
3012
|
if (!e)
|
|
3013
3013
|
return t;
|
|
3014
3014
|
if (typeof e == "number" || typeof e == "string")
|
|
@@ -3018,7 +3018,7 @@ function vn(e) {
|
|
|
3018
3018
|
return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
|
|
3019
3019
|
}
|
|
3020
3020
|
}
|
|
3021
|
-
const
|
|
3021
|
+
const rr = "SET_ANNOUNCEMENT", ar = "CLEAR_ANNOUNCEMENT", kn = {
|
|
3022
3022
|
alert: null,
|
|
3023
3023
|
alertdialog: null,
|
|
3024
3024
|
log: "polite",
|
|
@@ -3026,14 +3026,14 @@ const tr = "SET_ANNOUNCEMENT", rr = "CLEAR_ANNOUNCEMENT", Sn = {
|
|
|
3026
3026
|
progressbar: null,
|
|
3027
3027
|
status: "polite",
|
|
3028
3028
|
timer: "assertive"
|
|
3029
|
-
},
|
|
3029
|
+
}, An = (e, t) => {
|
|
3030
3030
|
switch (t == null ? void 0 : t.type) {
|
|
3031
|
-
case
|
|
3031
|
+
case rr:
|
|
3032
3032
|
return {
|
|
3033
3033
|
...e,
|
|
3034
3034
|
announcement: t.payload
|
|
3035
3035
|
};
|
|
3036
|
-
case
|
|
3036
|
+
case ar:
|
|
3037
3037
|
return {
|
|
3038
3038
|
...e,
|
|
3039
3039
|
announcement: null
|
|
@@ -3041,14 +3041,14 @@ const tr = "SET_ANNOUNCEMENT", rr = "CLEAR_ANNOUNCEMENT", Sn = {
|
|
|
3041
3041
|
default:
|
|
3042
3042
|
return e;
|
|
3043
3043
|
}
|
|
3044
|
-
},
|
|
3044
|
+
}, Sn = ({
|
|
3045
3045
|
onAnnouncementClear: e,
|
|
3046
3046
|
dispatch: t
|
|
3047
3047
|
}) => {
|
|
3048
3048
|
t({
|
|
3049
|
-
type:
|
|
3049
|
+
type: ar
|
|
3050
3050
|
}), typeof e == "function" && e();
|
|
3051
|
-
},
|
|
3051
|
+
}, vt = ({
|
|
3052
3052
|
children: e,
|
|
3053
3053
|
clearAnnouncementDelay: t,
|
|
3054
3054
|
clearAnnouncementTimeoutRef: r,
|
|
@@ -3056,10 +3056,10 @@ const tr = "SET_ANNOUNCEMENT", rr = "CLEAR_ANNOUNCEMENT", Sn = {
|
|
|
3056
3056
|
dispatch: n
|
|
3057
3057
|
}) => {
|
|
3058
3058
|
(r == null ? void 0 : r.current) !== null && clearTimeout(r.current), e !== null && n({
|
|
3059
|
-
type:
|
|
3059
|
+
type: rr,
|
|
3060
3060
|
payload: e
|
|
3061
3061
|
}), t && (r.current = setTimeout(
|
|
3062
|
-
() =>
|
|
3062
|
+
() => Sn({
|
|
3063
3063
|
onAnnouncementClear: a,
|
|
3064
3064
|
dispatch: n
|
|
3065
3065
|
}),
|
|
@@ -3074,13 +3074,13 @@ const tr = "SET_ANNOUNCEMENT", rr = "CLEAR_ANNOUNCEMENT", Sn = {
|
|
|
3074
3074
|
onAnnouncementClear: o,
|
|
3075
3075
|
dispatch: s
|
|
3076
3076
|
}) => {
|
|
3077
|
-
clearTimeout(t.current), r ? t.current = setTimeout(
|
|
3077
|
+
clearTimeout(t.current), r ? t.current = setTimeout(vt, r, {
|
|
3078
3078
|
children: e,
|
|
3079
3079
|
clearAnnouncementDelay: a,
|
|
3080
3080
|
clearAnnouncementTimeoutRef: n,
|
|
3081
3081
|
onAnnouncementClear: o,
|
|
3082
3082
|
dispatch: s
|
|
3083
|
-
}) :
|
|
3083
|
+
}) : vt({
|
|
3084
3084
|
children: e,
|
|
3085
3085
|
clearAnnouncementDelay: a,
|
|
3086
3086
|
clearAnnouncementTimeoutRef: n,
|
|
@@ -3088,7 +3088,7 @@ const tr = "SET_ANNOUNCEMENT", rr = "CLEAR_ANNOUNCEMENT", Sn = {
|
|
|
3088
3088
|
dispatch: s
|
|
3089
3089
|
});
|
|
3090
3090
|
};
|
|
3091
|
-
function
|
|
3091
|
+
function nr({
|
|
3092
3092
|
children: e,
|
|
3093
3093
|
className: t,
|
|
3094
3094
|
politeness: r,
|
|
@@ -3099,11 +3099,11 @@ function ar({
|
|
|
3099
3099
|
visible: i,
|
|
3100
3100
|
...u
|
|
3101
3101
|
}) {
|
|
3102
|
-
const h =
|
|
3102
|
+
const h = $(), p = $(), [m, l] = It(An, {
|
|
3103
3103
|
announcement: null
|
|
3104
3104
|
});
|
|
3105
3105
|
let d = r;
|
|
3106
|
-
typeof d > "u" && (d = a ?
|
|
3106
|
+
typeof d > "u" && (d = a ? kn[a] : "assertive"), q(() => {
|
|
3107
3107
|
_n({
|
|
3108
3108
|
announcementTimeoutRef: h,
|
|
3109
3109
|
announcementDelay: n,
|
|
@@ -3119,7 +3119,7 @@ function ar({
|
|
|
3119
3119
|
o,
|
|
3120
3120
|
s
|
|
3121
3121
|
]);
|
|
3122
|
-
const f =
|
|
3122
|
+
const f = y(t, {
|
|
3123
3123
|
"sr-only": !i
|
|
3124
3124
|
});
|
|
3125
3125
|
return /* @__PURE__ */ c(
|
|
@@ -3144,13 +3144,13 @@ const Rn = (e) => {
|
|
|
3144
3144
|
return t;
|
|
3145
3145
|
};
|
|
3146
3146
|
/*!
|
|
3147
|
-
@versini/ui-private v1.4.
|
|
3147
|
+
@versini/ui-private v1.4.17
|
|
3148
3148
|
© 2024 gizmette.com
|
|
3149
3149
|
*/
|
|
3150
3150
|
try {
|
|
3151
3151
|
window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
|
|
3152
|
-
version: "1.4.
|
|
3153
|
-
buildTime: "09/
|
|
3152
|
+
version: "1.4.17",
|
|
3153
|
+
buildTime: "09/28/2024 06:57 PM EDT",
|
|
3154
3154
|
homepage: "https://github.com/aversini/ui-components",
|
|
3155
3155
|
license: "MIT"
|
|
3156
3156
|
});
|
|
@@ -3158,22 +3158,22 @@ try {
|
|
|
3158
3158
|
}
|
|
3159
3159
|
const Nn = ({
|
|
3160
3160
|
mode: e
|
|
3161
|
-
}) =>
|
|
3161
|
+
}) => y({
|
|
3162
3162
|
"bg-surface-darker text-copy-lighter caret-copy-light": e === "dark",
|
|
3163
3163
|
"bg-surface-lighter text-copy-dark caret-copy-dark": e === "light",
|
|
3164
3164
|
"bg-surface-lighter text-copy-dark caret-copy-dark dark:bg-surface-darker dark:text-copy-lighter dark:caret-copy-light": e === "system",
|
|
3165
3165
|
"bg-surface-darker text-copy-lighter caret-copy-light dark:bg-surface-lighter dark:text-copy-dark dark:caret-copy-dark": e === "alt-system"
|
|
3166
|
-
}),
|
|
3166
|
+
}), xn = ({
|
|
3167
3167
|
focusMode: e
|
|
3168
|
-
}) =>
|
|
3168
|
+
}) => y("focus:outline focus:outline-2 focus:outline-offset-2", {
|
|
3169
3169
|
"focus:outline-focus-dark": e === "dark",
|
|
3170
3170
|
"focus:outline-focus-light": e === "light",
|
|
3171
3171
|
"focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
|
|
3172
3172
|
"focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
|
|
3173
|
-
}),
|
|
3173
|
+
}), Cn = ({
|
|
3174
3174
|
noBorder: e,
|
|
3175
3175
|
error: t
|
|
3176
|
-
}) =>
|
|
3176
|
+
}) => y("border-2", {
|
|
3177
3177
|
"border-border-dark": !e && !t,
|
|
3178
3178
|
"focus:border-border-dark": !e && t,
|
|
3179
3179
|
"border-border-error-dark": !e && t,
|
|
@@ -3187,16 +3187,16 @@ const Nn = ({
|
|
|
3187
3187
|
if (t)
|
|
3188
3188
|
return "";
|
|
3189
3189
|
if (e)
|
|
3190
|
-
return
|
|
3190
|
+
return y("absolute px-2 cursor-not-allowed opacity-50 font-medium");
|
|
3191
3191
|
if (!r)
|
|
3192
|
-
return
|
|
3192
|
+
return y("absolute px-2 cursor-text font-medium", {
|
|
3193
3193
|
"text-copy-lighter": a === "dark",
|
|
3194
3194
|
"text-copy-dark": a === "light",
|
|
3195
3195
|
"text-copy-dark dark:text-copy-lighter": a === "system",
|
|
3196
3196
|
"text-copy-lighter dark:text-copy-dark": a === "alt-system"
|
|
3197
3197
|
});
|
|
3198
3198
|
if (r)
|
|
3199
|
-
return
|
|
3199
|
+
return y("absolute px-2 cursor-text font-medium", {
|
|
3200
3200
|
"text-copy-lighter": a === "dark",
|
|
3201
3201
|
"text-copy-error-dark": a === "light",
|
|
3202
3202
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": a === "system",
|
|
@@ -3211,19 +3211,19 @@ const Nn = ({
|
|
|
3211
3211
|
if (t)
|
|
3212
3212
|
return "";
|
|
3213
3213
|
if (a)
|
|
3214
|
-
return
|
|
3214
|
+
return y(
|
|
3215
3215
|
je,
|
|
3216
3216
|
"absolute px-2 cursor-not-allowed opacity-50 font-medium"
|
|
3217
3217
|
);
|
|
3218
3218
|
if (!e)
|
|
3219
|
-
return
|
|
3219
|
+
return y(je, "absolute px-2 font-medium", {
|
|
3220
3220
|
"text-copy-lighter": r === "dark",
|
|
3221
3221
|
"text-copy-dark": r === "light",
|
|
3222
3222
|
"text-copy-dark dark:text-copy-lighter": r === "system",
|
|
3223
3223
|
"text-copy-lighter dark:text-copy-dark": r === "alt-system"
|
|
3224
3224
|
});
|
|
3225
3225
|
if (e)
|
|
3226
|
-
return
|
|
3226
|
+
return y(je, "absolute px-2 font-medium", {
|
|
3227
3227
|
"text-copy-error-light bg-surface-darker": r === "dark",
|
|
3228
3228
|
"text-copy-error-dark": r === "light",
|
|
3229
3229
|
"text-copy-error-dark dark:text-copy-error-light dark:bg-surface-darker": r === "system",
|
|
@@ -3238,43 +3238,64 @@ const Nn = ({
|
|
|
3238
3238
|
error: o,
|
|
3239
3239
|
spacing: s,
|
|
3240
3240
|
mode: i,
|
|
3241
|
-
focusMode: u
|
|
3241
|
+
focusMode: u,
|
|
3242
|
+
size: h
|
|
3242
3243
|
}) => {
|
|
3243
|
-
const
|
|
3244
|
+
const p = r ? e : y(
|
|
3244
3245
|
"relative flex w-full flex-col justify-center",
|
|
3245
3246
|
En,
|
|
3246
3247
|
e,
|
|
3247
3248
|
Rn(s)
|
|
3248
|
-
)
|
|
3249
|
-
|
|
3249
|
+
);
|
|
3250
|
+
let m = "";
|
|
3251
|
+
switch (h) {
|
|
3252
|
+
case "xs":
|
|
3253
|
+
m = "h-8";
|
|
3254
|
+
break;
|
|
3255
|
+
case "sm":
|
|
3256
|
+
m = "h-10";
|
|
3257
|
+
break;
|
|
3258
|
+
case "lg":
|
|
3259
|
+
m = "h-14";
|
|
3260
|
+
break;
|
|
3261
|
+
case "xl":
|
|
3262
|
+
m = "h-16";
|
|
3263
|
+
break;
|
|
3264
|
+
default:
|
|
3265
|
+
m = "h-12";
|
|
3266
|
+
break;
|
|
3267
|
+
}
|
|
3268
|
+
const l = r ? y(t) : y(
|
|
3269
|
+
tr,
|
|
3250
3270
|
t,
|
|
3251
|
-
|
|
3271
|
+
m,
|
|
3272
|
+
"rounded-md text-base px-4",
|
|
3252
3273
|
Nn({ mode: i }),
|
|
3253
|
-
|
|
3254
|
-
|
|
3274
|
+
xn({ focusMode: u }),
|
|
3275
|
+
Cn({ noBorder: n, error: o }),
|
|
3255
3276
|
{
|
|
3256
3277
|
"disabled:cursor-not-allowed disabled:opacity-50": a
|
|
3257
3278
|
}
|
|
3258
|
-
),
|
|
3279
|
+
), d = r ? void 0 : "sr-only", f = On({
|
|
3259
3280
|
disabled: a,
|
|
3260
3281
|
raw: r,
|
|
3261
3282
|
error: o,
|
|
3262
3283
|
mode: i
|
|
3263
|
-
}),
|
|
3284
|
+
}), b = Pn({
|
|
3264
3285
|
error: o,
|
|
3265
3286
|
raw: r,
|
|
3266
3287
|
mode: i,
|
|
3267
3288
|
disabled: a
|
|
3268
3289
|
});
|
|
3269
3290
|
return {
|
|
3270
|
-
wrapper:
|
|
3271
|
-
input:
|
|
3272
|
-
accessibleLabel:
|
|
3273
|
-
visibleLabel:
|
|
3274
|
-
helperText:
|
|
3291
|
+
wrapper: p,
|
|
3292
|
+
input: l,
|
|
3293
|
+
accessibleLabel: d,
|
|
3294
|
+
visibleLabel: f,
|
|
3295
|
+
helperText: b,
|
|
3275
3296
|
rightElement: r ? void 0 : "absolute right-3"
|
|
3276
3297
|
};
|
|
3277
|
-
}, nt =
|
|
3298
|
+
}, nt = W.forwardRef(
|
|
3278
3299
|
({
|
|
3279
3300
|
id: e,
|
|
3280
3301
|
name: t,
|
|
@@ -3292,10 +3313,17 @@ const Nn = ({
|
|
|
3292
3313
|
type: d = "text",
|
|
3293
3314
|
helperText: f = "",
|
|
3294
3315
|
rightElement: b,
|
|
3295
|
-
spacing:
|
|
3296
|
-
|
|
3316
|
+
spacing: I,
|
|
3317
|
+
size: w = "md",
|
|
3318
|
+
...P
|
|
3297
3319
|
}, D) => {
|
|
3298
|
-
const [L,
|
|
3320
|
+
const [L, M] = vn(), [O, G] = F(0), R = In({ id: e, prefix: `${tr}-` }), pe = `${t} error, ${f}`, X = $(null), Q = $(null), C = {
|
|
3321
|
+
xs: { label: "-25px", helperText: "30px" },
|
|
3322
|
+
sm: { label: "-29px", helperText: "34px" },
|
|
3323
|
+
md: { label: "-33px", helperText: "38px" },
|
|
3324
|
+
lg: { label: "-15px", helperText: "22px" },
|
|
3325
|
+
xl: { label: "-19px", helperText: "25px" }
|
|
3326
|
+
}, N = Dn({
|
|
3299
3327
|
className: o,
|
|
3300
3328
|
inputClassName: s,
|
|
3301
3329
|
error: a,
|
|
@@ -3303,18 +3331,26 @@ const Nn = ({
|
|
|
3303
3331
|
focusMode: u,
|
|
3304
3332
|
disabled: h,
|
|
3305
3333
|
noBorder: p,
|
|
3306
|
-
spacing:
|
|
3307
|
-
mode: i
|
|
3334
|
+
spacing: I,
|
|
3335
|
+
mode: i,
|
|
3336
|
+
size: w
|
|
3308
3337
|
});
|
|
3309
|
-
return
|
|
3310
|
-
|
|
3311
|
-
}, [
|
|
3338
|
+
return st(() => {
|
|
3339
|
+
M && M.width && G(M.width + 18 + 10);
|
|
3340
|
+
}, [M]), st(() => {
|
|
3341
|
+
var ee, g;
|
|
3342
|
+
const { label: T, helperText: E } = C[w];
|
|
3343
|
+
(ee = X == null ? void 0 : X.current) == null || ee.style.setProperty("--av-text-input-label", T), (g = Q == null ? void 0 : Q.current) == null || g.style.setProperty(
|
|
3344
|
+
"--av-text-input-helper-text",
|
|
3345
|
+
E
|
|
3346
|
+
);
|
|
3347
|
+
}, [w]), /* @__PURE__ */ v("div", { className: N.wrapper, children: [
|
|
3312
3348
|
/* @__PURE__ */ c(
|
|
3313
3349
|
"label",
|
|
3314
3350
|
{
|
|
3315
|
-
htmlFor:
|
|
3351
|
+
htmlFor: R,
|
|
3316
3352
|
id: m,
|
|
3317
|
-
className:
|
|
3353
|
+
className: N.accessibleLabel,
|
|
3318
3354
|
children: r
|
|
3319
3355
|
}
|
|
3320
3356
|
),
|
|
@@ -3322,32 +3358,34 @@ const Nn = ({
|
|
|
3322
3358
|
"input",
|
|
3323
3359
|
{
|
|
3324
3360
|
ref: D,
|
|
3325
|
-
id:
|
|
3361
|
+
id: R,
|
|
3326
3362
|
name: t,
|
|
3327
3363
|
type: d,
|
|
3328
3364
|
disabled: h,
|
|
3329
3365
|
placeholder: n ? void 0 : " ",
|
|
3330
|
-
className:
|
|
3331
|
-
...f && { "aria-describedby": `${
|
|
3366
|
+
className: N.input,
|
|
3367
|
+
...f && { "aria-describedby": `${R}-helper` },
|
|
3332
3368
|
...a && { "aria-invalid": "true" },
|
|
3333
|
-
...b && !n && { style: { paddingRight:
|
|
3334
|
-
...
|
|
3369
|
+
...b && !n && { style: { paddingRight: O } },
|
|
3370
|
+
...P
|
|
3335
3371
|
}
|
|
3336
3372
|
),
|
|
3337
3373
|
!n && !l && /* @__PURE__ */ c(
|
|
3338
3374
|
"label",
|
|
3339
3375
|
{
|
|
3376
|
+
ref: X,
|
|
3340
3377
|
"aria-hidden": !0,
|
|
3341
|
-
htmlFor:
|
|
3342
|
-
className:
|
|
3378
|
+
htmlFor: R,
|
|
3379
|
+
className: N.visibleLabel,
|
|
3343
3380
|
children: r
|
|
3344
3381
|
}
|
|
3345
3382
|
),
|
|
3346
3383
|
f && /* @__PURE__ */ c(
|
|
3347
3384
|
"div",
|
|
3348
3385
|
{
|
|
3349
|
-
|
|
3350
|
-
|
|
3386
|
+
ref: Q,
|
|
3387
|
+
id: `${R}-helper`,
|
|
3388
|
+
className: N.helperText,
|
|
3351
3389
|
children: f
|
|
3352
3390
|
}
|
|
3353
3391
|
),
|
|
@@ -3355,24 +3393,24 @@ const Nn = ({
|
|
|
3355
3393
|
"div",
|
|
3356
3394
|
{
|
|
3357
3395
|
ref: L,
|
|
3358
|
-
className:
|
|
3396
|
+
className: N.rightElement,
|
|
3359
3397
|
children: b
|
|
3360
3398
|
}
|
|
3361
3399
|
),
|
|
3362
|
-
a && f && /* @__PURE__ */ c(
|
|
3400
|
+
a && f && /* @__PURE__ */ c(nr, { politeness: "polite", clearAnnouncementDelay: 500, children: pe })
|
|
3363
3401
|
] });
|
|
3364
3402
|
}
|
|
3365
3403
|
);
|
|
3366
3404
|
nt.displayName = "TextInput";
|
|
3367
|
-
function
|
|
3368
|
-
return
|
|
3405
|
+
function $n(e) {
|
|
3406
|
+
return St(() => e.every((t) => t == null) ? () => {
|
|
3369
3407
|
} : (t) => {
|
|
3370
3408
|
e.forEach((r) => {
|
|
3371
3409
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
3372
3410
|
});
|
|
3373
3411
|
}, e);
|
|
3374
3412
|
}
|
|
3375
|
-
const
|
|
3413
|
+
const Ln = 500, Mn = 5e3, Un = 2e4, or = W.forwardRef(
|
|
3376
3414
|
({
|
|
3377
3415
|
name: e,
|
|
3378
3416
|
disabled: t,
|
|
@@ -3387,64 +3425,64 @@ const Mn = 500, Un = 5e3, Kn = 2e4, nr = H.forwardRef(
|
|
|
3387
3425
|
spacing: p,
|
|
3388
3426
|
...m
|
|
3389
3427
|
}, l) => {
|
|
3390
|
-
const [d, f] = F(!0), [b,
|
|
3428
|
+
const [d, f] = F(!0), [b, I] = F({
|
|
3391
3429
|
message: null,
|
|
3392
3430
|
politeness: null
|
|
3393
|
-
}), w =
|
|
3394
|
-
clearTimeout(
|
|
3395
|
-
w.current = !0, f(!0),
|
|
3396
|
-
announcementTimeout:
|
|
3431
|
+
}), w = $(!0), P = $(), D = $(null), L = $n([l, D]), M = d ? "Show" : "Hide", O = () => {
|
|
3432
|
+
clearTimeout(P.current), w.current || (P.current = window.setTimeout(() => {
|
|
3433
|
+
w.current = !0, f(!0), I({
|
|
3434
|
+
announcementTimeout: Mn,
|
|
3397
3435
|
politeness: "polite",
|
|
3398
3436
|
message: `${r} hiding characters`
|
|
3399
3437
|
}), n && n(!0);
|
|
3400
|
-
},
|
|
3401
|
-
},
|
|
3402
|
-
|
|
3403
|
-
const
|
|
3404
|
-
w.current =
|
|
3405
|
-
announcementTimeout:
|
|
3438
|
+
}, Un));
|
|
3439
|
+
}, G = (C) => {
|
|
3440
|
+
C.preventDefault();
|
|
3441
|
+
const N = !w.current;
|
|
3442
|
+
w.current = N, O(), f(N), I({
|
|
3443
|
+
announcementTimeout: Ln,
|
|
3406
3444
|
politeness: "assertive",
|
|
3407
|
-
message:
|
|
3408
|
-
}), n && n(
|
|
3409
|
-
},
|
|
3410
|
-
var
|
|
3411
|
-
const { relatedTarget:
|
|
3412
|
-
|
|
3413
|
-
},
|
|
3414
|
-
|
|
3415
|
-
},
|
|
3416
|
-
|
|
3417
|
-
},
|
|
3418
|
-
|
|
3445
|
+
message: N ? "Characters hidden" : "Characters showing"
|
|
3446
|
+
}), n && n(N);
|
|
3447
|
+
}, R = (C) => {
|
|
3448
|
+
var N;
|
|
3449
|
+
const { relatedTarget: ee } = C, g = (N = D.current) == null ? void 0 : N.parentElement;
|
|
3450
|
+
g != null && g.contains(ee) || u && u();
|
|
3451
|
+
}, pe = (C) => {
|
|
3452
|
+
O(), s && s(C), R(C);
|
|
3453
|
+
}, X = (C) => {
|
|
3454
|
+
O(), i && i(C);
|
|
3455
|
+
}, Q = (C) => {
|
|
3456
|
+
O(), o && o(C);
|
|
3419
3457
|
};
|
|
3420
3458
|
return q(() => () => {
|
|
3421
|
-
clearTimeout(
|
|
3422
|
-
}, []), /* @__PURE__ */
|
|
3459
|
+
clearTimeout(P.current);
|
|
3460
|
+
}, []), /* @__PURE__ */ v(ye, { children: [
|
|
3423
3461
|
/* @__PURE__ */ c(
|
|
3424
3462
|
nt,
|
|
3425
3463
|
{
|
|
3426
|
-
ref:
|
|
3464
|
+
ref: L,
|
|
3427
3465
|
name: e,
|
|
3428
3466
|
label: r,
|
|
3429
3467
|
labelHidden: a,
|
|
3430
3468
|
type: d ? "password" : "text",
|
|
3431
3469
|
disabled: t,
|
|
3432
3470
|
spacing: p,
|
|
3433
|
-
onBlur:
|
|
3434
|
-
onFocus:
|
|
3435
|
-
onChange:
|
|
3436
|
-
rightElement:
|
|
3471
|
+
onBlur: pe,
|
|
3472
|
+
onFocus: X,
|
|
3473
|
+
onChange: Q,
|
|
3474
|
+
rightElement: W.cloneElement(h, {
|
|
3437
3475
|
ref: l,
|
|
3438
|
-
label:
|
|
3439
|
-
onClick:
|
|
3440
|
-
onBlur:
|
|
3476
|
+
label: M,
|
|
3477
|
+
onClick: G,
|
|
3478
|
+
onBlur: R,
|
|
3441
3479
|
disabled: t
|
|
3442
3480
|
}),
|
|
3443
3481
|
...m
|
|
3444
3482
|
}
|
|
3445
3483
|
),
|
|
3446
3484
|
/* @__PURE__ */ c(
|
|
3447
|
-
|
|
3485
|
+
nr,
|
|
3448
3486
|
{
|
|
3449
3487
|
role: "status",
|
|
3450
3488
|
politeness: b.politeness,
|
|
@@ -3455,21 +3493,21 @@ const Mn = 500, Un = 5e3, Kn = 2e4, nr = H.forwardRef(
|
|
|
3455
3493
|
] });
|
|
3456
3494
|
}
|
|
3457
3495
|
);
|
|
3458
|
-
|
|
3496
|
+
or.displayName = "TextInputMask";
|
|
3459
3497
|
/*!
|
|
3460
|
-
@versini/ui-textinput v1.
|
|
3498
|
+
@versini/ui-textinput v1.1.6
|
|
3461
3499
|
© 2024 gizmette.com
|
|
3462
3500
|
*/
|
|
3463
3501
|
try {
|
|
3464
3502
|
window.__VERSINI_UI_TEXTINPUT__ || (window.__VERSINI_UI_TEXTINPUT__ = {
|
|
3465
|
-
version: "1.
|
|
3466
|
-
buildTime: "09/
|
|
3503
|
+
version: "1.1.6",
|
|
3504
|
+
buildTime: "09/28/2024 06:57 PM EDT",
|
|
3467
3505
|
homepage: "https://github.com/aversini/ui-components",
|
|
3468
3506
|
license: "MIT"
|
|
3469
3507
|
});
|
|
3470
3508
|
} catch {
|
|
3471
3509
|
}
|
|
3472
|
-
const
|
|
3510
|
+
const Kn = "ASK! ME! ANYTHING!", sr = "Sassy Saint", Hn = "gizmette.com", Wn = "Log in", Bn = "Sign in with a Passkey", Yo = "Log out", Gn = "Password", Vn = "Powered by OpenAI", Fo = "Send", zo = "Profile", jo = "Statistics", qo = "Chat history", Xo = "About", Qo = "Type your question here", Zo = "Clear chat", es = "Cancel chat", ts = "N/A", rs = {
|
|
3473
3511
|
TAGS: {
|
|
3474
3512
|
TITLE: "Pre-filled tags",
|
|
3475
3513
|
DESCRIPTION: "Tags are pre-filled buttons available on the main screen, to help you quickly start requests."
|
|
@@ -3509,13 +3547,13 @@ const $n = "ASK! ME! ANYTHING!", or = "Sassy Saint", Hn = "gizmette.com", Wn = "
|
|
|
3509
3547
|
}
|
|
3510
3548
|
};
|
|
3511
3549
|
/*!
|
|
3512
|
-
@versini/ui-footer v1.0.
|
|
3550
|
+
@versini/ui-footer v1.0.8
|
|
3513
3551
|
© 2024 gizmette.com
|
|
3514
3552
|
*/
|
|
3515
3553
|
try {
|
|
3516
3554
|
window.__VERSINI_UI_FOOTER__ || (window.__VERSINI_UI_FOOTER__ = {
|
|
3517
|
-
version: "1.0.
|
|
3518
|
-
buildTime: "09/
|
|
3555
|
+
version: "1.0.8",
|
|
3556
|
+
buildTime: "09/27/2024 11:55 AM EDT",
|
|
3519
3557
|
homepage: "https://github.com/aversini/ui-components",
|
|
3520
3558
|
license: "MIT"
|
|
3521
3559
|
});
|
|
@@ -3539,7 +3577,7 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3539
3577
|
spacing: o,
|
|
3540
3578
|
raw: s = !1
|
|
3541
3579
|
}) => {
|
|
3542
|
-
const i =
|
|
3580
|
+
const i = y(Jn, e, Yn(o), {
|
|
3543
3581
|
"text-copy-dark": !s && t === "dark",
|
|
3544
3582
|
"text-copy-lighter": !s && t === "light",
|
|
3545
3583
|
"text-copy-dark dark:text-copy-lighter": !s && t === "system",
|
|
@@ -3547,7 +3585,7 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3547
3585
|
"mb-[100px]": !n && !s,
|
|
3548
3586
|
"mt-0 flex w-full flex-col p-2 text-center text-xs sm:mt-3 md:mx-auto md:max-w-4xl": !s
|
|
3549
3587
|
});
|
|
3550
|
-
return /* @__PURE__ */
|
|
3588
|
+
return /* @__PURE__ */ v("footer", { className: i, children: [
|
|
3551
3589
|
r && /* @__PURE__ */ c("div", { children: r }),
|
|
3552
3590
|
a && /* @__PURE__ */ c("div", { children: a })
|
|
3553
3591
|
] });
|
|
@@ -3557,35 +3595,35 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3557
3595
|
Fn,
|
|
3558
3596
|
{
|
|
3559
3597
|
mode: "light",
|
|
3560
|
-
row1: /* @__PURE__ */
|
|
3561
|
-
|
|
3598
|
+
row1: /* @__PURE__ */ v("div", { children: [
|
|
3599
|
+
sr,
|
|
3562
3600
|
" v",
|
|
3563
|
-
"4.5.
|
|
3601
|
+
"4.5.2",
|
|
3564
3602
|
" - ",
|
|
3565
3603
|
Vn,
|
|
3566
3604
|
tt && e && e.models.length > 0 && e.models[0] === "development" ? " - Development Mode" : ""
|
|
3567
3605
|
] }),
|
|
3568
|
-
row2: /* @__PURE__ */
|
|
3606
|
+
row2: /* @__PURE__ */ v("div", { children: [
|
|
3569
3607
|
"© ",
|
|
3570
3608
|
(/* @__PURE__ */ new Date()).getFullYear(),
|
|
3571
3609
|
" ",
|
|
3572
3610
|
Hn
|
|
3573
3611
|
] })
|
|
3574
3612
|
}
|
|
3575
|
-
), jn =
|
|
3613
|
+
), jn = _t(
|
|
3576
3614
|
() => import(
|
|
3577
3615
|
/* webpackChunkName: "LazyHeader" */
|
|
3578
|
-
"./LazyHeader.
|
|
3616
|
+
"./LazyHeader.rYQgZPSI.js"
|
|
3579
3617
|
)
|
|
3580
3618
|
), qn = () => {
|
|
3581
3619
|
const { isAuthenticated: e } = et();
|
|
3582
|
-
return /* @__PURE__ */
|
|
3583
|
-
e && /* @__PURE__ */ c(
|
|
3584
|
-
/* @__PURE__ */
|
|
3620
|
+
return /* @__PURE__ */ v(ye, { children: [
|
|
3621
|
+
e && /* @__PURE__ */ c(Rt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(jn, {}) }),
|
|
3622
|
+
/* @__PURE__ */ v("div", { className: "flex items-center justify-center", children: [
|
|
3585
3623
|
/* @__PURE__ */ c("div", { className: "basis-1/4", children: /* @__PURE__ */ c(ln, {}) }),
|
|
3586
|
-
/* @__PURE__ */
|
|
3587
|
-
/* @__PURE__ */ c("h1", { children:
|
|
3588
|
-
/* @__PURE__ */ c("h2", { children:
|
|
3624
|
+
/* @__PURE__ */ v("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
|
|
3625
|
+
/* @__PURE__ */ c("h1", { children: sr }),
|
|
3626
|
+
/* @__PURE__ */ c("h2", { children: Kn })
|
|
3589
3627
|
] })
|
|
3590
3628
|
] })
|
|
3591
3629
|
] });
|
|
@@ -3604,13 +3642,13 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3604
3642
|
}, 500);
|
|
3605
3643
|
}), q(() => {
|
|
3606
3644
|
t && s(t);
|
|
3607
|
-
}, [t]), /* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */
|
|
3645
|
+
}, [t]), /* @__PURE__ */ v(ye, { children: [
|
|
3646
|
+
/* @__PURE__ */ v(gn, { children: [
|
|
3609
3647
|
/* @__PURE__ */ c("div", { className: Ja(), children: /* @__PURE__ */ c(qn, {}) }),
|
|
3610
|
-
/* @__PURE__ */
|
|
3611
|
-
/* @__PURE__ */ c(
|
|
3612
|
-
/* @__PURE__ */ c(
|
|
3613
|
-
/* @__PURE__ */ c(
|
|
3648
|
+
/* @__PURE__ */ v("form", { className: "mt-5", onSubmit: m, children: [
|
|
3649
|
+
/* @__PURE__ */ c(Tt, { alignHorizontal: "center", rowGap: 7, children: /* @__PURE__ */ c(le, { span: 6, children: /* @__PURE__ */ v(sn, { mode: "dark", children: [
|
|
3650
|
+
/* @__PURE__ */ c(le, { span: 12, children: o && /* @__PURE__ */ c("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
|
|
3651
|
+
/* @__PURE__ */ c(le, { span: 12, children: /* @__PURE__ */ c(
|
|
3614
3652
|
nt,
|
|
3615
3653
|
{
|
|
3616
3654
|
required: !0,
|
|
@@ -3630,8 +3668,8 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3630
3668
|
error: a !== ""
|
|
3631
3669
|
}
|
|
3632
3670
|
) }),
|
|
3633
|
-
/* @__PURE__ */ c(
|
|
3634
|
-
|
|
3671
|
+
/* @__PURE__ */ c(le, { span: 12, children: /* @__PURE__ */ c(
|
|
3672
|
+
or,
|
|
3635
3673
|
{
|
|
3636
3674
|
required: !0,
|
|
3637
3675
|
autoCapitalize: "off",
|
|
@@ -3653,8 +3691,8 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3653
3691
|
helperText: a
|
|
3654
3692
|
}
|
|
3655
3693
|
) }),
|
|
3656
|
-
/* @__PURE__ */ c(
|
|
3657
|
-
|
|
3694
|
+
/* @__PURE__ */ c(le, { span: 12, children: /* @__PURE__ */ c(
|
|
3695
|
+
Zt,
|
|
3658
3696
|
{
|
|
3659
3697
|
mode: "light",
|
|
3660
3698
|
focusMode: "light",
|
|
@@ -3667,7 +3705,7 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3667
3705
|
) })
|
|
3668
3706
|
] }) }) }),
|
|
3669
3707
|
/* @__PURE__ */ c("div", { className: "text-center text-copy-light", children: "or" }),
|
|
3670
|
-
/* @__PURE__ */ c(
|
|
3708
|
+
/* @__PURE__ */ c(Tt, { alignHorizontal: "center", children: /* @__PURE__ */ c(le, { span: 6, children: /* @__PURE__ */ c(
|
|
3671
3709
|
Xe,
|
|
3672
3710
|
{
|
|
3673
3711
|
mode: "dark",
|
|
@@ -3684,26 +3722,26 @@ const Jn = "av-footer", Yn = (e) => {
|
|
|
3684
3722
|
] }),
|
|
3685
3723
|
/* @__PURE__ */ c(zn, {})
|
|
3686
3724
|
] });
|
|
3687
|
-
}, Qn = new URL(document.location.href).searchParams, Zn = !!Qn.get("debug") || !1, eo =
|
|
3725
|
+
}, Qn = new URL(document.location.href).searchParams, Zn = !!Qn.get("debug") || !1, eo = _t(() => import(
|
|
3688
3726
|
/* webpackChunkName: "LazyApp" */
|
|
3689
|
-
"./App.
|
|
3727
|
+
"./App.Da6BVUYy.js"
|
|
3690
3728
|
).then((e) => e.App)), to = ({ isComponent: e }) => {
|
|
3691
3729
|
const { isAuthenticated: t } = et();
|
|
3692
|
-
return t ? /* @__PURE__ */ c(
|
|
3730
|
+
return t ? /* @__PURE__ */ c(Rt, { fallback: /* @__PURE__ */ c("div", {}), children: /* @__PURE__ */ c(eo, { isComponent: e }) }) : /* @__PURE__ */ c(Xn, {});
|
|
3693
3731
|
}, ro = ({
|
|
3694
3732
|
isComponent: e = !1,
|
|
3695
3733
|
domain: t = Va
|
|
3696
|
-
}) => /* @__PURE__ */ c(
|
|
3734
|
+
}) => /* @__PURE__ */ c(ye, { children: /* @__PURE__ */ c(Pa, { clientId: Da, domain: t, debug: Zn, children: /* @__PURE__ */ c(to, { isComponent: e }) }) }), as = ({ domain: e }) => /* @__PURE__ */ c(ro, { isComponent: !0, domain: e });
|
|
3697
3735
|
export {
|
|
3698
3736
|
Xo as ABOUT_TITLE,
|
|
3699
3737
|
wo as ACTION_MESSAGE,
|
|
3700
|
-
|
|
3738
|
+
vo as ACTION_MODEL,
|
|
3701
3739
|
To as ACTION_RESET,
|
|
3702
3740
|
Ro as ACTION_RESET_TAGS,
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3741
|
+
Io as ACTION_RESTORE,
|
|
3742
|
+
Ao as ACTION_SEARCH,
|
|
3743
|
+
So as ACTION_SORT,
|
|
3744
|
+
ko as ACTION_STREAMING,
|
|
3707
3745
|
_o as ACTION_TOGGLE_TAG,
|
|
3708
3746
|
zn as AppFooter,
|
|
3709
3747
|
es as CANCEL,
|
|
@@ -3711,15 +3749,15 @@ export {
|
|
|
3711
3749
|
Zo as CLEAR,
|
|
3712
3750
|
sn as D,
|
|
3713
3751
|
yo as ERROR_MESSAGE,
|
|
3714
|
-
|
|
3752
|
+
ue as G,
|
|
3715
3753
|
Eo as GPT4_MAX_TOKENS,
|
|
3716
3754
|
qo as HISTORY_TITLE,
|
|
3717
|
-
|
|
3718
|
-
|
|
3755
|
+
Co as LOCAL_STORAGE_CHAT_DETAILS,
|
|
3756
|
+
xo as LOCAL_STORAGE_PREFIX,
|
|
3719
3757
|
Oo as LOCAL_STORAGE_SEARCH,
|
|
3720
3758
|
Po as LOCAL_STORAGE_SORT,
|
|
3721
|
-
|
|
3722
|
-
|
|
3759
|
+
$o as LOCAL_STORAGE_TAG_PROOFREAD,
|
|
3760
|
+
Lo as LOCAL_STORAGE_TAG_REPHRASE,
|
|
3723
3761
|
Do as LOCAL_STORAGE_TAG_SUMMARIZE,
|
|
3724
3762
|
Yo as LOG_OUT,
|
|
3725
3763
|
bo as MODEL_GPT4,
|
|
@@ -3727,7 +3765,7 @@ export {
|
|
|
3727
3765
|
ts as NA,
|
|
3728
3766
|
Xe as O,
|
|
3729
3767
|
zo as PROFILE_TITLE,
|
|
3730
|
-
|
|
3768
|
+
Zt as R,
|
|
3731
3769
|
ho as ROLE_ASSISTANT,
|
|
3732
3770
|
fo as ROLE_HIDDEN,
|
|
3733
3771
|
go as ROLE_INTERNAL,
|
|
@@ -3735,25 +3773,25 @@ export {
|
|
|
3735
3773
|
mo as ROLE_USER,
|
|
3736
3774
|
Fo as SEND,
|
|
3737
3775
|
jo as STATS,
|
|
3738
|
-
|
|
3776
|
+
Mo as STATS_SEPARATOR,
|
|
3739
3777
|
as as SassySaint,
|
|
3740
3778
|
Fe as TAGS,
|
|
3741
3779
|
No as TAG_CONTENT,
|
|
3742
3780
|
Qo as TYPE_QUESTION,
|
|
3743
|
-
|
|
3744
|
-
wt as b,
|
|
3781
|
+
Tt as b,
|
|
3745
3782
|
gn as d,
|
|
3746
3783
|
Vo as durationFormatter,
|
|
3747
3784
|
Wo as extractAverage,
|
|
3748
|
-
|
|
3749
|
-
|
|
3785
|
+
Ke as g,
|
|
3786
|
+
Ko as getCurrentGeoLocation,
|
|
3750
3787
|
Ja as getMessageContaintWrapperClass,
|
|
3751
3788
|
Bo as isLastMessageFromRole,
|
|
3752
|
-
|
|
3789
|
+
le as j,
|
|
3753
3790
|
Go as numberFormatter,
|
|
3754
3791
|
Jo as pluralize,
|
|
3755
3792
|
Ho as renderDataAsList,
|
|
3756
3793
|
et as rn,
|
|
3757
|
-
|
|
3758
|
-
un as v
|
|
3794
|
+
Uo as truncate,
|
|
3795
|
+
un as v,
|
|
3796
|
+
nt as ye
|
|
3759
3797
|
};
|