@trimble-oss/trimble-id-react 0.0.4 → 0.1.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.
@@ -1,11 +1,11 @@
1
- var kt = Object.defineProperty;
2
- var Rt = (a, t, n) => t in a ? kt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n;
3
- var p = (a, t, n) => (Rt(a, typeof t != "symbol" ? t + "" : t, n), n);
4
- import { OpenIdEndpointProvider as Tt, AuthorizationCodeGrantTokenProvider as Fe, AnalyticsHttpClient as wt, BearerTokenHttpClientProvider as bt } from "@trimble-oss/trimble-id";
5
- import * as le from "es-cookie";
6
- import Ct from "jwt-decode";
7
- import Ye, { createContext as Pt, useContext as Je, useState as Ot, useReducer as It, useRef as xt, useMemo as Le, useEffect as Ge, useCallback as X } from "react";
8
- class At {
1
+ var wt = Object.defineProperty;
2
+ var bt = (a, t, n) => t in a ? wt(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n;
3
+ var p = (a, t, n) => (bt(a, typeof t != "symbol" ? t + "" : t, n), n);
4
+ import { OpenIdEndpointProvider as Ct, AuthorizationCodeGrantTokenProvider as Le, AnalyticsHttpClient as Pt, BearerTokenHttpClientProvider as Ot } from "@trimble-oss/trimble-id";
5
+ import * as ue from "es-cookie";
6
+ import It from "jwt-decode";
7
+ import Be, { createContext as xt, useContext as ze, useState as At, useReducer as Kt, useRef as Ut, useMemo as Fe, useEffect as He, useCallback as W } from "react";
8
+ class Dt {
9
9
  constructor() {
10
10
  /**
11
11
  * This function generate a encapsulation function to store
@@ -61,7 +61,7 @@ class At {
61
61
  }());
62
62
  }
63
63
  }
64
- class Kt {
64
+ class Mt {
65
65
  /**
66
66
  * Initialized configuration to store information into local storage
67
67
  * @param {LocalStorageCacheOptions} options - Configuration for caching in localstorage
@@ -135,8 +135,8 @@ class Kt {
135
135
  return this.localStorage.removeItem(this.getAuthKey()), this.localStorage.removeItem(this.getUserKey()), Promise.resolve(void 0);
136
136
  }
137
137
  }
138
- const he = "@TID", Ut = `${he}_AUTH_KEY`, Dt = `${he}_USER_KEY`;
139
- class Mt {
138
+ const ge = "@TID", jt = `${ge}_AUTH_KEY`, Lt = `${ge}_USER_KEY`;
139
+ class Ft {
140
140
  /**
141
141
  * Initialized the cache key
142
142
  * @param {CacheKeyOptions} cacheKeyOptions - Cache key options to edit the default values
@@ -151,17 +151,17 @@ class Mt {
151
151
  * Prefix value of the key, by default the prefix is based on the constant PREFIX_KEY
152
152
  * @type {string}
153
153
  */
154
- p(this, "prefix", he);
154
+ p(this, "prefix", ge);
155
155
  /**
156
156
  * Suffix value use it to generate the key to store and retrieve the token, by default the prefix is based on the constant AUTH_KEY
157
157
  * @type {string}
158
158
  */
159
- p(this, "authSuffix", Ut);
159
+ p(this, "authSuffix", jt);
160
160
  /**
161
161
  * Suffix value use it to generate the key to store and retrieve the user, by default the prefix is based on the constant USER_KEY
162
162
  * @type {string}
163
163
  */
164
- p(this, "userSuffix", Dt);
164
+ p(this, "userSuffix", Lt);
165
165
  this.clientId = t.client_id;
166
166
  }
167
167
  /**
@@ -179,7 +179,7 @@ class Mt {
179
179
  return `${this.prefix}_${this.authSuffix}_${this.clientId}`;
180
180
  }
181
181
  }
182
- class jt {
182
+ class Nt {
183
183
  /**
184
184
  * Initialized configuration to store information into session storage
185
185
  * @param {SessionStorageCacheOptions} options - Configuration for caching in session storage
@@ -253,7 +253,7 @@ class jt {
253
253
  return this.sessionStorage.removeItem(this.getAuthKey()), this.sessionStorage.removeItem(this.getUserKey()), Promise.resolve(void 0);
254
254
  }
255
255
  }
256
- class Ft {
256
+ class Wt {
257
257
  /**
258
258
  * Create a cache manager to extract or save the user, and token
259
259
  * @param {CacheManagerOptions} options - Configuration for the managing the caching
@@ -277,13 +277,13 @@ class Ft {
277
277
  * @type {CacheKey}
278
278
  */
279
279
  p(this, "cacheKey");
280
- this.persistentStore = t.persistentStore, this.cacheKey = new Mt({
280
+ this.persistentStore = t.persistentStore, this.cacheKey = new Ft({
281
281
  client_id: t.clientId
282
- }), this.persistentStore === "localStorage" ? this.cacheStorage = new Kt({
282
+ }), this.persistentStore === "localStorage" ? this.cacheStorage = new Mt({
283
283
  cacheKey: this.cacheKey
284
- }) : this.persistentStore === "sessionStorage" ? this.cacheStorage = new jt({
284
+ }) : this.persistentStore === "sessionStorage" ? this.cacheStorage = new Nt({
285
285
  cacheKey: this.cacheKey
286
- }) : this.cacheStorage = new At().generateCache;
286
+ }) : this.cacheStorage = new Dt().generateCache;
287
287
  }
288
288
  /**
289
289
  * Store token in cache
@@ -323,7 +323,7 @@ class Ft {
323
323
  await this.cacheStorage.clear();
324
324
  }
325
325
  }
326
- const Lt = 5 * 6e4, Wt = ["code", "state"], We = (a) => a.split("?")[0], Nt = (a) => a.split("?")[1], Be = (a) => {
326
+ const Ne = 5 * 6e4, $t = ["code", "state"], We = (a) => a.split("?")[0], Vt = (a) => a.split("?")[1], qe = (a) => {
327
327
  let t = a;
328
328
  if (!a.startsWith("?"))
329
329
  try {
@@ -331,18 +331,19 @@ const Lt = 5 * 6e4, Wt = ["code", "state"], We = (a) => a.split("?")[0], Nt = (a
331
331
  } catch {
332
332
  }
333
333
  return new URLSearchParams(t);
334
- }, $t = (a = window.location.href, t) => {
334
+ }, Yt = (a = window.location.href, t) => {
335
335
  if (t != null) {
336
336
  const o = We(t), c = We(a ?? "");
337
337
  if (o !== c)
338
338
  return !1;
339
339
  }
340
- const n = Be(a);
341
- for (const o of Wt)
340
+ const n = qe(a);
341
+ for (const o of $t)
342
342
  if (!n.has(o))
343
343
  return !1;
344
344
  return !0;
345
- }, Vt = (a) => ({
345
+ }, Gt = (a) => ({
346
+ id: a.sub,
346
347
  name: `${a.given_name} ${a.family_name}`,
347
348
  given_name: a.given_name,
348
349
  family_name: a.family_name,
@@ -350,14 +351,14 @@ const Lt = 5 * 6e4, Wt = ["code", "state"], We = (a) => a.split("?")[0], Nt = (a
350
351
  email: a.email,
351
352
  email_verified: a.email_verified,
352
353
  phone_number_verified: !1
353
- }), Yt = "@TID_COOKIE";
354
- class Jt {
354
+ }), Jt = "@TID_COOKIE";
355
+ class Bt {
355
356
  /**
356
357
  * Retrieve a cookie from the browser
357
358
  * @param {string} key - Key to retrieve the cookies
358
359
  */
359
360
  get(t) {
360
- const n = le.get(t);
361
+ const n = ue.get(t);
361
362
  if (n == null)
362
363
  throw new Error("Cookie not found");
363
364
  return JSON.parse(n);
@@ -377,7 +378,7 @@ class Jt {
377
378
  window.location.protocol === "https:" && (c = {
378
379
  secure: !0,
379
380
  sameSite: "none"
380
- }), o != null && o.expires && (c.expires = o.expires), o != null && o.domain && (c.domain = o.domain), le.set(t, JSON.stringify(n), c);
381
+ }), o != null && o.expires && (c.expires = o.expires), o != null && o.domain && (c.domain = o.domain), ue.set(t, JSON.stringify(n), c);
381
382
  }
382
383
  /**
383
384
  * Remove a cookie from the browser
@@ -390,10 +391,10 @@ class Jt {
390
391
  */
391
392
  remove(t, n) {
392
393
  const o = {};
393
- n != null && n.domain && (o.domain = n.domain), le.remove(t, o);
394
+ n != null && n.domain && (o.domain = n.domain), ue.remove(t, o);
394
395
  }
395
396
  }
396
- class Gt {
397
+ class zt {
397
398
  /**
398
399
  * Create a cookies manager to extract or save cookies in the browser
399
400
  * @param {CookiesManagerOptions} options - Configuration for the managing the cookies
@@ -409,7 +410,7 @@ class Gt {
409
410
  * @type {CookiesStorage}
410
411
  */
411
412
  p(this, "cookiesStorage");
412
- this.cookieKey = `${Yt}.${t.clientId}`, this.cookiesStorage = new Jt();
413
+ this.cookieKey = `${Jt}.${t.clientId}`, this.cookiesStorage = new Bt();
413
414
  }
414
415
  /**
415
416
  * Store cookies in the browser
@@ -438,13 +439,13 @@ class Gt {
438
439
  this.cookiesStorage.remove(this.cookieKey);
439
440
  }
440
441
  }
441
- class Bt extends Error {
442
+ class $e extends Error {
442
443
  }
443
- class zt extends Error {
444
+ class Ve extends Error {
444
445
  }
445
446
  class Ht extends Error {
446
447
  }
447
- const D = "@trimble-oss/trimble-id-react", M = "0.0.4", qt = {
448
+ const O = "@trimble-oss/trimble-id-react", I = "0.1.0", qt = {
448
449
  configurationEndpoint: "",
449
450
  clientId: "",
450
451
  redirectUrl: "",
@@ -494,19 +495,19 @@ class Qt {
494
495
  throw new Error("Configuration endpoint not defined");
495
496
  if (n.clientId == null || n.clientId == "")
496
497
  throw new Error("Consumer key is not defined");
497
- this.cookiesManager = new Gt({
498
+ this.cookiesManager = new zt({
498
499
  clientId: n.clientId
499
500
  });
500
- const c = this.cookiesManager.get(), k = new Tt(n.configurationEndpoint);
501
- let _ = new Fe(
502
- k,
501
+ const c = this.cookiesManager.get(), S = new Ct(n.configurationEndpoint);
502
+ let _ = new Le(
503
+ S,
503
504
  n.clientId,
504
505
  n.redirectUrl
505
506
  ).WithScopes(n.scopes);
506
- n.logoutRedirectUrl && (_ = _.WithLogoutRedirect(n.logoutRedirectUrl)), (c == null ? void 0 : c.code_verifier) != null && (_ = _.WithProofKeyForCodeExchange(c.code_verifier)), this.tokenProvider = _, this.cacheManager = new Ft({
507
+ n.logoutRedirectUrl && (_ = _.WithLogoutRedirect(n.logoutRedirectUrl)), (c == null ? void 0 : c.code_verifier) != null && (_ = _.WithProofKeyForCodeExchange(c.code_verifier)), this.tokenProvider = _, this.cacheManager = new Wt({
507
508
  clientId: n.clientId,
508
509
  persistentStore: o.persistentStore
509
- }), this.clientId = n.clientId, this.analyticshttpclient = new wt(), this.analyticshttpclient.sendInitEvent("TIDClient", this.clientId, D, M);
510
+ }), this.clientId = n.clientId, this.analyticshttpclient = Pt, this.analyticshttpclient.sendInitEvent("TIDClient", this.clientId, O, I);
510
511
  }
511
512
  /**
512
513
  * Redirect the user to TID using the browser
@@ -521,8 +522,8 @@ class Qt {
521
522
  * // So it can be handled by the developer
522
523
  */
523
524
  async loginWithRedirect(t) {
524
- this.analyticshttpclient.sendMethodEvent(this.loginWithRedirect.name, this.clientId, D, M);
525
- const { onRedirect: n } = t || {}, o = Fe.GenerateCodeVerifier();
525
+ this.analyticshttpclient.sendMethodEvent(this.loginWithRedirect.name, this.clientId, O, I);
526
+ const { onRedirect: n } = t || {}, o = Le.GenerateCodeVerifier();
526
527
  this.cookiesManager.save({ code_verifier: o }), this.tokenProvider = this.tokenProvider.WithProofKeyForCodeExchange(o);
527
528
  const c = await this.tokenProvider.GetOAuthRedirect("state");
528
529
  n != null ? n(c) : window.location.assign(c);
@@ -543,8 +544,8 @@ class Qt {
543
544
  const n = this.cookiesManager.get();
544
545
  if (n == null || (n == null ? void 0 : n.code_verifier) == null)
545
546
  throw new Ht("Code verifier not available");
546
- const o = Nt(t), c = Be(t), k = c.get("identity_provider") ?? "", _ = c.get("state") ?? "";
547
- return await this.tokenProvider.ValidateQuery(o), await this.generateToken(k), {
547
+ const o = Vt(t), c = qe(t), S = c.get("identity_provider") ?? "", _ = c.get("state") ?? "";
548
+ return await this.tokenProvider.ValidateQuery(o), await this.generateToken(S), {
548
549
  authState: _
549
550
  };
550
551
  }
@@ -554,10 +555,10 @@ class Qt {
554
555
  * @return {Promise<void>} Empty promise
555
556
  */
556
557
  async generateToken(t) {
557
- var T, d;
558
- const n = await this.tokenProvider.RetrieveToken(), o = await this.tokenProvider.RetrieveRefreshToken(), c = await this.tokenProvider.RetrieveIdToken(), k = await this.tokenProvider.RetrieveTokenExpiry(), w = new Date(k).getTime(), g = (d = (T = this.tokenProvider) == null ? void 0 : T._scopes) == null ? void 0 : d.join(" ");
558
+ var R, f;
559
+ const n = await this.tokenProvider.RetrieveToken(), o = await this.tokenProvider.RetrieveRefreshToken(), c = await this.tokenProvider.RetrieveIdToken(), S = await this.tokenProvider.RetrieveTokenExpiry(), w = new Date(S).getTime(), v = (f = (R = this.tokenProvider) == null ? void 0 : R._scopes) == null ? void 0 : f.join(" ");
559
560
  await this.cacheManager.setToken({
560
- scope: g,
561
+ scope: v,
561
562
  state: "",
562
563
  session_state: "",
563
564
  identity_provider: t,
@@ -567,8 +568,8 @@ class Qt {
567
568
  id_token: c,
568
569
  expires_at: w
569
570
  });
570
- const C = Ct(c), S = Vt(C);
571
- await this.cacheManager.setUser(S), await this.reloadCodeVerifier();
571
+ const P = It(c), T = Gt(P);
572
+ await this.cacheManager.setUser(T), await this.reloadCodeVerifier();
572
573
  }
573
574
  async reloadCodeVerifier() {
574
575
  const t = await this.tokenProvider.RetrieveCodeVerifier();
@@ -579,7 +580,7 @@ class Qt {
579
580
  * @return {Promise<TIDUser | undefined>} User in cache
580
581
  */
581
582
  async getUser() {
582
- return this.analyticshttpclient.sendMethodEvent(this.getUser.name, this.clientId, D, M), await this.cacheManager.getUser();
583
+ return this.analyticshttpclient.sendMethodEvent(this.getUser.name, this.clientId, O, I), await this.cacheManager.getUser();
583
584
  }
584
585
  /**
585
586
  * Gets the access token from cache. If the token already expired,
@@ -589,21 +590,48 @@ class Qt {
589
590
  * @throws {TokenExpiredException} Will throw an exception if the user token expired
590
591
  */
591
592
  async getAccessTokenSilently() {
592
- this.analyticshttpclient.sendMethodEvent(this.getAccessTokenSilently.name, this.clientId, D, M);
593
+ this.analyticshttpclient.sendMethodEvent(this.getAccessTokenSilently.name, this.clientId, O, I);
593
594
  let t = await this.cacheManager.getToken();
594
595
  if (t == null)
595
- throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, "No token available", this.clientId, D, M), new zt("No token available");
596
- const n = new Date((/* @__PURE__ */ new Date()).getTime() + Lt);
596
+ throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, "No token available", this.clientId, O, I), new Ve("No token available");
597
+ const n = new Date((/* @__PURE__ */ new Date()).getTime() + Ne);
597
598
  if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < n.getTime()) {
598
599
  try {
599
600
  await this.tokenProvider.RetrieveToken();
600
601
  } catch (o) {
601
- throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, o.message, this.clientId, D, M), new Bt(o.message);
602
+ throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, o.message, this.clientId, O, I), new $e(o.message);
602
603
  }
603
604
  await this.generateToken((t == null ? void 0 : t.identity_provider) ?? ""), t = await this.cacheManager.getToken();
604
605
  }
605
606
  return (t == null ? void 0 : t.access_token) || "";
606
607
  }
608
+ /**
609
+ * Retrieves token details from the cache, including the access token, ID token, and expiration time.
610
+ * If the token already expired, will try to refresh it using the refresh token.
611
+ * @return {Promise<TokenResponse>} Token response
612
+ * @throws {TokenNotFoundException} Will throw an exception if there are no tokens in cache
613
+ * @throws {TokenExpiredException} Will throw an exception if the user token expired
614
+ */
615
+ async getTokens() {
616
+ this.analyticshttpclient.sendMethodEvent(this.getTokens.name, this.clientId, O, I);
617
+ let t = await this.cacheManager.getToken();
618
+ if (t == null)
619
+ throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, "No token available", this.clientId, O, I), new Ve("No token available");
620
+ const n = new Date((/* @__PURE__ */ new Date()).getTime() + Ne);
621
+ if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < n.getTime()) {
622
+ try {
623
+ await this.tokenProvider.RetrieveToken();
624
+ } catch (o) {
625
+ throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, o.message, this.clientId, O, I), new $e(o.message);
626
+ }
627
+ await this.generateToken((t == null ? void 0 : t.identity_provider) ?? ""), t = await this.cacheManager.getToken();
628
+ }
629
+ return {
630
+ access_token: (t == null ? void 0 : t.access_token) || "",
631
+ expires_at: (t == null ? void 0 : t.expires_at) || 0,
632
+ id_token: (t == null ? void 0 : t.id_token) || ""
633
+ };
634
+ }
607
635
  /**
608
636
  * Redirect the user to TID using the browser
609
637
  * @param {LogoutOptions} options - Custom configuration for teh redirection
@@ -617,7 +645,7 @@ class Qt {
617
645
  * // So it can be handled by the developer
618
646
  */
619
647
  async logout(t) {
620
- this.analyticshttpclient.sendMethodEvent(this.logout.name, this.clientId, D, M);
648
+ this.analyticshttpclient.sendMethodEvent(this.logout.name, this.clientId, O, I);
621
649
  const { onRedirect: n, disabledAutoRedirect: o } = t || {};
622
650
  this.cacheManager && await this.cacheManager.clear(), this.cookiesManager && this.cookiesManager.clear();
623
651
  const c = await this.tokenProvider.GetOAuthLogoutRedirect("state");
@@ -652,15 +680,15 @@ class Qt {
652
680
  const t = await this.cacheManager.getToken();
653
681
  if (t == null)
654
682
  return;
655
- const n = t.access_token, o = t.refresh_token || "", c = t.id_token, k = t.expires_at;
656
- this.tokenProvider = this.tokenProvider.WithAccessToken(n, k).WithRefreshToken(o).WithIdToken(c);
683
+ const n = t.access_token, o = t.refresh_token || "", c = t.id_token, S = t.expires_at;
684
+ this.tokenProvider = this.tokenProvider.WithAccessToken(n, S).WithRefreshToken(o).WithIdToken(c);
657
685
  }
658
686
  /**
659
687
  * Get a http bearer token client to use it for another SDK (Ex: Processing framework)
660
688
  * @return {any} - BearerTokenHttpClientProvider
661
689
  */
662
690
  getBearerTokenHttpClient(t) {
663
- return new bt(this.tokenProvider, t);
691
+ return new Ot(this.tokenProvider, t);
664
692
  }
665
693
  /**
666
694
  * Get the redirect url to TID
@@ -670,8 +698,8 @@ class Qt {
670
698
  return this.redirectUrl;
671
699
  }
672
700
  }
673
- const ue = Pt(null), ze = () => Je(ue) ?? {};
674
- var fe = { exports: {} }, N = {};
701
+ const fe = xt(null), Xe = () => ze(fe) ?? {};
702
+ var de = { exports: {} }, $ = {};
675
703
  /**
676
704
  * @license React
677
705
  * react-jsx-runtime.production.min.js
@@ -681,25 +709,25 @@ var fe = { exports: {} }, N = {};
681
709
  * This source code is licensed under the MIT license found in the
682
710
  * LICENSE file in the root directory of this source tree.
683
711
  */
684
- var Ne;
712
+ var Ye;
685
713
  function Zt() {
686
- if (Ne)
687
- return N;
688
- Ne = 1;
689
- var a = Ye, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, c = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, k = { key: !0, ref: !0, __self: !0, __source: !0 };
690
- function _(w, g, C) {
691
- var S, T = {}, d = null, K = null;
692
- C !== void 0 && (d = "" + C), g.key !== void 0 && (d = "" + g.key), g.ref !== void 0 && (K = g.ref);
693
- for (S in g)
694
- o.call(g, S) && !k.hasOwnProperty(S) && (T[S] = g[S]);
714
+ if (Ye)
715
+ return $;
716
+ Ye = 1;
717
+ var a = Be, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, c = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 };
718
+ function _(w, v, P) {
719
+ var T, R = {}, f = null, D = null;
720
+ P !== void 0 && (f = "" + P), v.key !== void 0 && (f = "" + v.key), v.ref !== void 0 && (D = v.ref);
721
+ for (T in v)
722
+ o.call(v, T) && !S.hasOwnProperty(T) && (R[T] = v[T]);
695
723
  if (w && w.defaultProps)
696
- for (S in g = w.defaultProps, g)
697
- T[S] === void 0 && (T[S] = g[S]);
698
- return { $$typeof: t, type: w, key: d, ref: K, props: T, _owner: c.current };
724
+ for (T in v = w.defaultProps, v)
725
+ R[T] === void 0 && (R[T] = v[T]);
726
+ return { $$typeof: t, type: w, key: f, ref: D, props: R, _owner: c.current };
699
727
  }
700
- return N.Fragment = n, N.jsx = _, N.jsxs = _, N;
728
+ return $.Fragment = n, $.jsx = _, $.jsxs = _, $;
701
729
  }
702
- var $ = {};
730
+ var V = {};
703
731
  /**
704
732
  * @license React
705
733
  * react-jsx-runtime.development.js
@@ -709,54 +737,54 @@ var $ = {};
709
737
  * This source code is licensed under the MIT license found in the
710
738
  * LICENSE file in the root directory of this source tree.
711
739
  */
712
- var $e;
740
+ var Ge;
713
741
  function er() {
714
- return $e || ($e = 1, process.env.NODE_ENV !== "production" && function() {
715
- var a = Ye, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), k = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), w = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), d = Symbol.for("react.lazy"), K = Symbol.for("react.offscreen"), A = Symbol.iterator, V = "@@iterator";
716
- function Q(e) {
742
+ return Ge || (Ge = 1, process.env.NODE_ENV !== "production" && function() {
743
+ var a = Be, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), w = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), T = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), D = Symbol.for("react.offscreen"), x = Symbol.iterator, Y = "@@iterator";
744
+ function ee(e) {
717
745
  if (e === null || typeof e != "object")
718
746
  return null;
719
- var r = A && e[A] || e[V];
747
+ var r = x && e[x] || e[Y];
720
748
  return typeof r == "function" ? r : null;
721
749
  }
722
- var O = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
750
+ var A = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
723
751
  function E(e) {
724
752
  {
725
753
  for (var r = arguments.length, i = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
726
754
  i[s - 1] = arguments[s];
727
- Y("error", e, i);
755
+ G("error", e, i);
728
756
  }
729
757
  }
730
- function Y(e, r, i) {
758
+ function G(e, r, i) {
731
759
  {
732
- var s = O.ReactDebugCurrentFrame, f = s.getStackAddendum();
733
- f !== "" && (r += "%s", i = i.concat([f]));
760
+ var s = A.ReactDebugCurrentFrame, d = s.getStackAddendum();
761
+ d !== "" && (r += "%s", i = i.concat([d]));
734
762
  var h = i.map(function(u) {
735
763
  return String(u);
736
764
  });
737
765
  h.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, h);
738
766
  }
739
767
  }
740
- var J = !1, Z = !1, v = !1, P = !1, ee = !1, ge;
741
- ge = Symbol.for("react.module.reference");
742
- function He(e) {
743
- return !!(typeof e == "string" || typeof e == "function" || e === o || e === k || ee || e === c || e === C || e === S || P || e === K || J || Z || v || typeof e == "object" && e !== null && (e.$$typeof === d || e.$$typeof === T || e.$$typeof === _ || e.$$typeof === w || e.$$typeof === g || // This needs to include all possible module reference object
768
+ var J = !1, B = !1, te = !1, g = !1, b = !1, z;
769
+ z = Symbol.for("react.module.reference");
770
+ function Qe(e) {
771
+ return !!(typeof e == "string" || typeof e == "function" || e === o || e === S || b || e === c || e === P || e === T || g || e === D || J || B || te || typeof e == "object" && e !== null && (e.$$typeof === f || e.$$typeof === R || e.$$typeof === _ || e.$$typeof === w || e.$$typeof === v || // This needs to include all possible module reference object
744
772
  // types supported by any Flight configuration anywhere since
745
773
  // we don't know which Flight build this will end up being used
746
774
  // with.
747
- e.$$typeof === ge || e.getModuleId !== void 0));
775
+ e.$$typeof === z || e.getModuleId !== void 0));
748
776
  }
749
- function qe(e, r, i) {
777
+ function Ze(e, r, i) {
750
778
  var s = e.displayName;
751
779
  if (s)
752
780
  return s;
753
- var f = r.displayName || r.name || "";
754
- return f !== "" ? i + "(" + f + ")" : i;
781
+ var d = r.displayName || r.name || "";
782
+ return d !== "" ? i + "(" + d + ")" : i;
755
783
  }
756
784
  function ve(e) {
757
785
  return e.displayName || "Context";
758
786
  }
759
- function I(e) {
787
+ function K(e) {
760
788
  if (e == null)
761
789
  return null;
762
790
  if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
@@ -768,13 +796,13 @@ function er() {
768
796
  return "Fragment";
769
797
  case n:
770
798
  return "Portal";
771
- case k:
799
+ case S:
772
800
  return "Profiler";
773
801
  case c:
774
802
  return "StrictMode";
775
- case C:
803
+ case P:
776
804
  return "Suspense";
777
- case S:
805
+ case T:
778
806
  return "SuspenseList";
779
807
  }
780
808
  if (typeof e == "object")
@@ -785,15 +813,15 @@ function er() {
785
813
  case _:
786
814
  var i = e;
787
815
  return ve(i._context) + ".Provider";
788
- case g:
789
- return qe(e, e.render, "ForwardRef");
790
- case T:
816
+ case v:
817
+ return Ze(e, e.render, "ForwardRef");
818
+ case R:
791
819
  var s = e.displayName || null;
792
- return s !== null ? s : I(e.type) || "Memo";
793
- case d: {
794
- var f = e, h = f._payload, u = f._init;
820
+ return s !== null ? s : K(e.type) || "Memo";
821
+ case f: {
822
+ var d = e, h = d._payload, u = d._init;
795
823
  try {
796
- return I(u(h));
824
+ return K(u(h));
797
825
  } catch {
798
826
  return null;
799
827
  }
@@ -801,18 +829,18 @@ function er() {
801
829
  }
802
830
  return null;
803
831
  }
804
- var U = Object.assign, L = 0, ye, pe, me, Ee, _e, Se, ke;
805
- function Re() {
832
+ var M = Object.assign, F = 0, ye, pe, me, Ee, _e, Te, Se;
833
+ function ke() {
806
834
  }
807
- Re.__reactDisabledLog = !0;
808
- function Xe() {
835
+ ke.__reactDisabledLog = !0;
836
+ function et() {
809
837
  {
810
- if (L === 0) {
811
- ye = console.log, pe = console.info, me = console.warn, Ee = console.error, _e = console.group, Se = console.groupCollapsed, ke = console.groupEnd;
838
+ if (F === 0) {
839
+ ye = console.log, pe = console.info, me = console.warn, Ee = console.error, _e = console.group, Te = console.groupCollapsed, Se = console.groupEnd;
812
840
  var e = {
813
841
  configurable: !0,
814
842
  enumerable: !0,
815
- value: Re,
843
+ value: ke,
816
844
  writable: !0
817
845
  };
818
846
  Object.defineProperties(console, {
@@ -825,77 +853,77 @@ function er() {
825
853
  groupEnd: e
826
854
  });
827
855
  }
828
- L++;
856
+ F++;
829
857
  }
830
858
  }
831
- function Qe() {
859
+ function tt() {
832
860
  {
833
- if (L--, L === 0) {
861
+ if (F--, F === 0) {
834
862
  var e = {
835
863
  configurable: !0,
836
864
  enumerable: !0,
837
865
  writable: !0
838
866
  };
839
867
  Object.defineProperties(console, {
840
- log: U({}, e, {
868
+ log: M({}, e, {
841
869
  value: ye
842
870
  }),
843
- info: U({}, e, {
871
+ info: M({}, e, {
844
872
  value: pe
845
873
  }),
846
- warn: U({}, e, {
874
+ warn: M({}, e, {
847
875
  value: me
848
876
  }),
849
- error: U({}, e, {
877
+ error: M({}, e, {
850
878
  value: Ee
851
879
  }),
852
- group: U({}, e, {
880
+ group: M({}, e, {
853
881
  value: _e
854
882
  }),
855
- groupCollapsed: U({}, e, {
856
- value: Se
883
+ groupCollapsed: M({}, e, {
884
+ value: Te
857
885
  }),
858
- groupEnd: U({}, e, {
859
- value: ke
886
+ groupEnd: M({}, e, {
887
+ value: Se
860
888
  })
861
889
  });
862
890
  }
863
- L < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
891
+ F < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
864
892
  }
865
893
  }
866
- var te = O.ReactCurrentDispatcher, re;
867
- function G(e, r, i) {
894
+ var re = A.ReactCurrentDispatcher, ne;
895
+ function H(e, r, i) {
868
896
  {
869
- if (re === void 0)
897
+ if (ne === void 0)
870
898
  try {
871
899
  throw Error();
872
- } catch (f) {
873
- var s = f.stack.trim().match(/\n( *(at )?)/);
874
- re = s && s[1] || "";
900
+ } catch (d) {
901
+ var s = d.stack.trim().match(/\n( *(at )?)/);
902
+ ne = s && s[1] || "";
875
903
  }
876
904
  return `
877
- ` + re + e;
905
+ ` + ne + e;
878
906
  }
879
907
  }
880
- var ne = !1, B;
908
+ var ie = !1, q;
881
909
  {
882
- var Ze = typeof WeakMap == "function" ? WeakMap : Map;
883
- B = new Ze();
910
+ var rt = typeof WeakMap == "function" ? WeakMap : Map;
911
+ q = new rt();
884
912
  }
885
- function Te(e, r) {
886
- if (!e || ne)
913
+ function Re(e, r) {
914
+ if (!e || ie)
887
915
  return "";
888
916
  {
889
- var i = B.get(e);
917
+ var i = q.get(e);
890
918
  if (i !== void 0)
891
919
  return i;
892
920
  }
893
921
  var s;
894
- ne = !0;
895
- var f = Error.prepareStackTrace;
922
+ ie = !0;
923
+ var d = Error.prepareStackTrace;
896
924
  Error.prepareStackTrace = void 0;
897
925
  var h;
898
- h = te.current, te.current = null, Xe();
926
+ h = re.current, re.current = null, et();
899
927
  try {
900
928
  if (r) {
901
929
  var u = function() {
@@ -908,125 +936,125 @@ function er() {
908
936
  }), typeof Reflect == "object" && Reflect.construct) {
909
937
  try {
910
938
  Reflect.construct(u, []);
911
- } catch (x) {
912
- s = x;
939
+ } catch (U) {
940
+ s = U;
913
941
  }
914
942
  Reflect.construct(e, [], u);
915
943
  } else {
916
944
  try {
917
945
  u.call();
918
- } catch (x) {
919
- s = x;
946
+ } catch (U) {
947
+ s = U;
920
948
  }
921
949
  e.call(u.prototype);
922
950
  }
923
951
  } else {
924
952
  try {
925
953
  throw Error();
926
- } catch (x) {
927
- s = x;
954
+ } catch (U) {
955
+ s = U;
928
956
  }
929
957
  e();
930
958
  }
931
- } catch (x) {
932
- if (x && s && typeof x.stack == "string") {
933
- for (var l = x.stack.split(`
934
- `), R = s.stack.split(`
935
- `), y = l.length - 1, m = R.length - 1; y >= 1 && m >= 0 && l[y] !== R[m]; )
959
+ } catch (U) {
960
+ if (U && s && typeof U.stack == "string") {
961
+ for (var l = U.stack.split(`
962
+ `), k = s.stack.split(`
963
+ `), y = l.length - 1, m = k.length - 1; y >= 1 && m >= 0 && l[y] !== k[m]; )
936
964
  m--;
937
965
  for (; y >= 1 && m >= 0; y--, m--)
938
- if (l[y] !== R[m]) {
966
+ if (l[y] !== k[m]) {
939
967
  if (y !== 1 || m !== 1)
940
968
  do
941
- if (y--, m--, m < 0 || l[y] !== R[m]) {
942
- var b = `
969
+ if (y--, m--, m < 0 || l[y] !== k[m]) {
970
+ var C = `
943
971
  ` + l[y].replace(" at new ", " at ");
944
- return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, b), b;
972
+ return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, C), C;
945
973
  }
946
974
  while (y >= 1 && m >= 0);
947
975
  break;
948
976
  }
949
977
  }
950
978
  } finally {
951
- ne = !1, te.current = h, Qe(), Error.prepareStackTrace = f;
979
+ ie = !1, re.current = h, tt(), Error.prepareStackTrace = d;
952
980
  }
953
- var F = e ? e.displayName || e.name : "", je = F ? G(F) : "";
954
- return typeof e == "function" && B.set(e, je), je;
981
+ var L = e ? e.displayName || e.name : "", je = L ? H(L) : "";
982
+ return typeof e == "function" && q.set(e, je), je;
955
983
  }
956
- function et(e, r, i) {
957
- return Te(e, !1);
984
+ function nt(e, r, i) {
985
+ return Re(e, !1);
958
986
  }
959
- function tt(e) {
987
+ function it(e) {
960
988
  var r = e.prototype;
961
989
  return !!(r && r.isReactComponent);
962
990
  }
963
- function z(e, r, i) {
991
+ function X(e, r, i) {
964
992
  if (e == null)
965
993
  return "";
966
994
  if (typeof e == "function")
967
- return Te(e, tt(e));
995
+ return Re(e, it(e));
968
996
  if (typeof e == "string")
969
- return G(e);
997
+ return H(e);
970
998
  switch (e) {
971
- case C:
972
- return G("Suspense");
973
- case S:
974
- return G("SuspenseList");
999
+ case P:
1000
+ return H("Suspense");
1001
+ case T:
1002
+ return H("SuspenseList");
975
1003
  }
976
1004
  if (typeof e == "object")
977
1005
  switch (e.$$typeof) {
978
- case g:
979
- return et(e.render);
980
- case T:
981
- return z(e.type, r, i);
982
- case d: {
983
- var s = e, f = s._payload, h = s._init;
1006
+ case v:
1007
+ return nt(e.render);
1008
+ case R:
1009
+ return X(e.type, r, i);
1010
+ case f: {
1011
+ var s = e, d = s._payload, h = s._init;
984
1012
  try {
985
- return z(h(f), r, i);
1013
+ return X(h(d), r, i);
986
1014
  } catch {
987
1015
  }
988
1016
  }
989
1017
  }
990
1018
  return "";
991
1019
  }
992
- var H = Object.prototype.hasOwnProperty, we = {}, be = O.ReactDebugCurrentFrame;
993
- function q(e) {
1020
+ var Q = Object.prototype.hasOwnProperty, we = {}, be = A.ReactDebugCurrentFrame;
1021
+ function Z(e) {
994
1022
  if (e) {
995
- var r = e._owner, i = z(e.type, e._source, r ? r.type : null);
1023
+ var r = e._owner, i = X(e.type, e._source, r ? r.type : null);
996
1024
  be.setExtraStackFrame(i);
997
1025
  } else
998
1026
  be.setExtraStackFrame(null);
999
1027
  }
1000
- function rt(e, r, i, s, f) {
1028
+ function at(e, r, i, s, d) {
1001
1029
  {
1002
- var h = Function.call.bind(H);
1030
+ var h = Function.call.bind(Q);
1003
1031
  for (var u in e)
1004
1032
  if (h(e, u)) {
1005
1033
  var l = void 0;
1006
1034
  try {
1007
1035
  if (typeof e[u] != "function") {
1008
- var R = Error((s || "React class") + ": " + i + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1009
- throw R.name = "Invariant Violation", R;
1036
+ var k = Error((s || "React class") + ": " + i + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1037
+ throw k.name = "Invariant Violation", k;
1010
1038
  }
1011
1039
  l = e[u](r, u, s, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1012
1040
  } catch (y) {
1013
1041
  l = y;
1014
1042
  }
1015
- l && !(l instanceof Error) && (q(f), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", i, u, typeof l), q(null)), l instanceof Error && !(l.message in we) && (we[l.message] = !0, q(f), E("Failed %s type: %s", i, l.message), q(null));
1043
+ l && !(l instanceof Error) && (Z(d), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", i, u, typeof l), Z(null)), l instanceof Error && !(l.message in we) && (we[l.message] = !0, Z(d), E("Failed %s type: %s", i, l.message), Z(null));
1016
1044
  }
1017
1045
  }
1018
1046
  }
1019
- var nt = Array.isArray;
1020
- function ie(e) {
1021
- return nt(e);
1047
+ var ot = Array.isArray;
1048
+ function ae(e) {
1049
+ return ot(e);
1022
1050
  }
1023
- function it(e) {
1051
+ function st(e) {
1024
1052
  {
1025
1053
  var r = typeof Symbol == "function" && Symbol.toStringTag, i = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
1026
1054
  return i;
1027
1055
  }
1028
1056
  }
1029
- function at(e) {
1057
+ function ct(e) {
1030
1058
  try {
1031
1059
  return Ce(e), !1;
1032
1060
  } catch {
@@ -1037,39 +1065,39 @@ function er() {
1037
1065
  return "" + e;
1038
1066
  }
1039
1067
  function Pe(e) {
1040
- if (at(e))
1041
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", it(e)), Ce(e);
1068
+ if (ct(e))
1069
+ return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", st(e)), Ce(e);
1042
1070
  }
1043
- var W = O.ReactCurrentOwner, ot = {
1071
+ var N = A.ReactCurrentOwner, lt = {
1044
1072
  key: !0,
1045
1073
  ref: !0,
1046
1074
  __self: !0,
1047
1075
  __source: !0
1048
- }, Oe, Ie, ae;
1049
- ae = {};
1050
- function st(e) {
1051
- if (H.call(e, "ref")) {
1076
+ }, Oe, Ie, oe;
1077
+ oe = {};
1078
+ function ut(e) {
1079
+ if (Q.call(e, "ref")) {
1052
1080
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
1053
1081
  if (r && r.isReactWarning)
1054
1082
  return !1;
1055
1083
  }
1056
1084
  return e.ref !== void 0;
1057
1085
  }
1058
- function ct(e) {
1059
- if (H.call(e, "key")) {
1086
+ function ft(e) {
1087
+ if (Q.call(e, "key")) {
1060
1088
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
1061
1089
  if (r && r.isReactWarning)
1062
1090
  return !1;
1063
1091
  }
1064
1092
  return e.key !== void 0;
1065
1093
  }
1066
- function lt(e, r) {
1067
- if (typeof e.ref == "string" && W.current && r && W.current.stateNode !== r) {
1068
- var i = I(W.current.type);
1069
- ae[i] || (E('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', I(W.current.type), e.ref), ae[i] = !0);
1094
+ function dt(e, r) {
1095
+ if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
1096
+ var i = K(N.current.type);
1097
+ oe[i] || (E('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', K(N.current.type), e.ref), oe[i] = !0);
1070
1098
  }
1071
1099
  }
1072
- function ut(e, r) {
1100
+ function ht(e, r) {
1073
1101
  {
1074
1102
  var i = function() {
1075
1103
  Oe || (Oe = !0, E("%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)", r));
@@ -1080,7 +1108,7 @@ function er() {
1080
1108
  });
1081
1109
  }
1082
1110
  }
1083
- function ft(e, r) {
1111
+ function gt(e, r) {
1084
1112
  {
1085
1113
  var i = function() {
1086
1114
  Ie || (Ie = !0, E("%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)", r));
@@ -1091,7 +1119,7 @@ function er() {
1091
1119
  });
1092
1120
  }
1093
1121
  }
1094
- var dt = function(e, r, i, s, f, h, u) {
1122
+ var vt = function(e, r, i, s, d, h, u) {
1095
1123
  var l = {
1096
1124
  // This tag allows us to uniquely identify this as a React Element
1097
1125
  $$typeof: t,
@@ -1117,44 +1145,44 @@ function er() {
1117
1145
  configurable: !1,
1118
1146
  enumerable: !1,
1119
1147
  writable: !1,
1120
- value: f
1148
+ value: d
1121
1149
  }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
1122
1150
  };
1123
- function ht(e, r, i, s, f) {
1151
+ function yt(e, r, i, s, d) {
1124
1152
  {
1125
- var h, u = {}, l = null, R = null;
1126
- i !== void 0 && (Pe(i), l = "" + i), ct(r) && (Pe(r.key), l = "" + r.key), st(r) && (R = r.ref, lt(r, f));
1153
+ var h, u = {}, l = null, k = null;
1154
+ i !== void 0 && (Pe(i), l = "" + i), ft(r) && (Pe(r.key), l = "" + r.key), ut(r) && (k = r.ref, dt(r, d));
1127
1155
  for (h in r)
1128
- H.call(r, h) && !ot.hasOwnProperty(h) && (u[h] = r[h]);
1156
+ Q.call(r, h) && !lt.hasOwnProperty(h) && (u[h] = r[h]);
1129
1157
  if (e && e.defaultProps) {
1130
1158
  var y = e.defaultProps;
1131
1159
  for (h in y)
1132
1160
  u[h] === void 0 && (u[h] = y[h]);
1133
1161
  }
1134
- if (l || R) {
1162
+ if (l || k) {
1135
1163
  var m = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
1136
- l && ut(u, m), R && ft(u, m);
1164
+ l && ht(u, m), k && gt(u, m);
1137
1165
  }
1138
- return dt(e, l, R, f, s, W.current, u);
1166
+ return vt(e, l, k, d, s, N.current, u);
1139
1167
  }
1140
1168
  }
1141
- var oe = O.ReactCurrentOwner, xe = O.ReactDebugCurrentFrame;
1169
+ var se = A.ReactCurrentOwner, xe = A.ReactDebugCurrentFrame;
1142
1170
  function j(e) {
1143
1171
  if (e) {
1144
- var r = e._owner, i = z(e.type, e._source, r ? r.type : null);
1172
+ var r = e._owner, i = X(e.type, e._source, r ? r.type : null);
1145
1173
  xe.setExtraStackFrame(i);
1146
1174
  } else
1147
1175
  xe.setExtraStackFrame(null);
1148
1176
  }
1149
- var se;
1150
- se = !1;
1151
- function ce(e) {
1177
+ var ce;
1178
+ ce = !1;
1179
+ function le(e) {
1152
1180
  return typeof e == "object" && e !== null && e.$$typeof === t;
1153
1181
  }
1154
1182
  function Ae() {
1155
1183
  {
1156
- if (oe.current) {
1157
- var e = I(oe.current.type);
1184
+ if (se.current) {
1185
+ var e = K(se.current.type);
1158
1186
  if (e)
1159
1187
  return `
1160
1188
 
@@ -1163,7 +1191,7 @@ Check the render method of \`` + e + "`.";
1163
1191
  return "";
1164
1192
  }
1165
1193
  }
1166
- function gt(e) {
1194
+ function pt(e) {
1167
1195
  {
1168
1196
  if (e !== void 0) {
1169
1197
  var r = e.fileName.replace(/^.*[\\\/]/, ""), i = e.lineNumber;
@@ -1175,7 +1203,7 @@ Check your code at ` + r + ":" + i + ".";
1175
1203
  }
1176
1204
  }
1177
1205
  var Ke = {};
1178
- function vt(e) {
1206
+ function mt(e) {
1179
1207
  {
1180
1208
  var r = Ae();
1181
1209
  if (!r) {
@@ -1192,34 +1220,34 @@ Check the top-level render call using <` + i + ">.");
1192
1220
  if (!e._store || e._store.validated || e.key != null)
1193
1221
  return;
1194
1222
  e._store.validated = !0;
1195
- var i = vt(r);
1223
+ var i = mt(r);
1196
1224
  if (Ke[i])
1197
1225
  return;
1198
1226
  Ke[i] = !0;
1199
1227
  var s = "";
1200
- e && e._owner && e._owner !== oe.current && (s = " It was passed a child from " + I(e._owner.type) + "."), j(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, s), j(null);
1228
+ e && e._owner && e._owner !== se.current && (s = " It was passed a child from " + K(e._owner.type) + "."), j(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, s), j(null);
1201
1229
  }
1202
1230
  }
1203
1231
  function De(e, r) {
1204
1232
  {
1205
1233
  if (typeof e != "object")
1206
1234
  return;
1207
- if (ie(e))
1235
+ if (ae(e))
1208
1236
  for (var i = 0; i < e.length; i++) {
1209
1237
  var s = e[i];
1210
- ce(s) && Ue(s, r);
1238
+ le(s) && Ue(s, r);
1211
1239
  }
1212
- else if (ce(e))
1240
+ else if (le(e))
1213
1241
  e._store && (e._store.validated = !0);
1214
1242
  else if (e) {
1215
- var f = Q(e);
1216
- if (typeof f == "function" && f !== e.entries)
1217
- for (var h = f.call(e), u; !(u = h.next()).done; )
1218
- ce(u.value) && Ue(u.value, r);
1243
+ var d = ee(e);
1244
+ if (typeof d == "function" && d !== e.entries)
1245
+ for (var h = d.call(e), u; !(u = h.next()).done; )
1246
+ le(u.value) && Ue(u.value, r);
1219
1247
  }
1220
1248
  }
1221
1249
  }
1222
- function yt(e) {
1250
+ function Et(e) {
1223
1251
  {
1224
1252
  var r = e.type;
1225
1253
  if (r == null || typeof r == "string")
@@ -1227,24 +1255,24 @@ Check the top-level render call using <` + i + ">.");
1227
1255
  var i;
1228
1256
  if (typeof r == "function")
1229
1257
  i = r.propTypes;
1230
- else if (typeof r == "object" && (r.$$typeof === g || // Note: Memo only checks outer props here.
1258
+ else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
1231
1259
  // Inner props are checked in the reconciler.
1232
- r.$$typeof === T))
1260
+ r.$$typeof === R))
1233
1261
  i = r.propTypes;
1234
1262
  else
1235
1263
  return;
1236
1264
  if (i) {
1237
- var s = I(r);
1238
- rt(i, e.props, "prop", s, e);
1239
- } else if (r.PropTypes !== void 0 && !se) {
1240
- se = !0;
1241
- var f = I(r);
1242
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", f || "Unknown");
1265
+ var s = K(r);
1266
+ at(i, e.props, "prop", s, e);
1267
+ } else if (r.PropTypes !== void 0 && !ce) {
1268
+ ce = !0;
1269
+ var d = K(r);
1270
+ E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
1243
1271
  }
1244
1272
  typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1245
1273
  }
1246
1274
  }
1247
- function pt(e) {
1275
+ function _t(e) {
1248
1276
  {
1249
1277
  for (var r = Object.keys(e.props), i = 0; i < r.length; i++) {
1250
1278
  var s = r[i];
@@ -1256,48 +1284,48 @@ Check the top-level render call using <` + i + ">.");
1256
1284
  e.ref !== null && (j(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
1257
1285
  }
1258
1286
  }
1259
- function Me(e, r, i, s, f, h) {
1287
+ function Me(e, r, i, s, d, h) {
1260
1288
  {
1261
- var u = He(e);
1289
+ var u = Qe(e);
1262
1290
  if (!u) {
1263
1291
  var l = "";
1264
1292
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (l += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1265
- var R = gt(f);
1266
- R ? l += R : l += Ae();
1293
+ var k = pt(d);
1294
+ k ? l += k : l += Ae();
1267
1295
  var y;
1268
- e === null ? y = "null" : ie(e) ? y = "array" : e !== void 0 && e.$$typeof === t ? (y = "<" + (I(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, l);
1296
+ e === null ? y = "null" : ae(e) ? y = "array" : e !== void 0 && e.$$typeof === t ? (y = "<" + (K(e.type) || "Unknown") + " />", l = " Did you accidentally export a JSX literal instead of a component?") : y = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", y, l);
1269
1297
  }
1270
- var m = ht(e, r, i, f, h);
1298
+ var m = yt(e, r, i, d, h);
1271
1299
  if (m == null)
1272
1300
  return m;
1273
1301
  if (u) {
1274
- var b = r.children;
1275
- if (b !== void 0)
1302
+ var C = r.children;
1303
+ if (C !== void 0)
1276
1304
  if (s)
1277
- if (ie(b)) {
1278
- for (var F = 0; F < b.length; F++)
1279
- De(b[F], e);
1280
- Object.freeze && Object.freeze(b);
1305
+ if (ae(C)) {
1306
+ for (var L = 0; L < C.length; L++)
1307
+ De(C[L], e);
1308
+ Object.freeze && Object.freeze(C);
1281
1309
  } else
1282
1310
  E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1283
1311
  else
1284
- De(b, e);
1312
+ De(C, e);
1285
1313
  }
1286
- return e === o ? pt(m) : yt(m), m;
1314
+ return e === o ? _t(m) : Et(m), m;
1287
1315
  }
1288
1316
  }
1289
- function mt(e, r, i) {
1317
+ function Tt(e, r, i) {
1290
1318
  return Me(e, r, i, !0);
1291
1319
  }
1292
- function Et(e, r, i) {
1320
+ function St(e, r, i) {
1293
1321
  return Me(e, r, i, !1);
1294
1322
  }
1295
- var _t = Et, St = mt;
1296
- $.Fragment = o, $.jsx = _t, $.jsxs = St;
1297
- }()), $;
1323
+ var kt = St, Rt = Tt;
1324
+ V.Fragment = o, V.jsx = kt, V.jsxs = Rt;
1325
+ }()), V;
1298
1326
  }
1299
- process.env.NODE_ENV === "production" ? fe.exports = Zt() : fe.exports = er();
1300
- var de = fe.exports;
1327
+ process.env.NODE_ENV === "production" ? de.exports = Zt() : de.exports = er();
1328
+ var he = de.exports;
1301
1329
  const tr = (a, t) => {
1302
1330
  switch (t.type) {
1303
1331
  case "INIT":
@@ -1308,6 +1336,7 @@ const tr = (a, t) => {
1308
1336
  user: t.user,
1309
1337
  error: void 0
1310
1338
  };
1339
+ case "GET_TOKENS_COMPLETE":
1311
1340
  case "HANDLE_CALLBACK_COMPLETE":
1312
1341
  case "GET_ACCESS_TOKEN_COMPLETE":
1313
1342
  return {
@@ -1333,7 +1362,7 @@ const tr = (a, t) => {
1333
1362
  }, rr = {
1334
1363
  isLoading: !0,
1335
1364
  isAuthenticated: !1
1336
- }, Ve = (a) => {
1365
+ }, Je = (a) => {
1337
1366
  if (a == null || Object.keys(a).length <= 0)
1338
1367
  return !0;
1339
1368
  const t = Object.keys(a);
@@ -1342,7 +1371,7 @@ const tr = (a, t) => {
1342
1371
  return !1;
1343
1372
  return !0;
1344
1373
  }, nr = (a) => {
1345
- const t = Ve(a.config), n = Ve(a.persistentOptions);
1374
+ const t = Je(a.config), n = Je(a.persistentOptions);
1346
1375
  return !t || !n;
1347
1376
  }, ir = (a) => {
1348
1377
  const {
@@ -1350,36 +1379,36 @@ const tr = (a, t) => {
1350
1379
  configurationEndpoint: n,
1351
1380
  clientId: o,
1352
1381
  redirectUrl: c,
1353
- logoutRedirectUrl: k,
1382
+ logoutRedirectUrl: S,
1354
1383
  scopes: _,
1355
1384
  persistentStore: w,
1356
- onRedirectCallback: g,
1357
- checkRedirectUrlMatch: C
1385
+ onRedirectCallback: v,
1386
+ checkRedirectUrlMatch: P
1358
1387
  } = a;
1359
- if (Je(ue) != null)
1388
+ if (ze(fe) != null)
1360
1389
  throw new Error("TID Provider already defined");
1361
- const T = {
1390
+ const R = {
1362
1391
  config: {
1363
1392
  configurationEndpoint: n ?? "",
1364
1393
  clientId: o ?? "",
1365
1394
  redirectUrl: c ?? "",
1366
- logoutRedirectUrl: k ?? "",
1395
+ logoutRedirectUrl: S ?? "",
1367
1396
  scopes: _ ?? [""]
1368
1397
  },
1369
1398
  persistentOptions: {
1370
1399
  persistentStore: w ?? "in-memory"
1371
1400
  }
1372
- }, [d] = Ot(a.tidClient ?? new Qt(T)), [K, A] = It(tr, rr), V = xt(!1), Q = Le(
1373
- () => C ? d.getRedirectUrl() : void 0,
1374
- [C, d]
1401
+ }, [f] = At(a.tidClient ?? new Qt(R)), [D, x] = Kt(tr, rr), Y = Ut(!1), ee = Fe(
1402
+ () => P ? f.getRedirectUrl() : void 0,
1403
+ [P, f]
1375
1404
  );
1376
- Ge(() => {
1377
- V.current || (a.tidClient != null && nr({
1405
+ He(() => {
1406
+ Y.current || (a.tidClient != null && nr({
1378
1407
  config: {
1379
1408
  configurationEndpoint: n,
1380
1409
  clientId: o,
1381
1410
  redirectUrl: c,
1382
- logoutRedirectUrl: k,
1411
+ logoutRedirectUrl: S,
1383
1412
  scopes: _
1384
1413
  },
1385
1414
  persistentOptions: {
@@ -1387,71 +1416,78 @@ const tr = (a, t) => {
1387
1416
  }
1388
1417
  }) && console.warn(
1389
1418
  "When TID client is pass as prop, any client configuration property sent directly to the TID Provider component will be ignored"
1390
- ), V.current = !0, (async () => {
1419
+ ), Y.current = !0, (async () => {
1391
1420
  try {
1392
- let v;
1393
- if ($t(void 0, Q)) {
1394
- const { authState: P } = await d.handleCallback();
1395
- v = await d.getUser(), g != null && g(P);
1421
+ let g;
1422
+ if (Yt(void 0, ee)) {
1423
+ const { authState: b } = await f.handleCallback();
1424
+ g = await f.getUser(), v != null && v(b);
1396
1425
  } else
1397
- await d.loadUserSession(), v = await d.getUser();
1398
- A({ type: "INIT", user: v });
1399
- } catch (v) {
1400
- let P = v;
1401
- typeof v == "string" && (P = new Error(v)), A({ type: "ERROR", error: P });
1426
+ await f.loadUserSession(), g = await f.getUser();
1427
+ x({ type: "INIT", user: g });
1428
+ } catch (g) {
1429
+ let b = g;
1430
+ typeof g == "string" && (b = new Error(g)), x({ type: "ERROR", error: b });
1402
1431
  }
1403
1432
  })());
1404
- }, [d, g]);
1405
- const O = X(async () => {
1406
- const v = await d.getAccessTokenSilently(), P = await d.getUser();
1407
- return A({
1433
+ }, [f, v]);
1434
+ const A = W(async () => {
1435
+ const g = await f.getAccessTokenSilently(), b = await f.getUser();
1436
+ return x({
1408
1437
  type: "GET_ACCESS_TOKEN_COMPLETE",
1409
- user: P
1410
- }), v;
1411
- }, [d]), E = X(
1412
- async (v) => {
1413
- await d.loginWithRedirect(v);
1438
+ user: b
1439
+ }), g;
1440
+ }, [f]), E = W(async () => {
1441
+ const g = await f.getTokens(), b = await f.getUser();
1442
+ return x({
1443
+ type: "GET_TOKENS_COMPLETE",
1444
+ user: b
1445
+ }), g;
1446
+ }, [f]), G = W(
1447
+ async (g) => {
1448
+ await f.loginWithRedirect(g);
1414
1449
  },
1415
- [d]
1416
- ), Y = X(
1417
- async (v) => {
1418
- await d.logout(v), (v == null ? void 0 : v.disabledAutoRedirect) != null && v.disabledAutoRedirect && A({
1450
+ [f]
1451
+ ), J = W(
1452
+ async (g) => {
1453
+ await f.logout(g), (g == null ? void 0 : g.disabledAutoRedirect) != null && g.disabledAutoRedirect && x({
1419
1454
  type: "LOGOUT"
1420
1455
  });
1421
1456
  },
1422
- [d]
1423
- ), J = X(
1424
- async (v) => {
1425
- const { authState: P } = await d.handleCallback(v), ee = await d.getUser();
1426
- return A({
1457
+ [f]
1458
+ ), B = W(
1459
+ async (g) => {
1460
+ const { authState: b } = await f.handleCallback(g), z = await f.getUser();
1461
+ return x({
1427
1462
  type: "HANDLE_CALLBACK_COMPLETE",
1428
- user: ee
1463
+ user: z
1429
1464
  }), {
1430
- authState: P
1465
+ authState: b
1431
1466
  };
1432
1467
  },
1433
- [d]
1434
- ), Z = Le(
1468
+ [f]
1469
+ ), te = Fe(
1435
1470
  () => ({
1436
- ...K,
1437
- getAccessTokenSilently: O,
1438
- loginWithRedirect: E,
1439
- handleCallback: J,
1440
- logout: Y
1471
+ ...D,
1472
+ getAccessTokenSilently: A,
1473
+ getTokens: E,
1474
+ loginWithRedirect: G,
1475
+ handleCallback: B,
1476
+ logout: J
1441
1477
  }),
1442
- [K, O, E, J, Y]
1478
+ [D, A, E, G, B, J]
1443
1479
  );
1444
- return /* @__PURE__ */ de.jsx(ue.Provider, { value: Z, children: t });
1445
- }, lr = ze, ur = ir, fr = ({ renderComponent: a, loader: t }) => {
1446
- const { isAuthenticated: n, isLoading: o, loginWithRedirect: c } = ze();
1447
- return Ge(() => {
1480
+ return /* @__PURE__ */ he.jsx(fe.Provider, { value: te, children: t });
1481
+ }, lr = Xe, ur = ir, fr = ({ renderComponent: a, loader: t }) => {
1482
+ const { isAuthenticated: n, isLoading: o, loginWithRedirect: c } = Xe();
1483
+ return He(() => {
1448
1484
  !o && !n && (async () => await c())();
1449
- }, [o, n, c]), n ? a : t || /* @__PURE__ */ de.jsx(de.Fragment, {});
1485
+ }, [o, n, c]), n ? a : t || /* @__PURE__ */ he.jsx(he.Fragment, {});
1450
1486
  };
1451
1487
  export {
1452
1488
  fr as AuthenticationGuard,
1453
1489
  Qt as TIDClient,
1454
- ue as TIDContext,
1490
+ fe as TIDContext,
1455
1491
  ur as TIDProvider,
1456
1492
  lr as useAuth
1457
1493
  };