@trimble-oss/trimble-id-react 0.1.0-rc.1 → 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -15
- package/dist/TIDClient/TIDClient.d.ts +0 -19
- package/dist/TIDClient/index.d.ts +0 -2
- package/dist/TIDClient/interfaces.d.ts +2 -43
- package/dist/TIDClient/storage/cache-storage/CacheManager.d.ts +1 -34
- package/dist/TIDProvider/TIDProvider.d.ts +1 -9
- package/dist/index.d.ts +0 -1
- package/dist/trimble-id-react.es.js +475 -706
- package/dist/trimble-id-react.umd.js +10 -10
- package/package.json +2 -2
- package/dist/TIDClient/storage/cache-storage/CacheKey.d.ts +0 -46
- package/dist/TIDClient/storage/cache-storage/LocalStorageCache.d.ts +0 -67
- package/dist/TIDClient/storage/cache-storage/SessionStorageCache.d.ts +0 -67
- package/dist/TIDClient/storage/cache-storage/constants.d.ts +0 -15
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { OpenIdEndpointProvider as
|
|
5
|
-
import * as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
var Rt = Object.defineProperty;
|
|
2
|
+
var wt = (i, t, a) => t in i ? Rt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : i[t] = a;
|
|
3
|
+
var P = (i, t, a) => (wt(i, typeof t != "symbol" ? t + "" : t, a), a);
|
|
4
|
+
import { OpenIdEndpointProvider as bt, AuthorizationCodeGrantTokenProvider as Fe, AnalyticsHttpClient as Ct, BearerTokenHttpClientProvider as St } from "@trimble-oss/trimble-id";
|
|
5
|
+
import * as le from "es-cookie";
|
|
6
|
+
import Pt from "jwt-decode";
|
|
7
|
+
import Ge, { createContext as Ot, useContext as Be, useState as xt, useReducer as It, useRef as At, useMemo as Le, useEffect as qe, useCallback as $ } from "react";
|
|
8
8
|
class Dt {
|
|
9
9
|
constructor() {
|
|
10
10
|
/**
|
|
@@ -14,7 +14,7 @@ class Dt {
|
|
|
14
14
|
* @see {https://medium.com/javascript-scene/encapsulation-in-javascript-26be60e325b4} Encapsulation
|
|
15
15
|
* @return {CacheStorage} Key for the token
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
P(this, "generateCache", function() {
|
|
18
18
|
const t = {
|
|
19
19
|
token: void 0,
|
|
20
20
|
user: void 0
|
|
@@ -39,16 +39,16 @@ class Dt {
|
|
|
39
39
|
* @param {TIDAuthToken} token - Token that you want to store in cache
|
|
40
40
|
* @return {Promise<void>} Empty promise
|
|
41
41
|
*/
|
|
42
|
-
async storeToken(
|
|
43
|
-
t.token =
|
|
42
|
+
async storeToken(a) {
|
|
43
|
+
t.token = a;
|
|
44
44
|
},
|
|
45
45
|
/**
|
|
46
46
|
* Store user in cache
|
|
47
47
|
* @param {TIDUser} user - User that you want to store in cache
|
|
48
48
|
* @return {Promise<void>} Empty promise
|
|
49
49
|
*/
|
|
50
|
-
async storeUser(
|
|
51
|
-
t.user =
|
|
50
|
+
async storeUser(a) {
|
|
51
|
+
t.user = a;
|
|
52
52
|
},
|
|
53
53
|
/**
|
|
54
54
|
* The clear the cache from the storage
|
|
@@ -62,228 +62,13 @@ class Dt {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
class Mt {
|
|
65
|
-
|
|
66
|
-
* Initialized configuration to store information into local storage
|
|
67
|
-
* @param {LocalStorageCacheOptions} options - Configuration for caching in localstorage
|
|
68
|
-
*/
|
|
69
|
-
constructor(t) {
|
|
70
|
-
/**
|
|
71
|
-
* Local storage from the browser
|
|
72
|
-
* @type {Storage}
|
|
73
|
-
*/
|
|
74
|
-
p(this, "localStorage");
|
|
75
|
-
/**
|
|
76
|
-
* The cache key represents the keys for storing and retrieving user and token from auth
|
|
77
|
-
* @type {CacheKey}
|
|
78
|
-
*/
|
|
79
|
-
p(this, "cacheKey");
|
|
80
|
-
this.localStorage = window.localStorage, this.cacheKey = t.cacheKey;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Get token store in localstorage
|
|
84
|
-
* @return {Promise<TIDAuthToken | undefined>} - Token store in localstorage
|
|
85
|
-
*/
|
|
86
|
-
async getToken() {
|
|
87
|
-
const t = this.getAuthKey(), n = localStorage.getItem(t);
|
|
88
|
-
return n ? JSON.parse(n) : void 0;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Get user store in localstorage
|
|
92
|
-
* @return {Promise<TIDUser | undefined>} - User store in localstorage
|
|
93
|
-
*/
|
|
94
|
-
async getUser() {
|
|
95
|
-
const t = this.getUserKey(), n = localStorage.getItem(t);
|
|
96
|
-
return n ? JSON.parse(n) : void 0;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Store token in localstorage
|
|
100
|
-
* @param {TIDAuthToken} token - Token that you want to store in localstorage
|
|
101
|
-
* @return {Promise<void>} Empty promise
|
|
102
|
-
*/
|
|
103
|
-
async storeToken(t) {
|
|
104
|
-
const n = this.getAuthKey(), o = JSON.stringify(t);
|
|
105
|
-
localStorage.setItem(n, o);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Store user in cache
|
|
109
|
-
* @param {TIDUser} user - User that you want to store in localstorage
|
|
110
|
-
* @return {Promise<void>} Empty promise
|
|
111
|
-
*/
|
|
112
|
-
async storeUser(t) {
|
|
113
|
-
const n = this.getUserKey(), o = JSON.stringify(t);
|
|
114
|
-
localStorage.setItem(n, o);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Get the full key from the cachekey for the user
|
|
118
|
-
* @return {string} - Full key to get the token from the localstorage
|
|
119
|
-
*/
|
|
120
|
-
getUserKey() {
|
|
121
|
-
return this.cacheKey.getUserKey();
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Get the full key from the cachekey for the token
|
|
125
|
-
* @return {string} - Full key to get the token from the localstorage
|
|
126
|
-
*/
|
|
127
|
-
getAuthKey() {
|
|
128
|
-
return this.cacheKey.getAuthKey();
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* The clear the cache from the localstorage
|
|
132
|
-
* @return {Promise<void>} Empty promise
|
|
133
|
-
*/
|
|
134
|
-
clear() {
|
|
135
|
-
return this.localStorage.removeItem(this.getAuthKey()), this.localStorage.removeItem(this.getUserKey()), Promise.resolve(void 0);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
const ge = "@TID", jt = `${ge}_AUTH_KEY`, Lt = `${ge}_USER_KEY`;
|
|
139
|
-
class Ft {
|
|
140
|
-
/**
|
|
141
|
-
* Initialized the cache key
|
|
142
|
-
* @param {CacheKeyOptions} cacheKeyOptions - Cache key options to edit the default values
|
|
143
|
-
*/
|
|
144
|
-
constructor(t) {
|
|
145
|
-
/**
|
|
146
|
-
* Client id of the application created in trimble developer console
|
|
147
|
-
* @type {string}
|
|
148
|
-
*/
|
|
149
|
-
p(this, "clientId");
|
|
150
|
-
/**
|
|
151
|
-
* Prefix value of the key, by default the prefix is based on the constant PREFIX_KEY
|
|
152
|
-
* @type {string}
|
|
153
|
-
*/
|
|
154
|
-
p(this, "prefix", ge);
|
|
155
|
-
/**
|
|
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
|
-
* @type {string}
|
|
158
|
-
*/
|
|
159
|
-
p(this, "authSuffix", jt);
|
|
160
|
-
/**
|
|
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
|
-
* @type {string}
|
|
163
|
-
*/
|
|
164
|
-
p(this, "userSuffix", Lt);
|
|
165
|
-
this.clientId = t.client_id;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Get key to store/retrieve user
|
|
169
|
-
* @return {string} Key for the user
|
|
170
|
-
*/
|
|
171
|
-
getUserKey() {
|
|
172
|
-
return `${this.prefix}_${this.userSuffix}_${this.clientId}`;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Get key to store/retrieve token
|
|
176
|
-
* @return {string} Key for the token
|
|
177
|
-
*/
|
|
178
|
-
getAuthKey() {
|
|
179
|
-
return `${this.prefix}_${this.authSuffix}_${this.clientId}`;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
class Nt {
|
|
183
|
-
/**
|
|
184
|
-
* Initialized configuration to store information into session storage
|
|
185
|
-
* @param {SessionStorageCacheOptions} options - Configuration for caching in session storage
|
|
186
|
-
*/
|
|
187
|
-
constructor(t) {
|
|
188
|
-
/**
|
|
189
|
-
* Session storage from the browser
|
|
190
|
-
* @type {Storage}
|
|
191
|
-
*/
|
|
192
|
-
p(this, "sessionStorage");
|
|
193
|
-
/**
|
|
194
|
-
* The cache key represents the keys for storing and retrieving user and token from auth
|
|
195
|
-
* @type {CacheKey}
|
|
196
|
-
*/
|
|
197
|
-
p(this, "cacheKey");
|
|
198
|
-
this.sessionStorage = window.sessionStorage, this.cacheKey = t.cacheKey;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Get token store in session storage
|
|
202
|
-
* @return {Promise<TIDAuthToken | undefined>} - Token store in session storage
|
|
203
|
-
*/
|
|
204
|
-
async getToken() {
|
|
205
|
-
const t = this.getAuthKey(), n = sessionStorage.getItem(t);
|
|
206
|
-
return n ? JSON.parse(n) : void 0;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Get user store in session storage
|
|
210
|
-
* @return {Promise<TIDUser | undefined>} - User store in session storage
|
|
211
|
-
*/
|
|
212
|
-
async getUser() {
|
|
213
|
-
const t = this.getUserKey(), n = sessionStorage.getItem(t);
|
|
214
|
-
return n ? JSON.parse(n) : void 0;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Store token in session storage
|
|
218
|
-
* @param {TIDAuthToken} authToken - Token that you want to store in session storage
|
|
219
|
-
* @return {Promise<void>} Empty promise
|
|
220
|
-
*/
|
|
221
|
-
async storeToken(t) {
|
|
222
|
-
const n = this.getAuthKey(), o = JSON.stringify(t);
|
|
223
|
-
sessionStorage.setItem(n, o);
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Store user in cache
|
|
227
|
-
* @param {TIDUser} user - User that you want to store in session storage
|
|
228
|
-
* @return {Promise<void>} Empty promise
|
|
229
|
-
*/
|
|
230
|
-
async storeUser(t) {
|
|
231
|
-
const n = this.getUserKey(), o = JSON.stringify(t);
|
|
232
|
-
sessionStorage.setItem(n, o);
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Get the full key from the cachekey for the user
|
|
236
|
-
* @return {string} - Full key to get the token from the session storage
|
|
237
|
-
*/
|
|
238
|
-
getUserKey() {
|
|
239
|
-
return this.cacheKey.getUserKey();
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Get the full key from the cachekey for the token
|
|
243
|
-
* @return {string} - Full key to get the token from the session storage
|
|
244
|
-
*/
|
|
245
|
-
getAuthKey() {
|
|
246
|
-
return this.cacheKey.getAuthKey();
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* The clear the cache from the session storage
|
|
250
|
-
* @return {Promise<void>} Empty promise
|
|
251
|
-
*/
|
|
252
|
-
clear() {
|
|
253
|
-
return this.sessionStorage.removeItem(this.getAuthKey()), this.sessionStorage.removeItem(this.getUserKey()), Promise.resolve(void 0);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
class Wt {
|
|
257
|
-
/**
|
|
258
|
-
* Create a cache manager to extract or save the user, and token
|
|
259
|
-
* @param {CacheManagerOptions} options - Configuration for the managing the caching
|
|
260
|
-
*/
|
|
261
|
-
constructor(t) {
|
|
262
|
-
/**
|
|
263
|
-
* Type persistent you want the user and token to be store
|
|
264
|
-
* in-memory - This one will only persist will the user stays in the page
|
|
265
|
-
* localStorage - This persistent doesn't have expiration date
|
|
266
|
-
* sessionStorage - This one is cleared when the page session ends
|
|
267
|
-
* @type {PersistentStore}
|
|
268
|
-
*/
|
|
269
|
-
p(this, "persistentStore");
|
|
65
|
+
constructor() {
|
|
270
66
|
/**
|
|
271
67
|
* Cache option selected
|
|
272
68
|
* @type {CacheStorage}
|
|
273
69
|
*/
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
* The cache key represents the keys for storing and retrieving user and token from auth
|
|
277
|
-
* @type {CacheKey}
|
|
278
|
-
*/
|
|
279
|
-
p(this, "cacheKey");
|
|
280
|
-
this.persistentStore = t.persistentStore, this.cacheKey = new Ft({
|
|
281
|
-
client_id: t.clientId
|
|
282
|
-
}), this.persistentStore === "localStorage" ? this.cacheStorage = new Mt({
|
|
283
|
-
cacheKey: this.cacheKey
|
|
284
|
-
}) : this.persistentStore === "sessionStorage" ? this.cacheStorage = new Nt({
|
|
285
|
-
cacheKey: this.cacheKey
|
|
286
|
-
}) : this.cacheStorage = new Dt().generateCache;
|
|
70
|
+
P(this, "cacheStorage");
|
|
71
|
+
this.cacheStorage = new Dt().generateCache;
|
|
287
72
|
}
|
|
288
73
|
/**
|
|
289
74
|
* Store token in cache
|
|
@@ -323,45 +108,44 @@ class Wt {
|
|
|
323
108
|
await this.cacheStorage.clear();
|
|
324
109
|
}
|
|
325
110
|
}
|
|
326
|
-
const
|
|
327
|
-
let t =
|
|
328
|
-
if (!
|
|
111
|
+
const We = 5 * 6e4, Ut = ["code", "state"], Ne = (i) => i.split("?")[0], jt = (i) => i.split("?")[1], Je = (i) => {
|
|
112
|
+
let t = i;
|
|
113
|
+
if (!i.startsWith("?"))
|
|
329
114
|
try {
|
|
330
|
-
t = new URL(
|
|
115
|
+
t = new URL(i).search;
|
|
331
116
|
} catch {
|
|
332
117
|
}
|
|
333
118
|
return new URLSearchParams(t);
|
|
334
|
-
},
|
|
119
|
+
}, Ft = (i = window.location.href, t) => {
|
|
335
120
|
if (t != null) {
|
|
336
|
-
const o =
|
|
337
|
-
if (o !==
|
|
121
|
+
const o = Ne(t), u = Ne(i ?? "");
|
|
122
|
+
if (o !== u)
|
|
338
123
|
return !1;
|
|
339
124
|
}
|
|
340
|
-
const
|
|
341
|
-
for (const o of
|
|
342
|
-
if (!
|
|
125
|
+
const a = Je(i);
|
|
126
|
+
for (const o of Ut)
|
|
127
|
+
if (!a.has(o))
|
|
343
128
|
return !1;
|
|
344
129
|
return !0;
|
|
345
|
-
},
|
|
346
|
-
id:
|
|
347
|
-
name: `${
|
|
348
|
-
given_name:
|
|
349
|
-
family_name:
|
|
350
|
-
picture:
|
|
351
|
-
email:
|
|
352
|
-
email_verified:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
class Bt {
|
|
130
|
+
}, Lt = (i) => ({
|
|
131
|
+
id: i.sub,
|
|
132
|
+
name: `${i.given_name} ${i.family_name}`,
|
|
133
|
+
given_name: i.given_name,
|
|
134
|
+
family_name: i.family_name,
|
|
135
|
+
picture: i.picture,
|
|
136
|
+
email: i.email,
|
|
137
|
+
email_verified: i.email_verified
|
|
138
|
+
}), Wt = "@TID_COOKIE";
|
|
139
|
+
class Nt {
|
|
356
140
|
/**
|
|
357
141
|
* Retrieve a cookie from the browser
|
|
358
142
|
* @param {string} key - Key to retrieve the cookies
|
|
359
143
|
*/
|
|
360
144
|
get(t) {
|
|
361
|
-
const
|
|
362
|
-
if (
|
|
145
|
+
const a = le.get(t);
|
|
146
|
+
if (a == null)
|
|
363
147
|
throw new Error("Cookie not found");
|
|
364
|
-
return JSON.parse(
|
|
148
|
+
return JSON.parse(a);
|
|
365
149
|
}
|
|
366
150
|
/**
|
|
367
151
|
* Store cookies in the browser
|
|
@@ -373,12 +157,12 @@ class Bt {
|
|
|
373
157
|
* @example Save cookies with a custom domain
|
|
374
158
|
* cookiesStorage.set('key',{data:{...}},{domain:'https://example.com/subpath'})
|
|
375
159
|
*/
|
|
376
|
-
set(t,
|
|
377
|
-
let
|
|
378
|
-
window.location.protocol === "https:" && (
|
|
160
|
+
set(t, a, o) {
|
|
161
|
+
let u = {};
|
|
162
|
+
window.location.protocol === "https:" && (u = {
|
|
379
163
|
secure: !0,
|
|
380
164
|
sameSite: "none"
|
|
381
|
-
}), o != null && o.expires && (
|
|
165
|
+
}), o != null && o.expires && (u.expires = o.expires), o != null && o.domain && (u.domain = o.domain), le.set(t, JSON.stringify(a), u);
|
|
382
166
|
}
|
|
383
167
|
/**
|
|
384
168
|
* Remove a cookie from the browser
|
|
@@ -389,12 +173,12 @@ class Bt {
|
|
|
389
173
|
* @example Remove cookies with custom domain
|
|
390
174
|
* cookiesStorage.remove('key',{domain:'https://example.com/subpath'})
|
|
391
175
|
*/
|
|
392
|
-
remove(t,
|
|
176
|
+
remove(t, a) {
|
|
393
177
|
const o = {};
|
|
394
|
-
|
|
178
|
+
a != null && a.domain && (o.domain = a.domain), le.remove(t, o);
|
|
395
179
|
}
|
|
396
180
|
}
|
|
397
|
-
class
|
|
181
|
+
class $t {
|
|
398
182
|
/**
|
|
399
183
|
* Create a cookies manager to extract or save cookies in the browser
|
|
400
184
|
* @param {CookiesManagerOptions} options - Configuration for the managing the cookies
|
|
@@ -404,13 +188,13 @@ class zt {
|
|
|
404
188
|
* Cookie full key to store and retrieve the information from cookies
|
|
405
189
|
* @type {string}
|
|
406
190
|
*/
|
|
407
|
-
|
|
191
|
+
P(this, "cookieKey");
|
|
408
192
|
/**
|
|
409
193
|
* Cookie storage. This object contain all functions necessary to retrieve and store tokens using cookies
|
|
410
194
|
* @type {CookiesStorage}
|
|
411
195
|
*/
|
|
412
|
-
|
|
413
|
-
this.cookieKey = `${
|
|
196
|
+
P(this, "cookiesStorage");
|
|
197
|
+
this.cookieKey = `${Wt}.${t.clientId}`, this.cookiesStorage = new Nt();
|
|
414
198
|
}
|
|
415
199
|
/**
|
|
416
200
|
* Store cookies in the browser
|
|
@@ -443,18 +227,16 @@ class $e extends Error {
|
|
|
443
227
|
}
|
|
444
228
|
class Ve extends Error {
|
|
445
229
|
}
|
|
446
|
-
class
|
|
230
|
+
class Vt extends Error {
|
|
447
231
|
}
|
|
448
|
-
const O = "@trimble-oss/trimble-id-react",
|
|
232
|
+
const O = "@trimble-oss/trimble-id-react", x = "1.0.0-rc.1", Kt = {
|
|
449
233
|
configurationEndpoint: "",
|
|
450
234
|
clientId: "",
|
|
451
235
|
redirectUrl: "",
|
|
452
236
|
logoutRedirectUrl: "",
|
|
453
237
|
scopes: []
|
|
454
|
-
}, Xt = {
|
|
455
|
-
persistentStore: "in-memory"
|
|
456
238
|
};
|
|
457
|
-
class
|
|
239
|
+
class Yt {
|
|
458
240
|
/**
|
|
459
241
|
* Create a TID client to handle manage all user authentication functions and information
|
|
460
242
|
* @param {CacheManagerOptions} props - TID client configuration
|
|
@@ -464,50 +246,47 @@ class Qt {
|
|
|
464
246
|
* Token provider SDK. This object handles all necessary communication with TID
|
|
465
247
|
* @type {AuthorizationCodeGrantTokenProvider}
|
|
466
248
|
*/
|
|
467
|
-
|
|
249
|
+
P(this, "tokenProvider");
|
|
468
250
|
/**
|
|
469
251
|
* This object manage all caching, and all configurations necessary
|
|
470
252
|
* @type {CacheManager}
|
|
471
253
|
*/
|
|
472
|
-
|
|
254
|
+
P(this, "cacheManager");
|
|
473
255
|
/**
|
|
474
256
|
* This object manage all cookies administration, and all configurations necessary
|
|
475
257
|
* @type {CookiesManager}
|
|
476
258
|
*/
|
|
477
|
-
|
|
259
|
+
P(this, "cookiesManager");
|
|
478
260
|
/**
|
|
479
261
|
* Client id of the application created in trimble developer console
|
|
480
262
|
* @type {string}
|
|
481
263
|
*/
|
|
482
|
-
|
|
264
|
+
P(this, "clientId");
|
|
483
265
|
/**
|
|
484
266
|
* Callback url to redirect the user after the authentication is successful
|
|
485
267
|
* @type {string}
|
|
486
268
|
*/
|
|
487
|
-
|
|
269
|
+
P(this, "redirectUrl");
|
|
488
270
|
/**
|
|
489
271
|
* AnalyticsHttpClient for sending events
|
|
490
272
|
* @type {AnalyticsHttpClient}
|
|
491
273
|
*/
|
|
492
|
-
|
|
493
|
-
const { config:
|
|
494
|
-
if (this.redirectUrl =
|
|
274
|
+
P(this, "analyticshttpclient");
|
|
275
|
+
const { config: a = Kt } = t;
|
|
276
|
+
if (this.redirectUrl = a.redirectUrl, a.configurationEndpoint == null || a.configurationEndpoint == "")
|
|
495
277
|
throw new Error("Configuration endpoint not defined");
|
|
496
|
-
if (
|
|
278
|
+
if (a.clientId == null || a.clientId == "")
|
|
497
279
|
throw new Error("Consumer key is not defined");
|
|
498
|
-
this.cookiesManager = new
|
|
499
|
-
clientId:
|
|
280
|
+
this.cookiesManager = new $t({
|
|
281
|
+
clientId: a.clientId
|
|
500
282
|
});
|
|
501
|
-
const
|
|
502
|
-
let
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
).WithScopes(
|
|
507
|
-
|
|
508
|
-
clientId: n.clientId,
|
|
509
|
-
persistentStore: o.persistentStore
|
|
510
|
-
}), this.clientId = n.clientId, this.analyticshttpclient = Pt, this.analyticshttpclient.sendInitEvent("TIDClient", this.clientId, O, I);
|
|
283
|
+
const o = this.cookiesManager.get(), u = new bt(a.configurationEndpoint);
|
|
284
|
+
let E = new Fe(
|
|
285
|
+
u,
|
|
286
|
+
a.clientId,
|
|
287
|
+
a.redirectUrl
|
|
288
|
+
).WithScopes(a.scopes);
|
|
289
|
+
a.logoutRedirectUrl && (E = E.WithLogoutRedirect(a.logoutRedirectUrl)), (o == null ? void 0 : o.code_verifier) != null && (E = E.WithProofKeyForCodeExchange(o.code_verifier)), this.tokenProvider = E, this.cacheManager = new Mt(), this.clientId = a.clientId, this.analyticshttpclient = Ct, this.analyticshttpclient.sendInitEvent("TIDClient", this.clientId, O, x);
|
|
511
290
|
}
|
|
512
291
|
/**
|
|
513
292
|
* Redirect the user to TID using the browser
|
|
@@ -522,11 +301,11 @@ class Qt {
|
|
|
522
301
|
* // So it can be handled by the developer
|
|
523
302
|
*/
|
|
524
303
|
async loginWithRedirect(t) {
|
|
525
|
-
this.analyticshttpclient.sendMethodEvent(this.loginWithRedirect.name, this.clientId, O,
|
|
526
|
-
const { onRedirect:
|
|
304
|
+
this.analyticshttpclient.sendMethodEvent(this.loginWithRedirect.name, this.clientId, O, x);
|
|
305
|
+
const { onRedirect: a } = t || {}, o = Fe.GenerateCodeVerifier();
|
|
527
306
|
this.cookiesManager.save({ code_verifier: o }), this.tokenProvider = this.tokenProvider.WithProofKeyForCodeExchange(o);
|
|
528
|
-
const
|
|
529
|
-
|
|
307
|
+
const u = await this.tokenProvider.GetOAuthRedirect("state");
|
|
308
|
+
a != null ? a(u) : window.location.assign(u);
|
|
530
309
|
}
|
|
531
310
|
/**
|
|
532
311
|
* Authenticated the user using the url callback params
|
|
@@ -541,12 +320,12 @@ class Qt {
|
|
|
541
320
|
* // Will try to log in the user with the url assign by the developer
|
|
542
321
|
*/
|
|
543
322
|
async handleCallback(t = window.location.href) {
|
|
544
|
-
const
|
|
545
|
-
if (
|
|
546
|
-
throw new
|
|
547
|
-
const o =
|
|
548
|
-
return await this.tokenProvider.ValidateQuery(o), await this.generateToken(
|
|
549
|
-
authState:
|
|
323
|
+
const a = this.cookiesManager.get();
|
|
324
|
+
if (a == null || (a == null ? void 0 : a.code_verifier) == null)
|
|
325
|
+
throw new Vt("Code verifier not available");
|
|
326
|
+
const o = jt(t), u = Je(t), E = u.get("identity_provider") ?? "", C = u.get("state") ?? "";
|
|
327
|
+
return await this.tokenProvider.ValidateQuery(o), await this.generateToken(E), {
|
|
328
|
+
authState: C
|
|
550
329
|
};
|
|
551
330
|
}
|
|
552
331
|
/**
|
|
@@ -555,21 +334,21 @@ class Qt {
|
|
|
555
334
|
* @return {Promise<void>} Empty promise
|
|
556
335
|
*/
|
|
557
336
|
async generateToken(t) {
|
|
558
|
-
var
|
|
559
|
-
const
|
|
337
|
+
var f, R;
|
|
338
|
+
const a = await this.tokenProvider.RetrieveToken(), o = await this.tokenProvider.RetrieveRefreshToken(), u = await this.tokenProvider.RetrieveIdToken(), E = await this.tokenProvider.RetrieveTokenExpiry(), T = new Date(E).getTime(), p = (R = (f = this.tokenProvider) == null ? void 0 : f._scopes) == null ? void 0 : R.join(" ");
|
|
560
339
|
await this.cacheManager.setToken({
|
|
561
|
-
scope:
|
|
340
|
+
scope: p,
|
|
562
341
|
state: "",
|
|
563
342
|
session_state: "",
|
|
564
343
|
identity_provider: t,
|
|
565
344
|
token_type: "bearer",
|
|
566
|
-
access_token:
|
|
345
|
+
access_token: a,
|
|
567
346
|
refresh_token: o,
|
|
568
|
-
id_token:
|
|
569
|
-
expires_at:
|
|
347
|
+
id_token: u,
|
|
348
|
+
expires_at: T
|
|
570
349
|
});
|
|
571
|
-
const
|
|
572
|
-
await this.cacheManager.setUser(
|
|
350
|
+
const I = Pt(u), _ = Lt(I);
|
|
351
|
+
await this.cacheManager.setUser(_), await this.reloadCodeVerifier();
|
|
573
352
|
}
|
|
574
353
|
async reloadCodeVerifier() {
|
|
575
354
|
const t = await this.tokenProvider.RetrieveCodeVerifier();
|
|
@@ -580,7 +359,7 @@ class Qt {
|
|
|
580
359
|
* @return {Promise<TIDUser | undefined>} User in cache
|
|
581
360
|
*/
|
|
582
361
|
async getUser() {
|
|
583
|
-
return this.analyticshttpclient.sendMethodEvent(this.getUser.name, this.clientId, O,
|
|
362
|
+
return this.analyticshttpclient.sendMethodEvent(this.getUser.name, this.clientId, O, x), await this.cacheManager.getUser();
|
|
584
363
|
}
|
|
585
364
|
/**
|
|
586
365
|
* Gets the access token from cache. If the token already expired,
|
|
@@ -590,16 +369,16 @@ class Qt {
|
|
|
590
369
|
* @throws {TokenExpiredException} Will throw an exception if the user token expired
|
|
591
370
|
*/
|
|
592
371
|
async getAccessTokenSilently() {
|
|
593
|
-
this.analyticshttpclient.sendMethodEvent(this.getAccessTokenSilently.name, this.clientId, O,
|
|
372
|
+
this.analyticshttpclient.sendMethodEvent(this.getAccessTokenSilently.name, this.clientId, O, x);
|
|
594
373
|
let t = await this.cacheManager.getToken();
|
|
595
374
|
if (t == null)
|
|
596
|
-
throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, "No token available", this.clientId, O,
|
|
597
|
-
const
|
|
598
|
-
if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) <
|
|
375
|
+
throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, "No token available", this.clientId, O, x), new Ve("No token available");
|
|
376
|
+
const a = new Date((/* @__PURE__ */ new Date()).getTime() + We);
|
|
377
|
+
if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < a.getTime()) {
|
|
599
378
|
try {
|
|
600
379
|
await this.tokenProvider.RetrieveToken();
|
|
601
380
|
} catch (o) {
|
|
602
|
-
throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, o.message, this.clientId, O,
|
|
381
|
+
throw this.analyticshttpclient.sendExceptionEvent(this.getAccessTokenSilently.name, o.message, this.clientId, O, x), new $e(o.message);
|
|
603
382
|
}
|
|
604
383
|
await this.generateToken((t == null ? void 0 : t.identity_provider) ?? ""), t = await this.cacheManager.getToken();
|
|
605
384
|
}
|
|
@@ -613,16 +392,16 @@ class Qt {
|
|
|
613
392
|
* @throws {TokenExpiredException} Will throw an exception if the user token expired
|
|
614
393
|
*/
|
|
615
394
|
async getTokens() {
|
|
616
|
-
this.analyticshttpclient.sendMethodEvent(this.getTokens.name, this.clientId, O,
|
|
395
|
+
this.analyticshttpclient.sendMethodEvent(this.getTokens.name, this.clientId, O, x);
|
|
617
396
|
let t = await this.cacheManager.getToken();
|
|
618
397
|
if (t == null)
|
|
619
|
-
throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, "No token available", this.clientId, O,
|
|
620
|
-
const
|
|
621
|
-
if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) <
|
|
398
|
+
throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, "No token available", this.clientId, O, x), new Ve("No token available");
|
|
399
|
+
const a = new Date((/* @__PURE__ */ new Date()).getTime() + We);
|
|
400
|
+
if ((t == null ? void 0 : t.expires_at) == null || (t == null ? void 0 : t.expires_at) < a.getTime()) {
|
|
622
401
|
try {
|
|
623
402
|
await this.tokenProvider.RetrieveToken();
|
|
624
403
|
} catch (o) {
|
|
625
|
-
throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, o.message, this.clientId, O,
|
|
404
|
+
throw this.analyticshttpclient.sendExceptionEvent(this.getTokens.name, o.message, this.clientId, O, x), new $e(o.message);
|
|
626
405
|
}
|
|
627
406
|
await this.generateToken((t == null ? void 0 : t.identity_provider) ?? ""), t = await this.cacheManager.getToken();
|
|
628
407
|
}
|
|
@@ -645,13 +424,13 @@ class Qt {
|
|
|
645
424
|
* // So it can be handled by the developer
|
|
646
425
|
*/
|
|
647
426
|
async logout(t) {
|
|
648
|
-
this.analyticshttpclient.sendMethodEvent(this.logout.name, this.clientId, O,
|
|
649
|
-
const { onRedirect:
|
|
427
|
+
this.analyticshttpclient.sendMethodEvent(this.logout.name, this.clientId, O, x);
|
|
428
|
+
const { onRedirect: a, disabledAutoRedirect: o } = t || {};
|
|
650
429
|
this.cacheManager && await this.cacheManager.clear(), this.cookiesManager && this.cookiesManager.clear();
|
|
651
|
-
const
|
|
652
|
-
if (
|
|
653
|
-
return
|
|
654
|
-
o || window.location.assign(
|
|
430
|
+
const u = await this.tokenProvider.GetOAuthLogoutRedirect("state");
|
|
431
|
+
if (a != null)
|
|
432
|
+
return a(u);
|
|
433
|
+
o || window.location.assign(u);
|
|
655
434
|
}
|
|
656
435
|
/**
|
|
657
436
|
* Check if the user still has a valid session
|
|
@@ -680,15 +459,15 @@ class Qt {
|
|
|
680
459
|
const t = await this.cacheManager.getToken();
|
|
681
460
|
if (t == null)
|
|
682
461
|
return;
|
|
683
|
-
const
|
|
684
|
-
this.tokenProvider = this.tokenProvider.WithAccessToken(
|
|
462
|
+
const a = t.access_token, o = t.refresh_token || "", u = t.id_token, E = t.expires_at;
|
|
463
|
+
this.tokenProvider = this.tokenProvider.WithAccessToken(a, E).WithRefreshToken(o).WithIdToken(u);
|
|
685
464
|
}
|
|
686
465
|
/**
|
|
687
466
|
* Get a http bearer token client to use it for another SDK (Ex: Processing framework)
|
|
688
467
|
* @return {any} - BearerTokenHttpClientProvider
|
|
689
468
|
*/
|
|
690
469
|
getBearerTokenHttpClient(t) {
|
|
691
|
-
return new
|
|
470
|
+
return new St(this.tokenProvider, t);
|
|
692
471
|
}
|
|
693
472
|
/**
|
|
694
473
|
* Get the redirect url to TID
|
|
@@ -698,8 +477,8 @@ class Qt {
|
|
|
698
477
|
return this.redirectUrl;
|
|
699
478
|
}
|
|
700
479
|
}
|
|
701
|
-
const
|
|
702
|
-
var
|
|
480
|
+
const ue = Ot(null), He = () => Be(ue) ?? {};
|
|
481
|
+
var fe = { exports: {} }, V = {};
|
|
703
482
|
/**
|
|
704
483
|
* @license React
|
|
705
484
|
* react-jsx-runtime.production.min.js
|
|
@@ -709,25 +488,25 @@ var de = { exports: {} }, $ = {};
|
|
|
709
488
|
* This source code is licensed under the MIT license found in the
|
|
710
489
|
* LICENSE file in the root directory of this source tree.
|
|
711
490
|
*/
|
|
712
|
-
var
|
|
713
|
-
function
|
|
714
|
-
if (
|
|
715
|
-
return
|
|
716
|
-
|
|
717
|
-
var
|
|
718
|
-
function
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
for (
|
|
722
|
-
o.call(
|
|
723
|
-
if (
|
|
724
|
-
for (
|
|
725
|
-
|
|
726
|
-
return { $$typeof: t, type:
|
|
491
|
+
var Ke;
|
|
492
|
+
function Gt() {
|
|
493
|
+
if (Ke)
|
|
494
|
+
return V;
|
|
495
|
+
Ke = 1;
|
|
496
|
+
var i = Ge, t = Symbol.for("react.element"), a = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, u = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, E = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
497
|
+
function C(T, p, I) {
|
|
498
|
+
var _, f = {}, R = null, S = null;
|
|
499
|
+
I !== void 0 && (R = "" + I), p.key !== void 0 && (R = "" + p.key), p.ref !== void 0 && (S = p.ref);
|
|
500
|
+
for (_ in p)
|
|
501
|
+
o.call(p, _) && !E.hasOwnProperty(_) && (f[_] = p[_]);
|
|
502
|
+
if (T && T.defaultProps)
|
|
503
|
+
for (_ in p = T.defaultProps, p)
|
|
504
|
+
f[_] === void 0 && (f[_] = p[_]);
|
|
505
|
+
return { $$typeof: t, type: T, key: R, ref: S, props: f, _owner: u.current };
|
|
727
506
|
}
|
|
728
|
-
return
|
|
507
|
+
return V.Fragment = a, V.jsx = C, V.jsxs = C, V;
|
|
729
508
|
}
|
|
730
|
-
var
|
|
509
|
+
var K = {};
|
|
731
510
|
/**
|
|
732
511
|
* @license React
|
|
733
512
|
* react-jsx-runtime.development.js
|
|
@@ -737,91 +516,91 @@ var V = {};
|
|
|
737
516
|
* This source code is licensed under the MIT license found in the
|
|
738
517
|
* LICENSE file in the root directory of this source tree.
|
|
739
518
|
*/
|
|
740
|
-
var
|
|
741
|
-
function
|
|
742
|
-
return
|
|
743
|
-
var
|
|
744
|
-
function
|
|
519
|
+
var Ye;
|
|
520
|
+
function Bt() {
|
|
521
|
+
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
522
|
+
var i = Ge, t = Symbol.for("react.element"), a = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), T = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), L = Symbol.iterator, Q = "@@iterator";
|
|
523
|
+
function Y(e) {
|
|
745
524
|
if (e === null || typeof e != "object")
|
|
746
525
|
return null;
|
|
747
|
-
var r =
|
|
526
|
+
var r = L && e[L] || e[Q];
|
|
748
527
|
return typeof r == "function" ? r : null;
|
|
749
528
|
}
|
|
750
|
-
var A =
|
|
751
|
-
function
|
|
529
|
+
var A = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
530
|
+
function m(e) {
|
|
752
531
|
{
|
|
753
|
-
for (var r = arguments.length,
|
|
754
|
-
|
|
755
|
-
G("error", e,
|
|
532
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
|
|
533
|
+
n[s - 1] = arguments[s];
|
|
534
|
+
G("error", e, n);
|
|
756
535
|
}
|
|
757
536
|
}
|
|
758
|
-
function G(e, r,
|
|
537
|
+
function G(e, r, n) {
|
|
759
538
|
{
|
|
760
539
|
var s = A.ReactDebugCurrentFrame, d = s.getStackAddendum();
|
|
761
|
-
d !== "" && (r += "%s",
|
|
762
|
-
var h =
|
|
763
|
-
return String(
|
|
540
|
+
d !== "" && (r += "%s", n = n.concat([d]));
|
|
541
|
+
var h = n.map(function(l) {
|
|
542
|
+
return String(l);
|
|
764
543
|
});
|
|
765
544
|
h.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, h);
|
|
766
545
|
}
|
|
767
546
|
}
|
|
768
|
-
var
|
|
769
|
-
|
|
770
|
-
function
|
|
771
|
-
return !!(typeof e == "string" || typeof e == "function" || e === o || e ===
|
|
547
|
+
var B = !1, Z = !1, v = !1, w = !1, ee = !1, he;
|
|
548
|
+
he = Symbol.for("react.module.reference");
|
|
549
|
+
function ze(e) {
|
|
550
|
+
return !!(typeof e == "string" || typeof e == "function" || e === o || e === E || ee || e === u || e === I || e === _ || w || e === S || B || Z || v || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === f || e.$$typeof === C || e.$$typeof === T || e.$$typeof === p || // This needs to include all possible module reference object
|
|
772
551
|
// types supported by any Flight configuration anywhere since
|
|
773
552
|
// we don't know which Flight build this will end up being used
|
|
774
553
|
// with.
|
|
775
|
-
e.$$typeof ===
|
|
554
|
+
e.$$typeof === he || e.getModuleId !== void 0));
|
|
776
555
|
}
|
|
777
|
-
function
|
|
556
|
+
function Xe(e, r, n) {
|
|
778
557
|
var s = e.displayName;
|
|
779
558
|
if (s)
|
|
780
559
|
return s;
|
|
781
560
|
var d = r.displayName || r.name || "";
|
|
782
|
-
return d !== "" ?
|
|
561
|
+
return d !== "" ? n + "(" + d + ")" : n;
|
|
783
562
|
}
|
|
784
563
|
function ve(e) {
|
|
785
564
|
return e.displayName || "Context";
|
|
786
565
|
}
|
|
787
|
-
function
|
|
566
|
+
function D(e) {
|
|
788
567
|
if (e == null)
|
|
789
568
|
return null;
|
|
790
|
-
if (typeof e.tag == "number" &&
|
|
569
|
+
if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
791
570
|
return e.displayName || e.name || null;
|
|
792
571
|
if (typeof e == "string")
|
|
793
572
|
return e;
|
|
794
573
|
switch (e) {
|
|
795
574
|
case o:
|
|
796
575
|
return "Fragment";
|
|
797
|
-
case
|
|
576
|
+
case a:
|
|
798
577
|
return "Portal";
|
|
799
|
-
case
|
|
578
|
+
case E:
|
|
800
579
|
return "Profiler";
|
|
801
|
-
case
|
|
580
|
+
case u:
|
|
802
581
|
return "StrictMode";
|
|
803
|
-
case
|
|
582
|
+
case I:
|
|
804
583
|
return "Suspense";
|
|
805
|
-
case
|
|
584
|
+
case _:
|
|
806
585
|
return "SuspenseList";
|
|
807
586
|
}
|
|
808
587
|
if (typeof e == "object")
|
|
809
588
|
switch (e.$$typeof) {
|
|
810
|
-
case
|
|
589
|
+
case T:
|
|
811
590
|
var r = e;
|
|
812
591
|
return ve(r) + ".Consumer";
|
|
813
|
-
case
|
|
814
|
-
var
|
|
815
|
-
return ve(
|
|
816
|
-
case
|
|
817
|
-
return
|
|
818
|
-
case
|
|
592
|
+
case C:
|
|
593
|
+
var n = e;
|
|
594
|
+
return ve(n._context) + ".Provider";
|
|
595
|
+
case p:
|
|
596
|
+
return Xe(e, e.render, "ForwardRef");
|
|
597
|
+
case f:
|
|
819
598
|
var s = e.displayName || null;
|
|
820
|
-
return s !== null ? s :
|
|
821
|
-
case
|
|
822
|
-
var d = e, h = d._payload,
|
|
599
|
+
return s !== null ? s : D(e.type) || "Memo";
|
|
600
|
+
case R: {
|
|
601
|
+
var d = e, h = d._payload, l = d._init;
|
|
823
602
|
try {
|
|
824
|
-
return
|
|
603
|
+
return D(l(h));
|
|
825
604
|
} catch {
|
|
826
605
|
return null;
|
|
827
606
|
}
|
|
@@ -829,18 +608,18 @@ function er() {
|
|
|
829
608
|
}
|
|
830
609
|
return null;
|
|
831
610
|
}
|
|
832
|
-
var
|
|
833
|
-
function
|
|
611
|
+
var U = Object.assign, W = 0, ge, pe, ye, Ee, me, _e, ke;
|
|
612
|
+
function Te() {
|
|
834
613
|
}
|
|
835
|
-
|
|
836
|
-
function
|
|
614
|
+
Te.__reactDisabledLog = !0;
|
|
615
|
+
function Qe() {
|
|
837
616
|
{
|
|
838
|
-
if (
|
|
839
|
-
|
|
617
|
+
if (W === 0) {
|
|
618
|
+
ge = console.log, pe = console.info, ye = console.warn, Ee = console.error, me = console.group, _e = console.groupCollapsed, ke = console.groupEnd;
|
|
840
619
|
var e = {
|
|
841
620
|
configurable: !0,
|
|
842
621
|
enumerable: !0,
|
|
843
|
-
value:
|
|
622
|
+
value: Te,
|
|
844
623
|
writable: !0
|
|
845
624
|
};
|
|
846
625
|
Object.defineProperties(console, {
|
|
@@ -853,208 +632,208 @@ function er() {
|
|
|
853
632
|
groupEnd: e
|
|
854
633
|
});
|
|
855
634
|
}
|
|
856
|
-
|
|
635
|
+
W++;
|
|
857
636
|
}
|
|
858
637
|
}
|
|
859
|
-
function
|
|
638
|
+
function Ze() {
|
|
860
639
|
{
|
|
861
|
-
if (
|
|
640
|
+
if (W--, W === 0) {
|
|
862
641
|
var e = {
|
|
863
642
|
configurable: !0,
|
|
864
643
|
enumerable: !0,
|
|
865
644
|
writable: !0
|
|
866
645
|
};
|
|
867
646
|
Object.defineProperties(console, {
|
|
868
|
-
log:
|
|
869
|
-
value:
|
|
647
|
+
log: U({}, e, {
|
|
648
|
+
value: ge
|
|
870
649
|
}),
|
|
871
|
-
info:
|
|
650
|
+
info: U({}, e, {
|
|
872
651
|
value: pe
|
|
873
652
|
}),
|
|
874
|
-
warn:
|
|
875
|
-
value:
|
|
653
|
+
warn: U({}, e, {
|
|
654
|
+
value: ye
|
|
876
655
|
}),
|
|
877
|
-
error:
|
|
656
|
+
error: U({}, e, {
|
|
878
657
|
value: Ee
|
|
879
658
|
}),
|
|
880
|
-
group:
|
|
881
|
-
value:
|
|
659
|
+
group: U({}, e, {
|
|
660
|
+
value: me
|
|
882
661
|
}),
|
|
883
|
-
groupCollapsed:
|
|
884
|
-
value:
|
|
662
|
+
groupCollapsed: U({}, e, {
|
|
663
|
+
value: _e
|
|
885
664
|
}),
|
|
886
|
-
groupEnd:
|
|
887
|
-
value:
|
|
665
|
+
groupEnd: U({}, e, {
|
|
666
|
+
value: ke
|
|
888
667
|
})
|
|
889
668
|
});
|
|
890
669
|
}
|
|
891
|
-
|
|
670
|
+
W < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
892
671
|
}
|
|
893
672
|
}
|
|
894
|
-
var
|
|
895
|
-
function
|
|
673
|
+
var te = A.ReactCurrentDispatcher, re;
|
|
674
|
+
function q(e, r, n) {
|
|
896
675
|
{
|
|
897
|
-
if (
|
|
676
|
+
if (re === void 0)
|
|
898
677
|
try {
|
|
899
678
|
throw Error();
|
|
900
679
|
} catch (d) {
|
|
901
680
|
var s = d.stack.trim().match(/\n( *(at )?)/);
|
|
902
|
-
|
|
681
|
+
re = s && s[1] || "";
|
|
903
682
|
}
|
|
904
683
|
return `
|
|
905
|
-
` +
|
|
684
|
+
` + re + e;
|
|
906
685
|
}
|
|
907
686
|
}
|
|
908
|
-
var
|
|
687
|
+
var ne = !1, J;
|
|
909
688
|
{
|
|
910
|
-
var
|
|
911
|
-
|
|
689
|
+
var et = typeof WeakMap == "function" ? WeakMap : Map;
|
|
690
|
+
J = new et();
|
|
912
691
|
}
|
|
913
692
|
function Re(e, r) {
|
|
914
|
-
if (!e ||
|
|
693
|
+
if (!e || ne)
|
|
915
694
|
return "";
|
|
916
695
|
{
|
|
917
|
-
var
|
|
918
|
-
if (
|
|
919
|
-
return
|
|
696
|
+
var n = J.get(e);
|
|
697
|
+
if (n !== void 0)
|
|
698
|
+
return n;
|
|
920
699
|
}
|
|
921
700
|
var s;
|
|
922
|
-
|
|
701
|
+
ne = !0;
|
|
923
702
|
var d = Error.prepareStackTrace;
|
|
924
703
|
Error.prepareStackTrace = void 0;
|
|
925
704
|
var h;
|
|
926
|
-
h =
|
|
705
|
+
h = te.current, te.current = null, Qe();
|
|
927
706
|
try {
|
|
928
707
|
if (r) {
|
|
929
|
-
var
|
|
708
|
+
var l = function() {
|
|
930
709
|
throw Error();
|
|
931
710
|
};
|
|
932
|
-
if (Object.defineProperty(
|
|
711
|
+
if (Object.defineProperty(l.prototype, "props", {
|
|
933
712
|
set: function() {
|
|
934
713
|
throw Error();
|
|
935
714
|
}
|
|
936
715
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
937
716
|
try {
|
|
938
|
-
Reflect.construct(
|
|
939
|
-
} catch (
|
|
940
|
-
s =
|
|
717
|
+
Reflect.construct(l, []);
|
|
718
|
+
} catch (M) {
|
|
719
|
+
s = M;
|
|
941
720
|
}
|
|
942
|
-
Reflect.construct(e, [],
|
|
721
|
+
Reflect.construct(e, [], l);
|
|
943
722
|
} else {
|
|
944
723
|
try {
|
|
945
|
-
|
|
946
|
-
} catch (
|
|
947
|
-
s =
|
|
724
|
+
l.call();
|
|
725
|
+
} catch (M) {
|
|
726
|
+
s = M;
|
|
948
727
|
}
|
|
949
|
-
e.call(
|
|
728
|
+
e.call(l.prototype);
|
|
950
729
|
}
|
|
951
730
|
} else {
|
|
952
731
|
try {
|
|
953
732
|
throw Error();
|
|
954
|
-
} catch (
|
|
955
|
-
s =
|
|
733
|
+
} catch (M) {
|
|
734
|
+
s = M;
|
|
956
735
|
}
|
|
957
736
|
e();
|
|
958
737
|
}
|
|
959
|
-
} catch (
|
|
960
|
-
if (
|
|
961
|
-
for (var
|
|
738
|
+
} catch (M) {
|
|
739
|
+
if (M && s && typeof M.stack == "string") {
|
|
740
|
+
for (var c = M.stack.split(`
|
|
962
741
|
`), k = s.stack.split(`
|
|
963
|
-
`),
|
|
964
|
-
|
|
965
|
-
for (;
|
|
966
|
-
if (
|
|
967
|
-
if (
|
|
742
|
+
`), g = c.length - 1, y = k.length - 1; g >= 1 && y >= 0 && c[g] !== k[y]; )
|
|
743
|
+
y--;
|
|
744
|
+
for (; g >= 1 && y >= 0; g--, y--)
|
|
745
|
+
if (c[g] !== k[y]) {
|
|
746
|
+
if (g !== 1 || y !== 1)
|
|
968
747
|
do
|
|
969
|
-
if (
|
|
970
|
-
var
|
|
971
|
-
` +
|
|
972
|
-
return e.displayName &&
|
|
748
|
+
if (g--, y--, y < 0 || c[g] !== k[y]) {
|
|
749
|
+
var b = `
|
|
750
|
+
` + c[g].replace(" at new ", " at ");
|
|
751
|
+
return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && J.set(e, b), b;
|
|
973
752
|
}
|
|
974
|
-
while (
|
|
753
|
+
while (g >= 1 && y >= 0);
|
|
975
754
|
break;
|
|
976
755
|
}
|
|
977
756
|
}
|
|
978
757
|
} finally {
|
|
979
|
-
|
|
758
|
+
ne = !1, te.current = h, Ze(), Error.prepareStackTrace = d;
|
|
980
759
|
}
|
|
981
|
-
var
|
|
982
|
-
return typeof e == "function" &&
|
|
760
|
+
var F = e ? e.displayName || e.name : "", je = F ? q(F) : "";
|
|
761
|
+
return typeof e == "function" && J.set(e, je), je;
|
|
983
762
|
}
|
|
984
|
-
function
|
|
763
|
+
function tt(e, r, n) {
|
|
985
764
|
return Re(e, !1);
|
|
986
765
|
}
|
|
987
|
-
function
|
|
766
|
+
function rt(e) {
|
|
988
767
|
var r = e.prototype;
|
|
989
768
|
return !!(r && r.isReactComponent);
|
|
990
769
|
}
|
|
991
|
-
function
|
|
770
|
+
function H(e, r, n) {
|
|
992
771
|
if (e == null)
|
|
993
772
|
return "";
|
|
994
773
|
if (typeof e == "function")
|
|
995
|
-
return Re(e,
|
|
774
|
+
return Re(e, rt(e));
|
|
996
775
|
if (typeof e == "string")
|
|
997
|
-
return
|
|
776
|
+
return q(e);
|
|
998
777
|
switch (e) {
|
|
999
|
-
case
|
|
1000
|
-
return
|
|
1001
|
-
case
|
|
1002
|
-
return
|
|
778
|
+
case I:
|
|
779
|
+
return q("Suspense");
|
|
780
|
+
case _:
|
|
781
|
+
return q("SuspenseList");
|
|
1003
782
|
}
|
|
1004
783
|
if (typeof e == "object")
|
|
1005
784
|
switch (e.$$typeof) {
|
|
1006
|
-
case
|
|
1007
|
-
return
|
|
1008
|
-
case
|
|
1009
|
-
return
|
|
1010
|
-
case
|
|
785
|
+
case p:
|
|
786
|
+
return tt(e.render);
|
|
787
|
+
case f:
|
|
788
|
+
return H(e.type, r, n);
|
|
789
|
+
case R: {
|
|
1011
790
|
var s = e, d = s._payload, h = s._init;
|
|
1012
791
|
try {
|
|
1013
|
-
return
|
|
792
|
+
return H(h(d), r, n);
|
|
1014
793
|
} catch {
|
|
1015
794
|
}
|
|
1016
795
|
}
|
|
1017
796
|
}
|
|
1018
797
|
return "";
|
|
1019
798
|
}
|
|
1020
|
-
var
|
|
1021
|
-
function
|
|
799
|
+
var z = Object.prototype.hasOwnProperty, we = {}, be = A.ReactDebugCurrentFrame;
|
|
800
|
+
function X(e) {
|
|
1022
801
|
if (e) {
|
|
1023
|
-
var r = e._owner,
|
|
1024
|
-
be.setExtraStackFrame(
|
|
802
|
+
var r = e._owner, n = H(e.type, e._source, r ? r.type : null);
|
|
803
|
+
be.setExtraStackFrame(n);
|
|
1025
804
|
} else
|
|
1026
805
|
be.setExtraStackFrame(null);
|
|
1027
806
|
}
|
|
1028
|
-
function
|
|
807
|
+
function nt(e, r, n, s, d) {
|
|
1029
808
|
{
|
|
1030
|
-
var h = Function.call.bind(
|
|
1031
|
-
for (var
|
|
1032
|
-
if (h(e,
|
|
1033
|
-
var
|
|
809
|
+
var h = Function.call.bind(z);
|
|
810
|
+
for (var l in e)
|
|
811
|
+
if (h(e, l)) {
|
|
812
|
+
var c = void 0;
|
|
1034
813
|
try {
|
|
1035
|
-
if (typeof e[
|
|
1036
|
-
var k = Error((s || "React class") + ": " +
|
|
814
|
+
if (typeof e[l] != "function") {
|
|
815
|
+
var k = Error((s || "React class") + ": " + n + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1037
816
|
throw k.name = "Invariant Violation", k;
|
|
1038
817
|
}
|
|
1039
|
-
|
|
1040
|
-
} catch (
|
|
1041
|
-
|
|
818
|
+
c = e[l](r, l, s, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
819
|
+
} catch (g) {
|
|
820
|
+
c = g;
|
|
1042
821
|
}
|
|
1043
|
-
|
|
822
|
+
c && !(c instanceof Error) && (X(d), m("%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", n, l, typeof c), X(null)), c instanceof Error && !(c.message in we) && (we[c.message] = !0, X(d), m("Failed %s type: %s", n, c.message), X(null));
|
|
1044
823
|
}
|
|
1045
824
|
}
|
|
1046
825
|
}
|
|
1047
|
-
var
|
|
826
|
+
var at = Array.isArray;
|
|
1048
827
|
function ae(e) {
|
|
1049
|
-
return
|
|
828
|
+
return at(e);
|
|
1050
829
|
}
|
|
1051
|
-
function
|
|
830
|
+
function it(e) {
|
|
1052
831
|
{
|
|
1053
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag,
|
|
1054
|
-
return
|
|
832
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
833
|
+
return n;
|
|
1055
834
|
}
|
|
1056
835
|
}
|
|
1057
|
-
function
|
|
836
|
+
function ot(e) {
|
|
1058
837
|
try {
|
|
1059
838
|
return Ce(e), !1;
|
|
1060
839
|
} catch {
|
|
@@ -1064,125 +843,125 @@ function er() {
|
|
|
1064
843
|
function Ce(e) {
|
|
1065
844
|
return "" + e;
|
|
1066
845
|
}
|
|
1067
|
-
function
|
|
1068
|
-
if (
|
|
1069
|
-
return
|
|
846
|
+
function Se(e) {
|
|
847
|
+
if (ot(e))
|
|
848
|
+
return m("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);
|
|
1070
849
|
}
|
|
1071
|
-
var N = A.ReactCurrentOwner,
|
|
850
|
+
var N = A.ReactCurrentOwner, st = {
|
|
1072
851
|
key: !0,
|
|
1073
852
|
ref: !0,
|
|
1074
853
|
__self: !0,
|
|
1075
854
|
__source: !0
|
|
1076
|
-
},
|
|
1077
|
-
|
|
1078
|
-
function
|
|
1079
|
-
if (
|
|
855
|
+
}, Pe, Oe, ie;
|
|
856
|
+
ie = {};
|
|
857
|
+
function ct(e) {
|
|
858
|
+
if (z.call(e, "ref")) {
|
|
1080
859
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
1081
860
|
if (r && r.isReactWarning)
|
|
1082
861
|
return !1;
|
|
1083
862
|
}
|
|
1084
863
|
return e.ref !== void 0;
|
|
1085
864
|
}
|
|
1086
|
-
function
|
|
1087
|
-
if (
|
|
865
|
+
function lt(e) {
|
|
866
|
+
if (z.call(e, "key")) {
|
|
1088
867
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
1089
868
|
if (r && r.isReactWarning)
|
|
1090
869
|
return !1;
|
|
1091
870
|
}
|
|
1092
871
|
return e.key !== void 0;
|
|
1093
872
|
}
|
|
1094
|
-
function
|
|
873
|
+
function ut(e, r) {
|
|
1095
874
|
if (typeof e.ref == "string" && N.current && r && N.current.stateNode !== r) {
|
|
1096
|
-
var
|
|
1097
|
-
|
|
875
|
+
var n = D(N.current.type);
|
|
876
|
+
ie[n] || (m('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', D(N.current.type), e.ref), ie[n] = !0);
|
|
1098
877
|
}
|
|
1099
878
|
}
|
|
1100
|
-
function
|
|
879
|
+
function ft(e, r) {
|
|
1101
880
|
{
|
|
1102
|
-
var
|
|
1103
|
-
|
|
881
|
+
var n = function() {
|
|
882
|
+
Pe || (Pe = !0, m("%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));
|
|
1104
883
|
};
|
|
1105
|
-
|
|
1106
|
-
get:
|
|
884
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
885
|
+
get: n,
|
|
1107
886
|
configurable: !0
|
|
1108
887
|
});
|
|
1109
888
|
}
|
|
1110
889
|
}
|
|
1111
|
-
function
|
|
890
|
+
function dt(e, r) {
|
|
1112
891
|
{
|
|
1113
|
-
var
|
|
1114
|
-
|
|
892
|
+
var n = function() {
|
|
893
|
+
Oe || (Oe = !0, m("%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));
|
|
1115
894
|
};
|
|
1116
|
-
|
|
1117
|
-
get:
|
|
895
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
896
|
+
get: n,
|
|
1118
897
|
configurable: !0
|
|
1119
898
|
});
|
|
1120
899
|
}
|
|
1121
900
|
}
|
|
1122
|
-
var
|
|
1123
|
-
var
|
|
901
|
+
var ht = function(e, r, n, s, d, h, l) {
|
|
902
|
+
var c = {
|
|
1124
903
|
// This tag allows us to uniquely identify this as a React Element
|
|
1125
904
|
$$typeof: t,
|
|
1126
905
|
// Built-in properties that belong on the element
|
|
1127
906
|
type: e,
|
|
1128
907
|
key: r,
|
|
1129
|
-
ref:
|
|
1130
|
-
props:
|
|
908
|
+
ref: n,
|
|
909
|
+
props: l,
|
|
1131
910
|
// Record the component responsible for creating this element.
|
|
1132
911
|
_owner: h
|
|
1133
912
|
};
|
|
1134
|
-
return
|
|
913
|
+
return c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
1135
914
|
configurable: !1,
|
|
1136
915
|
enumerable: !1,
|
|
1137
916
|
writable: !0,
|
|
1138
917
|
value: !1
|
|
1139
|
-
}), Object.defineProperty(
|
|
918
|
+
}), Object.defineProperty(c, "_self", {
|
|
1140
919
|
configurable: !1,
|
|
1141
920
|
enumerable: !1,
|
|
1142
921
|
writable: !1,
|
|
1143
922
|
value: s
|
|
1144
|
-
}), Object.defineProperty(
|
|
923
|
+
}), Object.defineProperty(c, "_source", {
|
|
1145
924
|
configurable: !1,
|
|
1146
925
|
enumerable: !1,
|
|
1147
926
|
writable: !1,
|
|
1148
927
|
value: d
|
|
1149
|
-
}), Object.freeze && (Object.freeze(
|
|
928
|
+
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
1150
929
|
};
|
|
1151
|
-
function
|
|
930
|
+
function vt(e, r, n, s, d) {
|
|
1152
931
|
{
|
|
1153
|
-
var h,
|
|
1154
|
-
|
|
932
|
+
var h, l = {}, c = null, k = null;
|
|
933
|
+
n !== void 0 && (Se(n), c = "" + n), lt(r) && (Se(r.key), c = "" + r.key), ct(r) && (k = r.ref, ut(r, d));
|
|
1155
934
|
for (h in r)
|
|
1156
|
-
|
|
935
|
+
z.call(r, h) && !st.hasOwnProperty(h) && (l[h] = r[h]);
|
|
1157
936
|
if (e && e.defaultProps) {
|
|
1158
|
-
var
|
|
1159
|
-
for (h in
|
|
1160
|
-
|
|
937
|
+
var g = e.defaultProps;
|
|
938
|
+
for (h in g)
|
|
939
|
+
l[h] === void 0 && (l[h] = g[h]);
|
|
1161
940
|
}
|
|
1162
|
-
if (
|
|
1163
|
-
var
|
|
1164
|
-
|
|
941
|
+
if (c || k) {
|
|
942
|
+
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
943
|
+
c && ft(l, y), k && dt(l, y);
|
|
1165
944
|
}
|
|
1166
|
-
return
|
|
945
|
+
return ht(e, c, k, d, s, N.current, l);
|
|
1167
946
|
}
|
|
1168
947
|
}
|
|
1169
|
-
var
|
|
948
|
+
var oe = A.ReactCurrentOwner, xe = A.ReactDebugCurrentFrame;
|
|
1170
949
|
function j(e) {
|
|
1171
950
|
if (e) {
|
|
1172
|
-
var r = e._owner,
|
|
1173
|
-
xe.setExtraStackFrame(
|
|
951
|
+
var r = e._owner, n = H(e.type, e._source, r ? r.type : null);
|
|
952
|
+
xe.setExtraStackFrame(n);
|
|
1174
953
|
} else
|
|
1175
954
|
xe.setExtraStackFrame(null);
|
|
1176
955
|
}
|
|
1177
|
-
var
|
|
1178
|
-
|
|
1179
|
-
function
|
|
956
|
+
var se;
|
|
957
|
+
se = !1;
|
|
958
|
+
function ce(e) {
|
|
1180
959
|
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
1181
960
|
}
|
|
1182
|
-
function
|
|
961
|
+
function Ie() {
|
|
1183
962
|
{
|
|
1184
|
-
if (
|
|
1185
|
-
var e =
|
|
963
|
+
if (oe.current) {
|
|
964
|
+
var e = D(oe.current.type);
|
|
1186
965
|
if (e)
|
|
1187
966
|
return `
|
|
1188
967
|
|
|
@@ -1191,146 +970,146 @@ Check the render method of \`` + e + "`.";
|
|
|
1191
970
|
return "";
|
|
1192
971
|
}
|
|
1193
972
|
}
|
|
1194
|
-
function
|
|
973
|
+
function gt(e) {
|
|
1195
974
|
{
|
|
1196
975
|
if (e !== void 0) {
|
|
1197
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""),
|
|
976
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
|
|
1198
977
|
return `
|
|
1199
978
|
|
|
1200
|
-
Check your code at ` + r + ":" +
|
|
979
|
+
Check your code at ` + r + ":" + n + ".";
|
|
1201
980
|
}
|
|
1202
981
|
return "";
|
|
1203
982
|
}
|
|
1204
983
|
}
|
|
1205
|
-
var
|
|
1206
|
-
function
|
|
984
|
+
var Ae = {};
|
|
985
|
+
function pt(e) {
|
|
1207
986
|
{
|
|
1208
|
-
var r =
|
|
987
|
+
var r = Ie();
|
|
1209
988
|
if (!r) {
|
|
1210
|
-
var
|
|
1211
|
-
|
|
989
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
990
|
+
n && (r = `
|
|
1212
991
|
|
|
1213
|
-
Check the top-level render call using <` +
|
|
992
|
+
Check the top-level render call using <` + n + ">.");
|
|
1214
993
|
}
|
|
1215
994
|
return r;
|
|
1216
995
|
}
|
|
1217
996
|
}
|
|
1218
|
-
function
|
|
997
|
+
function De(e, r) {
|
|
1219
998
|
{
|
|
1220
999
|
if (!e._store || e._store.validated || e.key != null)
|
|
1221
1000
|
return;
|
|
1222
1001
|
e._store.validated = !0;
|
|
1223
|
-
var
|
|
1224
|
-
if (
|
|
1002
|
+
var n = pt(r);
|
|
1003
|
+
if (Ae[n])
|
|
1225
1004
|
return;
|
|
1226
|
-
|
|
1005
|
+
Ae[n] = !0;
|
|
1227
1006
|
var s = "";
|
|
1228
|
-
e && e._owner && e._owner !==
|
|
1007
|
+
e && e._owner && e._owner !== oe.current && (s = " It was passed a child from " + D(e._owner.type) + "."), j(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, s), j(null);
|
|
1229
1008
|
}
|
|
1230
1009
|
}
|
|
1231
|
-
function
|
|
1010
|
+
function Me(e, r) {
|
|
1232
1011
|
{
|
|
1233
1012
|
if (typeof e != "object")
|
|
1234
1013
|
return;
|
|
1235
1014
|
if (ae(e))
|
|
1236
|
-
for (var
|
|
1237
|
-
var s = e[
|
|
1238
|
-
|
|
1015
|
+
for (var n = 0; n < e.length; n++) {
|
|
1016
|
+
var s = e[n];
|
|
1017
|
+
ce(s) && De(s, r);
|
|
1239
1018
|
}
|
|
1240
|
-
else if (
|
|
1019
|
+
else if (ce(e))
|
|
1241
1020
|
e._store && (e._store.validated = !0);
|
|
1242
1021
|
else if (e) {
|
|
1243
|
-
var d =
|
|
1022
|
+
var d = Y(e);
|
|
1244
1023
|
if (typeof d == "function" && d !== e.entries)
|
|
1245
|
-
for (var h = d.call(e),
|
|
1246
|
-
|
|
1024
|
+
for (var h = d.call(e), l; !(l = h.next()).done; )
|
|
1025
|
+
ce(l.value) && De(l.value, r);
|
|
1247
1026
|
}
|
|
1248
1027
|
}
|
|
1249
1028
|
}
|
|
1250
|
-
function
|
|
1029
|
+
function yt(e) {
|
|
1251
1030
|
{
|
|
1252
1031
|
var r = e.type;
|
|
1253
1032
|
if (r == null || typeof r == "string")
|
|
1254
1033
|
return;
|
|
1255
|
-
var
|
|
1034
|
+
var n;
|
|
1256
1035
|
if (typeof r == "function")
|
|
1257
|
-
|
|
1258
|
-
else if (typeof r == "object" && (r.$$typeof ===
|
|
1036
|
+
n = r.propTypes;
|
|
1037
|
+
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
|
|
1259
1038
|
// Inner props are checked in the reconciler.
|
|
1260
|
-
r.$$typeof ===
|
|
1261
|
-
|
|
1039
|
+
r.$$typeof === f))
|
|
1040
|
+
n = r.propTypes;
|
|
1262
1041
|
else
|
|
1263
1042
|
return;
|
|
1264
|
-
if (
|
|
1265
|
-
var s =
|
|
1266
|
-
|
|
1267
|
-
} else if (r.PropTypes !== void 0 && !
|
|
1268
|
-
|
|
1269
|
-
var d =
|
|
1270
|
-
|
|
1043
|
+
if (n) {
|
|
1044
|
+
var s = D(r);
|
|
1045
|
+
nt(n, e.props, "prop", s, e);
|
|
1046
|
+
} else if (r.PropTypes !== void 0 && !se) {
|
|
1047
|
+
se = !0;
|
|
1048
|
+
var d = D(r);
|
|
1049
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
|
|
1271
1050
|
}
|
|
1272
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
1051
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1273
1052
|
}
|
|
1274
1053
|
}
|
|
1275
|
-
function
|
|
1054
|
+
function Et(e) {
|
|
1276
1055
|
{
|
|
1277
|
-
for (var r = Object.keys(e.props),
|
|
1278
|
-
var s = r[
|
|
1056
|
+
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
1057
|
+
var s = r[n];
|
|
1279
1058
|
if (s !== "children" && s !== "key") {
|
|
1280
|
-
j(e),
|
|
1059
|
+
j(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), j(null);
|
|
1281
1060
|
break;
|
|
1282
1061
|
}
|
|
1283
1062
|
}
|
|
1284
|
-
e.ref !== null && (j(e),
|
|
1063
|
+
e.ref !== null && (j(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
|
|
1285
1064
|
}
|
|
1286
1065
|
}
|
|
1287
|
-
function
|
|
1066
|
+
function Ue(e, r, n, s, d, h) {
|
|
1288
1067
|
{
|
|
1289
|
-
var
|
|
1290
|
-
if (!
|
|
1291
|
-
var
|
|
1292
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
1293
|
-
var k =
|
|
1294
|
-
k ?
|
|
1295
|
-
var
|
|
1296
|
-
e === null ?
|
|
1068
|
+
var l = ze(e);
|
|
1069
|
+
if (!l) {
|
|
1070
|
+
var c = "";
|
|
1071
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1072
|
+
var k = gt(d);
|
|
1073
|
+
k ? c += k : c += Ie();
|
|
1074
|
+
var g;
|
|
1075
|
+
e === null ? g = "null" : ae(e) ? g = "array" : e !== void 0 && e.$$typeof === t ? (g = "<" + (D(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : g = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", g, c);
|
|
1297
1076
|
}
|
|
1298
|
-
var
|
|
1299
|
-
if (
|
|
1300
|
-
return
|
|
1301
|
-
if (
|
|
1302
|
-
var
|
|
1303
|
-
if (
|
|
1077
|
+
var y = vt(e, r, n, d, h);
|
|
1078
|
+
if (y == null)
|
|
1079
|
+
return y;
|
|
1080
|
+
if (l) {
|
|
1081
|
+
var b = r.children;
|
|
1082
|
+
if (b !== void 0)
|
|
1304
1083
|
if (s)
|
|
1305
|
-
if (ae(
|
|
1306
|
-
for (var
|
|
1307
|
-
|
|
1308
|
-
Object.freeze && Object.freeze(
|
|
1084
|
+
if (ae(b)) {
|
|
1085
|
+
for (var F = 0; F < b.length; F++)
|
|
1086
|
+
Me(b[F], e);
|
|
1087
|
+
Object.freeze && Object.freeze(b);
|
|
1309
1088
|
} else
|
|
1310
|
-
|
|
1089
|
+
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1311
1090
|
else
|
|
1312
|
-
|
|
1091
|
+
Me(b, e);
|
|
1313
1092
|
}
|
|
1314
|
-
return e === o ?
|
|
1093
|
+
return e === o ? Et(y) : yt(y), y;
|
|
1315
1094
|
}
|
|
1316
1095
|
}
|
|
1317
|
-
function
|
|
1318
|
-
return
|
|
1096
|
+
function mt(e, r, n) {
|
|
1097
|
+
return Ue(e, r, n, !0);
|
|
1319
1098
|
}
|
|
1320
|
-
function
|
|
1321
|
-
return
|
|
1099
|
+
function _t(e, r, n) {
|
|
1100
|
+
return Ue(e, r, n, !1);
|
|
1322
1101
|
}
|
|
1323
|
-
var kt =
|
|
1324
|
-
|
|
1325
|
-
}()),
|
|
1102
|
+
var kt = _t, Tt = mt;
|
|
1103
|
+
K.Fragment = o, K.jsx = kt, K.jsxs = Tt;
|
|
1104
|
+
}()), K;
|
|
1326
1105
|
}
|
|
1327
|
-
process.env.NODE_ENV === "production" ?
|
|
1328
|
-
var
|
|
1329
|
-
const
|
|
1106
|
+
process.env.NODE_ENV === "production" ? fe.exports = Gt() : fe.exports = Bt();
|
|
1107
|
+
var de = fe.exports;
|
|
1108
|
+
const qt = (i, t) => {
|
|
1330
1109
|
switch (t.type) {
|
|
1331
1110
|
case "INIT":
|
|
1332
1111
|
return {
|
|
1333
|
-
...
|
|
1112
|
+
...i,
|
|
1334
1113
|
isLoading: !1,
|
|
1335
1114
|
isAuthenticated: t.user != null,
|
|
1336
1115
|
user: t.user,
|
|
@@ -1340,7 +1119,7 @@ const tr = (a, t) => {
|
|
|
1340
1119
|
case "HANDLE_CALLBACK_COMPLETE":
|
|
1341
1120
|
case "GET_ACCESS_TOKEN_COMPLETE":
|
|
1342
1121
|
return {
|
|
1343
|
-
...
|
|
1122
|
+
...i,
|
|
1344
1123
|
isLoading: !1,
|
|
1345
1124
|
isAuthenticated: t.user != null,
|
|
1346
1125
|
user: t.user,
|
|
@@ -1348,146 +1127,136 @@ const tr = (a, t) => {
|
|
|
1348
1127
|
};
|
|
1349
1128
|
case "LOGOUT":
|
|
1350
1129
|
return {
|
|
1351
|
-
...
|
|
1130
|
+
...i,
|
|
1352
1131
|
isAuthenticated: !1,
|
|
1353
1132
|
user: void 0
|
|
1354
1133
|
};
|
|
1355
1134
|
case "ERROR":
|
|
1356
1135
|
return {
|
|
1357
|
-
...
|
|
1136
|
+
...i,
|
|
1358
1137
|
isLoading: !1,
|
|
1359
1138
|
error: t.error
|
|
1360
1139
|
};
|
|
1361
1140
|
}
|
|
1362
|
-
},
|
|
1141
|
+
}, Jt = {
|
|
1363
1142
|
isLoading: !0,
|
|
1364
1143
|
isAuthenticated: !1
|
|
1365
|
-
},
|
|
1366
|
-
if (
|
|
1144
|
+
}, Ht = (i) => {
|
|
1145
|
+
if (i == null || Object.keys(i).length <= 0)
|
|
1367
1146
|
return !0;
|
|
1368
|
-
const t = Object.keys(
|
|
1369
|
-
for (const
|
|
1370
|
-
if (a
|
|
1147
|
+
const t = Object.keys(i);
|
|
1148
|
+
for (const a of t)
|
|
1149
|
+
if (i[a] != null && i[a] !== "")
|
|
1371
1150
|
return !1;
|
|
1372
1151
|
return !0;
|
|
1373
|
-
},
|
|
1374
|
-
const t = Je(a.config), n = Je(a.persistentOptions);
|
|
1375
|
-
return !t || !n;
|
|
1376
|
-
}, ir = (a) => {
|
|
1152
|
+
}, zt = (i) => !Ht(i.config), Xt = (i) => {
|
|
1377
1153
|
const {
|
|
1378
1154
|
children: t,
|
|
1379
|
-
configurationEndpoint:
|
|
1155
|
+
configurationEndpoint: a,
|
|
1380
1156
|
clientId: o,
|
|
1381
|
-
redirectUrl:
|
|
1382
|
-
logoutRedirectUrl:
|
|
1383
|
-
scopes:
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
if (ze(fe) != null)
|
|
1157
|
+
redirectUrl: u,
|
|
1158
|
+
logoutRedirectUrl: E,
|
|
1159
|
+
scopes: C,
|
|
1160
|
+
onRedirectCallback: T,
|
|
1161
|
+
checkRedirectUrlMatch: p
|
|
1162
|
+
} = i;
|
|
1163
|
+
if (Be(ue) != null)
|
|
1389
1164
|
throw new Error("TID Provider already defined");
|
|
1390
|
-
const
|
|
1165
|
+
const _ = {
|
|
1391
1166
|
config: {
|
|
1392
|
-
configurationEndpoint:
|
|
1167
|
+
configurationEndpoint: a ?? "",
|
|
1393
1168
|
clientId: o ?? "",
|
|
1394
|
-
redirectUrl:
|
|
1395
|
-
logoutRedirectUrl:
|
|
1396
|
-
scopes:
|
|
1397
|
-
},
|
|
1398
|
-
persistentOptions: {
|
|
1399
|
-
persistentStore: w ?? "in-memory"
|
|
1169
|
+
redirectUrl: u ?? "",
|
|
1170
|
+
logoutRedirectUrl: E ?? "",
|
|
1171
|
+
scopes: C ?? [""]
|
|
1400
1172
|
}
|
|
1401
|
-
}, [f] =
|
|
1402
|
-
() =>
|
|
1403
|
-
[
|
|
1173
|
+
}, [f] = xt(i.tidClient ?? new Yt(_)), [R, S] = It(qt, Jt), L = At(!1), Q = Le(
|
|
1174
|
+
() => p ? f.getRedirectUrl() : void 0,
|
|
1175
|
+
[p, f]
|
|
1404
1176
|
);
|
|
1405
|
-
|
|
1406
|
-
|
|
1177
|
+
qe(() => {
|
|
1178
|
+
L.current || (i.tidClient != null && zt({
|
|
1407
1179
|
config: {
|
|
1408
|
-
configurationEndpoint:
|
|
1180
|
+
configurationEndpoint: a,
|
|
1409
1181
|
clientId: o,
|
|
1410
|
-
redirectUrl:
|
|
1411
|
-
logoutRedirectUrl:
|
|
1412
|
-
scopes:
|
|
1413
|
-
},
|
|
1414
|
-
persistentOptions: {
|
|
1415
|
-
persistentStore: w
|
|
1182
|
+
redirectUrl: u,
|
|
1183
|
+
logoutRedirectUrl: E,
|
|
1184
|
+
scopes: C
|
|
1416
1185
|
}
|
|
1417
1186
|
}) && console.warn(
|
|
1418
1187
|
"When TID client is pass as prop, any client configuration property sent directly to the TID Provider component will be ignored"
|
|
1419
|
-
),
|
|
1188
|
+
), L.current = !0, (async () => {
|
|
1420
1189
|
try {
|
|
1421
|
-
let
|
|
1422
|
-
if (
|
|
1423
|
-
const { authState:
|
|
1424
|
-
|
|
1190
|
+
let v;
|
|
1191
|
+
if (Ft(void 0, Q)) {
|
|
1192
|
+
const { authState: w } = await f.handleCallback();
|
|
1193
|
+
v = await f.getUser(), T != null && T(w);
|
|
1425
1194
|
} else
|
|
1426
|
-
await f.loadUserSession(),
|
|
1427
|
-
|
|
1428
|
-
} catch (
|
|
1429
|
-
let
|
|
1430
|
-
typeof
|
|
1195
|
+
await f.loadUserSession(), v = await f.getUser();
|
|
1196
|
+
S({ type: "INIT", user: v });
|
|
1197
|
+
} catch (v) {
|
|
1198
|
+
let w = v;
|
|
1199
|
+
typeof v == "string" && (w = new Error(v)), S({ type: "ERROR", error: w });
|
|
1431
1200
|
}
|
|
1432
1201
|
})());
|
|
1433
|
-
}, [f,
|
|
1434
|
-
const
|
|
1435
|
-
const
|
|
1436
|
-
return
|
|
1202
|
+
}, [f, T]);
|
|
1203
|
+
const Y = $(async () => {
|
|
1204
|
+
const v = await f.getAccessTokenSilently(), w = await f.getUser();
|
|
1205
|
+
return S({
|
|
1437
1206
|
type: "GET_ACCESS_TOKEN_COMPLETE",
|
|
1438
|
-
user:
|
|
1439
|
-
}),
|
|
1440
|
-
}, [f]),
|
|
1441
|
-
const
|
|
1442
|
-
return
|
|
1207
|
+
user: w
|
|
1208
|
+
}), v;
|
|
1209
|
+
}, [f]), A = $(async () => {
|
|
1210
|
+
const v = await f.getTokens(), w = await f.getUser();
|
|
1211
|
+
return S({
|
|
1443
1212
|
type: "GET_TOKENS_COMPLETE",
|
|
1444
|
-
user:
|
|
1445
|
-
}),
|
|
1446
|
-
}, [f]),
|
|
1447
|
-
async (
|
|
1448
|
-
await f.loginWithRedirect(
|
|
1213
|
+
user: w
|
|
1214
|
+
}), v;
|
|
1215
|
+
}, [f]), m = $(
|
|
1216
|
+
async (v) => {
|
|
1217
|
+
await f.loginWithRedirect(v);
|
|
1449
1218
|
},
|
|
1450
1219
|
[f]
|
|
1451
|
-
),
|
|
1452
|
-
async (
|
|
1453
|
-
await f.logout(
|
|
1220
|
+
), G = $(
|
|
1221
|
+
async (v) => {
|
|
1222
|
+
await f.logout(v), (v == null ? void 0 : v.disabledAutoRedirect) != null && v.disabledAutoRedirect && S({
|
|
1454
1223
|
type: "LOGOUT"
|
|
1455
1224
|
});
|
|
1456
1225
|
},
|
|
1457
1226
|
[f]
|
|
1458
|
-
), B =
|
|
1459
|
-
async (
|
|
1460
|
-
const { authState:
|
|
1461
|
-
return
|
|
1227
|
+
), B = $(
|
|
1228
|
+
async (v) => {
|
|
1229
|
+
const { authState: w } = await f.handleCallback(v), ee = await f.getUser();
|
|
1230
|
+
return S({
|
|
1462
1231
|
type: "HANDLE_CALLBACK_COMPLETE",
|
|
1463
|
-
user:
|
|
1232
|
+
user: ee
|
|
1464
1233
|
}), {
|
|
1465
|
-
authState:
|
|
1234
|
+
authState: w
|
|
1466
1235
|
};
|
|
1467
1236
|
},
|
|
1468
1237
|
[f]
|
|
1469
|
-
),
|
|
1238
|
+
), Z = Le(
|
|
1470
1239
|
() => ({
|
|
1471
|
-
...
|
|
1472
|
-
getAccessTokenSilently:
|
|
1473
|
-
getTokens:
|
|
1474
|
-
loginWithRedirect:
|
|
1240
|
+
...R,
|
|
1241
|
+
getAccessTokenSilently: Y,
|
|
1242
|
+
getTokens: A,
|
|
1243
|
+
loginWithRedirect: m,
|
|
1475
1244
|
handleCallback: B,
|
|
1476
|
-
logout:
|
|
1245
|
+
logout: G
|
|
1477
1246
|
}),
|
|
1478
|
-
[
|
|
1247
|
+
[R, Y, A, m, B, G]
|
|
1479
1248
|
);
|
|
1480
|
-
return /* @__PURE__ */
|
|
1481
|
-
},
|
|
1482
|
-
const { isAuthenticated:
|
|
1483
|
-
return
|
|
1484
|
-
!o && !
|
|
1485
|
-
}, [o,
|
|
1249
|
+
return /* @__PURE__ */ de.jsx(ue.Provider, { value: Z, children: t });
|
|
1250
|
+
}, rr = He, nr = Xt, ar = ({ renderComponent: i, loader: t }) => {
|
|
1251
|
+
const { isAuthenticated: a, isLoading: o, loginWithRedirect: u } = He();
|
|
1252
|
+
return qe(() => {
|
|
1253
|
+
!o && !a && (async () => await u())();
|
|
1254
|
+
}, [o, a, u]), a ? i : t || /* @__PURE__ */ de.jsx(de.Fragment, {});
|
|
1486
1255
|
};
|
|
1487
1256
|
export {
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1257
|
+
ar as AuthenticationGuard,
|
|
1258
|
+
Yt as TIDClient,
|
|
1259
|
+
ue as TIDContext,
|
|
1260
|
+
nr as TIDProvider,
|
|
1261
|
+
rr as useAuth
|
|
1493
1262
|
};
|