@hybridcore/ui 1.5.49 → 1.5.51

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