@axa-fr/react-oidc 7.7.0-beta.1074 → 7.7.0

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/README.md CHANGED
@@ -200,6 +200,7 @@ const configuration = {
200
200
  token_renew_mode: String, // Optional, update tokens based on the selected token(s) lifetime: "access_token_or_id_token_invalid" (default), "access_token_invalid", "id_token_invalid"
201
201
  logout_tokens_to_invalidate: Array<string>, // Optional tokens to invalidate during logout, default: ['access_token', 'refresh_token']
202
202
  demonstrating_proof_of_possession: Boolean, // Optional, default is false, if true, the the Demonstrating Proof of Possession will be activated //https://www.rfc-editor.org/rfc/rfc9449.html#name-protected-resource-access
203
+ location: ILOidcLocation, // Optional, default is window.location, you can inject your own location object respecting the ILOidcLocation interface
203
204
  }.isRequired,
204
205
  };
205
206
 
@@ -1,3 +1,4 @@
1
+ import { ILOidcLocation } from '@axa-fr/oidc-client';
1
2
  import React, { ComponentType } from 'react';
2
3
  import { CustomHistory } from './withRouter.js';
3
4
  type OidcRoutesProps = {
@@ -9,6 +10,7 @@ type OidcRoutesProps = {
9
10
  silent_redirect_uri?: string;
10
11
  silent_login_uri?: string;
11
12
  withCustomHistory?: () => CustomHistory;
13
+ location: ILOidcLocation;
12
14
  };
13
15
  declare const _default: React.NamedExoticComponent<React.PropsWithChildren<OidcRoutesProps>>;
14
16
  export default _default;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import ke, { useCallback as kt, useState as S, useEffect as P } from "react";
2
- import { OidcClient as v, getParseQueryStringFromLocation as mt, getPath as z, getFetchDefault as Et, OidcLocation as Tt } from "@axa-fr/oidc-client";
1
+ import ke, { useCallback as mt, useState as A, useEffect as S } from "react";
2
+ import { OidcClient as v, getParseQueryStringFromLocation as Et, getPath as z, OidcLocation as Ye, getFetchDefault as Tt } from "@axa-fr/oidc-client";
3
3
  import { TokenRenewMode as nr } from "@axa-fr/oidc-client";
4
4
  var be = { exports: {} }, G = {};
5
5
  /**
@@ -11,21 +11,21 @@ var be = { exports: {} }, G = {};
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
- var Ye;
14
+ var Me;
15
15
  function wt() {
16
- if (Ye)
16
+ if (Me)
17
17
  return G;
18
- Ye = 1;
18
+ Me = 1;
19
19
  var o = ke, s = Symbol.for("react.element"), r = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, u = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
20
- function h(i, d, g) {
21
- var b, m = {}, C = null, A = null;
22
- g !== void 0 && (C = "" + g), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (A = d.ref);
23
- for (b in d)
24
- a.call(d, b) && !l.hasOwnProperty(b) && (m[b] = d[b]);
20
+ function h(i, f, b) {
21
+ var g, m = {}, R = null, O = null;
22
+ b !== void 0 && (R = "" + b), f.key !== void 0 && (R = "" + f.key), f.ref !== void 0 && (O = f.ref);
23
+ for (g in f)
24
+ a.call(f, g) && !l.hasOwnProperty(g) && (m[g] = f[g]);
25
25
  if (i && i.defaultProps)
26
- for (b in d = i.defaultProps, d)
27
- m[b] === void 0 && (m[b] = d[b]);
28
- return { $$typeof: s, type: i, key: C, ref: A, props: m, _owner: u.current };
26
+ for (g in f = i.defaultProps, f)
27
+ m[g] === void 0 && (m[g] = f[g]);
28
+ return { $$typeof: s, type: i, key: R, ref: O, props: m, _owner: u.current };
29
29
  }
30
30
  return G.Fragment = r, G.jsx = h, G.jsxs = h, G;
31
31
  }
@@ -39,27 +39,27 @@ var H = {};
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
41
  */
42
- var Me;
42
+ var Ve;
43
43
  function Ct() {
44
- return Me || (Me = 1, process.env.NODE_ENV !== "production" && function() {
45
- var o = ke, s = Symbol.for("react.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), i = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), K = Symbol.iterator, re = "@@iterator";
44
+ return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
45
+ var o = ke, s = Symbol.for("react.element"), r = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), h = Symbol.for("react.provider"), i = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), K = Symbol.iterator, X = "@@iterator";
46
46
  function U(e) {
47
47
  if (e === null || typeof e != "object")
48
48
  return null;
49
- var t = K && e[K] || e[re];
49
+ var t = K && e[K] || e[X];
50
50
  return typeof t == "function" ? t : null;
51
51
  }
52
52
  var L = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
53
- function R(e) {
53
+ function C(e) {
54
54
  {
55
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), f = 1; f < t; f++)
56
- n[f - 1] = arguments[f];
55
+ for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), d = 1; d < t; d++)
56
+ n[d - 1] = arguments[d];
57
57
  ne("error", e, n);
58
58
  }
59
59
  }
60
60
  function ne(e, t, n) {
61
61
  {
62
- var f = L.ReactDebugCurrentFrame, y = f.getStackAddendum();
62
+ var d = L.ReactDebugCurrentFrame, y = d.getStackAddendum();
63
63
  y !== "" && (t += "%s", n = n.concat([y]));
64
64
  var k = n.map(function(_) {
65
65
  return String(_);
@@ -70,26 +70,26 @@ function Ct() {
70
70
  var Y = !1, oe = !1, se = !1, ae = !1, ie = !1, F;
71
71
  F = Symbol.for("react.module.reference");
72
72
  function ce(e) {
73
- return !!(typeof e == "string" || typeof e == "function" || e === a || e === l || ie || e === u || e === g || e === b || ae || e === A || Y || oe || se || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === m || e.$$typeof === h || e.$$typeof === i || e.$$typeof === d || // This needs to include all possible module reference object
73
+ return !!(typeof e == "string" || typeof e == "function" || e === a || e === l || ie || e === u || e === b || e === g || ae || e === O || Y || oe || se || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === m || e.$$typeof === h || e.$$typeof === i || e.$$typeof === f || // This needs to include all possible module reference object
74
74
  // types supported by any Flight configuration anywhere since
75
75
  // we don't know which Flight build this will end up being used
76
76
  // with.
77
77
  e.$$typeof === F || e.getModuleId !== void 0));
78
78
  }
79
79
  function le(e, t, n) {
80
- var f = e.displayName;
81
- if (f)
82
- return f;
80
+ var d = e.displayName;
81
+ if (d)
82
+ return d;
83
83
  var y = t.displayName || t.name || "";
84
84
  return y !== "" ? n + "(" + y + ")" : n;
85
85
  }
86
86
  function W(e) {
87
87
  return e.displayName || "Context";
88
88
  }
89
- function O(e) {
89
+ function j(e) {
90
90
  if (e == null)
91
91
  return null;
92
- if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
92
+ if (typeof e.tag == "number" && C("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
93
93
  return e.displayName || e.name || null;
94
94
  if (typeof e == "string")
95
95
  return e;
@@ -102,9 +102,9 @@ function Ct() {
102
102
  return "Profiler";
103
103
  case u:
104
104
  return "StrictMode";
105
- case g:
106
- return "Suspense";
107
105
  case b:
106
+ return "Suspense";
107
+ case g:
108
108
  return "SuspenseList";
109
109
  }
110
110
  if (typeof e == "object")
@@ -115,15 +115,15 @@ function Ct() {
115
115
  case h:
116
116
  var n = e;
117
117
  return W(n._context) + ".Provider";
118
- case d:
118
+ case f:
119
119
  return le(e, e.render, "ForwardRef");
120
120
  case m:
121
- var f = e.displayName || null;
122
- return f !== null ? f : O(e.type) || "Memo";
123
- case C: {
121
+ var d = e.displayName || null;
122
+ return d !== null ? d : j(e.type) || "Memo";
123
+ case R: {
124
124
  var y = e, k = y._payload, _ = y._init;
125
125
  try {
126
- return O(_(k));
126
+ return j(_(k));
127
127
  } catch {
128
128
  return null;
129
129
  }
@@ -135,7 +135,7 @@ function Ct() {
135
135
  function Re() {
136
136
  }
137
137
  Re.__reactDisabledLog = !0;
138
- function Je() {
138
+ function Ke() {
139
139
  {
140
140
  if (N === 0) {
141
141
  M = console.log, T = console.info, D = console.warn, Ee = console.error, Te = console.group, we = console.groupCollapsed, Ce = console.groupEnd;
@@ -158,7 +158,7 @@ function Ct() {
158
158
  N++;
159
159
  }
160
160
  }
161
- function Ke() {
161
+ function Xe() {
162
162
  {
163
163
  if (N--, N === 0) {
164
164
  var e = {
@@ -190,42 +190,42 @@ function Ct() {
190
190
  })
191
191
  });
192
192
  }
193
- N < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
+ N < 0 && C("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
194
194
  }
195
195
  }
196
196
  var ue = L.ReactCurrentDispatcher, de;
197
- function X(e, t, n) {
197
+ function Q(e, t, n) {
198
198
  {
199
199
  if (de === void 0)
200
200
  try {
201
201
  throw Error();
202
202
  } catch (y) {
203
- var f = y.stack.trim().match(/\n( *(at )?)/);
204
- de = f && f[1] || "";
203
+ var d = y.stack.trim().match(/\n( *(at )?)/);
204
+ de = d && d[1] || "";
205
205
  }
206
206
  return `
207
207
  ` + de + e;
208
208
  }
209
209
  }
210
- var fe = !1, Q;
210
+ var fe = !1, Z;
211
211
  {
212
- var Xe = typeof WeakMap == "function" ? WeakMap : Map;
213
- Q = new Xe();
212
+ var Qe = typeof WeakMap == "function" ? WeakMap : Map;
213
+ Z = new Qe();
214
214
  }
215
215
  function xe(e, t) {
216
216
  if (!e || fe)
217
217
  return "";
218
218
  {
219
- var n = Q.get(e);
219
+ var n = Z.get(e);
220
220
  if (n !== void 0)
221
221
  return n;
222
222
  }
223
- var f;
223
+ var d;
224
224
  fe = !0;
225
225
  var y = Error.prepareStackTrace;
226
226
  Error.prepareStackTrace = void 0;
227
227
  var k;
228
- k = ue.current, ue.current = null, Je();
228
+ k = ue.current, ue.current = null, Ke();
229
229
  try {
230
230
  if (t) {
231
231
  var _ = function() {
@@ -239,14 +239,14 @@ function Ct() {
239
239
  try {
240
240
  Reflect.construct(_, []);
241
241
  } catch (I) {
242
- f = I;
242
+ d = I;
243
243
  }
244
244
  Reflect.construct(e, [], _);
245
245
  } else {
246
246
  try {
247
247
  _.call();
248
248
  } catch (I) {
249
- f = I;
249
+ d = I;
250
250
  }
251
251
  e.call(_.prototype);
252
252
  }
@@ -254,14 +254,14 @@ function Ct() {
254
254
  try {
255
255
  throw Error();
256
256
  } catch (I) {
257
- f = I;
257
+ d = I;
258
258
  }
259
259
  e();
260
260
  }
261
261
  } catch (I) {
262
- if (I && f && typeof I.stack == "string") {
262
+ if (I && d && typeof I.stack == "string") {
263
263
  for (var p = I.stack.split(`
264
- `), x = f.stack.split(`
264
+ `), x = d.stack.split(`
265
265
  `), E = p.length - 1, w = x.length - 1; E >= 1 && w >= 0 && p[E] !== x[w]; )
266
266
  w--;
267
267
  for (; E >= 1 && w >= 0; E--, w--)
@@ -269,94 +269,94 @@ function Ct() {
269
269
  if (E !== 1 || w !== 1)
270
270
  do
271
271
  if (E--, w--, w < 0 || p[E] !== x[w]) {
272
- var j = `
272
+ var P = `
273
273
  ` + p[E].replace(" at new ", " at ");
274
- return e.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", e.displayName)), typeof e == "function" && Q.set(e, j), j;
274
+ return e.displayName && P.includes("<anonymous>") && (P = P.replace("<anonymous>", e.displayName)), typeof e == "function" && Z.set(e, P), P;
275
275
  }
276
276
  while (E >= 1 && w >= 0);
277
277
  break;
278
278
  }
279
279
  }
280
280
  } finally {
281
- fe = !1, ue.current = k, Ke(), Error.prepareStackTrace = y;
281
+ fe = !1, ue.current = k, Xe(), Error.prepareStackTrace = y;
282
282
  }
283
- var B = e ? e.displayName || e.name : "", Ue = B ? X(B) : "";
284
- return typeof e == "function" && Q.set(e, Ue), Ue;
283
+ var B = e ? e.displayName || e.name : "", Ue = B ? Q(B) : "";
284
+ return typeof e == "function" && Z.set(e, Ue), Ue;
285
285
  }
286
- function Qe(e, t, n) {
286
+ function Ze(e, t, n) {
287
287
  return xe(e, !1);
288
288
  }
289
- function Ze(e) {
289
+ function et(e) {
290
290
  var t = e.prototype;
291
291
  return !!(t && t.isReactComponent);
292
292
  }
293
- function Z(e, t, n) {
293
+ function ee(e, t, n) {
294
294
  if (e == null)
295
295
  return "";
296
296
  if (typeof e == "function")
297
- return xe(e, Ze(e));
297
+ return xe(e, et(e));
298
298
  if (typeof e == "string")
299
- return X(e);
299
+ return Q(e);
300
300
  switch (e) {
301
- case g:
302
- return X("Suspense");
303
301
  case b:
304
- return X("SuspenseList");
302
+ return Q("Suspense");
303
+ case g:
304
+ return Q("SuspenseList");
305
305
  }
306
306
  if (typeof e == "object")
307
307
  switch (e.$$typeof) {
308
- case d:
309
- return Qe(e.render);
308
+ case f:
309
+ return Ze(e.render);
310
310
  case m:
311
- return Z(e.type, t, n);
312
- case C: {
313
- var f = e, y = f._payload, k = f._init;
311
+ return ee(e.type, t, n);
312
+ case R: {
313
+ var d = e, y = d._payload, k = d._init;
314
314
  try {
315
- return Z(k(y), t, n);
315
+ return ee(k(y), t, n);
316
316
  } catch {
317
317
  }
318
318
  }
319
319
  }
320
320
  return "";
321
321
  }
322
- var ee = Object.prototype.hasOwnProperty, Oe = {}, je = L.ReactDebugCurrentFrame;
323
- function te(e) {
322
+ var te = Object.prototype.hasOwnProperty, Oe = {}, je = L.ReactDebugCurrentFrame;
323
+ function re(e) {
324
324
  if (e) {
325
- var t = e._owner, n = Z(e.type, e._source, t ? t.type : null);
325
+ var t = e._owner, n = ee(e.type, e._source, t ? t.type : null);
326
326
  je.setExtraStackFrame(n);
327
327
  } else
328
328
  je.setExtraStackFrame(null);
329
329
  }
330
- function et(e, t, n, f, y) {
330
+ function tt(e, t, n, d, y) {
331
331
  {
332
- var k = Function.call.bind(ee);
332
+ var k = Function.call.bind(te);
333
333
  for (var _ in e)
334
334
  if (k(e, _)) {
335
335
  var p = void 0;
336
336
  try {
337
337
  if (typeof e[_] != "function") {
338
- var x = Error((f || "React class") + ": " + n + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ var x = Error((d || "React class") + ": " + n + " type `" + _ + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[_] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
339
339
  throw x.name = "Invariant Violation", x;
340
340
  }
341
- p = e[_](t, _, f, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
+ p = e[_](t, _, d, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
342
342
  } catch (E) {
343
343
  p = E;
344
344
  }
345
- p && !(p instanceof Error) && (te(y), R("%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).", f || "React class", n, _, typeof p), te(null)), p instanceof Error && !(p.message in Oe) && (Oe[p.message] = !0, te(y), R("Failed %s type: %s", n, p.message), te(null));
345
+ p && !(p instanceof Error) && (re(y), 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).", d || "React class", n, _, typeof p), re(null)), p instanceof Error && !(p.message in Oe) && (Oe[p.message] = !0, re(y), C("Failed %s type: %s", n, p.message), re(null));
346
346
  }
347
347
  }
348
348
  }
349
- var tt = Array.isArray;
349
+ var rt = Array.isArray;
350
350
  function ve(e) {
351
- return tt(e);
351
+ return rt(e);
352
352
  }
353
- function rt(e) {
353
+ function nt(e) {
354
354
  {
355
355
  var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
356
356
  return n;
357
357
  }
358
358
  }
359
- function nt(e) {
359
+ function ot(e) {
360
360
  try {
361
361
  return Pe(e), !1;
362
362
  } catch {
@@ -367,42 +367,42 @@ function Ct() {
367
367
  return "" + e;
368
368
  }
369
369
  function Se(e) {
370
- if (nt(e))
371
- return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rt(e)), Pe(e);
370
+ if (ot(e))
371
+ return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", nt(e)), Pe(e);
372
372
  }
373
- var q = L.ReactCurrentOwner, ot = {
373
+ var q = L.ReactCurrentOwner, st = {
374
374
  key: !0,
375
375
  ref: !0,
376
376
  __self: !0,
377
377
  __source: !0
378
378
  }, Ae, Fe, he;
379
379
  he = {};
380
- function st(e) {
381
- if (ee.call(e, "ref")) {
380
+ function at(e) {
381
+ if (te.call(e, "ref")) {
382
382
  var t = Object.getOwnPropertyDescriptor(e, "ref").get;
383
383
  if (t && t.isReactWarning)
384
384
  return !1;
385
385
  }
386
386
  return e.ref !== void 0;
387
387
  }
388
- function at(e) {
389
- if (ee.call(e, "key")) {
388
+ function it(e) {
389
+ if (te.call(e, "key")) {
390
390
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
391
391
  if (t && t.isReactWarning)
392
392
  return !1;
393
393
  }
394
394
  return e.key !== void 0;
395
395
  }
396
- function it(e, t) {
396
+ function ct(e, t) {
397
397
  if (typeof e.ref == "string" && q.current && t && q.current.stateNode !== t) {
398
- var n = O(q.current.type);
399
- he[n] || (R('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', O(q.current.type), e.ref), he[n] = !0);
398
+ var n = j(q.current.type);
399
+ he[n] || (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', j(q.current.type), e.ref), he[n] = !0);
400
400
  }
401
401
  }
402
- function ct(e, t) {
402
+ function lt(e, t) {
403
403
  {
404
404
  var n = function() {
405
- Ae || (Ae = !0, R("%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)", t));
405
+ Ae || (Ae = !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)", t));
406
406
  };
407
407
  n.isReactWarning = !0, Object.defineProperty(e, "key", {
408
408
  get: n,
@@ -410,10 +410,10 @@ function Ct() {
410
410
  });
411
411
  }
412
412
  }
413
- function lt(e, t) {
413
+ function ut(e, t) {
414
414
  {
415
415
  var n = function() {
416
- Fe || (Fe = !0, R("%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)", t));
416
+ Fe || (Fe = !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)", t));
417
417
  };
418
418
  n.isReactWarning = !0, Object.defineProperty(e, "ref", {
419
419
  get: n,
@@ -421,7 +421,7 @@ function Ct() {
421
421
  });
422
422
  }
423
423
  }
424
- var ut = function(e, t, n, f, y, k, _) {
424
+ var dt = function(e, t, n, d, y, k, _) {
425
425
  var p = {
426
426
  // This tag allows us to uniquely identify this as a React Element
427
427
  $$typeof: s,
@@ -442,7 +442,7 @@ function Ct() {
442
442
  configurable: !1,
443
443
  enumerable: !1,
444
444
  writable: !1,
445
- value: f
445
+ value: d
446
446
  }), Object.defineProperty(p, "_source", {
447
447
  configurable: !1,
448
448
  enumerable: !1,
@@ -450,12 +450,12 @@ function Ct() {
450
450
  value: y
451
451
  }), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p;
452
452
  };
453
- function dt(e, t, n, f, y) {
453
+ function ft(e, t, n, d, y) {
454
454
  {
455
455
  var k, _ = {}, p = null, x = null;
456
- n !== void 0 && (Se(n), p = "" + n), at(t) && (Se(t.key), p = "" + t.key), st(t) && (x = t.ref, it(t, y));
456
+ n !== void 0 && (Se(n), p = "" + n), it(t) && (Se(t.key), p = "" + t.key), at(t) && (x = t.ref, ct(t, y));
457
457
  for (k in t)
458
- ee.call(t, k) && !ot.hasOwnProperty(k) && (_[k] = t[k]);
458
+ te.call(t, k) && !st.hasOwnProperty(k) && (_[k] = t[k]);
459
459
  if (e && e.defaultProps) {
460
460
  var E = e.defaultProps;
461
461
  for (k in E)
@@ -463,15 +463,15 @@ function Ct() {
463
463
  }
464
464
  if (p || x) {
465
465
  var w = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
466
- p && ct(_, w), x && lt(_, w);
466
+ p && lt(_, w), x && ut(_, w);
467
467
  }
468
- return ut(e, p, x, y, f, q.current, _);
468
+ return dt(e, p, x, y, d, q.current, _);
469
469
  }
470
470
  }
471
471
  var pe = L.ReactCurrentOwner, Ne = L.ReactDebugCurrentFrame;
472
472
  function V(e) {
473
473
  if (e) {
474
- var t = e._owner, n = Z(e.type, e._source, t ? t.type : null);
474
+ var t = e._owner, n = ee(e.type, e._source, t ? t.type : null);
475
475
  Ne.setExtraStackFrame(n);
476
476
  } else
477
477
  Ne.setExtraStackFrame(null);
@@ -484,7 +484,7 @@ function Ct() {
484
484
  function De() {
485
485
  {
486
486
  if (pe.current) {
487
- var e = O(pe.current.type);
487
+ var e = j(pe.current.type);
488
488
  if (e)
489
489
  return `
490
490
 
@@ -493,7 +493,7 @@ Check the render method of \`` + e + "`.";
493
493
  return "";
494
494
  }
495
495
  }
496
- function ft(e) {
496
+ function vt(e) {
497
497
  {
498
498
  if (e !== void 0) {
499
499
  var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
@@ -505,7 +505,7 @@ Check your code at ` + t + ":" + n + ".";
505
505
  }
506
506
  }
507
507
  var Ie = {};
508
- function vt(e) {
508
+ function ht(e) {
509
509
  {
510
510
  var t = De();
511
511
  if (!t) {
@@ -522,12 +522,12 @@ Check the top-level render call using <` + n + ">.");
522
522
  if (!e._store || e._store.validated || e.key != null)
523
523
  return;
524
524
  e._store.validated = !0;
525
- var n = vt(t);
525
+ var n = ht(t);
526
526
  if (Ie[n])
527
527
  return;
528
528
  Ie[n] = !0;
529
- var f = "";
530
- e && e._owner && e._owner !== pe.current && (f = " It was passed a child from " + O(e._owner.type) + "."), V(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, f), V(null);
529
+ var d = "";
530
+ e && e._owner && e._owner !== pe.current && (d = " It was passed a child from " + j(e._owner.type) + "."), V(e), C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, d), V(null);
531
531
  }
532
532
  }
533
533
  function We(e, t) {
@@ -536,8 +536,8 @@ Check the top-level render call using <` + n + ">.");
536
536
  return;
537
537
  if (ve(e))
538
538
  for (var n = 0; n < e.length; n++) {
539
- var f = e[n];
540
- ge(f) && Le(f, t);
539
+ var d = e[n];
540
+ ge(d) && Le(d, t);
541
541
  }
542
542
  else if (ge(e))
543
543
  e._store && (e._store.validated = !0);
@@ -549,7 +549,7 @@ Check the top-level render call using <` + n + ">.");
549
549
  }
550
550
  }
551
551
  }
552
- function ht(e) {
552
+ function pt(e) {
553
553
  {
554
554
  var t = e.type;
555
555
  if (t == null || typeof t == "string")
@@ -557,103 +557,103 @@ Check the top-level render call using <` + n + ">.");
557
557
  var n;
558
558
  if (typeof t == "function")
559
559
  n = t.propTypes;
560
- else if (typeof t == "object" && (t.$$typeof === d || // Note: Memo only checks outer props here.
560
+ else if (typeof t == "object" && (t.$$typeof === f || // Note: Memo only checks outer props here.
561
561
  // Inner props are checked in the reconciler.
562
562
  t.$$typeof === m))
563
563
  n = t.propTypes;
564
564
  else
565
565
  return;
566
566
  if (n) {
567
- var f = O(t);
568
- et(n, e.props, "prop", f, e);
567
+ var d = j(t);
568
+ tt(n, e.props, "prop", d, e);
569
569
  } else if (t.PropTypes !== void 0 && !_e) {
570
570
  _e = !0;
571
- var y = O(t);
572
- R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
571
+ var y = j(t);
572
+ C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", y || "Unknown");
573
573
  }
574
- typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
575
575
  }
576
576
  }
577
- function pt(e) {
577
+ function _t(e) {
578
578
  {
579
579
  for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
580
- var f = t[n];
581
- if (f !== "children" && f !== "key") {
582
- V(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", f), V(null);
580
+ var d = t[n];
581
+ if (d !== "children" && d !== "key") {
582
+ V(e), C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", d), V(null);
583
583
  break;
584
584
  }
585
585
  }
586
- e.ref !== null && (V(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
586
+ e.ref !== null && (V(e), C("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
587
587
  }
588
588
  }
589
- function $e(e, t, n, f, y, k) {
589
+ function $e(e, t, n, d, y, k) {
590
590
  {
591
591
  var _ = ce(e);
592
592
  if (!_) {
593
593
  var p = "";
594
594
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (p += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
595
- var x = ft(y);
595
+ var x = vt(y);
596
596
  x ? p += x : p += De();
597
597
  var E;
598
- e === null ? E = "null" : ve(e) ? E = "array" : e !== void 0 && e.$$typeof === s ? (E = "<" + (O(e.type) || "Unknown") + " />", p = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, p);
598
+ e === null ? E = "null" : ve(e) ? E = "array" : e !== void 0 && e.$$typeof === s ? (E = "<" + (j(e.type) || "Unknown") + " />", p = " Did you accidentally export a JSX literal instead of a component?") : E = typeof e, C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", E, p);
599
599
  }
600
- var w = dt(e, t, n, y, k);
600
+ var w = ft(e, t, n, y, k);
601
601
  if (w == null)
602
602
  return w;
603
603
  if (_) {
604
- var j = t.children;
605
- if (j !== void 0)
606
- if (f)
607
- if (ve(j)) {
608
- for (var B = 0; B < j.length; B++)
609
- We(j[B], e);
610
- Object.freeze && Object.freeze(j);
604
+ var P = t.children;
605
+ if (P !== void 0)
606
+ if (d)
607
+ if (ve(P)) {
608
+ for (var B = 0; B < P.length; B++)
609
+ We(P[B], e);
610
+ Object.freeze && Object.freeze(P);
611
611
  } else
612
- R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
+ 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.");
613
613
  else
614
- We(j, e);
614
+ We(P, e);
615
615
  }
616
- return e === a ? pt(w) : ht(w), w;
616
+ return e === a ? _t(w) : pt(w), w;
617
617
  }
618
618
  }
619
- function _t(e, t, n) {
619
+ function gt(e, t, n) {
620
620
  return $e(e, t, n, !0);
621
621
  }
622
- function gt(e, t, n) {
622
+ function yt(e, t, n) {
623
623
  return $e(e, t, n, !1);
624
624
  }
625
- var yt = gt, bt = _t;
626
- H.Fragment = a, H.jsx = yt, H.jsxs = bt;
625
+ var bt = yt, kt = gt;
626
+ H.Fragment = a, H.jsx = bt, H.jsxs = kt;
627
627
  }()), H;
628
628
  }
629
629
  process.env.NODE_ENV === "production" ? be.exports = wt() : be.exports = Ct();
630
630
  var c = be.exports;
631
- const Be = "default", Rt = (o, s) => async (...r) => {
632
- var C;
631
+ const qe = "default", Rt = (o, s) => async (...r) => {
632
+ var R;
633
633
  const [a, u, ...l] = r, h = u ? { ...u } : { method: "GET" };
634
634
  let i = new Headers();
635
635
  h.headers && (i = h.headers instanceof Headers ? h.headers : new Headers(h.headers));
636
- const d = s(), g = await d.getValidTokenAsync(), b = (C = g == null ? void 0 : g.tokens) == null ? void 0 : C.accessToken;
637
- if (i.has("Accept") || i.set("Accept", "application/json"), b) {
638
- if (d.configuration.demonstrating_proof_of_possession) {
639
- const A = await d.generateDemonstrationOfProofOfPossessionAsync(b, a.toString(), h.method);
640
- i.set("Authorization", `PoP ${b}`), i.set("DPoP", A);
636
+ const f = s(), b = await f.getValidTokenAsync(), g = (R = b == null ? void 0 : b.tokens) == null ? void 0 : R.accessToken;
637
+ if (i.has("Accept") || i.set("Accept", "application/json"), g) {
638
+ if (f.configuration.demonstrating_proof_of_possession) {
639
+ const O = await f.generateDemonstrationOfProofOfPossessionAsync(g, a.toString(), h.method);
640
+ i.set("Authorization", `PoP ${g}`), i.set("DPoP", O);
641
641
  } else
642
- i.set("Authorization", `Bearer ${b}`);
642
+ i.set("Authorization", `Bearer ${g}`);
643
643
  h.credentials || (h.credentials = "same-origin");
644
644
  }
645
645
  const m = { ...h, headers: i };
646
646
  return await o(a, m, ...l);
647
- }, Ht = (o = null, s = Be) => (r) => (a) => {
647
+ }, Ht = (o = null, s = qe) => (r) => (a) => {
648
648
  const { fetch: u } = xt(o || a.fetch, s);
649
649
  return /* @__PURE__ */ c.jsx(r, { ...a, fetch: u });
650
- }, xt = (o = null, s = Be) => {
650
+ }, xt = (o = null, s = qe) => {
651
651
  const r = o || window.fetch, a = v.get;
652
- return { fetch: kt(
652
+ return { fetch: mt(
653
653
  (l, h) => Rt(r, () => a(s))(l, h),
654
654
  [r, s]
655
655
  ) };
656
- }, qe = () => /* @__PURE__ */ c.jsx("div", { className: "oidc-authenticating", children: /* @__PURE__ */ c.jsxs("div", { className: "oidc-authenticating__container", children: [
656
+ }, ze = () => /* @__PURE__ */ c.jsx("div", { className: "oidc-authenticating", children: /* @__PURE__ */ c.jsxs("div", { className: "oidc-authenticating__container", children: [
657
657
  /* @__PURE__ */ c.jsx("h1", { className: "oidc-authenticating__title", children: "Error authentication" }),
658
658
  /* @__PURE__ */ c.jsx("p", { className: "oidc-authenticating__content", children: "An error occurred during authentication." })
659
659
  ] }) }), Ot = () => /* @__PURE__ */ c.jsx("div", { className: "oidc-authenticating", children: /* @__PURE__ */ c.jsxs("div", { className: "oidc-authenticating__container", children: [
@@ -669,26 +669,26 @@ const Be = "default", Rt = (o, s) => async (...r) => {
669
669
  const l = r(), h = u || o.history.state;
670
670
  o.history.replaceState({ key: l, state: h }, null, a), o.dispatchEvent(s("popstate"));
671
671
  }
672
- }), At = () => St(window, Pt(window, document), jt), ze = () => /* @__PURE__ */ c.jsx("div", { className: "oidc-callback", children: /* @__PURE__ */ c.jsxs("div", { className: "oidc-callback__container", children: [
672
+ }), At = () => St(window, Pt(window, document), jt), Ge = () => /* @__PURE__ */ c.jsx("div", { className: "oidc-callback", children: /* @__PURE__ */ c.jsxs("div", { className: "oidc-callback__container", children: [
673
673
  /* @__PURE__ */ c.jsx("h1", { className: "oidc-callback__title", children: "Authentication complete" }),
674
674
  /* @__PURE__ */ c.jsx("p", { className: "oidc-callback__content", children: "You will be redirected to your application." })
675
675
  ] }) }), Ft = ({ callBackError: o, callBackSuccess: s, configurationName: r, withCustomHistory: a }) => {
676
- const [u, l] = S(!1);
677
- P(() => {
678
- let d = !0;
676
+ const [u, l] = A(!1);
677
+ S(() => {
678
+ let f = !0;
679
679
  return (async () => {
680
- const b = v.get;
680
+ const g = v.get;
681
681
  try {
682
- const { callbackPath: m } = await b(r).loginCallbackAsync();
682
+ const { callbackPath: m } = await g(r).loginCallbackAsync();
683
683
  (a ? a() : At()).replaceState(m || "/");
684
684
  } catch (m) {
685
- d && (console.warn(m), l(!0));
685
+ f && (console.warn(m), l(!0));
686
686
  }
687
687
  })(), () => {
688
- d = !1;
688
+ f = !1;
689
689
  };
690
690
  }, []);
691
- const h = o || qe, i = s || ze;
691
+ const h = o || ze, i = s || Ge;
692
692
  return u ? /* @__PURE__ */ c.jsx(h, { configurationName: r }) : /* @__PURE__ */ c.jsx(i, { configurationName: r });
693
693
  }, Nt = () => /* @__PURE__ */ c.jsx("span", { className: "oidc-loading", children: "Loading" }), Dt = () => /* @__PURE__ */ c.jsx("div", { className: "oidc-serviceworker", children: /* @__PURE__ */ c.jsxs("div", { className: "oidc-serviceworker__container", children: [
694
694
  /* @__PURE__ */ c.jsx("h1", { className: "oidc-serviceworker__title", children: "Unable to authenticate on this browser" }),
@@ -696,17 +696,17 @@ const Be = "default", Rt = (o, s) => async (...r) => {
696
696
  ] }) }), It = () => /* @__PURE__ */ c.jsx("div", { className: "oidc-session-lost", children: /* @__PURE__ */ c.jsxs("div", { className: "oidc-session-lost__container", children: [
697
697
  /* @__PURE__ */ c.jsx("h1", { className: "oidc-session-lost__title", children: "Session timed out" }),
698
698
  /* @__PURE__ */ c.jsx("p", { className: "oidc-session-lost__content", children: "Your session has expired. Please re-authenticate." })
699
- ] }) }), Lt = ({ configurationName: o }) => (P(() => {
699
+ ] }) }), Lt = ({ configurationName: o }) => (S(() => {
700
700
  (async () => {
701
701
  const r = v.get;
702
702
  r(o).silentLoginCallbackAsync();
703
703
  })();
704
704
  }, []), /* @__PURE__ */ c.jsx(c.Fragment, {})), Wt = ({ configurationName: o }) => {
705
- const s = mt(window.location.href), r = v.get, a = r(o);
705
+ const s = Et(window.location.href), r = v.get, a = r(o);
706
706
  let u = null;
707
707
  for (const [l, h] of Object.entries(s))
708
708
  l === "state" || l === "scope" || (u === null && (u = {}), u[l] = h);
709
- return P(() => {
709
+ return S(() => {
710
710
  a.tokens || a.loginAsync(null, u, !0, s.scope);
711
711
  }, []), /* @__PURE__ */ c.jsx(c.Fragment, {});
712
712
  }, $t = ({
@@ -717,32 +717,33 @@ const Be = "default", Rt = (o, s) => async (...r) => {
717
717
  silent_login_uri: u,
718
718
  children: l,
719
719
  configurationName: h,
720
- withCustomHistory: i = null
720
+ withCustomHistory: i = null,
721
+ location: f
721
722
  }) => {
722
- const d = window ? z(window.location.href) : "", [g, b] = S(d);
723
- P(() => {
724
- const C = () => b(z(window.location.href));
725
- return C(), window.addEventListener("popstate", C, !1), () => window.removeEventListener("popstate", C, !1);
723
+ const b = window ? z(window.location.href) : "", [g, m] = A(b);
724
+ S(() => {
725
+ const O = () => m(z(window.location.href));
726
+ return O(), window.addEventListener("popstate", O, !1), () => window.removeEventListener("popstate", O, !1);
726
727
  }, []);
727
- const m = z(r);
728
+ const R = z(r);
728
729
  if (a && g === z(a))
729
730
  return /* @__PURE__ */ c.jsx(Lt, { configurationName: h });
730
731
  if (u && g === z(u))
731
732
  return /* @__PURE__ */ c.jsx(Wt, { configurationName: h });
732
733
  switch (g) {
733
- case m:
734
+ case R:
734
735
  return /* @__PURE__ */ c.jsx(Ft, { callBackError: o, callBackSuccess: s, configurationName: h, withCustomHistory: i });
735
736
  default:
736
737
  return /* @__PURE__ */ c.jsx(c.Fragment, { children: l });
737
738
  }
738
- }, Ut = ke.memo($t), Ve = { name: "", data: null }, Yt = ({ loadingComponent: o, children: s, configurationName: r }) => {
739
- const [a, u] = S(!0), l = v.get, h = l(r);
740
- P(() => {
741
- let d = !0;
739
+ }, Ut = ke.memo($t), Be = { name: "", data: null }, Yt = ({ loadingComponent: o, children: s, configurationName: r }) => {
740
+ const [a, u] = A(!0), l = v.get, h = l(r);
741
+ S(() => {
742
+ let f = !0;
742
743
  return h && h.tryKeepExistingSessionAsync().then(() => {
743
- d && u(!1);
744
+ f && u(!1);
744
745
  }), () => {
745
- d = !1;
746
+ f = !1;
746
747
  };
747
748
  }, [r]);
748
749
  const i = o;
@@ -754,50 +755,50 @@ const Be = "default", Rt = (o, s) => async (...r) => {
754
755
  children: o,
755
756
  configuration: s,
756
757
  configurationName: r = "default",
757
- callbackSuccessComponent: a = ze,
758
+ callbackSuccessComponent: a = Ge,
758
759
  authenticatingComponent: u = Ot,
759
760
  loadingComponent: l = Nt,
760
761
  serviceWorkerNotSupportedComponent: h = Dt,
761
- authenticatingErrorComponent: i = qe,
762
- sessionLostComponent: d = It,
763
- onSessionLost: g = null,
764
- onLogoutFromAnotherTab: b = null,
762
+ authenticatingErrorComponent: i = ze,
763
+ sessionLostComponent: f = It,
764
+ onSessionLost: b = null,
765
+ onLogoutFromAnotherTab: g = null,
765
766
  onLogoutFromSameTab: m = null,
766
- withCustomHistory: C = null,
767
- onEvent: A = null,
767
+ withCustomHistory: R = null,
768
+ onEvent: O = null,
768
769
  getFetch: K = null,
769
- location: re = null
770
+ location: X = null
770
771
  }) => {
771
- const U = (N = "default") => v.getOrCreate(K ?? Et, re ?? new Tt())(s, N), [L, R] = S(!0), [ne, Y] = S(Ve), [oe, se] = S("default");
772
- P(() => {
772
+ const U = (N = "default") => v.getOrCreate(K ?? Tt, X ?? new Ye())(s, N), [L, C] = A(!0), [ne, Y] = A(Be), [oe, se] = A("default");
773
+ S(() => {
773
774
  const M = U(r).subscribeEvents((T, D) => {
774
- A && A(r, T, D);
775
+ O && O(r, T, D);
775
776
  });
776
777
  return () => {
777
778
  U(r).removeEventSubscription(M);
778
779
  };
779
- }, [r, A]), P(() => {
780
+ }, [r, O]), S(() => {
780
781
  const M = U(r).subscribeEvents((T, D) => {
781
782
  if (T === v.eventNames.refreshTokensAsync_error || T === v.eventNames.syncTokensAsync_error) {
782
- if (g != null) {
783
- g();
783
+ if (b != null) {
784
+ b();
784
785
  return;
785
786
  }
786
787
  Y({ name: T, data: D });
787
788
  } else if (T === v.eventNames.logout_from_another_tab) {
788
- if (b != null) {
789
- b();
789
+ if (g != null) {
790
+ g();
790
791
  return;
791
792
  }
792
793
  Y({ name: T, data: D });
793
794
  } else
794
795
  T === v.eventNames.logout_from_same_tab ? m != null && m() : T === v.eventNames.loginAsync_begin || T === v.eventNames.loginCallbackAsync_end || T === v.eventNames.loginAsync_error || T === v.eventNames.loginCallbackAsync_error ? Y({ name: T, data: D }) : T === v.eventNames.service_worker_not_supported_by_browser && s.service_worker_only === !0 && Y({ name: T, data: D });
795
796
  });
796
- return se(r), R(!1), () => {
797
- U(r).removeEventSubscription(M), Y(Ve);
797
+ return se(r), C(!1), () => {
798
+ U(r).removeEventSubscription(M), Y(Be);
798
799
  };
799
800
  }, [s, r]);
800
- const ae = d, ie = u, F = l, ce = h, le = i, W = L || oe !== r, O = U(r);
801
+ const ae = f, ie = u, F = l, ce = h, le = i, W = L || oe !== r, j = U(r);
801
802
  switch (ne.name) {
802
803
  case v.eventNames.service_worker_not_supported_by_browser:
803
804
  return /* @__PURE__ */ c.jsx(J, { loadingComponent: F, isLoading: W, configurationName: r, children: /* @__PURE__ */ c.jsx(ce, { configurationName: r }) });
@@ -814,52 +815,53 @@ const Be = "default", Rt = (o, s) => async (...r) => {
814
815
  return /* @__PURE__ */ c.jsx(J, { loadingComponent: F, isLoading: W, configurationName: r, children: /* @__PURE__ */ c.jsx(
815
816
  Ut,
816
817
  {
817
- redirect_uri: O.configuration.redirect_uri,
818
- silent_redirect_uri: O.configuration.silent_redirect_uri,
819
- silent_login_uri: O.configuration.silent_login_uri,
818
+ redirect_uri: j.configuration.redirect_uri,
819
+ silent_redirect_uri: j.configuration.silent_redirect_uri,
820
+ silent_login_uri: j.configuration.silent_login_uri,
820
821
  callbackSuccessComponent: a,
821
822
  callbackErrorComponent: i,
822
823
  authenticatingComponent: u,
823
824
  configurationName: r,
824
- withCustomHistory: C,
825
+ withCustomHistory: R,
826
+ location: X ?? new Ye(),
825
827
  children: /* @__PURE__ */ c.jsx(Yt, { loadingComponent: F, configurationName: r, children: o })
826
828
  }
827
829
  ) });
828
830
  }
829
831
  }, Mt = ({ children: o, callbackPath: s = null, extras: r = null, configurationName: a = "default" }) => {
830
832
  const u = v.get, l = u(a);
831
- return P(() => {
833
+ return S(() => {
832
834
  l.tokens || l.loginAsync(s, r);
833
835
  }, [a, s, r]), l.tokens ? /* @__PURE__ */ c.jsx(c.Fragment, { children: o }) : null;
834
836
  }, Kt = (o, s = null, r = null, a = "default") => (u) => /* @__PURE__ */ c.jsx(Mt, { callbackPath: s, extras: r, configurationName: a, children: /* @__PURE__ */ c.jsx(o, { ...u }) }), me = "default", ye = (o, s) => {
835
837
  let r = !1;
836
838
  return o(s) && (r = o(s).tokens != null), r;
837
839
  }, Xt = (o = me) => {
838
- const s = v.get, [r, a] = S(ye(s, o));
839
- return P(() => {
840
+ const s = v.get, [r, a] = A(ye(s, o));
841
+ return S(() => {
840
842
  let i = !0;
841
- const d = s(o);
843
+ const f = s(o);
842
844
  a(ye(s, o));
843
- const g = d.subscribeEvents((b, m) => {
844
- (b === v.eventNames.logout_from_another_tab || b === v.eventNames.logout_from_same_tab || b === v.eventNames.token_aquired) && i && a(ye(s, o));
845
+ const b = f.subscribeEvents((g, m) => {
846
+ (g === v.eventNames.logout_from_another_tab || g === v.eventNames.logout_from_same_tab || g === v.eventNames.token_aquired) && i && a(ye(s, o));
845
847
  });
846
848
  return () => {
847
- i = !1, d.removeEventSubscription(g);
849
+ i = !1, f.removeEventSubscription(b);
848
850
  };
849
- }, [o]), { login: (i = void 0, d = null, g = !1) => s(o).loginAsync(i, d, !1, void 0, g), logout: (i = void 0, d = null) => s(o).logoutAsync(i, d), renewTokens: async (i = null) => {
850
- const d = await s(o).renewTokensAsync(i);
851
+ }, [o]), { login: (i = void 0, f = null, b = !1) => s(o).loginAsync(i, f, !1, void 0, b), logout: (i = void 0, f = null) => s(o).logoutAsync(i, f), renewTokens: async (i = null) => {
852
+ const f = await s(o).renewTokensAsync(i);
851
853
  return {
852
854
  // @ts-ignore
853
- accessToken: d.accessToken,
855
+ accessToken: f.accessToken,
854
856
  // @ts-ignore
855
- accessTokenPayload: d.accessTokenPayload,
857
+ accessTokenPayload: f.accessTokenPayload,
856
858
  // @ts-ignore
857
- idToken: d.idToken,
859
+ idToken: f.idToken,
858
860
  // @ts-ignore
859
- idTokenPayload: d.idTokenPayload
861
+ idTokenPayload: f.idTokenPayload
860
862
  };
861
863
  }, isAuthenticated: r };
862
- }, Ge = { accessToken: null, accessTokenPayload: null }, Vt = (o) => {
864
+ }, He = { accessToken: null, accessTokenPayload: null }, Vt = (o) => {
863
865
  const s = v.get, r = s(o);
864
866
  if (r.tokens) {
865
867
  const a = r.tokens;
@@ -868,46 +870,46 @@ const Be = "default", Rt = (o, s) => async (...r) => {
868
870
  accessTokenPayload: a.accessTokenPayload
869
871
  };
870
872
  }
871
- return Ge;
873
+ return He;
872
874
  }, Qt = (o = me) => {
873
- const s = v.get, [r, a] = S(Vt(o));
874
- return P(() => {
875
+ const s = v.get, [r, a] = A(Vt(o));
876
+ return S(() => {
875
877
  let u = !0;
876
878
  const l = s(o);
877
879
  if (l.tokens) {
878
880
  const i = l.tokens;
879
881
  a({ accessToken: i.accessToken, accessTokenPayload: i.accessTokenPayload });
880
882
  }
881
- const h = l.subscribeEvents((i, d) => {
883
+ const h = l.subscribeEvents((i, f) => {
882
884
  if ((i === v.eventNames.token_renewed || i === v.eventNames.token_aquired || i === v.eventNames.logout_from_another_tab || i === v.eventNames.logout_from_same_tab || i === v.eventNames.refreshTokensAsync_error || i === v.eventNames.syncTokensAsync_error) && u) {
883
- const g = l.tokens;
884
- a(g != null ? { accessToken: g.accessToken, accessTokenPayload: g.accessTokenPayload } : Ge);
885
+ const b = l.tokens;
886
+ a(b != null ? { accessToken: b.accessToken, accessTokenPayload: b.accessTokenPayload } : He);
885
887
  }
886
888
  });
887
889
  return () => {
888
890
  u = !1, l.removeEventSubscription(h);
889
891
  };
890
892
  }, [o]), r;
891
- }, He = { idToken: null, idTokenPayload: null }, Bt = (o) => {
893
+ }, Je = { idToken: null, idTokenPayload: null }, Bt = (o) => {
892
894
  const s = v.get, r = s(o);
893
895
  if (r.tokens) {
894
896
  const a = r.tokens;
895
897
  return { idToken: a.idToken, idTokenPayload: a.idTokenPayload };
896
898
  }
897
- return He;
899
+ return Je;
898
900
  }, Zt = (o = me) => {
899
- const s = v.get, [r, a] = S(Bt(o));
900
- return P(() => {
901
+ const s = v.get, [r, a] = A(Bt(o));
902
+ return S(() => {
901
903
  let u = !0;
902
904
  const l = s(o);
903
905
  if (l.tokens) {
904
906
  const i = l.tokens;
905
907
  a({ idToken: i.idToken, idTokenPayload: i.idTokenPayload });
906
908
  }
907
- const h = l.subscribeEvents((i, d) => {
909
+ const h = l.subscribeEvents((i, f) => {
908
910
  if ((i === v.eventNames.token_renewed || i === v.eventNames.token_aquired || i === v.eventNames.logout_from_another_tab || i === v.eventNames.logout_from_same_tab || i === v.eventNames.refreshTokensAsync_error || i === v.eventNames.syncTokensAsync_error) && u) {
909
- const g = l.tokens;
910
- a(g != null ? { idToken: g.idToken, idTokenPayload: g.idTokenPayload } : He);
911
+ const b = l.tokens;
912
+ a(b != null ? { idToken: b.idToken, idTokenPayload: b.idTokenPayload } : Je);
911
913
  }
912
914
  });
913
915
  return () => {
@@ -917,12 +919,12 @@ const Be = "default", Rt = (o, s) => async (...r) => {
917
919
  };
918
920
  var qt = /* @__PURE__ */ ((o) => (o.Unauthenticated = "Unauthenticated", o.Loading = "Loading user", o.Loaded = "User loaded", o.LoadingError = "Error loading user", o))(qt || {});
919
921
  const er = (o = "default") => {
920
- const [s, r] = S({
922
+ const [s, r] = A({
921
923
  user: null,
922
924
  status: "Unauthenticated"
923
925
  /* Unauthenticated */
924
- }), [a, u] = S(""), l = v.get(o);
925
- P(() => {
926
+ }), [a, u] = A(""), l = v.get(o);
927
+ S(() => {
926
928
  let i = !0;
927
929
  if (l && l.tokens) {
928
930
  r({
@@ -930,10 +932,10 @@ const er = (o = "default") => {
930
932
  status: "Loading user"
931
933
  /* Loading */
932
934
  });
933
- const d = a !== "";
934
- l.userInfoAsync(d).then((g) => {
935
+ const f = a !== "";
936
+ l.userInfoAsync(f).then((b) => {
935
937
  i && r({
936
- user: g,
938
+ user: b,
937
939
  status: "User loaded"
938
940
  /* Loaded */
939
941
  });
@@ -1,4 +1,4 @@
1
- (function(R,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("@axa-fr/oidc-client")):typeof define=="function"&&define.amd?define(["exports","react","@axa-fr/oidc-client"],y):(R=typeof globalThis<"u"?globalThis:R||self,y(R["react-oidc"]={},R.React,R.oidcClient))})(this,function(R,y,l){"use strict";var te={exports:{}},G={};/**
1
+ (function(R,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@axa-fr/oidc-client")):typeof define=="function"&&define.amd?define(["exports","react","@axa-fr/oidc-client"],g):(R=typeof globalThis<"u"?globalThis:R||self,g(R["react-oidc"]={},R.React,R.oidcClient))})(this,function(R,g,l){"use strict";var ne={exports:{}},G={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var ke;function Qe(){if(ke)return G;ke=1;var s=y,o=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function h(i,f,g){var k,O={},S=null,A=null;g!==void 0&&(S=""+g),f.key!==void 0&&(S=""+f.key),f.ref!==void 0&&(A=f.ref);for(k in f)a.call(f,k)&&!u.hasOwnProperty(k)&&(O[k]=f[k]);if(i&&i.defaultProps)for(k in f=i.defaultProps,f)O[k]===void 0&&(O[k]=f[k]);return{$$typeof:o,type:i,key:S,ref:A,props:O,_owner:d.current}}return G.Fragment=n,G.jsx=h,G.jsxs=h,G}var H={};/**
9
+ */var ke;function Qe(){if(ke)return G;ke=1;var s=g,o=Symbol.for("react.element"),n=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function h(c,v,k){var y,O={},j=null,C=null;k!==void 0&&(j=""+k),v.key!==void 0&&(j=""+v.key),v.ref!==void 0&&(C=v.ref);for(y in v)a.call(v,y)&&!u.hasOwnProperty(y)&&(O[y]=v[y]);if(c&&c.defaultProps)for(y in v=c.defaultProps,v)O[y]===void 0&&(O[y]=v[y]);return{$$typeof:o,type:c,key:j,ref:C,props:O,_owner:d.current}}return G.Fragment=n,G.jsx=h,G.jsxs=h,G}var H={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,14 +14,14 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var me;function Ze(){return me||(me=1,process.env.NODE_ENV!=="production"&&function(){var s=y,o=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),i=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),X=Symbol.iterator,se="@@iterator";function M(e){if(e===null||typeof e!="object")return null;var t=X&&e[X]||e[se];return typeof t=="function"?t:null}var L=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),v=1;v<t;v++)r[v-1]=arguments[v];oe("error",e,r)}}function oe(e,t,r){{var v=L.ReactDebugCurrentFrame,b=v.getStackAddendum();b!==""&&(t+="%s",r=r.concat([b]));var m=r.map(function(_){return String(_)});m.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,m)}}var Y=!1,ae=!1,ie=!1,ce=!1,le=!1,F;F=Symbol.for("react.module.reference");function ue(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===u||le||e===d||e===g||e===k||ce||e===A||Y||ae||ie||typeof e=="object"&&e!==null&&(e.$$typeof===S||e.$$typeof===O||e.$$typeof===h||e.$$typeof===i||e.$$typeof===f||e.$$typeof===F||e.getModuleId!==void 0))}function de(e,t,r){var v=e.displayName;if(v)return v;var b=t.displayName||t.name||"";return b!==""?r+"("+b+")":r}function U(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case n:return"Portal";case u:return"Profiler";case d:return"StrictMode";case g:return"Suspense";case k:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case i:var t=e;return U(t)+".Consumer";case h:var r=e;return U(r._context)+".Provider";case f:return de(e,e.render,"ForwardRef");case O:var v=e.displayName||null;return v!==null?v:C(e.type)||"Memo";case S:{var b=e,m=b._payload,_=b._init;try{return C(_(m))}catch{return null}}}return null}var W=Object.assign,N=0,V,T,D,xe,Ae,Fe,Ne;function De(){}De.__reactDisabledLog=!0;function Ot(){{if(N===0){V=console.log,T=console.info,D=console.warn,xe=console.error,Ae=console.group,Fe=console.groupCollapsed,Ne=console.groupEnd;var e={configurable:!0,enumerable:!0,value:De,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Et(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:V}),info:W({},e,{value:T}),warn:W({},e,{value:D}),error:W({},e,{value:xe}),group:W({},e,{value:Ae}),groupCollapsed:W({},e,{value:Fe}),groupEnd:W({},e,{value:Ne})})}N<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=L.ReactCurrentDispatcher,ve;function Q(e,t,r){{if(ve===void 0)try{throw Error()}catch(b){var v=b.stack.trim().match(/\n( *(at )?)/);ve=v&&v[1]||""}return`
18
- `+ve+e}}var he=!1,Z;{var Tt=typeof WeakMap=="function"?WeakMap:Map;Z=new Tt}function Ie(e,t){if(!e||he)return"";{var r=Z.get(e);if(r!==void 0)return r}var v;he=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=fe.current,fe.current=null,Ot();try{if(t){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(I){v=I}Reflect.construct(e,[],_)}else{try{_.call()}catch(I){v=I}e.call(_.prototype)}}else{try{throw Error()}catch(I){v=I}e()}}catch(I){if(I&&v&&typeof I.stack=="string"){for(var p=I.stack.split(`
19
- `),P=v.stack.split(`
20
- `),E=p.length-1,w=P.length-1;E>=1&&w>=0&&p[E]!==P[w];)w--;for(;E>=1&&w>=0;E--,w--)if(p[E]!==P[w]){if(E!==1||w!==1)do if(E--,w--,w<0||p[E]!==P[w]){var x=`
21
- `+p[E].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,x),x}while(E>=1&&w>=0);break}}}finally{he=!1,fe.current=m,Et(),Error.prepareStackTrace=b}var z=e?e.displayName||e.name:"",Xe=z?Q(z):"";return typeof e=="function"&&Z.set(e,Xe),Xe}function wt(e,t,r){return Ie(e,!1)}function Rt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function q(e,t,r){if(e==null)return"";if(typeof e=="function")return Ie(e,Rt(e));if(typeof e=="string")return Q(e);switch(e){case g:return Q("Suspense");case k:return Q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return wt(e.render);case O:return q(e.type,t,r);case S:{var v=e,b=v._payload,m=v._init;try{return q(m(b),t,r)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,Le={},Ue=L.ReactDebugCurrentFrame;function ee(e){if(e){var t=e._owner,r=q(e.type,e._source,t?t.type:null);Ue.setExtraStackFrame(r)}else Ue.setExtraStackFrame(null)}function St(e,t,r,v,b){{var m=Function.call.bind($);for(var _ in e)if(m(e,_)){var p=void 0;try{if(typeof e[_]!="function"){var P=Error((v||"React class")+": "+r+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}p=e[_](t,_,v,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){p=E}p&&!(p instanceof Error)&&(ee(b),j("%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).",v||"React class",r,_,typeof p),ee(null)),p instanceof Error&&!(p.message in Le)&&(Le[p.message]=!0,ee(b),j("Failed %s type: %s",r,p.message),ee(null))}}}var jt=Array.isArray;function pe(e){return jt(e)}function Pt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function Ct(e){try{return We(e),!1}catch{return!0}}function We(e){return""+e}function Me(e){if(Ct(e))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(e)),We(e)}var K=L.ReactCurrentOwner,xt={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ve,_e;_e={};function At(e){if($.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ft(e){if($.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Nt(e,t){if(typeof e.ref=="string"&&K.current&&t&&K.current.stateNode!==t){var r=C(K.current.type);_e[r]||(j('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',C(K.current.type),e.ref),_e[r]=!0)}}function Dt(e,t){{var r=function(){Ye||(Ye=!0,j("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function It(e,t){{var r=function(){Ve||(Ve=!0,j("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var Lt=function(e,t,r,v,b,m,_){var p={$$typeof:o,type:e,key:t,ref:r,props:_,_owner:m};return p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(p,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(p,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p};function Ut(e,t,r,v,b){{var m,_={},p=null,P=null;r!==void 0&&(Me(r),p=""+r),Ft(t)&&(Me(t.key),p=""+t.key),At(t)&&(P=t.ref,Nt(t,b));for(m in t)$.call(t,m)&&!xt.hasOwnProperty(m)&&(_[m]=t[m]);if(e&&e.defaultProps){var E=e.defaultProps;for(m in E)_[m]===void 0&&(_[m]=E[m])}if(p||P){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;p&&Dt(_,w),P&&It(_,w)}return Lt(e,p,P,b,v,K.current,_)}}var ge=L.ReactCurrentOwner,Be=L.ReactDebugCurrentFrame;function B(e){if(e){var t=e._owner,r=q(e.type,e._source,t?t.type:null);Be.setExtraStackFrame(r)}else Be.setExtraStackFrame(null)}var ye;ye=!1;function be(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ze(){{if(ge.current){var e=C(ge.current.type);if(e)return`
17
+ */var me;function Ze(){return me||(me=1,process.env.NODE_ENV!=="production"&&function(){var s=g,o=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),c=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),C=Symbol.for("react.offscreen"),X=Symbol.iterator,Q="@@iterator";function M(e){if(e===null||typeof e!="object")return null;var t=X&&e[X]||e[Q];return typeof t=="function"?t:null}var L=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),f=1;f<t;f++)r[f-1]=arguments[f];oe("error",e,r)}}function oe(e,t,r){{var f=L.ReactDebugCurrentFrame,b=f.getStackAddendum();b!==""&&(t+="%s",r=r.concat([b]));var m=r.map(function(_){return String(_)});m.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,m)}}var Y=!1,ae=!1,ce=!1,ie=!1,le=!1,F;F=Symbol.for("react.module.reference");function ue(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===u||le||e===d||e===k||e===y||ie||e===C||Y||ae||ce||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===O||e.$$typeof===h||e.$$typeof===c||e.$$typeof===v||e.$$typeof===F||e.getModuleId!==void 0))}function de(e,t,r){var f=e.displayName;if(f)return f;var b=t.displayName||t.name||"";return b!==""?r+"("+b+")":r}function U(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case n:return"Portal";case u:return"Profiler";case d:return"StrictMode";case k:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var t=e;return U(t)+".Consumer";case h:var r=e;return U(r._context)+".Provider";case v:return de(e,e.render,"ForwardRef");case O:var f=e.displayName||null;return f!==null?f:x(e.type)||"Memo";case j:{var b=e,m=b._payload,_=b._init;try{return x(_(m))}catch{return null}}}return null}var W=Object.assign,N=0,V,T,D,xe,Ae,Fe,Ne;function De(){}De.__reactDisabledLog=!0;function Ot(){{if(N===0){V=console.log,T=console.info,D=console.warn,xe=console.error,Ae=console.group,Fe=console.groupCollapsed,Ne=console.groupEnd;var e={configurable:!0,enumerable:!0,value:De,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}N++}}function Et(){{if(N--,N===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:V}),info:W({},e,{value:T}),warn:W({},e,{value:D}),error:W({},e,{value:xe}),group:W({},e,{value:Ae}),groupCollapsed:W({},e,{value:Fe}),groupEnd:W({},e,{value:Ne})})}N<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=L.ReactCurrentDispatcher,ve;function Z(e,t,r){{if(ve===void 0)try{throw Error()}catch(b){var f=b.stack.trim().match(/\n( *(at )?)/);ve=f&&f[1]||""}return`
18
+ `+ve+e}}var he=!1,q;{var Tt=typeof WeakMap=="function"?WeakMap:Map;q=new Tt}function Ie(e,t){if(!e||he)return"";{var r=q.get(e);if(r!==void 0)return r}var f;he=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=fe.current,fe.current=null,Ot();try{if(t){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(I){f=I}Reflect.construct(e,[],_)}else{try{_.call()}catch(I){f=I}e.call(_.prototype)}}else{try{throw Error()}catch(I){f=I}e()}}catch(I){if(I&&f&&typeof I.stack=="string"){for(var p=I.stack.split(`
19
+ `),P=f.stack.split(`
20
+ `),E=p.length-1,w=P.length-1;E>=1&&w>=0&&p[E]!==P[w];)w--;for(;E>=1&&w>=0;E--,w--)if(p[E]!==P[w]){if(E!==1||w!==1)do if(E--,w--,w<0||p[E]!==P[w]){var A=`
21
+ `+p[E].replace(" at new "," at ");return e.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,A),A}while(E>=1&&w>=0);break}}}finally{he=!1,fe.current=m,Et(),Error.prepareStackTrace=b}var z=e?e.displayName||e.name:"",Xe=z?Z(z):"";return typeof e=="function"&&q.set(e,Xe),Xe}function wt(e,t,r){return Ie(e,!1)}function Rt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function $(e,t,r){if(e==null)return"";if(typeof e=="function")return Ie(e,Rt(e));if(typeof e=="string")return Z(e);switch(e){case k:return Z("Suspense");case y:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return wt(e.render);case O:return $(e.type,t,r);case j:{var f=e,b=f._payload,m=f._init;try{return $(m(b),t,r)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,Le={},Ue=L.ReactDebugCurrentFrame;function te(e){if(e){var t=e._owner,r=$(e.type,e._source,t?t.type:null);Ue.setExtraStackFrame(r)}else Ue.setExtraStackFrame(null)}function St(e,t,r,f,b){{var m=Function.call.bind(ee);for(var _ in e)if(m(e,_)){var p=void 0;try{if(typeof e[_]!="function"){var P=Error((f||"React class")+": "+r+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}p=e[_](t,_,f,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){p=E}p&&!(p instanceof Error)&&(te(b),S("%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).",f||"React class",r,_,typeof p),te(null)),p instanceof Error&&!(p.message in Le)&&(Le[p.message]=!0,te(b),S("Failed %s type: %s",r,p.message),te(null))}}}var jt=Array.isArray;function pe(e){return jt(e)}function Pt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function Ct(e){try{return We(e),!1}catch{return!0}}function We(e){return""+e}function Me(e){if(Ct(e))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(e)),We(e)}var K=L.ReactCurrentOwner,xt={key:!0,ref:!0,__self:!0,__source:!0},Ye,Ve,_e;_e={};function At(e){if(ee.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ft(e){if(ee.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Nt(e,t){if(typeof e.ref=="string"&&K.current&&t&&K.current.stateNode!==t){var r=x(K.current.type);_e[r]||(S('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',x(K.current.type),e.ref),_e[r]=!0)}}function Dt(e,t){{var r=function(){Ye||(Ye=!0,S("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function It(e,t){{var r=function(){Ve||(Ve=!0,S("%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)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var Lt=function(e,t,r,f,b,m,_){var p={$$typeof:o,type:e,key:t,ref:r,props:_,_owner:m};return p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(p,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(p,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p};function Ut(e,t,r,f,b){{var m,_={},p=null,P=null;r!==void 0&&(Me(r),p=""+r),Ft(t)&&(Me(t.key),p=""+t.key),At(t)&&(P=t.ref,Nt(t,b));for(m in t)ee.call(t,m)&&!xt.hasOwnProperty(m)&&(_[m]=t[m]);if(e&&e.defaultProps){var E=e.defaultProps;for(m in E)_[m]===void 0&&(_[m]=E[m])}if(p||P){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;p&&Dt(_,w),P&&It(_,w)}return Lt(e,p,P,b,f,K.current,_)}}var ge=L.ReactCurrentOwner,Be=L.ReactDebugCurrentFrame;function B(e){if(e){var t=e._owner,r=$(e.type,e._source,t?t.type:null);Be.setExtraStackFrame(r)}else Be.setExtraStackFrame(null)}var ye;ye=!1;function be(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ze(){{if(ge.current){var e=x(ge.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function Wt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return`
24
24
 
25
25
  Check your code at `+t+":"+r+"."}return""}}var Ge={};function Mt(e){{var t=ze();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
26
26
 
27
- Check the top-level render call using <`+r+">.")}return t}}function He(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Mt(t);if(Ge[r])return;Ge[r]=!0;var v="";e&&e._owner&&e._owner!==ge.current&&(v=" It was passed a child from "+C(e._owner.type)+"."),B(e),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,v),B(null)}}function Je(e,t){{if(typeof e!="object")return;if(pe(e))for(var r=0;r<e.length;r++){var v=e[r];be(v)&&He(v,t)}else if(be(e))e._store&&(e._store.validated=!0);else if(e){var b=M(e);if(typeof b=="function"&&b!==e.entries)for(var m=b.call(e),_;!(_=m.next()).done;)be(_.value)&&He(_.value,t)}}}function Yt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===f||t.$$typeof===O))r=t.propTypes;else return;if(r){var v=C(t);St(r,e.props,"prop",v,e)}else if(t.PropTypes!==void 0&&!ye){ye=!0;var b=C(t);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var v=t[r];if(v!=="children"&&v!=="key"){B(e),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),B(null);break}}e.ref!==null&&(B(e),j("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}function Ke(e,t,r,v,b,m){{var _=ue(e);if(!_){var p="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(p+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var P=Wt(b);P?p+=P:p+=ze();var E;e===null?E="null":pe(e)?E="array":e!==void 0&&e.$$typeof===o?(E="<"+(C(e.type)||"Unknown")+" />",p=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,p)}var w=Ut(e,t,r,b,m);if(w==null)return w;if(_){var x=t.children;if(x!==void 0)if(v)if(pe(x)){for(var z=0;z<x.length;z++)Je(x[z],e);Object.freeze&&Object.freeze(x)}else j("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Je(x,e)}return e===a?Vt(w):Yt(w),w}}function Bt(e,t,r){return Ke(e,t,r,!0)}function zt(e,t,r){return Ke(e,t,r,!1)}var Gt=zt,Ht=Bt;H.Fragment=a,H.jsx=Gt,H.jsxs=Ht}()),H}process.env.NODE_ENV==="production"?te.exports=Qe():te.exports=Ze();var c=te.exports;const Oe="default",qe=(s,o)=>async(...n)=>{var S;const[a,d,...u]=n,h=d?{...d}:{method:"GET"};let i=new Headers;h.headers&&(i=h.headers instanceof Headers?h.headers:new Headers(h.headers));const f=o(),g=await f.getValidTokenAsync(),k=(S=g==null?void 0:g.tokens)==null?void 0:S.accessToken;if(i.has("Accept")||i.set("Accept","application/json"),k){if(f.configuration.demonstrating_proof_of_possession){const A=await f.generateDemonstrationOfProofOfPossessionAsync(k,a.toString(),h.method);i.set("Authorization",`PoP ${k}`),i.set("DPoP",A)}else i.set("Authorization",`Bearer ${k}`);h.credentials||(h.credentials="same-origin")}const O={...h,headers:i};return await s(a,O,...u)},$e=(s=null,o=Oe)=>n=>a=>{const{fetch:d}=Ee(s||a.fetch,o);return c.jsx(n,{...a,fetch:d})},Ee=(s=null,o=Oe)=>{const n=s||window.fetch,a=l.OidcClient.get;return{fetch:y.useCallback((u,h)=>qe(n,()=>a(o))(u,h),[n,o])}},Te=()=>c.jsx("div",{className:"oidc-authenticating",children:c.jsxs("div",{className:"oidc-authenticating__container",children:[c.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),c.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),et=()=>c.jsx("div",{className:"oidc-authenticating",children:c.jsxs("div",{className:"oidc-authenticating__container",children:[c.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),c.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),tt=()=>Math.random().toString(36).substr(2,6),nt=(s,o)=>(n,a)=>{if(typeof s.CustomEvent=="function")return new s.CustomEvent(n,a);const d=a||{bubbles:!1,cancelable:!1,detail:void 0},u=o.createEvent("CustomEvent");return u.initCustomEvent(n,d.bubbles,d.cancelable,d.detail),u.prototype=s.Event.prototype,u},rt=(s,o,n)=>({replaceState:(a,d)=>{const u=n(),h=d||s.history.state;s.history.replaceState({key:u,state:h},null,a),s.dispatchEvent(o("popstate"))}}),st=()=>rt(window,nt(window,document),tt),we=()=>c.jsx("div",{className:"oidc-callback",children:c.jsxs("div",{className:"oidc-callback__container",children:[c.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),c.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),ot=({callBackError:s,callBackSuccess:o,configurationName:n,withCustomHistory:a})=>{const[d,u]=y.useState(!1);y.useEffect(()=>{let f=!0;return(async()=>{const k=l.OidcClient.get;try{const{callbackPath:O}=await k(n).loginCallbackAsync();(a?a():st()).replaceState(O||"/")}catch(O){f&&(console.warn(O),u(!0))}})(),()=>{f=!1}},[]);const h=s||Te,i=o||we;return d?c.jsx(h,{configurationName:n}):c.jsx(i,{configurationName:n})},at=()=>c.jsx("span",{className:"oidc-loading",children:"Loading"}),it=()=>c.jsx("div",{className:"oidc-serviceworker",children:c.jsxs("div",{className:"oidc-serviceworker__container",children:[c.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),c.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),ct=()=>c.jsx("div",{className:"oidc-session-lost",children:c.jsxs("div",{className:"oidc-session-lost__container",children:[c.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),c.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),lt=({configurationName:s})=>(y.useEffect(()=>{(async()=>{const n=l.OidcClient.get;n(s).silentLoginCallbackAsync()})()},[]),c.jsx(c.Fragment,{})),ut=({configurationName:s})=>{const o=l.getParseQueryStringFromLocation(window.location.href),n=l.OidcClient.get,a=n(s);let d=null;for(const[u,h]of Object.entries(o))u==="state"||u==="scope"||(d===null&&(d={}),d[u]=h);return y.useEffect(()=>{a.tokens||a.loginAsync(null,d,!0,o.scope)},[]),c.jsx(c.Fragment,{})},dt=({callbackErrorComponent:s,callbackSuccessComponent:o,redirect_uri:n,silent_redirect_uri:a,silent_login_uri:d,children:u,configurationName:h,withCustomHistory:i=null})=>{const f=window?l.getPath(window.location.href):"",[g,k]=y.useState(f);y.useEffect(()=>{const S=()=>k(l.getPath(window.location.href));return S(),window.addEventListener("popstate",S,!1),()=>window.removeEventListener("popstate",S,!1)},[]);const O=l.getPath(n);if(a&&g===l.getPath(a))return c.jsx(lt,{configurationName:h});if(d&&g===l.getPath(d))return c.jsx(ut,{configurationName:h});switch(g){case O:return c.jsx(ot,{callBackError:s,callBackSuccess:o,configurationName:h,withCustomHistory:i});default:return c.jsx(c.Fragment,{children:u})}},ft=y.memo(dt),Re={name:"",data:null},vt=({loadingComponent:s,children:o,configurationName:n})=>{const[a,d]=y.useState(!0),u=l.OidcClient.get,h=u(n);y.useEffect(()=>{let f=!0;return h&&h.tryKeepExistingSessionAsync().then(()=>{f&&d(!1)}),()=>{f=!1}},[n]);const i=s;return c.jsx(c.Fragment,{children:a?c.jsx(i,{configurationName:n}):c.jsx(c.Fragment,{children:o})})},J=({isLoading:s,loadingComponent:o,children:n,configurationName:a})=>{const d=o;return s?c.jsx(d,{configurationName:a,children:n}):c.jsx(c.Fragment,{children:n})},ht=({children:s,configuration:o,configurationName:n="default",callbackSuccessComponent:a=we,authenticatingComponent:d=et,loadingComponent:u=at,serviceWorkerNotSupportedComponent:h=it,authenticatingErrorComponent:i=Te,sessionLostComponent:f=ct,onSessionLost:g=null,onLogoutFromAnotherTab:k=null,onLogoutFromSameTab:O=null,withCustomHistory:S=null,onEvent:A=null,getFetch:X=null,location:se=null})=>{const M=(N="default")=>l.OidcClient.getOrCreate(X??l.getFetchDefault,se??new l.OidcLocation)(o,N),[L,j]=y.useState(!0),[oe,Y]=y.useState(Re),[ae,ie]=y.useState("default");y.useEffect(()=>{const V=M(n).subscribeEvents((T,D)=>{A&&A(n,T,D)});return()=>{M(n).removeEventSubscription(V)}},[n,A]),y.useEffect(()=>{const V=M(n).subscribeEvents((T,D)=>{if(T===l.OidcClient.eventNames.refreshTokensAsync_error||T===l.OidcClient.eventNames.syncTokensAsync_error){if(g!=null){g();return}Y({name:T,data:D})}else if(T===l.OidcClient.eventNames.logout_from_another_tab){if(k!=null){k();return}Y({name:T,data:D})}else T===l.OidcClient.eventNames.logout_from_same_tab?O!=null&&O():T===l.OidcClient.eventNames.loginAsync_begin||T===l.OidcClient.eventNames.loginCallbackAsync_end||T===l.OidcClient.eventNames.loginAsync_error||T===l.OidcClient.eventNames.loginCallbackAsync_error?Y({name:T,data:D}):T===l.OidcClient.eventNames.service_worker_not_supported_by_browser&&o.service_worker_only===!0&&Y({name:T,data:D})});return ie(n),j(!1),()=>{M(n).removeEventSubscription(V),Y(Re)}},[o,n]);const ce=f,le=d,F=u,ue=h,de=i,U=L||ae!==n,C=M(n);switch(oe.name){case l.OidcClient.eventNames.service_worker_not_supported_by_browser:return c.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:c.jsx(ue,{configurationName:n})});case l.OidcClient.eventNames.loginAsync_begin:return c.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:c.jsx(le,{configurationName:n})});case l.OidcClient.eventNames.loginAsync_error:case l.OidcClient.eventNames.loginCallbackAsync_error:return c.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:c.jsx(de,{configurationName:n})});case l.OidcClient.eventNames.refreshTokensAsync_error:case l.OidcClient.eventNames.syncTokensAsync_error:case l.OidcClient.eventNames.logout_from_another_tab:return c.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:c.jsx(ce,{configurationName:n})});default:return c.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:c.jsx(ft,{redirect_uri:C.configuration.redirect_uri,silent_redirect_uri:C.configuration.silent_redirect_uri,silent_login_uri:C.configuration.silent_login_uri,callbackSuccessComponent:a,callbackErrorComponent:i,authenticatingComponent:d,configurationName:n,withCustomHistory:S,children:c.jsx(vt,{loadingComponent:F,configurationName:n,children:s})})})}},Se=({children:s,callbackPath:o=null,extras:n=null,configurationName:a="default"})=>{const d=l.OidcClient.get,u=d(a);return y.useEffect(()=>{u.tokens||u.loginAsync(o,n)},[a,o,n]),u.tokens?c.jsx(c.Fragment,{children:s}):null},pt=(s,o=null,n=null,a="default")=>d=>c.jsx(Se,{callbackPath:o,extras:n,configurationName:a,children:c.jsx(s,{...d})}),ne="default",re=(s,o)=>{let n=!1;return s(o)&&(n=s(o).tokens!=null),n},_t=(s=ne)=>{const o=l.OidcClient.get,[n,a]=y.useState(re(o,s));return y.useEffect(()=>{let i=!0;const f=o(s);a(re(o,s));const g=f.subscribeEvents((k,O)=>{(k===l.OidcClient.eventNames.logout_from_another_tab||k===l.OidcClient.eventNames.logout_from_same_tab||k===l.OidcClient.eventNames.token_aquired)&&i&&a(re(o,s))});return()=>{i=!1,f.removeEventSubscription(g)}},[s]),{login:(i=void 0,f=null,g=!1)=>o(s).loginAsync(i,f,!1,void 0,g),logout:(i=void 0,f=null)=>o(s).logoutAsync(i,f),renewTokens:async(i=null)=>{const f=await o(s).renewTokensAsync(i);return{accessToken:f.accessToken,accessTokenPayload:f.accessTokenPayload,idToken:f.idToken,idTokenPayload:f.idTokenPayload}},isAuthenticated:n}},je={accessToken:null,accessTokenPayload:null},gt=s=>{const o=l.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload}}return je},yt=(s=ne)=>{const o=l.OidcClient.get,[n,a]=y.useState(gt(s));return y.useEffect(()=>{let d=!0;const u=o(s);if(u.tokens){const i=u.tokens;a({accessToken:i.accessToken,accessTokenPayload:i.accessTokenPayload})}const h=u.subscribeEvents((i,f)=>{if((i===l.OidcClient.eventNames.token_renewed||i===l.OidcClient.eventNames.token_aquired||i===l.OidcClient.eventNames.logout_from_another_tab||i===l.OidcClient.eventNames.logout_from_same_tab||i===l.OidcClient.eventNames.refreshTokensAsync_error||i===l.OidcClient.eventNames.syncTokensAsync_error)&&d){const g=u.tokens;a(g!=null?{accessToken:g.accessToken,accessTokenPayload:g.accessTokenPayload}:je)}});return()=>{d=!1,u.removeEventSubscription(h)}},[s]),n},Pe={idToken:null,idTokenPayload:null},bt=s=>{const o=l.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{idToken:a.idToken,idTokenPayload:a.idTokenPayload}}return Pe},kt=(s=ne)=>{const o=l.OidcClient.get,[n,a]=y.useState(bt(s));return y.useEffect(()=>{let d=!0;const u=o(s);if(u.tokens){const i=u.tokens;a({idToken:i.idToken,idTokenPayload:i.idTokenPayload})}const h=u.subscribeEvents((i,f)=>{if((i===l.OidcClient.eventNames.token_renewed||i===l.OidcClient.eventNames.token_aquired||i===l.OidcClient.eventNames.logout_from_another_tab||i===l.OidcClient.eventNames.logout_from_same_tab||i===l.OidcClient.eventNames.refreshTokensAsync_error||i===l.OidcClient.eventNames.syncTokensAsync_error)&&d){const g=u.tokens;a(g!=null?{idToken:g.idToken,idTokenPayload:g.idTokenPayload}:Pe)}});return()=>{d=!1,u.removeEventSubscription(h)}},[s]),n};var Ce=(s=>(s.Unauthenticated="Unauthenticated",s.Loading="Loading user",s.Loaded="User loaded",s.LoadingError="Error loading user",s))(Ce||{});const mt=(s="default")=>{const[o,n]=y.useState({user:null,status:"Unauthenticated"}),[a,d]=y.useState(""),u=l.OidcClient.get(s);y.useEffect(()=>{let i=!0;if(u&&u.tokens){n({...o,status:"Loading user"});const f=a!=="";u.userInfoAsync(f).then(g=>{i&&n({user:g,status:"User loaded"})}).catch(()=>n({...o,status:"Error loading user"}))}else n({user:null,status:"Unauthenticated"});return()=>{i=!1}},[a]);const h=()=>{d(a+" ")};return{oidcUser:o.user,oidcUserLoadingState:o.status,reloadOidcUser:h}};Object.defineProperty(R,"TokenRenewMode",{enumerable:!0,get:()=>l.TokenRenewMode}),R.OidcProvider=ht,R.OidcSecure=Se,R.OidcUserStatus=Ce,R.useOidc=_t,R.useOidcAccessToken=yt,R.useOidcFetch=Ee,R.useOidcIdToken=kt,R.useOidcUser=mt,R.withOidcFetch=$e,R.withOidcSecure=pt,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+r+">.")}return t}}function He(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=Mt(t);if(Ge[r])return;Ge[r]=!0;var f="";e&&e._owner&&e._owner!==ge.current&&(f=" It was passed a child from "+x(e._owner.type)+"."),B(e),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,f),B(null)}}function Je(e,t){{if(typeof e!="object")return;if(pe(e))for(var r=0;r<e.length;r++){var f=e[r];be(f)&&He(f,t)}else if(be(e))e._store&&(e._store.validated=!0);else if(e){var b=M(e);if(typeof b=="function"&&b!==e.entries)for(var m=b.call(e),_;!(_=m.next()).done;)be(_.value)&&He(_.value,t)}}}function Yt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===v||t.$$typeof===O))r=t.propTypes;else return;if(r){var f=x(t);St(r,e.props,"prop",f,e)}else if(t.PropTypes!==void 0&&!ye){ye=!0;var b=x(t);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var f=t[r];if(f!=="children"&&f!=="key"){B(e),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),B(null);break}}e.ref!==null&&(B(e),S("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}function Ke(e,t,r,f,b,m){{var _=ue(e);if(!_){var p="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(p+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var P=Wt(b);P?p+=P:p+=ze();var E;e===null?E="null":pe(e)?E="array":e!==void 0&&e.$$typeof===o?(E="<"+(x(e.type)||"Unknown")+" />",p=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,p)}var w=Ut(e,t,r,b,m);if(w==null)return w;if(_){var A=t.children;if(A!==void 0)if(f)if(pe(A)){for(var z=0;z<A.length;z++)Je(A[z],e);Object.freeze&&Object.freeze(A)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Je(A,e)}return e===a?Vt(w):Yt(w),w}}function Bt(e,t,r){return Ke(e,t,r,!0)}function zt(e,t,r){return Ke(e,t,r,!1)}var Gt=zt,Ht=Bt;H.Fragment=a,H.jsx=Gt,H.jsxs=Ht}()),H}process.env.NODE_ENV==="production"?ne.exports=Qe():ne.exports=Ze();var i=ne.exports;const Oe="default",qe=(s,o)=>async(...n)=>{var j;const[a,d,...u]=n,h=d?{...d}:{method:"GET"};let c=new Headers;h.headers&&(c=h.headers instanceof Headers?h.headers:new Headers(h.headers));const v=o(),k=await v.getValidTokenAsync(),y=(j=k==null?void 0:k.tokens)==null?void 0:j.accessToken;if(c.has("Accept")||c.set("Accept","application/json"),y){if(v.configuration.demonstrating_proof_of_possession){const C=await v.generateDemonstrationOfProofOfPossessionAsync(y,a.toString(),h.method);c.set("Authorization",`PoP ${y}`),c.set("DPoP",C)}else c.set("Authorization",`Bearer ${y}`);h.credentials||(h.credentials="same-origin")}const O={...h,headers:c};return await s(a,O,...u)},$e=(s=null,o=Oe)=>n=>a=>{const{fetch:d}=Ee(s||a.fetch,o);return i.jsx(n,{...a,fetch:d})},Ee=(s=null,o=Oe)=>{const n=s||window.fetch,a=l.OidcClient.get;return{fetch:g.useCallback((u,h)=>qe(n,()=>a(o))(u,h),[n,o])}},Te=()=>i.jsx("div",{className:"oidc-authenticating",children:i.jsxs("div",{className:"oidc-authenticating__container",children:[i.jsx("h1",{className:"oidc-authenticating__title",children:"Error authentication"}),i.jsx("p",{className:"oidc-authenticating__content",children:"An error occurred during authentication."})]})}),et=()=>i.jsx("div",{className:"oidc-authenticating",children:i.jsxs("div",{className:"oidc-authenticating__container",children:[i.jsx("h1",{className:"oidc-authenticating__title",children:"Authentication in progress"}),i.jsx("p",{className:"oidc-authenticating__content",children:"You will be redirected to the login page."})]})}),tt=()=>Math.random().toString(36).substr(2,6),nt=(s,o)=>(n,a)=>{if(typeof s.CustomEvent=="function")return new s.CustomEvent(n,a);const d=a||{bubbles:!1,cancelable:!1,detail:void 0},u=o.createEvent("CustomEvent");return u.initCustomEvent(n,d.bubbles,d.cancelable,d.detail),u.prototype=s.Event.prototype,u},rt=(s,o,n)=>({replaceState:(a,d)=>{const u=n(),h=d||s.history.state;s.history.replaceState({key:u,state:h},null,a),s.dispatchEvent(o("popstate"))}}),st=()=>rt(window,nt(window,document),tt),we=()=>i.jsx("div",{className:"oidc-callback",children:i.jsxs("div",{className:"oidc-callback__container",children:[i.jsx("h1",{className:"oidc-callback__title",children:"Authentication complete"}),i.jsx("p",{className:"oidc-callback__content",children:"You will be redirected to your application."})]})}),ot=({callBackError:s,callBackSuccess:o,configurationName:n,withCustomHistory:a})=>{const[d,u]=g.useState(!1);g.useEffect(()=>{let v=!0;return(async()=>{const y=l.OidcClient.get;try{const{callbackPath:O}=await y(n).loginCallbackAsync();(a?a():st()).replaceState(O||"/")}catch(O){v&&(console.warn(O),u(!0))}})(),()=>{v=!1}},[]);const h=s||Te,c=o||we;return d?i.jsx(h,{configurationName:n}):i.jsx(c,{configurationName:n})},at=()=>i.jsx("span",{className:"oidc-loading",children:"Loading"}),ct=()=>i.jsx("div",{className:"oidc-serviceworker",children:i.jsxs("div",{className:"oidc-serviceworker__container",children:[i.jsx("h1",{className:"oidc-serviceworker__title",children:"Unable to authenticate on this browser"}),i.jsx("p",{className:"oidc-serviceworker__content",children:"Your browser is not secure enough to make authentication work. Try updating your browser or use a newer browser."})]})}),it=()=>i.jsx("div",{className:"oidc-session-lost",children:i.jsxs("div",{className:"oidc-session-lost__container",children:[i.jsx("h1",{className:"oidc-session-lost__title",children:"Session timed out"}),i.jsx("p",{className:"oidc-session-lost__content",children:"Your session has expired. Please re-authenticate."})]})}),lt=({configurationName:s})=>(g.useEffect(()=>{(async()=>{const n=l.OidcClient.get;n(s).silentLoginCallbackAsync()})()},[]),i.jsx(i.Fragment,{})),ut=({configurationName:s})=>{const o=l.getParseQueryStringFromLocation(window.location.href),n=l.OidcClient.get,a=n(s);let d=null;for(const[u,h]of Object.entries(o))u==="state"||u==="scope"||(d===null&&(d={}),d[u]=h);return g.useEffect(()=>{a.tokens||a.loginAsync(null,d,!0,o.scope)},[]),i.jsx(i.Fragment,{})},dt=({callbackErrorComponent:s,callbackSuccessComponent:o,redirect_uri:n,silent_redirect_uri:a,silent_login_uri:d,children:u,configurationName:h,withCustomHistory:c=null,location:v})=>{const k=window?l.getPath(window.location.href):"",[y,O]=g.useState(k);g.useEffect(()=>{const C=()=>O(l.getPath(window.location.href));return C(),window.addEventListener("popstate",C,!1),()=>window.removeEventListener("popstate",C,!1)},[]);const j=l.getPath(n);if(a&&y===l.getPath(a))return i.jsx(lt,{configurationName:h});if(d&&y===l.getPath(d))return i.jsx(ut,{configurationName:h});switch(y){case j:return i.jsx(ot,{callBackError:s,callBackSuccess:o,configurationName:h,withCustomHistory:c});default:return i.jsx(i.Fragment,{children:u})}},ft=g.memo(dt),Re={name:"",data:null},vt=({loadingComponent:s,children:o,configurationName:n})=>{const[a,d]=g.useState(!0),u=l.OidcClient.get,h=u(n);g.useEffect(()=>{let v=!0;return h&&h.tryKeepExistingSessionAsync().then(()=>{v&&d(!1)}),()=>{v=!1}},[n]);const c=s;return i.jsx(i.Fragment,{children:a?i.jsx(c,{configurationName:n}):i.jsx(i.Fragment,{children:o})})},J=({isLoading:s,loadingComponent:o,children:n,configurationName:a})=>{const d=o;return s?i.jsx(d,{configurationName:a,children:n}):i.jsx(i.Fragment,{children:n})},ht=({children:s,configuration:o,configurationName:n="default",callbackSuccessComponent:a=we,authenticatingComponent:d=et,loadingComponent:u=at,serviceWorkerNotSupportedComponent:h=ct,authenticatingErrorComponent:c=Te,sessionLostComponent:v=it,onSessionLost:k=null,onLogoutFromAnotherTab:y=null,onLogoutFromSameTab:O=null,withCustomHistory:j=null,onEvent:C=null,getFetch:X=null,location:Q=null})=>{const M=(N="default")=>l.OidcClient.getOrCreate(X??l.getFetchDefault,Q??new l.OidcLocation)(o,N),[L,S]=g.useState(!0),[oe,Y]=g.useState(Re),[ae,ce]=g.useState("default");g.useEffect(()=>{const V=M(n).subscribeEvents((T,D)=>{C&&C(n,T,D)});return()=>{M(n).removeEventSubscription(V)}},[n,C]),g.useEffect(()=>{const V=M(n).subscribeEvents((T,D)=>{if(T===l.OidcClient.eventNames.refreshTokensAsync_error||T===l.OidcClient.eventNames.syncTokensAsync_error){if(k!=null){k();return}Y({name:T,data:D})}else if(T===l.OidcClient.eventNames.logout_from_another_tab){if(y!=null){y();return}Y({name:T,data:D})}else T===l.OidcClient.eventNames.logout_from_same_tab?O!=null&&O():T===l.OidcClient.eventNames.loginAsync_begin||T===l.OidcClient.eventNames.loginCallbackAsync_end||T===l.OidcClient.eventNames.loginAsync_error||T===l.OidcClient.eventNames.loginCallbackAsync_error?Y({name:T,data:D}):T===l.OidcClient.eventNames.service_worker_not_supported_by_browser&&o.service_worker_only===!0&&Y({name:T,data:D})});return ce(n),S(!1),()=>{M(n).removeEventSubscription(V),Y(Re)}},[o,n]);const ie=v,le=d,F=u,ue=h,de=c,U=L||ae!==n,x=M(n);switch(oe.name){case l.OidcClient.eventNames.service_worker_not_supported_by_browser:return i.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(ue,{configurationName:n})});case l.OidcClient.eventNames.loginAsync_begin:return i.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(le,{configurationName:n})});case l.OidcClient.eventNames.loginAsync_error:case l.OidcClient.eventNames.loginCallbackAsync_error:return i.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(de,{configurationName:n})});case l.OidcClient.eventNames.refreshTokensAsync_error:case l.OidcClient.eventNames.syncTokensAsync_error:case l.OidcClient.eventNames.logout_from_another_tab:return i.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(ie,{configurationName:n})});default:return i.jsx(J,{loadingComponent:F,isLoading:U,configurationName:n,children:i.jsx(ft,{redirect_uri:x.configuration.redirect_uri,silent_redirect_uri:x.configuration.silent_redirect_uri,silent_login_uri:x.configuration.silent_login_uri,callbackSuccessComponent:a,callbackErrorComponent:c,authenticatingComponent:d,configurationName:n,withCustomHistory:j,location:Q??new l.OidcLocation,children:i.jsx(vt,{loadingComponent:F,configurationName:n,children:s})})})}},Se=({children:s,callbackPath:o=null,extras:n=null,configurationName:a="default"})=>{const d=l.OidcClient.get,u=d(a);return g.useEffect(()=>{u.tokens||u.loginAsync(o,n)},[a,o,n]),u.tokens?i.jsx(i.Fragment,{children:s}):null},pt=(s,o=null,n=null,a="default")=>d=>i.jsx(Se,{callbackPath:o,extras:n,configurationName:a,children:i.jsx(s,{...d})}),re="default",se=(s,o)=>{let n=!1;return s(o)&&(n=s(o).tokens!=null),n},_t=(s=re)=>{const o=l.OidcClient.get,[n,a]=g.useState(se(o,s));return g.useEffect(()=>{let c=!0;const v=o(s);a(se(o,s));const k=v.subscribeEvents((y,O)=>{(y===l.OidcClient.eventNames.logout_from_another_tab||y===l.OidcClient.eventNames.logout_from_same_tab||y===l.OidcClient.eventNames.token_aquired)&&c&&a(se(o,s))});return()=>{c=!1,v.removeEventSubscription(k)}},[s]),{login:(c=void 0,v=null,k=!1)=>o(s).loginAsync(c,v,!1,void 0,k),logout:(c=void 0,v=null)=>o(s).logoutAsync(c,v),renewTokens:async(c=null)=>{const v=await o(s).renewTokensAsync(c);return{accessToken:v.accessToken,accessTokenPayload:v.accessTokenPayload,idToken:v.idToken,idTokenPayload:v.idTokenPayload}},isAuthenticated:n}},je={accessToken:null,accessTokenPayload:null},gt=s=>{const o=l.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{accessToken:a.accessToken,accessTokenPayload:a.accessTokenPayload}}return je},yt=(s=re)=>{const o=l.OidcClient.get,[n,a]=g.useState(gt(s));return g.useEffect(()=>{let d=!0;const u=o(s);if(u.tokens){const c=u.tokens;a({accessToken:c.accessToken,accessTokenPayload:c.accessTokenPayload})}const h=u.subscribeEvents((c,v)=>{if((c===l.OidcClient.eventNames.token_renewed||c===l.OidcClient.eventNames.token_aquired||c===l.OidcClient.eventNames.logout_from_another_tab||c===l.OidcClient.eventNames.logout_from_same_tab||c===l.OidcClient.eventNames.refreshTokensAsync_error||c===l.OidcClient.eventNames.syncTokensAsync_error)&&d){const k=u.tokens;a(k!=null?{accessToken:k.accessToken,accessTokenPayload:k.accessTokenPayload}:je)}});return()=>{d=!1,u.removeEventSubscription(h)}},[s]),n},Pe={idToken:null,idTokenPayload:null},bt=s=>{const o=l.OidcClient.get,n=o(s);if(n.tokens){const a=n.tokens;return{idToken:a.idToken,idTokenPayload:a.idTokenPayload}}return Pe},kt=(s=re)=>{const o=l.OidcClient.get,[n,a]=g.useState(bt(s));return g.useEffect(()=>{let d=!0;const u=o(s);if(u.tokens){const c=u.tokens;a({idToken:c.idToken,idTokenPayload:c.idTokenPayload})}const h=u.subscribeEvents((c,v)=>{if((c===l.OidcClient.eventNames.token_renewed||c===l.OidcClient.eventNames.token_aquired||c===l.OidcClient.eventNames.logout_from_another_tab||c===l.OidcClient.eventNames.logout_from_same_tab||c===l.OidcClient.eventNames.refreshTokensAsync_error||c===l.OidcClient.eventNames.syncTokensAsync_error)&&d){const k=u.tokens;a(k!=null?{idToken:k.idToken,idTokenPayload:k.idTokenPayload}:Pe)}});return()=>{d=!1,u.removeEventSubscription(h)}},[s]),n};var Ce=(s=>(s.Unauthenticated="Unauthenticated",s.Loading="Loading user",s.Loaded="User loaded",s.LoadingError="Error loading user",s))(Ce||{});const mt=(s="default")=>{const[o,n]=g.useState({user:null,status:"Unauthenticated"}),[a,d]=g.useState(""),u=l.OidcClient.get(s);g.useEffect(()=>{let c=!0;if(u&&u.tokens){n({...o,status:"Loading user"});const v=a!=="";u.userInfoAsync(v).then(k=>{c&&n({user:k,status:"User loaded"})}).catch(()=>n({...o,status:"Error loading user"}))}else n({user:null,status:"Unauthenticated"});return()=>{c=!1}},[a]);const h=()=>{d(a+" ")};return{oidcUser:o.user,oidcUserLoadingState:o.status,reloadOidcUser:h}};Object.defineProperty(R,"TokenRenewMode",{enumerable:!0,get:()=>l.TokenRenewMode}),R.OidcProvider=ht,R.OidcSecure=Se,R.OidcUserStatus=Ce,R.useOidc=_t,R.useOidcAccessToken=yt,R.useOidcFetch=Ee,R.useOidcIdToken=kt,R.useOidcUser=mt,R.withOidcFetch=$e,R.withOidcSecure=pt,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/react-oidc",
3
- "version": "7.7.0-beta.1074",
3
+ "version": "7.7.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
@@ -40,8 +40,8 @@
40
40
  "lint": "eslint src"
41
41
  },
42
42
  "dependencies": {
43
- "@axa-fr/oidc-client-service-worker": "7.7.0-beta.1074",
44
- "@axa-fr/oidc-client": "7.7.0-beta.1074",
43
+ "@axa-fr/oidc-client-service-worker": "7.7.0",
44
+ "@axa-fr/oidc-client": "7.7.0",
45
45
  "base64-js": "1.5.1"
46
46
  },
47
47
  "peerDependencies": {
@@ -196,7 +196,8 @@ export const OidcProvider: FC<PropsWithChildren<OidcProviderProps>> = ({
196
196
  callbackErrorComponent={authenticatingErrorComponent}
197
197
  authenticatingComponent={authenticatingComponent}
198
198
  configurationName={configurationName}
199
- withCustomHistory={withCustomHistory}>
199
+ withCustomHistory={withCustomHistory}
200
+ location={location ?? new OidcLocation()}>
200
201
  <OidcSession loadingComponent={LoadingComponent} configurationName={configurationName}>
201
202
  {children}
202
203
  </OidcSession>
@@ -1,4 +1,4 @@
1
- import { getPath } from '@axa-fr/oidc-client';
1
+ import {getPath, ILOidcLocation} from '@axa-fr/oidc-client';
2
2
  import React, { ComponentType, FC, PropsWithChildren, useEffect, useState } from 'react';
3
3
 
4
4
  import CallbackComponent from '../default-component/Callback.component.js';
@@ -15,6 +15,7 @@ type OidcRoutesProps = {
15
15
  silent_redirect_uri?: string;
16
16
  silent_login_uri?: string;
17
17
  withCustomHistory?: () => CustomHistory;
18
+ location: ILOidcLocation;
18
19
  };
19
20
 
20
21
  const OidcRoutes: FC<PropsWithChildren<OidcRoutesProps>> = ({
@@ -24,7 +25,8 @@ const OidcRoutes: FC<PropsWithChildren<OidcRoutesProps>> = ({
24
25
  silent_redirect_uri,
25
26
  silent_login_uri,
26
27
  children, configurationName,
27
- withCustomHistory = null,
28
+ withCustomHistory = null,
29
+ location,
28
30
  }) => {
29
31
  // This exist because in next.js window outside useEffect is null
30
32
  const pathname = window ? getPath(window.location.href) : '';