@hybridcore/ui 1.5.5 → 1.5.7

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.
@@ -1,371 +1,388 @@
1
- import { jsx as n, jsxs as h, Fragment as ee } from "react/jsx-runtime";
2
- import m from "react";
3
- import te from "lodash";
4
- import { useForm as ne, Controller as s } from "react-hook-form";
5
- import { getNestedChildrenFromMap as ie } from "../../utils/ontology.js";
6
- import { i as ae, d as le } from "../../utils-Bq0ye5vf.js";
7
- import { ConditionalWrapper as re } from "../conditional-wrapper/index.js";
8
- import { Container as de } from "../container/index.js";
9
- import { TextField as v, FormGroup as oe, FormControl as se, InputLabel as me, Select as ce, MenuItem as ue, FormControlLabel as K, Checkbox as U, Box as p, Button as g } from "@mui/material";
10
- import { TreeSelect as fe } from "../tree-select/index.js";
11
- import he from "./components/policy-list/index.js";
12
- import ve from "./components/variables/index.js";
13
- import { DisseminationList as be } from "../data-security-selectors/dissemination-list/index.js";
14
- import { SecurityLevel as ye } from "../data-security-selectors/security-level/index.js";
15
- const ge = {
1
+ import { jsx as i, jsxs as o, Fragment as re } from "react/jsx-runtime";
2
+ import f from "react";
3
+ import de from "lodash";
4
+ import { useForm as oe, Controller as u } from "react-hook-form";
5
+ import { getNestedChildrenFromMap as se } from "../../utils/ontology.js";
6
+ import { i as ce, d as me } from "../../utils-Bq0ye5vf.js";
7
+ import { ConditionalWrapper as ue } from "../conditional-wrapper/index.js";
8
+ import { Container as fe } from "../container/index.js";
9
+ import { Box as s, TextField as v, FormGroup as he, FormControl as ve, InputLabel as be, Select as ye, MenuItem as Te, FormControlLabel as J, Checkbox as $, Button as g } from "@mui/material";
10
+ import { TreeSelect as ge } from "../tree-select/index.js";
11
+ import pe from "./components/policy-list/index.js";
12
+ import Ie from "./components/variables/index.js";
13
+ import { DisseminationList as xe } from "../data-security-selectors/dissemination-list/index.js";
14
+ import { SecurityLevel as Ce } from "../data-security-selectors/security-level/index.js";
15
+ const Oe = {
16
16
  alg: "A256GCM",
17
17
  ext: !0,
18
18
  k: "_El6rHQxC5E7NdO5DiMDITjF7f65wrlaJmFVagVE9Ic",
19
19
  key_ops: ["encrypt", "decrypt"],
20
20
  kty: "oct"
21
- }, Te = [
21
+ }, Le = [
22
22
  "IMAGE",
23
23
  "VIDEO",
24
24
  "TEXT",
25
25
  "BINARY",
26
26
  "OTHER"
27
27
  ];
28
- function pe(e, j) {
29
- var L, V, S, E, F, k, O, R, w, B, _, A, D, P, W, M, N, G;
28
+ function Ve(e, Q) {
29
+ var L, V, S, E, F, k, R, w, B, _, A, D, P, W, M, N, G, K, U, j, q, H, Y;
30
30
  const {
31
- register: C,
32
- handleSubmit: q,
33
- control: o,
34
- formState: { errors: H, isDirty: Y },
35
- getValues: I,
31
+ register: x,
32
+ handleSubmit: X,
33
+ control: c,
34
+ formState: { errors: z, isDirty: Z },
35
+ getValues: C,
36
36
  setValue: b,
37
- reset: J
38
- } = ne({
37
+ reset: ee
38
+ } = oe({
39
39
  defaultValues: e.defaultValues
40
- }), [$, Q] = m.useState([]), [y, x] = m.useState(), [Ce, X] = m.useState(0), z = m.useMemo(() => {
40
+ }), [te, ie] = f.useState([]), [y, O] = f.useState(), [Se, ne] = f.useState(0), le = f.useMemo(() => {
41
41
  const t = [];
42
- return e.mappedTemplates.forEach((i) => {
43
- i.creatable || t.push(String(i.id));
42
+ return e.mappedTemplates.forEach((n) => {
43
+ n.creatable || t.push(String(n.id));
44
44
  }), t;
45
45
  }, [e.mappedTemplates]);
46
- m.useEffect(() => {
46
+ f.useEffect(() => {
47
47
  (async () => {
48
- const t = { ...e.defaultValues }, i = e.mappedTemplates.get(t.templateId);
49
- if (i) {
50
- const r = i.properties.filter(
51
- (a) => a.privacyPreservationMethod === "ENCRYPTION"
48
+ const t = { ...e.defaultValues }, n = e.mappedTemplates.get(t.templateId);
49
+ if (n) {
50
+ const a = n.properties.filter(
51
+ (r) => r.privacyPreservationMethod === "ENCRYPTION"
52
52
  );
53
- if (r.length > 0)
54
- for (let a = 0; a < r.length; a++) {
55
- const l = r[a], d = te.get(t, `variables.${l.propertyId}`);
53
+ if (a.length > 0)
54
+ for (let r = 0; r < a.length; r++) {
55
+ const l = a[r], d = de.get(t, `variables.${l.propertyId}`);
56
56
  if (d && e.keyAuth) {
57
- const c = await ae(ge), u = await le(c, String(d));
58
- u.data && (b(`variables.${l.propertyId}`, u.data), X((f) => f + 1));
57
+ const m = await ce(Oe), h = await me(m, String(d));
58
+ h.data && (b(`variables.${l.propertyId}`, h.data), ne((T) => T + 1));
59
59
  }
60
60
  }
61
61
  }
62
62
  })();
63
63
  }, [e.defaultValues, e.mappedTemplates, e.keyAuth]);
64
- const T = () => {
65
- const t = I("templateId");
66
- y && x(void 0);
67
- const i = ie(e.mappedTemplates);
68
- Q(i);
69
- for (const r of e.mappedTemplates.values())
70
- if (r.id === t) {
71
- x(r);
64
+ const p = () => {
65
+ const t = C("templateId");
66
+ y && O(void 0);
67
+ const n = se(e.mappedTemplates);
68
+ ie(n);
69
+ for (const a of e.mappedTemplates.values())
70
+ if (a.id === t) {
71
+ O(a);
72
72
  break;
73
73
  }
74
74
  };
75
- m.useImperativeHandle(j, () => ({
75
+ f.useImperativeHandle(Q, () => ({
76
76
  resetForm() {
77
- J({
77
+ ee({
78
78
  title: "",
79
79
  description: "",
80
80
  templateId: 0,
81
81
  variables: {}
82
- }), T();
82
+ }), p();
83
83
  },
84
- setFormValue(t, i) {
85
- b(t, i);
84
+ setFormValue(t, n) {
85
+ b(t, n);
86
86
  },
87
87
  getFormValue(t) {
88
- return I(t);
88
+ return C(t);
89
89
  }
90
- })), m.useEffect(() => (T(), () => {
91
- }), [e.mappedTemplates]), m.useEffect(() => {
90
+ })), f.useEffect(() => (p(), () => {
91
+ }), [e.mappedTemplates]), f.useEffect(() => {
92
92
  e.onSelectedTemplateChange && e.onSelectedTemplateChange(y);
93
93
  }, [y]);
94
- const Z = () => {
94
+ const ae = () => {
95
95
  if (e.onCancel) {
96
- e.onCancel(Y);
96
+ e.onCancel(Z);
97
97
  return;
98
98
  }
99
99
  };
100
- return /* @__PURE__ */ n(
101
- re,
100
+ return /* @__PURE__ */ i(
101
+ ue,
102
102
  {
103
103
  condition: e.variant === void 0 || e.variant === "inline",
104
- wrapper: (t) => /* @__PURE__ */ n(
105
- de,
104
+ wrapper: (t) => /* @__PURE__ */ i(
105
+ fe,
106
106
  {
107
107
  disableHeader: !0,
108
108
  sx: { position: "relative", overflow: "visible" },
109
109
  children: t
110
110
  }
111
111
  ),
112
- children: /* @__PURE__ */ h(
112
+ children: /* @__PURE__ */ o(
113
113
  "form",
114
114
  {
115
- onSubmit: q(e.onSubmit),
115
+ onSubmit: X(e.onSubmit),
116
116
  style: { display: "flex", flexDirection: "column" },
117
117
  children: [
118
- !((V = (L = e.fieldOptions) == null ? void 0 : L.title) != null && V.hidden) && /* @__PURE__ */ n(
119
- v,
120
- {
121
- label: "Title *",
122
- variant: e.inputVariant,
123
- fullWidth: !0,
124
- sx: { mb: 2 },
125
- ...C("title", { required: !0 }),
126
- ...H.title && {
127
- helperText: "This field is required!",
128
- error: !0
118
+ !((V = (L = e.fieldOptions) == null ? void 0 : L.title) != null && V.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
119
+ /* @__PURE__ */ i(
120
+ v,
121
+ {
122
+ label: "Title *",
123
+ variant: e.inputVariant,
124
+ fullWidth: !0,
125
+ ...x("title", { required: !0 }),
126
+ ...z.title && {
127
+ helperText: "This field is required!",
128
+ error: !0
129
+ }
129
130
  }
130
- }
131
- ),
132
- !((E = (S = e.fieldOptions) == null ? void 0 : S.description) != null && E.hidden) && /* @__PURE__ */ n(
133
- v,
134
- {
135
- label: "Description",
136
- variant: e.inputVariant,
137
- fullWidth: !0,
138
- multiline: !0,
139
- sx: { mb: 2 },
140
- minRows: (k = (F = e.fieldOptions) == null ? void 0 : F.description) == null ? void 0 : k.minRows,
141
- ...C("description")
142
- }
143
- ),
144
- !((R = (O = e.fieldOptions) == null ? void 0 : O.templateId) != null && R.hidden) && /* @__PURE__ */ n(oe, { sx: { mb: 2 }, children: /* @__PURE__ */ n(
145
- s,
146
- {
147
- name: "templateId",
148
- control: o,
149
- render: ({ field: { value: t, onChange: i } }) => {
150
- var r, a;
151
- if ((a = (r = e.fieldOptions) == null ? void 0 : r.templateId) != null && a.disabled) {
152
- const l = t ? e.mappedTemplates.get(t) : void 0;
153
- return /* @__PURE__ */ n(
154
- v,
131
+ ),
132
+ e.fieldOptions && ((S = e.fieldOptions.title) == null ? void 0 : S.helperText)
133
+ ] }),
134
+ !((F = (E = e.fieldOptions) == null ? void 0 : E.description) != null && F.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
135
+ /* @__PURE__ */ i(
136
+ v,
137
+ {
138
+ label: "Description",
139
+ variant: e.inputVariant,
140
+ fullWidth: !0,
141
+ multiline: !0,
142
+ minRows: (R = (k = e.fieldOptions) == null ? void 0 : k.description) == null ? void 0 : R.minRows,
143
+ ...x("description")
144
+ }
145
+ ),
146
+ e.fieldOptions && ((w = e.fieldOptions.description) == null ? void 0 : w.helperText)
147
+ ] }),
148
+ !((_ = (B = e.fieldOptions) == null ? void 0 : B.templateId) != null && _.hidden) && /* @__PURE__ */ o(he, { sx: { mb: 2 }, children: [
149
+ /* @__PURE__ */ i(
150
+ u,
151
+ {
152
+ name: "templateId",
153
+ control: c,
154
+ render: ({ field: { value: t, onChange: n } }) => {
155
+ var a, r;
156
+ if ((r = (a = e.fieldOptions) == null ? void 0 : a.templateId) != null && r.disabled) {
157
+ const l = t ? e.mappedTemplates.get(t) : void 0;
158
+ return /* @__PURE__ */ i(
159
+ v,
160
+ {
161
+ label: "Template",
162
+ variant: e.inputVariant,
163
+ fullWidth: !0,
164
+ disabled: !0,
165
+ value: l == null ? void 0 : l.name,
166
+ InputLabelProps: { shrink: !0 }
167
+ }
168
+ );
169
+ }
170
+ return /* @__PURE__ */ i(
171
+ ge,
155
172
  {
156
173
  label: "Template",
174
+ data: te,
175
+ selected: t === 0 ? "" : [String(t)],
176
+ disabled: le,
157
177
  variant: e.inputVariant,
158
- fullWidth: !0,
159
- disabled: !0,
160
- value: l == null ? void 0 : l.name,
161
- InputLabelProps: { shrink: !0 }
178
+ onChange: (l, d) => {
179
+ const m = {
180
+ target: {
181
+ value: d ? Number(l) : 0
182
+ }
183
+ };
184
+ n(m), p();
185
+ }
162
186
  }
163
187
  );
164
188
  }
165
- return /* @__PURE__ */ n(
166
- fe,
167
- {
168
- label: "Template",
169
- data: $,
170
- selected: t === 0 ? "" : [String(t)],
171
- disabled: z,
172
- variant: e.inputVariant,
173
- onChange: (l, d) => {
174
- const c = {
175
- target: {
176
- value: d ? Number(l) : 0
177
- }
178
- };
179
- i(c), T();
180
- }
181
- }
182
- );
183
189
  }
184
- }
185
- ) }),
186
- "aliasList" in e.defaultValues && !((B = (w = e.fieldOptions) == null ? void 0 : w.aliasList) != null && B.hidden) && /* @__PURE__ */ n(
187
- s,
190
+ ),
191
+ e.fieldOptions && ((A = e.fieldOptions.templateId) == null ? void 0 : A.helperText)
192
+ ] }),
193
+ "aliasList" in e.defaultValues && !((P = (D = e.fieldOptions) == null ? void 0 : D.aliasList) != null && P.hidden) && /* @__PURE__ */ i(
194
+ u,
188
195
  {
189
196
  name: "aliasList",
190
- control: o,
191
- render: ({ field: { value: t, onChange: i, ...r } }) => {
192
- const a = (l) => {
193
- const u = {
197
+ control: c,
198
+ render: ({ field: { value: t, onChange: n, ...a } }) => {
199
+ var l;
200
+ const r = (d) => {
201
+ const T = {
194
202
  target: {
195
- value: l.target.value.split(",").map((f) => f.trimStart())
203
+ value: d.target.value.split(",").map((I) => I.trimStart())
196
204
  }
197
205
  };
198
- i(u);
206
+ n(T);
199
207
  };
200
- return /* @__PURE__ */ n(
201
- v,
202
- {
203
- label: "Alias List",
204
- variant: e.inputVariant,
205
- fullWidth: !0,
206
- value: t,
207
- sx: { mb: 2 },
208
- helperText: "Add list values with the comma (,) separated string",
209
- onChange: a,
210
- ...r
211
- }
212
- );
208
+ return /* @__PURE__ */ o(s, { mb: 2, children: [
209
+ /* @__PURE__ */ i(
210
+ v,
211
+ {
212
+ label: "Alias List",
213
+ variant: e.inputVariant,
214
+ fullWidth: !0,
215
+ value: t,
216
+ helperText: "Add list values with the comma (,) separated string",
217
+ onChange: r,
218
+ ...a
219
+ }
220
+ ),
221
+ e.fieldOptions && ((l = e.fieldOptions.aliasList) == null ? void 0 : l.helperText)
222
+ ] });
213
223
  }
214
224
  }
215
225
  ),
216
- "appliedPolicies" in e.defaultValues && !((A = (_ = e.fieldOptions) == null ? void 0 : _.appliedPolicies) != null && A.hidden) && /* @__PURE__ */ n(
217
- s,
226
+ "appliedPolicies" in e.defaultValues && !((M = (W = e.fieldOptions) == null ? void 0 : W.appliedPolicies) != null && M.hidden) && /* @__PURE__ */ i(
227
+ u,
218
228
  {
219
229
  name: "appliedPolicies",
220
- control: o,
221
- render: ({ field: { value: t, onChange: i } }) => /* @__PURE__ */ n(
222
- he,
223
- {
224
- policyList: e.policyList,
225
- value: t || void 0,
226
- onChange: i
227
- }
228
- )
230
+ control: c,
231
+ render: ({ field: { value: t, onChange: n } }) => {
232
+ var a;
233
+ return /* @__PURE__ */ o(s, { mb: 2, children: [
234
+ /* @__PURE__ */ i(
235
+ pe,
236
+ {
237
+ policyList: e.policyList,
238
+ value: t || void 0,
239
+ onChange: n
240
+ }
241
+ ),
242
+ e.fieldOptions && ((a = e.fieldOptions.appliedPolicies) == null ? void 0 : a.helperText)
243
+ ] });
244
+ }
229
245
  }
230
246
  ),
231
- /* @__PURE__ */ n(
232
- s,
247
+ /* @__PURE__ */ i(
248
+ u,
233
249
  {
234
250
  name: "variables",
235
- control: o,
236
- render: ({ field: { value: t, onChange: i } }) => /* @__PURE__ */ n(
237
- ve,
251
+ control: c,
252
+ render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ i(
253
+ Ie,
238
254
  {
239
255
  template: y,
240
256
  value: t,
241
257
  mapboxAccessToken: e.mapboxAccessToken,
242
258
  variant: e.inputVariant,
243
259
  fieldOptions: e.fieldOptions,
244
- onChange: i
260
+ onChange: n
245
261
  }
246
262
  )
247
263
  }
248
264
  ),
249
- "fileInBase64" in e.defaultValues && !((P = (D = e.fieldOptions) == null ? void 0 : D.fileInBase64) != null && P.hidden) && /* @__PURE__ */ h(ee, { children: [
250
- /* @__PURE__ */ n(
251
- s,
265
+ "fileInBase64" in e.defaultValues && !((G = (N = e.fieldOptions) == null ? void 0 : N.fileInBase64) != null && G.hidden) && /* @__PURE__ */ o(re, { children: [
266
+ /* @__PURE__ */ i(
267
+ u,
252
268
  {
253
269
  name: "fileInBase64",
254
- control: o,
255
- render: ({ field: { onChange: t, ...i } }) => {
256
- const r = (a) => {
257
- if (a.target.files) {
258
- const l = new FileReader();
259
- l.onload = async (c) => {
260
- const f = c.target.result.split("base64,")[1];
261
- t(f);
270
+ control: c,
271
+ render: ({ field: { onChange: t, ...n } }) => {
272
+ var r;
273
+ const a = (l) => {
274
+ if (l.target.files) {
275
+ const d = new FileReader();
276
+ d.onload = async (h) => {
277
+ const I = h.target.result.split("base64,")[1];
278
+ t(I);
262
279
  };
263
- const d = a.target.files[0];
264
- b("originalFileName", d.name), b("contentType", d.type), l.readAsDataURL(d);
280
+ const m = l.target.files[0];
281
+ b("originalFileName", m.name), b("contentType", m.type), d.readAsDataURL(m);
265
282
  }
266
283
  };
267
- return /* @__PURE__ */ n(
268
- v,
269
- {
270
- type: "file",
271
- label: "File to Upload",
272
- variant: e.inputVariant,
273
- fullWidth: !0,
274
- sx: { mb: 2 },
275
- helperText: "Select a file to upload",
276
- InputLabelProps: { shrink: !0 },
277
- onChange: r,
278
- ...i
279
- }
280
- );
284
+ return /* @__PURE__ */ o(s, { mb: 2, children: [
285
+ /* @__PURE__ */ i(
286
+ v,
287
+ {
288
+ type: "file",
289
+ label: "File to Upload",
290
+ variant: e.inputVariant,
291
+ fullWidth: !0,
292
+ helperText: "Select a file to upload",
293
+ InputLabelProps: { shrink: !0 },
294
+ onChange: a,
295
+ ...n
296
+ }
297
+ ),
298
+ e.fieldOptions && ((r = e.fieldOptions.fileInBase64) == null ? void 0 : r.helperText)
299
+ ] });
281
300
  }
282
301
  }
283
302
  ),
284
- /* @__PURE__ */ n(
285
- s,
303
+ /* @__PURE__ */ i(
304
+ u,
286
305
  {
287
306
  name: "type",
288
- control: o,
289
- render: ({ field: { value: t, onChange: i } }) => {
290
- const r = (a) => {
307
+ control: c,
308
+ render: ({ field: { value: t, onChange: n } }) => {
309
+ var r;
310
+ const a = (l) => {
291
311
  const {
292
- target: { value: l }
293
- } = a;
294
- i(l);
312
+ target: { value: d }
313
+ } = l;
314
+ n(d);
295
315
  };
296
- return /* @__PURE__ */ h(
297
- se,
298
- {
299
- fullWidth: !0,
300
- sx: {
301
- mb: 2
302
- },
303
- variant: e.inputVariant,
304
- children: [
305
- /* @__PURE__ */ n(me, { children: "Type" }),
306
- /* @__PURE__ */ n(
307
- ce,
308
- {
309
- value: t ? [t] : "",
310
- onChange: r,
311
- children: Te.map((a) => /* @__PURE__ */ n(ue, { value: a, children: a }, a))
312
- }
313
- )
314
- ]
315
- }
316
- );
316
+ return /* @__PURE__ */ o(s, { mb: 2, children: [
317
+ /* @__PURE__ */ o(ve, { fullWidth: !0, variant: e.inputVariant, children: [
318
+ /* @__PURE__ */ i(be, { children: "Type" }),
319
+ /* @__PURE__ */ i(
320
+ ye,
321
+ {
322
+ value: t ? [t] : "",
323
+ onChange: a,
324
+ children: Le.map((l) => /* @__PURE__ */ i(Te, { value: l, children: l }, l))
325
+ }
326
+ )
327
+ ] }),
328
+ e.fieldOptions && ((r = e.fieldOptions.type) == null ? void 0 : r.helperText)
329
+ ] });
317
330
  }
318
331
  }
319
332
  ),
320
- /* @__PURE__ */ n(
321
- K,
322
- {
323
- control: /* @__PURE__ */ n(
324
- s,
325
- {
326
- name: "redacted",
327
- control: o,
328
- render: ({ field: { value: t, ...i } }) => /* @__PURE__ */ n(U, { checked: !!t, ...i })
329
- }
330
- ),
331
- label: "Redacted",
332
- sx: { mb: 2 }
333
- }
334
- ),
335
- /* @__PURE__ */ n(
336
- K,
337
- {
338
- control: /* @__PURE__ */ n(
339
- s,
340
- {
341
- name: "contentEncrypted",
342
- control: o,
343
- render: ({ field: { value: t, ...i } }) => /* @__PURE__ */ n(U, { checked: !!t, ...i })
344
- }
345
- ),
346
- label: "Content Encrypted",
347
- sx: { mb: 2 }
348
- }
349
- )
333
+ /* @__PURE__ */ o(s, { mb: 2, children: [
334
+ /* @__PURE__ */ i(
335
+ J,
336
+ {
337
+ control: /* @__PURE__ */ i(
338
+ u,
339
+ {
340
+ name: "redacted",
341
+ control: c,
342
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i($, { checked: !!t, ...n })
343
+ }
344
+ ),
345
+ label: "Redacted"
346
+ }
347
+ ),
348
+ e.fieldOptions && ((K = e.fieldOptions.redacted) == null ? void 0 : K.helperText)
349
+ ] }),
350
+ /* @__PURE__ */ o(s, { mb: 2, children: [
351
+ /* @__PURE__ */ i(
352
+ J,
353
+ {
354
+ control: /* @__PURE__ */ i(
355
+ u,
356
+ {
357
+ name: "contentEncrypted",
358
+ control: c,
359
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i($, { checked: !!t, ...n })
360
+ }
361
+ ),
362
+ label: "Content Encrypted"
363
+ }
364
+ ),
365
+ e.fieldOptions && ((U = e.fieldOptions.contentEncrypted) == null ? void 0 : U.helperText)
366
+ ] })
350
367
  ] }),
351
- !((M = (W = e.fieldOptions) == null ? void 0 : W.disseminationList) != null && M.hidden) && /* @__PURE__ */ n(
352
- s,
368
+ !((q = (j = e.fieldOptions) == null ? void 0 : j.disseminationList) != null && q.hidden) && /* @__PURE__ */ i(
369
+ u,
353
370
  {
354
371
  name: "disseminationList",
355
372
  rules: {
356
373
  required: !0
357
374
  },
358
- control: o,
359
- render: ({ field: { value: t, onChange: i }, fieldState: r }) => {
360
- const a = t || [], l = (d) => {
361
- i(d);
375
+ control: c,
376
+ render: ({ field: { value: t, onChange: n }, fieldState: a }) => {
377
+ const r = t || [], l = (d) => {
378
+ n(d);
362
379
  };
363
- return /* @__PURE__ */ n(
364
- be,
380
+ return /* @__PURE__ */ i(
381
+ xe,
365
382
  {
366
- selectedIds: a,
383
+ selectedIds: r,
367
384
  memberedGroups: e.memberedGroups,
368
- showError: !!r.error,
385
+ showError: !!a.error,
369
386
  variant: e.inputVariant,
370
387
  onChange: l
371
388
  }
@@ -373,21 +390,21 @@ function pe(e, j) {
373
390
  }
374
391
  }
375
392
  ),
376
- !((G = (N = e.fieldOptions) == null ? void 0 : N.securityLevelId) != null && G.hidden) && /* @__PURE__ */ n(p, { mt: 2, children: /* @__PURE__ */ n(
377
- s,
393
+ !((Y = (H = e.fieldOptions) == null ? void 0 : H.securityLevelId) != null && Y.hidden) && /* @__PURE__ */ i(s, { mt: 2, children: /* @__PURE__ */ i(
394
+ u,
378
395
  {
379
396
  name: "securityLevelId",
380
397
  rules: {
381
398
  required: !0
382
399
  },
383
- control: o,
384
- render: ({ field: { value: t, onChange: i }, fieldState: r }) => {
400
+ control: c,
401
+ render: ({ field: { value: t, onChange: n }, fieldState: a }) => {
385
402
  var l, d;
386
- const a = (c) => {
387
- i(c);
403
+ const r = (m) => {
404
+ n(m);
388
405
  };
389
- return /* @__PURE__ */ n(
390
- ye,
406
+ return /* @__PURE__ */ i(
407
+ Ce,
391
408
  {
392
409
  value: t || 0,
393
410
  ontologyId: e.ontologyId,
@@ -396,28 +413,28 @@ function pe(e, j) {
396
413
  minLevelId: e.minSecurityLevel,
397
414
  templateKeys: (l = e.securityLevelConfig) == null ? void 0 : l.templateKeys,
398
415
  templateType: (d = e.securityLevelConfig) == null ? void 0 : d.templateType,
399
- showError: !!r.error,
416
+ showError: !!a.error,
400
417
  variant: e.inputVariant,
401
- onChange: a
418
+ onChange: r
402
419
  }
403
420
  );
404
421
  }
405
422
  }
406
423
  ) }),
407
- /* @__PURE__ */ h(p, { display: "flex", justifyContent: "space-between", mt: 3, children: [
408
- /* @__PURE__ */ n(
424
+ /* @__PURE__ */ o(s, { display: "flex", justifyContent: "space-between", mt: 3, children: [
425
+ /* @__PURE__ */ i(
409
426
  g,
410
427
  {
411
428
  color: "primary",
412
429
  variant: "text",
413
430
  disabled: e.loading,
414
431
  sx: { textTransform: "none" },
415
- onClick: Z,
432
+ onClick: ae,
416
433
  children: "Cancel"
417
434
  }
418
435
  ),
419
- /* @__PURE__ */ h(p, { children: [
420
- e.onRemove !== void 0 && /* @__PURE__ */ n(
436
+ /* @__PURE__ */ o(s, { children: [
437
+ e.onRemove !== void 0 && /* @__PURE__ */ i(
421
438
  g,
422
439
  {
423
440
  type: "button",
@@ -429,7 +446,7 @@ function pe(e, j) {
429
446
  children: e.removeLoading ? "Deleting..." : "Delete"
430
447
  }
431
448
  ),
432
- e.saveButtons ? e.saveButtons.map((t, i) => /* @__PURE__ */ n(
449
+ e.saveButtons ? e.saveButtons.map((t, n) => /* @__PURE__ */ i(
433
450
  g,
434
451
  {
435
452
  type: "submit",
@@ -441,8 +458,8 @@ function pe(e, j) {
441
458
  onClick: t.onClick,
442
459
  children: t.label
443
460
  },
444
- i
445
- )) : /* @__PURE__ */ n(
461
+ n
462
+ )) : /* @__PURE__ */ i(
446
463
  g,
447
464
  {
448
465
  type: "submit",
@@ -461,7 +478,7 @@ function pe(e, j) {
461
478
  }
462
479
  );
463
480
  }
464
- const De = m.forwardRef(pe);
481
+ const Ke = f.forwardRef(Ve);
465
482
  export {
466
- De as InstanceForm
483
+ Ke as InstanceForm
467
484
  };