@sensinum/strapi-plugin-xecp 5.2.0 → 5.3.0

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.
Files changed (37) hide show
  1. package/README.md +3 -3
  2. package/dist/admin/App-BbgV5mHU.mjs +2809 -0
  3. package/dist/admin/App-OXf6qXjU.js +74 -0
  4. package/dist/admin/TruncatedTypography-B8iYkeNP.js +12 -0
  5. package/dist/admin/{TruncatedTypography-D8gHowDS.mjs → TruncatedTypography-BA_MhPw6.mjs} +4 -4
  6. package/dist/admin/{de-DPIfWiIq.mjs → de-9eabZie2.mjs} +114 -58
  7. package/dist/admin/de-BN51VcbT.js +1 -0
  8. package/dist/admin/en-DI1XKd0e.js +1 -0
  9. package/dist/admin/{en-CCG4TklL.mjs → en-tFIwzuCy.mjs} +114 -58
  10. package/dist/admin/{fr-DnzU_m4o.mjs → fr-BRWFIMrf.mjs} +114 -58
  11. package/dist/admin/fr-lAhQzMjM.js +1 -0
  12. package/dist/admin/index-BU_gTHIE.mjs +110 -0
  13. package/dist/admin/index-C5CJ1Sy4.js +1 -0
  14. package/dist/admin/{index-DTADzNmo.mjs → index-CT94KSzm.mjs} +179 -174
  15. package/dist/admin/index-CmLDGvPV.js +1 -0
  16. package/dist/admin/{index-CwNAiNVu.mjs → index-SQ5frWDn.mjs} +96 -90
  17. package/dist/admin/{index-B2NfpbcT.js → index-ghS-FZ_7.js} +8 -8
  18. package/dist/admin/index.js +1 -1
  19. package/dist/admin/index.mjs +3 -2
  20. package/dist/admin/pl-CSVwN6jF.js +1 -0
  21. package/dist/admin/{pl-F5zNdZs4.mjs → pl-DLMBD4Lc.mjs} +114 -58
  22. package/dist/admin/{queryKeys-rUHP1d6p.mjs → queryKeys-LazhiKSv.mjs} +5 -4
  23. package/dist/admin/queryKeys-Y6_AOyGq.js +1 -0
  24. package/dist/server/index.js +7 -10
  25. package/dist/server/index.mjs +8734 -8533
  26. package/package.json +48 -22
  27. package/dist/admin/App-DCc6Nerz.js +0 -30
  28. package/dist/admin/App-FBmORCnP.mjs +0 -2144
  29. package/dist/admin/TruncatedTypography-CJdWCFOe.js +0 -12
  30. package/dist/admin/de-Dc27qqZI.js +0 -1
  31. package/dist/admin/en-CPGWvai6.js +0 -1
  32. package/dist/admin/fr-uAOzHrhn.js +0 -1
  33. package/dist/admin/index-B21jnMBg.mjs +0 -113
  34. package/dist/admin/index-BHf1dfyp.js +0 -1
  35. package/dist/admin/index-jgDj_iIg.js +0 -1
  36. package/dist/admin/pl-B1KyPSlZ.js +0 -1
  37. package/dist/admin/queryKeys-B_GC_f73.js +0 -1
@@ -1,23 +1,23 @@
1
- import { jsx as t, Fragment as G, jsxs as m } from "react/jsx-runtime";
2
- import { useFetchClient as K, useForm as oe, useNotification as se, Layouts as O, useRBAC as ae, Page as F, Form as le } from "@strapi/strapi/admin";
3
- import { U as P, g as a, P as W } from "./index-B21jnMBg.mjs";
4
- import { S as D, P as de, Q as ce } from "./queryKeys-rUHP1d6p.mjs";
5
- import { useEffect as pe, useRef as ue, useMemo as me } from "react";
1
+ import { jsx as t, Fragment as G, jsxs as u } from "react/jsx-runtime";
2
+ import { useFetchClient as K, useForm as re, useNotification as se, Layouts as O, useRBAC as ae, Page as k, Form as le } from "@strapi/strapi/admin";
3
+ import { U as P, g as a, P as W } from "./index-BU_gTHIE.mjs";
4
+ import { S as D, P as de, Q as ce } from "./queryKeys-LazhiKSv.mjs";
5
+ import { useEffect as pe, useRef as me, useMemo as ue } from "react";
6
6
  import { useIntl as E } from "react-intl";
7
7
  import ge, { z as h } from "zod";
8
8
  import { useQuery as _, queryOptions as he, useQueryClient as ye, useMutation as H } from "@tanstack/react-query";
9
- import { Box as C, Field as y, SingleSelect as Te, SingleSelectOption as fe, Typography as v, Table as ve, Thead as Ee, Tr as j, Th as q, Tbody as Ce, Td as I, MultiSelect as be, MultiSelectOption as Se, Flex as z, Tooltip as Ae, Grid as A, NumberInput as we, TextInput as Q, Button as X, Loader as Re } from "@strapi/design-system";
9
+ import { Box as C, Field as T, SingleSelect as Te, SingleSelectOption as fe, Typography as v, Table as ve, Thead as Ee, Tr as j, Th as I, Tbody as Ce, Td as V, MultiSelect as be, MultiSelectOption as Se, Flex as z, Tooltip as Ae, Grid as A, NumberInput as we, TextInput as Q, Button as X, Loader as Re } from "@strapi/design-system";
10
10
  import { Information as Ke, Check as Z } from "@strapi/icons";
11
- import { T as B, A as J, b as Pe } from "./TruncatedTypography-D8gHowDS.mjs";
11
+ import { T as B, A as J, b as Pe } from "./TruncatedTypography-BA_MhPw6.mjs";
12
12
  import { isEqual as Fe } from "lodash";
13
- const De = 3, w = h.enum(["Related", "Promotable"]);
13
+ const ke = 3, w = h.enum(["Related", "Promotable"]);
14
14
  h.object({
15
15
  targetEnvApiKey: h.string().optional(),
16
16
  targetEnvApiUrl: h.url().optional(),
17
17
  comparisonDepth: h.number().positive().optional(),
18
18
  contentTypes: h.array(h.object({ uid: h.string(), key: h.string(), kind: w })).optional()
19
19
  });
20
- const Ue = () => {
20
+ const De = () => {
21
21
  const { get: e } = K();
22
22
  return _({
23
23
  queryKey: [D],
@@ -26,13 +26,13 @@ const Ue = () => {
26
26
  return n;
27
27
  }
28
28
  });
29
- }, ke = [
29
+ }, Ue = [
30
30
  D,
31
31
  "content-type-options"
32
32
  ], Le = () => {
33
33
  const { get: e } = K();
34
34
  return _({
35
- queryKey: ke,
35
+ queryKey: Ue,
36
36
  queryFn: async () => {
37
37
  const { data: n } = await e(
38
38
  `/${P}/settings/content-type-options`
@@ -43,7 +43,7 @@ const Ue = () => {
43
43
  }, qe = (e) => [D, "related-content-types", e], Ie = (e, n) => he({
44
44
  queryKey: qe(n),
45
45
  queryFn: async () => {
46
- const { data: r } = await e(
46
+ const { data: o } = await e(
47
47
  `/${P}/settings/related-content-types`,
48
48
  {
49
49
  params: {
@@ -51,9 +51,9 @@ const Ue = () => {
51
51
  }
52
52
  }
53
53
  );
54
- return r;
54
+ return o;
55
55
  }
56
- }), M = (e) => {
56
+ }), N = (e) => {
57
57
  const { get: n } = K();
58
58
  return _({
59
59
  ...Ie(n, e),
@@ -62,7 +62,7 @@ const Ue = () => {
62
62
  }, Ve = () => {
63
63
  const { put: e } = K(), n = ye();
64
64
  return H({
65
- mutationFn: async (r) => e(`/${P}/settings`, r),
65
+ mutationFn: async (o) => e(`/${P}/settings`, o),
66
66
  onSuccess: async () => {
67
67
  await Promise.all([
68
68
  n.invalidateQueries({ queryKey: [D] }),
@@ -70,10 +70,11 @@ const Ue = () => {
70
70
  ]);
71
71
  }
72
72
  });
73
- }, _e = (e, n) => Object.entries(n).reduce((r, [o, i]) => Fe(i, e[o]) ? r : {
74
- ...r,
75
- [o]: i
76
- }, {}), ee = h.object({
73
+ }, Me = (e, n) => Object.fromEntries(
74
+ Object.entries(n).filter(
75
+ ([o, r]) => !Fe(r, e[o])
76
+ )
77
+ ), ee = h.object({
77
78
  allowedContentTypes: h.array(h.string()).min(1, { message: "settings.form.error.minimalArrayLength" }),
78
79
  contentTypeSettings: h.record(
79
80
  h.string(),
@@ -84,14 +85,14 @@ const Ue = () => {
84
85
  targetEnvApiKey: h.string({ message: "settings.form.error.required" }).min(1, { message: "settings.form.error.required" }),
85
86
  targetEnvApiUrl: h.url({ message: "settings.form.error.validURL" }),
86
87
  comparisonDepth: h.number({ message: "settings.form.error.required" }).positive({ message: "settings.form.error.positive" })
87
- }), Me = ee.extend({
88
+ }), _e = ee.extend({
88
89
  relatedContentTypes: h.string().array()
89
- }), Ne = Me.refine(
90
+ }), Ne = _e.refine(
90
91
  (e) => [
91
92
  ...e.allowedContentTypes,
92
93
  ...e.relatedContentTypes
93
94
  ].every(
94
- (r) => !!e.contentTypeSettings[r]?.key
95
+ (o) => !!e.contentTypeSettings[o]?.key
95
96
  ),
96
97
  {
97
98
  path: ["allowedContentTypes"],
@@ -101,27 +102,27 @@ const Ue = () => {
101
102
  }
102
103
  }
103
104
  ), xe = (e, n) => {
104
- const r = [...e.allowedContentTypes, ...n];
105
+ const o = [...e.allowedContentTypes, ...n];
105
106
  return {
106
107
  ...e,
107
108
  contentTypeSettings: Object.fromEntries(
108
- r.map((o) => [
109
- o,
110
- e.contentTypeSettings[o]
109
+ o.map((r) => [
110
+ r,
111
+ e.contentTypeSettings[r]
111
112
  ])
112
113
  )
113
114
  };
114
- }, te = (e) => e.replace(".", ":"), V = (e) => e.replace(/:(?!.*:)/, "."), Oe = (e, n) => {
115
- const o = {
115
+ }, te = (e) => e.replace(".", ":"), M = (e) => e.replace(/:(?!.*:)/, "."), Oe = (e, n) => {
116
+ const r = {
116
117
  ...xe(n, e),
117
118
  relatedContentTypes: e
118
- }, i = Ne.parse(o);
119
+ }, i = Ne.parse(r);
119
120
  return {
120
121
  contentTypes: [
121
122
  ...i.allowedContentTypes,
122
123
  ...i.relatedContentTypes
123
124
  ].map((c) => ({
124
- uid: V(c),
125
+ uid: M(c),
125
126
  key: i.contentTypeSettings[c]?.key,
126
127
  kind: i.allowedContentTypes.includes(c) ? w.enum.Promotable : w.enum.Related
127
128
  })),
@@ -135,60 +136,60 @@ const Ue = () => {
135
136
  shadow: "filterShadow",
136
137
  padding: 6,
137
138
  width: "100%"
138
- }, N = ({ children: e, marginTop: n }) => /* @__PURE__ */ t(C, { ...je, marginTop: n, children: e }), Qe = ({
139
+ }, x = ({ children: e, marginTop: n }) => /* @__PURE__ */ t(C, { ...je, marginTop: n, children: e }), Qe = ({
139
140
  onChange: e,
140
141
  uniqueKeys: n,
141
- value: r,
142
- name: o,
142
+ value: o,
143
+ name: r,
143
144
  error: i,
144
145
  disabled: l = !1
145
146
  }) => {
146
- const { formatMessage: c } = E(), g = Object.keys(n).filter((u) => n[u] === "ok");
147
+ const { formatMessage: c } = E(), g = Object.keys(n).filter((m) => n[m] === "ok");
147
148
  return pe(() => {
148
- !r && g.length > 0 && e("");
149
- }, []), /* @__PURE__ */ t(G, { children: g.length > 0 ? /* @__PURE__ */ m(y.Root, { error: i && c({ id: a(i) }), children: [
149
+ !o && g.length > 0 && e("");
150
+ }, []), /* @__PURE__ */ t(G, { children: g.length > 0 ? /* @__PURE__ */ u(T.Root, { error: i && c({ id: a(i) }), children: [
150
151
  /* @__PURE__ */ t(
151
152
  Te,
152
153
  {
153
- name: o,
154
- value: r,
154
+ name: r,
155
+ value: o,
155
156
  onChange: e,
156
157
  required: !0,
157
158
  disabled: l,
158
- children: g.map((u) => /* @__PURE__ */ t(fe, { value: u, children: u }, u))
159
+ children: g.map((m) => /* @__PURE__ */ t(fe, { value: m, children: m }, m))
159
160
  }
160
161
  ),
161
- /* @__PURE__ */ t(y.Error, {})
162
+ /* @__PURE__ */ t(T.Error, {})
162
163
  ] }) : /* @__PURE__ */ t(
163
- y.Root,
164
+ T.Root,
164
165
  {
165
166
  error: c({ id: a("settings.table.uniqueKeyRequiredWarning") }),
166
- children: /* @__PURE__ */ t(y.Error, {})
167
+ children: /* @__PURE__ */ t(T.Error, {})
167
168
  }
168
169
  ) });
169
170
  }, Y = ({
170
171
  label: e,
171
172
  contentTypes: n,
172
- setFormValue: r,
173
- errors: o,
173
+ setFormValue: o,
174
+ errors: r,
174
175
  contentTypeSettings: i,
175
176
  shouldShowRequiredBy: l,
176
177
  isReadOnly: c,
177
178
  environmentSpecificFields: g = {}
178
179
  }) => {
179
- const { formatMessage: u } = E();
180
- return /* @__PURE__ */ m(C, { marginTop: 4, width: "100%", paddingTop: 4, children: [
180
+ const { formatMessage: m } = E();
181
+ return /* @__PURE__ */ u(C, { marginTop: 4, width: "100%", paddingTop: 4, children: [
181
182
  /* @__PURE__ */ t(C, { marginBottom: 1, children: /* @__PURE__ */ t(v, { variant: "pi", textColor: "neutral800", fontWeight: "bold", children: e }) }),
182
- /* @__PURE__ */ m(ve, { width: "100%", rowCount: n.length, colCount: l ? 3 : 2, children: [
183
- /* @__PURE__ */ t(Ee, { children: /* @__PURE__ */ m(j, { children: [
184
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(v, { variant: "sigma", children: u({ id: a("settings.table.contentType") }) }) }),
185
- l && /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(v, { variant: "sigma", children: u({ id: a("settings.table.requiredBy") }) }) }),
186
- /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(v, { variant: "sigma", children: u({ id: a("settings.table.uniqueKey") }) }) })
183
+ /* @__PURE__ */ u(ve, { width: "100%", rowCount: n.length, colCount: l ? 3 : 2, children: [
184
+ /* @__PURE__ */ t(Ee, { children: /* @__PURE__ */ u(j, { children: [
185
+ /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(v, { variant: "sigma", children: m({ id: a("settings.table.contentType") }) }) }),
186
+ l && /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(v, { variant: "sigma", children: m({ id: a("settings.table.requiredBy") }) }) }),
187
+ /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(v, { variant: "sigma", children: m({ id: a("settings.table.uniqueKey") }) }) })
187
188
  ] }) }),
188
189
  /* @__PURE__ */ t(Ce, { children: n.map((s) => {
189
190
  const d = `contentTypeSettings.${s.uid}.key`, p = g[s.uid] ?? [];
190
- return /* @__PURE__ */ m(j, { children: [
191
- /* @__PURE__ */ t(I, { width: l ? "25%" : "50%", children: /* @__PURE__ */ t(
191
+ return /* @__PURE__ */ u(j, { children: [
192
+ /* @__PURE__ */ t(V, { width: l ? "25%" : "50%", children: /* @__PURE__ */ t(
192
193
  B,
193
194
  {
194
195
  maxCharacters: 55,
@@ -196,7 +197,7 @@ const Ue = () => {
196
197
  textColor: "neutral800"
197
198
  }
198
199
  ) }),
199
- l && /* @__PURE__ */ t(I, { width: "25%", children: /* @__PURE__ */ t(
200
+ l && /* @__PURE__ */ t(V, { width: "25%", children: /* @__PURE__ */ t(
200
201
  B,
201
202
  {
202
203
  maxCharacters: 55,
@@ -204,17 +205,17 @@ const Ue = () => {
204
205
  textColor: "neutral800"
205
206
  }
206
207
  ) }),
207
- /* @__PURE__ */ m(I, { width: "50%", children: [
208
+ /* @__PURE__ */ u(V, { width: "50%", children: [
208
209
  /* @__PURE__ */ t(
209
210
  Qe,
210
211
  {
211
- onChange: (T) => {
212
- r(d, T);
212
+ onChange: (y) => {
213
+ o(d, y);
213
214
  },
214
215
  value: i[s.uid]?.key,
215
216
  uniqueKeys: s.uniqueKeys,
216
217
  name: d,
217
- error: o[d],
218
+ error: r[d],
218
219
  disabled: c
219
220
  }
220
221
  ),
@@ -224,7 +225,7 @@ const Ue = () => {
224
225
  variant: "pi",
225
226
  textColor: "neutral600",
226
227
  style: { whiteSpace: "normal", overflowWrap: "anywhere" },
227
- children: u(
228
+ children: m(
228
229
  { id: a("settings.table.environmentSpecificFields") },
229
230
  { fields: p.join(", ") }
230
231
  )
@@ -238,24 +239,25 @@ const Ue = () => {
238
239
  }, Be = ({
239
240
  allowedContentTypes: e,
240
241
  contentTypeSettings: n,
241
- setFormValue: r,
242
- promotableContentTypes: o,
242
+ setFormValue: o,
243
+ promotableContentTypes: r,
243
244
  errors: i,
244
245
  isReadOnly: l,
245
246
  environmentSpecificFields: c
246
247
  }) => {
247
- const { formatMessage: g } = E(), u = e.map(
248
- (p) => o?.find((T) => T.uid === p)
249
- ), { data: s, isLoading: d } = M(e);
250
- return d ? null : /* @__PURE__ */ m(N, { children: [
248
+ const { formatMessage: g } = E(), m = e.flatMap((p) => {
249
+ const y = r?.find(({ uid: F }) => F === p);
250
+ return y ? [y] : [];
251
+ }), { data: s, isLoading: d } = N(e);
252
+ return d ? null : /* @__PURE__ */ u(x, { children: [
251
253
  /* @__PURE__ */ t(v, { variant: "delta", children: g({ id: a("settings.allowedContentTypes") }) }),
252
- /* @__PURE__ */ t(C, { marginTop: 4, width: "100%", children: /* @__PURE__ */ m(
253
- y.Root,
254
+ /* @__PURE__ */ t(C, { marginTop: 4, width: "100%", children: /* @__PURE__ */ u(
255
+ T.Root,
254
256
  {
255
257
  width: "100%",
256
258
  error: i.allowedContentTypes && g({ id: a(i.allowedContentTypes) }),
257
259
  children: [
258
- /* @__PURE__ */ t(y.Label, { children: g({ id: a("settings.allowedContentTypes.label") }) }),
260
+ /* @__PURE__ */ t(T.Label, { children: g({ id: a("settings.allowedContentTypes.label") }) }),
259
261
  /* @__PURE__ */ t(
260
262
  be,
261
263
  {
@@ -263,14 +265,14 @@ const Ue = () => {
263
265
  name: "allowedContentTypes",
264
266
  value: e,
265
267
  onChange: (p) => {
266
- r("allowedContentTypes", p);
268
+ o("allowedContentTypes", p);
267
269
  },
268
270
  hasError: !!i.allowedContentTypes,
269
271
  disabled: l,
270
- children: o?.map((p) => /* @__PURE__ */ t(Se, { value: p.uid, children: p.displayName }, p.uid))
272
+ children: r?.map((p) => /* @__PURE__ */ t(Se, { value: p.uid, children: p.displayName }, p.uid))
271
273
  }
272
274
  ),
273
- /* @__PURE__ */ t(y.Error, {})
275
+ /* @__PURE__ */ t(T.Error, {})
274
276
  ]
275
277
  }
276
278
  ) }),
@@ -280,8 +282,8 @@ const Ue = () => {
280
282
  label: g({
281
283
  id: a("settings.table.keyForEligibleContentTypes")
282
284
  }),
283
- contentTypes: u,
284
- setFormValue: r,
285
+ contentTypes: m,
286
+ setFormValue: o,
285
287
  errors: i,
286
288
  contentTypeSettings: n,
287
289
  isReadOnly: l,
@@ -295,7 +297,7 @@ const Ue = () => {
295
297
  id: a("settings.table.keyForRelatedContentTypes")
296
298
  }),
297
299
  contentTypes: s ?? [],
298
- setFormValue: r,
300
+ setFormValue: o,
299
301
  errors: i,
300
302
  contentTypeSettings: n,
301
303
  shouldShowRequiredBy: !0,
@@ -316,30 +318,30 @@ const Ue = () => {
316
318
  })
317
319
  }
318
320
  ) });
319
- }, $e = ({ comparisonDepth: e, setFormValue: n, errors: r, isReadOnly: o }) => {
321
+ }, $e = ({ comparisonDepth: e, setFormValue: n, errors: o, isReadOnly: r }) => {
320
322
  const { formatMessage: i } = E();
321
- return /* @__PURE__ */ m(N, { marginTop: 4, children: [
322
- /* @__PURE__ */ m(z, { marginBottom: 4, gap: 1, children: [
323
+ return /* @__PURE__ */ u(x, { marginTop: 4, children: [
324
+ /* @__PURE__ */ u(z, { marginBottom: 4, gap: 1, children: [
323
325
  /* @__PURE__ */ t(v, { variant: "delta", children: i({ id: a("settings.comparisonDepth") }) }),
324
326
  /* @__PURE__ */ t(Ae, { label: i({ id: a("settings.comparisonDepth.tooltip") }), children: /* @__PURE__ */ t(Ke, {}) })
325
327
  ] }),
326
- /* @__PURE__ */ t(A.Root, { gap: 4, children: /* @__PURE__ */ t(A.Item, { col: 6, alignItems: "start", children: /* @__PURE__ */ m(
327
- y.Root,
328
+ /* @__PURE__ */ t(A.Root, { gap: 4, children: /* @__PURE__ */ t(A.Item, { col: 6, alignItems: "start", children: /* @__PURE__ */ u(
329
+ T.Root,
328
330
  {
329
- error: r.comparisonDepth && i({ id: a(r.comparisonDepth) }),
331
+ error: o.comparisonDepth && i({ id: a(o.comparisonDepth) }),
330
332
  width: "100%",
331
333
  children: [
332
- /* @__PURE__ */ t(y.Label, { children: i({ id: a("settings.comparisonDepth.label") }) }),
334
+ /* @__PURE__ */ t(T.Label, { children: i({ id: a("settings.comparisonDepth.label") }) }),
333
335
  /* @__PURE__ */ t(
334
336
  we,
335
337
  {
336
338
  value: e,
337
339
  onValueChange: (l) => n("comparisonDepth", l),
338
340
  name: "comparisonDepth",
339
- disabled: o
341
+ disabled: r
340
342
  }
341
343
  ),
342
- /* @__PURE__ */ t(y.Error, {})
344
+ /* @__PURE__ */ t(T.Error, {})
343
345
  ]
344
346
  }
345
347
  ) }) }),
@@ -347,25 +349,28 @@ const Ue = () => {
347
349
  ] });
348
350
  }, Ge = ({ staleValueMessages: e }) => {
349
351
  const { formatMessage: n } = E();
350
- return /* @__PURE__ */ t(C, { marginBottom: 4, children: /* @__PURE__ */ m(
352
+ return /* @__PURE__ */ t(C, { marginBottom: 4, children: /* @__PURE__ */ u(
351
353
  J,
352
354
  {
353
355
  title: n({ id: a("settings.alert.staleValuesRemoved.title") }),
354
356
  variant: "danger",
355
357
  children: [
356
358
  n({ id: a("settings.alert.staleValuesRemoved.description") }),
357
- e.map((r, o) => /* @__PURE__ */ m("span", { children: [
358
- /* @__PURE__ */ t("br", {}),
359
- o + 1,
360
- ".",
361
- " ",
362
- n(
363
- {
364
- id: a(r.message)
365
- },
366
- r.variables
367
- )
368
- ] }, o))
359
+ e.map((o, r) => (
360
+ // oxlint-disable-next-line react/no-array-index-key -- messages have no stable id
361
+ /* @__PURE__ */ u("span", { children: [
362
+ /* @__PURE__ */ t("br", {}),
363
+ r + 1,
364
+ ".",
365
+ " ",
366
+ n(
367
+ {
368
+ id: a(o.message)
369
+ },
370
+ o.variables
371
+ )
372
+ ] }, r)
373
+ ))
369
374
  ]
370
375
  }
371
376
  ) });
@@ -373,11 +378,11 @@ const Ue = () => {
373
378
  const { post: e } = K();
374
379
  return H({
375
380
  mutationFn: async (n) => {
376
- const { data: r } = await e(
381
+ const { data: o } = await e(
377
382
  `/${P}/settings/testConnection`,
378
383
  n
379
384
  );
380
- return r;
385
+ return o;
381
386
  }
382
387
  });
383
388
  }, He = "settings.form.error.badApiUrl", ze = {
@@ -386,74 +391,74 @@ const Ue = () => {
386
391
  }, Xe = ({
387
392
  targetEnvApiKey: e,
388
393
  targetEnvApiUrl: n,
389
- setFormValue: r,
390
- errors: o,
394
+ setFormValue: o,
395
+ errors: r,
391
396
  isReadOnly: i
392
397
  }) => {
393
- const { formatMessage: l } = E(), c = We(), { setErrors: g } = oe("TargetEnvConfigurationSection", (p) => p), u = async () => {
394
- const p = (T) => {
398
+ const { formatMessage: l } = E(), c = We(), { setErrors: g } = re("TargetEnvConfigurationSection", (p) => p), m = async () => {
399
+ const p = (y) => {
395
400
  g({
396
- ...o,
397
- targetEnvApiUrl: T.outcome === "badUrl" ? He : void 0,
398
- targetEnvApiKey: ze[T.outcome]
401
+ ...r,
402
+ targetEnvApiUrl: y.outcome === "badUrl" ? He : void 0,
403
+ targetEnvApiKey: ze[y.outcome]
399
404
  });
400
405
  };
401
406
  try {
402
- const T = await c.mutateAsync({
407
+ const y = await c.mutateAsync({
403
408
  targetEnvApiKey: e,
404
409
  targetEnvApiUrl: n
405
410
  });
406
- p(T);
411
+ p(y);
407
412
  } catch {
408
413
  p({ outcome: "unexpected" });
409
414
  }
410
415
  }, s = c.isSuccess && c.data?.outcome === "reachable", d = c.isError || c.data?.outcome === "unexpected";
411
- return /* @__PURE__ */ m(N, { marginTop: 4, children: [
416
+ return /* @__PURE__ */ u(x, { marginTop: 4, children: [
412
417
  /* @__PURE__ */ t(C, { marginBottom: 4, children: /* @__PURE__ */ t(v, { variant: "delta", children: l({ id: a("settings.targetEnvConfiguration") }) }) }),
413
- /* @__PURE__ */ m(A.Root, { gap: 4, children: [
414
- /* @__PURE__ */ t(A.Item, { col: 6, alignItems: "start", children: /* @__PURE__ */ m(
415
- y.Root,
418
+ /* @__PURE__ */ u(A.Root, { gap: 4, children: [
419
+ /* @__PURE__ */ t(A.Item, { col: 6, alignItems: "start", children: /* @__PURE__ */ u(
420
+ T.Root,
416
421
  {
417
- error: o.targetEnvApiUrl && l({ id: a(o.targetEnvApiUrl) }),
422
+ error: r.targetEnvApiUrl && l({ id: a(r.targetEnvApiUrl) }),
418
423
  width: "100%",
419
424
  children: [
420
- /* @__PURE__ */ t(y.Label, { children: l({ id: a("settings.targetEnvApiUrl.label") }) }),
425
+ /* @__PURE__ */ t(T.Label, { children: l({ id: a("settings.targetEnvApiUrl.label") }) }),
421
426
  /* @__PURE__ */ t(
422
427
  Q,
423
428
  {
424
429
  name: "targetEnvApiUrl",
425
430
  value: n,
426
- onChange: r,
431
+ onChange: o,
427
432
  disabled: i
428
433
  }
429
434
  ),
430
- /* @__PURE__ */ t(y.Error, {})
435
+ /* @__PURE__ */ t(T.Error, {})
431
436
  ]
432
437
  }
433
438
  ) }),
434
- /* @__PURE__ */ t(A.Item, { col: 6, alignItems: "start", children: /* @__PURE__ */ m(
435
- y.Root,
439
+ /* @__PURE__ */ t(A.Item, { col: 6, alignItems: "start", children: /* @__PURE__ */ u(
440
+ T.Root,
436
441
  {
437
- error: o.targetEnvApiKey && l({ id: a(o.targetEnvApiKey) }),
442
+ error: r.targetEnvApiKey && l({ id: a(r.targetEnvApiKey) }),
438
443
  width: "100%",
439
444
  children: [
440
- /* @__PURE__ */ t(y.Label, { children: l({ id: a("settings.targetEnvApiKey.label") }) }),
445
+ /* @__PURE__ */ t(T.Label, { children: l({ id: a("settings.targetEnvApiKey.label") }) }),
441
446
  /* @__PURE__ */ t(
442
447
  Q,
443
448
  {
444
449
  name: "targetEnvApiKey",
445
450
  value: e,
446
- onChange: r,
451
+ onChange: o,
447
452
  disabled: i
448
453
  }
449
454
  ),
450
- /* @__PURE__ */ t(y.Error, {})
455
+ /* @__PURE__ */ t(T.Error, {})
451
456
  ]
452
457
  }
453
458
  ) }),
454
- /* @__PURE__ */ m(A.Item, { col: 6, children: [
455
- i ? null : /* @__PURE__ */ t(X, { onClick: u, disabled: c.isPending, children: l({ id: a("settings.form.testConnection") }) }),
456
- /* @__PURE__ */ m(z, { marginLeft: 1, alignItems: "center", gap: 2, children: [
459
+ /* @__PURE__ */ u(A.Item, { col: 6, children: [
460
+ i ? null : /* @__PURE__ */ t(X, { onClick: m, disabled: c.isPending, children: l({ id: a("settings.form.testConnection") }) }),
461
+ /* @__PURE__ */ u(z, { marginLeft: 1, alignItems: "center", gap: 2, children: [
457
462
  c.isPending && /* @__PURE__ */ t(Re, { small: !0 }),
458
463
  s && /* @__PURE__ */ t(Z, { color: "#5cb176" }),
459
464
  d && /* @__PURE__ */ t(v, { variant: "pi", textColor: "danger600", children: l({ id: a("settings.form.error.connectionFailed") }) })
@@ -464,21 +469,21 @@ const Ue = () => {
464
469
  }, Ze = ({
465
470
  values: e,
466
471
  onChange: n,
467
- errors: r,
468
- setErrors: o,
472
+ errors: o,
473
+ setErrors: r,
469
474
  modified: i,
470
475
  settings: l,
471
476
  promotableContentTypes: c,
472
477
  staleValuesMessages: g,
473
- isReadOnly: u,
478
+ isReadOnly: m,
474
479
  environmentSpecificFields: s
475
480
  }) => {
476
- const { formatMessage: d } = E(), { toggleNotification: p } = se(), T = Ve(), { data: x = [], isFetching: U } = M(e.allowedContentTypes), k = async () => {
481
+ const { formatMessage: d } = E(), { toggleNotification: p } = se(), y = Ve(), { data: F = [], isFetching: U } = N(e.allowedContentTypes), L = async () => {
477
482
  try {
478
- const b = x.map((S) => S.uid), R = Oe(b, e), f = _e(l, R);
479
- await T.mutateAsync(f, {
483
+ const b = F.map((S) => S.uid), R = Oe(b, e), f = Me(l, R);
484
+ await y.mutateAsync(f, {
480
485
  onSuccess: () => {
481
- o({}), p({
486
+ r({}), p({
482
487
  type: "success",
483
488
  message: d({ id: a("settings.form.savedSuccessfully") })
484
489
  });
@@ -487,7 +492,7 @@ const Ue = () => {
487
492
  } catch (b) {
488
493
  if (b instanceof ge.ZodError) {
489
494
  const R = b.issues.reduce((f, S) => (f[S.path.join(".")] = S.message, f), {});
490
- o(R), p({
495
+ r(R), p({
491
496
  type: "warning",
492
497
  message: d({ id: a("settings.form.error.validationMessage") })
493
498
  });
@@ -497,20 +502,20 @@ const Ue = () => {
497
502
  message: Pe(b, d) ?? d({ id: a("settings.form.error.other") })
498
503
  });
499
504
  }
500
- }, L = u || !i && g.length === 0 || U || T.isPending;
501
- return /* @__PURE__ */ m(G, { children: [
505
+ }, q = m || !i && g.length === 0 || U || y.isPending;
506
+ return /* @__PURE__ */ u(G, { children: [
502
507
  /* @__PURE__ */ t(
503
508
  O.Header,
504
509
  {
505
510
  title: d({ id: a("settings.title") }),
506
511
  subtitle: d({ id: a("settings.subtitle") }),
507
- primaryAction: u ? null : /* @__PURE__ */ t(
512
+ primaryAction: m ? null : /* @__PURE__ */ t(
508
513
  X,
509
514
  {
510
515
  type: "submit",
511
516
  startIcon: /* @__PURE__ */ t(Z, {}),
512
- onClick: k,
513
- disabled: L,
517
+ onClick: L,
518
+ disabled: q,
514
519
  children: d({
515
520
  id: a("settings.form.submit")
516
521
  })
@@ -518,7 +523,7 @@ const Ue = () => {
518
523
  )
519
524
  }
520
525
  ),
521
- /* @__PURE__ */ m(O.Content, { children: [
526
+ /* @__PURE__ */ u(O.Content, { children: [
522
527
  g.length > 0 && /* @__PURE__ */ t(Ge, { staleValueMessages: g }),
523
528
  /* @__PURE__ */ t(
524
529
  Be,
@@ -527,8 +532,8 @@ const Ue = () => {
527
532
  contentTypeSettings: e.contentTypeSettings,
528
533
  setFormValue: n,
529
534
  promotableContentTypes: c,
530
- errors: r,
531
- isReadOnly: u,
535
+ errors: o,
536
+ isReadOnly: m,
532
537
  environmentSpecificFields: s
533
538
  }
534
539
  ),
@@ -536,9 +541,9 @@ const Ue = () => {
536
541
  $e,
537
542
  {
538
543
  setFormValue: n,
539
- errors: r,
544
+ errors: o,
540
545
  comparisonDepth: e.comparisonDepth,
541
- isReadOnly: u
546
+ isReadOnly: m
542
547
  }
543
548
  ),
544
549
  /* @__PURE__ */ t(
@@ -547,53 +552,53 @@ const Ue = () => {
547
552
  targetEnvApiKey: e.targetEnvApiKey,
548
553
  targetEnvApiUrl: e.targetEnvApiUrl,
549
554
  setFormValue: n,
550
- errors: r,
551
- isReadOnly: u
555
+ errors: o,
556
+ isReadOnly: m
552
557
  }
553
558
  )
554
559
  ] })
555
560
  ] });
556
561
  }, $ = (e) => {
557
- const n = e.contentTypes ?? [], r = n.filter((i) => i.kind === w.enum.Promotable).map((i) => i.uid), o = Object.fromEntries(
562
+ const n = e.contentTypes ?? [], o = n.filter((i) => i.kind === w.enum.Promotable).map((i) => i.uid), r = Object.fromEntries(
558
563
  n.map((i) => [i.uid, { key: i.key }])
559
564
  );
560
565
  return {
561
- allowedContentTypes: r,
562
- contentTypeSettings: o,
566
+ allowedContentTypes: o,
567
+ contentTypeSettings: r,
563
568
  targetEnvApiKey: e?.targetEnvApiKey ?? "",
564
569
  targetEnvApiUrl: e?.targetEnvApiUrl ?? "",
565
- comparisonDepth: e?.comparisonDepth ?? De
570
+ comparisonDepth: e?.comparisonDepth ?? ke
566
571
  };
567
572
  }, Je = {
568
573
  ok: void 0,
569
574
  notUnique: "settings.alert.staleValuesRemoved.keyDeleted",
570
575
  environmentSpecific: "settings.alert.staleValuesRemoved.keyEnvironmentSpecific",
571
576
  private: "settings.alert.staleValuesRemoved.keyPrivate"
572
- }, et = (e, n, r) => {
577
+ }, et = (e, n, o) => {
573
578
  if (!e.contentTypes)
574
579
  return [$(e), []];
575
- const o = [], i = e.contentTypes.map((s) => ({
580
+ const r = [], i = e.contentTypes.map((s) => ({
576
581
  ...s,
577
582
  uid: te(s.uid)
578
583
  })), l = n.map((s) => s.uid), g = i.filter(
579
584
  (s) => {
580
585
  const d = !l.includes(s.uid);
581
- return d && o.push({
586
+ return d && r.push({
582
587
  message: "settings.alert.staleValuesRemoved.contentTypeDeleted",
583
- variables: { uid: V(s.uid) }
588
+ variables: { uid: M(s.uid) }
584
589
  }), !d;
585
590
  }
586
591
  ).filter((s) => {
587
- const d = !r.includes(s.uid) && s.kind === w.enum.Related;
588
- return d && o.push({
592
+ const d = !o.includes(s.uid) && s.kind === w.enum.Related;
593
+ return d && r.push({
589
594
  message: "settings.alert.staleValuesRemoved.relationDeleted",
590
- variables: { uid: V(s.uid) }
595
+ variables: { uid: M(s.uid) }
591
596
  }), !d;
592
597
  }).map((s) => {
593
598
  const d = n.find(
594
- (T) => T.uid === s.uid
599
+ (y) => y.uid === s.uid
595
600
  ), p = Je[d?.uniqueKeys[s.key] ?? "notUnique"];
596
- return p && o.push({
601
+ return p && r.push({
597
602
  message: p,
598
603
  variables: {
599
604
  key: s.key,
@@ -607,45 +612,45 @@ const Ue = () => {
607
612
  return [$({
608
613
  ...e,
609
614
  contentTypes: g
610
- }), o];
615
+ }), r];
611
616
  }, tt = () => {
612
- const { formatMessage: e } = E(), n = ue(null), {
613
- isLoading: r,
614
- allowedActions: { canUpdate: o }
615
- } = ae([...W.settingsUpdate]), { data: i, isLoading: l } = Ue(), { data: c, isLoading: g } = Le(), u = me(
617
+ const { formatMessage: e } = E(), n = me(null), {
618
+ isLoading: o,
619
+ allowedActions: { canUpdate: r }
620
+ } = ae([...W.settingsUpdate]), { data: i, isLoading: l } = De(), { data: c, isLoading: g } = Le(), m = ue(
616
621
  () => (i?.contentTypes ?? []).filter((f) => f.kind === w.enum.Promotable).map((f) => te(f.uid)),
617
622
  [i?.contentTypes]
618
623
  ), {
619
624
  data: s = [],
620
625
  isLoading: d,
621
626
  isFetched: p
622
- } = M(u), T = u.length === 0 || p;
623
- if (r || l || g || d || !T || !i || !c)
624
- return /* @__PURE__ */ t(F.Loading, {});
625
- const { promotableContentTypes: U, relationLookupContentTypes: k, environmentSpecificFields: L } = c, [b, R] = et(
627
+ } = N(m), y = m.length === 0 || p;
628
+ if (o || l || g || d || !y || !i || !c)
629
+ return /* @__PURE__ */ t(k.Loading, {});
630
+ const { promotableContentTypes: U, relationLookupContentTypes: L, environmentSpecificFields: q } = c, [b, R] = et(
626
631
  i,
627
- k,
632
+ L,
628
633
  s.map((f) => f.uid)
629
634
  );
630
- return /* @__PURE__ */ m(F.Main, { children: [
631
- /* @__PURE__ */ t(F.Title, { children: e({ id: a("settings.metadata.title") }) }),
632
- /* @__PURE__ */ t(le, { width: "100%", height: "100%", ref: n, method: "PUT", initialValues: b, children: ({ values: f, onChange: S, errors: ne, setErrors: ie, modified: re }) => /* @__PURE__ */ t(
635
+ return /* @__PURE__ */ u(k.Main, { children: [
636
+ /* @__PURE__ */ t(k.Title, { children: e({ id: a("settings.metadata.title") }) }),
637
+ /* @__PURE__ */ t(le, { width: "100%", height: "100%", ref: n, method: "PUT", initialValues: b, children: ({ values: f, onChange: S, errors: ne, setErrors: ie, modified: oe }) => /* @__PURE__ */ t(
633
638
  Ze,
634
639
  {
635
640
  values: f,
636
641
  onChange: S,
637
642
  errors: ne,
638
643
  setErrors: ie,
639
- modified: re,
644
+ modified: oe,
640
645
  settings: i,
641
646
  promotableContentTypes: U,
642
647
  staleValuesMessages: R,
643
- isReadOnly: !o,
644
- environmentSpecificFields: L
648
+ isReadOnly: !r,
649
+ environmentSpecificFields: q
645
650
  }
646
651
  ) })
647
652
  ] });
648
- }, gt = () => /* @__PURE__ */ t(F.Protect, { permissions: [...W.settingsRead], children: /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(tt, {}) }) });
653
+ }, gt = () => /* @__PURE__ */ t(k.Protect, { permissions: [...W.settingsRead], children: /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(tt, {}) }) });
649
654
  export {
650
655
  gt as default
651
656
  };