@archbase/security-ui 4.2.0 → 4.2.1

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,18 +1,18 @@
1
1
  import { jsx as e, jsxs as r, Fragment as Pe } from "react/jsx-runtime";
2
- import { Modal as Oe, ScrollArea as Ce, Stack as V, Grid as W, Group as N, Button as Y, Paper as _, Box as re, Text as d, List as Ve, Checkbox as ia, Tooltip as Re, ActionIcon as le, Flex as De, Space as ya, Input as Te, useTree as oa, useMantineColorScheme as Ue, TextInput as me, Tree as na, Badge as j, Tabs as ye, RingProgress as Ba, SimpleGrid as Be, Drawer as Wa, Loader as ce, Alert as fe, Table as y, Pagination as qa, Chip as sa, UnstyledButton as Ee } from "@mantine/core";
3
- import { getI18nextInstance as g, resolveArchbasePasswordPolicy as Ha, ARCHBASE_IOC_API_TYPE as Q, emit as Ge, builder as Fe, validateArchbasePassword as ja, convertDateToISOString as Za, processErrorMessage as ge, getKeyByEnumValue as we, useArchbaseTheme as aa, useArchbaseValidator as Ka, useArchbaseTranslation as Qa, useValidationErrors as Ja, processDetailErrorMessage as Me } from "@archbase/core";
4
- import { ArchbaseEdit as ne, ArchbaseNotifications as te, ArchbasePasswordEdit as Xa, ArchbaseSelect as Ya, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as _a, ArchbaseAsyncSelect as er, Columns as Ie, ArchbaseDataGridColumn as P, ArchbaseDataGrid as wa, ArchbaseDialog as pe } from "@archbase/components";
5
- import { useArchbaseV1V2Compatibility as Ne, useArchbaseDataSourceListener as la, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as _e, ArchbaseDataSource as ar, useArchbaseStore as Ca, useArchbaseRemoteDataSourceV2 as ke, useArchbaseDataSource as rr } from "@archbase/data";
6
- import { useState as k, useCallback as oe, useEffect as ee, forwardRef as tr, useMemo as ie, useRef as xe } from "react";
7
- import { IconArrowRight as Sa, IconArrowLeft as Ta, IconChevronDown as ca, IconBorderCornerSquare as da, IconEye as ir, IconEdit as Aa, IconTrashX as ra, IconShieldCheckered as or, IconPlus as xa } from "@tabler/icons-react";
8
- import { UserGroupDto as ua, SecurityType as X, UserDto as nr, GroupDto as sr, ProfileDto as lr, ApiTokenDto as cr } from "@archbase/security";
9
- import { DateTimePicker as dr } from "@mantine/dates";
10
- import { useFocusTrap as ur, useDebouncedValue as ea } from "@mantine/hooks";
11
- import { ArchbaseSpaceFixed as hr, ArchbaseSpaceFill as pr, ArchbaseSpaceBottom as mr } from "@archbase/layout";
12
- const gr = (a) => {
2
+ import { Modal as Oe, ScrollArea as fe, Stack as L, Grid as W, Group as N, Button as Y, Paper as _, Box as ae, Text as p, List as Le, Checkbox as oa, Tooltip as Re, ActionIcon as pe, Flex as De, Space as wa, Input as Te, useTree as na, useMantineColorScheme as Be, TextInput as me, Tree as sa, Badge as Z, Tabs as we, RingProgress as Wa, SimpleGrid as We, Table as y, Drawer as qa, Loader as le, Alert as be, Pagination as Ha, Chip as la, UnstyledButton as Ee } from "@mantine/core";
3
+ import { getI18nextInstance as g, resolveArchbasePasswordPolicy as ja, ARCHBASE_IOC_API_TYPE as Q, emit as Me, builder as Fe, validateArchbasePassword as Za, convertDateToISOString as Ka, processErrorMessage as ge, getKeyByEnumValue as Ce, useArchbaseTheme as ra, useArchbaseValidator as Qa, useArchbaseTranslation as Ja, useValidationErrors as Xa, processDetailErrorMessage as Ve } from "@archbase/core";
4
+ import { ArchbaseEdit as ne, ArchbaseNotifications as te, ArchbasePasswordEdit as Ya, ArchbaseSelect as _a, ArchbaseCheckbox as Ae, ArchbaseAvatarEdit as er, ArchbaseAsyncSelect as ar, Columns as ke, ArchbaseDataGridColumn as P, ArchbaseDataGrid as Ca, ArchbaseDialog as he } from "@archbase/components";
5
+ import { useArchbaseV1V2Compatibility as Ne, useArchbaseDataSourceListener as ca, useArchbaseRemoteServiceApi as J, useArchbaseRemoteDataSource as ea, ArchbaseDataSource as rr, useArchbaseStore as Sa, useArchbaseRemoteDataSourceV2 as Ie, useArchbaseDataSource as tr } from "@archbase/data";
6
+ import { useState as z, useCallback as oe, useEffect as ee, forwardRef as ir, useMemo as ie, useRef as xe } from "react";
7
+ import { IconArrowRight as Ta, IconArrowLeft as Aa, IconChevronDown as da, IconBorderCornerSquare as ua, IconEye as or, IconEdit as xa, IconTrashX as ta, IconShieldCheckered as nr, IconPlus as Ra } from "@tabler/icons-react";
8
+ import { UserGroupDto as ha, SecurityType as X, UserDto as sr, GroupDto as lr, ProfileDto as cr, ApiTokenDto as dr } from "@archbase/security";
9
+ import { DateTimePicker as ur } from "@mantine/dates";
10
+ import { useFocusTrap as hr, useDebouncedValue as aa } from "@mantine/hooks";
11
+ import { ArchbaseSpaceFixed as pr, ArchbaseSpaceFill as mr, ArchbaseSpaceBottom as gr } from "@archbase/layout";
12
+ const fr = (a) => {
13
13
  const t = { ...a.options ?? {} }, o = () => {
14
- a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (p) => {
15
- p && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), p);
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
17
  }, i = () => {
18
18
  a.onClickCancel(a.dataSource.getCurrentRecord());
@@ -25,7 +25,7 @@ const gr = (a) => {
25
25
  title: g().t("archbase:Perfil"),
26
26
  size: "60%",
27
27
  styles: { content: { maxWidth: 1e3 } },
28
- children: /* @__PURE__ */ e(Ce, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
28
+ children: /* @__PURE__ */ e(fe, { style: { height: "460px" }, children: /* @__PURE__ */ r(L, { w: "98%", children: [
29
29
  t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
30
30
  /* @__PURE__ */ r(W, { children: [
31
31
  /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e(
@@ -56,18 +56,18 @@ const gr = (a) => {
56
56
  }
57
57
  );
58
58
  };
59
- function fr({
59
+ function br({
60
60
  availableItemsDS: a,
61
61
  assignedItemsDS: t,
62
62
  idFieldAvailable: o,
63
63
  labelFieldAvailable: i,
64
- idFieldAssigned: p,
65
- labelFieldAssigned: u,
64
+ idFieldAssigned: u,
65
+ labelFieldAssigned: h,
66
66
  handleCreateAssociationObject: c,
67
67
  width: I = "400px",
68
- height: A = "200px",
68
+ height: x = "200px",
69
69
  titleAvailable: f = "Disponíveis",
70
- titleAssigned: S = "Selecionados"
70
+ titleAssigned: C = "Selecionados"
71
71
  }) {
72
72
  Ne(
73
73
  "ArchbaseDualListSelector-Available",
@@ -75,47 +75,47 @@ function fr({
75
75
  void 0,
76
76
  []
77
77
  );
78
- const T = Ne(
78
+ const S = Ne(
79
79
  "ArchbaseDualListSelector-Assigned",
80
80
  t,
81
81
  void 0,
82
82
  []
83
- ), [n, s] = k([]), [w, D] = k([]), [h, l] = k([]), [m, v] = k([]), C = oe(() => {
83
+ ), [n, s] = z([]), [w, D] = z([]), [d, l] = z([]), [m, v] = z([]), T = oe(() => {
84
84
  a && s(a.browseRecords()), t && D(t.browseRecords());
85
85
  }, [a, t]);
86
- la({
86
+ ca({
87
87
  dataSource: a,
88
- listener: () => C()
89
- }), la({
88
+ listener: () => T()
89
+ }), ca({
90
90
  dataSource: t,
91
- listener: () => C()
91
+ listener: () => T()
92
92
  }), ee(() => {
93
- C();
94
- }, [C]);
95
- const z = (E, O) => typeof O == "function" ? O(E) : E[O], b = (E, O) => typeof O == "function" ? O(E) : E[O], K = (E, O) => {
93
+ T();
94
+ }, [T]);
95
+ const A = (E, O) => typeof O == "function" ? O(E) : E[O], b = (E, O) => typeof O == "function" ? O(E) : E[O], j = (E, O) => {
96
96
  E((F) => F.includes(O) ? F.filter((Se) => Se !== O) : [...F, O]);
97
- }, L = () => {
98
- h.forEach((E) => {
99
- const O = n.find((F) => z(F, o) === E);
97
+ }, G = () => {
98
+ d.forEach((E) => {
99
+ const O = n.find((F) => A(F, o) === E);
100
100
  if (O) {
101
101
  const F = c(O);
102
- T.isDataSourceV2 ? (t.insert(F), t.save()) : (t.insert(F), t.save(), T.v1State.forceUpdate());
102
+ S.isDataSourceV2 ? (t.insert(F), t.save()) : (t.insert(F), t.save(), S.v1State.forceUpdate());
103
103
  }
104
104
  }), l([]);
105
- }, Z = () => {
105
+ }, K = () => {
106
106
  m.forEach((E) => {
107
- const O = w.find((F) => z(F, p) === E);
107
+ const O = w.find((F) => A(F, u) === E);
108
108
  if (O) {
109
- const F = typeof p == "function" ? { customId: p(O) } : { [p]: E };
110
- T.isDataSourceV2 ? t.remove(() => t.locate(F)) : (t.remove(() => t.locate(F)), T.v1State.forceUpdate());
109
+ const F = typeof u == "function" ? { customId: u(O) } : { [u]: E };
110
+ S.isDataSourceV2 ? t.remove(() => t.locate(F)) : (t.remove(() => t.locate(F)), S.v1State.forceUpdate());
111
111
  }
112
112
  }), v([]);
113
113
  };
114
- return /* @__PURE__ */ r(_, { withBorder: !0, style: { display: "flex", width: I, height: A }, children: [
115
- /* @__PURE__ */ r(re, { style: { minWidth: "44%", minHeight: A }, children: [
116
- /* @__PURE__ */ e(d, { children: f }),
114
+ return /* @__PURE__ */ r(_, { withBorder: !0, style: { display: "flex", width: I, height: x }, children: [
115
+ /* @__PURE__ */ r(ae, { style: { minWidth: "44%", minHeight: x }, children: [
116
+ /* @__PURE__ */ e(p, { children: f }),
117
117
  /* @__PURE__ */ e(
118
- Ve,
118
+ Le,
119
119
  {
120
120
  spacing: "xs",
121
121
  size: "sm",
@@ -127,28 +127,28 @@ function fr({
127
127
  overflowX: "hidden",
128
128
  height: "calc(100% - 32px)"
129
129
  },
130
- children: n.map((E) => /* @__PURE__ */ e(Ve.Item, { children: /* @__PURE__ */ e(
131
- ia,
130
+ children: n.map((E) => /* @__PURE__ */ e(Le.Item, { children: /* @__PURE__ */ e(
131
+ oa,
132
132
  {
133
133
  label: b(E, i),
134
- checked: h.includes(z(E, o)),
135
- onChange: () => K(l, z(E, o)),
134
+ checked: d.includes(A(E, o)),
135
+ onChange: () => j(l, A(E, o)),
136
136
  disabled: w.some(
137
- (O) => z(O, p) === z(E, o)
137
+ (O) => A(O, u) === A(E, o)
138
138
  )
139
139
  }
140
- ) }, z(E, o)))
140
+ ) }, A(E, o)))
141
141
  }
142
142
  )
143
143
  ] }),
144
- /* @__PURE__ */ r(V, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
145
- /* @__PURE__ */ e(Re, { label: "Adicionar", children: /* @__PURE__ */ e(le, { onClick: L, disabled: !h.length, children: /* @__PURE__ */ e(Sa, {}) }) }),
146
- /* @__PURE__ */ e(Re, { label: "Remover", children: /* @__PURE__ */ e(le, { onClick: Z, disabled: !m.length, children: /* @__PURE__ */ e(Ta, {}) }) })
144
+ /* @__PURE__ */ r(L, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
145
+ /* @__PURE__ */ e(Re, { label: "Adicionar", children: /* @__PURE__ */ e(pe, { onClick: G, disabled: !d.length, children: /* @__PURE__ */ e(Ta, {}) }) }),
146
+ /* @__PURE__ */ e(Re, { label: "Remover", children: /* @__PURE__ */ e(pe, { onClick: K, disabled: !m.length, children: /* @__PURE__ */ e(Aa, {}) }) })
147
147
  ] }),
148
- /* @__PURE__ */ r(re, { style: { minWidth: "44%", minHeight: A }, children: [
149
- /* @__PURE__ */ e(d, { children: S }),
148
+ /* @__PURE__ */ r(ae, { style: { minWidth: "44%", minHeight: x }, children: [
149
+ /* @__PURE__ */ e(p, { children: C }),
150
150
  /* @__PURE__ */ e(
151
- Ve,
151
+ Le,
152
152
  {
153
153
  spacing: "xs",
154
154
  size: "sm",
@@ -160,25 +160,25 @@ function fr({
160
160
  overflowX: "hidden",
161
161
  height: "calc(100% - 32px)"
162
162
  },
163
- children: w.map((E) => /* @__PURE__ */ e(Ve.Item, { children: /* @__PURE__ */ e(
164
- ia,
163
+ children: w.map((E) => /* @__PURE__ */ e(Le.Item, { children: /* @__PURE__ */ e(
164
+ oa,
165
165
  {
166
- label: b(E, u),
167
- checked: m.includes(z(E, p)),
168
- onChange: () => K(v, z(E, p))
166
+ label: b(E, h),
167
+ checked: m.includes(A(E, u)),
168
+ onChange: () => j(v, A(E, u))
169
169
  }
170
- ) }, z(E, p)))
170
+ ) }, A(E, u)))
171
171
  }
172
172
  )
173
173
  ] })
174
174
  ] });
175
175
  }
176
- const br = tr(
177
- ({ image: a, label: t, description: o, origin: i, ...p }, u) => /* @__PURE__ */ e("div", { ref: u, ...p, children: /* @__PURE__ */ r(De, { children: [
178
- /* @__PURE__ */ e(d, { size: "sm", fw: 600, children: i ? i.name : "" }),
179
- /* @__PURE__ */ e(ya, { w: "lg" })
176
+ const vr = ir(
177
+ ({ image: a, label: t, description: o, origin: i, ...u }, h) => /* @__PURE__ */ e("div", { ref: h, ...u, children: /* @__PURE__ */ r(De, { children: [
178
+ /* @__PURE__ */ e(p, { size: "sm", fw: 600, children: i ? i.name : "" }),
179
+ /* @__PURE__ */ e(wa, { w: "lg" })
180
180
  ] }) })
181
- ), vr = {
181
+ ), yr = {
182
182
  // Campos de identificação
183
183
  showNickname: !0,
184
184
  // Campos de perfil e grupos
@@ -202,16 +202,16 @@ const br = tr(
202
202
  avatarImageQuality: 1,
203
203
  avatarMaxOutputSizePx: 512,
204
204
  allowEditEmail: !0
205
- }, yr = (a) => {
206
- const [t, o] = k(""), i = { ...vr, ...a.options ?? {} }, p = a.dataSource.getFieldValue("passwordChangedAt"), u = p ? new Date(p) : void 0, c = u && !Number.isNaN(u.getTime()) ? u.toLocaleString() : void 0, I = Ha(i.passwordPolicy), A = i.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((l) => {
205
+ }, wr = (a) => {
206
+ const [t, o] = z(""), i = { ...yr, ...a.options ?? {} }, u = a.dataSource.getFieldValue("passwordChangedAt"), h = u ? new Date(u) : void 0, c = h && !Number.isNaN(h.getTime()) ? h.toLocaleString() : void 0, I = ja(i.passwordPolicy), x = i.forbidPersonalDataInPassword ? ["name", "nickname", "email"].map((l) => {
207
207
  const m = a.dataSource.getFieldValue(l);
208
208
  return l === "email" && m ? m.split("@")[0] : m;
209
209
  }).filter((l) => typeof l == "string" && l.trim().length >= 3) : [], f = I ? {
210
210
  ...I,
211
- blocklist: [...I.blocklist ?? [], ...A]
212
- } : void 0, S = J(Q.Group), { dataSource: T } = _e({
211
+ blocklist: [...I.blocklist ?? [], ...x]
212
+ } : void 0, C = J(Q.Group), { dataSource: S } = ea({
213
213
  name: "dsGroups",
214
- service: S,
214
+ service: C,
215
215
  pageSize: 9999,
216
216
  loadOnStart: !0,
217
217
  sort: ["name:asc"],
@@ -220,7 +220,7 @@ const br = tr(
220
220
  }
221
221
  });
222
222
  console.log("versão 12/05/2026");
223
- const n = J(Q.Profile), { dataSource: s } = _e({
223
+ const n = J(Q.Profile), { dataSource: s } = ea({
224
224
  name: "dsProfiles",
225
225
  service: n,
226
226
  pageSize: 9999,
@@ -236,12 +236,12 @@ const br = tr(
236
236
  const w = async () => {
237
237
  if (a.dataSource.isInserting()) {
238
238
  if (i.userDefaultProfile) {
239
- const l = Ge(Fe.eq("name", i.userDefaultProfile)), m = await n.findAllWithFilter(l, 0, 1);
239
+ const l = Me(Fe.eq("name", i.userDefaultProfile)), m = await n.findAllWithFilter(l, 0, 1);
240
240
  m && m.content.length > 0 && a.dataSource.setFieldValue("profile", m.content[0]);
241
241
  }
242
242
  if (i.userDefaultGroups) {
243
- const l = Ge(Fe.in("name", i.userDefaultGroups)), m = await S.findAllWithFilter(l, 0, 500);
244
- m && m.content.length > 0 && a.dataSource.setFieldValue("groups", m.content.map((v) => ua.newInstance(v)));
243
+ const l = Me(Fe.in("name", i.userDefaultGroups)), m = await C.findAllWithFilter(l, 0, 500);
244
+ m && m.content.length > 0 && a.dataSource.setFieldValue("groups", m.content.map((v) => ha.newInstance(v)));
245
245
  }
246
246
  }
247
247
  };
@@ -255,7 +255,7 @@ const br = tr(
255
255
  return;
256
256
  }
257
257
  if (f && l.password) {
258
- const m = ja(l.password, f);
258
+ const m = Za(l.password, f);
259
259
  if (!m.valid) {
260
260
  o(m.error);
261
261
  return;
@@ -264,19 +264,19 @@ const br = tr(
264
264
  a.onCustomSave ? a.onCustomSave(l, (m) => {
265
265
  m && a.onAfterSave && a.onAfterSave(l), a.onClickOk(l, m);
266
266
  }) : a.onClickOk(l, !0);
267
- }, h = () => {
267
+ }, d = () => {
268
268
  a.onClickCancel(a.dataSource.getCurrentRecord());
269
269
  };
270
270
  return /* @__PURE__ */ r(
271
271
  Oe,
272
272
  {
273
273
  opened: a.opened,
274
- onClose: h,
274
+ onClose: d,
275
275
  title: g().t("archbase:Usuário"),
276
276
  size: "80%",
277
277
  styles: { content: { maxWidth: 1e3 } },
278
278
  children: [
279
- /* @__PURE__ */ e(Ce, { style: { height: "500px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
279
+ /* @__PURE__ */ e(fe, { style: { height: "500px" }, children: /* @__PURE__ */ r(L, { w: "98%", children: [
280
280
  i?.customContentBefore && /* @__PURE__ */ e(Pe, { children: i.customContentBefore(a.dataSource.getCurrentRecord()) }),
281
281
  /* @__PURE__ */ r(W, { children: [
282
282
  /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ r(N, { children: [
@@ -327,7 +327,7 @@ const br = tr(
327
327
  }
328
328
  ) }),
329
329
  /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
330
- Xa,
330
+ Ya,
331
331
  {
332
332
  label: `${g().t("archbase:Senha usuário")}`,
333
333
  dataSource: a.dataSource,
@@ -340,7 +340,7 @@ const br = tr(
340
340
  ) })
341
341
  ] }),
342
342
  /* @__PURE__ */ e(W, { children: i.showProfile && /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e(
343
- Ya,
343
+ _a,
344
344
  {
345
345
  label: `${g().t("archbase:Perfil do usuário")}`,
346
346
  dataSource: a.dataSource,
@@ -348,14 +348,14 @@ const br = tr(
348
348
  options: s,
349
349
  allowDeselect: !0,
350
350
  optionsLabelField: "nome",
351
- itemComponent: br,
351
+ itemComponent: vr,
352
352
  getOptionLabel: (l) => l.name,
353
353
  getOptionValue: (l) => l.id
354
354
  }
355
355
  ) }) }),
356
356
  /* @__PURE__ */ r(W, { children: [
357
- /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: i.showAccountConfigLabel && /* @__PURE__ */ e(d, { fz: 14, fw: 500, children: "Informe" }) }),
358
- /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
357
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: i.showAccountConfigLabel && /* @__PURE__ */ e(p, { fz: 14, fw: 500, children: "Informe" }) }),
358
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(L, { gap: "lg", children: [
359
359
  i.showChangePasswordOnNextLogin && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
360
360
  Ae,
361
361
  {
@@ -381,13 +381,13 @@ const br = tr(
381
381
  label: `${g().t("archbase:Senha nunca expira ?")}`
382
382
  }
383
383
  ),
384
- /* @__PURE__ */ e(d, { fz: 12, c: "dimmed", children: g().t(
384
+ /* @__PURE__ */ e(p, { fz: 12, c: "dimmed", children: g().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
- i.showPasswordChangedAt && c && /* @__PURE__ */ e(d, { fz: 12, c: "dimmed", children: `${g().t("archbase:Última troca de senha")}: ${c}` })
388
+ i.showPasswordChangedAt && c && /* @__PURE__ */ e(p, { fz: 12, c: "dimmed", children: `${g().t("archbase:Última troca de senha")}: ${c}` })
389
389
  ] }) }),
390
- /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(V, { gap: "lg", children: [
390
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ r(L, { gap: "lg", children: [
391
391
  i.showAccountDeactivated && /* @__PURE__ */ e(Te.Wrapper, { label: "", children: /* @__PURE__ */ e(
392
392
  Ae,
393
393
  {
@@ -413,8 +413,8 @@ const br = tr(
413
413
  }
414
414
  ) })
415
415
  ] }) }),
416
- /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(V, { gap: "lg", children: /* @__PURE__ */ e(
417
- _a,
416
+ /* @__PURE__ */ e(W.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e(L, { gap: "lg", children: /* @__PURE__ */ e(
417
+ er,
418
418
  {
419
419
  label: g().t("archbase:Foto do usuário"),
420
420
  dataSource: a.dataSource,
@@ -428,13 +428,13 @@ const br = tr(
428
428
  ) }) })
429
429
  ] }),
430
430
  i.showGroups && /* @__PURE__ */ r(W, { children: [
431
- /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(d, { fz: 14, fw: 500, children: "Grupos" }) }),
431
+ /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(p, { fz: 14, fw: 500, children: "Grupos" }) }),
432
432
  /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
433
- fr,
433
+ br,
434
434
  {
435
435
  titleAvailable: g().t("archbase:Disponíveis"),
436
436
  titleAssigned: g().t("archbase:Selecionados"),
437
- assignedItemsDS: new ar("dsDualList", {
437
+ assignedItemsDS: new rr("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 br = tr(
443
443
  }),
444
444
  width: "100%",
445
445
  height: "200px",
446
- availableItemsDS: T,
447
- handleCreateAssociationObject: (l) => ua.newInstance(l),
446
+ availableItemsDS: S,
447
+ handleCreateAssociationObject: (l) => ha.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 : "",
@@ -453,19 +453,19 @@ const br = tr(
453
453
  ) })
454
454
  ] }),
455
455
  i?.customContentAfter && /* @__PURE__ */ e(Pe, { children: i.customContentAfter(a.dataSource.getCurrentRecord()) }),
456
- /* @__PURE__ */ e(ya, { h: "12px" })
456
+ /* @__PURE__ */ e(wa, { h: "12px" })
457
457
  ] }) }),
458
458
  /* @__PURE__ */ r(N, { justify: "flex-end", mt: "md", children: [
459
- /* @__PURE__ */ e(Y, { variant: "default", onClick: h, children: g().t("archbase:Cancelar") }),
459
+ /* @__PURE__ */ e(Y, { variant: "default", onClick: d, children: g().t("archbase:Cancelar") }),
460
460
  /* @__PURE__ */ e(Y, { onClick: D, children: g().t("archbase:Salvar") })
461
461
  ] })
462
462
  ]
463
463
  }
464
464
  );
465
- }, wr = (a) => {
465
+ }, Cr = (a) => {
466
466
  const t = { ...a.options ?? {} }, o = () => {
467
- a.onCustomSave ? a.onCustomSave(a.dataSource.getCurrentRecord(), (p) => {
468
- p && a.onAfterSave && a.onAfterSave(a.dataSource.getCurrentRecord()), a.onClickOk(a.dataSource.getCurrentRecord(), p);
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
470
  }, i = () => {
471
471
  a.onClickCancel(a.dataSource.getCurrentRecord());
@@ -478,7 +478,7 @@ const br = tr(
478
478
  title: g().t("archbase:Grupo"),
479
479
  size: "60%",
480
480
  styles: { content: { maxWidth: 1e3 } },
481
- children: /* @__PURE__ */ e(Ce, { style: { height: "460px" }, children: /* @__PURE__ */ r(V, { w: "98%", children: [
481
+ children: /* @__PURE__ */ e(fe, { style: { height: "460px" }, children: /* @__PURE__ */ r(L, { w: "98%", children: [
482
482
  t?.customContentBefore && t.customContentBefore(a.dataSource.getCurrentRecord()),
483
483
  /* @__PURE__ */ r(W, { children: [
484
484
  /* @__PURE__ */ e(W.Col, { span: { base: 12 }, children: /* @__PURE__ */ e(
@@ -508,33 +508,33 @@ const br = tr(
508
508
  ] }) })
509
509
  }
510
510
  );
511
- }, Cr = ({ image: a, label: t, description: o, ...i }) => /* @__PURE__ */ e("div", { ...i, children: /* @__PURE__ */ r(N, { grow: !0, children: [
511
+ }, Sr = ({ image: a, label: t, description: o, ...i }) => /* @__PURE__ */ e("div", { ...i, children: /* @__PURE__ */ r(N, { grow: !0, children: [
512
512
  /* @__PURE__ */ e("img", { style: { maxWidth: "32px" }, src: a }),
513
513
  /* @__PURE__ */ r("div", { children: [
514
- /* @__PURE__ */ e(d, { size: "sm", children: t }),
515
- /* @__PURE__ */ e(d, { size: "xs", opacity: 0.65, children: o })
514
+ /* @__PURE__ */ e(p, { size: "sm", children: t }),
515
+ /* @__PURE__ */ e(p, { size: "xs", opacity: 0.65, children: o })
516
516
  ] })
517
- ] }) }), Sr = (a) => {
518
- ur();
519
- const [t, o] = k(), i = J(Q.User), p = Ne(
517
+ ] }) }), Tr = (a) => {
518
+ hr();
519
+ const [t, o] = z(), i = J(Q.User), u = Ne(
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: ${p.dataSourceVersion}`);
526
- const u = (f) => {
525
+ process.env.NODE_ENV === "development" && a.dataSource && console.log(`[ApiTokenModal] DataSource version: ${u.dataSourceVersion}`);
526
+ const h = (f) => {
527
527
  if (!f)
528
- p.handleValueChange(void 0);
528
+ u.handleValueChange(void 0);
529
529
  else {
530
- const S = typeof f == "string" ? new Date(f) : f, T = Za(S);
531
- p.handleValueChange(T);
530
+ const C = typeof f == "string" ? new Date(f) : f, S = Ka(C);
531
+ u.handleValueChange(S);
532
532
  }
533
533
  o(f);
534
- }, c = async (f, S) => new Promise(async (T, n) => {
534
+ }, c = async (f, C) => new Promise(async (S, n) => {
535
535
  try {
536
- const s = Ge(Fe.or(Fe.eq("name", `^*${S.trim()}*`))), w = await i.findAllWithFilter(s, f, 20);
537
- T({
536
+ const s = Me(Fe.or(Fe.eq("name", `^*${C.trim()}*`))), w = await i.findAllWithFilter(s, f, 20);
537
+ S({
538
538
  options: w.content,
539
539
  page: w.pageable.pageNumber,
540
540
  totalPages: w.totalPages
@@ -546,18 +546,18 @@ const br = tr(
546
546
  a.onCustomSave ? a.onCustomSave(a.dataSource.current, (f) => {
547
547
  f && a.onAfterSave && a.onAfterSave(a.dataSource.current), a.onClickOk(a.dataSource.current, f);
548
548
  }) : a.onClickOk(a.dataSource.current, !0);
549
- }, A = () => {
549
+ }, x = () => {
550
550
  a.onClickCancel(a.dataSource.current);
551
551
  };
552
552
  return /* @__PURE__ */ r(
553
553
  Oe,
554
554
  {
555
555
  opened: a.opened,
556
- onClose: A,
556
+ onClose: x,
557
557
  title: g().t("archbase:Token de API"),
558
558
  size: "50%",
559
559
  children: [
560
- /* @__PURE__ */ r(Ce, { style: { height: "300px" }, children: [
560
+ /* @__PURE__ */ r(fe, { style: { height: "300px" }, children: [
561
561
  /* @__PURE__ */ e(
562
562
  ne,
563
563
  {
@@ -577,17 +577,17 @@ const br = tr(
577
577
  }
578
578
  ),
579
579
  /* @__PURE__ */ e(
580
- dr,
580
+ ur,
581
581
  {
582
582
  withSeconds: !0,
583
583
  value: t,
584
- onChange: u,
584
+ onChange: h,
585
585
  label: "Data/hora expiração",
586
586
  placeholder: "Selecione a data de expiração"
587
587
  }
588
588
  ),
589
589
  /* @__PURE__ */ e(
590
- er,
590
+ ar,
591
591
  {
592
592
  label: `${g().t("archbase:Usuário")}`,
593
593
  dataSource: a.dataSource,
@@ -598,65 +598,65 @@ const br = tr(
598
598
  getOptions: c,
599
599
  debounceTime: 500,
600
600
  minCharsToSearch: 1,
601
- itemComponent: Cr
601
+ itemComponent: Sr
602
602
  }
603
603
  )
604
604
  ] }),
605
605
  /* @__PURE__ */ r(N, { justify: "flex-end", mt: "md", children: [
606
- /* @__PURE__ */ e(Y, { variant: "default", onClick: A, children: g().t("archbase:Cancelar") }),
606
+ /* @__PURE__ */ e(Y, { variant: "default", onClick: x, children: g().t("archbase:Cancelar") }),
607
607
  /* @__PURE__ */ e(Y, { onClick: I, children: g().t("archbase:Salvar") })
608
608
  ] })
609
609
  ]
610
610
  }
611
611
  );
612
- }, ha = (a) => {
612
+ }, pa = (a) => {
613
613
  const t = "->";
614
- return a.includes(t) ? a.split(t).map((p) => p.trim()).map((p) => g().t(p)).join(` ${t} `) : g().t(a);
614
+ return a.includes(t) ? a.split(t).map((u) => u.trim()).map((u) => g().t(u)).join(` ${t} `) : g().t(a);
615
615
  };
616
- function Ze({ dataSource: a, opened: t, close: o }) {
617
- const i = ie(() => a?.getFieldValue("name") || "", [a]), p = ie(() => a?.getFieldValue("id") || "", [a]), u = ie(() => a?.getFieldValue("type") || "", [a]), c = oa(), I = oa(), [A, f] = k([]), [S, T] = k([]), [n, s] = k(), [w, D] = k(), [h, l] = k(""), [m] = ea(h, 200), [v, C] = k(""), [z] = ea(v, 200), b = J(Q.Resource), { colorScheme: K } = Ue(), L = K === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", Z = ie(() => S.sort((x, R) => x.resourceDescription.localeCompare(R.resourceDescription)).map((x) => ({
618
- value: x.resourceId,
619
- label: x.resourceDescription,
620
- children: x.permissions.filter((R) => R.actionDescription.toLowerCase().includes(z.toLowerCase())).sort((R, B) => R.actionDescription.localeCompare(B.actionDescription)).map((R) => ({
621
- value: R.actionId,
622
- label: R.actionDescription,
616
+ function Ke({ dataSource: a, opened: t, close: o }) {
617
+ const i = ie(() => a?.getFieldValue("name") || "", [a]), u = ie(() => a?.getFieldValue("id") || "", [a]), h = ie(() => a?.getFieldValue("type") || "", [a]), c = na(), I = na(), [x, f] = z([]), [C, S] = z([]), [n, s] = z(), [w, D] = z(), [d, l] = z(""), [m] = aa(d, 200), [v, T] = z(""), [A] = aa(v, 200), b = J(Q.Resource), { colorScheme: j } = Be(), G = j === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", K = ie(() => C.sort((R, k) => R.resourceDescription.localeCompare(k.resourceDescription)).map((R) => ({
618
+ value: R.resourceId,
619
+ label: R.resourceDescription,
620
+ children: R.permissions.filter((k) => k.actionDescription.toLowerCase().includes(A.toLowerCase())).sort((k, B) => k.actionDescription.localeCompare(B.actionDescription)).map((k) => ({
621
+ value: k.actionId,
622
+ label: k.actionDescription,
623
623
  nodeProps: {
624
- permissionId: R.permissionId,
625
- types: R.types ?? [],
626
- owner: x
624
+ permissionId: k.permissionId,
625
+ types: k.types ?? [],
626
+ owner: R
627
627
  }
628
628
  }))
629
- })), [S, z]), E = ie(() => S.map((x) => x.permissions.map((R) => R.actionId)).flat(), [S]), O = ie(() => A.sort((x, R) => x.resourceDescription.localeCompare(R.resourceDescription)).map((x) => ({
630
- value: x.resourceId,
631
- label: x.resourceDescription,
632
- children: x.permissions.filter((R) => R.actionDescription.toLowerCase().includes(m.toLowerCase())).sort((R, B) => R.actionDescription.localeCompare(B.actionDescription)).map((R) => {
633
- const B = S.find((M) => M.resourceId === x.resourceId)?.permissions.find((M) => M.actionId === R.actionId);
629
+ })), [C, A]), E = ie(() => C.map((R) => R.permissions.map((k) => k.actionId)).flat(), [C]), O = ie(() => x.sort((R, k) => R.resourceDescription.localeCompare(k.resourceDescription)).map((R) => ({
630
+ value: R.resourceId,
631
+ label: R.resourceDescription,
632
+ children: R.permissions.filter((k) => k.actionDescription.toLowerCase().includes(m.toLowerCase())).sort((k, B) => k.actionDescription.localeCompare(B.actionDescription)).map((k) => {
633
+ const B = C.find((V) => V.resourceId === R.resourceId)?.permissions.find((V) => V.actionId === k.actionId);
634
634
  return {
635
- value: R.actionId,
636
- label: R.actionDescription,
635
+ value: k.actionId,
636
+ label: k.actionDescription,
637
637
  nodeProps: {
638
- granted: E.includes(R.actionId) && B?.types?.includes(we(X, u)),
639
- owner: x
638
+ granted: E.includes(k.actionId) && B?.types?.includes(Ce(X, h)),
639
+ owner: R
640
640
  }
641
641
  };
642
642
  })
643
- })), [A, S, E, u, m]), F = oe(async () => {
644
- if (p) {
645
- const x = await b.getPermissionsBySecurityId(p, u), R = await b.getAllPermissionsAvailable();
646
- f(R), T(x);
643
+ })), [x, C, E, h, m]), F = oe(async () => {
644
+ if (u) {
645
+ const R = await b.getPermissionsBySecurityId(u, h), k = await b.getAllPermissionsAvailable();
646
+ f(k), S(R);
647
647
  }
648
- }, [p, u]), Se = oe(() => {
649
- n?.value && p && b.createPermission(p, n.value, u).then((x) => {
650
- if (x) {
651
- T((q) => {
652
- let G;
653
- return q.map((H) => H.resourceId).includes(x.resourceId) ? G = q.map((H) => H.resourceId === x.resourceId ? H.permissions.map((U) => U.actionId).includes(n.value) ? {
648
+ }, [u, h]), Se = oe(() => {
649
+ n?.value && u && b.createPermission(u, n.value, h).then((R) => {
650
+ if (R) {
651
+ S((q) => {
652
+ let M;
653
+ return q.map((H) => H.resourceId).includes(R.resourceId) ? M = q.map((H) => H.resourceId === R.resourceId ? H.permissions.map((U) => U.actionId).includes(n.value) ? {
654
654
  ...H,
655
655
  permissions: H.permissions.map(
656
656
  (U) => U.actionId === n.value ? {
657
657
  ...U,
658
- permissionId: x.permissionId,
659
- types: [...U.types ?? [], we(X, u)]
658
+ permissionId: R.permissionId,
659
+ types: [...U.types ?? [], Ce(X, h)]
660
660
  } : U
661
661
  )
662
662
  } : {
@@ -664,114 +664,114 @@ function Ze({ dataSource: a, opened: t, close: o }) {
664
664
  permissions: [
665
665
  ...H.permissions ?? [],
666
666
  {
667
- actionId: x.actionId,
668
- actionDescription: x.actionDescription,
669
- permissionId: x.permissionId,
670
- types: [we(X, u)]
667
+ actionId: R.actionId,
668
+ actionDescription: R.actionDescription,
669
+ permissionId: R.permissionId,
670
+ types: [Ce(X, h)]
671
671
  }
672
672
  ]
673
- } : H) : G = [
673
+ } : H) : M = [
674
674
  ...q,
675
675
  {
676
- resourceId: x.resourceId,
677
- resourceDescription: x.resourceDescription,
676
+ resourceId: R.resourceId,
677
+ resourceDescription: R.resourceDescription,
678
678
  permissions: [
679
679
  {
680
- actionId: x.actionId,
681
- actionDescription: x.actionDescription,
682
- permissionId: x.permissionId,
683
- types: [we(X, u)]
680
+ actionId: R.actionId,
681
+ actionDescription: R.actionDescription,
682
+ permissionId: R.permissionId,
683
+ types: [Ce(X, h)]
684
684
  }
685
685
  ]
686
686
  }
687
- ], G;
687
+ ], M;
688
688
  });
689
- const R = O.filter((q) => q.value === n?.nodeProps?.owner?.resourceId).map((q) => q.children).flat(), B = R.map((q) => q.value).indexOf(n.value), M = R.find((q, G) => !q?.nodeProps?.granted && q?.value !== n.value && (R.length > B + 1 ? G > B : !0));
690
- M?.value && c.select(M.value), I.expand(x.resourceId), s(M);
689
+ const k = O.filter((q) => q.value === n?.nodeProps?.owner?.resourceId).map((q) => q.children).flat(), B = k.map((q) => q.value).indexOf(n.value), V = k.find((q, M) => !q?.nodeProps?.granted && q?.value !== n.value && (k.length > B + 1 ? M > B : !0));
690
+ V?.value && c.select(V.value), I.expand(R.resourceId), s(V);
691
691
  }
692
692
  });
693
- }, [n, p, u, b, O, A, S, c, I]), ve = oe(() => {
693
+ }, [n, u, h, b, O, x, C, c, I]), ye = oe(() => {
694
694
  w?.nodeProps?.permissionId && b.deletePermission(w.nodeProps.permissionId).then(() => {
695
- T((M) => [...M].filter((G) => {
695
+ S((V) => [...V].filter((M) => {
696
696
  let H = !0;
697
- return G.permissions?.forEach((U) => {
698
- U.permissionId !== void 0 && U.permissionId === w?.nodeProps?.permissionId && G.permissions.length === 1 && U?.types?.length === 1 && U.types[0] === we(X, u) && (H = !1);
697
+ return M.permissions?.forEach((U) => {
698
+ U.permissionId !== void 0 && U.permissionId === w?.nodeProps?.permissionId && M.permissions.length === 1 && U?.types?.length === 1 && U.types[0] === Ce(X, h) && (H = !1);
699
699
  }), H;
700
- }).map((G) => {
700
+ }).map((M) => {
701
701
  const H = w?.nodeProps?.owner;
702
- return G.resourceId === H.resourceId ? w?.nodeProps?.types?.length === 1 ? {
703
- ...G,
704
- permissions: [...(G.permissions ?? []).filter((U) => U.permissionId !== w?.nodeProps?.permissionId)]
702
+ return M.resourceId === H.resourceId ? w?.nodeProps?.types?.length === 1 ? {
703
+ ...M,
704
+ permissions: [...(M.permissions ?? []).filter((U) => U.permissionId !== w?.nodeProps?.permissionId)]
705
705
  } : {
706
- ...G,
707
- permissions: (G.permissions ?? []).map((U) => U.actionId === w.value ? {
706
+ ...M,
707
+ permissions: (M.permissions ?? []).map((U) => U.actionId === w.value ? {
708
708
  actionId: U.actionId,
709
709
  actionDescription: U.actionDescription,
710
- types: [...U.types?.filter((se) => se && se !== we(X, u)) ?? []]
710
+ types: [...U.types?.filter((se) => se && se !== Ce(X, h)) ?? []]
711
711
  } : U)
712
- } : G;
712
+ } : M;
713
713
  }));
714
- const x = Z.filter((M) => M.value === w?.nodeProps?.owner?.resourceId).map((M) => M.children).flat(), R = x.map((M) => M.value).indexOf(w.value), B = x.find((M, q) => M?.nodeProps?.types.includes(we(X, u)) && M?.value !== w.value && (x.length > R + 1 ? q > R : !0));
714
+ const R = K.filter((V) => V.value === w?.nodeProps?.owner?.resourceId).map((V) => V.children).flat(), k = R.map((V) => V.value).indexOf(w.value), B = R.find((V, q) => V?.nodeProps?.types.includes(Ce(X, h)) && V?.value !== w.value && (R.length > k + 1 ? q > k : !0));
715
715
  B?.value && I.select(B.value), D(B);
716
716
  });
717
- }, [w, b, u, Z, S, I]);
717
+ }, [w, b, h, K, C, I]);
718
718
  return ee(() => {
719
- t && a && (s(void 0), D(void 0), l(""), C(""), I.collapseAllNodes(), c.collapseAllNodes(), F());
720
- }, [t, u, p, F]), a ? /* @__PURE__ */ e(Oe, { opened: t, onClose: o, title: `${g().t(`archbase:${u}`)}: ${i}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(hr, { height: "540px", children: [
721
- /* @__PURE__ */ e(pr, { children: /* @__PURE__ */ e(_, { 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 && (s(void 0), D(void 0), l(""), T(""), I.collapseAllNodes(), c.collapseAllNodes(), F());
720
+ }, [t, h, u, F]), a ? /* @__PURE__ */ e(Oe, { opened: t, onClose: o, title: `${g().t(`archbase:${h}`)}: ${i}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ r(pr, { height: "540px", children: [
721
+ /* @__PURE__ */ e(mr, { children: /* @__PURE__ */ e(_, { 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(N, { mb: 20, children: [
724
- /* @__PURE__ */ e(d, { children: g().t("archbase:Available") }),
724
+ /* @__PURE__ */ e(p, { children: g().t("archbase:Available") }),
725
725
  /* @__PURE__ */ e(
726
726
  me,
727
727
  {
728
728
  size: "xs",
729
- value: h,
730
- onChange: (x) => l(x.target.value),
729
+ value: d,
730
+ onChange: (R) => l(R.target.value),
731
731
  placeholder: g().t("archbase:Filter available permissions")
732
732
  }
733
733
  )
734
734
  ] }),
735
- /* @__PURE__ */ e(Ce, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
736
- na,
735
+ /* @__PURE__ */ e(fe, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
736
+ sa,
737
737
  {
738
738
  data: O,
739
739
  selectOnClick: !0,
740
740
  allowRangeSelection: !1,
741
741
  tree: c,
742
- renderNode: ({ level: x, node: R, expanded: B, hasChildren: M, selected: q, elementProps: G }) => {
743
- const H = R?.nodeProps?.granted, U = H ? "dimmed" : void 0, se = H ? "line-through" : void 0, We = oe((qe) => {
744
- s(R), G.onClick(qe);
745
- }, [R, G.onClick]);
742
+ renderNode: ({ level: R, node: k, expanded: B, hasChildren: V, selected: q, elementProps: M }) => {
743
+ const H = k?.nodeProps?.granted, U = H ? "dimmed" : void 0, se = H ? "line-through" : void 0, qe = oe((He) => {
744
+ s(k), M.onClick(He);
745
+ }, [k, M.onClick]);
746
746
  return /* @__PURE__ */ r(
747
747
  N,
748
748
  {
749
- ml: M ? 0 : 5,
749
+ ml: V ? 0 : 5,
750
750
  gap: 5,
751
- ...G,
752
- bg: q && x === 2 ? L : "",
753
- onClick: We,
751
+ ...M,
752
+ bg: q && R === 2 ? G : "",
753
+ onClick: qe,
754
754
  children: [
755
- M && /* @__PURE__ */ e(
756
- ca,
755
+ V && /* @__PURE__ */ e(
756
+ da,
757
757
  {
758
758
  size: 18,
759
759
  style: { transform: B ? "rotate(0deg)" : "rotate(-90deg)" }
760
760
  }
761
761
  ),
762
- !M && /* @__PURE__ */ e(
763
- da,
762
+ !V && /* @__PURE__ */ e(
763
+ ua,
764
764
  {
765
765
  size: 12,
766
766
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
767
767
  }
768
768
  ),
769
769
  /* @__PURE__ */ e(
770
- d,
770
+ p,
771
771
  {
772
772
  c: U,
773
773
  td: se,
774
- children: ha(R.label)
774
+ children: pa(k.label)
775
775
  }
776
776
  )
777
777
  ]
@@ -781,61 +781,61 @@ function Ze({ dataSource: a, opened: t, close: o }) {
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(Re, { label: g().t("archbase:Add"), children: /* @__PURE__ */ e(le, { onClick: Se, disabled: !n || n?.nodeProps?.granted || !n.nodeProps, children: /* @__PURE__ */ e(Sa, {}) }) }),
786
- /* @__PURE__ */ e(Re, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(le, { onClick: ve, disabled: !w || !w?.nodeProps?.permissionId || !w.nodeProps, children: /* @__PURE__ */ e(Ta, {}) }) })
784
+ /* @__PURE__ */ e("div", { style: { flex: 2, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ r(L, { gap: 5, align: "center", children: [
785
+ /* @__PURE__ */ e(Re, { label: g().t("archbase:Add"), children: /* @__PURE__ */ e(pe, { onClick: Se, disabled: !n || n?.nodeProps?.granted || !n.nodeProps, children: /* @__PURE__ */ e(Ta, {}) }) }),
786
+ /* @__PURE__ */ e(Re, { label: g().t("archbase:Remove"), children: /* @__PURE__ */ e(pe, { onClick: ye, disabled: !w || !w?.nodeProps?.permissionId || !w.nodeProps, children: /* @__PURE__ */ e(Aa, {}) }) })
787
787
  ] }) }),
788
788
  /* @__PURE__ */ r("div", { style: { flex: 9, display: "flex", flexDirection: "column", overflow: "hidden", minHeight: 0 }, children: [
789
789
  /* @__PURE__ */ r(N, { mb: 20, children: [
790
- /* @__PURE__ */ e(d, { children: g().t("archbase:Granted") }),
790
+ /* @__PURE__ */ e(p, { children: g().t("archbase:Granted") }),
791
791
  /* @__PURE__ */ e(
792
792
  me,
793
793
  {
794
794
  size: "xs",
795
795
  value: v,
796
- onChange: (x) => C(x.target.value),
796
+ onChange: (R) => T(R.target.value),
797
797
  placeholder: g().t("archbase:Filter granted permissions")
798
798
  }
799
799
  )
800
800
  ] }),
801
- /* @__PURE__ */ e(Ce, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
802
- na,
801
+ /* @__PURE__ */ e(fe, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(
802
+ sa,
803
803
  {
804
- data: Z,
804
+ data: K,
805
805
  selectOnClick: !0,
806
806
  allowRangeSelection: !1,
807
807
  tree: I,
808
- renderNode: ({ level: x, node: R, expanded: B, hasChildren: M, selected: q, elementProps: G }) => {
808
+ renderNode: ({ level: R, node: k, expanded: B, hasChildren: V, selected: q, elementProps: M }) => {
809
809
  const H = oe((U) => {
810
- D(R), G.onClick(U);
811
- }, [R, G.onClick]);
810
+ D(k), M.onClick(U);
811
+ }, [k, M.onClick]);
812
812
  return /* @__PURE__ */ r(
813
813
  N,
814
814
  {
815
- ml: M ? 0 : 5,
815
+ ml: V ? 0 : 5,
816
816
  gap: 5,
817
- ...G,
818
- bg: q && x === 2 ? L : "",
817
+ ...M,
818
+ bg: q && R === 2 ? G : "",
819
819
  onClick: H,
820
820
  children: [
821
- M && /* @__PURE__ */ e(
822
- ca,
821
+ V && /* @__PURE__ */ e(
822
+ da,
823
823
  {
824
824
  size: 18,
825
825
  style: { transform: B ? "rotate(0deg)" : "rotate(-90deg)" }
826
826
  }
827
827
  ),
828
- !M && /* @__PURE__ */ e(
829
- da,
828
+ !V && /* @__PURE__ */ e(
829
+ ua,
830
830
  {
831
831
  size: 12,
832
832
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
833
833
  }
834
834
  ),
835
- /* @__PURE__ */ e(d, { children: ha(R.label) }),
836
- R?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(j, { color: "blue", children: g().t("archbase:user") }),
837
- R?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(j, { color: "orange", children: g().t("archbase:group") }),
838
- R?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(j, { color: "pink", children: g().t("archbase:profile") })
835
+ /* @__PURE__ */ e(p, { children: pa(k.label) }),
836
+ k?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e(Z, { color: "blue", children: g().t("archbase:user") }),
837
+ k?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e(Z, { color: "orange", children: g().t("archbase:group") }),
838
+ k?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e(Z, { color: "pink", children: g().t("archbase:profile") })
839
839
  ]
840
840
  }
841
841
  );
@@ -844,10 +844,10 @@ function Ze({ dataSource: a, opened: t, close: o }) {
844
844
  ) })
845
845
  ] })
846
846
  ] }) }) }),
847
- /* @__PURE__ */ e(mr, { size: "40px", children: /* @__PURE__ */ e(N, { justify: "flex-end", children: /* @__PURE__ */ e(Y, { onClick: o, children: g().t("archbase:Close") }) }) })
847
+ /* @__PURE__ */ e(gr, { size: "40px", children: /* @__PURE__ */ e(N, { justify: "flex-end", children: /* @__PURE__ */ e(Y, { onClick: o, children: g().t("archbase:Close") }) }) })
848
848
  ] }) }) : null;
849
849
  }
850
- const ta = "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", Tr = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, o) => (t.group?.name ?? "").localeCompare(o.group?.name ?? "")).map((t, o) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(j, { color: "blue", children: t.group?.name }) }, o)) }) : null, Ar = (a) => a.profile ? /* @__PURE__ */ e(j, { color: "green", children: a.profile?.name }) : null, xr = (a) => /* @__PURE__ */ r(Ie, { children: [
850
+ const ia = "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", Ar = (a) => a.groups ? /* @__PURE__ */ e("div", { style: { display: "flex" }, children: a.groups.slice().sort((t, o) => (t.group?.name ?? "").localeCompare(o.group?.name ?? "")).map((t, o) => /* @__PURE__ */ e("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e(Z, { color: "blue", children: t.group?.name }) }, o)) }) : null, xr = (a) => a.profile ? /* @__PURE__ */ e(Z, { color: "green", children: a.profile?.name }) : null, Rr = (a) => /* @__PURE__ */ r(ke, { children: [
851
851
  /* @__PURE__ */ e(
852
852
  P,
853
853
  {
@@ -859,7 +859,7 @@ const ta = "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) : ta
862
+ src: t.row.user && t.row.user.avatar ? atob(t.row.user.avatar) : ia
863
863
  }
864
864
  ),
865
865
  inputFilterType: "text",
@@ -894,7 +894,7 @@ const ta = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
894
894
  dataType: "text",
895
895
  size: 300,
896
896
  header: `${a("archbase:Expira em")}`,
897
- render: (t) => /* @__PURE__ */ e(d, { size: "sm", children: t.row.expirationDate }),
897
+ render: (t) => /* @__PURE__ */ e(p, { size: "sm", children: t.row.expirationDate }),
898
898
  inputFilterType: "text"
899
899
  }
900
900
  ),
@@ -926,7 +926,7 @@ const ta = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
926
926
  inputFilterType: "text"
927
927
  }
928
928
  )
929
- ] }), Rr = (a) => /* @__PURE__ */ r(Ie, { children: [
929
+ ] }), kr = (a) => /* @__PURE__ */ r(ke, { children: [
930
930
  /* @__PURE__ */ e(
931
931
  P,
932
932
  {
@@ -938,7 +938,7 @@ const ta = "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) : ta
941
+ src: t.row.avatar ? atob(t.row.avatar) : ia
942
942
  }
943
943
  ),
944
944
  enableSorting: !1,
@@ -998,7 +998,7 @@ const ta = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
998
998
  dataType: "text",
999
999
  header: `${a("archbase:Perfil")}`,
1000
1000
  size: 200,
1001
- render: (t) => Ar(t.row),
1001
+ render: (t) => xr(t.row),
1002
1002
  inputFilterType: "text"
1003
1003
  }
1004
1004
  ),
@@ -1009,7 +1009,7 @@ const ta = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1009
1009
  dataType: "text",
1010
1010
  size: 300,
1011
1011
  header: `${a("archbase:Grupos")}`,
1012
- render: (t) => Tr(t.row),
1012
+ render: (t) => Ar(t.row),
1013
1013
  exportValue: (t) => t.groups?.slice().sort((o, i) => (o.group?.name ?? "").localeCompare(i.group?.name ?? "")).map((o) => o.group?.name).filter(Boolean).join(", ") || "",
1014
1014
  enableSorting: !1,
1015
1015
  enableColumnFilter: !1,
@@ -1095,7 +1095,7 @@ const ta = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1095
1095
  size: 140
1096
1096
  }
1097
1097
  )
1098
- ] }), Ir = (a) => /* @__PURE__ */ r(Ie, { children: [
1098
+ ] }), Ir = (a) => /* @__PURE__ */ r(ke, { children: [
1099
1099
  /* @__PURE__ */ e(
1100
1100
  P,
1101
1101
  {
@@ -1116,7 +1116,7 @@ const ta = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1116
1116
  inputFilterType: "text"
1117
1117
  }
1118
1118
  )
1119
- ] }), kr = (a) => /* @__PURE__ */ r(Ie, { children: [
1119
+ ] }), zr = (a) => /* @__PURE__ */ r(ke, { children: [
1120
1120
  /* @__PURE__ */ e(
1121
1121
  P,
1122
1122
  {
@@ -1137,7 +1137,7 @@ const ta = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABMCAMAAAD5ogFjAA
1137
1137
  inputFilterType: "text"
1138
1138
  }
1139
1139
  )
1140
- ] }), zr = (a) => /* @__PURE__ */ r(Ie, { children: [
1140
+ ] }), Er = (a) => /* @__PURE__ */ r(ke, { children: [
1141
1141
  /* @__PURE__ */ e(
1142
1142
  P,
1143
1143
  {
@@ -1164,14 +1164,14 @@ function ze({
1164
1164
  printTitle: t,
1165
1165
  gridRef: o,
1166
1166
  dataSource: i,
1167
- isLoading: p,
1168
- error: u,
1167
+ isLoading: u,
1168
+ error: h,
1169
1169
  getRowId: c,
1170
1170
  striped: I = !1,
1171
- enableRowActions: A = !0,
1171
+ enableRowActions: x = !0,
1172
1172
  toolbarLeftContent: f,
1173
- renderRowActions: S,
1174
- actionsColumnWidth: T,
1173
+ renderRowActions: C,
1174
+ actionsColumnWidth: S,
1175
1175
  children: n
1176
1176
  }) {
1177
1177
  return /* @__PURE__ */ e(
@@ -1187,7 +1187,7 @@ function ze({
1187
1187
  overflow: "auto"
1188
1188
  },
1189
1189
  children: /* @__PURE__ */ e(
1190
- wa,
1190
+ Ca,
1191
1191
  {
1192
1192
  gridRef: o,
1193
1193
  printTitle: t,
@@ -1198,49 +1198,49 @@ function ze({
1198
1198
  withColumnBorders: !0,
1199
1199
  striped: I,
1200
1200
  enableTopToolbar: !0,
1201
- enableRowActions: A,
1201
+ enableRowActions: x,
1202
1202
  pageSize: 50,
1203
- isLoading: p,
1204
- isError: !!u,
1205
- error: u,
1203
+ isLoading: u,
1204
+ isError: !!h,
1205
+ error: h,
1206
1206
  enableGlobalFilter: !0,
1207
1207
  getRowId: c,
1208
1208
  toolbarLeftContent: f,
1209
- renderRowActions: S,
1210
- actionsColumnWidth: T,
1209
+ renderRowActions: C,
1210
+ actionsColumnWidth: S,
1211
1211
  children: n
1212
1212
  }
1213
1213
  )
1214
1214
  }
1215
1215
  );
1216
1216
  }
1217
- function Ke({
1217
+ function Qe({
1218
1218
  dataSource: a,
1219
1219
  securityType: t,
1220
1220
  newInstance: o,
1221
1221
  createEntitiesWithId: i,
1222
- removeMessageKey: p,
1223
- setOpenedModal: u,
1222
+ removeMessageKey: u,
1223
+ setOpenedModal: h,
1224
1224
  setOpenedPermissionsModal: c,
1225
1225
  validationContext: I,
1226
- t: A
1226
+ t: x
1227
1227
  }) {
1228
- const f = a, S = (m) => f.isEmpty() ? null : f.gotoRecordByData(m) ?? null;
1228
+ const f = a, C = (m) => f.isEmpty() ? null : f.gotoRecordByData(m) ?? null;
1229
1229
  return {
1230
1230
  handleAdd: () => {
1231
1231
  const m = o();
1232
- i || (m.id = void 0), f.insert(m), u(t);
1232
+ i || (m.id = void 0), f.insert(m), h(t);
1233
1233
  },
1234
1234
  handleViewRow: (m) => {
1235
- S(m) && u(t);
1235
+ C(m) && h(t);
1236
1236
  },
1237
1237
  handleEditRow: (m) => {
1238
- S(m) && (f.isEditing() || f.edit(), u(t));
1238
+ C(m) && (f.isEditing() || f.edit(), h(t));
1239
1239
  },
1240
1240
  handleRemoveRow: (m) => {
1241
- S(m) && pe.showConfirmDialogYesNo(
1242
- `${A("archbase:Confirme")}`,
1243
- `${A(p)}${m.name} ?`,
1241
+ C(m) && he.showConfirmDialogYesNo(
1242
+ `${x("archbase:Confirme")}`,
1243
+ `${x(u)}${m.name} ?`,
1244
1244
  () => {
1245
1245
  f.remove();
1246
1246
  },
@@ -1254,385 +1254,385 @@ function Ke({
1254
1254
  } catch {
1255
1255
  return;
1256
1256
  }
1257
- u(""), I?.clearAll();
1257
+ h(""), I?.clearAll();
1258
1258
  },
1259
1259
  handleCancelModal: () => {
1260
- u(""), f.isBrowsing() || f.cancel(), I?.clearAll();
1260
+ h(""), f.isBrowsing() || f.cancel(), I?.clearAll();
1261
1261
  },
1262
1262
  handleOpenPermissionsModal: () => {
1263
1263
  c(t);
1264
1264
  }
1265
1265
  };
1266
1266
  }
1267
- function Qe({
1267
+ function Je({
1268
1268
  row: a,
1269
1269
  onView: t,
1270
1270
  onEdit: o,
1271
1271
  onRemove: i,
1272
- onEditPermissions: p,
1273
- before: u,
1272
+ onEditPermissions: u,
1273
+ before: h,
1274
1274
  after: c,
1275
1275
  t: I
1276
1276
  }) {
1277
- const A = aa(), { colorScheme: f } = Ue(), S = f === "dark", T = (n) => S ? A.colors[n][8] : A.colors[n][4];
1277
+ const x = ra(), { colorScheme: f } = Be(), C = f === "dark", S = (n) => C ? x.colors[n][8] : x.colors[n][4];
1278
1278
  return /* @__PURE__ */ r(N, { gap: 1, wrap: "nowrap", children: [
1279
- u?.(a),
1280
- /* @__PURE__ */ e(le, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(ir, { size: 20, color: T("blue") }) }),
1281
- /* @__PURE__ */ e(le, { variant: "transparent", onClick: () => o(a), children: /* @__PURE__ */ e(Aa, { size: 20, color: T("yellow") }) }),
1282
- /* @__PURE__ */ e(le, { variant: "transparent", onClick: () => i(a), children: /* @__PURE__ */ e(ra, { size: 20, color: T("red") }) }),
1283
- /* @__PURE__ */ e(Re, { withinPortal: !0, withArrow: !0, position: "left", label: `${I("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(le, { variant: "transparent", onClick: p, children: /* @__PURE__ */ e(or, { size: 20, color: T("green") }) }) }),
1279
+ h?.(a),
1280
+ /* @__PURE__ */ e(pe, { variant: "transparent", onClick: () => t(a), children: /* @__PURE__ */ e(or, { size: 20, color: S("blue") }) }),
1281
+ /* @__PURE__ */ e(pe, { variant: "transparent", onClick: () => o(a), children: /* @__PURE__ */ e(xa, { size: 20, color: S("yellow") }) }),
1282
+ /* @__PURE__ */ e(pe, { variant: "transparent", onClick: () => i(a), children: /* @__PURE__ */ e(ta, { size: 20, color: S("red") }) }),
1283
+ /* @__PURE__ */ e(Re, { withinPortal: !0, withArrow: !0, position: "left", label: `${I("archbase:Edit permissions")}`, children: /* @__PURE__ */ e(pe, { variant: "transparent", onClick: u, children: /* @__PURE__ */ e(nr, { size: 20, color: S("green") }) }) }),
1284
1284
  c?.(a)
1285
1285
  ] });
1286
1286
  }
1287
- const Je = ({ onAdd: a, onEditPermissions: t, t: o }) => /* @__PURE__ */ r(De, { justify: "space-between", style: { width: "50%" }, children: [
1287
+ const Xe = ({ onAdd: a, onEditPermissions: t, t: o }) => /* @__PURE__ */ r(De, { justify: "space-between", style: { width: "50%" }, children: [
1288
1288
  /* @__PURE__ */ r(N, { align: "end", gap: "4px", wrap: "nowrap", children: [
1289
- /* @__PURE__ */ e(Y, { color: "green", leftSection: /* @__PURE__ */ e(xa, {}), onClick: a, children: `${o("archbase:New")}` }),
1290
- /* @__PURE__ */ e(Y, { color: "blue", leftSection: /* @__PURE__ */ e(Aa, {}), onClick: t, children: `${o("archbase:Edit permissions")}` })
1289
+ /* @__PURE__ */ e(Y, { color: "green", leftSection: /* @__PURE__ */ e(Ra, {}), onClick: a, children: `${o("archbase:New")}` }),
1290
+ /* @__PURE__ */ e(Y, { color: "blue", leftSection: /* @__PURE__ */ e(xa, {}), onClick: t, children: `${o("archbase:Edit permissions")}` })
1291
1291
  ] }),
1292
1292
  /* @__PURE__ */ e(De, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1293
1293
  ] });
1294
- function tt({
1294
+ function ot({
1295
1295
  height: a = "400px",
1296
1296
  width: t = "100%",
1297
1297
  createEntitiesWithId: o = !0,
1298
1298
  userModalOptions: i,
1299
- profileModalOptions: p,
1300
- groupModalOptions: u,
1299
+ profileModalOptions: u,
1300
+ groupModalOptions: h,
1301
1301
  options: c
1302
1302
  }) {
1303
- aa(), Ca("securityStore");
1304
- const I = Ka(), { colorScheme: A } = Ue(), [f, S] = k(void 0), [T, n] = k("users"), s = J(Q.User), w = J(Q.Group), D = J(Q.Resource), h = J(Q.Profile), [l, m] = k(""), [v, C] = k(""), z = J(Q.AccessToken), { t: b } = Qa(), K = xe(null), L = xe(null), Z = xe(null), E = xe(null), O = xe(null), F = ($) => $.id, Se = ($) => $.id, ve = ($) => $.id, x = ($) => $.id, R = ($) => $.id, {
1303
+ ra(), Sa("securityStore");
1304
+ const I = Qa(), { colorScheme: x } = Be(), [f, C] = z(void 0), [S, n] = z("users"), s = J(Q.User), w = J(Q.Group), D = J(Q.Resource), d = J(Q.Profile), [l, m] = z(""), [v, T] = z(""), A = J(Q.AccessToken), { t: b } = Ja(), j = xe(null), G = xe(null), K = xe(null), E = xe(null), O = xe(null), F = ($) => $.id, Se = ($) => $.id, ye = ($) => $.id, R = ($) => $.id, k = ($) => $.id, {
1305
1305
  dataSource: B,
1306
- isLoading: M,
1306
+ isLoading: V,
1307
1307
  refreshData: q
1308
- } = ke({
1308
+ } = Ie({
1309
1309
  name: "accessTokenApi",
1310
- service: z,
1310
+ service: A,
1311
1311
  validator: I,
1312
1312
  pageSize: 25,
1313
1313
  defaultSortFields: ["user.email", "expirationTime:desc"],
1314
- onError: ($, ae) => {
1315
- S($), te.showError(`${b("archbase:WARNING")}`, $, ae);
1314
+ onError: ($, re) => {
1315
+ C($), te.showError(`${b("archbase:WARNING")}`, $, re);
1316
1316
  }
1317
1317
  }), {
1318
- dataSource: G,
1318
+ dataSource: M,
1319
1319
  isLoading: H,
1320
1320
  refreshData: U
1321
- } = ke({
1321
+ } = Ie({
1322
1322
  name: "dsUsers",
1323
1323
  service: s,
1324
1324
  validator: I,
1325
1325
  pageSize: 25,
1326
- onError: ($, ae) => {
1327
- S($), te.showError(`${b("archbase:WARNING")}`, $, ae);
1326
+ onError: ($, re) => {
1327
+ C($), te.showError(`${b("archbase:WARNING")}`, $, re);
1328
1328
  }
1329
1329
  }), {
1330
1330
  dataSource: se,
1331
- isLoading: We,
1332
- refreshData: qe
1333
- } = ke({
1331
+ isLoading: qe,
1332
+ refreshData: He
1333
+ } = Ie({
1334
1334
  name: "dsGroups",
1335
1335
  service: w,
1336
1336
  validator: I,
1337
1337
  pageSize: 25,
1338
- onError: ($, ae) => {
1339
- S($), te.showError(`${b("archbase:WARNING")}`, $, ae);
1338
+ onError: ($, re) => {
1339
+ C($), te.showError(`${b("archbase:WARNING")}`, $, re);
1340
1340
  }
1341
1341
  }), {
1342
1342
  dataSource: $e,
1343
1343
  isLoading: Ia,
1344
- refreshData: ka
1345
- } = ke({
1344
+ refreshData: za
1345
+ } = Ie({
1346
1346
  name: "dsProfile",
1347
- service: h,
1347
+ service: d,
1348
1348
  validator: I,
1349
1349
  pageSize: 25,
1350
- onError: ($, ae) => {
1351
- S($), te.showError(`${b("archbase:WARNING")}`, $, ae);
1350
+ onError: ($, re) => {
1351
+ C($), te.showError(`${b("archbase:WARNING")}`, $, re);
1352
1352
  }
1353
1353
  }), {
1354
- dataSource: za,
1355
- isLoading: Ea,
1356
- refreshData: Pa
1357
- } = ke({
1354
+ dataSource: Ea,
1355
+ isLoading: Pa,
1356
+ refreshData: Da
1357
+ } = Ie({
1358
1358
  name: "dsResources",
1359
1359
  service: D,
1360
1360
  validator: I,
1361
1361
  pageSize: 25,
1362
- onError: ($, ae) => {
1363
- S($), te.showError(`${b("archbase:WARNING")}`, $, ae);
1362
+ onError: ($, re) => {
1363
+ C($), te.showError(`${b("archbase:WARNING")}`, $, re);
1364
1364
  }
1365
1365
  });
1366
1366
  ee(() => {
1367
- q({ filter: Ge(Fe.eq("revoked", "false")) }), U(), qe(), ka(), Pa();
1367
+ q({ filter: Me(Fe.eq("revoked", "false")) }), U(), He(), za(), Da();
1368
1368
  }, []);
1369
- const Da = xr(b), Fa = Rr(b), Na = Ir(b), Oa = kr(b), $a = zr(b), He = Ja(), de = Ke({
1370
- dataSource: G,
1369
+ const Fa = Rr(b), Na = kr(b), Oa = Ir(b), $a = zr(b), La = Er(b), je = Xa(), ce = Qe({
1370
+ dataSource: M,
1371
1371
  securityType: X.USER,
1372
- newInstance: () => nr.newInstance(),
1372
+ newInstance: () => sr.newInstance(),
1373
1373
  createEntitiesWithId: o,
1374
1374
  removeMessageKey: "archbase:Deseja remover o usuário ",
1375
1375
  setOpenedModal: m,
1376
- setOpenedPermissionsModal: C,
1377
- validationContext: He,
1376
+ setOpenedPermissionsModal: T,
1377
+ validationContext: je,
1378
1378
  t: b
1379
- }), ue = Ke({
1379
+ }), de = Qe({
1380
1380
  dataSource: se,
1381
1381
  securityType: X.GROUP,
1382
- newInstance: () => sr.newInstance(),
1382
+ newInstance: () => lr.newInstance(),
1383
1383
  createEntitiesWithId: o,
1384
1384
  removeMessageKey: "archbase:Deseja remover o grupo ",
1385
1385
  setOpenedModal: m,
1386
- setOpenedPermissionsModal: C,
1387
- validationContext: He,
1386
+ setOpenedPermissionsModal: T,
1387
+ validationContext: je,
1388
1388
  t: b
1389
- }), he = Ke({
1389
+ }), ue = Qe({
1390
1390
  dataSource: $e,
1391
1391
  securityType: X.PROFILE,
1392
- newInstance: () => lr.newInstance(),
1392
+ newInstance: () => cr.newInstance(),
1393
1393
  createEntitiesWithId: o,
1394
1394
  removeMessageKey: "archbase:Deseja remover o perfil ",
1395
1395
  setOpenedModal: m,
1396
- setOpenedPermissionsModal: C,
1397
- validationContext: He,
1396
+ setOpenedPermissionsModal: T,
1397
+ validationContext: je,
1398
1398
  t: b
1399
1399
  }), Va = ($) => /* @__PURE__ */ e(
1400
- Qe,
1400
+ Je,
1401
1401
  {
1402
1402
  row: $,
1403
- onView: de.handleViewRow,
1404
- onEdit: de.handleEditRow,
1405
- onRemove: de.handleRemoveRow,
1406
- onEditPermissions: de.handleOpenPermissionsModal,
1403
+ onView: ce.handleViewRow,
1404
+ onEdit: ce.handleEditRow,
1405
+ onRemove: ce.handleRemoveRow,
1406
+ onEditPermissions: ce.handleOpenPermissionsModal,
1407
1407
  before: c?.beforeDefaultUserActions,
1408
1408
  after: c?.afterDefaultUserActions,
1409
1409
  t: b
1410
1410
  }
1411
1411
  ), Ma = ($) => /* @__PURE__ */ e(
1412
- Qe,
1412
+ Je,
1413
1413
  {
1414
1414
  row: $,
1415
- onView: ue.handleViewRow,
1416
- onEdit: ue.handleEditRow,
1417
- onRemove: ue.handleRemoveRow,
1418
- onEditPermissions: ue.handleOpenPermissionsModal,
1415
+ onView: de.handleViewRow,
1416
+ onEdit: de.handleEditRow,
1417
+ onRemove: de.handleRemoveRow,
1418
+ onEditPermissions: de.handleOpenPermissionsModal,
1419
1419
  before: c?.beforeDefaultGroupActions,
1420
1420
  after: c?.afterDefaultGroupActions,
1421
1421
  t: b
1422
1422
  }
1423
1423
  ), Ga = ($) => /* @__PURE__ */ e(
1424
- Qe,
1424
+ Je,
1425
1425
  {
1426
1426
  row: $,
1427
- onView: he.handleViewRow,
1428
- onEdit: he.handleEditRow,
1429
- onRemove: he.handleRemoveRow,
1430
- onEditPermissions: he.handleOpenPermissionsModal,
1427
+ onView: ue.handleViewRow,
1428
+ onEdit: ue.handleEditRow,
1429
+ onRemove: ue.handleRemoveRow,
1430
+ onEditPermissions: ue.handleOpenPermissionsModal,
1431
1431
  before: c?.beforeDefaultProfileActions,
1432
1432
  after: c?.afterDefaultProfileActions,
1433
1433
  t: b
1434
1434
  }
1435
- ), La = () => {
1435
+ ), Ua = () => {
1436
1436
  const $ = B.getCurrentRecord();
1437
- $ && pe.showConfirmDialogYesNo(
1437
+ $ && he.showConfirmDialogYesNo(
1438
1438
  `${b("archbase:Confirme")}`,
1439
1439
  `${b("archbase:Deseja revogar o token de Acesso do usuário ")}${$.user.name} ?`,
1440
1440
  async () => {
1441
- await z.revoke($.token).then(async () => {
1441
+ await A.revoke($.token).then(async () => {
1442
1442
  te.showSuccess(
1443
1443
  `${b("mentors:Informação")}`,
1444
1444
  `${b("mentors:Token de Acesso revogado com sucesso!")}`
1445
1445
  ), B.refreshData();
1446
- }).catch((ae) => {
1447
- pe.showErrorWithDetails(
1446
+ }).catch((re) => {
1447
+ he.showErrorWithDetails(
1448
1448
  `${b("mentors:Atenção")}`,
1449
- ge(ae),
1450
- Me(ae)
1449
+ ge(re),
1450
+ Ve(re)
1451
1451
  );
1452
1452
  });
1453
1453
  },
1454
1454
  () => {
1455
1455
  }
1456
1456
  );
1457
- }, je = () => {
1458
- C("");
1459
- }, Ua = () => /* @__PURE__ */ e(De, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(N, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
1457
+ }, Ze = () => {
1458
+ T("");
1459
+ }, Ba = () => /* @__PURE__ */ e(De, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e(N, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e(
1460
1460
  Y,
1461
1461
  {
1462
1462
  disabled: !B.getCurrentRecord(),
1463
1463
  color: "red",
1464
- leftSection: /* @__PURE__ */ e(ra, {}),
1465
- onClick: La,
1464
+ leftSection: /* @__PURE__ */ e(ta, {}),
1465
+ onClick: Ua,
1466
1466
  children: `${b("archbase:Revoke")}`
1467
1467
  }
1468
1468
  ) }) });
1469
1469
  return /* @__PURE__ */ r(_, { p: "md", style: { height: a, display: "flex", flexDirection: "column" }, children: [
1470
- /* @__PURE__ */ e(ye, { variant: "pills", value: T, onChange: n, children: /* @__PURE__ */ r(ye.List, { children: [
1471
- /* @__PURE__ */ e(ye.Tab, { value: "users", children: `${b("Usuários")}` }),
1472
- /* @__PURE__ */ e(ye.Tab, { value: "groups", children: `${b("Grupos")}` }),
1473
- /* @__PURE__ */ e(ye.Tab, { value: "profiles", children: `${b("Perfis")}` }),
1474
- /* @__PURE__ */ e(ye.Tab, { value: "resources", children: `${b("Recursos")}` }),
1475
- /* @__PURE__ */ e(ye.Tab, { value: "accessTokens", children: `${b("Tokens Acesso")}` })
1470
+ /* @__PURE__ */ e(we, { variant: "pills", value: S, onChange: n, children: /* @__PURE__ */ r(we.List, { children: [
1471
+ /* @__PURE__ */ e(we.Tab, { value: "users", children: `${b("Usuários")}` }),
1472
+ /* @__PURE__ */ e(we.Tab, { value: "groups", children: `${b("Grupos")}` }),
1473
+ /* @__PURE__ */ e(we.Tab, { value: "profiles", children: `${b("Perfis")}` }),
1474
+ /* @__PURE__ */ e(we.Tab, { value: "resources", children: `${b("Recursos")}` }),
1475
+ /* @__PURE__ */ e(we.Tab, { value: "accessTokens", children: `${b("Tokens Acesso")}` })
1476
1476
  ] }) }),
1477
1477
  /* @__PURE__ */ e(
1478
1478
  ze,
1479
1479
  {
1480
- active: T === "users",
1480
+ active: S === "users",
1481
1481
  printTitle: "Usuários",
1482
- gridRef: K,
1483
- dataSource: G,
1482
+ gridRef: j,
1483
+ dataSource: M,
1484
1484
  isLoading: H,
1485
1485
  error: f,
1486
1486
  getRowId: F,
1487
1487
  striped: !0,
1488
1488
  toolbarLeftContent: /* @__PURE__ */ e(
1489
- Je,
1489
+ Xe,
1490
1490
  {
1491
- onAdd: de.handleAdd,
1492
- onEditPermissions: de.handleOpenPermissionsModal,
1491
+ onAdd: ce.handleAdd,
1492
+ onEditPermissions: ce.handleOpenPermissionsModal,
1493
1493
  t: b
1494
1494
  }
1495
1495
  ),
1496
1496
  renderRowActions: Va,
1497
1497
  actionsColumnWidth: c?.userActionsColumnWidth,
1498
- children: Fa
1498
+ children: Na
1499
1499
  }
1500
1500
  ),
1501
1501
  /* @__PURE__ */ e(
1502
1502
  ze,
1503
1503
  {
1504
- active: T === "groups",
1504
+ active: S === "groups",
1505
1505
  printTitle: "Grupos",
1506
- gridRef: L,
1506
+ gridRef: G,
1507
1507
  dataSource: se,
1508
- isLoading: We,
1508
+ isLoading: qe,
1509
1509
  error: f,
1510
1510
  getRowId: Se,
1511
1511
  toolbarLeftContent: /* @__PURE__ */ e(
1512
- Je,
1512
+ Xe,
1513
1513
  {
1514
- onAdd: ue.handleAdd,
1515
- onEditPermissions: ue.handleOpenPermissionsModal,
1514
+ onAdd: de.handleAdd,
1515
+ onEditPermissions: de.handleOpenPermissionsModal,
1516
1516
  t: b
1517
1517
  }
1518
1518
  ),
1519
1519
  renderRowActions: Ma,
1520
1520
  actionsColumnWidth: c?.groupActionsColumnWidth,
1521
- children: Na
1521
+ children: Oa
1522
1522
  }
1523
1523
  ),
1524
1524
  /* @__PURE__ */ e(
1525
1525
  ze,
1526
1526
  {
1527
- active: T === "profiles",
1527
+ active: S === "profiles",
1528
1528
  printTitle: "Perfis",
1529
- gridRef: Z,
1529
+ gridRef: K,
1530
1530
  dataSource: $e,
1531
1531
  isLoading: Ia,
1532
1532
  error: f,
1533
- getRowId: ve,
1533
+ getRowId: ye,
1534
1534
  toolbarLeftContent: /* @__PURE__ */ e(
1535
- Je,
1535
+ Xe,
1536
1536
  {
1537
- onAdd: he.handleAdd,
1538
- onEditPermissions: he.handleOpenPermissionsModal,
1537
+ onAdd: ue.handleAdd,
1538
+ onEditPermissions: ue.handleOpenPermissionsModal,
1539
1539
  t: b
1540
1540
  }
1541
1541
  ),
1542
1542
  renderRowActions: Ga,
1543
1543
  actionsColumnWidth: c?.profileActionsColumnWidth,
1544
- children: Oa
1544
+ children: $a
1545
1545
  }
1546
1546
  ),
1547
1547
  /* @__PURE__ */ e(
1548
1548
  ze,
1549
1549
  {
1550
- active: T === "resources",
1550
+ active: S === "resources",
1551
1551
  printTitle: "Recursos",
1552
1552
  gridRef: E,
1553
- dataSource: za,
1554
- isLoading: Ea,
1553
+ dataSource: Ea,
1554
+ isLoading: Pa,
1555
1555
  error: f,
1556
- getRowId: x,
1556
+ getRowId: R,
1557
1557
  enableRowActions: !1,
1558
- children: $a
1558
+ children: La
1559
1559
  }
1560
1560
  ),
1561
1561
  /* @__PURE__ */ e(
1562
1562
  ze,
1563
1563
  {
1564
- active: T === "accessTokens",
1564
+ active: S === "accessTokens",
1565
1565
  printTitle: "Tokens de API",
1566
1566
  gridRef: O,
1567
1567
  dataSource: B,
1568
- isLoading: M,
1568
+ isLoading: V,
1569
1569
  error: f,
1570
- getRowId: R,
1570
+ getRowId: k,
1571
1571
  striped: !0,
1572
1572
  enableRowActions: !1,
1573
- toolbarLeftContent: Ua(),
1574
- children: Da
1573
+ toolbarLeftContent: Ba(),
1574
+ children: Fa
1575
1575
  }
1576
1576
  ),
1577
1577
  l === X.USER ? /* @__PURE__ */ e(
1578
- yr,
1578
+ wr,
1579
1579
  {
1580
- onClickOk: de.handleSaveModal,
1580
+ onClickOk: ce.handleSaveModal,
1581
1581
  opened: !0,
1582
- dataSource: G,
1583
- onClickCancel: de.handleCancelModal,
1582
+ dataSource: M,
1583
+ onClickCancel: ce.handleCancelModal,
1584
1584
  options: i
1585
1585
  }
1586
1586
  ) : null,
1587
1587
  l === X.GROUP ? /* @__PURE__ */ e(
1588
- wr,
1588
+ Cr,
1589
1589
  {
1590
- onClickOk: ue.handleSaveModal,
1590
+ onClickOk: de.handleSaveModal,
1591
1591
  opened: !0,
1592
1592
  dataSource: se,
1593
- onClickCancel: ue.handleCancelModal,
1594
- options: u
1593
+ onClickCancel: de.handleCancelModal,
1594
+ options: h
1595
1595
  }
1596
1596
  ) : null,
1597
1597
  l === X.PROFILE ? /* @__PURE__ */ e(
1598
- gr,
1598
+ fr,
1599
1599
  {
1600
- onClickOk: he.handleSaveModal,
1600
+ onClickOk: ue.handleSaveModal,
1601
1601
  opened: !0,
1602
1602
  dataSource: $e,
1603
- onClickCancel: he.handleCancelModal,
1604
- options: p
1603
+ onClickCancel: ue.handleCancelModal,
1604
+ options: u
1605
1605
  }
1606
1606
  ) : null,
1607
1607
  v === X.USER ? /* @__PURE__ */ e(
1608
- Ze,
1608
+ Ke,
1609
1609
  {
1610
- dataSource: G,
1610
+ dataSource: M,
1611
1611
  opened: !!v,
1612
- close: je
1612
+ close: Ze
1613
1613
  }
1614
1614
  ) : null,
1615
1615
  v === X.GROUP ? /* @__PURE__ */ e(
1616
- Ze,
1616
+ Ke,
1617
1617
  {
1618
1618
  dataSource: se,
1619
1619
  opened: !!v,
1620
- close: je
1620
+ close: Ze
1621
1621
  }
1622
1622
  ) : null,
1623
1623
  v === X.PROFILE ? /* @__PURE__ */ e(
1624
- Ze,
1624
+ Ke,
1625
1625
  {
1626
1626
  dataSource: $e,
1627
1627
  opened: !!v,
1628
- close: je
1628
+ close: Ze
1629
1629
  }
1630
1630
  ) : null
1631
1631
  ] });
1632
1632
  }
1633
- function it({ height: a = "400px", width: t = "100%" }) {
1634
- aa();
1635
- const o = Ca("apiTokenStore"), i = { validateEntity: () => [] }, { colorScheme: p } = Ue(), [u, c] = k(void 0), I = J(Q.ApiToken), [A, f] = k(""), S = xe(null), T = (L) => L.id, { dataSource: n } = rr({
1633
+ function nt({ height: a = "400px", width: t = "100%" }) {
1634
+ ra();
1635
+ const o = Sa("apiTokenStore"), i = { validateEntity: () => [] }, { colorScheme: u } = Be(), [h, c] = z(void 0), I = J(Q.ApiToken), [x, f] = z(""), C = xe(null), S = (G) => G.id, { dataSource: n } = tr({
1636
1636
  initialData: [],
1637
1637
  name: "dataSource"
1638
1638
  }), s = Ne(
@@ -1640,26 +1640,26 @@ function it({ height: a = "400px", width: t = "100%" }) {
1640
1640
  n,
1641
1641
  void 0,
1642
1642
  void 0
1643
- ), { dataSource: w, isLoading: D } = _e({
1643
+ ), { dataSource: w, isLoading: D } = ea({
1644
1644
  name: "dsApiToken",
1645
1645
  service: I,
1646
1646
  store: o,
1647
1647
  validator: i,
1648
1648
  pageSize: 25,
1649
1649
  loadOnStart: !0,
1650
- onLoadComplete: (L) => {
1650
+ onLoadComplete: (G) => {
1651
1651
  },
1652
- onDestroy: (L) => {
1652
+ onDestroy: (G) => {
1653
1653
  },
1654
- onError: (L, Z) => {
1655
- c(L), te.showError(g().t("archbase:WARNING"), L, Z);
1654
+ onError: (G, K) => {
1655
+ c(G), te.showError(g().t("archbase:WARNING"), G, K);
1656
1656
  }
1657
- }), h = Ne(
1657
+ }), d = Ne(
1658
1658
  "ArchbaseApiTokenView-RemoteDataSource",
1659
1659
  w,
1660
1660
  void 0,
1661
1661
  void 0
1662
- ), l = `calc(${a} - 40px)`, m = /* @__PURE__ */ r(Ie, { children: [
1662
+ ), l = `calc(${a} - 40px)`, m = /* @__PURE__ */ r(ke, { children: [
1663
1663
  /* @__PURE__ */ e(
1664
1664
  P,
1665
1665
  {
@@ -1667,11 +1667,11 @@ function it({ height: a = "400px", width: t = "100%" }) {
1667
1667
  dataType: "image",
1668
1668
  size: 80,
1669
1669
  header: "Foto",
1670
- render: (L) => /* @__PURE__ */ e(
1670
+ render: (G) => /* @__PURE__ */ e(
1671
1671
  "img",
1672
1672
  {
1673
1673
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
1674
- src: L.row.user && L.row.user.avatar ? atob(L.row.user.avatar) : ta
1674
+ src: G.row.user && G.row.user.avatar ? atob(G.row.user.avatar) : ia
1675
1675
  }
1676
1676
  ),
1677
1677
  inputFilterType: "text",
@@ -1747,28 +1747,28 @@ function it({ height: a = "400px", width: t = "100%" }) {
1747
1747
  dataType: "text",
1748
1748
  size: 240,
1749
1749
  header: "Validade",
1750
- render: (L) => {
1751
- if (!L.row.expirationDate)
1752
- return /* @__PURE__ */ e(d, { c: "dimmed", children: "Sem expiração" });
1753
- const Z = /* @__PURE__ */ new Date();
1754
- Z.setHours(0, 0, 0, 0);
1755
- const E = new Date(L.row.expirationDate);
1750
+ render: (G) => {
1751
+ if (!G.row.expirationDate)
1752
+ return /* @__PURE__ */ e(p, { c: "dimmed", children: "Sem expiração" });
1753
+ const K = /* @__PURE__ */ new Date();
1754
+ K.setHours(0, 0, 0, 0);
1755
+ const E = new Date(G.row.expirationDate);
1756
1756
  E.setHours(0, 0, 0, 0);
1757
- const O = E.getTime() - Z.getTime(), F = Math.ceil(O / (1e3 * 60 * 60 * 24));
1758
- let ve = Math.max(0, Math.min(100, F / 365 * 100)), x = "green", R = "";
1759
- F < 0 ? (x = "red", ve = 100, R = `Vencido há ${Math.abs(F)} dia${Math.abs(F) !== 1 ? "s" : ""}`) : F === 0 ? (x = "red", ve = 5, R = "Vence hoje") : F <= 7 ? (x = "red", R = `${F} dia${F !== 1 ? "s" : ""}`) : F <= 30 ? (x = "orange", R = `${F} dias`) : F <= 90 ? (x = "yellow", R = `${F} dias`) : (x = "green", R = `${F} dias`);
1757
+ const O = E.getTime() - K.getTime(), F = Math.ceil(O / (1e3 * 60 * 60 * 24));
1758
+ let ye = Math.max(0, Math.min(100, F / 365 * 100)), R = "green", k = "";
1759
+ F < 0 ? (R = "red", ye = 100, k = `Vencido há ${Math.abs(F)} dia${Math.abs(F) !== 1 ? "s" : ""}`) : F === 0 ? (R = "red", ye = 5, k = "Vence hoje") : F <= 7 ? (R = "red", k = `${F} dia${F !== 1 ? "s" : ""}`) : F <= 30 ? (R = "orange", k = `${F} dias`) : F <= 90 ? (R = "yellow", k = `${F} dias`) : (R = "green", k = `${F} dias`);
1760
1760
  const B = F < 0 ? `Vencido em ${E.toLocaleDateString()}` : `Expira em ${E.toLocaleDateString()}`;
1761
1761
  return /* @__PURE__ */ e(Re, { label: B, withArrow: !0, children: /* @__PURE__ */ r(N, { gap: "xs", wrap: "nowrap", children: [
1762
1762
  /* @__PURE__ */ e(
1763
- Ba,
1763
+ Wa,
1764
1764
  {
1765
1765
  size: 36,
1766
1766
  thickness: 4,
1767
1767
  roundCaps: !0,
1768
- sections: [{ value: F < 0 ? 100 : ve, color: x }]
1768
+ sections: [{ value: F < 0 ? 100 : ye, color: R }]
1769
1769
  }
1770
1770
  ),
1771
- /* @__PURE__ */ e(d, { size: "sm", c: F < 0 ? "red" : void 0, fw: F <= 7 ? 600 : void 0, children: R })
1771
+ /* @__PURE__ */ e(p, { size: "sm", c: F < 0 ? "red" : void 0, fw: F <= 7 ? 600 : void 0, children: k })
1772
1772
  ] }) });
1773
1773
  },
1774
1774
  inputFilterType: "text"
@@ -1793,9 +1793,9 @@ function it({ height: a = "400px", width: t = "100%" }) {
1793
1793
  }
1794
1794
  )
1795
1795
  ] }), v = () => {
1796
- n.insert(cr.newInstance()), n && !s.isDataSourceV2 && s.v1State.forceUpdate(), f("apiToken");
1797
- }, C = () => {
1798
- w.getCurrentRecord() && pe.showConfirmDialogYesNo(
1796
+ n.insert(dr.newInstance()), n && !s.isDataSourceV2 && s.v1State.forceUpdate(), f("apiToken");
1797
+ }, T = () => {
1798
+ w.getCurrentRecord() && he.showConfirmDialogYesNo(
1799
1799
  `${g().t("archbase:Confirme")}`,
1800
1800
  `${g().t("archbase:Deseja revogar o token de API do usuário ")}${w.getCurrentRecord().user.name} ?`,
1801
1801
  async () => {
@@ -1803,26 +1803,26 @@ function it({ height: a = "400px", width: t = "100%" }) {
1803
1803
  te.showSuccess(
1804
1804
  `${g().t("mentors:Informação")}`,
1805
1805
  `${g().t("mentors:Token de API revogado com sucesso!")}`
1806
- ), w.refreshData(), w && !h.isDataSourceV2 && h.v1State.forceUpdate();
1807
- }).catch((L) => {
1808
- pe.showErrorWithDetails(
1806
+ ), w.refreshData(), w && !d.isDataSourceV2 && d.v1State.forceUpdate();
1807
+ }).catch((G) => {
1808
+ he.showErrorWithDetails(
1809
1809
  `${g().t("mentors:Atenção")}`,
1810
- ge(L),
1811
- Me(L)
1810
+ ge(G),
1811
+ Ve(G)
1812
1812
  );
1813
1813
  });
1814
1814
  },
1815
1815
  () => {
1816
1816
  }
1817
1817
  );
1818
- }, z = () => {
1818
+ }, A = () => {
1819
1819
  f("");
1820
- }, b = async (L, Z) => {
1820
+ }, b = async (G, K) => {
1821
1821
  const E = n.getCurrentRecord();
1822
1822
  if (E)
1823
1823
  try {
1824
1824
  if (n.validate(), !E.user || !E.user.email) {
1825
- pe.showErrorWithDetails(
1825
+ he.showErrorWithDetails(
1826
1826
  `${g().t("archbase:WARNING")}`,
1827
1827
  `${g().t("archbase:Selecione um usuário para o token de API")}`,
1828
1828
  ""
@@ -1830,22 +1830,22 @@ function it({ height: a = "400px", width: t = "100%" }) {
1830
1830
  return;
1831
1831
  }
1832
1832
  await I.create(E.user.email, E.expirationDate, E.name, E.description).then(async (O) => {
1833
- n.cancel(), n && !s.isDataSourceV2 && s.v1State.forceUpdate(), w.append(O), w && !h.isDataSourceV2 && h.v1State.forceUpdate(), te.showSuccess(
1833
+ n.cancel(), n && !s.isDataSourceV2 && s.v1State.forceUpdate(), w.append(O), w && !d.isDataSourceV2 && d.v1State.forceUpdate(), te.showSuccess(
1834
1834
  `${g().t("mentors:Informação")}`,
1835
1835
  `${g().t("mentors:Token de API gerado com sucesso!")}`
1836
- ), Z && Z(!0);
1836
+ ), K && K(!0);
1837
1837
  }).catch((O) => {
1838
- pe.showErrorWithDetails(
1838
+ he.showErrorWithDetails(
1839
1839
  `${g().t("mentors:Atenção")}`,
1840
1840
  ge(O),
1841
- Me(O)
1841
+ Ve(O)
1842
1842
  );
1843
1843
  });
1844
1844
  } catch (O) {
1845
- pe.showErrorWithDetails(
1845
+ he.showErrorWithDetails(
1846
1846
  `${g().t("mentors:Atenção")}`,
1847
1847
  ge(O),
1848
- Me(O)
1848
+ Ve(O)
1849
1849
  );
1850
1850
  }
1851
1851
  };
@@ -1863,9 +1863,9 @@ function it({ height: a = "400px", width: t = "100%" }) {
1863
1863
  overflow: "auto"
1864
1864
  },
1865
1865
  children: /* @__PURE__ */ e(
1866
- wa,
1866
+ Ca,
1867
1867
  {
1868
- gridRef: S,
1868
+ gridRef: C,
1869
1869
  printTitle: "Tokens de API",
1870
1870
  width: "100%",
1871
1871
  height: "100%",
@@ -1877,32 +1877,32 @@ function it({ height: a = "400px", width: t = "100%" }) {
1877
1877
  enableRowActions: !1,
1878
1878
  pageSize: 50,
1879
1879
  isLoading: D,
1880
- isError: !!u,
1881
- error: u,
1880
+ isError: !!h,
1881
+ error: h,
1882
1882
  enableGlobalFilter: !0,
1883
- getRowId: T,
1883
+ getRowId: S,
1884
1884
  toolbarLeftContent: /* @__PURE__ */ e(De, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ r(N, { align: "start", gap: "2px", wrap: "nowrap", children: [
1885
- /* @__PURE__ */ e(Y, { color: "green", leftSection: /* @__PURE__ */ e(xa, {}), onClick: v, children: g().t("archbase:New") }),
1886
- /* @__PURE__ */ e(Y, { disabled: !w.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(ra, {}), onClick: C, children: g().t("archbase:Revoke") })
1885
+ /* @__PURE__ */ e(Y, { color: "green", leftSection: /* @__PURE__ */ e(Ra, {}), onClick: v, children: g().t("archbase:New") }),
1886
+ /* @__PURE__ */ e(Y, { disabled: !w.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e(ta, {}), onClick: T, children: g().t("archbase:Revoke") })
1887
1887
  ] }) }),
1888
1888
  children: m
1889
1889
  }
1890
1890
  )
1891
1891
  }
1892
1892
  ),
1893
- A === "apiToken" ? /* @__PURE__ */ e(
1894
- Sr,
1893
+ x === "apiToken" ? /* @__PURE__ */ e(
1894
+ Tr,
1895
1895
  {
1896
- onClickOk: z,
1896
+ onClickOk: A,
1897
1897
  opened: !0,
1898
1898
  dataSource: n,
1899
1899
  onCustomSave: b,
1900
- onClickCancel: z
1900
+ onClickCancel: A
1901
1901
  }
1902
1902
  ) : null
1903
1903
  ] });
1904
1904
  }
1905
- const Le = (a) => {
1905
+ const Ge = (a) => {
1906
1906
  switch (a) {
1907
1907
  case "critical":
1908
1908
  return "red";
@@ -1913,7 +1913,7 @@ const Le = (a) => {
1913
1913
  default:
1914
1914
  return "gray";
1915
1915
  }
1916
- }, Er = ({ card: a, onOpen: t }) => {
1916
+ }, Pr = ({ card: a, onOpen: t }) => {
1917
1917
  const o = !!(t && a.metric);
1918
1918
  return /* @__PURE__ */ e(
1919
1919
  _,
@@ -1929,93 +1929,98 @@ const Le = (a) => {
1929
1929
  (i.key === "Enter" || i.key === " ") && (i.preventDefault(), t?.(a));
1930
1930
  } : void 0,
1931
1931
  style: {
1932
- borderLeft: `3px solid var(--mantine-color-${Le(a.severity)}-6)`,
1932
+ borderLeft: `3px solid var(--mantine-color-${Ge(a.severity)}-6)`,
1933
1933
  cursor: o ? "pointer" : void 0
1934
1934
  },
1935
- children: /* @__PURE__ */ r(V, { gap: 4, children: [
1935
+ children: /* @__PURE__ */ r(L, { gap: 4, children: [
1936
1936
  /* @__PURE__ */ r(N, { gap: 8, align: "baseline", wrap: "wrap", children: [
1937
- /* @__PURE__ */ e(d, { fw: 600, size: "1.7rem", lh: 1.05, c: Le(a.severity), children: a.value }),
1938
- a.of ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: a.of }) : null
1937
+ /* @__PURE__ */ e(p, { fw: 600, size: "1.7rem", lh: 1.05, c: Ge(a.severity), children: a.value }),
1938
+ a.of ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: a.of }) : null
1939
1939
  ] }),
1940
- /* @__PURE__ */ e(d, { size: "sm", fw: 550, children: a.label }),
1941
- a.description ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
1940
+ /* @__PURE__ */ e(p, { size: "sm", fw: 550, children: a.label }),
1941
+ a.description ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", lh: 1.45, children: a.description }) : null
1942
1942
  ] })
1943
1943
  }
1944
1944
  );
1945
- }, Pr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(Be, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((o, i) => /* @__PURE__ */ e(Er, { card: o, onOpen: t }, `${o.label}-${i}`)) }), Dr = ({ flags: a }) => /* @__PURE__ */ e(Be, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 3, children: [
1946
- /* @__PURE__ */ e(d, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
1945
+ }, Dr = ({ cards: a, onOpenCard: t }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 3, xl: 4 }, spacing: "xs", children: a.map((o, i) => /* @__PURE__ */ e(Pr, { card: o, onOpen: t }, `${o.label}-${i}`)) }), Fr = ({ flags: a }) => /* @__PURE__ */ e(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: a.map((t) => /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(L, { gap: 3, children: [
1946
+ /* @__PURE__ */ e(p, { size: "10px", c: "dimmed", ff: "monospace", style: { wordBreak: "break-all" }, children: t.key }),
1947
1947
  /* @__PURE__ */ r(N, { gap: 7, wrap: "nowrap", children: [
1948
- /* @__PURE__ */ e(j, { size: "xs", circle: !0, color: Le(t.severity) }),
1949
- /* @__PURE__ */ e(d, { size: "sm", fw: 550, children: t.value })
1948
+ /* @__PURE__ */ e(Z, { size: "xs", circle: !0, color: Ge(t.severity) }),
1949
+ /* @__PURE__ */ e(p, { size: "sm", fw: 550, children: t.value })
1950
1950
  ] }),
1951
- t.description ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
1952
- ] }) }, t.key)) }), Fr = ({ attributes: a }) => /* @__PURE__ */ e(V, { gap: 7, children: a.map((t, o) => /* @__PURE__ */ r(N, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
1953
- /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: t.label }),
1954
- /* @__PURE__ */ e(d, { size: "sm", fw: 600, ta: "right", children: t.value })
1955
- ] }, `${t.label}-${o}`)) }), be = ({ title: a, hint: t, children: o }) => /* @__PURE__ */ r(V, { gap: "xs", children: [
1951
+ t.description ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", lh: 1.4, children: t.description }) : null
1952
+ ] }) }, t.key)) }), Nr = ({ attributes: a }) => /* @__PURE__ */ e(L, { gap: 7, children: a.map((t, o) => /* @__PURE__ */ r(N, { gap: 12, wrap: "nowrap", justify: "space-between", children: [
1953
+ /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: t.label }),
1954
+ /* @__PURE__ */ e(p, { size: "sm", fw: 600, ta: "right", children: t.value })
1955
+ ] }, `${t.label}-${o}`)) }), ve = ({ title: a, hint: t, children: o }) => /* @__PURE__ */ r(L, { gap: "xs", children: [
1956
1956
  /* @__PURE__ */ r(N, { gap: 10, align: "baseline", wrap: "wrap", children: [
1957
- /* @__PURE__ */ e(d, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
1958
- t ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: t }) : null
1957
+ /* @__PURE__ */ e(p, { size: "xs", fw: 650, tt: "uppercase", style: { letterSpacing: ".05em" }, children: a }),
1958
+ t ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: t }) : null
1959
1959
  ] }),
1960
1960
  o
1961
- ] }), Nr = 25, Or = ({ card: a, onClose: t }) => {
1961
+ ] }), Ue = ({ children: a, maxHeight: t = 420 }) => /* @__PURE__ */ e(fe.Autosize, { mah: t, type: "hover", offsetScrollbars: !0, children: /* @__PURE__ */ e(y.ScrollContainer, { minWidth: 480, type: "native", children: a }) }), Or = 25, $r = ({ card: a, onClose: t }) => {
1962
1962
  const o = J(
1963
1963
  Q.SecurityDiagnostics
1964
- ), [i, p] = k([]), [u, c] = k(1), [I, A] = k(1), [f, S] = k(0), [T, n] = k(!1), [s, w] = k(null), D = a?.metric;
1964
+ ), [i, u] = z([]), [h, c] = z(1), [I, x] = z(1), [f, C] = z(0), [S, n] = z(!1), [s, w] = z(null), D = a?.metric;
1965
1965
  return ee(() => {
1966
1966
  c(1);
1967
1967
  }, [D]), ee(() => {
1968
1968
  if (!D)
1969
1969
  return;
1970
- let h = !1;
1971
- return n(!0), w(null), o.getOverviewItems(D, u - 1, Nr).then((l) => {
1972
- h || (p(l.content ?? []), S(l.totalElements ?? 0), A(Math.max(l.totalPages ?? 1, 1)));
1970
+ let d = !1;
1971
+ return n(!0), w(null), o.getOverviewItems(D, h - 1, Or).then((l) => {
1972
+ d || (u(l.content ?? []), C(l.totalElements ?? 0), x(Math.max(l.totalPages ?? 1, 1)));
1973
1973
  }).catch((l) => {
1974
- h || w(l instanceof Error ? l.message : "Não foi possível carregar os itens.");
1974
+ d || w(l instanceof Error ? l.message : "Não foi possível carregar os itens.");
1975
1975
  }).finally(() => {
1976
- h || n(!1);
1976
+ d || n(!1);
1977
1977
  }), () => {
1978
- h = !0;
1978
+ d = !0;
1979
1979
  };
1980
- }, [o, D, u]), /* @__PURE__ */ e(
1981
- Wa,
1980
+ }, [o, D, h]), /* @__PURE__ */ e(
1981
+ qa,
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(d, { fw: 600, children: a?.label }),
1989
- a?.description ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", lh: 1.4, children: a.description }) : null
1987
+ title: /* @__PURE__ */ r(L, { gap: 2, children: [
1988
+ /* @__PURE__ */ e(p, { fw: 600, children: a?.label }),
1989
+ a?.description ? /* @__PURE__ */ e(p, { 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(L, { gap: "sm", children: [
1992
1992
  /* @__PURE__ */ r(N, { gap: 8, children: [
1993
- /* @__PURE__ */ r(j, { variant: "light", children: [
1993
+ /* @__PURE__ */ r(Z, { variant: "light", children: [
1994
1994
  f,
1995
1995
  " ",
1996
1996
  f === 1 ? "item" : "itens"
1997
1997
  ] }),
1998
- T ? /* @__PURE__ */ e(ce, { size: "xs" }) : null
1998
+ S ? /* @__PURE__ */ e(le, { size: "xs" }) : null
1999
1999
  ] }),
2000
- s ? /* @__PURE__ */ e(fe, { color: "red", title: "Erro ao carregar", children: s }) : null,
2001
- !T && !s && i.length === 0 ? /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
2002
- i.length > 0 ? /* @__PURE__ */ r(y, { striped: !0, highlightOnHover: !0, withTableBorder: !0, children: [
2003
- /* @__PURE__ */ e(y.Thead, { children: /* @__PURE__ */ r(y.Tr, { children: [
2004
- /* @__PURE__ */ e(y.Th, { children: "Item" }),
2005
- /* @__PURE__ */ e(y.Th, { children: "Onde" }),
2006
- /* @__PURE__ */ e(y.Th, { children: "Por que está aqui" })
2007
- ] }) }),
2008
- /* @__PURE__ */ e(y.Tbody, { children: i.map((h) => /* @__PURE__ */ r(y.Tr, { children: [
2009
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(d, { size: "sm", fw: 550, children: h.label }) }),
2010
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: h.detail }) }),
2011
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(d, { size: "xs", children: h.reason }) })
2012
- ] }, h.id)) })
2013
- ] }) : null,
2014
- I > 1 ? /* @__PURE__ */ e(N, { justify: "center", children: /* @__PURE__ */ e(qa, { value: u, onChange: c, total: I, size: "sm" }) }) : null
2000
+ s ? /* @__PURE__ */ e(be, { color: "red", title: "Erro ao carregar", children: s }) : null,
2001
+ !S && !s && i.length === 0 ? /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: "Nada aqui — o número é zero." }) : null,
2002
+ i.length > 0 ? (
2003
+ // O scroll fica NA TABELA, não no drawer: rolando o drawer, o cabeçalho some e
2004
+ // uma coluna de valores sem cabeçalho deixa de dizer o que é. Aqui o cabeçalho
2005
+ // gruda e o título, a contagem e a paginação ficam onde estavam.
2006
+ /* @__PURE__ */ e(Ue, { maxHeight: "calc(100vh - 260px)", children: /* @__PURE__ */ r(y, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2007
+ /* @__PURE__ */ e(y.Thead, { children: /* @__PURE__ */ r(y.Tr, { children: [
2008
+ /* @__PURE__ */ e(y.Th, { children: "Item" }),
2009
+ /* @__PURE__ */ e(y.Th, { children: "Onde" }),
2010
+ /* @__PURE__ */ e(y.Th, { children: "Por que está aqui" })
2011
+ ] }) }),
2012
+ /* @__PURE__ */ e(y.Tbody, { children: i.map((d) => /* @__PURE__ */ r(y.Tr, { children: [
2013
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(p, { size: "sm", fw: 550, children: d.label }) }),
2014
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: d.detail }) }),
2015
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(p, { size: "xs", children: d.reason }) })
2016
+ ] }, d.id)) })
2017
+ ] }) })
2018
+ ) : null,
2019
+ I > 1 ? /* @__PURE__ */ e(N, { justify: "center", children: /* @__PURE__ */ e(Ha, { value: h, onChange: c, total: I, size: "sm" }) }) : null
2015
2020
  ] })
2016
2021
  }
2017
2022
  );
2018
- }, $r = (a, t) => t > 0 ? ` · ${Math.round(a / t * 100)}%` : "", Vr = (a) => {
2023
+ }, Lr = (a, t) => t > 0 ? ` · ${Math.round(a / t * 100)}%` : "", Vr = (a) => {
2019
2024
  const t = a.flags;
2020
2025
  return [
2021
2026
  {
@@ -2052,7 +2057,7 @@ const Le = (a) => {
2052
2057
  severity: "critical",
2053
2058
  value: a.permissionsPointingToInactive,
2054
2059
  metric: "PERMISSIONS_POINTING_TO_INACTIVE",
2055
- of: `de ${a.permissions}${$r(a.permissionsPointingToInactive, a.permissions)}`,
2060
+ of: `de ${a.permissions}${Lr(a.permissionsPointingToInactive, a.permissions)}`,
2056
2061
  label: "Permissões inertes",
2057
2062
  description: "Apontam para ação ou recurso inativo. É o acesso que o operador acredita ter concedido."
2058
2063
  },
@@ -2096,18 +2101,18 @@ const Le = (a) => {
2096
2101
  label: "Ninguém tem",
2097
2102
  description: "Capacidade existe no catálogo e não foi concedida a ninguém."
2098
2103
  }
2099
- ], pa = ({ slots: a, onError: t }) => {
2104
+ ], ma = ({ slots: a, onError: t }) => {
2100
2105
  const o = J(
2101
2106
  Q.SecurityDiagnostics
2102
- ), [i, p] = k(void 0), [u, c] = k(!0), [I, A] = k(void 0), [f, S] = k(null);
2107
+ ), [i, u] = z(void 0), [h, c] = z(!0), [I, x] = z(void 0), [f, C] = z(null);
2103
2108
  ee(() => {
2104
2109
  let s = !0;
2105
2110
  return c(!0), o.getOverview().then((w) => {
2106
- s && (p(w), A(void 0));
2111
+ s && (u(w), x(void 0));
2107
2112
  }).catch((w) => {
2108
2113
  if (s) {
2109
2114
  const D = ge(w);
2110
- A(D), t?.(D);
2115
+ x(D), t?.(D);
2111
2116
  }
2112
2117
  }).finally(() => {
2113
2118
  s && c(!1);
@@ -2115,53 +2120,53 @@ const Le = (a) => {
2115
2120
  s = !1;
2116
2121
  };
2117
2122
  }, [o]);
2118
- const T = ie(
2123
+ const S = ie(
2119
2124
  () => i ? [...Vr(i), ...a?.additionalFlags?.(i) ?? []] : [],
2120
2125
  [i, a]
2121
2126
  ), n = ie(
2122
2127
  () => i ? [...Mr(i), ...a?.additionalOverviewCards?.(i) ?? []] : [],
2123
2128
  [i, a]
2124
2129
  );
2125
- return u ? /* @__PURE__ */ e(ce, { size: "sm" }) : I ? /* @__PURE__ */ e(fe, { color: "red", title: "Não foi possível ler o diagnóstico", children: I }) : i ? /* @__PURE__ */ r(V, { gap: "lg", children: [
2126
- /* @__PURE__ */ r(be, { title: "Proteções", hint: "de AccessOverview.flags", children: [
2127
- /* @__PURE__ */ e(Dr, { flags: T }),
2128
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
2130
+ return h ? /* @__PURE__ */ e(le, { size: "sm" }) : I ? /* @__PURE__ */ e(be, { color: "red", title: "Não foi possível ler o diagnóstico", children: I }) : i ? /* @__PURE__ */ r(L, { gap: "lg", children: [
2131
+ /* @__PURE__ */ r(ve, { title: "Proteções", hint: "de AccessOverview.flags", children: [
2132
+ /* @__PURE__ */ e(Fr, { flags: S }),
2133
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", lh: 1.45, children: "Todas nascem com o padrão compatível — ligadas só quando alguém decide." })
2129
2134
  ] }),
2130
- /* @__PURE__ */ e(be, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Pr, { cards: n, onOpenCard: S }) }),
2135
+ /* @__PURE__ */ e(ve, { title: "Catálogo e concessões", hint: "contagens vivas", children: /* @__PURE__ */ e(Dr, { cards: n, onOpenCard: C }) }),
2131
2136
  a?.afterOverview?.(i),
2132
- /* @__PURE__ */ e(Or, { card: f, onClose: () => S(null) })
2137
+ /* @__PURE__ */ e($r, { card: f, onClose: () => C(null) })
2133
2138
  ] }) : null;
2134
- }, ma = {
2139
+ }, ga = {
2135
2140
  EFFECTIVE: { label: "Efetiva", color: "green" },
2136
2141
  INERT: { label: "Inerte", color: "orange" },
2137
2142
  DENIED: { label: "Negada", color: "red" }
2138
- }, Gr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, Lr = [
2143
+ }, Gr = { GROUP: "grupo", PROFILE: "perfil", USER: "direto" }, Ur = [
2139
2144
  { value: "all", label: "Todas" },
2140
2145
  { value: "EFFECTIVE", label: "Só efetivas" },
2141
2146
  { value: "INERT", label: "Só inertes" },
2142
2147
  { value: "DENIED", label: "Negadas" },
2143
2148
  { value: "inherited", label: "Só herdadas" }
2144
- ], Ur = ({ slots: a, onError: t, userId: o }) => {
2149
+ ], Br = ({ slots: a, onError: t, userId: o }) => {
2145
2150
  const i = J(
2146
2151
  Q.SecurityDiagnostics
2147
- ), [p, u] = k(""), [c, I] = k(void 0), [A, f] = k(!1), [S, T] = k(void 0), [n, s] = k("all"), w = !!o, D = oe(
2152
+ ), [u, h] = z(""), [c, I] = z(void 0), [x, f] = z(!1), [C, S] = z(void 0), [n, s] = z("all"), w = !!o, D = oe(
2148
2153
  async (v) => {
2149
- const C = v.trim();
2150
- if (C) {
2151
- f(!0), T(void 0);
2154
+ const T = v.trim();
2155
+ if (T) {
2156
+ f(!0), S(void 0);
2152
2157
  try {
2153
- const z = C.includes("@") ? await i.getEffectiveAccessByEmail(C) : await i.getEffectiveAccessByUserId(C);
2154
- I(z);
2155
- } catch (z) {
2156
- const b = ge(z);
2157
- T(b), t?.(b), I(void 0);
2158
+ const A = T.includes("@") ? await i.getEffectiveAccessByEmail(T) : await i.getEffectiveAccessByUserId(T);
2159
+ I(A);
2160
+ } catch (A) {
2161
+ const b = ge(A);
2162
+ S(b), t?.(b), I(void 0);
2158
2163
  } finally {
2159
2164
  f(!1);
2160
2165
  }
2161
2166
  }
2162
2167
  },
2163
2168
  [i, t]
2164
- ), h = ie(() => c ? [
2169
+ ), d = ie(() => c ? [
2165
2170
  { label: "Perfil", value: c.profileName || "—" },
2166
2171
  { label: "Grupos", value: c.groupNames.length ? c.groupNames.join(", ") : "—" },
2167
2172
  ...a?.userAttributes?.(c) ?? []
@@ -2170,9 +2175,9 @@ const Le = (a) => {
2170
2175
  o && (s("all"), D(o));
2171
2176
  }, [o, D]);
2172
2177
  const m = a?.additionalCapabilityColumns ?? [];
2173
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2174
- w ? null : /* @__PURE__ */ e(be, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((v) => {
2175
- u(v), D(v);
2178
+ return /* @__PURE__ */ r(L, { gap: "lg", children: [
2179
+ w ? null : /* @__PURE__ */ e(ve, { title: "Consultar", hint: "por e-mail ou id do usuário", children: a?.renderUserSearch ? a.renderUserSearch((v) => {
2180
+ h(v), D(v);
2176
2181
  }) : /* @__PURE__ */ r(N, { gap: "xs", align: "flex-end", children: [
2177
2182
  /* @__PURE__ */ e(
2178
2183
  me,
@@ -2180,44 +2185,44 @@ const Le = (a) => {
2180
2185
  style: { flex: 1, minWidth: 240 },
2181
2186
  label: "Usuário",
2182
2187
  placeholder: "pessoa@empresa.com.br",
2183
- value: p,
2184
- onChange: (v) => u(v.currentTarget.value),
2188
+ value: u,
2189
+ onChange: (v) => h(v.currentTarget.value),
2185
2190
  onKeyDown: (v) => {
2186
- v.key === "Enter" && D(p);
2191
+ v.key === "Enter" && D(u);
2187
2192
  }
2188
2193
  }
2189
2194
  ),
2190
- /* @__PURE__ */ e(Y, { onClick: () => void D(p), loading: A, children: "Consultar" })
2195
+ /* @__PURE__ */ e(Y, { onClick: () => void D(u), loading: x, children: "Consultar" })
2191
2196
  ] }) }),
2192
- S ? /* @__PURE__ */ e(fe, { color: "red", title: "Não foi possível ler o efetivo", children: S }) : null,
2193
- A && !c ? /* @__PURE__ */ e(ce, { size: "sm" }) : null,
2197
+ C ? /* @__PURE__ */ e(be, { color: "red", title: "Não foi possível ler o efetivo", children: C }) : null,
2198
+ x && !c ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
2194
2199
  c ? /* @__PURE__ */ r(Pe, { children: [
2195
- /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
2200
+ /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(L, { gap: "sm", children: [
2196
2201
  /* @__PURE__ */ r(N, { gap: 8, wrap: "wrap", align: "center", children: [
2197
- /* @__PURE__ */ e(d, { fw: 620, children: c.userLabel }),
2198
- c.administrator ? /* @__PURE__ */ e(j, { color: "red", children: "administrador" }) : null,
2199
- c.enabled ? null : /* @__PURE__ */ e(j, { color: "red", children: "conta desativada" }),
2202
+ /* @__PURE__ */ e(p, { fw: 620, children: c.userLabel }),
2203
+ c.administrator ? /* @__PURE__ */ e(Z, { color: "red", children: "administrador" }) : null,
2204
+ c.enabled ? null : /* @__PURE__ */ e(Z, { color: "red", children: "conta desativada" }),
2200
2205
  a?.afterUserBadges?.(c)
2201
2206
  ] }),
2202
- /* @__PURE__ */ e(Fr, { attributes: h })
2207
+ /* @__PURE__ */ e(Nr, { attributes: d })
2203
2208
  ] }) }),
2204
- c.administrator ? /* @__PURE__ */ r(fe, { color: "orange", title: "Administrador passa direto", children: [
2209
+ c.administrator ? /* @__PURE__ */ r(be, { color: "orange", title: "Administrador passa direto", children: [
2205
2210
  "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 ",
2206
2211
  /* @__PURE__ */ e("code", { children: "isAdministrator" }),
2207
2212
  " representa."
2208
2213
  ] }) : null,
2209
- /* @__PURE__ */ e(Be, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
2214
+ /* @__PURE__ */ e(We, { cols: { base: 2, sm: 4 }, spacing: "xs", children: [
2210
2215
  ["concedidas", c.granted, "neutral"],
2211
2216
  ["efetivas", c.effective, "ok"],
2212
2217
  ["inertes", c.inert, "warning"],
2213
2218
  ["negadas", c.denied, "critical"]
2214
- ].map(([v, C, z]) => /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(V, { gap: 2, children: [
2215
- /* @__PURE__ */ e(d, { size: "1.3rem", fw: 620, c: Le(z), children: C }),
2216
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: v })
2219
+ ].map(([v, T, A]) => /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "sm", children: /* @__PURE__ */ r(L, { gap: 2, children: [
2220
+ /* @__PURE__ */ e(p, { size: "1.3rem", fw: 620, c: Ge(A), children: T }),
2221
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: v })
2217
2222
  ] }) }, v)) }),
2218
2223
  a?.afterEffectiveTally?.(c),
2219
- /* @__PURE__ */ r(be, { title: "Capacidades", hint: `${l.length} de ${c.capabilities.length}`, children: [
2220
- /* @__PURE__ */ e(sa.Group, { multiple: !1, value: n, onChange: (v) => s(v), children: /* @__PURE__ */ e(N, { gap: 6, children: Lr.map((v) => /* @__PURE__ */ e(sa, { value: v.value, size: "xs", variant: "outline", children: v.label }, v.value)) }) }),
2224
+ /* @__PURE__ */ r(ve, { title: "Capacidades", hint: `${l.length} de ${c.capabilities.length}`, children: [
2225
+ /* @__PURE__ */ e(la.Group, { multiple: !1, value: n, onChange: (v) => s(v), children: /* @__PURE__ */ e(N, { gap: 6, children: Ur.map((v) => /* @__PURE__ */ e(la, { value: v.value, size: "xs", variant: "outline", children: v.label }, v.value)) }) }),
2221
2226
  /* @__PURE__ */ e(y.ScrollContainer, { minWidth: 640, children: /* @__PURE__ */ r(y, { striped: !0, highlightOnHover: !0, withTableBorder: !0, children: [
2222
2227
  /* @__PURE__ */ e(y.Thead, { children: /* @__PURE__ */ r(y.Tr, { children: [
2223
2228
  /* @__PURE__ */ e(y.Th, { children: "Capacidade" }),
@@ -2226,74 +2231,74 @@ const Le = (a) => {
2226
2231
  m.map((v) => /* @__PURE__ */ e(y.Th, { children: v.header }, v.header))
2227
2232
  ] }) }),
2228
2233
  /* @__PURE__ */ r(y.Tbody, { children: [
2229
- l.map((v, C) => /* @__PURE__ */ r(y.Tr, { children: [
2230
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(d, { size: "sm", ff: "monospace", children: [
2234
+ l.map((v, T) => /* @__PURE__ */ r(y.Tr, { children: [
2235
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(p, { size: "sm", ff: "monospace", children: [
2231
2236
  v.resource,
2232
2237
  ":",
2233
2238
  v.action
2234
2239
  ] }) }),
2235
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(d, { size: "sm", children: [
2236
- /* @__PURE__ */ r(d, { span: !0, c: "dimmed", children: [
2240
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(p, { size: "sm", children: [
2241
+ /* @__PURE__ */ r(p, { span: !0, c: "dimmed", children: [
2237
2242
  Gr[v.grantedByType] ?? v.grantedByType,
2238
2243
  " "
2239
2244
  ] }),
2240
2245
  v.grantedByName
2241
2246
  ] }) }),
2242
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(j, { color: ma[v.situation].color, variant: "light", children: ma[v.situation].label }) }),
2243
- m.map((z) => /* @__PURE__ */ e(y.Td, { children: z.render(v, c) }, z.header))
2244
- ] }, `${v.resource}:${v.action}:${C}`)),
2245
- l.length === 0 ? /* @__PURE__ */ e(y.Tr, { children: /* @__PURE__ */ e(y.Td, { colSpan: 3 + m.length, children: /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
2247
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(Z, { color: ga[v.situation].color, variant: "light", children: ga[v.situation].label }) }),
2248
+ m.map((A) => /* @__PURE__ */ e(y.Td, { children: A.render(v, c) }, A.header))
2249
+ ] }, `${v.resource}:${v.action}:${T}`)),
2250
+ l.length === 0 ? /* @__PURE__ */ e(y.Tr, { children: /* @__PURE__ */ e(y.Td, { colSpan: 3 + m.length, children: /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", ta: "center", py: "md", children: "Nenhuma capacidade neste filtro." }) }) }) : null
2246
2251
  ] })
2247
2252
  ] }) })
2248
2253
  ] })
2249
2254
  ] }) : null
2250
2255
  ] });
2251
- }, Br = [
2256
+ }, Wr = [
2252
2257
  { gate: "IDENTITY", titulo: "Identidade", papel: "só nega", pergunta: "O principal é resolvível e a conta está ativa?" },
2253
2258
  { gate: "SCOPE", titulo: "Escopo", papel: "só nega", pergunta: "A concessão vale para o tenant, empresa e projeto pedidos?" },
2254
2259
  { gate: "RESTRICTION", titulo: "Restrições", papel: "só nega", pergunta: "Perfil, papel e persona exigidos pela anotação." },
2255
2260
  { gate: "LEVEL", titulo: "Nível", papel: "só nega", pergunta: "O nível da pessoa alcança o piso da capacidade?" },
2256
2261
  { gate: "GRANT", titulo: "Concessão", papel: "concede", pergunta: "Existe permissão, sem negação explícita?" }
2257
- ], Wr = ({ slots: a, onError: t, initial: o }) => {
2262
+ ], qr = ({ slots: a, onError: t, initial: o }) => {
2258
2263
  const i = J(
2259
2264
  Q.SecurityDiagnostics
2260
- ), [p, u] = k(""), [c, I] = k(""), [A, f] = k(""), [S, T] = k({}), [n, s] = k(void 0), [w, D] = k(!1), [h, l] = k(void 0);
2265
+ ), [u, h] = z(""), [c, I] = z(""), [x, f] = z(""), [C, S] = z({}), [n, s] = z(void 0), [w, D] = z(!1), [d, l] = z(void 0);
2261
2266
  ee(() => {
2262
- o && (o.userId && u(o.userId), o.resource && I(o.resource), o.action && f(o.action), s(void 0));
2267
+ o && (o.userId && h(o.userId), o.resource && I(o.resource), o.action && f(o.action), s(void 0));
2263
2268
  }, [o?.userId, o?.resource, o?.action]);
2264
2269
  const m = oe(async () => {
2265
- if (!(!p.trim() || !c.trim() || !A.trim())) {
2270
+ if (!(!u.trim() || !c.trim() || !x.trim())) {
2266
2271
  D(!0), l(void 0);
2267
2272
  try {
2268
- const C = p.trim(), z = await i.simulate({
2269
- ...C.includes("@") ? { email: C } : { userId: C },
2273
+ const T = u.trim(), A = await i.simulate({
2274
+ ...T.includes("@") ? { email: T } : { userId: T },
2270
2275
  resource: c.trim(),
2271
- action: A.trim(),
2272
- companyId: S.companyId,
2273
- projectId: S.projectId
2276
+ action: x.trim(),
2277
+ companyId: C.companyId,
2278
+ projectId: C.projectId
2274
2279
  });
2275
- s(z);
2276
- } catch (C) {
2277
- const z = ge(C);
2278
- l(z), t?.(z), s(void 0);
2280
+ s(A);
2281
+ } catch (T) {
2282
+ const A = ge(T);
2283
+ l(A), t?.(A), s(void 0);
2279
2284
  } finally {
2280
2285
  D(!1);
2281
2286
  }
2282
2287
  }
2283
- }, [i, p, c, A, S, t]), v = (C, z) => {
2284
- const b = z.chain?.find((K) => K.gate === C);
2288
+ }, [i, u, c, x, C, t]), v = (T, A) => {
2289
+ const b = A.chain?.find((j) => j.gate === T);
2285
2290
  return b ? b.passed ? "passou" : "negou" : "nao-avaliado";
2286
2291
  };
2287
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2288
- /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(V, { gap: "sm", children: [
2289
- /* @__PURE__ */ r(Be, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
2292
+ return /* @__PURE__ */ r(L, { gap: "lg", children: [
2293
+ /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ r(L, { gap: "sm", children: [
2294
+ /* @__PURE__ */ r(We, { cols: { base: 1, sm: 2, lg: 4 }, spacing: "xs", children: [
2290
2295
  /* @__PURE__ */ e(
2291
2296
  me,
2292
2297
  {
2293
2298
  label: "Usuário",
2294
2299
  placeholder: "e-mail ou id",
2295
- value: p,
2296
- onChange: (C) => u(C.currentTarget.value)
2300
+ value: u,
2301
+ onChange: (T) => h(T.currentTarget.value)
2297
2302
  }
2298
2303
  ),
2299
2304
  /* @__PURE__ */ e(
@@ -2302,7 +2307,7 @@ const Le = (a) => {
2302
2307
  label: "Recurso",
2303
2308
  placeholder: "tms.ordemservico",
2304
2309
  value: c,
2305
- onChange: (C) => I(C.currentTarget.value)
2310
+ onChange: (T) => I(T.currentTarget.value)
2306
2311
  }
2307
2312
  ),
2308
2313
  /* @__PURE__ */ e(
@@ -2310,8 +2315,8 @@ const Le = (a) => {
2310
2315
  {
2311
2316
  label: "Ação",
2312
2317
  placeholder: "aprovar_custo",
2313
- value: A,
2314
- onChange: (C) => f(C.currentTarget.value)
2318
+ value: x,
2319
+ onChange: (T) => f(T.currentTarget.value)
2315
2320
  }
2316
2321
  ),
2317
2322
  /* @__PURE__ */ e(
@@ -2319,57 +2324,57 @@ const Le = (a) => {
2319
2324
  {
2320
2325
  label: "Empresa (opcional)",
2321
2326
  placeholder: "companyId",
2322
- value: S.companyId ?? "",
2323
- onChange: (C) => T((z) => ({ ...z, companyId: C.currentTarget.value || void 0 }))
2327
+ value: C.companyId ?? "",
2328
+ onChange: (T) => S((A) => ({ ...A, companyId: T.currentTarget.value || void 0 }))
2324
2329
  }
2325
2330
  )
2326
2331
  ] }),
2327
- a?.afterSimulationFields?.((C) => T((z) => ({ ...z, ...C }))),
2332
+ a?.afterSimulationFields?.((T) => S((A) => ({ ...A, ...T }))),
2328
2333
  /* @__PURE__ */ r(N, { gap: "xs", align: "center", children: [
2329
2334
  /* @__PURE__ */ e(Y, { onClick: () => void m(), loading: w, children: "Simular" }),
2330
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
2335
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: "Somente leitura — não altera permissão nenhuma." })
2331
2336
  ] })
2332
2337
  ] }) }),
2333
- h ? /* @__PURE__ */ e(fe, { color: "red", title: "Não foi possível simular", children: h }) : null,
2334
- w && !n ? /* @__PURE__ */ e(ce, { size: "sm" }) : null,
2338
+ d ? /* @__PURE__ */ e(be, { color: "red", title: "Não foi possível simular", children: d }) : null,
2339
+ w && !n ? /* @__PURE__ */ e(le, { size: "sm" }) : null,
2335
2340
  n ? /* @__PURE__ */ r(Pe, { children: [
2336
- /* @__PURE__ */ e(be, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(V, { gap: "sm", children: Br.map((C, z) => {
2337
- const b = v(C.gate, n), K = n.chain?.find((L) => L.gate === C.gate)?.detail;
2341
+ /* @__PURE__ */ e(ve, { title: "Cadeia de decisão", hint: "os quatro primeiros só negam; só o quinto concede", children: /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "md", children: /* @__PURE__ */ e(L, { gap: "sm", children: Wr.map((T, A) => {
2342
+ const b = v(T.gate, n), j = n.chain?.find((G) => G.gate === T.gate)?.detail;
2338
2343
  return /* @__PURE__ */ r(N, { align: "flex-start", wrap: "nowrap", gap: "sm", children: [
2339
- /* @__PURE__ */ e(d, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: z + 1 }),
2340
- /* @__PURE__ */ r(V, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
2344
+ /* @__PURE__ */ e(p, { size: "xs", ff: "monospace", c: "dimmed", w: 16, children: A + 1 }),
2345
+ /* @__PURE__ */ r(L, { gap: 2, style: { flex: 1, minWidth: 0 }, children: [
2341
2346
  /* @__PURE__ */ r(N, { gap: 8, align: "baseline", wrap: "wrap", children: [
2342
2347
  /* @__PURE__ */ e(
2343
- d,
2348
+ p,
2344
2349
  {
2345
2350
  size: "sm",
2346
2351
  fw: 600,
2347
2352
  c: b === "negou" ? "red" : void 0,
2348
2353
  opacity: b === "nao-avaliado" ? 0.5 : 1,
2349
- children: C.titulo
2354
+ children: T.titulo
2350
2355
  }
2351
2356
  ),
2352
- /* @__PURE__ */ r(d, { size: "xs", c: "dimmed", children: [
2357
+ /* @__PURE__ */ r(p, { size: "xs", c: "dimmed", children: [
2353
2358
  "· ",
2354
- C.papel
2359
+ T.papel
2355
2360
  ] })
2356
2361
  ] }),
2357
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", opacity: b === "nao-avaliado" ? 0.5 : 1, children: C.pergunta }),
2358
- K ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: K }) : null
2362
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", opacity: b === "nao-avaliado" ? 0.5 : 1, children: T.pergunta }),
2363
+ j ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: j }) : null
2359
2364
  ] }),
2360
2365
  /* @__PURE__ */ e(
2361
- j,
2366
+ Z,
2362
2367
  {
2363
2368
  variant: "light",
2364
2369
  color: b === "negou" ? "red" : b === "passou" ? "green" : "gray",
2365
2370
  children: b === "nao-avaliado" ? "não avaliado" : b
2366
2371
  }
2367
2372
  )
2368
- ] }, C.gate);
2373
+ ] }, T.gate);
2369
2374
  }) }) }) }),
2370
- /* @__PURE__ */ e(fe, { color: n.allowed ? "green" : "red", title: n.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(V, { gap: 6, children: [
2371
- /* @__PURE__ */ e(d, { size: "sm", children: n.message }),
2372
- /* @__PURE__ */ r(d, { size: "xs", ff: "monospace", c: "dimmed", children: [
2375
+ /* @__PURE__ */ e(be, { color: n.allowed ? "green" : "red", title: n.allowed ? "Pode" : "Não pode", children: /* @__PURE__ */ r(L, { gap: 6, children: [
2376
+ /* @__PURE__ */ e(p, { size: "sm", children: n.message }),
2377
+ /* @__PURE__ */ r(p, { size: "xs", ff: "monospace", c: "dimmed", children: [
2373
2378
  "reasonCode: ",
2374
2379
  n.reasonCode,
2375
2380
  n.deniedAt ? ` · deniedAt: ${n.deniedAt}` : "",
@@ -2379,47 +2384,47 @@ const Le = (a) => {
2379
2384
  a?.afterDecision?.(n)
2380
2385
  ] }) : null
2381
2386
  ] });
2382
- }, Ra = (a) => {
2387
+ }, ka = (a) => {
2383
2388
  switch (a) {
2384
2389
  case "EFFECTIVE":
2385
- return /* @__PURE__ */ e(j, { size: "sm", color: "green", variant: "light", children: "vale" });
2390
+ return /* @__PURE__ */ e(Z, { size: "sm", color: "green", variant: "light", children: "vale" });
2386
2391
  case "INERT":
2387
- return /* @__PURE__ */ e(j, { size: "sm", color: "yellow", variant: "light", children: "não vale" });
2392
+ return /* @__PURE__ */ e(Z, { size: "sm", color: "yellow", variant: "light", children: "não vale" });
2388
2393
  case "DENIED":
2389
- return /* @__PURE__ */ e(j, { size: "sm", color: "red", variant: "light", children: "bloqueada" });
2394
+ return /* @__PURE__ */ e(Z, { size: "sm", color: "red", variant: "light", children: "bloqueada" });
2390
2395
  default:
2391
- return /* @__PURE__ */ e(j, { size: "sm", color: "gray", variant: "light", children: "—" });
2396
+ return /* @__PURE__ */ e(Z, { size: "sm", color: "gray", variant: "light", children: "—" });
2392
2397
  }
2393
- }, qr = ({ id: a, label: t, slots: o, onSelectUser: i, onSimulate: p }) => {
2394
- const u = J(
2398
+ }, Hr = ({ id: a, label: t, slots: o, onSelectUser: i, onSimulate: u }) => {
2399
+ const h = J(
2395
2400
  Q.SecurityDiagnostics
2396
- ), [c, I] = k([]), [A, f] = k(!0), [S, T] = k();
2401
+ ), [c, I] = z([]), [x, f] = z(!0), [C, S] = z();
2397
2402
  ee(() => {
2398
2403
  let s = !1;
2399
- return f(!0), T(void 0), u.getReach(a).then((w) => {
2404
+ return f(!0), S(void 0), h.getReach(a).then((w) => {
2400
2405
  s || I(w ?? []);
2401
2406
  }).catch((w) => {
2402
- s || T(w instanceof Error ? w.message : "Não foi possível carregar.");
2407
+ s || S(w instanceof Error ? w.message : "Não foi possível carregar.");
2403
2408
  }).finally(() => {
2404
2409
  s || f(!1);
2405
2410
  }), () => {
2406
2411
  s = !0;
2407
2412
  };
2408
- }, [u, a]);
2413
+ }, [h, a]);
2409
2414
  const n = c.filter((s) => s.kind === "ADMINISTRADOR").length;
2410
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2411
- /* @__PURE__ */ r(V, { gap: 4, children: [
2412
- /* @__PURE__ */ e(d, { fw: 620, size: "xl", ff: "monospace", children: t }),
2413
- /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
2415
+ return /* @__PURE__ */ r(L, { gap: "lg", children: [
2416
+ /* @__PURE__ */ r(L, { gap: 4, children: [
2417
+ /* @__PURE__ */ e(p, { fw: 620, size: "xl", ff: "monospace", children: t }),
2418
+ /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: "Quem alcança esta capacidade, e por qual via." })
2414
2419
  ] }),
2415
- S ? /* @__PURE__ */ e(fe, { color: "red", title: "Erro ao carregar", children: S }) : null,
2420
+ C ? /* @__PURE__ */ e(be, { color: "red", title: "Erro ao carregar", children: C }) : null,
2416
2421
  /* @__PURE__ */ e(
2417
- be,
2422
+ ve,
2418
2423
  {
2419
2424
  title: "Quem alcança",
2420
- hint: A ? "carregando…" : `${c.length} ${c.length === 1 ? "pessoa" : "pessoas"}`,
2421
- children: A ? /* @__PURE__ */ e(ce, { size: "sm" }) : c.length === 0 ? /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(Pe, { children: [
2422
- /* @__PURE__ */ r(y, { striped: !0, highlightOnHover: !0, withTableBorder: !0, children: [
2425
+ hint: x ? "carregando…" : `${c.length} ${c.length === 1 ? "pessoa" : "pessoas"}`,
2426
+ children: x ? /* @__PURE__ */ e(le, { size: "sm" }) : c.length === 0 ? /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: "Ninguém. A capacidade existe no catálogo e nunca foi concedida." }) : /* @__PURE__ */ r(Pe, { children: [
2427
+ /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ r(y, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2423
2428
  /* @__PURE__ */ e(y.Thead, { children: /* @__PURE__ */ r(y.Tr, { children: [
2424
2429
  /* @__PURE__ */ e(y.Th, { children: "Pessoa" }),
2425
2430
  /* @__PURE__ */ e(y.Th, { children: "Por qual via" }),
@@ -2431,21 +2436,21 @@ const Le = (a) => {
2431
2436
  style: { cursor: i ? "pointer" : void 0 },
2432
2437
  onClick: () => i?.(s.userId, s.userName),
2433
2438
  children: [
2434
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
2435
- /* @__PURE__ */ e(d, { size: "sm", fw: 550, children: s.userName }),
2436
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: s.email })
2439
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(L, { gap: 0, children: [
2440
+ /* @__PURE__ */ e(p, { size: "sm", fw: 550, children: s.userName }),
2441
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: s.email })
2437
2442
  ] }) }),
2438
2443
  /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(N, { gap: 6, children: [
2439
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: s.via }),
2440
- s.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
2444
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: s.via }),
2445
+ s.kind === "ADMINISTRADOR" ? /* @__PURE__ */ e(Z, { size: "xs", color: "yellow", variant: "light", children: "atalho" }) : null
2441
2446
  ] }) }),
2442
- /* @__PURE__ */ e(y.Td, { children: Ra(s.situation) })
2447
+ /* @__PURE__ */ e(y.Td, { children: ka(s.situation) })
2443
2448
  ]
2444
2449
  },
2445
2450
  s.userId
2446
2451
  )) })
2447
- ] }),
2448
- n > 0 ? /* @__PURE__ */ r(d, { size: "xs", c: "dimmed", lh: 1.5, children: [
2452
+ ] }) }),
2453
+ n > 0 ? /* @__PURE__ */ r(p, { size: "xs", c: "dimmed", lh: 1.5, children: [
2449
2454
  n === 1 ? "Uma conta alcança" : `${n} contas alcançam`,
2450
2455
  " pelo atalho de administrador — sem concessão nenhuma. Revisar permissões não muda o que elas podem."
2451
2456
  ] }) : null
@@ -2453,56 +2458,56 @@ const Le = (a) => {
2453
2458
  }
2454
2459
  ),
2455
2460
  o?.afterReachList?.(a, c),
2456
- p ? /* @__PURE__ */ r(d, { size: "xs", c: "dimmed", children: [
2461
+ u ? /* @__PURE__ */ r(p, { size: "xs", c: "dimmed", children: [
2457
2462
  "Para testar uma pessoa específica contra esta capacidade, use ",
2458
2463
  /* @__PURE__ */ e("strong", { children: "Simular" }),
2459
2464
  " na árvore — ela já vem escolhida."
2460
2465
  ] }) : null
2461
2466
  ] });
2462
- }, ga = ({ id: a, kind: t, slots: o, onSelectUser: i }) => {
2463
- const p = J(
2467
+ }, fa = ({ id: a, kind: t, slots: o, onSelectUser: i }) => {
2468
+ const u = J(
2464
2469
  Q.SecurityDiagnostics
2465
- ), [u, c] = k(), [I, A] = k(!0), [f, S] = k();
2470
+ ), [h, c] = z(), [I, x] = z(!0), [f, C] = z();
2466
2471
  if (ee(() => {
2467
2472
  let s = !1;
2468
- return A(!0), S(void 0), (t === "GROUP" ? p.getGroup(a) : p.getProfile(a)).then((D) => {
2473
+ return x(!0), C(void 0), (t === "GROUP" ? u.getGroup(a) : u.getProfile(a)).then((D) => {
2469
2474
  s || c(D);
2470
2475
  }).catch((D) => {
2471
- s || S(D instanceof Error ? D.message : "Não foi possível carregar.");
2476
+ s || C(D instanceof Error ? D.message : "Não foi possível carregar.");
2472
2477
  }).finally(() => {
2473
- s || A(!1);
2478
+ s || x(!1);
2474
2479
  }), () => {
2475
2480
  s = !0;
2476
2481
  };
2477
- }, [p, a, t]), I)
2482
+ }, [u, a, t]), I)
2478
2483
  return /* @__PURE__ */ r(N, { gap: 8, children: [
2479
- /* @__PURE__ */ e(ce, { size: "sm" }),
2480
- /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: "Carregando…" })
2484
+ /* @__PURE__ */ e(le, { size: "sm" }),
2485
+ /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: "Carregando…" })
2481
2486
  ] });
2482
2487
  if (f)
2483
- return /* @__PURE__ */ e(fe, { color: "red", title: "Erro ao carregar", children: f });
2484
- if (!u)
2488
+ return /* @__PURE__ */ e(be, { color: "red", title: "Erro ao carregar", children: f });
2489
+ if (!h)
2485
2490
  return null;
2486
- const T = t === "GROUP" ? "grupo" : "perfil", n = o?.additionalMemberColumns ?? [];
2487
- return /* @__PURE__ */ r(V, { gap: "lg", children: [
2488
- /* @__PURE__ */ r(V, { gap: 4, children: [
2491
+ const S = t === "GROUP" ? "grupo" : "perfil", n = o?.additionalMemberColumns ?? [];
2492
+ return /* @__PURE__ */ r(L, { gap: "lg", children: [
2493
+ /* @__PURE__ */ r(L, { gap: 4, children: [
2489
2494
  /* @__PURE__ */ r(N, { gap: 8, children: [
2490
- /* @__PURE__ */ e(d, { fw: 620, size: "xl", children: u.groupName }),
2491
- /* @__PURE__ */ e(j, { variant: "light", children: T })
2495
+ /* @__PURE__ */ e(p, { fw: 620, size: "xl", children: h.groupName }),
2496
+ /* @__PURE__ */ e(Z, { variant: "light", children: S })
2492
2497
  ] }),
2493
- u.description ? /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: u.description }) : null
2498
+ h.description ? /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: h.description }) : null
2494
2499
  ] }),
2495
2500
  /* @__PURE__ */ r(
2496
- be,
2501
+ ve,
2497
2502
  {
2498
2503
  title: "Membros",
2499
- hint: `${u.members.length} — o total de cada um soma todas as origens`,
2504
+ hint: `${h.members.length} — o total de cada um soma todas as origens`,
2500
2505
  children: [
2501
- u.members.length === 0 ? /* @__PURE__ */ r(d, { size: "sm", c: "dimmed", children: [
2506
+ h.members.length === 0 ? /* @__PURE__ */ r(p, { size: "sm", c: "dimmed", children: [
2502
2507
  "Ninguém está ",
2503
2508
  t === "GROUP" ? "neste grupo" : "com este perfil",
2504
2509
  "."
2505
- ] }) : /* @__PURE__ */ r(y, { striped: !0, highlightOnHover: !0, withTableBorder: !0, children: [
2510
+ ] }) : /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ r(y, { striped: !0, highlightOnHover: !0, withTableBorder: !0, stickyHeader: !0, children: [
2506
2511
  /* @__PURE__ */ e(y.Thead, { children: /* @__PURE__ */ r(y.Tr, { children: [
2507
2512
  /* @__PURE__ */ e(y.Th, { children: "Pessoa" }),
2508
2513
  /* @__PURE__ */ e(y.Th, { children: "Perfil" }),
@@ -2512,32 +2517,32 @@ const Le = (a) => {
2512
2517
  /* @__PURE__ */ e(y.Th, { ta: "right", children: "Bloqueadas" }),
2513
2518
  n.map((s) => /* @__PURE__ */ e(y.Th, { children: s.header }, s.header))
2514
2519
  ] }) }),
2515
- /* @__PURE__ */ e(y.Tbody, { children: u.members.map((s) => /* @__PURE__ */ r(
2520
+ /* @__PURE__ */ e(y.Tbody, { children: h.members.map((s) => /* @__PURE__ */ r(
2516
2521
  y.Tr,
2517
2522
  {
2518
2523
  style: { cursor: i ? "pointer" : void 0 },
2519
2524
  onClick: () => i?.(s.userId, s.name),
2520
2525
  children: [
2521
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(V, { gap: 0, children: [
2526
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(L, { gap: 0, children: [
2522
2527
  /* @__PURE__ */ r(N, { gap: 6, children: [
2523
- /* @__PURE__ */ e(d, { size: "sm", fw: 550, children: s.name }),
2524
- s.administrator ? /* @__PURE__ */ e(j, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
2525
- s.enabled ? null : /* @__PURE__ */ e(j, { size: "xs", color: "red", variant: "light", children: "desativada" })
2528
+ /* @__PURE__ */ e(p, { size: "sm", fw: 550, children: s.name }),
2529
+ s.administrator ? /* @__PURE__ */ e(Z, { size: "xs", color: "yellow", variant: "light", children: "administrador" }) : null,
2530
+ s.enabled ? null : /* @__PURE__ */ e(Z, { size: "xs", color: "red", variant: "light", children: "desativada" })
2526
2531
  ] }),
2527
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: s.email })
2532
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: s.email })
2528
2533
  ] }) }),
2529
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: s.profileName ?? "—" }) }),
2534
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: s.profileName ?? "—" }) }),
2530
2535
  /* @__PURE__ */ e(y.Td, { ta: "right", children: s.total }),
2531
2536
  /* @__PURE__ */ e(y.Td, { ta: "right", c: "green", children: s.effective }),
2532
2537
  /* @__PURE__ */ e(y.Td, { ta: "right", c: "yellow.7", children: s.inert }),
2533
2538
  /* @__PURE__ */ e(y.Td, { ta: "right", c: "red", children: s.denied }),
2534
- n.map((w) => /* @__PURE__ */ e(y.Td, { children: w.render(s, u) }, w.header))
2539
+ n.map((w) => /* @__PURE__ */ e(y.Td, { children: w.render(s, h) }, w.header))
2535
2540
  ]
2536
2541
  },
2537
2542
  s.userId
2538
2543
  )) })
2539
- ] }),
2540
- /* @__PURE__ */ r(d, { size: "xs", c: "dimmed", lh: 1.5, children: [
2544
+ ] }) }),
2545
+ /* @__PURE__ */ r(p, { size: "xs", c: "dimmed", lh: 1.5, children: [
2541
2546
  "O total do membro não é o total ",
2542
2547
  t === "GROUP" ? "do grupo" : "do perfil",
2543
2548
  ": ele soma o que vem de outras vias. Clique numa pessoa para ver a lista dela."
@@ -2545,239 +2550,268 @@ const Le = (a) => {
2545
2550
  ]
2546
2551
  }
2547
2552
  ),
2548
- /* @__PURE__ */ e(be, { title: `O que este ${T} concede`, hint: "a parte que é responsabilidade dele", children: u.grants.length === 0 ? /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ r(y, { striped: !0, withTableBorder: !0, children: [
2553
+ /* @__PURE__ */ e(ve, { title: `O que este ${S} concede`, hint: "a parte que é responsabilidade dele", children: h.grants.length === 0 ? /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: "Nada concedido por esta via." }) : /* @__PURE__ */ e(Ue, { children: /* @__PURE__ */ r(y, { striped: !0, withTableBorder: !0, stickyHeader: !0, children: [
2549
2554
  /* @__PURE__ */ e(y.Thead, { children: /* @__PURE__ */ r(y.Tr, { children: [
2550
2555
  /* @__PURE__ */ e(y.Th, { children: "Capacidade" }),
2551
2556
  /* @__PURE__ */ e(y.Th, { children: "Situação" })
2552
2557
  ] }) }),
2553
- /* @__PURE__ */ e(y.Tbody, { children: u.grants.map((s, w) => /* @__PURE__ */ r(y.Tr, { children: [
2554
- /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(d, { size: "sm", ff: "monospace", children: [
2558
+ /* @__PURE__ */ e(y.Tbody, { children: h.grants.map((s, w) => /* @__PURE__ */ r(y.Tr, { children: [
2559
+ /* @__PURE__ */ e(y.Td, { children: /* @__PURE__ */ r(p, { size: "sm", ff: "monospace", children: [
2555
2560
  s.resource,
2556
2561
  " · ",
2557
2562
  s.action
2558
2563
  ] }) }),
2559
- /* @__PURE__ */ e(y.Td, { children: Ra(s.situation) })
2564
+ /* @__PURE__ */ e(y.Td, { children: ka(s.situation) })
2560
2565
  ] }, `${s.resource}-${s.action}-${w}`)) })
2561
- ] }) }),
2562
- o?.afterGroupMembers?.(u)
2566
+ ] }) }) }),
2567
+ o?.afterGroupMembers?.(h)
2563
2568
  ] });
2564
- }, fa = 50, Xe = [
2569
+ }, ba = 50, Ye = [
2565
2570
  { branch: "USERS", label: "Pessoas" },
2566
2571
  { branch: "GROUPS", label: "Grupos" },
2567
2572
  { branch: "PROFILES", label: "Perfis" },
2568
2573
  { branch: "RESOURCES", label: "Recursos" }
2569
- ], Ye = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 }, Hr = ({ selected: a, onSelect: t }) => {
2574
+ ], _e = { nodes: [], total: 0, carregando: !1, carregouTudo: !1 }, jr = ({ aberta: a }) => /* @__PURE__ */ e(
2575
+ ae,
2576
+ {
2577
+ "aria-hidden": !0,
2578
+ style: {
2579
+ width: 14,
2580
+ height: 14,
2581
+ flex: "none",
2582
+ display: "flex",
2583
+ alignItems: "center",
2584
+ justifyContent: "center"
2585
+ },
2586
+ children: /* @__PURE__ */ e(
2587
+ ae,
2588
+ {
2589
+ style: {
2590
+ width: 0,
2591
+ height: 0,
2592
+ borderLeft: "5px solid currentColor",
2593
+ borderTop: "4px solid transparent",
2594
+ borderBottom: "4px solid transparent",
2595
+ opacity: 0.55,
2596
+ transform: a ? "rotate(90deg)" : "none",
2597
+ transformOrigin: "2px 4px",
2598
+ transition: "transform 130ms ease"
2599
+ }
2600
+ }
2601
+ )
2602
+ }
2603
+ ), Zr = ({ selected: a, onSelect: t }) => {
2570
2604
  const o = J(
2571
2605
  Q.SecurityDiagnostics
2572
- ), [i, p] = k(""), [u] = ea(i, 300), [c, I] = k({}), [A, f] = k({}), S = (h, l) => l ? `${h}:${l}` : h, T = oe(
2573
- async (h, l, m) => {
2574
- const v = S(h, l), C = A[v] ?? Ye;
2575
- if (C.carregando || m && C.carregouTudo)
2606
+ ), [i, u] = z(""), [h] = aa(i, 300), [c, I] = z({}), [x, f] = z({}), C = (d, l) => l ? `${d}:${l}` : d, S = oe(
2607
+ async (d, l, m) => {
2608
+ const v = C(d, l), T = x[v] ?? _e;
2609
+ if (T.carregando || m && T.carregouTudo)
2576
2610
  return;
2577
- const z = m ? Math.floor(C.nodes.length / fa) : 0;
2578
- f((b) => ({ ...b, [v]: { ...b[v] ?? Ye, carregando: !0, erro: void 0 } }));
2611
+ const A = m ? Math.floor(T.nodes.length / ba) : 0;
2612
+ f((b) => ({ ...b, [v]: { ...b[v] ?? _e, carregando: !0, erro: void 0 } }));
2579
2613
  try {
2580
- const b = await o.browse(h, {
2614
+ const b = await o.browse(d, {
2581
2615
  parentId: l,
2582
- q: u || void 0,
2583
- page: z,
2584
- size: fa
2616
+ q: h || void 0,
2617
+ page: A,
2618
+ size: ba
2585
2619
  });
2586
- f((K) => {
2587
- const Z = [...m ? K[v]?.nodes ?? [] : [], ...b.content ?? []];
2620
+ f((j) => {
2621
+ const K = [...m ? j[v]?.nodes ?? [] : [], ...b.content ?? []];
2588
2622
  return {
2589
- ...K,
2623
+ ...j,
2590
2624
  [v]: {
2591
- nodes: Z,
2592
- total: b.totalElements ?? Z.length,
2625
+ nodes: K,
2626
+ total: b.totalElements ?? K.length,
2593
2627
  carregando: !1,
2594
- carregouTudo: Z.length >= (b.totalElements ?? 0)
2628
+ carregouTudo: K.length >= (b.totalElements ?? 0)
2595
2629
  }
2596
2630
  };
2597
2631
  });
2598
2632
  } catch (b) {
2599
- f((K) => ({
2600
- ...K,
2633
+ f((j) => ({
2634
+ ...j,
2601
2635
  [v]: {
2602
- ...K[v] ?? Ye,
2636
+ ...j[v] ?? _e,
2603
2637
  carregando: !1,
2604
2638
  erro: b instanceof Error ? b.message : "Não foi possível carregar."
2605
2639
  }
2606
2640
  }));
2607
2641
  }
2608
2642
  },
2609
- [o, u, A]
2643
+ [o, h, x]
2610
2644
  );
2611
2645
  ee(() => {
2612
- if (f({}), u) {
2613
- const h = {};
2614
- Xe.forEach((l) => {
2615
- h[l.branch] = !0;
2616
- }), I((l) => ({ ...l, ...h }));
2646
+ if (f({}), h) {
2647
+ const d = {};
2648
+ Ye.forEach((l) => {
2649
+ d[l.branch] = !0;
2650
+ }), I((l) => ({ ...l, ...d }));
2617
2651
  }
2618
- }, [u]), ee(() => {
2619
- Xe.forEach((h) => {
2620
- c[h.branch] && !A[h.branch] && T(h.branch, void 0, !1);
2652
+ }, [h]), ee(() => {
2653
+ Ye.forEach((d) => {
2654
+ c[d.branch] && !x[d.branch] && S(d.branch, void 0, !1);
2621
2655
  });
2622
- }, [c, A, u]);
2623
- const n = (h) => I((l) => ({ ...l, [h]: !l[h] })), s = (h) => h === "critical" ? "red" : h === "warning" ? "yellow" : void 0, w = (h, l) => {
2624
- const m = S("ACTIONS_OF_RESOURCE", h.id), v = !!c[m], C = A[m], z = a?.kind === h.kind && a?.id === h.id;
2625
- return /* @__PURE__ */ r(re, { children: [
2656
+ }, [c, x, h]);
2657
+ const n = (d) => I((l) => ({ ...l, [d]: !l[d] })), s = (d) => d === "critical" ? "red" : d === "warning" ? "yellow" : void 0, w = (d, l, m) => {
2658
+ const v = C("ACTIONS_OF_RESOURCE", d.id), T = !!c[v], A = x[v], b = a?.kind === d.kind && a?.id === d.id;
2659
+ return /* @__PURE__ */ r(ae, { children: [
2626
2660
  /* @__PURE__ */ e(
2627
2661
  Ee,
2628
2662
  {
2629
2663
  onClick: () => {
2630
- t({ kind: h.kind, id: h.id, label: h.label }), h.hasChildren && (n(m), C || T("ACTIONS_OF_RESOURCE", h.id, !1));
2664
+ t({ kind: d.kind, id: d.id, label: d.label, parentLabel: m }), d.hasChildren && (n(v), A || S("ACTIONS_OF_RESOURCE", d.id, !1));
2631
2665
  },
2632
- "aria-current": z ? "true" : void 0,
2633
- "aria-expanded": h.hasChildren ? v : void 0,
2666
+ "aria-current": b ? "true" : void 0,
2667
+ "aria-expanded": d.hasChildren ? T : void 0,
2634
2668
  style: {
2635
2669
  display: "block",
2636
2670
  width: "100%",
2637
2671
  padding: "5px 8px",
2638
2672
  paddingLeft: 8 + l * 14,
2639
2673
  borderRadius: 5,
2640
- background: z ? "var(--mantine-color-blue-light)" : void 0
2674
+ background: b ? "var(--mantine-color-blue-light)" : void 0
2641
2675
  },
2642
2676
  children: /* @__PURE__ */ r(N, { gap: 7, wrap: "nowrap", children: [
2643
- h.severity ? /* @__PURE__ */ e(j, { size: "xs", circle: !0, color: s(h.severity) }) : /* @__PURE__ */ e(re, { w: 8 }),
2644
- /* @__PURE__ */ e(d, { size: "sm", fw: z ? 600 : 400, truncate: !0, style: { flex: 1 }, children: h.label }),
2645
- h.badge ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", ff: "monospace", children: h.badge }) : null
2677
+ d.severity ? /* @__PURE__ */ e(Z, { size: "xs", circle: !0, color: s(d.severity) }) : /* @__PURE__ */ e(ae, { w: 8 }),
2678
+ /* @__PURE__ */ e(p, { size: "sm", fw: b ? 600 : 400, truncate: !0, style: { flex: 1 }, children: d.label }),
2679
+ d.badge ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", ff: "monospace", children: d.badge }) : null
2646
2680
  ] })
2647
2681
  }
2648
2682
  ),
2649
- h.hasChildren && v ? /* @__PURE__ */ r(re, { children: [
2650
- C?.nodes.map((b) => w(b, l + 1)),
2651
- C?.carregando ? /* @__PURE__ */ r(N, { gap: 6, pl: 8 + (l + 1) * 14, py: 4, children: [
2652
- /* @__PURE__ */ e(ce, { size: "xs" }),
2653
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: "carregando…" })
2683
+ d.hasChildren && T ? /* @__PURE__ */ r(ae, { children: [
2684
+ A?.nodes.map((j) => w(j, l + 1, d.label)),
2685
+ A?.carregando ? /* @__PURE__ */ r(N, { gap: 6, pl: 8 + (l + 1) * 14, py: 4, children: [
2686
+ /* @__PURE__ */ e(le, { size: "xs" }),
2687
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: "carregando…" })
2654
2688
  ] }) : null,
2655
- C && !C.carregouTudo && !C.carregando ? /* @__PURE__ */ e(
2689
+ A && !A.erro && !A.carregouTudo && !A.carregando && A.total > A.nodes.length ? /* @__PURE__ */ e(
2656
2690
  Ee,
2657
2691
  {
2658
- onClick: () => void T("ACTIONS_OF_RESOURCE", h.id, !0),
2692
+ onClick: () => void S("ACTIONS_OF_RESOURCE", d.id, !0),
2659
2693
  style: { paddingLeft: 8 + (l + 1) * 14, paddingTop: 3, paddingBottom: 3 },
2660
- children: /* @__PURE__ */ r(d, { size: "xs", c: "blue", children: [
2694
+ children: /* @__PURE__ */ r(p, { size: "xs", c: "blue", children: [
2661
2695
  "mais ",
2662
- C.total - C.nodes.length,
2696
+ A.total - A.nodes.length,
2663
2697
  " →"
2664
2698
  ] })
2665
2699
  }
2666
2700
  ) : null
2667
2701
  ] }) : null
2668
- ] }, `${h.kind}-${h.id}`);
2669
- }, D = ie(() => Xe, []);
2670
- return /* @__PURE__ */ r(re, { children: [
2702
+ ] }, `${d.kind}-${d.id}`);
2703
+ }, D = ie(() => Ye, []);
2704
+ return /* @__PURE__ */ r(ae, { children: [
2671
2705
  /* @__PURE__ */ e(
2672
2706
  me,
2673
2707
  {
2674
2708
  size: "xs",
2675
2709
  placeholder: "Buscar pessoa, grupo, capacidade…",
2676
2710
  value: i,
2677
- onChange: (h) => p(h.currentTarget.value),
2711
+ onChange: (d) => u(d.currentTarget.value),
2678
2712
  "aria-label": "Buscar na árvore",
2679
2713
  mb: "xs",
2680
- rightSection: i && i !== u ? /* @__PURE__ */ e(ce, { size: "xs" }) : null
2714
+ rightSection: i && i !== h ? /* @__PURE__ */ e(le, { size: "xs" }) : null
2681
2715
  }
2682
2716
  ),
2683
- D.map((h) => {
2684
- const l = !!c[h.branch], m = A[h.branch];
2685
- return /* @__PURE__ */ r(re, { mb: 2, children: [
2717
+ D.map((d) => {
2718
+ const l = !!c[d.branch], m = x[d.branch];
2719
+ return /* @__PURE__ */ r(ae, { mb: 2, children: [
2686
2720
  /* @__PURE__ */ e(
2687
2721
  Ee,
2688
2722
  {
2689
2723
  onClick: () => {
2690
- n(h.branch), m || T(h.branch, void 0, !1);
2724
+ n(d.branch), m || S(d.branch, void 0, !1);
2691
2725
  },
2692
2726
  "aria-expanded": l,
2693
2727
  style: { display: "block", width: "100%", padding: "5px 8px", borderRadius: 5 },
2694
2728
  children: /* @__PURE__ */ r(N, { gap: 7, wrap: "nowrap", children: [
2695
- /* @__PURE__ */ e(le, { variant: "transparent", size: "xs", component: "span", "aria-hidden": !0, children: /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: l ? "▾" : "▸" }) }),
2696
- /* @__PURE__ */ e(d, { size: "sm", fw: 600, style: { flex: 1 }, children: h.label }),
2697
- m ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", ff: "monospace", children: m.total }) : null
2729
+ /* @__PURE__ */ e(jr, { aberta: l }),
2730
+ /* @__PURE__ */ e(p, { size: "sm", fw: 600, style: { flex: 1 }, children: d.label }),
2731
+ m ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", ff: "monospace", children: m.total }) : null
2698
2732
  ] })
2699
2733
  }
2700
2734
  ),
2701
- l ? /* @__PURE__ */ r(re, { children: [
2702
- m?.erro ? /* @__PURE__ */ e(d, { size: "xs", c: "red", pl: 22, py: 4, children: m.erro }) : null,
2735
+ l ? /* @__PURE__ */ r(ae, { children: [
2736
+ m?.erro ? /* @__PURE__ */ e(p, { size: "xs", c: "red", pl: 22, py: 4, children: m.erro }) : null,
2703
2737
  m?.nodes.map((v) => w(v, 1)),
2704
2738
  m?.carregando ? /* @__PURE__ */ r(N, { gap: 6, pl: 22, py: 4, children: [
2705
- /* @__PURE__ */ e(ce, { size: "xs" }),
2706
- /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", children: "carregando…" })
2739
+ /* @__PURE__ */ e(le, { size: "xs" }),
2740
+ /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", children: "carregando…" })
2707
2741
  ] }) : null,
2708
- m && !m.carregouTudo && !m.carregando ? /* @__PURE__ */ e(
2742
+ m && !m.erro && !m.carregouTudo && !m.carregando && m.total > m.nodes.length ? /* @__PURE__ */ e(
2709
2743
  Ee,
2710
2744
  {
2711
- onClick: () => void T(h.branch, void 0, !0),
2745
+ onClick: () => void S(d.branch, void 0, !0),
2712
2746
  style: { paddingLeft: 22, paddingTop: 3, paddingBottom: 3 },
2713
- children: /* @__PURE__ */ r(d, { size: "xs", c: "blue", children: [
2747
+ children: /* @__PURE__ */ r(p, { size: "xs", c: "blue", children: [
2714
2748
  "mais ",
2715
2749
  m.total - m.nodes.length,
2716
2750
  " →"
2717
2751
  ] })
2718
2752
  }
2719
2753
  ) : null,
2720
- m && m.nodes.length === 0 && !m.carregando ? /* @__PURE__ */ e(d, { size: "xs", c: "dimmed", pl: 22, py: 4, children: u ? "Nada encontrado." : "Vazio." }) : null
2754
+ m && !m.erro && m.nodes.length === 0 && !m.carregando ? /* @__PURE__ */ e(p, { size: "xs", c: "dimmed", pl: 22, py: 4, children: h ? "Nada encontrado." : "Vazio." }) : null
2721
2755
  ] }) : null
2722
- ] }, h.branch);
2756
+ ] }, d.branch);
2723
2757
  })
2724
2758
  ] });
2725
- }, ba = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, va = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, ot = ({
2759
+ }, va = { kind: "OVERVIEW", id: "overview", label: "Panorama" }, ya = { kind: "SIMULATE", id: "simulate", label: "Simular acesso" }, st = ({
2726
2760
  height: a = "100%",
2727
2761
  width: t = "100%",
2728
2762
  slots: o,
2729
2763
  onError: i
2730
2764
  }) => {
2731
- const [p, u] = k(ba), [c, I] = k({}), A = oe((n) => {
2732
- u(n), n.kind === "USER" && I((s) => ({ ...s, userId: n.id })), n.kind === "ACTION" && I((s) => ({ ...s, action: n.label }));
2765
+ const [u, h] = z(va), [c, I] = z({}), x = oe((n) => {
2766
+ h(n), n.kind === "USER" && I((s) => ({ ...s, userId: n.id })), n.kind === "ACTION" && I((s) => ({ ...s, action: n.label, resource: n.parentLabel }));
2733
2767
  }, []), f = oe(
2734
- (n, s) => A({ kind: "USER", id: n, label: s }),
2735
- [A]
2736
- ), S = (n) => /* @__PURE__ */ e(
2768
+ (n, s) => x({ kind: "USER", id: n, label: s }),
2769
+ [x]
2770
+ ), C = (n) => /* @__PURE__ */ e(
2737
2771
  Ee,
2738
2772
  {
2739
- onClick: () => u(n),
2740
- "aria-current": p.kind === n.kind ? "true" : void 0,
2773
+ onClick: () => h(n),
2774
+ "aria-current": u.kind === n.kind ? "true" : void 0,
2741
2775
  style: {
2742
2776
  display: "block",
2743
2777
  width: "100%",
2744
2778
  padding: "6px 8px",
2745
2779
  borderRadius: 5,
2746
- background: p.kind === n.kind ? "var(--mantine-color-blue-light)" : void 0
2780
+ background: u.kind === n.kind ? "var(--mantine-color-blue-light)" : void 0
2747
2781
  },
2748
- children: /* @__PURE__ */ e(d, { size: "sm", fw: p.kind === n.kind ? 600 : 500, children: n.label })
2782
+ children: /* @__PURE__ */ e(p, { size: "sm", fw: u.kind === n.kind ? 600 : 500, children: n.label })
2749
2783
  },
2750
2784
  n.id
2751
- ), T = () => {
2752
- switch (p.kind) {
2785
+ ), S = () => {
2786
+ switch (u.kind) {
2753
2787
  case "OVERVIEW":
2754
- return /* @__PURE__ */ e(pa, { slots: o, onError: i });
2788
+ return /* @__PURE__ */ e(ma, { slots: o, onError: i });
2755
2789
  case "SIMULATE":
2756
- return /* @__PURE__ */ e(Wr, { slots: o, onError: i, initial: c });
2790
+ return /* @__PURE__ */ e(qr, { slots: o, onError: i, initial: c });
2757
2791
  case "USER":
2758
- return /* @__PURE__ */ e(Ur, { slots: o, onError: i, userId: p.id });
2792
+ return /* @__PURE__ */ e(Br, { slots: o, onError: i, userId: u.id });
2759
2793
  case "GROUP":
2760
- return /* @__PURE__ */ e(ga, { id: p.id, kind: "GROUP", slots: o, onSelectUser: f });
2794
+ return /* @__PURE__ */ e(fa, { id: u.id, kind: "GROUP", slots: o, onSelectUser: f });
2761
2795
  case "PROFILE":
2762
- return /* @__PURE__ */ e(ga, { id: p.id, kind: "PROFILE", slots: o, onSelectUser: f });
2796
+ return /* @__PURE__ */ e(fa, { id: u.id, kind: "PROFILE", slots: o, onSelectUser: f });
2763
2797
  case "ACTION":
2764
2798
  return /* @__PURE__ */ e(
2765
- qr,
2799
+ Hr,
2766
2800
  {
2767
- id: p.id,
2768
- label: p.label,
2801
+ id: u.id,
2802
+ label: u.parentLabel ? `${u.parentLabel} · ${u.label}` : u.label,
2769
2803
  slots: o,
2770
2804
  onSelectUser: f,
2771
- onSimulate: () => u(va)
2805
+ onSimulate: () => h(ya)
2772
2806
  }
2773
2807
  );
2774
2808
  case "RESOURCE":
2775
- return /* @__PURE__ */ r(V, { gap: "xs", children: [
2776
- /* @__PURE__ */ e(d, { fw: 620, size: "xl", ff: "monospace", children: p.label }),
2777
- /* @__PURE__ */ e(d, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
2809
+ return /* @__PURE__ */ r(L, { gap: "xs", children: [
2810
+ /* @__PURE__ */ e(p, { fw: 620, size: "xl", ff: "monospace", children: u.label }),
2811
+ /* @__PURE__ */ e(p, { size: "sm", c: "dimmed", children: "Abra o recurso na árvore para ver as ações. Cada ação responde quem alcança." })
2778
2812
  ] });
2779
2813
  default:
2780
- return /* @__PURE__ */ e(pa, { slots: o, onError: i });
2814
+ return /* @__PURE__ */ e(ma, { slots: o, onError: i });
2781
2815
  }
2782
2816
  };
2783
2817
  return (
@@ -2785,56 +2819,79 @@ const Le = (a) => {
2785
2819
  // não uma fração de doze, e o `minmax(0, 1fr)` é o que impede uma tabela larga no painel de
2786
2820
  // empurrar a árvore para fora da tela.
2787
2821
  /* @__PURE__ */ r(
2788
- re,
2822
+ ae,
2789
2823
  {
2790
2824
  style: {
2791
- height: a,
2792
2825
  width: t,
2826
+ // `height` só resolve quando o contêiner de cima tem altura definida — e o padrão de
2827
+ // quem embute a view é não ter. O minHeight em vh garante que a árvore ocupe a tela
2828
+ // mesmo assim; sem ele o painel encolhe até o conteúdo e sobra metade da tela vazia.
2829
+ height: a,
2830
+ minHeight: "calc(100vh - 190px)",
2793
2831
  display: "grid",
2794
2832
  gridTemplateColumns: "minmax(240px, 300px) minmax(0, 1fr)",
2795
2833
  gap: "var(--mantine-spacing-md)",
2796
- alignItems: "start"
2834
+ alignItems: "stretch"
2797
2835
  },
2798
2836
  className: "archbase-security-explorer",
2799
2837
  children: [
2800
- /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "xs", children: /* @__PURE__ */ r(V, { gap: 2, children: [
2801
- o?.renderUserSearch ? /* @__PURE__ */ e(re, { mb: 4, children: o.renderUserSearch(
2802
- (n) => A({ kind: "USER", id: n, label: n })
2803
- ) }) : null,
2804
- S(ba),
2805
- S(va),
2806
- /* @__PURE__ */ e(re, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
2807
- /* @__PURE__ */ e(Ce.Autosize, { mah: 620, type: "hover", children: /* @__PURE__ */ e(Hr, { selected: p, onSelect: A }) })
2808
- ] }) }),
2809
- /* @__PURE__ */ e(_, { withBorder: !0, radius: "md", p: "md", style: { minWidth: 0 }, children: T() })
2838
+ /* @__PURE__ */ e(
2839
+ _,
2840
+ {
2841
+ withBorder: !0,
2842
+ radius: "md",
2843
+ p: "xs",
2844
+ style: { display: "flex", flexDirection: "column", minHeight: 0, overflow: "hidden" },
2845
+ children: /* @__PURE__ */ r(L, { gap: 2, style: { flex: 1, minHeight: 0 }, children: [
2846
+ o?.renderUserSearch ? /* @__PURE__ */ e(ae, { mb: 4, children: o.renderUserSearch(
2847
+ (n) => x({ kind: "USER", id: n, label: n })
2848
+ ) }) : null,
2849
+ C(va),
2850
+ C(ya),
2851
+ /* @__PURE__ */ e(ae, { my: 6, style: { borderTop: "1px solid var(--mantine-color-default-border)" } }),
2852
+ /* @__PURE__ */ e(fe, { type: "hover", style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ e(Zr, { selected: u, onSelect: x }) })
2853
+ ] })
2854
+ }
2855
+ ),
2856
+ /* @__PURE__ */ e(
2857
+ _,
2858
+ {
2859
+ withBorder: !0,
2860
+ radius: "md",
2861
+ p: "md",
2862
+ style: { minWidth: 0, minHeight: 0, overflowY: "auto" },
2863
+ children: S()
2864
+ }
2865
+ )
2810
2866
  ]
2811
2867
  }
2812
2868
  )
2813
2869
  );
2814
2870
  };
2815
2871
  export {
2816
- qr as ActionNodePanel,
2817
- Sr as ApiTokenModal,
2818
- it as ArchbaseApiTokenView,
2819
- fr as ArchbaseDualListSelector,
2820
- ot as ArchbaseSecurityDiagnosticsView,
2821
- tt as ArchbaseSecurityView,
2822
- Fr as AttributeList,
2823
- Ur as EffectiveAccessPanel,
2824
- Dr as FlagStrip,
2825
- wr as GroupModal,
2826
- ga as GroupNodePanel,
2827
- Er as MetricCard,
2828
- Pr as MetricCards,
2829
- Or as OverviewItemsDrawer,
2830
- pa as OverviewPanel,
2831
- Ze as PermissionsSelectorModal,
2832
- gr as ProfileModal,
2833
- br as RenderProfileUserItem,
2834
- be as Section,
2835
- Hr as SecurityTree,
2836
- Wr as SimulationPanel,
2837
- yr as UserModal,
2838
- Le as severityColor,
2839
- Ra as situacaoBadge
2872
+ Hr as ActionNodePanel,
2873
+ Tr as ApiTokenModal,
2874
+ nt as ArchbaseApiTokenView,
2875
+ br as ArchbaseDualListSelector,
2876
+ st as ArchbaseSecurityDiagnosticsView,
2877
+ ot as ArchbaseSecurityView,
2878
+ Nr as AttributeList,
2879
+ Br as EffectiveAccessPanel,
2880
+ Fr as FlagStrip,
2881
+ Cr as GroupModal,
2882
+ fa as GroupNodePanel,
2883
+ Pr as MetricCard,
2884
+ Dr as MetricCards,
2885
+ $r as OverviewItemsDrawer,
2886
+ ma as OverviewPanel,
2887
+ Ke as PermissionsSelectorModal,
2888
+ fr as ProfileModal,
2889
+ vr as RenderProfileUserItem,
2890
+ ve as Section,
2891
+ Zr as SecurityTree,
2892
+ qr as SimulationPanel,
2893
+ Ue as TabelaRolavel,
2894
+ wr as UserModal,
2895
+ Ge as severityColor,
2896
+ ka as situacaoBadge
2840
2897
  };