@archbase/security-ui 4.2.6 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,47 +1,47 @@
1
- import { jsx as e, jsxs as r, Fragment as xe } from "react/jsx-runtime";
2
- import { Modal as $e, ScrollArea as de, Stack as V, Grid as H, Group as O, Button as X, Paper as re, Box as _, Text as h, List as Me, Checkbox as la, Tooltip as ke, ActionIcon as fe, Flex as Fe, Space as Ra, Input as Te, useTree as ca, useMantineColorScheme as qe, TextInput as ve, Tree as da, Badge as Q, Tabs as Ce, RingProgress as Ka, SimpleGrid as He, Table as S, Drawer as Ja, Loader as le, Alert as ye, Pagination as Xa, CloseButton as Ya, Chip as ua, Popover as Je, UnstyledButton as ze } from "@mantine/core";
3
- import { getI18nextInstance as g, resolveArchbasePasswordPolicy as _a, ARCHBASE_IOC_API_TYPE as K, emit as Ge, builder as De, validateArchbasePassword as er, convertDateToISOString as ar, processErrorMessage as be, getKeyByEnumValue as Se, useArchbaseTheme as oa, useArchbaseValidator as rr, useArchbaseTranslation as tr, useValidationErrors as ir, processDetailErrorMessage as Ve } from "@archbase/core";
4
- import { ArchbaseEdit as se, ArchbaseNotifications as ne, ArchbasePasswordEdit as or, ArchbaseSelect as nr, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as sr, ArchbaseAsyncSelect as lr, Columns as Ie, ArchbaseDataGridColumn as $, ArchbaseDataGrid as za, ArchbaseDialog as ge } from "@archbase/components";
5
- import { useArchbaseV1V2Compatibility as Ne, useArchbaseDataSourceListener as ha, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ta, ArchbaseDataSource as cr, useArchbaseStore as ka, useArchbaseRemoteDataSourceV2 as Ee, useArchbaseDataSource as dr } from "@archbase/data";
6
- import { useState as T, useCallback as ae, useEffect as ee, forwardRef as ur, useMemo as ie, useRef as Re } from "react";
7
- import { IconArrowRight as Ia, IconArrowLeft as Ea, IconChevronDown as pa, IconBorderCornerSquare as ma, IconEye as hr, IconEdit as Pa, IconTrashX as na, IconShieldCheckered as pr, IconPlus as Fa } from "@tabler/icons-react";
8
- import { UserGroupDto as ga, SecurityType as Y, UserDto as mr, GroupDto as gr, ProfileDto as fr, ApiTokenDto as br } from "@archbase/security";
9
- import { DateTimePicker as vr } from "@mantine/dates";
10
- import { useFocusTrap as yr, useDebouncedValue as ia } from "@mantine/hooks";
11
- import { ArchbaseSpaceFixed as wr, ArchbaseSpaceFill as Cr, ArchbaseSpaceBottom as Sr } from "@archbase/layout";
12
- const xr = (a) => {
13
- const t = { ...a.options ?? {} }, n = () => {
14
- a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (c) => {
15
- c && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), c);
1
+ import { jsx as e, jsxs as r, Fragment as Se } from "react/jsx-runtime";
2
+ import { Modal as $e, ScrollArea as ue, Stack as U, Grid as W, Group as O, Button as X, Paper as re, Box as Y, Text as c, List as Me, Checkbox as ca, Tooltip as ke, ActionIcon as ye, Flex as Fe, Space as za, Input as xe, useTree as da, useMantineColorScheme as qe, TextInput as he, Tree as ua, Badge as j, Tabs as we, RingProgress as Xa, SimpleGrid as We, Table as m, Drawer as _a, Loader as se, Alert as ce, Pagination as ka, CloseButton as Ya, Chip as ha, Popover as Je, UnstyledButton as ze, Select as er } from "@mantine/core";
3
+ import { getI18nextInstance as b, resolveArchbasePasswordPolicy as ar, ARCHBASE_IOC_API_TYPE as K, emit as Ue, builder as Ne, validateArchbasePassword as rr, convertDateToISOString as tr, processErrorMessage as Te, getKeyByEnumValue as Ce, useArchbaseTheme as na, useArchbaseValidator as ir, useArchbaseTranslation as or, useValidationErrors as nr, processDetailErrorMessage as Ve } from "@archbase/core";
4
+ import { ArchbaseEdit as le, ArchbaseNotifications as ne, ArchbasePasswordEdit as sr, ArchbaseSelect as lr, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as cr, ArchbaseAsyncSelect as dr, Columns as Ee, ArchbaseDataGridColumn as L, ArchbaseDataGrid as Ia, ArchbaseDialog as ve } from "@archbase/components";
5
+ import { useArchbaseV1V2Compatibility as Oe, useArchbaseDataSourceListener as pa, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ia, ArchbaseDataSource as ur, useArchbaseStore as Ea, useArchbaseRemoteDataSourceV2 as Pe, useArchbaseDataSource as hr } from "@archbase/data";
6
+ import { useState as C, useCallback as ae, useEffect as ee, forwardRef as pr, useMemo as ie, useRef as Re } from "react";
7
+ import { IconArrowRight as Pa, IconArrowLeft as Da, IconChevronDown as ma, IconBorderCornerSquare as ga, IconEye as mr, IconEdit as Fa, IconTrashX as sa, IconShieldCheckered as gr, IconPlus as Na } from "@tabler/icons-react";
8
+ import { UserGroupDto as fa, SecurityType as _, UserDto as fr, GroupDto as br, ProfileDto as vr, ApiTokenDto as yr } from "@archbase/security";
9
+ import { DateTimePicker as Tr } from "@mantine/dates";
10
+ import { useFocusTrap as wr, useDebouncedValue as oa } from "@mantine/hooks";
11
+ import { ArchbaseSpaceFixed as Cr, ArchbaseSpaceFill as Sr, ArchbaseSpaceBottom as xr } from "@archbase/layout";
12
+ const Ar = (a) => {
13
+ const t = { ...a.options ?? {} }, s = () => {
14
+ a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
15
+ u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
16
16
  }) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
17
- }, s = () => {
17
+ }, n = () => {
18
18
  a.onClickCancel(a.dataSource.getCurrentRecord());
19
19
  };
20
20
  return /* @__PURE__ */ e(
21
21
  $e,
22
22
  {
23
23
  opened: a.opened,
24
- onClose: s,
25
- title: g().t("archbase:Perfil"),
24
+ onClose: n,
25
+ title: b().t("archbase:Perfil"),
26
26
  size: "60%",
27
27
  styles: { content: { maxWidth: 1e3 } },
28
- children: /* @__PURE__ */ e(de, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
28
+ children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
29
29
  t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
30
- /* @__PURE__ */ r(H, { children: [
31
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
32
- se,
30
+ /* @__PURE__ */ r(W, { children: [
31
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
32
+ le,
33
33
  {
34
- label: `${g().t("archbase:Nome do perfil")}`,
35
- placeholder: `${g().t("archbase:Informe o nome do perfil")}`,
34
+ label: `${b().t("archbase:Nome do perfil")}`,
35
+ placeholder: `${b().t("archbase:Informe o nome do perfil")}`,
36
36
  dataSource: a.dataSource,
37
37
  dataField: "name"
38
38
  }
39
39
  ) }),
40
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
41
- se,
40
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
41
+ le,
42
42
  {
43
- label: `${g().t("archbase:Descrição do perfil")}`,
44
- placeholder: `${g().t("archbase:Informe a descrição do perfil")}`,
43
+ label: `${b().t("archbase:Descrição do perfil")}`,
44
+ placeholder: `${b().t("archbase:Informe a descrição do perfil")}`,
45
45
  dataSource: a.dataSource,
46
46
  dataField: "description"
47
47
  }
@@ -49,71 +49,71 @@ const xr = (a) => {
49
49
  ] }),
50
50
  t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
51
51
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
52
- /* @__PURE__ */ e(X, { variant: "default", onClick: s, children: g().t("archbase:Cancelar") }),
53
- /* @__PURE__ */ e(X, { onClick: n, children: g().t("archbase:Salvar") })
52
+ /* @__PURE__ */ e(X, { variant: "default", onClick: n, children: b().t("archbase:Cancelar") }),
53
+ /* @__PURE__ */ e(X, { onClick: s, children: b().t("archbase:Salvar") })
54
54
  ] })
55
55
  ] }) })
56
56
  }
57
57
  );
58
58
  };
59
- function Tr({
59
+ function Rr({
60
60
  availableItemsDS: a,
61
61
  assignedItemsDS: t,
62
- idFieldAvailable: n,
63
- labelFieldAvailable: s,
64
- idFieldAssigned: c,
62
+ idFieldAvailable: s,
63
+ labelFieldAvailable: n,
64
+ idFieldAssigned: u,
65
65
  labelFieldAssigned: d,
66
- handleCreateAssociationObject: u,
67
- width: x = "400px",
68
- height: R = "200px",
69
- titleAvailable: m = "Disponíveis",
70
- titleAssigned: v = "Selecionados"
66
+ handleCreateAssociationObject: h,
67
+ width: A = "400px",
68
+ height: z = "200px",
69
+ titleAvailable: g = "Disponíveis",
70
+ titleAssigned: T = "Selecionados"
71
71
  }) {
72
- Ne(
72
+ Oe(
73
73
  "ArchbaseDualListSelector-Available",
74
74
  a,
75
75
  void 0,
76
76
  []
77
77
  );
78
- const A = Ne(
78
+ const R = Oe(
79
79
  "ArchbaseDualListSelector-Assigned",
80
80
  t,
81
81
  void 0,
82
82
  []
83
- ), [y, P] = T([]), [f, w] = T([]), [o, l] = T([]), [p, b] = T([]), L = ae(() => {
84
- a && P(a.browseRecords()), t && w(t.browseRecords());
83
+ ), [S, D] = C([]), [f, w] = C([]), [o, l] = C([]), [p, v] = C([]), $ = ae(() => {
84
+ a && D(a.browseRecords()), t && w(t.browseRecords());
85
85
  }, [a, t]);
86
- ha({
86
+ pa({
87
87
  dataSource: a,
88
- listener: () => L()
89
- }), ha({
88
+ listener: () => $()
89
+ }), pa({
90
90
  dataSource: t,
91
- listener: () => L()
91
+ listener: () => $()
92
92
  }), ee(() => {
93
- L();
94
- }, [L]);
95
- const E = (D, C) => typeof C == "function" ? C(D) : D[C], i = (D, C) => typeof C == "function" ? C(D) : D[C], N = (D, C) => {
96
- D((z) => z.includes(C) ? z.filter((oe) => oe !== C) : [...z, C]);
97
- }, F = () => {
98
- o.forEach((D) => {
99
- const C = y.find((z) => E(z, n) === D);
100
- if (C) {
101
- const z = u(C);
102
- A.isDataSourceV2 ? (t.insert(z), t.save()) : (t.insert(z), t.save(), A.v1State.forceUpdate());
93
+ $();
94
+ }, [$]);
95
+ const y = (F, x) => typeof x == "function" ? x(F) : F[x], i = (F, x) => typeof x == "function" ? x(F) : F[x], N = (F, x) => {
96
+ F((I) => I.includes(x) ? I.filter((oe) => oe !== x) : [...I, x]);
97
+ }, k = () => {
98
+ o.forEach((F) => {
99
+ const x = S.find((I) => y(I, s) === F);
100
+ if (x) {
101
+ const I = h(x);
102
+ R.isDataSourceV2 ? (t.insert(I), t.save()) : (t.insert(I), t.save(), R.v1State.forceUpdate());
103
103
  }
104
104
  }), l([]);
105
- }, G = () => {
106
- p.forEach((D) => {
107
- const C = f.find((z) => E(z, c) === D);
108
- if (C) {
109
- const z = typeof c == "function" ? { customId: c(C) } : { [c]: D };
110
- A.isDataSourceV2 ? t.remove(() => t.locate(z)) : (t.remove(() => t.locate(z)), A.v1State.forceUpdate());
105
+ }, M = () => {
106
+ p.forEach((F) => {
107
+ const x = f.find((I) => y(I, u) === F);
108
+ if (x) {
109
+ const I = typeof u == "function" ? { customId: u(x) } : { [u]: F };
110
+ R.isDataSourceV2 ? t.remove(() => t.locate(I)) : (t.remove(() => t.locate(I)), R.v1State.forceUpdate());
111
111
  }
112
- }), b([]);
112
+ }), v([]);
113
113
  };
114
- return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width: x, height: R }, children: [
115
- /* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
116
- /* @__PURE__ */ e(h, { children: m }),
114
+ return /* @__PURE__ */ r(re, { withBorder: !0, style: { display: "flex", width: A, height: z }, children: [
115
+ /* @__PURE__ */ r(Y, { style: { minWidth: "44%", minHeight: z }, children: [
116
+ /* @__PURE__ */ e(c, { children: g }),
117
117
  /* @__PURE__ */ e(
118
118
  Me,
119
119
  {
@@ -127,26 +127,26 @@ function Tr({
127
127
  overflowX: "hidden",
128
128
  height: "calc(100% - 32px)"
129
129
  },
130
- children: y.map((D) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
131
- la,
130
+ children: S.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
131
+ ca,
132
132
  {
133
- label: i(D, s),
134
- checked: o.includes(E(D, n)),
135
- onChange: () => N(l, E(D, n)),
133
+ label: i(F, n),
134
+ checked: o.includes(y(F, s)),
135
+ onChange: () => N(l, y(F, s)),
136
136
  disabled: f.some(
137
- (C) => E(C, c) === E(D, n)
137
+ (x) => y(x, u) === y(F, s)
138
138
  )
139
139
  }
140
- ) }, E(D, n)))
140
+ ) }, y(F, s)))
141
141
  }
142
142
  )
143
143
  ] }),
144
- /* @__PURE__ */ r(V, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
145
- /* @__PURE__ */ e(ke, { label: "Adicionar", children: /* @__PURE__ */ e(fe, { onClick: F, disabled: !o.length, children: /* @__PURE__ */ e(Ia, {}) }) }),
146
- /* @__PURE__ */ e(ke, { label: "Remover", children: /* @__PURE__ */ e(fe, { onClick: G, disabled: !p.length, children: /* @__PURE__ */ e(Ea, {}) }) })
144
+ /* @__PURE__ */ r(U, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
145
+ /* @__PURE__ */ e(ke, { label: "Adicionar", children: /* @__PURE__ */ e(ye, { onClick: k, disabled: !o.length, children: /* @__PURE__ */ e(Pa, {}) }) }),
146
+ /* @__PURE__ */ e(ke, { label: "Remover", children: /* @__PURE__ */ e(ye, { onClick: M, disabled: !p.length, children: /* @__PURE__ */ e(Da, {}) }) })
147
147
  ] }),
148
- /* @__PURE__ */ r(_, { style: { minWidth: "44%", minHeight: R }, children: [
149
- /* @__PURE__ */ e(h, { children: v }),
148
+ /* @__PURE__ */ r(Y, { style: { minWidth: "44%", minHeight: z }, children: [
149
+ /* @__PURE__ */ e(c, { children: T }),
150
150
  /* @__PURE__ */ e(
151
151
  Me,
152
152
  {
@@ -160,25 +160,25 @@ function Tr({
160
160
  overflowX: "hidden",
161
161
  height: "calc(100% - 32px)"
162
162
  },
163
- children: f.map((D) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
164
- la,
163
+ children: f.map((F) => /* @__PURE__ */ e(Me.Item, { children: /* @__PURE__ */ e(
164
+ ca,
165
165
  {
166
- label: i(D, d),
167
- checked: p.includes(E(D, c)),
168
- onChange: () => N(b, E(D, c))
166
+ label: i(F, d),
167
+ checked: p.includes(y(F, u)),
168
+ onChange: () => N(v, y(F, u))
169
169
  }
170
- ) }, E(D, c)))
170
+ ) }, y(F, u)))
171
171
  }
172
172
  )
173
173
  ] })
174
174
  ] });
175
175
  }
176
- const Ar = ur(
177
- ({ image: a, label: t, description: n, origin: s, ...c }, d) => /* @__PURE__ */ e("div", { ref: d, ...c, children: /* @__PURE__ */ r(Fe, { children: [
178
- /* @__PURE__ */ e(h, { size: "sm", fw: 600, children: s ? s.name : "" }),
179
- /* @__PURE__ */ e(Ra, { w: "lg" })
176
+ const zr = pr(
177
+ ({ image: a, label: t, description: s, origin: n, ...u }, d) => /* @__PURE__ */ e("div", { ref: d, ...u, children: /* @__PURE__ */ r(Fe, { children: [
178
+ /* @__PURE__ */ e(c, { size: "sm", fw: 600, children: n ? n.name : "" }),
179
+ /* @__PURE__ */ e(za, { w: "lg" })
180
180
  ] }) })
181
- ), Rr = {
181
+ ), kr = {
182
182
  // Campos de identificação
183
183
  showNickname: !0,
184
184
  // Campos de perfil e grupos
@@ -202,46 +202,46 @@ const Ar = ur(
202
202
  avatarImageQuality: 1,
203
203
  avatarMaxOutputSizePx: 512,
204
204
  allowEditEmail: !0
205
- }, zr = (a) => {
206
- const [t, n] = T(""), s = { ...Rr, ...a.options ?? {} }, c = a.dataSource.getFieldValue("passwordChangedAt"), d = c ? new Date(c) : void 0, u = d && !Number.isNaN(d.getTime()) ? d.toLocaleString() : void 0, x = _a(s.passwordPolicy), R = s.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((l) => {
205
+ }, Ir = (a) => {
206
+ const [t, s] = C(""), n = { ...kr, ...a.options ?? {} }, u = a.dataSource.getFieldValue("passwordChangedAt"), d = u ? new Date(u) : void 0, h = d && !Number.isNaN(d.getTime()) ? d.toLocaleString() : void 0, A = ar(n.passwordPolicy), z = n.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((l) => {
207
207
  const p = a.dataSource.getFieldValue(l);
208
208
  return l === "email" && p ? p.split("@")[0] : p;
209
- }).filter((l) => typeof l == "string" && l.trim().length >= 3) : [], m = x ? {
210
- ...x,
211
- blocklist: [...x.blocklist ?? [], ...R]
212
- } : void 0, v = J(K.Group), { dataSource: A } = ta({
209
+ }).filter((l) => typeof l == "string" && l.trim().length >= 3) : [], g = A ? {
210
+ ...A,
211
+ blocklist: [...A.blocklist ?? [], ...z]
212
+ } : void 0, T = J(K.Group), { dataSource: R } = ia({
213
213
  name: "dsGroups",
214
- service: v,
214
+ service: T,
215
215
  pageSize: 9999,
216
216
  loadOnStart: !0,
217
217
  sort: ["name:asc"],
218
218
  onError: (l, p) => {
219
- ne.showError(g().t("archbase:WARNING"), l, p);
219
+ ne.showError(b().t("archbase:WARNING"), l, p);
220
220
  }
221
221
  });
222
222
  console.log("versão 12/05/2026");
223
- const y = J(K.Profile), { dataSource: P } = ta({
223
+ const S = J(K.Profile), { dataSource: D } = ia({
224
224
  name: "dsProfiles",
225
- service: y,
225
+ service: S,
226
226
  pageSize: 9999,
227
227
  loadOnStart: !0,
228
228
  sort: ["name:asc"],
229
229
  onError: (l, p) => {
230
- ne.showError(g().t("archbase:WARNING"), l, p);
230
+ ne.showError(b().t("archbase:WARNING"), l, p);
231
231
  }
232
232
  });
233
233
  ee(() => {
234
- n("");
234
+ s("");
235
235
  }, [a.dataSource.getFieldValue("password")]);
236
236
  const f = async () => {
237
237
  if (a.dataSource.isInserting()) {
238
- if (s.userDefaultProfile) {
239
- const l = Ge(De.eq("name", s.userDefaultProfile)), p = await y.findAllWithFilter(l, 0, 1);
238
+ if (n.userDefaultProfile) {
239
+ const l = Ue(Ne.eq("name", n.userDefaultProfile)), p = await S.findAllWithFilter(l, 0, 1);
240
240
  p && p.content.length > 0 && a.dataSource.setFieldValue("profile", p.content[0]);
241
241
  }
242
- if (s.userDefaultGroups) {
243
- const l = Ge(De.in("name", s.userDefaultGroups)), p = await v.findAllWithFilter(l, 0, 500);
244
- p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((b) => ga.newInstance(b)));
242
+ if (n.userDefaultGroups) {
243
+ const l = Ue(Ne.in("name", n.userDefaultGroups)), p = await T.findAllWithFilter(l, 0, 500);
244
+ p && p.content.length > 0 && a.dataSource.setFieldValue("groups", p.content.map((v) => fa.newInstance(v)));
245
245
  }
246
246
  }
247
247
  };
@@ -251,13 +251,13 @@ const Ar = ur(
251
251
  const w = () => {
252
252
  const l = a.dataSource.getCurrentRecord();
253
253
  if (!l.password && a.dataSource.isInserting()) {
254
- n(g().t("archbase:Informe a senha"));
254
+ s(b().t("archbase:Informe a senha"));
255
255
  return;
256
256
  }
257
- if (m && l.password) {
258
- const p = er(l.password, m);
257
+ if (g && l.password) {
258
+ const p = rr(l.password, g);
259
259
  if (!p.valid) {
260
- n(p.error);
260
+ s(p.error);
261
261
  return;
262
262
  }
263
263
  }
@@ -272,169 +272,169 @@ const Ar = ur(
272
272
  {
273
273
  opened: a.opened,
274
274
  onClose: o,
275
- title: g().t("archbase:Usuário"),
275
+ title: b().t("archbase:Usuário"),
276
276
  size: "80%",
277
277
  styles: { content: { maxWidth: 1e3 } },
278
278
  children: [
279
- /* @__PURE__ */ e(de, { style: { height: "500px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
280
- s?.customContentBefore && /* @__PURE__ */ e(xe, { children: s.customContentBefore(a.dataSource.getCurrentRecord()) }),
281
- /* @__PURE__ */ r(H, { children: [
282
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
279
+ /* @__PURE__ */ e(ue, { style: { height: "500px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
280
+ n?.customContentBefore && /* @__PURE__ */ e(Se, { children: n.customContentBefore(a.dataSource.getCurrentRecord()) }),
281
+ /* @__PURE__ */ r(W, { children: [
282
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(O, { children: [
283
283
  /* @__PURE__ */ e(
284
- se,
284
+ le,
285
285
  {
286
- label: `${g().t("archbase:Nome completo")}`,
287
- placeholder: `${g().t("archbase:Informe o nome completo do usuário")}`,
286
+ label: `${b().t("archbase:Nome completo")}`,
287
+ placeholder: `${b().t("archbase:Informe o nome completo do usuário")}`,
288
288
  dataSource: a.dataSource,
289
289
  dataField: "name",
290
290
  required: !0,
291
291
  width: "calc(100% - 208px)"
292
292
  }
293
293
  ),
294
- s.showNickname && /* @__PURE__ */ e(
295
- se,
294
+ n.showNickname && /* @__PURE__ */ e(
295
+ le,
296
296
  {
297
- label: `${g().t("archbase:Apelido")}`,
298
- placeholder: `${g().t("archbase:Apelido")}`,
297
+ label: `${b().t("archbase:Apelido")}`,
298
+ placeholder: `${b().t("archbase:Apelido")}`,
299
299
  dataSource: a.dataSource,
300
300
  dataField: "nickname",
301
- required: s.requiredNickname
301
+ required: n.requiredNickname
302
302
  }
303
303
  )
304
304
  ] }) }),
305
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
306
- se,
305
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
306
+ le,
307
307
  {
308
- label: `${g().t("archbase:Descrição do usuário")}`,
309
- placeholder: `${g().t("archbase:Informe a descrição do usuário")}`,
308
+ label: `${b().t("archbase:Descrição do usuário")}`,
309
+ placeholder: `${b().t("archbase:Informe a descrição do usuário")}`,
310
310
  dataSource: a.dataSource,
311
311
  dataField: "description",
312
312
  required: !0
313
313
  }
314
314
  ) })
315
315
  ] }),
316
- /* @__PURE__ */ r(H, { children: [
317
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
318
- se,
316
+ /* @__PURE__ */ r(W, { children: [
317
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
318
+ le,
319
319
  {
320
- label: `${g().t("archbase:E-mail")}`,
321
- placeholder: `${g().t("archbase:Informe o e-mail do usuário")}`,
320
+ label: `${b().t("archbase:E-mail")}`,
321
+ placeholder: `${b().t("archbase:Informe o e-mail do usuário")}`,
322
322
  dataSource: a.dataSource,
323
323
  onChangeValue: (l) => a.dataSource.setFieldValue("userName", l),
324
324
  dataField: "email",
325
- readOnly: a.dataSource.isEditing() ? !s.allowEditEmail : !1,
325
+ readOnly: a.dataSource.isEditing() ? !n.allowEditEmail : !1,
326
326
  required: !0
327
327
  }
328
328
  ) }),
329
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
330
- or,
329
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
330
+ sr,
331
331
  {
332
- label: `${g().t("archbase:Senha usuário")}`,
332
+ label: `${b().t("archbase:Senha usuário")}`,
333
333
  dataSource: a.dataSource,
334
334
  dataField: "password",
335
335
  error: t,
336
336
  required: a.dataSource.getFieldValue("isNewUser"),
337
- passwordPolicy: m,
338
- showPasswordRequirements: s.showPasswordRequirements
337
+ passwordPolicy: g,
338
+ showPasswordRequirements: n.showPasswordRequirements
339
339
  }
340
340
  ) })
341
341
  ] }),
342
- /* @__PURE__ */ e(H, { children: s.showProfile && /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
343
- nr,
342
+ /* @__PURE__ */ e(W, { children: n.showProfile && /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
343
+ lr,
344
344
  {
345
- label: `${g().t("archbase:Perfil do usuário")}`,
345
+ label: `${b().t("archbase:Perfil do usuário")}`,
346
346
  dataSource: a.dataSource,
347
347
  dataField: "profile",
348
- options: P,
348
+ options: D,
349
349
  allowDeselect: !0,
350
350
  optionsLabelField: "nome",
351
- itemComponent: Ar,
351
+ itemComponent: zr,
352
352
  getOptionLabel: (l) => l.name,
353
353
  getOptionValue: (l) => l.id
354
354
  }
355
355
  ) }) }),
356
- /* @__PURE__ */ r(H, { children: [
357
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: s.showAccountConfigLabel && /* @__PURE__ */ e(h, { fz: 14, fw: 500, children: "Informe" }) }),
358
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
359
- s.showChangePasswordOnNextLogin && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
356
+ /* @__PURE__ */ r(W, { children: [
357
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: n.showAccountConfigLabel && /* @__PURE__ */ e(c, { fz: 14, fw: 500, children: "Informe" }) }),
358
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
359
+ n.showChangePasswordOnNextLogin && /* @__PURE__ */ e(xe.Wrapper, { label: "", children: /* @__PURE__ */ e(
360
360
  Ae,
361
361
  {
362
362
  dataSource: a.dataSource,
363
363
  dataField: "changePasswordOnNextLogin",
364
- label: `${g().t("archbase:Deve alterar senha próximo login ?")}`
364
+ label: `${b().t("archbase:Deve alterar senha próximo login ?")}`
365
365
  }
366
366
  ) }),
367
- s.showAllowPasswordChange && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
367
+ n.showAllowPasswordChange && /* @__PURE__ */ e(xe.Wrapper, { label: "", children: /* @__PURE__ */ e(
368
368
  Ae,
369
369
  {
370
370
  dataSource: a.dataSource,
371
371
  dataField: "allowPasswordChange",
372
- label: `${g().t("archbase:Pode alterar a senha ?")}`
372
+ label: `${b().t("archbase:Pode alterar a senha ?")}`
373
373
  }
374
374
  ) }),
375
- s.showPasswordNeverExpires && /* @__PURE__ */ r(Te.Wrapper, { label: "", children: [
375
+ n.showPasswordNeverExpires && /* @__PURE__ */ r(xe.Wrapper, { label: "", children: [
376
376
  /* @__PURE__ */ e(
377
377
  Ae,
378
378
  {
379
379
  dataSource: a.dataSource,
380
380
  dataField: "passwordNeverExpires",
381
- label: `${g().t("archbase:Senha nunca expira ?")}`
381
+ label: `${b().t("archbase:Senha nunca expira ?")}`
382
382
  }
383
383
  ),
384
- /* @__PURE__ */ e(h, { fz: 12, c: "dimmed", children: g().t(
384
+ /* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: b().t(
385
385
  'archbase:Desmarcado, a senha expira conforme a política de validade do servidor. Para exigir a troca agora, use "Deve alterar senha próximo login".'
386
386
  ) })
387
387
  ] }),
388
- s.showPasswordChangedAt && u && /* @__PURE__ */ e(h, { fz: 12, c: "dimmed", children: `${g().t("archbase:Última troca de senha")}: ${u}` })
388
+ n.showPasswordChangedAt && h && /* @__PURE__ */ e(c, { fz: 12, c: "dimmed", children: `${b().t("archbase:Última troca de senha")}: ${h}` })
389
389
  ] }) }),
390
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
391
- s.showAccountDeactivated && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
390
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(U, { gap: "lg", children: [
391
+ n.showAccountDeactivated && /* @__PURE__ */ e(xe.Wrapper, { label: "", children: /* @__PURE__ */ e(
392
392
  Ae,
393
393
  {
394
394
  dataSource: a.dataSource,
395
395
  dataField: "accountDeactivated",
396
- label: `${g().t("archbase:Conta desativada ?")}`
396
+ label: `${b().t("archbase:Conta desativada ?")}`
397
397
  }
398
398
  ) }),
399
- s.showAccountLocked && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
399
+ n.showAccountLocked && /* @__PURE__ */ e(xe.Wrapper, { label: "", children: /* @__PURE__ */ e(
400
400
  Ae,
401
401
  {
402
402
  dataSource: a.dataSource,
403
403
  dataField: "accountLocked",
404
- label: `${g().t("archbase:Conta bloqueada ?")}`
404
+ label: `${b().t("archbase:Conta bloqueada ?")}`
405
405
  }
406
406
  ) }),
407
- s.showIsAdministrator && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
407
+ n.showIsAdministrator && /* @__PURE__ */ e(xe.Wrapper, { label: "", children: /* @__PURE__ */ e(
408
408
  Ae,
409
409
  {
410
410
  dataSource: a.dataSource,
411
411
  dataField: "isAdministrator",
412
- label: `${g().t("archbase:Administrador ?")}`
412
+ label: `${b().t("archbase:Administrador ?")}`
413
413
  }
414
414
  ) })
415
415
  ] }) }),
416
- /* @__PURE__ */ e(H.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(V, { gap: "lg", children: /* @__PURE__ */ e(
417
- sr,
416
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(U, { gap: "lg", children: /* @__PURE__ */ e(
417
+ cr,
418
418
  {
419
- label: g().t("archbase:Foto do usuário"),
419
+ label: b().t("archbase:Foto do usuário"),
420
420
  dataSource: a.dataSource,
421
421
  dataField: "avatar",
422
422
  width: 120,
423
423
  height: 120,
424
- maxSizeKB: s.avatarMaxSizeKB,
425
- imageQuality: s.avatarImageQuality,
426
- maxOutputSizePx: s.avatarMaxOutputSizePx
424
+ maxSizeKB: n.avatarMaxSizeKB,
425
+ imageQuality: n.avatarImageQuality,
426
+ maxOutputSizePx: n.avatarMaxOutputSizePx
427
427
  }
428
428
  ) }) })
429
429
  ] }),
430
- s.showGroups && /* @__PURE__ */ r(H, { children: [
431
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(h, { fz: 14, fw: 500, children: "Grupos" }) }),
432
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
433
- Tr,
430
+ n.showGroups && /* @__PURE__ */ r(W, { children: [
431
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(c, { fz: 14, fw: 500, children: "Grupos" }) }),
432
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
433
+ Rr,
434
434
  {
435
- titleAvailable: g().t("archbase:Disponíveis"),
436
- titleAssigned: g().t("archbase:Selecionados"),
437
- assignedItemsDS: new cr("dsDualList", {
435
+ titleAvailable: b().t("archbase:Disponíveis"),
436
+ titleAssigned: b().t("archbase:Selecionados"),
437
+ assignedItemsDS: new ur("dsDualList", {
438
438
  records: a.dataSource.getFieldValue("groups"),
439
439
  grandTotalRecords: a.dataSource.getFieldValue("groups").length,
440
440
  currentPage: 0,
@@ -443,8 +443,8 @@ const Ar = ur(
443
443
  }),
444
444
  width: "100%",
445
445
  height: "200px",
446
- availableItemsDS: A,
447
- handleCreateAssociationObject: (l) => ga.newInstance(l),
446
+ availableItemsDS: R,
447
+ handleCreateAssociationObject: (l) => fa.newInstance(l),
448
448
  idFieldAssigned: (l) => l && l.group ? l.group.id : "",
449
449
  idFieldAvailable: "id",
450
450
  labelFieldAssigned: (l) => l && l.group ? l.group.name : "",
@@ -452,49 +452,49 @@ const Ar = ur(
452
452
  }
453
453
  ) })
454
454
  ] }),
455
- s?.customContentAfter && /* @__PURE__ */ e(xe, { children: s.customContentAfter(a.dataSource.getCurrentRecord()) }),
456
- /* @__PURE__ */ e(Ra, { h: "12px" })
455
+ n?.customContentAfter && /* @__PURE__ */ e(Se, { children: n.customContentAfter(a.dataSource.getCurrentRecord()) }),
456
+ /* @__PURE__ */ e(za, { h: "12px" })
457
457
  ] }) }),
458
458
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
459
- /* @__PURE__ */ e(X, { variant: "default", onClick: o, children: g().t("archbase:Cancelar") }),
460
- /* @__PURE__ */ e(X, { onClick: w, children: g().t("archbase:Salvar") })
459
+ /* @__PURE__ */ e(X, { variant: "default", onClick: o, children: b().t("archbase:Cancelar") }),
460
+ /* @__PURE__ */ e(X, { onClick: w, children: b().t("archbase:Salvar") })
461
461
  ] })
462
462
  ]
463
463
  }
464
464
  );
465
- }, kr = (a) => {
466
- const t = { ...a.options ?? {} }, n = () => {
467
- a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (c) => {
468
- c && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), c);
465
+ }, Er = (a) => {
466
+ const t = { ...a.options ?? {} }, s = () => {
467
+ a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (u) => {
468
+ u && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), u);
469
469
  }) : a.onClickOk(a.dataSource.getCurrentRecord(), !0);
470
- }, s = () => {
470
+ }, n = () => {
471
471
  a.onClickCancel(a.dataSource.getCurrentRecord());
472
472
  };
473
473
  return /* @__PURE__ */ e(
474
474
  $e,
475
475
  {
476
476
  opened: a.opened,
477
- onClose: s,
478
- title: g().t("archbase:Grupo"),
477
+ onClose: n,
478
+ title: b().t("archbase:Grupo"),
479
479
  size: "60%",
480
480
  styles: { content: { maxWidth: 1e3 } },
481
- children: /* @__PURE__ */ e(de, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
481
+ children: /* @__PURE__ */ e(ue, { style: { height: "460px" }, children: /* @__PURE__ */ r(U, { w: "98%", children: [
482
482
  t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
483
- /* @__PURE__ */ r(H, { children: [
484
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
485
- se,
483
+ /* @__PURE__ */ r(W, { children: [
484
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
485
+ le,
486
486
  {
487
- label: `${g().t("archbase:Nome do grupo")}`,
488
- placeholder: `${g().t("archbase:Informe o nome do grupo")}`,
487
+ label: `${b().t("archbase:Nome do grupo")}`,
488
+ placeholder: `${b().t("archbase:Informe o nome do grupo")}`,
489
489
  dataSource: a.dataSource,
490
490
  dataField: "name"
491
491
  }
492
492
  ) }),
493
- /* @__PURE__ */ e(H.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
494
- se,
493
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
494
+ le,
495
495
  {
496
- label: `${g().t("archbase:Descrição do grupo")}`,
497
- placeholder: `${g().t("archbase:Informe a descrição do grupo")}`,
496
+ label: `${b().t("archbase:Descrição do grupo")}`,
497
+ placeholder: `${b().t("archbase:Informe a descrição do grupo")}`,
498
498
  dataSource: a.dataSource,
499
499
  dataField: "description"
500
500
  }
@@ -502,82 +502,82 @@ const Ar = ur(
502
502
  ] }),
503
503
  t?.customContentAfter && t.customContentAfter(a.dataSource.getCurrentRecord()),
504
504
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
505
- /* @__PURE__ */ e(X, { variant: "default", onClick: s, children: g().t("archbase:Cancelar") }),
506
- /* @__PURE__ */ e(X, { onClick: n, children: g().t("archbase:Salvar") })
505
+ /* @__PURE__ */ e(X, { variant: "default", onClick: n, children: b().t("archbase:Cancelar") }),
506
+ /* @__PURE__ */ e(X, { onClick: s, children: b().t("archbase:Salvar") })
507
507
  ] })
508
508
  ] }) })
509
509
  }
510
510
  );
511
- }, Ir = ({ image: a, label: t, description: n, ...s }) => /* @__PURE__ */ e("div", { ...s, children: /* @__PURE__ */ r(O, { grow: !0, children: [
511
+ }, Pr = ({ image: a, label: t, description: s, ...n }) => /* @__PURE__ */ e("div", { ...n, children: /* @__PURE__ */ r(O, { grow: !0, children: [
512
512
  /* @__PURE__ */ e("img", { style: { maxWidth: "32px" }, src: a }),
513
513
  /* @__PURE__ */ r("div", { children: [
514
- /* @__PURE__ */ e(h, { size: "sm", children: t }),
515
- /* @__PURE__ */ e(h, { size: "xs", opacity: 0.65, children: n })
514
+ /* @__PURE__ */ e(c, { size: "sm", children: t }),
515
+ /* @__PURE__ */ e(c, { size: "xs", opacity: 0.65, children: s })
516
516
  ] })
517
- ] }) }), Er = (a) => {
518
- yr();
519
- const [t, n] = T(), s = J(K.User), c = Ne(
517
+ ] }) }), Dr = (a) => {
518
+ wr();
519
+ const [t, s] = C(), n = J(K.User), u = Oe(
520
520
  "ApiTokenModal",
521
521
  a.dataSource,
522
522
  "expirationDate",
523
523
  ""
524
524
  );
525
- process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${c.dataSourceVersion}`);
526
- const d = (m) => {
527
- if (!m)
528
- c.handleValueChange(void 0);
525
+ process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${u.dataSourceVersion}`);
526
+ const d = (g) => {
527
+ if (!g)
528
+ u.handleValueChange(void 0);
529
529
  else {
530
- const v = typeof m == "string" ? new Date(m) : m, A = ar(v);
531
- c.handleValueChange(A);
530
+ const T = typeof g == "string" ? new Date(g) : g, R = tr(T);
531
+ u.handleValueChange(R);
532
532
  }
533
- n(m);
534
- }, u = async (m, v) => new Promise(async (A, y) => {
533
+ s(g);
534
+ }, h = async (g, T) => new Promise(async (R, S) => {
535
535
  try {
536
- const P = Ge(De.or(De.eq("name", `^*${v.trim()}*`))), f = await s.findAllWithFilter(P, m, 20);
537
- A({
536
+ const D = Ue(Ne.or(Ne.eq("name", `^*${T.trim()}*`))), f = await n.findAllWithFilter(D, g, 20);
537
+ R({
538
538
  options: f.content,
539
539
  page: f.pageable.pageNumber,
540
540
  totalPages: f.totalPages
541
541
  });
542
- } catch (P) {
543
- y(be(P));
542
+ } catch (D) {
543
+ S(Te(D));
544
544
  }
545
- }), x = () => {
546
- a.onCustomSave ? a.onCustomSave(a.dataSource.current, (m) => {
547
- m && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, m);
545
+ }), A = () => {
546
+ a.onCustomSave ? a.onCustomSave(a.dataSource.current, (g) => {
547
+ g && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, g);
548
548
  }) : a.onClickOk(a.dataSource.current, !0);
549
- }, R = () => {
549
+ }, z = () => {
550
550
  a.onClickCancel(a.dataSource.current);
551
551
  };
552
552
  return /* @__PURE__ */ r(
553
553
  $e,
554
554
  {
555
555
  opened: a.opened,
556
- onClose: R,
557
- title: g().t("archbase:Token de API"),
556
+ onClose: z,
557
+ title: b().t("archbase:Token de API"),
558
558
  size: "50%",
559
559
  children: [
560
- /* @__PURE__ */ r(de, { style: { height: "300px" }, children: [
560
+ /* @__PURE__ */ r(ue, { style: { height: "300px" }, children: [
561
561
  /* @__PURE__ */ e(
562
- se,
562
+ le,
563
563
  {
564
- label: `${g().t("archbase:Nome do token")}`,
565
- placeholder: `${g().t("archbase:Informe o nome do token")}`,
564
+ label: `${b().t("archbase:Nome do token")}`,
565
+ placeholder: `${b().t("archbase:Informe o nome do token")}`,
566
566
  dataSource: a.dataSource,
567
567
  dataField: "name"
568
568
  }
569
569
  ),
570
570
  /* @__PURE__ */ e(
571
- se,
571
+ le,
572
572
  {
573
- label: `${g().t("archbase:Descrição do token")}`,
574
- placeholder: `${g().t("archbase:Informe a descrição do token")}`,
573
+ label: `${b().t("archbase:Descrição do token")}`,
574
+ placeholder: `${b().t("archbase:Informe a descrição do token")}`,
575
575
  dataSource: a.dataSource,
576
576
  dataField: "description"
577
577
  }
578
578
  ),
579
579
  /* @__PURE__ */ e(
580
- vr,
580
+ Tr,
581
581
  {
582
582
  withSeconds: !0,
583
583
  value: t,
@@ -587,191 +587,191 @@ const Ar = ur(
587
587
  }
588
588
  ),
589
589
  /* @__PURE__ */ e(
590
- lr,
590
+ dr,
591
591
  {
592
- label: `${g().t("archbase:Usuário")}`,
592
+ label: `${b().t("archbase:Usuário")}`,
593
593
  dataSource: a.dataSource,
594
594
  dataField: "user",
595
- placeholder: `${g().t("archbase:Digite aqui o nome do usuário")}`,
596
- getOptionLabel: (m) => m && m.email ? m.email : "",
597
- getOptionValue: (m) => m && m.id ? m.id.toString() : "",
598
- getOptions: u,
595
+ placeholder: `${b().t("archbase:Digite aqui o nome do usuário")}`,
596
+ getOptionLabel: (g) => g && g.email ? g.email : "",
597
+ getOptionValue: (g) => g && g.id ? g.id.toString() : "",
598
+ getOptions: h,
599
599
  debounceTime: 500,
600
600
  minCharsToSearch: 1,
601
- itemComponent: Ir
601
+ itemComponent: Pr
602
602
  }
603
603
  )
604
604
  ] }),
605
605
  /* @__PURE__ */ r(O, { justify: "flex-end", mt: "md", children: [
606
- /* @__PURE__ */ e(X, { variant: "default", onClick: R, children: g().t("archbase:Cancelar") }),
607
- /* @__PURE__ */ e(X, { onClick: x, children: g().t("archbase:Salvar") })
606
+ /* @__PURE__ */ e(X, { variant: "default", onClick: z, children: b().t("archbase:Cancelar") }),
607
+ /* @__PURE__ */ e(X, { onClick: A, children: b().t("archbase:Salvar") })
608
608
  ] })
609
609
  ]
610
610
  }
611
611
  );
612
- }, fa = (a) => {
612
+ }, ba = (a) => {
613
613
  const t = "->";
614
- return a.includes(t) ? a.split(t).map((c) => c.trim()).map((c) => g().t(c)).join(` ${t} `) : g().t(a);
614
+ return a.includes(t) ? a.split(t).map((u) => u.trim()).map((u) => b().t(u)).join(` ${t} `) : b().t(a);
615
615
  };
616
- function Xe({ dataSource: a, opened: t, close: n }) {
617
- const s = ie(() => a?.getFieldValue("name") || "", [a]), c = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), u = ca(), x = ca(), [R, m] = T([]), [v, A] = T([]), [y, P] = T(), [f, w] = T(), [o, l] = T(""), [p] = ia(o, 200), [b, L] = T(""), [E] = ia(b, 200), i = J(K.Resource), { colorScheme: N } = qe(), F = N === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", G = ie(() => v.sort((k, I) => k.resourceDescription.localeCompare(I.resourceDescription)).map((k) => ({
618
- value: k.resourceId,
619
- label: k.resourceDescription,
620
- children: k.permissions.filter((I) => I.actionDescription.toLowerCase().includes(E.toLowerCase())).sort((I, q) => I.actionDescription.localeCompare(q.actionDescription)).map((I) => ({
621
- value: I.actionId,
622
- label: I.actionDescription,
616
+ function Xe({ dataSource: a, opened: t, close: s }) {
617
+ const n = ie(() => a?.getFieldValue("name") || "", [a]), u = ie(() => a?.getFieldValue("id") || "", [a]), d = ie(() => a?.getFieldValue("type") || "", [a]), h = da(), A = da(), [z, g] = C([]), [T, R] = C([]), [S, D] = C(), [f, w] = C(), [o, l] = C(""), [p] = oa(o, 200), [v, $] = C(""), [y] = oa(v, 200), i = J(K.Resource), { colorScheme: N } = qe(), k = N === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", M = ie(() => T.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
618
+ value: E.resourceId,
619
+ label: E.resourceDescription,
620
+ children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(y.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => ({
621
+ value: P.actionId,
622
+ label: P.actionDescription,
623
623
  nodeProps: {
624
- permissionId: I.permissionId,
625
- types: I.types ?? [],
626
- owner: k
624
+ permissionId: P.permissionId,
625
+ types: P.types ?? [],
626
+ owner: E
627
627
  }
628
628
  }))
629
- })), [v, E]), D = ie(() => v.map((k) => k.permissions.map((I) => I.actionId)).flat(), [v]), C = ie(() => R.sort((k, I) => k.resourceDescription.localeCompare(I.resourceDescription)).map((k) => ({
630
- value: k.resourceId,
631
- label: k.resourceDescription,
632
- children: k.permissions.filter((I) => I.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((I, q) => I.actionDescription.localeCompare(q.actionDescription)).map((I) => {
633
- const q = v.find((U) => U.resourceId === k.resourceId)?.permissions.find((U) => U.actionId === I.actionId);
629
+ })), [T, y]), F = ie(() => T.map((E) => E.permissions.map((P) => P.actionId)).flat(), [T]), x = ie(() => z.sort((E, P) => E.resourceDescription.localeCompare(P.resourceDescription)).map((E) => ({
630
+ value: E.resourceId,
631
+ label: E.resourceDescription,
632
+ children: E.permissions.filter((P) => P.actionDescription.toLowerCase().includes(p.toLowerCase())).sort((P, q) => P.actionDescription.localeCompare(q.actionDescription)).map((P) => {
633
+ const q = T.find((G) => G.resourceId === E.resourceId)?.permissions.find((G) => G.actionId === P.actionId);
634
634
  return {
635
- value: I.actionId,
636
- label: I.actionDescription,
635
+ value: P.actionId,
636
+ label: P.actionDescription,
637
637
  nodeProps: {
638
- granted: D.includes(I.actionId) && q?.types?.includes(Se(Y, d)),
639
- owner: k
638
+ granted: F.includes(P.actionId) && q?.types?.includes(Ce(_, d)),
639
+ owner: E
640
640
  }
641
641
  };
642
642
  })
643
- })), [R, v, D, d, p]), z = ae(async () => {
644
- if (c) {
645
- const k = await i.getPermissionsBySecurityId(c, d), I = await i.getAllPermissionsAvailable();
646
- m(I), A(k);
643
+ })), [z, T, F, d, p]), I = ae(async () => {
644
+ if (u) {
645
+ const E = await i.getPermissionsBySecurityId(u, d), P = await i.getAllPermissionsAvailable();
646
+ g(P), R(E);
647
647
  }
648
- }, [c, d]), oe = ae(() => {
649
- y?.value && c && i.createPermission(c, y.value, d).then((k) => {
650
- if (k) {
651
- A((j) => {
648
+ }, [u, d]), oe = ae(() => {
649
+ S?.value && u && i.createPermission(u, S.value, d).then((E) => {
650
+ if (E) {
651
+ R((Z) => {
652
652
  let B;
653
- return j.map((Z) => Z.resourceId).includes(k.resourceId) ? B = j.map((Z) => Z.resourceId === k.resourceId ? Z.permissions.map((W) => W.actionId).includes(y.value) ? {
654
- ...Z,
655
- permissions: Z.permissions.map(
656
- (W) => W.actionId === y.value ? {
657
- ...W,
658
- permissionId: k.permissionId,
659
- types: [...W.types ?? [], Se(Y, d)]
660
- } : W
653
+ return Z.map((Q) => Q.resourceId).includes(E.resourceId) ? B = Z.map((Q) => Q.resourceId === E.resourceId ? Q.permissions.map((H) => H.actionId).includes(S.value) ? {
654
+ ...Q,
655
+ permissions: Q.permissions.map(
656
+ (H) => H.actionId === S.value ? {
657
+ ...H,
658
+ permissionId: E.permissionId,
659
+ types: [...H.types ?? [], Ce(_, d)]
660
+ } : H
661
661
  )
662
662
  } : {
663
- ...Z,
663
+ ...Q,
664
664
  permissions: [
665
- ...Z.permissions ?? [],
665
+ ...Q.permissions ?? [],
666
666
  {
667
- actionId: k.actionId,
668
- actionDescription: k.actionDescription,
669
- permissionId: k.permissionId,
670
- types: [Se(Y, d)]
667
+ actionId: E.actionId,
668
+ actionDescription: E.actionDescription,
669
+ permissionId: E.permissionId,
670
+ types: [Ce(_, d)]
671
671
  }
672
672
  ]
673
- } : Z) : B = [
674
- ...j,
673
+ } : Q) : B = [
674
+ ...Z,
675
675
  {
676
- resourceId: k.resourceId,
677
- resourceDescription: k.resourceDescription,
676
+ resourceId: E.resourceId,
677
+ resourceDescription: E.resourceDescription,
678
678
  permissions: [
679
679
  {
680
- actionId: k.actionId,
681
- actionDescription: k.actionDescription,
682
- permissionId: k.permissionId,
683
- types: [Se(Y, d)]
680
+ actionId: E.actionId,
681
+ actionDescription: E.actionDescription,
682
+ permissionId: E.permissionId,
683
+ types: [Ce(_, d)]
684
684
  }
685
685
  ]
686
686
  }
687
687
  ], B;
688
688
  });
689
- const I = C.filter((j) => j.value === y?.nodeProps?.owner?.resourceId).map((j) => j.children).flat(), q = I.map((j) => j.value).indexOf(y.value), U = I.find((j, B) => !j?.nodeProps?.granted && j?.value !== y.value && (I.length > q + 1 ? B > q : !0));
690
- U?.value && u.select(U.value), x.expand(k.resourceId), P(U);
689
+ const P = x.filter((Z) => Z.value === S?.nodeProps?.owner?.resourceId).map((Z) => Z.children).flat(), q = P.map((Z) => Z.value).indexOf(S.value), G = P.find((Z, B) => !Z?.nodeProps?.granted && Z?.value !== S.value && (P.length > q + 1 ? B > q : !0));
690
+ G?.value && h.select(G.value), A.expand(E.resourceId), D(G);
691
691
  }
692
692
  });
693
- }, [y, c, d, i, C, R, v, u, x]), ue = ae(() => {
693
+ }, [S, u, d, i, x, z, T, h, A]), me = ae(() => {
694
694
  f?.nodeProps?.permissionId && i.deletePermission(f.nodeProps.permissionId).then(() => {
695
- A((U) => [...U].filter((B) => {
696
- let Z = !0;
697
- return B.permissions?.forEach((W) => {
698
- W.permissionId !== void 0 && W.permissionId === f?.nodeProps?.permissionId && B.permissions.length === 1 && W?.types?.length === 1 && W.types[0] === Se(Y, d) && (Z = !1);
699
- }), Z;
695
+ R((G) => [...G].filter((B) => {
696
+ let Q = !0;
697
+ return B.permissions?.forEach((H) => {
698
+ H.permissionId !== void 0 && H.permissionId === f?.nodeProps?.permissionId && B.permissions.length === 1 && H?.types?.length === 1 && H.types[0] === Ce(_, d) && (Q = !1);
699
+ }), Q;
700
700
  }).map((B) => {
701
- const Z = f?.nodeProps?.owner;
702
- return B.resourceId === Z.resourceId ? f?.nodeProps?.types?.length === 1 ? {
701
+ const Q = f?.nodeProps?.owner;
702
+ return B.resourceId === Q.resourceId ? f?.nodeProps?.types?.length === 1 ? {
703
703
  ...B,
704
- permissions: [...(B.permissions ?? []).filter((W) => W.permissionId !== f?.nodeProps?.permissionId)]
704
+ permissions: [...(B.permissions ?? []).filter((H) => H.permissionId !== f?.nodeProps?.permissionId)]
705
705
  } : {
706
706
  ...B,
707
- permissions: (B.permissions ?? []).map((W) => W.actionId === f.value ? {
708
- actionId: W.actionId,
709
- actionDescription: W.actionDescription,
710
- types: [...W.types?.filter((ce) => ce && ce !== Se(Y, d)) ?? []]
711
- } : W)
707
+ permissions: (B.permissions ?? []).map((H) => H.actionId === f.value ? {
708
+ actionId: H.actionId,
709
+ actionDescription: H.actionDescription,
710
+ types: [...H.types?.filter((de) => de && de !== Ce(_, d)) ?? []]
711
+ } : H)
712
712
  } : B;
713
713
  }));
714
- const k = G.filter((U) => U.value === f?.nodeProps?.owner?.resourceId).map((U) => U.children).flat(), I = k.map((U) => U.value).indexOf(f.value), q = k.find((U, j) => U?.nodeProps?.types.includes(Se(Y, d)) && U?.value !== f.value && (k.length > I + 1 ? j > I : !0));
715
- q?.value && x.select(q.value), w(q);
714
+ const E = M.filter((G) => G.value === f?.nodeProps?.owner?.resourceId).map((G) => G.children).flat(), P = E.map((G) => G.value).indexOf(f.value), q = E.find((G, Z) => G?.nodeProps?.types.includes(Ce(_, d)) && G?.value !== f.value && (E.length > P + 1 ? Z > P : !0));
715
+ q?.value && A.select(q.value), w(q);
716
716
  });
717
- }, [f, i, d, G, v, x]);
717
+ }, [f, i, d, M, T, A]);
718
718
  return ee(() => {
719
- t && a && (P(void 0), w(void 0), l(""), L(""), x.collapseAllNodes(), u.collapseAllNodes(), z());
720
- }, [t, d, c, z]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: n, title: `${g().t(`archbase:${d}`)}: ${s}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(wr, { height: "540px", children: [
721
- /* @__PURE__ */ e(Cr, { children: /* @__PURE__ */ e(re, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ r("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
719
+ t && a && (D(void 0), w(void 0), l(""), $(""), A.collapseAllNodes(), h.collapseAllNodes(), I());
720
+ }, [t, d, u, I]), a ? /* @__PURE__ */ e($e, { opened: t, onClose: s, title: `${b().t(`archbase:${d}`)}: ${n}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(Cr, { height: "540px", children: [
721
+ /* @__PURE__ */ e(Sr, { children: /* @__PURE__ */ e(re, { withBorder: !0, my: 20, p: 20, style: { height: "calc(100% - 40px)", overflow: "hidden", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ r("div", { style: { flex: 1, display: "flex", flexDirection: "row", overflow: "hidden", minHeight: 0, gap: "8px" }, children: [
722
722
  /* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
723
723
  /* @__PURE__ */ r(O, { mb: 20, children: [
724
- /* @__PURE__ */ e(h, { children: g().t("archbase:Available") }),
724
+ /* @__PURE__ */ e(c, { children: b().t("archbase:Available") }),
725
725
  /* @__PURE__ */ e(
726
- ve,
726
+ he,
727
727
  {
728
728
  size: "xs",
729
729
  value: o,
730
- onChange: (k) => l(k.target.value),
731
- placeholder: g().t("archbase:Filter available permissions")
730
+ onChange: (E) => l(E.target.value),
731
+ placeholder: b().t("archbase:Filter available permissions")
732
732
  }
733
733
  )
734
734
  ] }),
735
- /* @__PURE__ */ e(de, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
736
- da,
735
+ /* @__PURE__ */ e(ue, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
736
+ ua,
737
737
  {
738
- data: C,
738
+ data: x,
739
739
  selectOnClick: !0,
740
740
  allowRangeSelection: !1,
741
- tree: u,
742
- renderNode: ({ level: k, node: I, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
743
- const Z = I?.nodeProps?.granted, W = Z ? "dimmed" : void 0, ce = Z ? "line-through" : void 0, je = ae((Ze) => {
744
- P(I), B.onClick(Ze);
745
- }, [I, B.onClick]);
741
+ tree: h,
742
+ renderNode: ({ level: E, node: P, expanded: q, hasChildren: G, selected: Z, elementProps: B }) => {
743
+ const Q = P?.nodeProps?.granted, H = Q ? "dimmed" : void 0, de = Q ? "line-through" : void 0, je = ae((Ze) => {
744
+ D(P), B.onClick(Ze);
745
+ }, [P, B.onClick]);
746
746
  return /* @__PURE__ */ r(
747
747
  O,
748
748
  {
749
- ml: U ? 0 : 5,
749
+ ml: G ? 0 : 5,
750
750
  gap: 5,
751
751
  ...B,
752
- bg: j && k === 2 ? F : "",
752
+ bg: Z && E === 2 ? k : "",
753
753
  onClick: je,
754
754
  children: [
755
- U && /* @__PURE__ */ e(
756
- pa,
755
+ G && /* @__PURE__ */ e(
756
+ ma,
757
757
  {
758
758
  size: 18,
759
759
  style: { transform: q ? "rotate(0deg)" : "rotate(-90deg)" }
760
760
  }
761
761
  ),
762
- !U && /* @__PURE__ */ e(
763
- ma,
762
+ !G && /* @__PURE__ */ e(
763
+ ga,
764
764
  {
765
765
  size: 12,
766
766
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
767
767
  }
768
768
  ),
769
769
  /* @__PURE__ */ e(
770
- h,
770
+ c,
771
771
  {
772
- c: W,
773
- td: ce,
774
- children: fa(I.label)
772
+ c: H,
773
+ td: de,
774
+ children: ba(P.label)
775
775
  }
776
776
  )
777
777
  ]
@@ -781,61 +781,61 @@ function Xe({ dataSource: a, opened: t, close: n }) {
781
781
  }
782
782
  ) })
783
783
  ] }),
784
- /* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(V, { gap: 5, align: "center", children: [
785
- /* @__PURE__ */ e(ke, { label: g().t("archbase:Add"), children: /* @__PURE__ */ e(fe, { onClick: oe, disabled: !y || y?.nodeProps?.granted || !y.nodeProps, children: /* @__PURE__ */ e(Ia, {}) }) }),
786
- /* @__PURE__ */ e(ke, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(fe, { onClick: ue, disabled: !f || !f?.nodeProps?.permissionId || !f.nodeProps, children: /* @__PURE__ */ e(Ea, {}) }) })
784
+ /* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(U, { gap: 5, align: "center", children: [
785
+ /* @__PURE__ */ e(ke, { label: b().t("archbase:Add"), children: /* @__PURE__ */ e(ye, { onClick: oe, disabled: !S || S?.nodeProps?.granted || !S.nodeProps, children: /* @__PURE__ */ e(Pa, {}) }) }),
786
+ /* @__PURE__ */ e(ke, { label: b().t("archbase:Remove"), children: /* @__PURE__ */ e(ye, { onClick: me, disabled: !f || !f?.nodeProps?.permissionId || !f.nodeProps, children: /* @__PURE__ */ e(Da, {}) }) })
787
787
  ] }) }),
788
788
  /* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
789
789
  /* @__PURE__ */ r(O, { mb: 20, children: [
790
- /* @__PURE__ */ e(h, { children: g().t("archbase:Granted") }),
790
+ /* @__PURE__ */ e(c, { children: b().t("archbase:Granted") }),
791
791
  /* @__PURE__ */ e(
792
- ve,
792
+ he,
793
793
  {
794
794
  size: "xs",
795
- value: b,
796
- onChange: (k) => L(k.target.value),
797
- placeholder: g().t("archbase:Filter granted permissions")
795
+ value: v,
796
+ onChange: (E) => $(E.target.value),
797
+ placeholder: b().t("archbase:Filter granted permissions")
798
798
  }
799
799
  )
800
800
  ] }),
801
- /* @__PURE__ */ e(de, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
802
- da,
801
+ /* @__PURE__ */ e(ue, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
802
+ ua,
803
803
  {
804
- data: G,
804
+ data: M,
805
805
  selectOnClick: !0,
806
806
  allowRangeSelection: !1,
807
- tree: x,
808
- renderNode: ({ level: k, node: I, expanded: q, hasChildren: U, selected: j, elementProps: B }) => {
809
- const Z = ae((W) => {
810
- w(I), B.onClick(W);
811
- }, [I, B.onClick]);
807
+ tree: A,
808
+ renderNode: ({ level: E, node: P, expanded: q, hasChildren: G, selected: Z, elementProps: B }) => {
809
+ const Q = ae((H) => {
810
+ w(P), B.onClick(H);
811
+ }, [P, B.onClick]);
812
812
  return /* @__PURE__ */ r(
813
813
  O,
814
814
  {
815
- ml: U ? 0 : 5,
815
+ ml: G ? 0 : 5,
816
816
  gap: 5,
817
817
  ...B,
818
- bg: j && k === 2 ? F : "",
819
- onClick: Z,
818
+ bg: Z && E === 2 ? k : "",
819
+ onClick: Q,
820
820
  children: [
821
- U && /* @__PURE__ */ e(
822
- pa,
821
+ G && /* @__PURE__ */ e(
822
+ ma,
823
823
  {
824
824
  size: 18,
825
825
  style: { transform: q ? "rotate(0deg)" : "rotate(-90deg)" }
826
826
  }
827
827
  ),
828
- !U && /* @__PURE__ */ e(
829
- ma,
828
+ !G && /* @__PURE__ */ e(
829
+ ga,
830
830
  {
831
831
  size: 12,
832
832
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
833
833
  }
834
834
  ),
835
- /* @__PURE__ */ e(h, { children: fa(I.label) }),
836
- I?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(Q, { color: "blue", children: g().t("archbase:user") }),
837
- I?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(Q, { color: "orange", children: g().t("archbase:group") }),
838
- I?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(Q, { color: "pink", children: g().t("archbase:profile") })
835
+ /* @__PURE__ */ e(c, { children: ba(P.label) }),
836
+ P?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(j, { color: "blue", children: b().t("archbase:user") }),
837
+ P?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(j, { color: "orange", children: b().t("archbase:group") }),
838
+ P?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(j, { color: "pink", children: b().t("archbase:profile") })
839
839
  ]
840
840
  }
841
841
  );
@@ -844,12 +844,12 @@ function Xe({ dataSource: a, opened: t, close: n }) {
844
844
  ) })
845
845
  ] })
846
846
  ] }) }) }),
847
- /* @__PURE__ */ e(Sr, { size: "40px", children: /* @__PURE__ */ e(O, { justify: "flex-end", children: /* @__PURE__ */ e(X, { onClick: n, children: g().t("archbase:Close") }) }) })
847
+ /* @__PURE__ */ e(xr, { size: "40px", children: /* @__PURE__ */ e(O, { justify: "flex-end", children: /* @__PURE__ */ e(X, { onClick: s, children: b().t("archbase:Close") }) }) })
848
848
  ] }) }) : null;
849
849
  }
850
- const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", Pr = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, n) => (t.group?.name ?? "").localeCompare(n.group?.name ?? "")).map((t, n) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(Q, { color: "blue", children: t.group?.name }) }, n)) }) : null, Fr = (a) => a.profile ? /* @__PURE__ */ e(Q, { color: "green", children: a.profile?.name }) : null, Dr = (a) => /* @__PURE__ */ r(Ie, { children: [
850
+ const la = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAAABj1BMVEUAAADMzMzLy8vAwMDLy8vLy8vLy8vMzMzKysrR0dHPz8/MzMzNzc3KysrMzMzKysrLy8vLy8vLy8vJycnR0dHMzMzPz8/Ozs7MzMxPT0/Nzc1UVFTJyclTU1PMzMzKysrMzMzJycldXV1iYmLMzMzIyMhNTU1NTU3MzMzLy8vNzc3MzMxVVVXLy8vMzMzLy8vLy8tNTU3MzMzOzs5QUFDLy8vKyspRUVFRUVHMzMxZWVlycnLLy8tUVFTJycnKyspZWVlXV1dhYWHGxsZMTExQUFBPT0/Ozs7Ly8vPz89SUlJSUlLMzMxVVVVWVlZVVVXKysptbW1bW1t6enpmZmbLy8tKSkrQ0NDOzs5FRUXNzc1NTU3S0tLU1NRHR0dSUlKzs7ORkZF4eHhPT0/Jycm9vb26urp8fHxYWFisrKylpaWdnZ11dXVubm5fX1+8vLy3t7ehoaFkZGRVVVXBwcG/v7+vr6+ZmZmUlJSNjY2GhoZzc3NcXFzGxsbDw8Ofn5+WlpaBgYGwsLCpqalqampaWRCJAAAAVXRSTlMA+YUG1M7Df1AQ8urbdWdiXjo2HQkE+/vu4qqIcV1bRDEpIRwXFO/q2ZiObWJZSiv+9uTe3cq8s6qkgX55b1pWR0YVDfvJyLCcmZWTi2lZVz82LRcUQGGNCgAAA9pJREFUWMPll2db2zAQgJ0AgUIYDSl7tZRZ6N57793akizZCSSEEJKw9yi0/eHtEwgid5IxfOX9mnvenM93J8s4tZw5391Q3/Hu0mj3lTMnllys+hi6HqBCCCIEDVwPDVddPEEqXW9qiEOoeQAlDqlpGz1eYo2VYSFsE2ELcSPY6FvTV1njUFMDdVqCff48DWGgAdhOuMtPie8JrUaWq+3I5zs76Jg+cG50e3seVxPTF6S63svT0URNn1BSqffUEhvHE/ofgn8x9aZLKJpcja/sZnO57Pp0yqbIVKv2VDUBD93amedsn0QuA1U2eazynG8BceRPnrnWAczdmAERtLoHe6IhAaJWLWaVwNLLBPxXxQskCjogZse1ICz2G+TkDKNGbAb5THELwzaXQB2bzpZ6zt0GD5acZ5bKNA4LGSorET2BDz/NLDVT0FQywGW34GT81YhYForKo4dbCHjsVMLSEJuxgWnUkMAKkTmmE7E52ExhuX2vBGDzj+lFa7AKzRHUQ1K0qheNQZETPHj3FQSKfulF0zCYlpcVpyyAlseypcOdojC6uThxdQLt94mYTpRI2WjvduyL3kqRbGxXk1A+iYJFmywRhEyCIuEZwUXqq7Hxb+M60QYOtlsaZa3BT7PazuZxisP3VkA3/MX79a8QHH5574iWtfbZ2RDRUBDVA5HPzsbvvw6LaMZraLGodu9YdEzPhsRrBCIq985FLDKpto8mKY4WD+VWQymlXWVjpydshaiuILpcEKGxjSkfLE4VwaSqIOq5aioQ40w1IMRUEUEjgrctXkaqEZFDi1lccL1fGd5s94RKRLMMJZSTHrBGcEfiMxJ3Ne5HeYhg7CX03vgsVUZGiuesLBJqSrzUcNxgFBxHMGA2gVeRAjFkFOkJmCqSebekqzeTyrDmQ182IV8NEJtQNtytc+irBn5rwUHLqMJEvSGJlitCCCr2BsVRNFzyGdklcEQcHwAZop58SRmqEt2aZ3iJpChMuyJqlPC1CQRs51RDm08RdIAAhpzD6dCpvPpjNJ2hh5NyhvCFb5DIq0F83NKd/VY2LlWkXHFXjlTTfU1qlzNLC+OTs8Tev0JElHfZQkpkaT0GNEiVWJ8oqIjm8vdQ2GR7bAFrsGphbZHYQnthC5orm8y1fOCy9Fhy2NDyANVYr3IfGB6MXOM+Rdc+GZ48venLxG8+M46g9y734bl7wTiazlZ+hKZ1xPBFb/sA99D0t/cafrnQ3sq50sJb2+FTefOz804/50DC+++MPDeOTe+XD68GeJGXA6/ff4bJ+OfHt2edj+7ff9T59Ptz47TyD0dpv5fjoIC3AAAAAElFTkSuQmCC", Fr = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, s) => (t.group?.name ?? "").localeCompare(s.group?.name ?? "")).map((t, s) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(j, { color: "blue", children: t.group?.name }) }, s)) }) : null, Nr = (a) => a.profile ? /* @__PURE__ */ e(j, { color: "green", children: a.profile?.name }) : null, Or = (a) => /* @__PURE__ */ r(Ee, { children: [
851
851
  /* @__PURE__ */ e(
852
- $,
852
+ L,
853
853
  {
854
854
  dataField: "user.avatar",
855
855
  dataType: "image",
@@ -859,7 +859,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
859
859
  "img",
860
860
  {
861
861
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
862
- src: t.row.user && t.row.user.avatar ? atob(t.row.user.avatar) : sa
862
+ src: t.row.user && t.row.user.avatar ? atob(t.row.user.avatar) : la
863
863
  }
864
864
  ),
865
865
  inputFilterType: "text",
@@ -868,7 +868,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
868
868
  }
869
869
  ),
870
870
  /* @__PURE__ */ e(
871
- $,
871
+ L,
872
872
  {
873
873
  dataField: "user.userName",
874
874
  dataType: "text",
@@ -878,7 +878,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
878
878
  }
879
879
  ),
880
880
  /* @__PURE__ */ e(
881
- $,
881
+ L,
882
882
  {
883
883
  dataField: "user.email",
884
884
  dataType: "text",
@@ -888,18 +888,18 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
888
888
  }
889
889
  ),
890
890
  /* @__PURE__ */ e(
891
- $,
891
+ L,
892
892
  {
893
893
  dataField: "expirationDate",
894
894
  dataType: "text",
895
895
  size: 300,
896
896
  header: `${a("archbase:Expira em")}`,
897
- render: (t) => /* @__PURE__ */ e(h, { size: "sm", children: t.row.expirationDate }),
897
+ render: (t) => /* @__PURE__ */ e(c, { size: "sm", children: t.row.expirationDate }),
898
898
  inputFilterType: "text"
899
899
  }
900
900
  ),
901
901
  /* @__PURE__ */ e(
902
- $,
902
+ L,
903
903
  {
904
904
  dataField: "revoked",
905
905
  dataType: "boolean",
@@ -908,7 +908,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
908
908
  }
909
909
  ),
910
910
  /* @__PURE__ */ e(
911
- $,
911
+ L,
912
912
  {
913
913
  dataField: "expired",
914
914
  dataType: "boolean",
@@ -917,7 +917,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
917
917
  }
918
918
  ),
919
919
  /* @__PURE__ */ e(
920
- $,
920
+ L,
921
921
  {
922
922
  dataField: "token",
923
923
  dataType: "text",
@@ -926,9 +926,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
926
926
  inputFilterType: "text"
927
927
  }
928
928
  )
929
- ] }), Nr = (a) => /* @__PURE__ */ r(Ie, { children: [
929
+ ] }), $r = (a) => /* @__PURE__ */ r(Ee, { children: [
930
930
  /* @__PURE__ */ e(
931
- $,
931
+ L,
932
932
  {
933
933
  dataField: "avatar",
934
934
  dataType: "image",
@@ -938,7 +938,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
938
938
  "img",
939
939
  {
940
940
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
941
- src: t.row.avatar ? atob(t.row.avatar) : sa
941
+ src: t.row.avatar ? atob(t.row.avatar) : la
942
942
  }
943
943
  ),
944
944
  enableSorting: !1,
@@ -949,7 +949,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
949
949
  }
950
950
  ),
951
951
  /* @__PURE__ */ e(
952
- $,
952
+ L,
953
953
  {
954
954
  dataField: "name",
955
955
  dataType: "text",
@@ -960,7 +960,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
960
960
  }
961
961
  ),
962
962
  /* @__PURE__ */ e(
963
- $,
963
+ L,
964
964
  {
965
965
  dataField: "nickname",
966
966
  dataType: "text",
@@ -971,7 +971,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
971
971
  }
972
972
  ),
973
973
  /* @__PURE__ */ e(
974
- $,
974
+ L,
975
975
  {
976
976
  dataField: "email",
977
977
  dataType: "text",
@@ -982,7 +982,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
982
982
  }
983
983
  ),
984
984
  /* @__PURE__ */ e(
985
- $,
985
+ L,
986
986
  {
987
987
  dataField: "accountDeactivated",
988
988
  dataType: "boolean",
@@ -992,32 +992,32 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
992
992
  }
993
993
  ),
994
994
  /* @__PURE__ */ e(
995
- $,
995
+ L,
996
996
  {
997
997
  dataField: "profile.name",
998
998
  dataType: "text",
999
999
  header: `${a("archbase:Perfil")}`,
1000
1000
  size: 200,
1001
- render: (t) => Fr(t.row),
1001
+ render: (t) => Nr(t.row),
1002
1002
  inputFilterType: "text"
1003
1003
  }
1004
1004
  ),
1005
1005
  /* @__PURE__ */ e(
1006
- $,
1006
+ L,
1007
1007
  {
1008
1008
  dataField: "groups",
1009
1009
  dataType: "text",
1010
1010
  size: 300,
1011
1011
  header: `${a("archbase:Grupos")}`,
1012
- render: (t) => Pr(t.row),
1013
- exportValue: (t) => t.groups?.slice().sort((n, s) => (n.group?.name ?? "").localeCompare(s.group?.name ?? "")).map((n) => n.group?.name).filter(Boolean).join(", ") || "",
1012
+ render: (t) => Fr(t.row),
1013
+ exportValue: (t) => t.groups?.slice().sort((s, n) => (s.group?.name ?? "").localeCompare(n.group?.name ?? "")).map((s) => s.group?.name).filter(Boolean).join(", ") || "",
1014
1014
  enableSorting: !1,
1015
1015
  enableColumnFilter: !1,
1016
1016
  enableGlobalFilter: !1
1017
1017
  }
1018
1018
  ),
1019
1019
  /* @__PURE__ */ e(
1020
- $,
1020
+ L,
1021
1021
  {
1022
1022
  dataField: "isAdministrator",
1023
1023
  dataType: "boolean",
@@ -1026,7 +1026,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1026
1026
  }
1027
1027
  ),
1028
1028
  /* @__PURE__ */ e(
1029
- $,
1029
+ L,
1030
1030
  {
1031
1031
  dataField: "changePasswordOnNextLogin",
1032
1032
  dataType: "boolean",
@@ -1036,7 +1036,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1036
1036
  }
1037
1037
  ),
1038
1038
  /* @__PURE__ */ e(
1039
- $,
1039
+ L,
1040
1040
  {
1041
1041
  dataField: "allowPasswordChange",
1042
1042
  dataType: "boolean",
@@ -1046,7 +1046,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1046
1046
  }
1047
1047
  ),
1048
1048
  /* @__PURE__ */ e(
1049
- $,
1049
+ L,
1050
1050
  {
1051
1051
  dataField: "allowMultipleLogins",
1052
1052
  dataType: "boolean",
@@ -1056,7 +1056,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1056
1056
  }
1057
1057
  ),
1058
1058
  /* @__PURE__ */ e(
1059
- $,
1059
+ L,
1060
1060
  {
1061
1061
  dataField: "passwordNeverExpires",
1062
1062
  dataType: "boolean",
@@ -1066,7 +1066,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1066
1066
  }
1067
1067
  ),
1068
1068
  /* @__PURE__ */ e(
1069
- $,
1069
+ L,
1070
1070
  {
1071
1071
  dataField: "passwordChangedAt",
1072
1072
  dataType: "datetime",
@@ -1076,7 +1076,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1076
1076
  }
1077
1077
  ),
1078
1078
  /* @__PURE__ */ e(
1079
- $,
1079
+ L,
1080
1080
  {
1081
1081
  dataField: "accountLocked",
1082
1082
  dataType: "boolean",
@@ -1086,7 +1086,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1086
1086
  }
1087
1087
  ),
1088
1088
  /* @__PURE__ */ e(
1089
- $,
1089
+ L,
1090
1090
  {
1091
1091
  dataField: "unlimitedAccessHours",
1092
1092
  dataType: "boolean",
@@ -1095,9 +1095,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1095
1095
  size: 140
1096
1096
  }
1097
1097
  )
1098
- ] }), Or = (a) => /* @__PURE__ */ r(Ie, { children: [
1098
+ ] }), Lr = (a) => /* @__PURE__ */ r(Ee, { children: [
1099
1099
  /* @__PURE__ */ e(
1100
- $,
1100
+ L,
1101
1101
  {
1102
1102
  dataField: "name",
1103
1103
  dataType: "text",
@@ -1107,7 +1107,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1107
1107
  }
1108
1108
  ),
1109
1109
  /* @__PURE__ */ e(
1110
- $,
1110
+ L,
1111
1111
  {
1112
1112
  dataField: "description",
1113
1113
  dataType: "text",
@@ -1116,9 +1116,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1116
1116
  inputFilterType: "text"
1117
1117
  }
1118
1118
  )
1119
- ] }), $r = (a) => /* @__PURE__ */ r(Ie, { children: [
1119
+ ] }), Mr = (a) => /* @__PURE__ */ r(Ee, { children: [
1120
1120
  /* @__PURE__ */ e(
1121
- $,
1121
+ L,
1122
1122
  {
1123
1123
  dataField: "name",
1124
1124
  dataType: "text",
@@ -1128,7 +1128,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1128
1128
  }
1129
1129
  ),
1130
1130
  /* @__PURE__ */ e(
1131
- $,
1131
+ L,
1132
1132
  {
1133
1133
  dataField: "description",
1134
1134
  dataType: "text",
@@ -1137,9 +1137,9 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1137
1137
  inputFilterType: "text"
1138
1138
  }
1139
1139
  )
1140
- ] }), Lr = (a) => /* @__PURE__ */ r(Ie, { children: [
1140
+ ] }), Vr = (a) => /* @__PURE__ */ r(Ee, { children: [
1141
1141
  /* @__PURE__ */ e(
1142
- $,
1142
+ L,
1143
1143
  {
1144
1144
  dataField: "name",
1145
1145
  dataType: "text",
@@ -1149,7 +1149,7 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1149
1149
  }
1150
1150
  ),
1151
1151
  /* @__PURE__ */ e(
1152
- $,
1152
+ L,
1153
1153
  {
1154
1154
  dataField: "description",
1155
1155
  dataType: "text",
@@ -1159,20 +1159,20 @@ const sa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1159
1159
  }
1160
1160
  )
1161
1161
  ] });
1162
- function Pe({
1162
+ function De({
1163
1163
  active: a,
1164
1164
  printTitle: t,
1165
- gridRef: n,
1166
- dataSource: s,
1167
- isLoading: c,
1165
+ gridRef: s,
1166
+ dataSource: n,
1167
+ isLoading: u,
1168
1168
  error: d,
1169
- getRowId: u,
1170
- striped: x = !1,
1171
- enableRowActions: R = !0,
1172
- toolbarLeftContent: m,
1173
- renderRowActions: v,
1174
- actionsColumnWidth: A,
1175
- children: y
1169
+ getRowId: h,
1170
+ striped: A = !1,
1171
+ enableRowActions: z = !0,
1172
+ toolbarLeftContent: g,
1173
+ renderRowActions: T,
1174
+ actionsColumnWidth: R,
1175
+ children: S
1176
1176
  }) {
1177
1177
  return /* @__PURE__ */ e(
1178
1178
  re,
@@ -1187,62 +1187,62 @@ function Pe({
1187
1187
  overflow: "auto"
1188
1188
  },
1189
1189
  children: /* @__PURE__ */ e(
1190
- za,
1190
+ Ia,
1191
1191
  {
1192
- gridRef: n,
1192
+ gridRef: s,
1193
1193
  printTitle: t,
1194
1194
  width: "100%",
1195
1195
  height: "100%",
1196
1196
  withBorder: !1,
1197
- dataSource: s,
1197
+ dataSource: n,
1198
1198
  withColumnBorders: !0,
1199
- striped: x,
1199
+ striped: A,
1200
1200
  enableTopToolbar: !0,
1201
- enableRowActions: R,
1201
+ enableRowActions: z,
1202
1202
  pageSize: 50,
1203
- isLoading: c,
1203
+ isLoading: u,
1204
1204
  isError: !!d,
1205
1205
  error: d,
1206
1206
  enableGlobalFilter: !0,
1207
- getRowId: u,
1208
- toolbarLeftContent: m,
1209
- renderRowActions: v,
1210
- actionsColumnWidth: A,
1211
- children: y
1207
+ getRowId: h,
1208
+ toolbarLeftContent: g,
1209
+ renderRowActions: T,
1210
+ actionsColumnWidth: R,
1211
+ children: S
1212
1212
  }
1213
1213
  )
1214
1214
  }
1215
1215
  );
1216
1216
  }
1217
- function Ye({
1217
+ function _e({
1218
1218
  dataSource: a,
1219
1219
  securityType: t,
1220
- newInstance: n,
1221
- createEntitiesWithId: s,
1222
- removeMessageKey: c,
1220
+ newInstance: s,
1221
+ createEntitiesWithId: n,
1222
+ removeMessageKey: u,
1223
1223
  setOpenedModal: d,
1224
- setOpenedPermissionsModal: u,
1225
- validationContext: x,
1226
- t: R
1224
+ setOpenedPermissionsModal: h,
1225
+ validationContext: A,
1226
+ t: z
1227
1227
  }) {
1228
- const m = a, v = (p) => m.isEmpty() ? null : m.gotoRecordByData(p) ?? null;
1228
+ const g = a, T = (p) => g.isEmpty() ? null : g.gotoRecordByData(p) ?? null;
1229
1229
  return {
1230
1230
  handleAdd: () => {
1231
- const p = n();
1232
- s || (p.id = void 0), m.insert(p), d(t);
1231
+ const p = s();
1232
+ n || (p.id = void 0), g.insert(p), d(t);
1233
1233
  },
1234
1234
  handleViewRow: (p) => {
1235
- v(p) && d(t);
1235
+ T(p) && d(t);
1236
1236
  },
1237
1237
  handleEditRow: (p) => {
1238
- v(p) && (m.isEditing() || m.edit(), d(t));
1238
+ T(p) && (g.isEditing() || g.edit(), d(t));
1239
1239
  },
1240
1240
  handleRemoveRow: (p) => {
1241
- v(p) && ge.showConfirmDialogYesNo(
1242
- `${R("archbase:Confirme")}`,
1243
- `${R(c)}${p.name} ?`,
1241
+ T(p) && ve.showConfirmDialogYesNo(
1242
+ `${z("archbase:Confirme")}`,
1243
+ `${z(u)}${p.name} ?`,
1244
1244
  () => {
1245
- m.remove();
1245
+ g.remove();
1246
1246
  },
1247
1247
  () => {
1248
1248
  }
@@ -1250,203 +1250,203 @@ function Ye({
1250
1250
  },
1251
1251
  handleSaveModal: async () => {
1252
1252
  try {
1253
- await m.save();
1253
+ await g.save();
1254
1254
  } catch {
1255
1255
  return;
1256
1256
  }
1257
- d(""), x?.clearAll();
1257
+ d(""), A?.clearAll();
1258
1258
  },
1259
1259
  handleCancelModal: () => {
1260
- d(""), m.isBrowsing() || m.cancel(), x?.clearAll();
1260
+ d(""), g.isBrowsing() || g.cancel(), A?.clearAll();
1261
1261
  },
1262
1262
  handleOpenPermissionsModal: () => {
1263
- u(t);
1263
+ h(t);
1264
1264
  }
1265
1265
  };
1266
1266
  }
1267
- function _e({
1267
+ function Ye({
1268
1268
  row: a,
1269
1269
  onView: t,
1270
- onEdit: n,
1271
- onRemove: s,
1272
- onEditPermissions: c,
1270
+ onEdit: s,
1271
+ onRemove: n,
1272
+ onEditPermissions: u,
1273
1273
  before: d,
1274
- after: u,
1275
- t: x
1274
+ after: h,
1275
+ t: A
1276
1276
  }) {
1277
- const R = oa(), { colorScheme: m } = qe(), v = m === "dark", A = (y) => v ? R.colors[y][8] : R.colors[y][4];
1277
+ const z = na(), { colorScheme: g } = qe(), T = g === "dark", R = (S) => T ? z.colors[S][8] : z.colors[S][4];
1278
1278
  return /* @__PURE__ */ r(O, { gap: 1, wrap: "nowrap", children: [
1279
1279
  d?.(a),
1280
- /* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(hr, { size: 20, color: A("blue") }) }),
1281
- /* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(Pa, { size: 20, color: A("yellow") }) }),
1282
- /* @__PURE__ */ e(fe, { variant: "transparent", onClick: () => s(a), children: /* @__PURE__ */ e(na, { size: 20, color: A("red") }) }),
1283
- /* @__PURE__ */ e(ke, { withinPortal: !0, withArrow: !0, position: "left", label: `${x("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(fe, { variant: "transparent", onClick: c, children: /* @__PURE__ */ e(pr, { size: 20, color: A("green") }) }) }),
1284
- u?.(a)
1280
+ /* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(mr, { size: 20, color: R("blue") }) }),
1281
+ /* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => s(a), children: /* @__PURE__ */ e(Fa, { size: 20, color: R("yellow") }) }),
1282
+ /* @__PURE__ */ e(ye, { variant: "transparent", onClick: () => n(a), children: /* @__PURE__ */ e(sa, { size: 20, color: R("red") }) }),
1283
+ /* @__PURE__ */ e(ke, { withinPortal: !0, withArrow: !0, position: "left", label: `${A("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(ye, { variant: "transparent", onClick: u, children: /* @__PURE__ */ e(gr, { size: 20, color: R("green") }) }) }),
1284
+ h?.(a)
1285
1285
  ] });
1286
1286
  }
1287
- const ea = ({ onAdd: a, onEditPermissions: t, t: n }) => /* @__PURE__ */ r(Fe, { justify: "space-between", style: { width: "50%" }, children: [
1287
+ const ea = ({ onAdd: a, onEditPermissions: t, t: s }) => /* @__PURE__ */ r(Fe, { justify: "space-between", style: { width: "50%" }, children: [
1288
1288
  /* @__PURE__ */ r(O, { align: "end", gap: "4px", wrap: "nowrap", children: [
1289
- /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: a, children: `${n("archbase:New")}` }),
1290
- /* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(Pa, {}), onClick: t, children: `${n("archbase:Edit permissions")}` })
1289
+ /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: a, children: `${s("archbase:New")}` }),
1290
+ /* @__PURE__ */ e(X, { color: "blue", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: t, children: `${s("archbase:Edit permissions")}` })
1291
1291
  ] }),
1292
1292
  /* @__PURE__ */ e(Fe, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1293
1293
  ] });
1294
- function mt({
1294
+ function Tt({
1295
1295
  height: a = "400px",
1296
1296
  width: t = "100%",
1297
- createEntitiesWithId: n = !0,
1298
- userModalOptions: s,
1299
- profileModalOptions: c,
1297
+ createEntitiesWithId: s = !0,
1298
+ userModalOptions: n,
1299
+ profileModalOptions: u,
1300
1300
  groupModalOptions: d,
1301
- options: u
1301
+ options: h
1302
1302
  }) {
1303
- oa(), ka("securityStore");
1304
- const x = rr(), { colorScheme: R } = qe(), [m, v] = T(void 0), [A, y] = T("users"), P = J(K.User), f = J(K.Group), w = J(K.Resource), o = J(K.Profile), [l, p] = T(""), [b, L] = T(""), E = J(K.AccessToken), { t: i } = tr(), N = Re(null), F = Re(null), G = Re(null), D = Re(null), C = Re(null), z = (M) => M.id, oe = (M) => M.id, ue = (M) => M.id, k = (M) => M.id, I = (M) => M.id, {
1303
+ na(), Ea("securityStore");
1304
+ const A = ir(), { colorScheme: z } = qe(), [g, T] = C(void 0), [R, S] = C("users"), D = J(K.User), f = J(K.Group), w = J(K.Resource), o = J(K.Profile), [l, p] = C(""), [v, $] = C(""), y = J(K.AccessToken), { t: i } = or(), N = Re(null), k = Re(null), M = Re(null), F = Re(null), x = Re(null), I = (V) => V.id, oe = (V) => V.id, me = (V) => V.id, E = (V) => V.id, P = (V) => V.id, {
1305
1305
  dataSource: q,
1306
- isLoading: U,
1307
- refreshData: j
1308
- } = Ee({
1306
+ isLoading: G,
1307
+ refreshData: Z
1308
+ } = Pe({
1309
1309
  name: "accessTokenApi",
1310
- service: E,
1311
- validator: x,
1310
+ service: y,
1311
+ validator: A,
1312
1312
  pageSize: 25,
1313
1313
  defaultSortFields: ["user.email", "expirationTime:desc"],
1314
- onError: (M, te) => {
1315
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1314
+ onError: (V, te) => {
1315
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1316
1316
  }
1317
1317
  }), {
1318
1318
  dataSource: B,
1319
- isLoading: Z,
1320
- refreshData: W
1321
- } = Ee({
1319
+ isLoading: Q,
1320
+ refreshData: H
1321
+ } = Pe({
1322
1322
  name: "dsUsers",
1323
- service: P,
1324
- validator: x,
1323
+ service: D,
1324
+ validator: A,
1325
1325
  pageSize: 25,
1326
- onError: (M, te) => {
1327
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1326
+ onError: (V, te) => {
1327
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1328
1328
  }
1329
1329
  }), {
1330
- dataSource: ce,
1330
+ dataSource: de,
1331
1331
  isLoading: je,
1332
1332
  refreshData: Ze
1333
- } = Ee({
1333
+ } = Pe({
1334
1334
  name: "dsGroups",
1335
1335
  service: f,
1336
- validator: x,
1336
+ validator: A,
1337
1337
  pageSize: 25,
1338
- onError: (M, te) => {
1339
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1338
+ onError: (V, te) => {
1339
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1340
1340
  }
1341
1341
  }), {
1342
1342
  dataSource: Le,
1343
- isLoading: Na,
1344
- refreshData: Oa
1345
- } = Ee({
1343
+ isLoading: $a,
1344
+ refreshData: La
1345
+ } = Pe({
1346
1346
  name: "dsProfile",
1347
1347
  service: o,
1348
- validator: x,
1348
+ validator: A,
1349
1349
  pageSize: 25,
1350
- onError: (M, te) => {
1351
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1350
+ onError: (V, te) => {
1351
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1352
1352
  }
1353
1353
  }), {
1354
- dataSource: $a,
1355
- isLoading: La,
1356
- refreshData: Ma
1357
- } = Ee({
1354
+ dataSource: Ma,
1355
+ isLoading: Va,
1356
+ refreshData: Ua
1357
+ } = Pe({
1358
1358
  name: "dsResources",
1359
1359
  service: w,
1360
- validator: x,
1360
+ validator: A,
1361
1361
  pageSize: 25,
1362
- onError: (M, te) => {
1363
- v(M), ne.showError(`${i("archbase:WARNING")}`, M, te);
1362
+ onError: (V, te) => {
1363
+ T(V), ne.showError(`${i("archbase:WARNING")}`, V, te);
1364
1364
  }
1365
1365
  });
1366
1366
  ee(() => {
1367
- j({ filter: Ge(De.eq("revoked", "false")) }), W(), Ze(), Oa(), Ma();
1367
+ Z({ filter: Ue(Ne.eq("revoked", "false")) }), H(), Ze(), La(), Ua();
1368
1368
  }, []);
1369
- const Va = Dr(i), Ga = Nr(i), Ua = Or(i), Ba = $r(i), Wa = Lr(i), Qe = ir(), he = Ye({
1369
+ const Ga = Or(i), Ba = $r(i), Ha = Lr(i), qa = Mr(i), Wa = Vr(i), Qe = nr(), ge = _e({
1370
1370
  dataSource: B,
1371
- securityType: Y.USER,
1372
- newInstance: () => mr.newInstance(),
1373
- createEntitiesWithId: n,
1371
+ securityType: _.USER,
1372
+ newInstance: () => fr.newInstance(),
1373
+ createEntitiesWithId: s,
1374
1374
  removeMessageKey: "archbase:Deseja remover o usuário ",
1375
1375
  setOpenedModal: p,
1376
- setOpenedPermissionsModal: L,
1376
+ setOpenedPermissionsModal: $,
1377
1377
  validationContext: Qe,
1378
1378
  t: i
1379
- }), pe = Ye({
1380
- dataSource: ce,
1381
- securityType: Y.GROUP,
1382
- newInstance: () => gr.newInstance(),
1383
- createEntitiesWithId: n,
1379
+ }), fe = _e({
1380
+ dataSource: de,
1381
+ securityType: _.GROUP,
1382
+ newInstance: () => br.newInstance(),
1383
+ createEntitiesWithId: s,
1384
1384
  removeMessageKey: "archbase:Deseja remover o grupo ",
1385
1385
  setOpenedModal: p,
1386
- setOpenedPermissionsModal: L,
1386
+ setOpenedPermissionsModal: $,
1387
1387
  validationContext: Qe,
1388
1388
  t: i
1389
- }), me = Ye({
1389
+ }), be = _e({
1390
1390
  dataSource: Le,
1391
- securityType: Y.PROFILE,
1392
- newInstance: () => fr.newInstance(),
1393
- createEntitiesWithId: n,
1391
+ securityType: _.PROFILE,
1392
+ newInstance: () => vr.newInstance(),
1393
+ createEntitiesWithId: s,
1394
1394
  removeMessageKey: "archbase:Deseja remover o perfil ",
1395
1395
  setOpenedModal: p,
1396
- setOpenedPermissionsModal: L,
1396
+ setOpenedPermissionsModal: $,
1397
1397
  validationContext: Qe,
1398
1398
  t: i
1399
- }), qa = (M) => /* @__PURE__ */ e(
1400
- _e,
1399
+ }), ja = (V) => /* @__PURE__ */ e(
1400
+ Ye,
1401
1401
  {
1402
- row: M,
1403
- onView: he.handleViewRow,
1404
- onEdit: he.handleEditRow,
1405
- onRemove: he.handleRemoveRow,
1406
- onEditPermissions: he.handleOpenPermissionsModal,
1407
- before: u?.beforeDefaultUserActions,
1408
- after: u?.afterDefaultUserActions,
1402
+ row: V,
1403
+ onView: ge.handleViewRow,
1404
+ onEdit: ge.handleEditRow,
1405
+ onRemove: ge.handleRemoveRow,
1406
+ onEditPermissions: ge.handleOpenPermissionsModal,
1407
+ before: h?.beforeDefaultUserActions,
1408
+ after: h?.afterDefaultUserActions,
1409
1409
  t: i
1410
1410
  }
1411
- ), Ha = (M) => /* @__PURE__ */ e(
1412
- _e,
1411
+ ), Za = (V) => /* @__PURE__ */ e(
1412
+ Ye,
1413
1413
  {
1414
- row: M,
1415
- onView: pe.handleViewRow,
1416
- onEdit: pe.handleEditRow,
1417
- onRemove: pe.handleRemoveRow,
1418
- onEditPermissions: pe.handleOpenPermissionsModal,
1419
- before: u?.beforeDefaultGroupActions,
1420
- after: u?.afterDefaultGroupActions,
1414
+ row: V,
1415
+ onView: fe.handleViewRow,
1416
+ onEdit: fe.handleEditRow,
1417
+ onRemove: fe.handleRemoveRow,
1418
+ onEditPermissions: fe.handleOpenPermissionsModal,
1419
+ before: h?.beforeDefaultGroupActions,
1420
+ after: h?.afterDefaultGroupActions,
1421
1421
  t: i
1422
1422
  }
1423
- ), ja = (M) => /* @__PURE__ */ e(
1424
- _e,
1423
+ ), Qa = (V) => /* @__PURE__ */ e(
1424
+ Ye,
1425
1425
  {
1426
- row: M,
1427
- onView: me.handleViewRow,
1428
- onEdit: me.handleEditRow,
1429
- onRemove: me.handleRemoveRow,
1430
- onEditPermissions: me.handleOpenPermissionsModal,
1431
- before: u?.beforeDefaultProfileActions,
1432
- after: u?.afterDefaultProfileActions,
1426
+ row: V,
1427
+ onView: be.handleViewRow,
1428
+ onEdit: be.handleEditRow,
1429
+ onRemove: be.handleRemoveRow,
1430
+ onEditPermissions: be.handleOpenPermissionsModal,
1431
+ before: h?.beforeDefaultProfileActions,
1432
+ after: h?.afterDefaultProfileActions,
1433
1433
  t: i
1434
1434
  }
1435
- ), Za = () => {
1436
- const M = q.getCurrentRecord();
1437
- M && ge.showConfirmDialogYesNo(
1435
+ ), Ka = () => {
1436
+ const V = q.getCurrentRecord();
1437
+ V && ve.showConfirmDialogYesNo(
1438
1438
  `${i("archbase:Confirme")}`,
1439
- `${i("archbase:Deseja revogar o token de Acesso do usuário ")}${M.user.name} ?`,
1439
+ `${i("archbase:Deseja revogar o token de Acesso do usuário ")}${V.user.name} ?`,
1440
1440
  async () => {
1441
- await E.revoke(M.token).then(async () => {
1441
+ await y.revoke(V.token).then(async () => {
1442
1442
  ne.showSuccess(
1443
1443
  `${i("mentors:Informação")}`,
1444
1444
  `${i("mentors:Token de Acesso revogado com sucesso!")}`
1445
1445
  ), q.refreshData();
1446
1446
  }).catch((te) => {
1447
- ge.showErrorWithDetails(
1447
+ ve.showErrorWithDetails(
1448
1448
  `${i("mentors:Atenção")}`,
1449
- be(te),
1449
+ Te(te),
1450
1450
  Ve(te)
1451
1451
  );
1452
1452
  });
@@ -1455,223 +1455,223 @@ function mt({
1455
1455
  }
1456
1456
  );
1457
1457
  }, Ke = () => {
1458
- L("");
1459
- }, Qa = () => /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(O, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
1458
+ $("");
1459
+ }, Ja = () => /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(O, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
1460
1460
  X,
1461
1461
  {
1462
1462
  disabled: !q.getCurrentRecord(),
1463
1463
  color: "red",
1464
- leftSection: /* @__PURE__ */ e(na, {}),
1465
- onClick: Za,
1464
+ leftSection: /* @__PURE__ */ e(sa, {}),
1465
+ onClick: Ka,
1466
1466
  children: `${i("archbase:Revoke")}`
1467
1467
  }
1468
1468
  ) }) });
1469
1469
  return /* @__PURE__ */ r(re, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
1470
- /* @__PURE__ */ e(Ce, { variant: "pills", value: A, onChange: y, children: /* @__PURE__ */ r(Ce.List, { children: [
1471
- /* @__PURE__ */ e(Ce.Tab, { value: "users", children: `${i("Usuários")}` }),
1472
- /* @__PURE__ */ e(Ce.Tab, { value: "groups", children: `${i("Grupos")}` }),
1473
- /* @__PURE__ */ e(Ce.Tab, { value: "profiles", children: `${i("Perfis")}` }),
1474
- /* @__PURE__ */ e(Ce.Tab, { value: "resources", children: `${i("Recursos")}` }),
1475
- /* @__PURE__ */ e(Ce.Tab, { value: "accessTokens", children: `${i("Tokens Acesso")}` })
1470
+ /* @__PURE__ */ e(we, { variant: "pills", value: R, onChange: S, children: /* @__PURE__ */ r(we.List, { children: [
1471
+ /* @__PURE__ */ e(we.Tab, { value: "users", children: `${i("Usuários")}` }),
1472
+ /* @__PURE__ */ e(we.Tab, { value: "groups", children: `${i("Grupos")}` }),
1473
+ /* @__PURE__ */ e(we.Tab, { value: "profiles", children: `${i("Perfis")}` }),
1474
+ /* @__PURE__ */ e(we.Tab, { value: "resources", children: `${i("Recursos")}` }),
1475
+ /* @__PURE__ */ e(we.Tab, { value: "accessTokens", children: `${i("Tokens Acesso")}` })
1476
1476
  ] }) }),
1477
1477
  /* @__PURE__ */ e(
1478
- Pe,
1478
+ De,
1479
1479
  {
1480
- active: A === "users",
1480
+ active: R === "users",
1481
1481
  printTitle: "Usuários",
1482
1482
  gridRef: N,
1483
1483
  dataSource: B,
1484
- isLoading: Z,
1485
- error: m,
1486
- getRowId: z,
1484
+ isLoading: Q,
1485
+ error: g,
1486
+ getRowId: I,
1487
1487
  striped: !0,
1488
1488
  toolbarLeftContent: /* @__PURE__ */ e(
1489
1489
  ea,
1490
1490
  {
1491
- onAdd: he.handleAdd,
1492
- onEditPermissions: he.handleOpenPermissionsModal,
1491
+ onAdd: ge.handleAdd,
1492
+ onEditPermissions: ge.handleOpenPermissionsModal,
1493
1493
  t: i
1494
1494
  }
1495
1495
  ),
1496
- renderRowActions: qa,
1497
- actionsColumnWidth: u?.userActionsColumnWidth,
1498
- children: Ga
1496
+ renderRowActions: ja,
1497
+ actionsColumnWidth: h?.userActionsColumnWidth,
1498
+ children: Ba
1499
1499
  }
1500
1500
  ),
1501
1501
  /* @__PURE__ */ e(
1502
- Pe,
1502
+ De,
1503
1503
  {
1504
- active: A === "groups",
1504
+ active: R === "groups",
1505
1505
  printTitle: "Grupos",
1506
- gridRef: F,
1507
- dataSource: ce,
1506
+ gridRef: k,
1507
+ dataSource: de,
1508
1508
  isLoading: je,
1509
- error: m,
1509
+ error: g,
1510
1510
  getRowId: oe,
1511
1511
  toolbarLeftContent: /* @__PURE__ */ e(
1512
1512
  ea,
1513
1513
  {
1514
- onAdd: pe.handleAdd,
1515
- onEditPermissions: pe.handleOpenPermissionsModal,
1514
+ onAdd: fe.handleAdd,
1515
+ onEditPermissions: fe.handleOpenPermissionsModal,
1516
1516
  t: i
1517
1517
  }
1518
1518
  ),
1519
- renderRowActions: Ha,
1520
- actionsColumnWidth: u?.groupActionsColumnWidth,
1521
- children: Ua
1519
+ renderRowActions: Za,
1520
+ actionsColumnWidth: h?.groupActionsColumnWidth,
1521
+ children: Ha
1522
1522
  }
1523
1523
  ),
1524
1524
  /* @__PURE__ */ e(
1525
- Pe,
1525
+ De,
1526
1526
  {
1527
- active: A === "profiles",
1527
+ active: R === "profiles",
1528
1528
  printTitle: "Perfis",
1529
- gridRef: G,
1529
+ gridRef: M,
1530
1530
  dataSource: Le,
1531
- isLoading: Na,
1532
- error: m,
1533
- getRowId: ue,
1531
+ isLoading: $a,
1532
+ error: g,
1533
+ getRowId: me,
1534
1534
  toolbarLeftContent: /* @__PURE__ */ e(
1535
1535
  ea,
1536
1536
  {
1537
- onAdd: me.handleAdd,
1538
- onEditPermissions: me.handleOpenPermissionsModal,
1537
+ onAdd: be.handleAdd,
1538
+ onEditPermissions: be.handleOpenPermissionsModal,
1539
1539
  t: i
1540
1540
  }
1541
1541
  ),
1542
- renderRowActions: ja,
1543
- actionsColumnWidth: u?.profileActionsColumnWidth,
1544
- children: Ba
1542
+ renderRowActions: Qa,
1543
+ actionsColumnWidth: h?.profileActionsColumnWidth,
1544
+ children: qa
1545
1545
  }
1546
1546
  ),
1547
1547
  /* @__PURE__ */ e(
1548
- Pe,
1548
+ De,
1549
1549
  {
1550
- active: A === "resources",
1550
+ active: R === "resources",
1551
1551
  printTitle: "Recursos",
1552
- gridRef: D,
1553
- dataSource: $a,
1554
- isLoading: La,
1555
- error: m,
1556
- getRowId: k,
1552
+ gridRef: F,
1553
+ dataSource: Ma,
1554
+ isLoading: Va,
1555
+ error: g,
1556
+ getRowId: E,
1557
1557
  enableRowActions: !1,
1558
1558
  children: Wa
1559
1559
  }
1560
1560
  ),
1561
1561
  /* @__PURE__ */ e(
1562
- Pe,
1562
+ De,
1563
1563
  {
1564
- active: A === "accessTokens",
1564
+ active: R === "accessTokens",
1565
1565
  printTitle: "Tokens de API",
1566
- gridRef: C,
1566
+ gridRef: x,
1567
1567
  dataSource: q,
1568
- isLoading: U,
1569
- error: m,
1570
- getRowId: I,
1568
+ isLoading: G,
1569
+ error: g,
1570
+ getRowId: P,
1571
1571
  striped: !0,
1572
1572
  enableRowActions: !1,
1573
- toolbarLeftContent: Qa(),
1574
- children: Va
1573
+ toolbarLeftContent: Ja(),
1574
+ children: Ga
1575
1575
  }
1576
1576
  ),
1577
- l === Y.USER ? /* @__PURE__ */ e(
1578
- zr,
1577
+ l === _.USER ? /* @__PURE__ */ e(
1578
+ Ir,
1579
1579
  {
1580
- onClickOk: he.handleSaveModal,
1580
+ onClickOk: ge.handleSaveModal,
1581
1581
  opened: !0,
1582
1582
  dataSource: B,
1583
- onClickCancel: he.handleCancelModal,
1584
- options: s
1583
+ onClickCancel: ge.handleCancelModal,
1584
+ options: n
1585
1585
  }
1586
1586
  ) : null,
1587
- l === Y.GROUP ? /* @__PURE__ */ e(
1588
- kr,
1587
+ l === _.GROUP ? /* @__PURE__ */ e(
1588
+ Er,
1589
1589
  {
1590
- onClickOk: pe.handleSaveModal,
1590
+ onClickOk: fe.handleSaveModal,
1591
1591
  opened: !0,
1592
- dataSource: ce,
1593
- onClickCancel: pe.handleCancelModal,
1592
+ dataSource: de,
1593
+ onClickCancel: fe.handleCancelModal,
1594
1594
  options: d
1595
1595
  }
1596
1596
  ) : null,
1597
- l === Y.PROFILE ? /* @__PURE__ */ e(
1598
- xr,
1597
+ l === _.PROFILE ? /* @__PURE__ */ e(
1598
+ Ar,
1599
1599
  {
1600
- onClickOk: me.handleSaveModal,
1600
+ onClickOk: be.handleSaveModal,
1601
1601
  opened: !0,
1602
1602
  dataSource: Le,
1603
- onClickCancel: me.handleCancelModal,
1604
- options: c
1603
+ onClickCancel: be.handleCancelModal,
1604
+ options: u
1605
1605
  }
1606
1606
  ) : null,
1607
- b === Y.USER ? /* @__PURE__ */ e(
1607
+ v === _.USER ? /* @__PURE__ */ e(
1608
1608
  Xe,
1609
1609
  {
1610
1610
  dataSource: B,
1611
- opened: !!b,
1611
+ opened: !!v,
1612
1612
  close: Ke
1613
1613
  }
1614
1614
  ) : null,
1615
- b === Y.GROUP ? /* @__PURE__ */ e(
1615
+ v === _.GROUP ? /* @__PURE__ */ e(
1616
1616
  Xe,
1617
1617
  {
1618
- dataSource: ce,
1619
- opened: !!b,
1618
+ dataSource: de,
1619
+ opened: !!v,
1620
1620
  close: Ke
1621
1621
  }
1622
1622
  ) : null,
1623
- b === Y.PROFILE ? /* @__PURE__ */ e(
1623
+ v === _.PROFILE ? /* @__PURE__ */ e(
1624
1624
  Xe,
1625
1625
  {
1626
1626
  dataSource: Le,
1627
- opened: !!b,
1627
+ opened: !!v,
1628
1628
  close: Ke
1629
1629
  }
1630
1630
  ) : null
1631
1631
  ] });
1632
1632
  }
1633
- function gt({ height: a = "400px", width: t = "100%" }) {
1634
- oa();
1635
- const n = ka("apiTokenStore"), s = { validateEntity: () => [] }, { colorScheme: c } = qe(), [d, u] = T(void 0), x = J(K.ApiToken), [R, m] = T(""), v = Re(null), A = (F) => F.id, { dataSource: y } = dr({
1633
+ function wt({ height: a = "400px", width: t = "100%" }) {
1634
+ na();
1635
+ const s = Ea("apiTokenStore"), n = { validateEntity: () => [] }, { colorScheme: u } = qe(), [d, h] = C(void 0), A = J(K.ApiToken), [z, g] = C(""), T = Re(null), R = (k) => k.id, { dataSource: S } = hr({
1636
1636
  initialData: [],
1637
1637
  name: "dataSource"
1638
- }), P = Ne(
1638
+ }), D = Oe(
1639
1639
  "ArchbaseApiTokenView-LocalDataSource",
1640
- y,
1640
+ S,
1641
1641
  void 0,
1642
1642
  void 0
1643
- ), { dataSource: f, isLoading: w } = ta({
1643
+ ), { dataSource: f, isLoading: w } = ia({
1644
1644
  name: "dsApiToken",
1645
- service: x,
1646
- store: n,
1647
- validator: s,
1645
+ service: A,
1646
+ store: s,
1647
+ validator: n,
1648
1648
  pageSize: 25,
1649
1649
  loadOnStart: !0,
1650
- onLoadComplete: (F) => {
1650
+ onLoadComplete: (k) => {
1651
1651
  },
1652
- onDestroy: (F) => {
1652
+ onDestroy: (k) => {
1653
1653
  },
1654
- onError: (F, G) => {
1655
- u(F), ne.showError(g().t("archbase:WARNING"), F, G);
1654
+ onError: (k, M) => {
1655
+ h(k), ne.showError(b().t("archbase:WARNING"), k, M);
1656
1656
  }
1657
- }), o = Ne(
1657
+ }), o = Oe(
1658
1658
  "ArchbaseApiTokenView-RemoteDataSource",
1659
1659
  f,
1660
1660
  void 0,
1661
1661
  void 0
1662
- ), l = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ie, { children: [
1662
+ ), l = `calc(${a} - 40px)`, p = /* @__PURE__ */ r(Ee, { children: [
1663
1663
  /* @__PURE__ */ e(
1664
- $,
1664
+ L,
1665
1665
  {
1666
1666
  dataField: "user.avatar",
1667
1667
  dataType: "image",
1668
1668
  size: 80,
1669
1669
  header: "Foto",
1670
- render: (F) => /* @__PURE__ */ e(
1670
+ render: (k) => /* @__PURE__ */ e(
1671
1671
  "img",
1672
1672
  {
1673
1673
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
1674
- src: F.row.user && F.row.user.avatar ? atob(F.row.user.avatar) : sa
1674
+ src: k.row.user && k.row.user.avatar ? atob(k.row.user.avatar) : la
1675
1675
  }
1676
1676
  ),
1677
1677
  inputFilterType: "text",
@@ -1679,7 +1679,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1679
1679
  }
1680
1680
  ),
1681
1681
  /* @__PURE__ */ e(
1682
- $,
1682
+ L,
1683
1683
  {
1684
1684
  dataField: "user.userName",
1685
1685
  dataType: "text",
@@ -1689,7 +1689,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1689
1689
  }
1690
1690
  ),
1691
1691
  /* @__PURE__ */ e(
1692
- $,
1692
+ L,
1693
1693
  {
1694
1694
  dataField: "user.email",
1695
1695
  dataType: "text",
@@ -1699,7 +1699,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1699
1699
  }
1700
1700
  ),
1701
1701
  /* @__PURE__ */ e(
1702
- $,
1702
+ L,
1703
1703
  {
1704
1704
  dataField: "name",
1705
1705
  dataType: "text",
@@ -1709,7 +1709,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1709
1709
  }
1710
1710
  ),
1711
1711
  /* @__PURE__ */ e(
1712
- $,
1712
+ L,
1713
1713
  {
1714
1714
  dataField: "description",
1715
1715
  dataType: "text",
@@ -1719,7 +1719,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1719
1719
  }
1720
1720
  ),
1721
1721
  /* @__PURE__ */ e(
1722
- $,
1722
+ L,
1723
1723
  {
1724
1724
  dataField: "token",
1725
1725
  dataType: "text",
@@ -1730,7 +1730,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1730
1730
  }
1731
1731
  ),
1732
1732
  /* @__PURE__ */ e(
1733
- $,
1733
+ L,
1734
1734
  {
1735
1735
  dataField: "tenantId",
1736
1736
  dataType: "text",
@@ -1741,41 +1741,41 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1741
1741
  }
1742
1742
  ),
1743
1743
  /* @__PURE__ */ e(
1744
- $,
1744
+ L,
1745
1745
  {
1746
1746
  dataField: "expirationDate",
1747
1747
  dataType: "text",
1748
1748
  size: 240,
1749
1749
  header: "Validade",
1750
- render: (F) => {
1751
- if (!F.row.expirationDate)
1752
- return /* @__PURE__ */ e(h, { c: "dimmed", children: "Sem expiração" });
1753
- const G = /* @__PURE__ */ new Date();
1754
- G.setHours(0, 0, 0, 0);
1755
- const D = new Date(F.row.expirationDate);
1756
- D.setHours(0, 0, 0, 0);
1757
- const C = D.getTime() - G.getTime(), z = Math.ceil(C / (1e3 * 60 * 60 * 24));
1758
- let ue = Math.max(0, Math.min(100, z / 365 * 100)), k = "green", I = "";
1759
- z < 0 ? (k = "red", ue = 100, I = `Vencido há ${Math.abs(z)} dia${Math.abs(z) !== 1 ? "s" : ""}`) : z === 0 ? (k = "red", ue = 5, I = "Vence hoje") : z <= 7 ? (k = "red", I = `${z} dia${z !== 1 ? "s" : ""}`) : z <= 30 ? (k = "orange", I = `${z} dias`) : z <= 90 ? (k = "yellow", I = `${z} dias`) : (k = "green", I = `${z} dias`);
1760
- const q = z < 0 ? `Vencido em ${D.toLocaleDateString()}` : `Expira em ${D.toLocaleDateString()}`;
1750
+ render: (k) => {
1751
+ if (!k.row.expirationDate)
1752
+ return /* @__PURE__ */ e(c, { c: "dimmed", children: "Sem expiração" });
1753
+ const M = /* @__PURE__ */ new Date();
1754
+ M.setHours(0, 0, 0, 0);
1755
+ const F = new Date(k.row.expirationDate);
1756
+ F.setHours(0, 0, 0, 0);
1757
+ const x = F.getTime() - M.getTime(), I = Math.ceil(x / (1e3 * 60 * 60 * 24));
1758
+ let me = Math.max(0, Math.min(100, I / 365 * 100)), E = "green", P = "";
1759
+ I < 0 ? (E = "red", me = 100, P = `Vencido há ${Math.abs(I)} dia${Math.abs(I) !== 1 ? "s" : ""}`) : I === 0 ? (E = "red", me = 5, P = "Vence hoje") : I <= 7 ? (E = "red", P = `${I} dia${I !== 1 ? "s" : ""}`) : I <= 30 ? (E = "orange", P = `${I} dias`) : I <= 90 ? (E = "yellow", P = `${I} dias`) : (E = "green", P = `${I} dias`);
1760
+ const q = I < 0 ? `Vencido em ${F.toLocaleDateString()}` : `Expira em ${F.toLocaleDateString()}`;
1761
1761
  return /* @__PURE__ */ e(ke, { label: q, withArrow: !0, children: /* @__PURE__ */ r(O, { gap: "xs", wrap: "nowrap", children: [
1762
1762
  /* @__PURE__ */ e(
1763
- Ka,
1763
+ Xa,
1764
1764
  {
1765
1765
  size: 36,
1766
1766
  thickness: 4,
1767
1767
  roundCaps: !0,
1768
- sections: [{ value: z < 0 ? 100 : ue, color: k }]
1768
+ sections: [{ value: I < 0 ? 100 : me, color: E }]
1769
1769
  }
1770
1770
  ),
1771
- /* @__PURE__ */ e(h, { size: "sm", c: z < 0 ? "red" : void 0, fw: z <= 7 ? 600 : void 0, children: I })
1771
+ /* @__PURE__ */ e(c, { size: "sm", c: I < 0 ? "red" : void 0, fw: I <= 7 ? 600 : void 0, children: P })
1772
1772
  ] }) });
1773
1773
  },
1774
1774
  inputFilterType: "text"
1775
1775
  }
1776
1776
  ),
1777
1777
  /* @__PURE__ */ e(
1778
- $,
1778
+ L,
1779
1779
  {
1780
1780
  dataField: "activated",
1781
1781
  dataType: "boolean",
@@ -1784,7 +1784,7 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1784
1784
  }
1785
1785
  ),
1786
1786
  /* @__PURE__ */ e(
1787
- $,
1787
+ L,
1788
1788
  {
1789
1789
  dataField: "revoked",
1790
1790
  dataType: "boolean",
@@ -1792,60 +1792,60 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1792
1792
  inputFilterType: "checkbox"
1793
1793
  }
1794
1794
  )
1795
- ] }), b = () => {
1796
- y.insert(br.newInstance()), y && !P.isDataSourceV2 && P.v1State.forceUpdate(), m("apiToken");
1797
- }, L = () => {
1798
- f.getCurrentRecord() && ge.showConfirmDialogYesNo(
1799
- `${g().t("archbase:Confirme")}`,
1800
- `${g().t("archbase:Deseja revogar o token de API do usuário ")}${f.getCurrentRecord().user.name} ?`,
1795
+ ] }), v = () => {
1796
+ S.insert(yr.newInstance()), S && !D.isDataSourceV2 && D.v1State.forceUpdate(), g("apiToken");
1797
+ }, $ = () => {
1798
+ f.getCurrentRecord() && ve.showConfirmDialogYesNo(
1799
+ `${b().t("archbase:Confirme")}`,
1800
+ `${b().t("archbase:Deseja revogar o token de API do usuário ")}${f.getCurrentRecord().user.name} ?`,
1801
1801
  async () => {
1802
- await x.revoke(f.getCurrentRecord().token).then(async () => {
1802
+ await A.revoke(f.getCurrentRecord().token).then(async () => {
1803
1803
  ne.showSuccess(
1804
- `${g().t("mentors:Informação")}`,
1805
- `${g().t("mentors:Token de API revogado com sucesso!")}`
1804
+ `${b().t("mentors:Informação")}`,
1805
+ `${b().t("mentors:Token de API revogado com sucesso!")}`
1806
1806
  ), f.refreshData(), f && !o.isDataSourceV2 && o.v1State.forceUpdate();
1807
- }).catch((F) => {
1808
- ge.showErrorWithDetails(
1809
- `${g().t("mentors:Atenção")}`,
1810
- be(F),
1811
- Ve(F)
1807
+ }).catch((k) => {
1808
+ ve.showErrorWithDetails(
1809
+ `${b().t("mentors:Atenção")}`,
1810
+ Te(k),
1811
+ Ve(k)
1812
1812
  );
1813
1813
  });
1814
1814
  },
1815
1815
  () => {
1816
1816
  }
1817
1817
  );
1818
- }, E = () => {
1819
- m("");
1820
- }, i = async (F, G) => {
1821
- const D = y.getCurrentRecord();
1822
- if (D)
1818
+ }, y = () => {
1819
+ g("");
1820
+ }, i = async (k, M) => {
1821
+ const F = S.getCurrentRecord();
1822
+ if (F)
1823
1823
  try {
1824
- if (y.validate(), !D.user || !D.user.email) {
1825
- ge.showErrorWithDetails(
1826
- `${g().t("archbase:WARNING")}`,
1827
- `${g().t("archbase:Selecione um usuário para o token de API")}`,
1824
+ if (S.validate(), !F.user || !F.user.email) {
1825
+ ve.showErrorWithDetails(
1826
+ `${b().t("archbase:WARNING")}`,
1827
+ `${b().t("archbase:Selecione um usuário para o token de API")}`,
1828
1828
  ""
1829
1829
  );
1830
1830
  return;
1831
1831
  }
1832
- await x.create(D.user.email, D.expirationDate, D.name, D.description).then(async (C) => {
1833
- y.cancel(), y && !P.isDataSourceV2 && P.v1State.forceUpdate(), f.append(C), f && !o.isDataSourceV2 && o.v1State.forceUpdate(), ne.showSuccess(
1834
- `${g().t("mentors:Informação")}`,
1835
- `${g().t("mentors:Token de API gerado com sucesso!")}`
1836
- ), G && G(!0);
1837
- }).catch((C) => {
1838
- ge.showErrorWithDetails(
1839
- `${g().t("mentors:Atenção")}`,
1840
- be(C),
1841
- Ve(C)
1832
+ await A.create(F.user.email, F.expirationDate, F.name, F.description).then(async (x) => {
1833
+ S.cancel(), S && !D.isDataSourceV2 && D.v1State.forceUpdate(), f.append(x), f && !o.isDataSourceV2 && o.v1State.forceUpdate(), ne.showSuccess(
1834
+ `${b().t("mentors:Informação")}`,
1835
+ `${b().t("mentors:Token de API gerado com sucesso!")}`
1836
+ ), M && M(!0);
1837
+ }).catch((x) => {
1838
+ ve.showErrorWithDetails(
1839
+ `${b().t("mentors:Atenção")}`,
1840
+ Te(x),
1841
+ Ve(x)
1842
1842
  );
1843
1843
  });
1844
- } catch (C) {
1845
- ge.showErrorWithDetails(
1846
- `${g().t("mentors:Atenção")}`,
1847
- be(C),
1848
- Ve(C)
1844
+ } catch (x) {
1845
+ ve.showErrorWithDetails(
1846
+ `${b().t("mentors:Atenção")}`,
1847
+ Te(x),
1848
+ Ve(x)
1849
1849
  );
1850
1850
  }
1851
1851
  };
@@ -1863,9 +1863,9 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1863
1863
  overflow: "auto"
1864
1864
  },
1865
1865
  children: /* @__PURE__ */ e(
1866
- za,
1866
+ Ia,
1867
1867
  {
1868
- gridRef: v,
1868
+ gridRef: T,
1869
1869
  printTitle: "Tokens de API",
1870
1870
  width: "100%",
1871
1871
  height: "100%",
@@ -1880,29 +1880,29 @@ function gt({ height: a = "400px", width: t = "100%" }) {
1880
1880
  isError: !!d,
1881
1881
  error: d,
1882
1882
  enableGlobalFilter: !0,
1883
- getRowId: A,
1883
+ getRowId: R,
1884
1884
  toolbarLeftContent: /* @__PURE__ */ e(Fe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ r(O, { align: "start", gap: "2px", wrap: "nowrap", children: [
1885
- /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Fa, {}), onClick: b, children: g().t("archbase:New") }),
1886
- /* @__PURE__ */ e(X, { disabled: !f.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(na, {}), onClick: L, children: g().t("archbase:Revoke") })
1885
+ /* @__PURE__ */ e(X, { color: "green", leftSection: /* @__PURE__ */ e(Na, {}), onClick: v, children: b().t("archbase:New") }),
1886
+ /* @__PURE__ */ e(X, { disabled: !f.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(sa, {}), onClick: $, children: b().t("archbase:Revoke") })
1887
1887
  ] }) }),
1888
1888
  children: p
1889
1889
  }
1890
1890
  )
1891
1891
  }
1892
1892
  ),
1893
- R === "apiToken" ? /* @__PURE__ */ e(
1894
- Er,
1893
+ z === "apiToken" ? /* @__PURE__ */ e(
1894
+ Dr,
1895
1895
  {
1896
- onClickOk: E,
1896
+ onClickOk: y,
1897
1897
  opened: !0,
1898
- dataSource: y,
1898
+ dataSource: S,
1899
1899
  onCustomSave: i,
1900
- onClickCancel: E
1900
+ onClickCancel: y
1901
1901
  }
1902
1902
  ) : null
1903
1903
  ] });
1904
1904
  }
1905
- const Ue = (a) => {
1905
+ const Ge = (a) => {
1906
1906
  switch (a) {
1907
1907
  case "critical":
1908
1908
  return "red";
@@ -1913,114 +1913,114 @@ const Ue = (a) => {
1913
1913
  default:
1914
1914
  return "gray";
1915
1915
  }
1916
- }, Mr = ({ card: a, onOpen: t }) => {
1917
- const n = !!(t && a.metric);
1916
+ }, Ur = ({ card: a, onOpen: t }) => {
1917
+ const s = !!(t && a.metric);
1918
1918
  return /* @__PURE__ */ e(
1919
1919
  re,
1920
1920
  {
1921
1921
  withBorder: !0,
1922
1922
  radius: "md",
1923
1923
  p: "sm",
1924
- role: n ? "button" : void 0,
1925
- tabIndex: n ? 0 : void 0,
1926
- "aria-label": n ? `Ver os itens de ${a.label}` : void 0,
1927
- onClick: n ? () => t?.(a) : void 0,
1928
- onKeyDown: n ? (s) => {
1929
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), t?.(a));
1924
+ role: s ? "button" : void 0,
1925
+ tabIndex: s ? 0 : void 0,
1926
+ "aria-label": s ? `Ver os itens de ${a.label}` : void 0,
1927
+ onClick: s ? () => t?.(a) : void 0,
1928
+ onKeyDown: s ? (n) => {
1929
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), t?.(a));
1930
1930
  } : void 0,
1931
1931
  style: {
1932
- borderLeft: `3px solid var(--mantine-color-${Ue(a.severity)}-6)`,
1933
- cursor: n ? "pointer" : void 0
1932
+ borderLeft: `3px solid var(--mantine-color-${Ge(a.severity)}-6)`,
1933
+ cursor: s ? "pointer" : void 0
1934
1934
  },
1935
- children: /* @__PURE__ */ r(V, { gap: 4, children: [
1935
+ children: /* @__PURE__ */ r(U, { gap: 4, children: [
1936
1936
  /* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
1937
- /* @__PURE__ */ e(h, { fw: 600, size: "1.7rem", lh: 1.05, c: Ue(a.severity), children: a.value }),
1938
- a.of ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: a.of }) : null
1937
+ /* @__PURE__ */ e(c, { fw: 600, size: "1.7rem", lh: 1.05, c: Ge(a.severity), children: a.value }),
1938
+ a.of ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: a.of }) : null
1939
1939
  ] }),
1940
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: a.label }),
1941
- a.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
1940
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: a.label }),
1941
+ a.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
1942
1942
  ] })
1943
1943
  }
1944
1944
  );
1945
- }, Vr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((n, s) => /* @__PURE__ */ e(Mr, { card: n, onOpen: t }, `${n.label}-${s}`)) }), Gr = ({ flags: a }) => /* @__PURE__ */ e(He, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 3, children: [
1946
- /* @__PURE__ */ e(h, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
1945
+ }, Gr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((s, n) => /* @__PURE__ */ e(Ur, { card: s, onOpen: t }, `${s.label}-${n}`)) }), Br = ({ flags: a }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 3, children: [
1946
+ /* @__PURE__ */ e(c, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
1947
1947
  /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
1948
- /* @__PURE__ */ e(Q, { size: "xs", circle: !0, color: Ue(t.severity) }),
1949
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: t.value })
1948
+ /* @__PURE__ */ e(j, { size: "xs", circle: !0, color: Ge(t.severity) }),
1949
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: t.value })
1950
1950
  ] }),
1951
- t.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
1952
- ] }) }, t.key)) }), Ur = ({ attributes: a }) => /* @__PURE__ */ e(V, { gap: 7, children: a.map((t, n) => /* @__PURE__ */ r(O, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
1953
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: t.label }),
1954
- /* @__PURE__ */ e(h, { size: "sm", fw: 600, ta: "right", children: t.value })
1955
- ] }, `${t.label}-${n}`)) }), we = ({ title: a, hint: t, children: n }) => /* @__PURE__ */ r(V, { gap: "xs", children: [
1951
+ t.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
1952
+ ] }) }, t.key)) }), Hr = ({ attributes: a }) => /* @__PURE__ */ e(U, { gap: 7, children: a.map((t, s) => /* @__PURE__ */ r(O, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
1953
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: t.label }),
1954
+ /* @__PURE__ */ e(c, { size: "sm", fw: 600, ta: "right", children: t.value })
1955
+ ] }, `${t.label}-${s}`)) }), pe = ({ title: a, hint: t, children: s }) => /* @__PURE__ */ r(U, { gap: "xs", children: [
1956
1956
  /* @__PURE__ */ r(O, { gap: 10, align: "baseline", wrap: "wrap", children: [
1957
- /* @__PURE__ */ e(h, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
1958
- t ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: t }) : null
1957
+ /* @__PURE__ */ e(c, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
1958
+ t ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: t }) : null
1959
1959
  ] }),
1960
- n
1961
- ] }), Oe = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(de.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(S.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), Br = 25, Wr = ({ card: a, onClose: t }) => {
1962
- const n = J(
1960
+ s
1961
+ ] }), Ie = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(ue.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(m.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), qr = 25, Wr = ({ card: a, onClose: t }) => {
1962
+ const s = J(
1963
1963
  K.SecurityDiagnostics
1964
- ), [s, c] = T([]), [d, u] = T(1), [x, R] = T(1), [m, v] = T(0), [A, y] = T(!1), [P, f] = T(null), w = a?.metric;
1964
+ ), [n, u] = C([]), [d, h] = C(1), [A, z] = C(1), [g, T] = C(0), [R, S] = C(!1), [D, f] = C(null), w = a?.metric;
1965
1965
  return ee(() => {
1966
- u(1);
1966
+ h(1);
1967
1967
  }, [w]), ee(() => {
1968
1968
  if (!w)
1969
1969
  return;
1970
1970
  let o = !1;
1971
- return y(!0), f(null), n.getOverviewItems(w, d - 1, Br).then((l) => {
1972
- o || (c(l.content ?? []), v(l.totalElements ?? 0), R(Math.max(l.totalPages ?? 1, 1)));
1971
+ return S(!0), f(null), s.getOverviewItems(w, d - 1, qr).then((l) => {
1972
+ o || (u(l.content ?? []), T(l.totalElements ?? 0), z(Math.max(l.totalPages ?? 1, 1)));
1973
1973
  }).catch((l) => {
1974
1974
  o || f(l instanceof Error ? l.message : "Não foi possível carregar os itens.");
1975
1975
  }).finally(() => {
1976
- o || y(!1);
1976
+ o || S(!1);
1977
1977
  }), () => {
1978
1978
  o = !0;
1979
1979
  };
1980
- }, [n, w, d]), /* @__PURE__ */ e(
1981
- Ja,
1980
+ }, [s, w, d]), /* @__PURE__ */ e(
1981
+ _a,
1982
1982
  {
1983
1983
  opened: !!a,
1984
1984
  onClose: t,
1985
1985
  position: "right",
1986
1986
  size: "xl",
1987
- title: /* @__PURE__ */ r(V, { gap: 2, children: [
1988
- /* @__PURE__ */ e(h, { fw: 600, children: a?.label }),
1989
- a?.description ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.4, children: a.description }) : null
1987
+ title: /* @__PURE__ */ r(U, { gap: 2, children: [
1988
+ /* @__PURE__ */ e(c, { fw: 600, children: a?.label }),
1989
+ a?.description ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.4, children: a.description }) : null
1990
1990
  ] }),
1991
- children: /* @__PURE__ */ r(V, { gap: "sm", children: [
1991
+ children: /* @__PURE__ */ r(U, { gap: "sm", children: [
1992
1992
  /* @__PURE__ */ r(O, { gap: 8, children: [
1993
- /* @__PURE__ */ r(Q, { variant: "light", children: [
1994
- m,
1993
+ /* @__PURE__ */ r(j, { variant: "light", children: [
1994
+ g,
1995
1995
  " ",
1996
- m === 1 ? "item" : "itens"
1996
+ g === 1 ? "item" : "itens"
1997
1997
  ] }),
1998
- A ? /* @__PURE__ */ e(le, { size: "xs" }) : null
1998
+ R ? /* @__PURE__ */ e(se, { size: "xs" }) : null
1999
1999
  ] }),
2000
- P ? /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: P }) : null,
2001
- !A && !P && s.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
2002
- s.length > 0 ? (
2000
+ D ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: D }) : null,
2001
+ !R && !D && n.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
2002
+ n.length > 0 ? (
2003
2003
  // O scroll fica NA TABELA, não no drawer: rolando o drawer, o cabeçalho some e
2004
2004
  // uma coluna de valores sem cabeçalho deixa de dizer o que é. Aqui o cabeçalho
2005
2005
  // gruda e o título, a contagem e a paginação ficam onde estavam.
2006
- /* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2007
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2008
- /* @__PURE__ */ e(S.Th, { children: "Item" }),
2009
- /* @__PURE__ */ e(S.Th, { children: "Onde" }),
2010
- /* @__PURE__ */ e(S.Th, { children: "Por que está aqui" })
2006
+ /* @__PURE__ */ e(Ie, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2007
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2008
+ /* @__PURE__ */ e(m.Th, { children: "Item" }),
2009
+ /* @__PURE__ */ e(m.Th, { children: "Onde" }),
2010
+ /* @__PURE__ */ e(m.Th, { children: "Por que está aqui" })
2011
2011
  ] }) }),
2012
- /* @__PURE__ */ e(S.Tbody, { children: s.map((o) => /* @__PURE__ */ r(S.Tr, { children: [
2013
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.label }) }),
2014
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.detail }) }),
2015
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", children: o.reason }) })
2012
+ /* @__PURE__ */ e(m.Tbody, { children: n.map((o) => /* @__PURE__ */ r(m.Tr, { children: [
2013
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: o.label }) }),
2014
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.detail }) }),
2015
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", children: o.reason }) })
2016
2016
  ] }, o.id)) })
2017
2017
  ] }) })
2018
2018
  ) : null,
2019
- x > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(Xa, { value: d, onChange: u, total: x, size: "sm" }) }) : null
2019
+ A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(ka, { value: d, onChange: h, total: A, size: "sm" }) }) : null
2020
2020
  ] })
2021
2021
  }
2022
2022
  );
2023
- }, qr = (a, t) => t > 0 ? ` · ${Math.round(a / t * 100)}%` : "", Hr = (a) => {
2023
+ }, jr = (a, t) => t > 0 ? ` · ${Math.round(a / t * 100)}%` : "", Zr = (a) => {
2024
2024
  const t = a.flags;
2025
2025
  return [
2026
2026
  {
@@ -2052,12 +2052,12 @@ const Ue = (a) => {
2052
2052
  description: t.scanConfigured ? "O catálogo se alimenta do código." : "O catálogo não se alimenta do código."
2053
2053
  }
2054
2054
  ];
2055
- }, jr = (a) => [
2055
+ }, Qr = (a) => [
2056
2056
  {
2057
2057
  severity: "critical",
2058
2058
  value: a.permissionsPointingToInactive,
2059
2059
  metric: "PERMISSIONS_POINTING_TO_INACTIVE",
2060
- of: `de ${a.permissions}${qr(a.permissionsPointingToInactive, a.permissions)}`,
2060
+ of: `de ${a.permissions}${jr(a.permissionsPointingToInactive, a.permissions)}`,
2061
2061
  label: "Permissões inertes",
2062
2062
  description: "Apontam para ação ou recurso inativo. É o acesso que o operador acredita ter concedido."
2063
2063
  },
@@ -2101,189 +2101,189 @@ const Ue = (a) => {
2101
2101
  label: "Ninguém tem",
2102
2102
  description: "Capacidade existe no catálogo e não foi concedida a ninguém."
2103
2103
  }
2104
- ], ba = ({ slots: a, onError: t }) => {
2105
- const n = J(
2104
+ ], va = ({ slots: a, onError: t }) => {
2105
+ const s = J(
2106
2106
  K.SecurityDiagnostics
2107
- ), [s, c] = T(void 0), [d, u] = T(!0), [x, R] = T(void 0), [m, v] = T(null);
2107
+ ), [n, u] = C(void 0), [d, h] = C(!0), [A, z] = C(void 0), [g, T] = C(null);
2108
2108
  ee(() => {
2109
- let P = !0;
2110
- return u(!0), n.getOverview().then((f) => {
2111
- P && (c(f), R(void 0));
2109
+ let D = !0;
2110
+ return h(!0), s.getOverview().then((f) => {
2111
+ D && (u(f), z(void 0));
2112
2112
  }).catch((f) => {
2113
- if (P) {
2114
- const w = be(f);
2115
- R(w), t?.(w);
2113
+ if (D) {
2114
+ const w = Te(f);
2115
+ z(w), t?.(w);
2116
2116
  }
2117
2117
  }).finally(() => {
2118
- P && u(!1);
2118
+ D && h(!1);
2119
2119
  }), () => {
2120
- P = !1;
2120
+ D = !1;
2121
2121
  };
2122
- }, [n]);
2123
- const A = ie(
2124
- () => s ? [...Hr(s), ...a?.additionalFlags?.(s) ?? []] : [],
2125
- [s, a]
2126
- ), y = ie(
2127
- () => s ? [...jr(s), ...a?.additionalOverviewCards?.(s) ?? []] : [],
2128
- [s, a]
2122
+ }, [s]);
2123
+ const R = ie(
2124
+ () => n ? [...Zr(n), ...a?.additionalFlags?.(n) ?? []] : [],
2125
+ [n, a]
2126
+ ), S = ie(
2127
+ () => n ? [...Qr(n), ...a?.additionalOverviewCards?.(n) ?? []] : [],
2128
+ [n, a]
2129
2129
  );
2130
- return d ? /* @__PURE__ */ e(le, { size: "sm" }) : x ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível ler o diagnóstico", children: x }) : s ? /* @__PURE__ */ r(V, { gap: "lg", children: [
2131
- /* @__PURE__ */ r(we, { title: "Proteções", hint: "de AccessOverview.flags", children: [
2132
- /* @__PURE__ */ e(Gr, { flags: A }),
2133
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
2130
+ return d ? /* @__PURE__ */ e(se, { size: "sm" }) : A ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível ler o diagnóstico", children: A }) : n ? /* @__PURE__ */ r(U, { gap: "lg", children: [
2131
+ /* @__PURE__ */ r(pe, { title: "Proteções", hint: "de AccessOverview.flags", children: [
2132
+ /* @__PURE__ */ e(Br, { flags: R }),
2133
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
2134
2134
  ] }),
2135
- /* @__PURE__ */ e(we, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Vr, { cards: y, onOpenCard: v }) }),
2136
- a?.afterOverview?.(s),
2137
- /* @__PURE__ */ e(Wr, { card: m, onClose: () => v(null) })
2135
+ /* @__PURE__ */ e(pe, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Gr, { cards: S, onOpenCard: T }) }),
2136
+ a?.afterOverview?.(n),
2137
+ /* @__PURE__ */ e(Wr, { card: g, onClose: () => T(null) })
2138
2138
  ] }) : null;
2139
- }, Be = ({ value: a, onChange: t, assunto: n, visiveis: s, total: c }) => {
2140
- const d = typeof s == "number" && typeof c == "number" && s < c;
2139
+ }, Be = ({ value: a, onChange: t, assunto: s, visiveis: n, total: u }) => {
2140
+ const d = typeof n == "number" && typeof u == "number" && n < u;
2141
2141
  return /* @__PURE__ */ e(
2142
- ve,
2142
+ he,
2143
2143
  {
2144
2144
  size: "xs",
2145
2145
  value: a,
2146
- onChange: (u) => t(u.currentTarget.value),
2147
- placeholder: n ? `Filtrar ${n}…` : "Filtrar…",
2148
- "aria-label": n ? `Filtrar ${n}` : "Filtrar",
2149
- description: d ? `${s} de ${c}` : void 0,
2146
+ onChange: (h) => t(h.currentTarget.value),
2147
+ placeholder: s ? `Filtrar ${s}…` : "Filtrar…",
2148
+ "aria-label": s ? `Filtrar ${s}` : "Filtrar",
2149
+ description: d ? `${n} de ${u}` : void 0,
2150
2150
  rightSection: a ? /* @__PURE__ */ e(Ya, { size: "sm", onClick: () => t(""), "aria-label": "Limpar filtro" }) : null
2151
2151
  }
2152
2152
  );
2153
- }, Zr = /[̀-ͯ]/g, va = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Zr, ""), We = (a, t) => {
2154
- const [n, s] = T(""), c = ie(() => {
2155
- const d = va(n.trim());
2153
+ }, Kr = /[̀-ͯ]/g, ya = (a) => a.toLocaleLowerCase().normalize("NFD").replace(Kr, ""), He = (a, t) => {
2154
+ const [s, n] = C(""), u = ie(() => {
2155
+ const d = ya(s.trim());
2156
2156
  return d ? a.filter(
2157
- (u) => t(u).some((x) => x ? va(x).includes(d) : !1)
2157
+ (h) => t(h).some((A) => A ? ya(A).includes(d) : !1)
2158
2158
  ) : a;
2159
- }, [a, n]);
2160
- return { filtro: n, setFiltro: s, filtrados: c };
2161
- }, ya = {
2159
+ }, [a, s]);
2160
+ return { filtro: s, setFiltro: n, filtrados: u };
2161
+ }, Ta = {
2162
2162
  EFFECTIVE: { label: "Efetiva", color: "green" },
2163
2163
  INERT: { label: "Inerte", color: "orange" },
2164
2164
  DENIED: { label: "Negada", color: "red" }
2165
- }, Qr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, Kr = [
2165
+ }, Jr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, Xr = [
2166
2166
  { value: "all", label: "Todas" },
2167
2167
  { value: "EFFECTIVE", label: "Só efetivas" },
2168
2168
  { value: "INERT", label: "Só inertes" },
2169
2169
  { value: "DENIED", label: "Negadas" },
2170
2170
  { value: "inherited", label: "Só herdadas" }
2171
- ], Jr = ({ slots: a, onError: t, userId: n }) => {
2172
- const s = J(
2171
+ ], _r = ({ slots: a, onError: t, userId: s }) => {
2172
+ const n = J(
2173
2173
  K.SecurityDiagnostics
2174
- ), [c, d] = T(""), [u, x] = T(void 0), [R, m] = T(!1), [v, A] = T(void 0), [y, P] = T("all"), f = !!n, w = ae(
2174
+ ), [u, d] = C(""), [h, A] = C(void 0), [z, g] = C(!1), [T, R] = C(void 0), [S, D] = C("all"), f = !!s, w = ae(
2175
2175
  async (i) => {
2176
2176
  const N = i.trim();
2177
2177
  if (N) {
2178
- m(!0), A(void 0);
2178
+ g(!0), R(void 0);
2179
2179
  try {
2180
- const F = N.includes("@") ? await s.getEffectiveAccessByEmail(N) : await s.getEffectiveAccessByUserId(N);
2181
- x(F);
2182
- } catch (F) {
2183
- const G = be(F);
2184
- A(G), t?.(G), x(void 0);
2180
+ const k = N.includes("@") ? await n.getEffectiveAccessByEmail(N) : await n.getEffectiveAccessByUserId(N);
2181
+ A(k);
2182
+ } catch (k) {
2183
+ const M = Te(k);
2184
+ R(M), t?.(M), A(void 0);
2185
2185
  } finally {
2186
- m(!1);
2186
+ g(!1);
2187
2187
  }
2188
2188
  }
2189
2189
  },
2190
- [s, t]
2191
- ), o = ie(() => u ? [
2192
- { label: "Perfil", value: u.profileName || "—" },
2193
- { label: "Grupos", value: u.groupNames.length ? u.groupNames.join(", ") : "—" },
2194
- ...a?.userAttributes?.(u) ?? []
2195
- ] : [], [u, a]), l = ie(() => u ? y === "all" ? u.capabilities : y === "inherited" ? u.capabilities.filter((i) => i.grantedByType !== "USER") : u.capabilities.filter((i) => i.situation === y) : [], [u, y]), {
2190
+ [n, t]
2191
+ ), o = ie(() => h ? [
2192
+ { label: "Perfil", value: h.profileName || "—" },
2193
+ { label: "Grupos", value: h.groupNames.length ? h.groupNames.join(", ") : "—" },
2194
+ ...a?.userAttributes?.(h) ?? []
2195
+ ] : [], [h, a]), l = ie(() => h ? S === "all" ? h.capabilities : S === "inherited" ? h.capabilities.filter((i) => i.grantedByType !== "USER") : h.capabilities.filter((i) => i.situation === S) : [], [h, S]), {
2196
2196
  filtro: p,
2197
- setFiltro: b,
2198
- filtrados: L
2199
- } = We(l, (i) => [i.resource, i.action, i.grantedByName]);
2197
+ setFiltro: v,
2198
+ filtrados: $
2199
+ } = He(l, (i) => [i.resource, i.action, i.grantedByName]);
2200
2200
  ee(() => {
2201
- n && (P("all"), w(n));
2202
- }, [n, w]);
2203
- const E = a?.additionalCapabilityColumns ?? [];
2204
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2205
- f ? null : /* @__PURE__ */ e(we, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
2201
+ s && (D("all"), w(s));
2202
+ }, [s, w]);
2203
+ const y = a?.additionalCapabilityColumns ?? [];
2204
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2205
+ f ? null : /* @__PURE__ */ e(pe, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((i) => {
2206
2206
  d(i), w(i);
2207
2207
  }) : /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
2208
2208
  /* @__PURE__ */ e(
2209
- ve,
2209
+ he,
2210
2210
  {
2211
2211
  style: { flex: 1, minWidth: 240 },
2212
2212
  label: "Usuário",
2213
2213
  placeholder: "pessoa@empresa.com.br",
2214
- value: c,
2214
+ value: u,
2215
2215
  onChange: (i) => d(i.currentTarget.value),
2216
2216
  onKeyDown: (i) => {
2217
- i.key === "Enter" && w(c);
2217
+ i.key === "Enter" && w(u);
2218
2218
  }
2219
2219
  }
2220
2220
  ),
2221
- /* @__PURE__ */ e(X, { onClick: () => void w(c), loading: R, children: "Consultar" })
2221
+ /* @__PURE__ */ e(X, { onClick: () => void w(u), loading: z, children: "Consultar" })
2222
2222
  ] }) }),
2223
- v ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível ler o efetivo", children: v }) : null,
2224
- R && !u ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
2225
- u ? /* @__PURE__ */ r(xe, { children: [
2226
- /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
2223
+ T ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível ler o efetivo", children: T }) : null,
2224
+ z && !h ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
2225
+ h ? /* @__PURE__ */ r(Se, { children: [
2226
+ /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
2227
2227
  /* @__PURE__ */ r(O, { gap: 8, wrap: "wrap", align: "center", children: [
2228
- /* @__PURE__ */ e(h, { fw: 620, children: u.userLabel }),
2229
- u.administrator ? /* @__PURE__ */ e(Q, { color: "red", children: "administrador" }) : null,
2230
- u.enabled ? null : /* @__PURE__ */ e(Q, { color: "red", children: "conta desativada" }),
2231
- a?.afterUserBadges?.(u)
2228
+ /* @__PURE__ */ e(c, { fw: 620, children: h.userLabel }),
2229
+ h.administrator ? /* @__PURE__ */ e(j, { color: "red", children: "administrador" }) : null,
2230
+ h.enabled ? null : /* @__PURE__ */ e(j, { color: "red", children: "conta desativada" }),
2231
+ a?.afterUserBadges?.(h)
2232
2232
  ] }),
2233
- /* @__PURE__ */ e(Ur, { attributes: o })
2233
+ /* @__PURE__ */ e(Hr, { attributes: o })
2234
2234
  ] }) }),
2235
- u.administrator ? /* @__PURE__ */ r(ye, { color: "orange", title: "Administrador passa direto", children: [
2235
+ h.administrator ? /* @__PURE__ */ r(ce, { color: "orange", title: "Administrador passa direto", children: [
2236
2236
  "O portão GRANT concede sem consultar o catálogo. A lista abaixo vir vazia não é falta de dado — é o atalho que a flag ",
2237
2237
  /* @__PURE__ */ e("code", { children: "isAdministrator" }),
2238
2238
  " representa."
2239
2239
  ] }) : null,
2240
- /* @__PURE__ */ e(He, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
2241
- ["concedidas", u.granted, "neutral"],
2242
- ["efetivas", u.effective, "ok"],
2243
- ["inertes", u.inert, "warning"],
2244
- ["negadas", u.denied, "critical"]
2245
- ].map(([i, N, F]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 2, children: [
2246
- /* @__PURE__ */ e(h, { size: "1.3rem", fw: 620, c: Ue(F), children: N }),
2247
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: i })
2240
+ /* @__PURE__ */ e(We, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
2241
+ ["concedidas", h.granted, "neutral"],
2242
+ ["efetivas", h.effective, "ok"],
2243
+ ["inertes", h.inert, "warning"],
2244
+ ["negadas", h.denied, "critical"]
2245
+ ].map(([i, N, k]) => /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(U, { gap: 2, children: [
2246
+ /* @__PURE__ */ e(c, { size: "1.3rem", fw: 620, c: Ge(k), children: N }),
2247
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: i })
2248
2248
  ] }) }, i)) }),
2249
- a?.afterEffectiveTally?.(u),
2250
- /* @__PURE__ */ r(we, { title: "Capacidades", hint: `${u.capabilities.length} no total`, children: [
2251
- /* @__PURE__ */ e(ua.Group, { multiple: !1, value: y, onChange: (i) => P(i), children: /* @__PURE__ */ e(O, { gap: 6, children: Kr.map((i) => /* @__PURE__ */ e(ua, { value: i.value, size: "xs", variant: "outline", children: i.label }, i.value)) }) }),
2249
+ a?.afterEffectiveTally?.(h),
2250
+ /* @__PURE__ */ r(pe, { title: "Capacidades", hint: `${h.capabilities.length} no total`, children: [
2251
+ /* @__PURE__ */ e(ha.Group, { multiple: !1, value: S, onChange: (i) => D(i), children: /* @__PURE__ */ e(O, { gap: 6, children: Xr.map((i) => /* @__PURE__ */ e(ha, { value: i.value, size: "xs", variant: "outline", children: i.label }, i.value)) }) }),
2252
2252
  /* @__PURE__ */ e(
2253
2253
  Be,
2254
2254
  {
2255
2255
  value: p,
2256
- onChange: b,
2256
+ onChange: v,
2257
2257
  assunto: "capacidades",
2258
- visiveis: L.length,
2258
+ visiveis: $.length,
2259
2259
  total: l.length
2260
2260
  }
2261
2261
  ),
2262
- /* @__PURE__ */ e(Oe, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2263
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2264
- /* @__PURE__ */ e(S.Th, { children: "Capacidade" }),
2265
- /* @__PURE__ */ e(S.Th, { children: "Origem" }),
2266
- /* @__PURE__ */ e(S.Th, { children: "Situação" }),
2267
- E.map((i) => /* @__PURE__ */ e(S.Th, { children: i.header }, i.header))
2262
+ /* @__PURE__ */ e(Ie, { maxHeight: "calc(100vh - 460px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2263
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2264
+ /* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
2265
+ /* @__PURE__ */ e(m.Th, { children: "Origem" }),
2266
+ /* @__PURE__ */ e(m.Th, { children: "Situação" }),
2267
+ y.map((i) => /* @__PURE__ */ e(m.Th, { children: i.header }, i.header))
2268
2268
  ] }) }),
2269
- /* @__PURE__ */ r(S.Tbody, { children: [
2270
- L.map((i, N) => /* @__PURE__ */ r(S.Tr, { children: [
2271
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", ff: "monospace", children: [
2269
+ /* @__PURE__ */ r(m.Tbody, { children: [
2270
+ $.map((i, N) => /* @__PURE__ */ r(m.Tr, { children: [
2271
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", ff: "monospace", children: [
2272
2272
  i.resource,
2273
2273
  ":",
2274
2274
  i.action
2275
2275
  ] }) }),
2276
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", children: [
2277
- /* @__PURE__ */ r(h, { span: !0, c: "dimmed", children: [
2278
- Qr[i.grantedByType] ?? i.grantedByType,
2276
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", children: [
2277
+ /* @__PURE__ */ r(c, { span: !0, c: "dimmed", children: [
2278
+ Jr[i.grantedByType] ?? i.grantedByType,
2279
2279
  " "
2280
2280
  ] }),
2281
2281
  i.grantedByName
2282
2282
  ] }) }),
2283
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(Q, { color: ya[i.situation].color, variant: "light", children: ya[i.situation].label }) }),
2284
- E.map((F) => /* @__PURE__ */ e(S.Td, { children: F.render(i, u) }, F.header))
2283
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(j, { color: Ta[i.situation].color, variant: "light", children: Ta[i.situation].label }) }),
2284
+ y.map((k) => /* @__PURE__ */ e(m.Td, { children: k.render(i, h) }, k.header))
2285
2285
  ] }, `${i.resource}:${i.action}:${N}`)),
2286
- l.length === 0 ? /* @__PURE__ */ e(S.Tr, { children: /* @__PURE__ */ e(S.Td, { colSpan: 3 + E.length, children: /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
2286
+ l.length === 0 ? /* @__PURE__ */ e(m.Tr, { children: /* @__PURE__ */ e(m.Td, { colSpan: 3 + y.length, children: /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
2287
2287
  ] })
2288
2288
  ] }) })
2289
2289
  ] })
@@ -2292,160 +2292,160 @@ const Ue = (a) => {
2292
2292
  }, wa = 40, Ca = ({
2293
2293
  label: a,
2294
2294
  valor: t,
2295
- placeholder: n,
2296
- branch: s,
2297
- somenteFolhas: c,
2295
+ placeholder: s,
2296
+ branch: n,
2297
+ somenteFolhas: u,
2298
2298
  branchDosFilhos: d,
2299
- onSelecionar: u
2299
+ onSelecionar: h
2300
2300
  }) => {
2301
- const x = J(
2301
+ const A = J(
2302
2302
  K.SecurityDiagnostics
2303
- ), [R, m] = T(!1), [v, A] = T(""), [y, P] = T([]), [f, w] = T({}), [o, l] = T(), [p, b] = T(!1), [L, E] = T(), i = ae(
2304
- async (C) => {
2305
- b(!0), E(void 0);
2303
+ ), [z, g] = C(!1), [T, R] = C(""), [S, D] = C([]), [f, w] = C({}), [o, l] = C(), [p, v] = C(!1), [$, y] = C(), i = ae(
2304
+ async (x) => {
2305
+ v(!0), y(void 0);
2306
2306
  try {
2307
- const z = await x.browse(s, { q: C || void 0, page: 0, size: wa });
2308
- P(z.content ?? []);
2309
- } catch (z) {
2310
- E(z instanceof Error ? z.message : "Não foi possível carregar.");
2307
+ const I = await A.browse(n, { q: x || void 0, page: 0, size: wa });
2308
+ D(I.content ?? []);
2309
+ } catch (I) {
2310
+ y(I instanceof Error ? I.message : "Não foi possível carregar.");
2311
2311
  } finally {
2312
- b(!1);
2312
+ v(!1);
2313
2313
  }
2314
2314
  },
2315
- [x, s]
2315
+ [A, n]
2316
2316
  );
2317
2317
  ee(() => {
2318
- if (!R)
2318
+ if (!z)
2319
2319
  return;
2320
- const C = setTimeout(() => void i(v), v ? 300 : 0);
2321
- return () => clearTimeout(C);
2322
- }, [R, v, i]);
2320
+ const x = setTimeout(() => void i(T), T ? 300 : 0);
2321
+ return () => clearTimeout(x);
2322
+ }, [z, T, i]);
2323
2323
  const N = ae(
2324
- async (C) => {
2325
- if (o === C.id) {
2324
+ async (x) => {
2325
+ if (o === x.id) {
2326
2326
  l(void 0);
2327
2327
  return;
2328
2328
  }
2329
- if (l(C.id), !f[C.id])
2329
+ if (l(x.id), !f[x.id])
2330
2330
  try {
2331
- const z = await x.browse(d ?? s, {
2332
- parentId: C.id,
2331
+ const I = await A.browse(d ?? n, {
2332
+ parentId: x.id,
2333
2333
  page: 0,
2334
2334
  size: wa
2335
2335
  });
2336
- w((oe) => ({ ...oe, [C.id]: z.content ?? [] }));
2337
- } catch (z) {
2338
- E(z instanceof Error ? z.message : "Não foi possível abrir.");
2336
+ w((oe) => ({ ...oe, [x.id]: I.content ?? [] }));
2337
+ } catch (I) {
2338
+ y(I instanceof Error ? I.message : "Não foi possível abrir.");
2339
2339
  }
2340
2340
  },
2341
- [x, s, d, o, f]
2342
- ), F = (C, z) => {
2343
- u(C, z), m(!1);
2344
- }, G = (C, z) => {
2345
- const oe = C.hasChildren;
2341
+ [A, n, d, o, f]
2342
+ ), k = (x, I) => {
2343
+ h(x, I), g(!1);
2344
+ }, M = (x, I) => {
2345
+ const oe = x.hasChildren;
2346
2346
  return /* @__PURE__ */ e(
2347
2347
  ze,
2348
2348
  {
2349
- onClick: () => oe && c ? void N(C) : F(C, z),
2349
+ onClick: () => oe && u ? void N(x) : k(x, I),
2350
2350
  style: {
2351
2351
  display: "block",
2352
2352
  width: "100%",
2353
2353
  padding: "5px 8px",
2354
- paddingLeft: z ? 24 : 8,
2354
+ paddingLeft: I ? 24 : 8,
2355
2355
  borderRadius: 4
2356
2356
  },
2357
2357
  children: /* @__PURE__ */ r(O, { gap: 6, wrap: "nowrap", children: [
2358
- /* @__PURE__ */ e(h, { size: "sm", fw: !c || !oe ? 500 : 600, truncate: !0, children: C.label }),
2359
- C.badge ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: C.badge }) : null
2358
+ /* @__PURE__ */ e(c, { size: "sm", fw: !u || !oe ? 500 : 600, truncate: !0, children: x.label }),
2359
+ x.badge ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: x.badge }) : null
2360
2360
  ] })
2361
2361
  },
2362
- `${z?.id ?? "raiz"}:${C.id}`
2362
+ `${I?.id ?? "raiz"}:${x.id}`
2363
2363
  );
2364
- }, D = (C) => /* @__PURE__ */ r(_, { children: [
2365
- G(C),
2366
- o === C.id ? (f[C.id] ?? []).map((z) => G(z, C)) : null
2367
- ] }, `ramo:${C.id}`);
2368
- return /* @__PURE__ */ r(Je, { opened: R, onChange: m, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
2364
+ }, F = (x) => /* @__PURE__ */ r(Y, { children: [
2365
+ M(x),
2366
+ o === x.id ? (f[x.id] ?? []).map((I) => M(I, x)) : null
2367
+ ] }, `ramo:${x.id}`);
2368
+ return /* @__PURE__ */ r(Je, { opened: z, onChange: g, width: 340, position: "bottom-start", withinPortal: !0, shadow: "md", children: [
2369
2369
  /* @__PURE__ */ e(Je.Target, { children: /* @__PURE__ */ e(
2370
- ve,
2370
+ he,
2371
2371
  {
2372
2372
  label: a,
2373
- placeholder: n,
2373
+ placeholder: s,
2374
2374
  value: t ?? "",
2375
2375
  readOnly: !0,
2376
- onClick: () => m((C) => !C),
2376
+ onClick: () => g((x) => !x),
2377
2377
  styles: { input: { cursor: "pointer" } }
2378
2378
  }
2379
2379
  ) }),
2380
2380
  /* @__PURE__ */ r(Je.Dropdown, { p: 6, children: [
2381
2381
  /* @__PURE__ */ e(
2382
- ve,
2382
+ he,
2383
2383
  {
2384
2384
  size: "xs",
2385
2385
  placeholder: "Buscar…",
2386
- value: v,
2387
- onChange: (C) => A(C.currentTarget.value),
2386
+ value: T,
2387
+ onChange: (x) => R(x.currentTarget.value),
2388
2388
  mb: 6,
2389
2389
  autoFocus: !0
2390
2390
  }
2391
2391
  ),
2392
2392
  p ? /* @__PURE__ */ r(O, { gap: 6, p: 6, children: [
2393
- /* @__PURE__ */ e(le, { size: "xs" }),
2394
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Carregando…" })
2393
+ /* @__PURE__ */ e(se, { size: "xs" }),
2394
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "Carregando…" })
2395
2395
  ] }) : null,
2396
- L ? /* @__PURE__ */ e(h, { size: "xs", c: "red", p: 6, children: L }) : null,
2397
- !p && !L && y.length === 0 ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
2398
- /* @__PURE__ */ e(de.Autosize, { mah: 280, type: "hover", children: y.map((C) => D(C)) })
2396
+ $ ? /* @__PURE__ */ e(c, { size: "xs", c: "red", p: 6, children: $ }) : null,
2397
+ !p && !$ && S.length === 0 ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", p: 6, children: "Nada encontrado." }) : null,
2398
+ /* @__PURE__ */ e(ue.Autosize, { mah: 280, type: "hover", children: S.map((x) => F(x)) })
2399
2399
  ] })
2400
2400
  ] });
2401
- }, Xr = [
2401
+ }, Yr = [
2402
2402
  { gate: "IDENTITY", titulo: "Identidade", papel: "só nega", pergunta: "O principal é resolvível e a conta está ativa?" },
2403
2403
  { gate: "SCOPE", titulo: "Escopo", papel: "só nega", pergunta: "A concessão vale para o tenant, empresa e projeto pedidos?" },
2404
2404
  { gate: "RESTRICTION", titulo: "Restrições", papel: "só nega", pergunta: "Perfil, papel e persona exigidos pela anotação." },
2405
2405
  { gate: "LEVEL", titulo: "Nível", papel: "só nega", pergunta: "O nível da pessoa alcança o piso da capacidade?" },
2406
2406
  { gate: "GRANT", titulo: "Concessão", papel: "concede", pergunta: "Existe permissão, sem negação explícita?" }
2407
- ], Yr = ({ slots: a, onError: t, initial: n }) => {
2408
- const s = J(
2407
+ ], et = ({ slots: a, onError: t, initial: s }) => {
2408
+ const n = J(
2409
2409
  K.SecurityDiagnostics
2410
- ), [c, d] = T(""), [u, x] = T(""), [R, m] = T(""), [v, A] = T(""), [y, P] = T({}), [f, w] = T(void 0), [o, l] = T(!1), [p, b] = T(void 0);
2410
+ ), [u, d] = C(""), [h, A] = C(""), [z, g] = C(""), [T, R] = C(""), [S, D] = C({}), [f, w] = C(void 0), [o, l] = C(!1), [p, v] = C(void 0);
2411
2411
  ee(() => {
2412
- n && (n.userId && d(n.userId), n.userLabel && x(n.userLabel), n.resource && m(n.resource), n.action && A(n.action), w(void 0));
2413
- }, [n?.userId, n?.userLabel, n?.resource, n?.action]);
2414
- const L = ae(async () => {
2415
- if (!(!c.trim() || !R.trim() || !v.trim())) {
2416
- l(!0), b(void 0);
2412
+ s && (s.userId && d(s.userId), s.userLabel && A(s.userLabel), s.resource && g(s.resource), s.action && R(s.action), w(void 0));
2413
+ }, [s?.userId, s?.userLabel, s?.resource, s?.action]);
2414
+ const $ = ae(async () => {
2415
+ if (!(!u.trim() || !z.trim() || !T.trim())) {
2416
+ l(!0), v(void 0);
2417
2417
  try {
2418
- const i = c.trim(), N = await s.simulate({
2418
+ const i = u.trim(), N = await n.simulate({
2419
2419
  ...i.includes("@") ? { email: i } : { userId: i },
2420
- resource: R.trim(),
2421
- action: v.trim(),
2422
- companyId: y.companyId,
2423
- projectId: y.projectId
2420
+ resource: z.trim(),
2421
+ action: T.trim(),
2422
+ companyId: S.companyId,
2423
+ projectId: S.projectId
2424
2424
  });
2425
2425
  w(N);
2426
2426
  } catch (i) {
2427
- const N = be(i);
2428
- b(N), t?.(N), w(void 0);
2427
+ const N = Te(i);
2428
+ v(N), t?.(N), w(void 0);
2429
2429
  } finally {
2430
2430
  l(!1);
2431
2431
  }
2432
2432
  }
2433
- }, [s, c, R, v, y, t]), E = (i, N) => {
2434
- const F = N.chain?.find((G) => G.gate === i);
2435
- return F ? F.passed ? "passou" : "negou" : "nao-avaliado";
2433
+ }, [n, u, z, T, S, t]), y = (i, N) => {
2434
+ const k = N.chain?.find((M) => M.gate === i);
2435
+ return k ? k.passed ? "passou" : "negou" : "nao-avaliado";
2436
2436
  };
2437
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2438
- /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
2439
- /* @__PURE__ */ r(He, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
2437
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2438
+ /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(U, { gap: "sm", children: [
2439
+ /* @__PURE__ */ r(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
2440
2440
  /* @__PURE__ */ e(
2441
2441
  Ca,
2442
2442
  {
2443
2443
  label: "Usuário",
2444
2444
  placeholder: "escolher pessoa",
2445
2445
  branch: "USERS",
2446
- valor: u || c,
2446
+ valor: h || u,
2447
2447
  onSelecionar: (i) => {
2448
- d(i.id), x(i.label);
2448
+ d(i.id), A(i.label);
2449
2449
  }
2450
2450
  }
2451
2451
  ),
@@ -2457,68 +2457,68 @@ const Ue = (a) => {
2457
2457
  branch: "RESOURCES",
2458
2458
  branchDosFilhos: "ACTIONS_OF_RESOURCE",
2459
2459
  somenteFolhas: !0,
2460
- valor: R && v ? `${R} · ${v}` : "",
2460
+ valor: z && T ? `${z} · ${T}` : "",
2461
2461
  onSelecionar: (i, N) => {
2462
- A(i.label), N && m(N.label);
2462
+ R(i.label), N && g(N.label);
2463
2463
  }
2464
2464
  }
2465
2465
  ),
2466
2466
  /* @__PURE__ */ e(
2467
- ve,
2467
+ he,
2468
2468
  {
2469
2469
  label: "Empresa (opcional)",
2470
2470
  placeholder: "companyId",
2471
- value: y.companyId ?? "",
2472
- onChange: (i) => P((N) => ({ ...N, companyId: i.currentTarget.value || void 0 }))
2471
+ value: S.companyId ?? "",
2472
+ onChange: (i) => D((N) => ({ ...N, companyId: i.currentTarget.value || void 0 }))
2473
2473
  }
2474
2474
  )
2475
2475
  ] }),
2476
- a?.afterSimulationFields?.((i) => P((N) => ({ ...N, ...i }))),
2476
+ a?.afterSimulationFields?.((i) => D((N) => ({ ...N, ...i }))),
2477
2477
  /* @__PURE__ */ r(O, { gap: "xs", align: "center", children: [
2478
- /* @__PURE__ */ e(X, { onClick: () => void L(), loading: o, children: "Simular" }),
2479
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
2478
+ /* @__PURE__ */ e(X, { onClick: () => void $(), loading: o, children: "Simular" }),
2479
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
2480
2480
  ] })
2481
2481
  ] }) }),
2482
- p ? /* @__PURE__ */ e(ye, { color: "red", title: "Não foi possível simular", children: p }) : null,
2483
- o && !f ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
2484
- f ? /* @__PURE__ */ r(xe, { children: [
2485
- /* @__PURE__ */ e(we, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(V, { gap: "sm", children: Xr.map((i, N) => {
2486
- const F = E(i.gate, f), G = f.chain?.find((D) => D.gate === i.gate)?.detail;
2482
+ p ? /* @__PURE__ */ e(ce, { color: "red", title: "Não foi possível simular", children: p }) : null,
2483
+ o && !f ? /* @__PURE__ */ e(se, { size: "sm" }) : null,
2484
+ f ? /* @__PURE__ */ r(Se, { children: [
2485
+ /* @__PURE__ */ e(pe, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(re, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(U, { gap: "sm", children: Yr.map((i, N) => {
2486
+ const k = y(i.gate, f), M = f.chain?.find((F) => F.gate === i.gate)?.detail;
2487
2487
  return /* @__PURE__ */ r(O, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
2488
- /* @__PURE__ */ e(h, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: N + 1 }),
2489
- /* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
2488
+ /* @__PURE__ */ e(c, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: N + 1 }),
2489
+ /* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
2490
2490
  /* @__PURE__ */ r(O, { gap: 8, align: "baseline", wrap: "wrap", children: [
2491
2491
  /* @__PURE__ */ e(
2492
- h,
2492
+ c,
2493
2493
  {
2494
2494
  size: "sm",
2495
2495
  fw: 600,
2496
- c: F === "negou" ? "red" : void 0,
2497
- opacity: F === "nao-avaliado" ? 0.5 : 1,
2496
+ c: k === "negou" ? "red" : void 0,
2497
+ opacity: k === "nao-avaliado" ? 0.5 : 1,
2498
2498
  children: i.titulo
2499
2499
  }
2500
2500
  ),
2501
- /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", children: [
2501
+ /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", children: [
2502
2502
  "· ",
2503
2503
  i.papel
2504
2504
  ] })
2505
2505
  ] }),
2506
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", opacity: F === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
2507
- G ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: G }) : null
2506
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", opacity: k === "nao-avaliado" ? 0.5 : 1, children: i.pergunta }),
2507
+ M ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: M }) : null
2508
2508
  ] }),
2509
2509
  /* @__PURE__ */ e(
2510
- Q,
2510
+ j,
2511
2511
  {
2512
2512
  variant: "light",
2513
- color: F === "negou" ? "red" : F === "passou" ? "green" : "gray",
2514
- children: F === "nao-avaliado" ? "não avaliado" : F
2513
+ color: k === "negou" ? "red" : k === "passou" ? "green" : "gray",
2514
+ children: k === "nao-avaliado" ? "não avaliado" : k
2515
2515
  }
2516
2516
  )
2517
2517
  ] }, i.gate);
2518
2518
  }) }) }) }),
2519
- /* @__PURE__ */ e(ye, { color: f.allowed ? "green" : "red", title: f.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(V, { gap: 6, children: [
2520
- /* @__PURE__ */ e(h, { size: "sm", children: f.message }),
2521
- /* @__PURE__ */ r(h, { size: "xs", ff: "monospace", c: "dimmed", children: [
2519
+ /* @__PURE__ */ e(ce, { color: f.allowed ? "green" : "red", title: f.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(U, { gap: 6, children: [
2520
+ /* @__PURE__ */ e(c, { size: "sm", children: f.message }),
2521
+ /* @__PURE__ */ r(c, { size: "xs", ff: "monospace", c: "dimmed", children: [
2522
2522
  "reasonCode: ",
2523
2523
  f.reasonCode,
2524
2524
  f.deniedAt ? ` · deniedAt: ${f.deniedAt}` : "",
@@ -2528,199 +2528,199 @@ const Ue = (a) => {
2528
2528
  a?.afterDecision?.(f)
2529
2529
  ] }) : null
2530
2530
  ] });
2531
- }, Da = (a) => {
2531
+ }, Oa = (a) => {
2532
2532
  switch (a) {
2533
2533
  case "EFFECTIVE":
2534
- return /* @__PURE__ */ e(Q, { size: "sm", color: "green", variant: "light", children: "vale" });
2534
+ return /* @__PURE__ */ e(j, { size: "sm", color: "green", variant: "light", children: "vale" });
2535
2535
  case "INERT":
2536
- return /* @__PURE__ */ e(Q, { size: "sm", color: "yellow", variant: "light", children: "não vale" });
2536
+ return /* @__PURE__ */ e(j, { size: "sm", color: "yellow", variant: "light", children: "não vale" });
2537
2537
  case "DENIED":
2538
- return /* @__PURE__ */ e(Q, { size: "sm", color: "red", variant: "light", children: "bloqueada" });
2538
+ return /* @__PURE__ */ e(j, { size: "sm", color: "red", variant: "light", children: "bloqueada" });
2539
2539
  default:
2540
- return /* @__PURE__ */ e(Q, { size: "sm", color: "gray", variant: "light", children: "—" });
2540
+ return /* @__PURE__ */ e(j, { size: "sm", color: "gray", variant: "light", children: "—" });
2541
2541
  }
2542
- }, _r = ({ id: a, label: t, slots: n, onSelectUser: s, onSimulate: c }) => {
2542
+ }, at = ({ id: a, label: t, slots: s, onSelectUser: n, onSimulate: u }) => {
2543
2543
  const d = J(
2544
2544
  K.SecurityDiagnostics
2545
- ), [u, x] = T([]), {
2546
- filtro: R,
2547
- setFiltro: m,
2548
- filtrados: v
2549
- } = We(u, (o) => [o.userName, o.email, o.via]), [A, y] = T(!0), [P, f] = T();
2545
+ ), [h, A] = C([]), {
2546
+ filtro: z,
2547
+ setFiltro: g,
2548
+ filtrados: T
2549
+ } = He(h, (o) => [o.userName, o.email, o.via]), [R, S] = C(!0), [D, f] = C();
2550
2550
  ee(() => {
2551
2551
  let o = !1;
2552
- return y(!0), f(void 0), d.getReach(a).then((l) => {
2553
- o || x(l ?? []);
2552
+ return S(!0), f(void 0), d.getReach(a).then((l) => {
2553
+ o || A(l ?? []);
2554
2554
  }).catch((l) => {
2555
2555
  o || f(l instanceof Error ? l.message : "Não foi possível carregar.");
2556
2556
  }).finally(() => {
2557
- o || y(!1);
2557
+ o || S(!1);
2558
2558
  }), () => {
2559
2559
  o = !0;
2560
2560
  };
2561
2561
  }, [d, a]);
2562
- const w = u.filter((o) => o.kind === "ADMINISTRADOR").length;
2563
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2564
- /* @__PURE__ */ r(V, { gap: 4, children: [
2565
- /* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: t }),
2566
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
2562
+ const w = h.filter((o) => o.kind === "ADMINISTRADOR").length;
2563
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2564
+ /* @__PURE__ */ r(U, { gap: 4, children: [
2565
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", ff: "monospace", children: t }),
2566
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
2567
2567
  ] }),
2568
- P ? /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: P }) : null,
2568
+ D ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: D }) : null,
2569
2569
  /* @__PURE__ */ e(
2570
- we,
2570
+ pe,
2571
2571
  {
2572
2572
  title: "Quem alcança",
2573
- hint: A ? "carregando…" : `${u.length} ${u.length === 1 ? "pessoa" : "pessoas"}`,
2574
- children: A ? /* @__PURE__ */ e(le, { size: "sm" }) : u.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(xe, { children: [
2573
+ hint: R ? "carregando…" : `${h.length} ${h.length === 1 ? "pessoa" : "pessoas"}`,
2574
+ children: R ? /* @__PURE__ */ e(se, { size: "sm" }) : h.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(Se, { children: [
2575
2575
  /* @__PURE__ */ e(
2576
2576
  Be,
2577
2577
  {
2578
- value: R,
2579
- onChange: m,
2578
+ value: z,
2579
+ onChange: g,
2580
2580
  assunto: "pessoas",
2581
- visiveis: v.length,
2582
- total: u.length
2581
+ visiveis: T.length,
2582
+ total: h.length
2583
2583
  }
2584
2584
  ),
2585
- /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2586
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2587
- /* @__PURE__ */ e(S.Th, { children: "Pessoa" }),
2588
- /* @__PURE__ */ e(S.Th, { children: "Por qual via" }),
2589
- /* @__PURE__ */ e(S.Th, { children: "Situação" })
2585
+ /* @__PURE__ */ e(Ie, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2586
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2587
+ /* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
2588
+ /* @__PURE__ */ e(m.Th, { children: "Por qual via" }),
2589
+ /* @__PURE__ */ e(m.Th, { children: "Situação" })
2590
2590
  ] }) }),
2591
- /* @__PURE__ */ e(S.Tbody, { children: v.map((o) => /* @__PURE__ */ r(
2592
- S.Tr,
2591
+ /* @__PURE__ */ e(m.Tbody, { children: T.map((o) => /* @__PURE__ */ r(
2592
+ m.Tr,
2593
2593
  {
2594
- style: { cursor: s ? "pointer" : void 0 },
2595
- onClick: () => s?.(o.userId, o.userName),
2594
+ style: { cursor: n ? "pointer" : void 0 },
2595
+ onClick: () => n?.(o.userId, o.userName),
2596
2596
  children: [
2597
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
2598
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: o.userName }),
2599
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.email })
2597
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(U, { gap: 0, children: [
2598
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: o.userName }),
2599
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.email })
2600
2600
  ] }) }),
2601
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(O, { gap: 6, children: [
2602
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: o.via }),
2603
- o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
2601
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(O, { gap: 6, children: [
2602
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: o.via }),
2603
+ o.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
2604
2604
  ] }) }),
2605
- /* @__PURE__ */ e(S.Td, { children: Da(o.situation) })
2605
+ /* @__PURE__ */ e(m.Td, { children: Oa(o.situation) })
2606
2606
  ]
2607
2607
  },
2608
2608
  o.userId
2609
2609
  )) })
2610
2610
  ] }) }),
2611
- w > 0 ? /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", lh: 1.5, children: [
2611
+ w > 0 ? /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", lh: 1.5, children: [
2612
2612
  w === 1 ? "Uma conta alcança" : `${w} contas alcançam`,
2613
2613
  " pelo atalho de administrador — sem concessão nenhuma. Revisar permissões não muda o que elas podem."
2614
2614
  ] }) : null
2615
2615
  ] })
2616
2616
  }
2617
2617
  ),
2618
- n?.afterReachList?.(a, u),
2619
- c ? /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", children: [
2618
+ s?.afterReachList?.(a, h),
2619
+ u ? /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", children: [
2620
2620
  "Para testar uma pessoa específica contra esta capacidade, use ",
2621
2621
  /* @__PURE__ */ e("strong", { children: "Simular" }),
2622
2622
  " na árvore — ela já vem escolhida."
2623
2623
  ] }) : null
2624
2624
  ] });
2625
- }, Sa = ({ id: a, kind: t, slots: n, onSelectUser: s }) => {
2626
- const c = J(
2625
+ }, Sa = ({ id: a, kind: t, slots: s, onSelectUser: n }) => {
2626
+ const u = J(
2627
2627
  K.SecurityDiagnostics
2628
- ), [d, u] = T(), [x, R] = T(!0), [m, v] = T(), {
2629
- filtro: A,
2630
- setFiltro: y,
2631
- filtrados: P
2632
- } = We(d?.members ?? [], (b) => [b.name, b.email, b.profileName ?? void 0]), {
2628
+ ), [d, h] = C(), [A, z] = C(!0), [g, T] = C(), {
2629
+ filtro: R,
2630
+ setFiltro: S,
2631
+ filtrados: D
2632
+ } = He(d?.members ?? [], (v) => [v.name, v.email, v.profileName ?? void 0]), {
2633
2633
  filtro: f,
2634
2634
  setFiltro: w,
2635
2635
  filtrados: o
2636
- } = We(d?.grants ?? [], (b) => [b.resource, b.action]);
2636
+ } = He(d?.grants ?? [], (v) => [v.resource, v.action]);
2637
2637
  if (ee(() => {
2638
- let b = !1;
2639
- return R(!0), v(void 0), (t === "GROUP" ? c.getGroup(a) : c.getProfile(a)).then((E) => {
2640
- b || u(E);
2641
- }).catch((E) => {
2642
- b || v(E instanceof Error ? E.message : "Não foi possível carregar.");
2638
+ let v = !1;
2639
+ return z(!0), T(void 0), (t === "GROUP" ? u.getGroup(a) : u.getProfile(a)).then((y) => {
2640
+ v || h(y);
2641
+ }).catch((y) => {
2642
+ v || T(y instanceof Error ? y.message : "Não foi possível carregar.");
2643
2643
  }).finally(() => {
2644
- b || R(!1);
2644
+ v || z(!1);
2645
2645
  }), () => {
2646
- b = !0;
2646
+ v = !0;
2647
2647
  };
2648
- }, [c, a, t]), x)
2648
+ }, [u, a, t]), A)
2649
2649
  return /* @__PURE__ */ r(O, { gap: 8, children: [
2650
- /* @__PURE__ */ e(le, { size: "sm" }),
2651
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Carregando…" })
2650
+ /* @__PURE__ */ e(se, { size: "sm" }),
2651
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Carregando…" })
2652
2652
  ] });
2653
- if (m)
2654
- return /* @__PURE__ */ e(ye, { color: "red", title: "Erro ao carregar", children: m });
2653
+ if (g)
2654
+ return /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao carregar", children: g });
2655
2655
  if (!d)
2656
2656
  return null;
2657
- const l = t === "GROUP" ? "grupo" : "perfil", p = n?.additionalMemberColumns ?? [];
2658
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2659
- /* @__PURE__ */ r(V, { gap: 4, children: [
2657
+ const l = t === "GROUP" ? "grupo" : "perfil", p = s?.additionalMemberColumns ?? [];
2658
+ return /* @__PURE__ */ r(U, { gap: "lg", children: [
2659
+ /* @__PURE__ */ r(U, { gap: 4, children: [
2660
2660
  /* @__PURE__ */ r(O, { gap: 8, children: [
2661
- /* @__PURE__ */ e(h, { fw: 620, size: "xl", children: d.groupName }),
2662
- /* @__PURE__ */ e(Q, { variant: "light", children: l })
2661
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", children: d.groupName }),
2662
+ /* @__PURE__ */ e(j, { variant: "light", children: l })
2663
2663
  ] }),
2664
- d.description ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: d.description }) : null
2664
+ d.description ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: d.description }) : null
2665
2665
  ] }),
2666
2666
  /* @__PURE__ */ r(
2667
- we,
2667
+ pe,
2668
2668
  {
2669
2669
  title: "Membros",
2670
2670
  hint: `${d.members.length} — o total de cada um soma todas as origens`,
2671
2671
  children: [
2672
- d.members.length === 0 ? /* @__PURE__ */ r(h, { size: "sm", c: "dimmed", children: [
2672
+ d.members.length === 0 ? /* @__PURE__ */ r(c, { size: "sm", c: "dimmed", children: [
2673
2673
  "Ninguém está ",
2674
2674
  t === "GROUP" ? "neste grupo" : "com este perfil",
2675
2675
  "."
2676
- ] }) : /* @__PURE__ */ r(xe, { children: [
2676
+ ] }) : /* @__PURE__ */ r(Se, { children: [
2677
2677
  /* @__PURE__ */ e(
2678
2678
  Be,
2679
2679
  {
2680
- value: A,
2681
- onChange: y,
2680
+ value: R,
2681
+ onChange: S,
2682
2682
  assunto: "pessoas",
2683
- visiveis: P.length,
2683
+ visiveis: D.length,
2684
2684
  total: d.members.length
2685
2685
  }
2686
2686
  ),
2687
- /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2688
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2689
- /* @__PURE__ */ e(S.Th, { children: "Pessoa" }),
2690
- /* @__PURE__ */ e(S.Th, { children: "Perfil" }),
2691
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Concedidas" }),
2692
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Valem" }),
2693
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Não valem" }),
2694
- /* @__PURE__ */ e(S.Th, { ta: "right", children: "Bloqueadas" }),
2695
- p.map((b) => /* @__PURE__ */ e(S.Th, { children: b.header }, b.header))
2687
+ /* @__PURE__ */ e(Ie, { children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2688
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2689
+ /* @__PURE__ */ e(m.Th, { children: "Pessoa" }),
2690
+ /* @__PURE__ */ e(m.Th, { children: "Perfil" }),
2691
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Concedidas" }),
2692
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Valem" }),
2693
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Não valem" }),
2694
+ /* @__PURE__ */ e(m.Th, { ta: "right", children: "Bloqueadas" }),
2695
+ p.map((v) => /* @__PURE__ */ e(m.Th, { children: v.header }, v.header))
2696
2696
  ] }) }),
2697
- /* @__PURE__ */ e(S.Tbody, { children: P.map((b) => /* @__PURE__ */ r(
2698
- S.Tr,
2697
+ /* @__PURE__ */ e(m.Tbody, { children: D.map((v) => /* @__PURE__ */ r(
2698
+ m.Tr,
2699
2699
  {
2700
- style: { cursor: s ? "pointer" : void 0 },
2701
- onClick: () => s?.(b.userId, b.name),
2700
+ style: { cursor: n ? "pointer" : void 0 },
2701
+ onClick: () => n?.(v.userId, v.name),
2702
2702
  children: [
2703
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
2703
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(U, { gap: 0, children: [
2704
2704
  /* @__PURE__ */ r(O, { gap: 6, children: [
2705
- /* @__PURE__ */ e(h, { size: "sm", fw: 550, children: b.name }),
2706
- b.administrator ? /* @__PURE__ */ e(Q, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
2707
- b.enabled ? null : /* @__PURE__ */ e(Q, { size: "xs", color: "red", variant: "light", children: "desativada" })
2705
+ /* @__PURE__ */ e(c, { size: "sm", fw: 550, children: v.name }),
2706
+ v.administrator ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
2707
+ v.enabled ? null : /* @__PURE__ */ e(j, { size: "xs", color: "red", variant: "light", children: "desativada" })
2708
2708
  ] }),
2709
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.email })
2709
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: v.email })
2710
2710
  ] }) }),
2711
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: b.profileName ?? "—" }) }),
2712
- /* @__PURE__ */ e(S.Td, { ta: "right", children: b.total }),
2713
- /* @__PURE__ */ e(S.Td, { ta: "right", c: "green", children: b.effective }),
2714
- /* @__PURE__ */ e(S.Td, { ta: "right", c: "yellow.7", children: b.inert }),
2715
- /* @__PURE__ */ e(S.Td, { ta: "right", c: "red", children: b.denied }),
2716
- p.map((L) => /* @__PURE__ */ e(S.Td, { children: L.render(b, d) }, L.header))
2711
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: v.profileName ?? "—" }) }),
2712
+ /* @__PURE__ */ e(m.Td, { ta: "right", children: v.total }),
2713
+ /* @__PURE__ */ e(m.Td, { ta: "right", c: "green", children: v.effective }),
2714
+ /* @__PURE__ */ e(m.Td, { ta: "right", c: "yellow.7", children: v.inert }),
2715
+ /* @__PURE__ */ e(m.Td, { ta: "right", c: "red", children: v.denied }),
2716
+ p.map(($) => /* @__PURE__ */ e(m.Td, { children: $.render(v, d) }, $.header))
2717
2717
  ]
2718
2718
  },
2719
- b.userId
2719
+ v.userId
2720
2720
  )) })
2721
2721
  ] }) })
2722
2722
  ] }),
2723
- /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", lh: 1.5, children: [
2723
+ /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", lh: 1.5, children: [
2724
2724
  "O total do membro não é o total ",
2725
2725
  t === "GROUP" ? "do grupo" : "do perfil",
2726
2726
  ": ele soma o que vem de outras vias. Clique numa pessoa para ver a lista dela."
@@ -2728,7 +2728,7 @@ const Ue = (a) => {
2728
2728
  ]
2729
2729
  }
2730
2730
  ),
2731
- /* @__PURE__ */ e(we, { title: `O que este ${l} concede`, hint: "a parte que é responsabilidade dele", children: d.grants.length === 0 ? /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(xe, { children: [
2731
+ /* @__PURE__ */ e(pe, { title: `O que este ${l} concede`, hint: "a parte que é responsabilidade dele", children: d.grants.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(Se, { children: [
2732
2732
  /* @__PURE__ */ e(
2733
2733
  Be,
2734
2734
  {
@@ -2739,30 +2739,30 @@ const Ue = (a) => {
2739
2739
  total: d.grants.length
2740
2740
  }
2741
2741
  ),
2742
- /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ r(S, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
2743
- /* @__PURE__ */ e(S.Thead, { children: /* @__PURE__ */ r(S.Tr, { children: [
2744
- /* @__PURE__ */ e(S.Th, { children: "Capacidade" }),
2745
- /* @__PURE__ */ e(S.Th, { children: "Situação" })
2742
+ /* @__PURE__ */ e(Ie, { children: /* @__PURE__ */ r(m, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
2743
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
2744
+ /* @__PURE__ */ e(m.Th, { children: "Capacidade" }),
2745
+ /* @__PURE__ */ e(m.Th, { children: "Situação" })
2746
2746
  ] }) }),
2747
- /* @__PURE__ */ e(S.Tbody, { children: o.map((b, L) => /* @__PURE__ */ r(S.Tr, { children: [
2748
- /* @__PURE__ */ e(S.Td, { children: /* @__PURE__ */ r(h, { size: "sm", ff: "monospace", children: [
2749
- b.resource,
2747
+ /* @__PURE__ */ e(m.Tbody, { children: o.map((v, $) => /* @__PURE__ */ r(m.Tr, { children: [
2748
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ r(c, { size: "sm", ff: "monospace", children: [
2749
+ v.resource,
2750
2750
  " · ",
2751
- b.action
2751
+ v.action
2752
2752
  ] }) }),
2753
- /* @__PURE__ */ e(S.Td, { children: Da(b.situation) })
2754
- ] }, `${b.resource}-${b.action}-${L}`)) })
2753
+ /* @__PURE__ */ e(m.Td, { children: Oa(v.situation) })
2754
+ ] }, `${v.resource}-${v.action}-${$}`)) })
2755
2755
  ] }) })
2756
2756
  ] }) }),
2757
- n?.afterGroupMembers?.(d)
2757
+ s?.afterGroupMembers?.(d)
2758
2758
  ] });
2759
2759
  }, xa = 50, aa = [
2760
2760
  { branch: "USERS", label: "Pessoas" },
2761
2761
  { branch: "GROUPS", label: "Grupos" },
2762
2762
  { branch: "PROFILES", label: "Perfis" },
2763
2763
  { branch: "RESOURCES", label: "Recursos" }
2764
- ], ra = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 }, et = ({ aberta: a }) => /* @__PURE__ */ e(
2765
- _,
2764
+ ], ra = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 }, rt = ({ aberta: a }) => /* @__PURE__ */ e(
2765
+ Y,
2766
2766
  {
2767
2767
  "aria-hidden": !0,
2768
2768
  style: {
@@ -2774,7 +2774,7 @@ const Ue = (a) => {
2774
2774
  justifyContent: "center"
2775
2775
  },
2776
2776
  children: /* @__PURE__ */ e(
2777
- _,
2777
+ Y,
2778
2778
  {
2779
2779
  style: {
2780
2780
  width: 0,
@@ -2790,71 +2790,71 @@ const Ue = (a) => {
2790
2790
  }
2791
2791
  )
2792
2792
  }
2793
- ), at = ({ selected: a, onSelect: t }) => {
2794
- const n = J(
2793
+ ), tt = ({ selected: a, onSelect: t }) => {
2794
+ const s = J(
2795
2795
  K.SecurityDiagnostics
2796
- ), [s, c] = T(""), [d] = ia(s, 300), [u, x] = T({}), [R, m] = T({}), v = (o, l) => l ? `${o}:${l}` : o, A = ae(
2796
+ ), [n, u] = C(""), [d] = oa(n, 300), [h, A] = C({}), [z, g] = C({}), T = (o, l) => l ? `${o}:${l}` : o, R = ae(
2797
2797
  async (o, l, p) => {
2798
- const b = v(o, l), L = R[b] ?? ra;
2799
- if (L.carregando || p && L.carregouTudo)
2798
+ const v = T(o, l), $ = z[v] ?? ra;
2799
+ if ($.carregando || p && $.carregouTudo)
2800
2800
  return;
2801
- const E = p ? Math.floor(L.nodes.length / xa) : 0;
2802
- m((i) => ({ ...i, [b]: { ...i[b] ?? ra, carregando: !0, erro: void 0 } }));
2801
+ const y = p ? Math.floor($.nodes.length / xa) : 0;
2802
+ g((i) => ({ ...i, [v]: { ...i[v] ?? ra, carregando: !0, erro: void 0 } }));
2803
2803
  try {
2804
- const i = await n.browse(o, {
2804
+ const i = await s.browse(o, {
2805
2805
  parentId: l,
2806
2806
  q: d || void 0,
2807
- page: E,
2807
+ page: y,
2808
2808
  size: xa
2809
2809
  });
2810
- m((N) => {
2811
- const G = [...p ? N[b]?.nodes ?? [] : [], ...i.content ?? []];
2810
+ g((N) => {
2811
+ const M = [...p ? N[v]?.nodes ?? [] : [], ...i.content ?? []];
2812
2812
  return {
2813
2813
  ...N,
2814
- [b]: {
2815
- nodes: G,
2816
- total: i.totalElements ?? G.length,
2814
+ [v]: {
2815
+ nodes: M,
2816
+ total: i.totalElements ?? M.length,
2817
2817
  carregando: !1,
2818
- carregouTudo: G.length >= (i.totalElements ?? 0)
2818
+ carregouTudo: M.length >= (i.totalElements ?? 0)
2819
2819
  }
2820
2820
  };
2821
2821
  });
2822
2822
  } catch (i) {
2823
- m((N) => ({
2823
+ g((N) => ({
2824
2824
  ...N,
2825
- [b]: {
2826
- ...N[b] ?? ra,
2825
+ [v]: {
2826
+ ...N[v] ?? ra,
2827
2827
  carregando: !1,
2828
2828
  erro: i instanceof Error ? i.message : "Não foi possível carregar."
2829
2829
  }
2830
2830
  }));
2831
2831
  }
2832
2832
  },
2833
- [n, d, R]
2833
+ [s, d, z]
2834
2834
  );
2835
2835
  ee(() => {
2836
- if (m({}), d) {
2836
+ if (g({}), d) {
2837
2837
  const o = {};
2838
2838
  aa.forEach((l) => {
2839
2839
  o[l.branch] = !0;
2840
- }), x((l) => ({ ...l, ...o }));
2840
+ }), A((l) => ({ ...l, ...o }));
2841
2841
  }
2842
2842
  }, [d]), ee(() => {
2843
2843
  aa.forEach((o) => {
2844
- u[o.branch] && !R[o.branch] && A(o.branch, void 0, !1);
2844
+ h[o.branch] && !z[o.branch] && R(o.branch, void 0, !1);
2845
2845
  });
2846
- }, [u, R, d]);
2847
- const y = (o) => x((l) => ({ ...l, [o]: !l[o] })), P = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, f = (o, l, p) => {
2848
- const b = v("ACTIONS_OF_RESOURCE", o.id), L = !!u[b], E = R[b], i = a?.kind === o.kind && a?.id === o.id;
2849
- return /* @__PURE__ */ r(_, { children: [
2846
+ }, [h, z, d]);
2847
+ const S = (o) => A((l) => ({ ...l, [o]: !l[o] })), D = (o) => o === "critical" ? "red" : o === "warning" ? "yellow" : void 0, f = (o, l, p) => {
2848
+ const v = T("ACTIONS_OF_RESOURCE", o.id), $ = !!h[v], y = z[v], i = a?.kind === o.kind && a?.id === o.id;
2849
+ return /* @__PURE__ */ r(Y, { children: [
2850
2850
  /* @__PURE__ */ e(
2851
2851
  ze,
2852
2852
  {
2853
2853
  onClick: () => {
2854
- t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (y(b), E || A("ACTIONS_OF_RESOURCE", o.id, !1));
2854
+ t({ kind: o.kind, id: o.id, label: o.label, parentLabel: p }), o.hasChildren && (S(v), y || R("ACTIONS_OF_RESOURCE", o.id, !1));
2855
2855
  },
2856
2856
  "aria-current": i ? "true" : void 0,
2857
- "aria-expanded": o.hasChildren ? L : void 0,
2857
+ "aria-expanded": o.hasChildren ? $ : void 0,
2858
2858
  style: {
2859
2859
  display: "block",
2860
2860
  width: "100%",
@@ -2864,26 +2864,26 @@ const Ue = (a) => {
2864
2864
  background: i ? "var(--mantine-color-blue-light)" : void 0
2865
2865
  },
2866
2866
  children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
2867
- o.severity ? /* @__PURE__ */ e(Q, { size: "xs", circle: !0, color: P(o.severity) }) : /* @__PURE__ */ e(_, { w: 8 }),
2868
- /* @__PURE__ */ e(h, { size: "sm", fw: i ? 600 : 400, truncate: !0, style: { flex: 1 }, children: o.label }),
2869
- o.badge ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", ff: "monospace", children: o.badge }) : null
2867
+ o.severity ? /* @__PURE__ */ e(j, { size: "xs", circle: !0, color: D(o.severity) }) : /* @__PURE__ */ e(Y, { w: 8 }),
2868
+ /* @__PURE__ */ e(c, { size: "sm", fw: i ? 600 : 400, truncate: !0, style: { flex: 1 }, children: o.label }),
2869
+ o.badge ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", ff: "monospace", children: o.badge }) : null
2870
2870
  ] })
2871
2871
  }
2872
2872
  ),
2873
- o.hasChildren && L ? /* @__PURE__ */ r(_, { children: [
2874
- E?.nodes.map((N) => f(N, l + 1, o.label)),
2875
- E?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (l + 1) * 14, py: 4, children: [
2876
- /* @__PURE__ */ e(le, { size: "xs" }),
2877
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
2873
+ o.hasChildren && $ ? /* @__PURE__ */ r(Y, { children: [
2874
+ y?.nodes.map((N) => f(N, l + 1, o.label)),
2875
+ y?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 8 + (l + 1) * 14, py: 4, children: [
2876
+ /* @__PURE__ */ e(se, { size: "xs" }),
2877
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
2878
2878
  ] }) : null,
2879
- E && !E.erro && !E.carregouTudo && !E.carregando && E.total > E.nodes.length ? /* @__PURE__ */ e(
2879
+ y && !y.erro && !y.carregouTudo && !y.carregando && y.total > y.nodes.length ? /* @__PURE__ */ e(
2880
2880
  ze,
2881
2881
  {
2882
- onClick: () => void A("ACTIONS_OF_RESOURCE", o.id, !0),
2882
+ onClick: () => void R("ACTIONS_OF_RESOURCE", o.id, !0),
2883
2883
  style: { paddingLeft: 8 + (l + 1) * 14, paddingTop: 3, paddingBottom: 3 },
2884
- children: /* @__PURE__ */ r(h, { size: "xs", c: "blue", children: [
2884
+ children: /* @__PURE__ */ r(c, { size: "xs", c: "blue", children: [
2885
2885
  "mais ",
2886
- E.total - E.nodes.length,
2886
+ y.total - y.nodes.length,
2887
2887
  " →"
2888
2888
  ] })
2889
2889
  }
@@ -2891,63 +2891,174 @@ const Ue = (a) => {
2891
2891
  ] }) : null
2892
2892
  ] }, `${o.kind}-${o.id}`);
2893
2893
  }, w = ie(() => aa, []);
2894
- return /* @__PURE__ */ r(_, { children: [
2894
+ return /* @__PURE__ */ r(Y, { children: [
2895
2895
  /* @__PURE__ */ e(
2896
- ve,
2896
+ he,
2897
2897
  {
2898
2898
  size: "xs",
2899
2899
  placeholder: "Buscar pessoa, grupo, capacidade…",
2900
- value: s,
2901
- onChange: (o) => c(o.currentTarget.value),
2900
+ value: n,
2901
+ onChange: (o) => u(o.currentTarget.value),
2902
2902
  "aria-label": "Buscar na árvore",
2903
2903
  mb: "xs",
2904
- rightSection: s && s !== d ? /* @__PURE__ */ e(le, { size: "xs" }) : null
2904
+ rightSection: n && n !== d ? /* @__PURE__ */ e(se, { size: "xs" }) : null
2905
2905
  }
2906
2906
  ),
2907
2907
  w.map((o) => {
2908
- const l = !!u[o.branch], p = R[o.branch];
2909
- return /* @__PURE__ */ r(_, { mb: 2, children: [
2908
+ const l = !!h[o.branch], p = z[o.branch];
2909
+ return /* @__PURE__ */ r(Y, { mb: 2, children: [
2910
2910
  /* @__PURE__ */ e(
2911
2911
  ze,
2912
2912
  {
2913
2913
  onClick: () => {
2914
- y(o.branch), p || A(o.branch, void 0, !1);
2914
+ S(o.branch), p || R(o.branch, void 0, !1);
2915
2915
  },
2916
2916
  "aria-expanded": l,
2917
2917
  style: { display: "block", width: "100%", padding: "5px 8px", borderRadius: 5 },
2918
2918
  children: /* @__PURE__ */ r(O, { gap: 7, wrap: "nowrap", children: [
2919
- /* @__PURE__ */ e(et, { aberta: l }),
2920
- /* @__PURE__ */ e(h, { size: "sm", fw: 600, style: { flex: 1 }, children: o.label }),
2921
- p ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", ff: "monospace", children: p.total }) : null
2919
+ /* @__PURE__ */ e(rt, { aberta: l }),
2920
+ /* @__PURE__ */ e(c, { size: "sm", fw: 600, style: { flex: 1 }, children: o.label }),
2921
+ p ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", ff: "monospace", children: p.total }) : null
2922
2922
  ] })
2923
2923
  }
2924
2924
  ),
2925
- l ? /* @__PURE__ */ r(_, { children: [
2926
- p?.erro ? /* @__PURE__ */ e(h, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
2927
- p?.nodes.map((b) => f(b, 1)),
2925
+ l ? /* @__PURE__ */ r(Y, { children: [
2926
+ p?.erro ? /* @__PURE__ */ e(c, { size: "xs", c: "red", pl: 22, py: 4, children: p.erro }) : null,
2927
+ p?.nodes.map((v) => f(v, 1)),
2928
2928
  p?.carregando ? /* @__PURE__ */ r(O, { gap: 6, pl: 22, py: 4, children: [
2929
- /* @__PURE__ */ e(le, { size: "xs" }),
2930
- /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", children: "carregando…" })
2929
+ /* @__PURE__ */ e(se, { size: "xs" }),
2930
+ /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "carregando…" })
2931
2931
  ] }) : null,
2932
2932
  p && !p.erro && !p.carregouTudo && !p.carregando && p.total > p.nodes.length ? /* @__PURE__ */ e(
2933
2933
  ze,
2934
2934
  {
2935
- onClick: () => void A(o.branch, void 0, !0),
2935
+ onClick: () => void R(o.branch, void 0, !0),
2936
2936
  style: { paddingLeft: 22, paddingTop: 3, paddingBottom: 3 },
2937
- children: /* @__PURE__ */ r(h, { size: "xs", c: "blue", children: [
2937
+ children: /* @__PURE__ */ r(c, { size: "xs", c: "blue", children: [
2938
2938
  "mais ",
2939
2939
  p.total - p.nodes.length,
2940
2940
  " →"
2941
2941
  ] })
2942
2942
  }
2943
2943
  ) : null,
2944
- p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(h, { size: "xs", c: "dimmed", pl: 22, py: 4, children: d ? "Nada encontrado." : "Vazio." }) : null
2944
+ p && !p.erro && p.nodes.length === 0 && !p.carregando ? /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", pl: 22, py: 4, children: d ? "Nada encontrado." : "Vazio." }) : null
2945
2945
  ] }) : null
2946
2946
  ] }, o.branch);
2947
2947
  })
2948
2948
  ] });
2949
- }, rt = () => /* @__PURE__ */ e(
2950
- _,
2949
+ }, it = 50, ta = {
2950
+ LOGIN: { label: "Entrou" },
2951
+ LOGIN_FALHOU: { label: "Falha ao entrar", cor: "red" },
2952
+ LOGOUT: { label: "Saiu" },
2953
+ ACESSO_NEGADO: { label: "Acesso negado", cor: "red" },
2954
+ SIMULACAO: { label: "Simulação", cor: "blue" }
2955
+ }, ot = ({ slots: a, onError: t }) => {
2956
+ const s = J(
2957
+ K.SecurityDiagnostics
2958
+ ), [n, u] = C([]), [d, h] = C(1), [A, z] = C(1), [g, T] = C(0), [R, S] = C(""), [D, f] = C(null), [w, o] = C(!1), [l, p] = C(null), [v, $] = C(!1);
2959
+ return ee(() => {
2960
+ let y = !1;
2961
+ o(!0), p(null);
2962
+ const N = setTimeout(() => {
2963
+ s.getAuditEvents({
2964
+ usuario: R || void 0,
2965
+ tipo: D ?? void 0,
2966
+ page: d - 1,
2967
+ size: it
2968
+ }).then((k) => {
2969
+ y || (u(k.content ?? []), T(k.totalElements ?? 0), z(Math.max(k.totalPages ?? 1, 1)), $(!1));
2970
+ }).catch((k) => {
2971
+ if (y)
2972
+ return;
2973
+ const M = k instanceof Error ? k.message : "Não foi possível ler a trilha.";
2974
+ /404/.test(M) ? ($(!0), u([])) : (p(M), t?.(M));
2975
+ }).finally(() => {
2976
+ y || o(!1);
2977
+ });
2978
+ }, R ? 400 : 0);
2979
+ return () => {
2980
+ y = !0, clearTimeout(N);
2981
+ };
2982
+ }, [s, R, D, d, t]), v ? /* @__PURE__ */ r(ce, { color: "yellow", title: "Trilha desligada", children: [
2983
+ "O servidor está com ",
2984
+ /* @__PURE__ */ e("code", { children: "archbase.security.audit.enabled=false" }),
2985
+ '. Nada é registrado enquanto estiver assim — a lista vazia aqui significaria "nada aconteceu", e não é o caso.'
2986
+ ] }) : /* @__PURE__ */ r(U, { gap: "md", style: { flex: 1, minHeight: 0 }, children: [
2987
+ /* @__PURE__ */ r(U, { gap: 4, children: [
2988
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", children: "Trilha de auditoria" }),
2989
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "O que aconteceu — entradas, falhas, acessos negados e simulações. As outras telas mostram como a segurança está agora; esta mostra o que passou." })
2990
+ ] }),
2991
+ /* @__PURE__ */ r(O, { gap: "xs", align: "flex-end", children: [
2992
+ /* @__PURE__ */ e(
2993
+ he,
2994
+ {
2995
+ size: "xs",
2996
+ label: "Pessoa",
2997
+ placeholder: "e-mail ou parte dele",
2998
+ value: R,
2999
+ onChange: (y) => {
3000
+ S(y.currentTarget.value), h(1);
3001
+ },
3002
+ style: { minWidth: 220 }
3003
+ }
3004
+ ),
3005
+ /* @__PURE__ */ e(
3006
+ er,
3007
+ {
3008
+ size: "xs",
3009
+ label: "Tipo",
3010
+ placeholder: "todos",
3011
+ clearable: !0,
3012
+ value: D,
3013
+ onChange: (y) => {
3014
+ f(y ?? null), h(1);
3015
+ },
3016
+ data: Object.entries(ta).map(([y, { label: i }]) => ({ value: y, label: i })),
3017
+ style: { minWidth: 180 }
3018
+ }
3019
+ ),
3020
+ /* @__PURE__ */ r(j, { variant: "light", children: [
3021
+ g,
3022
+ " ",
3023
+ g === 1 ? "evento" : "eventos"
3024
+ ] }),
3025
+ w ? /* @__PURE__ */ e(se, { size: "xs" }) : null
3026
+ ] }),
3027
+ l ? /* @__PURE__ */ e(ce, { color: "red", title: "Erro ao ler a trilha", children: l }) : null,
3028
+ !w && !l && n.length === 0 ? /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Nenhum evento no período." }) : null,
3029
+ n.length > 0 ? /* @__PURE__ */ e(pe, { title: "Eventos", hint: "do mais recente para o mais antigo", children: /* @__PURE__ */ e(Ie, { maxHeight: "calc(100vh - 420px)", children: /* @__PURE__ */ r(m, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
3030
+ /* @__PURE__ */ e(m.Thead, { children: /* @__PURE__ */ r(m.Tr, { children: [
3031
+ /* @__PURE__ */ e(m.Th, { children: "Quando" }),
3032
+ /* @__PURE__ */ e(m.Th, { children: "O quê" }),
3033
+ /* @__PURE__ */ e(m.Th, { children: "Quem" }),
3034
+ /* @__PURE__ */ e(m.Th, { children: "Sobre" }),
3035
+ /* @__PURE__ */ e(m.Th, { children: "Por quê" }),
3036
+ /* @__PURE__ */ e(m.Th, { children: "Origem" })
3037
+ ] }) }),
3038
+ /* @__PURE__ */ e(m.Tbody, { children: n.map((y) => /* @__PURE__ */ r(m.Tr, { children: [
3039
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", children: nt(y.dataHora) }) }),
3040
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(j, { size: "sm", variant: "light", color: ta[y.tipo]?.cor, children: ta[y.tipo]?.label ?? y.tipo }) }),
3041
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "sm", children: y.usuario ?? "—" }) }),
3042
+ /* @__PURE__ */ e(m.Td, { children: y.recurso || y.acao ? /* @__PURE__ */ r(c, { size: "xs", ff: "monospace", children: [
3043
+ y.recurso,
3044
+ " · ",
3045
+ y.acao
3046
+ ] }) : /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: "—" }) }),
3047
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: y.detalhe ?? "—" }) }),
3048
+ /* @__PURE__ */ e(m.Td, { children: /* @__PURE__ */ e(c, { size: "xs", c: "dimmed", children: y.origem ?? "—" }) })
3049
+ ] }, y.id)) })
3050
+ ] }) }) }) : null,
3051
+ A > 1 ? /* @__PURE__ */ e(O, { justify: "center", children: /* @__PURE__ */ e(ka, { value: d, onChange: h, total: A, size: "sm" }) }) : null,
3052
+ a?.afterAuditTrail?.(n)
3053
+ ] });
3054
+ }, nt = (a) => {
3055
+ try {
3056
+ return new Date(a).toLocaleString();
3057
+ } catch {
3058
+ return a;
3059
+ }
3060
+ }, st = () => /* @__PURE__ */ e(
3061
+ Y,
2951
3062
  {
2952
3063
  "aria-hidden": !0,
2953
3064
  style: {
@@ -2958,67 +3069,69 @@ const Ue = (a) => {
2958
3069
  borderBottom: "4px solid transparent"
2959
3070
  }
2960
3071
  }
2961
- ), Ta = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, Aa = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, ft = ({
3072
+ ), Aa = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, Ra = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, lt = { kind: "AUDIT", id: "audit", label: "Trilha de auditoria" }, Ct = ({
2962
3073
  height: a = "100%",
2963
3074
  width: t = "100%",
2964
- slots: n,
2965
- onError: s
3075
+ slots: s,
3076
+ onError: n
2966
3077
  }) => {
2967
- const [c, d] = T(Ta), [u, x] = T([]), [R, m] = T({}), v = ae((w) => {
2968
- d((o) => o.kind === w.kind && o.id === w.id ? o : (x((l) => [...l, o]), w)), w.kind === "USER" && m((o) => ({ ...o, userId: w.id, userLabel: w.label })), w.kind === "ACTION" && m((o) => ({ ...o, action: w.label, resource: w.parentLabel }));
2969
- }, []), A = ae(() => {
2970
- x((w) => {
3078
+ const [u, d] = C(Aa), [h, A] = C([]), [z, g] = C({}), T = ae((w) => {
3079
+ d((o) => o.kind === w.kind && o.id === w.id ? o : (A((l) => [...l, o]), w)), w.kind === "USER" && g((o) => ({ ...o, userId: w.id, userLabel: w.label })), w.kind === "ACTION" && g((o) => ({ ...o, action: w.label, resource: w.parentLabel }));
3080
+ }, []), R = ae(() => {
3081
+ A((w) => {
2971
3082
  const o = w[w.length - 1];
2972
3083
  return o ? (d(o), w.slice(0, -1)) : w;
2973
3084
  });
2974
- }, []), y = ae(
2975
- (w, o) => v({ kind: "USER", id: w, label: o }),
2976
- [v]
2977
- ), P = (w) => /* @__PURE__ */ e(
3085
+ }, []), S = ae(
3086
+ (w, o) => T({ kind: "USER", id: w, label: o }),
3087
+ [T]
3088
+ ), D = (w) => /* @__PURE__ */ e(
2978
3089
  ze,
2979
3090
  {
2980
- onClick: () => v(w),
2981
- "aria-current": c.kind === w.kind ? "true" : void 0,
3091
+ onClick: () => T(w),
3092
+ "aria-current": u.kind === w.kind ? "true" : void 0,
2982
3093
  style: {
2983
3094
  display: "block",
2984
3095
  width: "100%",
2985
3096
  padding: "6px 8px",
2986
3097
  borderRadius: 5,
2987
- background: c.kind === w.kind ? "var(--mantine-color-blue-light)" : void 0
3098
+ background: u.kind === w.kind ? "var(--mantine-color-blue-light)" : void 0
2988
3099
  },
2989
- children: /* @__PURE__ */ e(h, { size: "sm", fw: c.kind === w.kind ? 600 : 500, children: w.label })
3100
+ children: /* @__PURE__ */ e(c, { size: "sm", fw: u.kind === w.kind ? 600 : 500, children: w.label })
2990
3101
  },
2991
3102
  w.id
2992
3103
  ), f = () => {
2993
- switch (c.kind) {
3104
+ switch (u.kind) {
2994
3105
  case "OVERVIEW":
2995
- return /* @__PURE__ */ e(ba, { slots: n, onError: s });
3106
+ return /* @__PURE__ */ e(va, { slots: s, onError: n });
2996
3107
  case "SIMULATE":
2997
- return /* @__PURE__ */ e(Yr, { slots: n, onError: s, initial: R });
3108
+ return /* @__PURE__ */ e(et, { slots: s, onError: n, initial: z });
3109
+ case "AUDIT":
3110
+ return /* @__PURE__ */ e(ot, { slots: s, onError: n });
2998
3111
  case "USER":
2999
- return /* @__PURE__ */ e(Jr, { slots: n, onError: s, userId: c.id });
3112
+ return /* @__PURE__ */ e(_r, { slots: s, onError: n, userId: u.id });
3000
3113
  case "GROUP":
3001
- return /* @__PURE__ */ e(Sa, { id: c.id, kind: "GROUP", slots: n, onSelectUser: y });
3114
+ return /* @__PURE__ */ e(Sa, { id: u.id, kind: "GROUP", slots: s, onSelectUser: S });
3002
3115
  case "PROFILE":
3003
- return /* @__PURE__ */ e(Sa, { id: c.id, kind: "PROFILE", slots: n, onSelectUser: y });
3116
+ return /* @__PURE__ */ e(Sa, { id: u.id, kind: "PROFILE", slots: s, onSelectUser: S });
3004
3117
  case "ACTION":
3005
3118
  return /* @__PURE__ */ e(
3006
- _r,
3119
+ at,
3007
3120
  {
3008
- id: c.id,
3009
- label: c.parentLabel ? `${c.parentLabel} · ${c.label}` : c.label,
3010
- slots: n,
3011
- onSelectUser: y,
3012
- onSimulate: () => v(Aa)
3121
+ id: u.id,
3122
+ label: u.parentLabel ? `${u.parentLabel} · ${u.label}` : u.label,
3123
+ slots: s,
3124
+ onSelectUser: S,
3125
+ onSimulate: () => T(Ra)
3013
3126
  }
3014
3127
  );
3015
3128
  case "RESOURCE":
3016
- return /* @__PURE__ */ r(V, { gap: "xs", children: [
3017
- /* @__PURE__ */ e(h, { fw: 620, size: "xl", ff: "monospace", children: c.label }),
3018
- /* @__PURE__ */ e(h, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
3129
+ return /* @__PURE__ */ r(U, { gap: "xs", children: [
3130
+ /* @__PURE__ */ e(c, { fw: 620, size: "xl", ff: "monospace", children: u.label }),
3131
+ /* @__PURE__ */ e(c, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
3019
3132
  ] });
3020
3133
  default:
3021
- return /* @__PURE__ */ e(ba, { slots: n, onError: s });
3134
+ return /* @__PURE__ */ e(va, { slots: s, onError: n });
3022
3135
  }
3023
3136
  };
3024
3137
  return (
@@ -3026,7 +3139,7 @@ const Ue = (a) => {
3026
3139
  // não uma fração de doze, e o `minmax(0, 1fr)` é o que impede uma tabela larga no painel de
3027
3140
  // empurrar a árvore para fora da tela.
3028
3141
  /* @__PURE__ */ r(
3029
- _,
3142
+ Y,
3030
3143
  {
3031
3144
  style: {
3032
3145
  width: t,
@@ -3049,14 +3162,15 @@ const Ue = (a) => {
3049
3162
  radius: "md",
3050
3163
  p: "xs",
3051
3164
  style: { display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden" },
3052
- children: /* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
3053
- n?.renderUserSearch ? /* @__PURE__ */ e(_, { mb: 4, children: n.renderUserSearch(
3054
- (w) => v({ kind: "USER", id: w, label: w })
3165
+ children: /* @__PURE__ */ r(U, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
3166
+ s?.renderUserSearch ? /* @__PURE__ */ e(Y, { mb: 4, children: s.renderUserSearch(
3167
+ (w) => T({ kind: "USER", id: w, label: w })
3055
3168
  ) }) : null,
3056
- P(Ta),
3057
- P(Aa),
3058
- /* @__PURE__ */ e(_, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
3059
- /* @__PURE__ */ e(de, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(at, { selected: c, onSelect: v }) })
3169
+ D(Aa),
3170
+ D(Ra),
3171
+ D(lt),
3172
+ /* @__PURE__ */ e(Y, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
3173
+ /* @__PURE__ */ e(ue, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(tt, { selected: u, onSelect: T }) })
3060
3174
  ] })
3061
3175
  }
3062
3176
  ),
@@ -3068,24 +3182,24 @@ const Ue = (a) => {
3068
3182
  p: "md",
3069
3183
  style: { minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden" },
3070
3184
  children: [
3071
- u.length > 0 ? /* @__PURE__ */ r(O, { gap: 6, mb: "xs", style: { flexShrink: 0 }, children: [
3185
+ h.length > 0 ? /* @__PURE__ */ r(O, { gap: 6, mb: "xs", style: { flexShrink: 0 }, children: [
3072
3186
  /* @__PURE__ */ e(
3073
3187
  X,
3074
3188
  {
3075
3189
  size: "compact-sm",
3076
3190
  variant: "subtle",
3077
- onClick: A,
3078
- leftSection: /* @__PURE__ */ e(rt, {}),
3191
+ onClick: R,
3192
+ leftSection: /* @__PURE__ */ e(st, {}),
3079
3193
  "aria-label": "Voltar para o item anterior",
3080
3194
  children: "Voltar"
3081
3195
  }
3082
3196
  ),
3083
- /* @__PURE__ */ r(h, { size: "xs", c: "dimmed", truncate: !0, children: [
3197
+ /* @__PURE__ */ r(c, { size: "xs", c: "dimmed", truncate: !0, children: [
3084
3198
  "para ",
3085
- u[u.length - 1]?.label
3199
+ h[h.length - 1]?.label
3086
3200
  ] })
3087
3201
  ] }) : null,
3088
- /* @__PURE__ */ e(_, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: f() })
3202
+ /* @__PURE__ */ e(Y, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: f() })
3089
3203
  ]
3090
3204
  }
3091
3205
  )
@@ -3095,29 +3209,29 @@ const Ue = (a) => {
3095
3209
  );
3096
3210
  };
3097
3211
  export {
3098
- _r as ActionNodePanel,
3099
- Er as ApiTokenModal,
3100
- gt as ArchbaseApiTokenView,
3101
- Tr as ArchbaseDualListSelector,
3102
- ft as ArchbaseSecurityDiagnosticsView,
3103
- mt as ArchbaseSecurityView,
3104
- Ur as AttributeList,
3105
- Jr as EffectiveAccessPanel,
3106
- Gr as FlagStrip,
3107
- kr as GroupModal,
3212
+ at as ActionNodePanel,
3213
+ Dr as ApiTokenModal,
3214
+ wt as ArchbaseApiTokenView,
3215
+ Rr as ArchbaseDualListSelector,
3216
+ Ct as ArchbaseSecurityDiagnosticsView,
3217
+ Tt as ArchbaseSecurityView,
3218
+ Hr as AttributeList,
3219
+ _r as EffectiveAccessPanel,
3220
+ Br as FlagStrip,
3221
+ Er as GroupModal,
3108
3222
  Sa as GroupNodePanel,
3109
- Mr as MetricCard,
3110
- Vr as MetricCards,
3223
+ Ur as MetricCard,
3224
+ Gr as MetricCards,
3111
3225
  Wr as OverviewItemsDrawer,
3112
- ba as OverviewPanel,
3226
+ va as OverviewPanel,
3113
3227
  Xe as PermissionsSelectorModal,
3114
- xr as ProfileModal,
3115
- Ar as RenderProfileUserItem,
3116
- we as Section,
3117
- at as SecurityTree,
3118
- Yr as SimulationPanel,
3119
- Oe as TabelaRolavel,
3120
- zr as UserModal,
3121
- Ue as severityColor,
3122
- Da as situacaoBadge
3228
+ Ar as ProfileModal,
3229
+ zr as RenderProfileUserItem,
3230
+ pe as Section,
3231
+ tt as SecurityTree,
3232
+ et as SimulationPanel,
3233
+ Ie as TabelaRolavel,
3234
+ Ir as UserModal,
3235
+ Ge as severityColor,
3236
+ Oa as situacaoBadge
3123
3237
  };