@archbase/security-ui 3.0.13 → 3.0.14

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