@archbase/security-ui 4.0.1 → 4.0.3

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