@archbase/security-ui 3.0.12 → 3.0.14

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,14 +1,14 @@
1
- import { Modal as Ce, ScrollArea as Ae, Stack as ne, Grid as C, Group as P, Button as V, Paper as Ie, Box as oe, Text as Z, List as Te, Checkbox as He, Tooltip as de, ActionIcon as N, Flex as ae, Space as nr, Input as ue, useTree as Qe, useMantineColorScheme as Me, TextInput as Ye, Tree as Xe, Badge as we, Tabs as le } from "@mantine/core";
2
- import { useFocusTrap as Ee, useDebouncedValue as Ke } from "@mantine/hooks";
3
- import { getI18nextInstance as t, ARCHBASE_IOC_API_TYPE as X, convertDateToISOString as Nr, getKeyByEnumValue as ce, useArchbaseTheme as ir, useArchbaseValidator as Or, useArchbaseTranslation as Br, emit as Wr, builder as _e, processErrorMessage as ke, processDetailErrorMessage as Re } from "@archbase/core";
4
- import { ArchbaseEdit as _, ArchbaseNotifications as Y, ArchbasePasswordEdit as qr, ArchbaseSelect as lr, ArchbaseCheckbox as he, ArchbaseAvatarEdit as Jr, Columns as me, ArchbaseDataGridColumn as m, ArchbaseDataGrid as be, ArchbaseDialog as te } from "@archbase/components";
5
- import { useArchbaseV1V2Compatibility as ie, useArchbaseDataSourceListener as er, useArchbaseRemoteServiceApi as K, useArchbaseRemoteDataSource as se, ArchbaseDataSource as Zr, useArchbaseStore as cr, useArchbaseDataSource as Hr } from "@archbase/data";
6
- import { useState as U, useCallback as fe, useEffect as Ne, forwardRef as Qr, useMemo as pe, useRef as je } from "react";
7
- import { IconArrowRight as dr, IconArrowLeft as ur, IconChevronDown as rr, IconBorderCornerSquare as ar, IconEye as Ge, IconEdit as xe, IconTrashX as ve, IconShieldCheckered as Le, IconPlus as Fe } from "@tabler/icons-react";
8
- import { UserGroupDto as Yr, SecurityType as k, UserDto as Xr, GroupDto as Kr, ProfileDto as _r, ApiTokenDto as ea } from "@archbase/security";
9
- import { DateTimePicker as ra } from "@mantine/dates";
10
- import { ArchbaseSpaceFixed as aa, ArchbaseSpaceFill as ta, ArchbaseSpaceBottom as oa } from "@archbase/layout";
11
- var $e = { exports: {} }, Se = {};
1
+ import { Modal as Te, ScrollArea as ke, Stack as ne, Grid as T, Group as $, Button as V, Paper as X, Box as Ze, Text as H, List as Re, Checkbox as Qe, Tooltip as ie, ActionIcon as B, Flex as oe, Space as nr, Input as pe, useTree as Ye, useMantineColorScheme as Me, TextInput as Xe, Tree as Ke, Badge as Ce, Tabs as de, RingProgress as Nr } from "@mantine/core";
2
+ import { useFocusTrap as Ee, useDebouncedValue as _e } from "@mantine/hooks";
3
+ import { getI18nextInstance as t, ARCHBASE_IOC_API_TYPE as K, convertDateToISOString as Or, emit as ir, builder as ze, processErrorMessage as Ae, getKeyByEnumValue as ue, useArchbaseTheme as lr, useArchbaseValidator as Br, useArchbaseTranslation as Wr, processDetailErrorMessage as Fe } from "@archbase/core";
4
+ import { ArchbaseEdit as re, ArchbaseNotifications as Y, ArchbasePasswordEdit as qr, ArchbaseSelect as Hr, ArchbaseCheckbox as xe, ArchbaseAvatarEdit as Jr, ArchbaseAsyncSelect as Zr, Columns as be, ArchbaseDataGridColumn as j, ArchbaseDataGrid as je, ArchbaseDialog as _ } from "@archbase/components";
5
+ import { useArchbaseV1V2Compatibility as le, useArchbaseDataSourceListener as er, useArchbaseRemoteServiceApi as ee, useArchbaseRemoteDataSource as se, ArchbaseDataSource as Qr, useArchbaseStore as cr, useArchbaseDataSource as Yr } from "@archbase/data";
6
+ import { useState as U, useCallback as ge, useEffect as Ne, forwardRef as Xr, useMemo as me, useRef as ye } from "react";
7
+ import { IconArrowRight as dr, IconArrowLeft as ur, IconChevronDown as rr, IconBorderCornerSquare as ar, IconEye as $e, IconEdit as fe, IconTrashX as ve, IconShieldCheckered as Ge, IconPlus as Ie } from "@tabler/icons-react";
8
+ import { UserGroupDto as Kr, SecurityType as F, UserDto as _r, GroupDto as ea, ProfileDto as ra, ApiTokenDto as aa } from "@archbase/security";
9
+ import { DateTimePicker as ta } from "@mantine/dates";
10
+ import { ArchbaseSpaceFixed as oa, ArchbaseSpaceFill as sa, ArchbaseSpaceBottom as na } from "@archbase/layout";
11
+ var Le = { exports: {} }, Se = {};
12
12
  /**
13
13
  * @license React
14
14
  * react-jsx-runtime.production.js
@@ -19,56 +19,56 @@ var $e = { exports: {} }, Se = {};
19
19
  * LICENSE file in the root directory of this source tree.
20
20
  */
21
21
  var tr;
22
- function sa() {
22
+ function ia() {
23
23
  if (tr)
24
24
  return Se;
25
25
  tr = 1;
26
- var r = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
27
- function f(S, s, p) {
28
- var c = null;
29
- if (p !== void 0 && (c = "" + p), s.key !== void 0 && (c = "" + s.key), "key" in s) {
30
- p = {};
31
- for (var u in s)
32
- u !== "key" && (p[u] = s[u]);
26
+ var r = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
27
+ function g(v, s, x) {
28
+ var u = null;
29
+ if (x !== void 0 && (u = "" + x), s.key !== void 0 && (u = "" + s.key), "key" in s) {
30
+ x = {};
31
+ for (var C in s)
32
+ C !== "key" && (x[C] = s[C]);
33
33
  } else
34
- p = s;
35
- return s = p.ref, {
34
+ x = s;
35
+ return s = x.ref, {
36
36
  $$typeof: r,
37
- type: S,
38
- key: c,
37
+ type: v,
38
+ key: u,
39
39
  ref: s !== void 0 ? s : null,
40
- props: p
40
+ props: x
41
41
  };
42
42
  }
43
- return Se.Fragment = l, Se.jsx = f, Se.jsxs = f, Se;
43
+ return Se.Fragment = c, Se.jsx = g, Se.jsxs = g, Se;
44
44
  }
45
45
  var or;
46
- function na() {
47
- return or || (or = 1, $e.exports = sa()), $e.exports;
46
+ function la() {
47
+ return or || (or = 1, Le.exports = ia()), Le.exports;
48
48
  }
49
- var e = na();
50
- const ia = (r) => {
49
+ var e = la();
50
+ const ca = (r) => {
51
51
  Ee();
52
- const l = { ...r.options ?? {} }, f = () => {
52
+ const c = { ...r.options ?? {} }, g = () => {
53
53
  r.onCustomSave ? r.onCustomSave(r.dataSource.current, (s) => {
54
54
  s && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, s);
55
55
  }) : r.onClickOk(r.dataSource.current, !0);
56
- }, S = () => {
56
+ }, v = () => {
57
57
  r.onClickCancel(r.dataSource.current);
58
58
  };
59
59
  return /* @__PURE__ */ e.jsx(
60
- Ce,
60
+ Te,
61
61
  {
62
62
  opened: r.opened,
63
- onClose: S,
63
+ onClose: v,
64
64
  title: t().t("archbase:Perfil"),
65
65
  size: "60%",
66
66
  styles: { content: { maxWidth: 1e3 } },
67
- children: /* @__PURE__ */ e.jsx(Ae, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(ne, { w: "98%", children: [
68
- l?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: l.customContentBefore }),
69
- /* @__PURE__ */ e.jsxs(C, { children: [
70
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
71
- _,
67
+ children: /* @__PURE__ */ e.jsx(ke, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(ne, { w: "98%", children: [
68
+ c?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: c.customContentBefore }),
69
+ /* @__PURE__ */ e.jsxs(T, { children: [
70
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
71
+ re,
72
72
  {
73
73
  label: `${t().t("archbase:Nome do perfil")}`,
74
74
  placeholder: `${t().t("archbase:Informe o nome do perfil")}`,
@@ -76,8 +76,8 @@ const ia = (r) => {
76
76
  dataField: "name"
77
77
  }
78
78
  ) }),
79
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
80
- _,
79
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 12, lg: 12 }, children: /* @__PURE__ */ e.jsx(
80
+ re,
81
81
  {
82
82
  label: `${t().t("archbase:Descrição do perfil")}`,
83
83
  placeholder: `${t().t("archbase:Informe a descrição do perfil")}`,
@@ -86,75 +86,75 @@ const ia = (r) => {
86
86
  }
87
87
  ) })
88
88
  ] }),
89
- l?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: l.customContentAfter }),
90
- /* @__PURE__ */ e.jsxs(P, { justify: "flex-end", mt: "md", children: [
91
- /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: S, children: t().t("archbase:Cancelar") }),
92
- /* @__PURE__ */ e.jsx(V, { onClick: f, children: t().t("archbase:Salvar") })
89
+ c?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: c.customContentAfter }),
90
+ /* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
91
+ /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: v, children: t().t("archbase:Cancelar") }),
92
+ /* @__PURE__ */ e.jsx(V, { onClick: g, children: t().t("archbase:Salvar") })
93
93
  ] })
94
94
  ] }) })
95
95
  }
96
96
  );
97
97
  };
98
- function la({
98
+ function da({
99
99
  availableItemsDS: r,
100
- assignedItemsDS: l,
101
- idFieldAvailable: f,
102
- labelFieldAvailable: S,
100
+ assignedItemsDS: c,
101
+ idFieldAvailable: g,
102
+ labelFieldAvailable: v,
103
103
  idFieldAssigned: s,
104
- labelFieldAssigned: p,
105
- handleCreateAssociationObject: c,
106
- width: u = "400px",
107
- height: z = "200px",
108
- titleAvailable: R = "Disponíveis",
109
- titleAssigned: v = "Selecionados"
104
+ labelFieldAssigned: x,
105
+ handleCreateAssociationObject: u,
106
+ width: C = "400px",
107
+ height: E = "200px",
108
+ titleAvailable: h = "Disponíveis",
109
+ titleAssigned: y = "Selecionados"
110
110
  }) {
111
- ie(
111
+ le(
112
112
  "ArchbaseDualListSelector-Available",
113
113
  r,
114
114
  void 0,
115
115
  []
116
116
  );
117
- const d = ie(
117
+ const l = le(
118
118
  "ArchbaseDualListSelector-Assigned",
119
- l,
119
+ c,
120
120
  void 0,
121
121
  []
122
- ), [h, H] = U([]), [j, ee] = U([]), [W, re] = U([]), [Q, E] = U([]), M = fe(() => {
123
- r && H(r.browseRecords()), l && ee(l.browseRecords());
124
- }, [r, l]);
122
+ ), [p, M] = U([]), [f, ae] = U([]), [J, te] = U([]), [Q, D] = U([]), N = ge(() => {
123
+ r && M(r.browseRecords()), c && ae(c.browseRecords());
124
+ }, [r, c]);
125
125
  er({
126
126
  dataSource: r,
127
- listener: () => M()
127
+ listener: () => N()
128
128
  }), er({
129
- dataSource: l,
130
- listener: () => M()
129
+ dataSource: c,
130
+ listener: () => N()
131
131
  }), Ne(() => {
132
- M();
133
- }, [M]);
134
- const F = (x, b) => typeof b == "function" ? b(x) : x[b], B = (x, b) => typeof b == "function" ? b(x) : x[b], o = (x, b) => {
135
- x((D) => D.includes(b) ? D.filter((ge) => ge !== b) : [...D, b]);
136
- }, g = () => {
137
- W.forEach((x) => {
138
- const b = h.find((D) => F(D, f) === x);
132
+ N();
133
+ }, [N]);
134
+ const I = (d, b) => typeof b == "function" ? b(d) : d[b], q = (d, b) => typeof b == "function" ? b(d) : d[b], o = (d, b) => {
135
+ d((m) => m.includes(b) ? m.filter((he) => he !== b) : [...m, b]);
136
+ }, w = () => {
137
+ J.forEach((d) => {
138
+ const b = p.find((m) => I(m, g) === d);
139
139
  if (b) {
140
- const D = c(b);
141
- d.isDataSourceV2 ? (l.insert(D), l.save()) : (l.insert(D), l.save(), d.v1State.forceUpdate());
140
+ const m = u(b);
141
+ l.isDataSourceV2 ? (c.insert(m), c.save()) : (c.insert(m), c.save(), l.v1State.forceUpdate());
142
142
  }
143
- }), re([]);
144
- }, q = () => {
145
- Q.forEach((x) => {
146
- const b = j.find((D) => F(D, s) === x);
143
+ }), te([]);
144
+ }, O = () => {
145
+ Q.forEach((d) => {
146
+ const b = f.find((m) => I(m, s) === d);
147
147
  if (b) {
148
- const D = typeof s == "function" ? { customId: s(b) } : { [s]: x };
149
- d.isDataSourceV2 ? l.remove(() => l.locate(D)) : (l.remove(() => l.locate(D)), d.v1State.forceUpdate());
148
+ const m = typeof s == "function" ? { customId: s(b) } : { [s]: d };
149
+ l.isDataSourceV2 ? c.remove(() => c.locate(m)) : (c.remove(() => c.locate(m)), l.v1State.forceUpdate());
150
150
  }
151
- }), E([]);
151
+ }), D([]);
152
152
  };
153
- return /* @__PURE__ */ e.jsxs(Ie, { withBorder: !0, style: { display: "flex", width: u, height: z }, children: [
154
- /* @__PURE__ */ e.jsxs(oe, { style: { minWidth: "44%", minHeight: z }, children: [
155
- /* @__PURE__ */ e.jsx(Z, { children: R }),
153
+ return /* @__PURE__ */ e.jsxs(X, { withBorder: !0, style: { display: "flex", width: C, height: E }, children: [
154
+ /* @__PURE__ */ e.jsxs(Ze, { style: { minWidth: "44%", minHeight: E }, children: [
155
+ /* @__PURE__ */ e.jsx(H, { children: h }),
156
156
  /* @__PURE__ */ e.jsx(
157
- Te,
157
+ Re,
158
158
  {
159
159
  spacing: "xs",
160
160
  size: "sm",
@@ -166,28 +166,28 @@ function la({
166
166
  overflowX: "hidden",
167
167
  height: "calc(100% - 32px)"
168
168
  },
169
- children: h.map((x) => /* @__PURE__ */ e.jsx(Te.Item, { children: /* @__PURE__ */ e.jsx(
170
- He,
169
+ children: p.map((d) => /* @__PURE__ */ e.jsx(Re.Item, { children: /* @__PURE__ */ e.jsx(
170
+ Qe,
171
171
  {
172
- label: B(x, S),
173
- checked: W.includes(F(x, f)),
174
- onChange: () => o(re, F(x, f)),
175
- disabled: j.some(
176
- (b) => F(b, s) === F(x, f)
172
+ label: q(d, v),
173
+ checked: J.includes(I(d, g)),
174
+ onChange: () => o(te, I(d, g)),
175
+ disabled: f.some(
176
+ (b) => I(b, s) === I(d, g)
177
177
  )
178
178
  }
179
- ) }, F(x, f)))
179
+ ) }, I(d, g)))
180
180
  }
181
181
  )
182
182
  ] }),
183
183
  /* @__PURE__ */ e.jsxs(ne, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", children: [
184
- /* @__PURE__ */ e.jsx(de, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(N, { onClick: g, disabled: !W.length, children: /* @__PURE__ */ e.jsx(dr, {}) }) }),
185
- /* @__PURE__ */ e.jsx(de, { label: "Remover", children: /* @__PURE__ */ e.jsx(N, { onClick: q, disabled: !Q.length, children: /* @__PURE__ */ e.jsx(ur, {}) }) })
184
+ /* @__PURE__ */ e.jsx(ie, { label: "Adicionar", children: /* @__PURE__ */ e.jsx(B, { onClick: w, disabled: !J.length, children: /* @__PURE__ */ e.jsx(dr, {}) }) }),
185
+ /* @__PURE__ */ e.jsx(ie, { label: "Remover", children: /* @__PURE__ */ e.jsx(B, { onClick: O, disabled: !Q.length, children: /* @__PURE__ */ e.jsx(ur, {}) }) })
186
186
  ] }),
187
- /* @__PURE__ */ e.jsxs(oe, { style: { minWidth: "44%", minHeight: z }, children: [
188
- /* @__PURE__ */ e.jsx(Z, { children: v }),
187
+ /* @__PURE__ */ e.jsxs(Ze, { style: { minWidth: "44%", minHeight: E }, children: [
188
+ /* @__PURE__ */ e.jsx(H, { children: y }),
189
189
  /* @__PURE__ */ e.jsx(
190
- Te,
190
+ Re,
191
191
  {
192
192
  spacing: "xs",
193
193
  size: "sm",
@@ -199,25 +199,25 @@ function la({
199
199
  overflowX: "hidden",
200
200
  height: "calc(100% - 32px)"
201
201
  },
202
- children: j.map((x) => /* @__PURE__ */ e.jsx(Te.Item, { children: /* @__PURE__ */ e.jsx(
203
- He,
202
+ children: f.map((d) => /* @__PURE__ */ e.jsx(Re.Item, { children: /* @__PURE__ */ e.jsx(
203
+ Qe,
204
204
  {
205
- label: B(x, p),
206
- checked: Q.includes(F(x, s)),
207
- onChange: () => o(E, F(x, s))
205
+ label: q(d, x),
206
+ checked: Q.includes(I(d, s)),
207
+ onChange: () => o(D, I(d, s))
208
208
  }
209
- ) }, F(x, s)))
209
+ ) }, I(d, s)))
210
210
  }
211
211
  )
212
212
  ] })
213
213
  ] });
214
214
  }
215
- const ca = Qr(
216
- ({ image: r, label: l, description: f, origin: S, ...s }, p) => /* @__PURE__ */ e.jsx("div", { ref: p, ...s, children: /* @__PURE__ */ e.jsxs(ae, { children: [
217
- /* @__PURE__ */ e.jsx(Z, { size: "sm", fw: 600, children: S ? S.name : "" }),
215
+ const ua = Xr(
216
+ ({ image: r, label: c, description: g, origin: v, ...s }, x) => /* @__PURE__ */ e.jsx("div", { ref: x, ...s, children: /* @__PURE__ */ e.jsxs(oe, { children: [
217
+ /* @__PURE__ */ e.jsx(H, { size: "sm", fw: 600, children: v ? v.name : "" }),
218
218
  /* @__PURE__ */ e.jsx(nr, { w: "lg" })
219
219
  ] }) })
220
- ), da = {
220
+ ), ha = {
221
221
  // Campos de identificação
222
222
  showNickname: !0,
223
223
  // Campos de perfil e grupos
@@ -237,56 +237,56 @@ const ca = Qr(
237
237
  avatarMaxSizeKB: 2e3,
238
238
  avatarImageQuality: 1,
239
239
  allowEditEmail: !0
240
- }, ua = (r) => {
241
- const l = Ee(), [f, S] = U(""), s = { ...da, ...r.options ?? {} }, p = K(X.Group), { dataSource: c } = se({
240
+ }, pa = (r) => {
241
+ const c = Ee(), [g, v] = U(""), s = { ...ha, ...r.options ?? {} }, x = ee(K.Group), { dataSource: u } = se({
242
242
  name: "dsGroups",
243
- service: p,
243
+ service: x,
244
244
  pageSize: 9999,
245
245
  loadOnStart: !0,
246
246
  sort: ["name:asc"],
247
- onError: (d, h) => {
248
- Y.showError(t().t("archbase:WARNING"), d, h);
247
+ onError: (l, p) => {
248
+ Y.showError(t().t("archbase:WARNING"), l, p);
249
249
  }
250
- }), u = K(X.Profile), { dataSource: z } = se({
250
+ }), C = ee(K.Profile), { dataSource: E } = se({
251
251
  name: "dsProfiles",
252
- service: u,
252
+ service: C,
253
253
  pageSize: 9999,
254
254
  loadOnStart: !0,
255
255
  sort: ["name:asc"],
256
- onError: (d, h) => {
257
- Y.showError(t().t("archbase:WARNING"), d, h);
256
+ onError: (l, p) => {
257
+ Y.showError(t().t("archbase:WARNING"), l, p);
258
258
  }
259
259
  });
260
260
  Ne(() => {
261
- S("");
261
+ v("");
262
262
  }, [r.dataSource.getFieldValue("password")]);
263
- const R = () => {
264
- const d = r.dataSource.current;
265
- if (!d.password && r.dataSource.isInserting()) {
266
- S(t().t("archbase:Informe a senha"));
263
+ const h = () => {
264
+ const l = r.dataSource.current;
265
+ if (!l.password && r.dataSource.isInserting()) {
266
+ v(t().t("archbase:Informe a senha"));
267
267
  return;
268
268
  }
269
- r.onCustomSave ? r.onCustomSave(d, (h) => {
270
- h && r.onAfterSave && r.onAfterSave(d), r.onClickOk(d, h);
271
- }) : r.onClickOk(d, !0);
272
- }, v = () => {
269
+ r.onCustomSave ? r.onCustomSave(l, (p) => {
270
+ p && r.onAfterSave && r.onAfterSave(l), r.onClickOk(l, p);
271
+ }) : r.onClickOk(l, !0);
272
+ }, y = () => {
273
273
  r.onClickCancel(r.dataSource.current);
274
274
  };
275
275
  return /* @__PURE__ */ e.jsxs(
276
- Ce,
276
+ Te,
277
277
  {
278
278
  opened: r.opened,
279
- onClose: v,
279
+ onClose: y,
280
280
  title: t().t("archbase:Usuário"),
281
281
  size: "80%",
282
282
  styles: { content: { maxWidth: 1e3 } },
283
283
  children: [
284
- /* @__PURE__ */ e.jsx(Ae, { ref: l, style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(ne, { w: "98%", children: [
284
+ /* @__PURE__ */ e.jsx(ke, { ref: c, style: { height: "500px" }, children: /* @__PURE__ */ e.jsxs(ne, { w: "98%", children: [
285
285
  s?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: s.customContentBefore }),
286
- /* @__PURE__ */ e.jsxs(C, { children: [
287
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs(P, { children: [
286
+ /* @__PURE__ */ e.jsxs(T, { children: [
287
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsxs($, { children: [
288
288
  /* @__PURE__ */ e.jsx(
289
- _,
289
+ re,
290
290
  {
291
291
  label: `${t().t("archbase:Nome completo")}`,
292
292
  placeholder: `${t().t("archbase:Informe o nome completo do usuário")}`,
@@ -297,7 +297,7 @@ const ca = Qr(
297
297
  }
298
298
  ),
299
299
  s.showNickname && /* @__PURE__ */ e.jsx(
300
- _,
300
+ re,
301
301
  {
302
302
  label: `${t().t("archbase:Apelido")}`,
303
303
  placeholder: `${t().t("archbase:Apelido")}`,
@@ -307,8 +307,8 @@ const ca = Qr(
307
307
  }
308
308
  )
309
309
  ] }) }),
310
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
311
- _,
310
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
311
+ re,
312
312
  {
313
313
  label: `${t().t("archbase:Descrição do usuário")}`,
314
314
  placeholder: `${t().t("archbase:Informe a descrição do usuário")}`,
@@ -318,65 +318,65 @@ const ca = Qr(
318
318
  }
319
319
  ) })
320
320
  ] }),
321
- /* @__PURE__ */ e.jsxs(C, { children: [
322
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
323
- _,
321
+ /* @__PURE__ */ e.jsxs(T, { children: [
322
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
323
+ re,
324
324
  {
325
325
  label: `${t().t("archbase:E-mail")}`,
326
326
  placeholder: `${t().t("archbase:Informe o e-mail do usuário")}`,
327
327
  dataSource: r.dataSource,
328
- onChangeValue: (d) => r.dataSource.setFieldValue("userName", d),
328
+ onChangeValue: (l) => r.dataSource.setFieldValue("userName", l),
329
329
  dataField: "email",
330
330
  readOnly: r.dataSource.isEditing() ? !s.allowEditEmail : !1,
331
331
  required: !0
332
332
  }
333
333
  ) }),
334
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
334
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
335
335
  qr,
336
336
  {
337
337
  label: `${t().t("archbase:Senha usuário")}`,
338
338
  dataSource: r.dataSource,
339
339
  dataField: "password",
340
- error: f,
340
+ error: g,
341
341
  required: r.dataSource.getFieldValue("isNewUser")
342
342
  }
343
343
  ) })
344
344
  ] }),
345
- /* @__PURE__ */ e.jsx(C, { children: s.showProfile && /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
346
- lr,
345
+ /* @__PURE__ */ e.jsx(T, { children: s.showProfile && /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 6, lg: 6 }, children: /* @__PURE__ */ e.jsx(
346
+ Hr,
347
347
  {
348
348
  label: `${t().t("archbase:Perfil do usuário")}`,
349
349
  dataSource: r.dataSource,
350
350
  dataField: "profile",
351
- options: z,
351
+ options: E,
352
352
  allowDeselect: !0,
353
353
  optionsLabelField: "nome",
354
- itemComponent: ca,
355
- getOptionLabel: (d) => d.name,
356
- getOptionValue: (d) => d.id
354
+ itemComponent: ua,
355
+ getOptionLabel: (l) => l.name,
356
+ getOptionValue: (l) => l.id
357
357
  }
358
358
  ) }) }),
359
- /* @__PURE__ */ e.jsxs(C, { children: [
360
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12 }, children: s.showAccountConfigLabel && /* @__PURE__ */ e.jsx(Z, { fz: 14, fw: 500, children: "Informe" }) }),
361
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(ne, { gap: "lg", children: [
362
- s.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(ue.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
363
- he,
359
+ /* @__PURE__ */ e.jsxs(T, { children: [
360
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12 }, children: s.showAccountConfigLabel && /* @__PURE__ */ e.jsx(H, { fz: 14, fw: 500, children: "Informe" }) }),
361
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(ne, { gap: "lg", children: [
362
+ s.showChangePasswordOnNextLogin && /* @__PURE__ */ e.jsx(pe.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
363
+ xe,
364
364
  {
365
365
  dataSource: r.dataSource,
366
366
  dataField: "changePasswordOnNextLogin",
367
367
  label: `${t().t("archbase:Deve alterar senha próximo login ?")}`
368
368
  }
369
369
  ) }),
370
- s.showAllowPasswordChange && /* @__PURE__ */ e.jsx(ue.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
371
- he,
370
+ s.showAllowPasswordChange && /* @__PURE__ */ e.jsx(pe.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
371
+ xe,
372
372
  {
373
373
  dataSource: r.dataSource,
374
374
  dataField: "allowPasswordChange",
375
375
  label: `${t().t("archbase:Pode alterar a senha ?")}`
376
376
  }
377
377
  ) }),
378
- s.showPasswordNeverExpires && /* @__PURE__ */ e.jsx(ue.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
379
- he,
378
+ s.showPasswordNeverExpires && /* @__PURE__ */ e.jsx(pe.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
379
+ xe,
380
380
  {
381
381
  dataSource: r.dataSource,
382
382
  dataField: "passwordNeverExpires",
@@ -384,25 +384,25 @@ const ca = Qr(
384
384
  }
385
385
  ) })
386
386
  ] }) }),
387
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(ne, { gap: "lg", children: [
388
- s.showAccountDeactivated && /* @__PURE__ */ e.jsx(ue.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
389
- he,
387
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsxs(ne, { gap: "lg", children: [
388
+ s.showAccountDeactivated && /* @__PURE__ */ e.jsx(pe.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
389
+ xe,
390
390
  {
391
391
  dataSource: r.dataSource,
392
392
  dataField: "accountDeactivated",
393
393
  label: `${t().t("archbase:Conta desativada ?")}`
394
394
  }
395
395
  ) }),
396
- s.showAccountLocked && /* @__PURE__ */ e.jsx(ue.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
397
- he,
396
+ s.showAccountLocked && /* @__PURE__ */ e.jsx(pe.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
397
+ xe,
398
398
  {
399
399
  dataSource: r.dataSource,
400
400
  dataField: "accountLocked",
401
401
  label: `${t().t("archbase:Conta bloqueada ?")}`
402
402
  }
403
403
  ) }),
404
- s.showIsAdministrator && /* @__PURE__ */ e.jsx(ue.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
405
- he,
404
+ s.showIsAdministrator && /* @__PURE__ */ e.jsx(pe.Wrapper, { label: "", children: /* @__PURE__ */ e.jsx(
405
+ xe,
406
406
  {
407
407
  dataSource: r.dataSource,
408
408
  dataField: "isAdministrator",
@@ -410,7 +410,7 @@ const ca = Qr(
410
410
  }
411
411
  ) })
412
412
  ] }) }),
413
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(ne, { gap: "lg", children: /* @__PURE__ */ e.jsx(
413
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12, md: 4, lg: 4 }, children: /* @__PURE__ */ e.jsx(ne, { gap: "lg", children: /* @__PURE__ */ e.jsx(
414
414
  Jr,
415
415
  {
416
416
  label: t().t("archbase:Foto do usuário"),
@@ -423,14 +423,14 @@ const ca = Qr(
423
423
  }
424
424
  ) }) })
425
425
  ] }),
426
- s.showGroups && /* @__PURE__ */ e.jsxs(C, { children: [
427
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(Z, { fz: 14, fw: 500, children: "Grupos" }) }),
428
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
429
- la,
426
+ s.showGroups && /* @__PURE__ */ e.jsxs(T, { children: [
427
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(H, { fz: 14, fw: 500, children: "Grupos" }) }),
428
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
429
+ da,
430
430
  {
431
431
  titleAvailable: t().t("archbase:Disponíveis"),
432
432
  titleAssigned: t().t("archbase:Selecionados"),
433
- assignedItemsDS: new Zr("dsDualList", {
433
+ assignedItemsDS: new Qr("dsDualList", {
434
434
  records: r.dataSource.getFieldValue("groups"),
435
435
  grandTotalRecords: r.dataSource.getFieldValue("groups").length,
436
436
  currentPage: 0,
@@ -439,11 +439,11 @@ const ca = Qr(
439
439
  }),
440
440
  width: "100%",
441
441
  height: "200px",
442
- availableItemsDS: c,
443
- handleCreateAssociationObject: (d) => Yr.newInstance(d),
444
- idFieldAssigned: (d) => d && d.group ? d.group.id : "",
442
+ availableItemsDS: u,
443
+ handleCreateAssociationObject: (l) => Kr.newInstance(l),
444
+ idFieldAssigned: (l) => l && l.group ? l.group.id : "",
445
445
  idFieldAvailable: "id",
446
- labelFieldAssigned: (d) => d && d.group ? d.group.name : "",
446
+ labelFieldAssigned: (l) => l && l.group ? l.group.name : "",
447
447
  labelFieldAvailable: "name"
448
448
  }
449
449
  ) })
@@ -451,35 +451,35 @@ const ca = Qr(
451
451
  s?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: s.customContentAfter }),
452
452
  /* @__PURE__ */ e.jsx(nr, { h: "12px" })
453
453
  ] }) }),
454
- /* @__PURE__ */ e.jsxs(P, { justify: "flex-end", mt: "md", children: [
455
- /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: v, children: t().t("archbase:Cancelar") }),
456
- /* @__PURE__ */ e.jsx(V, { onClick: R, children: t().t("archbase:Salvar") })
454
+ /* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
455
+ /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: y, children: t().t("archbase:Cancelar") }),
456
+ /* @__PURE__ */ e.jsx(V, { onClick: h, children: t().t("archbase:Salvar") })
457
457
  ] })
458
458
  ]
459
459
  }
460
460
  );
461
- }, ha = (r) => {
461
+ }, xa = (r) => {
462
462
  Ee();
463
- const l = { ...r.options ?? {} }, f = () => {
463
+ const c = { ...r.options ?? {} }, g = () => {
464
464
  r.onCustomSave ? r.onCustomSave(r.dataSource.current, (s) => {
465
465
  s && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, s);
466
466
  }) : r.onClickOk(r.dataSource.current, !0);
467
- }, S = () => {
467
+ }, v = () => {
468
468
  r.onClickCancel(r.dataSource.current);
469
469
  };
470
470
  return /* @__PURE__ */ e.jsx(
471
- Ce,
471
+ Te,
472
472
  {
473
473
  opened: r.opened,
474
- onClose: S,
474
+ onClose: v,
475
475
  title: t().t("archbase:Grupo"),
476
476
  size: "60%",
477
477
  styles: { content: { maxWidth: 1e3 } },
478
- children: /* @__PURE__ */ e.jsx(Ae, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(ne, { w: "98%", children: [
479
- l?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: r.options.customContentBefore }),
480
- /* @__PURE__ */ e.jsxs(C, { children: [
481
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
482
- _,
478
+ children: /* @__PURE__ */ e.jsx(ke, { style: { height: "460px" }, children: /* @__PURE__ */ e.jsxs(ne, { w: "98%", children: [
479
+ c?.customContentBefore && /* @__PURE__ */ e.jsx(e.Fragment, { children: r.options.customContentBefore }),
480
+ /* @__PURE__ */ e.jsxs(T, { children: [
481
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
482
+ re,
483
483
  {
484
484
  label: `${t().t("archbase:Nome do grupo")}`,
485
485
  placeholder: `${t().t("archbase:Informe o nome do grupo")}`,
@@ -487,8 +487,8 @@ const ca = Qr(
487
487
  dataField: "name"
488
488
  }
489
489
  ) }),
490
- /* @__PURE__ */ e.jsx(C.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
491
- _,
490
+ /* @__PURE__ */ e.jsx(T.Col, { span: { base: 12 }, children: /* @__PURE__ */ e.jsx(
491
+ re,
492
492
  {
493
493
  label: `${t().t("archbase:Descrição do grupo")}`,
494
494
  placeholder: `${t().t("archbase:Informe a descrição do grupo")}`,
@@ -497,55 +497,64 @@ const ca = Qr(
497
497
  }
498
498
  ) })
499
499
  ] }),
500
- l?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: r.options.customContentAfter }),
501
- /* @__PURE__ */ e.jsxs(P, { justify: "flex-end", mt: "md", children: [
502
- /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: S, children: t().t("archbase:Cancelar") }),
503
- /* @__PURE__ */ e.jsx(V, { onClick: f, children: t().t("archbase:Salvar") })
500
+ c?.customContentAfter && /* @__PURE__ */ e.jsx(e.Fragment, { children: r.options.customContentAfter }),
501
+ /* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
502
+ /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: v, children: t().t("archbase:Cancelar") }),
503
+ /* @__PURE__ */ e.jsx(V, { onClick: g, children: t().t("archbase:Salvar") })
504
504
  ] })
505
505
  ] }) })
506
506
  }
507
507
  );
508
- }, pa = ({ image: r, label: l, description: f, ...S }) => /* @__PURE__ */ e.jsx("div", { ...S, children: /* @__PURE__ */ e.jsxs(P, { grow: !0, children: [
508
+ }, ma = ({ image: r, label: c, description: g, ...v }) => /* @__PURE__ */ e.jsx("div", { ...v, children: /* @__PURE__ */ e.jsxs($, { grow: !0, children: [
509
509
  /* @__PURE__ */ e.jsx("img", { style: { maxWidth: "32px" }, src: r }),
510
510
  /* @__PURE__ */ e.jsxs("div", { children: [
511
- /* @__PURE__ */ e.jsx(Z, { size: "sm", children: l }),
512
- /* @__PURE__ */ e.jsx(Z, { size: "xs", opacity: 0.65, children: f })
511
+ /* @__PURE__ */ e.jsx(H, { size: "sm", children: c }),
512
+ /* @__PURE__ */ e.jsx(H, { size: "xs", opacity: 0.65, children: g })
513
513
  ] })
514
- ] }) }), xa = (r) => {
514
+ ] }) }), fa = (r) => {
515
515
  Ee();
516
- const [l, f] = U();
517
- K(X.User);
518
- const S = ie(
516
+ const [c, g] = U(), v = ee(K.User), s = le(
519
517
  "ApiTokenModal",
520
518
  r.dataSource,
521
519
  "expirationDate",
522
520
  ""
523
- ), s = (u) => {
524
- if (!u)
525
- S.handleValueChange(void 0);
521
+ ), x = (h) => {
522
+ if (!h)
523
+ s.handleValueChange(void 0);
526
524
  else {
527
- const z = typeof u == "string" ? new Date(u) : u, R = Nr(z);
528
- S.handleValueChange(R);
525
+ const y = typeof h == "string" ? new Date(h) : h, l = Or(y);
526
+ s.handleValueChange(l);
527
+ }
528
+ g(h);
529
+ }, u = async (h, y) => new Promise(async (l, p) => {
530
+ try {
531
+ const M = ir(ze.or(ze.eq("name", `^*${y.trim()}*`))), f = await v.findAllWithFilter(M, h, 20);
532
+ l({
533
+ options: f.content,
534
+ page: f.pageable.pageNumber,
535
+ totalPages: f.totalPages
536
+ });
537
+ } catch (M) {
538
+ p(Ae(M));
529
539
  }
530
- f(u);
531
- }, p = () => {
532
- r.onCustomSave ? r.onCustomSave(r.dataSource.current, (u) => {
533
- u && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, u);
540
+ }), C = () => {
541
+ r.onCustomSave ? r.onCustomSave(r.dataSource.current, (h) => {
542
+ h && r.onAfterSave && r.onAfterSave(r.dataSource.current), r.onClickOk(r.dataSource.current, h);
534
543
  }) : r.onClickOk(r.dataSource.current, !0);
535
- }, c = () => {
544
+ }, E = () => {
536
545
  r.onClickCancel(r.dataSource.current);
537
546
  };
538
547
  return /* @__PURE__ */ e.jsxs(
539
- Ce,
548
+ Te,
540
549
  {
541
550
  opened: r.opened,
542
- onClose: c,
551
+ onClose: E,
543
552
  title: t().t("archbase:Token de API"),
544
553
  size: "50%",
545
554
  children: [
546
- /* @__PURE__ */ e.jsxs(Ae, { style: { height: "300px" }, children: [
555
+ /* @__PURE__ */ e.jsxs(ke, { style: { height: "300px" }, children: [
547
556
  /* @__PURE__ */ e.jsx(
548
- _,
557
+ re,
549
558
  {
550
559
  label: `${t().t("archbase:Nome do token")}`,
551
560
  placeholder: `${t().t("archbase:Informe o nome do token")}`,
@@ -554,7 +563,7 @@ const ca = Qr(
554
563
  }
555
564
  ),
556
565
  /* @__PURE__ */ e.jsx(
557
- _,
566
+ re,
558
567
  {
559
568
  label: `${t().t("archbase:Descrição do token")}`,
560
569
  placeholder: `${t().t("archbase:Informe a descrição do token")}`,
@@ -563,46 +572,47 @@ const ca = Qr(
563
572
  }
564
573
  ),
565
574
  /* @__PURE__ */ e.jsx(
566
- ra,
575
+ ta,
567
576
  {
568
577
  withSeconds: !0,
569
- value: l,
570
- onChange: s,
578
+ value: c,
579
+ onChange: x,
571
580
  label: "Data/hora expiração",
572
581
  placeholder: "Selecione a data de expiração"
573
582
  }
574
583
  ),
575
584
  /* @__PURE__ */ e.jsx(
576
- lr,
585
+ Zr,
577
586
  {
578
587
  label: `${t().t("archbase:Usuário")}`,
579
588
  dataSource: r.dataSource,
580
589
  dataField: "user",
581
590
  placeholder: `${t().t("archbase:Digite aqui o nome do usuário")}`,
582
- getOptionLabel: (u) => u && u.email,
583
- getOptionValue: (u) => u.id?.toString() || "",
591
+ getOptionLabel: (h) => h && h.email ? h.email : "",
592
+ getOptionValue: (h) => h && h.id ? h.id.toString() : "",
593
+ getOptions: u,
584
594
  debounceTime: 500,
585
- itemComponent: pa,
586
- options: []
595
+ minCharsToSearch: 1,
596
+ itemComponent: ma
587
597
  }
588
598
  )
589
599
  ] }),
590
- /* @__PURE__ */ e.jsxs(P, { justify: "flex-end", mt: "md", children: [
591
- /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: c, children: t().t("archbase:Cancelar") }),
592
- /* @__PURE__ */ e.jsx(V, { onClick: p, children: t().t("archbase:Salvar") })
600
+ /* @__PURE__ */ e.jsxs($, { justify: "flex-end", mt: "md", children: [
601
+ /* @__PURE__ */ e.jsx(V, { variant: "default", onClick: E, children: t().t("archbase:Cancelar") }),
602
+ /* @__PURE__ */ e.jsx(V, { onClick: C, children: t().t("archbase:Salvar") })
593
603
  ] })
594
604
  ]
595
605
  }
596
606
  );
597
607
  }, sr = (r) => {
598
- const l = "->";
599
- return r.includes(l) ? r.split(l).map((s) => s.trim()).map((s) => t().t(s)).join(` ${l} `) : t().t(r);
608
+ const c = "->";
609
+ return r.includes(c) ? r.split(c).map((s) => s.trim()).map((s) => t().t(s)).join(` ${c} `) : t().t(r);
600
610
  };
601
- function Ve({ dataSource: r, opened: l, close: f }) {
602
- const S = pe(() => r?.getFieldValue("name") || "", [r]), s = pe(() => r?.getFieldValue("id") || "", [r]), p = pe(() => r?.getFieldValue("type") || "", [r]), c = Qe(), u = Qe(), [z, R] = U([]), [v, d] = U([]), [h, H] = U(), [j, ee] = U(), [W, re] = U(""), [Q] = Ke(W, 200), [E, M] = U(""), [F] = Ke(E, 200), B = K(X.Resource), { colorScheme: o } = Me(), g = o === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", q = pe(() => v.sort((n, i) => n.resourceDescription.localeCompare(i.resourceDescription)).map((n) => ({
611
+ function Ve({ dataSource: r, opened: c, close: g }) {
612
+ const v = me(() => r?.getFieldValue("name") || "", [r]), s = me(() => r?.getFieldValue("id") || "", [r]), x = me(() => r?.getFieldValue("type") || "", [r]), u = Ye(), C = Ye(), [E, h] = U([]), [y, l] = U([]), [p, M] = U(), [f, ae] = U(), [J, te] = U(""), [Q] = _e(J, 200), [D, N] = U(""), [I] = _e(D, 200), q = ee(K.Resource), { colorScheme: o } = Me(), w = o === "dark" ? "var(--mantine-primary-color-7)" : "var(--mantine-primary-color-4)", O = me(() => y.sort((n, i) => n.resourceDescription.localeCompare(i.resourceDescription)).map((n) => ({
603
613
  value: n.resourceId,
604
614
  label: n.resourceDescription,
605
- children: n.permissions.filter((i) => i.actionDescription.toLowerCase().includes(F.toLowerCase())).sort((i, G) => i.actionDescription.localeCompare(G.actionDescription)).map((i) => ({
615
+ children: n.permissions.filter((i) => i.actionDescription.toLowerCase().includes(I.toLowerCase())).sort((i, P) => i.actionDescription.localeCompare(P.actionDescription)).map((i) => ({
606
616
  value: i.actionId,
607
617
  label: i.actionDescription,
608
618
  nodeProps: {
@@ -611,52 +621,52 @@ function Ve({ dataSource: r, opened: l, close: f }) {
611
621
  owner: n
612
622
  }
613
623
  }))
614
- })), [v, F]), x = pe(() => v.map((n) => n.permissions.map((i) => i.actionId)).flat(), [v]), b = pe(() => z.sort((n, i) => n.resourceDescription.localeCompare(i.resourceDescription)).map((n) => ({
624
+ })), [y, I]), d = me(() => y.map((n) => n.permissions.map((i) => i.actionId)).flat(), [y]), b = me(() => E.sort((n, i) => n.resourceDescription.localeCompare(i.resourceDescription)).map((n) => ({
615
625
  value: n.resourceId,
616
626
  label: n.resourceDescription,
617
- children: n.permissions.filter((i) => i.actionDescription.toLowerCase().includes(Q.toLowerCase())).sort((i, G) => i.actionDescription.localeCompare(G.actionDescription)).map((i) => {
618
- const G = v.find((y) => y.resourceId === n.resourceId)?.permissions.find((y) => y.actionId === i.actionId);
627
+ children: n.permissions.filter((i) => i.actionDescription.toLowerCase().includes(Q.toLowerCase())).sort((i, P) => i.actionDescription.localeCompare(P.actionDescription)).map((i) => {
628
+ const P = y.find((S) => S.resourceId === n.resourceId)?.permissions.find((S) => S.actionId === i.actionId);
619
629
  return {
620
630
  value: i.actionId,
621
631
  label: i.actionDescription,
622
632
  nodeProps: {
623
- granted: x.includes(i.actionId) && G?.types?.includes(ce(k, p)),
633
+ granted: d.includes(i.actionId) && P?.types?.includes(ue(F, x)),
624
634
  owner: n
625
635
  }
626
636
  };
627
637
  })
628
- })), [z, v, x, p, Q]), D = fe(async () => {
638
+ })), [E, y, d, x, Q]), m = ge(async () => {
629
639
  if (s) {
630
- const n = await B.getPermissionsBySecurityId(s, p), i = await B.getAllPermissionsAvailable();
631
- R(i), d(n);
640
+ const n = await q.getPermissionsBySecurityId(s, x), i = await q.getAllPermissionsAvailable();
641
+ h(i), l(n);
632
642
  }
633
- }, [s, p]), ge = fe(() => {
634
- h?.value && s && B.createPermission(s, h.value, p).then((n) => {
643
+ }, [s, x]), he = ge(() => {
644
+ p?.value && s && q.createPermission(s, p.value, x).then((n) => {
635
645
  if (n) {
636
- d((I) => {
637
- let A;
638
- return I.map((w) => w.resourceId).includes(n.resourceId) ? A = I.map((w) => w.resourceId === n.resourceId ? w.permissions.map((T) => T.actionId).includes(h.value) ? {
639
- ...w,
640
- permissions: w.permissions.map(
641
- (T) => T.actionId === h.value ? {
642
- ...T,
646
+ l((z) => {
647
+ let k;
648
+ return z.map((A) => A.resourceId).includes(n.resourceId) ? k = z.map((A) => A.resourceId === n.resourceId ? A.permissions.map((R) => R.actionId).includes(p.value) ? {
649
+ ...A,
650
+ permissions: A.permissions.map(
651
+ (R) => R.actionId === p.value ? {
652
+ ...R,
643
653
  permissionId: n.permissionId,
644
- types: [...T.types ?? [], ce(k, p)]
645
- } : T
654
+ types: [...R.types ?? [], ue(F, x)]
655
+ } : R
646
656
  )
647
657
  } : {
648
- ...w,
658
+ ...A,
649
659
  permissions: [
650
- ...w.permissions ?? [],
660
+ ...A.permissions ?? [],
651
661
  {
652
662
  actionId: n.actionId,
653
663
  actionDescription: n.actionDescription,
654
664
  permissionId: n.permissionId,
655
- types: [ce(k, p)]
665
+ types: [ue(F, x)]
656
666
  }
657
667
  ]
658
- } : w) : A = [
659
- ...I,
668
+ } : A) : k = [
669
+ ...z,
660
670
  {
661
671
  resourceId: n.resourceId,
662
672
  resourceDescription: n.resourceDescription,
@@ -665,86 +675,86 @@ function Ve({ dataSource: r, opened: l, close: f }) {
665
675
  actionId: n.actionId,
666
676
  actionDescription: n.actionDescription,
667
677
  permissionId: n.permissionId,
668
- types: [ce(k, p)]
678
+ types: [ue(F, x)]
669
679
  }
670
680
  ]
671
681
  }
672
- ], A;
682
+ ], k;
673
683
  });
674
- const i = b.filter((I) => I.value === h?.nodeProps?.owner?.resourceId).map((I) => I.children).flat(), G = i.map((I) => I.value).indexOf(h.value), y = i.find((I, A) => !I?.nodeProps?.granted && I?.value !== h.value && (i.length > G + 1 ? A > G : !0));
675
- y?.value && c.select(y.value), u.expand(n.resourceId), H(y);
684
+ const i = b.filter((z) => z.value === p?.nodeProps?.owner?.resourceId).map((z) => z.children).flat(), P = i.map((z) => z.value).indexOf(p.value), S = i.find((z, k) => !z?.nodeProps?.granted && z?.value !== p.value && (i.length > P + 1 ? k > P : !0));
685
+ S?.value && u.select(S.value), C.expand(n.resourceId), M(S);
676
686
  }
677
687
  });
678
- }, [h, s, p, B, b, z, v, c, u]), ze = fe(() => {
679
- j?.nodeProps?.permissionId && B.deletePermission(j.nodeProps.permissionId).then(() => {
680
- d((y) => [...y].filter((A) => {
681
- let w = !0;
682
- return A.permissions?.forEach((T) => {
683
- T.permissionId !== void 0 && T.permissionId === j?.nodeProps?.permissionId && A.permissions.length === 1 && T?.types?.length === 1 && T.types[0] === ce(k, p) && (w = !1);
684
- }), w;
685
- }).map((A) => {
686
- const w = j?.nodeProps?.owner;
687
- return A.resourceId === w.resourceId ? j?.nodeProps?.types?.length === 1 ? {
688
- ...A,
689
- permissions: [...(A.permissions ?? []).filter((T) => T.permissionId !== j?.nodeProps?.permissionId)]
688
+ }, [p, s, x, q, b, E, y, u, C]), ce = ge(() => {
689
+ f?.nodeProps?.permissionId && q.deletePermission(f.nodeProps.permissionId).then(() => {
690
+ l((S) => [...S].filter((k) => {
691
+ let A = !0;
692
+ return k.permissions?.forEach((R) => {
693
+ R.permissionId !== void 0 && R.permissionId === f?.nodeProps?.permissionId && k.permissions.length === 1 && R?.types?.length === 1 && R.types[0] === ue(F, x) && (A = !1);
694
+ }), A;
695
+ }).map((k) => {
696
+ const A = f?.nodeProps?.owner;
697
+ return k.resourceId === A.resourceId ? f?.nodeProps?.types?.length === 1 ? {
698
+ ...k,
699
+ permissions: [...(k.permissions ?? []).filter((R) => R.permissionId !== f?.nodeProps?.permissionId)]
690
700
  } : {
691
- ...A,
692
- permissions: (A.permissions ?? []).map((T) => T.actionId === j.value ? {
693
- actionId: T.actionId,
694
- actionDescription: T.actionDescription,
695
- types: [...T.types?.filter((L) => L && L !== ce(k, p)) ?? []]
696
- } : T)
697
- } : A;
701
+ ...k,
702
+ permissions: (k.permissions ?? []).map((R) => R.actionId === f.value ? {
703
+ actionId: R.actionId,
704
+ actionDescription: R.actionDescription,
705
+ types: [...R.types?.filter((G) => G && G !== ue(F, x)) ?? []]
706
+ } : R)
707
+ } : k;
698
708
  }));
699
- const n = q.filter((y) => y.value === j?.nodeProps?.owner?.resourceId).map((y) => y.children).flat(), i = n.map((y) => y.value).indexOf(j.value), G = n.find((y, I) => y?.nodeProps?.types.includes(ce(k, p)) && y?.value !== j.value && (n.length > i + 1 ? I > i : !0));
700
- G?.value && u.select(G.value), ee(G);
709
+ const n = O.filter((S) => S.value === f?.nodeProps?.owner?.resourceId).map((S) => S.children).flat(), i = n.map((S) => S.value).indexOf(f.value), P = n.find((S, z) => S?.nodeProps?.types.includes(ue(F, x)) && S?.value !== f.value && (n.length > i + 1 ? z > i : !0));
710
+ P?.value && C.select(P.value), ae(P);
701
711
  });
702
- }, [j, B, p, q, v, u]);
712
+ }, [f, q, x, O, y, C]);
703
713
  return Ne(() => {
704
- l && r && (H(void 0), ee(void 0), re(""), M(""), u.collapseAllNodes(), c.collapseAllNodes(), D());
705
- }, [l, p, s, D]), r ? /* @__PURE__ */ e.jsx(Ce, { opened: l, onClose: f, title: `${t().t(`archbase:${p}`)}: ${S}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(aa, { height: "540px", children: [
706
- /* @__PURE__ */ e.jsx(ta, { children: /* @__PURE__ */ e.jsx(Ae, { h: "500px", children: /* @__PURE__ */ e.jsx(Ie, { withBorder: !0, my: 20, p: 20, children: /* @__PURE__ */ e.jsxs(C, { columns: 20, children: [
707
- /* @__PURE__ */ e.jsxs(C.Col, { span: 9, children: [
708
- /* @__PURE__ */ e.jsxs(P, { mb: 20, children: [
709
- /* @__PURE__ */ e.jsx(Z, { children: t().t("archbase:Available") }),
714
+ c && r && (M(void 0), ae(void 0), te(""), N(""), C.collapseAllNodes(), u.collapseAllNodes(), m());
715
+ }, [c, x, s, m]), r ? /* @__PURE__ */ e.jsx(Te, { opened: c, onClose: g, title: `${t().t(`archbase:${x}`)}: ${v}`, size: "80%", styles: { root: { overflow: "hidden" } }, children: /* @__PURE__ */ e.jsxs(oa, { height: "540px", children: [
716
+ /* @__PURE__ */ e.jsx(sa, { children: /* @__PURE__ */ e.jsx(ke, { h: "500px", children: /* @__PURE__ */ e.jsx(X, { withBorder: !0, my: 20, p: 20, children: /* @__PURE__ */ e.jsxs(T, { columns: 20, children: [
717
+ /* @__PURE__ */ e.jsxs(T.Col, { span: 9, children: [
718
+ /* @__PURE__ */ e.jsxs($, { mb: 20, children: [
719
+ /* @__PURE__ */ e.jsx(H, { children: t().t("archbase:Available") }),
710
720
  /* @__PURE__ */ e.jsx(
711
- Ye,
721
+ Xe,
712
722
  {
713
723
  size: "xs",
714
- value: W,
715
- onChange: (n) => re(n.target.value),
724
+ value: J,
725
+ onChange: (n) => te(n.target.value),
716
726
  placeholder: t().t("archbase:Filter available permissions")
717
727
  }
718
728
  )
719
729
  ] }),
720
730
  /* @__PURE__ */ e.jsx(
721
- Xe,
731
+ Ke,
722
732
  {
723
733
  data: b,
724
734
  selectOnClick: !0,
725
735
  allowRangeSelection: !1,
726
- tree: c,
727
- renderNode: ({ level: n, node: i, expanded: G, hasChildren: y, selected: I, elementProps: A }) => {
728
- const w = i?.nodeProps?.granted, T = w ? "dimmed" : void 0, L = w ? "line-through" : void 0, Pe = fe((O) => {
729
- H(i), A.onClick(O);
730
- }, [i, A.onClick]);
736
+ tree: u,
737
+ renderNode: ({ level: n, node: i, expanded: P, hasChildren: S, selected: z, elementProps: k }) => {
738
+ const A = i?.nodeProps?.granted, R = A ? "dimmed" : void 0, G = A ? "line-through" : void 0, De = ge((W) => {
739
+ M(i), k.onClick(W);
740
+ }, [i, k.onClick]);
731
741
  return /* @__PURE__ */ e.jsxs(
732
- P,
742
+ $,
733
743
  {
734
- ml: y ? 0 : 5,
744
+ ml: S ? 0 : 5,
735
745
  gap: 5,
736
- ...A,
737
- bg: I && n === 2 ? g : "",
738
- onClick: Pe,
746
+ ...k,
747
+ bg: z && n === 2 ? w : "",
748
+ onClick: De,
739
749
  children: [
740
- y && /* @__PURE__ */ e.jsx(
750
+ S && /* @__PURE__ */ e.jsx(
741
751
  rr,
742
752
  {
743
753
  size: 18,
744
- style: { transform: G ? "rotate(0deg)" : "rotate(-90deg)" }
754
+ style: { transform: P ? "rotate(0deg)" : "rotate(-90deg)" }
745
755
  }
746
756
  ),
747
- !y && /* @__PURE__ */ e.jsx(
757
+ !S && /* @__PURE__ */ e.jsx(
748
758
  ar,
749
759
  {
750
760
  size: 12,
@@ -752,10 +762,10 @@ function Ve({ dataSource: r, opened: l, close: f }) {
752
762
  }
753
763
  ),
754
764
  /* @__PURE__ */ e.jsx(
755
- Z,
765
+ H,
756
766
  {
757
- c: T,
758
- td: L,
767
+ c: R,
768
+ td: G,
759
769
  children: sr(i.label)
760
770
  }
761
771
  )
@@ -766,61 +776,61 @@ function Ve({ dataSource: r, opened: l, close: f }) {
766
776
  }
767
777
  )
768
778
  ] }),
769
- /* @__PURE__ */ e.jsx(C.Col, { span: 2, children: /* @__PURE__ */ e.jsxs(ne, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", h: "100%", children: [
770
- /* @__PURE__ */ e.jsx(de, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(N, { onClick: ge, disabled: !h || h?.nodeProps?.granted || !h.nodeProps, children: /* @__PURE__ */ e.jsx(dr, {}) }) }),
771
- /* @__PURE__ */ e.jsx(de, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(N, { onClick: ze, disabled: !j || !j?.nodeProps?.permissionId || !j.nodeProps, children: /* @__PURE__ */ e.jsx(ur, {}) }) })
779
+ /* @__PURE__ */ e.jsx(T.Col, { span: 2, children: /* @__PURE__ */ e.jsxs(ne, { gap: 5, style: { minWidth: "10%" }, justify: "center", align: "center", h: "100%", children: [
780
+ /* @__PURE__ */ e.jsx(ie, { label: t().t("archbase:Add"), children: /* @__PURE__ */ e.jsx(B, { onClick: he, disabled: !p || p?.nodeProps?.granted || !p.nodeProps, children: /* @__PURE__ */ e.jsx(dr, {}) }) }),
781
+ /* @__PURE__ */ e.jsx(ie, { label: t().t("archbase:Remove"), children: /* @__PURE__ */ e.jsx(B, { onClick: ce, disabled: !f || !f?.nodeProps?.permissionId || !f.nodeProps, children: /* @__PURE__ */ e.jsx(ur, {}) }) })
772
782
  ] }) }),
773
- /* @__PURE__ */ e.jsxs(C.Col, { span: 9, children: [
774
- /* @__PURE__ */ e.jsxs(P, { mb: 20, children: [
775
- /* @__PURE__ */ e.jsx(Z, { children: t().t("archbase:Granted") }),
783
+ /* @__PURE__ */ e.jsxs(T.Col, { span: 9, children: [
784
+ /* @__PURE__ */ e.jsxs($, { mb: 20, children: [
785
+ /* @__PURE__ */ e.jsx(H, { children: t().t("archbase:Granted") }),
776
786
  /* @__PURE__ */ e.jsx(
777
- Ye,
787
+ Xe,
778
788
  {
779
789
  size: "xs",
780
- value: E,
781
- onChange: (n) => M(n.target.value),
790
+ value: D,
791
+ onChange: (n) => N(n.target.value),
782
792
  placeholder: t().t("archbase:Filter granted permissions")
783
793
  }
784
794
  )
785
795
  ] }),
786
796
  /* @__PURE__ */ e.jsx(
787
- Xe,
797
+ Ke,
788
798
  {
789
- data: q,
799
+ data: O,
790
800
  selectOnClick: !0,
791
801
  allowRangeSelection: !1,
792
- tree: u,
793
- renderNode: ({ level: n, node: i, expanded: G, hasChildren: y, selected: I, elementProps: A }) => {
794
- const w = fe((T) => {
795
- ee(i), A.onClick(T);
796
- }, [i, A.onClick]);
802
+ tree: C,
803
+ renderNode: ({ level: n, node: i, expanded: P, hasChildren: S, selected: z, elementProps: k }) => {
804
+ const A = ge((R) => {
805
+ ae(i), k.onClick(R);
806
+ }, [i, k.onClick]);
797
807
  return /* @__PURE__ */ e.jsxs(
798
- P,
808
+ $,
799
809
  {
800
- ml: y ? 0 : 5,
810
+ ml: S ? 0 : 5,
801
811
  gap: 5,
802
- ...A,
803
- bg: I && n === 2 ? g : "",
804
- onClick: w,
812
+ ...k,
813
+ bg: z && n === 2 ? w : "",
814
+ onClick: A,
805
815
  children: [
806
- y && /* @__PURE__ */ e.jsx(
816
+ S && /* @__PURE__ */ e.jsx(
807
817
  rr,
808
818
  {
809
819
  size: 18,
810
- style: { transform: G ? "rotate(0deg)" : "rotate(-90deg)" }
820
+ style: { transform: P ? "rotate(0deg)" : "rotate(-90deg)" }
811
821
  }
812
822
  ),
813
- !y && /* @__PURE__ */ e.jsx(
823
+ !S && /* @__PURE__ */ e.jsx(
814
824
  ar,
815
825
  {
816
826
  size: 12,
817
827
  style: { transform: "rotate(-90deg)", marginTop: "-5px" }
818
828
  }
819
829
  ),
820
- /* @__PURE__ */ e.jsx(Z, { children: sr(i.label) }),
821
- i?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(we, { color: "blue", children: t().t("archbase:user") }),
822
- i?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(we, { color: "orange", children: t().t("archbase:group") }),
823
- i?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(we, { color: "pink", children: t().t("archbase:profile") })
830
+ /* @__PURE__ */ e.jsx(H, { children: sr(i.label) }),
831
+ i?.nodeProps?.types?.includes("USER") && /* @__PURE__ */ e.jsx(Ce, { color: "blue", children: t().t("archbase:user") }),
832
+ i?.nodeProps?.types?.includes("GROUP") && /* @__PURE__ */ e.jsx(Ce, { color: "orange", children: t().t("archbase:group") }),
833
+ i?.nodeProps?.types?.includes("PROFILE") && /* @__PURE__ */ e.jsx(Ce, { color: "pink", children: t().t("archbase:profile") })
824
834
  ]
825
835
  }
826
836
  );
@@ -829,111 +839,111 @@ function Ve({ dataSource: r, opened: l, close: f }) {
829
839
  )
830
840
  ] })
831
841
  ] }) }) }) }),
832
- /* @__PURE__ */ e.jsx(oa, { size: "40px", children: /* @__PURE__ */ e.jsx(P, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(V, { onClick: f, children: t().t("archbase:Close") }) }) })
842
+ /* @__PURE__ */ e.jsx(na, { size: "40px", children: /* @__PURE__ */ e.jsx($, { justify: "flex-end", children: /* @__PURE__ */ e.jsx(V, { onClick: g, children: t().t("archbase:Close") }) }) })
833
843
  ] }) }) : null;
834
844
  }
835
- const Ue = "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", ma = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups ? r.groups.map((l, f) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(we, { color: "blue", children: l.group?.name }) }, f)) : null }) : null, ba = (r) => r.profile ? /* @__PURE__ */ e.jsx(we, { color: "green", children: r.profile?.name }) : null;
836
- function ka({
845
+ const Ue = "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", ba = (r) => r.groups ? /* @__PURE__ */ e.jsx("div", { style: { display: "flex" }, children: r.groups ? r.groups.map((c, g) => /* @__PURE__ */ e.jsx("div", { style: { paddingRight: "2px" }, children: /* @__PURE__ */ e.jsx(Ce, { color: "blue", children: c.group?.name }) }, g)) : null }) : null, ja = (r) => r.profile ? /* @__PURE__ */ e.jsx(Ce, { color: "green", children: r.profile?.name }) : null;
846
+ function Fa({
837
847
  height: r = "400px",
838
- width: l = "100%",
839
- createEntitiesWithId: f = !0,
840
- userModalOptions: S,
848
+ width: c = "100%",
849
+ createEntitiesWithId: g = !0,
850
+ userModalOptions: v,
841
851
  profileModalOptions: s,
842
- groupModalOptions: p
852
+ groupModalOptions: x
843
853
  }) {
844
- const c = ir(), u = cr("securityStore"), z = Or(), { colorScheme: R } = Me(), [v, d] = U(void 0), [h, H] = U("users"), j = K(X.User), ee = K(X.Group), W = K(X.Resource), re = K(X.Profile), [Q, E] = U(""), [M, F] = U(""), B = K(X.AccessToken), { t: o } = Br(), g = ie(
854
+ const u = lr(), C = cr("securityStore"), E = Br(), { colorScheme: h } = Me(), [y, l] = U(void 0), [p, M] = U("users"), f = ee(K.User), ae = ee(K.Group), J = ee(K.Resource), te = ee(K.Profile), [Q, D] = U(""), [N, I] = U(""), q = ee(K.AccessToken), { t: o } = Wr(), w = le(
845
855
  "ArchbaseSecurityView-Users",
846
856
  void 0,
847
857
  // Will be set when dsUsers is available
848
858
  void 0,
849
859
  void 0
850
- ), q = ie(
860
+ ), O = le(
851
861
  "ArchbaseSecurityView-Groups",
852
862
  void 0,
853
863
  // Will be set when dsGroups is available
854
864
  void 0,
855
865
  void 0
856
- ), x = ie(
866
+ ), d = le(
857
867
  "ArchbaseSecurityView-Profiles",
858
868
  void 0,
859
869
  // Will be set when dsProfiles is available
860
870
  void 0,
861
871
  void 0
862
- ), b = je(null), D = je(null), ge = je(null), ze = je(null), n = je(null), i = (a) => a.id, G = (a) => a.id, y = (a) => a.id, I = (a) => a.id, A = (a) => a.id, { dataSource: w, isLoading: T } = se({
872
+ ), b = ye(null), m = ye(null), he = ye(null), ce = ye(null), n = ye(null), i = (a) => a.id, P = (a) => a.id, S = (a) => a.id, z = (a) => a.id, k = (a) => a.id, { dataSource: A, isLoading: R } = se({
863
873
  name: "accessTokenApi",
864
- service: B,
865
- store: u,
866
- validator: z,
874
+ service: q,
875
+ store: C,
876
+ validator: E,
867
877
  pageSize: 25,
868
878
  loadOnStart: !0,
869
- filter: Wr(_e.or(_e.eq("revoked", "false"))),
879
+ filter: ir(ze.or(ze.eq("revoked", "false"))),
870
880
  sort: ["user.email", "expirationTime:desc"],
871
881
  onLoadComplete: (a) => {
872
882
  },
873
883
  onDestroy: (a) => {
874
884
  },
875
- onError: (a, $) => {
876
- d(a), Y.showError(`${o("archbase:WARNING")}`, a, $);
885
+ onError: (a, L) => {
886
+ l(a), Y.showError(`${o("archbase:WARNING")}`, a, L);
877
887
  }
878
- }), { dataSource: L, isLoading: Pe } = se({
888
+ }), { dataSource: G, isLoading: De } = se({
879
889
  name: "dsUsers",
880
- service: j,
881
- store: u,
882
- validator: z,
890
+ service: f,
891
+ store: C,
892
+ validator: E,
883
893
  pageSize: 25,
884
894
  loadOnStart: !0,
885
895
  onLoadComplete: (a) => {
886
896
  },
887
897
  onDestroy: (a) => {
888
898
  },
889
- onError: (a, $) => {
890
- d(a), Y.showError(`${o("archbase:WARNING")}`, a, $);
899
+ onError: (a, L) => {
900
+ l(a), Y.showError(`${o("archbase:WARNING")}`, a, L);
891
901
  }
892
- }), { dataSource: O, isLoading: hr } = se({
902
+ }), { dataSource: W, isLoading: hr } = se({
893
903
  name: "dsGroups",
894
- service: ee,
895
- store: u,
896
- validator: z,
904
+ service: ae,
905
+ store: C,
906
+ validator: E,
897
907
  pageSize: 25,
898
908
  loadOnStart: !0,
899
909
  onLoadComplete: (a) => {
900
910
  },
901
911
  onDestroy: (a) => {
902
912
  },
903
- onError: (a, $) => {
904
- d(a), Y.showError(`${o("archbase:WARNING")}`, a, $);
913
+ onError: (a, L) => {
914
+ l(a), Y.showError(`${o("archbase:WARNING")}`, a, L);
905
915
  }
906
- }), { dataSource: J, isLoading: pr } = se({
916
+ }), { dataSource: Z, isLoading: pr } = se({
907
917
  name: "dsProfile",
908
- service: re,
909
- store: u,
910
- validator: z,
918
+ service: te,
919
+ store: C,
920
+ validator: E,
911
921
  pageSize: 25,
912
922
  loadOnStart: !0,
913
923
  onLoadComplete: (a) => {
914
924
  },
915
925
  onDestroy: (a) => {
916
926
  },
917
- onError: (a, $) => {
918
- d(a), Y.showError(`${o("archbase:WARNING")}`, a, $);
927
+ onError: (a, L) => {
928
+ l(a), Y.showError(`${o("archbase:WARNING")}`, a, L);
919
929
  }
920
930
  }), { dataSource: xr, isLoading: mr } = se({
921
931
  name: "dsResources",
922
- service: W,
923
- store: u,
924
- validator: z,
932
+ service: J,
933
+ store: C,
934
+ validator: E,
925
935
  pageSize: 25,
926
936
  loadOnStart: !0,
927
937
  onLoadComplete: (a) => {
928
938
  },
929
939
  onDestroy: (a) => {
930
940
  },
931
- onError: (a, $) => {
932
- d(a), Y.showError(`${o("archbase:WARNING")}`, a, $);
941
+ onError: (a, L) => {
942
+ l(a), Y.showError(`${o("archbase:WARNING")}`, a, L);
933
943
  }
934
- }), ye = `calc(${r} - 40px)`, br = /* @__PURE__ */ e.jsxs(me, { children: [
944
+ }), we = `calc(${r} - 40px)`, fr = /* @__PURE__ */ e.jsxs(be, { children: [
935
945
  /* @__PURE__ */ e.jsx(
936
- m,
946
+ j,
937
947
  {
938
948
  dataField: "user.avatar",
939
949
  dataType: "image",
@@ -951,7 +961,7 @@ function ka({
951
961
  }
952
962
  ),
953
963
  /* @__PURE__ */ e.jsx(
954
- m,
964
+ j,
955
965
  {
956
966
  dataField: "user.userName",
957
967
  dataType: "text",
@@ -961,7 +971,7 @@ function ka({
961
971
  }
962
972
  ),
963
973
  /* @__PURE__ */ e.jsx(
964
- m,
974
+ j,
965
975
  {
966
976
  dataField: "user.email",
967
977
  dataType: "text",
@@ -971,18 +981,18 @@ function ka({
971
981
  }
972
982
  ),
973
983
  /* @__PURE__ */ e.jsx(
974
- m,
984
+ j,
975
985
  {
976
986
  dataField: "expirationDate",
977
987
  dataType: "text",
978
988
  size: 300,
979
989
  header: `${o("archbase:Expira em")}`,
980
- render: (a) => /* @__PURE__ */ e.jsx(Z, { size: "sm", children: a.row.expirationDate }),
990
+ render: (a) => /* @__PURE__ */ e.jsx(H, { size: "sm", children: a.row.expirationDate }),
981
991
  inputFilterType: "text"
982
992
  }
983
993
  ),
984
994
  /* @__PURE__ */ e.jsx(
985
- m,
995
+ j,
986
996
  {
987
997
  dataField: "revoked",
988
998
  dataType: "boolean",
@@ -991,7 +1001,7 @@ function ka({
991
1001
  }
992
1002
  ),
993
1003
  /* @__PURE__ */ e.jsx(
994
- m,
1004
+ j,
995
1005
  {
996
1006
  dataField: "expired",
997
1007
  dataType: "boolean",
@@ -1000,7 +1010,7 @@ function ka({
1000
1010
  }
1001
1011
  ),
1002
1012
  /* @__PURE__ */ e.jsx(
1003
- m,
1013
+ j,
1004
1014
  {
1005
1015
  dataField: "token",
1006
1016
  dataType: "text",
@@ -1009,9 +1019,9 @@ function ka({
1009
1019
  inputFilterType: "text"
1010
1020
  }
1011
1021
  )
1012
- ] }), fr = /* @__PURE__ */ e.jsxs(me, { children: [
1022
+ ] }), br = /* @__PURE__ */ e.jsxs(be, { children: [
1013
1023
  /* @__PURE__ */ e.jsx(
1014
- m,
1024
+ j,
1015
1025
  {
1016
1026
  dataField: "avatar",
1017
1027
  dataType: "image",
@@ -1031,7 +1041,7 @@ function ka({
1031
1041
  }
1032
1042
  ),
1033
1043
  /* @__PURE__ */ e.jsx(
1034
- m,
1044
+ j,
1035
1045
  {
1036
1046
  dataField: "name",
1037
1047
  dataType: "text",
@@ -1041,7 +1051,7 @@ function ka({
1041
1051
  }
1042
1052
  ),
1043
1053
  /* @__PURE__ */ e.jsx(
1044
- m,
1054
+ j,
1045
1055
  {
1046
1056
  dataField: "nickname",
1047
1057
  dataType: "text",
@@ -1051,7 +1061,7 @@ function ka({
1051
1061
  }
1052
1062
  ),
1053
1063
  /* @__PURE__ */ e.jsx(
1054
- m,
1064
+ j,
1055
1065
  {
1056
1066
  dataField: "email",
1057
1067
  dataType: "text",
@@ -1061,31 +1071,31 @@ function ka({
1061
1071
  }
1062
1072
  ),
1063
1073
  /* @__PURE__ */ e.jsx(
1064
- m,
1074
+ j,
1065
1075
  {
1066
1076
  dataField: "profile.name",
1067
1077
  dataType: "text",
1068
1078
  header: `${o("archbase:Perfil")}`,
1069
1079
  size: 200,
1070
- render: (a) => ba(a.row),
1080
+ render: (a) => ja(a.row),
1071
1081
  inputFilterType: "text"
1072
1082
  }
1073
1083
  ),
1074
1084
  /* @__PURE__ */ e.jsx(
1075
- m,
1085
+ j,
1076
1086
  {
1077
1087
  dataField: "groups",
1078
1088
  dataType: "text",
1079
1089
  size: 300,
1080
1090
  header: `${o("archbase:Grupos")}`,
1081
- render: (a) => ma(a.row),
1091
+ render: (a) => ba(a.row),
1082
1092
  enableSorting: !1,
1083
1093
  enableColumnFilter: !1,
1084
1094
  enableGlobalFilter: !1
1085
1095
  }
1086
1096
  ),
1087
1097
  /* @__PURE__ */ e.jsx(
1088
- m,
1098
+ j,
1089
1099
  {
1090
1100
  dataField: "isAdministrator",
1091
1101
  dataType: "boolean",
@@ -1094,7 +1104,7 @@ function ka({
1094
1104
  }
1095
1105
  ),
1096
1106
  /* @__PURE__ */ e.jsx(
1097
- m,
1107
+ j,
1098
1108
  {
1099
1109
  dataField: "changePasswordOnNextLogin",
1100
1110
  dataType: "boolean",
@@ -1104,7 +1114,7 @@ function ka({
1104
1114
  }
1105
1115
  ),
1106
1116
  /* @__PURE__ */ e.jsx(
1107
- m,
1117
+ j,
1108
1118
  {
1109
1119
  dataField: "allowPasswordChange",
1110
1120
  dataType: "boolean",
@@ -1114,7 +1124,7 @@ function ka({
1114
1124
  }
1115
1125
  ),
1116
1126
  /* @__PURE__ */ e.jsx(
1117
- m,
1127
+ j,
1118
1128
  {
1119
1129
  dataField: "allowMultipleLogins",
1120
1130
  dataType: "boolean",
@@ -1124,7 +1134,7 @@ function ka({
1124
1134
  }
1125
1135
  ),
1126
1136
  /* @__PURE__ */ e.jsx(
1127
- m,
1137
+ j,
1128
1138
  {
1129
1139
  dataField: "passwordNeverExpires",
1130
1140
  dataType: "boolean",
@@ -1134,7 +1144,7 @@ function ka({
1134
1144
  }
1135
1145
  ),
1136
1146
  /* @__PURE__ */ e.jsx(
1137
- m,
1147
+ j,
1138
1148
  {
1139
1149
  dataField: "accountDeactivated",
1140
1150
  dataType: "boolean",
@@ -1144,7 +1154,7 @@ function ka({
1144
1154
  }
1145
1155
  ),
1146
1156
  /* @__PURE__ */ e.jsx(
1147
- m,
1157
+ j,
1148
1158
  {
1149
1159
  dataField: "accountLocked",
1150
1160
  dataType: "boolean",
@@ -1154,7 +1164,7 @@ function ka({
1154
1164
  }
1155
1165
  ),
1156
1166
  /* @__PURE__ */ e.jsx(
1157
- m,
1167
+ j,
1158
1168
  {
1159
1169
  dataField: "unlimitedAccessHours",
1160
1170
  dataType: "boolean",
@@ -1163,9 +1173,9 @@ function ka({
1163
1173
  size: 140
1164
1174
  }
1165
1175
  )
1166
- ] }), jr = /* @__PURE__ */ e.jsxs(me, { children: [
1176
+ ] }), jr = /* @__PURE__ */ e.jsxs(be, { children: [
1167
1177
  /* @__PURE__ */ e.jsx(
1168
- m,
1178
+ j,
1169
1179
  {
1170
1180
  dataField: "name",
1171
1181
  dataType: "text",
@@ -1175,7 +1185,7 @@ function ka({
1175
1185
  }
1176
1186
  ),
1177
1187
  /* @__PURE__ */ e.jsx(
1178
- m,
1188
+ j,
1179
1189
  {
1180
1190
  dataField: "description",
1181
1191
  dataType: "text",
@@ -1184,9 +1194,9 @@ function ka({
1184
1194
  inputFilterType: "text"
1185
1195
  }
1186
1196
  )
1187
- ] }), gr = /* @__PURE__ */ e.jsxs(me, { children: [
1197
+ ] }), gr = /* @__PURE__ */ e.jsxs(be, { children: [
1188
1198
  /* @__PURE__ */ e.jsx(
1189
- m,
1199
+ j,
1190
1200
  {
1191
1201
  dataField: "name",
1192
1202
  dataType: "text",
@@ -1196,7 +1206,7 @@ function ka({
1196
1206
  }
1197
1207
  ),
1198
1208
  /* @__PURE__ */ e.jsx(
1199
- m,
1209
+ j,
1200
1210
  {
1201
1211
  dataField: "description",
1202
1212
  dataType: "text",
@@ -1205,9 +1215,9 @@ function ka({
1205
1215
  inputFilterType: "text"
1206
1216
  }
1207
1217
  )
1208
- ] }), yr = /* @__PURE__ */ e.jsxs(me, { children: [
1218
+ ] }), yr = /* @__PURE__ */ e.jsxs(be, { children: [
1209
1219
  /* @__PURE__ */ e.jsx(
1210
- m,
1220
+ j,
1211
1221
  {
1212
1222
  dataField: "name",
1213
1223
  dataType: "text",
@@ -1217,7 +1227,7 @@ function ka({
1217
1227
  }
1218
1228
  ),
1219
1229
  /* @__PURE__ */ e.jsx(
1220
- m,
1230
+ j,
1221
1231
  {
1222
1232
  dataField: "description",
1223
1233
  dataType: "text",
@@ -1226,93 +1236,93 @@ function ka({
1226
1236
  inputFilterType: "text"
1227
1237
  }
1228
1238
  )
1229
- ] }), Sr = () => {
1230
- const a = Xr.newInstance();
1231
- f || (a.id = void 0), L.insert(a), L && !g.isDataSourceV2 && g.v1State.forceUpdate(), E(k.USER);
1239
+ ] }), wr = () => {
1240
+ const a = _r.newInstance();
1241
+ g || (a.id = void 0), G.insert(a), G && !w.isDataSourceV2 && w.v1State.forceUpdate(), D(F.USER);
1242
+ }, Sr = (a) => {
1243
+ G.isEmpty() || G.gotoRecordByData(a) && (G.edit(), w.isDataSourceV2 || w.v1State.forceUpdate(), D(F.USER));
1232
1244
  }, vr = (a) => {
1233
- L.isEmpty() || L.gotoRecordByData(a) && (L.edit(), g.isDataSourceV2 || g.v1State.forceUpdate(), E(k.USER));
1234
- }, wr = (a) => {
1235
- L.isEmpty() || L.gotoRecordByData(a) && te.showConfirmDialogYesNo(
1245
+ G.isEmpty() || G.gotoRecordByData(a) && _.showConfirmDialogYesNo(
1236
1246
  `${o("archbase:Confirme")}`,
1237
1247
  `${o("archbase:Deseja remover o usuário ")}${a.name} ?`,
1238
1248
  () => {
1239
- L.remove(), g.isDataSourceV2 || g.v1State.forceUpdate();
1249
+ G.remove(), w.isDataSourceV2 || w.v1State.forceUpdate();
1240
1250
  },
1241
1251
  () => {
1242
1252
  }
1243
1253
  );
1244
1254
  }, Cr = (a) => {
1245
- L.isEmpty() || L.gotoRecordByData(a) && E(k.USER);
1246
- }, Ar = (a) => /* @__PURE__ */ e.jsxs(P, { gap: 1, wrap: "nowrap", children: [
1247
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx(Ge, { size: 20, color: R === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1248
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(xe, { size: 20, color: R === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1249
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => wr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: R === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1250
- /* @__PURE__ */ e.jsx(de, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: qe, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: R === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) })
1255
+ G.isEmpty() || G.gotoRecordByData(a) && D(F.USER);
1256
+ }, Ar = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
1257
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Cr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
1258
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Sr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: h === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
1259
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => vr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: h === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
1260
+ /* @__PURE__ */ e.jsx(ie, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: qe, children: /* @__PURE__ */ e.jsx(Ge, { size: 20, color: h === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) })
1251
1261
  ] }), Tr = () => {
1252
- const a = Kr.newInstance();
1253
- f || (a.id = void 0), O.insert(a), O && !q.isDataSourceV2 && q.v1State.forceUpdate(), E(k.GROUP);
1262
+ const a = ea.newInstance();
1263
+ g || (a.id = void 0), W.insert(a), W && !O.isDataSourceV2 && O.v1State.forceUpdate(), D(F.GROUP);
1254
1264
  }, kr = (a) => {
1255
- O.isEmpty() || O.gotoRecordByData(a) && (O.edit(), E(k.GROUP));
1265
+ W.isEmpty() || W.gotoRecordByData(a) && (W.edit(), D(F.GROUP));
1256
1266
  }, Rr = (a) => {
1257
- O.isEmpty() || O.gotoRecordByData(a) && te.showConfirmDialogYesNo(
1267
+ W.isEmpty() || W.gotoRecordByData(a) && _.showConfirmDialogYesNo(
1258
1268
  `${o("archbase:Confirme")}`,
1259
1269
  `${o("archbase:Deseja remover o grupo ")}${a.name} ?`,
1260
1270
  () => {
1261
- O.remove();
1271
+ W.remove();
1262
1272
  },
1263
1273
  () => {
1264
1274
  }
1265
1275
  );
1266
1276
  }, Fr = (a) => {
1267
- O.isEmpty() || O.gotoRecordByData(a) && E(k.GROUP);
1268
- }, Ir = (a) => /* @__PURE__ */ e.jsxs(P, { gap: 1, wrap: "nowrap", children: [
1269
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx(Ge, { size: 20, color: R === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1270
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(xe, { size: 20, color: R === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1271
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: R === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1272
- /* @__PURE__ */ e.jsx(de, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: Je, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: R === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) })
1277
+ W.isEmpty() || W.gotoRecordByData(a) && D(F.GROUP);
1278
+ }, Ir = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
1279
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Fr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
1280
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => kr(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: h === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
1281
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Rr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: h === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
1282
+ /* @__PURE__ */ e.jsx(ie, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: He, children: /* @__PURE__ */ e.jsx(Ge, { size: 20, color: h === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) })
1273
1283
  ] }), Oe = () => {
1274
- E("");
1284
+ D("");
1275
1285
  }, Be = () => {
1276
- E("");
1286
+ D("");
1277
1287
  }, We = () => {
1278
- E("");
1279
- }, Er = () => {
1280
- const a = _r.newInstance();
1281
- f || (a.id = void 0), J.insert(a), J && !x.isDataSourceV2 && x.v1State.forceUpdate(), E(k.PROFILE);
1282
- }, zr = (a) => {
1283
- J.isEmpty() || J.gotoRecordByData(a) && (J.edit(), E(k.PROFILE));
1284
- }, Pr = (a) => {
1285
- J.isEmpty() || J.gotoRecordByData(a) && te.showConfirmDialogYesNo(
1288
+ D("");
1289
+ }, zr = () => {
1290
+ const a = ra.newInstance();
1291
+ g || (a.id = void 0), Z.insert(a), Z && !d.isDataSourceV2 && d.v1State.forceUpdate(), D(F.PROFILE);
1292
+ }, Er = (a) => {
1293
+ Z.isEmpty() || Z.gotoRecordByData(a) && (Z.edit(), D(F.PROFILE));
1294
+ }, Dr = (a) => {
1295
+ Z.isEmpty() || Z.gotoRecordByData(a) && _.showConfirmDialogYesNo(
1286
1296
  `${o("archbase:Confirme")}`,
1287
1297
  `${o("archbase:Deseja remover o perfil ")}${a.name} ?`,
1288
1298
  () => {
1289
- J.remove();
1299
+ Z.remove();
1290
1300
  },
1291
1301
  () => {
1292
1302
  }
1293
1303
  );
1294
- }, Dr = (a) => {
1295
- J.isEmpty() || J.gotoRecordByData(a) && E(k.PROFILE);
1296
- }, Gr = (a) => /* @__PURE__ */ e.jsxs(P, { gap: 1, wrap: "nowrap", children: [
1297
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => Dr(a), children: /* @__PURE__ */ e.jsx(Ge, { size: 20, color: R === "dark" ? c.colors.blue[8] : c.colors.blue[4] }) }),
1298
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => zr(a), children: /* @__PURE__ */ e.jsx(xe, { size: 20, color: R === "dark" ? c.colors.yellow[8] : c.colors.yellow[4] }) }),
1299
- /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: () => Pr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: R === "dark" ? c.colors.red[8] : c.colors.red[4] }) }),
1300
- /* @__PURE__ */ e.jsx(de, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(N, { variant: "transparent", onClick: Ze, children: /* @__PURE__ */ e.jsx(Le, { size: 20, color: R === "dark" ? c.colors.green[8] : c.colors.green[4] }) }) })
1301
- ] }), Lr = () => {
1302
- w.getCurrentRecord() && te.showConfirmDialogYesNo(
1304
+ }, Pr = (a) => {
1305
+ Z.isEmpty() || Z.gotoRecordByData(a) && D(F.PROFILE);
1306
+ }, $r = (a) => /* @__PURE__ */ e.jsxs($, { gap: 1, wrap: "nowrap", children: [
1307
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Pr(a), children: /* @__PURE__ */ e.jsx($e, { size: 20, color: h === "dark" ? u.colors.blue[8] : u.colors.blue[4] }) }),
1308
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Er(a), children: /* @__PURE__ */ e.jsx(fe, { size: 20, color: h === "dark" ? u.colors.yellow[8] : u.colors.yellow[4] }) }),
1309
+ /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: () => Dr(a), children: /* @__PURE__ */ e.jsx(ve, { size: 20, color: h === "dark" ? u.colors.red[8] : u.colors.red[4] }) }),
1310
+ /* @__PURE__ */ e.jsx(ie, { withinPortal: !0, withArrow: !0, position: "left", label: `${o("archbase:Edit permissions")}`, children: /* @__PURE__ */ e.jsx(B, { variant: "transparent", onClick: Je, children: /* @__PURE__ */ e.jsx(Ge, { size: 20, color: h === "dark" ? u.colors.green[8] : u.colors.green[4] }) }) })
1311
+ ] }), Gr = () => {
1312
+ A.getCurrentRecord() && _.showConfirmDialogYesNo(
1303
1313
  `${o("archbase:Confirme")}`,
1304
- `${o("archbase:Deseja revogar o token de Acesso do usuário ")}${w.getCurrentRecord().user.name} ?`,
1314
+ `${o("archbase:Deseja revogar o token de Acesso do usuário ")}${A.getCurrentRecord().user.name} ?`,
1305
1315
  async () => {
1306
- await B.revoke(w.getCurrentRecord().token).then(async () => {
1316
+ await q.revoke(A.getCurrentRecord().token).then(async () => {
1307
1317
  Y.showSuccess(
1308
1318
  `${o("mentors:Informação")}`,
1309
1319
  `${o("mentors:Token de Acesso revogado com sucesso!")}`
1310
- ), w.refreshData();
1320
+ ), A.refreshData();
1311
1321
  }).catch((a) => {
1312
- te.showErrorWithDetails(
1322
+ _.showErrorWithDetails(
1313
1323
  `${o("mentors:Atenção")}`,
1314
- ke(a),
1315
- Re(a)
1324
+ Ae(a),
1325
+ Fe(a)
1316
1326
  );
1317
1327
  });
1318
1328
  },
@@ -1320,109 +1330,119 @@ function ka({
1320
1330
  }
1321
1331
  );
1322
1332
  }, qe = () => {
1323
- F(k.USER);
1333
+ I(F.USER);
1334
+ }, He = () => {
1335
+ I(F.GROUP);
1324
1336
  }, Je = () => {
1325
- F(k.GROUP);
1326
- }, Ze = () => {
1327
- F(k.PROFILE);
1328
- }, De = () => {
1329
- F("");
1330
- }, $r = () => /* @__PURE__ */ e.jsxs(ae, { justify: "space-between", style: { width: "50%" }, children: [
1331
- /* @__PURE__ */ e.jsxs(P, { align: "end", gap: "4px", wrap: "nowrap", children: [
1332
- /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Fe, {}), onClick: Sr, children: `${o("archbase:New")}` }),
1333
- /* @__PURE__ */ e.jsx(V, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(xe, {}), onClick: qe, children: `${o("archbase:Edit permissions")}` })
1337
+ I(F.PROFILE);
1338
+ }, Pe = () => {
1339
+ I("");
1340
+ }, Lr = () => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", style: { width: "50%" }, children: [
1341
+ /* @__PURE__ */ e.jsxs($, { align: "end", gap: "4px", wrap: "nowrap", children: [
1342
+ /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: wr, children: `${o("archbase:New")}` }),
1343
+ /* @__PURE__ */ e.jsx(V, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(fe, {}), onClick: qe, children: `${o("archbase:Edit permissions")}` })
1334
1344
  ] }),
1335
- /* @__PURE__ */ e.jsx(ae, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1336
- ] }), Vr = () => /* @__PURE__ */ e.jsxs(ae, { justify: "space-between", style: { width: "50%" }, children: [
1337
- /* @__PURE__ */ e.jsxs(P, { align: "end", gap: "4px", wrap: "nowrap", children: [
1338
- /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Fe, {}), onClick: Tr, children: `${o("archbase:New")}` }),
1339
- /* @__PURE__ */ e.jsx(V, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(xe, {}), onClick: Je, children: `${o("archbase:Edit permissions")}` })
1345
+ /* @__PURE__ */ e.jsx(oe, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1346
+ ] }), Vr = () => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", style: { width: "50%" }, children: [
1347
+ /* @__PURE__ */ e.jsxs($, { align: "end", gap: "4px", wrap: "nowrap", children: [
1348
+ /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: Tr, children: `${o("archbase:New")}` }),
1349
+ /* @__PURE__ */ e.jsx(V, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(fe, {}), onClick: He, children: `${o("archbase:Edit permissions")}` })
1340
1350
  ] }),
1341
- /* @__PURE__ */ e.jsx(ae, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1342
- ] }), Ur = () => /* @__PURE__ */ e.jsxs(ae, { justify: "space-between", style: { width: "50%" }, children: [
1343
- /* @__PURE__ */ e.jsxs(P, { align: "end", gap: "4px", wrap: "nowrap", children: [
1344
- /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Fe, {}), onClick: Er, children: `${o("archbase:New")}` }),
1345
- /* @__PURE__ */ e.jsx(V, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(xe, {}), onClick: Ze, children: `${o("archbase:Edit permissions")}` })
1351
+ /* @__PURE__ */ e.jsx(oe, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1352
+ ] }), Ur = () => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", style: { width: "50%" }, children: [
1353
+ /* @__PURE__ */ e.jsxs($, { align: "end", gap: "4px", wrap: "nowrap", children: [
1354
+ /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: zr, children: `${o("archbase:New")}` }),
1355
+ /* @__PURE__ */ e.jsx(V, { color: "blue", leftSection: /* @__PURE__ */ e.jsx(fe, {}), onClick: Je, children: `${o("archbase:Edit permissions")}` })
1346
1356
  ] }),
1347
- /* @__PURE__ */ e.jsx(ae, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1348
- ] }), Mr = () => /* @__PURE__ */ e.jsx(ae, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsx(P, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e.jsx(
1357
+ /* @__PURE__ */ e.jsx(oe, { align: "flex-start", justify: "flex-end", style: { width: "200px" } })
1358
+ ] }), Mr = () => /* @__PURE__ */ e.jsx(oe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsx($, { align: "start", gap: "4px", wrap: "nowrap", children: /* @__PURE__ */ e.jsx(
1349
1359
  V,
1350
1360
  {
1351
- disabled: !w.getCurrentRecord(),
1361
+ disabled: !A.getCurrentRecord(),
1352
1362
  color: "red",
1353
1363
  leftSection: /* @__PURE__ */ e.jsx(ve, {}),
1354
- onClick: Lr,
1364
+ onClick: Gr,
1355
1365
  children: `${o("archbase:Revoke")}`
1356
1366
  }
1357
1367
  ) }) });
1358
- return /* @__PURE__ */ e.jsxs(Ie, { style: { height: r }, children: [
1359
- /* @__PURE__ */ e.jsx(le, { variant: "pills", value: h, onChange: H, children: /* @__PURE__ */ e.jsxs(le.List, { children: [
1360
- /* @__PURE__ */ e.jsx(le.Tab, { value: "users", children: `${o("Usuários")}` }),
1361
- /* @__PURE__ */ e.jsx(le.Tab, { value: "groups", children: `${o("Grupos")}` }),
1362
- /* @__PURE__ */ e.jsx(le.Tab, { value: "profiles", children: `${o("Perfis")}` }),
1363
- /* @__PURE__ */ e.jsx(le.Tab, { value: "resources", children: `${o("Recursos")}` }),
1364
- /* @__PURE__ */ e.jsx(le.Tab, { value: "accessTokens", children: `${o("Tokens Acesso")}` })
1368
+ return /* @__PURE__ */ e.jsxs(X, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1369
+ /* @__PURE__ */ e.jsx(de, { variant: "pills", value: p, onChange: M, children: /* @__PURE__ */ e.jsxs(de.List, { children: [
1370
+ /* @__PURE__ */ e.jsx(de.Tab, { value: "users", children: `${o("Usuários")}` }),
1371
+ /* @__PURE__ */ e.jsx(de.Tab, { value: "groups", children: `${o("Grupos")}` }),
1372
+ /* @__PURE__ */ e.jsx(de.Tab, { value: "profiles", children: `${o("Perfis")}` }),
1373
+ /* @__PURE__ */ e.jsx(de.Tab, { value: "resources", children: `${o("Recursos")}` }),
1374
+ /* @__PURE__ */ e.jsx(de.Tab, { value: "accessTokens", children: `${o("Tokens Acesso")}` })
1365
1375
  ] }) }),
1366
1376
  /* @__PURE__ */ e.jsx(
1367
- oe,
1377
+ X,
1368
1378
  {
1379
+ withBorder: !0,
1380
+ mt: "md",
1369
1381
  style: {
1370
- height: ye,
1371
- display: h === "users" ? "flex" : "none",
1372
- width: "100%"
1382
+ height: we,
1383
+ display: p === "users" ? "flex" : "none",
1384
+ width: "100%",
1385
+ flex: 1,
1386
+ minHeight: 0,
1387
+ overflow: "auto"
1373
1388
  },
1374
1389
  children: /* @__PURE__ */ e.jsx(
1375
- be,
1390
+ je,
1376
1391
  {
1377
1392
  gridRef: b,
1378
1393
  printTitle: "Usuários",
1379
1394
  width: "100%",
1380
1395
  height: "100%",
1381
1396
  withBorder: !1,
1382
- dataSource: L,
1397
+ dataSource: G,
1383
1398
  withColumnBorders: !0,
1384
1399
  striped: !0,
1385
1400
  enableTopToolbar: !0,
1386
1401
  enableRowActions: !0,
1387
1402
  pageSize: 50,
1388
- isLoading: Pe,
1389
- isError: !!v,
1390
- error: v,
1403
+ isLoading: De,
1404
+ isError: !!y,
1405
+ error: y,
1391
1406
  enableGlobalFilter: !0,
1392
1407
  getRowId: i,
1393
- toolbarLeftContent: $r(),
1408
+ toolbarLeftContent: Lr(),
1394
1409
  renderRowActions: Ar,
1395
- children: fr
1410
+ children: br
1396
1411
  }
1397
1412
  )
1398
1413
  }
1399
1414
  ),
1400
1415
  /* @__PURE__ */ e.jsx(
1401
- oe,
1416
+ X,
1402
1417
  {
1418
+ withBorder: !0,
1419
+ mt: "md",
1403
1420
  style: {
1404
- height: ye,
1405
- display: h === "groups" ? "flex" : "none"
1421
+ height: we,
1422
+ display: p === "groups" ? "flex" : "none",
1423
+ flex: 1,
1424
+ minHeight: 0,
1425
+ overflow: "auto"
1406
1426
  },
1407
1427
  children: /* @__PURE__ */ e.jsx(
1408
- be,
1428
+ je,
1409
1429
  {
1410
- gridRef: D,
1430
+ gridRef: m,
1411
1431
  printTitle: "Grupos",
1412
1432
  width: "100%",
1413
1433
  height: "100%",
1414
1434
  withBorder: !1,
1415
- dataSource: O,
1435
+ dataSource: W,
1416
1436
  withColumnBorders: !0,
1417
1437
  striped: !1,
1418
1438
  enableTopToolbar: !0,
1419
1439
  enableRowActions: !0,
1420
1440
  pageSize: 50,
1421
1441
  isLoading: hr,
1422
- isError: !!v,
1423
- error: v,
1442
+ isError: !!y,
1443
+ error: y,
1424
1444
  enableGlobalFilter: !0,
1425
- getRowId: G,
1445
+ getRowId: P,
1426
1446
  renderRowActions: Ir,
1427
1447
  children: jr,
1428
1448
  toolbarLeftContent: Vr()
@@ -1431,49 +1451,59 @@ function ka({
1431
1451
  }
1432
1452
  ),
1433
1453
  /* @__PURE__ */ e.jsx(
1434
- oe,
1454
+ X,
1435
1455
  {
1456
+ withBorder: !0,
1457
+ mt: "md",
1436
1458
  style: {
1437
- height: ye,
1438
- display: h === "profiles" ? "flex" : "none"
1459
+ height: we,
1460
+ display: p === "profiles" ? "flex" : "none",
1461
+ flex: 1,
1462
+ minHeight: 0,
1463
+ overflow: "auto"
1439
1464
  },
1440
1465
  children: /* @__PURE__ */ e.jsx(
1441
- be,
1466
+ je,
1442
1467
  {
1443
- gridRef: ge,
1468
+ gridRef: he,
1444
1469
  printTitle: "Perfis",
1445
1470
  width: "100%",
1446
1471
  height: "100%",
1447
1472
  withBorder: !1,
1448
- dataSource: J,
1473
+ dataSource: Z,
1449
1474
  withColumnBorders: !0,
1450
1475
  striped: !1,
1451
1476
  enableTopToolbar: !0,
1452
1477
  enableRowActions: !0,
1453
1478
  pageSize: 50,
1454
1479
  isLoading: pr,
1455
- isError: !!v,
1456
- error: v,
1480
+ isError: !!y,
1481
+ error: y,
1457
1482
  enableGlobalFilter: !0,
1458
- getRowId: y,
1483
+ getRowId: S,
1459
1484
  toolbarLeftContent: Ur(),
1460
- renderRowActions: Gr,
1485
+ renderRowActions: $r,
1461
1486
  children: gr
1462
1487
  }
1463
1488
  )
1464
1489
  }
1465
1490
  ),
1466
1491
  /* @__PURE__ */ e.jsx(
1467
- oe,
1492
+ X,
1468
1493
  {
1494
+ withBorder: !0,
1495
+ mt: "md",
1469
1496
  style: {
1470
- height: ye,
1471
- display: h === "resources" ? "flex" : "none"
1497
+ height: we,
1498
+ display: p === "resources" ? "flex" : "none",
1499
+ flex: 1,
1500
+ minHeight: 0,
1501
+ overflow: "auto"
1472
1502
  },
1473
1503
  children: /* @__PURE__ */ e.jsx(
1474
- be,
1504
+ je,
1475
1505
  {
1476
- gridRef: ze,
1506
+ gridRef: ce,
1477
1507
  printTitle: "Recursos",
1478
1508
  width: "100%",
1479
1509
  height: "100%",
@@ -1485,146 +1515,151 @@ function ka({
1485
1515
  enableRowActions: !1,
1486
1516
  pageSize: 50,
1487
1517
  isLoading: mr,
1488
- isError: !!v,
1489
- error: v,
1518
+ isError: !!y,
1519
+ error: y,
1490
1520
  enableGlobalFilter: !0,
1491
- getRowId: I,
1521
+ getRowId: z,
1492
1522
  children: yr
1493
1523
  }
1494
1524
  )
1495
1525
  }
1496
1526
  ),
1497
1527
  /* @__PURE__ */ e.jsx(
1498
- oe,
1528
+ X,
1499
1529
  {
1530
+ withBorder: !0,
1531
+ mt: "md",
1500
1532
  style: {
1501
- height: ye,
1502
- display: h === "accessTokens" ? "flex" : "none",
1503
- width: "100%"
1533
+ height: we,
1534
+ display: p === "accessTokens" ? "flex" : "none",
1535
+ width: "100%",
1536
+ flex: 1,
1537
+ minHeight: 0,
1538
+ overflow: "auto"
1504
1539
  },
1505
1540
  children: /* @__PURE__ */ e.jsx(
1506
- be,
1541
+ je,
1507
1542
  {
1508
1543
  gridRef: n,
1509
1544
  printTitle: "Tokens de API",
1510
1545
  width: "100%",
1511
1546
  height: "100%",
1512
1547
  withBorder: !1,
1513
- dataSource: w,
1548
+ dataSource: A,
1514
1549
  withColumnBorders: !0,
1515
1550
  striped: !0,
1516
1551
  enableTopToolbar: !0,
1517
1552
  enableRowActions: !1,
1518
1553
  pageSize: 50,
1519
- isLoading: T,
1520
- isError: !!v,
1521
- error: v,
1554
+ isLoading: R,
1555
+ isError: !!y,
1556
+ error: y,
1522
1557
  enableGlobalFilter: !0,
1523
- getRowId: A,
1558
+ getRowId: k,
1524
1559
  toolbarLeftContent: Mr(),
1525
- children: br
1560
+ children: fr
1526
1561
  }
1527
1562
  )
1528
1563
  }
1529
1564
  ),
1530
- Q === k.USER ? /* @__PURE__ */ e.jsx(
1531
- ua,
1565
+ Q === F.USER ? /* @__PURE__ */ e.jsx(
1566
+ pa,
1532
1567
  {
1533
1568
  onClickOk: Oe,
1534
1569
  opened: !0,
1535
- dataSource: L,
1570
+ dataSource: G,
1536
1571
  onClickCancel: Oe,
1537
- options: S
1572
+ options: v
1538
1573
  }
1539
1574
  ) : null,
1540
- Q === k.GROUP ? /* @__PURE__ */ e.jsx(
1541
- ha,
1575
+ Q === F.GROUP ? /* @__PURE__ */ e.jsx(
1576
+ xa,
1542
1577
  {
1543
1578
  onClickOk: Be,
1544
1579
  opened: !0,
1545
- dataSource: O,
1580
+ dataSource: W,
1546
1581
  onClickCancel: Be,
1547
- options: p
1582
+ options: x
1548
1583
  }
1549
1584
  ) : null,
1550
- Q === k.PROFILE ? /* @__PURE__ */ e.jsx(
1551
- ia,
1585
+ Q === F.PROFILE ? /* @__PURE__ */ e.jsx(
1586
+ ca,
1552
1587
  {
1553
1588
  onClickOk: We,
1554
1589
  opened: !0,
1555
- dataSource: J,
1590
+ dataSource: Z,
1556
1591
  onClickCancel: We,
1557
1592
  options: s
1558
1593
  }
1559
1594
  ) : null,
1560
- M === k.USER ? /* @__PURE__ */ e.jsx(
1595
+ N === F.USER ? /* @__PURE__ */ e.jsx(
1561
1596
  Ve,
1562
1597
  {
1563
- dataSource: L,
1564
- opened: !!M,
1565
- close: De
1598
+ dataSource: G,
1599
+ opened: !!N,
1600
+ close: Pe
1566
1601
  }
1567
1602
  ) : null,
1568
- M === k.GROUP ? /* @__PURE__ */ e.jsx(
1603
+ N === F.GROUP ? /* @__PURE__ */ e.jsx(
1569
1604
  Ve,
1570
1605
  {
1571
- dataSource: O,
1572
- opened: !!M,
1573
- close: De
1606
+ dataSource: W,
1607
+ opened: !!N,
1608
+ close: Pe
1574
1609
  }
1575
1610
  ) : null,
1576
- M === k.PROFILE ? /* @__PURE__ */ e.jsx(
1611
+ N === F.PROFILE ? /* @__PURE__ */ e.jsx(
1577
1612
  Ve,
1578
1613
  {
1579
- dataSource: J,
1580
- opened: !!M,
1581
- close: De
1614
+ dataSource: Z,
1615
+ opened: !!N,
1616
+ close: Pe
1582
1617
  }
1583
1618
  ) : null
1584
1619
  ] });
1585
1620
  }
1586
- function Ra({ height: r = "400px", width: l = "100%" }) {
1587
- ir();
1588
- const f = cr("apiTokenStore"), S = { validateEntity: () => [] }, { colorScheme: s } = Me(), [p, c] = U(void 0), u = K(X.ApiToken), [z, R] = U(""), v = je(null), d = (g) => g.id, { dataSource: h } = Hr({
1621
+ function Ia({ height: r = "400px", width: c = "100%" }) {
1622
+ lr();
1623
+ const g = cr("apiTokenStore"), v = { validateEntity: () => [] }, { colorScheme: s } = Me(), [x, u] = U(void 0), C = ee(K.ApiToken), [E, h] = U(""), y = ye(null), l = (w) => w.id, { dataSource: p } = Yr({
1589
1624
  initialData: [],
1590
1625
  name: "dataSource"
1591
- }), H = ie(
1626
+ }), M = le(
1592
1627
  "ArchbaseApiTokenView-LocalDataSource",
1593
- h,
1628
+ p,
1594
1629
  void 0,
1595
1630
  void 0
1596
- ), { dataSource: j, isLoading: ee } = se({
1631
+ ), { dataSource: f, isLoading: ae } = se({
1597
1632
  name: "dsApiToken",
1598
- service: u,
1599
- store: f,
1600
- validator: S,
1633
+ service: C,
1634
+ store: g,
1635
+ validator: v,
1601
1636
  pageSize: 25,
1602
1637
  loadOnStart: !0,
1603
- onLoadComplete: (g) => {
1638
+ onLoadComplete: (w) => {
1604
1639
  },
1605
- onDestroy: (g) => {
1640
+ onDestroy: (w) => {
1606
1641
  },
1607
- onError: (g, q) => {
1608
- c(g), Y.showError(t().t("archbase:WARNING"), g, q);
1642
+ onError: (w, O) => {
1643
+ u(w), Y.showError(t().t("archbase:WARNING"), w, O);
1609
1644
  }
1610
- }), W = ie(
1645
+ }), J = le(
1611
1646
  "ArchbaseApiTokenView-RemoteDataSource",
1612
- j,
1647
+ f,
1613
1648
  void 0,
1614
1649
  void 0
1615
- ), re = `calc(${r} - 40px)`, Q = /* @__PURE__ */ e.jsxs(me, { children: [
1650
+ ), te = `calc(${r} - 40px)`, Q = /* @__PURE__ */ e.jsxs(be, { children: [
1616
1651
  /* @__PURE__ */ e.jsx(
1617
- m,
1652
+ j,
1618
1653
  {
1619
1654
  dataField: "user.avatar",
1620
1655
  dataType: "image",
1621
1656
  size: 80,
1622
1657
  header: "Foto",
1623
- render: (g) => /* @__PURE__ */ e.jsx(
1658
+ render: (w) => /* @__PURE__ */ e.jsx(
1624
1659
  "img",
1625
1660
  {
1626
1661
  style: { borderRadius: 50, height: "32px", maxHeight: "32px" },
1627
- src: g.row.user && g.row.user.avatar ? atob(g.row.user.avatar) : Ue
1662
+ src: w.row.user && w.row.user.avatar ? atob(w.row.user.avatar) : Ue
1628
1663
  }
1629
1664
  ),
1630
1665
  inputFilterType: "text",
@@ -1632,7 +1667,7 @@ function Ra({ height: r = "400px", width: l = "100%" }) {
1632
1667
  }
1633
1668
  ),
1634
1669
  /* @__PURE__ */ e.jsx(
1635
- m,
1670
+ j,
1636
1671
  {
1637
1672
  dataField: "user.userName",
1638
1673
  dataType: "text",
@@ -1642,7 +1677,7 @@ function Ra({ height: r = "400px", width: l = "100%" }) {
1642
1677
  }
1643
1678
  ),
1644
1679
  /* @__PURE__ */ e.jsx(
1645
- m,
1680
+ j,
1646
1681
  {
1647
1682
  dataField: "user.email",
1648
1683
  dataType: "text",
@@ -1652,7 +1687,7 @@ function Ra({ height: r = "400px", width: l = "100%" }) {
1652
1687
  }
1653
1688
  ),
1654
1689
  /* @__PURE__ */ e.jsx(
1655
- m,
1690
+ j,
1656
1691
  {
1657
1692
  dataField: "token",
1658
1693
  dataType: "text",
@@ -1663,7 +1698,7 @@ function Ra({ height: r = "400px", width: l = "100%" }) {
1663
1698
  }
1664
1699
  ),
1665
1700
  /* @__PURE__ */ e.jsx(
1666
- m,
1701
+ j,
1667
1702
  {
1668
1703
  dataField: "tenantId",
1669
1704
  dataType: "text",
@@ -1674,18 +1709,41 @@ function Ra({ height: r = "400px", width: l = "100%" }) {
1674
1709
  }
1675
1710
  ),
1676
1711
  /* @__PURE__ */ e.jsx(
1677
- m,
1712
+ j,
1678
1713
  {
1679
1714
  dataField: "expirationDate",
1680
1715
  dataType: "text",
1681
- size: 300,
1682
- header: "Expira em",
1683
- render: (g) => /* @__PURE__ */ e.jsx(Z, { children: g.row.expirationDate ? new Date(g.row.expirationDate).toLocaleDateString() : "-" }),
1716
+ size: 180,
1717
+ header: "Validade",
1718
+ render: (w) => {
1719
+ if (!w.row.expirationDate)
1720
+ return /* @__PURE__ */ e.jsx(H, { c: "dimmed", children: "Sem expiração" });
1721
+ const O = /* @__PURE__ */ new Date();
1722
+ O.setHours(0, 0, 0, 0);
1723
+ const d = new Date(w.row.expirationDate);
1724
+ d.setHours(0, 0, 0, 0);
1725
+ const b = d.getTime() - O.getTime(), m = Math.ceil(b / (1e3 * 60 * 60 * 24));
1726
+ let ce = Math.max(0, Math.min(100, m / 365 * 100)), n = "green", i = "";
1727
+ m < 0 ? (n = "red", ce = 100, i = `Vencido há ${Math.abs(m)} dia${Math.abs(m) !== 1 ? "s" : ""}`) : m === 0 ? (n = "red", ce = 5, i = "Vence hoje") : m <= 7 ? (n = "red", i = `${m} dia${m !== 1 ? "s" : ""}`) : m <= 30 ? (n = "orange", i = `${m} dias`) : m <= 90 ? (n = "yellow", i = `${m} dias`) : (n = "green", i = `${m} dias`);
1728
+ const P = m < 0 ? `Vencido em ${d.toLocaleDateString()}` : `Expira em ${d.toLocaleDateString()}`;
1729
+ return /* @__PURE__ */ e.jsx(ie, { label: P, withArrow: !0, children: /* @__PURE__ */ e.jsxs($, { gap: "xs", wrap: "nowrap", children: [
1730
+ /* @__PURE__ */ e.jsx(
1731
+ Nr,
1732
+ {
1733
+ size: 36,
1734
+ thickness: 4,
1735
+ roundCaps: !0,
1736
+ sections: [{ value: m < 0 ? 100 : ce, color: n }]
1737
+ }
1738
+ ),
1739
+ /* @__PURE__ */ e.jsx(H, { size: "sm", c: m < 0 ? "red" : void 0, fw: m <= 7 ? 600 : void 0, children: i })
1740
+ ] }) });
1741
+ },
1684
1742
  inputFilterType: "text"
1685
1743
  }
1686
1744
  ),
1687
1745
  /* @__PURE__ */ e.jsx(
1688
- m,
1746
+ j,
1689
1747
  {
1690
1748
  dataField: "activated",
1691
1749
  dataType: "boolean",
@@ -1694,7 +1752,7 @@ function Ra({ height: r = "400px", width: l = "100%" }) {
1694
1752
  }
1695
1753
  ),
1696
1754
  /* @__PURE__ */ e.jsx(
1697
- m,
1755
+ j,
1698
1756
  {
1699
1757
  dataField: "revoked",
1700
1758
  dataType: "boolean",
@@ -1702,113 +1760,125 @@ function Ra({ height: r = "400px", width: l = "100%" }) {
1702
1760
  inputFilterType: "checkbox"
1703
1761
  }
1704
1762
  )
1705
- ] }), E = () => {
1706
- h.insert(ea.newInstance()), h && !H.isDataSourceV2 && H.v1State.forceUpdate(), R("apiToken");
1707
- }, M = () => {
1708
- j.getCurrentRecord() && te.showConfirmDialogYesNo(
1763
+ ] }), D = () => {
1764
+ p.insert(aa.newInstance()), p && !M.isDataSourceV2 && M.v1State.forceUpdate(), h("apiToken");
1765
+ }, N = () => {
1766
+ f.getCurrentRecord() && _.showConfirmDialogYesNo(
1709
1767
  `${t().t("archbase:Confirme")}`,
1710
- `${t().t("archbase:Deseja revogar o token de API do usuário ")}${j.getCurrentRecord().user.name} ?`,
1768
+ `${t().t("archbase:Deseja revogar o token de API do usuário ")}${f.getCurrentRecord().user.name} ?`,
1711
1769
  async () => {
1712
- await u.revoke(j.getCurrentRecord().token).then(async () => {
1770
+ await C.revoke(f.getCurrentRecord().token).then(async () => {
1713
1771
  Y.showSuccess(
1714
1772
  `${t().t("mentors:Informação")}`,
1715
1773
  `${t().t("mentors:Token de API revogado com sucesso!")}`
1716
- ), j.refreshData(), j && !W.isDataSourceV2 && W.v1State.forceUpdate();
1717
- }).catch((g) => {
1718
- te.showErrorWithDetails(
1774
+ ), f.refreshData(), f && !J.isDataSourceV2 && J.v1State.forceUpdate();
1775
+ }).catch((w) => {
1776
+ _.showErrorWithDetails(
1719
1777
  `${t().t("mentors:Atenção")}`,
1720
- ke(g),
1721
- Re(g)
1778
+ Ae(w),
1779
+ Fe(w)
1722
1780
  );
1723
1781
  });
1724
1782
  },
1725
1783
  () => {
1726
1784
  }
1727
1785
  );
1728
- }, F = () => {
1729
- R("");
1730
- }, B = async (g, q) => {
1731
- const x = h.getCurrentRecord();
1732
- if (x)
1786
+ }, I = () => {
1787
+ h("");
1788
+ }, q = async (w, O) => {
1789
+ const d = p.getCurrentRecord();
1790
+ if (d)
1733
1791
  try {
1734
- h.validate(), await u.create(x.user.email, x.expirationDate, x.name, x.description).then(async (b) => {
1735
- h.cancel(), h && !H.isDataSourceV2 && H.v1State.forceUpdate(), j.append(b), j && !W.isDataSourceV2 && W.v1State.forceUpdate(), Y.showSuccess(
1792
+ if (p.validate(), !d.user || !d.user.email) {
1793
+ _.showErrorWithDetails(
1794
+ `${t().t("archbase:WARNING")}`,
1795
+ `${t().t("archbase:Selecione um usuário para o token de API")}`,
1796
+ ""
1797
+ );
1798
+ return;
1799
+ }
1800
+ await C.create(d.user.email, d.expirationDate, d.name, d.description).then(async (b) => {
1801
+ p.cancel(), p && !M.isDataSourceV2 && M.v1State.forceUpdate(), f.append(b), f && !J.isDataSourceV2 && J.v1State.forceUpdate(), Y.showSuccess(
1736
1802
  `${t().t("mentors:Informação")}`,
1737
1803
  `${t().t("mentors:Token de API gerado com sucesso!")}`
1738
- ), q && q();
1804
+ ), O && O(!0);
1739
1805
  }).catch((b) => {
1740
- te.showErrorWithDetails(
1806
+ _.showErrorWithDetails(
1741
1807
  `${t().t("mentors:Atenção")}`,
1742
- ke(b),
1743
- Re(b)
1808
+ Ae(b),
1809
+ Fe(b)
1744
1810
  );
1745
1811
  });
1746
1812
  } catch (b) {
1747
- te.showErrorWithDetails(
1813
+ _.showErrorWithDetails(
1748
1814
  `${t().t("mentors:Atenção")}`,
1749
- ke(b),
1750
- Re(b)
1815
+ Ae(b),
1816
+ Fe(b)
1751
1817
  );
1752
1818
  }
1753
- }, o = () => /* @__PURE__ */ e.jsx(ae, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsxs(P, { align: "start", gap: "2px", wrap: "nowrap", children: [
1754
- /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Fe, {}), onClick: E, children: t().t("archbase:New") }),
1755
- /* @__PURE__ */ e.jsx(V, { disabled: !j.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(ve, {}), onClick: M, children: t().t("archbase:Revoke") })
1819
+ }, o = () => /* @__PURE__ */ e.jsx(oe, { justify: "space-between", style: { width: "50%" }, children: /* @__PURE__ */ e.jsxs($, { align: "start", gap: "2px", wrap: "nowrap", children: [
1820
+ /* @__PURE__ */ e.jsx(V, { color: "green", leftSection: /* @__PURE__ */ e.jsx(Ie, {}), onClick: D, children: t().t("archbase:New") }),
1821
+ /* @__PURE__ */ e.jsx(V, { disabled: !f.getCurrentRecord(), color: "red", leftSection: /* @__PURE__ */ e.jsx(ve, {}), onClick: N, children: t().t("archbase:Revoke") })
1756
1822
  ] }) });
1757
- return /* @__PURE__ */ e.jsxs(Ie, { style: { height: r }, children: [
1823
+ return /* @__PURE__ */ e.jsxs(X, { p: "md", style: { height: r, display: "flex", flexDirection: "column" }, children: [
1758
1824
  /* @__PURE__ */ e.jsx(
1759
- oe,
1825
+ X,
1760
1826
  {
1827
+ withBorder: !0,
1761
1828
  style: {
1762
- height: re,
1829
+ height: te,
1763
1830
  display: "flex",
1764
- width: "100%"
1831
+ width: "100%",
1832
+ flex: 1,
1833
+ minHeight: 0,
1834
+ overflow: "auto"
1765
1835
  },
1766
1836
  children: /* @__PURE__ */ e.jsx(
1767
- be,
1837
+ je,
1768
1838
  {
1769
- gridRef: v,
1839
+ gridRef: y,
1770
1840
  printTitle: "Tokens de API",
1771
1841
  width: "100%",
1772
1842
  height: "100%",
1773
1843
  withBorder: !1,
1774
- dataSource: j,
1844
+ dataSource: f,
1775
1845
  withColumnBorders: !0,
1776
1846
  striped: !0,
1777
1847
  enableTopToolbar: !0,
1778
1848
  enableRowActions: !1,
1779
1849
  pageSize: 50,
1780
- isLoading: ee,
1781
- isError: !!p,
1782
- error: p,
1850
+ isLoading: ae,
1851
+ isError: !!x,
1852
+ error: x,
1783
1853
  enableGlobalFilter: !0,
1784
- getRowId: d,
1854
+ getRowId: l,
1785
1855
  toolbarLeftContent: o(),
1786
1856
  children: Q
1787
1857
  }
1788
1858
  )
1789
1859
  }
1790
1860
  ),
1791
- z === "apiToken" ? /* @__PURE__ */ e.jsx(
1792
- xa,
1861
+ E === "apiToken" ? /* @__PURE__ */ e.jsx(
1862
+ fa,
1793
1863
  {
1794
- onClickOk: F,
1864
+ onClickOk: I,
1795
1865
  opened: !0,
1796
- dataSource: h,
1797
- onCustomSave: B,
1798
- onClickCancel: F
1866
+ dataSource: p,
1867
+ onCustomSave: q,
1868
+ onClickCancel: I
1799
1869
  }
1800
1870
  ) : null
1801
1871
  ] });
1802
1872
  }
1803
1873
  export {
1804
- xa as ApiTokenModal,
1805
- Ra as ArchbaseApiTokenView,
1806
- la as ArchbaseDualListSelector,
1807
- ka as ArchbaseSecurityView,
1808
- ha as GroupModal,
1874
+ fa as ApiTokenModal,
1875
+ Ia as ArchbaseApiTokenView,
1876
+ da as ArchbaseDualListSelector,
1877
+ Fa as ArchbaseSecurityView,
1878
+ xa as GroupModal,
1809
1879
  Ve as PermissionsSelectorModal,
1810
- ia as ProfileModal,
1811
- ca as RenderProfileUserItem,
1812
- ua as UserModal
1880
+ ca as ProfileModal,
1881
+ ua as RenderProfileUserItem,
1882
+ pa as UserModal
1813
1883
  };
1814
1884
  //# sourceMappingURL=index.js.map