react-luminus-components 2.0.30 → 2.0.32
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/.vite/manifest.json +40 -40
- package/dist/{FormDisabledProvider-BdVAJaqG.js → FormDisabledProvider-CknAF8EI.js} +1 -1
- package/dist/{FormDisabledProvider-DyO7R2kE.cjs → FormDisabledProvider-DoGy2C4j.cjs} +1 -1
- package/dist/components/common/NotificationCenter/Actions/NotificationActions.d.ts +23 -0
- package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/ActionTemplates/ActionTemplates.d.ts +1 -1
- package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/ActionTemplates/comps/Recipients/NotificationRecipients.d.ts +1 -1
- package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/ActionTemplates/comps/modals/NotificationTargetModal.d.ts +1 -1
- package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/HistoryTable/NotificationHistoryTable.d.ts +3 -3
- package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/modals/NotificationActionAddModal.d.ts +1 -1
- package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/modals/NotificationTemplateAddModal.d.ts +2 -2
- package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/modals/NotificationTemplateEditModal.d.ts +2 -2
- package/dist/components/common/NotificationCenter/NotifStyles/NotifStyles.d.ts +8 -0
- package/dist/components/common/NotificationCenter/Users/NotificationUsers.d.ts +12 -0
- package/dist/components/{NotifCenter → common/NotificationCenter}/Users/components/EmployeeNotifTable/EmployeeNotifHistoryTable.d.ts +2 -2
- package/dist/components/{NotifCenter → common/NotificationCenter}/index.d.ts +1 -1
- package/dist/components/common/index.d.ts +3 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +598 -598
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +31 -31
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +216 -210
- package/dist/{localStorageUtils-D2opn367.js → localStorageUtils-CZ4HDRzi.js} +2 -2
- package/dist/main.cjs.js +8 -8
- package/dist/main.d.ts +1 -3
- package/dist/main.es.js +8616 -8582
- package/dist/{nivo-bar-CdrSgzV1.cjs → nivo-bar-BkpPCncR.cjs} +1 -1
- package/dist/{nivo-bar-BsmDtzXw.js → nivo-bar-wBsr2P1t.js} +65 -65
- package/dist/style.css +1 -1
- package/dist/{useIsFormDirty-Pdd8CdTQ.js → useIsFormDirty-CTuj9_Nd.js} +1 -1
- package/dist/{useIsFormDirty-CzwHpad1.cjs → useIsFormDirty-Cb4GEBID.cjs} +1 -1
- package/dist/{useLocalStorageState-Byzo2ssr.js → useLocalStorageState-DBd2vOH1.js} +1 -1
- package/dist/{useLocalStorageState-CbsbIUSp.cjs → useLocalStorageState-gKbms6va.cjs} +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +16 -16
- package/package.json +1 -1
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +0 -22
- package/dist/components/NotifCenter/NotifStyles/NotifStyles.d.ts +0 -10
- package/dist/components/NotifCenter/NotifStyles/hooks/useNotifStyleFormSchema.d.ts +0 -20
- package/dist/components/NotifCenter/NotifStyles/hooks/useNotifStyleTableColumns.d.ts +0 -7
- package/dist/components/NotifCenter/Users/NotificationUsers.d.ts +0 -10
- /package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/ActionTemplates/comps/index.d.ts +0 -0
- /package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/components/index.d.ts +0 -0
- /package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/hooks/useNotifTemplateUtils.d.ts +0 -0
- /package/dist/components/{NotifCenter → common/NotificationCenter}/Actions/types/NotificationKindFullModel.d.ts +0 -0
- /package/dist/components/{NotifCenter → common/NotificationCenter}/Users/components/index.d.ts +0 -0
package/dist/contexts.es.js
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { ck as
|
|
3
|
-
import { jsxs as I, jsx as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { EventType as
|
|
1
|
+
import { t as re, bR as Ne, c as N, bS as Oe, R as ce, an as He, bT as Ae, a5 as H, ak as Ue, S as ie, bU as We, ar as je, ap as Fe, bd as _e, by as Re, bf as J, aq as Be, bV as ze, aF as we, bW as Ge, bX as Ve, bY as L, bZ as Xe, b_ as U, b$ as l, c0 as pe, c1 as Le, c2 as G, c3 as E, c4 as q, c5 as ae, c6 as Ie, c7 as Ke, c8 as Se, c9 as Je, ca as Qe, cb as Ye, cc as qe, cd as be, ce as z, cf as Me, cg as ye, ch as Ze, ci as fe, cj as et, ao as tt, b8 as nt, a6 as ot } from "./nivo-bar-wBsr2P1t.js";
|
|
2
|
+
import { ck as un, ah as dn } from "./nivo-bar-wBsr2P1t.js";
|
|
3
|
+
import { jsxs as I, jsx as C } from "react/jsx-runtime";
|
|
4
|
+
import { useState as R, useContext as X, useEffect as B, useRef as Q, useMemo as F, useCallback as Y, useSyncExternalStore as st } from "react";
|
|
5
|
+
import { EventType as ge, InteractionStatus as Ce, InteractionRequiredAuthError as rt } from "@azure/msal-browser";
|
|
6
6
|
import { useMsal as it, MsalProvider as at } from "@azure/msal-react";
|
|
7
7
|
import "react-router";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { L as ct, b as lt } from "./FormDisabledProvider-
|
|
12
|
-
import { F as
|
|
13
|
-
import { a as ht, u as ut } from "./useLocalStorageState-
|
|
11
|
+
import { L as ct, b as lt } from "./FormDisabledProvider-CknAF8EI.js";
|
|
12
|
+
import { F as gn } from "./FormDisabledProvider-CknAF8EI.js";
|
|
13
|
+
import { a as ht, u as ut } from "./useLocalStorageState-DBd2vOH1.js";
|
|
14
14
|
function dt(t) {
|
|
15
|
-
const e =
|
|
15
|
+
const e = re(t);
|
|
16
16
|
return e.setHours(23, 59, 59, 999), e;
|
|
17
17
|
}
|
|
18
18
|
function ft() {
|
|
19
19
|
return dt(Date.now());
|
|
20
20
|
}
|
|
21
21
|
function gt(t, e) {
|
|
22
|
-
const n = +
|
|
23
|
-
+
|
|
24
|
-
+
|
|
25
|
-
].sort((
|
|
22
|
+
const n = +re(t), [s, o] = [
|
|
23
|
+
+re(e.start),
|
|
24
|
+
+re(e.end)
|
|
25
|
+
].sort((i, r) => i - r);
|
|
26
26
|
return n >= s && n <= o;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
28
|
+
function _t() {
|
|
29
|
+
return Ne(Date.now());
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const pt = (t) => {
|
|
32
32
|
const e = N.c(10), {
|
|
33
33
|
children: n
|
|
34
|
-
} = t, [s, o] =
|
|
35
|
-
let
|
|
36
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
37
|
-
o(!0),
|
|
38
|
-
}, e[0] =
|
|
39
|
-
const
|
|
34
|
+
} = t, [s, o] = R(!1), [i, r] = R(""), [a, c] = R(void 0);
|
|
35
|
+
let h;
|
|
36
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = (m, S) => {
|
|
37
|
+
o(!0), r(m), c(S);
|
|
38
|
+
}, e[0] = h) : h = e[0];
|
|
39
|
+
const u = h;
|
|
40
40
|
let g;
|
|
41
41
|
e[1] === Symbol.for("react.memo_cache_sentinel") ? (g = () => {
|
|
42
42
|
o(!1);
|
|
43
43
|
}, e[1] = g) : g = e[1];
|
|
44
44
|
const p = g;
|
|
45
|
-
let
|
|
46
|
-
e[2] !== s || e[3] !==
|
|
45
|
+
let _;
|
|
46
|
+
e[2] !== s || e[3] !== i || e[4] !== a ? (_ = {
|
|
47
47
|
show: s,
|
|
48
|
-
text:
|
|
49
|
-
showConfirm:
|
|
48
|
+
text: i,
|
|
49
|
+
showConfirm: u,
|
|
50
50
|
hideConfirm: p,
|
|
51
51
|
textSm: a
|
|
52
|
-
}, e[2] = s, e[3] =
|
|
53
|
-
const
|
|
54
|
-
let
|
|
55
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
52
|
+
}, e[2] = s, e[3] = i, e[4] = a, e[5] = _) : _ = e[5];
|
|
53
|
+
const w = _;
|
|
54
|
+
let f;
|
|
55
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ C(Ft, {}), e[6] = f) : f = e[6];
|
|
56
56
|
let d;
|
|
57
|
-
return e[7] !== n || e[8] !==
|
|
58
|
-
|
|
57
|
+
return e[7] !== n || e[8] !== w ? (d = /* @__PURE__ */ I(Oe.Provider, { value: w, children: [
|
|
58
|
+
f,
|
|
59
59
|
n
|
|
60
|
-
] }), e[7] = n, e[8] =
|
|
60
|
+
] }), e[7] = n, e[8] = w, e[9] = d) : d = e[9], d;
|
|
61
61
|
}, mt = () => {
|
|
62
62
|
const t = N.c(43), {
|
|
63
63
|
texts: e
|
|
64
|
-
} =
|
|
64
|
+
} = X(ce), {
|
|
65
65
|
confirm: n
|
|
66
66
|
} = e, {
|
|
67
67
|
isShown: s,
|
|
68
68
|
text: o,
|
|
69
|
-
onFinish:
|
|
69
|
+
onFinish: i
|
|
70
70
|
} = He(), {
|
|
71
|
-
options:
|
|
72
|
-
} =
|
|
73
|
-
let
|
|
74
|
-
t[0] !==
|
|
75
|
-
|
|
76
|
-
}, t[0] =
|
|
77
|
-
const
|
|
71
|
+
options: r
|
|
72
|
+
} = X(Ae), [a, c] = R(r.defaultValue ?? "");
|
|
73
|
+
let h;
|
|
74
|
+
t[0] !== i ? (h = () => {
|
|
75
|
+
i(null);
|
|
76
|
+
}, t[0] = i, t[1] = h) : h = t[1];
|
|
77
|
+
const u = h;
|
|
78
78
|
let g;
|
|
79
|
-
t[2] !==
|
|
80
|
-
|
|
81
|
-
}, t[2] =
|
|
79
|
+
t[2] !== i || t[3] !== r.required || t[4] !== a ? (g = (j) => {
|
|
80
|
+
j.preventDefault(), !(r.required && !a) && (i(a), c(""));
|
|
81
|
+
}, t[2] = i, t[3] = r.required, t[4] = a, t[5] = g) : g = t[5];
|
|
82
82
|
const p = g;
|
|
83
|
-
let f;
|
|
84
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (f = (F) => c(F.currentTarget.value), t[6] = f) : f = t[6];
|
|
85
83
|
let _;
|
|
86
|
-
t[
|
|
84
|
+
t[6] === Symbol.for("react.memo_cache_sentinel") ? (_ = (j) => c(j.currentTarget.value), t[6] = _) : _ = t[6];
|
|
85
|
+
let w;
|
|
86
|
+
t[7] !== a ? (w = {
|
|
87
87
|
value: a,
|
|
88
|
-
onChange:
|
|
88
|
+
onChange: _,
|
|
89
89
|
className: "w-100",
|
|
90
90
|
autoFocus: !0,
|
|
91
91
|
tabIndex: 0
|
|
92
|
-
}, t[7] = a, t[8] =
|
|
93
|
-
const
|
|
94
|
-
let d,
|
|
95
|
-
t[9] !== s || t[10] !==
|
|
96
|
-
s === !0 && c(
|
|
97
|
-
},
|
|
98
|
-
let
|
|
99
|
-
t[13] !== o ? (
|
|
100
|
-
let y;
|
|
101
|
-
t[15] !== w || t[16] !== i.input ? (y = i.input === "textarea" ? /* @__PURE__ */ v("textarea", { ...w, rows: 5 }) : void 0, t[15] = w, t[16] = i.input, t[17] = y) : y = t[17];
|
|
92
|
+
}, t[7] = a, t[8] = w) : w = t[8];
|
|
93
|
+
const f = w;
|
|
94
|
+
let d, m;
|
|
95
|
+
t[9] !== s || t[10] !== r.defaultValue ? (d = () => {
|
|
96
|
+
s === !0 && c(r.defaultValue ?? "");
|
|
97
|
+
}, m = [s, r.defaultValue], t[9] = s, t[10] = r.defaultValue, t[11] = d, t[12] = m) : (d = t[11], m = t[12]), B(d, m);
|
|
98
|
+
let S;
|
|
99
|
+
t[13] !== o ? (S = /* @__PURE__ */ C(H.Header, { className: "justify-content-center", children: /* @__PURE__ */ C(H.Title, { children: o }) }), t[13] = o, t[14] = S) : S = t[14];
|
|
102
100
|
let b;
|
|
103
|
-
t[
|
|
104
|
-
let
|
|
105
|
-
t[
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
t[15] !== f || t[16] !== r.input ? (b = r.input === "textarea" ? /* @__PURE__ */ C("textarea", { ...f, rows: 5 }) : void 0, t[15] = f, t[16] = r.input, t[17] = b) : b = t[17];
|
|
102
|
+
let y;
|
|
103
|
+
t[18] !== f || t[19] !== r.input || t[20] !== r.type ? (y = r.input === "input" ? /* @__PURE__ */ C(Ue, { ...f, type: r.type }) : void 0, t[18] = f, t[19] = r.input, t[20] = r.type, t[21] = y) : y = t[21];
|
|
104
|
+
let v;
|
|
105
|
+
t[22] !== b || t[23] !== y ? (v = /* @__PURE__ */ I(H.Body, { children: [
|
|
106
|
+
b,
|
|
107
|
+
y
|
|
108
|
+
] }), t[22] = b, t[23] = y, t[24] = v) : v = t[24];
|
|
109
|
+
let T;
|
|
110
|
+
t[25] !== n.cancel || t[26] !== u ? (T = /* @__PURE__ */ C(ie, { variant: "outlined", color: "secondary", onClick: u, className: "flex-grow-1", children: n.cancel }), t[25] = n.cancel, t[26] = u, t[27] = T) : T = t[27];
|
|
111
|
+
const W = r.required && !a;
|
|
112
112
|
let P;
|
|
113
|
-
t[28] !== n.confirm || t[29] !==
|
|
113
|
+
t[28] !== n.confirm || t[29] !== W ? (P = /* @__PURE__ */ C(ie, { color: "primary", disabled: W, type: "submit", className: "flex-grow-1", children: n.confirm }), t[28] = n.confirm, t[29] = W, t[30] = P) : P = t[30];
|
|
114
114
|
let M;
|
|
115
|
-
t[31] !==
|
|
116
|
-
|
|
115
|
+
t[31] !== T || t[32] !== P ? (M = /* @__PURE__ */ I(H.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
116
|
+
T,
|
|
117
117
|
P
|
|
118
|
-
] }), t[31] =
|
|
118
|
+
] }), t[31] = T, t[32] = P, t[33] = M) : M = t[33];
|
|
119
119
|
let x;
|
|
120
|
-
t[34] !== p || t[35] !==
|
|
121
|
-
|
|
120
|
+
t[34] !== p || t[35] !== v || t[36] !== M ? (x = /* @__PURE__ */ I("form", { onSubmit: p, onKeyDown: wt, children: [
|
|
121
|
+
v,
|
|
122
122
|
M
|
|
123
|
-
] }), t[34] = p, t[35] =
|
|
124
|
-
let
|
|
125
|
-
return t[38] !== s || t[39] !==
|
|
126
|
-
|
|
123
|
+
] }), t[34] = p, t[35] = v, t[36] = M, t[37] = x) : x = t[37];
|
|
124
|
+
let O;
|
|
125
|
+
return t[38] !== s || t[39] !== u || t[40] !== x || t[41] !== S ? (O = /* @__PURE__ */ I(H, { show: s, size: "sm", centered: !0, onHide: u, children: [
|
|
126
|
+
S,
|
|
127
127
|
x
|
|
128
|
-
] }), t[38] = s, t[39] =
|
|
128
|
+
] }), t[38] = s, t[39] = u, t[40] = x, t[41] = S, t[42] = O) : O = t[42], O;
|
|
129
129
|
};
|
|
130
130
|
function wt(t) {
|
|
131
131
|
return t.stopPropagation();
|
|
@@ -133,358 +133,358 @@ function wt(t) {
|
|
|
133
133
|
const St = (t) => {
|
|
134
134
|
const e = N.c(11), {
|
|
135
135
|
children: n
|
|
136
|
-
} = t, [s, o] =
|
|
136
|
+
} = t, [s, o] = R(!1), [i, r] = R("");
|
|
137
137
|
let a;
|
|
138
138
|
e[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
139
139
|
input: "textarea",
|
|
140
140
|
type: "text"
|
|
141
141
|
}, e[0] = a) : a = e[0];
|
|
142
|
-
const [c,
|
|
142
|
+
const [c, h] = R(a), u = Q(bt);
|
|
143
143
|
let g;
|
|
144
|
-
e[1] === Symbol.for("react.memo_cache_sentinel") ? (g = (
|
|
145
|
-
|
|
144
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (g = (b) => {
|
|
145
|
+
r(b), o(!0);
|
|
146
146
|
}, e[1] = g) : g = e[1];
|
|
147
147
|
const p = g;
|
|
148
|
-
let
|
|
149
|
-
e[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
148
|
+
let _;
|
|
149
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (_ = () => {
|
|
150
150
|
o(!1);
|
|
151
|
-
}, e[2] =
|
|
152
|
-
const
|
|
153
|
-
let
|
|
154
|
-
e[3] !== s || e[4] !== c || e[5] !==
|
|
151
|
+
}, e[2] = _) : _ = e[2];
|
|
152
|
+
const w = _;
|
|
153
|
+
let f;
|
|
154
|
+
e[3] !== s || e[4] !== c || e[5] !== i ? (f = {
|
|
155
155
|
isShown: s,
|
|
156
|
-
text:
|
|
156
|
+
text: i,
|
|
157
157
|
showPrompt: p,
|
|
158
|
-
hidePrompt:
|
|
159
|
-
resolveRef:
|
|
158
|
+
hidePrompt: w,
|
|
159
|
+
resolveRef: u,
|
|
160
160
|
options: c,
|
|
161
|
-
setOptions:
|
|
162
|
-
}, e[3] = s, e[4] = c, e[5] =
|
|
163
|
-
const d =
|
|
164
|
-
let S;
|
|
165
|
-
e[7] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ v(mt, {}), e[7] = S) : S = e[7];
|
|
161
|
+
setOptions: h
|
|
162
|
+
}, e[3] = s, e[4] = c, e[5] = i, e[6] = f) : f = e[6];
|
|
163
|
+
const d = f;
|
|
166
164
|
let m;
|
|
167
|
-
|
|
165
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ C(mt, {}), e[7] = m) : m = e[7];
|
|
166
|
+
let S;
|
|
167
|
+
return e[8] !== n || e[9] !== d ? (S = /* @__PURE__ */ I(Ae.Provider, { value: d, children: [
|
|
168
168
|
n,
|
|
169
|
-
|
|
170
|
-
] }), e[8] = n, e[9] = d, e[10] =
|
|
169
|
+
m
|
|
170
|
+
] }), e[8] = n, e[9] = d, e[10] = S) : S = e[10], S;
|
|
171
171
|
};
|
|
172
172
|
function bt() {
|
|
173
173
|
}
|
|
174
|
-
const
|
|
174
|
+
const en = (t) => {
|
|
175
175
|
const e = N.c(14), {
|
|
176
176
|
cookieDomain: n,
|
|
177
177
|
axiosOptions: s,
|
|
178
178
|
language: o,
|
|
179
|
-
texts:
|
|
180
|
-
ProjectIconComponent:
|
|
179
|
+
texts: i,
|
|
180
|
+
ProjectIconComponent: r,
|
|
181
181
|
localizationContext: a,
|
|
182
182
|
chartColorPalette: c,
|
|
183
|
-
children:
|
|
183
|
+
children: h
|
|
184
184
|
} = t;
|
|
185
|
-
let
|
|
186
|
-
e[0] !==
|
|
185
|
+
let u;
|
|
186
|
+
e[0] !== r || e[1] !== s || e[2] !== c || e[3] !== n || e[4] !== o || e[5] !== a || e[6] !== i ? (u = {
|
|
187
187
|
axiosOptions: s,
|
|
188
188
|
cookieDomain: n,
|
|
189
189
|
language: o,
|
|
190
|
-
texts:
|
|
191
|
-
ProjectIconComponent:
|
|
190
|
+
texts: i,
|
|
191
|
+
ProjectIconComponent: r,
|
|
192
192
|
localizationContext: a,
|
|
193
193
|
chartColorPalette: c
|
|
194
|
-
}, e[0] =
|
|
195
|
-
const g =
|
|
194
|
+
}, e[0] = r, e[1] = s, e[2] = c, e[3] = n, e[4] = o, e[5] = a, e[6] = i, e[7] = u) : u = e[7];
|
|
195
|
+
const g = u;
|
|
196
196
|
let p;
|
|
197
|
-
e[8] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */
|
|
198
|
-
let f;
|
|
199
|
-
e[9] !== u ? (f = /* @__PURE__ */ v(_t, { children: /* @__PURE__ */ I(St, { children: [
|
|
200
|
-
p,
|
|
201
|
-
u
|
|
202
|
-
] }) }), e[9] = u, e[10] = f) : f = e[10];
|
|
197
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ C(We, {}), e[8] = p) : p = e[8];
|
|
203
198
|
let _;
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
e[9] !== h ? (_ = /* @__PURE__ */ C(pt, { children: /* @__PURE__ */ I(St, { children: [
|
|
200
|
+
p,
|
|
201
|
+
h
|
|
202
|
+
] }) }), e[9] = h, e[10] = _) : _ = e[10];
|
|
203
|
+
let w;
|
|
204
|
+
return e[11] !== g || e[12] !== _ ? (w = /* @__PURE__ */ C(ce.Provider, { value: g, children: _ }), e[11] = g, e[12] = _, e[13] = w) : w = e[13], w;
|
|
205
|
+
}, tn = (t) => {
|
|
206
206
|
const e = N.c(15), {
|
|
207
207
|
children: n
|
|
208
|
-
} = t, [s, o] =
|
|
209
|
-
let
|
|
210
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
211
|
-
const [
|
|
208
|
+
} = t, [s, o] = R(!1);
|
|
209
|
+
let i;
|
|
210
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ new Set(), e[0] = i) : i = e[0];
|
|
211
|
+
const [r] = R(i);
|
|
212
212
|
let a;
|
|
213
|
-
e[1] !==
|
|
214
|
-
|
|
215
|
-
}, e[1] =
|
|
213
|
+
e[1] !== r ? (a = (f) => {
|
|
214
|
+
r.add(f), o(!0);
|
|
215
|
+
}, e[1] = r, e[2] = a) : a = e[2];
|
|
216
216
|
const c = a;
|
|
217
|
-
let
|
|
218
|
-
e[3] !==
|
|
219
|
-
|
|
220
|
-
}, e[3] =
|
|
221
|
-
const
|
|
217
|
+
let h;
|
|
218
|
+
e[3] !== r ? (h = (f) => {
|
|
219
|
+
r.delete(f), r.size === 0 && o(!1);
|
|
220
|
+
}, e[3] = r, e[4] = h) : h = e[4];
|
|
221
|
+
const u = h;
|
|
222
222
|
let g;
|
|
223
|
-
e[5] !== s || e[6] !== c || e[7] !==
|
|
223
|
+
e[5] !== s || e[6] !== c || e[7] !== u ? (g = {
|
|
224
224
|
isLoading: s,
|
|
225
225
|
startLoading: c,
|
|
226
|
-
stopLoading:
|
|
227
|
-
}, e[5] = s, e[6] = c, e[7] =
|
|
226
|
+
stopLoading: u
|
|
227
|
+
}, e[5] = s, e[6] = c, e[7] = u, e[8] = g) : g = e[8];
|
|
228
228
|
const p = g;
|
|
229
|
-
let f;
|
|
230
|
-
e[9] !== s ? (f = s && /* @__PURE__ */ v(ct, {}), e[9] = s, e[10] = f) : f = e[10];
|
|
231
229
|
let _;
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
e[9] !== s ? (_ = s && /* @__PURE__ */ C(ct, {}), e[9] = s, e[10] = _) : _ = e[10];
|
|
231
|
+
let w;
|
|
232
|
+
return e[11] !== n || e[12] !== p || e[13] !== _ ? (w = /* @__PURE__ */ I(je.Provider, { value: p, children: [
|
|
233
|
+
_,
|
|
234
234
|
n
|
|
235
|
-
] }), e[11] = n, e[12] = p, e[13] =
|
|
236
|
-
},
|
|
235
|
+
] }), e[11] = n, e[12] = p, e[13] = _, e[14] = w) : w = e[14], w;
|
|
236
|
+
}, nn = (t) => {
|
|
237
237
|
const e = N.c(39), {
|
|
238
238
|
children: n
|
|
239
|
-
} = t, s =
|
|
239
|
+
} = t, s = Fe(), {
|
|
240
240
|
msalInstance: o,
|
|
241
|
-
getToken:
|
|
242
|
-
} =
|
|
243
|
-
delegation:
|
|
241
|
+
getToken: i
|
|
242
|
+
} = X(_e), {
|
|
243
|
+
delegation: r,
|
|
244
244
|
setDelegation: a,
|
|
245
245
|
setAvailableDelegations: c,
|
|
246
|
-
refreshAvailableDelegations:
|
|
247
|
-
} =
|
|
246
|
+
refreshAvailableDelegations: h
|
|
247
|
+
} = X(Re), [u, g] = R(null);
|
|
248
248
|
let p;
|
|
249
|
-
e[0] !==
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
}, e[0] =
|
|
253
|
-
const
|
|
254
|
-
let
|
|
255
|
-
e[2] !==
|
|
256
|
-
|
|
257
|
-
},
|
|
249
|
+
e[0] !== i ? (p = async () => {
|
|
250
|
+
const D = await i();
|
|
251
|
+
D && g(D.token);
|
|
252
|
+
}, e[0] = i, e[1] = p) : p = e[1];
|
|
253
|
+
const _ = p;
|
|
254
|
+
let w, f;
|
|
255
|
+
e[2] !== _ ? (w = () => {
|
|
256
|
+
_();
|
|
257
|
+
}, f = [_], e[2] = _, e[3] = w, e[4] = f) : (w = e[3], f = e[4]), B(w, f);
|
|
258
258
|
let d;
|
|
259
259
|
if (e[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
260
260
|
e: {
|
|
261
|
-
const
|
|
262
|
-
if (!
|
|
261
|
+
const D = localStorage.getItem("user") ?? null;
|
|
262
|
+
if (!D) {
|
|
263
263
|
d = null;
|
|
264
264
|
break e;
|
|
265
265
|
}
|
|
266
|
-
d = JSON.parse(
|
|
266
|
+
d = JSON.parse(D ?? "");
|
|
267
267
|
}
|
|
268
268
|
e[5] = d;
|
|
269
269
|
} else
|
|
270
270
|
d = e[5];
|
|
271
|
-
const
|
|
272
|
-
let
|
|
273
|
-
e[6] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
274
|
-
state:
|
|
275
|
-
user:
|
|
276
|
-
}, e[6] =
|
|
277
|
-
const [
|
|
278
|
-
let
|
|
279
|
-
e[7] !== s ? (
|
|
271
|
+
const m = d;
|
|
272
|
+
let S;
|
|
273
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (S = {
|
|
274
|
+
state: m ? J.LOGGED_IN : J.LOGGED_OUT,
|
|
275
|
+
user: m
|
|
276
|
+
}, e[6] = S) : S = e[6];
|
|
277
|
+
const [b, y] = R(S);
|
|
278
|
+
let v;
|
|
279
|
+
e[7] !== s ? (v = async (D) => {
|
|
280
280
|
let $ = null;
|
|
281
|
-
return await s.get("/user/detail",
|
|
281
|
+
return await s.get("/user/detail", D ? {
|
|
282
282
|
headers: {
|
|
283
|
-
Authorization: `Bearer ${
|
|
283
|
+
Authorization: `Bearer ${D}`
|
|
284
284
|
}
|
|
285
285
|
} : void 0).then((de) => {
|
|
286
286
|
$ = de.data;
|
|
287
287
|
}).catch(() => {
|
|
288
288
|
$ = null;
|
|
289
289
|
}), $;
|
|
290
|
-
}, e[7] = s, e[8] =
|
|
291
|
-
const
|
|
292
|
-
let
|
|
293
|
-
e[9] !== c || e[10] !== a ? (
|
|
294
|
-
localStorage.removeItem("user"),
|
|
295
|
-
state:
|
|
290
|
+
}, e[7] = s, e[8] = v) : v = e[8];
|
|
291
|
+
const T = v;
|
|
292
|
+
let W;
|
|
293
|
+
e[9] !== c || e[10] !== a ? (W = () => {
|
|
294
|
+
localStorage.removeItem("user"), y({
|
|
295
|
+
state: J.LOGGED_OUT,
|
|
296
296
|
user: null
|
|
297
297
|
}), a(null), c(null);
|
|
298
|
-
}, e[9] = c, e[10] = a, e[11] =
|
|
299
|
-
const P =
|
|
298
|
+
}, e[9] = c, e[10] = a, e[11] = W) : W = e[11];
|
|
299
|
+
const P = W;
|
|
300
300
|
let M;
|
|
301
|
-
e[12] !==
|
|
302
|
-
|
|
303
|
-
state:
|
|
301
|
+
e[12] !== T || e[13] !== h ? (M = async (D) => {
|
|
302
|
+
y({
|
|
303
|
+
state: J.LOGGING_IN,
|
|
304
304
|
user: null
|
|
305
305
|
});
|
|
306
|
-
const $ = await
|
|
307
|
-
return $ ? (
|
|
308
|
-
state:
|
|
306
|
+
const $ = await T(D);
|
|
307
|
+
return $ ? (y({
|
|
308
|
+
state: J.LOGGED_IN,
|
|
309
309
|
user: $
|
|
310
|
-
}), localStorage.setItem("user", JSON.stringify($)), await
|
|
311
|
-
state:
|
|
310
|
+
}), localStorage.setItem("user", JSON.stringify($)), await h(), !0) : (y({
|
|
311
|
+
state: J.LOGIN_FAILED,
|
|
312
312
|
user: null
|
|
313
313
|
}), !1);
|
|
314
|
-
}, e[12] =
|
|
314
|
+
}, e[12] = T, e[13] = h, e[14] = M) : M = e[14];
|
|
315
315
|
const x = M;
|
|
316
|
-
let
|
|
317
|
-
e[15] !== o ? (
|
|
316
|
+
let O;
|
|
317
|
+
e[15] !== o ? (O = () => {
|
|
318
318
|
if (o) {
|
|
319
|
-
const
|
|
320
|
-
if ($.eventType ===
|
|
319
|
+
const D = o.addEventCallback(($) => {
|
|
320
|
+
if ($.eventType === ge.LOGIN_SUCCESS && $.payload) {
|
|
321
321
|
const de = $.payload;
|
|
322
322
|
g(de.accessToken);
|
|
323
323
|
}
|
|
324
324
|
});
|
|
325
325
|
return () => {
|
|
326
|
-
|
|
326
|
+
D && o.removeEventCallback(D);
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
|
-
return
|
|
330
|
-
}, e[15] = o, e[16] =
|
|
331
|
-
let
|
|
332
|
-
e[17] !== x || e[18] !== P || e[19] !== o ? (
|
|
333
|
-
let
|
|
334
|
-
e[21] !== x || e[22] !== P || e[23] !== a ? (
|
|
335
|
-
|
|
329
|
+
return yt;
|
|
330
|
+
}, e[15] = o, e[16] = O) : O = e[16];
|
|
331
|
+
let j;
|
|
332
|
+
e[17] !== x || e[18] !== P || e[19] !== o ? (j = [o, x, P], e[17] = x, e[18] = P, e[19] = o, e[20] = j) : j = e[20], B(O, j);
|
|
333
|
+
let Z;
|
|
334
|
+
e[21] !== x || e[22] !== P || e[23] !== a ? (Z = async (D) => {
|
|
335
|
+
D && await x(D).catch(() => {
|
|
336
336
|
P(), a(null);
|
|
337
337
|
});
|
|
338
|
-
}, e[21] = x, e[22] = P, e[23] = a, e[24] =
|
|
339
|
-
const
|
|
340
|
-
let Y;
|
|
341
|
-
e[25] !== h || e[26] !== X ? (Y = () => {
|
|
342
|
-
X(h);
|
|
343
|
-
}, e[25] = h, e[26] = X, e[27] = Y) : Y = e[27];
|
|
344
|
-
const he = i == null ? void 0 : i.id;
|
|
345
|
-
let Z;
|
|
346
|
-
e[28] !== h || e[29] !== X || e[30] !== he ? (Z = [h, he, X], e[28] = h, e[29] = X, e[30] = he, e[31] = Z) : Z = e[31], W(Y, Z);
|
|
338
|
+
}, e[21] = x, e[22] = P, e[23] = a, e[24] = Z) : Z = e[24];
|
|
339
|
+
const K = Z;
|
|
347
340
|
let ee;
|
|
348
|
-
e[
|
|
349
|
-
|
|
350
|
-
|
|
341
|
+
e[25] !== u || e[26] !== K ? (ee = () => {
|
|
342
|
+
K(u);
|
|
343
|
+
}, e[25] = u, e[26] = K, e[27] = ee) : ee = e[27];
|
|
344
|
+
const he = r == null ? void 0 : r.id;
|
|
345
|
+
let te;
|
|
346
|
+
e[28] !== u || e[29] !== K || e[30] !== he ? (te = [u, he, K], e[28] = u, e[29] = K, e[30] = he, e[31] = te) : te = e[31], B(ee, te);
|
|
347
|
+
let ne;
|
|
348
|
+
e[32] !== x || e[33] !== P || e[34] !== b ? (ne = {
|
|
349
|
+
user: b.user,
|
|
350
|
+
userLoginState: b,
|
|
351
351
|
loginUser: x,
|
|
352
352
|
logoutUser: P
|
|
353
|
-
}, e[32] = x, e[33] = P, e[34] =
|
|
354
|
-
const ue =
|
|
355
|
-
let
|
|
356
|
-
return e[36] !== n || e[37] !== ue ? (
|
|
353
|
+
}, e[32] = x, e[33] = P, e[34] = b, e[35] = ne) : ne = e[35];
|
|
354
|
+
const ue = ne;
|
|
355
|
+
let oe;
|
|
356
|
+
return e[36] !== n || e[37] !== ue ? (oe = /* @__PURE__ */ C(Be.Provider, { value: ue, children: n }), e[36] = n, e[37] = ue, e[38] = oe) : oe = e[38], oe;
|
|
357
357
|
};
|
|
358
|
-
function
|
|
358
|
+
function yt() {
|
|
359
359
|
}
|
|
360
|
-
const
|
|
360
|
+
const ve = () => {
|
|
361
361
|
const t = N.c(2);
|
|
362
362
|
let e;
|
|
363
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
363
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ C("p", { children: "Redirecting..." }), t[0] = e) : e = t[0];
|
|
364
364
|
let n;
|
|
365
365
|
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ I("div", { children: [
|
|
366
366
|
e,
|
|
367
367
|
/* @__PURE__ */ I("p", { children: [
|
|
368
368
|
"If you are not redirected within 10 seconds, please click",
|
|
369
369
|
" ",
|
|
370
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ C("a", { href: window.location.href.replace("/blank", "/"), children: "here" })
|
|
371
371
|
] })
|
|
372
372
|
] }), t[1] = n) : n = t[1], n;
|
|
373
|
-
},
|
|
373
|
+
}, Ct = (t) => {
|
|
374
374
|
const e = t == null ? void 0 : t.getActiveAccount();
|
|
375
375
|
console.log("getTokenMsal activeAccount", e);
|
|
376
376
|
const n = t == null ? void 0 : t.getAllAccounts();
|
|
377
377
|
console.log("getTokenMsal allAccounts", n);
|
|
378
378
|
const s = (n == null ? void 0 : n.at(0)) ?? void 0;
|
|
379
379
|
return console.log("getTokenMsal account", s), s ? (e || t == null || t.setActiveAccount(s), s) : null;
|
|
380
|
-
},
|
|
380
|
+
}, on = ({
|
|
381
381
|
...t
|
|
382
382
|
}) => {
|
|
383
383
|
const {
|
|
384
384
|
inProgress: e
|
|
385
385
|
} = it(), {
|
|
386
386
|
cookieDomain: n
|
|
387
|
-
} =
|
|
387
|
+
} = X(ce), [, s] = ze(["Authorization"]), o = F(
|
|
388
388
|
() => t.useMsal ? t.msalInstance : null,
|
|
389
389
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
390
390
|
[t.useMsal, t.useMsal ? t.msalInstance : null]
|
|
391
|
-
),
|
|
391
|
+
), i = F(
|
|
392
392
|
() => t.useMsal ? t.msalScopes : [],
|
|
393
393
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
394
394
|
[t.useMsal, t.useMsal ? t.msalScopes : null]
|
|
395
|
-
),
|
|
395
|
+
), r = F(
|
|
396
396
|
() => t.useMsal ? t.msalExtraScopes : [],
|
|
397
397
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
398
398
|
[t.useMsal, t.useMsal ? t.msalExtraScopes : null]
|
|
399
|
-
), a =
|
|
399
|
+
), a = Q(null), c = Q(!1), h = Y(() => {
|
|
400
400
|
const d = localStorage.getItem("token");
|
|
401
401
|
return d ? {
|
|
402
402
|
token: d,
|
|
403
403
|
expiresOn: lt(new Date(Date.now()), 1)
|
|
404
404
|
} : null;
|
|
405
|
-
}, []),
|
|
405
|
+
}, []), u = Y(async () => {
|
|
406
406
|
if (console.log("getTokenMsal"), o == null)
|
|
407
407
|
throw console.log("getTokenMsal throwing error because msalInstance is null"), new Error("getTokenMsal: msalInstance is null");
|
|
408
408
|
if (a.current)
|
|
409
409
|
return console.log("getTokenMsal returning tokenRequestPromise.current", a.current), a.current;
|
|
410
|
-
const d = new Promise((
|
|
411
|
-
const
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
410
|
+
const d = new Promise((m, S) => {
|
|
411
|
+
const b = (y) => {
|
|
412
|
+
const v = Ct(o);
|
|
413
|
+
if (!v) {
|
|
414
414
|
console.log("getTokenMsal no account found. Redirecting to login"), o == null || o.loginRedirect({
|
|
415
|
-
scopes:
|
|
416
|
-
extraScopesToConsent:
|
|
415
|
+
scopes: i,
|
|
416
|
+
extraScopesToConsent: r
|
|
417
417
|
});
|
|
418
418
|
return;
|
|
419
419
|
}
|
|
420
420
|
o == null || o.acquireTokenSilent({
|
|
421
|
-
scopes:
|
|
422
|
-
account:
|
|
421
|
+
scopes: i,
|
|
422
|
+
account: v,
|
|
423
423
|
redirectUri: t.useMsal ? t.msalSilentRedirectUri : void 0
|
|
424
|
-
}).then((
|
|
425
|
-
|
|
426
|
-
token:
|
|
427
|
-
expiresOn:
|
|
424
|
+
}).then((T) => {
|
|
425
|
+
y(), m({
|
|
426
|
+
token: T.accessToken,
|
|
427
|
+
expiresOn: T.expiresOn ?? new Date(Date.now())
|
|
428
428
|
});
|
|
429
|
-
}).catch((
|
|
430
|
-
console.error("Error acquiring token",
|
|
431
|
-
scopes:
|
|
432
|
-
extraScopesToConsent:
|
|
433
|
-
}),
|
|
429
|
+
}).catch((T) => {
|
|
430
|
+
console.error("Error acquiring token", T), T instanceof rt && (console.log("Silent token acquisition failed. Acquiring token using redirect"), o == null || o.acquireTokenRedirect({
|
|
431
|
+
scopes: i,
|
|
432
|
+
extraScopesToConsent: r
|
|
433
|
+
}), y(), m(null)), y(), S(T);
|
|
434
434
|
}).finally(() => {
|
|
435
|
-
|
|
435
|
+
y(), S(new Error("No access token returned from handleRedirectPromise"));
|
|
436
436
|
});
|
|
437
437
|
};
|
|
438
|
-
if (
|
|
439
|
-
console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None", e),
|
|
438
|
+
if (e !== Ce.None) {
|
|
439
|
+
console.log("getTokenMsal rejecting because inProgress !== InteractionStatus.None", e), S(new Error("Authentication in progress"));
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
|
-
c.current ?
|
|
442
|
+
c.current ? b(() => {
|
|
443
443
|
a.current = null;
|
|
444
|
-
}) : o.handleRedirectPromise().then((
|
|
445
|
-
if (console.log("getTokenMsal tokenResponse",
|
|
446
|
-
|
|
444
|
+
}) : o.handleRedirectPromise().then((y) => {
|
|
445
|
+
if (console.log("getTokenMsal tokenResponse", y), !(y != null && y.accessToken)) {
|
|
446
|
+
b(() => {
|
|
447
447
|
a.current = null, c.current = !0;
|
|
448
448
|
});
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
-
a.current = null, c.current = !0,
|
|
452
|
-
token:
|
|
453
|
-
expiresOn:
|
|
451
|
+
a.current = null, c.current = !0, m({
|
|
452
|
+
token: y.accessToken,
|
|
453
|
+
expiresOn: y.expiresOn ?? new Date(Date.now())
|
|
454
454
|
});
|
|
455
455
|
});
|
|
456
456
|
});
|
|
457
457
|
return a.current = d, d;
|
|
458
|
-
}, [e,
|
|
458
|
+
}, [e, r, o, i, t.msalSilentRedirectUri, t.useMsal]), g = Y(async () => t.useMsal ? u() : h(), [h, u, t.useMsal]), p = Y((d) => t.useMsal ? () => {
|
|
459
459
|
} : (window.addEventListener("storage", d), window.addEventListener("dev-auth-change", d), () => {
|
|
460
460
|
window.removeEventListener("storage", d), window.removeEventListener("dev-auth-change", d);
|
|
461
|
-
}), [t.useMsal]),
|
|
461
|
+
}), [t.useMsal]), _ = st(p, () => localStorage.getItem("token") !== null ? "AUTH_OK" : "NO_AUTH"), w = F(() => {
|
|
462
462
|
var d;
|
|
463
|
-
return t.useMsal ? e !== Ce.None ? "AUTH_IN_PROGRESS" : (o == null ? void 0 : o.getActiveAccount()) ?? ((d = o == null ? void 0 : o.getAllAccounts()) == null ? void 0 : d[0]) ?? null ? "AUTH_OK" : "NO_AUTH" :
|
|
464
|
-
}, [
|
|
463
|
+
return t.useMsal ? e !== Ce.None ? "AUTH_IN_PROGRESS" : (o == null ? void 0 : o.getActiveAccount()) ?? ((d = o == null ? void 0 : o.getAllAccounts()) == null ? void 0 : d[0]) ?? null ? "AUTH_OK" : "NO_AUTH" : _;
|
|
464
|
+
}, [_, e, o, t.useMsal]), f = F(() => ({
|
|
465
465
|
useMsal: t.useMsal ?? !1,
|
|
466
466
|
msalInstance: o,
|
|
467
|
-
msalScopes:
|
|
468
|
-
msalExtraScopes:
|
|
467
|
+
msalScopes: i,
|
|
468
|
+
msalExtraScopes: r,
|
|
469
469
|
getToken: g,
|
|
470
|
-
authState:
|
|
471
|
-
}), [t.useMsal, o,
|
|
472
|
-
return
|
|
470
|
+
authState: w
|
|
471
|
+
}), [t.useMsal, o, i, r, g, w]);
|
|
472
|
+
return B(() => {
|
|
473
473
|
if (t.useMsal && o) {
|
|
474
|
-
const d = o.addEventCallback((
|
|
475
|
-
if (
|
|
476
|
-
const
|
|
477
|
-
o.setActiveAccount(
|
|
478
|
-
const
|
|
479
|
-
s("Authorization",
|
|
474
|
+
const d = o.addEventCallback((m) => {
|
|
475
|
+
if (m.eventType === ge.LOGIN_SUCCESS || m.eventType === ge.ACQUIRE_TOKEN_SUCCESS && m.payload) {
|
|
476
|
+
const S = m.payload, b = S.account;
|
|
477
|
+
o.setActiveAccount(b);
|
|
478
|
+
const y = S.accessToken, v = S.expiresOn;
|
|
479
|
+
s("Authorization", y, {
|
|
480
480
|
path: "/",
|
|
481
481
|
secure: !0,
|
|
482
482
|
sameSite: "none",
|
|
483
483
|
domain: n,
|
|
484
|
-
expires:
|
|
484
|
+
expires: v ?? void 0
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
-
|
|
487
|
+
m.error && console.error("AuthProvider MSAL Error", m);
|
|
488
488
|
});
|
|
489
489
|
return () => {
|
|
490
490
|
d && o.removeEventCallback(d);
|
|
@@ -492,112 +492,112 @@ const ye = () => {
|
|
|
492
492
|
}
|
|
493
493
|
return () => {
|
|
494
494
|
};
|
|
495
|
-
}, [t.useMsal, o, s, n]), /* @__PURE__ */
|
|
496
|
-
},
|
|
495
|
+
}, [t.useMsal, o, s, n]), /* @__PURE__ */ C(_e.Provider, { value: f, children: t.useMsal ? /* @__PURE__ */ C(at, { instance: t.msalInstance, children: window.location.pathname === "/blank" ? /* @__PURE__ */ C(ve, {}) : t.children }) : window.location.pathname === "/blank" ? /* @__PURE__ */ C(ve, {}) : t.children });
|
|
496
|
+
}, sn = (t) => {
|
|
497
497
|
const e = N.c(18), {
|
|
498
498
|
children: n,
|
|
499
499
|
relativeEndpoint: s
|
|
500
|
-
} = t, [o,
|
|
500
|
+
} = t, [o, i, r] = ht("user-delegation", null);
|
|
501
501
|
let a;
|
|
502
502
|
e: {
|
|
503
503
|
if (!o) {
|
|
504
504
|
a = null;
|
|
505
505
|
break e;
|
|
506
506
|
}
|
|
507
|
-
const
|
|
507
|
+
const v = o.from ? we(o.from) : _t(), T = o.to ? we(o.to) : ft();
|
|
508
508
|
if (!gt(new Date(Date.now()), {
|
|
509
|
-
start:
|
|
510
|
-
end:
|
|
509
|
+
start: v,
|
|
510
|
+
end: T
|
|
511
511
|
})) {
|
|
512
|
-
|
|
512
|
+
i(null), a = null;
|
|
513
513
|
break e;
|
|
514
514
|
}
|
|
515
515
|
a = o;
|
|
516
516
|
}
|
|
517
517
|
const c = a;
|
|
518
|
-
let
|
|
519
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
518
|
+
let h;
|
|
519
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (h = {
|
|
520
520
|
nullStateBeforeLoad: !1,
|
|
521
521
|
nullStateOnFail: !0
|
|
522
|
-
}, e[0] =
|
|
522
|
+
}, e[0] = h) : h = e[0];
|
|
523
523
|
const {
|
|
524
|
-
data:
|
|
524
|
+
data: u,
|
|
525
525
|
setData: g,
|
|
526
526
|
reloadData: p
|
|
527
|
-
} = ut(s,
|
|
528
|
-
let
|
|
529
|
-
e[1] !== p ? (
|
|
530
|
-
const
|
|
531
|
-
p(),
|
|
527
|
+
} = ut(s, h), _ = Q(null);
|
|
528
|
+
let w, f;
|
|
529
|
+
e[1] !== p ? (w = () => {
|
|
530
|
+
const v = () => {
|
|
531
|
+
p(), _.current = window.setTimeout(v, Ge() + 5e3);
|
|
532
532
|
};
|
|
533
|
-
return
|
|
534
|
-
|
|
533
|
+
return v(), () => {
|
|
534
|
+
_.current !== null && window.clearTimeout(_.current);
|
|
535
535
|
};
|
|
536
|
-
},
|
|
536
|
+
}, f = [p], e[1] = p, e[2] = w, e[3] = f) : (w = e[2], f = e[3]), B(w, f);
|
|
537
537
|
let d;
|
|
538
|
-
e[4] !==
|
|
539
|
-
const
|
|
540
|
-
|
|
538
|
+
e[4] !== r ? (d = () => {
|
|
539
|
+
const v = () => {
|
|
540
|
+
r();
|
|
541
541
|
};
|
|
542
|
-
return window.addEventListener("focus",
|
|
543
|
-
window.removeEventListener("focus",
|
|
542
|
+
return window.addEventListener("focus", v), () => {
|
|
543
|
+
window.removeEventListener("focus", v);
|
|
544
544
|
};
|
|
545
|
-
}, e[4] =
|
|
546
|
-
let S;
|
|
547
|
-
e[6] !== i || e[7] !== p ? (S = [i, p], e[6] = i, e[7] = p, e[8] = S) : S = e[8], W(d, S);
|
|
545
|
+
}, e[4] = r, e[5] = d) : d = e[5];
|
|
548
546
|
let m;
|
|
549
|
-
e[
|
|
547
|
+
e[6] !== r || e[7] !== p ? (m = [r, p], e[6] = r, e[7] = p, e[8] = m) : m = e[8], B(d, m);
|
|
548
|
+
let S;
|
|
549
|
+
e[9] !== u || e[10] !== p || e[11] !== g || e[12] !== i || e[13] !== c ? (S = {
|
|
550
550
|
delegation: c,
|
|
551
|
-
setDelegation:
|
|
552
|
-
availableDelegations:
|
|
551
|
+
setDelegation: i,
|
|
552
|
+
availableDelegations: u,
|
|
553
553
|
setAvailableDelegations: g,
|
|
554
554
|
refreshAvailableDelegations: p
|
|
555
|
-
}, e[9] =
|
|
556
|
-
const
|
|
557
|
-
let
|
|
558
|
-
return e[15] !== n || e[16] !==
|
|
559
|
-
},
|
|
555
|
+
}, e[9] = u, e[10] = p, e[11] = g, e[12] = i, e[13] = c, e[14] = S) : S = e[14];
|
|
556
|
+
const b = S;
|
|
557
|
+
let y;
|
|
558
|
+
return e[15] !== n || e[16] !== b ? (y = /* @__PURE__ */ C(Re.Provider, { value: b, children: n }), e[15] = n, e[16] = b, e[17] = y) : y = e[17], y;
|
|
559
|
+
}, Te = (t, e) => t ? `${t} | ${e}` : e, rn = (t) => {
|
|
560
560
|
const e = N.c(18), {
|
|
561
561
|
defaultHelmet: n,
|
|
562
562
|
children: s,
|
|
563
563
|
helmetPrefix: o
|
|
564
|
-
} = t,
|
|
565
|
-
let
|
|
566
|
-
e[0] !== n || e[1] !==
|
|
564
|
+
} = t, i = o ?? "";
|
|
565
|
+
let r;
|
|
566
|
+
e[0] !== n || e[1] !== i ? (r = Te(i, n), e[0] = n, e[1] = i, e[2] = r) : r = e[2];
|
|
567
567
|
let a;
|
|
568
|
-
e[3] !==
|
|
569
|
-
const [c,
|
|
570
|
-
let
|
|
571
|
-
e[5] !== o ? (
|
|
572
|
-
|
|
573
|
-
}, e[5] = o, e[6] =
|
|
574
|
-
const g =
|
|
568
|
+
e[3] !== r ? (a = [r], e[3] = r, e[4] = a) : a = e[4];
|
|
569
|
+
const [c, h] = R(a);
|
|
570
|
+
let u;
|
|
571
|
+
e[5] !== o ? (u = (y) => {
|
|
572
|
+
h((v) => [...v, Te(o ?? "", y)]);
|
|
573
|
+
}, e[5] = o, e[6] = u) : u = e[6];
|
|
574
|
+
const g = u;
|
|
575
575
|
let p;
|
|
576
576
|
e[7] === Symbol.for("react.memo_cache_sentinel") ? (p = () => {
|
|
577
|
-
|
|
577
|
+
h(vt);
|
|
578
578
|
}, e[7] = p) : p = e[7];
|
|
579
|
-
const
|
|
580
|
-
let
|
|
581
|
-
e[8] !== c ? (
|
|
582
|
-
const
|
|
579
|
+
const _ = p;
|
|
580
|
+
let w;
|
|
581
|
+
e[8] !== c ? (w = c.at(-1) ?? "", e[8] = c, e[9] = w) : w = e[9];
|
|
582
|
+
const f = w;
|
|
583
583
|
let d;
|
|
584
584
|
e[10] !== g ? (d = {
|
|
585
585
|
addHelmet: g,
|
|
586
|
-
removeHelmet:
|
|
586
|
+
removeHelmet: _
|
|
587
587
|
}, e[10] = g, e[11] = d) : d = e[11];
|
|
588
|
-
const
|
|
589
|
-
let
|
|
590
|
-
e[12] !==
|
|
591
|
-
let
|
|
592
|
-
return e[14] !== s || e[15] !==
|
|
593
|
-
|
|
588
|
+
const m = d;
|
|
589
|
+
let S;
|
|
590
|
+
e[12] !== f ? (S = /* @__PURE__ */ C("title", { children: f }), e[12] = f, e[13] = S) : S = e[13];
|
|
591
|
+
let b;
|
|
592
|
+
return e[14] !== s || e[15] !== m || e[16] !== S ? (b = /* @__PURE__ */ I(Ve.Provider, { value: m, children: [
|
|
593
|
+
S,
|
|
594
594
|
s
|
|
595
|
-
] }), e[14] = s, e[15] =
|
|
595
|
+
] }), e[14] = s, e[15] = m, e[16] = S, e[17] = b) : b = e[17], b;
|
|
596
596
|
};
|
|
597
597
|
function vt(t) {
|
|
598
598
|
return t.length > 1 ? t.slice(0, -1) : t;
|
|
599
599
|
}
|
|
600
|
-
class
|
|
600
|
+
class $e {
|
|
601
601
|
constructor(e, n, s) {
|
|
602
602
|
this.statusCode = e, this.statusText = n, this.content = s;
|
|
603
603
|
}
|
|
@@ -634,13 +634,13 @@ class le {
|
|
|
634
634
|
return "";
|
|
635
635
|
}
|
|
636
636
|
}
|
|
637
|
-
class
|
|
637
|
+
class Tt extends le {
|
|
638
638
|
constructor(e) {
|
|
639
|
-
if (super(), this._logger = e, typeof fetch > "u" ||
|
|
639
|
+
if (super(), this._logger = e, typeof fetch > "u" || L.isNode) {
|
|
640
640
|
const n = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
641
641
|
this._jar = new (n("tough-cookie")).CookieJar(), typeof fetch > "u" ? this._fetchType = n("node-fetch") : this._fetchType = fetch, this._fetchType = n("fetch-cookie")(this._fetchType, this._jar);
|
|
642
642
|
} else
|
|
643
|
-
this._fetchType = fetch.bind(
|
|
643
|
+
this._fetchType = fetch.bind(Xe());
|
|
644
644
|
if (typeof AbortController > "u") {
|
|
645
645
|
const n = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
646
646
|
this._abortControllerType = n("abort-controller");
|
|
@@ -668,9 +668,9 @@ class kt extends le {
|
|
|
668
668
|
}, c);
|
|
669
669
|
}
|
|
670
670
|
e.content === "" && (e.content = void 0), e.content && (e.headers = e.headers || {}, Le(e.content) ? e.headers["Content-Type"] = "application/octet-stream" : e.headers["Content-Type"] = "text/plain;charset=UTF-8");
|
|
671
|
-
let
|
|
671
|
+
let i;
|
|
672
672
|
try {
|
|
673
|
-
|
|
673
|
+
i = await this._fetchType(e.url, {
|
|
674
674
|
body: e.content,
|
|
675
675
|
cache: "no-cache",
|
|
676
676
|
credentials: e.withCredentials === !0 ? "include" : "same-origin",
|
|
@@ -688,16 +688,16 @@ class kt extends le {
|
|
|
688
688
|
} finally {
|
|
689
689
|
o && clearTimeout(o), e.abortSignal && (e.abortSignal.onabort = null);
|
|
690
690
|
}
|
|
691
|
-
if (!
|
|
692
|
-
const c = await ke(
|
|
693
|
-
throw new
|
|
691
|
+
if (!i.ok) {
|
|
692
|
+
const c = await ke(i, "text");
|
|
693
|
+
throw new G(c || i.statusText, i.status);
|
|
694
694
|
}
|
|
695
|
-
const a = await ke(
|
|
696
|
-
return new
|
|
695
|
+
const a = await ke(i, e.responseType);
|
|
696
|
+
return new $e(i.status, i.statusText, a);
|
|
697
697
|
}
|
|
698
698
|
getCookieString(e) {
|
|
699
699
|
let n = "";
|
|
700
|
-
return
|
|
700
|
+
return L.isNode && this._jar && this._jar.getCookies(e, (s, o) => n = o.join("; ")), n;
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
703
|
function ke(t, e) {
|
|
@@ -719,7 +719,7 @@ function ke(t, e) {
|
|
|
719
719
|
}
|
|
720
720
|
return n;
|
|
721
721
|
}
|
|
722
|
-
class
|
|
722
|
+
class kt extends le {
|
|
723
723
|
constructor(e) {
|
|
724
724
|
super(), this._logger = e;
|
|
725
725
|
}
|
|
@@ -728,15 +728,15 @@ class Tt extends le {
|
|
|
728
728
|
return e.abortSignal && e.abortSignal.aborted ? Promise.reject(new U()) : e.method ? e.url ? new Promise((n, s) => {
|
|
729
729
|
const o = new XMLHttpRequest();
|
|
730
730
|
o.open(e.method, e.url, !0), o.withCredentials = e.withCredentials === void 0 ? !0 : e.withCredentials, o.setRequestHeader("X-Requested-With", "XMLHttpRequest"), e.content === "" && (e.content = void 0), e.content && (Le(e.content) ? o.setRequestHeader("Content-Type", "application/octet-stream") : o.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"));
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
o.setRequestHeader(
|
|
731
|
+
const i = e.headers;
|
|
732
|
+
i && Object.keys(i).forEach((r) => {
|
|
733
|
+
o.setRequestHeader(r, i[r]);
|
|
734
734
|
}), e.responseType && (o.responseType = e.responseType), e.abortSignal && (e.abortSignal.onabort = () => {
|
|
735
735
|
o.abort(), s(new U());
|
|
736
736
|
}), e.timeout && (o.timeout = e.timeout), o.onload = () => {
|
|
737
|
-
e.abortSignal && (e.abortSignal.onabort = null), o.status >= 200 && o.status < 300 ? n(new
|
|
737
|
+
e.abortSignal && (e.abortSignal.onabort = null), o.status >= 200 && o.status < 300 ? n(new $e(o.status, o.statusText, o.response || o.responseText)) : s(new G(o.response || o.responseText || o.statusText, o.status));
|
|
738
738
|
}, o.onerror = () => {
|
|
739
|
-
this._logger.log(l.Warning, `Error from HTTP request. ${o.status}: ${o.statusText}.`), s(new
|
|
739
|
+
this._logger.log(l.Warning, `Error from HTTP request. ${o.status}: ${o.statusText}.`), s(new G(o.statusText, o.status));
|
|
740
740
|
}, o.ontimeout = () => {
|
|
741
741
|
this._logger.log(l.Warning, "Timeout from HTTP request."), s(new pe());
|
|
742
742
|
}, o.send(e.content);
|
|
@@ -746,10 +746,10 @@ class Tt extends le {
|
|
|
746
746
|
class Et extends le {
|
|
747
747
|
/** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */
|
|
748
748
|
constructor(e) {
|
|
749
|
-
if (super(), typeof fetch < "u" ||
|
|
750
|
-
this._httpClient = new kt(e);
|
|
751
|
-
else if (typeof XMLHttpRequest < "u")
|
|
749
|
+
if (super(), typeof fetch < "u" || L.isNode)
|
|
752
750
|
this._httpClient = new Tt(e);
|
|
751
|
+
else if (typeof XMLHttpRequest < "u")
|
|
752
|
+
this._httpClient = new kt(e);
|
|
753
753
|
else
|
|
754
754
|
throw new Error("No usable HttpClient found.");
|
|
755
755
|
}
|
|
@@ -762,7 +762,7 @@ class Et extends le {
|
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
764
|
const Pt = [0, 2e3, 1e4, 3e4, null];
|
|
765
|
-
class
|
|
765
|
+
class Ee {
|
|
766
766
|
constructor(e) {
|
|
767
767
|
this._retryDelays = e !== void 0 ? [...e, null] : Pt;
|
|
768
768
|
}
|
|
@@ -770,10 +770,10 @@ class Te {
|
|
|
770
770
|
return this._retryDelays[e.previousRetryCount];
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
class
|
|
773
|
+
class V {
|
|
774
774
|
}
|
|
775
|
-
|
|
776
|
-
|
|
775
|
+
V.Authorization = "Authorization";
|
|
776
|
+
V.Cookie = "Cookie";
|
|
777
777
|
class xt extends le {
|
|
778
778
|
constructor(e, n) {
|
|
779
779
|
super(), this._innerClient = e, this._accessTokenFactory = n;
|
|
@@ -785,21 +785,21 @@ class xt extends le {
|
|
|
785
785
|
return n && s.statusCode === 401 && this._accessTokenFactory ? (this._accessToken = await this._accessTokenFactory(), this._setAuthorizationHeader(e), await this._innerClient.send(e)) : s;
|
|
786
786
|
}
|
|
787
787
|
_setAuthorizationHeader(e) {
|
|
788
|
-
e.headers || (e.headers = {}), this._accessToken ? e.headers[
|
|
788
|
+
e.headers || (e.headers = {}), this._accessToken ? e.headers[V.Authorization] = `Bearer ${this._accessToken}` : this._accessTokenFactory && e.headers[V.Authorization] && delete e.headers[V.Authorization];
|
|
789
789
|
}
|
|
790
790
|
getCookieString(e) {
|
|
791
791
|
return this._innerClient.getCookieString(e);
|
|
792
792
|
}
|
|
793
793
|
}
|
|
794
|
-
var
|
|
794
|
+
var k;
|
|
795
795
|
(function(t) {
|
|
796
796
|
t[t.None = 0] = "None", t[t.WebSockets = 1] = "WebSockets", t[t.ServerSentEvents = 2] = "ServerSentEvents", t[t.LongPolling = 4] = "LongPolling";
|
|
797
|
-
})(
|
|
798
|
-
var
|
|
797
|
+
})(k || (k = {}));
|
|
798
|
+
var A;
|
|
799
799
|
(function(t) {
|
|
800
800
|
t[t.Text = 1] = "Text", t[t.Binary = 2] = "Binary";
|
|
801
|
-
})(
|
|
802
|
-
let
|
|
801
|
+
})(A || (A = {}));
|
|
802
|
+
let Dt = class {
|
|
803
803
|
constructor() {
|
|
804
804
|
this._isAborted = !1, this.onabort = null;
|
|
805
805
|
}
|
|
@@ -813,28 +813,28 @@ let At = class {
|
|
|
813
813
|
return this._isAborted;
|
|
814
814
|
}
|
|
815
815
|
};
|
|
816
|
-
class
|
|
816
|
+
class Pe {
|
|
817
817
|
// This is an internal type, not exported from 'index' so this is really just internal.
|
|
818
818
|
get pollAborted() {
|
|
819
819
|
return this._pollAbort.aborted;
|
|
820
820
|
}
|
|
821
821
|
constructor(e, n, s) {
|
|
822
|
-
this._httpClient = e, this._logger = n, this._pollAbort = new
|
|
822
|
+
this._httpClient = e, this._logger = n, this._pollAbort = new Dt(), this._options = s, this._running = !1, this.onreceive = null, this.onclose = null;
|
|
823
823
|
}
|
|
824
824
|
async connect(e, n) {
|
|
825
|
-
if (E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n,
|
|
825
|
+
if (E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, A, "transferFormat"), this._url = e, this._logger.log(l.Trace, "(LongPolling transport) Connecting."), n === A.Binary && typeof XMLHttpRequest < "u" && typeof new XMLHttpRequest().responseType != "string")
|
|
826
826
|
throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");
|
|
827
|
-
const [s, o] =
|
|
827
|
+
const [s, o] = q(), i = { [s]: o, ...this._options.headers }, r = {
|
|
828
828
|
abortSignal: this._pollAbort.signal,
|
|
829
|
-
headers:
|
|
829
|
+
headers: i,
|
|
830
830
|
timeout: 1e5,
|
|
831
831
|
withCredentials: this._options.withCredentials
|
|
832
832
|
};
|
|
833
|
-
n ===
|
|
833
|
+
n === A.Binary && (r.responseType = "arraybuffer");
|
|
834
834
|
const a = `${e}&_=${Date.now()}`;
|
|
835
835
|
this._logger.log(l.Trace, `(LongPolling transport) polling: ${a}.`);
|
|
836
|
-
const c = await this._httpClient.get(a,
|
|
837
|
-
c.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${c.statusCode}.`), this._closeError = new
|
|
836
|
+
const c = await this._httpClient.get(a, r);
|
|
837
|
+
c.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${c.statusCode}.`), this._closeError = new G(c.statusText || "", c.statusCode), this._running = !1) : this._running = !0, this._receiving = this._poll(this._url, r);
|
|
838
838
|
}
|
|
839
839
|
async _poll(e, n) {
|
|
840
840
|
try {
|
|
@@ -843,7 +843,7 @@ class Ee {
|
|
|
843
843
|
const s = `${e}&_=${Date.now()}`;
|
|
844
844
|
this._logger.log(l.Trace, `(LongPolling transport) polling: ${s}.`);
|
|
845
845
|
const o = await this._httpClient.get(s, n);
|
|
846
|
-
o.statusCode === 204 ? (this._logger.log(l.Information, "(LongPolling transport) Poll terminated by server."), this._running = !1) : o.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${o.statusCode}.`), this._closeError = new
|
|
846
|
+
o.statusCode === 204 ? (this._logger.log(l.Information, "(LongPolling transport) Poll terminated by server."), this._running = !1) : o.statusCode !== 200 ? (this._logger.log(l.Error, `(LongPolling transport) Unexpected response code: ${o.statusCode}.`), this._closeError = new G(o.statusText || "", o.statusCode), this._running = !1) : o.content ? (this._logger.log(l.Trace, `(LongPolling transport) data received. ${ae(o.content, this._options.logMessageContent)}.`), this.onreceive && this.onreceive(o.content)) : this._logger.log(l.Trace, "(LongPolling transport) Poll timed out, reissuing.");
|
|
847
847
|
} catch (s) {
|
|
848
848
|
this._running ? s instanceof pe ? this._logger.log(l.Trace, "(LongPolling transport) Poll timed out, reissuing.") : (this._closeError = s, this._running = !1) : this._logger.log(l.Trace, `(LongPolling transport) Poll errored after shutdown: ${s.message}`);
|
|
849
849
|
}
|
|
@@ -852,26 +852,26 @@ class Ee {
|
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
854
|
async send(e) {
|
|
855
|
-
return this._running ?
|
|
855
|
+
return this._running ? Ie(this._logger, "LongPolling", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
856
856
|
}
|
|
857
857
|
async stop() {
|
|
858
858
|
this._logger.log(l.Trace, "(LongPolling transport) Stopping polling."), this._running = !1, this._pollAbort.abort();
|
|
859
859
|
try {
|
|
860
860
|
await this._receiving, this._logger.log(l.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);
|
|
861
|
-
const e = {}, [n, s] =
|
|
861
|
+
const e = {}, [n, s] = q();
|
|
862
862
|
e[n] = s;
|
|
863
863
|
const o = {
|
|
864
864
|
headers: { ...e, ...this._options.headers },
|
|
865
865
|
timeout: this._options.timeout,
|
|
866
866
|
withCredentials: this._options.withCredentials
|
|
867
867
|
};
|
|
868
|
-
let
|
|
868
|
+
let i;
|
|
869
869
|
try {
|
|
870
870
|
await this._httpClient.delete(this._url, o);
|
|
871
|
-
} catch (
|
|
872
|
-
|
|
871
|
+
} catch (r) {
|
|
872
|
+
i = r;
|
|
873
873
|
}
|
|
874
|
-
|
|
874
|
+
i ? i instanceof G && (i.statusCode === 404 ? this._logger.log(l.Trace, "(LongPolling transport) A 404 response was returned from sending a DELETE request.") : this._logger.log(l.Trace, `(LongPolling transport) Error sending a DELETE request: ${i}`)) : this._logger.log(l.Trace, "(LongPolling transport) DELETE request accepted.");
|
|
875
875
|
} finally {
|
|
876
876
|
this._logger.log(l.Trace, "(LongPolling transport) Stop finished."), this._raiseOnClose();
|
|
877
877
|
}
|
|
@@ -883,39 +883,39 @@ class Ee {
|
|
|
883
883
|
}
|
|
884
884
|
}
|
|
885
885
|
}
|
|
886
|
-
class
|
|
886
|
+
class At {
|
|
887
887
|
constructor(e, n, s, o) {
|
|
888
888
|
this._httpClient = e, this._accessToken = n, this._logger = s, this._options = o, this.onreceive = null, this.onclose = null;
|
|
889
889
|
}
|
|
890
890
|
async connect(e, n) {
|
|
891
|
-
return E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n,
|
|
892
|
-
let
|
|
893
|
-
if (n !==
|
|
891
|
+
return E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, A, "transferFormat"), this._logger.log(l.Trace, "(SSE transport) Connecting."), this._url = e, this._accessToken && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(this._accessToken)}`), new Promise((s, o) => {
|
|
892
|
+
let i = !1;
|
|
893
|
+
if (n !== A.Text) {
|
|
894
894
|
o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));
|
|
895
895
|
return;
|
|
896
896
|
}
|
|
897
|
-
let
|
|
898
|
-
if (
|
|
899
|
-
|
|
897
|
+
let r;
|
|
898
|
+
if (L.isBrowser || L.isWebWorker)
|
|
899
|
+
r = new this._options.EventSource(e, { withCredentials: this._options.withCredentials });
|
|
900
900
|
else {
|
|
901
901
|
const a = this._httpClient.getCookieString(e), c = {};
|
|
902
902
|
c.Cookie = a;
|
|
903
|
-
const [
|
|
904
|
-
c[
|
|
903
|
+
const [h, u] = q();
|
|
904
|
+
c[h] = u, r = new this._options.EventSource(e, { withCredentials: this._options.withCredentials, headers: { ...c, ...this._options.headers } });
|
|
905
905
|
}
|
|
906
906
|
try {
|
|
907
|
-
|
|
907
|
+
r.onmessage = (a) => {
|
|
908
908
|
if (this.onreceive)
|
|
909
909
|
try {
|
|
910
|
-
this._logger.log(l.Trace, `(SSE transport) data received. ${
|
|
910
|
+
this._logger.log(l.Trace, `(SSE transport) data received. ${ae(a.data, this._options.logMessageContent)}.`), this.onreceive(a.data);
|
|
911
911
|
} catch (c) {
|
|
912
912
|
this._close(c);
|
|
913
913
|
return;
|
|
914
914
|
}
|
|
915
|
-
},
|
|
916
|
-
|
|
917
|
-
},
|
|
918
|
-
this._logger.log(l.Information, `SSE connected to ${this._url}`), this._eventSource =
|
|
915
|
+
}, r.onerror = (a) => {
|
|
916
|
+
i ? this._close() : o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."));
|
|
917
|
+
}, r.onopen = () => {
|
|
918
|
+
this._logger.log(l.Information, `SSE connected to ${this._url}`), this._eventSource = r, i = !0, s();
|
|
919
919
|
};
|
|
920
920
|
} catch (a) {
|
|
921
921
|
o(a);
|
|
@@ -924,7 +924,7 @@ class Dt {
|
|
|
924
924
|
});
|
|
925
925
|
}
|
|
926
926
|
async send(e) {
|
|
927
|
-
return this._eventSource ?
|
|
927
|
+
return this._eventSource ? Ie(this._logger, "SSE", this._httpClient, this._url, e, this._options) : Promise.reject(new Error("Cannot send until the transport is connected"));
|
|
928
928
|
}
|
|
929
929
|
stop() {
|
|
930
930
|
return this._close(), Promise.resolve();
|
|
@@ -933,50 +933,50 @@ class Dt {
|
|
|
933
933
|
this._eventSource && (this._eventSource.close(), this._eventSource = void 0, this.onclose && this.onclose(e));
|
|
934
934
|
}
|
|
935
935
|
}
|
|
936
|
-
class
|
|
937
|
-
constructor(e, n, s, o,
|
|
938
|
-
this._logger = s, this._accessTokenFactory = n, this._logMessageContent = o, this._webSocketConstructor =
|
|
936
|
+
class Rt {
|
|
937
|
+
constructor(e, n, s, o, i, r) {
|
|
938
|
+
this._logger = s, this._accessTokenFactory = n, this._logMessageContent = o, this._webSocketConstructor = i, this._httpClient = e, this.onreceive = null, this.onclose = null, this._headers = r;
|
|
939
939
|
}
|
|
940
940
|
async connect(e, n) {
|
|
941
|
-
E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n,
|
|
941
|
+
E.isRequired(e, "url"), E.isRequired(n, "transferFormat"), E.isIn(n, A, "transferFormat"), this._logger.log(l.Trace, "(WebSockets transport) Connecting.");
|
|
942
942
|
let s;
|
|
943
|
-
return this._accessTokenFactory && (s = await this._accessTokenFactory()), new Promise((o,
|
|
943
|
+
return this._accessTokenFactory && (s = await this._accessTokenFactory()), new Promise((o, i) => {
|
|
944
944
|
e = e.replace(/^http/, "ws");
|
|
945
|
-
let
|
|
945
|
+
let r;
|
|
946
946
|
const a = this._httpClient.getCookieString(e);
|
|
947
947
|
let c = !1;
|
|
948
|
-
if (
|
|
949
|
-
const
|
|
950
|
-
u
|
|
951
|
-
headers: { ...
|
|
948
|
+
if (L.isNode || L.isReactNative) {
|
|
949
|
+
const h = {}, [u, g] = q();
|
|
950
|
+
h[u] = g, s && (h[V.Authorization] = `Bearer ${s}`), a && (h[V.Cookie] = a), r = new this._webSocketConstructor(e, void 0, {
|
|
951
|
+
headers: { ...h, ...this._headers }
|
|
952
952
|
});
|
|
953
953
|
} else
|
|
954
954
|
s && (e += (e.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(s)}`);
|
|
955
|
-
|
|
956
|
-
this._logger.log(l.Information, `WebSocket connected to ${e}.`), this._webSocket =
|
|
957
|
-
},
|
|
958
|
-
let
|
|
959
|
-
typeof ErrorEvent < "u" &&
|
|
960
|
-
},
|
|
961
|
-
if (this._logger.log(l.Trace, `(WebSockets transport) data received. ${
|
|
955
|
+
r || (r = new this._webSocketConstructor(e)), n === A.Binary && (r.binaryType = "arraybuffer"), r.onopen = (h) => {
|
|
956
|
+
this._logger.log(l.Information, `WebSocket connected to ${e}.`), this._webSocket = r, c = !0, o();
|
|
957
|
+
}, r.onerror = (h) => {
|
|
958
|
+
let u = null;
|
|
959
|
+
typeof ErrorEvent < "u" && h instanceof ErrorEvent ? u = h.error : u = "There was an error with the transport", this._logger.log(l.Information, `(WebSockets transport) ${u}.`);
|
|
960
|
+
}, r.onmessage = (h) => {
|
|
961
|
+
if (this._logger.log(l.Trace, `(WebSockets transport) data received. ${ae(h.data, this._logMessageContent)}.`), this.onreceive)
|
|
962
962
|
try {
|
|
963
|
-
this.onreceive(
|
|
964
|
-
} catch (
|
|
965
|
-
this._close(
|
|
963
|
+
this.onreceive(h.data);
|
|
964
|
+
} catch (u) {
|
|
965
|
+
this._close(u);
|
|
966
966
|
return;
|
|
967
967
|
}
|
|
968
|
-
},
|
|
968
|
+
}, r.onclose = (h) => {
|
|
969
969
|
if (c)
|
|
970
|
-
this._close(
|
|
970
|
+
this._close(h);
|
|
971
971
|
else {
|
|
972
|
-
let
|
|
973
|
-
typeof ErrorEvent < "u" &&
|
|
972
|
+
let u = null;
|
|
973
|
+
typeof ErrorEvent < "u" && h instanceof ErrorEvent ? u = h.error : u = "WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.", i(new Error(u));
|
|
974
974
|
}
|
|
975
975
|
};
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
978
|
send(e) {
|
|
979
|
-
return this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN ? (this._logger.log(l.Trace, `(WebSockets transport) sending data. ${
|
|
979
|
+
return this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN ? (this._logger.log(l.Trace, `(WebSockets transport) sending data. ${ae(e, this._logMessageContent)}.`), this._webSocket.send(e), Promise.resolve()) : Promise.reject("WebSocket is not in the OPEN state");
|
|
980
980
|
}
|
|
981
981
|
stop() {
|
|
982
982
|
return this._webSocket && this._close(void 0), Promise.resolve();
|
|
@@ -991,24 +991,24 @@ class Lt {
|
|
|
991
991
|
return e && typeof e.wasClean == "boolean" && typeof e.code == "number";
|
|
992
992
|
}
|
|
993
993
|
}
|
|
994
|
-
const
|
|
995
|
-
class
|
|
994
|
+
const xe = 100;
|
|
995
|
+
class Lt {
|
|
996
996
|
constructor(e, n = {}) {
|
|
997
997
|
if (this._stopPromiseResolver = () => {
|
|
998
|
-
}, this.features = {}, this._negotiateVersion = 1, E.isRequired(e, "url"), this._logger =
|
|
998
|
+
}, this.features = {}, this._negotiateVersion = 1, E.isRequired(e, "url"), this._logger = Ke(n.logger), this.baseUrl = this._resolveUrl(e), n = n || {}, n.logMessageContent = n.logMessageContent === void 0 ? !1 : n.logMessageContent, typeof n.withCredentials == "boolean" || n.withCredentials === void 0)
|
|
999
999
|
n.withCredentials = n.withCredentials === void 0 ? !0 : n.withCredentials;
|
|
1000
1000
|
else
|
|
1001
1001
|
throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");
|
|
1002
1002
|
n.timeout = n.timeout === void 0 ? 100 * 1e3 : n.timeout;
|
|
1003
1003
|
let s = null, o = null;
|
|
1004
|
-
if (
|
|
1005
|
-
const
|
|
1006
|
-
s =
|
|
1004
|
+
if (L.isNode && typeof require < "u") {
|
|
1005
|
+
const i = typeof __webpack_require__ == "function" ? __non_webpack_require__ : require;
|
|
1006
|
+
s = i("ws"), o = i("eventsource");
|
|
1007
1007
|
}
|
|
1008
|
-
!
|
|
1008
|
+
!L.isNode && typeof WebSocket < "u" && !n.WebSocket ? n.WebSocket = WebSocket : L.isNode && !n.WebSocket && s && (n.WebSocket = s), !L.isNode && typeof EventSource < "u" && !n.EventSource ? n.EventSource = EventSource : L.isNode && !n.EventSource && typeof o < "u" && (n.EventSource = o), this._httpClient = new xt(n.httpClient || new Et(this._logger), n.accessTokenFactory), this._connectionState = "Disconnected", this._connectionStarted = !1, this._options = n, this.onreceive = null, this.onclose = null;
|
|
1009
1009
|
}
|
|
1010
1010
|
async start(e) {
|
|
1011
|
-
if (e = e ||
|
|
1011
|
+
if (e = e || A.Binary, E.isIn(e, A, "transferFormat"), this._logger.log(l.Debug, `Starting connection with transfer format '${A[e]}'.`), this._connectionState !== "Disconnected")
|
|
1012
1012
|
return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));
|
|
1013
1013
|
if (this._connectionState = "Connecting", this._startInternalPromise = this._startInternal(e), await this._startInternalPromise, this._connectionState === "Disconnecting") {
|
|
1014
1014
|
const n = "Failed to start the HttpConnection before stop() was called.";
|
|
@@ -1020,7 +1020,7 @@ class Rt {
|
|
|
1020
1020
|
this._connectionStarted = !0;
|
|
1021
1021
|
}
|
|
1022
1022
|
send(e) {
|
|
1023
|
-
return this._connectionState !== "Connected" ? Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")) : (this._sendQueue || (this._sendQueue = new
|
|
1023
|
+
return this._connectionState !== "Connected" ? Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")) : (this._sendQueue || (this._sendQueue = new me(this.transport)), this._sendQueue.send(e));
|
|
1024
1024
|
}
|
|
1025
1025
|
async stop(e) {
|
|
1026
1026
|
if (this._connectionState === "Disconnected")
|
|
@@ -1052,8 +1052,8 @@ class Rt {
|
|
|
1052
1052
|
this._accessTokenFactory = this._options.accessTokenFactory, this._httpClient._accessTokenFactory = this._accessTokenFactory;
|
|
1053
1053
|
try {
|
|
1054
1054
|
if (this._options.skipNegotiation)
|
|
1055
|
-
if (this._options.transport ===
|
|
1056
|
-
this.transport = this._constructTransport(
|
|
1055
|
+
if (this._options.transport === k.WebSockets)
|
|
1056
|
+
this.transport = this._constructTransport(k.WebSockets), await this._startTransport(n, e);
|
|
1057
1057
|
else
|
|
1058
1058
|
throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");
|
|
1059
1059
|
else {
|
|
@@ -1066,90 +1066,90 @@ class Rt {
|
|
|
1066
1066
|
if (s.ProtocolVersion)
|
|
1067
1067
|
throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");
|
|
1068
1068
|
if (s.url && (n = s.url), s.accessToken) {
|
|
1069
|
-
const
|
|
1070
|
-
this._accessTokenFactory = () =>
|
|
1069
|
+
const i = s.accessToken;
|
|
1070
|
+
this._accessTokenFactory = () => i, this._httpClient._accessToken = i, this._httpClient._accessTokenFactory = void 0;
|
|
1071
1071
|
}
|
|
1072
1072
|
o++;
|
|
1073
|
-
} while (s.url && o <
|
|
1074
|
-
if (o ===
|
|
1073
|
+
} while (s.url && o < xe);
|
|
1074
|
+
if (o === xe && s.url)
|
|
1075
1075
|
throw new Error("Negotiate redirection limit exceeded.");
|
|
1076
1076
|
await this._createTransport(n, this._options.transport, s, e);
|
|
1077
1077
|
}
|
|
1078
|
-
this.transport instanceof
|
|
1078
|
+
this.transport instanceof Pe && (this.features.inherentKeepAlive = !0), this._connectionState === "Connecting" && (this._logger.log(l.Debug, "The HttpConnection connected successfully."), this._connectionState = "Connected");
|
|
1079
1079
|
} catch (s) {
|
|
1080
1080
|
return this._logger.log(l.Error, "Failed to start the connection: " + s), this._connectionState = "Disconnected", this.transport = void 0, this._stopPromiseResolver(), Promise.reject(s);
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
1083
|
async _getNegotiationResponse(e) {
|
|
1084
|
-
const n = {}, [s, o] =
|
|
1084
|
+
const n = {}, [s, o] = q();
|
|
1085
1085
|
n[s] = o;
|
|
1086
|
-
const
|
|
1087
|
-
this._logger.log(l.Debug, `Sending negotiation request: ${
|
|
1086
|
+
const i = this._resolveNegotiateUrl(e);
|
|
1087
|
+
this._logger.log(l.Debug, `Sending negotiation request: ${i}.`);
|
|
1088
1088
|
try {
|
|
1089
|
-
const
|
|
1089
|
+
const r = await this._httpClient.post(i, {
|
|
1090
1090
|
content: "",
|
|
1091
1091
|
headers: { ...n, ...this._options.headers },
|
|
1092
1092
|
timeout: this._options.timeout,
|
|
1093
1093
|
withCredentials: this._options.withCredentials
|
|
1094
1094
|
});
|
|
1095
|
-
if (
|
|
1096
|
-
return Promise.reject(new Error(`Unexpected status code returned from negotiate '${
|
|
1097
|
-
const a = JSON.parse(
|
|
1098
|
-
return (!a.negotiateVersion || a.negotiateVersion < 1) && (a.connectionToken = a.connectionId), a.useStatefulReconnect && this._options._useStatefulReconnect !== !0 ? Promise.reject(new
|
|
1099
|
-
} catch (
|
|
1100
|
-
let a = "Failed to complete negotiation with the server: " +
|
|
1101
|
-
return
|
|
1095
|
+
if (r.statusCode !== 200)
|
|
1096
|
+
return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));
|
|
1097
|
+
const a = JSON.parse(r.content);
|
|
1098
|
+
return (!a.negotiateVersion || a.negotiateVersion < 1) && (a.connectionToken = a.connectionId), a.useStatefulReconnect && this._options._useStatefulReconnect !== !0 ? Promise.reject(new Se("Client didn't negotiate Stateful Reconnect but the server did.")) : a;
|
|
1099
|
+
} catch (r) {
|
|
1100
|
+
let a = "Failed to complete negotiation with the server: " + r;
|
|
1101
|
+
return r instanceof G && r.statusCode === 404 && (a = a + " Either this is not a SignalR endpoint or there is a proxy blocking the connection."), this._logger.log(l.Error, a), Promise.reject(new Se(a));
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
1104
|
_createConnectUrl(e, n) {
|
|
1105
1105
|
return n ? e + (e.indexOf("?") === -1 ? "?" : "&") + `id=${n}` : e;
|
|
1106
1106
|
}
|
|
1107
1107
|
async _createTransport(e, n, s, o) {
|
|
1108
|
-
let
|
|
1108
|
+
let i = this._createConnectUrl(e, s.connectionToken);
|
|
1109
1109
|
if (this._isITransport(n)) {
|
|
1110
|
-
this._logger.log(l.Debug, "Connection was provided an instance of ITransport, using that directly."), this.transport = n, await this._startTransport(
|
|
1110
|
+
this._logger.log(l.Debug, "Connection was provided an instance of ITransport, using that directly."), this.transport = n, await this._startTransport(i, o), this.connectionId = s.connectionId;
|
|
1111
1111
|
return;
|
|
1112
1112
|
}
|
|
1113
|
-
const
|
|
1113
|
+
const r = [], a = s.availableTransports || [];
|
|
1114
1114
|
let c = s;
|
|
1115
|
-
for (const
|
|
1116
|
-
const
|
|
1117
|
-
if (
|
|
1118
|
-
|
|
1119
|
-
else if (this._isITransport(
|
|
1120
|
-
if (this.transport =
|
|
1115
|
+
for (const h of a) {
|
|
1116
|
+
const u = this._resolveTransportOrError(h, n, o, (c == null ? void 0 : c.useStatefulReconnect) === !0);
|
|
1117
|
+
if (u instanceof Error)
|
|
1118
|
+
r.push(`${h.transport} failed:`), r.push(u);
|
|
1119
|
+
else if (this._isITransport(u)) {
|
|
1120
|
+
if (this.transport = u, !c) {
|
|
1121
1121
|
try {
|
|
1122
1122
|
c = await this._getNegotiationResponse(e);
|
|
1123
1123
|
} catch (g) {
|
|
1124
1124
|
return Promise.reject(g);
|
|
1125
1125
|
}
|
|
1126
|
-
|
|
1126
|
+
i = this._createConnectUrl(e, c.connectionToken);
|
|
1127
1127
|
}
|
|
1128
1128
|
try {
|
|
1129
|
-
await this._startTransport(
|
|
1129
|
+
await this._startTransport(i, o), this.connectionId = c.connectionId;
|
|
1130
1130
|
return;
|
|
1131
1131
|
} catch (g) {
|
|
1132
|
-
if (this._logger.log(l.Error, `Failed to start the transport '${
|
|
1132
|
+
if (this._logger.log(l.Error, `Failed to start the transport '${h.transport}': ${g}`), c = void 0, r.push(new Je(`${h.transport} failed: ${g}`, k[h.transport])), this._connectionState !== "Connecting") {
|
|
1133
1133
|
const p = "Failed to select transport before stop() was called.";
|
|
1134
1134
|
return this._logger.log(l.Debug, p), Promise.reject(new U(p));
|
|
1135
1135
|
}
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
1139
|
-
return
|
|
1139
|
+
return r.length > 0 ? Promise.reject(new Qe(`Unable to connect to the server with any of the available transports. ${r.join(" ")}`, r)) : Promise.reject(new Error("None of the transports supported by the client are supported by the server."));
|
|
1140
1140
|
}
|
|
1141
1141
|
_constructTransport(e) {
|
|
1142
1142
|
switch (e) {
|
|
1143
|
-
case
|
|
1143
|
+
case k.WebSockets:
|
|
1144
1144
|
if (!this._options.WebSocket)
|
|
1145
1145
|
throw new Error("'WebSocket' is not supported in your environment.");
|
|
1146
|
-
return new
|
|
1147
|
-
case
|
|
1146
|
+
return new Rt(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});
|
|
1147
|
+
case k.ServerSentEvents:
|
|
1148
1148
|
if (!this._options.EventSource)
|
|
1149
1149
|
throw new Error("'EventSource' is not supported in your environment.");
|
|
1150
|
-
return new
|
|
1151
|
-
case
|
|
1152
|
-
return new
|
|
1150
|
+
return new At(this._httpClient, this._httpClient._accessToken, this._logger, this._options);
|
|
1151
|
+
case k.LongPolling:
|
|
1152
|
+
return new Pe(this._httpClient, this._logger, this._options);
|
|
1153
1153
|
default:
|
|
1154
1154
|
throw new Error(`Unknown transport: ${e}.`);
|
|
1155
1155
|
}
|
|
@@ -1171,23 +1171,23 @@ class Rt {
|
|
|
1171
1171
|
} : this.transport.onclose = (s) => this._stopConnection(s), this.transport.connect(e, n);
|
|
1172
1172
|
}
|
|
1173
1173
|
_resolveTransportOrError(e, n, s, o) {
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1174
|
+
const i = k[e.transport];
|
|
1175
|
+
if (i == null)
|
|
1176
1176
|
return this._logger.log(l.Debug, `Skipping transport '${e.transport}' because it is not supported by this client.`), new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);
|
|
1177
|
-
if (It(n,
|
|
1178
|
-
if (e.transferFormats.map((a) =>
|
|
1179
|
-
if (
|
|
1180
|
-
return this._logger.log(l.Debug, `Skipping transport '${
|
|
1181
|
-
this._logger.log(l.Debug, `Selecting transport '${
|
|
1177
|
+
if (It(n, i))
|
|
1178
|
+
if (e.transferFormats.map((a) => A[a]).indexOf(s) >= 0) {
|
|
1179
|
+
if (i === k.WebSockets && !this._options.WebSocket || i === k.ServerSentEvents && !this._options.EventSource)
|
|
1180
|
+
return this._logger.log(l.Debug, `Skipping transport '${k[i]}' because it is not supported in your environment.'`), new Ye(`'${k[i]}' is not supported in your environment.`, i);
|
|
1181
|
+
this._logger.log(l.Debug, `Selecting transport '${k[i]}'.`);
|
|
1182
1182
|
try {
|
|
1183
|
-
return this.features.reconnect =
|
|
1183
|
+
return this.features.reconnect = i === k.WebSockets ? o : void 0, this._constructTransport(i);
|
|
1184
1184
|
} catch (a) {
|
|
1185
1185
|
return a;
|
|
1186
1186
|
}
|
|
1187
1187
|
} else
|
|
1188
|
-
return this._logger.log(l.Debug, `Skipping transport '${
|
|
1188
|
+
return this._logger.log(l.Debug, `Skipping transport '${k[i]}' because it does not support the requested transfer format '${A[s]}'.`), new Error(`'${k[i]}' does not support ${A[s]}.`);
|
|
1189
1189
|
else
|
|
1190
|
-
return this._logger.log(l.Debug, `Skipping transport '${
|
|
1190
|
+
return this._logger.log(l.Debug, `Skipping transport '${k[i]}' because it was disabled by the client.`), new qe(`'${k[i]}' is disabled by the client.`, i);
|
|
1191
1191
|
}
|
|
1192
1192
|
_isITransport(e) {
|
|
1193
1193
|
return e && typeof e == "object" && "connect" in e;
|
|
@@ -1213,7 +1213,7 @@ class Rt {
|
|
|
1213
1213
|
_resolveUrl(e) {
|
|
1214
1214
|
if (e.lastIndexOf("https://", 0) === 0 || e.lastIndexOf("http://", 0) === 0)
|
|
1215
1215
|
return e;
|
|
1216
|
-
if (!
|
|
1216
|
+
if (!L.isBrowser)
|
|
1217
1217
|
throw new Error(`Cannot resolve '${e}'.`);
|
|
1218
1218
|
const n = window.document.createElement("a");
|
|
1219
1219
|
return n.href = e, this._logger.log(l.Information, `Normalizing '${e}' to '${n.href}'.`), n.href;
|
|
@@ -1228,12 +1228,12 @@ class Rt {
|
|
|
1228
1228
|
function It(t, e) {
|
|
1229
1229
|
return !t || (e & t) !== 0;
|
|
1230
1230
|
}
|
|
1231
|
-
class
|
|
1231
|
+
class me {
|
|
1232
1232
|
constructor(e) {
|
|
1233
|
-
this._transport = e, this._buffer = [], this._executing = !0, this._sendBufferedData = new
|
|
1233
|
+
this._transport = e, this._buffer = [], this._executing = !0, this._sendBufferedData = new se(), this._transportResult = new se(), this._sendLoopPromise = this._sendLoop();
|
|
1234
1234
|
}
|
|
1235
1235
|
send(e) {
|
|
1236
|
-
return this._bufferData(e), this._transportResult || (this._transportResult = new
|
|
1236
|
+
return this._bufferData(e), this._transportResult || (this._transportResult = new se()), this._transportResult.promise;
|
|
1237
1237
|
}
|
|
1238
1238
|
stop() {
|
|
1239
1239
|
return this._executing = !1, this._sendBufferedData.resolve(), this._sendLoopPromise;
|
|
@@ -1249,10 +1249,10 @@ class _e {
|
|
|
1249
1249
|
this._transportResult && this._transportResult.reject("Connection stopped.");
|
|
1250
1250
|
break;
|
|
1251
1251
|
}
|
|
1252
|
-
this._sendBufferedData = new
|
|
1252
|
+
this._sendBufferedData = new se();
|
|
1253
1253
|
const e = this._transportResult;
|
|
1254
1254
|
this._transportResult = void 0;
|
|
1255
|
-
const n = typeof this._buffer[0] == "string" ? this._buffer.join("") :
|
|
1255
|
+
const n = typeof this._buffer[0] == "string" ? this._buffer.join("") : me._concatBuffers(this._buffer);
|
|
1256
1256
|
this._buffer.length = 0;
|
|
1257
1257
|
try {
|
|
1258
1258
|
await this._transport.send(n), e.resolve();
|
|
@@ -1262,14 +1262,14 @@ class _e {
|
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
static _concatBuffers(e) {
|
|
1265
|
-
const n = e.map((
|
|
1265
|
+
const n = e.map((i) => i.byteLength).reduce((i, r) => i + r), s = new Uint8Array(n);
|
|
1266
1266
|
let o = 0;
|
|
1267
|
-
for (const
|
|
1268
|
-
s.set(new Uint8Array(
|
|
1267
|
+
for (const i of e)
|
|
1268
|
+
s.set(new Uint8Array(i), o), o += i.byteLength;
|
|
1269
1269
|
return s.buffer;
|
|
1270
1270
|
}
|
|
1271
1271
|
}
|
|
1272
|
-
class
|
|
1272
|
+
class se {
|
|
1273
1273
|
constructor() {
|
|
1274
1274
|
this.promise = new Promise((e, n) => [this._resolver, this._rejecter] = [e, n]);
|
|
1275
1275
|
}
|
|
@@ -1283,7 +1283,7 @@ class oe {
|
|
|
1283
1283
|
const Mt = "json";
|
|
1284
1284
|
class $t {
|
|
1285
1285
|
constructor() {
|
|
1286
|
-
this.name = Mt, this.version = 2, this.transferFormat =
|
|
1286
|
+
this.name = Mt, this.version = 2, this.transferFormat = A.Text;
|
|
1287
1287
|
}
|
|
1288
1288
|
/** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.
|
|
1289
1289
|
*
|
|
@@ -1295,37 +1295,37 @@ class $t {
|
|
|
1295
1295
|
throw new Error("Invalid input for JSON hub protocol. Expected a string.");
|
|
1296
1296
|
if (!e)
|
|
1297
1297
|
return [];
|
|
1298
|
-
n === null && (n =
|
|
1299
|
-
const s =
|
|
1300
|
-
for (const
|
|
1301
|
-
const
|
|
1302
|
-
if (typeof
|
|
1298
|
+
n === null && (n = Me.instance);
|
|
1299
|
+
const s = be.parse(e), o = [];
|
|
1300
|
+
for (const i of s) {
|
|
1301
|
+
const r = JSON.parse(i);
|
|
1302
|
+
if (typeof r.type != "number")
|
|
1303
1303
|
throw new Error("Invalid payload.");
|
|
1304
|
-
switch (
|
|
1305
|
-
case
|
|
1306
|
-
this._isInvocationMessage(
|
|
1304
|
+
switch (r.type) {
|
|
1305
|
+
case z.Invocation:
|
|
1306
|
+
this._isInvocationMessage(r);
|
|
1307
1307
|
break;
|
|
1308
|
-
case
|
|
1309
|
-
this._isStreamItemMessage(
|
|
1308
|
+
case z.StreamItem:
|
|
1309
|
+
this._isStreamItemMessage(r);
|
|
1310
1310
|
break;
|
|
1311
|
-
case
|
|
1312
|
-
this._isCompletionMessage(
|
|
1311
|
+
case z.Completion:
|
|
1312
|
+
this._isCompletionMessage(r);
|
|
1313
1313
|
break;
|
|
1314
|
-
case
|
|
1314
|
+
case z.Ping:
|
|
1315
1315
|
break;
|
|
1316
|
-
case
|
|
1316
|
+
case z.Close:
|
|
1317
1317
|
break;
|
|
1318
|
-
case
|
|
1319
|
-
this._isAckMessage(
|
|
1318
|
+
case z.Ack:
|
|
1319
|
+
this._isAckMessage(r);
|
|
1320
1320
|
break;
|
|
1321
|
-
case
|
|
1322
|
-
this._isSequenceMessage(
|
|
1321
|
+
case z.Sequence:
|
|
1322
|
+
this._isSequenceMessage(r);
|
|
1323
1323
|
break;
|
|
1324
1324
|
default:
|
|
1325
|
-
n.log(l.Information, "Unknown message type '" +
|
|
1325
|
+
n.log(l.Information, "Unknown message type '" + r.type + "' ignored.");
|
|
1326
1326
|
continue;
|
|
1327
1327
|
}
|
|
1328
|
-
o.push(
|
|
1328
|
+
o.push(r);
|
|
1329
1329
|
}
|
|
1330
1330
|
return o;
|
|
1331
1331
|
}
|
|
@@ -1335,7 +1335,7 @@ class $t {
|
|
|
1335
1335
|
* @returns {string} A string containing the serialized representation of the message.
|
|
1336
1336
|
*/
|
|
1337
1337
|
writeMessage(e) {
|
|
1338
|
-
return
|
|
1338
|
+
return be.write(JSON.stringify(e));
|
|
1339
1339
|
}
|
|
1340
1340
|
_isInvocationMessage(e) {
|
|
1341
1341
|
this._assertNotEmptyString(e.target, "Invalid payload for Invocation message."), e.invocationId !== void 0 && this._assertNotEmptyString(e.invocationId, "Invalid payload for Invocation message.");
|
|
@@ -1373,21 +1373,21 @@ const Nt = {
|
|
|
1373
1373
|
critical: l.Critical,
|
|
1374
1374
|
none: l.None
|
|
1375
1375
|
};
|
|
1376
|
-
function
|
|
1376
|
+
function Ot(t) {
|
|
1377
1377
|
const e = Nt[t.toLowerCase()];
|
|
1378
1378
|
if (typeof e < "u")
|
|
1379
1379
|
return e;
|
|
1380
1380
|
throw new Error(`Unknown log level: ${t}`);
|
|
1381
1381
|
}
|
|
1382
|
-
class
|
|
1382
|
+
class Ht {
|
|
1383
1383
|
configureLogging(e) {
|
|
1384
1384
|
if (E.isRequired(e, "logging"), Ut(e))
|
|
1385
1385
|
this.logger = e;
|
|
1386
1386
|
else if (typeof e == "string") {
|
|
1387
|
-
const n =
|
|
1388
|
-
this.logger = new
|
|
1387
|
+
const n = Ot(e);
|
|
1388
|
+
this.logger = new ye(n);
|
|
1389
1389
|
} else
|
|
1390
|
-
this.logger = new
|
|
1390
|
+
this.logger = new ye(e);
|
|
1391
1391
|
return this;
|
|
1392
1392
|
}
|
|
1393
1393
|
withUrl(e, n) {
|
|
@@ -1406,7 +1406,7 @@ class Ot {
|
|
|
1406
1406
|
withAutomaticReconnect(e) {
|
|
1407
1407
|
if (this.reconnectPolicy)
|
|
1408
1408
|
throw new Error("A reconnectPolicy has already been set.");
|
|
1409
|
-
return e ? Array.isArray(e) ? this.reconnectPolicy = new
|
|
1409
|
+
return e ? Array.isArray(e) ? this.reconnectPolicy = new Ee(e) : this.reconnectPolicy = e : this.reconnectPolicy = new Ee(), this;
|
|
1410
1410
|
}
|
|
1411
1411
|
/** Configures {@link @microsoft/signalr.HubConnection.serverTimeoutInMilliseconds} for the {@link @microsoft/signalr.HubConnection}.
|
|
1412
1412
|
*
|
|
@@ -1437,125 +1437,125 @@ class Ot {
|
|
|
1437
1437
|
const e = this.httpConnectionOptions || {};
|
|
1438
1438
|
if (e.logger === void 0 && (e.logger = this.logger), !this.url)
|
|
1439
1439
|
throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");
|
|
1440
|
-
const n = new
|
|
1441
|
-
return
|
|
1440
|
+
const n = new Lt(this.url, e);
|
|
1441
|
+
return Ze.create(n, this.logger || Me.instance, this.protocol || new $t(), this.reconnectPolicy, this._serverTimeoutInMilliseconds, this._keepAliveIntervalInMilliseconds, this._statefulReconnectBufferSize);
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
function Ut(t) {
|
|
1445
1445
|
return t.log !== void 0;
|
|
1446
1446
|
}
|
|
1447
|
-
const Wt = 15 * 1e3,
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
authState:
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
if (
|
|
1447
|
+
const Wt = 10 * 1e3, jt = 15 * 1e3, cn = ({
|
|
1448
|
+
children: t,
|
|
1449
|
+
apiUrl: e,
|
|
1450
|
+
endpoint: n
|
|
1451
|
+
}) => {
|
|
1452
|
+
const {
|
|
1453
|
+
authState: s,
|
|
1454
|
+
getToken: o
|
|
1455
|
+
} = X(_e), [i, r] = R(fe.Disconnected), [a, c] = R(!1), h = Q(null), u = Q(o);
|
|
1456
|
+
u.current = o;
|
|
1457
|
+
const g = Y(() => {
|
|
1458
|
+
var f;
|
|
1459
|
+
return r(((f = h.current) == null ? void 0 : f.state) ?? fe.Disconnected);
|
|
1460
|
+
}, []);
|
|
1461
|
+
B(() => {
|
|
1462
|
+
if (s !== "AUTH_OK")
|
|
1463
1463
|
return;
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
})
|
|
1468
|
-
|
|
1469
|
-
})
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1464
|
+
let f = !1, d = null;
|
|
1465
|
+
const m = new Ht().withUrl(`${e}/${n}`, {
|
|
1466
|
+
accessTokenFactory: () => u.current().then((b) => (b == null ? void 0 : b.token) ?? "")
|
|
1467
|
+
}).withAutomaticReconnect({
|
|
1468
|
+
nextRetryDelayInMilliseconds: (b) => Math.min(1e3 * 2 ** b.previousRetryCount, jt)
|
|
1469
|
+
}).build();
|
|
1470
|
+
h.current = m, m.on("Connected", (b) => {
|
|
1471
|
+
console.log("Server says:", b);
|
|
1472
|
+
}), m.onreconnecting((b) => {
|
|
1473
|
+
f || (console.log("Reconnecting...", b), g(), c(!0));
|
|
1474
|
+
}), m.onreconnected(() => {
|
|
1475
|
+
f || (console.log("Reconnected"), g(), c(!1));
|
|
1476
|
+
}), m.onclose((b) => {
|
|
1477
|
+
f || (console.log("Connection closed", b), g(), c(!0));
|
|
1475
1478
|
});
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
},
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
console.log("Server says:", t);
|
|
1498
|
-
}
|
|
1499
|
-
const xe = 50, Bt = () => {
|
|
1479
|
+
const S = () => {
|
|
1480
|
+
m.start().then(() => {
|
|
1481
|
+
f || (console.log("Connection started"), g(), c(!1));
|
|
1482
|
+
}).catch((b) => {
|
|
1483
|
+
f || (console.log("Error starting connection:", b), g(), c(!0), d = window.setTimeout(S, Wt));
|
|
1484
|
+
});
|
|
1485
|
+
};
|
|
1486
|
+
return S(), () => {
|
|
1487
|
+
f = !0, d !== null && window.clearTimeout(d), h.current = null, m.stop().catch((b) => {
|
|
1488
|
+
console.log("Error stopping connection:", b);
|
|
1489
|
+
});
|
|
1490
|
+
};
|
|
1491
|
+
}, [e, s, n, g]);
|
|
1492
|
+
const p = F(() => i === fe.Connected, [i]), _ = F(() => s === "AUTH_OK", [s]), w = F(() => ({
|
|
1493
|
+
isAlive: p,
|
|
1494
|
+
shouldBeAlive: _,
|
|
1495
|
+
connectionState: i,
|
|
1496
|
+
hasLastConnectionEnded: a
|
|
1497
|
+
}), [p, _, i, a]);
|
|
1498
|
+
return /* @__PURE__ */ C(et.Provider, { value: w, children: t });
|
|
1499
|
+
}, De = 50, Ft = () => {
|
|
1500
1500
|
const t = N.c(22), {
|
|
1501
1501
|
texts: e
|
|
1502
|
-
} =
|
|
1502
|
+
} = X(ce), {
|
|
1503
1503
|
confirm: n
|
|
1504
1504
|
} = e, {
|
|
1505
1505
|
onConfirm: s,
|
|
1506
1506
|
onCancel: o,
|
|
1507
|
-
text:
|
|
1508
|
-
show:
|
|
1507
|
+
text: i,
|
|
1508
|
+
show: r,
|
|
1509
1509
|
textSm: a
|
|
1510
|
-
} = tt(), c = a === void 0 ?
|
|
1511
|
-
let
|
|
1512
|
-
t[0] !== o || t[1] !== s || t[2] !==
|
|
1513
|
-
if (
|
|
1514
|
-
e: switch (
|
|
1510
|
+
} = tt(), c = a === void 0 ? i.length > De : a, h = i.length > De;
|
|
1511
|
+
let u;
|
|
1512
|
+
t[0] !== o || t[1] !== s || t[2] !== r ? (u = (S) => {
|
|
1513
|
+
if (r)
|
|
1514
|
+
e: switch (S.key) {
|
|
1515
1515
|
case "Enter": {
|
|
1516
|
-
|
|
1516
|
+
S.preventDefault(), S.stopPropagation(), s();
|
|
1517
1517
|
break e;
|
|
1518
1518
|
}
|
|
1519
1519
|
case "Escape": {
|
|
1520
|
-
|
|
1520
|
+
S.preventDefault(), S.stopPropagation(), o();
|
|
1521
1521
|
break e;
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
1524
|
-
}, t[0] = o, t[1] = s, t[2] =
|
|
1525
|
-
const p =
|
|
1526
|
-
let f;
|
|
1527
|
-
t[4] !== c || t[5] !== r ? (f = /* @__PURE__ */ v(O.Header, { className: "justify-content-center", children: c ? /* @__PURE__ */ v(ot, { variant: "body", children: r }) : /* @__PURE__ */ v(O.Title, { children: r }) }), t[4] = c, t[5] = r, t[6] = f) : f = t[6];
|
|
1524
|
+
}, t[0] = o, t[1] = s, t[2] = r, t[3] = u) : u = t[3], nt(u);
|
|
1525
|
+
const p = h ? void 0 : "sm";
|
|
1528
1526
|
let _;
|
|
1529
|
-
t[
|
|
1527
|
+
t[4] !== c || t[5] !== i ? (_ = /* @__PURE__ */ C(H.Header, { className: "justify-content-center", children: c ? /* @__PURE__ */ C(ot, { variant: "body", children: i }) : /* @__PURE__ */ C(H.Title, { children: i }) }), t[4] = c, t[5] = i, t[6] = _) : _ = t[6];
|
|
1530
1528
|
let w;
|
|
1531
|
-
t[
|
|
1529
|
+
t[7] !== n.no || t[8] !== o ? (w = /* @__PURE__ */ C(ie, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: o, children: n.no }), t[7] = n.no, t[8] = o, t[9] = w) : w = t[9];
|
|
1530
|
+
let f;
|
|
1531
|
+
t[10] !== n.yes || t[11] !== s ? (f = /* @__PURE__ */ C(ie, { type: "button", color: "primary", onClick: s, className: "w-100 ml", children: n.yes }), t[10] = n.yes, t[11] = s, t[12] = f) : f = t[12];
|
|
1532
1532
|
let d;
|
|
1533
|
-
t[13] !==
|
|
1533
|
+
t[13] !== w || t[14] !== f ? (d = /* @__PURE__ */ C(H.Body, { children: /* @__PURE__ */ I("div", { className: "w-100 d-flex gap-5", children: [
|
|
1534
|
+
w,
|
|
1535
|
+
f
|
|
1536
|
+
] }) }), t[13] = w, t[14] = f, t[15] = d) : d = t[15];
|
|
1537
|
+
let m;
|
|
1538
|
+
return t[16] !== o || t[17] !== r || t[18] !== p || t[19] !== _ || t[20] !== d ? (m = /* @__PURE__ */ I(H, { show: r, size: p, centered: !0, onHide: o, children: [
|
|
1534
1539
|
_,
|
|
1535
|
-
w
|
|
1536
|
-
] }) }), t[13] = _, t[14] = w, t[15] = d) : d = t[15];
|
|
1537
|
-
let S;
|
|
1538
|
-
return t[16] !== o || t[17] !== i || t[18] !== p || t[19] !== f || t[20] !== d ? (S = /* @__PURE__ */ I(O, { show: i, size: p, centered: !0, onHide: o, children: [
|
|
1539
|
-
f,
|
|
1540
1540
|
d
|
|
1541
|
-
] }), t[16] = o, t[17] =
|
|
1541
|
+
] }), t[16] = o, t[17] = r, t[18] = p, t[19] = _, t[20] = d, t[21] = m) : m = t[21], m;
|
|
1542
1542
|
};
|
|
1543
1543
|
export {
|
|
1544
1544
|
et as ApiWebSocketContext,
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1545
|
+
cn as ApiWebSocketProvider,
|
|
1546
|
+
_e as AuthContext,
|
|
1547
|
+
on as AuthProvider,
|
|
1548
|
+
Re as DelegationContext,
|
|
1549
|
+
sn as DelegationProvider,
|
|
1550
|
+
un as FormDisabledContext,
|
|
1551
|
+
gn as FormDisabledProvider,
|
|
1552
|
+
Ve as HelmetContext,
|
|
1553
|
+
rn as HelmetProvider,
|
|
1554
|
+
je as LoadingContext,
|
|
1555
|
+
tn as LoadingProvider,
|
|
1556
1556
|
ce as LuminusComponentsContext,
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1557
|
+
en as LuminusComponentsProvider,
|
|
1558
|
+
Be as UserContext,
|
|
1559
|
+
nn as UserProvider,
|
|
1560
|
+
dn as useFormDisabledContext
|
|
1561
1561
|
};
|