@axa-fr/oidc-client 7.13.9 → 7.13.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const L = console;
2
2
  class Ie {
3
- constructor(e, n, t, o = 2e3, i = !0) {
4
- this._callback = e, this._client_id = n, this._url = t, this._interval = o || 2e3, this._stopOnError = i;
3
+ constructor(e, s, t, o = 2e3, i = !0) {
4
+ this._callback = e, this._client_id = s, this._url = t, this._interval = o || 2e3, this._stopOnError = i;
5
5
  const r = t.indexOf("/", t.indexOf("//") + 2);
6
6
  this._frame_origin = t.substr(0, r), this._frame = window.document.createElement("iframe"), this._frame.style.visibility = "hidden", this._frame.style.position = "absolute", this._frame.style.display = "none", this._frame.width = 0, this._frame.height = 0, this._frame.src = t;
7
7
  }
@@ -17,10 +17,10 @@ class Ie {
17
17
  }
18
18
  start(e) {
19
19
  L.debug("CheckSessionIFrame.start :" + e), this.stop();
20
- const n = () => {
20
+ const s = () => {
21
21
  this._frame.contentWindow.postMessage(this._client_id + " " + e, this._frame_origin);
22
22
  };
23
- n(), this._timer = window.setInterval(n, this._interval);
23
+ s(), this._timer = window.setInterval(s, this._interval);
24
24
  }
25
25
  stop() {
26
26
  this._timer && (L.debug("CheckSessionIFrame.stop"), window.clearInterval(this._timer), this._timer = null);
@@ -54,26 +54,26 @@ const m = {
54
54
  syncTokensAsync_lock_not_available: "syncTokensAsync_lock_not_available",
55
55
  syncTokensAsync_end: "syncTokensAsync_end",
56
56
  syncTokensAsync_error: "syncTokensAsync_error"
57
- }, I = (s, e = sessionStorage) => {
58
- const n = (p) => (e[`oidc.${s}`] = JSON.stringify({ tokens: null, status: p }), Promise.resolve()), t = async () => {
59
- if (!e[`oidc.${s}`])
60
- return e[`oidc.${s}`] = JSON.stringify({ tokens: null, status: null }), { tokens: null, status: null };
61
- const p = JSON.parse(e[`oidc.${s}`]);
57
+ }, I = (n, e = sessionStorage) => {
58
+ const s = (p) => (e[`oidc.${n}`] = JSON.stringify({ tokens: null, status: p }), Promise.resolve()), t = async () => {
59
+ if (!e[`oidc.${n}`])
60
+ return e[`oidc.${n}`] = JSON.stringify({ tokens: null, status: null }), { tokens: null, status: null };
61
+ const p = JSON.parse(e[`oidc.${n}`]);
62
62
  return Promise.resolve({ tokens: p.tokens, status: p.status });
63
63
  }, o = (p) => {
64
- e[`oidc.${s}`] = JSON.stringify({ tokens: p });
64
+ e[`oidc.${n}`] = JSON.stringify({ tokens: p });
65
65
  }, i = async (p) => {
66
- e[`oidc.session_state.${s}`] = p;
67
- }, r = async () => e[`oidc.session_state.${s}`], c = (p) => {
68
- e[`oidc.nonce.${s}`] = p.nonce;
66
+ e[`oidc.session_state.${n}`] = p;
67
+ }, r = async () => e[`oidc.session_state.${n}`], c = (p) => {
68
+ e[`oidc.nonce.${n}`] = p.nonce;
69
69
  }, a = (p) => {
70
- e[`oidc.jwk.${s}`] = JSON.stringify(p);
71
- }, u = () => JSON.parse(e[`oidc.jwk.${s}`]), f = async () => ({ nonce: e[`oidc.nonce.${s}`] }), d = async (p) => {
72
- e[`oidc.dpop_nonce.${s}`] = p;
73
- }, l = () => e[`oidc.dpop_nonce.${s}`], h = () => e[`oidc.${s}`] ? JSON.stringify({ tokens: JSON.parse(e[`oidc.${s}`]).tokens }) : null;
70
+ e[`oidc.jwk.${n}`] = JSON.stringify(p);
71
+ }, u = () => JSON.parse(e[`oidc.jwk.${n}`]), f = async () => ({ nonce: e[`oidc.nonce.${n}`] }), d = async (p) => {
72
+ e[`oidc.dpop_nonce.${n}`] = p;
73
+ }, l = () => e[`oidc.dpop_nonce.${n}`], h = () => e[`oidc.${n}`] ? JSON.stringify({ tokens: JSON.parse(e[`oidc.${n}`]).tokens }) : null;
74
74
  let y = {};
75
75
  return {
76
- clearAsync: n,
76
+ clearAsync: s,
77
77
  initAsync: t,
78
78
  setTokens: o,
79
79
  getTokens: h,
@@ -82,96 +82,96 @@ const m = {
82
82
  setNonceAsync: c,
83
83
  getNonceAsync: f,
84
84
  setLoginParams: (p) => {
85
- y[s] = p, e[`oidc.login.${s}`] = JSON.stringify(p);
85
+ y[n] = p, e[`oidc.login.${n}`] = JSON.stringify(p);
86
86
  },
87
87
  getLoginParams: () => {
88
- const p = e[`oidc.login.${s}`];
89
- return y[s] || (y[s] = JSON.parse(p)), y[s];
88
+ const p = e[`oidc.login.${n}`];
89
+ return y[n] || (y[n] = JSON.parse(p)), y[n];
90
90
  },
91
- getStateAsync: async () => e[`oidc.state.${s}`],
91
+ getStateAsync: async () => e[`oidc.state.${n}`],
92
92
  setStateAsync: async (p) => {
93
- e[`oidc.state.${s}`] = p;
93
+ e[`oidc.state.${n}`] = p;
94
94
  },
95
- getCodeVerifierAsync: async () => e[`oidc.code_verifier.${s}`],
95
+ getCodeVerifierAsync: async () => e[`oidc.code_verifier.${n}`],
96
96
  setCodeVerifierAsync: async (p) => {
97
- e[`oidc.code_verifier.${s}`] = p;
97
+ e[`oidc.code_verifier.${n}`] = p;
98
98
  },
99
99
  setDemonstratingProofOfPossessionNonce: d,
100
100
  getDemonstratingProofOfPossessionNonce: l,
101
101
  setDemonstratingProofOfPossessionJwkAsync: a,
102
102
  getDemonstratingProofOfPossessionJwkAsync: u
103
103
  };
104
- }, Ce = (s) => decodeURIComponent(Array.prototype.map.call(atob(s), (e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), xe = (s) => JSON.parse(Ce(s.split(".")[1].replace("-", "+").replace("_", "/"))), ce = (s) => {
104
+ }, Ce = (n) => decodeURIComponent(Array.prototype.map.call(atob(n), (e) => "%" + ("00" + e.charCodeAt(0).toString(16)).slice(-2)).join("")), xe = (n) => JSON.parse(Ce(n.split(".")[1].replace("-", "+").replace("_", "/"))), ce = (n) => {
105
105
  try {
106
- return s && Ne(s, ".") === 2 ? xe(s) : null;
106
+ return n && Ne(n, ".") === 2 ? xe(n) : null;
107
107
  } catch (e) {
108
108
  console.warn(e);
109
109
  }
110
110
  return null;
111
- }, Ne = (s, e) => s.split(e).length - 1, Y = {
111
+ }, Ne = (n, e) => n.split(e).length - 1, Y = {
112
112
  access_token_or_id_token_invalid: "access_token_or_id_token_invalid",
113
113
  access_token_invalid: "access_token_invalid",
114
114
  id_token_invalid: "id_token_invalid"
115
115
  };
116
- function We(s, e, n) {
117
- if (s.issuedAt) {
118
- if (typeof s.issuedAt == "string")
119
- return parseInt(s.issuedAt, 10);
116
+ function We(n, e, s) {
117
+ if (n.issuedAt) {
118
+ if (typeof n.issuedAt == "string")
119
+ return parseInt(n.issuedAt, 10);
120
120
  } else
121
- return e && e.iat ? e.iat : n && n.iat ? n.iat : (/* @__PURE__ */ new Date()).getTime() / 1e3;
122
- return s.issuedAt;
121
+ return e && e.iat ? e.iat : s && s.iat ? s.iat : (/* @__PURE__ */ new Date()).getTime() / 1e3;
122
+ return n.issuedAt;
123
123
  }
124
- const ne = (s, e = null, n) => {
125
- if (!s)
124
+ const se = (n, e = null, s) => {
125
+ if (!n)
126
126
  return null;
127
127
  let t;
128
- const o = typeof s.expiresIn == "string" ? parseInt(s.expiresIn, 10) : s.expiresIn;
129
- s.accessTokenPayload !== void 0 ? t = s.accessTokenPayload : t = ce(s.accessToken);
130
- const i = s.idTokenPayload ? s.idTokenPayload : ce(s.idToken), r = i && i.exp ? i.exp : Number.MAX_VALUE, c = t && t.exp ? t.exp : s.issuedAt + o;
131
- s.issuedAt = We(s, t, i);
128
+ const o = typeof n.expiresIn == "string" ? parseInt(n.expiresIn, 10) : n.expiresIn;
129
+ n.accessTokenPayload !== void 0 ? t = n.accessTokenPayload : t = ce(n.accessToken);
130
+ const i = n.idTokenPayload ? n.idTokenPayload : ce(n.idToken), r = i && i.exp ? i.exp : Number.MAX_VALUE, c = t && t.exp ? t.exp : n.issuedAt + o;
131
+ n.issuedAt = We(n, t, i);
132
132
  let a;
133
- s.expiresAt ? a = s.expiresAt : n === Y.access_token_invalid ? a = c : n === Y.id_token_invalid ? a = r : a = r < c ? r : c;
134
- const u = { ...s, idTokenPayload: i, accessTokenPayload: t, expiresAt: a };
135
- if (e != null && "refreshToken" in e && !("refreshToken" in s)) {
133
+ n.expiresAt ? a = n.expiresAt : s === Y.access_token_invalid ? a = c : s === Y.id_token_invalid ? a = r : a = r < c ? r : c;
134
+ const u = { ...n, idTokenPayload: i, accessTokenPayload: t, expiresAt: a };
135
+ if (e != null && "refreshToken" in e && !("refreshToken" in n)) {
136
136
  const f = e.refreshToken;
137
137
  return { ...u, refreshToken: f };
138
138
  }
139
139
  return u;
140
- }, te = (s, e, n) => {
141
- if (!s)
140
+ }, te = (n, e, s) => {
141
+ if (!n)
142
142
  return null;
143
- if (!s.issued_at) {
143
+ if (!n.issued_at) {
144
144
  const o = (/* @__PURE__ */ new Date()).getTime() / 1e3;
145
- s.issued_at = o;
145
+ n.issued_at = o;
146
146
  }
147
147
  const t = {
148
- accessToken: s.access_token,
149
- expiresIn: s.expires_in,
150
- idToken: s.id_token,
151
- scope: s.scope,
152
- tokenType: s.token_type,
153
- issuedAt: s.issued_at
148
+ accessToken: n.access_token,
149
+ expiresIn: n.expires_in,
150
+ idToken: n.id_token,
151
+ scope: n.scope,
152
+ tokenType: n.token_type,
153
+ issuedAt: n.issued_at
154
154
  };
155
- return "refresh_token" in s && (t.refreshToken = s.refresh_token), s.accessTokenPayload !== void 0 && (t.accessTokenPayload = s.accessTokenPayload), s.idTokenPayload !== void 0 && (t.idTokenPayload = s.idTokenPayload), ne(t, e, n);
156
- }, V = (s, e) => {
157
- const n = (/* @__PURE__ */ new Date()).getTime() / 1e3, t = e - n;
158
- return Math.round(t - s);
159
- }, z = (s) => s ? V(0, s.expiresAt) > 0 : !1, Le = async (s, e = 200, n = 50) => {
160
- let t = n;
161
- if (!s.tokens)
155
+ return "refresh_token" in n && (t.refreshToken = n.refresh_token), n.accessTokenPayload !== void 0 && (t.accessTokenPayload = n.accessTokenPayload), n.idTokenPayload !== void 0 && (t.idTokenPayload = n.idTokenPayload), se(t, e, s);
156
+ }, V = (n, e) => {
157
+ const s = (/* @__PURE__ */ new Date()).getTime() / 1e3, t = e - s;
158
+ return Math.round(t - n);
159
+ }, z = (n) => n ? V(0, n.expiresAt) > 0 : !1, Le = async (n, e = 200, s = 50) => {
160
+ let t = s;
161
+ if (!n.tokens)
162
162
  return null;
163
- for (; !z(s.tokens) && t > 0; )
163
+ for (; !z(n.tokens) && t > 0; )
164
164
  await $({ milliseconds: e }), t = t - 1;
165
165
  return {
166
- isTokensValid: z(s.tokens),
167
- tokens: s.tokens,
168
- numberWaited: t - n
166
+ isTokensValid: z(n.tokens),
167
+ tokens: n.tokens,
168
+ numberWaited: t - s
169
169
  };
170
- }, ge = (s, e, n) => {
171
- if (s.idTokenPayload) {
172
- const t = s.idTokenPayload;
173
- if (n.issuer !== t.iss)
174
- return { isValid: !1, reason: `Issuer does not match (oidcServerConfiguration issuer) ${n.issuer} !== (idTokenPayload issuer) ${t.iss}` };
170
+ }, ge = (n, e, s) => {
171
+ if (n.idTokenPayload) {
172
+ const t = n.idTokenPayload;
173
+ if (s.issuer !== t.iss)
174
+ return { isValid: !1, reason: `Issuer does not match (oidcServerConfiguration issuer) ${s.issuer} !== (idTokenPayload issuer) ${t.iss}` };
175
175
  const o = (/* @__PURE__ */ new Date()).getTime() / 1e3;
176
176
  if (t.exp && t.exp < o)
177
177
  return { isValid: !1, reason: `Token expired (idTokenPayload exp) ${t.exp} < (currentTimeUnixSecond) ${o}` };
@@ -183,7 +183,7 @@ const ne = (s, e = null, n) => {
183
183
  }
184
184
  return { isValid: !0, reason: "" };
185
185
  }, M = function() {
186
- const s = function() {
186
+ const n = function() {
187
187
  let a, u;
188
188
  const f = (function() {
189
189
  const l = {}, h = {
@@ -238,7 +238,7 @@ const ne = (s, e = null, n) => {
238
238
  }
239
239
  return null;
240
240
  }();
241
- if (!s) {
241
+ if (!n) {
242
242
  const a = typeof window > "u" ? global : window;
243
243
  return {
244
244
  setTimeout: setTimeout.bind(a),
@@ -252,11 +252,11 @@ const ne = (s, e = null, n) => {
252
252
  return function() {
253
253
  return a++, a;
254
254
  };
255
- }(), n = {}, t = {};
256
- s.onmessage = function(a) {
257
- const u = a.data, f = n[u];
255
+ }(), s = {}, t = {};
256
+ n.onmessage = function(a) {
257
+ const u = a.data, f = s[u];
258
258
  if (f) {
259
- f(), n[u] = null;
259
+ f(), s[u] = null;
260
260
  return;
261
261
  }
262
262
  const d = t[u];
@@ -264,17 +264,17 @@ const ne = (s, e = null, n) => {
264
264
  };
265
265
  function o(a, u) {
266
266
  const f = e();
267
- return s.postMessage(["setTimeout", f, u]), n[f] = a, f;
267
+ return n.postMessage(["setTimeout", f, u]), s[f] = a, f;
268
268
  }
269
269
  function i(a) {
270
- s.postMessage(["clearTimeout", a]), n[a] = null;
270
+ n.postMessage(["clearTimeout", a]), s[a] = null;
271
271
  }
272
272
  function r(a, u) {
273
273
  const f = e();
274
- return s.postMessage(["setInterval", f, u]), t[f] = a, f;
274
+ return n.postMessage(["setInterval", f, u]), t[f] = a, f;
275
275
  }
276
276
  function c(a) {
277
- s.postMessage(["clearInterval", a]), t[a] = null;
277
+ n.postMessage(["clearInterval", a]), t[a] = null;
278
278
  }
279
279
  return {
280
280
  setTimeout: o,
@@ -282,11 +282,11 @@ const ne = (s, e = null, n) => {
282
282
  setInterval: r,
283
283
  clearInterval: c
284
284
  };
285
- }(), le = "7.13.9";
285
+ }(), le = "7.13.11";
286
286
  let ue = null, q;
287
- const $ = ({ milliseconds: s }) => new Promise((e) => M.setTimeout(e, s)), ke = (s = "/") => {
287
+ const $ = ({ milliseconds: n }) => new Promise((e) => M.setTimeout(e, n)), ke = (n = "/") => {
288
288
  try {
289
- q = new AbortController(), fetch(`${s}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`, { signal: q.signal }).catch((t) => {
289
+ q = new AbortController(), fetch(`${n}OidcKeepAliveServiceWorker.json?minSleepSeconds=150`, { signal: q.signal }).catch((t) => {
290
290
  console.log(t);
291
291
  }), $({ milliseconds: 150 * 1e3 }).then(ke);
292
292
  } catch (e) {
@@ -294,27 +294,27 @@ const $ = ({ milliseconds: s }) => new Promise((e) => M.setTimeout(e, s)), ke =
294
294
  }
295
295
  }, De = () => {
296
296
  q && q.abort();
297
- }, $e = (s = "/") => fetch(`${s}OidcKeepAliveServiceWorker.json`, {
297
+ }, $e = (n = "/") => fetch(`${n}OidcKeepAliveServiceWorker.json`, {
298
298
  headers: {
299
299
  "oidc-vanilla": "true"
300
300
  }
301
301
  }).then((e) => e.statusText === "oidc-service-worker").catch((e) => {
302
302
  console.log(e);
303
- }), Re = (s) => async (e, n) => {
304
- n(), await e.update();
303
+ }), Re = (n) => async (e, s) => {
304
+ s(), await e.update();
305
305
  const t = await e.unregister();
306
- console.log(`Service worker unregistering ${t}`), await $({ milliseconds: 2e3 }), s.reload();
307
- }, b = (s) => (e) => new Promise(function(n, t) {
306
+ console.log(`Service worker unregistering ${t}`), await $({ milliseconds: 2e3 }), n.reload();
307
+ }, b = (n) => (e) => new Promise(function(s, t) {
308
308
  const o = new MessageChannel();
309
309
  o.port1.onmessage = function(i) {
310
- i.data && i.data.error ? t(i.data.error) : n(i.data);
311
- }, s.active.postMessage(e, [o.port2]);
312
- }), E = async (s, e) => {
313
- const n = s.service_worker_relative_url;
314
- if (typeof window > "u" || typeof navigator > "u" || !navigator.serviceWorker || !n || s.service_worker_activate() === !1)
310
+ i.data && i.data.error ? t(i.data.error) : s(i.data);
311
+ }, n.active.postMessage(e, [o.port2]);
312
+ }), E = async (n, e) => {
313
+ const s = n.service_worker_relative_url;
314
+ if (typeof window > "u" || typeof navigator > "u" || !navigator.serviceWorker || !s || n.service_worker_activate() === !1)
315
315
  return null;
316
316
  let t = null;
317
- s.register ? t = await s.service_worker_register(n) : t = await navigator.serviceWorker.register(n);
317
+ n.register ? t = await n.service_worker_register(s) : t = await navigator.serviceWorker.register(s);
318
318
  try {
319
319
  await navigator.serviceWorker.ready, navigator.serviceWorker.controller || await b(t)({ type: "claim" });
320
320
  } catch {
@@ -344,8 +344,8 @@ const $ = ({ milliseconds: s }) => new Promise((e) => M.setTimeout(e, s)), ke =
344
344
  return {
345
345
  clearAsync: o,
346
346
  initAsync: i,
347
- startKeepAliveServiceWorker: () => r(s.service_worker_keep_alive_path),
348
- isServiceWorkerProxyActiveAsync: () => $e(s.service_worker_keep_alive_path),
347
+ startKeepAliveServiceWorker: () => r(n.service_worker_keep_alive_path),
348
+ isServiceWorkerProxyActiveAsync: () => $e(n.service_worker_keep_alive_path),
349
349
  setSessionStateAsync: c,
350
350
  getSessionStateAsync: a,
351
351
  setNonceAsync: u,
@@ -381,82 +381,82 @@ const $ = ({ milliseconds: s }) => new Promise((e) => M.setTimeout(e, s)), ke =
381
381
  }
382
382
  };
383
383
  };
384
- async function de(s, e, n, t) {
384
+ async function de(n, e, s, t) {
385
385
  const o = (a) => {
386
- s.tokens = a;
387
- }, { tokens: i, status: r } = await s.synchroniseTokensAsync(e, 0, n, t, o);
388
- return await E(s.configuration, s.configurationName) || await I(s.configurationName, s.configuration.storage).setTokens(s.tokens), s.tokens ? i : (await s.destroyAsync(r), null);
386
+ n.tokens = a;
387
+ }, { tokens: i, status: r } = await n.synchroniseTokensAsync(e, 0, s, t, o);
388
+ return await E(n.configuration, n.configurationName) || await I(n.configurationName, n.configuration.storage).setTokens(n.tokens), n.tokens ? i : (await n.destroyAsync(r), null);
389
389
  }
390
- async function Fe(s, e) {
391
- const n = await E(e, s.configurationName);
392
- if (n) {
393
- const t = await s.initAsync(e.authority, e.authority_configuration), { tokens: o } = await n.initAsync(t, "tryKeepExistingSessionAsync", e);
390
+ async function Fe(n, e) {
391
+ const s = await E(e, n.configurationName);
392
+ if (s) {
393
+ const t = await n.initAsync(e.authority, e.authority_configuration), { tokens: o } = await s.initAsync(t, "tryKeepExistingSessionAsync", e);
394
394
  return o;
395
395
  } else {
396
- const t = I(s.configurationName, e.storage ?? sessionStorage);
396
+ const t = I(n.configurationName, e.storage ?? sessionStorage);
397
397
  let { tokens: o } = await t.initAsync();
398
- return o = ne(o, s.tokens, e.token_renew_mode), o;
398
+ return o = se(o, n.tokens, e.token_renew_mode), o;
399
399
  }
400
400
  }
401
- async function me(s, e, n = !1, t = null) {
402
- const o = s.configuration, i = `${o.client_id}_${s.configurationName}_${o.authority}`;
401
+ async function me(n, e, s = !1, t = null) {
402
+ const o = n.configuration, i = `${o.client_id}_${n.configurationName}_${o.authority}`;
403
403
  let r;
404
- const c = await E(s.configuration, s.configurationName);
405
- return (o == null ? void 0 : o.storage) === (window == null ? void 0 : window.sessionStorage) && !c ? r = await de(s, e, n, t) : r = await navigator.locks.request(i, { ifAvailable: !0 }, async (a) => a ? await de(s, e, n, t) : (s.publishEvent(R.eventNames.syncTokensAsync_lock_not_available, { lock: "lock not available" }), await Fe(s, o))), r ? (s.timeoutId && (s.timeoutId = K(s, r.refreshToken, s.tokens.expiresAt, t)), s.tokens) : null;
404
+ const c = await E(n.configuration, n.configurationName);
405
+ return (o == null ? void 0 : o.storage) === (window == null ? void 0 : window.sessionStorage) && !c ? r = await de(n, e, s, t) : r = await navigator.locks.request(i, { ifAvailable: !0 }, async (a) => a ? await de(n, e, s, t) : (n.publishEvent(R.eventNames.syncTokensAsync_lock_not_available, { lock: "lock not available" }), await Fe(n, o))), r ? (n.timeoutId && (n.timeoutId = K(n, r.refreshToken, n.tokens.expiresAt, t)), n.tokens) : null;
406
406
  }
407
- const K = (s, e, n, t = null) => {
408
- const o = s.configuration.refresh_time_before_tokens_expiration_in_second;
407
+ const K = (n, e, s, t = null) => {
408
+ const o = n.configuration.refresh_time_before_tokens_expiration_in_second;
409
409
  return M.setTimeout(async () => {
410
- const r = { timeLeft: V(o, n) };
411
- s.publishEvent(R.eventNames.token_timer, r), await me(s, e, !1, t);
410
+ const r = { timeLeft: V(o, s) };
411
+ n.publishEvent(R.eventNames.token_timer, r), await me(n, e, !1, t);
412
412
  }, 1e3);
413
- }, oe = (s, e, n) => (t = null, o = null, i = null) => {
413
+ }, oe = (n, e, s) => (t = null, o = null, i = null) => {
414
414
  if (!e.silent_redirect_uri || !e.silent_login_uri)
415
415
  return Promise.resolve(null);
416
416
  try {
417
- n(m.silentLoginAsync_begin, {});
417
+ s(m.silentLoginAsync_begin, {});
418
418
  let r = "";
419
419
  if (o && (t == null && (t = {}), t.state = o), i && (t == null && (t = {}), t.scope = i), t != null)
420
420
  for (const [d, l] of Object.entries(t))
421
421
  r === "" ? r = `?${encodeURIComponent(d)}=${encodeURIComponent(l)}` : r += `&${encodeURIComponent(d)}=${encodeURIComponent(l)}`;
422
422
  const c = e.silent_login_uri + r, a = c.indexOf("/", c.indexOf("//") + 2), u = c.substr(0, a), f = document.createElement("iframe");
423
- return f.width = "0px", f.height = "0px", f.id = `${s}_oidc_iframe`, f.setAttribute("src", c), document.body.appendChild(f), new Promise((d, l) => {
423
+ return f.width = "0px", f.height = "0px", f.id = `${n}_oidc_iframe`, f.setAttribute("src", c), document.body.appendChild(f), new Promise((d, l) => {
424
424
  try {
425
425
  let h = !1;
426
426
  window.onmessage = (_) => {
427
427
  if (_.origin === u && _.source === f.contentWindow) {
428
- const g = `${s}_oidc_tokens:`, w = `${s}_oidc_error:`, v = _.data;
428
+ const g = `${n}_oidc_tokens:`, w = `${n}_oidc_error:`, v = _.data;
429
429
  if (v && typeof v == "string" && !h) {
430
430
  if (v.startsWith(g)) {
431
431
  const T = JSON.parse(_.data.replace(g, ""));
432
- n(m.silentLoginAsync_end, {}), f.remove(), h = !0, d(T);
432
+ s(m.silentLoginAsync_end, {}), f.remove(), h = !0, d(T);
433
433
  } else if (v.startsWith(w)) {
434
434
  const T = JSON.parse(_.data.replace(w, ""));
435
- n(m.silentLoginAsync_error, T), f.remove(), h = !0, l(new Error("oidc_" + T.error));
435
+ s(m.silentLoginAsync_error, T), f.remove(), h = !0, l(new Error("oidc_" + T.error));
436
436
  }
437
437
  }
438
438
  }
439
439
  };
440
440
  const y = e.silent_login_timeout;
441
441
  setTimeout(() => {
442
- h || (n(m.silentLoginAsync_error, { reason: "timeout" }), f.remove(), h = !0, l(new Error("timeout")));
442
+ h || (s(m.silentLoginAsync_error, { reason: "timeout" }), f.remove(), h = !0, l(new Error("timeout")));
443
443
  }, y);
444
444
  } catch (h) {
445
- f.remove(), n(m.silentLoginAsync_error, h), l(h);
445
+ f.remove(), s(m.silentLoginAsync_error, h), l(h);
446
446
  }
447
447
  });
448
448
  } catch (r) {
449
- throw n(m.silentLoginAsync_error, r), r;
449
+ throw s(m.silentLoginAsync_error, r), r;
450
450
  }
451
- }, Ue = (s, e, n, t, o) => (i = null, r = void 0) => {
451
+ }, Ue = (n, e, s, t, o) => (i = null, r = void 0) => {
452
452
  i = { ...i };
453
- const c = (u, f, d) => oe(e, n, t.bind(o))(u, f, d);
453
+ const c = (u, f, d) => oe(e, s, t.bind(o))(u, f, d);
454
454
  return (async () => {
455
455
  o.timeoutId && M.clearTimeout(o.timeoutId);
456
456
  let u;
457
457
  i && "state" in i && (u = i.state, delete i.state);
458
458
  try {
459
- const f = n.extras ? { ...n.extras, ...i } : i, d = await c({
459
+ const f = s.extras ? { ...s.extras, ...i } : i, d = await c({
460
460
  ...f,
461
461
  prompt: "none"
462
462
  }, u, r);
@@ -466,35 +466,35 @@ const K = (s, e, n, t = null) => {
466
466
  return f;
467
467
  }
468
468
  })();
469
- }, Ve = (s, e, n) => (t, o, i, r = !1) => {
470
- const c = (a, u = void 0, f = void 0) => oe(s.configurationName, n, s.publishEvent.bind(s))(a, u, f);
469
+ }, Ve = (n, e, s) => (t, o, i, r = !1) => {
470
+ const c = (a, u = void 0, f = void 0) => oe(n.configurationName, s, n.publishEvent.bind(n))(a, u, f);
471
471
  return new Promise((a, u) => {
472
- if (n.silent_login_uri && n.silent_redirect_uri && n.monitor_session && t && i && !r) {
472
+ if (s.silent_login_uri && s.silent_redirect_uri && s.monitor_session && t && i && !r) {
473
473
  const f = () => {
474
- s.checkSessionIFrame.stop();
475
- const d = s.tokens;
474
+ n.checkSessionIFrame.stop();
475
+ const d = n.tokens;
476
476
  if (d === null)
477
477
  return;
478
478
  const l = d.idToken, h = d.idTokenPayload;
479
479
  return c({
480
480
  prompt: "none",
481
481
  id_token_hint: l,
482
- scope: n.scope || "openid"
482
+ scope: s.scope || "openid"
483
483
  }).then((y) => {
484
484
  const _ = y.tokens.idTokenPayload;
485
485
  if (h.sub === _.sub) {
486
486
  const g = y.sessionState;
487
- s.checkSessionIFrame.start(y.sessionState), h.sid === _.sid ? console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:", g) : console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:", g);
487
+ n.checkSessionIFrame.start(y.sessionState), h.sid === _.sid ? console.debug("SessionMonitor._callback: Same sub still logged in at OP, restarting check session iframe; session_state:", g) : console.debug("SessionMonitor._callback: Same sub still logged in at OP, session state has changed, restarting check session iframe; session_state:", g);
488
488
  } else
489
489
  console.debug("SessionMonitor._callback: Different subject signed into OP:", _.sub);
490
490
  }).catch(async (y) => {
491
491
  console.warn("SessionMonitor._callback: Silent login failed, logging out other tabs:", y);
492
492
  for (const [_, g] of Object.entries(e))
493
- await g.logoutOtherTabAsync(n.client_id, h.sub);
493
+ await g.logoutOtherTabAsync(s.client_id, h.sub);
494
494
  });
495
495
  };
496
- s.checkSessionIFrame = new Ie(f, o, t), s.checkSessionIFrame.load().then(() => {
497
- s.checkSessionIFrame.start(i), a(s.checkSessionIFrame);
496
+ n.checkSessionIFrame = new Ie(f, o, t), n.checkSessionIFrame.load().then(() => {
497
+ n.checkSessionIFrame.start(i), a(n.checkSessionIFrame);
498
498
  }).catch((d) => {
499
499
  u(d);
500
500
  });
@@ -505,86 +505,86 @@ const K = (s, e, n, t = null) => {
505
505
  var Ke = qe, C = [], fe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
506
506
  for (var B = 0, Me = fe.length; B < Me; ++B)
507
507
  C[B] = fe[B];
508
- function Je(s) {
509
- return C[s >> 18 & 63] + C[s >> 12 & 63] + C[s >> 6 & 63] + C[s & 63];
508
+ function Je(n) {
509
+ return C[n >> 18 & 63] + C[n >> 12 & 63] + C[n >> 6 & 63] + C[n & 63];
510
510
  }
511
- function Be(s, e, n) {
512
- for (var t, o = [], i = e; i < n; i += 3)
513
- t = (s[i] << 16 & 16711680) + (s[i + 1] << 8 & 65280) + (s[i + 2] & 255), o.push(Je(t));
511
+ function Be(n, e, s) {
512
+ for (var t, o = [], i = e; i < s; i += 3)
513
+ t = (n[i] << 16 & 16711680) + (n[i + 1] << 8 & 65280) + (n[i + 2] & 255), o.push(Je(t));
514
514
  return o.join("");
515
515
  }
516
- function qe(s) {
517
- for (var e, n = s.length, t = n % 3, o = [], i = 16383, r = 0, c = n - t; r < c; r += i)
518
- o.push(Be(s, r, r + i > c ? c : r + i));
519
- return t === 1 ? (e = s[n - 1], o.push(
516
+ function qe(n) {
517
+ for (var e, s = n.length, t = s % 3, o = [], i = 16383, r = 0, c = s - t; r < c; r += i)
518
+ o.push(Be(n, r, r + i > c ? c : r + i));
519
+ return t === 1 ? (e = n[s - 1], o.push(
520
520
  C[e >> 2] + C[e << 4 & 63] + "=="
521
- )) : t === 2 && (e = (s[n - 2] << 8) + s[n - 1], o.push(
521
+ )) : t === 2 && (e = (n[s - 2] << 8) + n[s - 1], o.push(
522
522
  C[e >> 10] + C[e >> 4 & 63] + C[e << 2 & 63] + "="
523
523
  )), o.join("");
524
524
  }
525
525
  const pe = () => {
526
- const s = typeof window < "u" && !!window.crypto, e = s && !!window.crypto.subtle;
527
- return { hasCrypto: s, hasSubtleCrypto: e };
528
- }, Q = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", je = (s) => {
526
+ const n = typeof window < "u" && !!window.crypto, e = n && !!window.crypto.subtle;
527
+ return { hasCrypto: n, hasSubtleCrypto: e };
528
+ }, Q = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", je = (n) => {
529
529
  const e = [];
530
- for (let n = 0; n < s.byteLength; n += 1) {
531
- const t = s[n] % Q.length;
530
+ for (let s = 0; s < n.byteLength; s += 1) {
531
+ const t = n[s] % Q.length;
532
532
  e.push(Q[t]);
533
533
  }
534
534
  return e.join("");
535
- }, He = (s) => Ke(new Uint8Array(s)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""), Z = (s) => {
536
- const e = new Uint8Array(s), { hasCrypto: n } = pe();
537
- if (n)
535
+ }, He = (n) => Ke(new Uint8Array(n)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""), Z = (n) => {
536
+ const e = new Uint8Array(n), { hasCrypto: s } = pe();
537
+ if (s)
538
538
  window.crypto.getRandomValues(e);
539
539
  else
540
- for (let t = 0; t < s; t += 1)
540
+ for (let t = 0; t < n; t += 1)
541
541
  e[t] = Math.random() * Q.length | 0;
542
542
  return je(e);
543
543
  };
544
- function Ge(s) {
545
- const e = new ArrayBuffer(s.length), n = new Uint8Array(e);
546
- for (let t = 0; t < s.length; t++)
547
- n[t] = s.charCodeAt(t);
548
- return n;
544
+ function Ge(n) {
545
+ const e = new ArrayBuffer(n.length), s = new Uint8Array(e);
546
+ for (let t = 0; t < n.length; t++)
547
+ s[t] = n.charCodeAt(t);
548
+ return s;
549
549
  }
550
- function we(s) {
551
- return new Promise((e, n) => {
552
- crypto.subtle.digest("SHA-256", Ge(s)).then((t) => e(He(new Uint8Array(t))), (t) => n(t));
550
+ function we(n) {
551
+ return new Promise((e, s) => {
552
+ crypto.subtle.digest("SHA-256", Ge(n)).then((t) => e(He(new Uint8Array(t))), (t) => s(t));
553
553
  });
554
554
  }
555
- const Xe = (s) => {
556
- if (s.length < 43 || s.length > 128)
555
+ const Xe = (n) => {
556
+ if (n.length < 43 || n.length > 128)
557
557
  return Promise.reject(new Error("Invalid code length."));
558
558
  const { hasSubtleCrypto: e } = pe();
559
- return e ? we(s) : Promise.reject(new Error("window.crypto.subtle is unavailable."));
560
- }, D = {}, Ye = (s, e = window.sessionStorage, n) => {
561
- if (!D[s] && e) {
562
- const o = e.getItem(s);
563
- o && (D[s] = JSON.parse(o));
564
- }
565
- const t = 1e3 * n;
566
- return D[s] && D[s].timestamp + t > Date.now() ? D[s].result : null;
567
- }, ze = (s, e, n = window.sessionStorage) => {
559
+ return e ? we(n) : Promise.reject(new Error("window.crypto.subtle is unavailable."));
560
+ }, D = {}, Ye = (n, e = window.sessionStorage, s) => {
561
+ if (!D[n] && e) {
562
+ const o = e.getItem(n);
563
+ o && (D[n] = JSON.parse(o));
564
+ }
565
+ const t = 1e3 * s;
566
+ return D[n] && D[n].timestamp + t > Date.now() ? D[n].result : null;
567
+ }, ze = (n, e, s = window.sessionStorage) => {
568
568
  const t = Date.now();
569
- D[s] = { result: e, timestamp: t }, n && n.setItem(s, JSON.stringify({ result: e, timestamp: t }));
570
- }, Qe = 60 * 60, Ze = (s) => async (e, n = Qe, t = window.sessionStorage, o = 1e4) => {
571
- const i = `${e}/.well-known/openid-configuration`, r = `oidc.server:${e}`, c = Ye(r, t, n);
569
+ D[n] = { result: e, timestamp: t }, s && s.setItem(n, JSON.stringify({ result: e, timestamp: t }));
570
+ }, Qe = 60 * 60, Ze = (n) => async (e, s = Qe, t = window.sessionStorage, o = 1e4) => {
571
+ const i = `${e}/.well-known/openid-configuration`, r = `oidc.server:${e}`, c = Ye(r, t, s);
572
572
  if (c)
573
- return new se(c);
574
- const a = await J(s)(i, {}, o);
573
+ return new ne(c);
574
+ const a = await J(n)(i, {}, o);
575
575
  if (a.status !== 200)
576
576
  return null;
577
577
  const u = await a.json();
578
- return ze(r, u, t), new se(u);
579
- }, J = (s) => async (e, n = {}, t = 1e4, o = 0) => {
578
+ return ze(r, u, t), new ne(u);
579
+ }, J = (n) => async (e, s = {}, t = 1e4, o = 0) => {
580
580
  let i;
581
581
  try {
582
582
  const r = new AbortController();
583
- setTimeout(() => r.abort(), t), i = await s(e, { ...n, signal: r.signal });
583
+ setTimeout(() => r.abort(), t), i = await n(e, { ...s, signal: r.signal });
584
584
  } catch (r) {
585
585
  if (r.name === "AbortError" || r.message === "Network request failed") {
586
586
  if (o <= 1)
587
- return await J(s)(e, n, t, o + 1);
587
+ return await J(n)(e, s, t, o + 1);
588
588
  throw r;
589
589
  } else
590
590
  throw console.error(r.message), r;
@@ -593,9 +593,9 @@ const Xe = (s) => {
593
593
  }, ee = {
594
594
  refresh_token: "refresh_token",
595
595
  access_token: "access_token"
596
- }, he = (s) => async (e, n, t = ee.refresh_token, o, i = 1e4) => {
596
+ }, he = (n) => async (e, s, t = ee.refresh_token, o, i = 1e4) => {
597
597
  const r = {
598
- token: n,
598
+ token: s,
599
599
  token_type_hint: t,
600
600
  client_id: o
601
601
  }, c = [];
@@ -604,7 +604,7 @@ const Xe = (s) => {
604
604
  c.push(`${d}=${l}`);
605
605
  }
606
606
  const a = c.join("&");
607
- return (await J(s)(e, {
607
+ return (await J(n)(e, {
608
608
  method: "POST",
609
609
  headers: {
610
610
  "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
@@ -613,15 +613,15 @@ const Xe = (s) => {
613
613
  }, i)).status !== 200 ? { success: !1 } : {
614
614
  success: !0
615
615
  };
616
- }, es = (s) => async (e, n, t, o, i = {}, r, c = 1e4) => {
616
+ }, en = (n) => async (e, s, t, o, i = {}, r, c = 1e4) => {
617
617
  for (const [h, y] of Object.entries(t))
618
- n[h] === void 0 && (n[h] = y);
618
+ s[h] === void 0 && (s[h] = y);
619
619
  const a = [];
620
- for (const h in n) {
621
- const y = encodeURIComponent(h), _ = encodeURIComponent(n[h]);
620
+ for (const h in s) {
621
+ const y = encodeURIComponent(h), _ = encodeURIComponent(s[h]);
622
622
  a.push(`${y}=${_}`);
623
623
  }
624
- const u = a.join("&"), f = await J(s)(e, {
624
+ const u = a.join("&"), f = await J(n)(e, {
625
625
  method: "POST",
626
626
  headers: {
627
627
  "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
@@ -638,20 +638,20 @@ const Xe = (s) => {
638
638
  data: te(d, o, r),
639
639
  demonstratingProofOfPossessionNonce: l
640
640
  };
641
- }, ss = (s, e) => async (n, t) => {
641
+ }, nn = (n, e) => async (s, t) => {
642
642
  t = t ? { ...t } : {};
643
643
  const o = Z(128), i = await Xe(o);
644
- await s.setCodeVerifierAsync(o), await s.setStateAsync(t.state), t.code_challenge = i, t.code_challenge_method = "S256";
644
+ await n.setCodeVerifierAsync(o), await n.setStateAsync(t.state), t.code_challenge = i, t.code_challenge_method = "S256";
645
645
  let r = "";
646
646
  if (t)
647
647
  for (const [c, a] of Object.entries(t))
648
648
  r === "" ? r += "?" : r += "&", r += `${c}=${encodeURIComponent(a)}`;
649
- e.open(`${n}${r}`);
650
- }, j = "DPoP-Nonce", ns = (s) => async (e, n, t, o, i = 1e4) => {
651
- n = n ? { ...n } : {}, n.code_verifier = await s.getCodeVerifierAsync();
649
+ e.open(`${s}${r}`);
650
+ }, j = "DPoP-Nonce", sn = (n) => async (e, s, t, o, i = 1e4) => {
651
+ s = s ? { ...s } : {}, s.code_verifier = await n.getCodeVerifierAsync();
652
652
  const r = [];
653
- for (const d in n) {
654
- const l = encodeURIComponent(d), h = encodeURIComponent(n[d]);
653
+ for (const d in s) {
654
+ const l = encodeURIComponent(d), h = encodeURIComponent(s[d]);
655
655
  r.push(`${l}=${h}`);
656
656
  }
657
657
  const c = r.join("&"), a = await J(fetch)(e, {
@@ -662,7 +662,7 @@ const Xe = (s) => {
662
662
  },
663
663
  body: c
664
664
  }, i);
665
- if (await Promise.all([s.setCodeVerifierAsync(null), s.setStateAsync(null)]), a.status !== 200)
665
+ if (await Promise.all([n.setCodeVerifierAsync(null), n.setStateAsync(null)]), a.status !== 200)
666
666
  return { success: !1, status: a.status };
667
667
  let u = null;
668
668
  a.headers.has(j) && (u = a.headers.get(j));
@@ -670,86 +670,86 @@ const Xe = (s) => {
670
670
  return {
671
671
  success: !0,
672
672
  data: {
673
- state: n.state,
673
+ state: s.state,
674
674
  tokens: te(f, null, o),
675
675
  demonstratingProofOfPossessionNonce: u
676
676
  }
677
677
  };
678
- }, Ae = (s) => {
679
- const e = s.match(
678
+ }, Ae = (n) => {
679
+ const e = n.match(
680
680
  // eslint-disable-next-line no-useless-escape
681
681
  /^([a-z][\w-]+\:)\/\/(([^:\/?#]*)(?:\:([0-9]+))?)([\/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/
682
682
  );
683
683
  if (!e)
684
684
  throw new Error("Invalid URL");
685
- let n = e[6], t = e[7];
685
+ let s = e[6], t = e[7];
686
686
  if (t) {
687
687
  const o = t.split("?");
688
- o.length === 2 && (t = o[0], n = o[1]);
688
+ o.length === 2 && (t = o[0], s = o[1]);
689
689
  }
690
- return n.startsWith("?") && (n = n.slice(1)), e && {
691
- href: s,
690
+ return s.startsWith("?") && (s = s.slice(1)), e && {
691
+ href: n,
692
692
  protocol: e[1],
693
693
  host: e[2],
694
694
  hostname: e[3],
695
695
  port: e[4],
696
696
  path: e[5],
697
- search: n,
697
+ search: s,
698
698
  hash: t
699
699
  };
700
- }, vs = (s) => {
701
- const e = Ae(s);
702
- let { path: n } = e;
703
- n.endsWith("/") && (n = n.slice(0, -1));
700
+ }, Sn = (n) => {
701
+ const e = Ae(n);
702
+ let { path: s } = e;
703
+ s.endsWith("/") && (s = s.slice(0, -1));
704
704
  let { hash: t } = e;
705
- return t === "#_=_" && (t = ""), t && (n += t), n;
706
- }, H = (s) => {
707
- const e = Ae(s), { search: n } = e;
708
- return ts(n);
709
- }, ts = (s) => {
705
+ return t === "#_=_" && (t = ""), t && (s += t), s;
706
+ }, H = (n) => {
707
+ const e = Ae(n), { search: s } = e;
708
+ return tn(s);
709
+ }, tn = (n) => {
710
710
  const e = {};
711
- let n, t, o;
712
- const i = s.split("&");
711
+ let s, t, o;
712
+ const i = n.split("&");
713
713
  for (t = 0, o = i.length; t < o; t++)
714
- n = i[t].split("="), e[decodeURIComponent(n[0])] = decodeURIComponent(n[1]);
714
+ s = i[t].split("="), e[decodeURIComponent(s[0])] = decodeURIComponent(s[1]);
715
715
  return e;
716
716
  };
717
- function ve(s) {
718
- return new TextEncoder().encode(s);
717
+ function ve(n) {
718
+ return new TextEncoder().encode(n);
719
719
  }
720
- function Se(s) {
721
- return btoa(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+/g, "");
720
+ function Se(n) {
721
+ return btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+/g, "");
722
722
  }
723
- function os(s) {
724
- return encodeURIComponent(s).replace(/%([0-9A-F]{2})/g, function(t, o) {
723
+ function on(n) {
724
+ return encodeURIComponent(n).replace(/%([0-9A-F]{2})/g, function(t, o) {
725
725
  return String.fromCharCode(parseInt(o, 16));
726
726
  });
727
727
  }
728
- function Te(s) {
728
+ function Te(n) {
729
729
  let e = "";
730
- return s.forEach(function(n) {
731
- e += String.fromCharCode(n);
730
+ return n.forEach(function(s) {
731
+ e += String.fromCharCode(s);
732
732
  }), Se(e);
733
733
  }
734
- function _e(s) {
735
- return Se(os(s));
734
+ function _e(n) {
735
+ return Se(on(n));
736
736
  }
737
737
  var be = {};
738
- be.sign = (s, e, n, t = "dpop+jwt") => {
739
- s = Object.assign({}, s), e.typ = t, e.alg = "ES256", e.kid || (e.jwk = { kty: s.kty, crv: s.crv, x: s.x, y: s.y });
738
+ be.sign = (n, e, s, t = "dpop+jwt") => {
739
+ n = Object.assign({}, n), e.typ = t, e.alg = "ES256", e.kid || (e.jwk = { kty: n.kty, crv: n.crv, x: n.x, y: n.y });
740
740
  const o = {
741
741
  // @ts-ignore
742
742
  // JWT "headers" really means JWS "protected headers"
743
743
  protected: _e(JSON.stringify(e)),
744
744
  // @ts-ignore
745
745
  // JWT "claims" are really a JSON-defined JWS "payload"
746
- payload: _e(JSON.stringify(n))
746
+ payload: _e(JSON.stringify(s))
747
747
  }, i = {
748
748
  name: "ECDSA",
749
749
  namedCurve: "P-256",
750
750
  hash: { name: "ES256" }
751
751
  }, r = !0, c = ["sign"];
752
- return window.crypto.subtle.importKey("jwk", s, i, r, c).then(function(a) {
752
+ return window.crypto.subtle.importKey("jwk", n, i, r, c).then(function(a) {
753
753
  const u = ve(o.protected + "." + o.payload), f = { name: "ECDSA", hash: { name: "SHA-256" } };
754
754
  return window.crypto.subtle.sign(f, a, u).then(function(d) {
755
755
  return o.signature = Te(new Uint8Array(d)), o.protected + "." + o.payload + "." + o.signature;
@@ -758,54 +758,54 @@ be.sign = (s, e, n, t = "dpop+jwt") => {
758
758
  };
759
759
  const ie = {};
760
760
  ie.generate = function() {
761
- const s = {
761
+ const n = {
762
762
  name: "ECDSA",
763
763
  namedCurve: "P-256"
764
- }, e = !0, n = ["sign", "verify"];
765
- return window.crypto.subtle.generateKey(s, e, n).then(function(t) {
764
+ }, e = !0, s = ["sign", "verify"];
765
+ return window.crypto.subtle.generateKey(n, e, s).then(function(t) {
766
766
  return window.crypto.subtle.exportKey("jwk", t.privateKey);
767
767
  });
768
768
  };
769
- ie.neuter = function(s) {
770
- const e = Object.assign({}, s);
769
+ ie.neuter = function(n) {
770
+ const e = Object.assign({}, n);
771
771
  return delete e.d, e.key_ops = ["verify"], e;
772
772
  };
773
773
  var Pe = {};
774
- Pe.thumbprint = function(s) {
775
- const e = '{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV", s.crv).replace("X", s.x).replace("Y", s.y);
776
- return window.crypto.subtle.digest({ name: "SHA-256" }, ve(e)).then(function(n) {
777
- return Te(new Uint8Array(n));
774
+ Pe.thumbprint = function(n) {
775
+ const e = '{"crv":"CRV","kty":"EC","x":"X","y":"Y"}'.replace("CRV", n.crv).replace("X", n.x).replace("Y", n.y);
776
+ return window.crypto.subtle.digest({ name: "SHA-256" }, ve(e)).then(function(s) {
777
+ return Te(new Uint8Array(s));
778
778
  });
779
779
  };
780
- const is = function() {
781
- const s = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", e = "0123456789abcdef";
782
- let n = 0, t = "";
780
+ const rn = function() {
781
+ const n = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx", e = "0123456789abcdef";
782
+ let s = 0, t = "";
783
783
  for (let o = 0; o < 36; o++)
784
- s[o] !== "-" && s[o] !== "4" && (n = Math.random() * 16 | 0), s[o] === "x" ? t += e[n] : s[o] === "y" ? (n &= 3, n |= 8, t += e[n]) : t += s[o];
784
+ n[o] !== "-" && n[o] !== "4" && (s = Math.random() * 16 | 0), n[o] === "x" ? t += e[s] : n[o] === "y" ? (s &= 3, s |= 8, t += e[s]) : t += n[o];
785
785
  return t;
786
- }, rs = () => ie.generate().then(function(s) {
787
- return s;
788
- }), Oe = (s, e = "POST", n, t = {}) => {
786
+ }, an = () => ie.generate().then(function(n) {
787
+ return n;
788
+ }), Oe = (n, e = "POST", s, t = {}) => {
789
789
  const o = {
790
790
  // https://www.rfc-editor.org/rfc/rfc9449.html#name-concept
791
- jit: btoa(is()),
791
+ jti: btoa(rn()),
792
792
  htm: e,
793
- htu: n,
793
+ htu: s,
794
794
  iat: Math.round(Date.now() / 1e3),
795
795
  ...t
796
796
  };
797
- return Pe.thumbprint(s).then(function(i) {
798
- return be.sign(s, {
797
+ return Pe.thumbprint(n).then(function(i) {
798
+ return be.sign(n, {
799
799
  /*kid: kid*/
800
800
  }, o).then(function(r) {
801
801
  return r;
802
802
  });
803
803
  });
804
- }, as = (s, e, n, t, o) => (i = void 0, r = null, c = !1, a = void 0) => {
804
+ }, cn = (n, e, s, t, o) => (i = void 0, r = null, c = !1, a = void 0) => {
805
805
  const u = r;
806
806
  return r = { ...r }, (async () => {
807
807
  const d = i || o.getPath();
808
- if ("state" in r || (r.state = Z(16)), n(m.loginAsync_begin, {}), r)
808
+ if ("state" in r || (r.state = Z(16)), s(m.loginAsync_begin, {}), r)
809
809
  for (const l of Object.keys(r))
810
810
  l.endsWith(":token_request") && delete r[l];
811
811
  try {
@@ -813,12 +813,12 @@ const is = function() {
813
813
  a || (a = e.scope);
814
814
  const h = e.extras ? { ...e.extras, ...r } : r;
815
815
  h.nonce || (h.nonce = Z(12));
816
- const y = { nonce: h.nonce }, _ = await E(e, s), g = await t(e.authority, e.authority_configuration);
816
+ const y = { nonce: h.nonce }, _ = await E(e, n), g = await t(e.authority, e.authority_configuration);
817
817
  let w;
818
818
  if (_)
819
819
  _.setLoginParams({ callbackPath: d, extras: u }), await _.initAsync(g, "loginAsync", e), await _.setNonceAsync(y), _.startKeepAliveServiceWorker(), w = _;
820
820
  else {
821
- const T = I(s, e.storage ?? sessionStorage);
821
+ const T = I(n, e.storage ?? sessionStorage);
822
822
  T.setLoginParams({ callbackPath: d, extras: u }), await T.setNonceAsync(y), w = T;
823
823
  }
824
824
  const v = {
@@ -828,20 +828,20 @@ const is = function() {
828
828
  response_type: "code",
829
829
  ...h
830
830
  };
831
- await ss(w, o)(g.authorizationEndpoint, v);
831
+ await nn(w, o)(g.authorizationEndpoint, v);
832
832
  } catch (l) {
833
- throw n(m.loginAsync_error, l), l;
833
+ throw s(m.loginAsync_error, l), l;
834
834
  }
835
835
  })();
836
- }, cs = (s) => async (e = !1) => {
836
+ }, ln = (n) => async (e = !1) => {
837
837
  try {
838
- s.publishEvent(m.loginCallbackAsync_begin, {});
839
- const n = s.configuration, t = n.client_id, o = e ? n.silent_redirect_uri : n.redirect_uri, i = n.authority, r = n.token_request_timeout, c = await s.initAsync(i, n.authority_configuration), a = s.location.getCurrentHref(), f = H(a).session_state, d = await E(n, s.configurationName);
838
+ n.publishEvent(m.loginCallbackAsync_begin, {});
839
+ const s = n.configuration, t = s.client_id, o = e ? s.silent_redirect_uri : s.redirect_uri, i = s.authority, r = s.token_request_timeout, c = await n.initAsync(i, s.authority_configuration), a = n.location.getCurrentHref(), f = H(a).session_state, d = await E(s, n.configurationName);
840
840
  let l, h, y, _;
841
841
  if (d)
842
- await d.initAsync(c, "loginCallbackAsync", n), await d.setSessionStateAsync(f), h = await d.getNonceAsync(), y = d.getLoginParams(), _ = await d.getStateAsync(), d.startKeepAliveServiceWorker(), l = d;
842
+ await d.initAsync(c, "loginCallbackAsync", s), await d.setSessionStateAsync(f), h = await d.getNonceAsync(), y = d.getLoginParams(), _ = await d.getStateAsync(), d.startKeepAliveServiceWorker(), l = d;
843
843
  else {
844
- const S = I(s.configurationName, n.storage ?? sessionStorage);
844
+ const S = I(n.configurationName, s.storage ?? sessionStorage);
845
845
  await S.setSessionStateAsync(f), h = await S.getNonceAsync(), y = S.getLoginParams(), _ = await S.getStateAsync(), l = S;
846
846
  }
847
847
  const g = H(a);
@@ -852,25 +852,25 @@ const is = function() {
852
852
  const w = {
853
853
  code: g.code,
854
854
  grant_type: "authorization_code",
855
- client_id: n.client_id,
855
+ client_id: s.client_id,
856
856
  redirect_uri: o
857
857
  }, v = {};
858
- if (n.token_request_extras)
859
- for (const [S, W] of Object.entries(n.token_request_extras))
858
+ if (s.token_request_extras)
859
+ for (const [S, W] of Object.entries(s.token_request_extras))
860
860
  v[S] = W;
861
861
  if (y && y.extras)
862
862
  for (const [S, W] of Object.entries(y.extras))
863
863
  S.endsWith(":token_request") && (v[S.replace(":token_request", "")] = W);
864
864
  const T = c.tokenEndpoint, F = {};
865
- if (n.demonstrating_proof_of_possession) {
866
- const S = await rs();
867
- d ? await d.setDemonstratingProofOfPossessionJwkAsync(S) : await I(s.configurationName, n.storage).setDemonstratingProofOfPossessionJwkAsync(S), F.DPoP = await Oe(S, "POST", T);
865
+ if (s.demonstrating_proof_of_possession) {
866
+ const S = await an();
867
+ d ? await d.setDemonstratingProofOfPossessionJwkAsync(S) : await I(n.configurationName, s.storage).setDemonstratingProofOfPossessionJwkAsync(S), F.DPoP = await Oe(S, "POST", T);
868
868
  }
869
- const p = await ns(l)(
869
+ const p = await sn(l)(
870
870
  T,
871
871
  { ...w, ...v },
872
872
  F,
873
- s.configuration.token_renew_mode,
873
+ n.configuration.token_renew_mode,
874
874
  r
875
875
  );
876
876
  if (!p.success)
@@ -889,44 +889,44 @@ const is = function() {
889
889
  throw new Error("Demonstration of proof of possession require Access token not hidden by service worker");
890
890
  }
891
891
  if (d)
892
- await d.initAsync(o, "syncTokensAsync", n), k = d.getLoginParams(), O && await d.setDemonstratingProofOfPossessionNonce(O);
892
+ await d.initAsync(o, "syncTokensAsync", s), k = d.getLoginParams(), O && await d.setDemonstratingProofOfPossessionNonce(O);
893
893
  else {
894
- const S = I(s.configurationName, n.storage);
894
+ const S = I(n.configurationName, s.storage);
895
895
  k = S.getLoginParams(), O && await S.setDemonstratingProofOfPossessionNonce(O);
896
896
  }
897
- return await s.startCheckSessionAsync(c.checkSessionIframe, t, f, e), s.publishEvent(m.loginCallbackAsync_end, {}), {
897
+ return await n.startCheckSessionAsync(c.checkSessionIframe, t, f, e), n.publishEvent(m.loginCallbackAsync_end, {}), {
898
898
  tokens: A,
899
899
  state: "request.state",
900
900
  callbackPath: k.callbackPath
901
901
  };
902
- } catch (n) {
903
- throw console.error(n), s.publishEvent(m.loginCallbackAsync_error, n), n;
902
+ } catch (s) {
903
+ throw console.error(s), n.publishEvent(m.loginCallbackAsync_error, s), s;
904
904
  }
905
905
  }, ye = {
906
906
  access_token: "access_token",
907
907
  refresh_token: "refresh_token"
908
- }, ls = (s) => async (e) => {
909
- M.clearTimeout(s.timeoutId), s.timeoutId = null, s.checkSessionIFrame && s.checkSessionIFrame.stop();
910
- const n = await E(s.configuration, s.configurationName);
911
- n ? await n.clearAsync(e) : await I(s.configurationName, s.configuration.storage).clearAsync(e), s.tokens = null, s.userInfo = null;
912
- }, us = (s, e, n, t, o) => async (i = void 0, r = null) => {
913
- const c = s.configuration, a = await s.initAsync(c.authority, c.authority_configuration);
908
+ }, un = (n) => async (e) => {
909
+ M.clearTimeout(n.timeoutId), n.timeoutId = null, n.checkSessionIFrame && n.checkSessionIFrame.stop();
910
+ const s = await E(n.configuration, n.configurationName);
911
+ s ? await s.clearAsync(e) : await I(n.configurationName, n.configuration.storage).clearAsync(e), n.tokens = null, n.userInfo = null;
912
+ }, dn = (n, e, s, t, o) => async (i = void 0, r = null) => {
913
+ const c = n.configuration, a = await n.initAsync(c.authority, c.authority_configuration);
914
914
  i && typeof i != "string" && (i = void 0, t.warn("callbackPathOrUrl path is not a string"));
915
915
  const u = i ?? o.getPath();
916
916
  let f = !1;
917
917
  i && (f = i.includes("https://") || i.includes("http://"));
918
- const d = f ? i : o.getOrigin() + u, l = s.tokens ? s.tokens.idToken : "";
918
+ const d = f ? i : o.getOrigin() + u, l = n.tokens ? n.tokens.idToken : "";
919
919
  try {
920
920
  const y = a.revocationEndpoint;
921
921
  if (y) {
922
- const _ = [], g = s.tokens ? s.tokens.accessToken : null;
922
+ const _ = [], g = n.tokens ? n.tokens.accessToken : null;
923
923
  if (g && c.logout_tokens_to_invalidate.includes(ye.access_token)) {
924
- const v = he(n)(y, g, ee.access_token, c.client_id);
924
+ const v = he(s)(y, g, ee.access_token, c.client_id);
925
925
  _.push(v);
926
926
  }
927
- const w = s.tokens ? s.tokens.refreshToken : null;
927
+ const w = n.tokens ? n.tokens.refreshToken : null;
928
928
  if (w && c.logout_tokens_to_invalidate.includes(ye.refresh_token)) {
929
- const v = he(n)(y, w, ee.refresh_token, c.client_id);
929
+ const v = he(s)(y, w, ee.refresh_token, c.client_id);
930
930
  _.push(v);
931
931
  }
932
932
  _.length > 0 && await Promise.all(_);
@@ -934,10 +934,10 @@ const is = function() {
934
934
  } catch (y) {
935
935
  t.warn("logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error"), t.warn(y);
936
936
  }
937
- const h = s.tokens && s.tokens.idTokenPayload ? s.tokens.idTokenPayload.sub : null;
938
- await s.destroyAsync("LOGGED_OUT");
937
+ const h = n.tokens && n.tokens.idTokenPayload ? n.tokens.idTokenPayload.sub : null;
938
+ await n.destroyAsync("LOGGED_OUT");
939
939
  for (const [y, _] of Object.entries(e))
940
- _ !== s && await s.logoutSameTabAsync(s.configuration.client_id, h);
940
+ _ !== n && await n.logoutSameTabAsync(n.configuration.client_id, h);
941
941
  if (a.endSessionEndpoint) {
942
942
  r || (r = {
943
943
  id_token_hint: l
@@ -949,25 +949,25 @@ const is = function() {
949
949
  o.open(`${a.endSessionEndpoint}${y}`);
950
950
  } else
951
951
  o.reload();
952
- }, ds = (s) => async (e = !1) => {
953
- if (s.userInfo != null && !e)
954
- return s.userInfo;
955
- for (; s.tokens && !z(s.tokens); )
952
+ }, fn = (n) => async (e = !1) => {
953
+ if (n.userInfo != null && !e)
954
+ return n.userInfo;
955
+ for (; n.tokens && !z(n.tokens); )
956
956
  await $({ milliseconds: 200 });
957
- if (!s.tokens)
957
+ if (!n.tokens)
958
958
  return null;
959
- const n = s.tokens.accessToken;
960
- if (!n)
959
+ const s = n.tokens.accessToken;
960
+ if (!s)
961
961
  return null;
962
- const t = s.configuration, i = (await s.initAsync(t.authority, t.authority_configuration)).userInfoEndpoint, c = await (async (a) => {
962
+ const t = n.configuration, i = (await n.initAsync(t.authority, t.authority_configuration)).userInfoEndpoint, c = await (async (a) => {
963
963
  const u = await fetch(i, {
964
964
  headers: {
965
965
  authorization: `Bearer ${a}`
966
966
  }
967
967
  });
968
968
  return u.status !== 200 ? null : u.json();
969
- })(n);
970
- return s.userInfo = c, c;
969
+ })(s);
970
+ return n.userInfo = c, c;
971
971
  };
972
972
  class G {
973
973
  open(e) {
@@ -987,8 +987,8 @@ class G {
987
987
  return window.origin;
988
988
  }
989
989
  }
990
- const fs = (s) => !!(s.os === "iOS" && s.osVersion.startsWith("12") || s.os === "Mac OS X" && s.osVersion.startsWith("10_15_6")), hs = (s) => {
991
- const e = s.appVersion, n = s.userAgent, t = "-";
990
+ const hn = (n) => !!(n.os === "iOS" && n.osVersion.startsWith("12") || n.os === "Mac OS X" && n.osVersion.startsWith("10_15_6")), _n = (n) => {
991
+ const e = n.appVersion, s = n.userAgent, t = "-";
992
992
  let o = t;
993
993
  const i = [
994
994
  { s: "Windows 10", r: /(Windows 10.0|Windows NT 10.0)/ },
@@ -1021,7 +1021,7 @@ const fs = (s) => !!(s.os === "iOS" && s.osVersion.startsWith("12") || s.os ===
1021
1021
  ];
1022
1022
  for (const c in i) {
1023
1023
  const a = i[c];
1024
- if (a.r.test(n)) {
1024
+ if (a.r.test(s)) {
1025
1025
  o = a.s;
1026
1026
  break;
1027
1027
  }
@@ -1031,11 +1031,11 @@ const fs = (s) => !!(s.os === "iOS" && s.osVersion.startsWith("12") || s.os ===
1031
1031
  case "Mac OS":
1032
1032
  case "Mac OS X":
1033
1033
  case "Android":
1034
- r = /(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(n)[1];
1034
+ r = /(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([._\d]+)/.exec(s)[1];
1035
1035
  break;
1036
1036
  case "iOS": {
1037
1037
  const c = /OS (\d+)_(\d+)_?(\d+)?/.exec(e);
1038
- r = c[1] + "." + c[2] + "." + (parseInt(c[3]) | 0);
1038
+ c != null && c.length > 2 && (r = c[1] + "." + c[2] + "." + (parseInt(c[3]) | 0));
1039
1039
  break;
1040
1040
  }
1041
1041
  }
@@ -1044,41 +1044,41 @@ const fs = (s) => !!(s.os === "iOS" && s.osVersion.startsWith("12") || s.os ===
1044
1044
  osVersion: r
1045
1045
  };
1046
1046
  };
1047
- function _s() {
1048
- const s = navigator.userAgent;
1049
- let e, n = s.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
1050
- if (/trident/i.test(n[1]))
1051
- return e = /\brv[ :]+(\d+)/g.exec(s) || [], { name: "ie", version: e[1] || "" };
1052
- if (n[1] === "Chrome" && (e = s.match(/\bOPR|Edge\/(\d+)/), e != null)) {
1047
+ function yn() {
1048
+ const n = navigator.userAgent;
1049
+ let e, s = n.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
1050
+ if (/trident/i.test(s[1]))
1051
+ return e = /\brv[ :]+(\d+)/g.exec(n) || [], { name: "ie", version: e[1] || "" };
1052
+ if (s[1] === "Chrome" && (e = n.match(/\bOPR|Edge\/(\d+)/), e != null)) {
1053
1053
  let t = e[1];
1054
1054
  if (!t) {
1055
- const o = s.split(e[0] + "/");
1055
+ const o = n.split(e[0] + "/");
1056
1056
  o.length > 1 && (t = o[1]);
1057
1057
  }
1058
1058
  return { name: "opera", version: t };
1059
1059
  }
1060
- return n = n[2] ? [n[1], n[2]] : [navigator.appName, navigator.appVersion, "-?"], (e = s.match(/version\/(\d+)/i)) != null && n.splice(1, 1, e[1]), {
1061
- name: n[0].toLowerCase(),
1062
- version: n[1]
1060
+ return s = s[2] ? [s[1], s[2]] : [navigator.appName, navigator.appVersion, "-?"], (e = n.match(/version\/(\d+)/i)) != null && s.splice(1, 1, e[1]), {
1061
+ name: s[0].toLowerCase(),
1062
+ version: s[1]
1063
1063
  };
1064
1064
  }
1065
- const ys = () => {
1066
- const { name: s, version: e } = _s();
1067
- if (s === "chrome" && parseInt(e) <= 70 || s === "opera" && (!e || parseInt(e.split(".")[0]) < 80) || s === "ie")
1065
+ const gn = () => {
1066
+ const { name: n, version: e } = yn();
1067
+ if (n === "chrome" && parseInt(e) <= 70 || n === "opera" && (!e || parseInt(e.split(".")[0]) < 80) || n === "ie")
1068
1068
  return !1;
1069
- const n = hs(navigator);
1070
- return !fs(n);
1071
- }, gs = () => fetch;
1072
- class se {
1069
+ const s = _n(navigator);
1070
+ return !hn(s);
1071
+ }, kn = () => fetch;
1072
+ class ne {
1073
1073
  constructor(e) {
1074
1074
  this.authorizationEndpoint = e.authorization_endpoint, this.tokenEndpoint = e.token_endpoint, this.revocationEndpoint = e.revocation_endpoint, this.userInfoEndpoint = e.userinfo_endpoint, this.checkSessionIframe = e.check_session_iframe, this.issuer = e.issuer, this.endSessionEndpoint = e.end_session_endpoint;
1075
1075
  }
1076
1076
  }
1077
- const N = {}, ks = (s, e = new G()) => (n, t = "default") => (N[t] || (N[t] = new R(n, t, s, e)), N[t]), ms = async (s) => {
1078
- const { parsedTokens: e, callbackPath: n } = await s.loginCallbackAsync();
1079
- return s.timeoutId = K(s, e.refreshToken, e.expiresAt), { callbackPath: n };
1080
- }, ps = (s) => Math.floor(Math.random() * s), re = class U {
1081
- constructor(e, n = "default", t, o = new G()) {
1077
+ const N = {}, mn = (n, e = new G()) => (s, t = "default") => (N[t] || (N[t] = new R(s, t, n, e)), N[t]), pn = async (n) => {
1078
+ const { parsedTokens: e, callbackPath: s } = await n.loginCallbackAsync();
1079
+ return n.timeoutId = K(n, e.refreshToken, e.expiresAt), { callbackPath: s };
1080
+ }, wn = (n) => Math.floor(Math.random() * n), re = class U {
1081
+ constructor(e, s = "default", t, o = new G()) {
1082
1082
  this.initPromise = null, this.tryKeepExistingSessionPromise = null, this.loginPromise = null, this.loginCallbackPromise = null, this.loginCallbackWithAutoTokensRenewPromise = null, this.userInfoPromise = null, this.renewTokensPromise = null, this.logoutPromise = null;
1083
1083
  let i = e.silent_login_uri;
1084
1084
  e.silent_redirect_uri && !e.silent_login_uri && (i = `${e.silent_redirect_uri.replace("-callback", "").replace("callback", "")}-login`);
@@ -1096,39 +1096,39 @@ const N = {}, ks = (s, e = new G()) => (n, t = "default") => (N[t] || (N[t] = ne
1096
1096
  authority_timeout_wellknowurl_in_millisecond: e.authority_timeout_wellknowurl_in_millisecond ?? 1e4,
1097
1097
  logout_tokens_to_invalidate: e.logout_tokens_to_invalidate ?? ["access_token", "refresh_token"],
1098
1098
  service_worker_update_require_callback: c,
1099
- service_worker_activate: e.service_worker_activate ?? ys
1100
- }, this.getFetch = t ?? gs, this.configurationName = n, this.tokens = null, this.userInfo = null, this.events = [], this.timeoutId = null, this.synchroniseTokensAsync.bind(this), this.loginCallbackWithAutoTokensRenewAsync.bind(this), this.initAsync.bind(this), this.loginCallbackAsync.bind(this), this.subscribeEvents.bind(this), this.removeEventSubscription.bind(this), this.publishEvent.bind(this), this.destroyAsync.bind(this), this.logoutAsync.bind(this), this.renewTokensAsync.bind(this), this.initAsync(this.configuration.authority, this.configuration.authority_configuration);
1099
+ service_worker_activate: e.service_worker_activate ?? gn
1100
+ }, this.getFetch = t ?? kn, this.configurationName = s, this.tokens = null, this.userInfo = null, this.events = [], this.timeoutId = null, this.synchroniseTokensAsync.bind(this), this.loginCallbackWithAutoTokensRenewAsync.bind(this), this.initAsync.bind(this), this.loginCallbackAsync.bind(this), this.subscribeEvents.bind(this), this.removeEventSubscription.bind(this), this.publishEvent.bind(this), this.destroyAsync.bind(this), this.logoutAsync.bind(this), this.renewTokensAsync.bind(this), this.initAsync(this.configuration.authority, this.configuration.authority_configuration);
1101
1101
  }
1102
1102
  subscribeEvents(e) {
1103
- const n = ps(9999999999999).toString();
1104
- return this.events.push({ id: n, func: e }), n;
1103
+ const s = wn(9999999999999).toString();
1104
+ return this.events.push({ id: s, func: e }), s;
1105
1105
  }
1106
1106
  removeEventSubscription(e) {
1107
- const n = this.events.filter((t) => t.id !== e);
1108
- this.events = n;
1107
+ const s = this.events.filter((t) => t.id !== e);
1108
+ this.events = s;
1109
1109
  }
1110
- publishEvent(e, n) {
1110
+ publishEvent(e, s) {
1111
1111
  this.events.forEach((t) => {
1112
- t.func(e, n);
1112
+ t.func(e, s);
1113
1113
  });
1114
1114
  }
1115
1115
  static get(e = "default") {
1116
- const n = typeof process > "u";
1117
- if (!Object.prototype.hasOwnProperty.call(N, e) && n)
1116
+ const s = typeof process > "u";
1117
+ if (!Object.prototype.hasOwnProperty.call(N, e) && s)
1118
1118
  throw Error(`OIDC library does seem initialized.
1119
1119
  Please checkout that you are using OIDC hook inside a <OidcProvider configurationName="${e}"></OidcProvider> compoment.`);
1120
1120
  return N[e];
1121
1121
  }
1122
1122
  _silentLoginCallbackFromIFrame() {
1123
1123
  if (this.configuration.silent_redirect_uri && this.configuration.silent_login_uri) {
1124
- const e = this.location, n = H(e.getCurrentHref());
1125
- window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({ tokens: this.tokens, sessionState: n.session_state })}`, e.getOrigin());
1124
+ const e = this.location, s = H(e.getCurrentHref());
1125
+ window.parent.postMessage(`${this.configurationName}_oidc_tokens:${JSON.stringify({ tokens: this.tokens, sessionState: s.session_state })}`, e.getOrigin());
1126
1126
  }
1127
1127
  }
1128
1128
  _silentLoginErrorCallbackFromIFrame() {
1129
1129
  if (this.configuration.silent_redirect_uri && this.configuration.silent_login_uri) {
1130
- const e = this.location, n = H(e.getCurrentHref());
1131
- window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({ error: n.error })}`, e.getOrigin());
1130
+ const e = this.location, s = H(e.getCurrentHref());
1131
+ window.parent.postMessage(`${this.configurationName}_oidc_error:${JSON.stringify({ error: s.error })}`, e.getOrigin());
1132
1132
  }
1133
1133
  }
1134
1134
  async silentLoginCallbackAsync() {
@@ -1138,19 +1138,19 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1138
1138
  console.error(e), this._silentLoginErrorCallbackFromIFrame();
1139
1139
  }
1140
1140
  }
1141
- async initAsync(e, n) {
1141
+ async initAsync(e, s) {
1142
1142
  if (this.initPromise !== null)
1143
1143
  return this.initPromise;
1144
1144
  const t = async () => {
1145
- if (n != null)
1146
- return new se({
1147
- authorization_endpoint: n.authorization_endpoint,
1148
- end_session_endpoint: n.end_session_endpoint,
1149
- revocation_endpoint: n.revocation_endpoint,
1150
- token_endpoint: n.token_endpoint,
1151
- userinfo_endpoint: n.userinfo_endpoint,
1152
- check_session_iframe: n.check_session_iframe,
1153
- issuer: n.issuer
1145
+ if (s != null)
1146
+ return new ne({
1147
+ authorization_endpoint: s.authorization_endpoint,
1148
+ end_session_endpoint: s.end_session_endpoint,
1149
+ revocation_endpoint: s.revocation_endpoint,
1150
+ token_endpoint: s.token_endpoint,
1151
+ userinfo_endpoint: s.userinfo_endpoint,
1152
+ check_session_iframe: s.check_session_iframe,
1153
+ issuer: s.issuer
1154
1154
  });
1155
1155
  const i = await E(this.configuration, this.configurationName) ? window.localStorage : null;
1156
1156
  return await Ze(this.getFetch())(e, this.configuration.authority_time_cache_wellknowurl_in_second ?? 60 * 60, i, this.configuration.authority_timeout_wellknowurl_in_millisecond);
@@ -1161,19 +1161,19 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1161
1161
  if (this.tryKeepExistingSessionPromise !== null)
1162
1162
  return this.tryKeepExistingSessionPromise;
1163
1163
  const e = async () => {
1164
- let n;
1164
+ let s;
1165
1165
  if (this.tokens != null)
1166
1166
  return !1;
1167
1167
  this.publishEvent(m.tryKeepExistingSessionAsync_begin, {});
1168
1168
  try {
1169
1169
  const t = this.configuration, o = await this.initAsync(t.authority, t.authority_configuration);
1170
- if (n = await E(t, this.configurationName), n) {
1171
- const { tokens: i } = await n.initAsync(o, "tryKeepExistingSessionAsync", t);
1170
+ if (s = await E(t, this.configurationName), s) {
1171
+ const { tokens: i } = await s.initAsync(o, "tryKeepExistingSessionAsync", t);
1172
1172
  if (i) {
1173
- n.startKeepAliveServiceWorker(), this.tokens = i;
1174
- const r = n.getLoginParams(this.configurationName);
1173
+ s.startKeepAliveServiceWorker(), this.tokens = i;
1174
+ const r = s.getLoginParams(this.configurationName);
1175
1175
  this.timeoutId = K(this, this.tokens.refreshToken, this.tokens.expiresAt, r.extras);
1176
- const c = await n.getSessionStateAsync();
1176
+ const c = await s.getSessionStateAsync();
1177
1177
  return await this.startCheckSessionAsync(o.check_session_iframe, t.client_id, c), this.publishEvent(m.tryKeepExistingSessionAsync_end, {
1178
1178
  success: !0,
1179
1179
  message: "tokens inside ServiceWorker are valid"
@@ -1189,7 +1189,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1189
1189
  });
1190
1190
  const i = I(this.configurationName, t.storage ?? sessionStorage), { tokens: r } = await i.initAsync();
1191
1191
  if (r) {
1192
- this.tokens = ne(r, null, t.token_renew_mode);
1192
+ this.tokens = se(r, null, t.token_renew_mode);
1193
1193
  const c = i.getLoginParams();
1194
1194
  this.timeoutId = K(this, r.refreshToken, this.tokens.expiresAt, c.extras);
1195
1195
  const a = await i.getSessionStateAsync();
@@ -1201,36 +1201,36 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1201
1201
  }
1202
1202
  return this.publishEvent(m.tryKeepExistingSessionAsync_end, {
1203
1203
  success: !1,
1204
- message: n ? "service worker sessions not retrieved" : "session storage sessions not retrieved"
1204
+ message: s ? "service worker sessions not retrieved" : "session storage sessions not retrieved"
1205
1205
  }), !1;
1206
1206
  } catch (t) {
1207
- return console.error(t), n && await n.clearAsync(), this.publishEvent(m.tryKeepExistingSessionAsync_error, "tokens inside ServiceWorker are invalid"), !1;
1207
+ return console.error(t), s && await s.clearAsync(), this.publishEvent(m.tryKeepExistingSessionAsync_error, "tokens inside ServiceWorker are invalid"), !1;
1208
1208
  }
1209
1209
  };
1210
- return this.tryKeepExistingSessionPromise = e(), this.tryKeepExistingSessionPromise.then((n) => (this.tryKeepExistingSessionPromise = null, n));
1210
+ return this.tryKeepExistingSessionPromise = e(), this.tryKeepExistingSessionPromise.then((s) => (this.tryKeepExistingSessionPromise = null, s));
1211
1211
  }
1212
- async startCheckSessionAsync(e, n, t, o = !1) {
1213
- await Ve(this, N, this.configuration)(e, n, t, o);
1212
+ async startCheckSessionAsync(e, s, t, o = !1) {
1213
+ await Ve(this, N, this.configuration)(e, s, t, o);
1214
1214
  }
1215
- async loginAsync(e = void 0, n = null, t = !1, o = void 0, i = !1) {
1216
- return this.loginPromise !== null ? this.loginPromise : i ? Ue(window, this.configurationName, this.configuration, this.publishEvent.bind(this), this)(n, o) : (this.loginPromise = as(this.configurationName, this.configuration, this.publishEvent.bind(this), this.initAsync.bind(this), this.location)(e, n, t, o), this.loginPromise.then((r) => (this.loginPromise = null, r)));
1215
+ async loginAsync(e = void 0, s = null, t = !1, o = void 0, i = !1) {
1216
+ return this.loginPromise !== null ? this.loginPromise : i ? Ue(window, this.configurationName, this.configuration, this.publishEvent.bind(this), this)(s, o) : (this.loginPromise = cn(this.configurationName, this.configuration, this.publishEvent.bind(this), this.initAsync.bind(this), this.location)(e, s, t, o), this.loginPromise.then((r) => (this.loginPromise = null, r)));
1217
1217
  }
1218
1218
  async loginCallbackAsync(e = !1) {
1219
1219
  if (this.loginCallbackPromise !== null)
1220
1220
  return this.loginCallbackPromise;
1221
- const n = async () => {
1222
- const t = await cs(this)(e), o = t.tokens;
1221
+ const s = async () => {
1222
+ const t = await ln(this)(e), o = t.tokens;
1223
1223
  return this.tokens = o, await E(this.configuration, this.configurationName) || I(this.configurationName, this.configuration.storage).setTokens(o), this.publishEvent(U.eventNames.token_aquired, o), { parsedTokens: o, state: t.state, callbackPath: t.callbackPath };
1224
1224
  };
1225
- return this.loginCallbackPromise = n(), this.loginCallbackPromise.then((t) => (this.loginCallbackPromise = null, t));
1225
+ return this.loginCallbackPromise = s(), this.loginCallbackPromise.then((t) => (this.loginCallbackPromise = null, t));
1226
1226
  }
1227
- async synchroniseTokensAsync(e, n = 0, t = !1, o = null, i) {
1227
+ async synchroniseTokensAsync(e, s = 0, t = !1, o = null, i) {
1228
1228
  for (; !navigator.onLine && document.hidden; )
1229
1229
  await $({ milliseconds: 1e3 }), this.publishEvent(m.refreshTokensAsync, { message: "wait because navigator is offline and hidden" });
1230
1230
  let r = 6;
1231
1231
  for (; !navigator.onLine && r > 0; )
1232
1232
  await $({ milliseconds: 1e3 }), r--, this.publishEvent(m.refreshTokensAsync, { message: `wait because navigator is offline try ${r}` });
1233
- const a = document.hidden ? n : n + 1;
1233
+ const a = document.hidden ? s : s + 1;
1234
1234
  o || (o = {});
1235
1235
  const u = this.configuration, f = (l, h, y = null) => oe(this.configurationName, this.configuration, this.publishEvent.bind(this))(l, h, y), d = async () => {
1236
1236
  try {
@@ -1250,7 +1250,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1250
1250
  }
1251
1251
  return this.publishEvent(m.refreshTokensAsync_error, { message: "refresh token silent return" }), await this.synchroniseTokensAsync(null, a, t, o, i);
1252
1252
  };
1253
- if (n > 4)
1253
+ if (s > 4)
1254
1254
  return i(null), this.publishEvent(m.refreshTokensAsync_error, { message: "refresh token" }), { tokens: null, status: "SESSION_LOST" };
1255
1255
  try {
1256
1256
  const { status: l, tokens: h, nonce: y } = await this.syncTokensInfoAsync(u, this.configurationName, this.tokens, t);
@@ -1266,9 +1266,9 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1266
1266
  case "LOGOUT_FROM_ANOTHER_TAB":
1267
1267
  return i(null), this.publishEvent(m.logout_from_another_tab, { status: "session syncTokensAsync" }), { tokens: null, status: "LOGGED_OUT" };
1268
1268
  case "REQUIRE_SYNC_TOKENS":
1269
- return this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: e, status: l, tryNumber: n }), await d();
1269
+ return this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: e, status: l, tryNumber: s }), await d();
1270
1270
  default: {
1271
- if (this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: e, status: l, tryNumber: n }), !e)
1271
+ if (this.publishEvent(m.refreshTokensAsync_begin, { refreshToken: e, status: l, tryNumber: s }), !e)
1272
1272
  return await d();
1273
1273
  const _ = u.client_id, g = u.redirect_uri, w = u.authority, T = { ...u.token_request_extras ? u.token_request_extras : {} };
1274
1274
  for (const [p, k] of Object.entries(o))
@@ -1281,7 +1281,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1281
1281
  refresh_token: h.refreshToken
1282
1282
  }, k = await this.initAsync(w, u.authority_configuration), A = document.hidden ? 1e4 : 3e4 * 10, O = k.tokenEndpoint, x = {};
1283
1283
  u.demonstrating_proof_of_possession && (x.DPoP = await this.generateDemonstrationOfProofOfPossessionAsync(h.accessToken, O, "POST"));
1284
- const P = await es(this.getFetch())(
1284
+ const P = await en(this.getFetch())(
1285
1285
  O,
1286
1286
  p,
1287
1287
  T,
@@ -1311,7 +1311,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1311
1311
  return console.error(l), this.publishEvent(m.refreshTokensAsync_silent_error, { message: "exception", exception: l.message }), this.synchroniseTokensAsync(e, a, t, o, i);
1312
1312
  }
1313
1313
  }
1314
- async generateDemonstrationOfProofOfPossessionAsync(e, n, t) {
1314
+ async generateDemonstrationOfProofOfPossessionAsync(e, s, t) {
1315
1315
  const o = this.configuration, i = { ath: await we(e) }, r = await E(o, this.configurationName);
1316
1316
  let c = null, a;
1317
1317
  if (r)
@@ -1320,14 +1320,14 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1320
1320
  const u = I(this.configurationName, o.storage);
1321
1321
  a = await u.getDemonstratingProofOfPossessionJwkAsync(), c = await u.getDemonstratingProofOfPossessionNonce();
1322
1322
  }
1323
- return c && (i.nonce = c), await Oe(a, t, n, i);
1323
+ return c && (i.nonce = c), await Oe(a, t, s, i);
1324
1324
  }
1325
- async syncTokensInfoAsync(e, n, t, o = !1) {
1325
+ async syncTokensInfoAsync(e, s, t, o = !1) {
1326
1326
  const i = { nonce: null };
1327
1327
  if (!t)
1328
1328
  return { tokens: null, status: "NOT_CONNECTED", nonce: i };
1329
1329
  let r = i;
1330
- const c = await this.initAsync(e.authority, e.authority_configuration), a = await E(e, n);
1330
+ const c = await this.initAsync(e.authority, e.authority_configuration), a = await E(e, s);
1331
1331
  if (a) {
1332
1332
  const { status: d, tokens: l } = await a.initAsync(c, "syncTokensAsync", e);
1333
1333
  if (d === "LOGGED_OUT")
@@ -1342,7 +1342,7 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1342
1342
  }
1343
1343
  r = await a.getNonceAsync();
1344
1344
  } else {
1345
- const d = I(n, e.storage ?? sessionStorage), { tokens: l, status: h } = await d.initAsync();
1345
+ const d = I(s, e.storage ?? sessionStorage), { tokens: l, status: h } = await d.initAsync();
1346
1346
  if (l) {
1347
1347
  if (h === "SESSIONS_LOST")
1348
1348
  return { tokens: null, status: "SESSIONS_LOST", nonce: i };
@@ -1358,36 +1358,36 @@ Please checkout that you are using OIDC hook inside a <OidcProvider configuratio
1358
1358
  return o ? { tokens: t, status: "FORCE_REFRESH", nonce: r } : { tokens: t, status: f, nonce: r };
1359
1359
  }
1360
1360
  loginCallbackWithAutoTokensRenewAsync() {
1361
- return this.loginCallbackWithAutoTokensRenewPromise !== null ? this.loginCallbackWithAutoTokensRenewPromise : (this.loginCallbackWithAutoTokensRenewPromise = ms(this), this.loginCallbackWithAutoTokensRenewPromise.then((e) => (this.loginCallbackWithAutoTokensRenewPromise = null, e)));
1361
+ return this.loginCallbackWithAutoTokensRenewPromise !== null ? this.loginCallbackWithAutoTokensRenewPromise : (this.loginCallbackWithAutoTokensRenewPromise = pn(this), this.loginCallbackWithAutoTokensRenewPromise.then((e) => (this.loginCallbackWithAutoTokensRenewPromise = null, e)));
1362
1362
  }
1363
1363
  userInfoAsync(e = !1) {
1364
- return this.userInfoPromise !== null ? this.userInfoPromise : (this.userInfoPromise = ds(this)(e), this.userInfoPromise.then((n) => (this.userInfoPromise = null, n)));
1364
+ return this.userInfoPromise !== null ? this.userInfoPromise : (this.userInfoPromise = fn(this)(e), this.userInfoPromise.then((s) => (this.userInfoPromise = null, s)));
1365
1365
  }
1366
1366
  async renewTokensAsync(e = null) {
1367
1367
  if (this.renewTokensPromise !== null)
1368
1368
  return this.renewTokensPromise;
1369
1369
  if (this.timeoutId)
1370
- return M.clearTimeout(this.timeoutId), this.renewTokensPromise = me(this, this.tokens.refreshToken, !0, e), this.renewTokensPromise.then((n) => (this.renewTokensPromise = null, n));
1370
+ return M.clearTimeout(this.timeoutId), this.renewTokensPromise = me(this, this.tokens.refreshToken, !0, e), this.renewTokensPromise.then((s) => (this.renewTokensPromise = null, s));
1371
1371
  }
1372
1372
  async destroyAsync(e) {
1373
- return await ls(this)(e);
1373
+ return await un(this)(e);
1374
1374
  }
1375
- async logoutSameTabAsync(e, n) {
1376
- this.configuration.monitor_session && this.configuration.client_id === e && n && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === n && (this.publishEvent(m.logout_from_same_tab, { message: n }), await this.destroyAsync("LOGGED_OUT"));
1375
+ async logoutSameTabAsync(e, s) {
1376
+ this.configuration.monitor_session && this.configuration.client_id === e && s && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === s && (this.publishEvent(m.logout_from_same_tab, { message: s }), await this.destroyAsync("LOGGED_OUT"));
1377
1377
  }
1378
- async logoutOtherTabAsync(e, n) {
1379
- this.configuration.monitor_session && this.configuration.client_id === e && n && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === n && (await this.destroyAsync("LOGGED_OUT"), this.publishEvent(m.logout_from_another_tab, { message: "SessionMonitor", sub: n }));
1378
+ async logoutOtherTabAsync(e, s) {
1379
+ this.configuration.monitor_session && this.configuration.client_id === e && s && this.tokens && this.tokens.idTokenPayload && this.tokens.idTokenPayload.sub === s && (await this.destroyAsync("LOGGED_OUT"), this.publishEvent(m.logout_from_another_tab, { message: "SessionMonitor", sub: s }));
1380
1380
  }
1381
- async logoutAsync(e = void 0, n = null) {
1382
- return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = us(this, N, this.getFetch(), console, this.location)(e, n), this.logoutPromise.then((t) => (this.logoutPromise = null, t)));
1381
+ async logoutAsync(e = void 0, s = null) {
1382
+ return this.logoutPromise ? this.logoutPromise : (this.logoutPromise = dn(this, N, this.getFetch(), console, this.location)(e, s), this.logoutPromise.then((t) => (this.logoutPromise = null, t)));
1383
1383
  }
1384
1384
  };
1385
- re.getOrCreate = (s, e) => (n, t = "default") => ks(s, e)(n, t);
1385
+ re.getOrCreate = (n, e) => (s, t = "default") => mn(n, e)(s, t);
1386
1386
  re.eventNames = m;
1387
1387
  let R = re;
1388
- const ws = (s, e) => async (...n) => {
1388
+ const An = (n, e) => async (...s) => {
1389
1389
  var l;
1390
- const [t, o, ...i] = n, r = o ? { ...o } : { method: "GET" };
1390
+ const [t, o, ...i] = s, r = o ? { ...o } : { method: "GET" };
1391
1391
  let c = new Headers();
1392
1392
  r.headers && (c = r.headers instanceof Headers ? r.headers : new Headers(r.headers));
1393
1393
  const a = e, u = await a.getValidTokenAsync(), f = (l = u == null ? void 0 : u.tokens) == null ? void 0 : l.accessToken;
@@ -1400,7 +1400,7 @@ const ws = (s, e) => async (...n) => {
1400
1400
  r.credentials || (r.credentials = "same-origin");
1401
1401
  }
1402
1402
  const d = { ...r, headers: c };
1403
- return await s(t, d, ...i);
1403
+ return await n(t, d, ...i);
1404
1404
  }, X = class Ee {
1405
1405
  constructor(e) {
1406
1406
  this._oidc = e;
@@ -1411,8 +1411,8 @@ const ws = (s, e) => async (...n) => {
1411
1411
  removeEventSubscription(e) {
1412
1412
  this._oidc.removeEventSubscription(e);
1413
1413
  }
1414
- publishEvent(e, n) {
1415
- this._oidc.publishEvent(e, n);
1414
+ publishEvent(e, s) {
1415
+ this._oidc.publishEvent(e, s);
1416
1416
  }
1417
1417
  static get(e = "default") {
1418
1418
  return new Ee(R.get(e));
@@ -1420,11 +1420,11 @@ const ws = (s, e) => async (...n) => {
1420
1420
  tryKeepExistingSessionAsync() {
1421
1421
  return this._oidc.tryKeepExistingSessionAsync();
1422
1422
  }
1423
- loginAsync(e = void 0, n = null, t = !1, o = void 0, i = !1) {
1424
- return this._oidc.loginAsync(e, n, t, o, i);
1423
+ loginAsync(e = void 0, s = null, t = !1, o = void 0, i = !1) {
1424
+ return this._oidc.loginAsync(e, s, t, o, i);
1425
1425
  }
1426
- logoutAsync(e = void 0, n = null) {
1427
- return this._oidc.logoutAsync(e, n);
1426
+ logoutAsync(e = void 0, s = null) {
1427
+ return this._oidc.logoutAsync(e, s);
1428
1428
  }
1429
1429
  silentLoginCallbackAsync() {
1430
1430
  return this._oidc.silentLoginCallbackAsync();
@@ -1441,27 +1441,27 @@ const ws = (s, e) => async (...n) => {
1441
1441
  get configuration() {
1442
1442
  return this._oidc.configuration;
1443
1443
  }
1444
- async generateDemonstrationOfProofOfPossessionAsync(e, n, t) {
1445
- return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e, n, t);
1444
+ async generateDemonstrationOfProofOfPossessionAsync(e, s, t) {
1445
+ return this._oidc.generateDemonstrationOfProofOfPossessionAsync(e, s, t);
1446
1446
  }
1447
- async getValidTokenAsync(e = 200, n = 50) {
1448
- return Le(this._oidc, e, n);
1447
+ async getValidTokenAsync(e = 200, s = 50) {
1448
+ return Le(this._oidc, e, s);
1449
1449
  }
1450
1450
  fetchWithTokens(e) {
1451
- return ws(e, this);
1451
+ return An(e, this);
1452
1452
  }
1453
1453
  async userInfoAsync(e = !1) {
1454
1454
  return this._oidc.userInfoAsync(e);
1455
1455
  }
1456
1456
  };
1457
- X.getOrCreate = (s, e = new G()) => (n, t = "default") => new X(R.getOrCreate(s, e)(n, t));
1457
+ X.getOrCreate = (n, e = new G()) => (s, t = "default") => new X(R.getOrCreate(n, e)(s, t));
1458
1458
  X.eventNames = R.eventNames;
1459
- let Ss = X;
1459
+ let Tn = X;
1460
1460
  export {
1461
- Ss as OidcClient,
1461
+ Tn as OidcClient,
1462
1462
  G as OidcLocation,
1463
1463
  Y as TokenRenewMode,
1464
- gs as getFetchDefault,
1464
+ kn as getFetchDefault,
1465
1465
  H as getParseQueryStringFromLocation,
1466
- vs as getPath
1466
+ Sn as getPath
1467
1467
  };