@arkitektbedriftene/fe-lib 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/oidc.es.js CHANGED
@@ -1,716 +1,82 @@
1
- import dt, { createContext as ht, useContext as gt, useMemo as ft, useEffect as pe, useState as Gt, useRef as _t, useCallback as it } from "react";
2
- import { u as Xt } from "./useLocalStorageState-b4fb2a60.js";
3
- var Q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
4
- function Qt(e) {
1
+ import { j as se } from "./jsx-runtime-a0589023.js";
2
+ import { createContext as ue, useContext as ge, useMemo as _e, useEffect as F, useState as Ce, useRef as pe, useCallback as ae } from "react";
3
+ import { u as Re } from "./useLocalStorageState-b4fb2a60.js";
4
+ var N = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
+ function Te(e) {
5
6
  if (e.__esModule)
6
7
  return e;
7
8
  var t = e.default;
8
9
  if (typeof t == "function") {
9
- var r = function s() {
10
- if (this instanceof s) {
11
- var n = [null];
12
- n.push.apply(n, arguments);
13
- var o = Function.bind.apply(t, n);
14
- return new o();
10
+ var s = function r() {
11
+ if (this instanceof r) {
12
+ var i = [null];
13
+ i.push.apply(i, arguments);
14
+ var n = Function.bind.apply(t, i);
15
+ return new n();
15
16
  }
16
17
  return t.apply(this, arguments);
17
18
  };
18
- r.prototype = t.prototype;
19
+ s.prototype = t.prototype;
19
20
  } else
20
- r = {};
21
- return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(e).forEach(function(s) {
22
- var n = Object.getOwnPropertyDescriptor(e, s);
23
- Object.defineProperty(r, s, n.get ? n : {
21
+ s = {};
22
+ return Object.defineProperty(s, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
23
+ var i = Object.getOwnPropertyDescriptor(e, r);
24
+ Object.defineProperty(s, r, i.get ? i : {
24
25
  enumerable: !0,
25
26
  get: function() {
26
- return e[s];
27
+ return e[r];
27
28
  }
28
29
  });
29
- }), r;
30
+ }), s;
30
31
  }
31
- var ce = {}, Zt = {
32
- get exports() {
33
- return ce;
34
- },
35
- set exports(e) {
36
- ce = e;
37
- }
38
- }, oe = {};
39
- /**
40
- * @license React
41
- * react-jsx-runtime.production.min.js
42
- *
43
- * Copyright (c) Facebook, Inc. and its affiliates.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE file in the root directory of this source tree.
47
- */
48
- var nt;
49
- function er() {
50
- if (nt)
51
- return oe;
52
- nt = 1;
53
- var e = dt, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, n = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
54
- function a(d, l, h) {
55
- var p, _ = {}, y = null, w = null;
56
- h !== void 0 && (y = "" + h), l.key !== void 0 && (y = "" + l.key), l.ref !== void 0 && (w = l.ref);
57
- for (p in l)
58
- s.call(l, p) && !o.hasOwnProperty(p) && (_[p] = l[p]);
59
- if (d && d.defaultProps)
60
- for (p in l = d.defaultProps, l)
61
- _[p] === void 0 && (_[p] = l[p]);
62
- return { $$typeof: t, type: d, key: y, ref: w, props: _, _owner: n.current };
63
- }
64
- return oe.Fragment = r, oe.jsx = a, oe.jsxs = a, oe;
65
- }
66
- var ae = {};
67
- /**
68
- * @license React
69
- * react-jsx-runtime.development.js
70
- *
71
- * Copyright (c) Facebook, Inc. and its affiliates.
72
- *
73
- * This source code is licensed under the MIT license found in the
74
- * LICENSE file in the root directory of this source tree.
75
- */
76
- var ot;
77
- function tr() {
78
- return ot || (ot = 1, process.env.NODE_ENV !== "production" && function() {
79
- var e = dt, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), n = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), d = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), w = Symbol.for("react.offscreen"), I = Symbol.iterator, v = "@@iterator";
80
- function R(i) {
81
- if (i === null || typeof i != "object")
82
- return null;
83
- var u = I && i[I] || i[v];
84
- return typeof u == "function" ? u : null;
85
- }
86
- var k = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
87
- function c(i) {
88
- {
89
- for (var u = arguments.length, f = new Array(u > 1 ? u - 1 : 0), S = 1; S < u; S++)
90
- f[S - 1] = arguments[S];
91
- g("error", i, f);
92
- }
93
- }
94
- function g(i, u, f) {
95
- {
96
- var S = k.ReactDebugCurrentFrame, C = S.getStackAddendum();
97
- C !== "" && (u += "%s", f = f.concat([C]));
98
- var U = f.map(function(x) {
99
- return String(x);
100
- });
101
- U.unshift("Warning: " + u), Function.prototype.apply.call(console[i], console, U);
102
- }
103
- }
104
- var m = !1, E = !1, P = !1, O = !1, A = !1, j;
105
- j = Symbol.for("react.module.reference");
106
- function B(i) {
107
- return !!(typeof i == "string" || typeof i == "function" || i === s || i === o || A || i === n || i === h || i === p || O || i === w || m || E || P || typeof i == "object" && i !== null && (i.$$typeof === y || i.$$typeof === _ || i.$$typeof === a || i.$$typeof === d || i.$$typeof === l || // This needs to include all possible module reference object
108
- // types supported by any Flight configuration anywhere since
109
- // we don't know which Flight build this will end up being used
110
- // with.
111
- i.$$typeof === j || i.getModuleId !== void 0));
112
- }
113
- function F(i, u, f) {
114
- var S = i.displayName;
115
- if (S)
116
- return S;
117
- var C = u.displayName || u.name || "";
118
- return C !== "" ? f + "(" + C + ")" : f;
119
- }
120
- function L(i) {
121
- return i.displayName || "Context";
122
- }
123
- function W(i) {
124
- if (i == null)
125
- return null;
126
- if (typeof i.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof i == "function")
127
- return i.displayName || i.name || null;
128
- if (typeof i == "string")
129
- return i;
130
- switch (i) {
131
- case s:
132
- return "Fragment";
133
- case r:
134
- return "Portal";
135
- case o:
136
- return "Profiler";
137
- case n:
138
- return "StrictMode";
139
- case h:
140
- return "Suspense";
141
- case p:
142
- return "SuspenseList";
143
- }
144
- if (typeof i == "object")
145
- switch (i.$$typeof) {
146
- case d:
147
- var u = i;
148
- return L(u) + ".Consumer";
149
- case a:
150
- var f = i;
151
- return L(f._context) + ".Provider";
152
- case l:
153
- return F(i, i.render, "ForwardRef");
154
- case _:
155
- var S = i.displayName || null;
156
- return S !== null ? S : W(i.type) || "Memo";
157
- case y: {
158
- var C = i, U = C._payload, x = C._init;
159
- try {
160
- return W(x(U));
161
- } catch {
162
- return null;
163
- }
164
- }
165
- }
166
- return null;
167
- }
168
- var $ = Object.assign, V = 0, ee, X, le, Fe, De, He, Be;
169
- function $e() {
170
- }
171
- $e.__reactDisabledLog = !0;
172
- function Rt() {
173
- {
174
- if (V === 0) {
175
- ee = console.log, X = console.info, le = console.warn, Fe = console.error, De = console.group, He = console.groupCollapsed, Be = console.groupEnd;
176
- var i = {
177
- configurable: !0,
178
- enumerable: !0,
179
- value: $e,
180
- writable: !0
181
- };
182
- Object.defineProperties(console, {
183
- info: i,
184
- log: i,
185
- warn: i,
186
- error: i,
187
- group: i,
188
- groupCollapsed: i,
189
- groupEnd: i
190
- });
191
- }
192
- V++;
193
- }
194
- }
195
- function Tt() {
196
- {
197
- if (V--, V === 0) {
198
- var i = {
199
- configurable: !0,
200
- enumerable: !0,
201
- writable: !0
202
- };
203
- Object.defineProperties(console, {
204
- log: $({}, i, {
205
- value: ee
206
- }),
207
- info: $({}, i, {
208
- value: X
209
- }),
210
- warn: $({}, i, {
211
- value: le
212
- }),
213
- error: $({}, i, {
214
- value: Fe
215
- }),
216
- group: $({}, i, {
217
- value: De
218
- }),
219
- groupCollapsed: $({}, i, {
220
- value: He
221
- }),
222
- groupEnd: $({}, i, {
223
- value: Be
224
- })
225
- });
226
- }
227
- V < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
228
- }
229
- }
230
- var Se = k.ReactCurrentDispatcher, ye;
231
- function ue(i, u, f) {
232
- {
233
- if (ye === void 0)
234
- try {
235
- throw Error();
236
- } catch (C) {
237
- var S = C.stack.trim().match(/\n( *(at )?)/);
238
- ye = S && S[1] || "";
239
- }
240
- return `
241
- ` + ye + i;
242
- }
243
- }
244
- var be = !1, de;
245
- {
246
- var xt = typeof WeakMap == "function" ? WeakMap : Map;
247
- de = new xt();
248
- }
249
- function Le(i, u) {
250
- if (!i || be)
251
- return "";
252
- {
253
- var f = de.get(i);
254
- if (f !== void 0)
255
- return f;
256
- }
257
- var S;
258
- be = !0;
259
- var C = Error.prepareStackTrace;
260
- Error.prepareStackTrace = void 0;
261
- var U;
262
- U = Se.current, Se.current = null, Rt();
263
- try {
264
- if (u) {
265
- var x = function() {
266
- throw Error();
267
- };
268
- if (Object.defineProperty(x.prototype, "props", {
269
- set: function() {
270
- throw Error();
271
- }
272
- }), typeof Reflect == "object" && Reflect.construct) {
273
- try {
274
- Reflect.construct(x, []);
275
- } catch (Y) {
276
- S = Y;
277
- }
278
- Reflect.construct(i, [], x);
279
- } else {
280
- try {
281
- x.call();
282
- } catch (Y) {
283
- S = Y;
284
- }
285
- i.call(x.prototype);
286
- }
287
- } else {
288
- try {
289
- throw Error();
290
- } catch (Y) {
291
- S = Y;
292
- }
293
- i();
294
- }
295
- } catch (Y) {
296
- if (Y && S && typeof Y.stack == "string") {
297
- for (var T = Y.stack.split(`
298
- `), M = S.stack.split(`
299
- `), N = T.length - 1, q = M.length - 1; N >= 1 && q >= 0 && T[N] !== M[q]; )
300
- q--;
301
- for (; N >= 1 && q >= 0; N--, q--)
302
- if (T[N] !== M[q]) {
303
- if (N !== 1 || q !== 1)
304
- do
305
- if (N--, q--, q < 0 || T[N] !== M[q]) {
306
- var D = `
307
- ` + T[N].replace(" at new ", " at ");
308
- return i.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", i.displayName)), typeof i == "function" && de.set(i, D), D;
309
- }
310
- while (N >= 1 && q >= 0);
311
- break;
312
- }
313
- }
314
- } finally {
315
- be = !1, Se.current = U, Tt(), Error.prepareStackTrace = C;
316
- }
317
- var re = i ? i.displayName || i.name : "", st = re ? ue(re) : "";
318
- return typeof i == "function" && de.set(i, st), st;
319
- }
320
- function Ct(i, u, f) {
321
- return Le(i, !1);
322
- }
323
- function It(i) {
324
- var u = i.prototype;
325
- return !!(u && u.isReactComponent);
326
- }
327
- function he(i, u, f) {
328
- if (i == null)
329
- return "";
330
- if (typeof i == "function")
331
- return Le(i, It(i));
332
- if (typeof i == "string")
333
- return ue(i);
334
- switch (i) {
335
- case h:
336
- return ue("Suspense");
337
- case p:
338
- return ue("SuspenseList");
339
- }
340
- if (typeof i == "object")
341
- switch (i.$$typeof) {
342
- case l:
343
- return Ct(i.render);
344
- case _:
345
- return he(i.type, u, f);
346
- case y: {
347
- var S = i, C = S._payload, U = S._init;
348
- try {
349
- return he(U(C), u, f);
350
- } catch {
351
- }
352
- }
353
- }
354
- return "";
355
- }
356
- var ge = Object.prototype.hasOwnProperty, ze = {}, Je = k.ReactDebugCurrentFrame;
357
- function fe(i) {
358
- if (i) {
359
- var u = i._owner, f = he(i.type, i._source, u ? u.type : null);
360
- Je.setExtraStackFrame(f);
361
- } else
362
- Je.setExtraStackFrame(null);
363
- }
364
- function Pt(i, u, f, S, C) {
365
- {
366
- var U = Function.call.bind(ge);
367
- for (var x in i)
368
- if (U(i, x)) {
369
- var T = void 0;
370
- try {
371
- if (typeof i[x] != "function") {
372
- var M = Error((S || "React class") + ": " + f + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
373
- throw M.name = "Invariant Violation", M;
374
- }
375
- T = i[x](u, x, S, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
376
- } catch (N) {
377
- T = N;
378
- }
379
- T && !(T instanceof Error) && (fe(C), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", S || "React class", f, x, typeof T), fe(null)), T instanceof Error && !(T.message in ze) && (ze[T.message] = !0, fe(C), c("Failed %s type: %s", f, T.message), fe(null));
380
- }
381
- }
382
- }
383
- var Ot = Array.isArray;
384
- function ke(i) {
385
- return Ot(i);
386
- }
387
- function Ut(i) {
388
- {
389
- var u = typeof Symbol == "function" && Symbol.toStringTag, f = u && i[Symbol.toStringTag] || i.constructor.name || "Object";
390
- return f;
391
- }
392
- }
393
- function At(i) {
394
- try {
395
- return Ke(i), !1;
396
- } catch {
397
- return !0;
398
- }
399
- }
400
- function Ke(i) {
401
- return "" + i;
402
- }
403
- function Ve(i) {
404
- if (At(i))
405
- return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ut(i)), Ke(i);
406
- }
407
- var ne = k.ReactCurrentOwner, jt = {
408
- key: !0,
409
- ref: !0,
410
- __self: !0,
411
- __source: !0
412
- }, Ye, Ge, Ee;
413
- Ee = {};
414
- function Nt(i) {
415
- if (ge.call(i, "ref")) {
416
- var u = Object.getOwnPropertyDescriptor(i, "ref").get;
417
- if (u && u.isReactWarning)
418
- return !1;
419
- }
420
- return i.ref !== void 0;
421
- }
422
- function qt(i) {
423
- if (ge.call(i, "key")) {
424
- var u = Object.getOwnPropertyDescriptor(i, "key").get;
425
- if (u && u.isReactWarning)
426
- return !1;
427
- }
428
- return i.key !== void 0;
429
- }
430
- function Wt(i, u) {
431
- if (typeof i.ref == "string" && ne.current && u && ne.current.stateNode !== u) {
432
- var f = W(ne.current.type);
433
- Ee[f] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', W(ne.current.type), i.ref), Ee[f] = !0);
434
- }
435
- }
436
- function Mt(i, u) {
437
- {
438
- var f = function() {
439
- Ye || (Ye = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", u));
440
- };
441
- f.isReactWarning = !0, Object.defineProperty(i, "key", {
442
- get: f,
443
- configurable: !0
444
- });
445
- }
446
- }
447
- function Ft(i, u) {
448
- {
449
- var f = function() {
450
- Ge || (Ge = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", u));
451
- };
452
- f.isReactWarning = !0, Object.defineProperty(i, "ref", {
453
- get: f,
454
- configurable: !0
455
- });
456
- }
457
- }
458
- var Dt = function(i, u, f, S, C, U, x) {
459
- var T = {
460
- // This tag allows us to uniquely identify this as a React Element
461
- $$typeof: t,
462
- // Built-in properties that belong on the element
463
- type: i,
464
- key: u,
465
- ref: f,
466
- props: x,
467
- // Record the component responsible for creating this element.
468
- _owner: U
469
- };
470
- return T._store = {}, Object.defineProperty(T._store, "validated", {
471
- configurable: !1,
472
- enumerable: !1,
473
- writable: !0,
474
- value: !1
475
- }), Object.defineProperty(T, "_self", {
476
- configurable: !1,
477
- enumerable: !1,
478
- writable: !1,
479
- value: S
480
- }), Object.defineProperty(T, "_source", {
481
- configurable: !1,
482
- enumerable: !1,
483
- writable: !1,
484
- value: C
485
- }), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
486
- };
487
- function Ht(i, u, f, S, C) {
488
- {
489
- var U, x = {}, T = null, M = null;
490
- f !== void 0 && (Ve(f), T = "" + f), qt(u) && (Ve(u.key), T = "" + u.key), Nt(u) && (M = u.ref, Wt(u, C));
491
- for (U in u)
492
- ge.call(u, U) && !jt.hasOwnProperty(U) && (x[U] = u[U]);
493
- if (i && i.defaultProps) {
494
- var N = i.defaultProps;
495
- for (U in N)
496
- x[U] === void 0 && (x[U] = N[U]);
497
- }
498
- if (T || M) {
499
- var q = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
500
- T && Mt(x, q), M && Ft(x, q);
501
- }
502
- return Dt(i, T, M, C, S, ne.current, x);
503
- }
504
- }
505
- var Re = k.ReactCurrentOwner, Xe = k.ReactDebugCurrentFrame;
506
- function te(i) {
507
- if (i) {
508
- var u = i._owner, f = he(i.type, i._source, u ? u.type : null);
509
- Xe.setExtraStackFrame(f);
510
- } else
511
- Xe.setExtraStackFrame(null);
512
- }
513
- var Te;
514
- Te = !1;
515
- function xe(i) {
516
- return typeof i == "object" && i !== null && i.$$typeof === t;
517
- }
518
- function Qe() {
519
- {
520
- if (Re.current) {
521
- var i = W(Re.current.type);
522
- if (i)
523
- return `
524
-
525
- Check the render method of \`` + i + "`.";
526
- }
527
- return "";
528
- }
529
- }
530
- function Bt(i) {
531
- {
532
- if (i !== void 0) {
533
- var u = i.fileName.replace(/^.*[\\\/]/, ""), f = i.lineNumber;
534
- return `
535
-
536
- Check your code at ` + u + ":" + f + ".";
537
- }
538
- return "";
539
- }
540
- }
541
- var Ze = {};
542
- function $t(i) {
543
- {
544
- var u = Qe();
545
- if (!u) {
546
- var f = typeof i == "string" ? i : i.displayName || i.name;
547
- f && (u = `
548
-
549
- Check the top-level render call using <` + f + ">.");
550
- }
551
- return u;
552
- }
553
- }
554
- function et(i, u) {
555
- {
556
- if (!i._store || i._store.validated || i.key != null)
557
- return;
558
- i._store.validated = !0;
559
- var f = $t(u);
560
- if (Ze[f])
561
- return;
562
- Ze[f] = !0;
563
- var S = "";
564
- i && i._owner && i._owner !== Re.current && (S = " It was passed a child from " + W(i._owner.type) + "."), te(i), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, S), te(null);
565
- }
566
- }
567
- function tt(i, u) {
568
- {
569
- if (typeof i != "object")
570
- return;
571
- if (ke(i))
572
- for (var f = 0; f < i.length; f++) {
573
- var S = i[f];
574
- xe(S) && et(S, u);
575
- }
576
- else if (xe(i))
577
- i._store && (i._store.validated = !0);
578
- else if (i) {
579
- var C = R(i);
580
- if (typeof C == "function" && C !== i.entries)
581
- for (var U = C.call(i), x; !(x = U.next()).done; )
582
- xe(x.value) && et(x.value, u);
583
- }
584
- }
585
- }
586
- function Lt(i) {
587
- {
588
- var u = i.type;
589
- if (u == null || typeof u == "string")
590
- return;
591
- var f;
592
- if (typeof u == "function")
593
- f = u.propTypes;
594
- else if (typeof u == "object" && (u.$$typeof === l || // Note: Memo only checks outer props here.
595
- // Inner props are checked in the reconciler.
596
- u.$$typeof === _))
597
- f = u.propTypes;
598
- else
599
- return;
600
- if (f) {
601
- var S = W(u);
602
- Pt(f, i.props, "prop", S, i);
603
- } else if (u.PropTypes !== void 0 && !Te) {
604
- Te = !0;
605
- var C = W(u);
606
- c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", C || "Unknown");
607
- }
608
- typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
609
- }
610
- }
611
- function zt(i) {
612
- {
613
- for (var u = Object.keys(i.props), f = 0; f < u.length; f++) {
614
- var S = u[f];
615
- if (S !== "children" && S !== "key") {
616
- te(i), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), te(null);
617
- break;
618
- }
619
- }
620
- i.ref !== null && (te(i), c("Invalid attribute `ref` supplied to `React.Fragment`."), te(null));
621
- }
622
- }
623
- function rt(i, u, f, S, C, U) {
624
- {
625
- var x = B(i);
626
- if (!x) {
627
- var T = "";
628
- (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
629
- var M = Bt(C);
630
- M ? T += M : T += Qe();
631
- var N;
632
- i === null ? N = "null" : ke(i) ? N = "array" : i !== void 0 && i.$$typeof === t ? (N = "<" + (W(i.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : N = typeof i, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, T);
633
- }
634
- var q = Ht(i, u, f, C, U);
635
- if (q == null)
636
- return q;
637
- if (x) {
638
- var D = u.children;
639
- if (D !== void 0)
640
- if (S)
641
- if (ke(D)) {
642
- for (var re = 0; re < D.length; re++)
643
- tt(D[re], i);
644
- Object.freeze && Object.freeze(D);
645
- } else
646
- c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
647
- else
648
- tt(D, i);
649
- }
650
- return i === s ? zt(q) : Lt(q), q;
651
- }
652
- }
653
- function Jt(i, u, f) {
654
- return rt(i, u, f, !0);
655
- }
656
- function Kt(i, u, f) {
657
- return rt(i, u, f, !1);
658
- }
659
- var Vt = Kt, Yt = Jt;
660
- ae.Fragment = s, ae.jsx = Vt, ae.jsxs = Yt;
661
- }()), ae;
662
- }
663
- (function(e) {
664
- process.env.NODE_ENV === "production" ? e.exports = er() : e.exports = tr();
665
- })(Zt);
666
- function rr(e) {
32
+ function Ie(e) {
667
33
  throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
668
34
  }
669
- var se = {}, sr = {
35
+ var H = {}, Ue = {
670
36
  get exports() {
671
- return se;
37
+ return H;
672
38
  },
673
39
  set exports(e) {
674
- se = e;
40
+ H = e;
675
41
  }
676
42
  };
677
- const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
43
+ const Pe = {}, Ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
678
44
  __proto__: null,
679
- default: ir
680
- }, Symbol.toStringTag, { value: "Module" })), or = /* @__PURE__ */ Qt(nr);
45
+ default: Pe
46
+ }, Symbol.toStringTag, { value: "Module" })), Oe = /* @__PURE__ */ Te(Ae);
681
47
  (function(e, t) {
682
- (function(r, s) {
683
- e.exports = s();
684
- })(Q, function() {
685
- var r = r || function(s, n) {
686
- var o;
687
- if (typeof window < "u" && window.crypto && (o = window.crypto), typeof self < "u" && self.crypto && (o = self.crypto), typeof globalThis < "u" && globalThis.crypto && (o = globalThis.crypto), !o && typeof window < "u" && window.msCrypto && (o = window.msCrypto), !o && typeof Q < "u" && Q.crypto && (o = Q.crypto), !o && typeof rr == "function")
48
+ (function(s, r) {
49
+ e.exports = r();
50
+ })(N, function() {
51
+ var s = s || function(r, i) {
52
+ var n;
53
+ if (typeof window < "u" && window.crypto && (n = window.crypto), typeof self < "u" && self.crypto && (n = self.crypto), typeof globalThis < "u" && globalThis.crypto && (n = globalThis.crypto), !n && typeof window < "u" && window.msCrypto && (n = window.msCrypto), !n && typeof N < "u" && N.crypto && (n = N.crypto), !n && typeof Ie == "function")
688
54
  try {
689
- o = or;
55
+ n = Oe;
690
56
  } catch {
691
57
  }
692
- var a = function() {
693
- if (o) {
694
- if (typeof o.getRandomValues == "function")
58
+ var o = function() {
59
+ if (n) {
60
+ if (typeof n.getRandomValues == "function")
695
61
  try {
696
- return o.getRandomValues(new Uint32Array(1))[0];
62
+ return n.getRandomValues(new Uint32Array(1))[0];
697
63
  } catch {
698
64
  }
699
- if (typeof o.randomBytes == "function")
65
+ if (typeof n.randomBytes == "function")
700
66
  try {
701
- return o.randomBytes(4).readInt32LE();
67
+ return n.randomBytes(4).readInt32LE();
702
68
  } catch {
703
69
  }
704
70
  }
705
71
  throw new Error("Native crypto module could not be used to get secure random number.");
706
- }, d = Object.create || function() {
707
- function c() {
72
+ }, c = Object.create || function() {
73
+ function a() {
708
74
  }
709
- return function(g) {
710
- var m;
711
- return c.prototype = g, m = new c(), c.prototype = null, m;
75
+ return function(d) {
76
+ var p;
77
+ return a.prototype = d, p = new a(), a.prototype = null, p;
712
78
  };
713
- }(), l = {}, h = l.lib = {}, p = h.Base = function() {
79
+ }(), l = {}, h = l.lib = {}, g = h.Base = function() {
714
80
  return {
715
81
  /**
716
82
  * Creates a new object that inherits from this object.
@@ -730,11 +96,11 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
730
96
  * }
731
97
  * });
732
98
  */
733
- extend: function(c) {
734
- var g = d(this);
735
- return c && g.mixIn(c), (!g.hasOwnProperty("init") || this.init === g.init) && (g.init = function() {
736
- g.$super.init.apply(this, arguments);
737
- }), g.init.prototype = g, g.$super = this, g;
99
+ extend: function(a) {
100
+ var d = c(this);
101
+ return a && d.mixIn(a), (!d.hasOwnProperty("init") || this.init === d.init) && (d.init = function() {
102
+ d.$super.init.apply(this, arguments);
103
+ }), d.init.prototype = d, d.$super = this, d;
738
104
  },
739
105
  /**
740
106
  * Extends this object and runs the init method.
@@ -749,8 +115,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
749
115
  * var instance = MyType.create();
750
116
  */
751
117
  create: function() {
752
- var c = this.extend();
753
- return c.init.apply(c, arguments), c;
118
+ var a = this.extend();
119
+ return a.init.apply(a, arguments), a;
754
120
  },
755
121
  /**
756
122
  * Initializes a newly created object.
@@ -777,10 +143,10 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
777
143
  * field: 'value'
778
144
  * });
779
145
  */
780
- mixIn: function(c) {
781
- for (var g in c)
782
- c.hasOwnProperty(g) && (this[g] = c[g]);
783
- c.hasOwnProperty("toString") && (this.toString = c.toString);
146
+ mixIn: function(a) {
147
+ for (var d in a)
148
+ a.hasOwnProperty(d) && (this[d] = a[d]);
149
+ a.hasOwnProperty("toString") && (this.toString = a.toString);
784
150
  },
785
151
  /**
786
152
  * Creates a copy of this object.
@@ -795,7 +161,7 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
795
161
  return this.init.prototype.extend(this);
796
162
  }
797
163
  };
798
- }(), _ = h.WordArray = p.extend({
164
+ }(), u = h.WordArray = g.extend({
799
165
  /**
800
166
  * Initializes a newly created word array.
801
167
  *
@@ -808,8 +174,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
808
174
  * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
809
175
  * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
810
176
  */
811
- init: function(c, g) {
812
- c = this.words = c || [], g != n ? this.sigBytes = g : this.sigBytes = c.length * 4;
177
+ init: function(a, d) {
178
+ a = this.words = a || [], d != i ? this.sigBytes = d : this.sigBytes = a.length * 4;
813
179
  },
814
180
  /**
815
181
  * Converts this word array to a string.
@@ -824,8 +190,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
824
190
  * var string = wordArray.toString();
825
191
  * var string = wordArray.toString(CryptoJS.enc.Utf8);
826
192
  */
827
- toString: function(c) {
828
- return (c || w).stringify(this);
193
+ toString: function(a) {
194
+ return (a || w).stringify(this);
829
195
  },
830
196
  /**
831
197
  * Concatenates a word array to this word array.
@@ -838,17 +204,17 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
838
204
  *
839
205
  * wordArray1.concat(wordArray2);
840
206
  */
841
- concat: function(c) {
842
- var g = this.words, m = c.words, E = this.sigBytes, P = c.sigBytes;
843
- if (this.clamp(), E % 4)
844
- for (var O = 0; O < P; O++) {
845
- var A = m[O >>> 2] >>> 24 - O % 4 * 8 & 255;
846
- g[E + O >>> 2] |= A << 24 - (E + O) % 4 * 8;
207
+ concat: function(a) {
208
+ var d = this.words, p = a.words, v = this.sigBytes, b = a.sigBytes;
209
+ if (this.clamp(), v % 4)
210
+ for (var E = 0; E < b; E++) {
211
+ var x = p[E >>> 2] >>> 24 - E % 4 * 8 & 255;
212
+ d[v + E >>> 2] |= x << 24 - (v + E) % 4 * 8;
847
213
  }
848
214
  else
849
- for (var j = 0; j < P; j += 4)
850
- g[E + j >>> 2] = m[j >>> 2];
851
- return this.sigBytes += P, this;
215
+ for (var C = 0; C < b; C += 4)
216
+ d[v + C >>> 2] = p[C >>> 2];
217
+ return this.sigBytes += b, this;
852
218
  },
853
219
  /**
854
220
  * Removes insignificant bits.
@@ -858,8 +224,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
858
224
  * wordArray.clamp();
859
225
  */
860
226
  clamp: function() {
861
- var c = this.words, g = this.sigBytes;
862
- c[g >>> 2] &= 4294967295 << 32 - g % 4 * 8, c.length = s.ceil(g / 4);
227
+ var a = this.words, d = this.sigBytes;
228
+ a[d >>> 2] &= 4294967295 << 32 - d % 4 * 8, a.length = r.ceil(d / 4);
863
229
  },
864
230
  /**
865
231
  * Creates a copy of this word array.
@@ -871,8 +237,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
871
237
  * var clone = wordArray.clone();
872
238
  */
873
239
  clone: function() {
874
- var c = p.clone.call(this);
875
- return c.words = this.words.slice(0), c;
240
+ var a = g.clone.call(this);
241
+ return a.words = this.words.slice(0), a;
876
242
  },
877
243
  /**
878
244
  * Creates a word array filled with random bytes.
@@ -887,12 +253,12 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
887
253
  *
888
254
  * var wordArray = CryptoJS.lib.WordArray.random(16);
889
255
  */
890
- random: function(c) {
891
- for (var g = [], m = 0; m < c; m += 4)
892
- g.push(a());
893
- return new _.init(g, c);
256
+ random: function(a) {
257
+ for (var d = [], p = 0; p < a; p += 4)
258
+ d.push(o());
259
+ return new u.init(d, a);
894
260
  }
895
- }), y = l.enc = {}, w = y.Hex = {
261
+ }), S = l.enc = {}, w = S.Hex = {
896
262
  /**
897
263
  * Converts a word array to a hex string.
898
264
  *
@@ -906,12 +272,12 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
906
272
  *
907
273
  * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
908
274
  */
909
- stringify: function(c) {
910
- for (var g = c.words, m = c.sigBytes, E = [], P = 0; P < m; P++) {
911
- var O = g[P >>> 2] >>> 24 - P % 4 * 8 & 255;
912
- E.push((O >>> 4).toString(16)), E.push((O & 15).toString(16));
275
+ stringify: function(a) {
276
+ for (var d = a.words, p = a.sigBytes, v = [], b = 0; b < p; b++) {
277
+ var E = d[b >>> 2] >>> 24 - b % 4 * 8 & 255;
278
+ v.push((E >>> 4).toString(16)), v.push((E & 15).toString(16));
913
279
  }
914
- return E.join("");
280
+ return v.join("");
915
281
  },
916
282
  /**
917
283
  * Converts a hex string to a word array.
@@ -926,12 +292,12 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
926
292
  *
927
293
  * var wordArray = CryptoJS.enc.Hex.parse(hexString);
928
294
  */
929
- parse: function(c) {
930
- for (var g = c.length, m = [], E = 0; E < g; E += 2)
931
- m[E >>> 3] |= parseInt(c.substr(E, 2), 16) << 24 - E % 8 * 4;
932
- return new _.init(m, g / 2);
295
+ parse: function(a) {
296
+ for (var d = a.length, p = [], v = 0; v < d; v += 2)
297
+ p[v >>> 3] |= parseInt(a.substr(v, 2), 16) << 24 - v % 8 * 4;
298
+ return new u.init(p, d / 2);
933
299
  }
934
- }, I = y.Latin1 = {
300
+ }, k = S.Latin1 = {
935
301
  /**
936
302
  * Converts a word array to a Latin1 string.
937
303
  *
@@ -945,12 +311,12 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
945
311
  *
946
312
  * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
947
313
  */
948
- stringify: function(c) {
949
- for (var g = c.words, m = c.sigBytes, E = [], P = 0; P < m; P++) {
950
- var O = g[P >>> 2] >>> 24 - P % 4 * 8 & 255;
951
- E.push(String.fromCharCode(O));
314
+ stringify: function(a) {
315
+ for (var d = a.words, p = a.sigBytes, v = [], b = 0; b < p; b++) {
316
+ var E = d[b >>> 2] >>> 24 - b % 4 * 8 & 255;
317
+ v.push(String.fromCharCode(E));
952
318
  }
953
- return E.join("");
319
+ return v.join("");
954
320
  },
955
321
  /**
956
322
  * Converts a Latin1 string to a word array.
@@ -965,12 +331,12 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
965
331
  *
966
332
  * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
967
333
  */
968
- parse: function(c) {
969
- for (var g = c.length, m = [], E = 0; E < g; E++)
970
- m[E >>> 2] |= (c.charCodeAt(E) & 255) << 24 - E % 4 * 8;
971
- return new _.init(m, g);
334
+ parse: function(a) {
335
+ for (var d = a.length, p = [], v = 0; v < d; v++)
336
+ p[v >>> 2] |= (a.charCodeAt(v) & 255) << 24 - v % 4 * 8;
337
+ return new u.init(p, d);
972
338
  }
973
- }, v = y.Utf8 = {
339
+ }, _ = S.Utf8 = {
974
340
  /**
975
341
  * Converts a word array to a UTF-8 string.
976
342
  *
@@ -984,9 +350,9 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
984
350
  *
985
351
  * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
986
352
  */
987
- stringify: function(c) {
353
+ stringify: function(a) {
988
354
  try {
989
- return decodeURIComponent(escape(I.stringify(c)));
355
+ return decodeURIComponent(escape(k.stringify(a)));
990
356
  } catch {
991
357
  throw new Error("Malformed UTF-8 data");
992
358
  }
@@ -1004,10 +370,10 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1004
370
  *
1005
371
  * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
1006
372
  */
1007
- parse: function(c) {
1008
- return I.parse(unescape(encodeURIComponent(c)));
373
+ parse: function(a) {
374
+ return k.parse(unescape(encodeURIComponent(a)));
1009
375
  }
1010
- }, R = h.BufferedBlockAlgorithm = p.extend({
376
+ }, m = h.BufferedBlockAlgorithm = g.extend({
1011
377
  /**
1012
378
  * Resets this block algorithm's data buffer to its initial state.
1013
379
  *
@@ -1016,7 +382,7 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1016
382
  * bufferedBlockAlgorithm.reset();
1017
383
  */
1018
384
  reset: function() {
1019
- this._data = new _.init(), this._nDataBytes = 0;
385
+ this._data = new u.init(), this._nDataBytes = 0;
1020
386
  },
1021
387
  /**
1022
388
  * Adds new data to this block algorithm's buffer.
@@ -1028,8 +394,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1028
394
  * bufferedBlockAlgorithm._append('data');
1029
395
  * bufferedBlockAlgorithm._append(wordArray);
1030
396
  */
1031
- _append: function(c) {
1032
- typeof c == "string" && (c = v.parse(c)), this._data.concat(c), this._nDataBytes += c.sigBytes;
397
+ _append: function(a) {
398
+ typeof a == "string" && (a = _.parse(a)), this._data.concat(a), this._nDataBytes += a.sigBytes;
1033
399
  },
1034
400
  /**
1035
401
  * Processes available data blocks.
@@ -1045,16 +411,16 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1045
411
  * var processedData = bufferedBlockAlgorithm._process();
1046
412
  * var processedData = bufferedBlockAlgorithm._process(!!'flush');
1047
413
  */
1048
- _process: function(c) {
1049
- var g, m = this._data, E = m.words, P = m.sigBytes, O = this.blockSize, A = O * 4, j = P / A;
1050
- c ? j = s.ceil(j) : j = s.max((j | 0) - this._minBufferSize, 0);
1051
- var B = j * O, F = s.min(B * 4, P);
1052
- if (B) {
1053
- for (var L = 0; L < B; L += O)
1054
- this._doProcessBlock(E, L);
1055
- g = E.splice(0, B), m.sigBytes -= F;
414
+ _process: function(a) {
415
+ var d, p = this._data, v = p.words, b = p.sigBytes, E = this.blockSize, x = E * 4, C = b / x;
416
+ a ? C = r.ceil(C) : C = r.max((C | 0) - this._minBufferSize, 0);
417
+ var A = C * E, R = r.min(A * 4, b);
418
+ if (A) {
419
+ for (var q = 0; q < A; q += E)
420
+ this._doProcessBlock(v, q);
421
+ d = v.splice(0, A), p.sigBytes -= R;
1056
422
  }
1057
- return new _.init(g, F);
423
+ return new u.init(d, R);
1058
424
  },
1059
425
  /**
1060
426
  * Creates a copy of this object.
@@ -1066,16 +432,16 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1066
432
  * var clone = bufferedBlockAlgorithm.clone();
1067
433
  */
1068
434
  clone: function() {
1069
- var c = p.clone.call(this);
1070
- return c._data = this._data.clone(), c;
435
+ var a = g.clone.call(this);
436
+ return a._data = this._data.clone(), a;
1071
437
  },
1072
438
  _minBufferSize: 0
1073
439
  });
1074
- h.Hasher = R.extend({
440
+ h.Hasher = m.extend({
1075
441
  /**
1076
442
  * Configuration options.
1077
443
  */
1078
- cfg: p.extend(),
444
+ cfg: g.extend(),
1079
445
  /**
1080
446
  * Initializes a newly created hasher.
1081
447
  *
@@ -1085,8 +451,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1085
451
  *
1086
452
  * var hasher = CryptoJS.algo.SHA256.create();
1087
453
  */
1088
- init: function(c) {
1089
- this.cfg = this.cfg.extend(c), this.reset();
454
+ init: function(a) {
455
+ this.cfg = this.cfg.extend(a), this.reset();
1090
456
  },
1091
457
  /**
1092
458
  * Resets this hasher to its initial state.
@@ -1096,7 +462,7 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1096
462
  * hasher.reset();
1097
463
  */
1098
464
  reset: function() {
1099
- R.reset.call(this), this._doReset();
465
+ m.reset.call(this), this._doReset();
1100
466
  },
1101
467
  /**
1102
468
  * Updates this hasher with a message.
@@ -1110,8 +476,8 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1110
476
  * hasher.update('message');
1111
477
  * hasher.update(wordArray);
1112
478
  */
1113
- update: function(c) {
1114
- return this._append(c), this._process(), this;
479
+ update: function(a) {
480
+ return this._append(a), this._process(), this;
1115
481
  },
1116
482
  /**
1117
483
  * Finalizes the hash computation.
@@ -1127,10 +493,10 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1127
493
  * var hash = hasher.finalize('message');
1128
494
  * var hash = hasher.finalize(wordArray);
1129
495
  */
1130
- finalize: function(c) {
1131
- c && this._append(c);
1132
- var g = this._doFinalize();
1133
- return g;
496
+ finalize: function(a) {
497
+ a && this._append(a);
498
+ var d = this._doFinalize();
499
+ return d;
1134
500
  },
1135
501
  blockSize: 16,
1136
502
  /**
@@ -1146,9 +512,9 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1146
512
  *
1147
513
  * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
1148
514
  */
1149
- _createHelper: function(c) {
1150
- return function(g, m) {
1151
- return new c.init(m).finalize(g);
515
+ _createHelper: function(a) {
516
+ return function(d, p) {
517
+ return new a.init(p).finalize(d);
1152
518
  };
1153
519
  },
1154
520
  /**
@@ -1164,90 +530,90 @@ const ir = {}, nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1164
530
  *
1165
531
  * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
1166
532
  */
1167
- _createHmacHelper: function(c) {
1168
- return function(g, m) {
1169
- return new k.HMAC.init(c, m).finalize(g);
533
+ _createHmacHelper: function(a) {
534
+ return function(d, p) {
535
+ return new y.HMAC.init(a, p).finalize(d);
1170
536
  };
1171
537
  }
1172
538
  });
1173
- var k = l.algo = {};
539
+ var y = l.algo = {};
1174
540
  return l;
1175
541
  }(Math);
1176
- return r;
542
+ return s;
1177
543
  });
1178
- })(sr);
1179
- var Ie = {}, ar = {
544
+ })(Ue);
545
+ var Q = {}, qe = {
1180
546
  get exports() {
1181
- return Ie;
547
+ return Q;
1182
548
  },
1183
549
  set exports(e) {
1184
- Ie = e;
550
+ Q = e;
1185
551
  }
1186
552
  };
1187
553
  (function(e, t) {
1188
- (function(r, s) {
1189
- e.exports = s(se);
1190
- })(Q, function(r) {
1191
- return function(s) {
1192
- var n = r, o = n.lib, a = o.WordArray, d = o.Hasher, l = n.algo, h = [], p = [];
554
+ (function(s, r) {
555
+ e.exports = r(H);
556
+ })(N, function(s) {
557
+ return function(r) {
558
+ var i = s, n = i.lib, o = n.WordArray, c = n.Hasher, l = i.algo, h = [], g = [];
1193
559
  (function() {
1194
- function w(k) {
1195
- for (var c = s.sqrt(k), g = 2; g <= c; g++)
1196
- if (!(k % g))
560
+ function w(y) {
561
+ for (var a = r.sqrt(y), d = 2; d <= a; d++)
562
+ if (!(y % d))
1197
563
  return !1;
1198
564
  return !0;
1199
565
  }
1200
- function I(k) {
1201
- return (k - (k | 0)) * 4294967296 | 0;
566
+ function k(y) {
567
+ return (y - (y | 0)) * 4294967296 | 0;
1202
568
  }
1203
- for (var v = 2, R = 0; R < 64; )
1204
- w(v) && (R < 8 && (h[R] = I(s.pow(v, 1 / 2))), p[R] = I(s.pow(v, 1 / 3)), R++), v++;
569
+ for (var _ = 2, m = 0; m < 64; )
570
+ w(_) && (m < 8 && (h[m] = k(r.pow(_, 1 / 2))), g[m] = k(r.pow(_, 1 / 3)), m++), _++;
1205
571
  })();
1206
- var _ = [], y = l.SHA256 = d.extend({
572
+ var u = [], S = l.SHA256 = c.extend({
1207
573
  _doReset: function() {
1208
- this._hash = new a.init(h.slice(0));
574
+ this._hash = new o.init(h.slice(0));
1209
575
  },
1210
- _doProcessBlock: function(w, I) {
1211
- for (var v = this._hash.words, R = v[0], k = v[1], c = v[2], g = v[3], m = v[4], E = v[5], P = v[6], O = v[7], A = 0; A < 64; A++) {
1212
- if (A < 16)
1213
- _[A] = w[I + A] | 0;
576
+ _doProcessBlock: function(w, k) {
577
+ for (var _ = this._hash.words, m = _[0], y = _[1], a = _[2], d = _[3], p = _[4], v = _[5], b = _[6], E = _[7], x = 0; x < 64; x++) {
578
+ if (x < 16)
579
+ u[x] = w[k + x] | 0;
1214
580
  else {
1215
- var j = _[A - 15], B = (j << 25 | j >>> 7) ^ (j << 14 | j >>> 18) ^ j >>> 3, F = _[A - 2], L = (F << 15 | F >>> 17) ^ (F << 13 | F >>> 19) ^ F >>> 10;
1216
- _[A] = B + _[A - 7] + L + _[A - 16];
581
+ var C = u[x - 15], A = (C << 25 | C >>> 7) ^ (C << 14 | C >>> 18) ^ C >>> 3, R = u[x - 2], q = (R << 15 | R >>> 17) ^ (R << 13 | R >>> 19) ^ R >>> 10;
582
+ u[x] = A + u[x - 7] + q + u[x - 16];
1217
583
  }
1218
- var W = m & E ^ ~m & P, $ = R & k ^ R & c ^ k & c, V = (R << 30 | R >>> 2) ^ (R << 19 | R >>> 13) ^ (R << 10 | R >>> 22), ee = (m << 26 | m >>> 6) ^ (m << 21 | m >>> 11) ^ (m << 7 | m >>> 25), X = O + ee + W + p[A] + _[A], le = V + $;
1219
- O = P, P = E, E = m, m = g + X | 0, g = c, c = k, k = R, R = X + le | 0;
584
+ var W = p & v ^ ~p & b, J = m & y ^ m & a ^ y & a, K = (m << 30 | m >>> 2) ^ (m << 19 | m >>> 13) ^ (m << 10 | m >>> 22), V = (p << 26 | p >>> 6) ^ (p << 21 | p >>> 11) ^ (p << 7 | p >>> 25), B = E + V + W + g[x] + u[x], xe = K + J;
585
+ E = b, b = v, v = p, p = d + B | 0, d = a, a = y, y = m, m = B + xe | 0;
1220
586
  }
1221
- v[0] = v[0] + R | 0, v[1] = v[1] + k | 0, v[2] = v[2] + c | 0, v[3] = v[3] + g | 0, v[4] = v[4] + m | 0, v[5] = v[5] + E | 0, v[6] = v[6] + P | 0, v[7] = v[7] + O | 0;
587
+ _[0] = _[0] + m | 0, _[1] = _[1] + y | 0, _[2] = _[2] + a | 0, _[3] = _[3] + d | 0, _[4] = _[4] + p | 0, _[5] = _[5] + v | 0, _[6] = _[6] + b | 0, _[7] = _[7] + E | 0;
1222
588
  },
1223
589
  _doFinalize: function() {
1224
- var w = this._data, I = w.words, v = this._nDataBytes * 8, R = w.sigBytes * 8;
1225
- return I[R >>> 5] |= 128 << 24 - R % 32, I[(R + 64 >>> 9 << 4) + 14] = s.floor(v / 4294967296), I[(R + 64 >>> 9 << 4) + 15] = v, w.sigBytes = I.length * 4, this._process(), this._hash;
590
+ var w = this._data, k = w.words, _ = this._nDataBytes * 8, m = w.sigBytes * 8;
591
+ return k[m >>> 5] |= 128 << 24 - m % 32, k[(m + 64 >>> 9 << 4) + 14] = r.floor(_ / 4294967296), k[(m + 64 >>> 9 << 4) + 15] = _, w.sigBytes = k.length * 4, this._process(), this._hash;
1226
592
  },
1227
593
  clone: function() {
1228
- var w = d.clone.call(this);
594
+ var w = c.clone.call(this);
1229
595
  return w._hash = this._hash.clone(), w;
1230
596
  }
1231
597
  });
1232
- n.SHA256 = d._createHelper(y), n.HmacSHA256 = d._createHmacHelper(y);
1233
- }(Math), r.SHA256;
598
+ i.SHA256 = c._createHelper(S), i.HmacSHA256 = c._createHmacHelper(S);
599
+ }(Math), s.SHA256;
1234
600
  });
1235
- })(ar);
1236
- var ve = {}, cr = {
601
+ })(qe);
602
+ var $ = {}, Ne = {
1237
603
  get exports() {
1238
- return ve;
604
+ return $;
1239
605
  },
1240
606
  set exports(e) {
1241
- ve = e;
607
+ $ = e;
1242
608
  }
1243
609
  };
1244
610
  (function(e, t) {
1245
- (function(r, s) {
1246
- e.exports = s(se);
1247
- })(Q, function(r) {
611
+ (function(s, r) {
612
+ e.exports = r(H);
613
+ })(N, function(s) {
1248
614
  return function() {
1249
- var s = r, n = s.lib, o = n.WordArray, a = s.enc;
1250
- a.Base64 = {
615
+ var r = s, i = r.lib, n = i.WordArray, o = r.enc;
616
+ o.Base64 = {
1251
617
  /**
1252
618
  * Converts a word array to a Base64 string.
1253
619
  *
@@ -1262,16 +628,16 @@ var ve = {}, cr = {
1262
628
  * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
1263
629
  */
1264
630
  stringify: function(l) {
1265
- var h = l.words, p = l.sigBytes, _ = this._map;
631
+ var h = l.words, g = l.sigBytes, u = this._map;
1266
632
  l.clamp();
1267
- for (var y = [], w = 0; w < p; w += 3)
1268
- for (var I = h[w >>> 2] >>> 24 - w % 4 * 8 & 255, v = h[w + 1 >>> 2] >>> 24 - (w + 1) % 4 * 8 & 255, R = h[w + 2 >>> 2] >>> 24 - (w + 2) % 4 * 8 & 255, k = I << 16 | v << 8 | R, c = 0; c < 4 && w + c * 0.75 < p; c++)
1269
- y.push(_.charAt(k >>> 6 * (3 - c) & 63));
1270
- var g = _.charAt(64);
1271
- if (g)
1272
- for (; y.length % 4; )
1273
- y.push(g);
1274
- return y.join("");
633
+ for (var S = [], w = 0; w < g; w += 3)
634
+ for (var k = h[w >>> 2] >>> 24 - w % 4 * 8 & 255, _ = h[w + 1 >>> 2] >>> 24 - (w + 1) % 4 * 8 & 255, m = h[w + 2 >>> 2] >>> 24 - (w + 2) % 4 * 8 & 255, y = k << 16 | _ << 8 | m, a = 0; a < 4 && w + a * 0.75 < g; a++)
635
+ S.push(u.charAt(y >>> 6 * (3 - a) & 63));
636
+ var d = u.charAt(64);
637
+ if (d)
638
+ for (; S.length % 4; )
639
+ S.push(d);
640
+ return S.join("");
1275
641
  },
1276
642
  /**
1277
643
  * Converts a Base64 string to a word array.
@@ -1287,60 +653,60 @@ var ve = {}, cr = {
1287
653
  * var wordArray = CryptoJS.enc.Base64.parse(base64String);
1288
654
  */
1289
655
  parse: function(l) {
1290
- var h = l.length, p = this._map, _ = this._reverseMap;
1291
- if (!_) {
1292
- _ = this._reverseMap = [];
1293
- for (var y = 0; y < p.length; y++)
1294
- _[p.charCodeAt(y)] = y;
656
+ var h = l.length, g = this._map, u = this._reverseMap;
657
+ if (!u) {
658
+ u = this._reverseMap = [];
659
+ for (var S = 0; S < g.length; S++)
660
+ u[g.charCodeAt(S)] = S;
1295
661
  }
1296
- var w = p.charAt(64);
662
+ var w = g.charAt(64);
1297
663
  if (w) {
1298
- var I = l.indexOf(w);
1299
- I !== -1 && (h = I);
664
+ var k = l.indexOf(w);
665
+ k !== -1 && (h = k);
1300
666
  }
1301
- return d(l, h, _);
667
+ return c(l, h, u);
1302
668
  },
1303
669
  _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
1304
670
  };
1305
- function d(l, h, p) {
1306
- for (var _ = [], y = 0, w = 0; w < h; w++)
671
+ function c(l, h, g) {
672
+ for (var u = [], S = 0, w = 0; w < h; w++)
1307
673
  if (w % 4) {
1308
- var I = p[l.charCodeAt(w - 1)] << w % 4 * 2, v = p[l.charCodeAt(w)] >>> 6 - w % 4 * 2, R = I | v;
1309
- _[y >>> 2] |= R << 24 - y % 4 * 8, y++;
674
+ var k = g[l.charCodeAt(w - 1)] << w % 4 * 2, _ = g[l.charCodeAt(w)] >>> 6 - w % 4 * 2, m = k | _;
675
+ u[S >>> 2] |= m << 24 - S % 4 * 8, S++;
1310
676
  }
1311
- return o.create(_, y);
677
+ return n.create(u, S);
1312
678
  }
1313
- }(), r.enc.Base64;
679
+ }(), s.enc.Base64;
1314
680
  });
1315
- })(cr);
1316
- var Pe = {}, lr = {
681
+ })(Ne);
682
+ var X = {}, je = {
1317
683
  get exports() {
1318
- return Pe;
684
+ return X;
1319
685
  },
1320
686
  set exports(e) {
1321
- Pe = e;
687
+ X = e;
1322
688
  }
1323
689
  };
1324
690
  (function(e, t) {
1325
- (function(r, s) {
1326
- e.exports = s(se);
1327
- })(Q, function(r) {
1328
- return r.enc.Utf8;
691
+ (function(s, r) {
692
+ e.exports = r(H);
693
+ })(N, function(s) {
694
+ return s.enc.Utf8;
1329
695
  });
1330
- })(lr);
1331
- function Oe(e) {
696
+ })(je);
697
+ function Y(e) {
1332
698
  this.message = e;
1333
699
  }
1334
- Oe.prototype = new Error(), Oe.prototype.name = "InvalidCharacterError";
1335
- var at = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
700
+ Y.prototype = new Error(), Y.prototype.name = "InvalidCharacterError";
701
+ var ce = typeof window < "u" && window.atob && window.atob.bind(window) || function(e) {
1336
702
  var t = String(e).replace(/=+$/, "");
1337
703
  if (t.length % 4 == 1)
1338
- throw new Oe("'atob' failed: The string to be decoded is not correctly encoded.");
1339
- for (var r, s, n = 0, o = 0, a = ""; s = t.charAt(o++); ~s && (r = n % 4 ? 64 * r + s : s, n++ % 4) ? a += String.fromCharCode(255 & r >> (-2 * n & 6)) : 0)
1340
- s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);
1341
- return a;
704
+ throw new Y("'atob' failed: The string to be decoded is not correctly encoded.");
705
+ for (var s, r, i = 0, n = 0, o = ""; r = t.charAt(n++); ~r && (s = i % 4 ? 64 * s + r : r, i++ % 4) ? o += String.fromCharCode(255 & s >> (-2 * i & 6)) : 0)
706
+ r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
707
+ return o;
1342
708
  };
1343
- function ur(e) {
709
+ function He(e) {
1344
710
  var t = e.replace(/-/g, "+").replace(/_/g, "/");
1345
711
  switch (t.length % 4) {
1346
712
  case 0:
@@ -1355,31 +721,31 @@ function ur(e) {
1355
721
  throw "Illegal base64url string!";
1356
722
  }
1357
723
  try {
1358
- return function(r) {
1359
- return decodeURIComponent(at(r).replace(/(.)/g, function(s, n) {
1360
- var o = n.charCodeAt(0).toString(16).toUpperCase();
1361
- return o.length < 2 && (o = "0" + o), "%" + o;
724
+ return function(s) {
725
+ return decodeURIComponent(ce(s).replace(/(.)/g, function(r, i) {
726
+ var n = i.charCodeAt(0).toString(16).toUpperCase();
727
+ return n.length < 2 && (n = "0" + n), "%" + n;
1362
728
  }));
1363
729
  }(t);
1364
730
  } catch {
1365
- return at(t);
731
+ return ce(t);
1366
732
  }
1367
733
  }
1368
- function we(e) {
734
+ function z(e) {
1369
735
  this.message = e;
1370
736
  }
1371
- function dr(e, t) {
737
+ function Me(e, t) {
1372
738
  if (typeof e != "string")
1373
- throw new we("Invalid token specified");
1374
- var r = (t = t || {}).header === !0 ? 0 : 1;
739
+ throw new z("Invalid token specified");
740
+ var s = (t = t || {}).header === !0 ? 0 : 1;
1375
741
  try {
1376
- return JSON.parse(ur(e.split(".")[r]));
1377
- } catch (s) {
1378
- throw new we("Invalid token specified: " + s.message);
742
+ return JSON.parse(He(e.split(".")[s]));
743
+ } catch (r) {
744
+ throw new z("Invalid token specified: " + r.message);
1379
745
  }
1380
746
  }
1381
- we.prototype = new Error(), we.prototype.name = "InvalidTokenError";
1382
- var hr = {
747
+ z.prototype = new Error(), z.prototype.name = "InvalidTokenError";
748
+ var We = {
1383
749
  debug: () => {
1384
750
  },
1385
751
  info: () => {
@@ -1388,38 +754,38 @@ var hr = {
1388
754
  },
1389
755
  error: () => {
1390
756
  }
1391
- }, z, J, me = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(me || {});
757
+ }, I, U, D = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(D || {});
1392
758
  ((e) => {
1393
759
  function t() {
1394
- z = 3, J = hr;
760
+ I = 3, U = We;
1395
761
  }
1396
762
  e.reset = t;
1397
- function r(n) {
1398
- if (!(0 <= n && n <= 4))
763
+ function s(i) {
764
+ if (!(0 <= i && i <= 4))
1399
765
  throw new Error("Invalid log level");
1400
- z = n;
766
+ I = i;
1401
767
  }
1402
- e.setLevel = r;
1403
- function s(n) {
1404
- J = n;
768
+ e.setLevel = s;
769
+ function r(i) {
770
+ U = i;
1405
771
  }
1406
- e.setLogger = s;
1407
- })(me || (me = {}));
1408
- var b = class {
772
+ e.setLogger = r;
773
+ })(D || (D = {}));
774
+ var f = class {
1409
775
  constructor(e) {
1410
776
  this._name = e;
1411
777
  }
1412
778
  debug(...e) {
1413
- z >= 4 && J.debug(b._format(this._name, this._method), ...e);
779
+ I >= 4 && U.debug(f._format(this._name, this._method), ...e);
1414
780
  }
1415
781
  info(...e) {
1416
- z >= 3 && J.info(b._format(this._name, this._method), ...e);
782
+ I >= 3 && U.info(f._format(this._name, this._method), ...e);
1417
783
  }
1418
784
  warn(...e) {
1419
- z >= 2 && J.warn(b._format(this._name, this._method), ...e);
785
+ I >= 2 && U.warn(f._format(this._name, this._method), ...e);
1420
786
  }
1421
787
  error(...e) {
1422
- z >= 1 && J.error(b._format(this._name, this._method), ...e);
788
+ I >= 1 && U.error(f._format(this._name, this._method), ...e);
1423
789
  }
1424
790
  throw(e) {
1425
791
  throw this.error(e), e;
@@ -1429,68 +795,68 @@ var b = class {
1429
795
  return t._method = e, t.debug("begin"), t;
1430
796
  }
1431
797
  static createStatic(e, t) {
1432
- const r = new b(`${e}.${t}`);
1433
- return r.debug("begin"), r;
798
+ const s = new f(`${e}.${t}`);
799
+ return s.debug("begin"), s;
1434
800
  }
1435
801
  static _format(e, t) {
1436
- const r = `[${e}]`;
1437
- return t ? `${r} ${t}:` : r;
802
+ const s = `[${e}]`;
803
+ return t ? `${s} ${t}:` : s;
1438
804
  }
1439
805
  // helpers for static class methods
1440
806
  static debug(e, ...t) {
1441
- z >= 4 && J.debug(b._format(e), ...t);
807
+ I >= 4 && U.debug(f._format(e), ...t);
1442
808
  }
1443
809
  static info(e, ...t) {
1444
- z >= 3 && J.info(b._format(e), ...t);
810
+ I >= 3 && U.info(f._format(e), ...t);
1445
811
  }
1446
812
  static warn(e, ...t) {
1447
- z >= 2 && J.warn(b._format(e), ...t);
813
+ I >= 2 && U.warn(f._format(e), ...t);
1448
814
  }
1449
815
  static error(e, ...t) {
1450
- z >= 1 && J.error(b._format(e), ...t);
816
+ I >= 1 && U.error(f._format(e), ...t);
1451
817
  }
1452
818
  };
1453
- me.reset();
1454
- var gr = "10000000-1000-4000-8000-100000000000", K = class {
819
+ D.reset();
820
+ var Be = "10000000-1000-4000-8000-100000000000", P = class {
1455
821
  static _randomWord() {
1456
- return se.lib.WordArray.random(1).words[0];
822
+ return H.lib.WordArray.random(1).words[0];
1457
823
  }
1458
824
  /**
1459
825
  * Generates RFC4122 version 4 guid
1460
826
  */
1461
827
  static generateUUIDv4() {
1462
- return gr.replace(
828
+ return Be.replace(
1463
829
  /[018]/g,
1464
- (t) => (+t ^ K._randomWord() & 15 >> +t / 4).toString(16)
830
+ (t) => (+t ^ P._randomWord() & 15 >> +t / 4).toString(16)
1465
831
  ).replace(/-/g, "");
1466
832
  }
1467
833
  /**
1468
834
  * PKCE: Generate a code verifier
1469
835
  */
1470
836
  static generateCodeVerifier() {
1471
- return K.generateUUIDv4() + K.generateUUIDv4() + K.generateUUIDv4();
837
+ return P.generateUUIDv4() + P.generateUUIDv4() + P.generateUUIDv4();
1472
838
  }
1473
839
  /**
1474
840
  * PKCE: Generate a code challenge
1475
841
  */
1476
842
  static generateCodeChallenge(e) {
1477
843
  try {
1478
- const t = Ie(e);
1479
- return ve.stringify(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
844
+ const t = Q(e);
845
+ return $.stringify(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
1480
846
  } catch (t) {
1481
- throw b.error("CryptoUtils.generateCodeChallenge", t), t;
847
+ throw f.error("CryptoUtils.generateCodeChallenge", t), t;
1482
848
  }
1483
849
  }
1484
850
  /**
1485
851
  * Generates a base64-encoded string for a basic auth header
1486
852
  */
1487
853
  static generateBasicAuth(e, t) {
1488
- const r = Pe.parse([e, t].join(":"));
1489
- return ve.stringify(r);
854
+ const s = X.parse([e, t].join(":"));
855
+ return $.stringify(s);
1490
856
  }
1491
- }, G = class {
857
+ }, O = class {
1492
858
  constructor(e) {
1493
- this._name = e, this._logger = new b(`Event('${this._name}')`), this._callbacks = [];
859
+ this._name = e, this._logger = new f(`Event('${this._name}')`), this._callbacks = [];
1494
860
  }
1495
861
  addHandler(e) {
1496
862
  return this._callbacks.push(e), () => this.removeHandler(e);
@@ -1504,33 +870,33 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1504
870
  for (const t of this._callbacks)
1505
871
  t(...e);
1506
872
  }
1507
- }, Ue = class {
873
+ }, Z = class {
1508
874
  // IMPORTANT: doesn't validate the token
1509
875
  static decode(e) {
1510
876
  try {
1511
- return dr(e);
877
+ return Me(e);
1512
878
  } catch (t) {
1513
- throw b.error("JwtUtils.decode", t), t;
879
+ throw f.error("JwtUtils.decode", t), t;
1514
880
  }
1515
881
  }
1516
- }, ct = class {
882
+ }, le = class {
1517
883
  /**
1518
884
  * Populates a map of window features with a placement centered in front of
1519
885
  * the current window. If no explicit width is given, a default value is
1520
886
  * binned into [800, 720, 600, 480, 360] based on the current window's width.
1521
887
  */
1522
888
  static center({ ...e }) {
1523
- var t, r, s;
1524
- return e.width == null && (e.width = (t = [800, 720, 600, 480].find((n) => n <= window.outerWidth / 1.618)) != null ? t : 360), (r = e.left) != null || (e.left = Math.max(0, Math.round(window.screenX + (window.outerWidth - e.width) / 2))), e.height != null && ((s = e.top) != null || (e.top = Math.max(0, Math.round(window.screenY + (window.outerHeight - e.height) / 2)))), e;
889
+ var t, s, r;
890
+ return e.width == null && (e.width = (t = [800, 720, 600, 480].find((i) => i <= window.outerWidth / 1.618)) != null ? t : 360), (s = e.left) != null || (e.left = Math.max(0, Math.round(window.screenX + (window.outerWidth - e.width) / 2))), e.height != null && ((r = e.top) != null || (e.top = Math.max(0, Math.round(window.screenY + (window.outerHeight - e.height) / 2)))), e;
1525
891
  }
1526
892
  static serialize(e) {
1527
- return Object.entries(e).filter(([, t]) => t != null).map(([t, r]) => `${t}=${typeof r != "boolean" ? r : r ? "yes" : "no"}`).join(",");
893
+ return Object.entries(e).filter(([, t]) => t != null).map(([t, s]) => `${t}=${typeof s != "boolean" ? s : s ? "yes" : "no"}`).join(",");
1528
894
  }
1529
- }, H = class extends G {
895
+ }, T = class extends O {
1530
896
  constructor() {
1531
- super(...arguments), this._logger = new b(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
1532
- const e = this._expiration - H.getEpochTime();
1533
- this._logger.debug("timer completes in", e), this._expiration <= H.getEpochTime() && (this.cancel(), super.raise());
897
+ super(...arguments), this._logger = new f(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
898
+ const e = this._expiration - T.getEpochTime();
899
+ this._logger.debug("timer completes in", e), this._expiration <= T.getEpochTime() && (this.cancel(), super.raise());
1534
900
  };
1535
901
  }
1536
902
  // get the time
@@ -1540,14 +906,14 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1540
906
  init(e) {
1541
907
  const t = this._logger.create("init");
1542
908
  e = Math.max(Math.floor(e), 1);
1543
- const r = H.getEpochTime() + e;
1544
- if (this.expiration === r && this._timerHandle) {
909
+ const s = T.getEpochTime() + e;
910
+ if (this.expiration === s && this._timerHandle) {
1545
911
  t.debug("skipping since already initialized for expiration at", this.expiration);
1546
912
  return;
1547
913
  }
1548
- this.cancel(), t.debug("using duration", e), this._expiration = r;
1549
- const s = Math.min(e, 5);
1550
- this._timerHandle = setInterval(this._callback, s * 1e3);
914
+ this.cancel(), t.debug("using duration", e), this._expiration = s;
915
+ const r = Math.min(e, 5);
916
+ this._timerHandle = setInterval(this._callback, r * 1e3);
1551
917
  }
1552
918
  get expiration() {
1553
919
  return this._expiration;
@@ -1555,39 +921,39 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1555
921
  cancel() {
1556
922
  this._logger.create("cancel"), this._timerHandle && (clearInterval(this._timerHandle), this._timerHandle = null);
1557
923
  }
1558
- }, Ae = class {
924
+ }, ee = class {
1559
925
  static readParams(e, t = "query") {
1560
926
  if (!e)
1561
927
  throw new TypeError("Invalid URL");
1562
- const s = new URL(e, window.location.origin)[t === "fragment" ? "hash" : "search"];
1563
- return new URLSearchParams(s.slice(1));
928
+ const r = new URL(e, window.location.origin)[t === "fragment" ? "hash" : "search"];
929
+ return new URLSearchParams(r.slice(1));
1564
930
  }
1565
- }, Z = class extends Error {
931
+ }, j = class extends Error {
1566
932
  constructor(e, t) {
1567
- var r, s, n;
933
+ var s, r, i;
1568
934
  if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error)
1569
- throw b.error("ErrorResponse", "No error passed"), new Error("No error passed");
1570
- this.error = e.error, this.error_description = (r = e.error_description) != null ? r : null, this.error_uri = (s = e.error_uri) != null ? s : null, this.state = e.userState, this.session_state = (n = e.session_state) != null ? n : null;
935
+ throw f.error("ErrorResponse", "No error passed"), new Error("No error passed");
936
+ this.error = e.error, this.error_description = (s = e.error_description) != null ? s : null, this.error_uri = (r = e.error_uri) != null ? r : null, this.state = e.userState, this.session_state = (i = e.session_state) != null ? i : null;
1571
937
  }
1572
- }, Ne = class extends Error {
938
+ }, re = class extends Error {
1573
939
  constructor(e) {
1574
940
  super(e), this.name = "ErrorTimeout";
1575
941
  }
1576
- }, fr = class {
942
+ }, Le = class {
1577
943
  constructor(e) {
1578
- this._logger = new b("AccessTokenEvents"), this._expiringTimer = new H("Access token expiring"), this._expiredTimer = new H("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
944
+ this._logger = new f("AccessTokenEvents"), this._expiringTimer = new T("Access token expiring"), this._expiredTimer = new T("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
1579
945
  }
1580
946
  load(e) {
1581
947
  const t = this._logger.create("load");
1582
948
  if (e.access_token && e.expires_in !== void 0) {
1583
- const r = e.expires_in;
1584
- if (t.debug("access token present, remaining duration:", r), r > 0) {
1585
- let n = r - this._expiringNotificationTimeInSeconds;
1586
- n <= 0 && (n = 1), t.debug("registering expiring timer, raising in", n, "seconds"), this._expiringTimer.init(n);
949
+ const s = e.expires_in;
950
+ if (t.debug("access token present, remaining duration:", s), s > 0) {
951
+ let i = s - this._expiringNotificationTimeInSeconds;
952
+ i <= 0 && (i = 1), t.debug("registering expiring timer, raising in", i, "seconds"), this._expiringTimer.init(i);
1587
953
  } else
1588
954
  t.debug("canceling existing expiring timer because we're past expiration."), this._expiringTimer.cancel();
1589
- const s = r + 1;
1590
- t.debug("registering expired timer, raising in", s, "seconds"), this._expiredTimer.init(s);
955
+ const r = s + 1;
956
+ t.debug("registering expired timer, raising in", r, "seconds"), this._expiredTimer.init(r);
1591
957
  } else
1592
958
  this._expiringTimer.cancel(), this._expiredTimer.cancel();
1593
959
  }
@@ -1618,13 +984,13 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1618
984
  removeAccessTokenExpired(e) {
1619
985
  this._expiredTimer.removeHandler(e);
1620
986
  }
1621
- }, _r = class {
1622
- constructor(e, t, r, s, n) {
1623
- this._callback = e, this._client_id = t, this._intervalInSeconds = s, this._stopOnError = n, this._logger = new b("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (a) => {
1624
- a.origin === this._frame_origin && a.source === this._frame.contentWindow && (a.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : a.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(a.data + " message from check session op iframe"));
987
+ }, Fe = class {
988
+ constructor(e, t, s, r, i) {
989
+ this._callback = e, this._client_id = t, this._intervalInSeconds = r, this._stopOnError = i, this._logger = new f("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (o) => {
990
+ o.origin === this._frame_origin && o.source === this._frame.contentWindow && (o.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : o.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(o.data + " message from check session op iframe"));
1625
991
  };
1626
- const o = new URL(r);
1627
- this._frame_origin = o.origin, this._frame = window.document.createElement("iframe"), this._frame.style.visibility = "hidden", this._frame.style.position = "fixed", this._frame.style.left = "-1000px", this._frame.style.top = "0", this._frame.width = "0", this._frame.height = "0", this._frame.src = o.href;
992
+ const n = new URL(s);
993
+ this._frame_origin = n.origin, this._frame = window.document.createElement("iframe"), this._frame.style.visibility = "hidden", this._frame.style.position = "fixed", this._frame.style.left = "-1000px", this._frame.style.top = "0", this._frame.width = "0", this._frame.height = "0", this._frame.src = n.href;
1628
994
  }
1629
995
  load() {
1630
996
  return new Promise((e) => {
@@ -1645,9 +1011,9 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1645
1011
  stop() {
1646
1012
  this._logger.create("stop"), this._session_state = null, this._timer && (clearInterval(this._timer), this._timer = null);
1647
1013
  }
1648
- }, pt = class {
1014
+ }, fe = class {
1649
1015
  constructor() {
1650
- this._logger = new b("InMemoryWebStorage"), this._data = {};
1016
+ this._logger = new f("InMemoryWebStorage"), this._data = {};
1651
1017
  }
1652
1018
  clear() {
1653
1019
  this._logger.create("clear"), this._data = {};
@@ -1667,90 +1033,90 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1667
1033
  key(e) {
1668
1034
  return Object.getOwnPropertyNames(this._data)[e];
1669
1035
  }
1670
- }, qe = class {
1036
+ }, ie = class {
1671
1037
  constructor(e = [], t = null) {
1672
- this._jwtHandler = t, this._logger = new b("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
1038
+ this._jwtHandler = t, this._logger = new f("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
1673
1039
  }
1674
1040
  async fetchWithTimeout(e, t = {}) {
1675
- const { timeoutInSeconds: r, ...s } = t;
1676
- if (!r)
1677
- return await fetch(e, s);
1678
- const n = new AbortController(), o = setTimeout(() => n.abort(), r * 1e3);
1041
+ const { timeoutInSeconds: s, ...r } = t;
1042
+ if (!s)
1043
+ return await fetch(e, r);
1044
+ const i = new AbortController(), n = setTimeout(() => i.abort(), s * 1e3);
1679
1045
  try {
1680
1046
  return await fetch(e, {
1681
1047
  ...t,
1682
- signal: n.signal
1048
+ signal: i.signal
1683
1049
  });
1684
- } catch (a) {
1685
- throw a instanceof DOMException && a.name === "AbortError" ? new Ne("Network timed out") : a;
1050
+ } catch (o) {
1051
+ throw o instanceof DOMException && o.name === "AbortError" ? new re("Network timed out") : o;
1686
1052
  } finally {
1687
- clearTimeout(o);
1053
+ clearTimeout(n);
1688
1054
  }
1689
1055
  }
1690
1056
  async getJson(e, {
1691
1057
  token: t,
1692
- credentials: r
1058
+ credentials: s
1693
1059
  } = {}) {
1694
- const s = this._logger.create("getJson"), n = {
1060
+ const r = this._logger.create("getJson"), i = {
1695
1061
  Accept: this._contentTypes.join(", ")
1696
1062
  };
1697
- t && (s.debug("token passed, setting Authorization header"), n.Authorization = "Bearer " + t);
1698
- let o;
1063
+ t && (r.debug("token passed, setting Authorization header"), i.Authorization = "Bearer " + t);
1064
+ let n;
1699
1065
  try {
1700
- s.debug("url:", e), o = await this.fetchWithTimeout(e, { method: "GET", headers: n, credentials: r });
1066
+ r.debug("url:", e), n = await this.fetchWithTimeout(e, { method: "GET", headers: i, credentials: s });
1701
1067
  } catch (l) {
1702
- throw s.error("Network Error"), l;
1068
+ throw r.error("Network Error"), l;
1703
1069
  }
1704
- s.debug("HTTP response received, status", o.status);
1705
- const a = o.headers.get("Content-Type");
1706
- if (a && !this._contentTypes.find((l) => a.startsWith(l)) && s.throw(new Error(`Invalid response Content-Type: ${a ?? "undefined"}, from URL: ${e}`)), o.ok && this._jwtHandler && (a != null && a.startsWith("application/jwt")))
1707
- return await this._jwtHandler(await o.text());
1708
- let d;
1070
+ r.debug("HTTP response received, status", n.status);
1071
+ const o = n.headers.get("Content-Type");
1072
+ if (o && !this._contentTypes.find((l) => o.startsWith(l)) && r.throw(new Error(`Invalid response Content-Type: ${o ?? "undefined"}, from URL: ${e}`)), n.ok && this._jwtHandler && (o != null && o.startsWith("application/jwt")))
1073
+ return await this._jwtHandler(await n.text());
1074
+ let c;
1709
1075
  try {
1710
- d = await o.json();
1076
+ c = await n.json();
1711
1077
  } catch (l) {
1712
- throw s.error("Error parsing JSON response", l), o.ok ? l : new Error(`${o.statusText} (${o.status})`);
1078
+ throw r.error("Error parsing JSON response", l), n.ok ? l : new Error(`${n.statusText} (${n.status})`);
1713
1079
  }
1714
- if (!o.ok)
1715
- throw s.error("Error from server:", d), d.error ? new Z(d) : new Error(`${o.statusText} (${o.status}): ${JSON.stringify(d)}`);
1716
- return d;
1080
+ if (!n.ok)
1081
+ throw r.error("Error from server:", c), c.error ? new j(c) : new Error(`${n.statusText} (${n.status}): ${JSON.stringify(c)}`);
1082
+ return c;
1717
1083
  }
1718
1084
  async postForm(e, {
1719
1085
  body: t,
1720
- basicAuth: r,
1721
- timeoutInSeconds: s,
1722
- initCredentials: n
1086
+ basicAuth: s,
1087
+ timeoutInSeconds: r,
1088
+ initCredentials: i
1723
1089
  }) {
1724
- const o = this._logger.create("postForm"), a = {
1090
+ const n = this._logger.create("postForm"), o = {
1725
1091
  Accept: this._contentTypes.join(", "),
1726
1092
  "Content-Type": "application/x-www-form-urlencoded"
1727
1093
  };
1728
- r !== void 0 && (a.Authorization = "Basic " + r);
1729
- let d;
1094
+ s !== void 0 && (o.Authorization = "Basic " + s);
1095
+ let c;
1730
1096
  try {
1731
- o.debug("url:", e), d = await this.fetchWithTimeout(e, { method: "POST", headers: a, body: t, timeoutInSeconds: s, credentials: n });
1732
- } catch (_) {
1733
- throw o.error("Network error"), _;
1097
+ n.debug("url:", e), c = await this.fetchWithTimeout(e, { method: "POST", headers: o, body: t, timeoutInSeconds: r, credentials: i });
1098
+ } catch (u) {
1099
+ throw n.error("Network error"), u;
1734
1100
  }
1735
- o.debug("HTTP response received, status", d.status);
1736
- const l = d.headers.get("Content-Type");
1737
- if (l && !this._contentTypes.find((_) => l.startsWith(_)))
1101
+ n.debug("HTTP response received, status", c.status);
1102
+ const l = c.headers.get("Content-Type");
1103
+ if (l && !this._contentTypes.find((u) => l.startsWith(u)))
1738
1104
  throw new Error(`Invalid response Content-Type: ${l ?? "undefined"}, from URL: ${e}`);
1739
- const h = await d.text();
1740
- let p = {};
1105
+ const h = await c.text();
1106
+ let g = {};
1741
1107
  if (h)
1742
1108
  try {
1743
- p = JSON.parse(h);
1744
- } catch (_) {
1745
- throw o.error("Error parsing JSON response", _), d.ok ? _ : new Error(`${d.statusText} (${d.status})`);
1109
+ g = JSON.parse(h);
1110
+ } catch (u) {
1111
+ throw n.error("Error parsing JSON response", u), c.ok ? u : new Error(`${c.statusText} (${c.status})`);
1746
1112
  }
1747
- if (!d.ok)
1748
- throw o.error("Error from server:", p), p.error ? new Z(p, t) : new Error(`${d.statusText} (${d.status}): ${JSON.stringify(p)}`);
1749
- return p;
1113
+ if (!c.ok)
1114
+ throw n.error("Error from server:", g), g.error ? new j(g, t) : new Error(`${c.statusText} (${c.status}): ${JSON.stringify(g)}`);
1115
+ return g;
1750
1116
  }
1751
- }, pr = class {
1117
+ }, $e = class {
1752
1118
  constructor(e) {
1753
- this._settings = e, this._logger = new b("MetadataService"), this._jsonService = new qe(["application/jwk-set+json"]), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._settings.signingKeys && (this._logger.debug("using signingKeys from settings"), this._signingKeys = this._settings.signingKeys), this._settings.metadata && (this._logger.debug("using metadata from settings"), this._metadata = this._settings.metadata), this._settings.fetchRequestCredentials && (this._logger.debug("using fetchRequestCredentials from settings"), this._fetchRequestCredentials = this._settings.fetchRequestCredentials);
1119
+ this._settings = e, this._logger = new f("MetadataService"), this._jsonService = new ie(["application/jwk-set+json"]), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._settings.signingKeys && (this._logger.debug("using signingKeys from settings"), this._signingKeys = this._settings.signingKeys), this._settings.metadata && (this._logger.debug("using metadata from settings"), this._metadata = this._settings.metadata), this._settings.fetchRequestCredentials && (this._logger.debug("using fetchRequestCredentials from settings"), this._fetchRequestCredentials = this._settings.fetchRequestCredentials);
1754
1120
  }
1755
1121
  resetSigningKeys() {
1756
1122
  this._signingKeys = null;
@@ -1790,15 +1156,15 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1790
1156
  return this._getMetadataProperty("jwks_uri", e);
1791
1157
  }
1792
1158
  async _getMetadataProperty(e, t = !1) {
1793
- const r = this._logger.create(`_getMetadataProperty('${e}')`), s = await this.getMetadata();
1794
- if (r.debug("resolved"), s[e] === void 0) {
1159
+ const s = this._logger.create(`_getMetadataProperty('${e}')`), r = await this.getMetadata();
1160
+ if (s.debug("resolved"), r[e] === void 0) {
1795
1161
  if (t === !0) {
1796
- r.warn("Metadata does not contain optional property");
1162
+ s.warn("Metadata does not contain optional property");
1797
1163
  return;
1798
1164
  }
1799
- r.throw(new Error("Metadata does not contain property " + e));
1165
+ s.throw(new Error("Metadata does not contain property " + e));
1800
1166
  }
1801
- return s[e];
1167
+ return r[e];
1802
1168
  }
1803
1169
  async getSigningKeys() {
1804
1170
  const e = this._logger.create("getSigningKeys");
@@ -1806,17 +1172,17 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1806
1172
  return e.debug("returning signingKeys from cache"), this._signingKeys;
1807
1173
  const t = await this.getKeysEndpoint(!1);
1808
1174
  e.debug("got jwks_uri", t);
1809
- const r = await this._jsonService.getJson(t);
1810
- if (e.debug("got key set", r), !Array.isArray(r.keys))
1175
+ const s = await this._jsonService.getJson(t);
1176
+ if (e.debug("got key set", s), !Array.isArray(s.keys))
1811
1177
  throw e.throw(new Error("Missing keys on keyset")), null;
1812
- return this._signingKeys = r.keys, this._signingKeys;
1178
+ return this._signingKeys = s.keys, this._signingKeys;
1813
1179
  }
1814
- }, vt = class {
1180
+ }, we = class {
1815
1181
  constructor({
1816
1182
  prefix: e = "oidc.",
1817
1183
  store: t = localStorage
1818
1184
  } = {}) {
1819
- this._logger = new b("WebStorageStateStore"), this._store = t, this._prefix = e;
1185
+ this._logger = new f("WebStorageStateStore"), this._store = t, this._prefix = e;
1820
1186
  }
1821
1187
  async set(e, t) {
1822
1188
  this._logger.create(`set('${e}')`), e = this._prefix + e, await this._store.setItem(e, t);
@@ -1832,172 +1198,172 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
1832
1198
  async getAllKeys() {
1833
1199
  this._logger.create("getAllKeys");
1834
1200
  const e = await this._store.length, t = [];
1835
- for (let r = 0; r < e; r++) {
1836
- const s = await this._store.key(r);
1837
- s && s.indexOf(this._prefix) === 0 && t.push(s.substr(this._prefix.length));
1201
+ for (let s = 0; s < e; s++) {
1202
+ const r = await this._store.key(s);
1203
+ r && r.indexOf(this._prefix) === 0 && t.push(r.substr(this._prefix.length));
1838
1204
  }
1839
1205
  return t;
1840
1206
  }
1841
- }, vr = "code", wr = "openid", mr = "client_secret_post", Sr = "query", yr = 60 * 15, br = 60 * 5, wt = class {
1207
+ }, ze = "code", De = "openid", Je = "client_secret_post", Ke = "query", Ve = 60 * 15, Ge = 60 * 5, ve = class {
1842
1208
  constructor({
1843
1209
  // metadata related
1844
1210
  authority: e,
1845
1211
  metadataUrl: t,
1846
- metadata: r,
1847
- signingKeys: s,
1848
- metadataSeed: n,
1212
+ metadata: s,
1213
+ signingKeys: r,
1214
+ metadataSeed: i,
1849
1215
  // client related
1850
- client_id: o,
1851
- client_secret: a,
1852
- response_type: d = vr,
1853
- scope: l = wr,
1216
+ client_id: n,
1217
+ client_secret: o,
1218
+ response_type: c = ze,
1219
+ scope: l = De,
1854
1220
  redirect_uri: h,
1855
- post_logout_redirect_uri: p,
1856
- client_authentication: _ = mr,
1221
+ post_logout_redirect_uri: g,
1222
+ client_authentication: u = Je,
1857
1223
  // optional protocol
1858
- prompt: y,
1224
+ prompt: S,
1859
1225
  display: w,
1860
- max_age: I,
1861
- ui_locales: v,
1862
- acr_values: R,
1863
- resource: k,
1864
- response_mode: c = Sr,
1226
+ max_age: k,
1227
+ ui_locales: _,
1228
+ acr_values: m,
1229
+ resource: y,
1230
+ response_mode: a = Ke,
1865
1231
  // behavior flags
1866
- filterProtocolClaims: g = !0,
1867
- loadUserInfo: m = !1,
1868
- staleStateAgeInSeconds: E = yr,
1869
- clockSkewInSeconds: P = br,
1870
- userInfoJwtIssuer: O = "OP",
1871
- mergeClaims: A = !1,
1872
- disablePKCE: j = !1,
1232
+ filterProtocolClaims: d = !0,
1233
+ loadUserInfo: p = !1,
1234
+ staleStateAgeInSeconds: v = Ve,
1235
+ clockSkewInSeconds: b = Ge,
1236
+ userInfoJwtIssuer: E = "OP",
1237
+ mergeClaims: x = !1,
1238
+ disablePKCE: C = !1,
1873
1239
  // other behavior
1874
- stateStore: B,
1875
- refreshTokenCredentials: F,
1876
- revokeTokenAdditionalContentTypes: L,
1240
+ stateStore: A,
1241
+ refreshTokenCredentials: R,
1242
+ revokeTokenAdditionalContentTypes: q,
1877
1243
  fetchRequestCredentials: W,
1878
- refreshTokenAllowedScope: $,
1244
+ refreshTokenAllowedScope: J,
1879
1245
  // extra query params
1880
- extraQueryParams: V = {},
1881
- extraTokenParams: ee = {}
1246
+ extraQueryParams: K = {},
1247
+ extraTokenParams: V = {}
1882
1248
  }) {
1883
- if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = r, this.metadataSeed = n, this.signingKeys = s, this.client_id = o, this.client_secret = a, this.response_type = d, this.scope = l, this.redirect_uri = h, this.post_logout_redirect_uri = p, this.client_authentication = _, this.prompt = y, this.display = w, this.max_age = I, this.ui_locales = v, this.acr_values = R, this.resource = k, this.response_mode = c, this.filterProtocolClaims = g ?? !0, this.loadUserInfo = !!m, this.staleStateAgeInSeconds = E, this.clockSkewInSeconds = P, this.userInfoJwtIssuer = O, this.mergeClaims = !!A, this.disablePKCE = !!j, this.revokeTokenAdditionalContentTypes = L, W && F && console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."), this.fetchRequestCredentials = W || F || "same-origin", B)
1884
- this.stateStore = B;
1249
+ if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = s, this.metadataSeed = i, this.signingKeys = r, this.client_id = n, this.client_secret = o, this.response_type = c, this.scope = l, this.redirect_uri = h, this.post_logout_redirect_uri = g, this.client_authentication = u, this.prompt = S, this.display = w, this.max_age = k, this.ui_locales = _, this.acr_values = m, this.resource = y, this.response_mode = a, this.filterProtocolClaims = d ?? !0, this.loadUserInfo = !!p, this.staleStateAgeInSeconds = v, this.clockSkewInSeconds = b, this.userInfoJwtIssuer = E, this.mergeClaims = !!x, this.disablePKCE = !!C, this.revokeTokenAdditionalContentTypes = q, W && R && console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."), this.fetchRequestCredentials = W || R || "same-origin", A)
1250
+ this.stateStore = A;
1885
1251
  else {
1886
- const X = typeof window < "u" ? window.localStorage : new pt();
1887
- this.stateStore = new vt({ store: X });
1252
+ const B = typeof window < "u" ? window.localStorage : new fe();
1253
+ this.stateStore = new we({ store: B });
1888
1254
  }
1889
- this.refreshTokenAllowedScope = $, this.extraQueryParams = V, this.extraTokenParams = ee;
1255
+ this.refreshTokenAllowedScope = J, this.extraQueryParams = K, this.extraTokenParams = V;
1890
1256
  }
1891
- }, kr = class {
1257
+ }, Qe = class {
1892
1258
  constructor(e, t) {
1893
- this._settings = e, this._metadataService = t, this._logger = new b("UserInfoService"), this._getClaimsFromJwt = async (r) => {
1894
- const s = this._logger.create("_getClaimsFromJwt");
1259
+ this._settings = e, this._metadataService = t, this._logger = new f("UserInfoService"), this._getClaimsFromJwt = async (s) => {
1260
+ const r = this._logger.create("_getClaimsFromJwt");
1895
1261
  try {
1896
- const n = Ue.decode(r);
1897
- return s.debug("JWT decoding successful"), n;
1898
- } catch (n) {
1899
- throw s.error("Error parsing JWT response"), n;
1262
+ const i = Z.decode(s);
1263
+ return r.debug("JWT decoding successful"), i;
1264
+ } catch (i) {
1265
+ throw r.error("Error parsing JWT response"), i;
1900
1266
  }
1901
- }, this._jsonService = new qe(void 0, this._getClaimsFromJwt);
1267
+ }, this._jsonService = new ie(void 0, this._getClaimsFromJwt);
1902
1268
  }
1903
1269
  async getClaims(e) {
1904
1270
  const t = this._logger.create("getClaims");
1905
1271
  e || this._logger.throw(new Error("No token passed"));
1906
- const r = await this._metadataService.getUserInfoEndpoint();
1907
- t.debug("got userinfo url", r);
1908
- const s = await this._jsonService.getJson(r, {
1272
+ const s = await this._metadataService.getUserInfoEndpoint();
1273
+ t.debug("got userinfo url", s);
1274
+ const r = await this._jsonService.getJson(s, {
1909
1275
  token: e,
1910
1276
  credentials: this._settings.fetchRequestCredentials
1911
1277
  });
1912
- return t.debug("got claims", s), s;
1278
+ return t.debug("got claims", r), r;
1913
1279
  }
1914
- }, mt = class {
1280
+ }, me = class {
1915
1281
  constructor(e, t) {
1916
- this._settings = e, this._metadataService = t, this._logger = new b("TokenClient"), this._jsonService = new qe(this._settings.revokeTokenAdditionalContentTypes);
1282
+ this._settings = e, this._metadataService = t, this._logger = new f("TokenClient"), this._jsonService = new ie(this._settings.revokeTokenAdditionalContentTypes);
1917
1283
  }
1918
1284
  async exchangeCode({
1919
1285
  grant_type: e = "authorization_code",
1920
1286
  redirect_uri: t = this._settings.redirect_uri,
1921
- client_id: r = this._settings.client_id,
1922
- client_secret: s = this._settings.client_secret,
1923
- ...n
1287
+ client_id: s = this._settings.client_id,
1288
+ client_secret: r = this._settings.client_secret,
1289
+ ...i
1924
1290
  }) {
1925
- const o = this._logger.create("exchangeCode");
1926
- r || o.throw(new Error("A client_id is required")), t || o.throw(new Error("A redirect_uri is required")), n.code || o.throw(new Error("A code is required"));
1927
- const a = new URLSearchParams({ grant_type: e, redirect_uri: t });
1928
- for (const [p, _] of Object.entries(n))
1929
- _ != null && a.set(p, _);
1930
- let d;
1291
+ const n = this._logger.create("exchangeCode");
1292
+ s || n.throw(new Error("A client_id is required")), t || n.throw(new Error("A redirect_uri is required")), i.code || n.throw(new Error("A code is required"));
1293
+ const o = new URLSearchParams({ grant_type: e, redirect_uri: t });
1294
+ for (const [g, u] of Object.entries(i))
1295
+ u != null && o.set(g, u);
1296
+ let c;
1931
1297
  switch (this._settings.client_authentication) {
1932
1298
  case "client_secret_basic":
1933
- if (!s)
1934
- throw o.throw(new Error("A client_secret is required")), null;
1935
- d = K.generateBasicAuth(r, s);
1299
+ if (!r)
1300
+ throw n.throw(new Error("A client_secret is required")), null;
1301
+ c = P.generateBasicAuth(s, r);
1936
1302
  break;
1937
1303
  case "client_secret_post":
1938
- a.append("client_id", r), s && a.append("client_secret", s);
1304
+ o.append("client_id", s), r && o.append("client_secret", r);
1939
1305
  break;
1940
1306
  }
1941
1307
  const l = await this._metadataService.getTokenEndpoint(!1);
1942
- o.debug("got token endpoint");
1943
- const h = await this._jsonService.postForm(l, { body: a, basicAuth: d, initCredentials: this._settings.fetchRequestCredentials });
1944
- return o.debug("got response"), h;
1308
+ n.debug("got token endpoint");
1309
+ const h = await this._jsonService.postForm(l, { body: o, basicAuth: c, initCredentials: this._settings.fetchRequestCredentials });
1310
+ return n.debug("got response"), h;
1945
1311
  }
1946
1312
  async exchangeCredentials({
1947
1313
  grant_type: e = "password",
1948
1314
  client_id: t = this._settings.client_id,
1949
- client_secret: r = this._settings.client_secret,
1950
- scope: s = this._settings.scope,
1951
- ...n
1315
+ client_secret: s = this._settings.client_secret,
1316
+ scope: r = this._settings.scope,
1317
+ ...i
1952
1318
  }) {
1953
- const o = this._logger.create("exchangeCredentials");
1954
- t || o.throw(new Error("A client_id is required"));
1955
- const a = new URLSearchParams({ grant_type: e, scope: s });
1956
- for (const [p, _] of Object.entries(n))
1957
- _ != null && a.set(p, _);
1958
- let d;
1319
+ const n = this._logger.create("exchangeCredentials");
1320
+ t || n.throw(new Error("A client_id is required"));
1321
+ const o = new URLSearchParams({ grant_type: e, scope: r });
1322
+ for (const [g, u] of Object.entries(i))
1323
+ u != null && o.set(g, u);
1324
+ let c;
1959
1325
  switch (this._settings.client_authentication) {
1960
1326
  case "client_secret_basic":
1961
- if (!r)
1962
- throw o.throw(new Error("A client_secret is required")), null;
1963
- d = K.generateBasicAuth(t, r);
1327
+ if (!s)
1328
+ throw n.throw(new Error("A client_secret is required")), null;
1329
+ c = P.generateBasicAuth(t, s);
1964
1330
  break;
1965
1331
  case "client_secret_post":
1966
- a.append("client_id", t), r && a.append("client_secret", r);
1332
+ o.append("client_id", t), s && o.append("client_secret", s);
1967
1333
  break;
1968
1334
  }
1969
1335
  const l = await this._metadataService.getTokenEndpoint(!1);
1970
- o.debug("got token endpoint");
1971
- const h = await this._jsonService.postForm(l, { body: a, basicAuth: d, initCredentials: this._settings.fetchRequestCredentials });
1972
- return o.debug("got response"), h;
1336
+ n.debug("got token endpoint");
1337
+ const h = await this._jsonService.postForm(l, { body: o, basicAuth: c, initCredentials: this._settings.fetchRequestCredentials });
1338
+ return n.debug("got response"), h;
1973
1339
  }
1974
1340
  async exchangeRefreshToken({
1975
1341
  grant_type: e = "refresh_token",
1976
1342
  client_id: t = this._settings.client_id,
1977
- client_secret: r = this._settings.client_secret,
1978
- timeoutInSeconds: s,
1979
- ...n
1343
+ client_secret: s = this._settings.client_secret,
1344
+ timeoutInSeconds: r,
1345
+ ...i
1980
1346
  }) {
1981
- const o = this._logger.create("exchangeRefreshToken");
1982
- t || o.throw(new Error("A client_id is required")), n.refresh_token || o.throw(new Error("A refresh_token is required"));
1983
- const a = new URLSearchParams({ grant_type: e });
1984
- for (const [p, _] of Object.entries(n))
1985
- _ != null && a.set(p, _);
1986
- let d;
1347
+ const n = this._logger.create("exchangeRefreshToken");
1348
+ t || n.throw(new Error("A client_id is required")), i.refresh_token || n.throw(new Error("A refresh_token is required"));
1349
+ const o = new URLSearchParams({ grant_type: e });
1350
+ for (const [g, u] of Object.entries(i))
1351
+ u != null && o.set(g, u);
1352
+ let c;
1987
1353
  switch (this._settings.client_authentication) {
1988
1354
  case "client_secret_basic":
1989
- if (!r)
1990
- throw o.throw(new Error("A client_secret is required")), null;
1991
- d = K.generateBasicAuth(t, r);
1355
+ if (!s)
1356
+ throw n.throw(new Error("A client_secret is required")), null;
1357
+ c = P.generateBasicAuth(t, s);
1992
1358
  break;
1993
1359
  case "client_secret_post":
1994
- a.append("client_id", t), r && a.append("client_secret", r);
1360
+ o.append("client_id", t), s && o.append("client_secret", s);
1995
1361
  break;
1996
1362
  }
1997
1363
  const l = await this._metadataService.getTokenEndpoint(!1);
1998
- o.debug("got token endpoint");
1999
- const h = await this._jsonService.postForm(l, { body: a, basicAuth: d, timeoutInSeconds: s, initCredentials: this._settings.fetchRequestCredentials });
2000
- return o.debug("got response"), h;
1364
+ n.debug("got token endpoint");
1365
+ const h = await this._jsonService.postForm(l, { body: o, basicAuth: c, timeoutInSeconds: r, initCredentials: this._settings.fetchRequestCredentials });
1366
+ return n.debug("got response"), h;
2001
1367
  }
2002
1368
  /**
2003
1369
  * Revoke an access or refresh token.
@@ -2006,16 +1372,16 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2006
1372
  */
2007
1373
  async revoke(e) {
2008
1374
  var t;
2009
- const r = this._logger.create("revoke");
2010
- e.token || r.throw(new Error("A token is required"));
2011
- const s = await this._metadataService.getRevocationEndpoint(!1);
2012
- r.debug(`got revocation endpoint, revoking ${(t = e.token_type_hint) != null ? t : "default token type"}`);
2013
- const n = new URLSearchParams();
2014
- for (const [o, a] of Object.entries(e))
2015
- a != null && n.set(o, a);
2016
- n.set("client_id", this._settings.client_id), this._settings.client_secret && n.set("client_secret", this._settings.client_secret), await this._jsonService.postForm(s, { body: n }), r.debug("got response");
2017
- }
2018
- }, Er = [
1375
+ const s = this._logger.create("revoke");
1376
+ e.token || s.throw(new Error("A token is required"));
1377
+ const r = await this._metadataService.getRevocationEndpoint(!1);
1378
+ s.debug(`got revocation endpoint, revoking ${(t = e.token_type_hint) != null ? t : "default token type"}`);
1379
+ const i = new URLSearchParams();
1380
+ for (const [n, o] of Object.entries(e))
1381
+ o != null && i.set(n, o);
1382
+ i.set("client_id", this._settings.client_id), this._settings.client_secret && i.set("client_secret", this._settings.client_secret), await this._jsonService.postForm(r, { body: i }), s.debug("got response");
1383
+ }
1384
+ }, Xe = [
2019
1385
  "nbf",
2020
1386
  "jti",
2021
1387
  "auth_time",
@@ -2025,71 +1391,71 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2025
1391
  "azp",
2026
1392
  "at_hash"
2027
1393
  // https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken
2028
- ], Rr = ["sub", "iss", "aud", "exp", "iat"], Tr = class {
1394
+ ], Ye = ["sub", "iss", "aud", "exp", "iat"], Ze = class {
2029
1395
  constructor(e, t) {
2030
- this._settings = e, this._metadataService = t, this._logger = new b("ResponseValidator"), this._userInfoService = new kr(this._settings, this._metadataService), this._tokenClient = new mt(this._settings, this._metadataService);
1396
+ this._settings = e, this._metadataService = t, this._logger = new f("ResponseValidator"), this._userInfoService = new Qe(this._settings, this._metadataService), this._tokenClient = new me(this._settings, this._metadataService);
2031
1397
  }
2032
1398
  async validateSigninResponse(e, t) {
2033
- const r = this._logger.create("validateSigninResponse");
2034
- this._processSigninState(e, t), r.debug("state processed"), await this._processCode(e, t), r.debug("code processed"), e.isOpenId && this._validateIdTokenAttributes(e), r.debug("tokens validated"), await this._processClaims(e, t == null ? void 0 : t.skipUserInfo, e.isOpenId), r.debug("claims processed");
1399
+ const s = this._logger.create("validateSigninResponse");
1400
+ this._processSigninState(e, t), s.debug("state processed"), await this._processCode(e, t), s.debug("code processed"), e.isOpenId && this._validateIdTokenAttributes(e), s.debug("tokens validated"), await this._processClaims(e, t == null ? void 0 : t.skipUserInfo, e.isOpenId), s.debug("claims processed");
2035
1401
  }
2036
1402
  async validateCredentialsResponse(e, t) {
2037
- const r = this._logger.create("validateCredentialsResponse");
2038
- e.isOpenId && this._validateIdTokenAttributes(e), r.debug("tokens validated"), await this._processClaims(e, t, e.isOpenId), r.debug("claims processed");
1403
+ const s = this._logger.create("validateCredentialsResponse");
1404
+ e.isOpenId && this._validateIdTokenAttributes(e), s.debug("tokens validated"), await this._processClaims(e, t, e.isOpenId), s.debug("claims processed");
2039
1405
  }
2040
1406
  async validateRefreshResponse(e, t) {
2041
- var r, s;
2042
- const n = this._logger.create("validateRefreshResponse");
2043
- e.userState = t.data, (r = e.session_state) != null || (e.session_state = t.session_state), (s = e.scope) != null || (e.scope = t.scope), e.isOpenId && e.id_token && (this._validateIdTokenAttributes(e, t.id_token), n.debug("ID Token validated")), e.id_token || (e.id_token = t.id_token, e.profile = t.profile);
2044
- const o = e.isOpenId && !!e.id_token;
2045
- await this._processClaims(e, !1, o), n.debug("claims processed");
1407
+ var s, r;
1408
+ const i = this._logger.create("validateRefreshResponse");
1409
+ e.userState = t.data, (s = e.session_state) != null || (e.session_state = t.session_state), (r = e.scope) != null || (e.scope = t.scope), e.isOpenId && e.id_token && (this._validateIdTokenAttributes(e, t.id_token), i.debug("ID Token validated")), e.id_token || (e.id_token = t.id_token, e.profile = t.profile);
1410
+ const n = e.isOpenId && !!e.id_token;
1411
+ await this._processClaims(e, !1, n), i.debug("claims processed");
2046
1412
  }
2047
1413
  validateSignoutResponse(e, t) {
2048
- const r = this._logger.create("validateSignoutResponse");
2049
- if (t.id !== e.state && r.throw(new Error("State does not match")), r.debug("state validated"), e.userState = t.data, e.error)
2050
- throw r.warn("Response was error", e.error), new Z(e);
1414
+ const s = this._logger.create("validateSignoutResponse");
1415
+ if (t.id !== e.state && s.throw(new Error("State does not match")), s.debug("state validated"), e.userState = t.data, e.error)
1416
+ throw s.warn("Response was error", e.error), new j(e);
2051
1417
  }
2052
1418
  _processSigninState(e, t) {
2053
- var r;
2054
- const s = this._logger.create("_processSigninState");
2055
- if (t.id !== e.state && s.throw(new Error("State does not match")), t.client_id || s.throw(new Error("No client_id on state")), t.authority || s.throw(new Error("No authority on state")), this._settings.authority !== t.authority && s.throw(new Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== t.client_id && s.throw(new Error("client_id mismatch on settings vs. signin state")), s.debug("state validated"), e.userState = t.data, (r = e.scope) != null || (e.scope = t.scope), e.error)
2056
- throw s.warn("Response was error", e.error), new Z(e);
2057
- t.code_verifier && !e.code && s.throw(new Error("Expected code in response"));
2058
- }
2059
- async _processClaims(e, t = !1, r = !0) {
2060
- const s = this._logger.create("_processClaims");
1419
+ var s;
1420
+ const r = this._logger.create("_processSigninState");
1421
+ if (t.id !== e.state && r.throw(new Error("State does not match")), t.client_id || r.throw(new Error("No client_id on state")), t.authority || r.throw(new Error("No authority on state")), this._settings.authority !== t.authority && r.throw(new Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== t.client_id && r.throw(new Error("client_id mismatch on settings vs. signin state")), r.debug("state validated"), e.userState = t.data, (s = e.scope) != null || (e.scope = t.scope), e.error)
1422
+ throw r.warn("Response was error", e.error), new j(e);
1423
+ t.code_verifier && !e.code && r.throw(new Error("Expected code in response"));
1424
+ }
1425
+ async _processClaims(e, t = !1, s = !0) {
1426
+ const r = this._logger.create("_processClaims");
2061
1427
  if (e.profile = this._filterProtocolClaims(e.profile), t || !this._settings.loadUserInfo || !e.access_token) {
2062
- s.debug("not loading user info");
1428
+ r.debug("not loading user info");
2063
1429
  return;
2064
1430
  }
2065
- s.debug("loading user info");
2066
- const n = await this._userInfoService.getClaims(e.access_token);
2067
- s.debug("user info claims received from user info endpoint"), r && n.sub !== e.profile.sub && s.throw(new Error("subject from UserInfo response does not match subject in ID Token")), e.profile = this._mergeClaims(e.profile, this._filterProtocolClaims(n)), s.debug("user info claims received, updated profile:", e.profile);
1431
+ r.debug("loading user info");
1432
+ const i = await this._userInfoService.getClaims(e.access_token);
1433
+ r.debug("user info claims received from user info endpoint"), s && i.sub !== e.profile.sub && r.throw(new Error("subject from UserInfo response does not match subject in ID Token")), e.profile = this._mergeClaims(e.profile, this._filterProtocolClaims(i)), r.debug("user info claims received, updated profile:", e.profile);
2068
1434
  }
2069
1435
  _mergeClaims(e, t) {
2070
- const r = { ...e };
2071
- for (const [s, n] of Object.entries(t))
2072
- for (const o of Array.isArray(n) ? n : [n]) {
2073
- const a = r[s];
2074
- a ? Array.isArray(a) ? a.includes(o) || a.push(o) : r[s] !== o && (typeof o == "object" && this._settings.mergeClaims ? r[s] = this._mergeClaims(a, o) : r[s] = [a, o]) : r[s] = o;
1436
+ const s = { ...e };
1437
+ for (const [r, i] of Object.entries(t))
1438
+ for (const n of Array.isArray(i) ? i : [i]) {
1439
+ const o = s[r];
1440
+ o ? Array.isArray(o) ? o.includes(n) || o.push(n) : s[r] !== n && (typeof n == "object" && this._settings.mergeClaims ? s[r] = this._mergeClaims(o, n) : s[r] = [o, n]) : s[r] = n;
2075
1441
  }
2076
- return r;
1442
+ return s;
2077
1443
  }
2078
1444
  _filterProtocolClaims(e) {
2079
1445
  const t = { ...e };
2080
1446
  if (this._settings.filterProtocolClaims) {
2081
- let r;
2082
- Array.isArray(this._settings.filterProtocolClaims) ? r = this._settings.filterProtocolClaims : r = Er;
2083
- for (const s of r)
2084
- Rr.includes(s) || delete t[s];
1447
+ let s;
1448
+ Array.isArray(this._settings.filterProtocolClaims) ? s = this._settings.filterProtocolClaims : s = Xe;
1449
+ for (const r of s)
1450
+ Ye.includes(r) || delete t[r];
2085
1451
  }
2086
1452
  return t;
2087
1453
  }
2088
1454
  async _processCode(e, t) {
2089
- const r = this._logger.create("_processCode");
1455
+ const s = this._logger.create("_processCode");
2090
1456
  if (e.code) {
2091
- r.debug("Validating code");
2092
- const s = await this._tokenClient.exchangeCode({
1457
+ s.debug("Validating code");
1458
+ const r = await this._tokenClient.exchangeCode({
2093
1459
  client_id: t.client_id,
2094
1460
  client_secret: t.client_secret,
2095
1461
  code: e.code,
@@ -2097,27 +1463,27 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2097
1463
  code_verifier: t.code_verifier,
2098
1464
  ...t.extraTokenParams
2099
1465
  });
2100
- Object.assign(e, s);
1466
+ Object.assign(e, r);
2101
1467
  } else
2102
- r.debug("No code to process");
1468
+ s.debug("No code to process");
2103
1469
  }
2104
1470
  _validateIdTokenAttributes(e, t) {
2105
- var r;
2106
- const s = this._logger.create("_validateIdTokenAttributes");
2107
- s.debug("decoding ID Token JWT");
2108
- const n = Ue.decode((r = e.id_token) != null ? r : "");
2109
- if (n.sub || s.throw(new Error("ID Token is missing a subject claim")), t) {
2110
- const o = Ue.decode(t);
2111
- o.sub !== n.sub && s.throw(new Error("sub in id_token does not match current sub")), o.auth_time && o.auth_time !== n.auth_time && s.throw(new Error("auth_time in id_token does not match original auth_time")), o.azp && o.azp !== n.azp && s.throw(new Error("azp in id_token does not match original azp")), !o.azp && n.azp && s.throw(new Error("azp not in id_token, but present in original id_token"));
1471
+ var s;
1472
+ const r = this._logger.create("_validateIdTokenAttributes");
1473
+ r.debug("decoding ID Token JWT");
1474
+ const i = Z.decode((s = e.id_token) != null ? s : "");
1475
+ if (i.sub || r.throw(new Error("ID Token is missing a subject claim")), t) {
1476
+ const n = Z.decode(t);
1477
+ n.sub !== i.sub && r.throw(new Error("sub in id_token does not match current sub")), n.auth_time && n.auth_time !== i.auth_time && r.throw(new Error("auth_time in id_token does not match original auth_time")), n.azp && n.azp !== i.azp && r.throw(new Error("azp in id_token does not match original azp")), !n.azp && i.azp && r.throw(new Error("azp not in id_token, but present in original id_token"));
2112
1478
  }
2113
- e.profile = n;
1479
+ e.profile = i;
2114
1480
  }
2115
- }, ie = class {
1481
+ }, M = class {
2116
1482
  constructor(e) {
2117
- this.id = e.id || K.generateUUIDv4(), this.data = e.data, e.created && e.created > 0 ? this.created = e.created : this.created = H.getEpochTime(), this.request_type = e.request_type;
1483
+ this.id = e.id || P.generateUUIDv4(), this.data = e.data, e.created && e.created > 0 ? this.created = e.created : this.created = T.getEpochTime(), this.request_type = e.request_type;
2118
1484
  }
2119
1485
  toStorageString() {
2120
- return new b("State").create("toStorageString"), JSON.stringify({
1486
+ return new f("State").create("toStorageString"), JSON.stringify({
2121
1487
  id: this.id,
2122
1488
  data: this.data,
2123
1489
  created: this.created,
@@ -2125,32 +1491,32 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2125
1491
  });
2126
1492
  }
2127
1493
  static fromStorageString(e) {
2128
- return b.createStatic("State", "fromStorageString"), new ie(JSON.parse(e));
1494
+ return f.createStatic("State", "fromStorageString"), new M(JSON.parse(e));
2129
1495
  }
2130
1496
  static async clearStaleState(e, t) {
2131
- const r = b.createStatic("State", "clearStaleState"), s = H.getEpochTime() - t, n = await e.getAllKeys();
2132
- r.debug("got keys", n);
2133
- for (let o = 0; o < n.length; o++) {
2134
- const a = n[o], d = await e.get(a);
1497
+ const s = f.createStatic("State", "clearStaleState"), r = T.getEpochTime() - t, i = await e.getAllKeys();
1498
+ s.debug("got keys", i);
1499
+ for (let n = 0; n < i.length; n++) {
1500
+ const o = i[n], c = await e.get(o);
2135
1501
  let l = !1;
2136
- if (d)
1502
+ if (c)
2137
1503
  try {
2138
- const h = ie.fromStorageString(d);
2139
- r.debug("got item from key:", a, h.created), h.created <= s && (l = !0);
1504
+ const h = M.fromStorageString(c);
1505
+ s.debug("got item from key:", o, h.created), h.created <= r && (l = !0);
2140
1506
  } catch (h) {
2141
- r.error("Error parsing state for key:", a, h), l = !0;
1507
+ s.error("Error parsing state for key:", o, h), l = !0;
2142
1508
  }
2143
1509
  else
2144
- r.debug("no item in storage for key:", a), l = !0;
2145
- l && (r.debug("removed item for key:", a), e.remove(a));
1510
+ s.debug("no item in storage for key:", o), l = !0;
1511
+ l && (s.debug("removed item for key:", o), e.remove(o));
2146
1512
  }
2147
1513
  }
2148
- }, We = class extends ie {
1514
+ }, ne = class extends M {
2149
1515
  constructor(e) {
2150
- super(e), e.code_verifier === !0 ? this.code_verifier = K.generateCodeVerifier() : e.code_verifier && (this.code_verifier = e.code_verifier), this.code_verifier && (this.code_challenge = K.generateCodeChallenge(this.code_verifier)), this.authority = e.authority, this.client_id = e.client_id, this.redirect_uri = e.redirect_uri, this.scope = e.scope, this.client_secret = e.client_secret, this.extraTokenParams = e.extraTokenParams, this.response_mode = e.response_mode, this.skipUserInfo = e.skipUserInfo;
1516
+ super(e), e.code_verifier === !0 ? this.code_verifier = P.generateCodeVerifier() : e.code_verifier && (this.code_verifier = e.code_verifier), this.code_verifier && (this.code_challenge = P.generateCodeChallenge(this.code_verifier)), this.authority = e.authority, this.client_id = e.client_id, this.redirect_uri = e.redirect_uri, this.scope = e.scope, this.client_secret = e.client_secret, this.extraTokenParams = e.extraTokenParams, this.response_mode = e.response_mode, this.skipUserInfo = e.skipUserInfo;
2151
1517
  }
2152
1518
  toStorageString() {
2153
- return new b("SigninState").create("toStorageString"), JSON.stringify({
1519
+ return new f("SigninState").create("toStorageString"), JSON.stringify({
2154
1520
  id: this.id,
2155
1521
  data: this.data,
2156
1522
  created: this.created,
@@ -2167,250 +1533,250 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2167
1533
  });
2168
1534
  }
2169
1535
  static fromStorageString(e) {
2170
- b.createStatic("SigninState", "fromStorageString");
1536
+ f.createStatic("SigninState", "fromStorageString");
2171
1537
  const t = JSON.parse(e);
2172
- return new We(t);
1538
+ return new ne(t);
2173
1539
  }
2174
- }, xr = class {
1540
+ }, et = class {
2175
1541
  constructor({
2176
1542
  // mandatory
2177
1543
  url: e,
2178
1544
  authority: t,
2179
- client_id: r,
2180
- redirect_uri: s,
2181
- response_type: n,
2182
- scope: o,
1545
+ client_id: s,
1546
+ redirect_uri: r,
1547
+ response_type: i,
1548
+ scope: n,
2183
1549
  // optional
2184
- state_data: a,
2185
- response_mode: d,
1550
+ state_data: o,
1551
+ response_mode: c,
2186
1552
  request_type: l,
2187
1553
  client_secret: h,
2188
- nonce: p,
2189
- resource: _,
2190
- skipUserInfo: y,
1554
+ nonce: g,
1555
+ resource: u,
1556
+ skipUserInfo: S,
2191
1557
  extraQueryParams: w,
2192
- extraTokenParams: I,
2193
- disablePKCE: v,
2194
- ...R
1558
+ extraTokenParams: k,
1559
+ disablePKCE: _,
1560
+ ...m
2195
1561
  }) {
2196
- if (this._logger = new b("SigninRequest"), !e)
1562
+ if (this._logger = new f("SigninRequest"), !e)
2197
1563
  throw this._logger.error("ctor: No url passed"), new Error("url");
2198
- if (!r)
2199
- throw this._logger.error("ctor: No client_id passed"), new Error("client_id");
2200
1564
  if (!s)
1565
+ throw this._logger.error("ctor: No client_id passed"), new Error("client_id");
1566
+ if (!r)
2201
1567
  throw this._logger.error("ctor: No redirect_uri passed"), new Error("redirect_uri");
2202
- if (!n)
1568
+ if (!i)
2203
1569
  throw this._logger.error("ctor: No response_type passed"), new Error("response_type");
2204
- if (!o)
1570
+ if (!n)
2205
1571
  throw this._logger.error("ctor: No scope passed"), new Error("scope");
2206
1572
  if (!t)
2207
1573
  throw this._logger.error("ctor: No authority passed"), new Error("authority");
2208
- this.state = new We({
2209
- data: a,
1574
+ this.state = new ne({
1575
+ data: o,
2210
1576
  request_type: l,
2211
- code_verifier: !v,
2212
- client_id: r,
1577
+ code_verifier: !_,
1578
+ client_id: s,
2213
1579
  authority: t,
2214
- redirect_uri: s,
2215
- response_mode: d,
1580
+ redirect_uri: r,
1581
+ response_mode: c,
2216
1582
  client_secret: h,
2217
- scope: o,
2218
- extraTokenParams: I,
2219
- skipUserInfo: y
1583
+ scope: n,
1584
+ extraTokenParams: k,
1585
+ skipUserInfo: S
2220
1586
  });
2221
- const k = new URL(e);
2222
- k.searchParams.append("client_id", r), k.searchParams.append("redirect_uri", s), k.searchParams.append("response_type", n), k.searchParams.append("scope", o), p && k.searchParams.append("nonce", p), k.searchParams.append("state", this.state.id), this.state.code_challenge && (k.searchParams.append("code_challenge", this.state.code_challenge), k.searchParams.append("code_challenge_method", "S256")), _ && (Array.isArray(_) ? _ : [_]).forEach((g) => k.searchParams.append("resource", g));
2223
- for (const [c, g] of Object.entries({ response_mode: d, ...R, ...w }))
2224
- g != null && k.searchParams.append(c, g.toString());
2225
- this.url = k.href;
1587
+ const y = new URL(e);
1588
+ y.searchParams.append("client_id", s), y.searchParams.append("redirect_uri", r), y.searchParams.append("response_type", i), y.searchParams.append("scope", n), g && y.searchParams.append("nonce", g), y.searchParams.append("state", this.state.id), this.state.code_challenge && (y.searchParams.append("code_challenge", this.state.code_challenge), y.searchParams.append("code_challenge_method", "S256")), u && (Array.isArray(u) ? u : [u]).forEach((d) => y.searchParams.append("resource", d));
1589
+ for (const [a, d] of Object.entries({ response_mode: c, ...m, ...w }))
1590
+ d != null && y.searchParams.append(a, d.toString());
1591
+ this.url = y.href;
2226
1592
  }
2227
- }, Cr = "openid", Ce = class {
1593
+ }, tt = "openid", G = class {
2228
1594
  constructor(e) {
2229
1595
  this.access_token = "", this.token_type = "", this.profile = {}, this.state = e.get("state"), this.session_state = e.get("session_state"), this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri"), this.code = e.get("code");
2230
1596
  }
2231
1597
  get expires_in() {
2232
1598
  if (this.expires_at !== void 0)
2233
- return this.expires_at - H.getEpochTime();
1599
+ return this.expires_at - T.getEpochTime();
2234
1600
  }
2235
1601
  set expires_in(e) {
2236
- typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + H.getEpochTime());
1602
+ typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + T.getEpochTime());
2237
1603
  }
2238
1604
  get isOpenId() {
2239
1605
  var e;
2240
- return ((e = this.scope) == null ? void 0 : e.split(" ").includes(Cr)) || !!this.id_token;
1606
+ return ((e = this.scope) == null ? void 0 : e.split(" ").includes(tt)) || !!this.id_token;
2241
1607
  }
2242
- }, Ir = class {
1608
+ }, st = class {
2243
1609
  constructor({
2244
1610
  url: e,
2245
1611
  state_data: t,
2246
- id_token_hint: r,
2247
- post_logout_redirect_uri: s,
2248
- extraQueryParams: n,
2249
- request_type: o
1612
+ id_token_hint: s,
1613
+ post_logout_redirect_uri: r,
1614
+ extraQueryParams: i,
1615
+ request_type: n
2250
1616
  }) {
2251
- if (this._logger = new b("SignoutRequest"), !e)
1617
+ if (this._logger = new f("SignoutRequest"), !e)
2252
1618
  throw this._logger.error("ctor: No url passed"), new Error("url");
2253
- const a = new URL(e);
2254
- r && a.searchParams.append("id_token_hint", r), s && (a.searchParams.append("post_logout_redirect_uri", s), t && (this.state = new ie({ data: t, request_type: o }), a.searchParams.append("state", this.state.id)));
2255
- for (const [d, l] of Object.entries({ ...n }))
2256
- l != null && a.searchParams.append(d, l.toString());
2257
- this.url = a.href;
1619
+ const o = new URL(e);
1620
+ s && o.searchParams.append("id_token_hint", s), r && (o.searchParams.append("post_logout_redirect_uri", r), t && (this.state = new M({ data: t, request_type: n }), o.searchParams.append("state", this.state.id)));
1621
+ for (const [c, l] of Object.entries({ ...i }))
1622
+ l != null && o.searchParams.append(c, l.toString());
1623
+ this.url = o.href;
2258
1624
  }
2259
- }, Pr = class {
1625
+ }, rt = class {
2260
1626
  constructor(e) {
2261
1627
  this.state = e.get("state"), this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri");
2262
1628
  }
2263
- }, Or = class {
1629
+ }, it = class {
2264
1630
  constructor(e) {
2265
- this._logger = new b("OidcClient"), this.settings = new wt(e), this.metadataService = new pr(this.settings), this._validator = new Tr(this.settings, this.metadataService), this._tokenClient = new mt(this.settings, this.metadataService);
1631
+ this._logger = new f("OidcClient"), this.settings = new ve(e), this.metadataService = new $e(this.settings), this._validator = new Ze(this.settings, this.metadataService), this._tokenClient = new me(this.settings, this.metadataService);
2266
1632
  }
2267
1633
  async createSigninRequest({
2268
1634
  state: e,
2269
1635
  request: t,
2270
- request_uri: r,
2271
- request_type: s,
2272
- id_token_hint: n,
2273
- login_hint: o,
2274
- skipUserInfo: a,
2275
- nonce: d,
1636
+ request_uri: s,
1637
+ request_type: r,
1638
+ id_token_hint: i,
1639
+ login_hint: n,
1640
+ skipUserInfo: o,
1641
+ nonce: c,
2276
1642
  response_type: l = this.settings.response_type,
2277
1643
  scope: h = this.settings.scope,
2278
- redirect_uri: p = this.settings.redirect_uri,
2279
- prompt: _ = this.settings.prompt,
2280
- display: y = this.settings.display,
1644
+ redirect_uri: g = this.settings.redirect_uri,
1645
+ prompt: u = this.settings.prompt,
1646
+ display: S = this.settings.display,
2281
1647
  max_age: w = this.settings.max_age,
2282
- ui_locales: I = this.settings.ui_locales,
2283
- acr_values: v = this.settings.acr_values,
2284
- resource: R = this.settings.resource,
2285
- response_mode: k = this.settings.response_mode,
2286
- extraQueryParams: c = this.settings.extraQueryParams,
2287
- extraTokenParams: g = this.settings.extraTokenParams
1648
+ ui_locales: k = this.settings.ui_locales,
1649
+ acr_values: _ = this.settings.acr_values,
1650
+ resource: m = this.settings.resource,
1651
+ response_mode: y = this.settings.response_mode,
1652
+ extraQueryParams: a = this.settings.extraQueryParams,
1653
+ extraTokenParams: d = this.settings.extraTokenParams
2288
1654
  }) {
2289
- const m = this._logger.create("createSigninRequest");
1655
+ const p = this._logger.create("createSigninRequest");
2290
1656
  if (l !== "code")
2291
1657
  throw new Error("Only the Authorization Code flow (with PKCE) is supported");
2292
- const E = await this.metadataService.getAuthorizationEndpoint();
2293
- m.debug("Received authorization endpoint", E);
2294
- const P = new xr({
2295
- url: E,
1658
+ const v = await this.metadataService.getAuthorizationEndpoint();
1659
+ p.debug("Received authorization endpoint", v);
1660
+ const b = new et({
1661
+ url: v,
2296
1662
  authority: this.settings.authority,
2297
1663
  client_id: this.settings.client_id,
2298
- redirect_uri: p,
1664
+ redirect_uri: g,
2299
1665
  response_type: l,
2300
1666
  scope: h,
2301
1667
  state_data: e,
2302
- prompt: _,
2303
- display: y,
1668
+ prompt: u,
1669
+ display: S,
2304
1670
  max_age: w,
2305
- ui_locales: I,
2306
- id_token_hint: n,
2307
- login_hint: o,
2308
- acr_values: v,
2309
- resource: R,
1671
+ ui_locales: k,
1672
+ id_token_hint: i,
1673
+ login_hint: n,
1674
+ acr_values: _,
1675
+ resource: m,
2310
1676
  request: t,
2311
- request_uri: r,
2312
- extraQueryParams: c,
2313
- extraTokenParams: g,
2314
- request_type: s,
2315
- response_mode: k,
1677
+ request_uri: s,
1678
+ extraQueryParams: a,
1679
+ extraTokenParams: d,
1680
+ request_type: r,
1681
+ response_mode: y,
2316
1682
  client_secret: this.settings.client_secret,
2317
- skipUserInfo: a,
2318
- nonce: d,
1683
+ skipUserInfo: o,
1684
+ nonce: c,
2319
1685
  disablePKCE: this.settings.disablePKCE
2320
1686
  });
2321
1687
  await this.clearStaleState();
2322
- const O = P.state;
2323
- return await this.settings.stateStore.set(O.id, O.toStorageString()), P;
1688
+ const E = b.state;
1689
+ return await this.settings.stateStore.set(E.id, E.toStorageString()), b;
2324
1690
  }
2325
1691
  async readSigninResponseState(e, t = !1) {
2326
- const r = this._logger.create("readSigninResponseState"), s = new Ce(Ae.readParams(e, this.settings.response_mode));
2327
- if (!s.state)
2328
- throw r.throw(new Error("No state in response")), null;
2329
- const n = await this.settings.stateStore[t ? "remove" : "get"](s.state);
2330
- if (!n)
2331
- throw r.throw(new Error("No matching state found in storage")), null;
2332
- return { state: We.fromStorageString(n), response: s };
1692
+ const s = this._logger.create("readSigninResponseState"), r = new G(ee.readParams(e, this.settings.response_mode));
1693
+ if (!r.state)
1694
+ throw s.throw(new Error("No state in response")), null;
1695
+ const i = await this.settings.stateStore[t ? "remove" : "get"](r.state);
1696
+ if (!i)
1697
+ throw s.throw(new Error("No matching state found in storage")), null;
1698
+ return { state: ne.fromStorageString(i), response: r };
2333
1699
  }
2334
1700
  async processSigninResponse(e) {
2335
- const t = this._logger.create("processSigninResponse"), { state: r, response: s } = await this.readSigninResponseState(e, !0);
2336
- return t.debug("received state from storage; validating response"), await this._validator.validateSigninResponse(s, r), s;
1701
+ const t = this._logger.create("processSigninResponse"), { state: s, response: r } = await this.readSigninResponseState(e, !0);
1702
+ return t.debug("received state from storage; validating response"), await this._validator.validateSigninResponse(r, s), r;
2337
1703
  }
2338
1704
  async processResourceOwnerPasswordCredentials({
2339
1705
  username: e,
2340
1706
  password: t,
2341
- skipUserInfo: r = !1,
2342
- extraTokenParams: s = {}
1707
+ skipUserInfo: s = !1,
1708
+ extraTokenParams: r = {}
2343
1709
  }) {
2344
- const n = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...s }), o = new Ce(new URLSearchParams());
2345
- return Object.assign(o, n), await this._validator.validateCredentialsResponse(o, r), o;
1710
+ const i = await this._tokenClient.exchangeCredentials({ username: e, password: t, ...r }), n = new G(new URLSearchParams());
1711
+ return Object.assign(n, i), await this._validator.validateCredentialsResponse(n, s), n;
2346
1712
  }
2347
1713
  async useRefreshToken({
2348
1714
  state: e,
2349
1715
  timeoutInSeconds: t
2350
1716
  }) {
2351
- var r;
2352
- const s = this._logger.create("useRefreshToken");
2353
- let n;
1717
+ var s;
1718
+ const r = this._logger.create("useRefreshToken");
1719
+ let i;
2354
1720
  if (this.settings.refreshTokenAllowedScope === void 0)
2355
- n = e.scope;
1721
+ i = e.scope;
2356
1722
  else {
2357
- const d = this.settings.refreshTokenAllowedScope.split(" ");
2358
- n = (((r = e.scope) == null ? void 0 : r.split(" ")) || []).filter((h) => d.includes(h)).join(" ");
1723
+ const c = this.settings.refreshTokenAllowedScope.split(" ");
1724
+ i = (((s = e.scope) == null ? void 0 : s.split(" ")) || []).filter((h) => c.includes(h)).join(" ");
2359
1725
  }
2360
- const o = await this._tokenClient.exchangeRefreshToken({
1726
+ const n = await this._tokenClient.exchangeRefreshToken({
2361
1727
  refresh_token: e.refresh_token,
2362
1728
  // provide the (possible filtered) scope list
2363
- scope: n,
1729
+ scope: i,
2364
1730
  timeoutInSeconds: t
2365
- }), a = new Ce(new URLSearchParams());
2366
- return Object.assign(a, o), s.debug("validating response", a), await this._validator.validateRefreshResponse(a, {
1731
+ }), o = new G(new URLSearchParams());
1732
+ return Object.assign(o, n), r.debug("validating response", o), await this._validator.validateRefreshResponse(o, {
2367
1733
  ...e,
2368
1734
  // overide the scope in the state handed over to the validator
2369
1735
  // so it can set the granted scope to the requested scope in case none is included in the response
2370
- scope: n
2371
- }), a;
1736
+ scope: i
1737
+ }), o;
2372
1738
  }
2373
1739
  async createSignoutRequest({
2374
1740
  state: e,
2375
1741
  id_token_hint: t,
2376
- request_type: r,
2377
- post_logout_redirect_uri: s = this.settings.post_logout_redirect_uri,
2378
- extraQueryParams: n = this.settings.extraQueryParams
1742
+ request_type: s,
1743
+ post_logout_redirect_uri: r = this.settings.post_logout_redirect_uri,
1744
+ extraQueryParams: i = this.settings.extraQueryParams
2379
1745
  } = {}) {
2380
- const o = this._logger.create("createSignoutRequest"), a = await this.metadataService.getEndSessionEndpoint();
2381
- if (!a)
2382
- throw o.throw(new Error("No end session endpoint")), null;
2383
- o.debug("Received end session endpoint", a);
2384
- const d = new Ir({
2385
- url: a,
1746
+ const n = this._logger.create("createSignoutRequest"), o = await this.metadataService.getEndSessionEndpoint();
1747
+ if (!o)
1748
+ throw n.throw(new Error("No end session endpoint")), null;
1749
+ n.debug("Received end session endpoint", o);
1750
+ const c = new st({
1751
+ url: o,
2386
1752
  id_token_hint: t,
2387
- post_logout_redirect_uri: s,
1753
+ post_logout_redirect_uri: r,
2388
1754
  state_data: e,
2389
- extraQueryParams: n,
2390
- request_type: r
1755
+ extraQueryParams: i,
1756
+ request_type: s
2391
1757
  });
2392
1758
  await this.clearStaleState();
2393
- const l = d.state;
2394
- return l && (o.debug("Signout request has state to persist"), await this.settings.stateStore.set(l.id, l.toStorageString())), d;
1759
+ const l = c.state;
1760
+ return l && (n.debug("Signout request has state to persist"), await this.settings.stateStore.set(l.id, l.toStorageString())), c;
2395
1761
  }
2396
1762
  async readSignoutResponseState(e, t = !1) {
2397
- const r = this._logger.create("readSignoutResponseState"), s = new Pr(Ae.readParams(e, this.settings.response_mode));
2398
- if (!s.state) {
2399
- if (r.debug("No state in response"), s.error)
2400
- throw r.warn("Response was error:", s.error), new Z(s);
2401
- return { state: void 0, response: s };
1763
+ const s = this._logger.create("readSignoutResponseState"), r = new rt(ee.readParams(e, this.settings.response_mode));
1764
+ if (!r.state) {
1765
+ if (s.debug("No state in response"), r.error)
1766
+ throw s.warn("Response was error:", r.error), new j(r);
1767
+ return { state: void 0, response: r };
2402
1768
  }
2403
- const n = await this.settings.stateStore[t ? "remove" : "get"](s.state);
2404
- if (!n)
2405
- throw r.throw(new Error("No matching state found in storage")), null;
2406
- return { state: ie.fromStorageString(n), response: s };
1769
+ const i = await this.settings.stateStore[t ? "remove" : "get"](r.state);
1770
+ if (!i)
1771
+ throw s.throw(new Error("No matching state found in storage")), null;
1772
+ return { state: M.fromStorageString(i), response: r };
2407
1773
  }
2408
1774
  async processSignoutResponse(e) {
2409
- const t = this._logger.create("processSignoutResponse"), { state: r, response: s } = await this.readSignoutResponseState(e, !0);
2410
- return r ? (t.debug("Received state from storage; validating response"), this._validator.validateSignoutResponse(s, r)) : t.debug("No state from storage; skipping response validation"), s;
1775
+ const t = this._logger.create("processSignoutResponse"), { state: s, response: r } = await this.readSignoutResponseState(e, !0);
1776
+ return s ? (t.debug("Received state from storage; validating response"), this._validator.validateSignoutResponse(r, s)) : t.debug("No state from storage; skipping response validation"), r;
2411
1777
  }
2412
1778
  clearStaleState() {
2413
- return this._logger.create("clearStaleState"), ie.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
1779
+ return this._logger.create("clearStaleState"), M.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
2414
1780
  }
2415
1781
  async revokeToken(e, t) {
2416
1782
  return this._logger.create("revokeToken"), await this._tokenClient.revoke({
@@ -2418,58 +1784,58 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2418
1784
  token_type_hint: t
2419
1785
  });
2420
1786
  }
2421
- }, Ur = class {
1787
+ }, nt = class {
2422
1788
  constructor(e) {
2423
- this._userManager = e, this._logger = new b("SessionMonitor"), this._start = async (t) => {
2424
- const r = t.session_state;
2425
- if (!r)
1789
+ this._userManager = e, this._logger = new f("SessionMonitor"), this._start = async (t) => {
1790
+ const s = t.session_state;
1791
+ if (!s)
2426
1792
  return;
2427
- const s = this._logger.create("_start");
2428
- if (t.profile ? (this._sub = t.profile.sub, this._sid = t.profile.sid, s.debug("session_state", r, ", sub", this._sub)) : (this._sub = void 0, this._sid = void 0, s.debug("session_state", r, ", anonymous user")), this._checkSessionIFrame) {
2429
- this._checkSessionIFrame.start(r);
1793
+ const r = this._logger.create("_start");
1794
+ if (t.profile ? (this._sub = t.profile.sub, this._sid = t.profile.sid, r.debug("session_state", s, ", sub", this._sub)) : (this._sub = void 0, this._sid = void 0, r.debug("session_state", s, ", anonymous user")), this._checkSessionIFrame) {
1795
+ this._checkSessionIFrame.start(s);
2430
1796
  return;
2431
1797
  }
2432
1798
  try {
2433
- const n = await this._userManager.metadataService.getCheckSessionIframe();
2434
- if (n) {
2435
- s.debug("initializing check session iframe");
2436
- const o = this._userManager.settings.client_id, a = this._userManager.settings.checkSessionIntervalInSeconds, d = this._userManager.settings.stopCheckSessionOnError, l = new _r(this._callback, o, n, a, d);
2437
- await l.load(), this._checkSessionIFrame = l, l.start(r);
1799
+ const i = await this._userManager.metadataService.getCheckSessionIframe();
1800
+ if (i) {
1801
+ r.debug("initializing check session iframe");
1802
+ const n = this._userManager.settings.client_id, o = this._userManager.settings.checkSessionIntervalInSeconds, c = this._userManager.settings.stopCheckSessionOnError, l = new Fe(this._callback, n, i, o, c);
1803
+ await l.load(), this._checkSessionIFrame = l, l.start(s);
2438
1804
  } else
2439
- s.warn("no check session iframe found in the metadata");
2440
- } catch (n) {
2441
- s.error("Error from getCheckSessionIframe:", n instanceof Error ? n.message : n);
1805
+ r.warn("no check session iframe found in the metadata");
1806
+ } catch (i) {
1807
+ r.error("Error from getCheckSessionIframe:", i instanceof Error ? i.message : i);
2442
1808
  }
2443
1809
  }, this._stop = () => {
2444
1810
  const t = this._logger.create("_stop");
2445
1811
  if (this._sub = void 0, this._sid = void 0, this._checkSessionIFrame && this._checkSessionIFrame.stop(), this._userManager.settings.monitorAnonymousSession) {
2446
- const r = setInterval(async () => {
2447
- clearInterval(r);
1812
+ const s = setInterval(async () => {
1813
+ clearInterval(s);
2448
1814
  try {
2449
- const s = await this._userManager.querySessionStatus();
2450
- if (s) {
2451
- const n = {
2452
- session_state: s.session_state,
2453
- profile: s.sub && s.sid ? {
2454
- sub: s.sub,
2455
- sid: s.sid
1815
+ const r = await this._userManager.querySessionStatus();
1816
+ if (r) {
1817
+ const i = {
1818
+ session_state: r.session_state,
1819
+ profile: r.sub && r.sid ? {
1820
+ sub: r.sub,
1821
+ sid: r.sid
2456
1822
  } : null
2457
1823
  };
2458
- this._start(n);
1824
+ this._start(i);
2459
1825
  }
2460
- } catch (s) {
2461
- t.error("error from querySessionStatus", s instanceof Error ? s.message : s);
1826
+ } catch (r) {
1827
+ t.error("error from querySessionStatus", r instanceof Error ? r.message : r);
2462
1828
  }
2463
1829
  }, 1e3);
2464
1830
  }
2465
1831
  }, this._callback = async () => {
2466
1832
  const t = this._logger.create("_callback");
2467
1833
  try {
2468
- const r = await this._userManager.querySessionStatus();
2469
- let s = !0;
2470
- r && this._checkSessionIFrame ? r.sub === this._sub ? (s = !1, this._checkSessionIFrame.start(r.session_state), r.sid === this._sid ? t.debug("same sub still logged in at OP, restarting check session iframe; session_state", r.session_state) : (t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state", r.session_state), this._userManager.events._raiseUserSessionChanged())) : t.debug("different subject signed into OP", r.sub) : t.debug("subject no longer signed into OP"), s ? this._sub ? this._userManager.events._raiseUserSignedOut() : this._userManager.events._raiseUserSignedIn() : t.debug("no change in session detected, no event to raise");
2471
- } catch (r) {
2472
- this._sub && (t.debug("Error calling queryCurrentSigninSession; raising signed out event", r), this._userManager.events._raiseUserSignedOut());
1834
+ const s = await this._userManager.querySessionStatus();
1835
+ let r = !0;
1836
+ s && this._checkSessionIFrame ? s.sub === this._sub ? (r = !1, this._checkSessionIFrame.start(s.session_state), s.sid === this._sid ? t.debug("same sub still logged in at OP, restarting check session iframe; session_state", s.session_state) : (t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state", s.session_state), this._userManager.events._raiseUserSessionChanged())) : t.debug("different subject signed into OP", s.sub) : t.debug("subject no longer signed into OP"), r ? this._sub ? this._userManager.events._raiseUserSignedOut() : this._userManager.events._raiseUserSignedIn() : t.debug("no change in session detected, no event to raise");
1837
+ } catch (s) {
1838
+ this._sub && (t.debug("Error calling queryCurrentSigninSession; raising signed out event", s), this._userManager.events._raiseUserSignedOut());
2473
1839
  }
2474
1840
  }, e || this._logger.throw(new Error("No user manager passed")), this._userManager.events.addUserLoaded(this._start), this._userManager.events.addUserUnloaded(this._stop), this._init().catch((t) => {
2475
1841
  this._logger.error(t);
@@ -2483,18 +1849,18 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2483
1849
  else if (this._userManager.settings.monitorAnonymousSession) {
2484
1850
  const t = await this._userManager.querySessionStatus();
2485
1851
  if (t) {
2486
- const r = {
1852
+ const s = {
2487
1853
  session_state: t.session_state,
2488
1854
  profile: t.sub && t.sid ? {
2489
1855
  sub: t.sub,
2490
1856
  sid: t.sid
2491
1857
  } : null
2492
1858
  };
2493
- this._start(r);
1859
+ this._start(s);
2494
1860
  }
2495
1861
  }
2496
1862
  }
2497
- }, _e = class {
1863
+ }, L = class {
2498
1864
  constructor(e) {
2499
1865
  var t;
2500
1866
  this.id_token = e.id_token, this.session_state = (t = e.session_state) != null ? t : null, this.access_token = e.access_token, this.refresh_token = e.refresh_token, this.token_type = e.token_type, this.scope = e.scope, this.profile = e.profile, this.expires_at = e.expires_at, this.state = e.userState;
@@ -2502,10 +1868,10 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2502
1868
  /** Computed number of seconds the access token has remaining. */
2503
1869
  get expires_in() {
2504
1870
  if (this.expires_at !== void 0)
2505
- return this.expires_at - H.getEpochTime();
1871
+ return this.expires_at - T.getEpochTime();
2506
1872
  }
2507
1873
  set expires_in(e) {
2508
- e !== void 0 && (this.expires_at = Math.floor(e) + H.getEpochTime());
1874
+ e !== void 0 && (this.expires_at = Math.floor(e) + T.getEpochTime());
2509
1875
  }
2510
1876
  /** Computed value indicating if the access token is expired. */
2511
1877
  get expired() {
@@ -2519,7 +1885,7 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2519
1885
  return (t = (e = this.scope) == null ? void 0 : e.split(" ")) != null ? t : [];
2520
1886
  }
2521
1887
  toStorageString() {
2522
- return new b("User").create("toStorageString"), JSON.stringify({
1888
+ return new f("User").create("toStorageString"), JSON.stringify({
2523
1889
  id_token: this.id_token,
2524
1890
  session_state: this.session_state,
2525
1891
  access_token: this.access_token,
@@ -2531,37 +1897,37 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2531
1897
  });
2532
1898
  }
2533
1899
  static fromStorageString(e) {
2534
- return b.createStatic("User", "fromStorageString"), new _e(JSON.parse(e));
1900
+ return f.createStatic("User", "fromStorageString"), new L(JSON.parse(e));
2535
1901
  }
2536
- }, lt = "oidc-client", St = class {
1902
+ }, de = "oidc-client", Se = class {
2537
1903
  constructor() {
2538
- this._abort = new G("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
1904
+ this._abort = new O("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
2539
1905
  }
2540
1906
  async navigate(e) {
2541
1907
  const t = this._logger.create("navigate");
2542
1908
  if (!this._window)
2543
1909
  throw new Error("Attempted to navigate on a disposed window");
2544
1910
  t.debug("setting URL in window"), this._window.location.replace(e.url);
2545
- const { url: r, keepOpen: s } = await new Promise((n, o) => {
2546
- const a = (d) => {
1911
+ const { url: s, keepOpen: r } = await new Promise((i, n) => {
1912
+ const o = (c) => {
2547
1913
  var l;
2548
- const h = d.data, p = (l = e.scriptOrigin) != null ? l : window.location.origin;
2549
- if (!(d.origin !== p || (h == null ? void 0 : h.source) !== lt)) {
1914
+ const h = c.data, g = (l = e.scriptOrigin) != null ? l : window.location.origin;
1915
+ if (!(c.origin !== g || (h == null ? void 0 : h.source) !== de)) {
2550
1916
  try {
2551
- const _ = Ae.readParams(h.url, e.response_mode).get("state");
2552
- if (_ || t.warn("no state found in response url"), d.source !== this._window && _ !== e.state)
1917
+ const u = ee.readParams(h.url, e.response_mode).get("state");
1918
+ if (u || t.warn("no state found in response url"), c.source !== this._window && u !== e.state)
2553
1919
  return;
2554
1920
  } catch {
2555
- this._dispose(), o(new Error("Invalid response from window"));
1921
+ this._dispose(), n(new Error("Invalid response from window"));
2556
1922
  }
2557
- n(h);
1923
+ i(h);
2558
1924
  }
2559
1925
  };
2560
- window.addEventListener("message", a, !1), this._disposeHandlers.add(() => window.removeEventListener("message", a, !1)), this._disposeHandlers.add(this._abort.addHandler((d) => {
2561
- this._dispose(), o(d);
1926
+ window.addEventListener("message", o, !1), this._disposeHandlers.add(() => window.removeEventListener("message", o, !1)), this._disposeHandlers.add(this._abort.addHandler((c) => {
1927
+ this._dispose(), n(c);
2562
1928
  }));
2563
1929
  });
2564
- return t.debug("got response from window"), this._dispose(), s || this.close(), { url: r };
1930
+ return t.debug("got response from window"), this._dispose(), r || this.close(), { url: s };
2565
1931
  }
2566
1932
  _dispose() {
2567
1933
  this._logger.create("_dispose");
@@ -2569,56 +1935,56 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2569
1935
  e();
2570
1936
  this._disposeHandlers.clear();
2571
1937
  }
2572
- static _notifyParent(e, t, r = !1, s = window.location.origin) {
1938
+ static _notifyParent(e, t, s = !1, r = window.location.origin) {
2573
1939
  e.postMessage({
2574
- source: lt,
1940
+ source: de,
2575
1941
  url: t,
2576
- keepOpen: r
2577
- }, s);
1942
+ keepOpen: s
1943
+ }, r);
2578
1944
  }
2579
- }, yt = {
1945
+ }, ye = {
2580
1946
  location: !1,
2581
1947
  toolbar: !1,
2582
1948
  height: 640
2583
- }, bt = "_blank", Ar = 60, jr = 2, kt = 10, Nr = class extends wt {
1949
+ }, be = "_blank", ot = 60, at = 2, ke = 10, ct = class extends ve {
2584
1950
  constructor(e) {
2585
1951
  const {
2586
1952
  popup_redirect_uri: t = e.redirect_uri,
2587
- popup_post_logout_redirect_uri: r = e.post_logout_redirect_uri,
2588
- popupWindowFeatures: s = yt,
2589
- popupWindowTarget: n = bt,
2590
- redirectMethod: o = "assign",
2591
- redirectTarget: a = "self",
2592
- iframeNotifyParentOrigin: d = e.iframeNotifyParentOrigin,
1953
+ popup_post_logout_redirect_uri: s = e.post_logout_redirect_uri,
1954
+ popupWindowFeatures: r = ye,
1955
+ popupWindowTarget: i = be,
1956
+ redirectMethod: n = "assign",
1957
+ redirectTarget: o = "self",
1958
+ iframeNotifyParentOrigin: c = e.iframeNotifyParentOrigin,
2593
1959
  iframeScriptOrigin: l = e.iframeScriptOrigin,
2594
1960
  silent_redirect_uri: h = e.redirect_uri,
2595
- silentRequestTimeoutInSeconds: p = kt,
2596
- automaticSilentRenew: _ = !0,
2597
- validateSubOnSilentRenew: y = !0,
1961
+ silentRequestTimeoutInSeconds: g = ke,
1962
+ automaticSilentRenew: u = !0,
1963
+ validateSubOnSilentRenew: S = !0,
2598
1964
  includeIdTokenInSilentRenew: w = !1,
2599
- monitorSession: I = !1,
2600
- monitorAnonymousSession: v = !1,
2601
- checkSessionIntervalInSeconds: R = jr,
2602
- query_status_response_type: k = "code",
2603
- stopCheckSessionOnError: c = !0,
2604
- revokeTokenTypes: g = ["access_token", "refresh_token"],
2605
- revokeTokensOnSignout: m = !1,
2606
- includeIdTokenInSilentSignout: E = !1,
2607
- accessTokenExpiringNotificationTimeInSeconds: P = Ar,
2608
- userStore: O
1965
+ monitorSession: k = !1,
1966
+ monitorAnonymousSession: _ = !1,
1967
+ checkSessionIntervalInSeconds: m = at,
1968
+ query_status_response_type: y = "code",
1969
+ stopCheckSessionOnError: a = !0,
1970
+ revokeTokenTypes: d = ["access_token", "refresh_token"],
1971
+ revokeTokensOnSignout: p = !1,
1972
+ includeIdTokenInSilentSignout: v = !1,
1973
+ accessTokenExpiringNotificationTimeInSeconds: b = ot,
1974
+ userStore: E
2609
1975
  } = e;
2610
- if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = r, this.popupWindowFeatures = s, this.popupWindowTarget = n, this.redirectMethod = o, this.redirectTarget = a, this.iframeNotifyParentOrigin = d, this.iframeScriptOrigin = l, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = p, this.automaticSilentRenew = _, this.validateSubOnSilentRenew = y, this.includeIdTokenInSilentRenew = w, this.monitorSession = I, this.monitorAnonymousSession = v, this.checkSessionIntervalInSeconds = R, this.stopCheckSessionOnError = c, this.query_status_response_type = k, this.revokeTokenTypes = g, this.revokeTokensOnSignout = m, this.includeIdTokenInSilentSignout = E, this.accessTokenExpiringNotificationTimeInSeconds = P, O)
2611
- this.userStore = O;
1976
+ if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = r, this.popupWindowTarget = i, this.redirectMethod = n, this.redirectTarget = o, this.iframeNotifyParentOrigin = c, this.iframeScriptOrigin = l, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = g, this.automaticSilentRenew = u, this.validateSubOnSilentRenew = S, this.includeIdTokenInSilentRenew = w, this.monitorSession = k, this.monitorAnonymousSession = _, this.checkSessionIntervalInSeconds = m, this.stopCheckSessionOnError = a, this.query_status_response_type = y, this.revokeTokenTypes = d, this.revokeTokensOnSignout = p, this.includeIdTokenInSilentSignout = v, this.accessTokenExpiringNotificationTimeInSeconds = b, E)
1977
+ this.userStore = E;
2612
1978
  else {
2613
- const A = typeof window < "u" ? window.sessionStorage : new pt();
2614
- this.userStore = new vt({ store: A });
1979
+ const x = typeof window < "u" ? window.sessionStorage : new fe();
1980
+ this.userStore = new we({ store: x });
2615
1981
  }
2616
1982
  }
2617
- }, je = class extends St {
1983
+ }, te = class extends Se {
2618
1984
  constructor({
2619
- silentRequestTimeoutInSeconds: e = kt
1985
+ silentRequestTimeoutInSeconds: e = ke
2620
1986
  }) {
2621
- super(), this._logger = new b("IFrameWindow"), this._timeoutInSeconds = e, this._frame = je.createHiddenIframe(), this._window = this._frame.contentWindow;
1987
+ super(), this._logger = new f("IFrameWindow"), this._timeoutInSeconds = e, this._frame = te.createHiddenIframe(), this._window = this._frame.contentWindow;
2622
1988
  }
2623
1989
  static createHiddenIframe() {
2624
1990
  const e = window.document.createElement("iframe");
@@ -2626,48 +1992,48 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2626
1992
  }
2627
1993
  async navigate(e) {
2628
1994
  this._logger.debug("navigate: Using timeout of:", this._timeoutInSeconds);
2629
- const t = setTimeout(() => this._abort.raise(new Ne("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
1995
+ const t = setTimeout(() => this._abort.raise(new re("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
2630
1996
  return this._disposeHandlers.add(() => clearTimeout(t)), await super.navigate(e);
2631
1997
  }
2632
1998
  close() {
2633
1999
  var e;
2634
2000
  this._frame && (this._frame.parentNode && (this._frame.addEventListener("load", (t) => {
2635
- var r;
2636
- const s = t.target;
2637
- (r = s.parentNode) == null || r.removeChild(s), this._abort.raise(new Error("IFrame removed from DOM"));
2001
+ var s;
2002
+ const r = t.target;
2003
+ (s = r.parentNode) == null || s.removeChild(r), this._abort.raise(new Error("IFrame removed from DOM"));
2638
2004
  }, !0), (e = this._frame.contentWindow) == null || e.location.replace("about:blank")), this._frame = null), this._window = null;
2639
2005
  }
2640
2006
  static notifyParent(e, t) {
2641
2007
  return super._notifyParent(window.parent, e, !1, t);
2642
2008
  }
2643
- }, qr = class {
2009
+ }, lt = class {
2644
2010
  constructor(e) {
2645
- this._settings = e, this._logger = new b("IFrameNavigator");
2011
+ this._settings = e, this._logger = new f("IFrameNavigator");
2646
2012
  }
2647
2013
  async prepare({
2648
2014
  silentRequestTimeoutInSeconds: e = this._settings.silentRequestTimeoutInSeconds
2649
2015
  }) {
2650
- return new je({ silentRequestTimeoutInSeconds: e });
2016
+ return new te({ silentRequestTimeoutInSeconds: e });
2651
2017
  }
2652
2018
  async callback(e) {
2653
- this._logger.create("callback"), je.notifyParent(e, this._settings.iframeNotifyParentOrigin);
2019
+ this._logger.create("callback"), te.notifyParent(e, this._settings.iframeNotifyParentOrigin);
2654
2020
  }
2655
- }, Wr = 500, ut = class extends St {
2021
+ }, dt = 500, he = class extends Se {
2656
2022
  constructor({
2657
- popupWindowTarget: e = bt,
2023
+ popupWindowTarget: e = be,
2658
2024
  popupWindowFeatures: t = {}
2659
2025
  }) {
2660
- super(), this._logger = new b("PopupWindow");
2661
- const r = ct.center({ ...yt, ...t });
2662
- this._window = window.open(void 0, e, ct.serialize(r));
2026
+ super(), this._logger = new f("PopupWindow");
2027
+ const s = le.center({ ...ye, ...t });
2028
+ this._window = window.open(void 0, e, le.serialize(s));
2663
2029
  }
2664
2030
  async navigate(e) {
2665
2031
  var t;
2666
2032
  (t = this._window) == null || t.focus();
2667
- const r = setInterval(() => {
2033
+ const s = setInterval(() => {
2668
2034
  (!this._window || this._window.closed) && this._abort.raise(new Error("Popup closed by user"));
2669
- }, Wr);
2670
- return this._disposeHandlers.add(() => clearInterval(r)), await super.navigate(e);
2035
+ }, dt);
2036
+ return this._disposeHandlers.add(() => clearInterval(s)), await super.navigate(e);
2671
2037
  }
2672
2038
  close() {
2673
2039
  this._window && (this._window.closed || (this._window.close(), this._abort.raise(new Error("Popup closed")))), this._window = null;
@@ -2677,49 +2043,49 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2677
2043
  throw new Error("No window.opener. Can't complete notification.");
2678
2044
  return super._notifyParent(window.opener, e, t);
2679
2045
  }
2680
- }, Mr = class {
2046
+ }, ht = class {
2681
2047
  constructor(e) {
2682
- this._settings = e, this._logger = new b("PopupNavigator");
2048
+ this._settings = e, this._logger = new f("PopupNavigator");
2683
2049
  }
2684
2050
  async prepare({
2685
2051
  popupWindowFeatures: e = this._settings.popupWindowFeatures,
2686
2052
  popupWindowTarget: t = this._settings.popupWindowTarget
2687
2053
  }) {
2688
- return new ut({ popupWindowFeatures: e, popupWindowTarget: t });
2054
+ return new he({ popupWindowFeatures: e, popupWindowTarget: t });
2689
2055
  }
2690
2056
  async callback(e, t = !1) {
2691
- this._logger.create("callback"), ut.notifyOpener(e, t);
2057
+ this._logger.create("callback"), he.notifyOpener(e, t);
2692
2058
  }
2693
- }, Fr = class {
2059
+ }, ut = class {
2694
2060
  constructor(e) {
2695
- this._settings = e, this._logger = new b("RedirectNavigator");
2061
+ this._settings = e, this._logger = new f("RedirectNavigator");
2696
2062
  }
2697
2063
  async prepare({
2698
2064
  redirectMethod: e = this._settings.redirectMethod,
2699
2065
  redirectTarget: t = this._settings.redirectTarget
2700
2066
  }) {
2701
- var r;
2067
+ var s;
2702
2068
  this._logger.create("prepare");
2703
- let s = window.self;
2704
- t === "top" && (s = (r = window.top) != null ? r : window.self);
2705
- const n = s.location[e].bind(s.location);
2706
- let o;
2069
+ let r = window.self;
2070
+ t === "top" && (r = (s = window.top) != null ? s : window.self);
2071
+ const i = r.location[e].bind(r.location);
2072
+ let n;
2707
2073
  return {
2708
- navigate: async (a) => {
2074
+ navigate: async (o) => {
2709
2075
  this._logger.create("navigate");
2710
- const d = new Promise((l, h) => {
2711
- o = h;
2076
+ const c = new Promise((l, h) => {
2077
+ n = h;
2712
2078
  });
2713
- return n(a.url), await d;
2079
+ return i(o.url), await c;
2714
2080
  },
2715
2081
  close: () => {
2716
- this._logger.create("close"), o == null || o(new Error("Redirect aborted")), s.stop();
2082
+ this._logger.create("close"), n == null || n(new Error("Redirect aborted")), r.stop();
2717
2083
  }
2718
2084
  };
2719
2085
  }
2720
- }, Dr = class extends fr {
2086
+ }, gt = class extends Le {
2721
2087
  constructor(e) {
2722
- super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new b("UserManagerEvents"), this._userLoaded = new G("User loaded"), this._userUnloaded = new G("User unloaded"), this._silentRenewError = new G("Silent renew error"), this._userSignedIn = new G("User signed in"), this._userSignedOut = new G("User signed out"), this._userSessionChanged = new G("User session changed");
2088
+ super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new f("UserManagerEvents"), this._userLoaded = new O("User loaded"), this._userUnloaded = new O("User unloaded"), this._silentRenewError = new O("Silent renew error"), this._userSignedIn = new O("User signed in"), this._userSignedOut = new O("User signed out"), this._userSessionChanged = new O("User session changed");
2723
2089
  }
2724
2090
  load(e, t = !0) {
2725
2091
  super.load(e), t && this._userLoaded.raise(e);
@@ -2826,18 +2192,18 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2826
2192
  _raiseUserSessionChanged() {
2827
2193
  this._userSessionChanged.raise();
2828
2194
  }
2829
- }, Hr = class {
2195
+ }, _t = class {
2830
2196
  constructor(e) {
2831
- this._userManager = e, this._logger = new b("SilentRenewService"), this._isStarted = !1, this._retryTimer = new H("Retry Silent Renew"), this._tokenExpiring = async () => {
2197
+ this._userManager = e, this._logger = new f("SilentRenewService"), this._isStarted = !1, this._retryTimer = new T("Retry Silent Renew"), this._tokenExpiring = async () => {
2832
2198
  const t = this._logger.create("_tokenExpiring");
2833
2199
  try {
2834
2200
  await this._userManager.signinSilent(), t.debug("silent token renewal successful");
2835
- } catch (r) {
2836
- if (r instanceof Ne) {
2837
- t.warn("ErrorTimeout from signinSilent:", r, "retry in 5s"), this._retryTimer.init(5);
2201
+ } catch (s) {
2202
+ if (s instanceof re) {
2203
+ t.warn("ErrorTimeout from signinSilent:", s, "retry in 5s"), this._retryTimer.init(5);
2838
2204
  return;
2839
2205
  }
2840
- t.error("Error from signinSilent:", r), this._userManager.events._raiseSilentRenewError(r);
2206
+ t.error("Error from signinSilent:", s), this._userManager.events._raiseSilentRenewError(s);
2841
2207
  }
2842
2208
  };
2843
2209
  }
@@ -2855,13 +2221,13 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2855
2221
  stop() {
2856
2222
  this._isStarted && (this._retryTimer.cancel(), this._retryTimer.removeHandler(this._tokenExpiring), this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring), this._isStarted = !1);
2857
2223
  }
2858
- }, Br = class {
2224
+ }, pt = class {
2859
2225
  constructor(e) {
2860
2226
  this.refresh_token = e.refresh_token, this.id_token = e.id_token, this.session_state = e.session_state, this.scope = e.scope, this.profile = e.profile, this.data = e.state;
2861
2227
  }
2862
- }, Xr = class {
2228
+ }, xt = class {
2863
2229
  constructor(e) {
2864
- this._logger = new b("UserManager"), this.settings = new Nr(e), this._client = new Or(e), this._redirectNavigator = new Fr(this.settings), this._popupNavigator = new Mr(this.settings), this._iframeNavigator = new qr(this.settings), this._events = new Dr(this.settings), this._silentRenewService = new Hr(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new Ur(this));
2230
+ this._logger = new f("UserManager"), this.settings = new ct(e), this._client = new it(e), this._redirectNavigator = new ut(this.settings), this._popupNavigator = new ht(this.settings), this._iframeNavigator = new lt(this.settings), this._events = new gt(this.settings), this._silentRenewService = new _t(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new nt(this));
2865
2231
  }
2866
2232
  /** Returns an object used to register for events raised by the `UserManager`. */
2867
2233
  get events() {
@@ -2892,19 +2258,19 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2892
2258
  this._logger.create("signinRedirect");
2893
2259
  const {
2894
2260
  redirectMethod: t,
2895
- ...r
2896
- } = e, s = await this._redirectNavigator.prepare({ redirectMethod: t });
2261
+ ...s
2262
+ } = e, r = await this._redirectNavigator.prepare({ redirectMethod: t });
2897
2263
  await this._signinStart({
2898
2264
  request_type: "si:r",
2899
- ...r
2900
- }, s);
2265
+ ...s
2266
+ }, r);
2901
2267
  }
2902
2268
  /**
2903
2269
  * Returns promise to process response from the authorization endpoint. The result of the promise is the authenticated `User`.
2904
2270
  */
2905
2271
  async signinRedirectCallback(e = window.location.href) {
2906
- const t = this._logger.create("signinRedirectCallback"), r = await this._signinEnd(e);
2907
- return r.profile && r.profile.sub ? t.info("success, signed in subject", r.profile.sub) : t.info("no subject"), r;
2272
+ const t = this._logger.create("signinRedirectCallback"), s = await this._signinEnd(e);
2273
+ return s.profile && s.profile.sub ? t.info("success, signed in subject", s.profile.sub) : t.info("no subject"), s;
2908
2274
  }
2909
2275
  /**
2910
2276
  * Returns promise to process the signin with user/password. The result of the promise is the authenticated `User`.
@@ -2914,37 +2280,37 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2914
2280
  async signinResourceOwnerCredentials({
2915
2281
  username: e,
2916
2282
  password: t,
2917
- skipUserInfo: r = !1
2283
+ skipUserInfo: s = !1
2918
2284
  }) {
2919
- const s = this._logger.create("signinResourceOwnerCredential"), n = await this._client.processResourceOwnerPasswordCredentials({ username: e, password: t, skipUserInfo: r, extraTokenParams: this.settings.extraTokenParams });
2920
- s.debug("got signin response");
2921
- const o = await this._buildUser(n);
2922
- return o.profile && o.profile.sub ? s.info("success, signed in subject", o.profile.sub) : s.info("no subject"), o;
2285
+ const r = this._logger.create("signinResourceOwnerCredential"), i = await this._client.processResourceOwnerPasswordCredentials({ username: e, password: t, skipUserInfo: s, extraTokenParams: this.settings.extraTokenParams });
2286
+ r.debug("got signin response");
2287
+ const n = await this._buildUser(i);
2288
+ return n.profile && n.profile.sub ? r.info("success, signed in subject", n.profile.sub) : r.info("no subject"), n;
2923
2289
  }
2924
2290
  /**
2925
2291
  * Returns promise to trigger a request (via a popup window) to the authorization endpoint. The result of the promise is the authenticated `User`.
2926
2292
  */
2927
2293
  async signinPopup(e = {}) {
2928
2294
  const t = this._logger.create("signinPopup"), {
2929
- popupWindowFeatures: r,
2930
- popupWindowTarget: s,
2931
- ...n
2932
- } = e, o = this.settings.popup_redirect_uri;
2933
- o || t.throw(new Error("No popup_redirect_uri configured"));
2934
- const a = await this._popupNavigator.prepare({ popupWindowFeatures: r, popupWindowTarget: s }), d = await this._signin({
2295
+ popupWindowFeatures: s,
2296
+ popupWindowTarget: r,
2297
+ ...i
2298
+ } = e, n = this.settings.popup_redirect_uri;
2299
+ n || t.throw(new Error("No popup_redirect_uri configured"));
2300
+ const o = await this._popupNavigator.prepare({ popupWindowFeatures: s, popupWindowTarget: r }), c = await this._signin({
2935
2301
  request_type: "si:p",
2936
- redirect_uri: o,
2302
+ redirect_uri: n,
2937
2303
  display: "popup",
2938
- ...n
2939
- }, a);
2940
- return d && (d.profile && d.profile.sub ? t.info("success, signed in subject", d.profile.sub) : t.info("no subject")), d;
2304
+ ...i
2305
+ }, o);
2306
+ return c && (c.profile && c.profile.sub ? t.info("success, signed in subject", c.profile.sub) : t.info("no subject")), c;
2941
2307
  }
2942
2308
  /**
2943
2309
  * Returns promise to notify the opening window of response from the authorization endpoint.
2944
2310
  */
2945
2311
  async signinPopupCallback(e = window.location.href, t = !1) {
2946
- const r = this._logger.create("signinPopupCallback");
2947
- await this._popupNavigator.callback(e, t), r.info("success");
2312
+ const s = this._logger.create("signinPopupCallback");
2313
+ await this._popupNavigator.callback(e, t), s.info("success");
2948
2314
  }
2949
2315
  /**
2950
2316
  * Returns promise to trigger a silent request (via an iframe) to the authorization endpoint.
@@ -2952,35 +2318,35 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
2952
2318
  */
2953
2319
  async signinSilent(e = {}) {
2954
2320
  var t;
2955
- const r = this._logger.create("signinSilent"), {
2956
- silentRequestTimeoutInSeconds: s,
2957
- ...n
2321
+ const s = this._logger.create("signinSilent"), {
2322
+ silentRequestTimeoutInSeconds: r,
2323
+ ...i
2958
2324
  } = e;
2959
- let o = await this._loadUser();
2960
- if (o != null && o.refresh_token) {
2961
- r.debug("using refresh token");
2962
- const h = new Br(o);
2325
+ let n = await this._loadUser();
2326
+ if (n != null && n.refresh_token) {
2327
+ s.debug("using refresh token");
2328
+ const h = new pt(n);
2963
2329
  return await this._useRefreshToken(h);
2964
2330
  }
2965
- const a = this.settings.silent_redirect_uri;
2966
- a || r.throw(new Error("No silent_redirect_uri configured"));
2967
- let d;
2968
- o && this.settings.validateSubOnSilentRenew && (r.debug("subject prior to silent renew:", o.profile.sub), d = o.profile.sub);
2969
- const l = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: s });
2970
- return o = await this._signin({
2331
+ const o = this.settings.silent_redirect_uri;
2332
+ o || s.throw(new Error("No silent_redirect_uri configured"));
2333
+ let c;
2334
+ n && this.settings.validateSubOnSilentRenew && (s.debug("subject prior to silent renew:", n.profile.sub), c = n.profile.sub);
2335
+ const l = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: r });
2336
+ return n = await this._signin({
2971
2337
  request_type: "si:s",
2972
- redirect_uri: a,
2338
+ redirect_uri: o,
2973
2339
  prompt: "none",
2974
- id_token_hint: this.settings.includeIdTokenInSilentRenew ? o == null ? void 0 : o.id_token : void 0,
2975
- ...n
2976
- }, l, d), o && ((t = o.profile) != null && t.sub ? r.info("success, signed in subject", o.profile.sub) : r.info("no subject")), o;
2340
+ id_token_hint: this.settings.includeIdTokenInSilentRenew ? n == null ? void 0 : n.id_token : void 0,
2341
+ ...i
2342
+ }, l, c), n && ((t = n.profile) != null && t.sub ? s.info("success, signed in subject", n.profile.sub) : s.info("no subject")), n;
2977
2343
  }
2978
2344
  async _useRefreshToken(e) {
2979
2345
  const t = await this._client.useRefreshToken({
2980
2346
  state: e,
2981
2347
  timeoutInSeconds: this.settings.silentRequestTimeoutInSeconds
2982
- }), r = new _e({ ...e, ...t });
2983
- return await this.storeUser(r), this._events.load(r), r;
2348
+ }), s = new L({ ...e, ...t });
2349
+ return await this.storeUser(s), this._events.load(s), s;
2984
2350
  }
2985
2351
  /**
2986
2352
  * Returns promise to notify the parent window of response from the authorization endpoint.
@@ -3003,9 +2369,9 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
3003
2369
  }
3004
2370
  }
3005
2371
  async signoutCallback(e = window.location.href, t = !1) {
3006
- const { state: r } = await this._client.readSignoutResponseState(e);
3007
- if (r)
3008
- switch (r.request_type) {
2372
+ const { state: s } = await this._client.readSignoutResponseState(e);
2373
+ if (s)
2374
+ switch (s.request_type) {
3009
2375
  case "so:r":
3010
2376
  await this.signoutRedirectCallback(e);
3011
2377
  break;
@@ -3024,30 +2390,30 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
3024
2390
  */
3025
2391
  async querySessionStatus(e = {}) {
3026
2392
  const t = this._logger.create("querySessionStatus"), {
3027
- silentRequestTimeoutInSeconds: r,
3028
- ...s
3029
- } = e, n = this.settings.silent_redirect_uri;
3030
- n || t.throw(new Error("No silent_redirect_uri configured"));
3031
- const o = await this._loadUser(), a = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: r }), d = await this._signinStart({
2393
+ silentRequestTimeoutInSeconds: s,
2394
+ ...r
2395
+ } = e, i = this.settings.silent_redirect_uri;
2396
+ i || t.throw(new Error("No silent_redirect_uri configured"));
2397
+ const n = await this._loadUser(), o = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: s }), c = await this._signinStart({
3032
2398
  request_type: "si:s",
3033
2399
  // this acts like a signin silent
3034
- redirect_uri: n,
2400
+ redirect_uri: i,
3035
2401
  prompt: "none",
3036
- id_token_hint: this.settings.includeIdTokenInSilentRenew ? o == null ? void 0 : o.id_token : void 0,
2402
+ id_token_hint: this.settings.includeIdTokenInSilentRenew ? n == null ? void 0 : n.id_token : void 0,
3037
2403
  response_type: this.settings.query_status_response_type,
3038
2404
  scope: "openid",
3039
2405
  skipUserInfo: !0,
3040
- ...s
3041
- }, a);
2406
+ ...r
2407
+ }, o);
3042
2408
  try {
3043
- const l = await this._client.processSigninResponse(d.url);
2409
+ const l = await this._client.processSigninResponse(c.url);
3044
2410
  return t.debug("got signin response"), l.session_state && l.profile.sub ? (t.info("success for subject", l.profile.sub), {
3045
2411
  session_state: l.session_state,
3046
2412
  sub: l.profile.sub,
3047
2413
  sid: l.profile.sid
3048
2414
  }) : (t.info("success, user not authenticated"), null);
3049
2415
  } catch (l) {
3050
- if (this.settings.monitorAnonymousSession && l instanceof Z)
2416
+ if (this.settings.monitorAnonymousSession && l instanceof j)
3051
2417
  switch (l.error) {
3052
2418
  case "login_required":
3053
2419
  case "consent_required":
@@ -3061,126 +2427,126 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
3061
2427
  throw l;
3062
2428
  }
3063
2429
  }
3064
- async _signin(e, t, r) {
3065
- const s = await this._signinStart(e, t);
3066
- return await this._signinEnd(s.url, r);
2430
+ async _signin(e, t, s) {
2431
+ const r = await this._signinStart(e, t);
2432
+ return await this._signinEnd(r.url, s);
3067
2433
  }
3068
2434
  async _signinStart(e, t) {
3069
- const r = this._logger.create("_signinStart");
2435
+ const s = this._logger.create("_signinStart");
3070
2436
  try {
3071
- const s = await this._client.createSigninRequest(e);
3072
- return r.debug("got signin request"), await t.navigate({
3073
- url: s.url,
3074
- state: s.state.id,
3075
- response_mode: s.state.response_mode,
2437
+ const r = await this._client.createSigninRequest(e);
2438
+ return s.debug("got signin request"), await t.navigate({
2439
+ url: r.url,
2440
+ state: r.state.id,
2441
+ response_mode: r.state.response_mode,
3076
2442
  scriptOrigin: this.settings.iframeScriptOrigin
3077
2443
  });
3078
- } catch (s) {
3079
- throw r.debug("error after preparing navigator, closing navigator window"), t.close(), s;
2444
+ } catch (r) {
2445
+ throw s.debug("error after preparing navigator, closing navigator window"), t.close(), r;
3080
2446
  }
3081
2447
  }
3082
2448
  async _signinEnd(e, t) {
3083
- const r = this._logger.create("_signinEnd"), s = await this._client.processSigninResponse(e);
3084
- return r.debug("got signin response"), await this._buildUser(s, t);
2449
+ const s = this._logger.create("_signinEnd"), r = await this._client.processSigninResponse(e);
2450
+ return s.debug("got signin response"), await this._buildUser(r, t);
3085
2451
  }
3086
2452
  async _buildUser(e, t) {
3087
- const r = this._logger.create("_buildUser"), s = new _e(e);
2453
+ const s = this._logger.create("_buildUser"), r = new L(e);
3088
2454
  if (t) {
3089
- if (t !== s.profile.sub)
3090
- throw r.debug("current user does not match user returned from signin. sub from signin:", s.profile.sub), new Z({ ...e, error: "login_required" });
3091
- r.debug("current user matches user returned from signin");
2455
+ if (t !== r.profile.sub)
2456
+ throw s.debug("current user does not match user returned from signin. sub from signin:", r.profile.sub), new j({ ...e, error: "login_required" });
2457
+ s.debug("current user matches user returned from signin");
3092
2458
  }
3093
- return await this.storeUser(s), r.debug("user stored"), this._events.load(s), s;
2459
+ return await this.storeUser(r), s.debug("user stored"), this._events.load(r), r;
3094
2460
  }
3095
2461
  /**
3096
2462
  * Returns promise to trigger a redirect of the current window to the end session endpoint.
3097
2463
  */
3098
2464
  async signoutRedirect(e = {}) {
3099
2465
  const t = this._logger.create("signoutRedirect"), {
3100
- redirectMethod: r,
3101
- ...s
3102
- } = e, n = await this._redirectNavigator.prepare({ redirectMethod: r });
2466
+ redirectMethod: s,
2467
+ ...r
2468
+ } = e, i = await this._redirectNavigator.prepare({ redirectMethod: s });
3103
2469
  await this._signoutStart({
3104
2470
  request_type: "so:r",
3105
2471
  post_logout_redirect_uri: this.settings.post_logout_redirect_uri,
3106
- ...s
3107
- }, n), t.info("success");
2472
+ ...r
2473
+ }, i), t.info("success");
3108
2474
  }
3109
2475
  /**
3110
2476
  * Returns promise to process response from the end session endpoint.
3111
2477
  */
3112
2478
  async signoutRedirectCallback(e = window.location.href) {
3113
- const t = this._logger.create("signoutRedirectCallback"), r = await this._signoutEnd(e);
3114
- return t.info("success"), r;
2479
+ const t = this._logger.create("signoutRedirectCallback"), s = await this._signoutEnd(e);
2480
+ return t.info("success"), s;
3115
2481
  }
3116
2482
  /**
3117
2483
  * Returns promise to trigger a redirect of a popup window window to the end session endpoint.
3118
2484
  */
3119
2485
  async signoutPopup(e = {}) {
3120
2486
  const t = this._logger.create("signoutPopup"), {
3121
- popupWindowFeatures: r,
3122
- popupWindowTarget: s,
3123
- ...n
3124
- } = e, o = this.settings.popup_post_logout_redirect_uri, a = await this._popupNavigator.prepare({ popupWindowFeatures: r, popupWindowTarget: s });
2487
+ popupWindowFeatures: s,
2488
+ popupWindowTarget: r,
2489
+ ...i
2490
+ } = e, n = this.settings.popup_post_logout_redirect_uri, o = await this._popupNavigator.prepare({ popupWindowFeatures: s, popupWindowTarget: r });
3125
2491
  await this._signout({
3126
2492
  request_type: "so:p",
3127
- post_logout_redirect_uri: o,
2493
+ post_logout_redirect_uri: n,
3128
2494
  // we're putting a dummy entry in here because we
3129
2495
  // need a unique id from the state for notification
3130
2496
  // to the parent window, which is necessary if we
3131
2497
  // plan to return back to the client after signout
3132
2498
  // and so we can close the popup after signout
3133
- state: o == null ? void 0 : {},
3134
- ...n
3135
- }, a), t.info("success");
2499
+ state: n == null ? void 0 : {},
2500
+ ...i
2501
+ }, o), t.info("success");
3136
2502
  }
3137
2503
  /**
3138
2504
  * Returns promise to process response from the end session endpoint from a popup window.
3139
2505
  */
3140
2506
  async signoutPopupCallback(e = window.location.href, t = !1) {
3141
- const r = this._logger.create("signoutPopupCallback");
3142
- await this._popupNavigator.callback(e, t), r.info("success");
2507
+ const s = this._logger.create("signoutPopupCallback");
2508
+ await this._popupNavigator.callback(e, t), s.info("success");
3143
2509
  }
3144
2510
  async _signout(e, t) {
3145
- const r = await this._signoutStart(e, t);
3146
- return await this._signoutEnd(r.url);
2511
+ const s = await this._signoutStart(e, t);
2512
+ return await this._signoutEnd(s.url);
3147
2513
  }
3148
2514
  async _signoutStart(e = {}, t) {
3149
- var r;
3150
- const s = this._logger.create("_signoutStart");
2515
+ var s;
2516
+ const r = this._logger.create("_signoutStart");
3151
2517
  try {
3152
- const n = await this._loadUser();
3153
- s.debug("loaded current user from storage"), this.settings.revokeTokensOnSignout && await this._revokeInternal(n);
3154
- const o = e.id_token_hint || n && n.id_token;
3155
- o && (s.debug("setting id_token_hint in signout request"), e.id_token_hint = o), await this.removeUser(), s.debug("user removed, creating signout request");
3156
- const a = await this._client.createSignoutRequest(e);
3157
- return s.debug("got signout request"), await t.navigate({
3158
- url: a.url,
3159
- state: (r = a.state) == null ? void 0 : r.id
2518
+ const i = await this._loadUser();
2519
+ r.debug("loaded current user from storage"), this.settings.revokeTokensOnSignout && await this._revokeInternal(i);
2520
+ const n = e.id_token_hint || i && i.id_token;
2521
+ n && (r.debug("setting id_token_hint in signout request"), e.id_token_hint = n), await this.removeUser(), r.debug("user removed, creating signout request");
2522
+ const o = await this._client.createSignoutRequest(e);
2523
+ return r.debug("got signout request"), await t.navigate({
2524
+ url: o.url,
2525
+ state: (s = o.state) == null ? void 0 : s.id
3160
2526
  });
3161
- } catch (n) {
3162
- throw s.debug("error after preparing navigator, closing navigator window"), t.close(), n;
2527
+ } catch (i) {
2528
+ throw r.debug("error after preparing navigator, closing navigator window"), t.close(), i;
3163
2529
  }
3164
2530
  }
3165
2531
  async _signoutEnd(e) {
3166
- const t = this._logger.create("_signoutEnd"), r = await this._client.processSignoutResponse(e);
3167
- return t.debug("got signout response"), r;
2532
+ const t = this._logger.create("_signoutEnd"), s = await this._client.processSignoutResponse(e);
2533
+ return t.debug("got signout response"), s;
3168
2534
  }
3169
2535
  /**
3170
2536
  * Returns promise to trigger a silent request (via an iframe) to the end session endpoint.
3171
2537
  */
3172
2538
  async signoutSilent(e = {}) {
3173
2539
  var t;
3174
- const r = this._logger.create("signoutSilent"), {
3175
- silentRequestTimeoutInSeconds: s,
3176
- ...n
3177
- } = e, o = this.settings.includeIdTokenInSilentSignout ? (t = await this._loadUser()) == null ? void 0 : t.id_token : void 0, a = this.settings.popup_post_logout_redirect_uri, d = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: s });
2540
+ const s = this._logger.create("signoutSilent"), {
2541
+ silentRequestTimeoutInSeconds: r,
2542
+ ...i
2543
+ } = e, n = this.settings.includeIdTokenInSilentSignout ? (t = await this._loadUser()) == null ? void 0 : t.id_token : void 0, o = this.settings.popup_post_logout_redirect_uri, c = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: r });
3178
2544
  await this._signout({
3179
2545
  request_type: "so:s",
3180
- post_logout_redirect_uri: a,
3181
- id_token_hint: o,
3182
- ...n
3183
- }, d), r.info("success");
2546
+ post_logout_redirect_uri: o,
2547
+ id_token_hint: n,
2548
+ ...i
2549
+ }, c), s.info("success");
3184
2550
  }
3185
2551
  /**
3186
2552
  * Returns promise to notify the parent window of response from the end session endpoint.
@@ -3194,21 +2560,21 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
3194
2560
  await this._revokeInternal(t, e);
3195
2561
  }
3196
2562
  async _revokeInternal(e, t = this.settings.revokeTokenTypes) {
3197
- const r = this._logger.create("_revokeInternal");
2563
+ const s = this._logger.create("_revokeInternal");
3198
2564
  if (!e)
3199
2565
  return;
3200
- const s = t.filter((n) => typeof e[n] == "string");
3201
- if (!s.length) {
3202
- r.debug("no need to revoke due to no token(s)");
2566
+ const r = t.filter((i) => typeof e[i] == "string");
2567
+ if (!r.length) {
2568
+ s.debug("no need to revoke due to no token(s)");
3203
2569
  return;
3204
2570
  }
3205
- for (const n of s)
2571
+ for (const i of r)
3206
2572
  await this._client.revokeToken(
3207
- e[n],
2573
+ e[i],
3208
2574
  // eslint-disable-line @typescript-eslint/no-non-null-assertion
3209
- n
3210
- ), r.info(`${n} revoked successfully`), n !== "access_token" && (e[n] = null);
3211
- await this.storeUser(e), r.debug("user stored"), this._events.load(e);
2575
+ i
2576
+ ), s.info(`${i} revoked successfully`), i !== "access_token" && (e[i] = null);
2577
+ await this.storeUser(e), s.debug("user stored"), this._events.load(e);
3212
2578
  }
3213
2579
  /**
3214
2580
  * Enables silent renew for the `UserManager`.
@@ -3227,14 +2593,14 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
3227
2593
  }
3228
2594
  async _loadUser() {
3229
2595
  const e = this._logger.create("_loadUser"), t = await this.settings.userStore.get(this._userStoreKey);
3230
- return t ? (e.debug("user storageString loaded"), _e.fromStorageString(t)) : (e.debug("no user storageString"), null);
2596
+ return t ? (e.debug("user storageString loaded"), L.fromStorageString(t)) : (e.debug("no user storageString"), null);
3231
2597
  }
3232
2598
  async storeUser(e) {
3233
2599
  const t = this._logger.create("storeUser");
3234
2600
  if (e) {
3235
2601
  t.debug("storing user");
3236
- const r = e.toStorageString();
3237
- await this.settings.userStore.set(this._userStoreKey, r);
2602
+ const s = e.toStorageString();
2603
+ await this.settings.userStore.set(this._userStoreKey, s);
3238
2604
  } else
3239
2605
  this._logger.debug("removing user"), await this.settings.userStore.remove(this._userStoreKey);
3240
2606
  }
@@ -3244,60 +2610,60 @@ var gr = "10000000-1000-4000-8000-100000000000", K = class {
3244
2610
  async clearStaleState() {
3245
2611
  await this._client.clearStaleState();
3246
2612
  }
3247
- }, $r = "2.2.2", Qr = $r;
3248
- const Et = ht(
2613
+ }, ft = "2.2.2", Ct = ft;
2614
+ const Ee = ue(
3249
2615
  null
3250
- ), Lr = () => {
3251
- const e = gt(Et);
2616
+ ), wt = () => {
2617
+ const e = ge(Ee);
3252
2618
  if (!e)
3253
2619
  throw new Error(
3254
2620
  "useImpersonationContext must be used within a ImpersonationContextProvider"
3255
2621
  );
3256
2622
  return e;
3257
- }, Zr = ({
2623
+ }, Rt = ({
3258
2624
  children: e
3259
2625
  }) => {
3260
- const [t, r] = Xt("impersonationState", {
2626
+ const [t, s] = Re("impersonationState", {
3261
2627
  defaultValue: {}
3262
- }), s = ft(() => ({
2628
+ }), r = _e(() => ({
3263
2629
  accessToken: t == null ? void 0 : t.accessToken,
3264
2630
  userInfo: t == null ? void 0 : t.userInfo,
3265
- setImpersonation: (n, o) => {
3266
- r({ accessToken: n, userInfo: o });
2631
+ setImpersonation: (i, n) => {
2632
+ s({ accessToken: i, userInfo: n });
3267
2633
  }
3268
2634
  }), []);
3269
- return /* @__PURE__ */ ce.jsx(Et.Provider, { value: s, children: e });
3270
- }, zr = (e) => {
3271
- const r = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), s = atob(r);
3272
- return JSON.parse(s);
3273
- }, es = (e) => {
3274
- const { setImpersonation: t } = Lr();
3275
- pe(() => {
3276
- const { search: r } = window.location, s = new URLSearchParams(r).get(
2635
+ return /* @__PURE__ */ se.jsx(Ee.Provider, { value: r, children: e });
2636
+ }, vt = (e) => {
2637
+ const s = e.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), r = atob(s);
2638
+ return JSON.parse(r);
2639
+ }, Tt = (e) => {
2640
+ const { setImpersonation: t } = wt();
2641
+ F(() => {
2642
+ const { search: s } = window.location, r = new URLSearchParams(s).get(
3277
2643
  "impersonateAccessToken"
3278
2644
  );
3279
- if (s && t) {
3280
- const n = zr(s);
3281
- t(s, n), e();
2645
+ if (r && t) {
2646
+ const i = vt(r);
2647
+ t(r, i), e();
3282
2648
  }
3283
2649
  }, []);
3284
- }, Jr = ({
2650
+ }, mt = ({
3285
2651
  userManager: e,
3286
2652
  context: t,
3287
- children: r
2653
+ children: s
3288
2654
  }) => {
3289
- const [s, n] = Gt({
2655
+ const [r, i] = Ce({
3290
2656
  user: null,
3291
2657
  isLoading: !0,
3292
2658
  isAuthenticated: !1,
3293
2659
  isError: !1,
3294
2660
  error: null
3295
- }), o = _t(!1);
3296
- pe(() => {
3297
- o.current || (o.current = !0, (async () => {
2661
+ }), n = pe(!1);
2662
+ F(() => {
2663
+ n.current || (n.current = !0, (async () => {
3298
2664
  try {
3299
2665
  const h = await e.getUser();
3300
- n({
2666
+ i({
3301
2667
  user: h,
3302
2668
  isLoading: !1,
3303
2669
  isAuthenticated: h ? !h.expired : !1,
@@ -3305,7 +2671,7 @@ const Et = ht(
3305
2671
  error: null
3306
2672
  });
3307
2673
  } catch (h) {
3308
- n({
2674
+ i({
3309
2675
  user: null,
3310
2676
  isLoading: !1,
3311
2677
  isAuthenticated: !1,
@@ -3314,118 +2680,118 @@ const Et = ht(
3314
2680
  });
3315
2681
  }
3316
2682
  })());
3317
- }, [e]), pe(() => {
3318
- const h = (y) => {
3319
- n({
3320
- user: y,
2683
+ }, [e]), F(() => {
2684
+ const h = (S) => {
2685
+ i({
2686
+ user: S,
3321
2687
  isLoading: !1,
3322
- isAuthenticated: !y.expired,
2688
+ isAuthenticated: !S.expired,
3323
2689
  isError: !1,
3324
2690
  error: null
3325
2691
  });
3326
2692
  };
3327
2693
  e.events.addUserLoaded(h);
3328
- const p = () => {
3329
- n({
3330
- ...s,
2694
+ const g = () => {
2695
+ i({
2696
+ ...r,
3331
2697
  user: null,
3332
2698
  isAuthenticated: !1
3333
2699
  });
3334
2700
  };
3335
- e.events.addUserUnloaded(p);
3336
- const _ = (y) => {
3337
- n({
3338
- ...s,
2701
+ e.events.addUserUnloaded(g);
2702
+ const u = (S) => {
2703
+ i({
2704
+ ...r,
3339
2705
  isLoading: !1,
3340
2706
  isError: !0,
3341
- error: y
2707
+ error: S
3342
2708
  });
3343
2709
  };
3344
- return e.events.addSilentRenewError(_), () => {
3345
- e.events.removeUserLoaded(h), e.events.removeUserUnloaded(p), e.events.removeSilentRenewError(_);
2710
+ return e.events.addSilentRenewError(u), () => {
2711
+ e.events.removeUserLoaded(h), e.events.removeUserUnloaded(g), e.events.removeSilentRenewError(u);
3346
2712
  };
3347
2713
  }, [e]);
3348
- const a = it(async () => {
2714
+ const o = ae(async () => {
3349
2715
  const h = await e.signinCallback();
3350
- return n({
2716
+ return i({
3351
2717
  user: h ?? null,
3352
2718
  isLoading: !1,
3353
2719
  isAuthenticated: h ? !h.expired : !1,
3354
2720
  isError: !1,
3355
2721
  error: null
3356
2722
  }), h ?? void 0;
3357
- }, [e]), d = it(
2723
+ }, [e]), c = ae(
3358
2724
  async (h) => {
3359
2725
  try {
3360
2726
  await e.signinRedirect(h);
3361
- } catch (p) {
3362
- console.error(p);
2727
+ } catch (g) {
2728
+ console.error(g);
3363
2729
  }
3364
2730
  },
3365
2731
  [e]
3366
- ), l = ft(
2732
+ ), l = _e(
3367
2733
  () => ({
3368
- state: s,
3369
- handleSigninCallback: a,
3370
- redirectToSignin: d
2734
+ state: r,
2735
+ handleSigninCallback: o,
2736
+ redirectToSignin: c
3371
2737
  }),
3372
- [s, a, d]
2738
+ [r, o, c]
3373
2739
  );
3374
- return /* @__PURE__ */ ce.jsx(t.Provider, { value: l, children: r });
3375
- }, Me = (e) => {
3376
- const t = gt(e);
2740
+ return /* @__PURE__ */ se.jsx(t.Provider, { value: l, children: s });
2741
+ }, oe = (e) => {
2742
+ const t = ge(e);
3377
2743
  if (!t)
3378
2744
  throw new Error("useAuthContext must be used within an AuthProvider");
3379
2745
  return t;
3380
- }, Kr = (e) => {
3381
- const { state: t } = Me(e);
2746
+ }, St = (e) => {
2747
+ const { state: t } = oe(e);
3382
2748
  return t;
3383
- }, Vr = (e, t) => {
3384
- const { state: r, handleSigninCallback: s } = Me(e), n = _t(!1);
3385
- return pe(() => {
3386
- n.current || (n.current = !0, s().then(
3387
- (o) => new Promise(
3388
- (a) => setTimeout(() => a(o), 0)
2749
+ }, yt = (e, t) => {
2750
+ const { state: s, handleSigninCallback: r } = oe(e), i = pe(!1);
2751
+ return F(() => {
2752
+ i.current || (i.current = !0, r().then(
2753
+ (n) => new Promise(
2754
+ (o) => setTimeout(() => o(n), 0)
3389
2755
  )
3390
- ).then((o) => t == null ? void 0 : t(o)));
3391
- }, [s]), r;
3392
- }, ts = (e) => {
3393
- const t = ht(null);
2756
+ ).then((n) => t == null ? void 0 : t(n)));
2757
+ }, [r]), s;
2758
+ }, It = (e) => {
2759
+ const t = ue(null);
3394
2760
  return {
3395
2761
  AuthContext: t,
3396
- AuthProvider: ({ children: d }) => /* @__PURE__ */ ce.jsx(Jr, { userManager: e, context: t, children: d }),
3397
- useAuthContext: () => Me(t),
3398
- useAuthState: () => Kr(t),
3399
- useSigninCallback: (d) => Vr(t, d),
2762
+ AuthProvider: ({ children: c }) => /* @__PURE__ */ se.jsx(mt, { userManager: e, context: t, children: c }),
2763
+ useAuthContext: () => oe(t),
2764
+ useAuthState: () => St(t),
2765
+ useSigninCallback: (c) => yt(t, c),
3400
2766
  getAccessToken: async () => {
3401
- const d = await e.getUser();
3402
- return d ? d.access_token : null;
2767
+ const c = await e.getUser();
2768
+ return c ? c.access_token : null;
3403
2769
  }
3404
2770
  };
3405
2771
  };
3406
2772
  export {
3407
- fr as AccessTokenEvents,
3408
- _r as CheckSessionIFrame,
3409
- Z as ErrorResponse,
3410
- Ne as ErrorTimeout,
3411
- Zr as ImpersonationContextProvider,
3412
- pt as InMemoryWebStorage,
3413
- me as Log,
3414
- b as Logger,
3415
- pr as MetadataService,
3416
- Or as OidcClient,
3417
- wt as OidcClientSettingsStore,
3418
- Ur as SessionMonitor,
3419
- Ce as SigninResponse,
3420
- We as SigninState,
3421
- Pr as SignoutResponse,
3422
- ie as State,
3423
- _e as User,
3424
- Xr as UserManager,
3425
- Nr as UserManagerSettingsStore,
3426
- Qr as Version,
3427
- vt as WebStorageStateStore,
3428
- ts as createAuthContext,
3429
- es as useImpersonationCallback,
3430
- Lr as useImpersonationContext
2773
+ Le as AccessTokenEvents,
2774
+ Fe as CheckSessionIFrame,
2775
+ j as ErrorResponse,
2776
+ re as ErrorTimeout,
2777
+ Rt as ImpersonationContextProvider,
2778
+ fe as InMemoryWebStorage,
2779
+ D as Log,
2780
+ f as Logger,
2781
+ $e as MetadataService,
2782
+ it as OidcClient,
2783
+ ve as OidcClientSettingsStore,
2784
+ nt as SessionMonitor,
2785
+ G as SigninResponse,
2786
+ ne as SigninState,
2787
+ rt as SignoutResponse,
2788
+ M as State,
2789
+ L as User,
2790
+ xt as UserManager,
2791
+ ct as UserManagerSettingsStore,
2792
+ Ct as Version,
2793
+ we as WebStorageStateStore,
2794
+ It as createAuthContext,
2795
+ Tt as useImpersonationCallback,
2796
+ wt as useImpersonationContext
3431
2797
  };