@archbase/security 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/archbase-security-4.4.0.tgz +0 -0
- package/dist/index.js +823 -819
- package/package.json +5 -5
- package/dist/archbase-security-4.3.1.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
2
|
import * as I from "inversify";
|
|
3
|
-
import { decorate as
|
|
4
|
-
import { compressString as
|
|
5
|
-
import
|
|
6
|
-
import { jwtDecode as
|
|
7
|
-
import { jsx as o, jsxs as C, Fragment as
|
|
8
|
-
import
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import { ArchbaseRemoteApiService as
|
|
3
|
+
import { decorate as Lt, injectable as Ot } from "inversify";
|
|
4
|
+
import { compressString as zt, decompressString as jt, IOCContainer as Ft, ARCHBASE_IOC_API_TYPE as q, processErrorMessage as oe, IsNotEmpty as Q, IsOptional as Z, IsBoolean as se, IsEmail as Ht, getKeyByEnumValue as et, useArchbasePasswordRemember as Vt, getI18nextInstance as S, useArchbaseTheme as Wt, resolveArchbasePasswordPolicy as Gt, isEmailValidate as Jt, validateArchbasePassword as Kt, useArchbaseAppContext as qt } from "@archbase/core";
|
|
5
|
+
import K from "crypto-js";
|
|
6
|
+
import { jwtDecode as Yt } from "jwt-decode";
|
|
7
|
+
import { jsx as o, jsxs as C, Fragment as ie } from "react/jsx-runtime";
|
|
8
|
+
import ct, { useState as p, useEffect as Y, createContext as Ve, useMemo as lt, useRef as We, useCallback as Ce, useContext as Ge } from "react";
|
|
9
|
+
import { BehaviorSubject as tt } from "rxjs";
|
|
10
|
+
import { ArchbaseRemoteApiService as ye, useArchbaseStore as dt } from "@archbase/data";
|
|
11
11
|
import { v4 as ee } from "uuid";
|
|
12
|
-
import { Card as
|
|
13
|
-
import { useFocusTrap as
|
|
14
|
-
import { IconCopy as
|
|
15
|
-
import { ArchbaseQRCode as
|
|
16
|
-
import { useContainer as
|
|
17
|
-
class
|
|
12
|
+
import { Card as Je, Text as j, Divider as De, Stack as xe, TextInput as Se, Button as W, Anchor as rt, Group as ue, Select as Xt, Tooltip as Qt, Loader as ut, PasswordInput as je, Checkbox as Zt, Alert as st, Code as nt, CopyButton as ot, SimpleGrid as er, useMantineColorScheme as tr, Box as rr, Skeleton as Pe } from "@mantine/core";
|
|
13
|
+
import { useFocusTrap as ht } from "@mantine/hooks";
|
|
14
|
+
import { IconCopy as sr } from "@tabler/icons-react";
|
|
15
|
+
import { ArchbaseQRCode as nr, ArchbasePasswordStrengthMeter as or, ArchbaseDialog as it } from "@archbase/components";
|
|
16
|
+
import { useContainer as _e } from "inversify-react";
|
|
17
|
+
class pt {
|
|
18
18
|
id;
|
|
19
19
|
displayName;
|
|
20
20
|
email;
|
|
@@ -24,10 +24,10 @@ class ht {
|
|
|
24
24
|
this.id = e.id, this.displayName = e.displayName, this.email = e.email, this.photo = e.photo, this.isAdmin = e.isAdmin;
|
|
25
25
|
}
|
|
26
26
|
static newInstance() {
|
|
27
|
-
return new
|
|
27
|
+
return new pt({});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class ft {
|
|
31
31
|
username;
|
|
32
32
|
password;
|
|
33
33
|
remember;
|
|
@@ -35,16 +35,16 @@ class pt {
|
|
|
35
35
|
this.username = e.username, this.password = e.password, this.remember = e.remember;
|
|
36
36
|
}
|
|
37
37
|
static newInstance() {
|
|
38
|
-
return new
|
|
38
|
+
return new ft({});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const le = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=",
|
|
42
|
-
class
|
|
41
|
+
const le = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=", $e = "c1ab58e7-c113-4225-a190-a9e59d1207fc", Be = "6faf6932-a0b5-457b-83b1-8d89ddbd91fd", Le = "602b05c5-ec46-451e-aba6-187e463bc245", Oe = "8b4a7c2d-9e5f-4163-b8a7-3f2c9d8e5a1b";
|
|
42
|
+
class ir {
|
|
43
43
|
getUsernameAndPassword() {
|
|
44
44
|
try {
|
|
45
|
-
const e = localStorage.getItem(
|
|
45
|
+
const e = localStorage.getItem(Be);
|
|
46
46
|
if (e) {
|
|
47
|
-
const t =
|
|
47
|
+
const t = K.AES.decrypt(e, le).toString(K.enc.Utf8), n = atob(t).split(":");
|
|
48
48
|
return { username: n[0], password: n[1], remember: !0 };
|
|
49
49
|
} else
|
|
50
50
|
return null;
|
|
@@ -53,14 +53,14 @@ class or {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
saveUsernameAndPassword(e, t) {
|
|
56
|
-
const s = btoa(`${e}:${t}`), n =
|
|
57
|
-
localStorage.setItem(
|
|
56
|
+
const s = btoa(`${e}:${t}`), n = K.AES.encrypt(s, le).toString();
|
|
57
|
+
localStorage.setItem(Be, n);
|
|
58
58
|
}
|
|
59
59
|
getUsername() {
|
|
60
60
|
try {
|
|
61
|
-
const e = localStorage.getItem(
|
|
61
|
+
const e = localStorage.getItem(Le);
|
|
62
62
|
if (e) {
|
|
63
|
-
const t =
|
|
63
|
+
const t = K.AES.decrypt(e, le).toString(K.enc.Utf8);
|
|
64
64
|
return atob(t);
|
|
65
65
|
} else
|
|
66
66
|
return null;
|
|
@@ -69,42 +69,42 @@ class or {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
saveUsername(e) {
|
|
72
|
-
const t = btoa(e), s =
|
|
73
|
-
localStorage.setItem(
|
|
72
|
+
const t = btoa(e), s = K.AES.encrypt(t, le).toString();
|
|
73
|
+
localStorage.setItem(Le, s);
|
|
74
74
|
}
|
|
75
75
|
isTokenExpired(e, t = 300) {
|
|
76
76
|
let s = e;
|
|
77
77
|
if (!s && !this.getToken())
|
|
78
78
|
return !0;
|
|
79
79
|
try {
|
|
80
|
-
const n =
|
|
80
|
+
const n = Yt(s.access_token);
|
|
81
81
|
if (!n)
|
|
82
82
|
return !0;
|
|
83
|
-
const
|
|
84
|
-
return
|
|
83
|
+
const c = Math.floor(Date.now() / 1e3), l = n.exp;
|
|
84
|
+
return c > l - t;
|
|
85
85
|
} catch {
|
|
86
86
|
return !0;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
saveToken(e) {
|
|
90
90
|
if (e) {
|
|
91
|
-
const t = JSON.stringify(e), s =
|
|
92
|
-
localStorage.setItem(
|
|
91
|
+
const t = JSON.stringify(e), s = K.AES.encrypt(t, le).toString(), n = zt(s);
|
|
92
|
+
localStorage.setItem($e, n);
|
|
93
93
|
} else
|
|
94
94
|
this.clearToken();
|
|
95
95
|
}
|
|
96
96
|
clearUsernameAndPassword() {
|
|
97
|
-
localStorage.removeItem(
|
|
97
|
+
localStorage.removeItem(Be), localStorage.removeItem(Le);
|
|
98
98
|
}
|
|
99
99
|
clearToken() {
|
|
100
|
-
localStorage.removeItem(
|
|
100
|
+
localStorage.removeItem($e);
|
|
101
101
|
}
|
|
102
102
|
getToken() {
|
|
103
103
|
try {
|
|
104
|
-
const e = localStorage.getItem(
|
|
104
|
+
const e = localStorage.getItem($e);
|
|
105
105
|
if (!e)
|
|
106
106
|
return null;
|
|
107
|
-
const t =
|
|
107
|
+
const t = jt(e), s = K.AES.decrypt(t, le).toString(K.enc.Utf8);
|
|
108
108
|
return JSON.parse(s);
|
|
109
109
|
} catch {
|
|
110
110
|
return null;
|
|
@@ -112,37 +112,37 @@ class or {
|
|
|
112
112
|
}
|
|
113
113
|
saveContext(e) {
|
|
114
114
|
try {
|
|
115
|
-
const t =
|
|
116
|
-
localStorage.setItem(
|
|
115
|
+
const t = K.AES.encrypt(e, le).toString();
|
|
116
|
+
localStorage.setItem(Oe, t);
|
|
117
117
|
} catch (t) {
|
|
118
118
|
console.warn("Erro ao salvar contexto:", t);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
getContext() {
|
|
122
122
|
try {
|
|
123
|
-
const e = localStorage.getItem(
|
|
124
|
-
return e ?
|
|
123
|
+
const e = localStorage.getItem(Oe);
|
|
124
|
+
return e ? K.AES.decrypt(e, le).toString(K.enc.Utf8) : null;
|
|
125
125
|
} catch {
|
|
126
126
|
return null;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
clearContext() {
|
|
130
|
-
localStorage.removeItem(
|
|
130
|
+
localStorage.removeItem(Oe);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
function
|
|
133
|
+
Lt(Ot(), ir);
|
|
134
|
+
function mt(r) {
|
|
135
135
|
const t = new Uint8Array(1);
|
|
136
|
-
return window.crypto.getRandomValues(t), t[0] >= Math.floor(256 / r) * r ?
|
|
136
|
+
return window.crypto.getRandomValues(t), t[0] >= Math.floor(256 / r) * r ? mt(r) : t[0] % r;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function ar(r) {
|
|
139
139
|
let e = "";
|
|
140
140
|
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
141
141
|
for (let s = 0; s < r; s++)
|
|
142
|
-
e += t.charAt(
|
|
142
|
+
e += t.charAt(mt(t.length - 1));
|
|
143
143
|
return e;
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
145
|
+
async function cr(r) {
|
|
146
146
|
if (!window.crypto.subtle?.digest)
|
|
147
147
|
throw new Error(
|
|
148
148
|
"The context/environment is not secure, and does not support the 'crypto.subtle' module. See: https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle for details"
|
|
@@ -150,36 +150,36 @@ async function ar(r) {
|
|
|
150
150
|
const t = new TextEncoder().encode(r), s = await window.crypto.subtle.digest("SHA-256", t), n = String.fromCharCode(...new Uint8Array(s));
|
|
151
151
|
return btoa(n).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class gt extends Error {
|
|
154
154
|
status;
|
|
155
155
|
statusText;
|
|
156
156
|
constructor(e, t, s) {
|
|
157
157
|
super(s), this.name = "FetchError", this.status = e, this.statusText = t;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function lr(r) {
|
|
161
161
|
let e = "";
|
|
162
162
|
return Object.entries(r).forEach(([t, s]) => {
|
|
163
163
|
e += (e ? "&" : "") + t + "=" + encodeURIComponent(s);
|
|
164
164
|
}), e;
|
|
165
165
|
}
|
|
166
|
-
async function
|
|
166
|
+
async function dr(r, e) {
|
|
167
167
|
return fetch(r, {
|
|
168
168
|
method: "POST",
|
|
169
|
-
body:
|
|
169
|
+
body: lr(e),
|
|
170
170
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
171
171
|
}).then(async (t) => {
|
|
172
172
|
if (!t.ok) {
|
|
173
173
|
const s = await t.text();
|
|
174
|
-
throw new
|
|
174
|
+
throw new gt(t.status, t.statusText, s);
|
|
175
175
|
}
|
|
176
176
|
return t;
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
async function
|
|
181
|
-
const t =
|
|
182
|
-
return sessionStorage.setItem(
|
|
179
|
+
const yt = "PKCE_code_verifier", Fe = "ROCP_auth_state";
|
|
180
|
+
async function ur(r, e) {
|
|
181
|
+
const t = ar(96);
|
|
182
|
+
return sessionStorage.setItem(yt, t), cr(t).then((s) => {
|
|
183
183
|
const n = new URLSearchParams({
|
|
184
184
|
response_type: "code",
|
|
185
185
|
client_id: r.clientId,
|
|
@@ -188,23 +188,23 @@ async function dr(r, e) {
|
|
|
188
188
|
code_challenge_method: "S256",
|
|
189
189
|
...r.extraAuthParameters
|
|
190
190
|
});
|
|
191
|
-
r.scope !== void 0 && n.append("scope", r.scope), sessionStorage.removeItem(
|
|
192
|
-
const
|
|
193
|
-
|
|
191
|
+
r.scope !== void 0 && n.append("scope", r.scope), sessionStorage.removeItem(Fe);
|
|
192
|
+
const c = e ?? r.state;
|
|
193
|
+
c && (sessionStorage.setItem(Fe, c), n.append("state", c)), r?.preLogin && r.preLogin(), window.location.replace(`${r.authorizationEndpoint}?${n.toString()}`);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function hr(r) {
|
|
197
197
|
return r.access_token !== void 0;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
201
|
-
if (
|
|
199
|
+
function vt(r, e) {
|
|
200
|
+
return dr(r, e).then((t) => t.json().then((s) => {
|
|
201
|
+
if (hr(s))
|
|
202
202
|
return s;
|
|
203
203
|
throw Error(s);
|
|
204
204
|
}));
|
|
205
205
|
}
|
|
206
|
-
const
|
|
207
|
-
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(
|
|
206
|
+
const pr = (r) => {
|
|
207
|
+
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(yt);
|
|
208
208
|
if (!t)
|
|
209
209
|
throw Error(`Parâmetro 'código' não encontrado na URL.
|
|
210
210
|
A autenticação ocorreu?`);
|
|
@@ -221,8 +221,8 @@ A autenticação ocorreu?`);
|
|
|
221
221
|
...r.extraTokenParameters,
|
|
222
222
|
...r.extraAuthParams
|
|
223
223
|
};
|
|
224
|
-
return
|
|
225
|
-
},
|
|
224
|
+
return vt(r.tokenEndpoint, n);
|
|
225
|
+
}, fr = (r) => {
|
|
226
226
|
const { config: e, refreshToken: t } = r, s = {
|
|
227
227
|
grant_type: "refresh_token",
|
|
228
228
|
refresh_token: t,
|
|
@@ -231,10 +231,10 @@ A autenticação ocorreu?`);
|
|
|
231
231
|
redirect_uri: e.redirectUri,
|
|
232
232
|
...e.extraTokenParameters
|
|
233
233
|
};
|
|
234
|
-
return
|
|
234
|
+
return vt(e.tokenEndpoint, s);
|
|
235
235
|
};
|
|
236
|
-
function
|
|
237
|
-
const
|
|
236
|
+
function mr(r, e, t, s, n, c) {
|
|
237
|
+
const l = new URLSearchParams({
|
|
238
238
|
token: t || e,
|
|
239
239
|
token_type_hint: t ? "refresh_token" : "access_token",
|
|
240
240
|
client_id: r.clientId,
|
|
@@ -242,17 +242,17 @@ function fr(r, e, t, s, n, a) {
|
|
|
242
242
|
ui_locales: window.navigator.languages.reduce((i, d) => i + " " + d),
|
|
243
243
|
...r.extraLogoutParameters
|
|
244
244
|
});
|
|
245
|
-
s &&
|
|
245
|
+
s && l.append("id_token_hint", s), n && l.append("state", n), c && l.append("logout_hint", c), window.location.replace(`${r.logoutEndpoint}?${l.toString()}`);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const e = r.get("state"), t = sessionStorage.getItem(
|
|
247
|
+
function gr(r) {
|
|
248
|
+
const e = r.get("state"), t = sessionStorage.getItem(Fe);
|
|
249
249
|
if (e !== t)
|
|
250
250
|
throw new Error(
|
|
251
251
|
'"state" valor recebido do servidor de autenticação não corresponde à solicitação do cliente. Possível falsificação de solicitação entre sites'
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
function de(r, e, t) {
|
|
255
|
-
const s = t === "session" ? sessionStorage : localStorage, [n,
|
|
255
|
+
const s = t === "session" ? sessionStorage : localStorage, [n, c] = p(() => {
|
|
256
256
|
const i = s.getItem(r);
|
|
257
257
|
try {
|
|
258
258
|
return i ? JSON.parse(i) : e;
|
|
@@ -263,69 +263,69 @@ Continuando com o valor padrão.
|
|
|
263
263
|
Error: ${d.message}`
|
|
264
264
|
), e;
|
|
265
265
|
}
|
|
266
|
-
}),
|
|
266
|
+
}), l = (i) => {
|
|
267
267
|
if (i === void 0) {
|
|
268
|
-
|
|
268
|
+
c(i), s.removeItem(r);
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
try {
|
|
272
272
|
const d = i instanceof Function ? i(n) : i;
|
|
273
|
-
|
|
273
|
+
c(d), s.setItem(r, JSON.stringify(d));
|
|
274
274
|
} catch {
|
|
275
275
|
console.log(`Falha ao armazenar valor '${i}' para chave '${r}'`);
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
|
-
return
|
|
278
|
+
return Y(() => {
|
|
279
279
|
const i = (d) => {
|
|
280
|
-
d.storageArea === s && d.key === r &&
|
|
280
|
+
d.storageArea === s && d.key === r && c(JSON.parse(d.newValue ?? ""));
|
|
281
281
|
};
|
|
282
282
|
return window.addEventListener("storage", i, !1), () => window.removeEventListener("storage", i, !1);
|
|
283
|
-
}), [n,
|
|
283
|
+
}), [n, l];
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
286
286
|
__proto__: null,
|
|
287
287
|
default: de
|
|
288
288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
289
|
-
function
|
|
289
|
+
function Te(r) {
|
|
290
290
|
return ["", void 0, null].includes(r);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function yr(r) {
|
|
293
293
|
const {
|
|
294
294
|
autoLogin: e = !0,
|
|
295
295
|
clearURL: t = !0,
|
|
296
296
|
decodeToken: s = !0,
|
|
297
297
|
scope: n = void 0,
|
|
298
|
-
preLogin:
|
|
299
|
-
postLogin:
|
|
298
|
+
preLogin: c = () => null,
|
|
299
|
+
postLogin: l = () => null,
|
|
300
300
|
onRefreshTokenExpire: i = void 0,
|
|
301
301
|
storage: d = "local"
|
|
302
|
-
} = r,
|
|
302
|
+
} = r, g = {
|
|
303
303
|
...r,
|
|
304
304
|
autoLogin: e,
|
|
305
305
|
clearURL: t,
|
|
306
306
|
decodeToken: s,
|
|
307
307
|
scope: n,
|
|
308
|
-
preLogin:
|
|
309
|
-
postLogin:
|
|
308
|
+
preLogin: c,
|
|
309
|
+
postLogin: l,
|
|
310
310
|
onRefreshTokenExpire: i,
|
|
311
311
|
storage: d
|
|
312
312
|
};
|
|
313
|
-
return
|
|
313
|
+
return vr(g), g;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
if (
|
|
315
|
+
function vr(r) {
|
|
316
|
+
if (Te(r?.clientId))
|
|
317
317
|
throw Error(
|
|
318
318
|
"'clientId' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
319
319
|
);
|
|
320
|
-
if (
|
|
320
|
+
if (Te(r?.authorizationEndpoint))
|
|
321
321
|
throw Error(
|
|
322
322
|
"'authorizationEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
323
323
|
);
|
|
324
|
-
if (
|
|
324
|
+
if (Te(r?.tokenEndpoint))
|
|
325
325
|
throw Error(
|
|
326
326
|
"'tokenEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
327
327
|
);
|
|
328
|
-
if (
|
|
328
|
+
if (Te(r?.redirectUri))
|
|
329
329
|
throw Error(
|
|
330
330
|
"'redirectUri' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
331
331
|
);
|
|
@@ -337,23 +337,23 @@ function yr(r) {
|
|
|
337
337
|
"Usar 'extraAuthParams' e 'extraTokenParameters' não é recomendado. Eles fazem a mesma coisa e você deve usar apenas 'extraTokenParameters'"
|
|
338
338
|
);
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
function
|
|
340
|
+
const me = 600, fe = (r) => Math.round(Date.now() / 1e3 + r);
|
|
341
|
+
function at(r) {
|
|
342
342
|
return Math.round(Date.now()) / 1e3 + 30 >= r;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
344
|
+
const wr = [
|
|
345
345
|
"refresh_expires_in",
|
|
346
346
|
// KeyCloak
|
|
347
347
|
"refresh_token_expires_in"
|
|
348
348
|
// Azure AD
|
|
349
349
|
];
|
|
350
|
-
function
|
|
351
|
-
for (const t of
|
|
350
|
+
function br(r, e) {
|
|
351
|
+
for (const t of wr)
|
|
352
352
|
if (t in e)
|
|
353
353
|
return e[t];
|
|
354
|
-
return e.refresh_token ? r +
|
|
354
|
+
return e.refresh_token ? r + me : r;
|
|
355
355
|
}
|
|
356
|
-
const
|
|
356
|
+
const Ue = (r) => {
|
|
357
357
|
try {
|
|
358
358
|
const t = r.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), s = decodeURIComponent(
|
|
359
359
|
atob(t).split("").map(function(n) {
|
|
@@ -368,86 +368,86 @@ const Te = (r) => {
|
|
|
368
368
|
Você pode desativar a decodificação JWT definindo o valor 'decodeToken' como 'falso' na configuração.`
|
|
369
369
|
);
|
|
370
370
|
}
|
|
371
|
-
},
|
|
371
|
+
}, Ar = Ve({
|
|
372
372
|
token: "",
|
|
373
373
|
login: () => null,
|
|
374
374
|
logOut: () => null,
|
|
375
375
|
error: null,
|
|
376
376
|
loginInProgress: !1
|
|
377
|
-
}),
|
|
378
|
-
const t =
|
|
377
|
+
}), Jr = ({ authConfig: r, children: e }) => {
|
|
378
|
+
const t = lt(() => yr(r), [r]), [s, n] = de(
|
|
379
379
|
"ROCP_refreshToken",
|
|
380
380
|
void 0,
|
|
381
381
|
t.storage
|
|
382
|
-
), [
|
|
382
|
+
), [c, l] = de(
|
|
383
383
|
"ROCP_refreshTokenExpire",
|
|
384
|
-
|
|
384
|
+
fe(2 * me),
|
|
385
385
|
t.storage
|
|
386
|
-
), [i, d] = de("ROCP_token", "", t.storage), [
|
|
386
|
+
), [i, d] = de("ROCP_token", "", t.storage), [g, k] = de(
|
|
387
387
|
"ROCP_tokenExpire",
|
|
388
|
-
|
|
388
|
+
fe(me),
|
|
389
389
|
t.storage
|
|
390
|
-
), [
|
|
390
|
+
), [u, T] = de(
|
|
391
391
|
"ROCP_idToken",
|
|
392
392
|
void 0,
|
|
393
393
|
t.storage
|
|
394
|
-
), [
|
|
394
|
+
), [b, v] = de(
|
|
395
395
|
"ROCP_loginInProgress",
|
|
396
396
|
!1,
|
|
397
397
|
t.storage
|
|
398
|
-
), [
|
|
398
|
+
), [E, P] = de(
|
|
399
399
|
"ROCP_refreshInProgress",
|
|
400
400
|
!1,
|
|
401
401
|
t.storage
|
|
402
|
-
), [M, B] = p(), [
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
n(void 0), d(""), k(
|
|
406
|
-
}
|
|
407
|
-
function L(
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
function N(
|
|
411
|
-
|
|
412
|
-
let
|
|
413
|
-
|
|
414
|
-
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${
|
|
415
|
-
),
|
|
416
|
-
console.error(
|
|
402
|
+
), [M, B] = p(), [F, D] = p(), [w, f] = p(null);
|
|
403
|
+
let _;
|
|
404
|
+
function H() {
|
|
405
|
+
n(void 0), d(""), k(fe(me)), l(fe(me)), T(void 0), B(void 0), D(void 0), v(!1);
|
|
406
|
+
}
|
|
407
|
+
function L(m, y) {
|
|
408
|
+
H(), f(null), t?.logoutEndpoint && mr(t, i, s, u, m, y);
|
|
409
|
+
}
|
|
410
|
+
function N(m) {
|
|
411
|
+
H(), v(!0);
|
|
412
|
+
let y = m;
|
|
413
|
+
m && typeof m != "string" && (console.warn(
|
|
414
|
+
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${m}'. Ignorando o valor...`
|
|
415
|
+
), y = void 0), ur(t, y).catch((J) => {
|
|
416
|
+
console.error(J), f(J.message), v(!1);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
d(
|
|
421
|
-
const
|
|
422
|
-
k(
|
|
423
|
-
const
|
|
424
|
-
|
|
419
|
+
function X(m) {
|
|
420
|
+
d(m.access_token), n(m.refresh_token);
|
|
421
|
+
const y = t.tokenExpiresIn ?? m.expires_in ?? me;
|
|
422
|
+
k(fe(y));
|
|
423
|
+
const J = t.refreshTokenExpiresIn ?? br(y, m);
|
|
424
|
+
l(fe(J)), T(m.id_token);
|
|
425
425
|
try {
|
|
426
|
-
|
|
427
|
-
} catch (
|
|
428
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
426
|
+
m.id_token && D(Ue(m.id_token));
|
|
427
|
+
} catch (V) {
|
|
428
|
+
console.warn(`Falha ao decodificar idToken: ${V.message}`);
|
|
429
429
|
}
|
|
430
430
|
try {
|
|
431
|
-
t.decodeToken && B(
|
|
432
|
-
} catch (
|
|
433
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
431
|
+
t.decodeToken && B(Ue(m.access_token));
|
|
432
|
+
} catch (V) {
|
|
433
|
+
console.warn(`Falha ao decodificar o token de acesso: ${V.message}`);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
return
|
|
436
|
+
function U(m = !1) {
|
|
437
|
+
return m || !t.onRefreshTokenExpire ? N() : t.onRefreshTokenExpire({ login: N });
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
if (i &&
|
|
441
|
-
if (
|
|
442
|
-
return
|
|
439
|
+
function te(m = !1) {
|
|
440
|
+
if (i && at(g) && !(E && !m)) {
|
|
441
|
+
if (at(c))
|
|
442
|
+
return U(m);
|
|
443
443
|
if (s) {
|
|
444
|
-
P(!0),
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
447
|
-
return
|
|
448
|
-
console.error(
|
|
444
|
+
P(!0), fr({ config: t, refreshToken: s }).then((y) => X(y)).catch((y) => {
|
|
445
|
+
if (y instanceof gt) {
|
|
446
|
+
if (y.status === 400)
|
|
447
|
+
return U(m);
|
|
448
|
+
console.error(y), f(y.message), m && N();
|
|
449
449
|
} else
|
|
450
|
-
|
|
450
|
+
y instanceof Error && (console.error(y), f(y.message), m && N());
|
|
451
451
|
}).finally(() => {
|
|
452
452
|
P(!1);
|
|
453
453
|
});
|
|
@@ -458,29 +458,29 @@ const Te = (r) => {
|
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
if (
|
|
465
|
-
const
|
|
466
|
-
if (!
|
|
467
|
-
const
|
|
468
|
-
console.error(
|
|
461
|
+
Y(() => (_ = setInterval(() => te(), 1e4), () => clearInterval(_)), [i, s, c, g]);
|
|
462
|
+
const ae = We(!1);
|
|
463
|
+
return Y(() => {
|
|
464
|
+
if (b) {
|
|
465
|
+
const m = new URLSearchParams(window.location.search);
|
|
466
|
+
if (!m.get("code")) {
|
|
467
|
+
const y = m.get("error_description") || "Estado de autorização inválido. Atualizar a página pode resolver o problema.";
|
|
468
|
+
console.error(y), f(y), L();
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
if (!
|
|
472
|
-
|
|
471
|
+
if (!ae.current) {
|
|
472
|
+
ae.current = !0;
|
|
473
473
|
try {
|
|
474
|
-
|
|
475
|
-
} catch (
|
|
476
|
-
console.error(
|
|
474
|
+
gr(m);
|
|
475
|
+
} catch (y) {
|
|
476
|
+
console.error(y), f(y.message);
|
|
477
477
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}).catch((
|
|
481
|
-
console.error(
|
|
478
|
+
pr(t).then((y) => {
|
|
479
|
+
X(y), t?.postLogin && t.postLogin();
|
|
480
|
+
}).catch((y) => {
|
|
481
|
+
console.error(y), f(y.message);
|
|
482
482
|
}).finally(() => {
|
|
483
|
-
t.clearURL && window.history.replaceState(null, "", window.location.pathname),
|
|
483
|
+
t.clearURL && window.history.replaceState(null, "", window.location.pathname), v(!1);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
return;
|
|
@@ -488,25 +488,25 @@ const Te = (r) => {
|
|
|
488
488
|
if (!i && t.autoLogin)
|
|
489
489
|
return N();
|
|
490
490
|
try {
|
|
491
|
-
|
|
492
|
-
} catch (
|
|
493
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
491
|
+
u && D(Ue(u));
|
|
492
|
+
} catch (m) {
|
|
493
|
+
console.warn(`Falha ao decodificar idToken: ${m.message}`);
|
|
494
494
|
}
|
|
495
495
|
try {
|
|
496
|
-
t.decodeToken && B(
|
|
497
|
-
} catch (
|
|
498
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
496
|
+
t.decodeToken && B(Ue(i));
|
|
497
|
+
} catch (m) {
|
|
498
|
+
console.warn(`Falha ao decodificar o token de acesso: ${m.message}`);
|
|
499
499
|
}
|
|
500
|
-
|
|
500
|
+
te(!0);
|
|
501
501
|
}, []), /* @__PURE__ */ o(
|
|
502
|
-
|
|
502
|
+
Ar.Provider,
|
|
503
503
|
{
|
|
504
|
-
value: { token: i, tokenData: M, idToken:
|
|
504
|
+
value: { token: i, tokenData: M, idToken: u, idTokenData: F, login: N, logOut: L, error: w, loginInProgress: b },
|
|
505
505
|
children: e
|
|
506
506
|
}
|
|
507
507
|
);
|
|
508
508
|
};
|
|
509
|
-
class
|
|
509
|
+
class wt {
|
|
510
510
|
resourceService;
|
|
511
511
|
resource;
|
|
512
512
|
actions;
|
|
@@ -515,7 +515,7 @@ class vt {
|
|
|
515
515
|
error;
|
|
516
516
|
isAdmin;
|
|
517
517
|
constructor(e, t, s) {
|
|
518
|
-
this.resourceService =
|
|
518
|
+
this.resourceService = Ft.getContainer().get(q.Resource), this.resource = { resourceName: e, resourceDescription: t }, this.alreadyApplied = !1, this.actions = [], this.permissions = [], this.error = "", this.isAdmin = s;
|
|
519
519
|
}
|
|
520
520
|
registerAction(e, t) {
|
|
521
521
|
!this.alreadyApplied && this.actions.findIndex((s) => s.actionName === e) < 0 && this.actions.push({ actionName: e, actionDescription: t });
|
|
@@ -524,7 +524,7 @@ class vt {
|
|
|
524
524
|
this.alreadyApplied || (this.alreadyApplied = !0, this.resourceService.registerResource({ resource: this.resource, actions: this.actions }).then((t) => {
|
|
525
525
|
this.permissions = t.permissions, this.error = "", e && e();
|
|
526
526
|
}).catch((t) => {
|
|
527
|
-
this.alreadyApplied = !1, this.error =
|
|
527
|
+
this.alreadyApplied = !1, this.error = oe(t);
|
|
528
528
|
}));
|
|
529
529
|
}
|
|
530
530
|
hasPermission(e) {
|
|
@@ -586,10 +586,10 @@ class vt {
|
|
|
586
586
|
return [...this.actions];
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
class
|
|
589
|
+
class G {
|
|
590
590
|
static instance;
|
|
591
|
-
_currentTenant = new
|
|
592
|
-
_availableTenants = new
|
|
591
|
+
_currentTenant = new tt(null);
|
|
592
|
+
_availableTenants = new tt([]);
|
|
593
593
|
constructor() {
|
|
594
594
|
const e = localStorage.getItem("tenant_info");
|
|
595
595
|
if (e)
|
|
@@ -600,7 +600,7 @@ class J {
|
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
static getInstance() {
|
|
603
|
-
return
|
|
603
|
+
return G.instance || (G.instance = new G()), G.instance;
|
|
604
604
|
}
|
|
605
605
|
get currentTenant$() {
|
|
606
606
|
return this._currentTenant.asObservable();
|
|
@@ -629,15 +629,15 @@ class J {
|
|
|
629
629
|
return t && (e["X-TENANT-ID"] = t.id), e;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
return
|
|
632
|
+
function Kr() {
|
|
633
|
+
return G.getInstance();
|
|
634
634
|
}
|
|
635
|
-
var
|
|
636
|
-
for (var n = void 0,
|
|
637
|
-
(
|
|
638
|
-
return n &&
|
|
639
|
-
},
|
|
640
|
-
const
|
|
635
|
+
var ge = /* @__PURE__ */ ((r) => (r.USER = "user", r.PROFILE = "profile", r.GROUP = "group", r))(ge || {}), Er = Object.defineProperty, A = (r, e, t, s) => {
|
|
636
|
+
for (var n = void 0, c = r.length - 1, l; c >= 0; c--)
|
|
637
|
+
(l = r[c]) && (n = l(e, t, n) || n);
|
|
638
|
+
return n && Er(e, t, n), n;
|
|
639
|
+
}, xr = /* @__PURE__ */ ((r) => (r.VIEW = "VIEW", r.API = "API", r))(xr || {});
|
|
640
|
+
const bt = class At {
|
|
641
641
|
id;
|
|
642
642
|
code;
|
|
643
643
|
version;
|
|
@@ -648,20 +648,20 @@ const wt = class bt {
|
|
|
648
648
|
description;
|
|
649
649
|
intervals;
|
|
650
650
|
constructor(e) {
|
|
651
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.description = e.description || "", this.intervals = e.intervals ? e.intervals.map((t) => new
|
|
651
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.description = e.description || "", this.intervals = e.intervals ? e.intervals.map((t) => new Sr(t)) : [];
|
|
652
652
|
}
|
|
653
|
-
static newInstance = () => new
|
|
653
|
+
static newInstance = () => new At({
|
|
654
654
|
id: ee(),
|
|
655
655
|
intervals: []
|
|
656
656
|
});
|
|
657
657
|
};
|
|
658
|
-
|
|
658
|
+
A([
|
|
659
659
|
Q({
|
|
660
660
|
message: "archbase:Informe a descrição do cronograma de acesso"
|
|
661
661
|
})
|
|
662
|
-
],
|
|
663
|
-
let
|
|
664
|
-
const
|
|
662
|
+
], bt.prototype, "description");
|
|
663
|
+
let Et = bt;
|
|
664
|
+
const Re = class xt {
|
|
665
665
|
id;
|
|
666
666
|
code;
|
|
667
667
|
version;
|
|
@@ -674,30 +674,30 @@ const _e = class Et {
|
|
|
674
674
|
startTime;
|
|
675
675
|
endTime;
|
|
676
676
|
constructor(e) {
|
|
677
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.accessSchedule = e.accessSchedule ? new
|
|
677
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.accessSchedule = e.accessSchedule ? new Et(e.accessSchedule) : void 0, this.dayOfWeek = e.dayOfWeek || 0, this.startTime = e.startTime || "", this.endTime = e.endTime || "";
|
|
678
678
|
}
|
|
679
|
-
static newInstance = () => new
|
|
679
|
+
static newInstance = () => new xt({
|
|
680
680
|
id: ee(),
|
|
681
681
|
dayOfWeek: (/* @__PURE__ */ new Date()).getDay(),
|
|
682
682
|
startTime: "08:00",
|
|
683
683
|
endTime: "17:00"
|
|
684
684
|
});
|
|
685
685
|
};
|
|
686
|
-
|
|
686
|
+
A([
|
|
687
687
|
Z()
|
|
688
|
-
],
|
|
689
|
-
|
|
688
|
+
], Re.prototype, "accessSchedule");
|
|
689
|
+
A([
|
|
690
690
|
Q({
|
|
691
691
|
message: "archbase:Informe a hora de início"
|
|
692
692
|
})
|
|
693
|
-
],
|
|
694
|
-
|
|
693
|
+
], Re.prototype, "startTime");
|
|
694
|
+
A([
|
|
695
695
|
Q({
|
|
696
696
|
message: "archbase:Informe a hora de término"
|
|
697
697
|
})
|
|
698
|
-
],
|
|
699
|
-
let
|
|
700
|
-
class
|
|
698
|
+
], Re.prototype, "endTime");
|
|
699
|
+
let Sr = Re;
|
|
700
|
+
class ve {
|
|
701
701
|
id;
|
|
702
702
|
code;
|
|
703
703
|
version;
|
|
@@ -712,20 +712,20 @@ class ye {
|
|
|
712
712
|
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.actions = e.actions || [];
|
|
713
713
|
}
|
|
714
714
|
}
|
|
715
|
-
|
|
715
|
+
A([
|
|
716
716
|
Q({
|
|
717
717
|
message: "archbase:Informe o nome"
|
|
718
718
|
})
|
|
719
|
-
],
|
|
720
|
-
|
|
719
|
+
], ve.prototype, "name");
|
|
720
|
+
A([
|
|
721
721
|
Q({
|
|
722
722
|
message: "archbase:Informe a descrição"
|
|
723
723
|
})
|
|
724
|
-
],
|
|
725
|
-
|
|
724
|
+
], ve.prototype, "description");
|
|
725
|
+
A([
|
|
726
726
|
Z()
|
|
727
|
-
],
|
|
728
|
-
const
|
|
727
|
+
], ve.prototype, "actions");
|
|
728
|
+
const we = class St {
|
|
729
729
|
id;
|
|
730
730
|
code;
|
|
731
731
|
version;
|
|
@@ -741,48 +741,48 @@ const ve = class xt {
|
|
|
741
741
|
actionVersion;
|
|
742
742
|
isNewAction;
|
|
743
743
|
constructor(e) {
|
|
744
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.resource = e.resource ? new
|
|
744
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.resource = e.resource ? new It(e.resource) : void 0, this.category = e.category || "", this.active = e.active || !1, this.actionVersion = e.actionVersion || "", this.isNewAction = e.isNewAction || !1;
|
|
745
745
|
}
|
|
746
|
-
static newInstance = () => new
|
|
746
|
+
static newInstance = () => new St({
|
|
747
747
|
id: ee(),
|
|
748
748
|
active: !0,
|
|
749
749
|
isNewAction: !0
|
|
750
750
|
});
|
|
751
751
|
};
|
|
752
|
-
|
|
752
|
+
A([
|
|
753
753
|
Q({
|
|
754
754
|
message: "archbase:Informe o nome para a ação"
|
|
755
755
|
})
|
|
756
|
-
],
|
|
757
|
-
|
|
756
|
+
], we.prototype, "name");
|
|
757
|
+
A([
|
|
758
758
|
Q({
|
|
759
759
|
message: "archbase:Informe a descrição para a ação"
|
|
760
760
|
})
|
|
761
|
-
],
|
|
762
|
-
|
|
761
|
+
], we.prototype, "description");
|
|
762
|
+
A([
|
|
763
763
|
Z()
|
|
764
|
-
],
|
|
765
|
-
|
|
764
|
+
], we.prototype, "resource");
|
|
765
|
+
A([
|
|
766
766
|
Q({
|
|
767
767
|
message: "archbase:Informe a categoria para a ação"
|
|
768
768
|
})
|
|
769
|
-
],
|
|
770
|
-
|
|
769
|
+
], we.prototype, "category");
|
|
770
|
+
A([
|
|
771
771
|
se()
|
|
772
|
-
],
|
|
773
|
-
let
|
|
774
|
-
class
|
|
772
|
+
], we.prototype, "active");
|
|
773
|
+
let kr = we;
|
|
774
|
+
class ke extends ve {
|
|
775
775
|
type;
|
|
776
776
|
isNewProfile;
|
|
777
777
|
constructor(e) {
|
|
778
|
-
super(e), this.type =
|
|
778
|
+
super(e), this.type = ge.PROFILE, this.isNewProfile = e.isNewProfile || !1;
|
|
779
779
|
}
|
|
780
|
-
static newInstance = () => new
|
|
780
|
+
static newInstance = () => new ke({
|
|
781
781
|
id: ee(),
|
|
782
782
|
isNewProfile: !0
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
class
|
|
785
|
+
class Ke {
|
|
786
786
|
id;
|
|
787
787
|
code;
|
|
788
788
|
version;
|
|
@@ -792,25 +792,25 @@ class Ge {
|
|
|
792
792
|
lastModifiedByUser;
|
|
793
793
|
group;
|
|
794
794
|
constructor(e) {
|
|
795
|
-
this.id = e.id, this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.group = e.group ? new
|
|
795
|
+
this.id = e.id, this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.group = e.group ? new Ie(e.group) : void 0;
|
|
796
796
|
}
|
|
797
|
-
static newInstance = (e) => new
|
|
797
|
+
static newInstance = (e) => new Ke({
|
|
798
798
|
id: ee(),
|
|
799
799
|
group: e
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
|
-
class
|
|
802
|
+
class Ie extends ve {
|
|
803
803
|
type;
|
|
804
804
|
isNewGroup;
|
|
805
805
|
constructor(e) {
|
|
806
|
-
super(e), this.type =
|
|
806
|
+
super(e), this.type = ge.GROUP, this.isNewGroup = e.isNewGroup || !1;
|
|
807
807
|
}
|
|
808
|
-
static newInstance = () => new
|
|
808
|
+
static newInstance = () => new Ie({
|
|
809
809
|
id: ee(),
|
|
810
810
|
isNewGroup: !0
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
const
|
|
813
|
+
const Me = class kt {
|
|
814
814
|
id;
|
|
815
815
|
code;
|
|
816
816
|
version;
|
|
@@ -827,28 +827,28 @@ const Re = class St {
|
|
|
827
827
|
constructor(e) {
|
|
828
828
|
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.name = e.name || "", this.description = e.description || "", this.actions = e.actions || [], this.active = e.active || !1, this.type = e.type || "VIEW", this.isNewResource = e.isNewResource || !1;
|
|
829
829
|
}
|
|
830
|
-
static newInstance = () => new
|
|
830
|
+
static newInstance = () => new kt({
|
|
831
831
|
id: ee(),
|
|
832
832
|
actions: [],
|
|
833
833
|
active: !0,
|
|
834
834
|
isNewResource: !0
|
|
835
835
|
});
|
|
836
836
|
};
|
|
837
|
-
|
|
837
|
+
A([
|
|
838
838
|
Q({
|
|
839
839
|
message: "archbase:Informe o nome para o recurso"
|
|
840
840
|
})
|
|
841
|
-
],
|
|
842
|
-
|
|
841
|
+
], Me.prototype, "name");
|
|
842
|
+
A([
|
|
843
843
|
Q({
|
|
844
844
|
message: "archbase:Informe a descrição para o recurso"
|
|
845
845
|
})
|
|
846
|
-
],
|
|
847
|
-
|
|
846
|
+
], Me.prototype, "description");
|
|
847
|
+
A([
|
|
848
848
|
se()
|
|
849
|
-
],
|
|
850
|
-
let
|
|
851
|
-
const O = class
|
|
849
|
+
], Me.prototype, "active");
|
|
850
|
+
let It = Me;
|
|
851
|
+
const O = class Ct extends ve {
|
|
852
852
|
userName;
|
|
853
853
|
password;
|
|
854
854
|
changePasswordOnNextLogin;
|
|
@@ -871,9 +871,9 @@ const O = class It extends ye {
|
|
|
871
871
|
employeeId;
|
|
872
872
|
externalId;
|
|
873
873
|
constructor(e) {
|
|
874
|
-
super(e), this.type =
|
|
874
|
+
super(e), this.type = ge.USER, this.userName = e.userName || "", this.password = e.password || "", this.changePasswordOnNextLogin = e.changePasswordOnNextLogin || !1, this.allowPasswordChange = e.allowPasswordChange || !1, this.allowMultipleLogins = e.allowMultipleLogins || !1, this.passwordNeverExpires = e.passwordNeverExpires || !1, this.passwordChangedAt = e.passwordChangedAt || void 0, this.accountDeactivated = e.accountDeactivated || !1, this.accountLocked = e.accountLocked || !1, this.unlimitedAccessHours = e.unlimitedAccessHours || !1, this.isAdministrator = e.isAdministrator || !1, this.accessSchedule = e.accessSchedule ? new Et(e.accessSchedule) : void 0, this.groups = e.groups ? e.groups.map((t) => new Ke(t)) : [], this.profile = e.profile ? new ke(e.profile) : void 0, this.email = e.email || "", this.avatar = e.avatar || void 0, this.isNewUser = e.isNewUser || !1, this.nickname = e.nickname, this.employeeId = e.employeeId || void 0, this.externalId = e.externalId || void 0;
|
|
875
875
|
}
|
|
876
|
-
static newInstance = () => new
|
|
876
|
+
static newInstance = () => new Ct({
|
|
877
877
|
id: ee(),
|
|
878
878
|
userName: "",
|
|
879
879
|
password: "",
|
|
@@ -885,63 +885,63 @@ const O = class It extends ye {
|
|
|
885
885
|
isNewUser: !0
|
|
886
886
|
});
|
|
887
887
|
};
|
|
888
|
-
|
|
888
|
+
A([
|
|
889
889
|
Q({
|
|
890
890
|
message: "archbase:Informe o nome de usuário"
|
|
891
891
|
})
|
|
892
892
|
], O.prototype, "userName");
|
|
893
|
-
|
|
893
|
+
A([
|
|
894
894
|
se()
|
|
895
895
|
], O.prototype, "changePasswordOnNextLogin");
|
|
896
|
-
|
|
896
|
+
A([
|
|
897
897
|
se()
|
|
898
898
|
], O.prototype, "allowPasswordChange");
|
|
899
|
-
|
|
899
|
+
A([
|
|
900
900
|
se()
|
|
901
901
|
], O.prototype, "allowMultipleLogins");
|
|
902
|
-
|
|
902
|
+
A([
|
|
903
903
|
se()
|
|
904
904
|
], O.prototype, "passwordNeverExpires");
|
|
905
|
-
|
|
905
|
+
A([
|
|
906
906
|
Z()
|
|
907
907
|
], O.prototype, "passwordChangedAt");
|
|
908
|
-
|
|
908
|
+
A([
|
|
909
909
|
se()
|
|
910
910
|
], O.prototype, "accountDeactivated");
|
|
911
|
-
|
|
911
|
+
A([
|
|
912
912
|
se()
|
|
913
913
|
], O.prototype, "accountLocked");
|
|
914
|
-
|
|
914
|
+
A([
|
|
915
915
|
se()
|
|
916
916
|
], O.prototype, "unlimitedAccessHours");
|
|
917
|
-
|
|
917
|
+
A([
|
|
918
918
|
se()
|
|
919
919
|
], O.prototype, "isAdministrator");
|
|
920
|
-
|
|
920
|
+
A([
|
|
921
921
|
Z()
|
|
922
922
|
], O.prototype, "accessSchedule");
|
|
923
|
-
|
|
923
|
+
A([
|
|
924
924
|
Z()
|
|
925
925
|
], O.prototype, "groups");
|
|
926
|
-
|
|
926
|
+
A([
|
|
927
927
|
Z()
|
|
928
928
|
], O.prototype, "profile");
|
|
929
|
-
|
|
930
|
-
|
|
929
|
+
A([
|
|
930
|
+
Ht(
|
|
931
931
|
{},
|
|
932
932
|
{
|
|
933
933
|
message: "archbase:Informe um email válido"
|
|
934
934
|
}
|
|
935
935
|
)
|
|
936
936
|
], O.prototype, "email");
|
|
937
|
-
|
|
937
|
+
A([
|
|
938
938
|
Z()
|
|
939
939
|
], O.prototype, "employeeId");
|
|
940
|
-
|
|
940
|
+
A([
|
|
941
941
|
Z()
|
|
942
942
|
], O.prototype, "externalId");
|
|
943
|
-
let
|
|
944
|
-
const
|
|
943
|
+
let Ne = O;
|
|
944
|
+
const qe = class He {
|
|
945
945
|
id;
|
|
946
946
|
code;
|
|
947
947
|
version;
|
|
@@ -955,35 +955,35 @@ const Je = class Fe {
|
|
|
955
955
|
companyId;
|
|
956
956
|
projectId;
|
|
957
957
|
constructor(e) {
|
|
958
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.security = e.security ?
|
|
958
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.security = e.security ? He.createDtoFromJson(e.security) : void 0, this.action = e.action ? new kr(e.action) : void 0, this.tenantId = e.tenantId || "", this.companyId = e.companyId || "", this.projectId = e.projectId || "";
|
|
959
959
|
}
|
|
960
960
|
static createDtoFromJson(e) {
|
|
961
961
|
switch (e.type) {
|
|
962
962
|
case "profile":
|
|
963
|
-
return new Se(e);
|
|
964
|
-
case "group":
|
|
965
963
|
return new ke(e);
|
|
964
|
+
case "group":
|
|
965
|
+
return new Ie(e);
|
|
966
966
|
case "user":
|
|
967
|
-
return new
|
|
967
|
+
return new Ne(e);
|
|
968
968
|
default:
|
|
969
969
|
throw new Error("Unknown DTO type");
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
|
-
static newInstance = () => new
|
|
972
|
+
static newInstance = () => new He({
|
|
973
973
|
id: ee(),
|
|
974
974
|
tenantId: "",
|
|
975
975
|
companyId: "",
|
|
976
976
|
projectId: ""
|
|
977
977
|
});
|
|
978
978
|
};
|
|
979
|
-
|
|
979
|
+
A([
|
|
980
980
|
Z()
|
|
981
|
-
],
|
|
982
|
-
|
|
981
|
+
], qe.prototype, "security");
|
|
982
|
+
A([
|
|
983
983
|
Z()
|
|
984
|
-
],
|
|
985
|
-
let
|
|
986
|
-
class
|
|
984
|
+
], qe.prototype, "action");
|
|
985
|
+
let qr = qe;
|
|
986
|
+
class Ye {
|
|
987
987
|
id;
|
|
988
988
|
code;
|
|
989
989
|
version;
|
|
@@ -1001,13 +1001,13 @@ class Ke {
|
|
|
1001
1001
|
activated;
|
|
1002
1002
|
isNovoToken;
|
|
1003
1003
|
constructor(e) {
|
|
1004
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.tenantId = e.tenantId || "", this.user = e.user ? new
|
|
1004
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || "", this.updateEntityDate = e.updateEntityDate || "", this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.tenantId = e.tenantId || "", this.user = e.user ? new Ne(e.user) : void 0, this.name = e.name || "", this.description = e.description || "", this.token = e.token || "", this.expirationDate = e.expirationDate, this.revoked = e.revoked, this.activated = e.activated || !1;
|
|
1005
1005
|
}
|
|
1006
|
-
static newInstance = () => new
|
|
1006
|
+
static newInstance = () => new Ye({
|
|
1007
1007
|
id: ee()
|
|
1008
1008
|
});
|
|
1009
1009
|
}
|
|
1010
|
-
class
|
|
1010
|
+
class Xe {
|
|
1011
1011
|
id;
|
|
1012
1012
|
code;
|
|
1013
1013
|
version;
|
|
@@ -1024,23 +1024,23 @@ class qe {
|
|
|
1024
1024
|
user;
|
|
1025
1025
|
isNewAccessToken;
|
|
1026
1026
|
constructor(e) {
|
|
1027
|
-
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.token = e.token || "", this.tokenType = e.tokenType || void 0, this.user = e.user ? new
|
|
1027
|
+
this.id = e.id || "", this.code = e.code || "", this.version = e.version || 0, this.createEntityDate = e.createEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.updateEntityDate = e.updateEntityDate || (/* @__PURE__ */ new Date()).toISOString(), this.createdByUser = e.createdByUser || "", this.lastModifiedByUser = e.lastModifiedByUser || "", this.token = e.token || "", this.tokenType = e.tokenType || void 0, this.user = e.user ? new Ne(e.user) : void 0, this.revoked = e.revoked || !1, this.expired = e.expired || !1, this.expirationTime = e.expirationTime || 0, this.expirationDate = e.expirationDate || "", this.isNewAccessToken = e.isNewAccessToken || !1;
|
|
1028
1028
|
}
|
|
1029
|
-
static newInstance = () => new
|
|
1029
|
+
static newInstance = () => new Xe({
|
|
1030
1030
|
id: ee(),
|
|
1031
1031
|
active: !0,
|
|
1032
1032
|
isNewAccessToken: !0
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
|
-
class
|
|
1035
|
+
class Pt extends ye {
|
|
1036
1036
|
constructor(e) {
|
|
1037
1037
|
super(e);
|
|
1038
1038
|
}
|
|
1039
1039
|
configureHeaders() {
|
|
1040
|
-
return
|
|
1040
|
+
return G.getInstance().getHeaders();
|
|
1041
1041
|
}
|
|
1042
1042
|
transform(e) {
|
|
1043
|
-
return new
|
|
1043
|
+
return new Ne(e);
|
|
1044
1044
|
}
|
|
1045
1045
|
getEndpoint() {
|
|
1046
1046
|
return "/api/v1/user";
|
|
@@ -1059,17 +1059,17 @@ class Ct extends ge {
|
|
|
1059
1059
|
return this.transform(t);
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
|
-
I.decorate(I.inject(
|
|
1063
|
-
I.decorate(I.injectable(),
|
|
1064
|
-
class
|
|
1062
|
+
I.decorate(I.inject(q.ApiClient), Pt, 0);
|
|
1063
|
+
I.decorate(I.injectable(), Pt);
|
|
1064
|
+
class Tt extends ye {
|
|
1065
1065
|
constructor(e) {
|
|
1066
1066
|
super(e);
|
|
1067
1067
|
}
|
|
1068
1068
|
configureHeaders() {
|
|
1069
|
-
return
|
|
1069
|
+
return G.getInstance().getHeaders();
|
|
1070
1070
|
}
|
|
1071
1071
|
transform(e) {
|
|
1072
|
-
return new
|
|
1072
|
+
return new Ie(e);
|
|
1073
1073
|
}
|
|
1074
1074
|
getEndpoint() {
|
|
1075
1075
|
return "/api/v1/group";
|
|
@@ -1081,17 +1081,17 @@ class Pt extends ge {
|
|
|
1081
1081
|
return e.isNewGroup;
|
|
1082
1082
|
}
|
|
1083
1083
|
}
|
|
1084
|
-
I.decorate(I.inject(
|
|
1085
|
-
I.decorate(I.injectable(),
|
|
1086
|
-
class
|
|
1084
|
+
I.decorate(I.inject(q.ApiClient), Tt, 0);
|
|
1085
|
+
I.decorate(I.injectable(), Tt);
|
|
1086
|
+
class Ut extends ye {
|
|
1087
1087
|
constructor(e) {
|
|
1088
1088
|
super(e);
|
|
1089
1089
|
}
|
|
1090
1090
|
configureHeaders() {
|
|
1091
|
-
return
|
|
1091
|
+
return G.getInstance().getHeaders();
|
|
1092
1092
|
}
|
|
1093
1093
|
transform(e) {
|
|
1094
|
-
return new
|
|
1094
|
+
return new ke(e);
|
|
1095
1095
|
}
|
|
1096
1096
|
getEndpoint() {
|
|
1097
1097
|
return "/api/v1/userProfile";
|
|
@@ -1103,17 +1103,17 @@ class Tt extends ge {
|
|
|
1103
1103
|
return e.isNewProfile;
|
|
1104
1104
|
}
|
|
1105
1105
|
}
|
|
1106
|
-
I.decorate(I.inject(
|
|
1107
|
-
I.decorate(I.injectable(),
|
|
1108
|
-
class
|
|
1106
|
+
I.decorate(I.inject(q.ApiClient), Ut, 0);
|
|
1107
|
+
I.decorate(I.injectable(), Ut);
|
|
1108
|
+
class Dt extends ye {
|
|
1109
1109
|
constructor(e) {
|
|
1110
1110
|
super(e);
|
|
1111
1111
|
}
|
|
1112
1112
|
configureHeaders() {
|
|
1113
|
-
return
|
|
1113
|
+
return G.getInstance().getHeaders();
|
|
1114
1114
|
}
|
|
1115
1115
|
transform(e) {
|
|
1116
|
-
return new
|
|
1116
|
+
return new Ye(e);
|
|
1117
1117
|
}
|
|
1118
1118
|
getEndpoint() {
|
|
1119
1119
|
return "/api/v1/apiToken";
|
|
@@ -1125,12 +1125,12 @@ class Ut extends ge {
|
|
|
1125
1125
|
return e.isNovoToken;
|
|
1126
1126
|
}
|
|
1127
1127
|
async create(e, t, s, n) {
|
|
1128
|
-
const
|
|
1128
|
+
const c = await this.client.post(
|
|
1129
1129
|
`${this.getEndpoint()}/create?email=${e}&expirationDate=${t}&name=${s}&description=${n}`,
|
|
1130
1130
|
void 0,
|
|
1131
1131
|
this.configureHeaders()
|
|
1132
1132
|
);
|
|
1133
|
-
return this.transform(
|
|
1133
|
+
return this.transform(c);
|
|
1134
1134
|
}
|
|
1135
1135
|
async revoke(e) {
|
|
1136
1136
|
await this.client.post(
|
|
@@ -1140,17 +1140,17 @@ class Ut extends ge {
|
|
|
1140
1140
|
);
|
|
1141
1141
|
}
|
|
1142
1142
|
}
|
|
1143
|
-
I.decorate(I.inject(
|
|
1144
|
-
I.decorate(I.injectable(),
|
|
1145
|
-
class
|
|
1143
|
+
I.decorate(I.inject(q.ApiClient), Dt, 0);
|
|
1144
|
+
I.decorate(I.injectable(), Dt);
|
|
1145
|
+
class _t extends ye {
|
|
1146
1146
|
constructor(e) {
|
|
1147
1147
|
super(e);
|
|
1148
1148
|
}
|
|
1149
1149
|
configureHeaders() {
|
|
1150
|
-
return
|
|
1150
|
+
return G.getInstance().getHeaders();
|
|
1151
1151
|
}
|
|
1152
1152
|
transform(e) {
|
|
1153
|
-
return new
|
|
1153
|
+
return new Xe(e);
|
|
1154
1154
|
}
|
|
1155
1155
|
getEndpoint() {
|
|
1156
1156
|
return "/api/v1/accessToken";
|
|
@@ -1169,17 +1169,17 @@ class Dt extends ge {
|
|
|
1169
1169
|
);
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
|
-
I.decorate(I.inject(
|
|
1173
|
-
I.decorate(I.injectable(),
|
|
1174
|
-
class
|
|
1172
|
+
I.decorate(I.inject(q.ApiClient), _t, 0);
|
|
1173
|
+
I.decorate(I.injectable(), _t);
|
|
1174
|
+
class Rt extends ye {
|
|
1175
1175
|
constructor(e) {
|
|
1176
1176
|
super(e);
|
|
1177
1177
|
}
|
|
1178
1178
|
configureHeaders() {
|
|
1179
|
-
return
|
|
1179
|
+
return G.getInstance().getHeaders();
|
|
1180
1180
|
}
|
|
1181
1181
|
transform(e) {
|
|
1182
|
-
return new
|
|
1182
|
+
return new It(e);
|
|
1183
1183
|
}
|
|
1184
1184
|
getEndpoint() {
|
|
1185
1185
|
return "/api/v1/resource";
|
|
@@ -1203,7 +1203,7 @@ class _t extends ge {
|
|
|
1203
1203
|
!1,
|
|
1204
1204
|
{
|
|
1205
1205
|
params: {
|
|
1206
|
-
type:
|
|
1206
|
+
type: et(ge, t)
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
1209
|
);
|
|
@@ -1214,7 +1214,7 @@ class _t extends ge {
|
|
|
1214
1214
|
{
|
|
1215
1215
|
securityId: e,
|
|
1216
1216
|
actionId: t,
|
|
1217
|
-
type:
|
|
1217
|
+
type: et(ge, s)
|
|
1218
1218
|
},
|
|
1219
1219
|
this.configureHeaders()
|
|
1220
1220
|
);
|
|
@@ -1233,15 +1233,15 @@ class _t extends ge {
|
|
|
1233
1233
|
);
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
I.decorate(I.inject(
|
|
1237
|
-
I.decorate(I.injectable(),
|
|
1238
|
-
class
|
|
1236
|
+
I.decorate(I.inject(q.ApiClient), Rt, 0);
|
|
1237
|
+
I.decorate(I.injectable(), Rt);
|
|
1238
|
+
class Mt {
|
|
1239
1239
|
client;
|
|
1240
1240
|
constructor(e) {
|
|
1241
1241
|
this.client = e;
|
|
1242
1242
|
}
|
|
1243
1243
|
configureHeaders() {
|
|
1244
|
-
return
|
|
1244
|
+
return G.getInstance().getHeaders();
|
|
1245
1245
|
}
|
|
1246
1246
|
getEndpoint() {
|
|
1247
1247
|
return "/api/v1/security/diagnostics";
|
|
@@ -1353,88 +1353,88 @@ class Rt {
|
|
|
1353
1353
|
);
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
|
-
I.decorate(I.inject(
|
|
1357
|
-
I.decorate(I.injectable(),
|
|
1358
|
-
function
|
|
1356
|
+
I.decorate(I.inject(q.ApiClient), Mt, 0);
|
|
1357
|
+
I.decorate(I.injectable(), Mt);
|
|
1358
|
+
function Yr({
|
|
1359
1359
|
onLogin: r,
|
|
1360
1360
|
error: e,
|
|
1361
1361
|
onClickForgotPassword: t,
|
|
1362
1362
|
loginLabel: s = "Email",
|
|
1363
1363
|
loginPlaceholder: n,
|
|
1364
|
-
afterInputs:
|
|
1365
|
-
showMockUsersSelector:
|
|
1364
|
+
afterInputs: c,
|
|
1365
|
+
showMockUsersSelector: l = !1,
|
|
1366
1366
|
mockUsers: i = [],
|
|
1367
1367
|
mockUsersGroupMap: d,
|
|
1368
|
-
options:
|
|
1368
|
+
options: g = {},
|
|
1369
1369
|
onChangeUsername: k,
|
|
1370
|
-
disabledLogin:
|
|
1371
|
-
isCheckingUsername:
|
|
1372
|
-
showSignIn:
|
|
1373
|
-
mfaRequired:
|
|
1374
|
-
onVerifyMfa:
|
|
1370
|
+
disabledLogin: u = !1,
|
|
1371
|
+
isCheckingUsername: T = !1,
|
|
1372
|
+
showSignIn: b = !0,
|
|
1373
|
+
mfaRequired: v = !1,
|
|
1374
|
+
onVerifyMfa: E,
|
|
1375
1375
|
mfaError: P,
|
|
1376
1376
|
onCancelMfa: M,
|
|
1377
1377
|
isVerifyingMfa: B = !1
|
|
1378
1378
|
}) {
|
|
1379
|
-
const
|
|
1380
|
-
username:
|
|
1381
|
-
password:
|
|
1382
|
-
rememberMe:
|
|
1383
|
-
clearRememberMe:
|
|
1384
|
-
} =
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
}, [e]),
|
|
1388
|
-
|
|
1389
|
-
}, [
|
|
1379
|
+
const F = ht(), {
|
|
1380
|
+
username: D,
|
|
1381
|
+
password: w,
|
|
1382
|
+
rememberMe: f,
|
|
1383
|
+
clearRememberMe: _
|
|
1384
|
+
} = Vt(), [H, L] = p(D), [N, X] = p(w), [U, te] = p(f), [ae, m] = p(!1), [y, J] = p(null), [V, be] = p("");
|
|
1385
|
+
Y(() => {
|
|
1386
|
+
m(!!e);
|
|
1387
|
+
}, [e]), Y(() => {
|
|
1388
|
+
D !== H && (L(D), k?.(D)), w !== N && X(w), f !== U && te(f);
|
|
1389
|
+
}, [D, w, f]);
|
|
1390
1390
|
const he = () => {
|
|
1391
|
-
|
|
1391
|
+
m(!1);
|
|
1392
1392
|
}, $ = () => {
|
|
1393
|
-
|
|
1393
|
+
H && N && r(H, N, U).finally(() => m(!0));
|
|
1394
1394
|
}, ce = () => {
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
},
|
|
1395
|
+
const a = V.trim();
|
|
1396
|
+
a && E && E(a);
|
|
1397
|
+
}, ne = () => {
|
|
1398
1398
|
if (!d)
|
|
1399
|
-
return i.map((
|
|
1400
|
-
value:
|
|
1401
|
-
label:
|
|
1399
|
+
return i.map((h) => ({
|
|
1400
|
+
value: h.email,
|
|
1401
|
+
label: h.email
|
|
1402
1402
|
}));
|
|
1403
|
-
const
|
|
1404
|
-
const
|
|
1405
|
-
return
|
|
1406
|
-
value:
|
|
1407
|
-
label:
|
|
1408
|
-
})),
|
|
1403
|
+
const a = i.reduce((h, x) => {
|
|
1404
|
+
const R = d[x.type];
|
|
1405
|
+
return R && (h[R] || (h[R] = []), h[R].push({
|
|
1406
|
+
value: x.email,
|
|
1407
|
+
label: x.email
|
|
1408
|
+
})), h;
|
|
1409
1409
|
}, {});
|
|
1410
|
-
return Object.entries(
|
|
1411
|
-
group:
|
|
1412
|
-
items:
|
|
1410
|
+
return Object.entries(a).map(([h, x]) => ({
|
|
1411
|
+
group: h,
|
|
1412
|
+
items: x
|
|
1413
1413
|
}));
|
|
1414
|
-
},
|
|
1415
|
-
if (
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1414
|
+
}, Ae = () => {
|
|
1415
|
+
if (y) {
|
|
1416
|
+
const a = i.find((h) => h.email === y);
|
|
1417
|
+
a && (L(a.email), X(a.password), he());
|
|
1418
1418
|
}
|
|
1419
|
-
},
|
|
1419
|
+
}, pe = {
|
|
1420
1420
|
withBorder: !0,
|
|
1421
1421
|
shadow: "md",
|
|
1422
1422
|
p: 30,
|
|
1423
1423
|
mt: 30,
|
|
1424
1424
|
radius: "md",
|
|
1425
1425
|
w: 400,
|
|
1426
|
-
...
|
|
1426
|
+
...g.cardProps
|
|
1427
1427
|
};
|
|
1428
1428
|
return /* @__PURE__ */ C(
|
|
1429
|
-
|
|
1429
|
+
Je,
|
|
1430
1430
|
{
|
|
1431
|
-
...
|
|
1431
|
+
...pe,
|
|
1432
1432
|
pos: "relative",
|
|
1433
|
-
ref:
|
|
1433
|
+
ref: F,
|
|
1434
1434
|
children: [
|
|
1435
|
-
|
|
1435
|
+
b && /* @__PURE__ */ C(ie, { children: [
|
|
1436
1436
|
/* @__PURE__ */ o(
|
|
1437
|
-
|
|
1437
|
+
j,
|
|
1438
1438
|
{
|
|
1439
1439
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1440
1440
|
fw: 800,
|
|
@@ -1444,43 +1444,43 @@ function qr({
|
|
|
1444
1444
|
children: S().t("archbase:signIn")
|
|
1445
1445
|
}
|
|
1446
1446
|
),
|
|
1447
|
-
/* @__PURE__ */ o(
|
|
1447
|
+
/* @__PURE__ */ o(De, { m: "md" })
|
|
1448
1448
|
] }),
|
|
1449
|
-
|
|
1450
|
-
|
|
1449
|
+
g?.customContentBefore,
|
|
1450
|
+
v && /* @__PURE__ */ C(xe, { gap: "md", children: [
|
|
1451
1451
|
/* @__PURE__ */ C("div", { children: [
|
|
1452
|
-
/* @__PURE__ */ o(
|
|
1453
|
-
/* @__PURE__ */ o(
|
|
1452
|
+
/* @__PURE__ */ o(j, { fw: 700, fz: "lg", children: S().t("archbase:mfa.title", "Verificação em duas etapas") }),
|
|
1453
|
+
/* @__PURE__ */ o(j, { c: "dimmed", fz: "sm", children: S().t(
|
|
1454
1454
|
"archbase:mfa.subtitle",
|
|
1455
1455
|
"Digite o código do seu aplicativo autenticador (ou um código de recuperação)."
|
|
1456
1456
|
) })
|
|
1457
1457
|
] }),
|
|
1458
1458
|
/* @__PURE__ */ o(
|
|
1459
|
-
|
|
1459
|
+
Se,
|
|
1460
1460
|
{
|
|
1461
1461
|
label: S().t("archbase:mfa.code", "Código de verificação"),
|
|
1462
1462
|
placeholder: "000000",
|
|
1463
|
-
value:
|
|
1463
|
+
value: V,
|
|
1464
1464
|
autoFocus: !0,
|
|
1465
|
-
onChange: (
|
|
1466
|
-
onKeyDown: (
|
|
1467
|
-
|
|
1465
|
+
onChange: (a) => be(a.currentTarget.value),
|
|
1466
|
+
onKeyDown: (a) => {
|
|
1467
|
+
a.key === "Enter" && ce();
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
1470
|
),
|
|
1471
|
-
P && /* @__PURE__ */ o(
|
|
1471
|
+
P && /* @__PURE__ */ o(j, { c: "red", fz: "sm", children: P }),
|
|
1472
1472
|
/* @__PURE__ */ o(
|
|
1473
|
-
|
|
1473
|
+
W,
|
|
1474
1474
|
{
|
|
1475
1475
|
fullWidth: !0,
|
|
1476
|
-
disabled: !
|
|
1476
|
+
disabled: !V.trim() || B,
|
|
1477
1477
|
loading: B,
|
|
1478
1478
|
onClick: ce,
|
|
1479
1479
|
children: S().t("archbase:mfa.verify", "Verificar")
|
|
1480
1480
|
}
|
|
1481
1481
|
),
|
|
1482
1482
|
M && /* @__PURE__ */ o(
|
|
1483
|
-
|
|
1483
|
+
rt,
|
|
1484
1484
|
{
|
|
1485
1485
|
component: "button",
|
|
1486
1486
|
c: "var(--mantine-text-color)",
|
|
@@ -1492,55 +1492,55 @@ function qr({
|
|
|
1492
1492
|
}
|
|
1493
1493
|
)
|
|
1494
1494
|
] }),
|
|
1495
|
-
!
|
|
1496
|
-
|
|
1495
|
+
!v && /* @__PURE__ */ C(ie, { children: [
|
|
1496
|
+
l && /* @__PURE__ */ C(ie, { children: [
|
|
1497
1497
|
/* @__PURE__ */ C(ue, { gap: "sm", mb: "md", children: [
|
|
1498
1498
|
/* @__PURE__ */ o(
|
|
1499
|
-
|
|
1499
|
+
Xt,
|
|
1500
1500
|
{
|
|
1501
1501
|
placeholder: "Selecione um usuário mock",
|
|
1502
|
-
data:
|
|
1503
|
-
value:
|
|
1504
|
-
onChange: (
|
|
1502
|
+
data: ne(),
|
|
1503
|
+
value: y,
|
|
1504
|
+
onChange: (a) => J(a ?? ""),
|
|
1505
1505
|
searchable: !0,
|
|
1506
1506
|
clearable: !0,
|
|
1507
1507
|
style: { flexGrow: 1 }
|
|
1508
1508
|
}
|
|
1509
1509
|
),
|
|
1510
|
-
/* @__PURE__ */ o(
|
|
1511
|
-
|
|
1510
|
+
/* @__PURE__ */ o(Qt, { label: "Aplicar", children: /* @__PURE__ */ o(
|
|
1511
|
+
W,
|
|
1512
1512
|
{
|
|
1513
1513
|
variant: "light",
|
|
1514
1514
|
size: "sm",
|
|
1515
|
-
onClick:
|
|
1516
|
-
disabled: !
|
|
1515
|
+
onClick: Ae,
|
|
1516
|
+
disabled: !y,
|
|
1517
1517
|
"aria-label": "Aplicar usuário mock selecionado",
|
|
1518
|
-
children: /* @__PURE__ */ o(
|
|
1518
|
+
children: /* @__PURE__ */ o(sr, { size: 16 })
|
|
1519
1519
|
}
|
|
1520
1520
|
) })
|
|
1521
1521
|
] }),
|
|
1522
|
-
/* @__PURE__ */ o(
|
|
1522
|
+
/* @__PURE__ */ o(De, { mb: "md" })
|
|
1523
1523
|
] }),
|
|
1524
1524
|
/* @__PURE__ */ o(
|
|
1525
|
-
|
|
1525
|
+
Se,
|
|
1526
1526
|
{
|
|
1527
1527
|
label: s,
|
|
1528
1528
|
placeholder: n ?? S().t("archbase:usuario@email.com"),
|
|
1529
|
-
rightSection:
|
|
1530
|
-
value:
|
|
1529
|
+
rightSection: T ? /* @__PURE__ */ o(ut, { size: "xs" }) : null,
|
|
1530
|
+
value: H || "",
|
|
1531
1531
|
required: !0,
|
|
1532
|
-
onChange: (
|
|
1533
|
-
L(
|
|
1532
|
+
onChange: (a) => {
|
|
1533
|
+
L(a.currentTarget.value), k?.(a.currentTarget.value), he();
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
),
|
|
1537
1537
|
/* @__PURE__ */ o(
|
|
1538
|
-
|
|
1538
|
+
je,
|
|
1539
1539
|
{
|
|
1540
1540
|
label: S().t("archbase:Password"),
|
|
1541
1541
|
placeholder: S().t("archbase:Sua senha"),
|
|
1542
|
-
onChange: (
|
|
1543
|
-
|
|
1542
|
+
onChange: (a) => {
|
|
1543
|
+
X(a.currentTarget.value), he();
|
|
1544
1544
|
},
|
|
1545
1545
|
value: N || "",
|
|
1546
1546
|
required: !0,
|
|
@@ -1549,18 +1549,18 @@ function qr({
|
|
|
1549
1549
|
),
|
|
1550
1550
|
/* @__PURE__ */ C(ue, { justify: "space-between", mt: "md", children: [
|
|
1551
1551
|
/* @__PURE__ */ o(
|
|
1552
|
-
|
|
1552
|
+
Zt,
|
|
1553
1553
|
{
|
|
1554
1554
|
label: S().t("archbase:Lembre-me"),
|
|
1555
|
-
checked:
|
|
1556
|
-
onChange: (
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1555
|
+
checked: U,
|
|
1556
|
+
onChange: (a) => {
|
|
1557
|
+
const h = a.currentTarget.checked;
|
|
1558
|
+
te(h), h || _();
|
|
1559
1559
|
}
|
|
1560
1560
|
}
|
|
1561
1561
|
),
|
|
1562
1562
|
t && /* @__PURE__ */ o(
|
|
1563
|
-
|
|
1563
|
+
rt,
|
|
1564
1564
|
{
|
|
1565
1565
|
component: "button",
|
|
1566
1566
|
c: "var(--mantine-text-color)",
|
|
@@ -1572,11 +1572,11 @@ function qr({
|
|
|
1572
1572
|
}
|
|
1573
1573
|
)
|
|
1574
1574
|
] }),
|
|
1575
|
-
|
|
1575
|
+
g?.afterInputs || c,
|
|
1576
1576
|
/* @__PURE__ */ o(
|
|
1577
|
-
|
|
1577
|
+
W,
|
|
1578
1578
|
{
|
|
1579
|
-
disabled: !N || !
|
|
1579
|
+
disabled: !N || !H || u,
|
|
1580
1580
|
fullWidth: !0,
|
|
1581
1581
|
mt: "xl",
|
|
1582
1582
|
onClick: $,
|
|
@@ -1584,156 +1584,156 @@ function qr({
|
|
|
1584
1584
|
}
|
|
1585
1585
|
)
|
|
1586
1586
|
] }),
|
|
1587
|
-
|
|
1588
|
-
|
|
1587
|
+
g?.customContentAfter,
|
|
1588
|
+
ae && e && /* @__PURE__ */ o(j, { c: "red", mt: "sm", children: e })
|
|
1589
1589
|
]
|
|
1590
1590
|
}
|
|
1591
1591
|
);
|
|
1592
1592
|
}
|
|
1593
1593
|
const z = (r, e) => S().t(r, e);
|
|
1594
|
-
function
|
|
1594
|
+
function Xr({
|
|
1595
1595
|
enabled: r,
|
|
1596
1596
|
onSetup: e,
|
|
1597
1597
|
onEnable: t,
|
|
1598
1598
|
onDisable: s,
|
|
1599
1599
|
onStatusChange: n
|
|
1600
1600
|
}) {
|
|
1601
|
-
const [
|
|
1602
|
-
|
|
1601
|
+
const [c, l] = p("idle"), [i, d] = p(null), [g, k] = p(""), [u, T] = p([]), [b, v] = p(!1), [E, P] = p(null), M = async () => {
|
|
1602
|
+
v(!0), P(null);
|
|
1603
1603
|
try {
|
|
1604
|
-
const
|
|
1605
|
-
d(
|
|
1606
|
-
} catch (
|
|
1607
|
-
P(
|
|
1604
|
+
const w = await e();
|
|
1605
|
+
d(w), k(""), l("setup");
|
|
1606
|
+
} catch (w) {
|
|
1607
|
+
P(w?.message || String(w));
|
|
1608
1608
|
} finally {
|
|
1609
|
-
|
|
1609
|
+
v(!1);
|
|
1610
1610
|
}
|
|
1611
1611
|
}, B = async () => {
|
|
1612
|
-
const
|
|
1613
|
-
if (
|
|
1614
|
-
|
|
1612
|
+
const w = g.trim();
|
|
1613
|
+
if (w) {
|
|
1614
|
+
v(!0), P(null);
|
|
1615
1615
|
try {
|
|
1616
|
-
const
|
|
1617
|
-
|
|
1618
|
-
} catch (
|
|
1619
|
-
P(
|
|
1616
|
+
const f = await t(w);
|
|
1617
|
+
T(f), l("recovery"), n?.(!0);
|
|
1618
|
+
} catch (f) {
|
|
1619
|
+
P(f?.message || String(f));
|
|
1620
1620
|
} finally {
|
|
1621
|
-
|
|
1621
|
+
v(!1);
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
|
-
},
|
|
1625
|
-
|
|
1624
|
+
}, F = async () => {
|
|
1625
|
+
v(!0), P(null);
|
|
1626
1626
|
try {
|
|
1627
|
-
await s(), d(null),
|
|
1628
|
-
} catch (
|
|
1629
|
-
P(
|
|
1627
|
+
await s(), d(null), T([]), l("idle"), n?.(!1);
|
|
1628
|
+
} catch (w) {
|
|
1629
|
+
P(w?.message || String(w));
|
|
1630
1630
|
} finally {
|
|
1631
|
-
|
|
1631
|
+
v(!1);
|
|
1632
1632
|
}
|
|
1633
|
-
},
|
|
1634
|
-
|
|
1633
|
+
}, D = () => {
|
|
1634
|
+
T([]), d(null), k(""), l("idle");
|
|
1635
1635
|
};
|
|
1636
|
-
return /* @__PURE__ */ o(
|
|
1636
|
+
return /* @__PURE__ */ o(Je, { withBorder: !0, radius: "md", p: "lg", children: /* @__PURE__ */ C(xe, { gap: "md", children: [
|
|
1637
1637
|
/* @__PURE__ */ C("div", { children: [
|
|
1638
|
-
/* @__PURE__ */ o(
|
|
1639
|
-
/* @__PURE__ */ o(
|
|
1638
|
+
/* @__PURE__ */ o(j, { fw: 700, fz: "lg", children: z("archbase:mfa.setup.title", "Autenticação em duas etapas (MFA)") }),
|
|
1639
|
+
/* @__PURE__ */ o(j, { c: "dimmed", fz: "sm", children: z(
|
|
1640
1640
|
"archbase:mfa.setup.subtitle",
|
|
1641
1641
|
"Proteja o acesso exigindo um código do seu aplicativo autenticador no login."
|
|
1642
1642
|
) })
|
|
1643
1643
|
] }),
|
|
1644
|
-
|
|
1645
|
-
r &&
|
|
1646
|
-
/* @__PURE__ */ o(
|
|
1647
|
-
/* @__PURE__ */ o(
|
|
1644
|
+
E && /* @__PURE__ */ o(st, { color: "red", children: E }),
|
|
1645
|
+
r && c === "idle" && /* @__PURE__ */ C(ue, { justify: "space-between", children: [
|
|
1646
|
+
/* @__PURE__ */ o(j, { c: "teal", fw: 600, children: z("archbase:mfa.setup.active", "MFA ativo") }),
|
|
1647
|
+
/* @__PURE__ */ o(W, { color: "red", variant: "light", loading: b, onClick: F, children: z("archbase:mfa.setup.disable", "Desativar") })
|
|
1648
1648
|
] }),
|
|
1649
|
-
!r &&
|
|
1650
|
-
|
|
1651
|
-
/* @__PURE__ */ o(
|
|
1649
|
+
!r && c === "idle" && /* @__PURE__ */ o(W, { loading: b, onClick: M, children: z("archbase:mfa.setup.enable", "Ativar MFA") }),
|
|
1650
|
+
c === "setup" && i && /* @__PURE__ */ C(xe, { gap: "sm", align: "center", children: [
|
|
1651
|
+
/* @__PURE__ */ o(j, { fz: "sm", ta: "center", children: z(
|
|
1652
1652
|
"archbase:mfa.setup.scan",
|
|
1653
1653
|
"Escaneie o QR Code no seu app autenticador (Google Authenticator, Authy…):"
|
|
1654
1654
|
) }),
|
|
1655
|
-
/* @__PURE__ */ o(
|
|
1656
|
-
/* @__PURE__ */ o(
|
|
1655
|
+
/* @__PURE__ */ o(nr, { value: i.provisioningUri, size: 180, level: "M" }),
|
|
1656
|
+
/* @__PURE__ */ o(j, { fz: "xs", c: "dimmed", ta: "center", children: z("archbase:mfa.setup.manual", "Ou informe o código manualmente:") }),
|
|
1657
1657
|
/* @__PURE__ */ C(ue, { gap: "xs", children: [
|
|
1658
|
-
/* @__PURE__ */ o(
|
|
1659
|
-
/* @__PURE__ */ o(
|
|
1658
|
+
/* @__PURE__ */ o(nt, { children: i.secret }),
|
|
1659
|
+
/* @__PURE__ */ o(ot, { value: i.secret, children: ({ copied: w, copy: f }) => /* @__PURE__ */ o(W, { size: "xs", variant: "subtle", onClick: f, children: w ? z("archbase:mfa.setup.copied", "Copiado") : z("archbase:mfa.setup.copy", "Copiar") }) })
|
|
1660
1660
|
] }),
|
|
1661
1661
|
/* @__PURE__ */ o(
|
|
1662
|
-
|
|
1662
|
+
Se,
|
|
1663
1663
|
{
|
|
1664
1664
|
w: "100%",
|
|
1665
1665
|
label: z("archbase:mfa.setup.confirmCode", "Digite o código gerado para confirmar"),
|
|
1666
1666
|
placeholder: "000000",
|
|
1667
|
-
value:
|
|
1668
|
-
onChange: (
|
|
1669
|
-
onKeyDown: (
|
|
1670
|
-
|
|
1667
|
+
value: g,
|
|
1668
|
+
onChange: (w) => k(w.currentTarget.value),
|
|
1669
|
+
onKeyDown: (w) => {
|
|
1670
|
+
w.key === "Enter" && B();
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
1673
|
),
|
|
1674
1674
|
/* @__PURE__ */ C(ue, { w: "100%", justify: "flex-end", children: [
|
|
1675
|
-
/* @__PURE__ */ o(
|
|
1676
|
-
/* @__PURE__ */ o(
|
|
1675
|
+
/* @__PURE__ */ o(W, { variant: "default", onClick: D, disabled: b, children: z("archbase:mfa.setup.cancel", "Cancelar") }),
|
|
1676
|
+
/* @__PURE__ */ o(W, { onClick: B, loading: b, disabled: !g.trim(), children: z("archbase:mfa.setup.confirm", "Confirmar e ativar") })
|
|
1677
1677
|
] })
|
|
1678
1678
|
] }),
|
|
1679
|
-
|
|
1680
|
-
/* @__PURE__ */ o(
|
|
1679
|
+
c === "recovery" && /* @__PURE__ */ C(xe, { gap: "sm", children: [
|
|
1680
|
+
/* @__PURE__ */ o(st, { color: "yellow", children: z(
|
|
1681
1681
|
"archbase:mfa.setup.recoveryWarning",
|
|
1682
1682
|
"Guarde estes códigos de recuperação em local seguro. Cada um funciona uma única vez e permite entrar se você perder o acesso ao app autenticador. Eles não serão exibidos novamente."
|
|
1683
1683
|
) }),
|
|
1684
|
-
/* @__PURE__ */ o(
|
|
1684
|
+
/* @__PURE__ */ o(er, { cols: 2, spacing: "xs", children: u.map((w) => /* @__PURE__ */ o(nt, { fz: "sm", children: w }, w)) }),
|
|
1685
1685
|
/* @__PURE__ */ C(ue, { justify: "space-between", children: [
|
|
1686
|
-
/* @__PURE__ */ o(
|
|
1687
|
-
`), children: ({ copied:
|
|
1688
|
-
/* @__PURE__ */ o(
|
|
1686
|
+
/* @__PURE__ */ o(ot, { value: u.join(`
|
|
1687
|
+
`), children: ({ copied: w, copy: f }) => /* @__PURE__ */ o(W, { variant: "subtle", onClick: f, children: w ? z("archbase:mfa.setup.copied", "Copiado") : z("archbase:mfa.setup.copyAll", "Copiar todos") }) }),
|
|
1688
|
+
/* @__PURE__ */ o(W, { onClick: D, children: z("archbase:mfa.setup.done", "Guardei os códigos") })
|
|
1689
1689
|
] })
|
|
1690
1690
|
] })
|
|
1691
1691
|
] }) });
|
|
1692
1692
|
}
|
|
1693
|
-
const
|
|
1693
|
+
const Ir = {
|
|
1694
1694
|
position: "relative",
|
|
1695
1695
|
width: "90%",
|
|
1696
1696
|
maxWidth: 400,
|
|
1697
1697
|
padding: 30,
|
|
1698
1698
|
marginTop: 30
|
|
1699
1699
|
};
|
|
1700
|
-
function
|
|
1701
|
-
const
|
|
1702
|
-
async function
|
|
1703
|
-
$ && (
|
|
1704
|
-
|
|
1700
|
+
function Qr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClickBackToLogin: s, validatePassword: n, validateToken: c, initialEmail: l = "", description: i, style: d, passwordPolicy: g, showPasswordRequirements: k = !0 }) {
|
|
1701
|
+
const u = ht(), T = Wt(), { colorScheme: b } = tr(), [v, E] = p(r ?? ""), [P, M] = p(l), [B, F] = p(""), [D, w] = p(""), [f, _] = p(""), [H, L] = p(!1), [N, X] = p(""), [U, te] = p(""), [ae, m] = p(""), [y, J] = p(""), V = Gt(g);
|
|
1702
|
+
async function be($) {
|
|
1703
|
+
$ && (Jt($) ? await e($).then(() => {
|
|
1704
|
+
it.showSuccess(`${S().t("archbase:Um e-mail com instruções para redefinir sua senha foi enviado. Verifique sua caixa de entrada.")}`), L(!0);
|
|
1705
1705
|
}).catch(() => {
|
|
1706
|
-
}) :
|
|
1706
|
+
}) : X(`${S().t("archbase:Email inválido")}`));
|
|
1707
1707
|
}
|
|
1708
|
-
async function he($, ce,
|
|
1709
|
-
if ($ && ce &&
|
|
1710
|
-
let
|
|
1711
|
-
|
|
1712
|
-
|
|
1708
|
+
async function he($, ce, ne, Ae) {
|
|
1709
|
+
if ($ && ce && ne) {
|
|
1710
|
+
let pe = "", a = "", h = "";
|
|
1711
|
+
c && (pe = c(ce), te(pe)), V && (a = Kt(ne, V).error ?? ""), !a && n && (a = n(ne)), m(a), ne !== Ae && (h = `${S().t("archbase:A nova senha e a confirmação devem ser iguais.")}`, J(h)), !a && !pe && !h && await t($, ce, ne).then(() => {
|
|
1712
|
+
it.showSuccess(`${S().t("archbase:Senha redefinida com sucesso.")}`), s(), L(!1);
|
|
1713
1713
|
}).catch(() => {
|
|
1714
|
-
|
|
1714
|
+
E(r || `${S().t("archbase:Erro ao redefinir senha.")}`);
|
|
1715
1715
|
});
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
|
-
return
|
|
1719
|
-
r &&
|
|
1720
|
-
}, [r]),
|
|
1721
|
-
|
|
1722
|
-
}, [P, B,
|
|
1723
|
-
|
|
1718
|
+
return Y(() => {
|
|
1719
|
+
r && E(r);
|
|
1720
|
+
}, [r]), Y(() => {
|
|
1721
|
+
E("");
|
|
1722
|
+
}, [P, B, D, f]), /* @__PURE__ */ C(
|
|
1723
|
+
Je,
|
|
1724
1724
|
{
|
|
1725
1725
|
withBorder: !0,
|
|
1726
1726
|
shadow: "md",
|
|
1727
1727
|
radius: "md",
|
|
1728
|
-
ref:
|
|
1728
|
+
ref: u,
|
|
1729
1729
|
style: {
|
|
1730
|
-
...
|
|
1730
|
+
...Ir,
|
|
1731
1731
|
...d
|
|
1732
1732
|
},
|
|
1733
1733
|
children: [
|
|
1734
|
-
|
|
1734
|
+
H ? /* @__PURE__ */ C(ie, { children: [
|
|
1735
1735
|
/* @__PURE__ */ o(
|
|
1736
|
-
|
|
1736
|
+
j,
|
|
1737
1737
|
{
|
|
1738
1738
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1739
1739
|
fw: 800,
|
|
@@ -1743,79 +1743,79 @@ function Xr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClick
|
|
|
1743
1743
|
children: S().t("archbase:Redefinir senha")
|
|
1744
1744
|
}
|
|
1745
1745
|
),
|
|
1746
|
-
/* @__PURE__ */ o(
|
|
1746
|
+
/* @__PURE__ */ o(De, { m: "xs" }),
|
|
1747
1747
|
/* @__PURE__ */ o(
|
|
1748
|
-
|
|
1748
|
+
Se,
|
|
1749
1749
|
{
|
|
1750
1750
|
label: S().t("archbase:Código de segurança"),
|
|
1751
1751
|
placeholder: `${S().t("archbase:Código enviado no seu e-mail")}`,
|
|
1752
1752
|
value: B || "",
|
|
1753
1753
|
required: !0,
|
|
1754
1754
|
onChange: ($) => {
|
|
1755
|
-
|
|
1755
|
+
F($.currentTarget.value), te("");
|
|
1756
1756
|
},
|
|
1757
|
-
error:
|
|
1757
|
+
error: U
|
|
1758
1758
|
}
|
|
1759
1759
|
),
|
|
1760
1760
|
/* @__PURE__ */ o(
|
|
1761
|
-
|
|
1761
|
+
je,
|
|
1762
1762
|
{
|
|
1763
1763
|
label: S().t("archbase:Nova senha"),
|
|
1764
1764
|
placeholder: S().t("archbase:Nova senha"),
|
|
1765
1765
|
onChange: ($) => {
|
|
1766
|
-
|
|
1766
|
+
w($.currentTarget.value), m(""), J("");
|
|
1767
1767
|
},
|
|
1768
|
-
value:
|
|
1768
|
+
value: D,
|
|
1769
1769
|
required: !0,
|
|
1770
|
-
error:
|
|
1770
|
+
error: ae
|
|
1771
1771
|
}
|
|
1772
1772
|
),
|
|
1773
|
-
|
|
1774
|
-
|
|
1773
|
+
V && /* @__PURE__ */ o(
|
|
1774
|
+
or,
|
|
1775
1775
|
{
|
|
1776
|
-
value:
|
|
1777
|
-
policy:
|
|
1776
|
+
value: D,
|
|
1777
|
+
policy: V,
|
|
1778
1778
|
showRequirements: k
|
|
1779
1779
|
}
|
|
1780
1780
|
),
|
|
1781
1781
|
/* @__PURE__ */ o(
|
|
1782
|
-
|
|
1782
|
+
je,
|
|
1783
1783
|
{
|
|
1784
1784
|
label: S().t("archbase:Confirmar senha"),
|
|
1785
1785
|
placeholder: S().t("archbase:Confirmar senha"),
|
|
1786
1786
|
onChange: ($) => {
|
|
1787
|
-
|
|
1787
|
+
_($.currentTarget.value), J("");
|
|
1788
1788
|
},
|
|
1789
|
-
value:
|
|
1789
|
+
value: f || "",
|
|
1790
1790
|
required: !0,
|
|
1791
|
-
error:
|
|
1791
|
+
error: y
|
|
1792
1792
|
}
|
|
1793
1793
|
),
|
|
1794
1794
|
/* @__PURE__ */ o(
|
|
1795
|
-
|
|
1795
|
+
W,
|
|
1796
1796
|
{
|
|
1797
|
-
disabled: !P || !B || !
|
|
1797
|
+
disabled: !P || !B || !D || !f,
|
|
1798
1798
|
mt: "md",
|
|
1799
1799
|
fullWidth: !0,
|
|
1800
|
-
onClick: () => he(P, B,
|
|
1800
|
+
onClick: () => he(P, B, D, f),
|
|
1801
1801
|
children: `${S().t("archbase:Redefinir senha")}`
|
|
1802
1802
|
}
|
|
1803
1803
|
),
|
|
1804
1804
|
/* @__PURE__ */ o(
|
|
1805
|
-
|
|
1805
|
+
W,
|
|
1806
1806
|
{
|
|
1807
1807
|
mt: "6px",
|
|
1808
1808
|
fullWidth: !0,
|
|
1809
|
-
color:
|
|
1809
|
+
color: b === "dark" ? T.colors.dark[4] : T.colors.gray[7],
|
|
1810
1810
|
onClick: () => {
|
|
1811
1811
|
N || L(!1);
|
|
1812
1812
|
},
|
|
1813
1813
|
children: `${S().t("archbase:Voltar")}`
|
|
1814
1814
|
}
|
|
1815
1815
|
)
|
|
1816
|
-
] }) : /* @__PURE__ */ C(
|
|
1816
|
+
] }) : /* @__PURE__ */ C(ie, { children: [
|
|
1817
1817
|
/* @__PURE__ */ o(
|
|
1818
|
-
|
|
1818
|
+
j,
|
|
1819
1819
|
{
|
|
1820
1820
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1821
1821
|
fw: 800,
|
|
@@ -1825,261 +1825,265 @@ function Xr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClick
|
|
|
1825
1825
|
children: S().t("archbase:Redefinir senha")
|
|
1826
1826
|
}
|
|
1827
1827
|
),
|
|
1828
|
-
/* @__PURE__ */ o(
|
|
1829
|
-
/* @__PURE__ */ o(
|
|
1828
|
+
/* @__PURE__ */ o(j, { c: "dimmed", fz: 14, style: { textAlign: "justify" }, children: i }),
|
|
1829
|
+
/* @__PURE__ */ o(De, { m: "md" }),
|
|
1830
1830
|
/* @__PURE__ */ o(
|
|
1831
|
-
|
|
1831
|
+
Se,
|
|
1832
1832
|
{
|
|
1833
1833
|
label: "Email",
|
|
1834
1834
|
placeholder: `${S().t("archbase:usuario@email.com")}`,
|
|
1835
1835
|
value: P || "",
|
|
1836
1836
|
required: !0,
|
|
1837
1837
|
onChange: ($) => {
|
|
1838
|
-
M($.currentTarget.value),
|
|
1838
|
+
M($.currentTarget.value), X("");
|
|
1839
1839
|
},
|
|
1840
1840
|
error: N
|
|
1841
1841
|
}
|
|
1842
1842
|
),
|
|
1843
1843
|
/* @__PURE__ */ o(
|
|
1844
|
-
|
|
1844
|
+
W,
|
|
1845
1845
|
{
|
|
1846
1846
|
disabled: !P,
|
|
1847
1847
|
mt: "md",
|
|
1848
1848
|
fullWidth: !0,
|
|
1849
|
-
onClick: () =>
|
|
1849
|
+
onClick: () => be(P),
|
|
1850
1850
|
children: `${S().t("archbase:Enviar")}`
|
|
1851
1851
|
}
|
|
1852
1852
|
),
|
|
1853
1853
|
/* @__PURE__ */ o(
|
|
1854
|
-
|
|
1854
|
+
W,
|
|
1855
1855
|
{
|
|
1856
1856
|
mt: "6px",
|
|
1857
1857
|
fullWidth: !0,
|
|
1858
|
-
color:
|
|
1858
|
+
color: b === "dark" ? T.colors.dark[4] : T.colors.gray[7],
|
|
1859
1859
|
onClick: () => s && s(),
|
|
1860
1860
|
children: `${S().t("archbase:Voltar")}`
|
|
1861
1861
|
}
|
|
1862
1862
|
)
|
|
1863
1863
|
] }),
|
|
1864
|
-
|
|
1864
|
+
v ? /* @__PURE__ */ o(j, { c: "red", style: { textAlign: "justify" }, children: v }) : null
|
|
1865
1865
|
]
|
|
1866
1866
|
}
|
|
1867
1867
|
);
|
|
1868
1868
|
}
|
|
1869
|
-
const
|
|
1870
|
-
const s =
|
|
1869
|
+
const Cr = () => qt().user, Nt = "archbaseSecurityManagerStore", Zr = ({ resourceName: r, resourceDescription: e, enableSecurity: t = !0 }) => {
|
|
1870
|
+
const s = dt(Nt), n = Cr(), c = n?.isAdmin ?? !1, l = n?.id, i = We(l), d = lt(() => {
|
|
1871
1871
|
if (!t)
|
|
1872
1872
|
return null;
|
|
1873
|
-
const
|
|
1874
|
-
if (s && s.existsValue(
|
|
1875
|
-
const
|
|
1876
|
-
if (
|
|
1877
|
-
return
|
|
1873
|
+
const g = l ? `${r}_${l}` : r;
|
|
1874
|
+
if (s && s.existsValue(g)) {
|
|
1875
|
+
const u = s.getValue(g);
|
|
1876
|
+
if (u && u.isAdmin === c)
|
|
1877
|
+
return u;
|
|
1878
1878
|
}
|
|
1879
|
-
const k = new
|
|
1880
|
-
return s &&
|
|
1881
|
-
}, [t, r, e,
|
|
1882
|
-
return
|
|
1883
|
-
i.current =
|
|
1884
|
-
}, [
|
|
1879
|
+
const k = new wt(r, e, c);
|
|
1880
|
+
return s && l && s.setValue(g, k), k;
|
|
1881
|
+
}, [t, r, e, c, l]);
|
|
1882
|
+
return Y(() => {
|
|
1883
|
+
i.current = l;
|
|
1884
|
+
}, [l]), { securityManager: d };
|
|
1885
1885
|
};
|
|
1886
|
-
function
|
|
1886
|
+
function ze(r) {
|
|
1887
1887
|
const e = r?.response?.data ?? r?.data ?? r;
|
|
1888
1888
|
return e?.error === "CREDENTIALS_EXPIRED" || e?.requirePasswordChange === !0;
|
|
1889
1889
|
}
|
|
1890
|
-
const
|
|
1890
|
+
const es = ({
|
|
1891
1891
|
checkIntervalTokenHasExpired: r = 3e4,
|
|
1892
1892
|
// Verificar a 30 segundos
|
|
1893
1893
|
expirationThresholdOfToken: e = 300
|
|
1894
1894
|
// Antecipar em 5 minutos
|
|
1895
1895
|
}) => {
|
|
1896
|
-
const t =
|
|
1897
|
-
(
|
|
1898
|
-
), s =
|
|
1899
|
-
(
|
|
1900
|
-
), [n,
|
|
1896
|
+
const t = _e(
|
|
1897
|
+
(a) => a.get(q.TokenManager)
|
|
1898
|
+
), s = _e(
|
|
1899
|
+
(a) => a.get(q.Authenticator)
|
|
1900
|
+
), [n, c] = p(null), [l, i] = p(!1), [d, g] = p(!0), [k, u] = p(!1), [T, b] = p(!1), [v, E] = p(""), [P, M] = p(""), [B, F] = p(null), [D, w] = p(!1), [f, _] = p(!1), [H, L] = p(null), N = We(!1), X = dt(Nt), U = {
|
|
1901
1901
|
hasContextualLogin: typeof s.loginWithContext == "function",
|
|
1902
1902
|
hasFlexibleLogin: typeof s.loginFlexible == "function",
|
|
1903
1903
|
hasSocialLogin: typeof s.loginSocial == "function",
|
|
1904
1904
|
hasRegistration: typeof s.register == "function",
|
|
1905
1905
|
hasContextSupport: typeof t.saveContext == "function"
|
|
1906
1906
|
};
|
|
1907
|
-
|
|
1908
|
-
const
|
|
1909
|
-
if (
|
|
1910
|
-
const
|
|
1911
|
-
if (
|
|
1907
|
+
Y(() => {
|
|
1908
|
+
const a = t.getUsername();
|
|
1909
|
+
if (a && a != "" && M(a), U.hasContextSupport && t.getContext) {
|
|
1910
|
+
const x = t.getContext();
|
|
1911
|
+
if (x)
|
|
1912
1912
|
try {
|
|
1913
|
-
const
|
|
1914
|
-
|
|
1915
|
-
} catch (
|
|
1916
|
-
console.warn("Erro ao carregar contexto salvo:",
|
|
1913
|
+
const R = typeof x == "string" ? JSON.parse(x) : x;
|
|
1914
|
+
F(R);
|
|
1915
|
+
} catch (R) {
|
|
1916
|
+
console.warn("Erro ao carregar contexto salvo:", R);
|
|
1917
1917
|
}
|
|
1918
1918
|
}
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1919
|
+
const h = t.getToken();
|
|
1920
|
+
h && (u(!0), E(""), b(!1), c(h)), g(!1);
|
|
1921
1921
|
}, []);
|
|
1922
1922
|
const te = () => {
|
|
1923
|
-
|
|
1924
|
-
},
|
|
1925
|
-
|
|
1926
|
-
},
|
|
1927
|
-
i(!1),
|
|
1928
|
-
},
|
|
1923
|
+
b(!1), E("");
|
|
1924
|
+
}, ae = () => {
|
|
1925
|
+
_(!1);
|
|
1926
|
+
}, m = (a) => {
|
|
1927
|
+
i(!1), u(!1), c(null), t.clearToken(), a && t.clearUsernameAndPassword(), U.hasContextSupport && t.clearContext && t.clearContext(), M(""), F(null), E(""), b(!1), _(!1), X.clearAllValues();
|
|
1928
|
+
}, y = async (a, h, x) => {
|
|
1929
1929
|
try {
|
|
1930
|
-
i(!0),
|
|
1931
|
-
const
|
|
1932
|
-
t.saveToken(
|
|
1933
|
-
} catch (
|
|
1934
|
-
i(!1),
|
|
1930
|
+
i(!0), u(!1);
|
|
1931
|
+
const R = await s.login(a, h);
|
|
1932
|
+
t.saveToken(R), x && t.saveUsernameAndPassword(a, h), t.saveUsername(a), M(a), c(R), i(!1), u(!0);
|
|
1933
|
+
} catch (R) {
|
|
1934
|
+
i(!1), u(!1), ze(R) && (M(a), _(!0)), E(oe(R)), b(!0);
|
|
1935
1935
|
}
|
|
1936
|
-
},
|
|
1937
|
-
if (!
|
|
1936
|
+
}, J = async (a, h = !1) => {
|
|
1937
|
+
if (!U.hasContextualLogin || !s.loginWithContext)
|
|
1938
1938
|
throw new Error("Login contextual não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1939
1939
|
try {
|
|
1940
|
-
i(!0),
|
|
1941
|
-
const { context:
|
|
1942
|
-
if (
|
|
1943
|
-
L(
|
|
1940
|
+
i(!0), u(!1);
|
|
1941
|
+
const { context: x, user: R, ...re } = await s.loginWithContext(a);
|
|
1942
|
+
if (re.mfa_required) {
|
|
1943
|
+
L(re.challenge_token ?? null), w(!0), M(a.email), i(!1);
|
|
1944
1944
|
return;
|
|
1945
1945
|
}
|
|
1946
|
-
const
|
|
1946
|
+
const Ee = {
|
|
1947
1947
|
scope: "",
|
|
1948
|
-
ext_expires_in:
|
|
1949
|
-
...
|
|
1948
|
+
ext_expires_in: re.expires_in,
|
|
1949
|
+
...re
|
|
1950
1950
|
};
|
|
1951
|
-
t.saveToken(
|
|
1952
|
-
} catch (
|
|
1953
|
-
throw i(!1),
|
|
1951
|
+
t.saveToken(Ee), h ? t.saveUsernameAndPassword(a.email, a.password) : t.clearUsernameAndPassword(), t.saveUsername(a.email), U.hasContextSupport && t.saveContext && x && (t.saveContext(JSON.stringify(x)), F(x)), M(a.email), c(Ee), i(!1), u(!0);
|
|
1952
|
+
} catch (x) {
|
|
1953
|
+
throw i(!1), u(!1), ze(x) && (M(a.email), _(!0)), E(oe(x)), b(!0), x;
|
|
1954
1954
|
}
|
|
1955
|
-
},
|
|
1955
|
+
}, V = async (a) => {
|
|
1956
1956
|
if (!s.verifyMfa)
|
|
1957
1957
|
throw new Error("verifyMfa não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1958
|
-
if (!
|
|
1958
|
+
if (!H)
|
|
1959
1959
|
throw new Error("Nenhum desafio de MFA pendente");
|
|
1960
1960
|
try {
|
|
1961
|
-
i(!0),
|
|
1962
|
-
const
|
|
1963
|
-
t.saveToken(
|
|
1964
|
-
} catch (
|
|
1965
|
-
throw i(!1),
|
|
1961
|
+
i(!0), E(""), b(!1);
|
|
1962
|
+
const h = await s.verifyMfa(H, a);
|
|
1963
|
+
t.saveToken(h), t.saveUsername(P), c(h), w(!1), L(null), i(!1), u(!0);
|
|
1964
|
+
} catch (h) {
|
|
1965
|
+
throw i(!1), E(oe(h)), b(!0), h;
|
|
1966
1966
|
}
|
|
1967
|
-
},
|
|
1968
|
-
|
|
1969
|
-
},
|
|
1970
|
-
if (!
|
|
1967
|
+
}, be = () => {
|
|
1968
|
+
w(!1), L(null), E(""), b(!1);
|
|
1969
|
+
}, he = async (a, h = !1) => {
|
|
1970
|
+
if (!U.hasFlexibleLogin || !s.loginFlexible)
|
|
1971
1971
|
throw new Error("Login flexível não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1972
1972
|
try {
|
|
1973
|
-
i(!0),
|
|
1974
|
-
const { context:
|
|
1973
|
+
i(!0), u(!1);
|
|
1974
|
+
const { context: x, user: R, ...re } = await s.loginFlexible(a), Ee = {
|
|
1975
1975
|
scope: "",
|
|
1976
|
-
ext_expires_in:
|
|
1977
|
-
...
|
|
1976
|
+
ext_expires_in: re.expires_in,
|
|
1977
|
+
...re
|
|
1978
1978
|
};
|
|
1979
|
-
t.saveToken(
|
|
1980
|
-
} catch (
|
|
1981
|
-
throw i(!1),
|
|
1979
|
+
t.saveToken(Ee), h && t.saveUsernameAndPassword(a.identifier, a.password), t.saveUsername(R.email || a.identifier), U.hasContextSupport && t.saveContext && x && (t.saveContext(JSON.stringify(x)), F(x)), M(R.email || a.identifier), c(Ee), i(!1), u(!0);
|
|
1980
|
+
} catch (x) {
|
|
1981
|
+
throw i(!1), u(!1), ze(x) && (M(a.identifier), _(!0)), E(oe(x)), b(!0), x;
|
|
1982
1982
|
}
|
|
1983
|
-
},
|
|
1984
|
-
if (!
|
|
1983
|
+
}, $ = async (a) => {
|
|
1984
|
+
if (!U.hasSocialLogin || !s.loginSocial)
|
|
1985
1985
|
throw new Error("Login social não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1986
1986
|
try {
|
|
1987
|
-
i(!0),
|
|
1988
|
-
const { context:
|
|
1987
|
+
i(!0), u(!1);
|
|
1988
|
+
const { context: h, user: x, ...R } = await s.loginSocial(a), re = {
|
|
1989
1989
|
scope: "",
|
|
1990
|
-
ext_expires_in:
|
|
1991
|
-
...
|
|
1990
|
+
ext_expires_in: R.expires_in,
|
|
1991
|
+
...R
|
|
1992
1992
|
};
|
|
1993
|
-
t.saveToken(
|
|
1994
|
-
} catch (
|
|
1995
|
-
throw i(!1),
|
|
1993
|
+
t.saveToken(re), t.saveUsername(x.email), U.hasContextSupport && t.saveContext && h && (t.saveContext(JSON.stringify(h)), F(h)), M(x.email), c(re), i(!1), u(!0);
|
|
1994
|
+
} catch (h) {
|
|
1995
|
+
throw i(!1), u(!1), E(oe(h)), b(!0), h;
|
|
1996
1996
|
}
|
|
1997
|
-
},
|
|
1998
|
-
if (!
|
|
1997
|
+
}, ce = async (a) => {
|
|
1998
|
+
if (!U.hasRegistration || !s.register)
|
|
1999
1999
|
throw new Error("Registro não suportado por esta implementação do ArchbaseAuthenticator");
|
|
2000
2000
|
try {
|
|
2001
2001
|
i(!0);
|
|
2002
|
-
const
|
|
2003
|
-
return i(!1),
|
|
2004
|
-
} catch (
|
|
2005
|
-
throw i(!1),
|
|
2002
|
+
const h = await s.register(a);
|
|
2003
|
+
return i(!1), h;
|
|
2004
|
+
} catch (h) {
|
|
2005
|
+
throw i(!1), E(oe(h)), b(!0), h;
|
|
2006
2006
|
}
|
|
2007
|
-
},
|
|
2008
|
-
|
|
2009
|
-
const
|
|
2010
|
-
n && n.access_token && t.isTokenExpired(n, e) &&
|
|
2007
|
+
}, ne = async () => s.getSupportedContexts ? await s.getSupportedContexts() : { supportedContexts: ["DEFAULT"], defaultContext: "DEFAULT" }, Ae = async (a) => s.validateContext ? await s.validateContext(a) : { context: a, supported: a === "DEFAULT" };
|
|
2008
|
+
Y(() => {
|
|
2009
|
+
const a = setInterval(() => {
|
|
2010
|
+
n && n.access_token && t.isTokenExpired(n, e) && pe();
|
|
2011
2011
|
}, r);
|
|
2012
2012
|
return () => {
|
|
2013
|
-
clearInterval(
|
|
2013
|
+
clearInterval(a);
|
|
2014
2014
|
};
|
|
2015
2015
|
}, [n]);
|
|
2016
|
-
const
|
|
2017
|
-
if (n)
|
|
2016
|
+
const pe = async () => {
|
|
2017
|
+
if (n && !N.current) {
|
|
2018
|
+
N.current = !0;
|
|
2018
2019
|
try {
|
|
2019
|
-
const
|
|
2020
|
-
t.saveToken(
|
|
2021
|
-
} catch (
|
|
2022
|
-
console.error("Erro ao renovar o token:",
|
|
2020
|
+
const a = await s.refreshToken(n?.refresh_token);
|
|
2021
|
+
t.saveToken(a), c(a);
|
|
2022
|
+
} catch (a) {
|
|
2023
|
+
console.error("Erro ao renovar o token:", a), m();
|
|
2024
|
+
} finally {
|
|
2025
|
+
N.current = !1;
|
|
2023
2026
|
}
|
|
2027
|
+
}
|
|
2024
2028
|
};
|
|
2025
2029
|
return {
|
|
2026
2030
|
// Métodos básicos (compatibilidade)
|
|
2027
|
-
login:
|
|
2028
|
-
logout:
|
|
2031
|
+
login: y,
|
|
2032
|
+
logout: m,
|
|
2029
2033
|
username: P,
|
|
2030
2034
|
isAuthenticated: k,
|
|
2031
|
-
isAuthenticating:
|
|
2035
|
+
isAuthenticating: l,
|
|
2032
2036
|
isInitializing: d,
|
|
2033
|
-
isError:
|
|
2034
|
-
error:
|
|
2037
|
+
isError: T,
|
|
2038
|
+
error: v,
|
|
2035
2039
|
clearError: te,
|
|
2036
2040
|
accessToken: n ? n.access_token : null,
|
|
2037
2041
|
// Métodos opcionais para autenticação avançada
|
|
2038
|
-
loginWithContext:
|
|
2039
|
-
loginFlexible:
|
|
2040
|
-
loginSocial:
|
|
2041
|
-
register:
|
|
2042
|
-
getSupportedContexts:
|
|
2043
|
-
validateContext:
|
|
2042
|
+
loginWithContext: U.hasContextualLogin ? J : void 0,
|
|
2043
|
+
loginFlexible: U.hasFlexibleLogin ? he : void 0,
|
|
2044
|
+
loginSocial: U.hasSocialLogin ? $ : void 0,
|
|
2045
|
+
register: U.hasRegistration ? ce : void 0,
|
|
2046
|
+
getSupportedContexts: ne,
|
|
2047
|
+
validateContext: Ae,
|
|
2044
2048
|
// MFA / segundo fator (2 passos)
|
|
2045
|
-
mfaRequired:
|
|
2046
|
-
verifyMfa: typeof s.verifyMfa == "function" ?
|
|
2047
|
-
cancelMfa:
|
|
2049
|
+
mfaRequired: D,
|
|
2050
|
+
verifyMfa: typeof s.verifyMfa == "function" ? V : void 0,
|
|
2051
|
+
cancelMfa: be,
|
|
2048
2052
|
// Troca de senha obrigatória (CREDENTIALS_EXPIRED)
|
|
2049
|
-
passwordChangeRequired:
|
|
2050
|
-
clearPasswordChangeRequired:
|
|
2053
|
+
passwordChangeRequired: f,
|
|
2054
|
+
clearPasswordChangeRequired: ae,
|
|
2051
2055
|
// Informações de contexto
|
|
2052
2056
|
context: B,
|
|
2053
2057
|
// Detecção de capacidades
|
|
2054
|
-
capabilities:
|
|
2058
|
+
capabilities: U
|
|
2055
2059
|
};
|
|
2056
|
-
},
|
|
2057
|
-
const r =
|
|
2058
|
-
(s) => s.get(
|
|
2060
|
+
}, ts = () => {
|
|
2061
|
+
const r = _e(
|
|
2062
|
+
(s) => s.get(q.TokenManager)
|
|
2059
2063
|
), [e, t] = p(null);
|
|
2060
|
-
return
|
|
2064
|
+
return Y(() => {
|
|
2061
2065
|
const s = r.getToken();
|
|
2062
2066
|
s && t(s.access_token);
|
|
2063
2067
|
}, []), {
|
|
2064
2068
|
token: e
|
|
2065
2069
|
};
|
|
2066
|
-
},
|
|
2067
|
-
const r =
|
|
2068
|
-
(d) => d.get(
|
|
2070
|
+
}, rs = () => {
|
|
2071
|
+
const r = _e(
|
|
2072
|
+
(d) => d.get(q.Authenticator)
|
|
2069
2073
|
), [e, t] = p(!1), [s, n] = p("");
|
|
2070
2074
|
return {
|
|
2071
2075
|
sendResetPasswordEmail: async (d) => {
|
|
2072
2076
|
try {
|
|
2073
2077
|
return await r.sendResetPasswordEmail(d);
|
|
2074
|
-
} catch (
|
|
2075
|
-
throw n(
|
|
2078
|
+
} catch (g) {
|
|
2079
|
+
throw n(oe(g)), t(!0), g;
|
|
2076
2080
|
}
|
|
2077
2081
|
},
|
|
2078
|
-
resetPassword: async (d,
|
|
2082
|
+
resetPassword: async (d, g, k) => {
|
|
2079
2083
|
try {
|
|
2080
|
-
return await r.resetPassword(d,
|
|
2081
|
-
} catch (
|
|
2082
|
-
throw n(
|
|
2084
|
+
return await r.resetPassword(d, g, k);
|
|
2085
|
+
} catch (u) {
|
|
2086
|
+
throw n(oe(u)), t(!0), u;
|
|
2083
2087
|
}
|
|
2084
2088
|
},
|
|
2085
2089
|
isError: e,
|
|
@@ -2088,77 +2092,77 @@ const Zr = ({
|
|
|
2088
2092
|
t(!1), n("");
|
|
2089
2093
|
}
|
|
2090
2094
|
};
|
|
2091
|
-
},
|
|
2095
|
+
}, Pr = () => /* @__PURE__ */ o(rr, { p: "xl", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ C(xe, { gap: "md", children: [
|
|
2092
2096
|
/* @__PURE__ */ C(ue, { gap: "sm", children: [
|
|
2093
|
-
/* @__PURE__ */ o(
|
|
2094
|
-
/* @__PURE__ */ o(
|
|
2097
|
+
/* @__PURE__ */ o(ut, { size: "sm" }),
|
|
2098
|
+
/* @__PURE__ */ o(j, { size: "sm", c: "dimmed", children: "Carregando permissões..." })
|
|
2095
2099
|
] }),
|
|
2096
|
-
/* @__PURE__ */ o(
|
|
2097
|
-
/* @__PURE__ */ o(
|
|
2100
|
+
/* @__PURE__ */ o(Pe, { height: 40, radius: "sm" }),
|
|
2101
|
+
/* @__PURE__ */ o(Pe, { height: 200, radius: "sm" }),
|
|
2098
2102
|
/* @__PURE__ */ C(ue, { gap: "md", children: [
|
|
2099
|
-
/* @__PURE__ */ o(
|
|
2100
|
-
/* @__PURE__ */ o(
|
|
2103
|
+
/* @__PURE__ */ o(Pe, { height: 36, width: 100, radius: "sm" }),
|
|
2104
|
+
/* @__PURE__ */ o(Pe, { height: 36, width: 100, radius: "sm" })
|
|
2101
2105
|
] })
|
|
2102
|
-
] }) }),
|
|
2106
|
+
] }) }), Qe = Ve(null), ss = ({
|
|
2103
2107
|
children: r,
|
|
2104
2108
|
user: e,
|
|
2105
2109
|
onError: t
|
|
2106
2110
|
}) => {
|
|
2107
|
-
const [s, n] = p(!1), [
|
|
2108
|
-
|
|
2109
|
-
}, [t]),
|
|
2111
|
+
const [s, n] = p(!1), [c, l] = p(null), [i] = p([]), d = e?.isAdministrator || !1, g = Ce((v) => d ? !0 : i.includes(v), [i, d]), k = Ce((v) => d ? !0 : v.some((E) => i.includes(E)), [i, d]), u = Ce((v) => d ? !0 : v.every((E) => i.includes(E)), [i, d]), T = Ce((v) => {
|
|
2112
|
+
l(v), v && t && t(v);
|
|
2113
|
+
}, [t]), b = {
|
|
2110
2114
|
user: e,
|
|
2111
2115
|
isLoading: s,
|
|
2112
|
-
hasGlobalPermission:
|
|
2116
|
+
hasGlobalPermission: g,
|
|
2113
2117
|
hasAnyGlobalPermission: k,
|
|
2114
|
-
hasAllGlobalPermissions:
|
|
2118
|
+
hasAllGlobalPermissions: u,
|
|
2115
2119
|
isAdmin: d,
|
|
2116
|
-
error:
|
|
2117
|
-
setError:
|
|
2120
|
+
error: c,
|
|
2121
|
+
setError: T
|
|
2118
2122
|
};
|
|
2119
|
-
return /* @__PURE__ */ o(
|
|
2120
|
-
},
|
|
2123
|
+
return /* @__PURE__ */ o(Qe.Provider, { value: b, children: r });
|
|
2124
|
+
}, $t = Ve(null), Tr = ({
|
|
2121
2125
|
children: r,
|
|
2122
2126
|
resourceName: e,
|
|
2123
2127
|
resourceDescription: t,
|
|
2124
2128
|
requiredPermissions: s = [],
|
|
2125
2129
|
fallbackComponent: n,
|
|
2126
|
-
loadingComponent:
|
|
2127
|
-
onSecurityReady:
|
|
2130
|
+
loadingComponent: c,
|
|
2131
|
+
onSecurityReady: l,
|
|
2128
2132
|
onError: i
|
|
2129
2133
|
}) => {
|
|
2130
|
-
const d =
|
|
2134
|
+
const d = Ge(Qe);
|
|
2131
2135
|
if (!d)
|
|
2132
2136
|
throw new Error("ArchbaseViewSecurityProvider deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
2133
|
-
const { user:
|
|
2134
|
-
if (
|
|
2135
|
-
if (!
|
|
2136
|
-
|
|
2137
|
+
const { user: g, isAdmin: k } = d, [u, T] = p(null), [b, v] = p(!0), [E, P] = p(null);
|
|
2138
|
+
if (ct.useEffect(() => {
|
|
2139
|
+
if (!g) {
|
|
2140
|
+
v(!1);
|
|
2137
2141
|
return;
|
|
2138
2142
|
}
|
|
2139
|
-
const
|
|
2143
|
+
const f = new wt(e, t, k);
|
|
2140
2144
|
(async () => {
|
|
2141
|
-
|
|
2145
|
+
v(!0);
|
|
2142
2146
|
try {
|
|
2143
|
-
await
|
|
2144
|
-
|
|
2147
|
+
await f.apply(() => {
|
|
2148
|
+
T(f), v(!1), l && l(f);
|
|
2145
2149
|
});
|
|
2146
2150
|
} catch {
|
|
2147
|
-
const L =
|
|
2148
|
-
P(L),
|
|
2151
|
+
const L = f.getError() || "Erro ao carregar permissões";
|
|
2152
|
+
P(L), v(!1), i && i(L);
|
|
2149
2153
|
}
|
|
2150
2154
|
})();
|
|
2151
|
-
}, [e, t,
|
|
2152
|
-
return
|
|
2153
|
-
if (
|
|
2155
|
+
}, [e, t, g, k, l, i]), b)
|
|
2156
|
+
return c ? /* @__PURE__ */ o(ie, { children: c }) : /* @__PURE__ */ o(Pr, {});
|
|
2157
|
+
if (E)
|
|
2154
2158
|
return /* @__PURE__ */ o("div", { className: "archbase-security-error", children: /* @__PURE__ */ C("div", { children: [
|
|
2155
2159
|
"Erro ao carregar permissões: ",
|
|
2156
|
-
|
|
2160
|
+
E
|
|
2157
2161
|
] }) });
|
|
2158
|
-
if (!
|
|
2162
|
+
if (!g)
|
|
2159
2163
|
return n || /* @__PURE__ */ o("div", { className: "archbase-security-no-user", children: /* @__PURE__ */ o("div", { children: "É necessário fazer login para acessar esta área" }) });
|
|
2160
|
-
if (s.length > 0 &&
|
|
2161
|
-
(
|
|
2164
|
+
if (s.length > 0 && u && !s.every(
|
|
2165
|
+
(_) => u.hasPermission(_)
|
|
2162
2166
|
))
|
|
2163
2167
|
return n || /* @__PURE__ */ C("div", { className: "archbase-security-access-denied", children: [
|
|
2164
2168
|
/* @__PURE__ */ o("div", { children: "Você não possui permissão para acessar esta área" }),
|
|
@@ -2167,37 +2171,37 @@ const Zr = ({
|
|
|
2167
2171
|
s.join(", ")
|
|
2168
2172
|
] })
|
|
2169
2173
|
] });
|
|
2170
|
-
const
|
|
2171
|
-
securityManager:
|
|
2172
|
-
hasPermission: (
|
|
2173
|
-
hasAnyPermission: (
|
|
2174
|
-
hasAllPermissions: (
|
|
2175
|
-
registerAction: (
|
|
2176
|
-
|
|
2174
|
+
const w = {
|
|
2175
|
+
securityManager: u,
|
|
2176
|
+
hasPermission: (f) => u?.hasPermission(f) || !1,
|
|
2177
|
+
hasAnyPermission: (f) => f.some((_) => u?.hasPermission(_) || !1),
|
|
2178
|
+
hasAllPermissions: (f) => f.every((_) => u?.hasPermission(_) || !1),
|
|
2179
|
+
registerAction: (f, _) => {
|
|
2180
|
+
u?.registerAction(f, _);
|
|
2177
2181
|
},
|
|
2178
|
-
isLoading:
|
|
2179
|
-
error:
|
|
2182
|
+
isLoading: b,
|
|
2183
|
+
error: E
|
|
2180
2184
|
};
|
|
2181
|
-
return /* @__PURE__ */ o(
|
|
2182
|
-
},
|
|
2183
|
-
const r =
|
|
2185
|
+
return /* @__PURE__ */ o($t.Provider, { value: w, children: r });
|
|
2186
|
+
}, Ur = () => {
|
|
2187
|
+
const r = Ge(Qe);
|
|
2184
2188
|
if (!r)
|
|
2185
2189
|
throw new Error("useArchbaseSecurity deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
2186
2190
|
return r;
|
|
2187
|
-
},
|
|
2188
|
-
const r =
|
|
2191
|
+
}, Ze = () => {
|
|
2192
|
+
const r = Ge($t);
|
|
2189
2193
|
if (!r)
|
|
2190
2194
|
throw new Error("useArchbaseViewSecurity deve ser usado dentro de um ArchbaseViewSecurityProvider");
|
|
2191
2195
|
return r;
|
|
2192
|
-
},
|
|
2193
|
-
const t =
|
|
2194
|
-
return
|
|
2195
|
-
r && e && (
|
|
2196
|
-
}, [r, e,
|
|
2196
|
+
}, ns = (r, e) => {
|
|
2197
|
+
const t = Ze(), { hasPermission: s, hasAnyPermission: n, hasAllPermissions: c, registerAction: l, securityManager: i, isLoading: d, error: g } = t;
|
|
2198
|
+
return ct.useEffect(() => {
|
|
2199
|
+
r && e && (l("create", `Criar ${e}`), l("edit", `Editar ${e}`), l("delete", `Deletar ${e}`), l("view", `Visualizar ${e}`), l("list", `Listar ${e}`));
|
|
2200
|
+
}, [r, e, l]), {
|
|
2197
2201
|
hasPermission: s,
|
|
2198
2202
|
hasAnyPermission: n,
|
|
2199
|
-
hasAllPermissions:
|
|
2200
|
-
registerAction:
|
|
2203
|
+
hasAllPermissions: c,
|
|
2204
|
+
registerAction: l,
|
|
2201
2205
|
securityManager: i,
|
|
2202
2206
|
canCreate: s("create"),
|
|
2203
2207
|
canEdit: s("edit"),
|
|
@@ -2205,52 +2209,52 @@ const Zr = ({
|
|
|
2205
2209
|
canView: s("view"),
|
|
2206
2210
|
canList: s("list"),
|
|
2207
2211
|
isLoading: d,
|
|
2208
|
-
error:
|
|
2212
|
+
error: g
|
|
2209
2213
|
};
|
|
2210
|
-
},
|
|
2211
|
-
const r =
|
|
2214
|
+
}, os = () => {
|
|
2215
|
+
const r = Ze();
|
|
2212
2216
|
return {
|
|
2213
2217
|
check: r.hasPermission,
|
|
2214
2218
|
checkAny: r.hasAnyPermission,
|
|
2215
2219
|
checkAll: r.hasAllPermissions,
|
|
2216
|
-
isAdmin:
|
|
2220
|
+
isAdmin: Ur().isAdmin
|
|
2217
2221
|
};
|
|
2218
|
-
},
|
|
2222
|
+
}, Bt = ({
|
|
2219
2223
|
children: r,
|
|
2220
2224
|
actionName: e,
|
|
2221
2225
|
requiredPermissions: t = [],
|
|
2222
2226
|
requireAll: s = !0,
|
|
2223
2227
|
actionDescription: n,
|
|
2224
|
-
fallback:
|
|
2225
|
-
autoRegister:
|
|
2228
|
+
fallback: c = null,
|
|
2229
|
+
autoRegister: l = !0
|
|
2226
2230
|
}) => {
|
|
2227
|
-
const { hasPermission: i, hasAnyPermission: d, hasAllPermissions:
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
}, [e, n,
|
|
2231
|
-
let
|
|
2232
|
-
return e ?
|
|
2233
|
-
},
|
|
2231
|
+
const { hasPermission: i, hasAnyPermission: d, hasAllPermissions: g, registerAction: k } = Ze();
|
|
2232
|
+
Y(() => {
|
|
2233
|
+
l && e && n && k(e, n);
|
|
2234
|
+
}, [e, n, l, k]);
|
|
2235
|
+
let u = !1;
|
|
2236
|
+
return e ? u = i(e) : t.length > 0 ? u = s ? g(t) : d(t) : u = !0, u ? /* @__PURE__ */ o(ie, { children: r }) : /* @__PURE__ */ o(ie, { children: c });
|
|
2237
|
+
}, is = ({
|
|
2234
2238
|
actionName: r,
|
|
2235
2239
|
actionDescription: e,
|
|
2236
2240
|
children: t,
|
|
2237
2241
|
onClick: s,
|
|
2238
2242
|
disabled: n = !1,
|
|
2239
|
-
className:
|
|
2240
|
-
style:
|
|
2243
|
+
className: c = "",
|
|
2244
|
+
style: l = {},
|
|
2241
2245
|
variant: i = "primary",
|
|
2242
2246
|
size: d = "medium",
|
|
2243
|
-
type:
|
|
2247
|
+
type: g = "button"
|
|
2244
2248
|
}) => {
|
|
2245
2249
|
const k = () => {
|
|
2246
|
-
const
|
|
2247
|
-
return `${
|
|
2248
|
-
},
|
|
2249
|
-
const
|
|
2250
|
+
const T = "archbase-secure-btn", b = `archbase-secure-btn--${i}`, v = `archbase-secure-btn--${d}`;
|
|
2251
|
+
return `${T} ${b} ${v} ${c}`.trim();
|
|
2252
|
+
}, u = () => {
|
|
2253
|
+
const T = {
|
|
2250
2254
|
small: { padding: "4px 8px", fontSize: "12px" },
|
|
2251
2255
|
medium: { padding: "8px 16px", fontSize: "14px" },
|
|
2252
2256
|
large: { padding: "12px 24px", fontSize: "16px" }
|
|
2253
|
-
},
|
|
2257
|
+
}, b = {
|
|
2254
2258
|
primary: { backgroundColor: "#007bff", color: "white" },
|
|
2255
2259
|
secondary: { backgroundColor: "#6c757d", color: "white" },
|
|
2256
2260
|
danger: { backgroundColor: "#dc3545", color: "white" },
|
|
@@ -2263,13 +2267,13 @@ const Zr = ({
|
|
|
2263
2267
|
cursor: n ? "not-allowed" : "pointer",
|
|
2264
2268
|
fontWeight: "500",
|
|
2265
2269
|
opacity: n ? 0.6 : 1,
|
|
2266
|
-
...
|
|
2267
|
-
...
|
|
2268
|
-
...
|
|
2270
|
+
...T[d],
|
|
2271
|
+
...b[i],
|
|
2272
|
+
...l
|
|
2269
2273
|
};
|
|
2270
2274
|
};
|
|
2271
2275
|
return /* @__PURE__ */ o(
|
|
2272
|
-
|
|
2276
|
+
Bt,
|
|
2273
2277
|
{
|
|
2274
2278
|
actionName: r,
|
|
2275
2279
|
actionDescription: e,
|
|
@@ -2277,30 +2281,30 @@ const Zr = ({
|
|
|
2277
2281
|
children: /* @__PURE__ */ o(
|
|
2278
2282
|
"button",
|
|
2279
2283
|
{
|
|
2280
|
-
type:
|
|
2284
|
+
type: g,
|
|
2281
2285
|
onClick: s,
|
|
2282
2286
|
disabled: n,
|
|
2283
2287
|
className: k(),
|
|
2284
|
-
style:
|
|
2288
|
+
style: u(),
|
|
2285
2289
|
children: t
|
|
2286
2290
|
}
|
|
2287
2291
|
)
|
|
2288
2292
|
}
|
|
2289
2293
|
);
|
|
2290
|
-
},
|
|
2294
|
+
}, as = ({
|
|
2291
2295
|
children: r,
|
|
2292
2296
|
actionName: e,
|
|
2293
2297
|
actionDescription: t,
|
|
2294
2298
|
showLabel: s = !0,
|
|
2295
2299
|
label: n,
|
|
2296
|
-
fallbackText:
|
|
2297
|
-
fallbackComponent:
|
|
2300
|
+
fallbackText: c = "Campo não disponível",
|
|
2301
|
+
fallbackComponent: l
|
|
2298
2302
|
}) => e ? /* @__PURE__ */ o(
|
|
2299
|
-
|
|
2303
|
+
Bt,
|
|
2300
2304
|
{
|
|
2301
2305
|
actionName: e,
|
|
2302
2306
|
actionDescription: t,
|
|
2303
|
-
fallback:
|
|
2307
|
+
fallback: l || /* @__PURE__ */ C("div", { className: "archbase-secure-field-fallback", style: {
|
|
2304
2308
|
padding: "8px",
|
|
2305
2309
|
color: "#666",
|
|
2306
2310
|
fontStyle: "italic",
|
|
@@ -2312,20 +2316,20 @@ const Zr = ({
|
|
|
2312
2316
|
n,
|
|
2313
2317
|
": "
|
|
2314
2318
|
] }),
|
|
2315
|
-
|
|
2319
|
+
c
|
|
2316
2320
|
] }),
|
|
2317
2321
|
children: r
|
|
2318
2322
|
}
|
|
2319
|
-
) : /* @__PURE__ */ o(
|
|
2320
|
-
function
|
|
2323
|
+
) : /* @__PURE__ */ o(ie, { children: r });
|
|
2324
|
+
function cs(r, e) {
|
|
2321
2325
|
return function(s) {
|
|
2322
|
-
const { resourceName: n, resourceDescription:
|
|
2326
|
+
const { resourceName: n, resourceDescription: c, requiredPermissions: l, fallbackComponent: i } = e;
|
|
2323
2327
|
return /* @__PURE__ */ o(
|
|
2324
|
-
|
|
2328
|
+
Tr,
|
|
2325
2329
|
{
|
|
2326
2330
|
resourceName: n,
|
|
2327
|
-
resourceDescription:
|
|
2328
|
-
requiredPermissions:
|
|
2331
|
+
resourceDescription: c,
|
|
2332
|
+
requiredPermissions: l,
|
|
2329
2333
|
fallbackComponent: i,
|
|
2330
2334
|
children: /* @__PURE__ */ o(r, { ...s })
|
|
2331
2335
|
}
|
|
@@ -2333,77 +2337,77 @@ function as(r, e) {
|
|
|
2333
2337
|
};
|
|
2334
2338
|
}
|
|
2335
2339
|
export {
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2340
|
+
Nt as ARCHBASE_SECURITY_MANAGER_STORE,
|
|
2341
|
+
Sr as AccessIntervalDto,
|
|
2342
|
+
Et as AccessScheduleDto,
|
|
2343
|
+
Xe as AccessTokenDto,
|
|
2344
|
+
kr as ActionDto,
|
|
2345
|
+
Ye as ApiTokenDto,
|
|
2346
|
+
_t as ArchbaseAccessTokenService,
|
|
2347
|
+
Dt as ArchbaseApiTokenService,
|
|
2348
|
+
Ar as ArchbaseAuthContext,
|
|
2349
|
+
Jr as ArchbaseAuthProvider,
|
|
2350
|
+
Tt as ArchbaseGroupService,
|
|
2351
|
+
Yr as ArchbaseLogin,
|
|
2352
|
+
Xr as ArchbaseMfaSetup,
|
|
2353
|
+
Ut as ArchbaseProfileService,
|
|
2354
|
+
Bt as ArchbaseProtectedComponent,
|
|
2355
|
+
Qr as ArchbaseResetPassword,
|
|
2356
|
+
Rt as ArchbaseResourceService,
|
|
2357
|
+
is as ArchbaseSecureActionButton,
|
|
2358
|
+
as as ArchbaseSecureFormField,
|
|
2359
|
+
Mt as ArchbaseSecurityDiagnosticsService,
|
|
2360
|
+
wt as ArchbaseSecurityManager,
|
|
2361
|
+
ss as ArchbaseSecurityProvider,
|
|
2362
|
+
G as ArchbaseTenantManager,
|
|
2363
|
+
pt as ArchbaseUser,
|
|
2364
|
+
Pt as ArchbaseUserService,
|
|
2365
|
+
ft as ArchbaseUsernameAndPassword,
|
|
2366
|
+
ft as ArchbaseUsernameAndPasswordImpl,
|
|
2367
|
+
Tr as ArchbaseViewSecurityProvider,
|
|
2368
|
+
Oe as CONTEXT_STORAGE_KEY,
|
|
2369
|
+
ir as DefaultArchbaseTokenManager,
|
|
2370
|
+
Pr as DefaultSecurityLoading,
|
|
2367
2371
|
le as ENCRYPTION_KEY,
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2372
|
+
gt as FetchError,
|
|
2373
|
+
Ie as GroupDto,
|
|
2374
|
+
qr as PermissionDto,
|
|
2375
|
+
ke as ProfileDto,
|
|
2376
|
+
It as ResourceDto,
|
|
2377
|
+
ve as SecurityDto,
|
|
2378
|
+
ge as SecurityType,
|
|
2379
|
+
$e as TOKEN_COOKIE_NAME,
|
|
2380
|
+
xr as TipoRecurso,
|
|
2381
|
+
Le as USER_NAME,
|
|
2382
|
+
Be as USER_NAME_AND_PASSWORD,
|
|
2383
|
+
Ne as UserDto,
|
|
2384
|
+
Ke as UserGroupDto,
|
|
2385
|
+
yr as createInternalConfig,
|
|
2386
|
+
Ue as decodeJWT,
|
|
2387
|
+
fe as epochAtSecondsFromNow,
|
|
2388
|
+
at as epochTimeIsPast,
|
|
2389
|
+
pr as fetchTokens,
|
|
2390
|
+
fr as fetchWithRefreshToken,
|
|
2391
|
+
cr as generateCodeChallenge,
|
|
2392
|
+
ar as generateRandomString,
|
|
2393
|
+
mt as getRandomInteger,
|
|
2394
|
+
br as getRefreshExpiresIn,
|
|
2395
|
+
ze as isCredentialsExpiredError,
|
|
2396
|
+
dr as postWithXForm,
|
|
2397
|
+
ur as redirectToLogin,
|
|
2398
|
+
mr as redirectToLogout,
|
|
2399
|
+
es as useArchbaseAuthenticationManager,
|
|
2400
|
+
ts as useArchbaseGetCurrentToken,
|
|
2401
|
+
Cr as useArchbaseGetLoggedUser,
|
|
2402
|
+
os as useArchbasePermissionCheck,
|
|
2403
|
+
rs as useArchbaseResetPassword,
|
|
2404
|
+
ns as useArchbaseSecureForm,
|
|
2405
|
+
Ur as useArchbaseSecurity,
|
|
2406
|
+
Zr as useArchbaseSecurityManager,
|
|
2407
|
+
Kr as useArchbaseTenantManager,
|
|
2408
|
+
Ze as useArchbaseViewSecurity,
|
|
2409
|
+
Gr as useBrowserStorage,
|
|
2410
|
+
vr as validateConfig,
|
|
2411
|
+
gr as validateState,
|
|
2412
|
+
cs as withArchbaseSecurity
|
|
2409
2413
|
};
|