@apicurio/common-ui-components 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +144 -141
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as a, jsxs as v, Fragment as Re } from "react/jsx-runtime";
|
|
|
3
3
|
import { useInterval as _t, Tooltip as pt, EmptyState as ne, EmptyStateVariant as ft, EmptyStateHeader as oe, EmptyStateBody as me, Spinner as ee, Alert as mt, Dropdown as wt, MenuToggle as Je, DropdownList as vt, Divider as Ke, DropdownItem as St, Select as yt, SelectOption as bt, TextInput as ae, Button as ce, TextArea as kt, AboutModal as Tt, TextContent as It, Text as De, TextVariants as Le, TextList as je, TextListItem as b, Modal as Ue, Form as Be, FormGroup as He, Progress as Et, EmptyStateIcon as ze, ChipGroup as Ct, Chip as Pt, InputGroup as Rt, ButtonVariant as Ut, Pagination as xt, PaginationVariant as At, Skeleton as Ot } from "@patternfly/react-core";
|
|
4
4
|
import { EllipsisVIcon as Nt, ChevronDownIcon as qt, ChevronRightIcon as Dt, ErrorCircleOIcon as Lt, SearchIcon as jt } from "@patternfly/react-icons";
|
|
5
5
|
import { DateTime as se } from "luxon";
|
|
6
|
-
import { Tr as le, Td as xe, Th as Ht, Table as $t, Thead as
|
|
6
|
+
import { Tr as le, Td as xe, Th as Ht, Table as $t, Thead as Ft, Tbody as Mt, ActionsColumn as Wt } from "@patternfly/react-table";
|
|
7
7
|
import Jt from "use-resize-observer";
|
|
8
8
|
const Kt = gt({
|
|
9
9
|
type: "none"
|
|
@@ -82,7 +82,7 @@ var Gt = {
|
|
|
82
82
|
}
|
|
83
83
|
e.setLogger = i;
|
|
84
84
|
})(de || (de = {}));
|
|
85
|
-
var
|
|
85
|
+
var _ = class D {
|
|
86
86
|
constructor(t) {
|
|
87
87
|
this._name = t;
|
|
88
88
|
}
|
|
@@ -138,7 +138,7 @@ var he = class {
|
|
|
138
138
|
try {
|
|
139
139
|
return Vt(e);
|
|
140
140
|
} catch (t) {
|
|
141
|
-
throw
|
|
141
|
+
throw _.error("JwtUtils.decode", t), t;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
static async generateSignedJwt(e, t, s) {
|
|
@@ -182,7 +182,7 @@ var he = class {
|
|
|
182
182
|
const i = new TextEncoder().encode(t), r = await crypto.subtle.digest("SHA-256", i);
|
|
183
183
|
return we(r).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
184
184
|
} catch (s) {
|
|
185
|
-
throw
|
|
185
|
+
throw _.error("CryptoUtils.generateCodeChallenge", s), s;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
@@ -295,7 +295,7 @@ var he = class {
|
|
|
295
295
|
Ve.encodeBase64Url = (e) => we(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
296
296
|
var C = Ve, W = class {
|
|
297
297
|
constructor(e) {
|
|
298
|
-
this._name = e, this._callbacks = [], this._logger = new
|
|
298
|
+
this._name = e, this._callbacks = [], this._logger = new _(`Event('${this._name}')`);
|
|
299
299
|
}
|
|
300
300
|
addHandler(e) {
|
|
301
301
|
return this._callbacks.push(e), () => this.removeHandler(e);
|
|
@@ -322,9 +322,9 @@ var C = Ve, W = class {
|
|
|
322
322
|
static serialize(e) {
|
|
323
323
|
return Object.entries(e).filter(([, t]) => t != null).map(([t, s]) => `${t}=${typeof s != "boolean" ? s : s ? "yes" : "no"}`).join(",");
|
|
324
324
|
}
|
|
325
|
-
},
|
|
325
|
+
}, M = class ie extends W {
|
|
326
326
|
constructor() {
|
|
327
|
-
super(...arguments), this._logger = new
|
|
327
|
+
super(...arguments), this._logger = new _(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
|
|
328
328
|
const t = this._expiration - ie.getEpochTime();
|
|
329
329
|
this._logger.debug("timer completes in", t), this._expiration <= ie.getEpochTime() && (this.cancel(), super.raise());
|
|
330
330
|
};
|
|
@@ -361,7 +361,7 @@ var C = Ve, W = class {
|
|
|
361
361
|
constructor(e, t) {
|
|
362
362
|
var s, i, r;
|
|
363
363
|
if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error)
|
|
364
|
-
throw
|
|
364
|
+
throw _.error("ErrorResponse", "No error passed"), new Error("No error passed");
|
|
365
365
|
this.error = e.error, this.error_description = (s = e.error_description) != null ? s : null, this.error_uri = (i = e.error_uri) != null ? i : null, this.state = e.userState, this.session_state = (r = e.session_state) != null ? r : null, this.url_state = e.url_state;
|
|
366
366
|
}
|
|
367
367
|
}, Ae = class extends Error {
|
|
@@ -370,7 +370,7 @@ var C = Ve, W = class {
|
|
|
370
370
|
}
|
|
371
371
|
}, Xt = class {
|
|
372
372
|
constructor(e) {
|
|
373
|
-
this._logger = new
|
|
373
|
+
this._logger = new _("AccessTokenEvents"), this._expiringTimer = new M("Access token expiring"), this._expiredTimer = new M("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
|
|
374
374
|
}
|
|
375
375
|
load(e) {
|
|
376
376
|
const t = this._logger.create("load");
|
|
@@ -415,7 +415,7 @@ var C = Ve, W = class {
|
|
|
415
415
|
}
|
|
416
416
|
}, Yt = class {
|
|
417
417
|
constructor(e, t, s, i, r) {
|
|
418
|
-
this._callback = e, this._client_id = t, this._intervalInSeconds = i, this._stopOnError = r, this._logger = new
|
|
418
|
+
this._callback = e, this._client_id = t, this._intervalInSeconds = i, this._stopOnError = r, this._logger = new _("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (o) => {
|
|
419
419
|
o.origin === this._frame_origin && o.source === this._frame.contentWindow && (o.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : o.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(o.data + " message from check session op iframe"));
|
|
420
420
|
};
|
|
421
421
|
const n = new URL(s);
|
|
@@ -442,7 +442,7 @@ var C = Ve, W = class {
|
|
|
442
442
|
}
|
|
443
443
|
}, Ge = class {
|
|
444
444
|
constructor() {
|
|
445
|
-
this._logger = new
|
|
445
|
+
this._logger = new _("InMemoryWebStorage"), this._data = {};
|
|
446
446
|
}
|
|
447
447
|
clear() {
|
|
448
448
|
this._logger.create("clear"), this._data = {};
|
|
@@ -468,7 +468,7 @@ var C = Ve, W = class {
|
|
|
468
468
|
}
|
|
469
469
|
}, Oe = class {
|
|
470
470
|
constructor(e = [], t = null, s = {}) {
|
|
471
|
-
this._jwtHandler = t, this._extraHeaders = s, this._logger = new
|
|
471
|
+
this._jwtHandler = t, this._extraHeaders = s, this._logger = new _("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
|
|
472
472
|
}
|
|
473
473
|
async fetchWithTimeout(e, t = {}) {
|
|
474
474
|
const { timeoutInSeconds: s, ...i } = t;
|
|
@@ -531,25 +531,25 @@ var C = Ve, W = class {
|
|
|
531
531
|
let l;
|
|
532
532
|
try {
|
|
533
533
|
o.debug("url:", e), l = await this.fetchWithTimeout(e, { method: "POST", headers: c, body: t, timeoutInSeconds: i, credentials: r });
|
|
534
|
-
} catch (
|
|
535
|
-
throw o.error("Network error"),
|
|
534
|
+
} catch (p) {
|
|
535
|
+
throw o.error("Network error"), p;
|
|
536
536
|
}
|
|
537
537
|
o.debug("HTTP response received, status", l.status);
|
|
538
538
|
const d = l.headers.get("Content-Type");
|
|
539
|
-
if (d && !this._contentTypes.find((
|
|
539
|
+
if (d && !this._contentTypes.find((p) => d.startsWith(p)))
|
|
540
540
|
throw new Error(`Invalid response Content-Type: ${d ?? "undefined"}, from URL: ${e}`);
|
|
541
541
|
const h = await l.text();
|
|
542
542
|
let g = {};
|
|
543
543
|
if (h)
|
|
544
544
|
try {
|
|
545
545
|
g = JSON.parse(h);
|
|
546
|
-
} catch (
|
|
547
|
-
throw o.error("Error parsing JSON response",
|
|
546
|
+
} catch (p) {
|
|
547
|
+
throw o.error("Error parsing JSON response", p), l.ok ? p : new Error(`${l.statusText} (${l.status})`);
|
|
548
548
|
}
|
|
549
549
|
if (!l.ok) {
|
|
550
550
|
if (o.error("Error from server:", g), l.headers.has("dpop-nonce")) {
|
|
551
|
-
const
|
|
552
|
-
throw new ye(
|
|
551
|
+
const p = l.headers.get("dpop-nonce");
|
|
552
|
+
throw new ye(p, `${JSON.stringify(g)}`);
|
|
553
553
|
}
|
|
554
554
|
throw g.error ? new B(g, t) : new Error(`${l.statusText} (${l.status}): ${JSON.stringify(g)}`);
|
|
555
555
|
}
|
|
@@ -572,7 +572,7 @@ var C = Ve, W = class {
|
|
|
572
572
|
}
|
|
573
573
|
}, Zt = class {
|
|
574
574
|
constructor(e) {
|
|
575
|
-
this._settings = e, this._logger = new
|
|
575
|
+
this._settings = e, this._logger = new _("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new Oe(
|
|
576
576
|
["application/jwk-set+json"],
|
|
577
577
|
null,
|
|
578
578
|
this._settings.extraHeaders
|
|
@@ -642,7 +642,7 @@ var C = Ve, W = class {
|
|
|
642
642
|
prefix: e = "oidc.",
|
|
643
643
|
store: t = localStorage
|
|
644
644
|
} = {}) {
|
|
645
|
-
this._logger = new
|
|
645
|
+
this._logger = new _("WebStorageStateStore"), this._store = t, this._prefix = e;
|
|
646
646
|
}
|
|
647
647
|
async set(e, t) {
|
|
648
648
|
this._logger.create(`set('${e}')`), e = this._prefix + e, await this._store.setItem(e, t);
|
|
@@ -681,7 +681,7 @@ var C = Ve, W = class {
|
|
|
681
681
|
post_logout_redirect_uri: h,
|
|
682
682
|
client_authentication: g = ss,
|
|
683
683
|
// optional protocol
|
|
684
|
-
prompt:
|
|
684
|
+
prompt: p,
|
|
685
685
|
display: S,
|
|
686
686
|
max_age: x,
|
|
687
687
|
ui_locales: k,
|
|
@@ -690,7 +690,7 @@ var C = Ve, W = class {
|
|
|
690
690
|
response_mode: N,
|
|
691
691
|
// behavior flags
|
|
692
692
|
filterProtocolClaims: P = !0,
|
|
693
|
-
loadUserInfo:
|
|
693
|
+
loadUserInfo: F = !1,
|
|
694
694
|
requestTimeoutInSeconds: R,
|
|
695
695
|
staleStateAgeInSeconds: m = is,
|
|
696
696
|
mergeClaimsStrategy: E = { array: "replace" },
|
|
@@ -708,7 +708,7 @@ var C = Ve, W = class {
|
|
|
708
708
|
omitScopeWhenRequesting: _e = !1
|
|
709
709
|
}) {
|
|
710
710
|
var X;
|
|
711
|
-
if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = o, this.response_type = c, this.scope = l, this.redirect_uri = d, this.post_logout_redirect_uri = h, this.client_authentication = g, this.prompt =
|
|
711
|
+
if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = o, this.response_type = c, this.scope = l, this.redirect_uri = d, this.post_logout_redirect_uri = h, this.client_authentication = g, this.prompt = p, this.display = S, this.max_age = x, this.ui_locales = k, this.acr_values = A, this.resource = I, this.response_mode = N, this.filterProtocolClaims = P ?? !0, this.loadUserInfo = !!F, this.staleStateAgeInSeconds = m, this.mergeClaimsStrategy = E, this.omitScopeWhenRequesting = _e, this.disablePKCE = !!U, this.revokeTokenAdditionalContentTypes = z, this.fetchRequestCredentials = f || "same-origin", this.requestTimeoutInSeconds = R, y)
|
|
712
712
|
this.stateStore = y;
|
|
713
713
|
else {
|
|
714
714
|
const te = typeof window < "u" ? window.localStorage : new Ge();
|
|
@@ -719,7 +719,7 @@ var C = Ve, W = class {
|
|
|
719
719
|
}
|
|
720
720
|
}, rs = class {
|
|
721
721
|
constructor(e, t) {
|
|
722
|
-
this._settings = e, this._metadataService = t, this._logger = new
|
|
722
|
+
this._settings = e, this._metadataService = t, this._logger = new _("UserInfoService"), this._getClaimsFromJwt = async (s) => {
|
|
723
723
|
const i = this._logger.create("_getClaimsFromJwt");
|
|
724
724
|
try {
|
|
725
725
|
const r = he.decode(s);
|
|
@@ -747,7 +747,7 @@ var C = Ve, W = class {
|
|
|
747
747
|
}
|
|
748
748
|
}, Xe = class {
|
|
749
749
|
constructor(e, t) {
|
|
750
|
-
this._settings = e, this._metadataService = t, this._logger = new
|
|
750
|
+
this._settings = e, this._metadataService = t, this._logger = new _("TokenClient"), this._jsonService = new Oe(
|
|
751
751
|
this._settings.revokeTokenAdditionalContentTypes,
|
|
752
752
|
null,
|
|
753
753
|
this._settings.extraHeaders
|
|
@@ -769,8 +769,8 @@ var C = Ve, W = class {
|
|
|
769
769
|
const o = this._logger.create("exchangeCode");
|
|
770
770
|
s || o.throw(new Error("A client_id is required")), t || o.throw(new Error("A redirect_uri is required")), n.code || o.throw(new Error("A code is required"));
|
|
771
771
|
const c = new URLSearchParams({ grant_type: e, redirect_uri: t });
|
|
772
|
-
for (const [g,
|
|
773
|
-
|
|
772
|
+
for (const [g, p] of Object.entries(n))
|
|
773
|
+
p != null && c.set(g, p);
|
|
774
774
|
let l;
|
|
775
775
|
switch (this._settings.client_authentication) {
|
|
776
776
|
case "client_secret_basic":
|
|
@@ -843,8 +843,8 @@ var C = Ve, W = class {
|
|
|
843
843
|
const o = this._logger.create("exchangeRefreshToken");
|
|
844
844
|
t || o.throw(new Error("A client_id is required")), n.refresh_token || o.throw(new Error("A refresh_token is required"));
|
|
845
845
|
const c = new URLSearchParams({ grant_type: e });
|
|
846
|
-
for (const [g,
|
|
847
|
-
Array.isArray(
|
|
846
|
+
for (const [g, p] of Object.entries(n))
|
|
847
|
+
Array.isArray(p) ? p.forEach((S) => c.append(g, S)) : p != null && c.set(g, p);
|
|
848
848
|
let l;
|
|
849
849
|
switch (this._settings.client_authentication) {
|
|
850
850
|
case "client_secret_basic":
|
|
@@ -879,7 +879,7 @@ var C = Ve, W = class {
|
|
|
879
879
|
}
|
|
880
880
|
}, ns = class {
|
|
881
881
|
constructor(e, t, s) {
|
|
882
|
-
this._settings = e, this._metadataService = t, this._claimsService = s, this._logger = new
|
|
882
|
+
this._settings = e, this._metadataService = t, this._claimsService = s, this._logger = new _("ResponseValidator"), this._userInfoService = new rs(this._settings, this._metadataService), this._tokenClient = new Xe(this._settings, this._metadataService);
|
|
883
883
|
}
|
|
884
884
|
async validateSigninResponse(e, t, s) {
|
|
885
885
|
const i = this._logger.create("validateSigninResponse");
|
|
@@ -948,10 +948,10 @@ var C = Ve, W = class {
|
|
|
948
948
|
}
|
|
949
949
|
}, ge = class ke {
|
|
950
950
|
constructor(t) {
|
|
951
|
-
this.id = t.id || C.generateUUIDv4(), this.data = t.data, t.created && t.created > 0 ? this.created = t.created : this.created =
|
|
951
|
+
this.id = t.id || C.generateUUIDv4(), this.data = t.data, t.created && t.created > 0 ? this.created = t.created : this.created = M.getEpochTime(), this.request_type = t.request_type, this.url_state = t.url_state;
|
|
952
952
|
}
|
|
953
953
|
toStorageString() {
|
|
954
|
-
return new
|
|
954
|
+
return new _("State").create("toStorageString"), JSON.stringify({
|
|
955
955
|
id: this.id,
|
|
956
956
|
data: this.data,
|
|
957
957
|
created: this.created,
|
|
@@ -960,10 +960,10 @@ var C = Ve, W = class {
|
|
|
960
960
|
});
|
|
961
961
|
}
|
|
962
962
|
static fromStorageString(t) {
|
|
963
|
-
return
|
|
963
|
+
return _.createStatic("State", "fromStorageString"), Promise.resolve(new ke(JSON.parse(t)));
|
|
964
964
|
}
|
|
965
965
|
static async clearStaleState(t, s) {
|
|
966
|
-
const i =
|
|
966
|
+
const i = _.createStatic("State", "clearStaleState"), r = M.getEpochTime() - s, n = await t.getAllKeys();
|
|
967
967
|
i.debug("got keys", n);
|
|
968
968
|
for (let o = 0; o < n.length; o++) {
|
|
969
969
|
const c = n[o], l = await t.get(c);
|
|
@@ -993,7 +993,7 @@ var C = Ve, W = class {
|
|
|
993
993
|
});
|
|
994
994
|
}
|
|
995
995
|
toStorageString() {
|
|
996
|
-
return new
|
|
996
|
+
return new _("SigninState").create("toStorageString"), JSON.stringify({
|
|
997
997
|
id: this.id,
|
|
998
998
|
data: this.data,
|
|
999
999
|
created: this.created,
|
|
@@ -1011,7 +1011,7 @@ var C = Ve, W = class {
|
|
|
1011
1011
|
});
|
|
1012
1012
|
}
|
|
1013
1013
|
static fromStorageString(t) {
|
|
1014
|
-
|
|
1014
|
+
_.createStatic("SigninState", "fromStorageString");
|
|
1015
1015
|
const s = JSON.parse(t);
|
|
1016
1016
|
return Te.create(s);
|
|
1017
1017
|
}
|
|
@@ -1033,7 +1033,7 @@ var C = Ve, W = class {
|
|
|
1033
1033
|
request_type: d,
|
|
1034
1034
|
client_secret: h,
|
|
1035
1035
|
nonce: g,
|
|
1036
|
-
url_state:
|
|
1036
|
+
url_state: p,
|
|
1037
1037
|
resource: S,
|
|
1038
1038
|
skipUserInfo: x,
|
|
1039
1039
|
extraQueryParams: k,
|
|
@@ -1041,7 +1041,7 @@ var C = Ve, W = class {
|
|
|
1041
1041
|
disablePKCE: I,
|
|
1042
1042
|
dpopJkt: N,
|
|
1043
1043
|
omitScopeWhenRequesting: P,
|
|
1044
|
-
...
|
|
1044
|
+
...F
|
|
1045
1045
|
}) {
|
|
1046
1046
|
if (!t)
|
|
1047
1047
|
throw this._logger.error("create: No url passed"), new Error("url");
|
|
@@ -1058,7 +1058,7 @@ var C = Ve, W = class {
|
|
|
1058
1058
|
const R = await Ye.create({
|
|
1059
1059
|
data: c,
|
|
1060
1060
|
request_type: d,
|
|
1061
|
-
url_state:
|
|
1061
|
+
url_state: p,
|
|
1062
1062
|
code_verifier: !I,
|
|
1063
1063
|
client_id: i,
|
|
1064
1064
|
authority: s,
|
|
@@ -1071,8 +1071,8 @@ var C = Ve, W = class {
|
|
|
1071
1071
|
}), m = new URL(t);
|
|
1072
1072
|
m.searchParams.append("client_id", i), m.searchParams.append("redirect_uri", r), m.searchParams.append("response_type", n), P || m.searchParams.append("scope", o), g && m.searchParams.append("nonce", g), N && m.searchParams.append("dpop_jkt", N);
|
|
1073
1073
|
let E = R.id;
|
|
1074
|
-
|
|
1075
|
-
for (const [U, y] of Object.entries({ response_mode: l, ...
|
|
1074
|
+
p && (E = `${E}${Se}${p}`), m.searchParams.append("state", E), R.code_challenge && (m.searchParams.append("code_challenge", R.code_challenge), m.searchParams.append("code_challenge_method", "S256")), S && (Array.isArray(S) ? S : [S]).forEach((y) => m.searchParams.append("resource", y));
|
|
1075
|
+
for (const [U, y] of Object.entries({ response_mode: l, ...F, ...k }))
|
|
1076
1076
|
y != null && m.searchParams.append(U, y.toString());
|
|
1077
1077
|
return new et({
|
|
1078
1078
|
url: m.href,
|
|
@@ -1080,7 +1080,7 @@ var C = Ve, W = class {
|
|
|
1080
1080
|
});
|
|
1081
1081
|
}
|
|
1082
1082
|
};
|
|
1083
|
-
Ze._logger = new
|
|
1083
|
+
Ze._logger = new _("SigninRequest");
|
|
1084
1084
|
var os = Ze, as = "openid", pe = class {
|
|
1085
1085
|
constructor(e) {
|
|
1086
1086
|
if (this.access_token = "", this.token_type = "", this.profile = {}, this.state = e.get("state"), this.session_state = e.get("session_state"), this.state) {
|
|
@@ -1091,10 +1091,10 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
get expires_in() {
|
|
1093
1093
|
if (this.expires_at !== void 0)
|
|
1094
|
-
return this.expires_at -
|
|
1094
|
+
return this.expires_at - M.getEpochTime();
|
|
1095
1095
|
}
|
|
1096
1096
|
set expires_in(e) {
|
|
1097
|
-
typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) +
|
|
1097
|
+
typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + M.getEpochTime());
|
|
1098
1098
|
}
|
|
1099
1099
|
get isOpenId() {
|
|
1100
1100
|
var e;
|
|
@@ -1110,7 +1110,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1110
1110
|
request_type: n,
|
|
1111
1111
|
client_id: o
|
|
1112
1112
|
}) {
|
|
1113
|
-
if (this._logger = new
|
|
1113
|
+
if (this._logger = new _("SignoutRequest"), !e)
|
|
1114
1114
|
throw this._logger.error("ctor: No url passed"), new Error("url");
|
|
1115
1115
|
const c = new URL(e);
|
|
1116
1116
|
s && c.searchParams.append("id_token_hint", s), o && c.searchParams.append("client_id", o), i && (c.searchParams.append("post_logout_redirect_uri", i), t && (this.state = new ge({ data: t, request_type: n }), c.searchParams.append("state", this.state.id)));
|
|
@@ -1134,7 +1134,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1134
1134
|
// https://openid.net/specs/openid-connect-core-1_0.html#CodeIDToken
|
|
1135
1135
|
], hs = ["sub", "iss", "aud", "exp", "iat"], gs = class {
|
|
1136
1136
|
constructor(e) {
|
|
1137
|
-
this._settings = e, this._logger = new
|
|
1137
|
+
this._settings = e, this._logger = new _("ClaimsService");
|
|
1138
1138
|
}
|
|
1139
1139
|
filterProtocolClaims(e) {
|
|
1140
1140
|
const t = { ...e };
|
|
@@ -1168,7 +1168,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1168
1168
|
}
|
|
1169
1169
|
}, us = class {
|
|
1170
1170
|
constructor(e, t) {
|
|
1171
|
-
this._logger = new
|
|
1171
|
+
this._logger = new _("OidcClient"), this.settings = e instanceof be ? e : new be(e), this.metadataService = t ?? new Zt(this.settings), this._claimsService = new gs(this.settings), this._validator = new ns(this.settings, this.metadataService, this._claimsService), this._tokenClient = new Xe(this.settings, this.metadataService);
|
|
1172
1172
|
}
|
|
1173
1173
|
async createSigninRequest({
|
|
1174
1174
|
state: e,
|
|
@@ -1183,7 +1183,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1183
1183
|
response_type: d = this.settings.response_type,
|
|
1184
1184
|
scope: h = this.settings.scope,
|
|
1185
1185
|
redirect_uri: g = this.settings.redirect_uri,
|
|
1186
|
-
prompt:
|
|
1186
|
+
prompt: p = this.settings.prompt,
|
|
1187
1187
|
display: S = this.settings.display,
|
|
1188
1188
|
max_age: x = this.settings.max_age,
|
|
1189
1189
|
ui_locales: k = this.settings.ui_locales,
|
|
@@ -1191,7 +1191,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1191
1191
|
resource: I = this.settings.resource,
|
|
1192
1192
|
response_mode: N = this.settings.response_mode,
|
|
1193
1193
|
extraQueryParams: P = this.settings.extraQueryParams,
|
|
1194
|
-
extraTokenParams:
|
|
1194
|
+
extraTokenParams: F = this.settings.extraTokenParams,
|
|
1195
1195
|
dpopJkt: R,
|
|
1196
1196
|
omitScopeWhenRequesting: m = this.settings.omitScopeWhenRequesting
|
|
1197
1197
|
}) {
|
|
@@ -1209,7 +1209,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1209
1209
|
scope: h,
|
|
1210
1210
|
state_data: e,
|
|
1211
1211
|
url_state: l,
|
|
1212
|
-
prompt:
|
|
1212
|
+
prompt: p,
|
|
1213
1213
|
display: S,
|
|
1214
1214
|
max_age: x,
|
|
1215
1215
|
ui_locales: k,
|
|
@@ -1221,7 +1221,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1221
1221
|
request: t,
|
|
1222
1222
|
request_uri: s,
|
|
1223
1223
|
extraQueryParams: P,
|
|
1224
|
-
extraTokenParams:
|
|
1224
|
+
extraTokenParams: F,
|
|
1225
1225
|
request_type: i,
|
|
1226
1226
|
response_mode: N,
|
|
1227
1227
|
client_secret: this.settings.client_secret,
|
|
@@ -1386,7 +1386,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
}, _s = class {
|
|
1388
1388
|
constructor(e) {
|
|
1389
|
-
this._userManager = e, this._logger = new
|
|
1389
|
+
this._userManager = e, this._logger = new _("SessionMonitor"), this._start = async (t) => {
|
|
1390
1390
|
const s = t.session_state;
|
|
1391
1391
|
if (!s)
|
|
1392
1392
|
return;
|
|
@@ -1466,10 +1466,10 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1466
1466
|
/** Computed number of seconds the access token has remaining. */
|
|
1467
1467
|
get expires_in() {
|
|
1468
1468
|
if (this.expires_at !== void 0)
|
|
1469
|
-
return this.expires_at -
|
|
1469
|
+
return this.expires_at - M.getEpochTime();
|
|
1470
1470
|
}
|
|
1471
1471
|
set expires_in(t) {
|
|
1472
|
-
t !== void 0 && (this.expires_at = Math.floor(t) +
|
|
1472
|
+
t !== void 0 && (this.expires_at = Math.floor(t) + M.getEpochTime());
|
|
1473
1473
|
}
|
|
1474
1474
|
/** Computed value indicating if the access token is expired. */
|
|
1475
1475
|
get expired() {
|
|
@@ -1483,7 +1483,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1483
1483
|
return (s = (t = this.scope) == null ? void 0 : t.split(" ")) != null ? s : [];
|
|
1484
1484
|
}
|
|
1485
1485
|
toStorageString() {
|
|
1486
|
-
return new
|
|
1486
|
+
return new _("User").create("toStorageString"), JSON.stringify({
|
|
1487
1487
|
id_token: this.id_token,
|
|
1488
1488
|
session_state: this.session_state,
|
|
1489
1489
|
access_token: this.access_token,
|
|
@@ -1495,9 +1495,9 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1495
1495
|
});
|
|
1496
1496
|
}
|
|
1497
1497
|
static fromStorageString(t) {
|
|
1498
|
-
return
|
|
1498
|
+
return _.createStatic("User", "fromStorageString"), new st(JSON.parse(t));
|
|
1499
1499
|
}
|
|
1500
|
-
},
|
|
1500
|
+
}, Fe = "oidc-client", it = class {
|
|
1501
1501
|
constructor() {
|
|
1502
1502
|
this._abort = new W("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
|
|
1503
1503
|
}
|
|
@@ -1510,7 +1510,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1510
1510
|
const o = (c) => {
|
|
1511
1511
|
var l;
|
|
1512
1512
|
const d = c.data, h = (l = e.scriptOrigin) != null ? l : window.location.origin;
|
|
1513
|
-
if (!(c.origin !== h || (d == null ? void 0 : d.source) !==
|
|
1513
|
+
if (!(c.origin !== h || (d == null ? void 0 : d.source) !== Fe)) {
|
|
1514
1514
|
try {
|
|
1515
1515
|
const g = ve.readParams(d.url, e.response_mode).get("state");
|
|
1516
1516
|
if (g || t.warn("no state found in response url"), c.source !== this._window && g !== e.state)
|
|
@@ -1535,7 +1535,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
static _notifyParent(e, t, s = !1, i = window.location.origin) {
|
|
1537
1537
|
e.postMessage({
|
|
1538
|
-
source:
|
|
1538
|
+
source: Fe,
|
|
1539
1539
|
url: t,
|
|
1540
1540
|
keepOpen: s
|
|
1541
1541
|
}, i);
|
|
@@ -1559,7 +1559,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1559
1559
|
requestTimeoutInSeconds: d,
|
|
1560
1560
|
silent_redirect_uri: h = e.redirect_uri,
|
|
1561
1561
|
silentRequestTimeoutInSeconds: g,
|
|
1562
|
-
automaticSilentRenew:
|
|
1562
|
+
automaticSilentRenew: p = !0,
|
|
1563
1563
|
validateSubOnSilentRenew: S = !0,
|
|
1564
1564
|
includeIdTokenInSilentRenew: x = !1,
|
|
1565
1565
|
monitorSession: k = !1,
|
|
@@ -1567,24 +1567,24 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1567
1567
|
checkSessionIntervalInSeconds: I = fs,
|
|
1568
1568
|
query_status_response_type: N = "code",
|
|
1569
1569
|
stopCheckSessionOnError: P = !0,
|
|
1570
|
-
revokeTokenTypes:
|
|
1570
|
+
revokeTokenTypes: F = ["access_token", "refresh_token"],
|
|
1571
1571
|
revokeTokensOnSignout: R = !1,
|
|
1572
1572
|
includeIdTokenInSilentSignout: m = !1,
|
|
1573
1573
|
accessTokenExpiringNotificationTimeInSeconds: E = ps,
|
|
1574
1574
|
userStore: U
|
|
1575
1575
|
} = e;
|
|
1576
|
-
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = o, this.iframeNotifyParentOrigin = c, this.iframeScriptOrigin = l, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = g || d || ot, this.automaticSilentRenew =
|
|
1576
|
+
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = o, this.iframeNotifyParentOrigin = c, this.iframeScriptOrigin = l, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = g || d || ot, this.automaticSilentRenew = p, this.validateSubOnSilentRenew = S, this.includeIdTokenInSilentRenew = x, this.monitorSession = k, this.monitorAnonymousSession = A, this.checkSessionIntervalInSeconds = I, this.stopCheckSessionOnError = P, this.query_status_response_type = N, this.revokeTokenTypes = F, this.revokeTokensOnSignout = R, this.includeIdTokenInSilentSignout = m, this.accessTokenExpiringNotificationTimeInSeconds = E, U)
|
|
1577
1577
|
this.userStore = U;
|
|
1578
1578
|
else {
|
|
1579
1579
|
const y = typeof window < "u" ? window.sessionStorage : new Ge();
|
|
1580
1580
|
this.userStore = new Qe({ store: y });
|
|
1581
1581
|
}
|
|
1582
1582
|
}
|
|
1583
|
-
},
|
|
1583
|
+
}, Me = class at extends it {
|
|
1584
1584
|
constructor({
|
|
1585
1585
|
silentRequestTimeoutInSeconds: t = ot
|
|
1586
1586
|
}) {
|
|
1587
|
-
super(), this._logger = new
|
|
1587
|
+
super(), this._logger = new _("IFrameWindow"), this._timeoutInSeconds = t, this._frame = at.createHiddenIframe(), this._window = this._frame.contentWindow;
|
|
1588
1588
|
}
|
|
1589
1589
|
static createHiddenIframe() {
|
|
1590
1590
|
const t = window.document.createElement("iframe");
|
|
@@ -1608,15 +1608,15 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1608
1608
|
}
|
|
1609
1609
|
}, ws = class {
|
|
1610
1610
|
constructor(e) {
|
|
1611
|
-
this._settings = e, this._logger = new
|
|
1611
|
+
this._settings = e, this._logger = new _("IFrameNavigator");
|
|
1612
1612
|
}
|
|
1613
1613
|
async prepare({
|
|
1614
1614
|
silentRequestTimeoutInSeconds: e = this._settings.silentRequestTimeoutInSeconds
|
|
1615
1615
|
}) {
|
|
1616
|
-
return new
|
|
1616
|
+
return new Me({ silentRequestTimeoutInSeconds: e });
|
|
1617
1617
|
}
|
|
1618
1618
|
async callback(e) {
|
|
1619
|
-
this._logger.create("callback"),
|
|
1619
|
+
this._logger.create("callback"), Me.notifyParent(e, this._settings.iframeNotifyParentOrigin);
|
|
1620
1620
|
}
|
|
1621
1621
|
}, vs = 500, Ss = 1e3, We = class extends it {
|
|
1622
1622
|
constructor({
|
|
@@ -1624,7 +1624,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1624
1624
|
popupWindowFeatures: t = {},
|
|
1625
1625
|
popupSignal: s
|
|
1626
1626
|
}) {
|
|
1627
|
-
super(), this._logger = new
|
|
1627
|
+
super(), this._logger = new _("PopupWindow");
|
|
1628
1628
|
const i = $e.center({ ...rt, ...t });
|
|
1629
1629
|
this._window = window.open(void 0, e, $e.serialize(i)), s && s.addEventListener("abort", () => {
|
|
1630
1630
|
var r;
|
|
@@ -1655,7 +1655,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1655
1655
|
}
|
|
1656
1656
|
}, ys = class {
|
|
1657
1657
|
constructor(e) {
|
|
1658
|
-
this._settings = e, this._logger = new
|
|
1658
|
+
this._settings = e, this._logger = new _("PopupNavigator");
|
|
1659
1659
|
}
|
|
1660
1660
|
async prepare({
|
|
1661
1661
|
popupWindowFeatures: e = this._settings.popupWindowFeatures,
|
|
@@ -1669,7 +1669,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
}, bs = class {
|
|
1671
1671
|
constructor(e) {
|
|
1672
|
-
this._settings = e, this._logger = new
|
|
1672
|
+
this._settings = e, this._logger = new _("RedirectNavigator");
|
|
1673
1673
|
}
|
|
1674
1674
|
async prepare({
|
|
1675
1675
|
redirectMethod: e = this._settings.redirectMethod,
|
|
@@ -1698,7 +1698,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1698
1698
|
}
|
|
1699
1699
|
}, ks = class extends Xt {
|
|
1700
1700
|
constructor(e) {
|
|
1701
|
-
super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new
|
|
1701
|
+
super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new _("UserManagerEvents"), this._userLoaded = new W("User loaded"), this._userUnloaded = new W("User unloaded"), this._silentRenewError = new W("Silent renew error"), this._userSignedIn = new W("User signed in"), this._userSignedOut = new W("User signed out"), this._userSessionChanged = new W("User session changed");
|
|
1702
1702
|
}
|
|
1703
1703
|
async load(e, t = !0) {
|
|
1704
1704
|
super.load(e), t && await this._userLoaded.raise(e);
|
|
@@ -1807,7 +1807,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
}, Ts = class {
|
|
1809
1809
|
constructor(e) {
|
|
1810
|
-
this._userManager = e, this._logger = new
|
|
1810
|
+
this._userManager = e, this._logger = new _("SilentRenewService"), this._isStarted = !1, this._retryTimer = new M("Retry Silent Renew"), this._tokenExpiring = async () => {
|
|
1811
1811
|
const t = this._logger.create("_tokenExpiring");
|
|
1812
1812
|
try {
|
|
1813
1813
|
await this._userManager.signinSilent(), t.debug("silent token renewal successful");
|
|
@@ -1840,7 +1840,7 @@ var os = Ze, as = "openid", pe = class {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
}, Es = class {
|
|
1842
1842
|
constructor(e, t, s, i) {
|
|
1843
|
-
this._logger = new
|
|
1843
|
+
this._logger = new _("UserManager"), this.settings = new ms(e), this._client = new us(e), this._redirectNavigator = t ?? new bs(this.settings), this._popupNavigator = s ?? new ys(this.settings), this._iframeNavigator = i ?? new ws(this.settings), this._events = new ks(this.settings), this._silentRenewService = new Ts(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new _s(this));
|
|
1844
1844
|
}
|
|
1845
1845
|
/**
|
|
1846
1846
|
* Get object used to register for events raised by the `UserManager`.
|
|
@@ -2362,7 +2362,7 @@ function Rs(e, t) {
|
|
|
2362
2362
|
t[i] !== void 0 && (s[i] = t[i]);
|
|
2363
2363
|
}), s;
|
|
2364
2364
|
}
|
|
2365
|
-
let
|
|
2365
|
+
let u, V;
|
|
2366
2366
|
const Us = (e) => (V = Rs(Cs, e), new Es({
|
|
2367
2367
|
authority: V.url,
|
|
2368
2368
|
client_id: V.clientId,
|
|
@@ -2376,34 +2376,37 @@ const Us = (e) => (V = Rs(Cs, e), new Es({
|
|
|
2376
2376
|
})), xs = async () => {
|
|
2377
2377
|
try {
|
|
2378
2378
|
console.debug("[Auth] Logging in using OIDC");
|
|
2379
|
-
const e = new URL(window.location.href), t = await (
|
|
2380
|
-
e.searchParams.get("state") || t ? await (
|
|
2381
|
-
|
|
2379
|
+
const e = new URL(window.location.href), t = await (u == null ? void 0 : u.getUser());
|
|
2380
|
+
e.searchParams.get("state") || t ? await (u == null ? void 0 : u.signinRedirectCallback()) : await (u == null ? void 0 : u.signinRedirect().then(() => {
|
|
2381
|
+
u == null || u.startSilentRenew(), u == null || u.signinRedirectCallback();
|
|
2382
2382
|
}).catch((s) => {
|
|
2383
2383
|
console.log(s);
|
|
2384
2384
|
}));
|
|
2385
2385
|
} catch (e) {
|
|
2386
2386
|
console.error("[Auth] Error logging in using OIDC: ", e);
|
|
2387
2387
|
}
|
|
2388
|
-
}, As = async () =>
|
|
2388
|
+
}, As = async () => u == null ? void 0 : u.removeUser().then(() => u == null ? void 0 : u.signoutRedirect({
|
|
2389
2389
|
post_logout_redirect_uri: V.logoutUrl || window.location.href
|
|
2390
|
-
})), Os = async () => await (
|
|
2391
|
-
const e = await (
|
|
2392
|
-
return Promise.resolve(e == null ? void 0 : e.
|
|
2390
|
+
})), Os = async () => await (u == null ? void 0 : u.getUser()) != null, Ns = async () => {
|
|
2391
|
+
const e = await (u == null ? void 0 : u.getUser());
|
|
2392
|
+
return Promise.resolve(e == null ? void 0 : e.access_token);
|
|
2393
2393
|
}, qs = async () => {
|
|
2394
|
-
const e = await (
|
|
2394
|
+
const e = await (u == null ? void 0 : u.getUser());
|
|
2395
|
+
return Promise.resolve(e == null ? void 0 : e.id_token);
|
|
2396
|
+
}, Ds = async () => {
|
|
2397
|
+
const e = await (u == null ? void 0 : u.getUser());
|
|
2395
2398
|
return Promise.resolve(e == null ? void 0 : e.profile.preferred_username);
|
|
2396
2399
|
};
|
|
2397
2400
|
let G, Z;
|
|
2398
|
-
const
|
|
2401
|
+
const Ls = async (e, t) => {
|
|
2399
2402
|
try {
|
|
2400
2403
|
console.debug("[Auth] Setting Username and Password for BasicAuth"), G = e, Z = t;
|
|
2401
2404
|
} catch (s) {
|
|
2402
2405
|
console.error("[Auth] Error logging in using BasicAuth: ", s);
|
|
2403
2406
|
}
|
|
2404
|
-
},
|
|
2407
|
+
}, js = async () => {
|
|
2405
2408
|
console.debug("[Auth] Logout for BasicAuth"), G = void 0, Z = void 0, window.location.reload();
|
|
2406
|
-
},
|
|
2409
|
+
}, Hs = async () => G !== void 0 && Z !== void 0, $s = async () => Promise.resolve(G), Fs = () => {
|
|
2407
2410
|
if (G !== void 0 && Z != null)
|
|
2408
2411
|
return {
|
|
2409
2412
|
username: G,
|
|
@@ -2411,25 +2414,25 @@ const Ds = async (e, t) => {
|
|
|
2411
2414
|
};
|
|
2412
2415
|
}, ct = () => {
|
|
2413
2416
|
const e = ut(Kt);
|
|
2414
|
-
return e.type === "oidc" ? (
|
|
2417
|
+
return e.type === "oidc" ? (u === void 0 && (console.debug("[Auth] Creating OIDC UserManager with options: ", e.options), u = Us(e.options)), {
|
|
2415
2418
|
isOidcAuthEnabled: () => !0,
|
|
2416
2419
|
isBasicAuthEnabled: () => !1,
|
|
2417
2420
|
isAuthenticated: Os,
|
|
2418
|
-
getToken: Ns,
|
|
2421
|
+
getToken: e.options.tokenType === "id" ? qs : Ns,
|
|
2419
2422
|
getUsernameAndPassword: () => {
|
|
2420
2423
|
},
|
|
2421
|
-
getUsername:
|
|
2424
|
+
getUsername: Ds,
|
|
2422
2425
|
login: xs,
|
|
2423
2426
|
logout: As
|
|
2424
2427
|
}) : e.type === "basic" ? {
|
|
2425
2428
|
isOidcAuthEnabled: () => !1,
|
|
2426
2429
|
isBasicAuthEnabled: () => !0,
|
|
2427
|
-
isAuthenticated:
|
|
2430
|
+
isAuthenticated: Hs,
|
|
2428
2431
|
getToken: () => Promise.resolve(void 0),
|
|
2429
|
-
getUsernameAndPassword:
|
|
2430
|
-
getUsername:
|
|
2431
|
-
login:
|
|
2432
|
-
logout:
|
|
2432
|
+
getUsernameAndPassword: Fs,
|
|
2433
|
+
getUsername: $s,
|
|
2434
|
+
login: Ls,
|
|
2435
|
+
logout: js
|
|
2433
2436
|
} : {
|
|
2434
2437
|
isOidcAuthEnabled: () => !1,
|
|
2435
2438
|
isBasicAuthEnabled: () => !1,
|
|
@@ -2458,7 +2461,7 @@ const Ds = async (e, t) => {
|
|
|
2458
2461
|
return Ce(() => {
|
|
2459
2462
|
o();
|
|
2460
2463
|
}, [e.date]), n === "fromNow" ? /* @__PURE__ */ a(pt, { content: /* @__PURE__ */ a("span", { children: i }), children: /* @__PURE__ */ a("span", { children: t }) }) : /* @__PURE__ */ a("span", { children: t });
|
|
2461
|
-
},
|
|
2464
|
+
}, Zs = (e) => /* @__PURE__ */ a(Ie, { date: e.date, format: "fromNow" }), O = ({ condition: e, children: t }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ a($.Fragment, { children: t }) : /* @__PURE__ */ a($.Fragment, {}), ei = ({ collection: e, emptyState: t, emptyStateTitle: s, emptyStateMessage: i, children: r }) => {
|
|
2462
2465
|
const n = () => !e || e.length === 0, o = t || /* @__PURE__ */ v(ne, { variant: ft.xs, children: [
|
|
2463
2466
|
/* @__PURE__ */ a(oe, { titleText: s || "None found", headingLevel: "h4" }),
|
|
2464
2467
|
/* @__PURE__ */ a(me, { children: i || "No items found." })
|
|
@@ -2467,7 +2470,7 @@ const Ds = async (e, t) => {
|
|
|
2467
2470
|
}, ue = ({ isLoading: e, loadingComponent: t, children: s }) => {
|
|
2468
2471
|
const i = () => typeof e == "boolean" ? e : e(), r = t || /* @__PURE__ */ a(ee, {});
|
|
2469
2472
|
return i() ? /* @__PURE__ */ a($.Fragment, { children: r }) : /* @__PURE__ */ a($.Fragment, { children: s });
|
|
2470
|
-
},
|
|
2473
|
+
}, ti = ({ toolbar: e, alwaysShowToolbar: t, emptyState: s, filteredEmptyState: i, isLoading: r, isError: n, loadingComponent: o, errorComponent: c, isEmpty: l, isFiltered: d, children: h }) => {
|
|
2471
2474
|
const g = t || !l || d || n;
|
|
2472
2475
|
return c || (c = /* @__PURE__ */ a("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ a(mt, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ a("p", { children: "Something went wrong with the action you attempted, but we're not sure what it was. Try reloading the page and hopef for a better result, or contact your admin to report the error." }) }) })), /* @__PURE__ */ v($.Fragment, { children: [
|
|
2473
2476
|
/* @__PURE__ */ a(O, { condition: g, children: e }),
|
|
@@ -2478,7 +2481,7 @@ const Ds = async (e, t) => {
|
|
|
2478
2481
|
/* @__PURE__ */ a(O, { condition: n, children: c })
|
|
2479
2482
|
] })
|
|
2480
2483
|
] });
|
|
2481
|
-
},
|
|
2484
|
+
}, si = (e) => {
|
|
2482
2485
|
const [t, s] = T(!1), i = (l, d) => {
|
|
2483
2486
|
s(!1);
|
|
2484
2487
|
const h = d;
|
|
@@ -2567,21 +2570,21 @@ const Ds = async (e, t) => {
|
|
|
2567
2570
|
))
|
|
2568
2571
|
}
|
|
2569
2572
|
);
|
|
2570
|
-
},
|
|
2573
|
+
}, ii = ({ expanded: e, onClick: t }) => e ? /* @__PURE__ */ a(qt, { onClick: t, style: { cursor: "pointer" } }) : /* @__PURE__ */ a(Dt, { onClick: t, style: { cursor: "pointer" } }), lt = {
|
|
2571
2574
|
padding: "5px",
|
|
2572
2575
|
minHeight: "128px",
|
|
2573
2576
|
borderRight: 0,
|
|
2574
2577
|
borderLeft: 0,
|
|
2575
2578
|
borderBottom: "1px solid #666",
|
|
2576
2579
|
backgroundColor: "rgb(240, 240, 240)"
|
|
2577
|
-
},
|
|
2580
|
+
}, Ws = {
|
|
2578
2581
|
...lt,
|
|
2579
2582
|
color: "red",
|
|
2580
2583
|
overflow: "auto"
|
|
2581
|
-
},
|
|
2584
|
+
}, ri = (e) => {
|
|
2582
2585
|
const [t, s] = T(""), [i, r] = T(""), [n, o] = T(!1), [c, l] = T(), d = (k, A) => {
|
|
2583
2586
|
s(A);
|
|
2584
|
-
}, h = () => t != null && t.trim().length > 0, g = () => c != null && c.trim().length > 0,
|
|
2587
|
+
}, h = () => t != null && t.trim().length > 0, g = () => c != null && c.trim().length > 0, p = () => {
|
|
2585
2588
|
o(!0), e.onUrlFetch(t).then((k) => {
|
|
2586
2589
|
l(void 0), r(k), o(!1), e.onChange(k, t);
|
|
2587
2590
|
}).catch((k) => {
|
|
@@ -2607,11 +2610,11 @@ const Ds = async (e, t) => {
|
|
|
2607
2610
|
"aria-label": "url input"
|
|
2608
2611
|
}
|
|
2609
2612
|
) }),
|
|
2610
|
-
/* @__PURE__ */ a("div", { className: "url-fetch-button", children: /* @__PURE__ */ a(ce, { "data-testid": `${e.testId}-fetch`, variant: "control", isDisabled: !h(), onClick:
|
|
2613
|
+
/* @__PURE__ */ a("div", { className: "url-fetch-button", children: /* @__PURE__ */ a(ce, { "data-testid": `${e.testId}-fetch`, variant: "control", isDisabled: !h(), onClick: p, children: "Fetch" }) }),
|
|
2611
2614
|
/* @__PURE__ */ a("div", { className: "url-clear-button", children: /* @__PURE__ */ a(ce, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !h(), onClick: S, children: "Clear" }) })
|
|
2612
2615
|
] }),
|
|
2613
2616
|
/* @__PURE__ */ a("div", { className: "url-upload-preview", children: /* @__PURE__ */ v(ue, { isLoading: n, loadingComponent: x, children: [
|
|
2614
|
-
/* @__PURE__ */ a(O, { condition: g, children: /* @__PURE__ */ v("div", { className: "url-upload-error", style:
|
|
2617
|
+
/* @__PURE__ */ a(O, { condition: g, children: /* @__PURE__ */ v("div", { className: "url-upload-error", style: Ws, children: [
|
|
2615
2618
|
/* @__PURE__ */ a("div", { children: "Error getting content from URL." }),
|
|
2616
2619
|
/* @__PURE__ */ a("div", { children: c })
|
|
2617
2620
|
] }) }),
|
|
@@ -2627,7 +2630,7 @@ const Ds = async (e, t) => {
|
|
|
2627
2630
|
) })
|
|
2628
2631
|
] }) })
|
|
2629
2632
|
] });
|
|
2630
|
-
},
|
|
2633
|
+
}, ni = (e) => {
|
|
2631
2634
|
const [t, s] = T(), [i, r] = T();
|
|
2632
2635
|
return Ce(() => {
|
|
2633
2636
|
e.isOpen && (typeof e.frontendInfo == "function" ? e.frontendInfo().then(s) : s(e.frontendInfo), typeof e.backendInfo == "function" ? e.backendInfo().then(r) : r(e.backendInfo));
|
|
@@ -2667,7 +2670,7 @@ const Ds = async (e, t) => {
|
|
|
2667
2670
|
] })
|
|
2668
2671
|
}
|
|
2669
2672
|
);
|
|
2670
|
-
},
|
|
2673
|
+
}, Js = (e) => {
|
|
2671
2674
|
const [t, s] = T({
|
|
2672
2675
|
username: "",
|
|
2673
2676
|
password: ""
|
|
@@ -2742,7 +2745,7 @@ const Ds = async (e, t) => {
|
|
|
2742
2745
|
] })
|
|
2743
2746
|
}
|
|
2744
2747
|
);
|
|
2745
|
-
},
|
|
2748
|
+
}, oi = (e) => /* @__PURE__ */ v(
|
|
2746
2749
|
Ue,
|
|
2747
2750
|
{
|
|
2748
2751
|
title: "Please Wait",
|
|
@@ -2758,7 +2761,7 @@ const Ds = async (e, t) => {
|
|
|
2758
2761
|
/* @__PURE__ */ a("span", { className: "message", style: { fontSize: "15px", color: "#333", marginLeft: "10px" }, children: e.message })
|
|
2759
2762
|
]
|
|
2760
2763
|
}
|
|
2761
|
-
),
|
|
2764
|
+
), ai = (e) => /* @__PURE__ */ a(
|
|
2762
2765
|
Ue,
|
|
2763
2766
|
{
|
|
2764
2767
|
title: e.title,
|
|
@@ -2770,7 +2773,7 @@ const Ds = async (e, t) => {
|
|
|
2770
2773
|
"aria-label": "progress-modal",
|
|
2771
2774
|
children: /* @__PURE__ */ a(Et, { title: e.message, value: e.progress })
|
|
2772
2775
|
}
|
|
2773
|
-
),
|
|
2776
|
+
), ci = (e) => {
|
|
2774
2777
|
const [t, s] = T(
|
|
2775
2778
|
0
|
|
2776
2779
|
/* AUTHENTICATING */
|
|
@@ -2800,24 +2803,24 @@ const Ds = async (e, t) => {
|
|
|
2800
2803
|
/* @__PURE__ */ a(oe, { titleText: "Loading", headingLevel: "h4" }),
|
|
2801
2804
|
/* @__PURE__ */ a(me, { children: /* @__PURE__ */ a(ee, { size: "xl", "aria-label": "Loading spinner" }) })
|
|
2802
2805
|
] }) }),
|
|
2803
|
-
/* @__PURE__ */ a(O, { condition: t === 0 && i.isBasicAuthEnabled(), children: /* @__PURE__ */ a(
|
|
2806
|
+
/* @__PURE__ */ a(O, { condition: t === 0 && i.isBasicAuthEnabled(), children: /* @__PURE__ */ a(Js, { onLogin: r }) }),
|
|
2804
2807
|
/* @__PURE__ */ a(O, { condition: t === 2, children: /* @__PURE__ */ v(ne, { children: [
|
|
2805
2808
|
/* @__PURE__ */ a(oe, { titleText: "Empty state", headingLevel: "h4", icon: /* @__PURE__ */ a(ze, { icon: Lt }) }),
|
|
2806
2809
|
/* @__PURE__ */ a(me, { children: "Authentication failed." })
|
|
2807
2810
|
] }) }),
|
|
2808
2811
|
/* @__PURE__ */ a(O, { condition: t === 1, children: e.children })
|
|
2809
2812
|
] });
|
|
2810
|
-
},
|
|
2813
|
+
}, li = (e) => {
|
|
2811
2814
|
const t = ct();
|
|
2812
2815
|
return (() => {
|
|
2813
2816
|
let i = !0;
|
|
2814
2817
|
return e.enabled !== void 0 && (i = i && (t.isOidcAuthEnabled() === e.enabled || t.isBasicAuthEnabled() === e.enabled)), i;
|
|
2815
2818
|
})() ? /* @__PURE__ */ a($.Fragment, { children: e.children }) : /* @__PURE__ */ a($.Fragment, {});
|
|
2816
|
-
},
|
|
2819
|
+
}, di = (e) => /* @__PURE__ */ a(Ct, { categoryName: e.categoryName || "Filters", isClosable: !0, onClick: e.onClearAllCriteria, children: e.criteria.map((t, s) => /* @__PURE__ */ v(Pt, { onClick: () => e.onRemoveCriteria(t), children: [
|
|
2817
2820
|
/* @__PURE__ */ a("b", { children: t.filterBy.label }),
|
|
2818
2821
|
/* @__PURE__ */ a("span", { children: ": " }),
|
|
2819
2822
|
/* @__PURE__ */ a("span", { children: t.filterValue })
|
|
2820
|
-
] }, s)) }),
|
|
2823
|
+
] }, s)) }), hi = (e) => {
|
|
2821
2824
|
const [t, s] = T(e.filterTypes[0]), [i, r] = T(""), n = (o) => {
|
|
2822
2825
|
o && o.preventDefault(), e.onAddCriteria({
|
|
2823
2826
|
filterBy: t,
|
|
@@ -2861,7 +2864,7 @@ const Ds = async (e, t) => {
|
|
|
2861
2864
|
)
|
|
2862
2865
|
] }) });
|
|
2863
2866
|
};
|
|
2864
|
-
function
|
|
2867
|
+
function gi() {
|
|
2865
2868
|
return /* @__PURE__ */ a(ne, { children: /* @__PURE__ */ a(
|
|
2866
2869
|
oe,
|
|
2867
2870
|
{
|
|
@@ -2871,7 +2874,7 @@ function hi() {
|
|
|
2871
2874
|
}
|
|
2872
2875
|
) });
|
|
2873
2876
|
}
|
|
2874
|
-
function
|
|
2877
|
+
function ui({
|
|
2875
2878
|
itemCount: e,
|
|
2876
2879
|
page: t,
|
|
2877
2880
|
perPage: s,
|
|
@@ -2892,7 +2895,7 @@ function gi({
|
|
|
2892
2895
|
}
|
|
2893
2896
|
);
|
|
2894
2897
|
}
|
|
2895
|
-
function
|
|
2898
|
+
function Ks({ columns: e, rows: t, getTd: s = () => xe }) {
|
|
2896
2899
|
const i = new Array(e).fill(0).map((n, o) => {
|
|
2897
2900
|
const c = s(o);
|
|
2898
2901
|
return /* @__PURE__ */ a(c, { children: /* @__PURE__ */ a(
|
|
@@ -2904,7 +2907,7 @@ function Js({ columns: e, rows: t, getTd: s = () => xe }) {
|
|
|
2904
2907
|
}), r = new Array(t).fill(0).map((n, o) => /* @__PURE__ */ a(le, { children: i }, `row_${o}`));
|
|
2905
2908
|
return /* @__PURE__ */ a(Re, { children: r });
|
|
2906
2909
|
}
|
|
2907
|
-
const
|
|
2910
|
+
const _i = ({
|
|
2908
2911
|
ariaLabel: e,
|
|
2909
2912
|
minimumColumnWidth: t = 250,
|
|
2910
2913
|
columns: s,
|
|
@@ -2917,7 +2920,7 @@ const ui = ({
|
|
|
2917
2920
|
isRowSelected: d,
|
|
2918
2921
|
expectedLength: h = 3,
|
|
2919
2922
|
onRowClick: g,
|
|
2920
|
-
setActionCellOuiaId:
|
|
2923
|
+
setActionCellOuiaId: p,
|
|
2921
2924
|
setRowOuiaId: S,
|
|
2922
2925
|
tableOuiaId: x,
|
|
2923
2926
|
children: k,
|
|
@@ -2925,11 +2928,11 @@ const ui = ({
|
|
|
2925
2928
|
}) => {
|
|
2926
2929
|
const [I, N] = T(1e3);
|
|
2927
2930
|
let P;
|
|
2928
|
-
const
|
|
2931
|
+
const F = ({ width: f }) => {
|
|
2929
2932
|
P && cancelAnimationFrame(P), f && (P = requestAnimationFrame(() => {
|
|
2930
2933
|
N(f);
|
|
2931
2934
|
}));
|
|
2932
|
-
}, { ref: R } = Jt({ onResize:
|
|
2935
|
+
}, { ref: R } = Jt({ onResize: F }), m = I >= 576, E = Ne(
|
|
2933
2936
|
(f) => m && f !== 0 && f !== s.length - 1,
|
|
2934
2937
|
[s, m]
|
|
2935
2938
|
), U = qe(() => s.map((f, w) => {
|
|
@@ -2994,10 +2997,10 @@ const ui = ({
|
|
|
2994
2997
|
ouiaId: x,
|
|
2995
2998
|
variant: A,
|
|
2996
2999
|
children: [
|
|
2997
|
-
/* @__PURE__ */ a(
|
|
2998
|
-
/* @__PURE__ */ v(
|
|
3000
|
+
/* @__PURE__ */ a(Ft, { children: /* @__PURE__ */ a(le, { children: U }) }),
|
|
3001
|
+
/* @__PURE__ */ v(Mt, { children: [
|
|
2999
3002
|
i === void 0 && /* @__PURE__ */ a(
|
|
3000
|
-
|
|
3003
|
+
Ks,
|
|
3001
3004
|
{
|
|
3002
3005
|
columns: s.length,
|
|
3003
3006
|
rows: h,
|
|
@@ -3020,7 +3023,7 @@ const ui = ({
|
|
|
3020
3023
|
columnWidth: t,
|
|
3021
3024
|
canHide: !1,
|
|
3022
3025
|
isActionCell: !0,
|
|
3023
|
-
"data-testid":
|
|
3026
|
+
"data-testid": p ? p({ row: f, rowIndex: w }) : `actions-for-row-${w}`,
|
|
3024
3027
|
children: o({ rowIndex: w, row: f, ActionsColumn: Wt })
|
|
3025
3028
|
}
|
|
3026
3029
|
);
|
|
@@ -3108,31 +3111,31 @@ const ht = Pe(
|
|
|
3108
3111
|
);
|
|
3109
3112
|
ht.displayName = "DeletableRow";
|
|
3110
3113
|
export {
|
|
3111
|
-
|
|
3112
|
-
|
|
3114
|
+
ni as AppAboutModal,
|
|
3115
|
+
ci as ApplicationAuth,
|
|
3113
3116
|
Kt as AuthConfigContext,
|
|
3114
|
-
|
|
3115
|
-
|
|
3117
|
+
Js as BasicAuthModal,
|
|
3118
|
+
hi as ChipFilterInput,
|
|
3116
3119
|
Ie as DateTime,
|
|
3117
3120
|
ht as DeletableRow,
|
|
3118
|
-
|
|
3119
|
-
|
|
3121
|
+
di as FilterChips,
|
|
3122
|
+
Zs as FromNow,
|
|
3120
3123
|
O as If,
|
|
3121
|
-
|
|
3122
|
-
|
|
3124
|
+
li as IfAuth,
|
|
3125
|
+
ei as IfNotEmpty,
|
|
3123
3126
|
ue as IfNotLoading,
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
+
ti as ListWithToolbar,
|
|
3128
|
+
gi as Loading,
|
|
3129
|
+
si as ObjectDropdown,
|
|
3127
3130
|
Ms as ObjectSelect,
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3131
|
+
ui as Pagination,
|
|
3132
|
+
oi as PleaseWaitModal,
|
|
3133
|
+
ai as ProgressModal,
|
|
3134
|
+
_i as ResponsiveTable,
|
|
3132
3135
|
Ee as ResponsiveTd,
|
|
3133
3136
|
dt as ResponsiveTh,
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
+
Ks as TableSkeleton,
|
|
3138
|
+
ii as ToggleIcon,
|
|
3139
|
+
ri as UrlUpload,
|
|
3137
3140
|
ct as useAuth
|
|
3138
3141
|
};
|