@archbase/security 4.0.39 → 4.0.41
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/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import * as
|
|
3
|
-
import { decorate as
|
|
4
|
-
import { compressString as
|
|
5
|
-
import
|
|
6
|
-
import { jwtDecode as
|
|
7
|
-
import { jsx as n, jsxs as
|
|
8
|
-
import
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import { ArchbaseRemoteApiService as
|
|
11
|
-
import { v4 as
|
|
12
|
-
import { Card as
|
|
13
|
-
import { useFocusTrap as
|
|
14
|
-
import { IconCopy as
|
|
15
|
-
import { ArchbaseQRCode as
|
|
16
|
-
import { useContainer as
|
|
17
|
-
class
|
|
2
|
+
import * as P from "inversify";
|
|
3
|
+
import { decorate as Bt, injectable as Lt } from "inversify";
|
|
4
|
+
import { compressString as Ot, decompressString as $t, IOCContainer as zt, ARCHBASE_IOC_API_TYPE as Y, processErrorMessage as oe, IsNotEmpty as X, IsOptional as ie, IsBoolean as te, IsEmail as jt, getKeyByEnumValue as Qe, useArchbasePasswordRemember as Ft, getI18nextInstance as x, useArchbaseTheme as Vt, isEmailValidate as Wt, useArchbaseAppContext as Ht } from "@archbase/core";
|
|
5
|
+
import G from "crypto-js";
|
|
6
|
+
import { jwtDecode as Gt } from "jwt-decode";
|
|
7
|
+
import { jsx as n, jsxs as C, Fragment as ne } from "react/jsx-runtime";
|
|
8
|
+
import it, { useState as p, useEffect as K, createContext as Ve, useMemo as at, useRef as ct, useCallback as Ce, useContext as We } from "react";
|
|
9
|
+
import { BehaviorSubject as Ze } from "rxjs";
|
|
10
|
+
import { ArchbaseRemoteApiService as ye, useArchbaseStore as lt } from "@archbase/data";
|
|
11
|
+
import { v4 as Q } from "uuid";
|
|
12
|
+
import { Card as He, Text as F, Divider as Ue, Stack as Ee, TextInput as xe, Button as H, Anchor as et, Group as de, Select as Jt, Tooltip as Kt, Loader as dt, PasswordInput as ze, Checkbox as qt, Alert as tt, Code as rt, CopyButton as st, SimpleGrid as Yt, useMantineColorScheme as Xt, Box as Qt, Skeleton as Ie } from "@mantine/core";
|
|
13
|
+
import { useFocusTrap as ut } from "@mantine/hooks";
|
|
14
|
+
import { IconCopy as Zt } from "@tabler/icons-react";
|
|
15
|
+
import { ArchbaseQRCode as er, ArchbaseDialog as ot } from "@archbase/components";
|
|
16
|
+
import { useContainer as De } from "inversify-react";
|
|
17
|
+
class ht {
|
|
18
18
|
id;
|
|
19
19
|
displayName;
|
|
20
20
|
email;
|
|
@@ -24,10 +24,10 @@ class lt {
|
|
|
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 ht({});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
class
|
|
30
|
+
class pt {
|
|
31
31
|
username;
|
|
32
32
|
password;
|
|
33
33
|
remember;
|
|
@@ -35,16 +35,16 @@ class dt {
|
|
|
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 pt({});
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
class
|
|
41
|
+
const ce = "YngzI1guK3dGaElFcFY9MywqK3xgPzg/Ojg7eD8xRmg=", Me = "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 tr {
|
|
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 = G.AES.decrypt(e, ce).toString(G.enc.Utf8), o = atob(t).split(":");
|
|
48
48
|
return { username: o[0], password: o[1], remember: !0 };
|
|
49
49
|
} else
|
|
50
50
|
return null;
|
|
@@ -53,14 +53,14 @@ class Zt {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
saveUsernameAndPassword(e, t) {
|
|
56
|
-
const s = btoa(`${e}:${t}`), o =
|
|
57
|
-
localStorage.setItem(
|
|
56
|
+
const s = btoa(`${e}:${t}`), o = G.AES.encrypt(s, ce).toString();
|
|
57
|
+
localStorage.setItem(Be, o);
|
|
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 = G.AES.decrypt(e, ce).toString(G.enc.Utf8);
|
|
64
64
|
return atob(t);
|
|
65
65
|
} else
|
|
66
66
|
return null;
|
|
@@ -69,42 +69,42 @@ class Zt {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
saveUsername(e) {
|
|
72
|
-
const t = btoa(e), s =
|
|
73
|
-
localStorage.setItem(
|
|
72
|
+
const t = btoa(e), s = G.AES.encrypt(t, ce).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 o =
|
|
80
|
+
const o = Gt(s.access_token);
|
|
81
81
|
if (!o)
|
|
82
82
|
return !0;
|
|
83
|
-
const
|
|
84
|
-
return
|
|
83
|
+
const a = Math.floor(Date.now() / 1e3), c = o.exp;
|
|
84
|
+
return a > c - 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 = G.AES.encrypt(t, ce).toString(), o = Ot(s);
|
|
92
|
+
localStorage.setItem(Me, o);
|
|
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(Me);
|
|
101
101
|
}
|
|
102
102
|
getToken() {
|
|
103
103
|
try {
|
|
104
|
-
const e = localStorage.getItem(
|
|
104
|
+
const e = localStorage.getItem(Me);
|
|
105
105
|
if (!e)
|
|
106
106
|
return null;
|
|
107
|
-
const t =
|
|
107
|
+
const t = $t(e), s = G.AES.decrypt(t, ce).toString(G.enc.Utf8);
|
|
108
108
|
return JSON.parse(s);
|
|
109
109
|
} catch {
|
|
110
110
|
return null;
|
|
@@ -112,37 +112,37 @@ class Zt {
|
|
|
112
112
|
}
|
|
113
113
|
saveContext(e) {
|
|
114
114
|
try {
|
|
115
|
-
const t =
|
|
116
|
-
localStorage.setItem(
|
|
115
|
+
const t = G.AES.encrypt(e, ce).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 ? G.AES.decrypt(e, ce).toString(G.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
|
+
Bt(Lt(), tr);
|
|
134
|
+
function ft(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 ? ft(r) : t[0] % r;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function rr(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(ft(t.length - 1));
|
|
143
143
|
return e;
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
145
|
+
async function sr(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 tr(r) {
|
|
|
150
150
|
const t = new TextEncoder().encode(r), s = await window.crypto.subtle.digest("SHA-256", t), o = String.fromCharCode(...new Uint8Array(s));
|
|
151
151
|
return btoa(o).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
152
152
|
}
|
|
153
|
-
class
|
|
153
|
+
class mt 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 or(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 nr(r, e) {
|
|
167
167
|
return fetch(r, {
|
|
168
168
|
method: "POST",
|
|
169
|
-
body:
|
|
169
|
+
body: or(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 mt(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 gt = "PKCE_code_verifier", je = "ROCP_auth_state";
|
|
180
|
+
async function ir(r, e) {
|
|
181
|
+
const t = rr(96);
|
|
182
|
+
return sessionStorage.setItem(gt, t), sr(t).then((s) => {
|
|
183
183
|
const o = new URLSearchParams({
|
|
184
184
|
response_type: "code",
|
|
185
185
|
client_id: r.clientId,
|
|
@@ -188,23 +188,23 @@ async function or(r, e) {
|
|
|
188
188
|
code_challenge_method: "S256",
|
|
189
189
|
...r.extraAuthParameters
|
|
190
190
|
});
|
|
191
|
-
r.scope !== void 0 && o.append("scope", r.scope), sessionStorage.removeItem(
|
|
192
|
-
const
|
|
193
|
-
|
|
191
|
+
r.scope !== void 0 && o.append("scope", r.scope), sessionStorage.removeItem(je);
|
|
192
|
+
const a = e ?? r.state;
|
|
193
|
+
a && (sessionStorage.setItem(je, a), o.append("state", a)), r?.preLogin && r.preLogin(), window.location.replace(`${r.authorizationEndpoint}?${o.toString()}`);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function ar(r) {
|
|
197
197
|
return r.access_token !== void 0;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
201
|
-
if (
|
|
199
|
+
function yt(r, e) {
|
|
200
|
+
return nr(r, e).then((t) => t.json().then((s) => {
|
|
201
|
+
if (ar(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 cr = (r) => {
|
|
207
|
+
const t = new URLSearchParams(window.location.search).get("code"), s = window.sessionStorage.getItem(gt);
|
|
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 yt(r.tokenEndpoint, o);
|
|
225
|
+
}, lr = (r) => {
|
|
226
226
|
const { config: e, refreshToken: t } = r, s = {
|
|
227
227
|
grant_type: "refresh_token",
|
|
228
228
|
refresh_token: t,
|
|
@@ -231,101 +231,101 @@ A autenticação ocorreu?`);
|
|
|
231
231
|
redirect_uri: e.redirectUri,
|
|
232
232
|
...e.extraTokenParameters
|
|
233
233
|
};
|
|
234
|
-
return
|
|
234
|
+
return yt(e.tokenEndpoint, s);
|
|
235
235
|
};
|
|
236
|
-
function
|
|
237
|
-
const
|
|
236
|
+
function dr(r, e, t, s, o, a) {
|
|
237
|
+
const c = new URLSearchParams({
|
|
238
238
|
token: t || e,
|
|
239
239
|
token_type_hint: t ? "refresh_token" : "access_token",
|
|
240
240
|
client_id: r.clientId,
|
|
241
241
|
post_logout_redirect_uri: r.logoutRedirect ?? r.redirectUri,
|
|
242
|
-
ui_locales: window.navigator.languages.reduce((
|
|
242
|
+
ui_locales: window.navigator.languages.reduce((i, l) => i + " " + l),
|
|
243
243
|
...r.extraLogoutParameters
|
|
244
244
|
});
|
|
245
|
-
s &&
|
|
245
|
+
s && c.append("id_token_hint", s), o && c.append("state", o), a && c.append("logout_hint", a), window.location.replace(`${r.logoutEndpoint}?${c.toString()}`);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
const e = r.get("state"), t = sessionStorage.getItem(
|
|
247
|
+
function ur(r) {
|
|
248
|
+
const e = r.get("state"), t = sessionStorage.getItem(je);
|
|
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
|
-
function
|
|
255
|
-
const s = t === "session" ? sessionStorage : localStorage, [o,
|
|
256
|
-
const
|
|
254
|
+
function le(r, e, t) {
|
|
255
|
+
const s = t === "session" ? sessionStorage : localStorage, [o, a] = p(() => {
|
|
256
|
+
const i = s.getItem(r);
|
|
257
257
|
try {
|
|
258
|
-
return
|
|
259
|
-
} catch (
|
|
258
|
+
return i ? JSON.parse(i) : e;
|
|
259
|
+
} catch (l) {
|
|
260
260
|
return console.warn(
|
|
261
261
|
`Falha ao analisar o valor armazenado para '${r}'.
|
|
262
262
|
Continuando com o valor padrão.
|
|
263
|
-
Error: ${
|
|
263
|
+
Error: ${l.message}`
|
|
264
264
|
), e;
|
|
265
265
|
}
|
|
266
|
-
}),
|
|
267
|
-
if (
|
|
268
|
-
|
|
266
|
+
}), c = (i) => {
|
|
267
|
+
if (i === void 0) {
|
|
268
|
+
a(i), s.removeItem(r);
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
try {
|
|
272
|
-
const
|
|
273
|
-
|
|
272
|
+
const l = i instanceof Function ? i(o) : i;
|
|
273
|
+
a(l), s.setItem(r, JSON.stringify(l));
|
|
274
274
|
} catch {
|
|
275
|
-
console.log(`Falha ao armazenar valor '${
|
|
275
|
+
console.log(`Falha ao armazenar valor '${i}' para chave '${r}'`);
|
|
276
276
|
}
|
|
277
277
|
};
|
|
278
|
-
return
|
|
279
|
-
const
|
|
280
|
-
|
|
278
|
+
return K(() => {
|
|
279
|
+
const i = (l) => {
|
|
280
|
+
l.storageArea === s && l.key === r && a(JSON.parse(l.newValue ?? ""));
|
|
281
281
|
};
|
|
282
|
-
return window.addEventListener("storage",
|
|
283
|
-
}), [o,
|
|
282
|
+
return window.addEventListener("storage", i, !1), () => window.removeEventListener("storage", i, !1);
|
|
283
|
+
}), [o, c];
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
286
286
|
__proto__: null,
|
|
287
|
-
default:
|
|
287
|
+
default: le
|
|
288
288
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
289
|
-
function
|
|
289
|
+
function Pe(r) {
|
|
290
290
|
return ["", void 0, null].includes(r);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function hr(r) {
|
|
293
293
|
const {
|
|
294
294
|
autoLogin: e = !0,
|
|
295
295
|
clearURL: t = !0,
|
|
296
296
|
decodeToken: s = !0,
|
|
297
297
|
scope: o = void 0,
|
|
298
|
-
preLogin:
|
|
299
|
-
postLogin:
|
|
300
|
-
onRefreshTokenExpire:
|
|
301
|
-
storage:
|
|
298
|
+
preLogin: a = () => null,
|
|
299
|
+
postLogin: c = () => null,
|
|
300
|
+
onRefreshTokenExpire: i = void 0,
|
|
301
|
+
storage: l = "local"
|
|
302
302
|
} = r, y = {
|
|
303
303
|
...r,
|
|
304
304
|
autoLogin: e,
|
|
305
305
|
clearURL: t,
|
|
306
306
|
decodeToken: s,
|
|
307
307
|
scope: o,
|
|
308
|
-
preLogin:
|
|
309
|
-
postLogin:
|
|
310
|
-
onRefreshTokenExpire:
|
|
311
|
-
storage:
|
|
308
|
+
preLogin: a,
|
|
309
|
+
postLogin: c,
|
|
310
|
+
onRefreshTokenExpire: i,
|
|
311
|
+
storage: l
|
|
312
312
|
};
|
|
313
|
-
return
|
|
313
|
+
return pr(y), y;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
if (
|
|
315
|
+
function pr(r) {
|
|
316
|
+
if (Pe(r?.clientId))
|
|
317
317
|
throw Error(
|
|
318
318
|
"'clientId' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
319
319
|
);
|
|
320
|
-
if (
|
|
320
|
+
if (Pe(r?.authorizationEndpoint))
|
|
321
321
|
throw Error(
|
|
322
322
|
"'authorizationEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
323
323
|
);
|
|
324
|
-
if (
|
|
324
|
+
if (Pe(r?.tokenEndpoint))
|
|
325
325
|
throw Error(
|
|
326
326
|
"'tokenEndpoint' deve ser definido no objeto 'ArchbaseAuthConfig' passado para ArchbaseAuthProvider"
|
|
327
327
|
);
|
|
328
|
-
if (
|
|
328
|
+
if (Pe(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 ur(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 nt(r) {
|
|
342
342
|
return Math.round(Date.now()) / 1e3 + 30 >= r;
|
|
343
343
|
}
|
|
344
|
-
const
|
|
344
|
+
const fr = [
|
|
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 mr(r, e) {
|
|
351
|
+
for (const t of fr)
|
|
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 Te = (r) => {
|
|
357
357
|
try {
|
|
358
358
|
const t = r.split(".")[1].replace(/-/g, "+").replace(/_/g, "/"), s = decodeURIComponent(
|
|
359
359
|
atob(t).split("").map(function(o) {
|
|
@@ -368,88 +368,88 @@ const Ce = (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
|
+
}, gr = 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
|
+
}), Fr = ({ authConfig: r, children: e }) => {
|
|
378
|
+
const t = at(() => hr(r), [r]), [s, o] = le(
|
|
379
379
|
"ROCP_refreshToken",
|
|
380
380
|
void 0,
|
|
381
381
|
t.storage
|
|
382
|
-
), [
|
|
382
|
+
), [a, c] = le(
|
|
383
383
|
"ROCP_refreshTokenExpire",
|
|
384
|
-
|
|
384
|
+
fe(2 * me),
|
|
385
385
|
t.storage
|
|
386
|
-
), [
|
|
386
|
+
), [i, l] = le("ROCP_token", "", t.storage), [y, E] = le(
|
|
387
387
|
"ROCP_tokenExpire",
|
|
388
|
-
|
|
388
|
+
fe(me),
|
|
389
389
|
t.storage
|
|
390
|
-
), [
|
|
390
|
+
), [d, R] = le(
|
|
391
391
|
"ROCP_idToken",
|
|
392
392
|
void 0,
|
|
393
393
|
t.storage
|
|
394
|
-
), [
|
|
394
|
+
), [A, g] = le(
|
|
395
395
|
"ROCP_loginInProgress",
|
|
396
396
|
!1,
|
|
397
397
|
t.storage
|
|
398
|
-
), [S,
|
|
398
|
+
), [S, D] = le(
|
|
399
399
|
"ROCP_refreshInProgress",
|
|
400
400
|
!1,
|
|
401
401
|
t.storage
|
|
402
|
-
), [
|
|
403
|
-
let
|
|
404
|
-
function
|
|
405
|
-
o(void 0),
|
|
402
|
+
), [N, B] = p(), [W, M] = p(), [b, w] = p(null);
|
|
403
|
+
let T;
|
|
404
|
+
function z() {
|
|
405
|
+
o(void 0), l(""), E(fe(me)), c(fe(me)), R(void 0), B(void 0), M(void 0), g(!1);
|
|
406
406
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
407
|
+
function O(f, v) {
|
|
408
|
+
z(), w(null), t?.logoutEndpoint && dr(t, i, s, d, f, v);
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
let
|
|
410
|
+
function L(f) {
|
|
411
|
+
z(), g(!0);
|
|
412
|
+
let v = f;
|
|
413
413
|
f && typeof f != "string" && (console.warn(
|
|
414
414
|
`O estado de login aprovado deve ser do tipo 'string'. Recebido'${f}'. Ignorando o valor...`
|
|
415
|
-
),
|
|
416
|
-
console.error(
|
|
415
|
+
), v = void 0), ir(t, v).catch((ee) => {
|
|
416
|
+
console.error(ee), w(ee.message), g(!1);
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
|
-
function
|
|
420
|
-
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
|
|
419
|
+
function U(f) {
|
|
420
|
+
l(f.access_token), o(f.refresh_token);
|
|
421
|
+
const v = t.tokenExpiresIn ?? f.expires_in ?? me;
|
|
422
|
+
E(fe(v));
|
|
423
|
+
const ee = t.refreshTokenExpiresIn ?? mr(v, f);
|
|
424
|
+
c(fe(ee)), R(f.id_token);
|
|
425
425
|
try {
|
|
426
|
-
f.id_token &&
|
|
427
|
-
} catch (
|
|
428
|
-
console.warn(`Falha ao decodificar idToken: ${
|
|
426
|
+
f.id_token && M(Te(f.id_token));
|
|
427
|
+
} catch (I) {
|
|
428
|
+
console.warn(`Falha ao decodificar idToken: ${I.message}`);
|
|
429
429
|
}
|
|
430
430
|
try {
|
|
431
|
-
t.decodeToken &&
|
|
432
|
-
} catch (
|
|
433
|
-
console.warn(`Falha ao decodificar o token de acesso: ${
|
|
431
|
+
t.decodeToken && B(Te(f.access_token));
|
|
432
|
+
} catch (I) {
|
|
433
|
+
console.warn(`Falha ao decodificar o token de acesso: ${I.message}`);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
function Z(f = !1) {
|
|
437
|
-
return f || !t.onRefreshTokenExpire ?
|
|
437
|
+
return f || !t.onRefreshTokenExpire ? L() : t.onRefreshTokenExpire({ login: L });
|
|
438
438
|
}
|
|
439
|
-
function
|
|
440
|
-
if (
|
|
441
|
-
if (
|
|
439
|
+
function q(f = !1) {
|
|
440
|
+
if (i && nt(y) && !(S && !f)) {
|
|
441
|
+
if (nt(a))
|
|
442
442
|
return Z(f);
|
|
443
443
|
if (s) {
|
|
444
|
-
|
|
445
|
-
if (
|
|
446
|
-
if (
|
|
444
|
+
D(!0), lr({ config: t, refreshToken: s }).then((v) => U(v)).catch((v) => {
|
|
445
|
+
if (v instanceof mt) {
|
|
446
|
+
if (v.status === 400)
|
|
447
447
|
return Z(f);
|
|
448
|
-
console.error(
|
|
448
|
+
console.error(v), w(v.message), f && L();
|
|
449
449
|
} else
|
|
450
|
-
|
|
450
|
+
v instanceof Error && (console.error(v), w(v.message), f && L());
|
|
451
451
|
}).finally(() => {
|
|
452
|
-
|
|
452
|
+
D(!1);
|
|
453
453
|
});
|
|
454
454
|
return;
|
|
455
455
|
}
|
|
@@ -458,55 +458,55 @@ const Ce = (r) => {
|
|
|
458
458
|
);
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
return
|
|
464
|
-
if (
|
|
461
|
+
K(() => (T = setInterval(() => q(), 1e4), () => clearInterval(T)), [i, s, a, y]);
|
|
462
|
+
const re = ct(!1);
|
|
463
|
+
return K(() => {
|
|
464
|
+
if (A) {
|
|
465
465
|
const f = new URLSearchParams(window.location.search);
|
|
466
466
|
if (!f.get("code")) {
|
|
467
|
-
const
|
|
468
|
-
console.error(
|
|
467
|
+
const v = f.get("error_description") || "Estado de autorização inválido. Atualizar a página pode resolver o problema.";
|
|
468
|
+
console.error(v), w(v), O();
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
if (!
|
|
472
|
-
|
|
471
|
+
if (!re.current) {
|
|
472
|
+
re.current = !0;
|
|
473
473
|
try {
|
|
474
|
-
|
|
475
|
-
} catch (
|
|
476
|
-
console.error(
|
|
474
|
+
ur(f);
|
|
475
|
+
} catch (v) {
|
|
476
|
+
console.error(v), w(v.message);
|
|
477
477
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}).catch((
|
|
481
|
-
console.error(
|
|
478
|
+
cr(t).then((v) => {
|
|
479
|
+
U(v), t?.postLogin && t.postLogin();
|
|
480
|
+
}).catch((v) => {
|
|
481
|
+
console.error(v), w(v.message);
|
|
482
482
|
}).finally(() => {
|
|
483
483
|
t.clearURL && window.history.replaceState(null, "", window.location.pathname), g(!1);
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
return;
|
|
487
487
|
}
|
|
488
|
-
if (!
|
|
489
|
-
return
|
|
488
|
+
if (!i && t.autoLogin)
|
|
489
|
+
return L();
|
|
490
490
|
try {
|
|
491
|
-
|
|
491
|
+
d && M(Te(d));
|
|
492
492
|
} catch (f) {
|
|
493
493
|
console.warn(`Falha ao decodificar idToken: ${f.message}`);
|
|
494
494
|
}
|
|
495
495
|
try {
|
|
496
|
-
t.decodeToken &&
|
|
496
|
+
t.decodeToken && B(Te(i));
|
|
497
497
|
} catch (f) {
|
|
498
498
|
console.warn(`Falha ao decodificar o token de acesso: ${f.message}`);
|
|
499
499
|
}
|
|
500
|
-
|
|
500
|
+
q(!0);
|
|
501
501
|
}, []), /* @__PURE__ */ n(
|
|
502
|
-
|
|
502
|
+
gr.Provider,
|
|
503
503
|
{
|
|
504
|
-
value: { token:
|
|
504
|
+
value: { token: i, tokenData: N, idToken: d, idTokenData: W, login: L, logOut: O, error: b, loginInProgress: A },
|
|
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 ft {
|
|
|
515
515
|
error;
|
|
516
516
|
isAdmin;
|
|
517
517
|
constructor(e, t, s) {
|
|
518
|
-
this.resourceService =
|
|
518
|
+
this.resourceService = zt.getContainer().get(Y.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 ft {
|
|
|
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 ft {
|
|
|
586
586
|
return [...this.actions];
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
class
|
|
589
|
+
class J {
|
|
590
590
|
static instance;
|
|
591
|
-
_currentTenant = new
|
|
592
|
-
_availableTenants = new
|
|
591
|
+
_currentTenant = new Ze(null);
|
|
592
|
+
_availableTenants = new Ze([]);
|
|
593
593
|
constructor() {
|
|
594
594
|
const e = localStorage.getItem("tenant_info");
|
|
595
595
|
if (e)
|
|
@@ -600,7 +600,7 @@ class G {
|
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
static getInstance() {
|
|
603
|
-
return
|
|
603
|
+
return J.instance || (J.instance = new J()), J.instance;
|
|
604
604
|
}
|
|
605
605
|
get currentTenant$() {
|
|
606
606
|
return this._currentTenant.asObservable();
|
|
@@ -629,15 +629,15 @@ class G {
|
|
|
629
629
|
return t && (e["X-TENANT-ID"] = t.id), e;
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
|
-
function
|
|
633
|
-
return
|
|
632
|
+
function Vr() {
|
|
633
|
+
return J.getInstance();
|
|
634
634
|
}
|
|
635
|
-
var
|
|
636
|
-
for (var o = void 0,
|
|
637
|
-
(
|
|
638
|
-
return o &&
|
|
639
|
-
},
|
|
640
|
-
const
|
|
635
|
+
var ge = /* @__PURE__ */ ((r) => (r.USER = "user", r.PROFILE = "profile", r.GROUP = "group", r))(ge || {}), yr = Object.defineProperty, k = (r, e, t, s) => {
|
|
636
|
+
for (var o = void 0, a = r.length - 1, c; a >= 0; a--)
|
|
637
|
+
(c = r[a]) && (o = c(e, t, o) || o);
|
|
638
|
+
return o && yr(e, t, o), o;
|
|
639
|
+
}, wr = /* @__PURE__ */ ((r) => (r.VIEW = "VIEW", r.API = "API", r))(wr || {});
|
|
640
|
+
const vt = class bt {
|
|
641
641
|
id;
|
|
642
642
|
code;
|
|
643
643
|
version;
|
|
@@ -648,20 +648,20 @@ const gt = class yt {
|
|
|
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 vr(t)) : [];
|
|
652
652
|
}
|
|
653
|
-
static newInstance = () => new
|
|
654
|
-
id:
|
|
653
|
+
static newInstance = () => new bt({
|
|
654
|
+
id: Q(),
|
|
655
655
|
intervals: []
|
|
656
656
|
});
|
|
657
657
|
};
|
|
658
|
-
|
|
659
|
-
|
|
658
|
+
k([
|
|
659
|
+
X({
|
|
660
660
|
message: "archbase:Informe a descrição do cronograma de acesso"
|
|
661
661
|
})
|
|
662
|
-
],
|
|
663
|
-
let
|
|
664
|
-
const
|
|
662
|
+
], vt.prototype, "description");
|
|
663
|
+
let At = vt;
|
|
664
|
+
const _e = class Et {
|
|
665
665
|
id;
|
|
666
666
|
code;
|
|
667
667
|
version;
|
|
@@ -674,30 +674,30 @@ const Ue = class vt {
|
|
|
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 At(e.accessSchedule) : void 0, this.dayOfWeek = e.dayOfWeek || 0, this.startTime = e.startTime || "", this.endTime = e.endTime || "";
|
|
678
678
|
}
|
|
679
|
-
static newInstance = () => new
|
|
680
|
-
id:
|
|
679
|
+
static newInstance = () => new Et({
|
|
680
|
+
id: Q(),
|
|
681
681
|
dayOfWeek: (/* @__PURE__ */ new Date()).getDay(),
|
|
682
682
|
startTime: "08:00",
|
|
683
683
|
endTime: "17:00"
|
|
684
684
|
});
|
|
685
685
|
};
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
],
|
|
689
|
-
|
|
690
|
-
|
|
686
|
+
k([
|
|
687
|
+
ie()
|
|
688
|
+
], _e.prototype, "accessSchedule");
|
|
689
|
+
k([
|
|
690
|
+
X({
|
|
691
691
|
message: "archbase:Informe a hora de início"
|
|
692
692
|
})
|
|
693
|
-
],
|
|
694
|
-
|
|
695
|
-
|
|
693
|
+
], _e.prototype, "startTime");
|
|
694
|
+
k([
|
|
695
|
+
X({
|
|
696
696
|
message: "archbase:Informe a hora de término"
|
|
697
697
|
})
|
|
698
|
-
],
|
|
699
|
-
let
|
|
700
|
-
class
|
|
698
|
+
], _e.prototype, "endTime");
|
|
699
|
+
let vr = _e;
|
|
700
|
+
class we {
|
|
701
701
|
id;
|
|
702
702
|
code;
|
|
703
703
|
version;
|
|
@@ -712,20 +712,20 @@ class me {
|
|
|
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
|
-
|
|
716
|
-
|
|
715
|
+
k([
|
|
716
|
+
X({
|
|
717
717
|
message: "archbase:Informe o nome"
|
|
718
718
|
})
|
|
719
|
-
],
|
|
720
|
-
|
|
721
|
-
|
|
719
|
+
], we.prototype, "name");
|
|
720
|
+
k([
|
|
721
|
+
X({
|
|
722
722
|
message: "archbase:Informe a descrição"
|
|
723
723
|
})
|
|
724
|
-
],
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
],
|
|
728
|
-
const
|
|
724
|
+
], we.prototype, "description");
|
|
725
|
+
k([
|
|
726
|
+
ie()
|
|
727
|
+
], we.prototype, "actions");
|
|
728
|
+
const ve = class xt {
|
|
729
729
|
id;
|
|
730
730
|
code;
|
|
731
731
|
version;
|
|
@@ -741,48 +741,48 @@ const fe = class bt {
|
|
|
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 St(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
|
|
747
|
-
id:
|
|
746
|
+
static newInstance = () => new xt({
|
|
747
|
+
id: Q(),
|
|
748
748
|
active: !0,
|
|
749
749
|
isNewAction: !0
|
|
750
750
|
});
|
|
751
751
|
};
|
|
752
|
-
|
|
753
|
-
|
|
752
|
+
k([
|
|
753
|
+
X({
|
|
754
754
|
message: "archbase:Informe o nome para a ação"
|
|
755
755
|
})
|
|
756
|
-
],
|
|
757
|
-
|
|
758
|
-
|
|
756
|
+
], ve.prototype, "name");
|
|
757
|
+
k([
|
|
758
|
+
X({
|
|
759
759
|
message: "archbase:Informe a descrição para a ação"
|
|
760
760
|
})
|
|
761
|
-
],
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
],
|
|
765
|
-
|
|
766
|
-
|
|
761
|
+
], ve.prototype, "description");
|
|
762
|
+
k([
|
|
763
|
+
ie()
|
|
764
|
+
], ve.prototype, "resource");
|
|
765
|
+
k([
|
|
766
|
+
X({
|
|
767
767
|
message: "archbase:Informe a categoria para a ação"
|
|
768
768
|
})
|
|
769
|
-
],
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
],
|
|
773
|
-
let
|
|
774
|
-
class
|
|
769
|
+
], ve.prototype, "category");
|
|
770
|
+
k([
|
|
771
|
+
te()
|
|
772
|
+
], ve.prototype, "active");
|
|
773
|
+
let br = ve;
|
|
774
|
+
class ke extends we {
|
|
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
|
|
781
|
-
id:
|
|
780
|
+
static newInstance = () => new ke({
|
|
781
|
+
id: Q(),
|
|
782
782
|
isNewProfile: !0
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
|
-
class
|
|
785
|
+
class Ge {
|
|
786
786
|
id;
|
|
787
787
|
code;
|
|
788
788
|
version;
|
|
@@ -792,25 +792,25 @@ class Ve {
|
|
|
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 Se(e.group) : void 0;
|
|
796
796
|
}
|
|
797
|
-
static newInstance = (e) => new
|
|
798
|
-
id:
|
|
797
|
+
static newInstance = (e) => new Ge({
|
|
798
|
+
id: Q(),
|
|
799
799
|
group: e
|
|
800
800
|
});
|
|
801
801
|
}
|
|
802
|
-
class
|
|
802
|
+
class Se extends we {
|
|
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
|
|
809
|
-
id:
|
|
808
|
+
static newInstance = () => new Se({
|
|
809
|
+
id: Q(),
|
|
810
810
|
isNewGroup: !0
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
-
const
|
|
813
|
+
const Re = class kt {
|
|
814
814
|
id;
|
|
815
815
|
code;
|
|
816
816
|
version;
|
|
@@ -827,34 +827,35 @@ const De = class At {
|
|
|
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
|
|
831
|
-
id:
|
|
830
|
+
static newInstance = () => new kt({
|
|
831
|
+
id: Q(),
|
|
832
832
|
actions: [],
|
|
833
833
|
active: !0,
|
|
834
834
|
isNewResource: !0
|
|
835
835
|
});
|
|
836
836
|
};
|
|
837
|
-
|
|
838
|
-
|
|
837
|
+
k([
|
|
838
|
+
X({
|
|
839
839
|
message: "archbase:Informe o nome para o recurso"
|
|
840
840
|
})
|
|
841
|
-
],
|
|
842
|
-
|
|
843
|
-
|
|
841
|
+
], Re.prototype, "name");
|
|
842
|
+
k([
|
|
843
|
+
X({
|
|
844
844
|
message: "archbase:Informe a descrição para o recurso"
|
|
845
845
|
})
|
|
846
|
-
],
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
],
|
|
850
|
-
let
|
|
851
|
-
const
|
|
846
|
+
], Re.prototype, "description");
|
|
847
|
+
k([
|
|
848
|
+
te()
|
|
849
|
+
], Re.prototype, "active");
|
|
850
|
+
let St = Re;
|
|
851
|
+
const V = class Ct extends we {
|
|
852
852
|
userName;
|
|
853
853
|
password;
|
|
854
854
|
changePasswordOnNextLogin;
|
|
855
855
|
allowPasswordChange;
|
|
856
856
|
allowMultipleLogins;
|
|
857
857
|
passwordNeverExpires;
|
|
858
|
+
passwordChangedAt;
|
|
858
859
|
accountDeactivated;
|
|
859
860
|
accountLocked;
|
|
860
861
|
unlimitedAccessHours;
|
|
@@ -868,10 +869,10 @@ const W = class xt extends me {
|
|
|
868
869
|
type;
|
|
869
870
|
isNewUser;
|
|
870
871
|
constructor(e) {
|
|
871
|
-
super(e), this.type =
|
|
872
|
+
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 At(e.accessSchedule) : void 0, this.groups = e.groups ? e.groups.map((t) => new Ge(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;
|
|
872
873
|
}
|
|
873
|
-
static newInstance = () => new
|
|
874
|
-
id:
|
|
874
|
+
static newInstance = () => new Ct({
|
|
875
|
+
id: Q(),
|
|
875
876
|
userName: "",
|
|
876
877
|
password: "",
|
|
877
878
|
groups: [],
|
|
@@ -882,54 +883,57 @@ const W = class xt extends me {
|
|
|
882
883
|
isNewUser: !0
|
|
883
884
|
});
|
|
884
885
|
};
|
|
885
|
-
|
|
886
|
-
|
|
886
|
+
k([
|
|
887
|
+
X({
|
|
887
888
|
message: "archbase:Informe o nome de usuário"
|
|
888
889
|
})
|
|
889
|
-
],
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
],
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
],
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
],
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
],
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
],
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
],
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
],
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
],
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
],
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
],
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
],
|
|
923
|
-
|
|
924
|
-
|
|
890
|
+
], V.prototype, "userName");
|
|
891
|
+
k([
|
|
892
|
+
te()
|
|
893
|
+
], V.prototype, "changePasswordOnNextLogin");
|
|
894
|
+
k([
|
|
895
|
+
te()
|
|
896
|
+
], V.prototype, "allowPasswordChange");
|
|
897
|
+
k([
|
|
898
|
+
te()
|
|
899
|
+
], V.prototype, "allowMultipleLogins");
|
|
900
|
+
k([
|
|
901
|
+
te()
|
|
902
|
+
], V.prototype, "passwordNeverExpires");
|
|
903
|
+
k([
|
|
904
|
+
ie()
|
|
905
|
+
], V.prototype, "passwordChangedAt");
|
|
906
|
+
k([
|
|
907
|
+
te()
|
|
908
|
+
], V.prototype, "accountDeactivated");
|
|
909
|
+
k([
|
|
910
|
+
te()
|
|
911
|
+
], V.prototype, "accountLocked");
|
|
912
|
+
k([
|
|
913
|
+
te()
|
|
914
|
+
], V.prototype, "unlimitedAccessHours");
|
|
915
|
+
k([
|
|
916
|
+
te()
|
|
917
|
+
], V.prototype, "isAdministrator");
|
|
918
|
+
k([
|
|
919
|
+
ie()
|
|
920
|
+
], V.prototype, "accessSchedule");
|
|
921
|
+
k([
|
|
922
|
+
ie()
|
|
923
|
+
], V.prototype, "groups");
|
|
924
|
+
k([
|
|
925
|
+
ie()
|
|
926
|
+
], V.prototype, "profile");
|
|
927
|
+
k([
|
|
928
|
+
jt(
|
|
925
929
|
{},
|
|
926
930
|
{
|
|
927
931
|
message: "archbase:Informe um email válido"
|
|
928
932
|
}
|
|
929
933
|
)
|
|
930
|
-
],
|
|
931
|
-
let
|
|
932
|
-
const
|
|
934
|
+
], V.prototype, "email");
|
|
935
|
+
let Ne = V;
|
|
936
|
+
const Je = class Fe {
|
|
933
937
|
id;
|
|
934
938
|
code;
|
|
935
939
|
version;
|
|
@@ -943,35 +947,35 @@ const We = class $e {
|
|
|
943
947
|
companyId;
|
|
944
948
|
projectId;
|
|
945
949
|
constructor(e) {
|
|
946
|
-
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 ?
|
|
950
|
+
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 ? Fe.createDtoFromJson(e.security) : void 0, this.action = e.action ? new br(e.action) : void 0, this.tenantId = e.tenantId || "", this.companyId = e.companyId || "", this.projectId = e.projectId || "";
|
|
947
951
|
}
|
|
948
952
|
static createDtoFromJson(e) {
|
|
949
953
|
switch (e.type) {
|
|
950
954
|
case "profile":
|
|
951
|
-
return new
|
|
955
|
+
return new ke(e);
|
|
952
956
|
case "group":
|
|
953
|
-
return new
|
|
957
|
+
return new Se(e);
|
|
954
958
|
case "user":
|
|
955
|
-
return new
|
|
959
|
+
return new Ne(e);
|
|
956
960
|
default:
|
|
957
961
|
throw new Error("Unknown DTO type");
|
|
958
962
|
}
|
|
959
963
|
}
|
|
960
|
-
static newInstance = () => new
|
|
961
|
-
id:
|
|
964
|
+
static newInstance = () => new Fe({
|
|
965
|
+
id: Q(),
|
|
962
966
|
tenantId: "",
|
|
963
967
|
companyId: "",
|
|
964
968
|
projectId: ""
|
|
965
969
|
});
|
|
966
970
|
};
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
],
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
],
|
|
973
|
-
let
|
|
974
|
-
class
|
|
971
|
+
k([
|
|
972
|
+
ie()
|
|
973
|
+
], Je.prototype, "security");
|
|
974
|
+
k([
|
|
975
|
+
ie()
|
|
976
|
+
], Je.prototype, "action");
|
|
977
|
+
let Wr = Je;
|
|
978
|
+
class Ke {
|
|
975
979
|
id;
|
|
976
980
|
code;
|
|
977
981
|
version;
|
|
@@ -989,13 +993,13 @@ class He {
|
|
|
989
993
|
activated;
|
|
990
994
|
isNovoToken;
|
|
991
995
|
constructor(e) {
|
|
992
|
-
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
|
|
996
|
+
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;
|
|
993
997
|
}
|
|
994
|
-
static newInstance = () => new
|
|
995
|
-
id:
|
|
998
|
+
static newInstance = () => new Ke({
|
|
999
|
+
id: Q()
|
|
996
1000
|
});
|
|
997
1001
|
}
|
|
998
|
-
class
|
|
1002
|
+
class qe {
|
|
999
1003
|
id;
|
|
1000
1004
|
code;
|
|
1001
1005
|
version;
|
|
@@ -1012,23 +1016,23 @@ class Ge {
|
|
|
1012
1016
|
user;
|
|
1013
1017
|
isNewAccessToken;
|
|
1014
1018
|
constructor(e) {
|
|
1015
|
-
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
|
|
1019
|
+
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;
|
|
1016
1020
|
}
|
|
1017
|
-
static newInstance = () => new
|
|
1018
|
-
id:
|
|
1021
|
+
static newInstance = () => new qe({
|
|
1022
|
+
id: Q(),
|
|
1019
1023
|
active: !0,
|
|
1020
1024
|
isNewAccessToken: !0
|
|
1021
1025
|
});
|
|
1022
1026
|
}
|
|
1023
|
-
class
|
|
1027
|
+
class It extends ye {
|
|
1024
1028
|
constructor(e) {
|
|
1025
1029
|
super(e);
|
|
1026
1030
|
}
|
|
1027
1031
|
configureHeaders() {
|
|
1028
|
-
return
|
|
1032
|
+
return J.getInstance().getHeaders();
|
|
1029
1033
|
}
|
|
1030
1034
|
transform(e) {
|
|
1031
|
-
return new
|
|
1035
|
+
return new Ne(e);
|
|
1032
1036
|
}
|
|
1033
1037
|
getEndpoint() {
|
|
1034
1038
|
return "/api/v1/user";
|
|
@@ -1047,17 +1051,17 @@ class kt extends pe {
|
|
|
1047
1051
|
return this.transform(t);
|
|
1048
1052
|
}
|
|
1049
1053
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
class
|
|
1054
|
+
P.decorate(P.inject(Y.ApiClient), It, 0);
|
|
1055
|
+
P.decorate(P.injectable(), It);
|
|
1056
|
+
class Pt extends ye {
|
|
1053
1057
|
constructor(e) {
|
|
1054
1058
|
super(e);
|
|
1055
1059
|
}
|
|
1056
1060
|
configureHeaders() {
|
|
1057
|
-
return
|
|
1061
|
+
return J.getInstance().getHeaders();
|
|
1058
1062
|
}
|
|
1059
1063
|
transform(e) {
|
|
1060
|
-
return new
|
|
1064
|
+
return new Se(e);
|
|
1061
1065
|
}
|
|
1062
1066
|
getEndpoint() {
|
|
1063
1067
|
return "/api/v1/group";
|
|
@@ -1069,17 +1073,17 @@ class St extends pe {
|
|
|
1069
1073
|
return e.isNewGroup;
|
|
1070
1074
|
}
|
|
1071
1075
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
class
|
|
1076
|
+
P.decorate(P.inject(Y.ApiClient), Pt, 0);
|
|
1077
|
+
P.decorate(P.injectable(), Pt);
|
|
1078
|
+
class Tt extends ye {
|
|
1075
1079
|
constructor(e) {
|
|
1076
1080
|
super(e);
|
|
1077
1081
|
}
|
|
1078
1082
|
configureHeaders() {
|
|
1079
|
-
return
|
|
1083
|
+
return J.getInstance().getHeaders();
|
|
1080
1084
|
}
|
|
1081
1085
|
transform(e) {
|
|
1082
|
-
return new
|
|
1086
|
+
return new ke(e);
|
|
1083
1087
|
}
|
|
1084
1088
|
getEndpoint() {
|
|
1085
1089
|
return "/api/v1/userProfile";
|
|
@@ -1091,17 +1095,17 @@ class It extends pe {
|
|
|
1091
1095
|
return e.isNewProfile;
|
|
1092
1096
|
}
|
|
1093
1097
|
}
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
class
|
|
1098
|
+
P.decorate(P.inject(Y.ApiClient), Tt, 0);
|
|
1099
|
+
P.decorate(P.injectable(), Tt);
|
|
1100
|
+
class Ut extends ye {
|
|
1097
1101
|
constructor(e) {
|
|
1098
1102
|
super(e);
|
|
1099
1103
|
}
|
|
1100
1104
|
configureHeaders() {
|
|
1101
|
-
return
|
|
1105
|
+
return J.getInstance().getHeaders();
|
|
1102
1106
|
}
|
|
1103
1107
|
transform(e) {
|
|
1104
|
-
return new
|
|
1108
|
+
return new Ke(e);
|
|
1105
1109
|
}
|
|
1106
1110
|
getEndpoint() {
|
|
1107
1111
|
return "/api/v1/apiToken";
|
|
@@ -1113,12 +1117,12 @@ class Ct extends pe {
|
|
|
1113
1117
|
return e.isNovoToken;
|
|
1114
1118
|
}
|
|
1115
1119
|
async create(e, t, s, o) {
|
|
1116
|
-
const
|
|
1120
|
+
const a = await this.client.post(
|
|
1117
1121
|
`${this.getEndpoint()}/create?email=${e}&expirationDate=${t}&name=${s}&description=${o}`,
|
|
1118
1122
|
void 0,
|
|
1119
1123
|
this.configureHeaders()
|
|
1120
1124
|
);
|
|
1121
|
-
return this.transform(
|
|
1125
|
+
return this.transform(a);
|
|
1122
1126
|
}
|
|
1123
1127
|
async revoke(e) {
|
|
1124
1128
|
await this.client.post(
|
|
@@ -1128,17 +1132,17 @@ class Ct extends pe {
|
|
|
1128
1132
|
);
|
|
1129
1133
|
}
|
|
1130
1134
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
class
|
|
1135
|
+
P.decorate(P.inject(Y.ApiClient), Ut, 0);
|
|
1136
|
+
P.decorate(P.injectable(), Ut);
|
|
1137
|
+
class Dt extends ye {
|
|
1134
1138
|
constructor(e) {
|
|
1135
1139
|
super(e);
|
|
1136
1140
|
}
|
|
1137
1141
|
configureHeaders() {
|
|
1138
|
-
return
|
|
1142
|
+
return J.getInstance().getHeaders();
|
|
1139
1143
|
}
|
|
1140
1144
|
transform(e) {
|
|
1141
|
-
return new
|
|
1145
|
+
return new qe(e);
|
|
1142
1146
|
}
|
|
1143
1147
|
getEndpoint() {
|
|
1144
1148
|
return "/api/v1/accessToken";
|
|
@@ -1157,17 +1161,17 @@ class Pt extends pe {
|
|
|
1157
1161
|
);
|
|
1158
1162
|
}
|
|
1159
1163
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
class
|
|
1164
|
+
P.decorate(P.inject(Y.ApiClient), Dt, 0);
|
|
1165
|
+
P.decorate(P.injectable(), Dt);
|
|
1166
|
+
class _t extends ye {
|
|
1163
1167
|
constructor(e) {
|
|
1164
1168
|
super(e);
|
|
1165
1169
|
}
|
|
1166
1170
|
configureHeaders() {
|
|
1167
|
-
return
|
|
1171
|
+
return J.getInstance().getHeaders();
|
|
1168
1172
|
}
|
|
1169
1173
|
transform(e) {
|
|
1170
|
-
return new
|
|
1174
|
+
return new St(e);
|
|
1171
1175
|
}
|
|
1172
1176
|
getEndpoint() {
|
|
1173
1177
|
return "/api/v1/resource";
|
|
@@ -1191,7 +1195,7 @@ class Tt extends pe {
|
|
|
1191
1195
|
!1,
|
|
1192
1196
|
{
|
|
1193
1197
|
params: {
|
|
1194
|
-
type:
|
|
1198
|
+
type: Qe(ge, t)
|
|
1195
1199
|
}
|
|
1196
1200
|
}
|
|
1197
1201
|
);
|
|
@@ -1202,7 +1206,7 @@ class Tt extends pe {
|
|
|
1202
1206
|
{
|
|
1203
1207
|
securityId: e,
|
|
1204
1208
|
actionId: t,
|
|
1205
|
-
type:
|
|
1209
|
+
type: Qe(ge, s)
|
|
1206
1210
|
},
|
|
1207
1211
|
this.configureHeaders()
|
|
1208
1212
|
);
|
|
@@ -1221,70 +1225,70 @@ class Tt extends pe {
|
|
|
1221
1225
|
);
|
|
1222
1226
|
}
|
|
1223
1227
|
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
function
|
|
1228
|
+
P.decorate(P.inject(Y.ApiClient), _t, 0);
|
|
1229
|
+
P.decorate(P.injectable(), _t);
|
|
1230
|
+
function Hr({
|
|
1227
1231
|
onLogin: r,
|
|
1228
1232
|
error: e,
|
|
1229
1233
|
onClickForgotPassword: t,
|
|
1230
1234
|
loginLabel: s = "Email",
|
|
1231
1235
|
loginPlaceholder: o,
|
|
1232
|
-
afterInputs:
|
|
1233
|
-
showMockUsersSelector:
|
|
1234
|
-
mockUsers:
|
|
1235
|
-
mockUsersGroupMap:
|
|
1236
|
+
afterInputs: a,
|
|
1237
|
+
showMockUsersSelector: c = !1,
|
|
1238
|
+
mockUsers: i = [],
|
|
1239
|
+
mockUsersGroupMap: l,
|
|
1236
1240
|
options: y = {},
|
|
1237
|
-
onChangeUsername:
|
|
1238
|
-
disabledLogin:
|
|
1239
|
-
isCheckingUsername:
|
|
1240
|
-
showSignIn:
|
|
1241
|
+
onChangeUsername: E,
|
|
1242
|
+
disabledLogin: d = !1,
|
|
1243
|
+
isCheckingUsername: R = !1,
|
|
1244
|
+
showSignIn: A = !0,
|
|
1241
1245
|
mfaRequired: g = !1,
|
|
1242
1246
|
onVerifyMfa: S,
|
|
1243
|
-
mfaError:
|
|
1244
|
-
onCancelMfa:
|
|
1245
|
-
isVerifyingMfa:
|
|
1247
|
+
mfaError: D,
|
|
1248
|
+
onCancelMfa: N,
|
|
1249
|
+
isVerifyingMfa: B = !1
|
|
1246
1250
|
}) {
|
|
1247
|
-
const
|
|
1248
|
-
username:
|
|
1249
|
-
password:
|
|
1251
|
+
const W = ut(), {
|
|
1252
|
+
username: M,
|
|
1253
|
+
password: b,
|
|
1250
1254
|
rememberMe: w,
|
|
1251
|
-
clearRememberMe:
|
|
1252
|
-
} =
|
|
1253
|
-
|
|
1255
|
+
clearRememberMe: T
|
|
1256
|
+
} = Ft(), [z, O] = p(M), [L, U] = p(b), [Z, q] = p(w), [re, f] = p(!1), [v, ee] = p(null), [I, he] = p("");
|
|
1257
|
+
K(() => {
|
|
1254
1258
|
f(!!e);
|
|
1255
|
-
}, [e]),
|
|
1256
|
-
|
|
1257
|
-
}, [
|
|
1258
|
-
const
|
|
1259
|
+
}, [e]), K(() => {
|
|
1260
|
+
M !== z && (O(M), E?.(M)), b !== L && U(b), w !== Z && q(w);
|
|
1261
|
+
}, [M, b, w]);
|
|
1262
|
+
const se = () => {
|
|
1259
1263
|
f(!1);
|
|
1260
|
-
},
|
|
1261
|
-
|
|
1262
|
-
},
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1265
|
-
},
|
|
1266
|
-
if (!
|
|
1267
|
-
return
|
|
1268
|
-
value:
|
|
1269
|
-
label:
|
|
1264
|
+
}, be = () => {
|
|
1265
|
+
z && L && r(z, L, Z).finally(() => f(!0));
|
|
1266
|
+
}, ae = () => {
|
|
1267
|
+
const h = I.trim();
|
|
1268
|
+
h && S && S(h);
|
|
1269
|
+
}, ue = () => {
|
|
1270
|
+
if (!l)
|
|
1271
|
+
return i.map((m) => ({
|
|
1272
|
+
value: m.email,
|
|
1273
|
+
label: m.email
|
|
1270
1274
|
}));
|
|
1271
|
-
const
|
|
1272
|
-
const
|
|
1273
|
-
return
|
|
1274
|
-
value:
|
|
1275
|
-
label:
|
|
1276
|
-
})),
|
|
1275
|
+
const h = i.reduce((m, _) => {
|
|
1276
|
+
const j = l[_.type];
|
|
1277
|
+
return j && (m[j] || (m[j] = []), m[j].push({
|
|
1278
|
+
value: _.email,
|
|
1279
|
+
label: _.email
|
|
1280
|
+
})), m;
|
|
1277
1281
|
}, {});
|
|
1278
|
-
return Object.entries(
|
|
1279
|
-
group:
|
|
1280
|
-
items:
|
|
1282
|
+
return Object.entries(h).map(([m, _]) => ({
|
|
1283
|
+
group: m,
|
|
1284
|
+
items: _
|
|
1281
1285
|
}));
|
|
1282
|
-
},
|
|
1283
|
-
if (
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1286
|
+
}, pe = () => {
|
|
1287
|
+
if (v) {
|
|
1288
|
+
const h = i.find((m) => m.email === v);
|
|
1289
|
+
h && (O(h.email), U(h.password), se());
|
|
1286
1290
|
}
|
|
1287
|
-
},
|
|
1291
|
+
}, u = {
|
|
1288
1292
|
withBorder: !0,
|
|
1289
1293
|
shadow: "md",
|
|
1290
1294
|
p: 30,
|
|
@@ -1293,142 +1297,142 @@ function Vr({
|
|
|
1293
1297
|
w: 400,
|
|
1294
1298
|
...y.cardProps
|
|
1295
1299
|
};
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
|
|
1300
|
+
return /* @__PURE__ */ C(
|
|
1301
|
+
He,
|
|
1298
1302
|
{
|
|
1299
|
-
...
|
|
1303
|
+
...u,
|
|
1300
1304
|
pos: "relative",
|
|
1301
|
-
ref:
|
|
1305
|
+
ref: W,
|
|
1302
1306
|
children: [
|
|
1303
|
-
|
|
1307
|
+
A && /* @__PURE__ */ C(ne, { children: [
|
|
1304
1308
|
/* @__PURE__ */ n(
|
|
1305
|
-
|
|
1309
|
+
F,
|
|
1306
1310
|
{
|
|
1307
1311
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1308
1312
|
fw: 800,
|
|
1309
1313
|
fz: { base: "20px", md: "35px" },
|
|
1310
1314
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1311
1315
|
mt: "xs",
|
|
1312
|
-
children:
|
|
1316
|
+
children: x().t("archbase:signIn")
|
|
1313
1317
|
}
|
|
1314
1318
|
),
|
|
1315
|
-
/* @__PURE__ */ n(
|
|
1319
|
+
/* @__PURE__ */ n(Ue, { m: "md" })
|
|
1316
1320
|
] }),
|
|
1317
1321
|
y?.customContentBefore,
|
|
1318
|
-
g && /* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */ n(
|
|
1321
|
-
/* @__PURE__ */ n(
|
|
1322
|
+
g && /* @__PURE__ */ C(Ee, { gap: "md", children: [
|
|
1323
|
+
/* @__PURE__ */ C("div", { children: [
|
|
1324
|
+
/* @__PURE__ */ n(F, { fw: 700, fz: "lg", children: x().t("archbase:mfa.title", "Verificação em duas etapas") }),
|
|
1325
|
+
/* @__PURE__ */ n(F, { c: "dimmed", fz: "sm", children: x().t(
|
|
1322
1326
|
"archbase:mfa.subtitle",
|
|
1323
1327
|
"Digite o código do seu aplicativo autenticador (ou um código de recuperação)."
|
|
1324
1328
|
) })
|
|
1325
1329
|
] }),
|
|
1326
1330
|
/* @__PURE__ */ n(
|
|
1327
|
-
|
|
1331
|
+
xe,
|
|
1328
1332
|
{
|
|
1329
|
-
label:
|
|
1333
|
+
label: x().t("archbase:mfa.code", "Código de verificação"),
|
|
1330
1334
|
placeholder: "000000",
|
|
1331
|
-
value:
|
|
1335
|
+
value: I,
|
|
1332
1336
|
autoFocus: !0,
|
|
1333
|
-
onChange: (
|
|
1334
|
-
onKeyDown: (
|
|
1335
|
-
|
|
1337
|
+
onChange: (h) => he(h.currentTarget.value),
|
|
1338
|
+
onKeyDown: (h) => {
|
|
1339
|
+
h.key === "Enter" && ae();
|
|
1336
1340
|
}
|
|
1337
1341
|
}
|
|
1338
1342
|
),
|
|
1339
|
-
|
|
1343
|
+
D && /* @__PURE__ */ n(F, { c: "red", fz: "sm", children: D }),
|
|
1340
1344
|
/* @__PURE__ */ n(
|
|
1341
|
-
|
|
1345
|
+
H,
|
|
1342
1346
|
{
|
|
1343
1347
|
fullWidth: !0,
|
|
1344
|
-
disabled: !
|
|
1345
|
-
loading:
|
|
1346
|
-
onClick:
|
|
1347
|
-
children:
|
|
1348
|
+
disabled: !I.trim() || B,
|
|
1349
|
+
loading: B,
|
|
1350
|
+
onClick: ae,
|
|
1351
|
+
children: x().t("archbase:mfa.verify", "Verificar")
|
|
1348
1352
|
}
|
|
1349
1353
|
),
|
|
1350
|
-
|
|
1351
|
-
|
|
1354
|
+
N && /* @__PURE__ */ n(
|
|
1355
|
+
et,
|
|
1352
1356
|
{
|
|
1353
1357
|
component: "button",
|
|
1354
1358
|
c: "var(--mantine-text-color)",
|
|
1355
1359
|
fz: 14,
|
|
1356
1360
|
ta: "center",
|
|
1357
1361
|
styles: { root: { cursor: "pointer" } },
|
|
1358
|
-
onClick:
|
|
1359
|
-
children:
|
|
1362
|
+
onClick: N,
|
|
1363
|
+
children: x().t("archbase:mfa.back", "Voltar ao login")
|
|
1360
1364
|
}
|
|
1361
1365
|
)
|
|
1362
1366
|
] }),
|
|
1363
|
-
!g && /* @__PURE__ */
|
|
1364
|
-
|
|
1365
|
-
/* @__PURE__ */
|
|
1367
|
+
!g && /* @__PURE__ */ C(ne, { children: [
|
|
1368
|
+
c && /* @__PURE__ */ C(ne, { children: [
|
|
1369
|
+
/* @__PURE__ */ C(de, { gap: "sm", mb: "md", children: [
|
|
1366
1370
|
/* @__PURE__ */ n(
|
|
1367
|
-
|
|
1371
|
+
Jt,
|
|
1368
1372
|
{
|
|
1369
1373
|
placeholder: "Selecione um usuário mock",
|
|
1370
|
-
data:
|
|
1371
|
-
value:
|
|
1372
|
-
onChange: (
|
|
1374
|
+
data: ue(),
|
|
1375
|
+
value: v,
|
|
1376
|
+
onChange: (h) => ee(h ?? ""),
|
|
1373
1377
|
searchable: !0,
|
|
1374
1378
|
clearable: !0,
|
|
1375
1379
|
style: { flexGrow: 1 }
|
|
1376
1380
|
}
|
|
1377
1381
|
),
|
|
1378
|
-
/* @__PURE__ */ n(
|
|
1379
|
-
|
|
1382
|
+
/* @__PURE__ */ n(Kt, { label: "Aplicar", children: /* @__PURE__ */ n(
|
|
1383
|
+
H,
|
|
1380
1384
|
{
|
|
1381
1385
|
variant: "light",
|
|
1382
1386
|
size: "sm",
|
|
1383
|
-
onClick:
|
|
1384
|
-
disabled: !
|
|
1387
|
+
onClick: pe,
|
|
1388
|
+
disabled: !v,
|
|
1385
1389
|
"aria-label": "Aplicar usuário mock selecionado",
|
|
1386
|
-
children: /* @__PURE__ */ n(
|
|
1390
|
+
children: /* @__PURE__ */ n(Zt, { size: 16 })
|
|
1387
1391
|
}
|
|
1388
1392
|
) })
|
|
1389
1393
|
] }),
|
|
1390
|
-
/* @__PURE__ */ n(
|
|
1394
|
+
/* @__PURE__ */ n(Ue, { mb: "md" })
|
|
1391
1395
|
] }),
|
|
1392
1396
|
/* @__PURE__ */ n(
|
|
1393
|
-
|
|
1397
|
+
xe,
|
|
1394
1398
|
{
|
|
1395
1399
|
label: s,
|
|
1396
|
-
placeholder: o ??
|
|
1397
|
-
rightSection:
|
|
1398
|
-
value:
|
|
1400
|
+
placeholder: o ?? x().t("archbase:usuario@email.com"),
|
|
1401
|
+
rightSection: R ? /* @__PURE__ */ n(dt, { size: "xs" }) : null,
|
|
1402
|
+
value: z || "",
|
|
1399
1403
|
required: !0,
|
|
1400
|
-
onChange: (
|
|
1401
|
-
|
|
1404
|
+
onChange: (h) => {
|
|
1405
|
+
O(h.currentTarget.value), E?.(h.currentTarget.value), se();
|
|
1402
1406
|
}
|
|
1403
1407
|
}
|
|
1404
1408
|
),
|
|
1405
1409
|
/* @__PURE__ */ n(
|
|
1406
|
-
|
|
1410
|
+
ze,
|
|
1407
1411
|
{
|
|
1408
|
-
label:
|
|
1409
|
-
placeholder:
|
|
1410
|
-
onChange: (
|
|
1411
|
-
|
|
1412
|
+
label: x().t("archbase:Password"),
|
|
1413
|
+
placeholder: x().t("archbase:Sua senha"),
|
|
1414
|
+
onChange: (h) => {
|
|
1415
|
+
U(h.currentTarget.value), se();
|
|
1412
1416
|
},
|
|
1413
|
-
value:
|
|
1417
|
+
value: L || "",
|
|
1414
1418
|
required: !0,
|
|
1415
1419
|
mt: "md"
|
|
1416
1420
|
}
|
|
1417
1421
|
),
|
|
1418
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ C(de, { justify: "space-between", mt: "md", children: [
|
|
1419
1423
|
/* @__PURE__ */ n(
|
|
1420
|
-
|
|
1424
|
+
qt,
|
|
1421
1425
|
{
|
|
1422
|
-
label:
|
|
1426
|
+
label: x().t("archbase:Lembre-me"),
|
|
1423
1427
|
checked: Z,
|
|
1424
|
-
onChange: (
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1428
|
+
onChange: (h) => {
|
|
1429
|
+
const m = h.currentTarget.checked;
|
|
1430
|
+
q(m), m || T();
|
|
1427
1431
|
}
|
|
1428
1432
|
}
|
|
1429
1433
|
),
|
|
1430
1434
|
t && /* @__PURE__ */ n(
|
|
1431
|
-
|
|
1435
|
+
et,
|
|
1432
1436
|
{
|
|
1433
1437
|
component: "button",
|
|
1434
1438
|
c: "var(--mantine-text-color)",
|
|
@@ -1436,477 +1440,510 @@ function Vr({
|
|
|
1436
1440
|
lh: "20px",
|
|
1437
1441
|
styles: { root: { cursor: "pointer" } },
|
|
1438
1442
|
onClick: t,
|
|
1439
|
-
children:
|
|
1443
|
+
children: x().t("archbase:Esqueci minha senha")
|
|
1440
1444
|
}
|
|
1441
1445
|
)
|
|
1442
1446
|
] }),
|
|
1443
|
-
y?.afterInputs ||
|
|
1447
|
+
y?.afterInputs || a,
|
|
1444
1448
|
/* @__PURE__ */ n(
|
|
1445
|
-
|
|
1449
|
+
H,
|
|
1446
1450
|
{
|
|
1447
|
-
disabled: !
|
|
1451
|
+
disabled: !L || !z || d,
|
|
1448
1452
|
fullWidth: !0,
|
|
1449
1453
|
mt: "xl",
|
|
1450
|
-
onClick:
|
|
1451
|
-
children:
|
|
1454
|
+
onClick: be,
|
|
1455
|
+
children: x().t("archbase:signIn")
|
|
1452
1456
|
}
|
|
1453
1457
|
)
|
|
1454
1458
|
] }),
|
|
1455
1459
|
y?.customContentAfter,
|
|
1456
|
-
|
|
1460
|
+
re && e && /* @__PURE__ */ n(F, { c: "red", mt: "sm", children: e })
|
|
1457
1461
|
]
|
|
1458
1462
|
}
|
|
1459
1463
|
);
|
|
1460
1464
|
}
|
|
1461
|
-
const
|
|
1462
|
-
function
|
|
1465
|
+
const $ = (r, e) => x().t(r, e);
|
|
1466
|
+
function Gr({
|
|
1463
1467
|
enabled: r,
|
|
1464
1468
|
onSetup: e,
|
|
1465
1469
|
onEnable: t,
|
|
1466
1470
|
onDisable: s,
|
|
1467
1471
|
onStatusChange: o
|
|
1468
1472
|
}) {
|
|
1469
|
-
const [
|
|
1470
|
-
g(!0),
|
|
1473
|
+
const [a, c] = p("idle"), [i, l] = p(null), [y, E] = p(""), [d, R] = p([]), [A, g] = p(!1), [S, D] = p(null), N = async () => {
|
|
1474
|
+
g(!0), D(null);
|
|
1471
1475
|
try {
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
} catch (
|
|
1475
|
-
|
|
1476
|
+
const b = await e();
|
|
1477
|
+
l(b), E(""), c("setup");
|
|
1478
|
+
} catch (b) {
|
|
1479
|
+
D(b?.message || String(b));
|
|
1476
1480
|
} finally {
|
|
1477
1481
|
g(!1);
|
|
1478
1482
|
}
|
|
1479
|
-
},
|
|
1480
|
-
const
|
|
1481
|
-
if (
|
|
1482
|
-
g(!0),
|
|
1483
|
+
}, B = async () => {
|
|
1484
|
+
const b = y.trim();
|
|
1485
|
+
if (b) {
|
|
1486
|
+
g(!0), D(null);
|
|
1483
1487
|
try {
|
|
1484
|
-
const w = await t(
|
|
1485
|
-
|
|
1488
|
+
const w = await t(b);
|
|
1489
|
+
R(w), c("recovery"), o?.(!0);
|
|
1486
1490
|
} catch (w) {
|
|
1487
|
-
|
|
1491
|
+
D(w?.message || String(w));
|
|
1488
1492
|
} finally {
|
|
1489
1493
|
g(!1);
|
|
1490
1494
|
}
|
|
1491
1495
|
}
|
|
1492
|
-
},
|
|
1493
|
-
g(!0),
|
|
1496
|
+
}, W = async () => {
|
|
1497
|
+
g(!0), D(null);
|
|
1494
1498
|
try {
|
|
1495
|
-
await s(),
|
|
1496
|
-
} catch (
|
|
1497
|
-
|
|
1499
|
+
await s(), l(null), R([]), c("idle"), o?.(!1);
|
|
1500
|
+
} catch (b) {
|
|
1501
|
+
D(b?.message || String(b));
|
|
1498
1502
|
} finally {
|
|
1499
1503
|
g(!1);
|
|
1500
1504
|
}
|
|
1501
|
-
},
|
|
1502
|
-
|
|
1505
|
+
}, M = () => {
|
|
1506
|
+
R([]), l(null), E(""), c("idle");
|
|
1503
1507
|
};
|
|
1504
|
-
return /* @__PURE__ */ n(
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
/* @__PURE__ */ n(
|
|
1507
|
-
/* @__PURE__ */ n(
|
|
1508
|
+
return /* @__PURE__ */ n(He, { withBorder: !0, radius: "md", p: "lg", children: /* @__PURE__ */ C(Ee, { gap: "md", children: [
|
|
1509
|
+
/* @__PURE__ */ C("div", { children: [
|
|
1510
|
+
/* @__PURE__ */ n(F, { fw: 700, fz: "lg", children: $("archbase:mfa.setup.title", "Autenticação em duas etapas (MFA)") }),
|
|
1511
|
+
/* @__PURE__ */ n(F, { c: "dimmed", fz: "sm", children: $(
|
|
1508
1512
|
"archbase:mfa.setup.subtitle",
|
|
1509
1513
|
"Proteja o acesso exigindo um código do seu aplicativo autenticador no login."
|
|
1510
1514
|
) })
|
|
1511
1515
|
] }),
|
|
1512
|
-
S && /* @__PURE__ */ n(
|
|
1513
|
-
r &&
|
|
1514
|
-
/* @__PURE__ */ n(
|
|
1515
|
-
/* @__PURE__ */ n(
|
|
1516
|
+
S && /* @__PURE__ */ n(tt, { color: "red", children: S }),
|
|
1517
|
+
r && a === "idle" && /* @__PURE__ */ C(de, { justify: "space-between", children: [
|
|
1518
|
+
/* @__PURE__ */ n(F, { c: "teal", fw: 600, children: $("archbase:mfa.setup.active", "MFA ativo") }),
|
|
1519
|
+
/* @__PURE__ */ n(H, { color: "red", variant: "light", loading: A, onClick: W, children: $("archbase:mfa.setup.disable", "Desativar") })
|
|
1516
1520
|
] }),
|
|
1517
|
-
!r &&
|
|
1518
|
-
|
|
1519
|
-
/* @__PURE__ */ n(
|
|
1521
|
+
!r && a === "idle" && /* @__PURE__ */ n(H, { loading: A, onClick: N, children: $("archbase:mfa.setup.enable", "Ativar MFA") }),
|
|
1522
|
+
a === "setup" && i && /* @__PURE__ */ C(Ee, { gap: "sm", align: "center", children: [
|
|
1523
|
+
/* @__PURE__ */ n(F, { fz: "sm", ta: "center", children: $(
|
|
1520
1524
|
"archbase:mfa.setup.scan",
|
|
1521
1525
|
"Escaneie o QR Code no seu app autenticador (Google Authenticator, Authy…):"
|
|
1522
1526
|
) }),
|
|
1523
|
-
/* @__PURE__ */ n(
|
|
1524
|
-
/* @__PURE__ */ n(
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */ n(
|
|
1527
|
-
/* @__PURE__ */ n(
|
|
1527
|
+
/* @__PURE__ */ n(er, { value: i.provisioningUri, size: 180, level: "M" }),
|
|
1528
|
+
/* @__PURE__ */ n(F, { fz: "xs", c: "dimmed", ta: "center", children: $("archbase:mfa.setup.manual", "Ou informe o código manualmente:") }),
|
|
1529
|
+
/* @__PURE__ */ C(de, { gap: "xs", children: [
|
|
1530
|
+
/* @__PURE__ */ n(rt, { children: i.secret }),
|
|
1531
|
+
/* @__PURE__ */ n(st, { value: i.secret, children: ({ copied: b, copy: w }) => /* @__PURE__ */ n(H, { size: "xs", variant: "subtle", onClick: w, children: b ? $("archbase:mfa.setup.copied", "Copiado") : $("archbase:mfa.setup.copy", "Copiar") }) })
|
|
1528
1532
|
] }),
|
|
1529
1533
|
/* @__PURE__ */ n(
|
|
1530
|
-
|
|
1534
|
+
xe,
|
|
1531
1535
|
{
|
|
1532
1536
|
w: "100%",
|
|
1533
|
-
label:
|
|
1537
|
+
label: $("archbase:mfa.setup.confirmCode", "Digite o código gerado para confirmar"),
|
|
1534
1538
|
placeholder: "000000",
|
|
1535
1539
|
value: y,
|
|
1536
|
-
onChange: (
|
|
1537
|
-
onKeyDown: (
|
|
1538
|
-
|
|
1540
|
+
onChange: (b) => E(b.currentTarget.value),
|
|
1541
|
+
onKeyDown: (b) => {
|
|
1542
|
+
b.key === "Enter" && B();
|
|
1539
1543
|
}
|
|
1540
1544
|
}
|
|
1541
1545
|
),
|
|
1542
|
-
/* @__PURE__ */
|
|
1543
|
-
/* @__PURE__ */ n(
|
|
1544
|
-
/* @__PURE__ */ n(
|
|
1546
|
+
/* @__PURE__ */ C(de, { w: "100%", justify: "flex-end", children: [
|
|
1547
|
+
/* @__PURE__ */ n(H, { variant: "default", onClick: M, disabled: A, children: $("archbase:mfa.setup.cancel", "Cancelar") }),
|
|
1548
|
+
/* @__PURE__ */ n(H, { onClick: B, loading: A, disabled: !y.trim(), children: $("archbase:mfa.setup.confirm", "Confirmar e ativar") })
|
|
1545
1549
|
] })
|
|
1546
1550
|
] }),
|
|
1547
|
-
|
|
1548
|
-
/* @__PURE__ */ n(
|
|
1551
|
+
a === "recovery" && /* @__PURE__ */ C(Ee, { gap: "sm", children: [
|
|
1552
|
+
/* @__PURE__ */ n(tt, { color: "yellow", children: $(
|
|
1549
1553
|
"archbase:mfa.setup.recoveryWarning",
|
|
1550
1554
|
"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."
|
|
1551
1555
|
) }),
|
|
1552
|
-
/* @__PURE__ */ n(
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */ n(
|
|
1555
|
-
`), children: ({ copied:
|
|
1556
|
-
/* @__PURE__ */ n(
|
|
1556
|
+
/* @__PURE__ */ n(Yt, { cols: 2, spacing: "xs", children: d.map((b) => /* @__PURE__ */ n(rt, { fz: "sm", children: b }, b)) }),
|
|
1557
|
+
/* @__PURE__ */ C(de, { justify: "space-between", children: [
|
|
1558
|
+
/* @__PURE__ */ n(st, { value: d.join(`
|
|
1559
|
+
`), children: ({ copied: b, copy: w }) => /* @__PURE__ */ n(H, { variant: "subtle", onClick: w, children: b ? $("archbase:mfa.setup.copied", "Copiado") : $("archbase:mfa.setup.copyAll", "Copiar todos") }) }),
|
|
1560
|
+
/* @__PURE__ */ n(H, { onClick: M, children: $("archbase:mfa.setup.done", "Guardei os códigos") })
|
|
1557
1561
|
] })
|
|
1558
1562
|
] })
|
|
1559
1563
|
] }) });
|
|
1560
1564
|
}
|
|
1561
|
-
const
|
|
1565
|
+
const Ar = {
|
|
1562
1566
|
position: "relative",
|
|
1563
1567
|
width: "90%",
|
|
1564
1568
|
maxWidth: 400,
|
|
1565
1569
|
padding: 30,
|
|
1566
1570
|
marginTop: 30
|
|
1567
1571
|
};
|
|
1568
|
-
function
|
|
1569
|
-
const y =
|
|
1570
|
-
async function
|
|
1571
|
-
|
|
1572
|
-
|
|
1572
|
+
function Jr({ error: r, onSendResetPasswordEmail: e, onResetPassword: t, onClickBackToLogin: s, validatePassword: o, validateToken: a, initialEmail: c = "", description: i, style: l }) {
|
|
1573
|
+
const y = ut(), E = Vt(), { colorScheme: d } = Xt(), [R, A] = p(r ?? ""), [g, S] = p(c), [D, N] = p(""), [B, W] = p(""), [M, b] = p(""), [w, T] = p(!1), [z, O] = p(""), [L, U] = p(""), [Z, q] = p(""), [re, f] = p("");
|
|
1574
|
+
async function v(I) {
|
|
1575
|
+
I && (Wt(I) ? await e(I).then(() => {
|
|
1576
|
+
ot.showSuccess(`${x().t("archbase:Um e-mail com instruções para redefinir sua senha foi enviado. Verifique sua caixa de entrada.")}`), T(!0);
|
|
1573
1577
|
}).catch(() => {
|
|
1574
|
-
}) :
|
|
1578
|
+
}) : O(`${x().t("archbase:Email inválido")}`));
|
|
1575
1579
|
}
|
|
1576
|
-
async function
|
|
1577
|
-
if (
|
|
1578
|
-
let
|
|
1579
|
-
|
|
1580
|
-
|
|
1580
|
+
async function ee(I, he, se, be) {
|
|
1581
|
+
if (I && he && se) {
|
|
1582
|
+
let ae = "", ue = "", pe = "";
|
|
1583
|
+
a && (ae = a(), q(ae)), o && (ue = o(), q(ue)), se !== be && (pe = `${x().t("archbase:A nova senha e a confirmação devem ser iguais.")}`, f(pe)), !ue && !ae && await t(I, he, se).then(() => {
|
|
1584
|
+
ot.showSuccess(`${x().t("archbase:Senha redefinida com sucesso.")}`), s(), T(!1);
|
|
1581
1585
|
}).catch(() => {
|
|
1582
|
-
|
|
1586
|
+
A(r || `${x().t("archbase:Erro ao redefinir senha.")}`);
|
|
1583
1587
|
});
|
|
1584
1588
|
}
|
|
1585
1589
|
}
|
|
1586
|
-
return
|
|
1587
|
-
r &&
|
|
1588
|
-
}, [r]),
|
|
1589
|
-
|
|
1590
|
-
}, [g,
|
|
1591
|
-
|
|
1590
|
+
return K(() => {
|
|
1591
|
+
r && A(r);
|
|
1592
|
+
}, [r]), K(() => {
|
|
1593
|
+
A("");
|
|
1594
|
+
}, [g, D, B, M]), /* @__PURE__ */ C(
|
|
1595
|
+
He,
|
|
1592
1596
|
{
|
|
1593
1597
|
withBorder: !0,
|
|
1594
1598
|
shadow: "md",
|
|
1595
1599
|
radius: "md",
|
|
1596
1600
|
ref: y,
|
|
1597
1601
|
style: {
|
|
1598
|
-
...
|
|
1599
|
-
...
|
|
1602
|
+
...Ar,
|
|
1603
|
+
...l
|
|
1600
1604
|
},
|
|
1601
1605
|
children: [
|
|
1602
|
-
w ? /* @__PURE__ */
|
|
1606
|
+
w ? /* @__PURE__ */ C(ne, { children: [
|
|
1603
1607
|
/* @__PURE__ */ n(
|
|
1604
|
-
|
|
1608
|
+
F,
|
|
1605
1609
|
{
|
|
1606
1610
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1607
1611
|
fw: 800,
|
|
1608
1612
|
fz: { base: "20px", md: "35px" },
|
|
1609
1613
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1610
1614
|
mt: "xs",
|
|
1611
|
-
children:
|
|
1615
|
+
children: x().t("archbase:Redefinir senha")
|
|
1612
1616
|
}
|
|
1613
1617
|
),
|
|
1614
|
-
/* @__PURE__ */ n(
|
|
1618
|
+
/* @__PURE__ */ n(Ue, { m: "xs" }),
|
|
1615
1619
|
/* @__PURE__ */ n(
|
|
1616
|
-
|
|
1620
|
+
xe,
|
|
1617
1621
|
{
|
|
1618
|
-
label:
|
|
1619
|
-
placeholder: `${
|
|
1620
|
-
value:
|
|
1622
|
+
label: x().t("archbase:Código de segurança"),
|
|
1623
|
+
placeholder: `${x().t("archbase:Código enviado no seu e-mail")}`,
|
|
1624
|
+
value: D || "",
|
|
1621
1625
|
required: !0,
|
|
1622
|
-
onChange: (
|
|
1623
|
-
|
|
1626
|
+
onChange: (I) => {
|
|
1627
|
+
N(I.currentTarget.value), U("");
|
|
1624
1628
|
},
|
|
1625
|
-
error:
|
|
1629
|
+
error: L
|
|
1626
1630
|
}
|
|
1627
1631
|
),
|
|
1628
1632
|
/* @__PURE__ */ n(
|
|
1629
|
-
|
|
1633
|
+
ze,
|
|
1630
1634
|
{
|
|
1631
|
-
label:
|
|
1632
|
-
placeholder:
|
|
1633
|
-
onChange: (
|
|
1634
|
-
|
|
1635
|
+
label: x().t("archbase:Nova senha"),
|
|
1636
|
+
placeholder: x().t("archbase:Nova senha"),
|
|
1637
|
+
onChange: (I) => {
|
|
1638
|
+
W(I.currentTarget.value), q(""), f("");
|
|
1635
1639
|
},
|
|
1636
|
-
value:
|
|
1640
|
+
value: B,
|
|
1637
1641
|
required: !0,
|
|
1638
1642
|
error: Z
|
|
1639
1643
|
}
|
|
1640
1644
|
),
|
|
1641
1645
|
/* @__PURE__ */ n(
|
|
1642
|
-
|
|
1646
|
+
ze,
|
|
1643
1647
|
{
|
|
1644
|
-
label:
|
|
1645
|
-
placeholder:
|
|
1646
|
-
onChange: (
|
|
1647
|
-
|
|
1648
|
+
label: x().t("archbase:Confirmar senha"),
|
|
1649
|
+
placeholder: x().t("archbase:Confirmar senha"),
|
|
1650
|
+
onChange: (I) => {
|
|
1651
|
+
b(I.currentTarget.value), f("");
|
|
1648
1652
|
},
|
|
1649
|
-
value:
|
|
1653
|
+
value: M || "",
|
|
1650
1654
|
required: !0,
|
|
1651
|
-
error:
|
|
1655
|
+
error: re
|
|
1652
1656
|
}
|
|
1653
1657
|
),
|
|
1654
1658
|
/* @__PURE__ */ n(
|
|
1655
|
-
|
|
1659
|
+
H,
|
|
1656
1660
|
{
|
|
1657
|
-
disabled: !g || !
|
|
1661
|
+
disabled: !g || !D || !B || !M,
|
|
1658
1662
|
mt: "md",
|
|
1659
1663
|
fullWidth: !0,
|
|
1660
|
-
onClick: () =>
|
|
1661
|
-
children: `${
|
|
1664
|
+
onClick: () => ee(g, D, B, M),
|
|
1665
|
+
children: `${x().t("archbase:Redefinir senha")}`
|
|
1662
1666
|
}
|
|
1663
1667
|
),
|
|
1664
1668
|
/* @__PURE__ */ n(
|
|
1665
|
-
|
|
1669
|
+
H,
|
|
1666
1670
|
{
|
|
1667
1671
|
mt: "6px",
|
|
1668
1672
|
fullWidth: !0,
|
|
1669
|
-
color:
|
|
1673
|
+
color: d === "dark" ? E.colors.dark[4] : E.colors.gray[7],
|
|
1670
1674
|
onClick: () => {
|
|
1671
|
-
|
|
1675
|
+
z || T(!1);
|
|
1672
1676
|
},
|
|
1673
|
-
children: `${
|
|
1677
|
+
children: `${x().t("archbase:Voltar")}`
|
|
1674
1678
|
}
|
|
1675
1679
|
)
|
|
1676
|
-
] }) : /* @__PURE__ */
|
|
1680
|
+
] }) : /* @__PURE__ */ C(ne, { children: [
|
|
1677
1681
|
/* @__PURE__ */ n(
|
|
1678
|
-
|
|
1682
|
+
F,
|
|
1679
1683
|
{
|
|
1680
1684
|
c: "light-dark(var(--mantine-color-black), var(--mantine-color-white))",
|
|
1681
1685
|
fw: 800,
|
|
1682
1686
|
fz: { base: "20px", md: "35px" },
|
|
1683
1687
|
style: { textAlign: "center", letterSpacing: "-1px" },
|
|
1684
1688
|
mt: "xs",
|
|
1685
|
-
children:
|
|
1689
|
+
children: x().t("archbase:Redefinir senha")
|
|
1686
1690
|
}
|
|
1687
1691
|
),
|
|
1688
|
-
/* @__PURE__ */ n(
|
|
1689
|
-
/* @__PURE__ */ n(
|
|
1692
|
+
/* @__PURE__ */ n(F, { c: "dimmed", fz: 14, style: { textAlign: "justify" }, children: i }),
|
|
1693
|
+
/* @__PURE__ */ n(Ue, { m: "md" }),
|
|
1690
1694
|
/* @__PURE__ */ n(
|
|
1691
|
-
|
|
1695
|
+
xe,
|
|
1692
1696
|
{
|
|
1693
1697
|
label: "Email",
|
|
1694
|
-
placeholder: `${
|
|
1698
|
+
placeholder: `${x().t("archbase:usuario@email.com")}`,
|
|
1695
1699
|
value: g || "",
|
|
1696
1700
|
required: !0,
|
|
1697
|
-
onChange: (
|
|
1698
|
-
S(
|
|
1701
|
+
onChange: (I) => {
|
|
1702
|
+
S(I.currentTarget.value), O("");
|
|
1699
1703
|
},
|
|
1700
|
-
error:
|
|
1704
|
+
error: z
|
|
1701
1705
|
}
|
|
1702
1706
|
),
|
|
1703
1707
|
/* @__PURE__ */ n(
|
|
1704
|
-
|
|
1708
|
+
H,
|
|
1705
1709
|
{
|
|
1706
1710
|
disabled: !g,
|
|
1707
1711
|
mt: "md",
|
|
1708
1712
|
fullWidth: !0,
|
|
1709
|
-
onClick: () =>
|
|
1710
|
-
children: `${
|
|
1713
|
+
onClick: () => v(g),
|
|
1714
|
+
children: `${x().t("archbase:Enviar")}`
|
|
1711
1715
|
}
|
|
1712
1716
|
),
|
|
1713
1717
|
/* @__PURE__ */ n(
|
|
1714
|
-
|
|
1718
|
+
H,
|
|
1715
1719
|
{
|
|
1716
1720
|
mt: "6px",
|
|
1717
1721
|
fullWidth: !0,
|
|
1718
|
-
color:
|
|
1722
|
+
color: d === "dark" ? E.colors.dark[4] : E.colors.gray[7],
|
|
1719
1723
|
onClick: () => s && s(),
|
|
1720
|
-
children: `${
|
|
1724
|
+
children: `${x().t("archbase:Voltar")}`
|
|
1721
1725
|
}
|
|
1722
1726
|
)
|
|
1723
1727
|
] }),
|
|
1724
|
-
|
|
1728
|
+
R ? /* @__PURE__ */ n(F, { c: "red", style: { textAlign: "justify" }, children: R }) : null
|
|
1725
1729
|
]
|
|
1726
1730
|
}
|
|
1727
1731
|
);
|
|
1728
1732
|
}
|
|
1729
|
-
const
|
|
1730
|
-
const s =
|
|
1733
|
+
const Er = () => Ht().user, Rt = "archbaseSecurityManagerStore", Kr = ({ resourceName: r, resourceDescription: e, enableSecurity: t = !0 }) => {
|
|
1734
|
+
const s = lt(Rt), o = Er(), a = o?.isAdmin ?? !1, c = o?.id, i = ct(c), l = at(() => {
|
|
1731
1735
|
if (!t)
|
|
1732
1736
|
return null;
|
|
1733
|
-
const y =
|
|
1737
|
+
const y = c ? `${r}_${c}` : r;
|
|
1734
1738
|
if (s && s.existsValue(y)) {
|
|
1735
|
-
const
|
|
1736
|
-
if (
|
|
1737
|
-
return
|
|
1739
|
+
const d = s.getValue(y);
|
|
1740
|
+
if (d && d.isAdmin === a)
|
|
1741
|
+
return d;
|
|
1738
1742
|
}
|
|
1739
|
-
const
|
|
1740
|
-
return s &&
|
|
1741
|
-
}, [t, r, e,
|
|
1742
|
-
return
|
|
1743
|
-
|
|
1744
|
-
}, [
|
|
1745
|
-
}
|
|
1743
|
+
const E = new wt(r, e, a);
|
|
1744
|
+
return s && c && s.setValue(y, E), E;
|
|
1745
|
+
}, [t, r, e, a, c]);
|
|
1746
|
+
return K(() => {
|
|
1747
|
+
i.current = c;
|
|
1748
|
+
}, [c]), { securityManager: l };
|
|
1749
|
+
};
|
|
1750
|
+
function $e(r) {
|
|
1751
|
+
const e = r?.response?.data ?? r?.data ?? r;
|
|
1752
|
+
return e?.error === "CREDENTIALS_EXPIRED" || e?.requirePasswordChange === !0;
|
|
1753
|
+
}
|
|
1754
|
+
const qr = ({
|
|
1746
1755
|
checkIntervalTokenHasExpired: r = 3e4,
|
|
1747
1756
|
// Verificar a 30 segundos
|
|
1748
1757
|
expirationThresholdOfToken: e = 300
|
|
1749
1758
|
// Antecipar em 5 minutos
|
|
1750
1759
|
}) => {
|
|
1751
|
-
const t =
|
|
1752
|
-
(
|
|
1753
|
-
), s =
|
|
1754
|
-
(
|
|
1755
|
-
), [o,
|
|
1760
|
+
const t = De(
|
|
1761
|
+
(u) => u.get(Y.TokenManager)
|
|
1762
|
+
), s = De(
|
|
1763
|
+
(u) => u.get(Y.Authenticator)
|
|
1764
|
+
), [o, a] = p(null), [c, i] = p(!1), [l, y] = p(!0), [E, d] = p(!1), [R, A] = p(!1), [g, S] = p(""), [D, N] = p(""), [B, W] = p(null), [M, b] = p(!1), [w, T] = p(!1), [z, O] = p(null), L = lt(Rt), U = {
|
|
1756
1765
|
hasContextualLogin: typeof s.loginWithContext == "function",
|
|
1757
1766
|
hasFlexibleLogin: typeof s.loginFlexible == "function",
|
|
1758
1767
|
hasSocialLogin: typeof s.loginSocial == "function",
|
|
1759
1768
|
hasRegistration: typeof s.register == "function",
|
|
1760
1769
|
hasContextSupport: typeof t.saveContext == "function"
|
|
1761
1770
|
};
|
|
1762
|
-
|
|
1763
|
-
const
|
|
1764
|
-
if (
|
|
1765
|
-
const
|
|
1766
|
-
if (
|
|
1771
|
+
K(() => {
|
|
1772
|
+
const u = t.getUsername();
|
|
1773
|
+
if (u && u != "" && N(u), U.hasContextSupport && t.getContext) {
|
|
1774
|
+
const m = t.getContext();
|
|
1775
|
+
if (m)
|
|
1767
1776
|
try {
|
|
1768
|
-
const _ = typeof
|
|
1769
|
-
|
|
1777
|
+
const _ = typeof m == "string" ? JSON.parse(m) : m;
|
|
1778
|
+
W(_);
|
|
1770
1779
|
} catch (_) {
|
|
1771
1780
|
console.warn("Erro ao carregar contexto salvo:", _);
|
|
1772
1781
|
}
|
|
1773
1782
|
}
|
|
1774
|
-
const
|
|
1775
|
-
|
|
1783
|
+
const h = t.getToken();
|
|
1784
|
+
h && (d(!0), S(""), A(!1), a(h)), y(!1);
|
|
1776
1785
|
}, []);
|
|
1777
|
-
const
|
|
1778
|
-
|
|
1779
|
-
},
|
|
1780
|
-
|
|
1781
|
-
},
|
|
1786
|
+
const Z = () => {
|
|
1787
|
+
A(!1), S("");
|
|
1788
|
+
}, q = () => {
|
|
1789
|
+
T(!1);
|
|
1790
|
+
}, re = (u) => {
|
|
1791
|
+
i(!1), d(!1), t.clearToken(), u && t.clearUsernameAndPassword(), U.hasContextSupport && t.clearContext && t.clearContext(), N(""), W(null), S(""), A(!1), T(!1), L.clearAllValues();
|
|
1792
|
+
}, f = async (u, h, m) => {
|
|
1782
1793
|
try {
|
|
1783
|
-
|
|
1784
|
-
const _ = await s.login(
|
|
1785
|
-
t.saveToken(_),
|
|
1794
|
+
i(!0), d(!1);
|
|
1795
|
+
const _ = await s.login(u, h);
|
|
1796
|
+
t.saveToken(_), m && t.saveUsernameAndPassword(u, h), t.saveUsername(u), N(u), a(_), i(!1), d(!0);
|
|
1786
1797
|
} catch (_) {
|
|
1787
|
-
|
|
1798
|
+
i(!1), d(!1), $e(_) && (N(u), T(!0)), S(oe(_)), A(!0);
|
|
1788
1799
|
}
|
|
1789
|
-
},
|
|
1790
|
-
if (!
|
|
1800
|
+
}, v = async (u, h = !1) => {
|
|
1801
|
+
if (!U.hasContextualLogin || !s.loginWithContext)
|
|
1791
1802
|
throw new Error("Login contextual não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1792
1803
|
try {
|
|
1793
|
-
|
|
1794
|
-
const { context:
|
|
1804
|
+
i(!0), d(!1);
|
|
1805
|
+
const { context: m, user: _, ...j } = await s.loginWithContext(u);
|
|
1806
|
+
if (j.mfa_required) {
|
|
1807
|
+
O(j.challenge_token ?? null), b(!0), N(u.email), i(!1);
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
const Ae = {
|
|
1795
1811
|
scope: "",
|
|
1796
|
-
ext_expires_in:
|
|
1797
|
-
...
|
|
1812
|
+
ext_expires_in: j.expires_in,
|
|
1813
|
+
...j
|
|
1798
1814
|
};
|
|
1799
|
-
t.saveToken(
|
|
1800
|
-
} catch (
|
|
1801
|
-
throw
|
|
1815
|
+
t.saveToken(Ae), h ? t.saveUsernameAndPassword(u.email, u.password) : t.clearUsernameAndPassword(), t.saveUsername(u.email), U.hasContextSupport && t.saveContext && m && (t.saveContext(JSON.stringify(m)), W(m)), N(u.email), a(Ae), i(!1), d(!0);
|
|
1816
|
+
} catch (m) {
|
|
1817
|
+
throw i(!1), d(!1), $e(m) && (N(u.email), T(!0)), S(oe(m)), A(!0), m;
|
|
1818
|
+
}
|
|
1819
|
+
}, ee = async (u) => {
|
|
1820
|
+
if (!s.verifyMfa)
|
|
1821
|
+
throw new Error("verifyMfa não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1822
|
+
if (!z)
|
|
1823
|
+
throw new Error("Nenhum desafio de MFA pendente");
|
|
1824
|
+
try {
|
|
1825
|
+
i(!0), S(""), A(!1);
|
|
1826
|
+
const h = await s.verifyMfa(z, u);
|
|
1827
|
+
t.saveToken(h), t.saveUsername(D), a(h), b(!1), O(null), i(!1), d(!0);
|
|
1828
|
+
} catch (h) {
|
|
1829
|
+
throw i(!1), S(oe(h)), A(!0), h;
|
|
1802
1830
|
}
|
|
1803
|
-
},
|
|
1804
|
-
|
|
1831
|
+
}, I = () => {
|
|
1832
|
+
b(!1), O(null), S(""), A(!1);
|
|
1833
|
+
}, he = async (u, h = !1) => {
|
|
1834
|
+
if (!U.hasFlexibleLogin || !s.loginFlexible)
|
|
1805
1835
|
throw new Error("Login flexível não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1806
1836
|
try {
|
|
1807
|
-
|
|
1808
|
-
const { context:
|
|
1837
|
+
i(!0), d(!1);
|
|
1838
|
+
const { context: m, user: _, ...j } = await s.loginFlexible(u), Ae = {
|
|
1809
1839
|
scope: "",
|
|
1810
|
-
ext_expires_in:
|
|
1811
|
-
...
|
|
1840
|
+
ext_expires_in: j.expires_in,
|
|
1841
|
+
...j
|
|
1812
1842
|
};
|
|
1813
|
-
t.saveToken(
|
|
1814
|
-
} catch (
|
|
1815
|
-
throw
|
|
1843
|
+
t.saveToken(Ae), h && t.saveUsernameAndPassword(u.identifier, u.password), t.saveUsername(_.email || u.identifier), U.hasContextSupport && t.saveContext && m && (t.saveContext(JSON.stringify(m)), W(m)), N(_.email || u.identifier), a(Ae), i(!1), d(!0);
|
|
1844
|
+
} catch (m) {
|
|
1845
|
+
throw i(!1), d(!1), $e(m) && (N(u.identifier), T(!0)), S(oe(m)), A(!0), m;
|
|
1816
1846
|
}
|
|
1817
|
-
},
|
|
1818
|
-
if (!
|
|
1847
|
+
}, se = async (u) => {
|
|
1848
|
+
if (!U.hasSocialLogin || !s.loginSocial)
|
|
1819
1849
|
throw new Error("Login social não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1820
1850
|
try {
|
|
1821
|
-
|
|
1822
|
-
const { context:
|
|
1851
|
+
i(!0), d(!1);
|
|
1852
|
+
const { context: h, user: m, ..._ } = await s.loginSocial(u), j = {
|
|
1823
1853
|
scope: "",
|
|
1824
1854
|
ext_expires_in: _.expires_in,
|
|
1825
1855
|
..._
|
|
1826
1856
|
};
|
|
1827
|
-
t.saveToken(
|
|
1828
|
-
} catch (
|
|
1829
|
-
throw
|
|
1857
|
+
t.saveToken(j), t.saveUsername(m.email), U.hasContextSupport && t.saveContext && h && (t.saveContext(JSON.stringify(h)), W(h)), N(m.email), a(j), i(!1), d(!0);
|
|
1858
|
+
} catch (h) {
|
|
1859
|
+
throw i(!1), d(!1), S(oe(h)), A(!0), h;
|
|
1830
1860
|
}
|
|
1831
|
-
},
|
|
1832
|
-
if (!
|
|
1861
|
+
}, be = async (u) => {
|
|
1862
|
+
if (!U.hasRegistration || !s.register)
|
|
1833
1863
|
throw new Error("Registro não suportado por esta implementação do ArchbaseAuthenticator");
|
|
1834
1864
|
try {
|
|
1835
|
-
|
|
1836
|
-
const
|
|
1837
|
-
return
|
|
1838
|
-
} catch (
|
|
1839
|
-
throw
|
|
1865
|
+
i(!0);
|
|
1866
|
+
const h = await s.register(u);
|
|
1867
|
+
return i(!1), h;
|
|
1868
|
+
} catch (h) {
|
|
1869
|
+
throw i(!1), S(oe(h)), A(!0), h;
|
|
1840
1870
|
}
|
|
1841
|
-
},
|
|
1842
|
-
|
|
1843
|
-
const
|
|
1844
|
-
o && o.access_token && t.isTokenExpired(o, e) &&
|
|
1871
|
+
}, ae = async () => s.getSupportedContexts ? await s.getSupportedContexts() : { supportedContexts: ["DEFAULT"], defaultContext: "DEFAULT" }, ue = async (u) => s.validateContext ? await s.validateContext(u) : { context: u, supported: u === "DEFAULT" };
|
|
1872
|
+
K(() => {
|
|
1873
|
+
const u = setInterval(() => {
|
|
1874
|
+
o && o.access_token && t.isTokenExpired(o, e) && pe();
|
|
1845
1875
|
}, r);
|
|
1846
1876
|
return () => {
|
|
1847
|
-
clearInterval(
|
|
1877
|
+
clearInterval(u);
|
|
1848
1878
|
};
|
|
1849
1879
|
}, [o]);
|
|
1850
|
-
const
|
|
1880
|
+
const pe = async () => {
|
|
1851
1881
|
if (o)
|
|
1852
1882
|
try {
|
|
1853
|
-
const
|
|
1854
|
-
t.saveToken(
|
|
1855
|
-
} catch (
|
|
1856
|
-
console.error("Erro ao renovar o token:",
|
|
1883
|
+
const u = await s.refreshToken(o?.refresh_token);
|
|
1884
|
+
t.saveToken(u), a(u);
|
|
1885
|
+
} catch (u) {
|
|
1886
|
+
console.error("Erro ao renovar o token:", u), re();
|
|
1857
1887
|
}
|
|
1858
1888
|
};
|
|
1859
1889
|
return {
|
|
1860
1890
|
// Métodos básicos (compatibilidade)
|
|
1861
|
-
login:
|
|
1862
|
-
logout:
|
|
1863
|
-
username:
|
|
1864
|
-
isAuthenticated:
|
|
1865
|
-
isAuthenticating:
|
|
1866
|
-
isInitializing:
|
|
1867
|
-
isError:
|
|
1891
|
+
login: f,
|
|
1892
|
+
logout: re,
|
|
1893
|
+
username: D,
|
|
1894
|
+
isAuthenticated: E,
|
|
1895
|
+
isAuthenticating: c,
|
|
1896
|
+
isInitializing: l,
|
|
1897
|
+
isError: R,
|
|
1868
1898
|
error: g,
|
|
1869
|
-
clearError:
|
|
1899
|
+
clearError: Z,
|
|
1870
1900
|
accessToken: o ? o.access_token : null,
|
|
1871
1901
|
// Métodos opcionais para autenticação avançada
|
|
1872
|
-
loginWithContext:
|
|
1873
|
-
loginFlexible:
|
|
1874
|
-
loginSocial:
|
|
1875
|
-
register:
|
|
1876
|
-
getSupportedContexts:
|
|
1877
|
-
validateContext:
|
|
1902
|
+
loginWithContext: U.hasContextualLogin ? v : void 0,
|
|
1903
|
+
loginFlexible: U.hasFlexibleLogin ? he : void 0,
|
|
1904
|
+
loginSocial: U.hasSocialLogin ? se : void 0,
|
|
1905
|
+
register: U.hasRegistration ? be : void 0,
|
|
1906
|
+
getSupportedContexts: ae,
|
|
1907
|
+
validateContext: ue,
|
|
1908
|
+
// MFA / segundo fator (2 passos)
|
|
1909
|
+
mfaRequired: M,
|
|
1910
|
+
verifyMfa: typeof s.verifyMfa == "function" ? ee : void 0,
|
|
1911
|
+
cancelMfa: I,
|
|
1912
|
+
// Troca de senha obrigatória (CREDENTIALS_EXPIRED)
|
|
1913
|
+
passwordChangeRequired: w,
|
|
1914
|
+
clearPasswordChangeRequired: q,
|
|
1878
1915
|
// Informações de contexto
|
|
1879
|
-
context:
|
|
1916
|
+
context: B,
|
|
1880
1917
|
// Detecção de capacidades
|
|
1881
|
-
capabilities:
|
|
1918
|
+
capabilities: U
|
|
1882
1919
|
};
|
|
1883
|
-
},
|
|
1884
|
-
const r =
|
|
1920
|
+
}, Yr = () => {
|
|
1921
|
+
const r = De(
|
|
1885
1922
|
(s) => s.get(Y.TokenManager)
|
|
1886
|
-
), [e, t] =
|
|
1887
|
-
return
|
|
1923
|
+
), [e, t] = p(null);
|
|
1924
|
+
return K(() => {
|
|
1888
1925
|
const s = r.getToken();
|
|
1889
1926
|
s && t(s.access_token);
|
|
1890
1927
|
}, []), {
|
|
1891
1928
|
token: e
|
|
1892
1929
|
};
|
|
1893
|
-
},
|
|
1894
|
-
const r =
|
|
1895
|
-
(
|
|
1896
|
-
), [e, t] =
|
|
1930
|
+
}, Xr = () => {
|
|
1931
|
+
const r = De(
|
|
1932
|
+
(l) => l.get(Y.Authenticator)
|
|
1933
|
+
), [e, t] = p(!1), [s, o] = p("");
|
|
1897
1934
|
return {
|
|
1898
|
-
sendResetPasswordEmail: async (
|
|
1935
|
+
sendResetPasswordEmail: async (l) => {
|
|
1899
1936
|
try {
|
|
1900
|
-
return await r.sendResetPasswordEmail(
|
|
1937
|
+
return await r.sendResetPasswordEmail(l);
|
|
1901
1938
|
} catch (y) {
|
|
1902
|
-
throw o(
|
|
1939
|
+
throw o(oe(y)), t(!0), y;
|
|
1903
1940
|
}
|
|
1904
1941
|
},
|
|
1905
|
-
resetPassword: async (
|
|
1942
|
+
resetPassword: async (l, y, E) => {
|
|
1906
1943
|
try {
|
|
1907
|
-
return await r.resetPassword(
|
|
1908
|
-
} catch (
|
|
1909
|
-
throw o(
|
|
1944
|
+
return await r.resetPassword(l, y, E);
|
|
1945
|
+
} catch (d) {
|
|
1946
|
+
throw o(oe(d)), t(!0), d;
|
|
1910
1947
|
}
|
|
1911
1948
|
},
|
|
1912
1949
|
isError: e,
|
|
@@ -1915,169 +1952,169 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
1915
1952
|
t(!1), o("");
|
|
1916
1953
|
}
|
|
1917
1954
|
};
|
|
1918
|
-
},
|
|
1919
|
-
/* @__PURE__ */
|
|
1920
|
-
/* @__PURE__ */ n(
|
|
1921
|
-
/* @__PURE__ */ n(
|
|
1955
|
+
}, xr = () => /* @__PURE__ */ n(Qt, { p: "xl", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ C(Ee, { gap: "md", children: [
|
|
1956
|
+
/* @__PURE__ */ C(de, { gap: "sm", children: [
|
|
1957
|
+
/* @__PURE__ */ n(dt, { size: "sm" }),
|
|
1958
|
+
/* @__PURE__ */ n(F, { size: "sm", c: "dimmed", children: "Carregando permissões..." })
|
|
1922
1959
|
] }),
|
|
1923
|
-
/* @__PURE__ */ n(
|
|
1924
|
-
/* @__PURE__ */ n(
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */ n(
|
|
1927
|
-
/* @__PURE__ */ n(
|
|
1960
|
+
/* @__PURE__ */ n(Ie, { height: 40, radius: "sm" }),
|
|
1961
|
+
/* @__PURE__ */ n(Ie, { height: 200, radius: "sm" }),
|
|
1962
|
+
/* @__PURE__ */ C(de, { gap: "md", children: [
|
|
1963
|
+
/* @__PURE__ */ n(Ie, { height: 36, width: 100, radius: "sm" }),
|
|
1964
|
+
/* @__PURE__ */ n(Ie, { height: 36, width: 100, radius: "sm" })
|
|
1928
1965
|
] })
|
|
1929
|
-
] }) }),
|
|
1966
|
+
] }) }), Ye = Ve(null), Qr = ({
|
|
1930
1967
|
children: r,
|
|
1931
1968
|
user: e,
|
|
1932
1969
|
onError: t
|
|
1933
1970
|
}) => {
|
|
1934
|
-
const [s, o] =
|
|
1935
|
-
|
|
1936
|
-
}, [t]),
|
|
1971
|
+
const [s, o] = p(!1), [a, c] = p(null), [i] = p([]), l = e?.isAdministrator || !1, y = Ce((g) => l ? !0 : i.includes(g), [i, l]), E = Ce((g) => l ? !0 : g.some((S) => i.includes(S)), [i, l]), d = Ce((g) => l ? !0 : g.every((S) => i.includes(S)), [i, l]), R = Ce((g) => {
|
|
1972
|
+
c(g), g && t && t(g);
|
|
1973
|
+
}, [t]), A = {
|
|
1937
1974
|
user: e,
|
|
1938
1975
|
isLoading: s,
|
|
1939
1976
|
hasGlobalPermission: y,
|
|
1940
|
-
hasAnyGlobalPermission:
|
|
1941
|
-
hasAllGlobalPermissions:
|
|
1942
|
-
isAdmin:
|
|
1943
|
-
error:
|
|
1944
|
-
setError:
|
|
1977
|
+
hasAnyGlobalPermission: E,
|
|
1978
|
+
hasAllGlobalPermissions: d,
|
|
1979
|
+
isAdmin: l,
|
|
1980
|
+
error: a,
|
|
1981
|
+
setError: R
|
|
1945
1982
|
};
|
|
1946
|
-
return /* @__PURE__ */ n(
|
|
1947
|
-
},
|
|
1983
|
+
return /* @__PURE__ */ n(Ye.Provider, { value: A, children: r });
|
|
1984
|
+
}, Nt = Ve(null), kr = ({
|
|
1948
1985
|
children: r,
|
|
1949
1986
|
resourceName: e,
|
|
1950
1987
|
resourceDescription: t,
|
|
1951
1988
|
requiredPermissions: s = [],
|
|
1952
1989
|
fallbackComponent: o,
|
|
1953
|
-
loadingComponent:
|
|
1954
|
-
onSecurityReady:
|
|
1955
|
-
onError:
|
|
1990
|
+
loadingComponent: a,
|
|
1991
|
+
onSecurityReady: c,
|
|
1992
|
+
onError: i
|
|
1956
1993
|
}) => {
|
|
1957
|
-
const
|
|
1958
|
-
if (!
|
|
1994
|
+
const l = We(Ye);
|
|
1995
|
+
if (!l)
|
|
1959
1996
|
throw new Error("ArchbaseViewSecurityProvider deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
1960
|
-
const { user: y, isAdmin:
|
|
1961
|
-
if (
|
|
1997
|
+
const { user: y, isAdmin: E } = l, [d, R] = p(null), [A, g] = p(!0), [S, D] = p(null);
|
|
1998
|
+
if (it.useEffect(() => {
|
|
1962
1999
|
if (!y) {
|
|
1963
2000
|
g(!1);
|
|
1964
2001
|
return;
|
|
1965
2002
|
}
|
|
1966
|
-
const w = new
|
|
2003
|
+
const w = new wt(e, t, E);
|
|
1967
2004
|
(async () => {
|
|
1968
2005
|
g(!0);
|
|
1969
2006
|
try {
|
|
1970
2007
|
await w.apply(() => {
|
|
1971
|
-
|
|
2008
|
+
R(w), g(!1), c && c(w);
|
|
1972
2009
|
});
|
|
1973
2010
|
} catch {
|
|
1974
|
-
const
|
|
1975
|
-
|
|
2011
|
+
const O = w.getError() || "Erro ao carregar permissões";
|
|
2012
|
+
D(O), g(!1), i && i(O);
|
|
1976
2013
|
}
|
|
1977
2014
|
})();
|
|
1978
|
-
}, [e, t, y,
|
|
1979
|
-
return
|
|
2015
|
+
}, [e, t, y, E, c, i]), A)
|
|
2016
|
+
return a ? /* @__PURE__ */ n(ne, { children: a }) : /* @__PURE__ */ n(xr, {});
|
|
1980
2017
|
if (S)
|
|
1981
|
-
return /* @__PURE__ */ n("div", { className: "archbase-security-error", children: /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ n("div", { className: "archbase-security-error", children: /* @__PURE__ */ C("div", { children: [
|
|
1982
2019
|
"Erro ao carregar permissões: ",
|
|
1983
2020
|
S
|
|
1984
2021
|
] }) });
|
|
1985
2022
|
if (!y)
|
|
1986
2023
|
return o || /* @__PURE__ */ n("div", { className: "archbase-security-no-user", children: /* @__PURE__ */ n("div", { children: "É necessário fazer login para acessar esta área" }) });
|
|
1987
|
-
if (s.length > 0 &&
|
|
1988
|
-
(
|
|
2024
|
+
if (s.length > 0 && d && !s.every(
|
|
2025
|
+
(T) => d.hasPermission(T)
|
|
1989
2026
|
))
|
|
1990
|
-
return o || /* @__PURE__ */
|
|
2027
|
+
return o || /* @__PURE__ */ C("div", { className: "archbase-security-access-denied", children: [
|
|
1991
2028
|
/* @__PURE__ */ n("div", { children: "Você não possui permissão para acessar esta área" }),
|
|
1992
|
-
/* @__PURE__ */
|
|
2029
|
+
/* @__PURE__ */ C("small", { children: [
|
|
1993
2030
|
"Permissões necessárias: ",
|
|
1994
2031
|
s.join(", ")
|
|
1995
2032
|
] })
|
|
1996
2033
|
] });
|
|
1997
|
-
const
|
|
1998
|
-
securityManager:
|
|
1999
|
-
hasPermission: (w) =>
|
|
2000
|
-
hasAnyPermission: (w) => w.some((
|
|
2001
|
-
hasAllPermissions: (w) => w.every((
|
|
2002
|
-
registerAction: (w,
|
|
2003
|
-
|
|
2034
|
+
const b = {
|
|
2035
|
+
securityManager: d,
|
|
2036
|
+
hasPermission: (w) => d?.hasPermission(w) || !1,
|
|
2037
|
+
hasAnyPermission: (w) => w.some((T) => d?.hasPermission(T) || !1),
|
|
2038
|
+
hasAllPermissions: (w) => w.every((T) => d?.hasPermission(T) || !1),
|
|
2039
|
+
registerAction: (w, T) => {
|
|
2040
|
+
d?.registerAction(w, T);
|
|
2004
2041
|
},
|
|
2005
|
-
isLoading:
|
|
2042
|
+
isLoading: A,
|
|
2006
2043
|
error: S
|
|
2007
2044
|
};
|
|
2008
|
-
return /* @__PURE__ */ n(
|
|
2009
|
-
},
|
|
2010
|
-
const r =
|
|
2045
|
+
return /* @__PURE__ */ n(Nt.Provider, { value: b, children: r });
|
|
2046
|
+
}, Sr = () => {
|
|
2047
|
+
const r = We(Ye);
|
|
2011
2048
|
if (!r)
|
|
2012
2049
|
throw new Error("useArchbaseSecurity deve ser usado dentro de um ArchbaseSecurityProvider");
|
|
2013
2050
|
return r;
|
|
2014
|
-
},
|
|
2015
|
-
const r =
|
|
2051
|
+
}, Xe = () => {
|
|
2052
|
+
const r = We(Nt);
|
|
2016
2053
|
if (!r)
|
|
2017
2054
|
throw new Error("useArchbaseViewSecurity deve ser usado dentro de um ArchbaseViewSecurityProvider");
|
|
2018
2055
|
return r;
|
|
2019
|
-
},
|
|
2020
|
-
const t =
|
|
2021
|
-
return
|
|
2022
|
-
r && e && (
|
|
2023
|
-
}, [r, e,
|
|
2056
|
+
}, Zr = (r, e) => {
|
|
2057
|
+
const t = Xe(), { hasPermission: s, hasAnyPermission: o, hasAllPermissions: a, registerAction: c, securityManager: i, isLoading: l, error: y } = t;
|
|
2058
|
+
return it.useEffect(() => {
|
|
2059
|
+
r && e && (c("create", `Criar ${e}`), c("edit", `Editar ${e}`), c("delete", `Deletar ${e}`), c("view", `Visualizar ${e}`), c("list", `Listar ${e}`));
|
|
2060
|
+
}, [r, e, c]), {
|
|
2024
2061
|
hasPermission: s,
|
|
2025
2062
|
hasAnyPermission: o,
|
|
2026
|
-
hasAllPermissions:
|
|
2027
|
-
registerAction:
|
|
2028
|
-
securityManager:
|
|
2063
|
+
hasAllPermissions: a,
|
|
2064
|
+
registerAction: c,
|
|
2065
|
+
securityManager: i,
|
|
2029
2066
|
canCreate: s("create"),
|
|
2030
2067
|
canEdit: s("edit"),
|
|
2031
2068
|
canDelete: s("delete"),
|
|
2032
2069
|
canView: s("view"),
|
|
2033
2070
|
canList: s("list"),
|
|
2034
|
-
isLoading:
|
|
2071
|
+
isLoading: l,
|
|
2035
2072
|
error: y
|
|
2036
2073
|
};
|
|
2037
|
-
},
|
|
2038
|
-
const r =
|
|
2074
|
+
}, es = () => {
|
|
2075
|
+
const r = Xe();
|
|
2039
2076
|
return {
|
|
2040
2077
|
check: r.hasPermission,
|
|
2041
2078
|
checkAny: r.hasAnyPermission,
|
|
2042
2079
|
checkAll: r.hasAllPermissions,
|
|
2043
|
-
isAdmin:
|
|
2080
|
+
isAdmin: Sr().isAdmin
|
|
2044
2081
|
};
|
|
2045
|
-
},
|
|
2082
|
+
}, Mt = ({
|
|
2046
2083
|
children: r,
|
|
2047
2084
|
actionName: e,
|
|
2048
2085
|
requiredPermissions: t = [],
|
|
2049
2086
|
requireAll: s = !0,
|
|
2050
2087
|
actionDescription: o,
|
|
2051
|
-
fallback:
|
|
2052
|
-
autoRegister:
|
|
2088
|
+
fallback: a = null,
|
|
2089
|
+
autoRegister: c = !0
|
|
2053
2090
|
}) => {
|
|
2054
|
-
const { hasPermission:
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
}, [e, o,
|
|
2058
|
-
let
|
|
2059
|
-
return e ?
|
|
2060
|
-
},
|
|
2091
|
+
const { hasPermission: i, hasAnyPermission: l, hasAllPermissions: y, registerAction: E } = Xe();
|
|
2092
|
+
K(() => {
|
|
2093
|
+
c && e && o && E(e, o);
|
|
2094
|
+
}, [e, o, c, E]);
|
|
2095
|
+
let d = !1;
|
|
2096
|
+
return e ? d = i(e) : t.length > 0 ? d = s ? y(t) : l(t) : d = !0, d ? /* @__PURE__ */ n(ne, { children: r }) : /* @__PURE__ */ n(ne, { children: a });
|
|
2097
|
+
}, ts = ({
|
|
2061
2098
|
actionName: r,
|
|
2062
2099
|
actionDescription: e,
|
|
2063
2100
|
children: t,
|
|
2064
2101
|
onClick: s,
|
|
2065
2102
|
disabled: o = !1,
|
|
2066
|
-
className:
|
|
2067
|
-
style:
|
|
2068
|
-
variant:
|
|
2069
|
-
size:
|
|
2103
|
+
className: a = "",
|
|
2104
|
+
style: c = {},
|
|
2105
|
+
variant: i = "primary",
|
|
2106
|
+
size: l = "medium",
|
|
2070
2107
|
type: y = "button"
|
|
2071
2108
|
}) => {
|
|
2072
|
-
const
|
|
2073
|
-
const
|
|
2074
|
-
return `${
|
|
2075
|
-
},
|
|
2076
|
-
const
|
|
2109
|
+
const E = () => {
|
|
2110
|
+
const R = "archbase-secure-btn", A = `archbase-secure-btn--${i}`, g = `archbase-secure-btn--${l}`;
|
|
2111
|
+
return `${R} ${A} ${g} ${a}`.trim();
|
|
2112
|
+
}, d = () => {
|
|
2113
|
+
const R = {
|
|
2077
2114
|
small: { padding: "4px 8px", fontSize: "12px" },
|
|
2078
2115
|
medium: { padding: "8px 16px", fontSize: "14px" },
|
|
2079
2116
|
large: { padding: "12px 24px", fontSize: "16px" }
|
|
2080
|
-
},
|
|
2117
|
+
}, A = {
|
|
2081
2118
|
primary: { backgroundColor: "#007bff", color: "white" },
|
|
2082
2119
|
secondary: { backgroundColor: "#6c757d", color: "white" },
|
|
2083
2120
|
danger: { backgroundColor: "#dc3545", color: "white" },
|
|
@@ -2090,13 +2127,13 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
2090
2127
|
cursor: o ? "not-allowed" : "pointer",
|
|
2091
2128
|
fontWeight: "500",
|
|
2092
2129
|
opacity: o ? 0.6 : 1,
|
|
2093
|
-
...
|
|
2094
|
-
...
|
|
2095
|
-
...
|
|
2130
|
+
...R[l],
|
|
2131
|
+
...A[i],
|
|
2132
|
+
...c
|
|
2096
2133
|
};
|
|
2097
2134
|
};
|
|
2098
2135
|
return /* @__PURE__ */ n(
|
|
2099
|
-
|
|
2136
|
+
Mt,
|
|
2100
2137
|
{
|
|
2101
2138
|
actionName: r,
|
|
2102
2139
|
actionDescription: e,
|
|
@@ -2107,27 +2144,27 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
2107
2144
|
type: y,
|
|
2108
2145
|
onClick: s,
|
|
2109
2146
|
disabled: o,
|
|
2110
|
-
className:
|
|
2111
|
-
style:
|
|
2147
|
+
className: E(),
|
|
2148
|
+
style: d(),
|
|
2112
2149
|
children: t
|
|
2113
2150
|
}
|
|
2114
2151
|
)
|
|
2115
2152
|
}
|
|
2116
2153
|
);
|
|
2117
|
-
},
|
|
2154
|
+
}, rs = ({
|
|
2118
2155
|
children: r,
|
|
2119
2156
|
actionName: e,
|
|
2120
2157
|
actionDescription: t,
|
|
2121
2158
|
showLabel: s = !0,
|
|
2122
2159
|
label: o,
|
|
2123
|
-
fallbackText:
|
|
2124
|
-
fallbackComponent:
|
|
2160
|
+
fallbackText: a = "Campo não disponível",
|
|
2161
|
+
fallbackComponent: c
|
|
2125
2162
|
}) => e ? /* @__PURE__ */ n(
|
|
2126
|
-
|
|
2163
|
+
Mt,
|
|
2127
2164
|
{
|
|
2128
2165
|
actionName: e,
|
|
2129
2166
|
actionDescription: t,
|
|
2130
|
-
fallback:
|
|
2167
|
+
fallback: c || /* @__PURE__ */ C("div", { className: "archbase-secure-field-fallback", style: {
|
|
2131
2168
|
padding: "8px",
|
|
2132
2169
|
color: "#666",
|
|
2133
2170
|
fontStyle: "italic",
|
|
@@ -2135,100 +2172,101 @@ const br = () => Vt().user, Ut = "archbaseSecurityManagerStore", Gr = ({ resourc
|
|
|
2135
2172
|
border: "1px dashed #dee2e6",
|
|
2136
2173
|
borderRadius: "4px"
|
|
2137
2174
|
}, children: [
|
|
2138
|
-
s && o && /* @__PURE__ */
|
|
2175
|
+
s && o && /* @__PURE__ */ C("label", { style: { fontWeight: "bold" }, children: [
|
|
2139
2176
|
o,
|
|
2140
2177
|
": "
|
|
2141
2178
|
] }),
|
|
2142
|
-
|
|
2179
|
+
a
|
|
2143
2180
|
] }),
|
|
2144
2181
|
children: r
|
|
2145
2182
|
}
|
|
2146
|
-
) : /* @__PURE__ */ n(
|
|
2147
|
-
function
|
|
2183
|
+
) : /* @__PURE__ */ n(ne, { children: r });
|
|
2184
|
+
function ss(r, e) {
|
|
2148
2185
|
return function(s) {
|
|
2149
|
-
const { resourceName: o, resourceDescription:
|
|
2186
|
+
const { resourceName: o, resourceDescription: a, requiredPermissions: c, fallbackComponent: i } = e;
|
|
2150
2187
|
return /* @__PURE__ */ n(
|
|
2151
|
-
|
|
2188
|
+
kr,
|
|
2152
2189
|
{
|
|
2153
2190
|
resourceName: o,
|
|
2154
|
-
resourceDescription:
|
|
2155
|
-
requiredPermissions:
|
|
2156
|
-
fallbackComponent:
|
|
2191
|
+
resourceDescription: a,
|
|
2192
|
+
requiredPermissions: c,
|
|
2193
|
+
fallbackComponent: i,
|
|
2157
2194
|
children: /* @__PURE__ */ n(r, { ...s })
|
|
2158
2195
|
}
|
|
2159
2196
|
);
|
|
2160
2197
|
};
|
|
2161
2198
|
}
|
|
2162
2199
|
export {
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
Xr as
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2200
|
+
Rt as ARCHBASE_SECURITY_MANAGER_STORE,
|
|
2201
|
+
vr as AccessIntervalDto,
|
|
2202
|
+
At as AccessScheduleDto,
|
|
2203
|
+
qe as AccessTokenDto,
|
|
2204
|
+
br as ActionDto,
|
|
2205
|
+
Ke as ApiTokenDto,
|
|
2206
|
+
Dt as ArchbaseAccessTokenService,
|
|
2207
|
+
Ut as ArchbaseApiTokenService,
|
|
2208
|
+
gr as ArchbaseAuthContext,
|
|
2209
|
+
Fr as ArchbaseAuthProvider,
|
|
2210
|
+
Pt as ArchbaseGroupService,
|
|
2211
|
+
Hr as ArchbaseLogin,
|
|
2212
|
+
Gr as ArchbaseMfaSetup,
|
|
2213
|
+
Tt as ArchbaseProfileService,
|
|
2214
|
+
Mt as ArchbaseProtectedComponent,
|
|
2215
|
+
Jr as ArchbaseResetPassword,
|
|
2216
|
+
_t as ArchbaseResourceService,
|
|
2217
|
+
ts as ArchbaseSecureActionButton,
|
|
2218
|
+
rs as ArchbaseSecureFormField,
|
|
2219
|
+
wt as ArchbaseSecurityManager,
|
|
2220
|
+
Qr as ArchbaseSecurityProvider,
|
|
2221
|
+
J as ArchbaseTenantManager,
|
|
2222
|
+
ht as ArchbaseUser,
|
|
2223
|
+
It as ArchbaseUserService,
|
|
2224
|
+
pt as ArchbaseUsernameAndPassword,
|
|
2225
|
+
pt as ArchbaseUsernameAndPasswordImpl,
|
|
2226
|
+
kr as ArchbaseViewSecurityProvider,
|
|
2227
|
+
Oe as CONTEXT_STORAGE_KEY,
|
|
2228
|
+
tr as DefaultArchbaseTokenManager,
|
|
2229
|
+
xr as DefaultSecurityLoading,
|
|
2230
|
+
ce as ENCRYPTION_KEY,
|
|
2231
|
+
mt as FetchError,
|
|
2232
|
+
Se as GroupDto,
|
|
2233
|
+
Wr as PermissionDto,
|
|
2234
|
+
ke as ProfileDto,
|
|
2235
|
+
St as ResourceDto,
|
|
2236
|
+
we as SecurityDto,
|
|
2237
|
+
ge as SecurityType,
|
|
2238
|
+
Me as TOKEN_COOKIE_NAME,
|
|
2239
|
+
wr as TipoRecurso,
|
|
2240
|
+
Le as USER_NAME,
|
|
2241
|
+
Be as USER_NAME_AND_PASSWORD,
|
|
2242
|
+
Ne as UserDto,
|
|
2243
|
+
Ge as UserGroupDto,
|
|
2244
|
+
hr as createInternalConfig,
|
|
2245
|
+
Te as decodeJWT,
|
|
2246
|
+
fe as epochAtSecondsFromNow,
|
|
2247
|
+
nt as epochTimeIsPast,
|
|
2248
|
+
cr as fetchTokens,
|
|
2249
|
+
lr as fetchWithRefreshToken,
|
|
2250
|
+
sr as generateCodeChallenge,
|
|
2251
|
+
rr as generateRandomString,
|
|
2252
|
+
ft as getRandomInteger,
|
|
2253
|
+
mr as getRefreshExpiresIn,
|
|
2254
|
+
$e as isCredentialsExpiredError,
|
|
2255
|
+
nr as postWithXForm,
|
|
2256
|
+
ir as redirectToLogin,
|
|
2257
|
+
dr as redirectToLogout,
|
|
2258
|
+
qr as useArchbaseAuthenticationManager,
|
|
2259
|
+
Yr as useArchbaseGetCurrentToken,
|
|
2260
|
+
Er as useArchbaseGetLoggedUser,
|
|
2261
|
+
es as useArchbasePermissionCheck,
|
|
2262
|
+
Xr as useArchbaseResetPassword,
|
|
2263
|
+
Zr as useArchbaseSecureForm,
|
|
2264
|
+
Sr as useArchbaseSecurity,
|
|
2265
|
+
Kr as useArchbaseSecurityManager,
|
|
2266
|
+
Vr as useArchbaseTenantManager,
|
|
2267
|
+
Xe as useArchbaseViewSecurity,
|
|
2268
|
+
jr as useBrowserStorage,
|
|
2269
|
+
pr as validateConfig,
|
|
2270
|
+
ur as validateState,
|
|
2271
|
+
ss as withArchbaseSecurity
|
|
2234
2272
|
};
|