@versini/sassysaint 1.0.6 → 1.0.8

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