@versini/sassysaint 5.5.17 → 5.5.18
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.CGtB3zQZ.js → App.oZoXeHpk.js} +371 -383
- package/dist/chunks/{HeaderToolbar.2wFvK4Tt.js → HeaderToolbar.BS7wgkaB.js} +139 -143
- package/dist/chunks/{MarkdownWithExtra.BCy_BgBz.js → MarkdownWithExtra.D6_F01Wo.js} +4 -4
- package/dist/chunks/{MessageAssistant.CwEosJOq.js → MessageAssistant.D9gVxi35.js} +3 -3
- package/dist/chunks/{index.DfBlqXlL.js → index.Dc-g6Ljy.js} +445 -449
- package/dist/components/SassySaint/SassySaint.js +1 -1
- package/dist/index.js +4 -4
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import z, { createContext as
|
|
1
|
+
import { jsx as l, jsxs as O, Fragment as Oe } from "react/jsx-runtime";
|
|
2
|
+
import z, { createContext as ar, useReducer as wt, useRef as $, useCallback as q, useEffect as Q, useContext as Tt, useSyncExternalStore as nr, useId as It, useState as j, useLayoutEffect as ot, useMemo as St, lazy as or, Suspense as sr } from "react";
|
|
3
3
|
import g from "clsx";
|
|
4
|
-
var
|
|
4
|
+
var ir = Object.defineProperty, cr = (e, t, r) => t in e ? ir(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ke = (e, t, r) => cr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
5
5
|
/*!
|
|
6
6
|
@versini/auth-provider v7.4.0
|
|
7
7
|
© 2024 gizmette.com
|
|
@@ -31,7 +31,7 @@ function ve(e) {
|
|
|
31
31
|
function Ze() {
|
|
32
32
|
return (window == null ? void 0 : window.PublicKeyCredential) !== void 0 && typeof window.PublicKeyCredential == "function";
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function _t(e) {
|
|
35
35
|
const { id: t } = e;
|
|
36
36
|
return {
|
|
37
37
|
...e,
|
|
@@ -39,7 +39,7 @@ function kt(e) {
|
|
|
39
39
|
transports: e.transports
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function kt(e) {
|
|
43
43
|
return e === "localhost" || /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e);
|
|
44
44
|
}
|
|
45
45
|
let R = class extends Error {
|
|
@@ -47,7 +47,7 @@ let R = class extends Error {
|
|
|
47
47
|
super(t, { cause: a }), this.name = n ?? a.name, this.code = r;
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
function
|
|
50
|
+
function lr({ error: e, options: t }) {
|
|
51
51
|
var a, n;
|
|
52
52
|
const { publicKey: r } = t;
|
|
53
53
|
if (!r)
|
|
@@ -97,7 +97,7 @@ function dr({ error: e, options: t }) {
|
|
|
97
97
|
});
|
|
98
98
|
if (e.name === "SecurityError") {
|
|
99
99
|
const o = window.location.hostname;
|
|
100
|
-
if (
|
|
100
|
+
if (kt(o)) {
|
|
101
101
|
if (r.rp.id !== o)
|
|
102
102
|
return new R({
|
|
103
103
|
message: `The RP ID "${r.rp.id}" is invalid for this domain`,
|
|
@@ -125,7 +125,7 @@ function dr({ error: e, options: t }) {
|
|
|
125
125
|
}
|
|
126
126
|
return e;
|
|
127
127
|
}
|
|
128
|
-
class
|
|
128
|
+
class dr {
|
|
129
129
|
createNewAbortSignal() {
|
|
130
130
|
if (this.controller) {
|
|
131
131
|
const r = new Error("Cancelling existing WebAuthn API call for new one");
|
|
@@ -141,12 +141,12 @@ class ur {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
const
|
|
145
|
-
function
|
|
146
|
-
if (e && !(
|
|
144
|
+
const At = new dr(), ur = ["cross-platform", "platform"];
|
|
145
|
+
function vt(e) {
|
|
146
|
+
if (e && !(ur.indexOf(e) < 0))
|
|
147
147
|
return e;
|
|
148
148
|
}
|
|
149
|
-
async function
|
|
149
|
+
async function hr(e) {
|
|
150
150
|
var u;
|
|
151
151
|
if (!Ze())
|
|
152
152
|
throw new Error("WebAuthn is not supported in this browser");
|
|
@@ -157,14 +157,14 @@ async function mr(e) {
|
|
|
157
157
|
...e.user,
|
|
158
158
|
id: ve(e.user.id)
|
|
159
159
|
},
|
|
160
|
-
excludeCredentials: (u = e.excludeCredentials) == null ? void 0 : u.map(
|
|
160
|
+
excludeCredentials: (u = e.excludeCredentials) == null ? void 0 : u.map(_t)
|
|
161
161
|
} };
|
|
162
|
-
t.signal =
|
|
162
|
+
t.signal = At.createNewAbortSignal();
|
|
163
163
|
let r;
|
|
164
164
|
try {
|
|
165
165
|
r = await navigator.credentials.create(t);
|
|
166
166
|
} catch (c) {
|
|
167
|
-
throw
|
|
167
|
+
throw lr({ error: c, options: t });
|
|
168
168
|
}
|
|
169
169
|
if (!r)
|
|
170
170
|
throw new Error("Registration was not completed");
|
|
@@ -206,20 +206,20 @@ async function mr(e) {
|
|
|
206
206
|
},
|
|
207
207
|
type: s,
|
|
208
208
|
clientExtensionResults: r.getClientExtensionResults(),
|
|
209
|
-
authenticatorAttachment:
|
|
209
|
+
authenticatorAttachment: vt(r.authenticatorAttachment)
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
function He(e, t) {
|
|
213
213
|
console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
|
|
214
214
|
`, t);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function mr() {
|
|
217
217
|
if (!Ze())
|
|
218
218
|
return new Promise((t) => t(!1));
|
|
219
219
|
const e = window.PublicKeyCredential;
|
|
220
220
|
return e.isConditionalMediationAvailable === void 0 ? new Promise((t) => t(!1)) : e.isConditionalMediationAvailable();
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function pr({ error: e, options: t }) {
|
|
223
223
|
const { publicKey: r } = t;
|
|
224
224
|
if (!r)
|
|
225
225
|
throw Error("options was missing required publicKey property");
|
|
@@ -239,7 +239,7 @@ function gr({ error: e, options: t }) {
|
|
|
239
239
|
});
|
|
240
240
|
if (e.name === "SecurityError") {
|
|
241
241
|
const a = window.location.hostname;
|
|
242
|
-
if (
|
|
242
|
+
if (kt(a)) {
|
|
243
243
|
if (r.rpId !== a)
|
|
244
244
|
return new R({
|
|
245
245
|
message: `The RP ID "${r.rpId}" is invalid for this domain`,
|
|
@@ -260,30 +260,30 @@ function gr({ error: e, options: t }) {
|
|
|
260
260
|
}
|
|
261
261
|
return e;
|
|
262
262
|
}
|
|
263
|
-
async function
|
|
263
|
+
async function gr(e, t = !1) {
|
|
264
264
|
var u, c;
|
|
265
265
|
if (!Ze())
|
|
266
266
|
throw new Error("WebAuthn is not supported in this browser");
|
|
267
267
|
let r;
|
|
268
|
-
((u = e.allowCredentials) == null ? void 0 : u.length) !== 0 && (r = (c = e.allowCredentials) == null ? void 0 : c.map(
|
|
268
|
+
((u = e.allowCredentials) == null ? void 0 : u.length) !== 0 && (r = (c = e.allowCredentials) == null ? void 0 : c.map(_t));
|
|
269
269
|
const a = {
|
|
270
270
|
...e,
|
|
271
271
|
challenge: ve(e.challenge),
|
|
272
272
|
allowCredentials: r
|
|
273
273
|
}, n = {};
|
|
274
274
|
if (t) {
|
|
275
|
-
if (!await
|
|
275
|
+
if (!await mr())
|
|
276
276
|
throw Error("Browser does not support WebAuthn autofill");
|
|
277
277
|
if (document.querySelectorAll("input[autocomplete$='webauthn']").length < 1)
|
|
278
278
|
throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');
|
|
279
279
|
n.mediation = "conditional", a.allowCredentials = [];
|
|
280
280
|
}
|
|
281
|
-
n.publicKey = a, n.signal =
|
|
281
|
+
n.publicKey = a, n.signal = At.createNewAbortSignal();
|
|
282
282
|
let o;
|
|
283
283
|
try {
|
|
284
284
|
o = await navigator.credentials.get(n);
|
|
285
285
|
} catch (h) {
|
|
286
|
-
throw
|
|
286
|
+
throw pr({ error: h, options: n });
|
|
287
287
|
}
|
|
288
288
|
if (!o)
|
|
289
289
|
throw new Error("Authentication was not completed");
|
|
@@ -300,7 +300,7 @@ async function yr(e, t = !1) {
|
|
|
300
300
|
},
|
|
301
301
|
type: m,
|
|
302
302
|
clientExtensionResults: o.getClientExtensionResults(),
|
|
303
|
-
authenticatorAttachment:
|
|
303
|
+
authenticatorAttachment: vt(o.authenticatorAttachment)
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
/*!
|
|
@@ -323,7 +323,7 @@ const ue = {
|
|
|
323
323
|
CODE: "code",
|
|
324
324
|
REFRESH_TOKEN: "refresh_token",
|
|
325
325
|
PASSKEY: "passkey"
|
|
326
|
-
},
|
|
326
|
+
}, Rt = {
|
|
327
327
|
CLIENT_ID: "X-Auth-ClientId"
|
|
328
328
|
}, A = {
|
|
329
329
|
ALG: "RS256",
|
|
@@ -338,7 +338,7 @@ const ue = {
|
|
|
338
338
|
SCOPES_KEY: "scopes",
|
|
339
339
|
CLIENT_ID_KEY: "aud",
|
|
340
340
|
ISSUER: "gizmette.com"
|
|
341
|
-
},
|
|
341
|
+
}, yr = `-----BEGIN PUBLIC KEY-----
|
|
342
342
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsF6i3Jd9fY/3COqCw/m7
|
|
343
343
|
w5PKyTYLGAI2I6SIIdpe6i6DOCbEkmDz7LdVsBqwNtVi8gvWYIj+8ol6rU3qu1v5
|
|
344
344
|
i1Jd45GSK4kzkVdgCmQZbM5ak0KI99q5wsrAIzUd+LRJ2HRvWtr5IYdsIiXaQjle
|
|
@@ -351,15 +351,15 @@ awIDAQAB
|
|
|
351
351
|
LOGOUT: "logout",
|
|
352
352
|
LOGIN: "login",
|
|
353
353
|
REFRESH: "refresh"
|
|
354
|
-
}, De = crypto,
|
|
355
|
-
function
|
|
354
|
+
}, De = crypto, Nt = (e) => e instanceof CryptoKey, Ee = new TextEncoder(), fe = new TextDecoder();
|
|
355
|
+
function fr(...e) {
|
|
356
356
|
const t = e.reduce((n, { length: o }) => n + o, 0), r = new Uint8Array(t);
|
|
357
357
|
let a = 0;
|
|
358
358
|
for (const n of e)
|
|
359
359
|
r.set(n, a), a += n.length;
|
|
360
360
|
return r;
|
|
361
361
|
}
|
|
362
|
-
const
|
|
362
|
+
const br = (e) => {
|
|
363
363
|
const t = atob(e), r = new Uint8Array(t.length);
|
|
364
364
|
for (let a = 0; a < t.length; a++)
|
|
365
365
|
r[a] = t.charCodeAt(a);
|
|
@@ -368,102 +368,102 @@ const Er = (e) => {
|
|
|
368
368
|
let t = e;
|
|
369
369
|
t instanceof Uint8Array && (t = fe.decode(t)), t = t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
370
370
|
try {
|
|
371
|
-
return
|
|
371
|
+
return br(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 C = class extends Error {
|
|
377
377
|
constructor(t, r) {
|
|
378
378
|
var a;
|
|
379
379
|
super(t, r), this.code = "ERR_JOSE_GENERIC", this.name = this.constructor.name, (a = Error.captureStackTrace) == null || a.call(Error, this, this.constructor);
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
|
-
|
|
383
|
-
let D = class extends
|
|
382
|
+
C.code = "ERR_JOSE_GENERIC";
|
|
383
|
+
let D = class extends C {
|
|
384
384
|
constructor(t, r, a = "unspecified", n = "unspecified") {
|
|
385
385
|
super(t, { cause: { claim: a, reason: n, payload: r } }), this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED", this.claim = a, this.reason = n, this.payload = r;
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
D.code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
389
|
-
class Fe extends
|
|
389
|
+
class Fe extends C {
|
|
390
390
|
constructor(t, r, a = "unspecified", n = "unspecified") {
|
|
391
391
|
super(t, { cause: { claim: a, reason: n, payload: r } }), this.code = "ERR_JWT_EXPIRED", this.claim = a, this.reason = n, this.payload = r;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
Fe.code = "ERR_JWT_EXPIRED";
|
|
395
|
-
class
|
|
395
|
+
class xt extends C {
|
|
396
396
|
constructor() {
|
|
397
397
|
super(...arguments), this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
|
|
401
|
-
let L = class extends
|
|
400
|
+
xt.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
401
|
+
let L = class extends C {
|
|
402
402
|
constructor() {
|
|
403
403
|
super(...arguments), this.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
404
404
|
}
|
|
405
405
|
};
|
|
406
406
|
L.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
407
|
-
class
|
|
407
|
+
class Er extends C {
|
|
408
408
|
constructor(t = "decryption operation failed", r) {
|
|
409
409
|
super(t, r), this.code = "ERR_JWE_DECRYPTION_FAILED";
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
|
|
413
|
-
class
|
|
412
|
+
Er.code = "ERR_JWE_DECRYPTION_FAILED";
|
|
413
|
+
class wr extends C {
|
|
414
414
|
constructor() {
|
|
415
415
|
super(...arguments), this.code = "ERR_JWE_INVALID";
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
|
|
419
|
-
let S = class extends
|
|
418
|
+
wr.code = "ERR_JWE_INVALID";
|
|
419
|
+
let S = class extends C {
|
|
420
420
|
constructor() {
|
|
421
421
|
super(...arguments), this.code = "ERR_JWS_INVALID";
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
424
|
S.code = "ERR_JWS_INVALID";
|
|
425
|
-
let B = class extends
|
|
425
|
+
let B = class extends C {
|
|
426
426
|
constructor() {
|
|
427
427
|
super(...arguments), this.code = "ERR_JWT_INVALID";
|
|
428
428
|
}
|
|
429
429
|
};
|
|
430
430
|
B.code = "ERR_JWT_INVALID";
|
|
431
|
-
class
|
|
431
|
+
class Tr extends C {
|
|
432
432
|
constructor() {
|
|
433
433
|
super(...arguments), this.code = "ERR_JWK_INVALID";
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
|
|
437
|
-
class
|
|
436
|
+
Tr.code = "ERR_JWK_INVALID";
|
|
437
|
+
class Ir extends C {
|
|
438
438
|
constructor() {
|
|
439
439
|
super(...arguments), this.code = "ERR_JWKS_INVALID";
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
|
|
443
|
-
class
|
|
442
|
+
Ir.code = "ERR_JWKS_INVALID";
|
|
443
|
+
class Sr extends C {
|
|
444
444
|
constructor(t = "no applicable key found in the JSON Web Key Set", r) {
|
|
445
445
|
super(t, r), this.code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
|
|
449
|
-
class
|
|
448
|
+
Sr.code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
449
|
+
class _r extends C {
|
|
450
450
|
constructor(t = "multiple matching keys found in the JSON Web Key Set", r) {
|
|
451
451
|
super(t, r), this.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
452
452
|
}
|
|
453
453
|
}
|
|
454
|
-
|
|
455
|
-
class
|
|
454
|
+
_r.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
455
|
+
class kr extends C {
|
|
456
456
|
constructor(t = "request timed out", r) {
|
|
457
457
|
super(t, r), this.code = "ERR_JWKS_TIMEOUT";
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
|
-
|
|
461
|
-
class
|
|
460
|
+
kr.code = "ERR_JWKS_TIMEOUT";
|
|
461
|
+
class Ct extends C {
|
|
462
462
|
constructor(t = "signature verification failed", r) {
|
|
463
463
|
super(t, r), this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
|
|
466
|
+
Ct.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
467
467
|
function Y(e, t = "algorithm.name") {
|
|
468
468
|
return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`);
|
|
469
469
|
}
|
|
@@ -473,7 +473,7 @@ function we(e, t) {
|
|
|
473
473
|
function We(e) {
|
|
474
474
|
return parseInt(e.name.slice(4), 10);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Ar(e) {
|
|
477
477
|
switch (e) {
|
|
478
478
|
case "ES256":
|
|
479
479
|
return "P-256";
|
|
@@ -485,7 +485,7 @@ function vr(e) {
|
|
|
485
485
|
throw new Error("unreachable");
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function vr(e, t) {
|
|
489
489
|
if (t.length && !t.some((r) => e.usages.includes(r))) {
|
|
490
490
|
let r = "CryptoKey does not support this operation, its usages must include ";
|
|
491
491
|
if (t.length > 2) {
|
|
@@ -495,7 +495,7 @@ function Rr(e, t) {
|
|
|
495
495
|
throw new TypeError(r);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function Rr(e, t, ...r) {
|
|
499
499
|
switch (t) {
|
|
500
500
|
case "HS256":
|
|
501
501
|
case "HS384":
|
|
@@ -537,7 +537,7 @@ function Nr(e, t, ...r) {
|
|
|
537
537
|
case "ES512": {
|
|
538
538
|
if (!we(e.algorithm, "ECDSA"))
|
|
539
539
|
throw Y("ECDSA");
|
|
540
|
-
const a =
|
|
540
|
+
const a = Ar(t);
|
|
541
541
|
if (e.algorithm.namedCurve !== a)
|
|
542
542
|
throw Y(a, "algorithm.namedCurve");
|
|
543
543
|
break;
|
|
@@ -545,9 +545,9 @@ function Nr(e, t, ...r) {
|
|
|
545
545
|
default:
|
|
546
546
|
throw new TypeError("CryptoKey does not support this operation");
|
|
547
547
|
}
|
|
548
|
-
|
|
548
|
+
vr(e, r);
|
|
549
549
|
}
|
|
550
|
-
function
|
|
550
|
+
function Ot(e, t, ...r) {
|
|
551
551
|
var a;
|
|
552
552
|
if (r = r.filter(Boolean), r.length > 2) {
|
|
553
553
|
const n = r.pop();
|
|
@@ -555,11 +555,11 @@ function Pt(e, t, ...r) {
|
|
|
555
555
|
} else r.length === 2 ? e += `one of type ${r[0]} or ${r[1]}.` : e += `of type ${r[0]}.`;
|
|
556
556
|
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;
|
|
557
557
|
}
|
|
558
|
-
const st = (e, ...t) =>
|
|
559
|
-
function
|
|
560
|
-
return
|
|
558
|
+
const st = (e, ...t) => Ot("Key must be ", e, ...t);
|
|
559
|
+
function Pt(e, t, ...r) {
|
|
560
|
+
return Ot(`Key for the ${e} algorithm must be `, t, ...r);
|
|
561
561
|
}
|
|
562
|
-
const
|
|
562
|
+
const Dt = (e) => Nt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Re = ["CryptoKey"], Nr = (...e) => {
|
|
563
563
|
const t = e.filter(Boolean);
|
|
564
564
|
if (t.length === 0 || t.length === 1)
|
|
565
565
|
return !0;
|
|
@@ -578,11 +578,11 @@ const Lt = (e) => xt(e) ? !0 : (e == null ? void 0 : e[Symbol.toStringTag]) ===
|
|
|
578
578
|
}
|
|
579
579
|
return !0;
|
|
580
580
|
};
|
|
581
|
-
function
|
|
581
|
+
function xr(e) {
|
|
582
582
|
return typeof e == "object" && e !== null;
|
|
583
583
|
}
|
|
584
584
|
function he(e) {
|
|
585
|
-
if (!
|
|
585
|
+
if (!xr(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
586
586
|
return !1;
|
|
587
587
|
if (Object.getPrototypeOf(e) === null)
|
|
588
588
|
return !0;
|
|
@@ -591,7 +591,7 @@ function he(e) {
|
|
|
591
591
|
t = Object.getPrototypeOf(t);
|
|
592
592
|
return Object.getPrototypeOf(e) === t;
|
|
593
593
|
}
|
|
594
|
-
const
|
|
594
|
+
const Cr = (e, t) => {
|
|
595
595
|
if (e.startsWith("RS") || e.startsWith("PS")) {
|
|
596
596
|
const { modulusLength: r } = t.algorithm;
|
|
597
597
|
if (typeof r != "number" || r < 2048)
|
|
@@ -601,16 +601,16 @@ const Or = (e, t) => {
|
|
|
601
601
|
function me(e) {
|
|
602
602
|
return he(e) && typeof e.kty == "string";
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function Or(e) {
|
|
605
605
|
return e.kty !== "oct" && typeof e.d == "string";
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function Pr(e) {
|
|
608
608
|
return e.kty !== "oct" && typeof e.d > "u";
|
|
609
609
|
}
|
|
610
|
-
function
|
|
610
|
+
function Dr(e) {
|
|
611
611
|
return me(e) && e.kty === "oct" && typeof e.k == "string";
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Lr(e) {
|
|
614
614
|
let t, r;
|
|
615
615
|
switch (e.kty) {
|
|
616
616
|
case "RSA": {
|
|
@@ -682,36 +682,36 @@ function $r(e) {
|
|
|
682
682
|
}
|
|
683
683
|
return { algorithm: t, keyUsages: r };
|
|
684
684
|
}
|
|
685
|
-
const
|
|
685
|
+
const Lt = async (e) => {
|
|
686
686
|
if (!e.alg)
|
|
687
687
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
688
|
-
const { algorithm: t, keyUsages: r } =
|
|
688
|
+
const { algorithm: t, keyUsages: r } = Lr(e), a = [
|
|
689
689
|
t,
|
|
690
690
|
e.ext ?? !1,
|
|
691
691
|
e.key_ops ?? r
|
|
692
692
|
], n = { ...e };
|
|
693
693
|
return delete n.alg, delete n.use, De.subtle.importKey("jwk", n, ...a);
|
|
694
|
-
},
|
|
695
|
-
let
|
|
696
|
-
const
|
|
694
|
+
}, $t = (e) => X(e);
|
|
695
|
+
let ne, oe;
|
|
696
|
+
const Mt = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject", Ne = async (e, t, r, a, n = !1) => {
|
|
697
697
|
let o = e.get(t);
|
|
698
698
|
if (o != null && o[a])
|
|
699
699
|
return o[a];
|
|
700
|
-
const s = await
|
|
700
|
+
const s = await Lt({ ...r, alg: a });
|
|
701
701
|
return n && Object.freeze(t), o ? o[a] = s : e.set(t, { [a]: s }), s;
|
|
702
|
-
},
|
|
703
|
-
if (
|
|
702
|
+
}, $r = (e, t) => {
|
|
703
|
+
if (Mt(e)) {
|
|
704
704
|
let r = e.export({ format: "jwk" });
|
|
705
|
-
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ?
|
|
705
|
+
return delete r.d, delete r.dp, delete r.dq, delete r.p, delete r.q, delete r.qi, r.k ? $t(r.k) : (oe || (oe = /* @__PURE__ */ new WeakMap()), Ne(oe, e, r, t));
|
|
706
706
|
}
|
|
707
|
-
return me(e) ? e.k ? X(e.k) : (
|
|
708
|
-
},
|
|
709
|
-
if (
|
|
707
|
+
return me(e) ? e.k ? X(e.k) : (oe || (oe = /* @__PURE__ */ new WeakMap()), Ne(oe, e, e, t, !0)) : e;
|
|
708
|
+
}, Mr = (e, t) => {
|
|
709
|
+
if (Mt(e)) {
|
|
710
710
|
let r = e.export({ format: "jwk" });
|
|
711
|
-
return r.k ?
|
|
711
|
+
return r.k ? $t(r.k) : (ne || (ne = /* @__PURE__ */ new WeakMap()), Ne(ne, e, r, t));
|
|
712
712
|
}
|
|
713
|
-
return me(e) ? e.k ? X(e.k) : (
|
|
714
|
-
},
|
|
713
|
+
return me(e) ? e.k ? X(e.k) : (ne || (ne = /* @__PURE__ */ new WeakMap()), Ne(ne, e, e, t, !0)) : e;
|
|
714
|
+
}, Ur = { normalizePublicKey: $r, normalizePrivateKey: Mr }, F = (e, t, r = 0) => {
|
|
715
715
|
r === 0 && (t.unshift(t.length), t.unshift(6));
|
|
716
716
|
const a = e.indexOf(t[0], r);
|
|
717
717
|
if (a === -1)
|
|
@@ -737,7 +737,7 @@ const Ut = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
737
737
|
default:
|
|
738
738
|
throw new L("Invalid or unsupported EC Key Curve or OKP Key Sub Type");
|
|
739
739
|
}
|
|
740
|
-
},
|
|
740
|
+
}, Kr = async (e, t, r, a, n) => {
|
|
741
741
|
let o, s;
|
|
742
742
|
const i = new Uint8Array(atob(r.replace(e, "")).split("").map((d) => d.charCodeAt(0)));
|
|
743
743
|
switch (a) {
|
|
@@ -784,13 +784,13 @@ const Ut = (e) => (e == null ? void 0 : e[Symbol.toStringTag]) === "KeyObject",
|
|
|
784
784
|
throw new L('Invalid or unsupported "alg" (Algorithm) value');
|
|
785
785
|
}
|
|
786
786
|
return De.subtle.importKey(t, i, o, !1, s);
|
|
787
|
-
},
|
|
788
|
-
async function
|
|
787
|
+
}, Hr = (e, t, r) => Kr(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, "spki", e, t);
|
|
788
|
+
async function Wr(e, t, r) {
|
|
789
789
|
if (e.indexOf("-----BEGIN PUBLIC KEY-----") !== 0)
|
|
790
790
|
throw new TypeError('"spki" must be SPKI formatted string');
|
|
791
|
-
return
|
|
791
|
+
return Hr(e, t);
|
|
792
792
|
}
|
|
793
|
-
async function
|
|
793
|
+
async function Gr(e, t) {
|
|
794
794
|
if (!he(e))
|
|
795
795
|
throw new TypeError("JWK must be an object");
|
|
796
796
|
switch (t || (t = e.alg), e.kty) {
|
|
@@ -803,7 +803,7 @@ async function Br(e, t) {
|
|
|
803
803
|
throw new L('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
|
|
804
804
|
case "EC":
|
|
805
805
|
case "OKP":
|
|
806
|
-
return
|
|
806
|
+
return Lt({ ...e, alg: t });
|
|
807
807
|
default:
|
|
808
808
|
throw new L('Unsupported "kty" (Key Type) Parameter value');
|
|
809
809
|
}
|
|
@@ -817,32 +817,32 @@ const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], je = (e, t, r) =>
|
|
|
817
817
|
if (t.alg !== void 0 && t.alg !== e)
|
|
818
818
|
throw new TypeError(`Invalid key for this operation, when present its alg must be ${e}`);
|
|
819
819
|
return !0;
|
|
820
|
-
},
|
|
820
|
+
}, Br = (e, t, r, a) => {
|
|
821
821
|
if (!(t instanceof Uint8Array)) {
|
|
822
822
|
if (a && me(t)) {
|
|
823
|
-
if (
|
|
823
|
+
if (Dr(t) && je(e, t, r))
|
|
824
824
|
return;
|
|
825
825
|
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');
|
|
826
826
|
}
|
|
827
|
-
if (!
|
|
828
|
-
throw new TypeError(
|
|
827
|
+
if (!Dt(t))
|
|
828
|
+
throw new TypeError(Pt(e, t, ...Re, "Uint8Array", a ? "JSON Web Key" : null));
|
|
829
829
|
if (t.type !== "secret")
|
|
830
830
|
throw new TypeError(`${de(t)} instances for symmetric algorithms must be of type "secret"`);
|
|
831
831
|
}
|
|
832
|
-
},
|
|
832
|
+
}, Jr = (e, t, r, a) => {
|
|
833
833
|
if (a && me(t))
|
|
834
834
|
switch (r) {
|
|
835
835
|
case "sign":
|
|
836
|
-
if (
|
|
836
|
+
if (Or(t) && je(e, t, r))
|
|
837
837
|
return;
|
|
838
838
|
throw new TypeError("JSON Web Key for this operation be a private JWK");
|
|
839
839
|
case "verify":
|
|
840
|
-
if (
|
|
840
|
+
if (Pr(t) && je(e, t, r))
|
|
841
841
|
return;
|
|
842
842
|
throw new TypeError("JSON Web Key for this operation be a public JWK");
|
|
843
843
|
}
|
|
844
|
-
if (!
|
|
845
|
-
throw new TypeError(
|
|
844
|
+
if (!Dt(t))
|
|
845
|
+
throw new TypeError(Pt(e, t, ...Re, a ? "JSON Web Key" : null));
|
|
846
846
|
if (t.type === "secret")
|
|
847
847
|
throw new TypeError(`${de(t)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
848
848
|
if (r === "sign" && t.type === "public")
|
|
@@ -854,12 +854,12 @@ const de = (e) => e == null ? void 0 : e[Symbol.toStringTag], je = (e, t, r) =>
|
|
|
854
854
|
if (t.algorithm && r === "encrypt" && t.type === "private")
|
|
855
855
|
throw new TypeError(`${de(t)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
856
856
|
};
|
|
857
|
-
function
|
|
858
|
-
t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ?
|
|
857
|
+
function Ut(e, t, r, a) {
|
|
858
|
+
t.startsWith("HS") || t === "dir" || t.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(t) ? Br(t, r, a, e) : Jr(t, r, a, e);
|
|
859
859
|
}
|
|
860
|
-
|
|
861
|
-
const ct =
|
|
862
|
-
function
|
|
860
|
+
Ut.bind(void 0, !1);
|
|
861
|
+
const ct = Ut.bind(void 0, !0);
|
|
862
|
+
function Vr(e, t, r, a, n) {
|
|
863
863
|
if (n.crit !== void 0 && (a == null ? void 0 : a.crit) === void 0)
|
|
864
864
|
throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
865
865
|
if (!a || a.crit === void 0)
|
|
@@ -878,13 +878,13 @@ function Yr(e, t, r, a, n) {
|
|
|
878
878
|
}
|
|
879
879
|
return new Set(a.crit);
|
|
880
880
|
}
|
|
881
|
-
const
|
|
881
|
+
const Yr = (e, t) => {
|
|
882
882
|
if (t !== void 0 && (!Array.isArray(t) || t.some((r) => typeof r != "string")))
|
|
883
883
|
throw new TypeError(`"${e}" option must be an array of strings`);
|
|
884
884
|
if (t)
|
|
885
885
|
return new Set(t);
|
|
886
886
|
};
|
|
887
|
-
function
|
|
887
|
+
function zr(e, t) {
|
|
888
888
|
const r = `SHA-${e.slice(-3)}`;
|
|
889
889
|
switch (e) {
|
|
890
890
|
case "HS256":
|
|
@@ -909,9 +909,9 @@ function Fr(e, t) {
|
|
|
909
909
|
throw new L(`alg ${e} is not supported either by JOSE or your javascript runtime`);
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
|
-
async function
|
|
913
|
-
if (t = await
|
|
914
|
-
return
|
|
912
|
+
async function Fr(e, t, r) {
|
|
913
|
+
if (t = await Ur.normalizePublicKey(t, e), Nt(t))
|
|
914
|
+
return Rr(t, e, r), t;
|
|
915
915
|
if (t instanceof Uint8Array) {
|
|
916
916
|
if (!e.startsWith("HS"))
|
|
917
917
|
throw new TypeError(st(t, ...Re));
|
|
@@ -919,17 +919,17 @@ async function jr(e, t, r) {
|
|
|
919
919
|
}
|
|
920
920
|
throw new TypeError(st(t, ...Re, "Uint8Array", "JSON Web Key"));
|
|
921
921
|
}
|
|
922
|
-
const
|
|
923
|
-
const n = await
|
|
924
|
-
|
|
925
|
-
const o =
|
|
922
|
+
const jr = async (e, t, r, a) => {
|
|
923
|
+
const n = await Fr(e, t, "verify");
|
|
924
|
+
Cr(e, n);
|
|
925
|
+
const o = zr(e, n.algorithm);
|
|
926
926
|
try {
|
|
927
927
|
return await De.subtle.verify(o, n, r, a);
|
|
928
928
|
} catch {
|
|
929
929
|
return !1;
|
|
930
930
|
}
|
|
931
931
|
};
|
|
932
|
-
async function
|
|
932
|
+
async function qr(e, t, r) {
|
|
933
933
|
if (!he(e))
|
|
934
934
|
throw new S("Flattened JWS must be an object");
|
|
935
935
|
if (e.protected === void 0 && e.header === void 0)
|
|
@@ -950,37 +950,37 @@ async function Xr(e, t, r) {
|
|
|
950
950
|
} catch {
|
|
951
951
|
throw new S("JWS Protected Header is invalid");
|
|
952
952
|
}
|
|
953
|
-
if (!
|
|
953
|
+
if (!Nr(a, e.header))
|
|
954
954
|
throw new S("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
955
955
|
const n = {
|
|
956
956
|
...a,
|
|
957
957
|
...e.header
|
|
958
|
-
}, o =
|
|
958
|
+
}, o = Vr(S, /* @__PURE__ */ new Map([["b64", !0]]), r == null ? void 0 : r.crit, a, n);
|
|
959
959
|
let s = !0;
|
|
960
960
|
if (o.has("b64") && (s = a.b64, typeof s != "boolean"))
|
|
961
961
|
throw new S('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
962
962
|
const { alg: i } = n;
|
|
963
963
|
if (typeof i != "string" || !i)
|
|
964
964
|
throw new S('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
965
|
-
const d =
|
|
965
|
+
const d = Yr("algorithms", r.algorithms);
|
|
966
966
|
if (d && !d.has(i))
|
|
967
|
-
throw new
|
|
967
|
+
throw new xt('"alg" (Algorithm) Header Parameter value not allowed');
|
|
968
968
|
if (s) {
|
|
969
969
|
if (typeof e.payload != "string")
|
|
970
970
|
throw new S("JWS Payload must be a string");
|
|
971
971
|
} else if (typeof e.payload != "string" && !(e.payload instanceof Uint8Array))
|
|
972
972
|
throw new S("JWS Payload must be a string or an Uint8Array instance");
|
|
973
973
|
let m = !1;
|
|
974
|
-
typeof t == "function" ? (t = await t(a, e), m = !0, ct(i, t, "verify"), me(t) && (t = await
|
|
975
|
-
const p =
|
|
974
|
+
typeof t == "function" ? (t = await t(a, e), m = !0, ct(i, t, "verify"), me(t) && (t = await Gr(t, i))) : ct(i, t, "verify");
|
|
975
|
+
const p = fr(Ee.encode(e.protected ?? ""), Ee.encode("."), typeof e.payload == "string" ? Ee.encode(e.payload) : e.payload);
|
|
976
976
|
let u;
|
|
977
977
|
try {
|
|
978
978
|
u = X(e.signature);
|
|
979
979
|
} catch {
|
|
980
980
|
throw new S("Failed to base64url decode the signature");
|
|
981
981
|
}
|
|
982
|
-
if (!await
|
|
983
|
-
throw new
|
|
982
|
+
if (!await jr(i, t, u, p))
|
|
983
|
+
throw new Ct();
|
|
984
984
|
let c;
|
|
985
985
|
if (s)
|
|
986
986
|
try {
|
|
@@ -992,17 +992,17 @@ async function Xr(e, t, r) {
|
|
|
992
992
|
const h = { payload: c };
|
|
993
993
|
return e.protected !== void 0 && (h.protectedHeader = a), e.header !== void 0 && (h.unprotectedHeader = e.header), m ? { ...h, key: t } : h;
|
|
994
994
|
}
|
|
995
|
-
async function
|
|
995
|
+
async function Xr(e, t, r) {
|
|
996
996
|
if (e instanceof Uint8Array && (e = fe.decode(e)), typeof e != "string")
|
|
997
997
|
throw new S("Compact JWS must be a string or Uint8Array");
|
|
998
998
|
const { 0: a, 1: n, 2: o, length: s } = e.split(".");
|
|
999
999
|
if (s !== 3)
|
|
1000
1000
|
throw new S("Invalid Compact JWS");
|
|
1001
|
-
const i = await
|
|
1001
|
+
const i = await qr({ payload: n, protected: a, signature: o }, t, r), d = { payload: i.payload, protectedHeader: i.protectedHeader };
|
|
1002
1002
|
return typeof t == "function" ? { ...d, key: i.key } : d;
|
|
1003
1003
|
}
|
|
1004
|
-
const
|
|
1005
|
-
const t =
|
|
1004
|
+
const Qr = (e) => Math.floor(e.getTime() / 1e3), Kt = 60, Ht = Kt * 60, et = Ht * 24, Zr = et * 7, ea = et * 365.25, ta = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i, lt = (e) => {
|
|
1005
|
+
const t = ta.exec(e);
|
|
1006
1006
|
if (!t || t[4] && t[1])
|
|
1007
1007
|
throw new TypeError("Invalid time period format");
|
|
1008
1008
|
const r = parseFloat(t[2]), a = t[3].toLowerCase();
|
|
@@ -1020,14 +1020,14 @@ const Zr = (e) => Math.floor(e.getTime() / 1e3), Ht = 60, Wt = Ht * 60, et = Wt
|
|
|
1020
1020
|
case "min":
|
|
1021
1021
|
case "mins":
|
|
1022
1022
|
case "m":
|
|
1023
|
-
n = Math.round(r *
|
|
1023
|
+
n = Math.round(r * Kt);
|
|
1024
1024
|
break;
|
|
1025
1025
|
case "hour":
|
|
1026
1026
|
case "hours":
|
|
1027
1027
|
case "hr":
|
|
1028
1028
|
case "hrs":
|
|
1029
1029
|
case "h":
|
|
1030
|
-
n = Math.round(r *
|
|
1030
|
+
n = Math.round(r * Ht);
|
|
1031
1031
|
break;
|
|
1032
1032
|
case "day":
|
|
1033
1033
|
case "days":
|
|
@@ -1037,14 +1037,14 @@ const Zr = (e) => Math.floor(e.getTime() / 1e3), Ht = 60, Wt = Ht * 60, et = Wt
|
|
|
1037
1037
|
case "week":
|
|
1038
1038
|
case "weeks":
|
|
1039
1039
|
case "w":
|
|
1040
|
-
n = Math.round(r *
|
|
1040
|
+
n = Math.round(r * Zr);
|
|
1041
1041
|
break;
|
|
1042
1042
|
default:
|
|
1043
|
-
n = Math.round(r *
|
|
1043
|
+
n = Math.round(r * ea);
|
|
1044
1044
|
break;
|
|
1045
1045
|
}
|
|
1046
1046
|
return t[1] === "-" || t[4] === "ago" ? -n : n;
|
|
1047
|
-
}, dt = (e) => e.toLowerCase().replace(/^application\//, ""),
|
|
1047
|
+
}, dt = (e) => e.toLowerCase().replace(/^application\//, ""), ra = (e, t) => typeof e == "string" ? t.includes(e) : Array.isArray(e) ? t.some(Set.prototype.has.bind(new Set(e))) : !1, aa = (e, t, r = {}) => {
|
|
1048
1048
|
let a;
|
|
1049
1049
|
try {
|
|
1050
1050
|
a = JSON.parse(fe.decode(t));
|
|
@@ -1064,7 +1064,7 @@ const Zr = (e) => Math.floor(e.getTime() / 1e3), Ht = 60, Wt = Ht * 60, et = Wt
|
|
|
1064
1064
|
throw new D('unexpected "iss" claim value', a, "iss", "check_failed");
|
|
1065
1065
|
if (i && a.sub !== i)
|
|
1066
1066
|
throw new D('unexpected "sub" claim value', a, "sub", "check_failed");
|
|
1067
|
-
if (d && !
|
|
1067
|
+
if (d && !ra(a.aud, typeof d == "string" ? [d] : d))
|
|
1068
1068
|
throw new D('unexpected "aud" claim value', a, "aud", "check_failed");
|
|
1069
1069
|
let u;
|
|
1070
1070
|
switch (typeof r.clockTolerance) {
|
|
@@ -1080,7 +1080,7 @@ const Zr = (e) => Math.floor(e.getTime() / 1e3), Ht = 60, Wt = Ht * 60, et = Wt
|
|
|
1080
1080
|
default:
|
|
1081
1081
|
throw new TypeError("Invalid clockTolerance option type");
|
|
1082
1082
|
}
|
|
1083
|
-
const { currentDate: c } = r, h =
|
|
1083
|
+
const { currentDate: c } = r, h = Qr(c || /* @__PURE__ */ new Date());
|
|
1084
1084
|
if ((a.iat !== void 0 || m) && typeof a.iat != "number")
|
|
1085
1085
|
throw new D('"iat" claim must be a number', a, "iat", "invalid");
|
|
1086
1086
|
if (a.nbf !== void 0) {
|
|
@@ -1104,16 +1104,16 @@ const Zr = (e) => Math.floor(e.getTime() / 1e3), Ht = 60, Wt = Ht * 60, et = Wt
|
|
|
1104
1104
|
}
|
|
1105
1105
|
return a;
|
|
1106
1106
|
};
|
|
1107
|
-
async function
|
|
1107
|
+
async function na(e, t, r) {
|
|
1108
1108
|
var a;
|
|
1109
|
-
const n = await
|
|
1109
|
+
const n = await Xr(e, t, r);
|
|
1110
1110
|
if ((a = n.protectedHeader.crit) != null && a.includes("b64") && n.protectedHeader.b64 === !1)
|
|
1111
1111
|
throw new B("JWTs MUST NOT use unencoded payload");
|
|
1112
|
-
const o = { payload:
|
|
1112
|
+
const o = { payload: aa(n.protectedHeader, n.payload, r), protectedHeader: n.protectedHeader };
|
|
1113
1113
|
return typeof t == "function" ? { ...o, key: n.key } : o;
|
|
1114
1114
|
}
|
|
1115
|
-
const
|
|
1116
|
-
function
|
|
1115
|
+
const oa = X;
|
|
1116
|
+
function sa(e) {
|
|
1117
1117
|
if (typeof e != "string")
|
|
1118
1118
|
throw new B("JWTs must use Compact JWS serialization, JWT must be a string");
|
|
1119
1119
|
const { 1: t, length: r } = e.split(".");
|
|
@@ -1125,7 +1125,7 @@ function ia(e) {
|
|
|
1125
1125
|
throw new B("JWTs must contain a payload");
|
|
1126
1126
|
let a;
|
|
1127
1127
|
try {
|
|
1128
|
-
a =
|
|
1128
|
+
a = oa(t);
|
|
1129
1129
|
} catch {
|
|
1130
1130
|
throw new B("Failed to base64url decode the payload");
|
|
1131
1131
|
}
|
|
@@ -1141,81 +1141,81 @@ function ia(e) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
const ye = async (e) => {
|
|
1143
1143
|
try {
|
|
1144
|
-
const t = A.ALG, r = await
|
|
1145
|
-
return await
|
|
1144
|
+
const t = A.ALG, r = await Wr(yr, t);
|
|
1145
|
+
return await na(e, r, {
|
|
1146
1146
|
issuer: A.ISSUER
|
|
1147
1147
|
});
|
|
1148
1148
|
} catch {
|
|
1149
1149
|
return;
|
|
1150
1150
|
}
|
|
1151
|
-
},
|
|
1151
|
+
}, ia = (e) => {
|
|
1152
1152
|
try {
|
|
1153
|
-
return
|
|
1153
|
+
return sa(e);
|
|
1154
1154
|
} catch {
|
|
1155
1155
|
return;
|
|
1156
1156
|
}
|
|
1157
1157
|
}, _ = [];
|
|
1158
1158
|
for (let e = 0; e < 256; ++e)
|
|
1159
1159
|
_.push((e + 256).toString(16).slice(1));
|
|
1160
|
-
function
|
|
1160
|
+
function ca(e, t = 0) {
|
|
1161
1161
|
return (_[e[t + 0]] + _[e[t + 1]] + _[e[t + 2]] + _[e[t + 3]] + "-" + _[e[t + 4]] + _[e[t + 5]] + "-" + _[e[t + 6]] + _[e[t + 7]] + "-" + _[e[t + 8]] + _[e[t + 9]] + "-" + _[e[t + 10]] + _[e[t + 11]] + _[e[t + 12]] + _[e[t + 13]] + _[e[t + 14]] + _[e[t + 15]]).toLowerCase();
|
|
1162
1162
|
}
|
|
1163
1163
|
let Ge;
|
|
1164
|
-
const
|
|
1165
|
-
function
|
|
1164
|
+
const la = new Uint8Array(16);
|
|
1165
|
+
function da() {
|
|
1166
1166
|
if (!Ge) {
|
|
1167
1167
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1168
1168
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1169
1169
|
Ge = crypto.getRandomValues.bind(crypto);
|
|
1170
1170
|
}
|
|
1171
|
-
return Ge(
|
|
1171
|
+
return Ge(la);
|
|
1172
1172
|
}
|
|
1173
|
-
const
|
|
1173
|
+
const ua = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ut = { randomUUID: ua };
|
|
1174
1174
|
function ht(e, t, r) {
|
|
1175
1175
|
if (ut.randomUUID && !t && !e)
|
|
1176
1176
|
return ut.randomUUID();
|
|
1177
1177
|
e = e || {};
|
|
1178
|
-
const a = e.random || (e.rng ||
|
|
1179
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
1178
|
+
const a = e.random || (e.rng || da)();
|
|
1179
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ca(a);
|
|
1180
1180
|
}
|
|
1181
|
-
const mt = globalThis.crypto,
|
|
1181
|
+
const mt = globalThis.crypto, ha = (e) => `${ht()}${ht()}`.slice(0, e), ma = (e) => btoa(
|
|
1182
1182
|
[...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")
|
|
1183
1183
|
);
|
|
1184
|
-
async function
|
|
1184
|
+
async function pa(e) {
|
|
1185
1185
|
if (!mt.subtle)
|
|
1186
1186
|
throw new Error(
|
|
1187
1187
|
"crypto.subtle is available only in secure contexts (HTTPS)."
|
|
1188
1188
|
);
|
|
1189
1189
|
const t = new TextEncoder().encode(e), r = await mt.subtle.digest("SHA-256", t);
|
|
1190
|
-
return
|
|
1190
|
+
return ma(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
1191
1191
|
}
|
|
1192
|
-
async function
|
|
1193
|
-
const t =
|
|
1192
|
+
async function ga(e) {
|
|
1193
|
+
const t = ha(43), r = await pa(t);
|
|
1194
1194
|
return {
|
|
1195
1195
|
code_verifier: t,
|
|
1196
1196
|
code_challenge: r
|
|
1197
1197
|
};
|
|
1198
1198
|
}
|
|
1199
|
-
function
|
|
1199
|
+
function Wt(e, t) {
|
|
1200
1200
|
window.dispatchEvent(new StorageEvent("storage", { key: e, newValue: t }));
|
|
1201
1201
|
}
|
|
1202
1202
|
const pt = (e, t) => {
|
|
1203
1203
|
const r = JSON.stringify(
|
|
1204
1204
|
typeof t == "function" ? t() : t
|
|
1205
1205
|
);
|
|
1206
|
-
window.localStorage.setItem(e, r),
|
|
1207
|
-
},
|
|
1208
|
-
window.localStorage.removeItem(e),
|
|
1209
|
-
}, gt = (e) => window.localStorage.getItem(e),
|
|
1206
|
+
window.localStorage.setItem(e, r), Wt(e, r);
|
|
1207
|
+
}, ya = (e) => {
|
|
1208
|
+
window.localStorage.removeItem(e), Wt(e, null);
|
|
1209
|
+
}, gt = (e) => window.localStorage.getItem(e), fa = (e) => (window.addEventListener("storage", e), () => window.removeEventListener("storage", e));
|
|
1210
1210
|
function Te({
|
|
1211
1211
|
key: e,
|
|
1212
1212
|
initialValue: t
|
|
1213
1213
|
}) {
|
|
1214
|
-
const r =
|
|
1214
|
+
const r = nr(fa, () => gt(e)), a = q(
|
|
1215
1215
|
(s) => {
|
|
1216
1216
|
try {
|
|
1217
1217
|
const i = typeof s == "function" ? s(JSON.parse(r)) : s;
|
|
1218
|
-
i == null ?
|
|
1218
|
+
i == null ? ya(e) : pt(e, i);
|
|
1219
1219
|
} catch (i) {
|
|
1220
1220
|
console.warn(i);
|
|
1221
1221
|
}
|
|
@@ -1237,31 +1237,31 @@ function Te({
|
|
|
1237
1237
|
const k = [];
|
|
1238
1238
|
for (let e = 0; e < 256; ++e)
|
|
1239
1239
|
k.push((e + 256).toString(16).slice(1));
|
|
1240
|
-
function
|
|
1240
|
+
function ba(e, t = 0) {
|
|
1241
1241
|
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();
|
|
1242
1242
|
}
|
|
1243
1243
|
let Be;
|
|
1244
|
-
const
|
|
1245
|
-
function
|
|
1244
|
+
const Ea = new Uint8Array(16);
|
|
1245
|
+
function wa() {
|
|
1246
1246
|
if (!Be) {
|
|
1247
1247
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1248
1248
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1249
1249
|
Be = crypto.getRandomValues.bind(crypto);
|
|
1250
1250
|
}
|
|
1251
|
-
return Be(
|
|
1251
|
+
return Be(Ea);
|
|
1252
1252
|
}
|
|
1253
|
-
const
|
|
1253
|
+
const Ta = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), yt = { randomUUID: Ta };
|
|
1254
1254
|
function Je(e, t, r) {
|
|
1255
1255
|
if (yt.randomUUID && !t && !e)
|
|
1256
1256
|
return yt.randomUUID();
|
|
1257
1257
|
e = e || {};
|
|
1258
|
-
const a = e.random || (e.rng ||
|
|
1259
|
-
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128,
|
|
1258
|
+
const a = e.random || (e.rng || wa)();
|
|
1259
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, ba(a);
|
|
1260
1260
|
}
|
|
1261
|
-
const
|
|
1261
|
+
const se = "Your session has expired. For your security, please log in again to continue.", Ia = "Your session has been successfully terminated.", Ve = "Login failed. Please try again.", Sa = "Error getting access token, please re-authenticate.", _a = "You forgot to wrap your component in <AuthProvider>.", xe = {
|
|
1262
1262
|
dev: "https://auth.gizmette.local.com:3003",
|
|
1263
1263
|
prod: "https://mylogin.gizmette.com/auth"
|
|
1264
|
-
}, Ie = "@@auth@@", ge = "LOADING", ke = "LOGIN",
|
|
1264
|
+
}, Ie = "@@auth@@", ge = "LOADING", ke = "LOGIN", Gt = "LOGOUT", be = "success", V = "failure", Bt = "include", Jt = "POST", Vt = "application/json", Se = {
|
|
1265
1265
|
GET_REGISTRATION_OPTIONS: `mutation GetPasskeyRegistrationOptions(
|
|
1266
1266
|
$clientId: String!,
|
|
1267
1267
|
$username: String!,
|
|
@@ -1342,7 +1342,7 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1342
1342
|
email
|
|
1343
1343
|
}
|
|
1344
1344
|
}`
|
|
1345
|
-
},
|
|
1345
|
+
}, ie = {
|
|
1346
1346
|
GET_REGISTRATION_OPTIONS: {
|
|
1347
1347
|
schema: Se.GET_REGISTRATION_OPTIONS,
|
|
1348
1348
|
method: "getPasskeyRegistrationOptions"
|
|
@@ -1359,7 +1359,7 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1359
1359
|
schema: Se.VERIFY_AUTHENTICATION,
|
|
1360
1360
|
method: "verifyPasskeyAuthentication"
|
|
1361
1361
|
}
|
|
1362
|
-
},
|
|
1362
|
+
}, ce = async ({
|
|
1363
1363
|
accessToken: e,
|
|
1364
1364
|
type: t,
|
|
1365
1365
|
clientId: r,
|
|
@@ -1367,14 +1367,14 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1367
1367
|
}) => {
|
|
1368
1368
|
try {
|
|
1369
1369
|
const n = `Bearer ${e}`, o = await fetch(
|
|
1370
|
-
|
|
1370
|
+
Yt ? `${xe.dev}/graphql` : `${xe.prod}/graphql`,
|
|
1371
1371
|
{
|
|
1372
|
-
credentials:
|
|
1373
|
-
method:
|
|
1372
|
+
credentials: Bt,
|
|
1373
|
+
method: Jt,
|
|
1374
1374
|
headers: {
|
|
1375
1375
|
authorization: n,
|
|
1376
|
-
"Content-Type":
|
|
1377
|
-
[
|
|
1376
|
+
"Content-Type": Vt,
|
|
1377
|
+
[Rt.CLIENT_ID]: `${r}`
|
|
1378
1378
|
},
|
|
1379
1379
|
body: JSON.stringify({
|
|
1380
1380
|
query: t.schema,
|
|
@@ -1399,13 +1399,13 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1399
1399
|
}) => {
|
|
1400
1400
|
try {
|
|
1401
1401
|
const a = await fetch(
|
|
1402
|
-
|
|
1402
|
+
Yt ? `${xe.dev}/${e}` : `${xe.prod}/${e}`,
|
|
1403
1403
|
{
|
|
1404
|
-
credentials:
|
|
1405
|
-
method:
|
|
1404
|
+
credentials: Bt,
|
|
1405
|
+
method: Jt,
|
|
1406
1406
|
headers: {
|
|
1407
|
-
"Content-Type":
|
|
1408
|
-
[
|
|
1407
|
+
"Content-Type": Vt,
|
|
1408
|
+
[Rt.CLIENT_ID]: `${t}`
|
|
1409
1409
|
},
|
|
1410
1410
|
body: JSON.stringify(r)
|
|
1411
1411
|
}
|
|
@@ -1420,21 +1420,21 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1420
1420
|
} catch (a) {
|
|
1421
1421
|
return console.error(a), { status: V, data: [] };
|
|
1422
1422
|
}
|
|
1423
|
-
},
|
|
1423
|
+
}, ka = process.env.NODE_ENV === "production", Yt = !ka, zt = {
|
|
1424
1424
|
isLoading: !0,
|
|
1425
1425
|
isAuthenticated: !1,
|
|
1426
1426
|
user: void 0,
|
|
1427
1427
|
logoutReason: "",
|
|
1428
1428
|
debug: !1,
|
|
1429
1429
|
authenticationType: ""
|
|
1430
|
-
},
|
|
1430
|
+
}, Aa = (e) => {
|
|
1431
1431
|
try {
|
|
1432
|
-
const t =
|
|
1432
|
+
const t = ia(e);
|
|
1433
1433
|
return t ? t[A.USER_ID_KEY] : "";
|
|
1434
1434
|
} catch {
|
|
1435
1435
|
return "";
|
|
1436
1436
|
}
|
|
1437
|
-
},
|
|
1437
|
+
}, va = async ({
|
|
1438
1438
|
userId: e,
|
|
1439
1439
|
clientId: t,
|
|
1440
1440
|
domain: r,
|
|
@@ -1458,7 +1458,7 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1458
1458
|
status: V
|
|
1459
1459
|
};
|
|
1460
1460
|
}
|
|
1461
|
-
},
|
|
1461
|
+
}, Ra = async ({
|
|
1462
1462
|
username: e,
|
|
1463
1463
|
password: t,
|
|
1464
1464
|
clientId: r,
|
|
@@ -1502,7 +1502,7 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1502
1502
|
status: !1
|
|
1503
1503
|
};
|
|
1504
1504
|
}
|
|
1505
|
-
},
|
|
1505
|
+
}, Na = async ({
|
|
1506
1506
|
nonce: e,
|
|
1507
1507
|
clientId: t,
|
|
1508
1508
|
code_challenge: r
|
|
@@ -1531,7 +1531,7 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1531
1531
|
data: ""
|
|
1532
1532
|
};
|
|
1533
1533
|
}
|
|
1534
|
-
},
|
|
1534
|
+
}, xa = async ({
|
|
1535
1535
|
clientId: e,
|
|
1536
1536
|
userId: t,
|
|
1537
1537
|
nonce: r,
|
|
@@ -1567,7 +1567,7 @@ const oe = "Your session has expired. For your security, please log in again to
|
|
|
1567
1567
|
};
|
|
1568
1568
|
}
|
|
1569
1569
|
};
|
|
1570
|
-
class
|
|
1570
|
+
class Ca {
|
|
1571
1571
|
constructor(t = null, r = null) {
|
|
1572
1572
|
Ke(this, "refreshTokenPromise", null), Ke(this, "accessToken"), Ke(this, "refreshToken"), this.accessToken = t || "", this.refreshToken = r || "";
|
|
1573
1573
|
}
|
|
@@ -1597,7 +1597,7 @@ class Oa {
|
|
|
1597
1597
|
}) {
|
|
1598
1598
|
const o = await ye(this.refreshToken);
|
|
1599
1599
|
if (o && o.payload[A.USER_ID_KEY] !== "") {
|
|
1600
|
-
const s = await
|
|
1600
|
+
const s = await xa({
|
|
1601
1601
|
clientId: t,
|
|
1602
1602
|
userId: r,
|
|
1603
1603
|
nonce: a,
|
|
@@ -1618,29 +1618,29 @@ class Oa {
|
|
|
1618
1618
|
};
|
|
1619
1619
|
}
|
|
1620
1620
|
}
|
|
1621
|
-
const
|
|
1621
|
+
const Oa = (e) => q(
|
|
1622
1622
|
(...t) => {
|
|
1623
1623
|
e && console.info(`==> [Auth ${Date.now()}]: `, ...t);
|
|
1624
1624
|
},
|
|
1625
1625
|
[e]
|
|
1626
|
-
),
|
|
1627
|
-
throw new Error(
|
|
1628
|
-
},
|
|
1626
|
+
), le = () => {
|
|
1627
|
+
throw new Error(_a);
|
|
1628
|
+
}, Ft = ar({
|
|
1629
1629
|
isAuthenticated: !1,
|
|
1630
1630
|
isLoading: !1,
|
|
1631
|
-
login:
|
|
1632
|
-
logout:
|
|
1633
|
-
getAccessToken:
|
|
1634
|
-
getIdToken:
|
|
1635
|
-
registeringForPasskey:
|
|
1636
|
-
loginWithPasskey:
|
|
1631
|
+
login: le,
|
|
1632
|
+
logout: le,
|
|
1633
|
+
getAccessToken: le,
|
|
1634
|
+
getIdToken: le,
|
|
1635
|
+
registeringForPasskey: le,
|
|
1636
|
+
loginWithPasskey: le,
|
|
1637
1637
|
logoutReason: "",
|
|
1638
1638
|
authenticationType: ""
|
|
1639
|
-
}),
|
|
1640
|
-
state:
|
|
1639
|
+
}), Pa = z.createContext({
|
|
1640
|
+
state: zt,
|
|
1641
1641
|
dispatch: () => {
|
|
1642
1642
|
}
|
|
1643
|
-
}),
|
|
1643
|
+
}), Da = (e, t) => (t == null ? void 0 : t.type) === ge ? {
|
|
1644
1644
|
...e,
|
|
1645
1645
|
isLoading: t.payload.isLoading
|
|
1646
1646
|
} : (t == null ? void 0 : t.type) === ke ? {
|
|
@@ -1650,24 +1650,24 @@ const Pa = (e) => q(
|
|
|
1650
1650
|
user: t.payload.user,
|
|
1651
1651
|
authenticationType: t.payload.authenticationType,
|
|
1652
1652
|
logoutReason: ""
|
|
1653
|
-
} : (t == null ? void 0 : t.type) ===
|
|
1653
|
+
} : (t == null ? void 0 : t.type) === Gt ? {
|
|
1654
1654
|
...e,
|
|
1655
1655
|
isLoading: !1,
|
|
1656
1656
|
isAuthenticated: !1,
|
|
1657
1657
|
user: void 0,
|
|
1658
1658
|
authenticationType: "",
|
|
1659
1659
|
logoutReason: t.payload.logoutReason
|
|
1660
|
-
} : e,
|
|
1660
|
+
} : e, La = ({
|
|
1661
1661
|
children: e,
|
|
1662
1662
|
sessionExpiration: t,
|
|
1663
1663
|
clientId: r,
|
|
1664
1664
|
domain: a = "",
|
|
1665
1665
|
debug: n = !1
|
|
1666
1666
|
}) => {
|
|
1667
|
-
const [o, s] =
|
|
1668
|
-
...
|
|
1667
|
+
const [o, s] = wt(Da, {
|
|
1668
|
+
...zt,
|
|
1669
1669
|
debug: n
|
|
1670
|
-
}), i =
|
|
1670
|
+
}), i = Oa(n), d = $(!1), [m, p, , u] = Te({
|
|
1671
1671
|
key: `${Ie}::${r}::@@user@@`
|
|
1672
1672
|
}), [c, h, , f] = Te({
|
|
1673
1673
|
key: `${Ie}::${r}::@@access@@`
|
|
@@ -1677,7 +1677,7 @@ const Pa = (e) => q(
|
|
|
1677
1677
|
}
|
|
1678
1678
|
), [M, U, , K] = Te({
|
|
1679
1679
|
key: `${Ie}::${r}::@@nonce@@`
|
|
1680
|
-
}), N = new
|
|
1680
|
+
}), N = new Ca(c, E), H = q(() => {
|
|
1681
1681
|
i("removeLocalStorage: removing local storage"), u(), f(), I(), K();
|
|
1682
1682
|
}, [
|
|
1683
1683
|
f,
|
|
@@ -1691,9 +1691,9 @@ const Pa = (e) => q(
|
|
|
1691
1691
|
"removeStateAndLocalStorage: removing state and local storage with reason: ",
|
|
1692
1692
|
y
|
|
1693
1693
|
), s({
|
|
1694
|
-
type:
|
|
1694
|
+
type: Gt,
|
|
1695
1695
|
payload: {
|
|
1696
|
-
logoutReason: y ||
|
|
1696
|
+
logoutReason: y || se
|
|
1697
1697
|
}
|
|
1698
1698
|
}), H(), s({ type: ge, payload: { isLoading: !1 } });
|
|
1699
1699
|
},
|
|
@@ -1701,15 +1701,15 @@ const Pa = (e) => q(
|
|
|
1701
1701
|
), x = q(
|
|
1702
1702
|
async (y) => {
|
|
1703
1703
|
i("invalidateAndLogout: invalidating and logging out");
|
|
1704
|
-
const { user: T } = o, b = (T == null ? void 0 : T.userId) ||
|
|
1704
|
+
const { user: T } = o, b = (T == null ? void 0 : T.userId) || Aa(m);
|
|
1705
1705
|
b || i(
|
|
1706
1706
|
"invalidateAndLogout: user cannot be identified, logging out without userId"
|
|
1707
|
-
), await
|
|
1707
|
+
), await va({
|
|
1708
1708
|
userId: b,
|
|
1709
1709
|
clientId: r,
|
|
1710
1710
|
domain: a,
|
|
1711
1711
|
idToken: m
|
|
1712
|
-
}), W(y ||
|
|
1712
|
+
}), W(y || se);
|
|
1713
1713
|
},
|
|
1714
1714
|
[m, o, r, a, W, i]
|
|
1715
1715
|
);
|
|
@@ -1728,11 +1728,11 @@ const Pa = (e) => q(
|
|
|
1728
1728
|
email: y.payload[A.EMAIL_KEY]
|
|
1729
1729
|
}
|
|
1730
1730
|
}
|
|
1731
|
-
})) : (i("useEffect: invalid JWT, invalidating and logging out"), await x(
|
|
1731
|
+
})) : (i("useEffect: invalid JWT, invalidating and logging out"), await x(se));
|
|
1732
1732
|
} catch {
|
|
1733
1733
|
i(
|
|
1734
1734
|
"useEffect: exception validating JWT, invalidating and logging out"
|
|
1735
|
-
), await x(
|
|
1735
|
+
), await x(se);
|
|
1736
1736
|
}
|
|
1737
1737
|
})() : (i("useEffect: setting the loading state to false"), s({ type: ge, payload: { isLoading: !1 } })), () => {
|
|
1738
1738
|
d.current = !0;
|
|
@@ -1742,13 +1742,13 @@ const Pa = (e) => q(
|
|
|
1742
1742
|
s({ type: ge, payload: { isLoading: !0 } }), H();
|
|
1743
1743
|
const b = Je();
|
|
1744
1744
|
U(b), i("login: Logging in with password");
|
|
1745
|
-
const { code_verifier:
|
|
1745
|
+
const { code_verifier: re, code_challenge: rr } = await ga(), nt = await Na({
|
|
1746
1746
|
nonce: b,
|
|
1747
1747
|
clientId: r,
|
|
1748
|
-
code_challenge:
|
|
1748
|
+
code_challenge: rr
|
|
1749
1749
|
});
|
|
1750
1750
|
if (nt.status) {
|
|
1751
|
-
const
|
|
1751
|
+
const ae = await Ra({
|
|
1752
1752
|
username: y,
|
|
1753
1753
|
password: T,
|
|
1754
1754
|
clientId: r,
|
|
@@ -1756,33 +1756,33 @@ const Pa = (e) => q(
|
|
|
1756
1756
|
nonce: b,
|
|
1757
1757
|
type: ue.CODE,
|
|
1758
1758
|
code: nt.data,
|
|
1759
|
-
code_verifier:
|
|
1759
|
+
code_verifier: re,
|
|
1760
1760
|
domain: a,
|
|
1761
1761
|
ua: navigator.userAgent
|
|
1762
1762
|
});
|
|
1763
|
-
return
|
|
1763
|
+
return ae.status ? (p(ae.idToken), h(ae.accessToken), w(ae.refreshToken), s({
|
|
1764
1764
|
type: ke,
|
|
1765
1765
|
payload: {
|
|
1766
1766
|
authenticationType: ue.CODE,
|
|
1767
1767
|
user: {
|
|
1768
|
-
userId:
|
|
1768
|
+
userId: ae.userId,
|
|
1769
1769
|
username: y,
|
|
1770
|
-
email:
|
|
1770
|
+
email: ae.email
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
1773
|
}), !0) : (W(Ve), !1);
|
|
1774
1774
|
}
|
|
1775
1775
|
return !1;
|
|
1776
1776
|
}, Z = async (y) => {
|
|
1777
|
-
y == null || y.preventDefault(), await x(
|
|
1777
|
+
y == null || y.preventDefault(), await x(Ia);
|
|
1778
1778
|
}, v = async () => {
|
|
1779
1779
|
const { isAuthenticated: y, user: T } = o;
|
|
1780
1780
|
try {
|
|
1781
1781
|
if (y && T && T.userId) {
|
|
1782
1782
|
if (c) {
|
|
1783
1783
|
i("getAccessToken");
|
|
1784
|
-
const
|
|
1785
|
-
if (
|
|
1784
|
+
const re = await ye(c);
|
|
1785
|
+
if (re && re.payload[A.USER_ID_KEY] !== "")
|
|
1786
1786
|
return c;
|
|
1787
1787
|
}
|
|
1788
1788
|
i("getAccessToken: invalid access token, trying to refresh it");
|
|
@@ -1794,22 +1794,22 @@ const Pa = (e) => q(
|
|
|
1794
1794
|
});
|
|
1795
1795
|
return b.status && b.status === "success" && b.newAccessToken ? (h(b.newAccessToken), w(b.newRefreshToken), b.newAccessToken) : (i(
|
|
1796
1796
|
"getAccessToken: invalid refresh token, need to re-authenticate"
|
|
1797
|
-
), await x(
|
|
1797
|
+
), await x(se), "");
|
|
1798
1798
|
}
|
|
1799
1799
|
return i(
|
|
1800
1800
|
"getAccessToken: user is not authenticated, cannot get access token"
|
|
1801
|
-
), await x(
|
|
1801
|
+
), await x(se), "";
|
|
1802
1802
|
} catch {
|
|
1803
1803
|
return i(
|
|
1804
1804
|
"getAccessToken: exception occurred, invalidating and logging out"
|
|
1805
|
-
), await x(
|
|
1805
|
+
), await x(Sa), "";
|
|
1806
1806
|
}
|
|
1807
1807
|
}, P = () => o.isAuthenticated && m ? m : "", G = async () => {
|
|
1808
1808
|
const { user: y } = o;
|
|
1809
|
-
let T = await
|
|
1809
|
+
let T = await ce({
|
|
1810
1810
|
accessToken: c,
|
|
1811
1811
|
clientId: r,
|
|
1812
|
-
type:
|
|
1812
|
+
type: ie.GET_REGISTRATION_OPTIONS,
|
|
1813
1813
|
params: {
|
|
1814
1814
|
clientId: r,
|
|
1815
1815
|
id: y == null ? void 0 : y.userId,
|
|
@@ -1818,11 +1818,11 @@ const Pa = (e) => q(
|
|
|
1818
1818
|
});
|
|
1819
1819
|
if (T.status)
|
|
1820
1820
|
try {
|
|
1821
|
-
const b = await
|
|
1822
|
-
return T = await
|
|
1821
|
+
const b = await hr(T.data);
|
|
1822
|
+
return T = await ce({
|
|
1823
1823
|
accessToken: c,
|
|
1824
1824
|
clientId: r,
|
|
1825
|
-
type:
|
|
1825
|
+
type: ie.VERIFY_REGISTRATION,
|
|
1826
1826
|
params: {
|
|
1827
1827
|
clientId: r,
|
|
1828
1828
|
id: y == null ? void 0 : y.userId,
|
|
@@ -1831,10 +1831,10 @@ const Pa = (e) => q(
|
|
|
1831
1831
|
}
|
|
1832
1832
|
}), !!(T.status && T.data.length > 0);
|
|
1833
1833
|
} catch {
|
|
1834
|
-
return await
|
|
1834
|
+
return await ce({
|
|
1835
1835
|
accessToken: c,
|
|
1836
1836
|
clientId: r,
|
|
1837
|
-
type:
|
|
1837
|
+
type: ie.VERIFY_REGISTRATION,
|
|
1838
1838
|
params: {
|
|
1839
1839
|
clientId: r,
|
|
1840
1840
|
id: y == null ? void 0 : y.userId,
|
|
@@ -1849,10 +1849,10 @@ const Pa = (e) => q(
|
|
|
1849
1849
|
const y = Je();
|
|
1850
1850
|
U(y), i("loginWithPasskey");
|
|
1851
1851
|
const T = Je();
|
|
1852
|
-
let b = await
|
|
1852
|
+
let b = await ce({
|
|
1853
1853
|
accessToken: c,
|
|
1854
1854
|
clientId: r,
|
|
1855
|
-
type:
|
|
1855
|
+
type: ie.GET_AUTHENTICATION_OPTIONS,
|
|
1856
1856
|
params: {
|
|
1857
1857
|
id: T,
|
|
1858
1858
|
clientId: r
|
|
@@ -1860,15 +1860,15 @@ const Pa = (e) => q(
|
|
|
1860
1860
|
});
|
|
1861
1861
|
if (b.status)
|
|
1862
1862
|
try {
|
|
1863
|
-
const
|
|
1864
|
-
return b = await
|
|
1863
|
+
const re = await gr(b.data);
|
|
1864
|
+
return b = await ce({
|
|
1865
1865
|
accessToken: c,
|
|
1866
1866
|
clientId: r,
|
|
1867
|
-
type:
|
|
1867
|
+
type: ie.VERIFY_AUTHENTICATION,
|
|
1868
1868
|
params: {
|
|
1869
1869
|
clientId: r,
|
|
1870
1870
|
id: T,
|
|
1871
|
-
authentication:
|
|
1871
|
+
authentication: re,
|
|
1872
1872
|
nonce: y,
|
|
1873
1873
|
domain: a,
|
|
1874
1874
|
sessionExpiration: t,
|
|
@@ -1886,10 +1886,10 @@ const Pa = (e) => q(
|
|
|
1886
1886
|
}
|
|
1887
1887
|
}), !0) : (W(Ve), !1);
|
|
1888
1888
|
} catch {
|
|
1889
|
-
return await
|
|
1889
|
+
return await ce({
|
|
1890
1890
|
accessToken: c,
|
|
1891
1891
|
clientId: r,
|
|
1892
|
-
type:
|
|
1892
|
+
type: ie.VERIFY_AUTHENTICATION,
|
|
1893
1893
|
params: {
|
|
1894
1894
|
clientId: r,
|
|
1895
1895
|
id: T,
|
|
@@ -1902,8 +1902,8 @@ const Pa = (e) => q(
|
|
|
1902
1902
|
}
|
|
1903
1903
|
return !1;
|
|
1904
1904
|
};
|
|
1905
|
-
return /* @__PURE__ */ l(
|
|
1906
|
-
|
|
1905
|
+
return /* @__PURE__ */ l(Pa.Provider, { value: { state: o, dispatch: s }, children: /* @__PURE__ */ l(
|
|
1906
|
+
Ft.Provider,
|
|
1907
1907
|
{
|
|
1908
1908
|
value: {
|
|
1909
1909
|
...o,
|
|
@@ -1917,8 +1917,8 @@ const Pa = (e) => q(
|
|
|
1917
1917
|
children: e
|
|
1918
1918
|
}
|
|
1919
1919
|
) });
|
|
1920
|
-
},
|
|
1921
|
-
function
|
|
1920
|
+
}, jt = (e = Ft) => Tt(e), io = "user", co = "assistant", lo = "system", uo = "internal", ho = "hidden", mo = "I'm having trouble right now. Please try again later.", po = "OpenAI", go = "OpenAI", yo = "Anthropic", fo = "action-message", bo = "action-reset", Eo = "action-model", wo = "action-restore", To = "action-streaming", Io = "action-engine", So = "action-search", _o = "action-sort", ko = "action-toggle-tag", Ao = "action-reset-tags", vo = "action-set-tags", Ro = "sassy-saint-", No = "details", xo = "search", Co = "sort", Oo = "engine-toggle", Po = "==stats==", $a = "b44c68f0-e5b3-4a1d-a3e3-df8632b0223b", Do = 10, Lo = 30, ft = (e) => Number.isFinite(e) ? e : 0;
|
|
1921
|
+
function Ma(e) {
|
|
1922
1922
|
return {
|
|
1923
1923
|
days: Math.trunc(e / 864e5),
|
|
1924
1924
|
hours: Math.trunc(e / 36e5 % 24),
|
|
@@ -1929,7 +1929,7 @@ function Ua(e) {
|
|
|
1929
1929
|
nanoseconds: Math.trunc(ft(e * 1e6) % 1e3)
|
|
1930
1930
|
};
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1932
|
+
function Ua(e) {
|
|
1933
1933
|
return {
|
|
1934
1934
|
days: e / 86400000n,
|
|
1935
1935
|
hours: e / 3600000n % 24n,
|
|
@@ -1940,20 +1940,20 @@ function Ka(e) {
|
|
|
1940
1940
|
nanoseconds: 0n
|
|
1941
1941
|
};
|
|
1942
1942
|
}
|
|
1943
|
-
function
|
|
1943
|
+
function Ka(e) {
|
|
1944
1944
|
switch (typeof e) {
|
|
1945
1945
|
case "number": {
|
|
1946
1946
|
if (Number.isFinite(e))
|
|
1947
|
-
return
|
|
1947
|
+
return Ma(e);
|
|
1948
1948
|
break;
|
|
1949
1949
|
}
|
|
1950
1950
|
case "bigint":
|
|
1951
|
-
return
|
|
1951
|
+
return Ua(e);
|
|
1952
1952
|
}
|
|
1953
1953
|
throw new TypeError("Expected a finite number or bigint");
|
|
1954
1954
|
}
|
|
1955
|
-
const
|
|
1956
|
-
function
|
|
1955
|
+
const Ha = (e) => e === 0 || e === 0n, Wa = (e, t) => t === 1 || t === 1n ? e : `${e}s`, Ga = 1e-7, Ba = 24n * 60n * 60n * 1000n;
|
|
1956
|
+
function Ja(e, t) {
|
|
1957
1957
|
const r = typeof e == "bigint";
|
|
1958
1958
|
if (!r && !Number.isFinite(e))
|
|
1959
1959
|
throw new TypeError("Expected a finite number or bigint");
|
|
@@ -1962,18 +1962,18 @@ function Va(e, t) {
|
|
|
1962
1962
|
e = e < 0 ? -e : e, t.colonNotation && (t.compact = !1, t.formatSubMilliseconds = !1, t.separateMilliseconds = !1, t.verbose = !1), t.compact && (t.unitCount = 1, t.secondsDecimalDigits = 0, t.millisecondsDecimalDigits = 0);
|
|
1963
1963
|
let n = [];
|
|
1964
1964
|
const o = (p, u) => {
|
|
1965
|
-
const c = Math.floor(p * 10 ** u +
|
|
1965
|
+
const c = Math.floor(p * 10 ** u + Ga);
|
|
1966
1966
|
return (Math.round(c) / 10 ** u).toFixed(u);
|
|
1967
1967
|
}, s = (p, u, c, h) => {
|
|
1968
|
-
if (!((n.length === 0 || !t.colonNotation) &&
|
|
1968
|
+
if (!((n.length === 0 || !t.colonNotation) && Ha(p) && !(t.colonNotation && c === "m"))) {
|
|
1969
1969
|
if (h ?? (h = String(p)), t.colonNotation) {
|
|
1970
1970
|
const f = h.includes(".") ? h.split(".")[0].length : h.length, E = n.length > 0 ? 2 : 1;
|
|
1971
1971
|
h = "0".repeat(Math.max(0, E - f)) + h;
|
|
1972
1972
|
} else
|
|
1973
|
-
h += t.verbose ? " " +
|
|
1973
|
+
h += t.verbose ? " " + Wa(u, p) : c;
|
|
1974
1974
|
n.push(h);
|
|
1975
1975
|
}
|
|
1976
|
-
}, i =
|
|
1976
|
+
}, i = Ka(e), d = BigInt(i.days);
|
|
1977
1977
|
if (t.hideYearAndDays ? s(BigInt(d) * 24n + BigInt(i.hours), "hour", "h") : (t.hideYear ? s(d, "day", "d") : (s(d / 365n, "year", "y"), s(d % 365n, "day", "d")), s(Number(i.hours), "hour", "h")), s(Number(i.minutes), "minute", "m"), !t.hideSeconds)
|
|
1978
1978
|
if (t.separateMilliseconds || t.formatSubMilliseconds || !t.colonNotation && e < 1e3) {
|
|
1979
1979
|
const p = Number(i.seconds), u = Number(i.milliseconds), c = Number(i.microseconds), h = Number(i.nanoseconds);
|
|
@@ -1989,7 +1989,7 @@ function Va(e, t) {
|
|
|
1989
1989
|
);
|
|
1990
1990
|
}
|
|
1991
1991
|
} else {
|
|
1992
|
-
const p = (r ? Number(e %
|
|
1992
|
+
const p = (r ? Number(e % Ba) : e) / 1e3 % 60, u = typeof t.secondsDecimalDigits == "number" ? t.secondsDecimalDigits : 1, c = o(p, u), h = t.keepDecimalsOnWholeSeconds ? c : c.replace(/\.0+$/, "");
|
|
1993
1993
|
s(Number.parseFloat(h), "second", "s", h);
|
|
1994
1994
|
}
|
|
1995
1995
|
if (n.length === 0)
|
|
@@ -1997,7 +1997,7 @@ function Va(e, t) {
|
|
|
1997
1997
|
const m = t.colonNotation ? ":" : " ";
|
|
1998
1998
|
return typeof t.unitCount == "number" && (n = n.slice(0, Math.max(t.unitCount, 1))), a + n.join(m);
|
|
1999
1999
|
}
|
|
2000
|
-
const
|
|
2000
|
+
const Va = process.env.NODE_ENV === "production", Ya = !Va, za = Ya ? "gizmette.local.com" : "gizmette.com", $o = async () => {
|
|
2001
2001
|
const e = {
|
|
2002
2002
|
/**
|
|
2003
2003
|
* A boolean value that indicates the application would
|
|
@@ -2046,27 +2046,27 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2046
2046
|
e
|
|
2047
2047
|
);
|
|
2048
2048
|
});
|
|
2049
|
-
}, Mo = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ l("dl", { className: "my-0", children: /* @__PURE__ */
|
|
2049
|
+
}, Mo = (e, t) => t ? Object.keys(t).map((r) => /* @__PURE__ */ l("dl", { className: "my-0", children: /* @__PURE__ */ O("div", { className: "flex items-center justify-between", children: [
|
|
2050
2050
|
/* @__PURE__ */ l("dt", { className: "my-1 inline-block font-bold text-copy-dark dark:text-copy-lighter", children: r }),
|
|
2051
2051
|
/* @__PURE__ */ l("dd", { className: "my-1 inline-block", children: t[r] })
|
|
2052
|
-
] }) }, `${e}-${r}`)) : null, Uo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Ko = (e) => e > 0 ?
|
|
2052
|
+
] }) }, `${e}-${r}`)) : null, Uo = (e, t) => t && t.messages.length > 0 && t.messages[t.messages.length - 1].message.role === e, Ko = (e) => e > 0 ? Ja(e, {
|
|
2053
2053
|
secondsDecimalDigits: 2,
|
|
2054
2054
|
unitCount: 2
|
|
2055
|
-
}) : "N/A",
|
|
2055
|
+
}) : "N/A", Fa = ({
|
|
2056
2056
|
isAuthenticated: e,
|
|
2057
2057
|
extraClass: t
|
|
2058
2058
|
}) => g(
|
|
2059
2059
|
"flex-1 overflow-y-auto bg-slate-900 px-4 pb-10 text-base leading-6 text-slate-300 shadow-sm sm:text-base sm:leading-7",
|
|
2060
2060
|
e ? "pt-0" : "pt-10",
|
|
2061
2061
|
t
|
|
2062
|
-
),
|
|
2062
|
+
), ja = ({
|
|
2063
2063
|
extraClass: e
|
|
2064
2064
|
}) => g("px-2 sm:px-0", e), Ho = (e, t) => t === 1 ? e : `${e}s`, Wo = (e, t) => {
|
|
2065
2065
|
let r;
|
|
2066
2066
|
return (...a) => {
|
|
2067
2067
|
window.clearTimeout(r), r = window.setTimeout(() => e(...a), t);
|
|
2068
2068
|
};
|
|
2069
|
-
}, bt = "av-button", $e = "icon", tt = "button", qe = "link",
|
|
2069
|
+
}, bt = "av-button", $e = "icon", tt = "button", qe = "link", qa = ({
|
|
2070
2070
|
type: e,
|
|
2071
2071
|
size: t,
|
|
2072
2072
|
labelRight: r,
|
|
@@ -2095,7 +2095,7 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2095
2095
|
"h-12 px-4": t === "large" && (r || a)
|
|
2096
2096
|
});
|
|
2097
2097
|
}
|
|
2098
|
-
},
|
|
2098
|
+
}, Xa = ({
|
|
2099
2099
|
type: e,
|
|
2100
2100
|
size: t,
|
|
2101
2101
|
labelRight: r,
|
|
@@ -2118,7 +2118,7 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2118
2118
|
[s]: t === "large" && (r || a)
|
|
2119
2119
|
});
|
|
2120
2120
|
}
|
|
2121
|
-
},
|
|
2121
|
+
}, Qa = ({
|
|
2122
2122
|
mode: e,
|
|
2123
2123
|
noBackground: t,
|
|
2124
2124
|
noTruncate: r,
|
|
@@ -2129,36 +2129,32 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2129
2129
|
if (a === "primary")
|
|
2130
2130
|
return g("not-prose", {
|
|
2131
2131
|
truncate: !r,
|
|
2132
|
-
"text-copy-light": e === "dark",
|
|
2133
|
-
"text-copy-lighter": e === "light",
|
|
2134
|
-
"
|
|
2135
|
-
"
|
|
2132
|
+
"text-copy-light": e === "dark" || e === "system",
|
|
2133
|
+
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
2134
|
+
"dark:text-copy-lighter": e === "system",
|
|
2135
|
+
"dark:text-copy-light": e === "alt-system"
|
|
2136
2136
|
});
|
|
2137
2137
|
if (a === "secondary")
|
|
2138
2138
|
return g("not-prose", {
|
|
2139
2139
|
truncate: !r,
|
|
2140
|
-
"text-copy-light": e === "light",
|
|
2141
|
-
"text-copy-lighter": e === "dark",
|
|
2142
|
-
"
|
|
2143
|
-
"
|
|
2140
|
+
"text-copy-light": e === "light" || e === "system",
|
|
2141
|
+
"text-copy-lighter": e === "dark" || e === "alt-system",
|
|
2142
|
+
"dark:text-copy-lighter": e === "alt-system",
|
|
2143
|
+
"dark:text-copy-light": e === "system"
|
|
2144
2144
|
});
|
|
2145
2145
|
if (a === "danger")
|
|
2146
2146
|
return g("not-prose", {
|
|
2147
2147
|
truncate: !r,
|
|
2148
|
-
"text-copy-light": e === "dark",
|
|
2149
|
-
"text-copy-lighter": e === "light",
|
|
2150
|
-
"
|
|
2151
|
-
"
|
|
2148
|
+
"text-copy-light": e === "dark" || e === "system",
|
|
2149
|
+
"text-copy-lighter": e === "light" || e === "alt-system",
|
|
2150
|
+
"dark:text-copy-lighter": e === "system",
|
|
2151
|
+
"dark:text-copy-light": e === "alt-system"
|
|
2152
2152
|
});
|
|
2153
2153
|
if (a === "selected")
|
|
2154
|
-
return g("not-prose", {
|
|
2155
|
-
truncate: !r
|
|
2156
|
-
"text-copy-light": e === "dark",
|
|
2157
|
-
"text-copy-lighter": e === "light",
|
|
2158
|
-
"text-copy-light dark:text-copy-lighter": e === "system",
|
|
2159
|
-
"text-copy-lighter dark:text-copy-light": e === "alt-system"
|
|
2154
|
+
return g("not-prose text-copy-lighter", {
|
|
2155
|
+
truncate: !r
|
|
2160
2156
|
});
|
|
2161
|
-
},
|
|
2157
|
+
}, Za = ({
|
|
2162
2158
|
mode: e,
|
|
2163
2159
|
noBackground: t,
|
|
2164
2160
|
variant: r
|
|
@@ -2188,13 +2184,13 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2188
2184
|
if (r === "selected")
|
|
2189
2185
|
return "bg-action-selected-dark";
|
|
2190
2186
|
}
|
|
2191
|
-
},
|
|
2187
|
+
}, en = ({
|
|
2192
2188
|
radius: e
|
|
2193
2189
|
}) => g({
|
|
2194
2190
|
"rounded-full": e === "large",
|
|
2195
2191
|
"rounded-md": e === "medium",
|
|
2196
2192
|
"rounded-sm": e === "small"
|
|
2197
|
-
}),
|
|
2193
|
+
}), tn = ({
|
|
2198
2194
|
mode: e,
|
|
2199
2195
|
disabled: t,
|
|
2200
2196
|
variant: r
|
|
@@ -2224,7 +2220,7 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2224
2220
|
});
|
|
2225
2221
|
if (r === "selected")
|
|
2226
2222
|
return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
|
|
2227
|
-
},
|
|
2223
|
+
}, rn = ({
|
|
2228
2224
|
mode: e,
|
|
2229
2225
|
disabled: t,
|
|
2230
2226
|
variant: r
|
|
@@ -2254,7 +2250,7 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2254
2250
|
});
|
|
2255
2251
|
if (r === "selected")
|
|
2256
2252
|
return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
|
|
2257
|
-
},
|
|
2253
|
+
}, an = ({
|
|
2258
2254
|
mode: e,
|
|
2259
2255
|
noBorder: t,
|
|
2260
2256
|
variant: r
|
|
@@ -2284,7 +2280,7 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2284
2280
|
});
|
|
2285
2281
|
if (r === "selected")
|
|
2286
2282
|
return "border border-border-selected-dark";
|
|
2287
|
-
},
|
|
2283
|
+
}, nn = ({
|
|
2288
2284
|
focusMode: e
|
|
2289
2285
|
}) => g("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
|
|
2290
2286
|
"focus:outline-focus-dark": e === "dark",
|
|
@@ -2310,32 +2306,32 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2310
2306
|
radius: E
|
|
2311
2307
|
}) => (c || (c = "primary"), r ? g(bt, t) : g(
|
|
2312
2308
|
bt,
|
|
2313
|
-
|
|
2309
|
+
Qa({
|
|
2314
2310
|
mode: a,
|
|
2315
2311
|
variant: c,
|
|
2316
2312
|
noBackground: u,
|
|
2317
2313
|
noTruncate: h
|
|
2318
2314
|
}),
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2315
|
+
Za({ mode: a, noBackground: u, variant: c }),
|
|
2316
|
+
en({ radius: E }),
|
|
2317
|
+
qa({
|
|
2322
2318
|
type: e,
|
|
2323
2319
|
size: i,
|
|
2324
2320
|
labelRight: m,
|
|
2325
2321
|
labelLeft: p,
|
|
2326
2322
|
align: f
|
|
2327
2323
|
}),
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2324
|
+
Xa({ type: e, size: i, labelRight: m, labelLeft: p }),
|
|
2325
|
+
an({ mode: a, variant: c, noBorder: d }),
|
|
2326
|
+
nn({ focusMode: n }),
|
|
2327
|
+
tn({ mode: a, variant: c, disabled: o }),
|
|
2331
2328
|
rn({ mode: a, variant: c, disabled: o }),
|
|
2332
|
-
an({ mode: a, variant: c, disabled: o }),
|
|
2333
2329
|
{
|
|
2334
2330
|
"w-full": s,
|
|
2335
2331
|
"disabled:cursor-not-allowed disabled:opacity-50": o
|
|
2336
2332
|
},
|
|
2337
2333
|
t
|
|
2338
|
-
)),
|
|
2334
|
+
)), on = (e, t, r) => {
|
|
2339
2335
|
var a;
|
|
2340
2336
|
!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);
|
|
2341
2337
|
}, Me = z.forwardRef((e, t) => {
|
|
@@ -2345,14 +2341,14 @@ const Ya = process.env.NODE_ENV === "production", za = !Ya, Fa = za ? "gizmette.
|
|
|
2345
2341
|
{
|
|
2346
2342
|
ref: t,
|
|
2347
2343
|
onClick: (o) => {
|
|
2348
|
-
|
|
2344
|
+
on(o, a, r);
|
|
2349
2345
|
},
|
|
2350
2346
|
...n
|
|
2351
2347
|
}
|
|
2352
2348
|
);
|
|
2353
2349
|
});
|
|
2354
2350
|
Me.displayName = "BaseButton";
|
|
2355
|
-
const
|
|
2351
|
+
const qt = z.forwardRef(
|
|
2356
2352
|
({
|
|
2357
2353
|
children: e,
|
|
2358
2354
|
disabled: t = !1,
|
|
@@ -2394,7 +2390,7 @@ const Xt = z.forwardRef(
|
|
|
2394
2390
|
);
|
|
2395
2391
|
}
|
|
2396
2392
|
);
|
|
2397
|
-
|
|
2393
|
+
qt.displayName = "Button";
|
|
2398
2394
|
const Xe = z.forwardRef(
|
|
2399
2395
|
({
|
|
2400
2396
|
children: e,
|
|
@@ -2439,7 +2435,7 @@ const Xe = z.forwardRef(
|
|
|
2439
2435
|
"text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !i,
|
|
2440
2436
|
"text-copy-light dark:text-copy-accent-dark": r === "system" && !i
|
|
2441
2437
|
});
|
|
2442
|
-
return /* @__PURE__ */
|
|
2438
|
+
return /* @__PURE__ */ O(
|
|
2443
2439
|
Me,
|
|
2444
2440
|
{
|
|
2445
2441
|
ref: U,
|
|
@@ -2459,19 +2455,19 @@ const Xe = z.forwardRef(
|
|
|
2459
2455
|
);
|
|
2460
2456
|
Xe.displayName = "ButtonIcon";
|
|
2461
2457
|
/*!
|
|
2462
|
-
@versini/ui-button v4.0.
|
|
2458
|
+
@versini/ui-button v4.0.1
|
|
2463
2459
|
© 2025 gizmette.com
|
|
2464
2460
|
*/
|
|
2465
2461
|
try {
|
|
2466
2462
|
window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
|
|
2467
|
-
version: "4.0.
|
|
2468
|
-
buildTime: "01/
|
|
2463
|
+
version: "4.0.1",
|
|
2464
|
+
buildTime: "01/04/2025 10:02 AM EST",
|
|
2469
2465
|
homepage: "https://github.com/aversini/ui-components",
|
|
2470
2466
|
license: "MIT"
|
|
2471
2467
|
});
|
|
2472
2468
|
} catch {
|
|
2473
2469
|
}
|
|
2474
|
-
const
|
|
2470
|
+
const sn = z.forwardRef(
|
|
2475
2471
|
({
|
|
2476
2472
|
children: e,
|
|
2477
2473
|
disabled: t = !1,
|
|
@@ -2530,7 +2526,7 @@ const cn = z.forwardRef(
|
|
|
2530
2526
|
"after:border-table-light dark:after:border-table-dark": r === "alt-system"
|
|
2531
2527
|
}
|
|
2532
2528
|
) : "";
|
|
2533
|
-
return /* @__PURE__ */ l("div", { className: H, children: /* @__PURE__ */
|
|
2529
|
+
return /* @__PURE__ */ l("div", { className: H, children: /* @__PURE__ */ O(
|
|
2534
2530
|
Me,
|
|
2535
2531
|
{
|
|
2536
2532
|
ref: U,
|
|
@@ -2548,7 +2544,7 @@ const cn = z.forwardRef(
|
|
|
2548
2544
|
) });
|
|
2549
2545
|
}
|
|
2550
2546
|
);
|
|
2551
|
-
|
|
2547
|
+
sn.displayName = "ButtonSort";
|
|
2552
2548
|
/*!
|
|
2553
2549
|
@versini/ui-card v3.0.0
|
|
2554
2550
|
© 2025 gizmette.com
|
|
@@ -2563,11 +2559,11 @@ try {
|
|
|
2563
2559
|
} catch {
|
|
2564
2560
|
}
|
|
2565
2561
|
const Ae = "av-card";
|
|
2566
|
-
function
|
|
2567
|
-
const t =
|
|
2562
|
+
function cn(e) {
|
|
2563
|
+
const t = It();
|
|
2568
2564
|
return `${e}${t}`;
|
|
2569
2565
|
}
|
|
2570
|
-
const
|
|
2566
|
+
const ln = ({
|
|
2571
2567
|
className: e,
|
|
2572
2568
|
headerClassName: t,
|
|
2573
2569
|
bodyClassName: r,
|
|
@@ -2607,7 +2603,7 @@ const dn = ({
|
|
|
2607
2603
|
footer: p
|
|
2608
2604
|
};
|
|
2609
2605
|
};
|
|
2610
|
-
function
|
|
2606
|
+
function dn({
|
|
2611
2607
|
id: e,
|
|
2612
2608
|
content: t,
|
|
2613
2609
|
userAriaLabelledby: r,
|
|
@@ -2615,7 +2611,7 @@ function un({
|
|
|
2615
2611
|
}) {
|
|
2616
2612
|
return typeof t == "string" ? /* @__PURE__ */ l("h2", { id: e, className: a, children: t }) : r ? /* @__PURE__ */ l("div", { className: a, children: t }) : t ? /* @__PURE__ */ l("div", { className: a, id: e, children: t }) : null;
|
|
2617
2613
|
}
|
|
2618
|
-
const
|
|
2614
|
+
const un = ({
|
|
2619
2615
|
header: e,
|
|
2620
2616
|
headerClassName: t,
|
|
2621
2617
|
footer: r,
|
|
@@ -2630,7 +2626,7 @@ const hn = ({
|
|
|
2630
2626
|
...u
|
|
2631
2627
|
}) => {
|
|
2632
2628
|
let c = null, h = null;
|
|
2633
|
-
const f = typeof e == "string", E =
|
|
2629
|
+
const f = typeof e == "string", E = cn(Ae), w = ln({
|
|
2634
2630
|
className: o,
|
|
2635
2631
|
headerClassName: t,
|
|
2636
2632
|
bodyClassName: s,
|
|
@@ -2639,7 +2635,7 @@ const hn = ({
|
|
|
2639
2635
|
compact: m,
|
|
2640
2636
|
noBorder: p
|
|
2641
2637
|
});
|
|
2642
|
-
return f ? (c = E, h = c) : !f && e && i ? (c = null, h = i) : !f && e && !i ? (c = E, h = c) : (c = null, h = i || null), /* @__PURE__ */ l("div", { className: w.wrapper, children: /* @__PURE__ */
|
|
2638
|
+
return f ? (c = E, h = c) : !f && e && i ? (c = null, h = i) : !f && e && !i ? (c = E, h = c) : (c = null, h = i || null), /* @__PURE__ */ l("div", { className: w.wrapper, children: /* @__PURE__ */ O(
|
|
2643
2639
|
"section",
|
|
2644
2640
|
{
|
|
2645
2641
|
...h && {
|
|
@@ -2649,7 +2645,7 @@ const hn = ({
|
|
|
2649
2645
|
...u,
|
|
2650
2646
|
children: [
|
|
2651
2647
|
/* @__PURE__ */ l(
|
|
2652
|
-
|
|
2648
|
+
dn,
|
|
2653
2649
|
{
|
|
2654
2650
|
...c && { id: c },
|
|
2655
2651
|
content: e,
|
|
@@ -2674,7 +2670,7 @@ const hn = ({
|
|
|
2674
2670
|
...d
|
|
2675
2671
|
}) => {
|
|
2676
2672
|
const m = g(o, a);
|
|
2677
|
-
return /* @__PURE__ */
|
|
2673
|
+
return /* @__PURE__ */ O(Oe, { children: [
|
|
2678
2674
|
/* @__PURE__ */ l(
|
|
2679
2675
|
"svg",
|
|
2680
2676
|
{
|
|
@@ -2705,7 +2701,7 @@ try {
|
|
|
2705
2701
|
});
|
|
2706
2702
|
} catch {
|
|
2707
2703
|
}
|
|
2708
|
-
const
|
|
2704
|
+
const hn = ({ className: e, viewBox: t, ...r }) => /* @__PURE__ */ l(
|
|
2709
2705
|
Ue,
|
|
2710
2706
|
{
|
|
2711
2707
|
defaultViewBox: "0 0 1200 500",
|
|
@@ -2723,13 +2719,13 @@ const mn = ({ className: e, viewBox: t, ...r }) => /* @__PURE__ */ l(
|
|
|
2723
2719
|
}
|
|
2724
2720
|
) })
|
|
2725
2721
|
}
|
|
2726
|
-
),
|
|
2722
|
+
), mn = ({
|
|
2727
2723
|
className: e,
|
|
2728
2724
|
viewBox: t,
|
|
2729
2725
|
title: r,
|
|
2730
2726
|
monotone: a,
|
|
2731
2727
|
...n
|
|
2732
|
-
}) => /* @__PURE__ */
|
|
2728
|
+
}) => /* @__PURE__ */ O(
|
|
2733
2729
|
Ue,
|
|
2734
2730
|
{
|
|
2735
2731
|
defaultViewBox: "0 0 640 512",
|
|
@@ -2749,7 +2745,7 @@ const mn = ({ className: e, viewBox: t, ...r }) => /* @__PURE__ */ l(
|
|
|
2749
2745
|
/* @__PURE__ */ l("path", { d: "M5.1 9.2C13.3-1.2 28.4-3.1 38.8 5.1l592 464c10.4 8.2 12.3 23.3 4.1 33.7s-23.3 12.3-33.7 4.1L9.2 42.9C-1.2 34.7-3.1 19.6 5.1 9.2z" })
|
|
2750
2746
|
]
|
|
2751
2747
|
}
|
|
2752
|
-
),
|
|
2748
|
+
), pn = ({
|
|
2753
2749
|
className: e,
|
|
2754
2750
|
viewBox: t,
|
|
2755
2751
|
title: r,
|
|
@@ -2757,7 +2753,7 @@ const mn = ({ className: e, viewBox: t, ...r }) => /* @__PURE__ */ l(
|
|
|
2757
2753
|
...n
|
|
2758
2754
|
}) => {
|
|
2759
2755
|
const o = a ? "1" : "0.4";
|
|
2760
|
-
return /* @__PURE__ */
|
|
2756
|
+
return /* @__PURE__ */ O(
|
|
2761
2757
|
Ue,
|
|
2762
2758
|
{
|
|
2763
2759
|
defaultViewBox: "0 0 190 190",
|
|
@@ -2786,13 +2782,13 @@ const mn = ({ className: e, viewBox: t, ...r }) => /* @__PURE__ */ l(
|
|
|
2786
2782
|
]
|
|
2787
2783
|
}
|
|
2788
2784
|
);
|
|
2789
|
-
},
|
|
2785
|
+
}, gn = ({
|
|
2790
2786
|
className: e,
|
|
2791
2787
|
viewBox: t,
|
|
2792
2788
|
title: r,
|
|
2793
2789
|
monotone: a,
|
|
2794
2790
|
...n
|
|
2795
|
-
}) => /* @__PURE__ */
|
|
2791
|
+
}) => /* @__PURE__ */ O(
|
|
2796
2792
|
Ue,
|
|
2797
2793
|
{
|
|
2798
2794
|
defaultViewBox: "0 0 576 512",
|
|
@@ -2839,7 +2835,7 @@ try {
|
|
|
2839
2835
|
});
|
|
2840
2836
|
} catch {
|
|
2841
2837
|
}
|
|
2842
|
-
const
|
|
2838
|
+
const yn = "av-main", fn = ({
|
|
2843
2839
|
children: e,
|
|
2844
2840
|
className: t,
|
|
2845
2841
|
raw: r = !1,
|
|
@@ -2847,7 +2843,7 @@ const fn = "av-main", bn = ({
|
|
|
2847
2843
|
noPadding: n = !1
|
|
2848
2844
|
}) => {
|
|
2849
2845
|
const o = g(
|
|
2850
|
-
|
|
2846
|
+
yn,
|
|
2851
2847
|
{
|
|
2852
2848
|
"mt-2 sm:mt-3": !r && !a,
|
|
2853
2849
|
"p-2": !r && !n,
|
|
@@ -2856,10 +2852,10 @@ const fn = "av-main", bn = ({
|
|
|
2856
2852
|
t
|
|
2857
2853
|
);
|
|
2858
2854
|
return /* @__PURE__ */ l("main", { className: o, children: e });
|
|
2859
|
-
},
|
|
2855
|
+
}, bn = "av-flexgrid", _e = "av-flexgrid-item", Ce = 0.25, Qe = z.createContext({
|
|
2860
2856
|
columnGap: 0,
|
|
2861
2857
|
rowGap: 0
|
|
2862
|
-
}),
|
|
2858
|
+
}), En = ({
|
|
2863
2859
|
children: e,
|
|
2864
2860
|
className: t,
|
|
2865
2861
|
columnGap: r = 1,
|
|
@@ -2885,7 +2881,7 @@ const fn = "av-main", bn = ({
|
|
|
2885
2881
|
marginLeft: r * -1 * Ce + "rem",
|
|
2886
2882
|
marginTop: a * -1 * Ce + "rem"
|
|
2887
2883
|
}, u = g(
|
|
2888
|
-
|
|
2884
|
+
bn,
|
|
2889
2885
|
"box-border flex flex-wrap"
|
|
2890
2886
|
), c = { columnGap: r, rowGap: a };
|
|
2891
2887
|
return t ? /* @__PURE__ */ l("div", { className: t, children: /* @__PURE__ */ l("div", { className: u, style: p, ...m, children: /* @__PURE__ */ l(Qe.Provider, { value: c, children: e }) }) }) : /* @__PURE__ */ l("div", { className: u, style: p, ...m, children: /* @__PURE__ */ l(Qe.Provider, { value: c, children: e }) });
|
|
@@ -2985,13 +2981,13 @@ const fn = "av-main", bn = ({
|
|
|
2985
2981
|
r
|
|
2986
2982
|
);
|
|
2987
2983
|
}
|
|
2988
|
-
},
|
|
2984
|
+
}, te = ({
|
|
2989
2985
|
children: e,
|
|
2990
2986
|
className: t,
|
|
2991
2987
|
span: r,
|
|
2992
2988
|
...a
|
|
2993
2989
|
}) => {
|
|
2994
|
-
const { columnGap: n, rowGap: o } =
|
|
2990
|
+
const { columnGap: n, rowGap: o } = Tt(Qe), s = {
|
|
2995
2991
|
paddingLeft: n * Ce + "rem",
|
|
2996
2992
|
paddingTop: o * Ce + "rem"
|
|
2997
2993
|
}, i = wn({
|
|
@@ -3013,7 +3009,7 @@ try {
|
|
|
3013
3009
|
});
|
|
3014
3010
|
} catch {
|
|
3015
3011
|
}
|
|
3016
|
-
const
|
|
3012
|
+
const Xt = "av-text-input", Tn = "av-text-input-wrapper", ze = "av-text-input-helper-text";
|
|
3017
3013
|
function In() {
|
|
3018
3014
|
const e = $(!1);
|
|
3019
3015
|
return Q(() => (e.current = !0, () => {
|
|
@@ -3031,7 +3027,7 @@ const Sn = {
|
|
|
3031
3027
|
right: 0
|
|
3032
3028
|
};
|
|
3033
3029
|
function _n(e) {
|
|
3034
|
-
const t = In(), r = $(0), a = $(null), [n, o] = j(Sn), s =
|
|
3030
|
+
const t = In(), r = $(0), a = $(null), [n, o] = j(Sn), s = St(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((i) => {
|
|
3035
3031
|
const d = i[0];
|
|
3036
3032
|
d && (cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
|
|
3037
3033
|
a.current && t() && o(d.contentRect);
|
|
@@ -3042,7 +3038,7 @@ function _n(e) {
|
|
|
3042
3038
|
}), [s, e]), [a, n];
|
|
3043
3039
|
}
|
|
3044
3040
|
function kn(e) {
|
|
3045
|
-
const t =
|
|
3041
|
+
const t = It();
|
|
3046
3042
|
if (!e)
|
|
3047
3043
|
return t;
|
|
3048
3044
|
if (typeof e == "number" || typeof e == "string")
|
|
@@ -3052,7 +3048,7 @@ function kn(e) {
|
|
|
3052
3048
|
return typeof r == "number" || typeof r == "string" ? `${a}${r}` : `${a}${t}`;
|
|
3053
3049
|
}
|
|
3054
3050
|
}
|
|
3055
|
-
const
|
|
3051
|
+
const Qt = "SET_ANNOUNCEMENT", Zt = "CLEAR_ANNOUNCEMENT", An = {
|
|
3056
3052
|
alert: null,
|
|
3057
3053
|
alertdialog: null,
|
|
3058
3054
|
log: "polite",
|
|
@@ -3062,12 +3058,12 @@ const Zt = "SET_ANNOUNCEMENT", er = "CLEAR_ANNOUNCEMENT", An = {
|
|
|
3062
3058
|
timer: "assertive"
|
|
3063
3059
|
}, vn = (e, t) => {
|
|
3064
3060
|
switch (t == null ? void 0 : t.type) {
|
|
3065
|
-
case
|
|
3061
|
+
case Qt:
|
|
3066
3062
|
return {
|
|
3067
3063
|
...e,
|
|
3068
3064
|
announcement: t.payload
|
|
3069
3065
|
};
|
|
3070
|
-
case
|
|
3066
|
+
case Zt:
|
|
3071
3067
|
return {
|
|
3072
3068
|
...e,
|
|
3073
3069
|
announcement: null
|
|
@@ -3080,9 +3076,9 @@ const Zt = "SET_ANNOUNCEMENT", er = "CLEAR_ANNOUNCEMENT", An = {
|
|
|
3080
3076
|
dispatch: t
|
|
3081
3077
|
}) => {
|
|
3082
3078
|
t({
|
|
3083
|
-
type:
|
|
3079
|
+
type: Zt
|
|
3084
3080
|
}), typeof e == "function" && e();
|
|
3085
|
-
},
|
|
3081
|
+
}, Et = ({
|
|
3086
3082
|
children: e,
|
|
3087
3083
|
clearAnnouncementDelay: t,
|
|
3088
3084
|
clearAnnouncementTimeoutRef: r,
|
|
@@ -3090,7 +3086,7 @@ const Zt = "SET_ANNOUNCEMENT", er = "CLEAR_ANNOUNCEMENT", An = {
|
|
|
3090
3086
|
dispatch: n
|
|
3091
3087
|
}) => {
|
|
3092
3088
|
clearTimeout(r.current), e !== null && n({
|
|
3093
|
-
type:
|
|
3089
|
+
type: Qt,
|
|
3094
3090
|
payload: e
|
|
3095
3091
|
}), t && (r.current = setTimeout(
|
|
3096
3092
|
() => Rn({
|
|
@@ -3108,13 +3104,13 @@ const Zt = "SET_ANNOUNCEMENT", er = "CLEAR_ANNOUNCEMENT", An = {
|
|
|
3108
3104
|
onAnnouncementClear: o,
|
|
3109
3105
|
dispatch: s
|
|
3110
3106
|
}) => {
|
|
3111
|
-
clearTimeout(t.current), r ? t.current = setTimeout(
|
|
3107
|
+
clearTimeout(t.current), r ? t.current = setTimeout(Et, r, {
|
|
3112
3108
|
children: e,
|
|
3113
3109
|
clearAnnouncementDelay: a,
|
|
3114
3110
|
clearAnnouncementTimeoutRef: n,
|
|
3115
3111
|
onAnnouncementClear: o,
|
|
3116
3112
|
dispatch: s
|
|
3117
|
-
}) :
|
|
3113
|
+
}) : Et({
|
|
3118
3114
|
children: e,
|
|
3119
3115
|
clearAnnouncementDelay: a,
|
|
3120
3116
|
clearAnnouncementTimeoutRef: n,
|
|
@@ -3122,7 +3118,7 @@ const Zt = "SET_ANNOUNCEMENT", er = "CLEAR_ANNOUNCEMENT", An = {
|
|
|
3122
3118
|
dispatch: s
|
|
3123
3119
|
});
|
|
3124
3120
|
};
|
|
3125
|
-
function
|
|
3121
|
+
function er({
|
|
3126
3122
|
children: e,
|
|
3127
3123
|
className: t,
|
|
3128
3124
|
politeness: r,
|
|
@@ -3133,7 +3129,7 @@ function tr({
|
|
|
3133
3129
|
visible: i,
|
|
3134
3130
|
...d
|
|
3135
3131
|
}) {
|
|
3136
|
-
const m = $(null), p = $(null), [u, c] =
|
|
3132
|
+
const m = $(null), p = $(null), [u, c] = wt(vn, {
|
|
3137
3133
|
announcement: null
|
|
3138
3134
|
});
|
|
3139
3135
|
let h = r;
|
|
@@ -3289,7 +3285,7 @@ const xn = ({
|
|
|
3289
3285
|
break;
|
|
3290
3286
|
}
|
|
3291
3287
|
const c = r ? g(t) : g(
|
|
3292
|
-
|
|
3288
|
+
Xt,
|
|
3293
3289
|
u,
|
|
3294
3290
|
"rounded-md text-base px-4",
|
|
3295
3291
|
xn({ mode: s }),
|
|
@@ -3340,7 +3336,7 @@ const xn = ({
|
|
|
3340
3336
|
size: I = "md",
|
|
3341
3337
|
...M
|
|
3342
3338
|
}, U) => {
|
|
3343
|
-
const [K, N] = _n(), [H, W] = j(0), x = kn({ id: e, prefix: `${
|
|
3339
|
+
const [K, N] = _n(), [H, W] = j(0), x = kn({ id: e, prefix: `${Xt}-` }), pe = `${t} error, ${f}`, Z = $(null), v = $(null), P = {
|
|
3344
3340
|
xs: { label: "-25px", helperText: "30px" },
|
|
3345
3341
|
sm: { label: "-29px", helperText: "34px" },
|
|
3346
3342
|
md: { label: "-33px", helperText: "38px" },
|
|
@@ -3367,7 +3363,7 @@ const xn = ({
|
|
|
3367
3363
|
"--av-text-input-helper-text",
|
|
3368
3364
|
b
|
|
3369
3365
|
);
|
|
3370
|
-
}, [I]), /* @__PURE__ */
|
|
3366
|
+
}, [I]), /* @__PURE__ */ O("div", { className: G.wrapper, children: [
|
|
3371
3367
|
/* @__PURE__ */ l(
|
|
3372
3368
|
"label",
|
|
3373
3369
|
{
|
|
@@ -3420,20 +3416,20 @@ const xn = ({
|
|
|
3420
3416
|
children: E
|
|
3421
3417
|
}
|
|
3422
3418
|
),
|
|
3423
|
-
a && f && /* @__PURE__ */ l(
|
|
3419
|
+
a && f && /* @__PURE__ */ l(er, { politeness: "polite", clearAnnouncementDelay: 500, children: pe })
|
|
3424
3420
|
] });
|
|
3425
3421
|
}
|
|
3426
3422
|
);
|
|
3427
3423
|
at.displayName = "TextInput";
|
|
3428
3424
|
function $n(e) {
|
|
3429
|
-
return
|
|
3425
|
+
return St(() => e.every((t) => t == null) ? () => {
|
|
3430
3426
|
} : (t) => {
|
|
3431
3427
|
e.forEach((r) => {
|
|
3432
3428
|
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
3433
3429
|
});
|
|
3434
3430
|
}, e);
|
|
3435
3431
|
}
|
|
3436
|
-
const Mn = 500, Un = 5e3, Kn = 2e4,
|
|
3432
|
+
const Mn = 500, Un = 5e3, Kn = 2e4, tr = z.forwardRef(
|
|
3437
3433
|
({
|
|
3438
3434
|
name: e,
|
|
3439
3435
|
disabled: t,
|
|
@@ -3479,7 +3475,7 @@ const Mn = 500, Un = 5e3, Kn = 2e4, rr = z.forwardRef(
|
|
|
3479
3475
|
};
|
|
3480
3476
|
return Q(() => () => {
|
|
3481
3477
|
I.current && clearTimeout(I.current);
|
|
3482
|
-
}, []), /* @__PURE__ */
|
|
3478
|
+
}, []), /* @__PURE__ */ O(Oe, { children: [
|
|
3483
3479
|
/* @__PURE__ */ l(
|
|
3484
3480
|
at,
|
|
3485
3481
|
{
|
|
@@ -3503,7 +3499,7 @@ const Mn = 500, Un = 5e3, Kn = 2e4, rr = z.forwardRef(
|
|
|
3503
3499
|
}
|
|
3504
3500
|
),
|
|
3505
3501
|
/* @__PURE__ */ l(
|
|
3506
|
-
|
|
3502
|
+
er,
|
|
3507
3503
|
{
|
|
3508
3504
|
role: "status",
|
|
3509
3505
|
politeness: f.politeness,
|
|
@@ -3514,7 +3510,7 @@ const Mn = 500, Un = 5e3, Kn = 2e4, rr = z.forwardRef(
|
|
|
3514
3510
|
] });
|
|
3515
3511
|
}
|
|
3516
3512
|
);
|
|
3517
|
-
|
|
3513
|
+
tr.displayName = "TextInputMask";
|
|
3518
3514
|
/*!
|
|
3519
3515
|
@versini/ui-textinput v3.0.0
|
|
3520
3516
|
© 2025 gizmette.com
|
|
@@ -3565,14 +3561,14 @@ const Hn = "ASK! ME! ANYTHING!", Wn = "Callisto", Gn = "Log in", Bn = "Sign in w
|
|
|
3565
3561
|
SETTINGS_ENGINE: {
|
|
3566
3562
|
TITLE: "AI Engine"
|
|
3567
3563
|
}
|
|
3568
|
-
}, Vn = () => /* @__PURE__ */
|
|
3569
|
-
/* @__PURE__ */ l("div", { className: "basis-1/4", children: /* @__PURE__ */ l(
|
|
3570
|
-
/* @__PURE__ */
|
|
3564
|
+
}, Vn = () => /* @__PURE__ */ O("div", { className: "flex items-center justify-center", children: [
|
|
3565
|
+
/* @__PURE__ */ l("div", { className: "basis-1/4", children: /* @__PURE__ */ l(hn, {}) }),
|
|
3566
|
+
/* @__PURE__ */ O("div", { className: "prose prose-sm prose-light md:prose-base prose-h1:mb-0 prose-h2:mt-0", children: [
|
|
3571
3567
|
/* @__PURE__ */ l("h1", { children: Wn }),
|
|
3572
3568
|
/* @__PURE__ */ l("h2", { children: Hn })
|
|
3573
3569
|
] })
|
|
3574
3570
|
] }), Yn = () => {
|
|
3575
|
-
const { login: e, logoutReason: t, loginWithPasskey: r } =
|
|
3571
|
+
const { login: e, logoutReason: t, loginWithPasskey: r } = jt(), [a, n] = j(""), [o, s] = j(""), [i, d] = j(!0), [m, p] = j({
|
|
3576
3572
|
username: "",
|
|
3577
3573
|
password: ""
|
|
3578
3574
|
}), u = async (c) => {
|
|
@@ -3586,10 +3582,10 @@ const Hn = "ASK! ME! ANYTHING!", Wn = "Callisto", Gn = "Log in", Bn = "Sign in w
|
|
|
3586
3582
|
}, 500);
|
|
3587
3583
|
}), Q(() => {
|
|
3588
3584
|
t && s(t);
|
|
3589
|
-
}, [t]), /* @__PURE__ */ l(Oe, { children: /* @__PURE__ */
|
|
3590
|
-
|
|
3585
|
+
}, [t]), /* @__PURE__ */ l(Oe, { children: /* @__PURE__ */ O(
|
|
3586
|
+
fn,
|
|
3591
3587
|
{
|
|
3592
|
-
className:
|
|
3588
|
+
className: ja({
|
|
3593
3589
|
extraClass: "mt-5"
|
|
3594
3590
|
}),
|
|
3595
3591
|
noMargin: !0,
|
|
@@ -3598,99 +3594,99 @@ const Hn = "ASK! ME! ANYTHING!", Wn = "Callisto", Gn = "Log in", Bn = "Sign in w
|
|
|
3598
3594
|
/* @__PURE__ */ l(
|
|
3599
3595
|
"div",
|
|
3600
3596
|
{
|
|
3601
|
-
className:
|
|
3597
|
+
className: Fa({
|
|
3602
3598
|
extraClass: "rounded-md"
|
|
3603
3599
|
}),
|
|
3604
3600
|
children: /* @__PURE__ */ l(Vn, {})
|
|
3605
3601
|
}
|
|
3606
3602
|
),
|
|
3607
|
-
/* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */ l(
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
},
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
/* @__PURE__ */ l("div", { className: "text-center text-copy-light", children: "or" }),
|
|
3667
|
-
/* @__PURE__ */ l(
|
|
3603
|
+
/* @__PURE__ */ l("form", { className: "mt-5", onSubmit: u, children: /* @__PURE__ */ l(En, { alignHorizontal: "center", children: /* @__PURE__ */ l(te, { span: 6, children: /* @__PURE__ */ O(un, { mode: "dark", children: [
|
|
3604
|
+
/* @__PURE__ */ l(te, { span: 12, className: "mt-7", children: o && /* @__PURE__ */ l("div", { className: "p-2 text-sm text-center text-copy-error-light bg-surface-darker", children: o }) }),
|
|
3605
|
+
/* @__PURE__ */ l(te, { span: 12, children: /* @__PURE__ */ l(
|
|
3606
|
+
at,
|
|
3607
|
+
{
|
|
3608
|
+
className: "mt-7",
|
|
3609
|
+
required: !0,
|
|
3610
|
+
autoCapitalize: "off",
|
|
3611
|
+
autoComplete: "off",
|
|
3612
|
+
autoCorrect: "off",
|
|
3613
|
+
mode: "dark",
|
|
3614
|
+
focusMode: "light",
|
|
3615
|
+
name: "username",
|
|
3616
|
+
label: "Username",
|
|
3617
|
+
onChange: (c) => {
|
|
3618
|
+
p({
|
|
3619
|
+
...m,
|
|
3620
|
+
username: c.target.value
|
|
3621
|
+
}), n("");
|
|
3622
|
+
},
|
|
3623
|
+
error: a !== ""
|
|
3624
|
+
}
|
|
3625
|
+
) }),
|
|
3626
|
+
/* @__PURE__ */ l(te, { span: 12, children: /* @__PURE__ */ l(
|
|
3627
|
+
tr,
|
|
3628
|
+
{
|
|
3629
|
+
className: "mt-7",
|
|
3630
|
+
required: !0,
|
|
3631
|
+
autoCapitalize: "off",
|
|
3632
|
+
autoComplete: "off",
|
|
3633
|
+
autoCorrect: "off",
|
|
3634
|
+
mode: "dark",
|
|
3635
|
+
focusMode: "light",
|
|
3636
|
+
name: "password",
|
|
3637
|
+
label: Jn,
|
|
3638
|
+
rightElement: /* @__PURE__ */ l(Xe, { focusMode: "light", mode: "dark", children: i ? /* @__PURE__ */ l(gn, {}) : /* @__PURE__ */ l(mn, {}) }),
|
|
3639
|
+
onMaskChange: d,
|
|
3640
|
+
onChange: (c) => {
|
|
3641
|
+
p({
|
|
3642
|
+
...m,
|
|
3643
|
+
password: c.target.value
|
|
3644
|
+
}), n("");
|
|
3645
|
+
},
|
|
3646
|
+
error: a !== "",
|
|
3647
|
+
helperText: a
|
|
3648
|
+
}
|
|
3649
|
+
) }),
|
|
3650
|
+
/* @__PURE__ */ l(te, { span: 12, children: /* @__PURE__ */ l(
|
|
3651
|
+
qt,
|
|
3652
|
+
{
|
|
3653
|
+
mode: "light",
|
|
3654
|
+
focusMode: "light",
|
|
3655
|
+
fullWidth: !0,
|
|
3656
|
+
noBorder: !0,
|
|
3657
|
+
type: "submit",
|
|
3658
|
+
className: "mt-7",
|
|
3659
|
+
children: Gn
|
|
3660
|
+
}
|
|
3661
|
+
) }),
|
|
3662
|
+
/* @__PURE__ */ l(te, { span: 12, children: /* @__PURE__ */ l("div", { className: "text-center text-copy-light mt-2 mb-2", children: "or" }) }),
|
|
3663
|
+
/* @__PURE__ */ l(te, { span: 12, children: /* @__PURE__ */ l(
|
|
3668
3664
|
Xe,
|
|
3669
3665
|
{
|
|
3670
3666
|
variant: "selected",
|
|
3671
3667
|
mode: "dark",
|
|
3672
3668
|
focusMode: "light",
|
|
3673
3669
|
fullWidth: !0,
|
|
3674
|
-
className: "mb-4
|
|
3670
|
+
className: "mb-4",
|
|
3675
3671
|
labelRight: Bn,
|
|
3676
3672
|
onClick: r,
|
|
3677
|
-
children: /* @__PURE__ */ l(
|
|
3673
|
+
children: /* @__PURE__ */ l(pn, { size: "size-7" })
|
|
3678
3674
|
}
|
|
3679
|
-
) })
|
|
3680
|
-
] })
|
|
3675
|
+
) })
|
|
3676
|
+
] }) }) }) })
|
|
3681
3677
|
]
|
|
3682
3678
|
}
|
|
3683
3679
|
) });
|
|
3684
|
-
}, zn = new URL(document.location.href).searchParams, Fn = !!zn.get("debug") || !1, jn =
|
|
3680
|
+
}, zn = new URL(document.location.href).searchParams, Fn = !!zn.get("debug") || !1, jn = or(() => import(
|
|
3685
3681
|
/* webpackChunkName: "LazyApp" */
|
|
3686
|
-
"./App.
|
|
3682
|
+
"./App.oZoXeHpk.js"
|
|
3687
3683
|
).then((e) => e.App)), qn = ({ isComponent: e }) => {
|
|
3688
|
-
const { isAuthenticated: t } =
|
|
3689
|
-
return t ? /* @__PURE__ */ l(
|
|
3684
|
+
const { isAuthenticated: t } = jt();
|
|
3685
|
+
return t ? /* @__PURE__ */ l(sr, { fallback: /* @__PURE__ */ l("div", {}), children: /* @__PURE__ */ l(jn, { isComponent: e }) }) : /* @__PURE__ */ l(Yn, {});
|
|
3690
3686
|
}, Xn = ({
|
|
3691
3687
|
isComponent: e = !1,
|
|
3692
|
-
domain: t =
|
|
3693
|
-
}) => /* @__PURE__ */ l(Oe, { children: /* @__PURE__ */ l(
|
|
3688
|
+
domain: t = za
|
|
3689
|
+
}) => /* @__PURE__ */ l(Oe, { children: /* @__PURE__ */ l(La, { clientId: $a, domain: t, debug: Fn, children: /* @__PURE__ */ l(qn, { isComponent: e }) }) }), Qo = ({ domain: e }) => /* @__PURE__ */ l(Xn, { isComponent: !0, domain: e });
|
|
3694
3690
|
export {
|
|
3695
3691
|
zo as ABOUT_TITLE,
|
|
3696
3692
|
Io as ACTION_ENGINE,
|
|
@@ -3705,7 +3701,7 @@ export {
|
|
|
3705
3701
|
To as ACTION_STREAMING,
|
|
3706
3702
|
ko as ACTION_TOGGLE_TAG,
|
|
3707
3703
|
Wn as APP_NAME,
|
|
3708
|
-
|
|
3704
|
+
qt as C,
|
|
3709
3705
|
Xo as CARDS,
|
|
3710
3706
|
jo as CLIPBOARD_TAG,
|
|
3711
3707
|
po as DEFAULT_AI_ENGINE,
|
|
@@ -3715,7 +3711,7 @@ export {
|
|
|
3715
3711
|
Yo as HISTORY_TITLE,
|
|
3716
3712
|
Lo as INFINITE_SCROLL_LIMIT,
|
|
3717
3713
|
Do as INFINITE_SCROLL_THRESHOLD,
|
|
3718
|
-
|
|
3714
|
+
En as L,
|
|
3719
3715
|
No as LOCAL_STORAGE_CHAT_DETAILS,
|
|
3720
3716
|
Oo as LOCAL_STORAGE_ENGINE_TOGGLE,
|
|
3721
3717
|
Ro as LOCAL_STORAGE_PREFIX,
|
|
@@ -3726,7 +3722,7 @@ export {
|
|
|
3726
3722
|
ue as M,
|
|
3727
3723
|
Xe as P,
|
|
3728
3724
|
Jo as PROFILE_TITLE,
|
|
3729
|
-
|
|
3725
|
+
un as R,
|
|
3730
3726
|
co as ROLE_ASSISTANT,
|
|
3731
3727
|
ho as ROLE_HIDDEN,
|
|
3732
3728
|
uo as ROLE_INTERNAL,
|
|
@@ -3742,14 +3738,14 @@ export {
|
|
|
3742
3738
|
Ko as durationFormatter,
|
|
3743
3739
|
Ue as g,
|
|
3744
3740
|
$o as getCurrentGeoLocation,
|
|
3745
|
-
|
|
3746
|
-
|
|
3741
|
+
ja as getMainPaddingClass,
|
|
3742
|
+
Fa as getMessageContaintWrapperClass,
|
|
3747
3743
|
Uo as isLastMessageFromRole,
|
|
3748
|
-
|
|
3744
|
+
te as j,
|
|
3749
3745
|
Ho as pluralize,
|
|
3750
|
-
|
|
3746
|
+
fn as r,
|
|
3751
3747
|
Mo as renderDataAsList,
|
|
3752
|
-
|
|
3748
|
+
jt as un,
|
|
3753
3749
|
at as ye,
|
|
3754
|
-
|
|
3750
|
+
pn as z
|
|
3755
3751
|
};
|