@knkcs/importhub-ui 0.7.0 → 0.9.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.
@@ -1,1149 +1,1293 @@
1
- import { jsx as t, jsxs as s, Fragment as P } from "react/jsx-runtime";
2
- import { useState as _, useEffect as ue, useMemo as ve } from "react";
3
- import { useTranslation as $ } from "react-i18next";
4
- import { I as F, l as D, m as te, u as Se, i as xe, M as Ce } from "./mapping-page-Lu48SY_L.js";
5
- import { Button as H, StatusBadge as Ee, IconButton as B } from "@knkcs/anker/atoms";
6
- import { Card as y, NavList as Q } from "@knkcs/anker/components";
7
- import { Stack as h, Text as g, Textarea as me, Alert as K, Box as x, List as oe, HStack as ee, Heading as Ie, Code as $e, Separator as ae, Grid as he, RadioGroup as Fe, Radio as Ne } from "@knkcs/anker/primitives";
1
+ import { jsx as e, jsxs as a, Fragment as z } from "react/jsx-runtime";
2
+ import { useState as N, useEffect as ye, useId as He, useMemo as U } from "react";
3
+ import { useTranslation as E } from "react-i18next";
4
+ import { I, l as O, m as te, u as $e, i as Te, n as we, F as W, M as ze } from "./mapping-page-BTEJR0-z.js";
5
+ import { Button as w, StatusBadge as Se, BaseSelect as ke, IconButton as X } from "@knkcs/anker/atoms";
6
+ import { Card as v, NavList as Q, UploadDropZone as Ae, CodeCell as Me, TruncatedTextCell as se, DataTable as Re } from "@knkcs/anker/components";
7
+ import { Stack as b, Text as h, Textarea as ve, Alert as $, Box as x, List as de, HStack as R, Heading as Oe, Code as Le, Checkbox as De, Center as _e, Grid as le, Separator as ce, RadioGroup as Ve, Radio as je } from "@knkcs/anker/primitives";
8
8
  import { SubNavLayout as Z } from "@knkcs/anker/templates";
9
- import { Plus as z, Trash2 as A } from "lucide-react";
10
- import { useFormContext as R, useWatch as U, useFieldArray as w } from "react-hook-form";
11
- import { FormField as fe, InputField as p, BaseSelectField as j, SwitchField as C, CheckboxField as Pe } from "@knkcs/anker/forms";
12
- import { useHostIdentity as He } from "@knkcs/anker/host";
13
- import { useQuery as Me } from "@tanstack/react-query";
14
- const se = (o) => JSON.stringify(o ?? {}, null, 2);
15
- function _e({ name: o, disabled: e }) {
16
- const { t: l } = $(F), { control: r, setValue: i } = R(), n = U({ control: r, name: o }), [a, c] = _(() => se(n)), [d, f] = _(!1), [b, u] = _(null);
17
- ue(() => {
18
- d || c(se(n));
19
- }, [n, d]);
20
- const m = () => {
21
- let v;
9
+ import { Plus as D, Trash2 as _, FileCode as Be, Play as Ke } from "lucide-react";
10
+ import { useFormContext as k, useWatch as B, useFieldArray as q } from "react-hook-form";
11
+ import { FormField as xe, InputField as f, BaseSelectField as V, SwitchField as H, CheckboxField as We } from "@knkcs/anker/forms";
12
+ import { X as Ge, l as re, f as pe, a as ee, b as Ue, r as Xe, p as qe } from "./field-tree-CghMgGKm.js";
13
+ import { useHostIdentity as Ce } from "@knkcs/anker/host";
14
+ import { useQuery as Fe, useMutation as Je } from "@tanstack/react-query";
15
+ const me = (i) => JSON.stringify(i ?? {}, null, 2);
16
+ function Ye({ name: i, disabled: t }) {
17
+ const { t: l } = E(I), { control: n, setValue: r } = k(), o = B({ control: n, name: i }), [s, m] = N(() => me(o)), [d, g] = N(!1), [u, c] = N(null);
18
+ ye(() => {
19
+ d || m(me(o));
20
+ }, [o, d]);
21
+ const p = () => {
22
+ let C;
22
23
  try {
23
- v = JSON.parse(a);
24
+ C = JSON.parse(s);
24
25
  } catch {
25
- u(l("editor.json.notJson"));
26
+ c(l("editor.json.notJson"));
26
27
  return;
27
28
  }
28
- if (!v || typeof v != "object" || Array.isArray(v)) {
29
- u(l("editor.json.notObject"));
29
+ if (!C || typeof C != "object" || Array.isArray(C)) {
30
+ c(l("editor.json.notObject"));
30
31
  return;
31
32
  }
32
- u(null), f(!1), i(o, v, { shouldDirty: !0 });
33
+ c(null), g(!1), r(i, C, { shouldDirty: !0 });
33
34
  };
34
- return /* @__PURE__ */ t(y, { title: l("editor.json.title"), children: /* @__PURE__ */ s(h, { gap: "3", children: [
35
- /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: l("editor.json.help") }),
36
- /* @__PURE__ */ t(
37
- me,
35
+ return /* @__PURE__ */ e(v, { title: l("editor.json.title"), children: /* @__PURE__ */ a(b, { gap: "3", children: [
36
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: l("editor.json.help") }),
37
+ /* @__PURE__ */ e(
38
+ ve,
38
39
  {
39
40
  "aria-label": l("editor.json.label"),
40
- value: a,
41
- rows: Math.min(24, Math.max(6, a.split(`
41
+ value: s,
42
+ rows: Math.min(24, Math.max(6, s.split(`
42
43
  `).length)),
43
44
  fontFamily: "mono",
44
45
  spellCheck: !1,
45
- disabled: e,
46
- onChange: (v) => {
47
- c(v.target.value), f(!0);
46
+ disabled: t,
47
+ onChange: (C) => {
48
+ m(C.target.value), g(!0);
48
49
  }
49
50
  }
50
51
  ),
51
- d && !b ? /* @__PURE__ */ t(g, { color: "fg.warning", fontSize: "sm", children: l("editor.json.unapplied") }) : null,
52
- b ? /* @__PURE__ */ t(K, { status: "error", colorPalette: "danger", children: b }) : null,
53
- e ? null : /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(H, { variant: "outline", size: "sm", disabled: !d, onClick: m, children: l("editor.json.apply") }) })
52
+ d && !u ? /* @__PURE__ */ e(h, { color: "fg.warning", fontSize: "sm", children: l("editor.json.unapplied") }) : null,
53
+ u ? /* @__PURE__ */ e($, { status: "error", colorPalette: "danger", children: u }) : null,
54
+ t ? null : /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(w, { variant: "outline", size: "sm", disabled: !d, onClick: p, children: l("editor.json.apply") }) })
54
55
  ] }) });
55
56
  }
56
- const Re = ["fields", "virtualTableFields"], L = (o) => Array.isArray(o) ? o : [];
57
- function Y(o, e = "", l = "fields") {
58
- return L(o).flatMap((r, i) => {
59
- const n = `${e}${String(r.name ?? "")}`, a = `${l}.${i}`;
60
- return [
61
- { path: n, name: a },
62
- ...Re.flatMap((c) => Y(r[c], `${n}.`, `${a}.${c}`))
63
- ];
64
- });
65
- }
66
- function ke(o, e) {
67
- return Y(o).find((l) => l.path === e)?.name ?? null;
68
- }
69
- function W(o, e) {
70
- for (const l of o) {
71
- if (l.path === e) return [l];
72
- if (e.startsWith(`${l.path}.`)) {
73
- const r = W(l.children, e);
74
- if (r) return [l, ...r];
75
- }
76
- }
77
- return null;
78
- }
79
- function G(o, e = "") {
80
- return { accessor: o.split(".").pop() ?? o, path: o, fieldType: e, label: "", children: [] };
81
- }
82
- const ze = (o) => o.fieldType.includes("table") ? "virtualTableFields" : "fields";
83
- function Ae(o, e, l) {
84
- const r = structuredClone(L(o)), i = ke(r, l);
85
- if (i) return { fields: r, name: i };
86
- const n = W(e, l) ?? [{ ...G(l, "text"), accessor: l }];
87
- let a = r, c = "fields", d = "";
88
- return n.forEach((f, b) => {
89
- const u = f.path.slice(d.length);
90
- let m = a.findIndex((E) => String(E.name ?? "") === u);
91
- const v = b === n.length - 1;
92
- if (m < 0 && (a.push({
93
- name: u,
94
- selector: v ? "" : ".",
95
- type: Ve(f.fieldType)
96
- }), m = a.length - 1), c = `${c}.${m}`, !v) {
97
- const E = ze(f), k = a[m];
98
- k[E] = L(k[E]), a = k[E], c = `${c}.${E}`, d = `${f.path}.`;
99
- }
100
- }), { fields: r, name: c };
101
- }
102
- function Le(o, e) {
103
- const l = structuredClone(L(o)), r = e.split(".").slice(1);
104
- let i = l;
105
- for (let n = 0; n < r.length - 1; n += 2) {
106
- const a = i[Number(r[n])];
107
- if (!a) return l;
108
- i = L(a[r[n + 1]]);
109
- }
110
- return i.splice(Number(r[r.length - 1]), 1), l;
111
- }
112
- const Oe = [
113
- "text",
114
- "array",
115
- "date",
116
- "number",
117
- "richtext",
118
- "reference",
119
- "toc_reference",
120
- "concat",
121
- "virtualtable",
122
- "select",
123
- "boolean",
124
- "fieldset",
125
- "title_scope",
126
- "title_data",
127
- "outline_tree",
128
- "processing_instructions"
129
- ], De = {
130
- date: "date",
131
- number: "number",
132
- boolean: "boolean",
133
- select: "select",
134
- radio: "select",
135
- checkboxes: "array",
136
- list: "array",
137
- array: "array",
138
- rich_text: "richtext",
139
- reference: "reference",
140
- single_reference: "reference",
141
- fieldset: "fieldset",
142
- group: "fieldset",
143
- card: "fieldset",
144
- section: "fieldset",
145
- virtual_table: "virtualtable"
146
- };
147
- function Ve(o) {
148
- return De[o] ?? "text";
149
- }
150
- function O({ name: o, within: e = !1 }) {
151
- const { t: l } = $(F), { reasons: r } = D(), i = r.filter(
152
- (n) => e ? ge(n.path, o) : te(n.path) === o
57
+ function j({ name: i, within: t = !1 }) {
58
+ const { t: l } = E(I), { reasons: n } = O(), r = n.filter(
59
+ (o) => t ? Ee(o.path, i) : te(o.path) === i
153
60
  );
154
- return i.length === 0 ? null : /* @__PURE__ */ t(K, { status: "error", colorPalette: "danger", title: l("editor.reasonsHere"), children: /* @__PURE__ */ t(oe.Root, { ps: "4", children: i.map((n, a) => (
61
+ return r.length === 0 ? null : /* @__PURE__ */ e($, { status: "error", colorPalette: "danger", title: l("editor.reasonsHere"), children: /* @__PURE__ */ e(de.Root, { ps: "4", children: r.map((o, s) => (
155
62
  // Two reasons may read alike; their order is importhub's.
156
63
  // biome-ignore lint/suspicious/noArrayIndexKey: a static list
157
- /* @__PURE__ */ t(oe.Item, { children: n.message }, a)
64
+ /* @__PURE__ */ e(de.Item, { children: o.message }, s)
158
65
  )) }) });
159
66
  }
160
- function Be(o, e) {
161
- return o.some((l) => ge(l.path, e));
67
+ function Qe(i, t) {
68
+ return i.some((l) => Ee(l.path, t));
162
69
  }
163
- function ge(o, e) {
164
- const l = te(o);
165
- return l === e || l.startsWith(`${e}.`);
70
+ function Ee(i, t) {
71
+ const l = te(i);
72
+ return l === t || l.startsWith(`${t}.`);
166
73
  }
167
- function be({ name: o }) {
168
- const { reasons: e } = D(), l = new Set(
169
- e.map((r) => te(r.path)).filter((r) => r.startsWith(`${o}.`) && /^\d+$/.test(r.slice(o.length + 1)))
74
+ function Ie({ name: i }) {
75
+ const { reasons: t } = O(), l = new Set(
76
+ t.map((n) => te(n.path)).filter((n) => n.startsWith(`${i}.`) && /^\d+$/.test(n.slice(i.length + 1)))
170
77
  );
171
- return /* @__PURE__ */ t(P, { children: [...l].map((r) => /* @__PURE__ */ t(O, { name: r }, r)) });
78
+ return /* @__PURE__ */ e(z, { children: [...l].map((n) => /* @__PURE__ */ e(j, { name: n }, n)) });
172
79
  }
173
- const Ke = " = ";
174
- function V(o) {
175
- return Array.isArray(o) ? o.join(`
176
- `) : o && typeof o == "object" ? Object.entries(o).map(([e, l]) => `${e}${Ke}${l}`).join(`
80
+ const Ze = " = ";
81
+ function G(i) {
82
+ return Array.isArray(i) ? i.join(`
83
+ `) : i && typeof i == "object" ? Object.entries(i).map(([t, l]) => `${t}${Ze}${l}`).join(`
177
84
  `) : "";
178
85
  }
179
- function ce(o, e) {
180
- const l = o.split(`
181
- `).map((r) => r.trim()).filter((r) => r !== "");
182
- return e === "list" ? l : Object.fromEntries(
183
- l.map((r) => {
184
- const i = r.indexOf("=");
185
- return i < 0 ? [r, ""] : [r.slice(0, i).trim(), r.slice(i + 1).trim()];
86
+ function ue(i, t) {
87
+ const l = i.split(`
88
+ `).map((n) => n.trim()).filter((n) => n !== "");
89
+ return t === "list" ? l : Object.fromEntries(
90
+ l.map((n) => {
91
+ const r = n.indexOf("=");
92
+ return r < 0 ? [n, ""] : [n.slice(0, r).trim(), n.slice(r + 1).trim()];
186
93
  })
187
94
  );
188
95
  }
189
- function S({
190
- name: o,
191
- label: e,
96
+ function F({
97
+ name: i,
98
+ label: t,
192
99
  helperText: l,
193
- kind: r = "list",
194
- disabled: i
100
+ kind: n = "list",
101
+ disabled: r
195
102
  }) {
196
- return /* @__PURE__ */ s(h, { gap: "2", children: [
197
- /* @__PURE__ */ t(
198
- fe,
103
+ return /* @__PURE__ */ a(b, { gap: "2", children: [
104
+ /* @__PURE__ */ e(
105
+ xe,
199
106
  {
200
- name: o,
201
- label: e,
107
+ name: i,
108
+ label: t,
202
109
  helperText: l,
203
- disabled: i,
204
- children: (n) => /* @__PURE__ */ t(
205
- we,
110
+ disabled: r,
111
+ children: (o) => /* @__PURE__ */ e(
112
+ et,
206
113
  {
207
- value: n.value,
208
- onChange: n.onChange,
209
- onBlur: n.onBlur,
210
- kind: r,
211
- id: n.name,
212
- name: n.name,
213
- describedBy: n["aria-describedby"],
214
- disabled: i
114
+ value: o.value,
115
+ onChange: o.onChange,
116
+ onBlur: o.onBlur,
117
+ kind: n,
118
+ id: o.name,
119
+ name: o.name,
120
+ describedBy: o["aria-describedby"],
121
+ disabled: r
215
122
  }
216
123
  )
217
124
  }
218
125
  ),
219
- /* @__PURE__ */ t(be, { name: o })
126
+ /* @__PURE__ */ e(Ie, { name: i })
220
127
  ] });
221
128
  }
222
- function we({
223
- value: o,
224
- onChange: e,
129
+ function et({
130
+ value: i,
131
+ onChange: t,
225
132
  onBlur: l,
226
- kind: r,
227
- id: i,
228
- name: n,
229
- describedBy: a,
230
- disabled: c
133
+ kind: n,
134
+ id: r,
135
+ name: o,
136
+ describedBy: s,
137
+ disabled: m
231
138
  }) {
232
- const [d, f] = _(() => V(o));
233
- return ue(() => {
234
- f(
235
- (b) => V(ce(b, r)) === V(o) ? b : V(o)
139
+ const [d, g] = N(() => G(i));
140
+ return ye(() => {
141
+ g(
142
+ (u) => G(ue(u, n)) === G(i) ? u : G(i)
236
143
  );
237
- }, [o, r]), /* @__PURE__ */ t(
238
- me,
144
+ }, [i, n]), /* @__PURE__ */ e(
145
+ ve,
239
146
  {
240
- id: i,
241
- name: n,
242
- "aria-describedby": a,
147
+ id: r,
148
+ name: o,
149
+ "aria-describedby": s,
243
150
  value: d,
244
151
  rows: Math.max(2, d.split(`
245
152
  `).length),
246
153
  fontFamily: "mono",
247
- disabled: c,
154
+ disabled: m,
248
155
  onBlur: l,
249
- onChange: (b) => {
250
- f(b.target.value), e(ce(b.target.value, r));
156
+ onChange: (u) => {
157
+ g(u.target.value), t(ue(u.target.value, n));
251
158
  }
252
159
  }
253
160
  );
254
161
  }
255
- const je = ["de", "en", "ch"];
256
- function We({ name: o, disabled: e }) {
257
- const { t: l } = $(F), { control: r } = R(), i = String(U({ control: r, name: `${o}.type` }) ?? ""), n = (a) => `${o}.${a}`;
258
- return /* @__PURE__ */ s(h, { gap: "4", children: [
259
- /* @__PURE__ */ t(
260
- p,
162
+ const tt = ["de", "en", "ch"];
163
+ function lt({ name: i, disabled: t }) {
164
+ const { t: l } = E(I), { control: n } = k(), r = String(B({ control: n, name: `${i}.type` }) ?? ""), o = (s) => `${i}.${s}`;
165
+ return /* @__PURE__ */ a(b, { gap: "4", children: [
166
+ /* @__PURE__ */ e(
167
+ f,
261
168
  {
262
- name: n("selector"),
169
+ name: o("selector"),
263
170
  label: l("editor.field.selector"),
264
171
  helperText: l("editor.field.selectorHelp"),
265
- disabled: e
172
+ disabled: t
266
173
  }
267
174
  ),
268
- /* @__PURE__ */ t(
269
- j,
175
+ /* @__PURE__ */ e(
176
+ V,
270
177
  {
271
- name: n("type"),
178
+ name: o("type"),
272
179
  label: l("editor.field.type"),
273
180
  isClearable: !1,
274
- disabled: e,
275
- options: Oe.map((a) => ({ id: a, label: a }))
181
+ disabled: t,
182
+ options: Ge.map((s) => ({ id: s, label: s }))
276
183
  }
277
184
  ),
278
- /* @__PURE__ */ t(
279
- C,
185
+ /* @__PURE__ */ e(
186
+ H,
280
187
  {
281
- name: n("optional"),
188
+ name: o("optional"),
282
189
  label: l("editor.field.optional"),
283
190
  helperText: l("editor.field.optionalHelp"),
284
- disabled: e
191
+ disabled: t
285
192
  }
286
193
  ),
287
- i === "date" ? /* @__PURE__ */ s(P, { children: [
288
- /* @__PURE__ */ t(
289
- p,
194
+ r === "date" ? /* @__PURE__ */ a(z, { children: [
195
+ /* @__PURE__ */ e(
196
+ f,
290
197
  {
291
- name: n("dateFormat"),
198
+ name: o("dateFormat"),
292
199
  label: l("editor.field.dateFormat"),
293
200
  helperText: l("editor.field.dateFormatHelp"),
294
- disabled: e
201
+ disabled: t
295
202
  }
296
203
  ),
297
- /* @__PURE__ */ t(
298
- S,
204
+ /* @__PURE__ */ e(
205
+ F,
299
206
  {
300
- name: n("dateFormats"),
207
+ name: o("dateFormats"),
301
208
  label: l("editor.field.dateFormats"),
302
209
  helperText: l("editor.field.dateFormatsHelp"),
303
- disabled: e
210
+ disabled: t
304
211
  }
305
212
  ),
306
- /* @__PURE__ */ t(
307
- C,
213
+ /* @__PURE__ */ e(
214
+ H,
308
215
  {
309
- name: n("autoDetectDateFormat"),
216
+ name: o("autoDetectDateFormat"),
310
217
  label: l("editor.field.autoDetectDateFormat"),
311
- disabled: e
218
+ disabled: t
312
219
  }
313
220
  )
314
221
  ] }) : null,
315
- i === "number" ? /* @__PURE__ */ s(P, { children: [
316
- /* @__PURE__ */ t(
317
- j,
222
+ r === "number" ? /* @__PURE__ */ a(z, { children: [
223
+ /* @__PURE__ */ e(
224
+ V,
318
225
  {
319
- name: n("numberLocale"),
226
+ name: o("numberLocale"),
320
227
  label: l("editor.field.numberLocale"),
321
- disabled: e,
322
- options: je.map((a) => ({ id: a, label: l(`editor.field.locale.${a}`) }))
228
+ disabled: t,
229
+ options: tt.map((s) => ({ id: s, label: l(`editor.field.locale.${s}`) }))
323
230
  }
324
231
  ),
325
- /* @__PURE__ */ t(
326
- C,
232
+ /* @__PURE__ */ e(
233
+ H,
327
234
  {
328
- name: n("stripCurrency"),
235
+ name: o("stripCurrency"),
329
236
  label: l("editor.field.stripCurrency"),
330
- disabled: e
237
+ disabled: t
331
238
  }
332
239
  )
333
240
  ] }) : null,
334
- i === "date" || i === "number" ? /* @__PURE__ */ t(
335
- C,
241
+ r === "date" || r === "number" ? /* @__PURE__ */ e(
242
+ H,
336
243
  {
337
- name: n("skipInvalid"),
244
+ name: o("skipInvalid"),
338
245
  label: l("editor.field.skipInvalid"),
339
246
  helperText: l("editor.field.skipInvalidHelp"),
340
- disabled: e
247
+ disabled: t
341
248
  }
342
249
  ) : null,
343
- i === "select" ? /* @__PURE__ */ t(
344
- S,
250
+ r === "select" ? /* @__PURE__ */ e(
251
+ F,
345
252
  {
346
- name: n("selectOptions"),
253
+ name: o("selectOptions"),
347
254
  kind: "map",
348
255
  label: l("editor.field.selectOptions"),
349
256
  helperText: l("editor.field.selectOptionsHelp"),
350
- disabled: e
257
+ disabled: t
351
258
  }
352
259
  ) : null,
353
- i === "richtext" ? /* @__PURE__ */ s(P, { children: [
354
- /* @__PURE__ */ t(
355
- p,
260
+ r === "richtext" ? /* @__PURE__ */ a(z, { children: [
261
+ /* @__PURE__ */ e(
262
+ f,
356
263
  {
357
- name: n("richTextConfig.textWrapperElement"),
264
+ name: o("richTextConfig.textWrapperElement"),
358
265
  label: l("editor.field.textWrapperElement"),
359
- disabled: e
266
+ disabled: t
360
267
  }
361
268
  ),
362
- /* @__PURE__ */ t(
363
- S,
269
+ /* @__PURE__ */ e(
270
+ F,
364
271
  {
365
- name: n("richTextConfig.ignoreElements"),
272
+ name: o("richTextConfig.ignoreElements"),
366
273
  label: l("editor.field.ignoreElements"),
367
274
  helperText: l("editor.field.elementsHelp"),
368
- disabled: e
275
+ disabled: t
369
276
  }
370
277
  ),
371
- /* @__PURE__ */ t(
372
- S,
278
+ /* @__PURE__ */ e(
279
+ F,
373
280
  {
374
- name: n("richTextConfig.passThroughElements"),
281
+ name: o("richTextConfig.passThroughElements"),
375
282
  label: l("editor.field.passThroughElements"),
376
283
  helperText: l("editor.field.elementsHelp"),
377
- disabled: e
284
+ disabled: t
378
285
  }
379
286
  ),
380
- /* @__PURE__ */ t(
381
- C,
287
+ /* @__PURE__ */ e(
288
+ H,
382
289
  {
383
- name: n("richTextConfig.normalizeWhitespace"),
290
+ name: o("richTextConfig.normalizeWhitespace"),
384
291
  label: l("editor.field.normalizeWhitespace"),
385
- disabled: e
292
+ disabled: t
386
293
  }
387
294
  ),
388
- /* @__PURE__ */ t(
389
- C,
295
+ /* @__PURE__ */ e(
296
+ H,
390
297
  {
391
- name: n("richTextConfig.convertNewlinesToBreaks"),
298
+ name: o("richTextConfig.convertNewlinesToBreaks"),
392
299
  label: l("editor.field.convertNewlinesToBreaks"),
393
- disabled: e
300
+ disabled: t
394
301
  }
395
302
  ),
396
- /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: l("editor.field.richTextMore") })
303
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: l("editor.field.richTextMore") })
397
304
  ] }) : null,
398
- i === "reference" || i === "toc_reference" ? /* @__PURE__ */ s(P, { children: [
399
- /* @__PURE__ */ t(
400
- p,
305
+ r === "reference" || r === "toc_reference" ? /* @__PURE__ */ a(z, { children: [
306
+ /* @__PURE__ */ e(
307
+ f,
401
308
  {
402
- name: n("refBlueprintId"),
309
+ name: o("refBlueprintId"),
403
310
  label: l("editor.field.refBlueprintId"),
404
- disabled: e
311
+ disabled: t
405
312
  }
406
313
  ),
407
- /* @__PURE__ */ t(
408
- p,
314
+ /* @__PURE__ */ e(
315
+ f,
409
316
  {
410
- name: n("refIdTemplate"),
317
+ name: o("refIdTemplate"),
411
318
  label: l("editor.field.refIdTemplate"),
412
319
  helperText: l("editor.field.refIdTemplateHelp"),
413
- disabled: e
320
+ disabled: t
414
321
  }
415
322
  ),
416
- /* @__PURE__ */ t(
417
- p,
323
+ /* @__PURE__ */ e(
324
+ f,
418
325
  {
419
- name: n("refIdExtractPattern"),
326
+ name: o("refIdExtractPattern"),
420
327
  label: l("editor.field.refIdExtractPattern"),
421
- disabled: e
328
+ disabled: t
422
329
  }
423
330
  ),
424
- /* @__PURE__ */ t(
425
- p,
331
+ /* @__PURE__ */ e(
332
+ f,
426
333
  {
427
- name: n("refIdExtractSeparator"),
334
+ name: o("refIdExtractSeparator"),
428
335
  label: l("editor.field.refIdExtractSeparator"),
429
336
  helperText: l("editor.field.refIdExtractSeparatorHelp"),
430
- disabled: e
337
+ disabled: t
431
338
  }
432
339
  ),
433
- /* @__PURE__ */ t(
434
- S,
340
+ /* @__PURE__ */ e(
341
+ F,
435
342
  {
436
- name: n("elementBlueprintMap"),
343
+ name: o("elementBlueprintMap"),
437
344
  kind: "map",
438
345
  label: l("editor.field.elementBlueprintMap"),
439
346
  helperText: l("editor.field.elementBlueprintMapHelp"),
440
- disabled: e
347
+ disabled: t
441
348
  }
442
349
  ),
443
- /* @__PURE__ */ t(
444
- S,
350
+ /* @__PURE__ */ e(
351
+ F,
445
352
  {
446
- name: n("elementRefIdTemplateMap"),
353
+ name: o("elementRefIdTemplateMap"),
447
354
  kind: "map",
448
355
  label: l("editor.field.elementRefIdTemplateMap"),
449
356
  helperText: l("editor.field.elementRefIdTemplateMapHelp"),
450
- disabled: e
357
+ disabled: t
451
358
  }
452
359
  )
453
360
  ] }) : null,
454
- i === "concat" ? /* @__PURE__ */ t(
455
- S,
361
+ r === "concat" ? /* @__PURE__ */ e(
362
+ F,
456
363
  {
457
- name: n("concatSelectors"),
364
+ name: o("concatSelectors"),
458
365
  label: l("editor.field.concatSelectors"),
459
366
  helperText: l("editor.field.concatSelectorsHelp"),
460
- disabled: e
367
+ disabled: t
461
368
  }
462
369
  ) : null,
463
- i === "text" || i === "concat" || i === "array" ? /* @__PURE__ */ t(
464
- C,
370
+ r === "text" || r === "concat" || r === "array" ? /* @__PURE__ */ e(
371
+ H,
465
372
  {
466
- name: n("normalizeUnicode"),
373
+ name: o("normalizeUnicode"),
467
374
  label: l("editor.field.normalizeUnicode"),
468
- disabled: e
375
+ disabled: t
469
376
  }
470
377
  ) : null,
471
- i === "fieldset" || i === "virtualtable" ? /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: l("editor.field.childrenHelp") }) : null
378
+ r === "fieldset" || r === "virtualtable" ? /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: l("editor.field.childrenHelp") }) : null
472
379
  ] });
473
380
  }
474
- function Te(o) {
475
- const { blueprints: e } = Se(), { workspaceId: l } = He(), r = e?.getRelease?.bind(e), i = Me({
476
- queryKey: xe.blueprintRelease(l, o),
477
- queryFn: () => r(o),
478
- enabled: !!(r && o),
381
+ function ie(i) {
382
+ const { blueprints: t } = $e(), { workspaceId: l } = Ce(), n = t?.getRelease?.bind(t), r = Fe({
383
+ queryKey: Te.blueprintRelease(l, i),
384
+ queryFn: () => n(i),
385
+ enabled: !!(n && i),
479
386
  staleTime: Number.POSITIVE_INFINITY
480
387
  });
481
388
  return {
482
- available: !!r,
483
- release: i.data,
484
- isLoading: i.isLoading,
485
- isError: i.isError
389
+ available: !!n,
390
+ release: r.data,
391
+ isLoading: r.isLoading,
392
+ isError: r.isError
486
393
  };
487
394
  }
488
- function Ge(o) {
489
- const e = /* @__PURE__ */ new Map(), l = [];
490
- for (const r of o) {
491
- const i = G(r.path);
492
- e.set(r.name, i);
493
- const n = e.get(r.name.replace(/\.(fields|virtualTableFields)\.\d+$/, ""));
494
- n && n !== i ? n.children.push(i) : l.push(i);
395
+ function rt(i) {
396
+ const t = /* @__PURE__ */ new Map(), l = [];
397
+ for (const n of i) {
398
+ const r = ee(n.path);
399
+ t.set(n.name, r);
400
+ const o = t.get(n.name.replace(/\.(fields|virtualTableFields)\.\d+$/, ""));
401
+ o && o !== r ? o.children.push(r) : l.push(r);
495
402
  }
496
403
  return l;
497
404
  }
498
- function Ue({ notices: o }) {
499
- const { t: e } = $(F), { mapping: l, canConfigure: r, reasons: i } = D(), { control: n, setValue: a } = R(), c = U({ control: n, name: "fields" }), d = Y(c), f = Te(l.content.blueprintReleaseId), b = f.release ? f.release.fields : Ge(d), u = f.release ? d.filter((T) => !W(b, T.path)) : [], [m, v] = _(null), [E, k] = _(/* @__PURE__ */ new Set()), le = (T) => d.find((M) => M.path === T)?.name ?? null, J = (T) => {
500
- const M = le(T.path), re = M !== null && Be(i, M), ie = e(re ? "editor.tree.invalid" : M ? "editor.tree.mapped" : "editor.tree.unmapped"), q = T.label || T.accessor, ne = T.children.length > 0;
501
- return /* @__PURE__ */ t(
405
+ function it({ notices: i }) {
406
+ const { t } = E(I), { mapping: l, canConfigure: n, reasons: r } = O(), { control: o, setValue: s } = k(), m = B({ control: o, name: "fields" }), d = re(m), g = ie(l.content.blueprintReleaseId), u = g.release ? g.release.fields : rt(d), c = g.release ? d.filter((T) => !pe(u, T.path)) : [], [p, C] = N(null), [L, P] = N(/* @__PURE__ */ new Set()), K = (T) => d.find((M) => M.path === T)?.name ?? null, A = (T) => {
407
+ const M = K(T.path), ne = M !== null && Qe(r, M), oe = t(ne ? "editor.tree.invalid" : M ? "editor.tree.mapped" : "editor.tree.unmapped"), J = T.label || T.accessor, ae = T.children.length > 0;
408
+ return /* @__PURE__ */ e(
502
409
  Q.Item,
503
410
  {
504
411
  asChild: !0,
505
- active: m === T.path,
506
- expanded: ne ? !E.has(T.path) : void 0,
507
- onExpandedChange: (ye) => {
508
- const X = new Set(E);
509
- ye ? X.delete(T.path) : X.add(T.path), k(X);
412
+ active: p === T.path,
413
+ expanded: ae ? !L.has(T.path) : void 0,
414
+ onExpandedChange: (Ne) => {
415
+ const Y = new Set(L);
416
+ Ne ? Y.delete(T.path) : Y.add(T.path), P(Y);
510
417
  },
511
- toggleAriaLabel: e("editor.tree.toggle", { label: q }),
512
- indicator: /* @__PURE__ */ t(x, { "aria-hidden": !0, children: /* @__PURE__ */ t(Ee, { tone: re ? "danger" : M ? "success" : "neutral", label: ie }) }),
513
- subItems: ne ? T.children.map(J) : void 0,
514
- children: /* @__PURE__ */ t(
418
+ toggleAriaLabel: t("editor.tree.toggle", { label: J }),
419
+ indicator: /* @__PURE__ */ e(x, { "aria-hidden": !0, children: /* @__PURE__ */ e(Se, { tone: ne ? "danger" : M ? "success" : "neutral", label: oe }) }),
420
+ subItems: ae ? T.children.map(A) : void 0,
421
+ children: /* @__PURE__ */ e(
515
422
  "button",
516
423
  {
517
424
  type: "button",
518
- "aria-label": `${q}, ${ie}`,
519
- onClick: () => v(T.path),
520
- children: q
425
+ "aria-label": `${J}, ${oe}`,
426
+ onClick: () => C(T.path),
427
+ children: J
521
428
  }
522
429
  )
523
430
  },
524
431
  T.path
525
432
  );
526
- }, I = m ? W(b, m)?.at(-1) ?? { ...G(m), accessor: m } : null, N = I ? le(I.path) : null;
527
- return /* @__PURE__ */ s(Z, { storageKey: "importhub.mappingEditor.fields", children: [
528
- /* @__PURE__ */ t(Z.Nav, { "aria-label": e("editor.tree.label"), children: /* @__PURE__ */ s(Q, { children: [
529
- f.isLoading ? /* @__PURE__ */ t(g, { px: "3", color: "fg.muted", children: e("startPage.loading") }) : null,
530
- b.map(J),
531
- u.length > 0 ? /* @__PURE__ */ t(Q.Group, { label: e("editor.tree.outside"), children: u.map((T) => J({ ...G(T.path), accessor: T.path })) }) : null
433
+ }, y = p ? pe(u, p)?.at(-1) ?? { ...ee(p), accessor: p } : null, S = y ? K(y.path) : null;
434
+ return /* @__PURE__ */ a(Z, { storageKey: "importhub.mappingEditor.fields", children: [
435
+ /* @__PURE__ */ e(Z.Nav, { "aria-label": t("editor.tree.label"), children: /* @__PURE__ */ a(Q, { children: [
436
+ g.isLoading ? /* @__PURE__ */ e(h, { px: "3", color: "fg.muted", children: t("startPage.loading") }) : null,
437
+ u.map(A),
438
+ c.length > 0 ? /* @__PURE__ */ e(Q.Group, { label: t("editor.tree.outside"), children: c.map((T) => A({ ...ee(T.path), accessor: T.path })) }) : null
532
439
  ] }) }),
533
- /* @__PURE__ */ t(Z.Detail, { children: /* @__PURE__ */ t(x, { px: "8", py: "6", children: /* @__PURE__ */ s(h, { gap: "4", children: [
534
- o,
535
- f.available ? null : /* @__PURE__ */ t(K, { status: "info", colorPalette: "info", children: e("editor.tree.noLookup") }),
536
- f.isError ? /* @__PURE__ */ t(K, { status: "error", colorPalette: "danger", children: e("editor.tree.loadFailed") }) : null,
537
- I ? /* @__PURE__ */ s(P, { children: [
538
- /* @__PURE__ */ s(ee, { gap: "3", align: "baseline", wrap: "wrap", children: [
539
- /* @__PURE__ */ t(Ie, { size: "md", children: I.label || I.accessor }),
540
- /* @__PURE__ */ t($e, { children: I.path }),
541
- I.fieldType ? /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: I.fieldType }) : null
440
+ /* @__PURE__ */ e(Z.Detail, { children: /* @__PURE__ */ e(x, { px: "8", py: "6", children: /* @__PURE__ */ a(b, { gap: "4", children: [
441
+ i,
442
+ g.available ? null : /* @__PURE__ */ e($, { status: "info", colorPalette: "info", children: t("editor.tree.noLookup") }),
443
+ g.isError ? /* @__PURE__ */ e($, { status: "error", colorPalette: "danger", children: t("editor.tree.loadFailed") }) : null,
444
+ y ? /* @__PURE__ */ a(z, { children: [
445
+ /* @__PURE__ */ a(R, { gap: "3", align: "baseline", wrap: "wrap", children: [
446
+ /* @__PURE__ */ e(Oe, { size: "md", children: y.label || y.accessor }),
447
+ /* @__PURE__ */ e(Le, { children: y.path }),
448
+ y.fieldType ? /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: y.fieldType }) : null
542
449
  ] }),
543
- N ? /* @__PURE__ */ t(O, { name: N, within: !0 }) : null,
544
- N ? /* @__PURE__ */ s(P, { children: [
545
- /* @__PURE__ */ t(y, { title: e("editor.field.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
546
- /* @__PURE__ */ t(We, { name: N, disabled: !r }, N),
547
- r ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(
548
- H,
450
+ S ? /* @__PURE__ */ e(j, { name: S, within: !0 }) : null,
451
+ S ? /* @__PURE__ */ a(z, { children: [
452
+ /* @__PURE__ */ e(v, { title: t("editor.field.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
453
+ /* @__PURE__ */ e(lt, { name: S, disabled: !n }, S),
454
+ n ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ a(
455
+ w,
549
456
  {
550
457
  variant: "outline",
551
458
  colorPalette: "red",
552
459
  size: "sm",
553
- onClick: () => a("fields", Le(c, N), {
460
+ onClick: () => s("fields", Xe(m, S), {
554
461
  shouldDirty: !0
555
462
  }),
556
463
  children: [
557
- /* @__PURE__ */ t(A, { size: 14, "aria-hidden": !0 }),
558
- e("editor.field.remove")
464
+ /* @__PURE__ */ e(_, { size: 14, "aria-hidden": !0 }),
465
+ t("editor.field.remove")
559
466
  ]
560
467
  }
561
468
  ) }) : null
562
469
  ] }) }),
563
- /* @__PURE__ */ t(
564
- _e,
470
+ /* @__PURE__ */ e(
471
+ Ye,
565
472
  {
566
- name: N,
567
- disabled: !r
473
+ name: S,
474
+ disabled: !n
568
475
  },
569
- `json:${N}`
476
+ `json:${S}`
570
477
  )
571
- ] }) : /* @__PURE__ */ t(y, { title: e("editor.field.title"), children: /* @__PURE__ */ s(h, { gap: "3", children: [
572
- /* @__PURE__ */ t(g, { color: "fg.muted", children: e("editor.field.notMapped") }),
573
- r ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(
574
- H,
478
+ ] }) : /* @__PURE__ */ e(v, { title: t("editor.field.title"), children: /* @__PURE__ */ a(b, { gap: "3", children: [
479
+ /* @__PURE__ */ e(h, { color: "fg.muted", children: t("editor.field.notMapped") }),
480
+ n ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ a(
481
+ w,
575
482
  {
576
483
  variant: "outline",
577
484
  size: "sm",
578
- onClick: () => a("fields", Ae(c, b, I.path).fields, {
485
+ onClick: () => s("fields", Ue(m, u, y.path).fields, {
579
486
  shouldDirty: !0
580
487
  }),
581
488
  children: [
582
- /* @__PURE__ */ t(z, { size: 14, "aria-hidden": !0 }),
583
- e("editor.field.map")
489
+ /* @__PURE__ */ e(D, { size: 14, "aria-hidden": !0 }),
490
+ t("editor.field.map")
584
491
  ]
585
492
  }
586
493
  ) }) : null
587
494
  ] }) })
588
- ] }) : /* @__PURE__ */ t(g, { color: "fg.muted", children: e("editor.tree.selectField") })
495
+ ] }) : /* @__PURE__ */ e(h, { color: "fg.muted", children: t("editor.tree.selectField") })
589
496
  ] }) }) })
590
497
  ] });
591
498
  }
592
- const Ye = [
499
+ const he = 25;
500
+ function nt({
501
+ client: i,
502
+ notices: t
503
+ }) {
504
+ const { t: l } = E(I), { workspaceId: n } = Ce(), { mapping: r, canConfigure: o } = O(), { getValues: s } = k(), [m, d] = N(null), [g, u] = N(null), [c, p] = N(""), C = He(), L = Fe({
505
+ queryKey: Te.entitySets(n),
506
+ queryFn: () => i.listEntitySets(),
507
+ enabled: o
508
+ }), P = Je({
509
+ mutationFn: async ({ sample: y, content: S }) => ({
510
+ content: S,
511
+ result: await i.runMappingTest({
512
+ content: S,
513
+ sample: new Uint8Array(await y.arrayBuffer()),
514
+ entitySetId: c
515
+ })
516
+ })
517
+ }), K = (y) => {
518
+ const S = y[0];
519
+ if (S) {
520
+ if (!/\.xml$/i.test(S.name) && !/xml/.test(S.type)) {
521
+ u(S.name);
522
+ return;
523
+ }
524
+ u(null), d(S);
525
+ }
526
+ }, A = [
527
+ { id: "", label: l("editor.test.noEntitySet") },
528
+ ...(L.data ?? []).map((y) => ({ id: y.id, label: y.content.name }))
529
+ ];
530
+ return /* @__PURE__ */ e(x, { px: "8", py: "6", children: /* @__PURE__ */ a(b, { gap: "4", children: [
531
+ t,
532
+ /* @__PURE__ */ e($, { status: "info", colorPalette: "info", title: l("editor.test.title"), children: /* @__PURE__ */ a(b, { gap: "1", children: [
533
+ /* @__PURE__ */ e(h, { children: l("editor.test.about") }),
534
+ /* @__PURE__ */ e(h, { children: l("editor.test.aboutDerived") })
535
+ ] }) }),
536
+ o ? /* @__PURE__ */ e(v, { title: l("editor.test.sampleCard"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
537
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: l("editor.test.sampleHelp") }),
538
+ /* @__PURE__ */ e(
539
+ Ae,
540
+ {
541
+ onFiles: K,
542
+ accept: ".xml,text/xml,application/xml",
543
+ disabled: P.isPending,
544
+ dropHintText: l("editor.test.dropHint"),
545
+ dragActiveText: l("editor.test.dragActive"),
546
+ buttonLabel: l("editor.test.chooseFile")
547
+ }
548
+ ),
549
+ g ? /* @__PURE__ */ e($, { status: "error", colorPalette: "danger", children: l("editor.test.notXml", { name: g }) }) : null,
550
+ m ? /* @__PURE__ */ a(R, { gap: "2", children: [
551
+ /* @__PURE__ */ e(Be, { size: 16, "aria-hidden": !0 }),
552
+ /* @__PURE__ */ e(h, { color: "fg.muted", children: l("editor.test.chosen") }),
553
+ /* @__PURE__ */ e(h, { fontWeight: "medium", children: m.name })
554
+ ] }) : null,
555
+ /* @__PURE__ */ a(b, { gap: "1", children: [
556
+ /* @__PURE__ */ e(h, { id: C, fontWeight: "medium", fontSize: "sm", children: l("editor.test.entitySet") }),
557
+ /* @__PURE__ */ e(
558
+ ke,
559
+ {
560
+ "aria-labelledby": C,
561
+ options: A,
562
+ value: A.find((y) => y.id === c) ?? null,
563
+ onChange: (y) => p(y && !Array.isArray(y) ? y.id : ""),
564
+ isClearable: !1,
565
+ loading: L.isLoading
566
+ }
567
+ ),
568
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: l("editor.test.entitySetHelp") })
569
+ ] }),
570
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ a(
571
+ w,
572
+ {
573
+ type: "button",
574
+ variant: "outline",
575
+ disabled: !m,
576
+ loading: P.isPending,
577
+ onClick: () => m && P.mutate({
578
+ sample: m,
579
+ // As Save would send it: a blank setting the draft left
580
+ // unset stays unset, so the test reads what a save would
581
+ // store.
582
+ content: we(s(), r.content)
583
+ }),
584
+ children: [
585
+ /* @__PURE__ */ e(Ke, { size: 14, "aria-hidden": !0 }),
586
+ l("editor.test.run")
587
+ ]
588
+ }
589
+ ) })
590
+ ] }) }) : /* @__PURE__ */ e(h, { color: "fg.muted", children: l("editor.test.adminOnly") }),
591
+ P.isError ? /* @__PURE__ */ e($, { status: "error", colorPalette: "danger", title: l("editor.test.failed"), children: P.error.message }) : null,
592
+ P.data && !P.isPending ? /* @__PURE__ */ e(ot, { result: P.data.result, content: P.data.content }) : null
593
+ ] }) });
594
+ }
595
+ function ot({ result: i, content: t }) {
596
+ const { t: l } = E(I), n = U(() => Pe(t.fields ?? []), [t]), [r, o] = N(!1), [s, m] = N(he), d = i.elements.filter((u) => u.problems.length > 0), g = r ? d : i.elements;
597
+ return i.elements.length === 0 ? /* @__PURE__ */ e($, { status: "warning", colorPalette: "warning", children: l("editor.test.noElements") }) : /* @__PURE__ */ a(b, { gap: "4", children: [
598
+ /* @__PURE__ */ a(R, { gap: "4", justify: "space-between", wrap: "wrap", children: [
599
+ /* @__PURE__ */ e(h, { role: "status", children: l("editor.test.summary", {
600
+ count: i.elements.length,
601
+ problems: d.length
602
+ }) }),
603
+ /* @__PURE__ */ e(
604
+ De,
605
+ {
606
+ checked: r,
607
+ onCheckedChange: (u) => o(u.checked === !0),
608
+ children: l("editor.test.onlyProblems")
609
+ }
610
+ )
611
+ ] }),
612
+ g.slice(0, s).map((u) => /* @__PURE__ */ e(st, { element: u, fieldsets: n }, u.position)),
613
+ g.length > s ? /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ a(b, { gap: "2", align: "center", children: [
614
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: l("editor.test.shownOf", { shown: s, total: g.length }) }),
615
+ /* @__PURE__ */ e(w, { type: "button", variant: "outline", onClick: () => m(s + he), children: l("editor.test.showMore") })
616
+ ] }) }) : null
617
+ ] });
618
+ }
619
+ function Pe(i, t = "") {
620
+ const l = /* @__PURE__ */ new Set();
621
+ for (const n of i) {
622
+ if (n.type !== "fieldset" || typeof n.name != "string") continue;
623
+ const r = t ? `${t}.${n.name}` : n.name;
624
+ l.add(r);
625
+ const o = Array.isArray(n.fields) ? n.fields : [];
626
+ for (const s of Pe(o, r)) l.add(s);
627
+ }
628
+ return l;
629
+ }
630
+ function at(i, t) {
631
+ const l = [], n = (r, o) => {
632
+ for (const [s, m] of Object.entries(r)) {
633
+ const d = o ? `${o}.${s}` : s;
634
+ t.has(d) && m !== null && typeof m == "object" && !Array.isArray(m) ? n(m, d) : l.push({ field: d, value: m, problems: [] });
635
+ }
636
+ };
637
+ n(i.values, "");
638
+ for (const r of i.problems) {
639
+ if (!r.field) continue;
640
+ const o = l.find((s) => s.field === r.field);
641
+ o ? o.problems.push(r.reason) : l.push({ field: r.field, problems: [r.reason] });
642
+ }
643
+ return l;
644
+ }
645
+ const fe = (i) => i === void 0 ? "" : typeof i == "string" ? i : JSON.stringify(i);
646
+ function st({
647
+ element: i,
648
+ fieldsets: t
649
+ }) {
650
+ const { t: l } = E(I), n = l("editor.test.element", {
651
+ position: i.position,
652
+ sourceKey: i.sourceKey || l("editor.test.noSourceKey")
653
+ }), r = [...new Set(i.problems.filter((d) => !d.field).map((d) => d.reason))], o = U(() => at(i, t), [i, t]), s = U(
654
+ () => [
655
+ {
656
+ id: "field",
657
+ header: l("editor.test.field"),
658
+ size: 200,
659
+ cell: (d) => /* @__PURE__ */ e(Me, { value: d.row.original.field })
660
+ },
661
+ {
662
+ id: "value",
663
+ header: l("editor.test.value"),
664
+ minSize: 240,
665
+ cell: (d) => /* @__PURE__ */ e(se, { value: fe(d.row.original.value), maxLength: 160 })
666
+ },
667
+ {
668
+ id: "problem",
669
+ header: l("editor.test.problem"),
670
+ size: 260,
671
+ cell: (d) => d.row.original.problems.length > 0 ? /* @__PURE__ */ e(se, { value: d.row.original.problems.join("; ") }) : null
672
+ }
673
+ ],
674
+ [l]
675
+ ), m = Object.entries(i.releaseSpec);
676
+ return /* @__PURE__ */ e(
677
+ v,
678
+ {
679
+ role: "region",
680
+ "aria-label": n,
681
+ header: /* @__PURE__ */ a(R, { gap: "3", justify: "space-between", wrap: "wrap", children: [
682
+ /* @__PURE__ */ e(h, { fontWeight: "semibold", children: n }),
683
+ i.problems.length > 0 ? /* @__PURE__ */ e(
684
+ Se,
685
+ {
686
+ tone: "danger",
687
+ label: l("editor.test.problemCount", { count: i.problems.length })
688
+ }
689
+ ) : null
690
+ ] }),
691
+ children: /* @__PURE__ */ a(b, { gap: "3", children: [
692
+ r.map((d) => /* @__PURE__ */ e(
693
+ $,
694
+ {
695
+ status: "error",
696
+ colorPalette: "danger",
697
+ title: l("editor.test.wholeElement"),
698
+ children: d
699
+ },
700
+ d
701
+ )),
702
+ i.firstDay || i.lastDay ? /* @__PURE__ */ e(W, { label: l("editor.test.validityPeriod"), children: l("editor.test.validFromTo", {
703
+ from: i.firstDay || l("editor.test.open"),
704
+ to: i.lastDay || l("editor.test.open")
705
+ }) }) : null,
706
+ i.displayName ? /* @__PURE__ */ e(W, { label: l("editor.test.displayName"), children: i.displayName }) : null,
707
+ i.collections.length > 0 ? /* @__PURE__ */ e(W, { label: l("editor.test.collections"), children: i.collections.join(", ") }) : null,
708
+ m.length > 0 ? /* @__PURE__ */ e(W, { label: l("editor.test.releaseSpec"), children: m.map(([d, g]) => `${d}: ${fe(g)}`).join(", ") }) : null,
709
+ o.length > 0 ? /* @__PURE__ */ e(Re, { columns: s, data: o, getRowId: (d) => d.field }) : null
710
+ ] })
711
+ }
712
+ );
713
+ }
714
+ const dt = [
593
715
  ["TITLE_INTENT_UNSPECIFIED", "none"],
594
716
  ["TITLE_INTENT_EXCLUDE", "exclude"],
595
717
  ["TITLE_INTENT_REPLACE", "replace"],
596
718
  ["TITLE_INTENT_ANNOTATE", "annotate"]
597
719
  ];
598
- function Je({ notices: o }) {
599
- const { t: e } = $(F), { canConfigure: l } = D(), r = !l, { control: i } = R(), n = w({ control: i, name: "titleContributions" }), a = w({ control: i, name: "placeholderAssets" });
600
- return /* @__PURE__ */ t(x, { px: "8", py: "6", children: /* @__PURE__ */ s(h, { gap: "4", children: [
601
- o,
602
- /* @__PURE__ */ t(y, { title: e("editor.stub.title"), children: /* @__PURE__ */ t(
603
- C,
720
+ function ct({ notices: i }) {
721
+ const { t } = E(I), { mapping: l, canConfigure: n } = O(), r = !n, { control: o } = k(), s = ie(l.content.blueprintReleaseId).release, m = re(B({ control: o, name: "fields" })).map((c) => c.path), d = s ? qe(s.fields).filter((c) => !m.includes(c.path)).map((c) => ({ id: c.path, label: c.label || c.path })) : void 0, g = q({ control: o, name: "titleContributions" }), u = q({ control: o, name: "placeholderAssets" });
722
+ return /* @__PURE__ */ e(x, { px: "8", py: "6", children: /* @__PURE__ */ a(b, { gap: "4", children: [
723
+ i,
724
+ /* @__PURE__ */ e(v, { title: t("editor.stub.title"), children: /* @__PURE__ */ e(
725
+ H,
604
726
  {
605
727
  name: "stub",
606
- label: e("editor.stub.label"),
607
- helperText: e("editor.stub.help"),
728
+ label: t("editor.stub.label"),
729
+ helperText: t("editor.stub.help"),
608
730
  disabled: r
609
731
  }
610
732
  ) }),
611
- /* @__PURE__ */ t(y, { title: e("editor.naming.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
612
- /* @__PURE__ */ t(
613
- p,
614
- {
615
- name: "displayNameTemplate",
616
- label: e("editor.naming.displayNameTemplate"),
617
- helperText: e("editor.naming.displayNameTemplateHelp"),
618
- disabled: r
619
- }
620
- ),
621
- /* @__PURE__ */ t(
622
- S,
733
+ /* @__PURE__ */ e(v, { title: t("editor.naming.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
734
+ /* @__PURE__ */ a(le, { templateColumns: { base: "1fr", md: "2fr 1fr" }, gap: "4", alignItems: "start", children: [
735
+ /* @__PURE__ */ e(
736
+ f,
737
+ {
738
+ name: "displayNameTemplate",
739
+ label: t("editor.naming.displayNameTemplate"),
740
+ helperText: t("editor.naming.displayNameTemplateHelp"),
741
+ disabled: r
742
+ }
743
+ ),
744
+ d ? /* @__PURE__ */ e(
745
+ V,
746
+ {
747
+ name: "displayNameField",
748
+ label: t("editor.naming.displayNameField"),
749
+ helperText: t("editor.naming.displayNameFieldHelp"),
750
+ placeholder: t("editor.naming.displayNameFieldNone"),
751
+ options: d,
752
+ disabled: r
753
+ }
754
+ ) : /* @__PURE__ */ e(
755
+ f,
756
+ {
757
+ name: "displayNameField",
758
+ label: t("editor.naming.displayNameField"),
759
+ helperText: t("editor.naming.displayNameFieldPathHelp"),
760
+ disabled: r
761
+ }
762
+ )
763
+ ] }),
764
+ /* @__PURE__ */ e(
765
+ F,
623
766
  {
624
767
  name: "collections",
625
- label: e("editor.naming.collections"),
626
- helperText: e("editor.naming.collectionsHelp"),
768
+ label: t("editor.naming.collections"),
769
+ helperText: t("editor.naming.collectionsHelp"),
627
770
  disabled: r
628
771
  }
629
772
  )
630
773
  ] }) }),
631
- /* @__PURE__ */ t(y, { title: e("editor.routing.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
632
- /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: e("editor.routing.help") }),
633
- /* @__PURE__ */ t(
634
- p,
774
+ /* @__PURE__ */ e(v, { title: t("editor.routing.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
775
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: t("editor.routing.help") }),
776
+ /* @__PURE__ */ e(
777
+ f,
635
778
  {
636
779
  name: "collectionRouting.selector",
637
- label: e("editor.routing.selector"),
780
+ label: t("editor.routing.selector"),
638
781
  disabled: r
639
782
  }
640
783
  ),
641
- /* @__PURE__ */ t(
642
- S,
784
+ /* @__PURE__ */ e(
785
+ F,
643
786
  {
644
787
  name: "collectionRouting.collectionMap",
645
788
  kind: "map",
646
- label: e("editor.routing.collectionMap"),
647
- helperText: e("editor.routing.collectionMapHelp"),
789
+ label: t("editor.routing.collectionMap"),
790
+ helperText: t("editor.routing.collectionMapHelp"),
648
791
  disabled: r
649
792
  }
650
793
  ),
651
- /* @__PURE__ */ t(
652
- p,
794
+ /* @__PURE__ */ e(
795
+ f,
653
796
  {
654
797
  name: "collectionRouting.idPattern",
655
- label: e("editor.routing.idPattern"),
798
+ label: t("editor.routing.idPattern"),
656
799
  disabled: r
657
800
  }
658
801
  ),
659
- /* @__PURE__ */ t(
660
- p,
802
+ /* @__PURE__ */ e(
803
+ f,
661
804
  {
662
805
  name: "collectionRouting.collectionTemplate",
663
- label: e("editor.routing.collectionTemplate"),
664
- helperText: e("editor.routing.collectionTemplateHelp"),
806
+ label: t("editor.routing.collectionTemplate"),
807
+ helperText: t("editor.routing.collectionTemplateHelp"),
665
808
  disabled: r
666
809
  }
667
810
  ),
668
- /* @__PURE__ */ t(
669
- p,
811
+ /* @__PURE__ */ e(
812
+ f,
670
813
  {
671
814
  name: "collectionRouting.suffix",
672
- label: e("editor.routing.suffix"),
815
+ label: t("editor.routing.suffix"),
673
816
  disabled: r
674
817
  }
675
818
  ),
676
- /* @__PURE__ */ t(
677
- p,
819
+ /* @__PURE__ */ e(
820
+ f,
678
821
  {
679
822
  name: "collectionRouting.fallback",
680
- label: e("editor.routing.fallback"),
823
+ label: t("editor.routing.fallback"),
681
824
  disabled: r
682
825
  }
683
826
  )
684
827
  ] }) }),
685
- /* @__PURE__ */ t(y, { title: e("editor.titles.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
686
- /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: e("editor.titles.help") }),
687
- n.fields.length === 0 ? /* @__PURE__ */ t(g, { color: "fg.muted", children: e("editor.titles.none") }) : null,
688
- n.fields.map((c, d) => /* @__PURE__ */ s(
689
- h,
828
+ /* @__PURE__ */ e(v, { title: t("editor.titles.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
829
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: t("editor.titles.help") }),
830
+ g.fields.length === 0 ? /* @__PURE__ */ e(h, { color: "fg.muted", children: t("editor.titles.none") }) : null,
831
+ g.fields.map((c, p) => /* @__PURE__ */ a(
832
+ b,
690
833
  {
691
834
  gap: "4",
692
835
  role: "group",
693
- "aria-label": e("editor.titles.item", { index: d + 1 }),
836
+ "aria-label": t("editor.titles.item", { index: p + 1 }),
694
837
  children: [
695
- d > 0 ? /* @__PURE__ */ t(ae, {}) : null,
696
- /* @__PURE__ */ s(ee, { justify: "space-between", children: [
697
- /* @__PURE__ */ t(g, { fontWeight: "medium", children: e("editor.titles.item", { index: d + 1 }) }),
698
- l ? /* @__PURE__ */ t(
699
- B,
838
+ p > 0 ? /* @__PURE__ */ e(ce, {}) : null,
839
+ /* @__PURE__ */ a(R, { justify: "space-between", children: [
840
+ /* @__PURE__ */ e(h, { fontWeight: "medium", children: t("editor.titles.item", { index: p + 1 }) }),
841
+ n ? /* @__PURE__ */ e(
842
+ X,
700
843
  {
701
- "aria-label": e("editor.titles.remove", { index: d + 1 }),
844
+ "aria-label": t("editor.titles.remove", { index: p + 1 }),
702
845
  variant: "ghost",
703
846
  colorPalette: "red",
704
- onClick: () => n.remove(d),
705
- children: /* @__PURE__ */ t(A, { size: 16 })
847
+ onClick: () => g.remove(p),
848
+ children: /* @__PURE__ */ e(_, { size: 16 })
706
849
  }
707
850
  ) : null
708
851
  ] }),
709
- /* @__PURE__ */ t(O, { name: `titleContributions.${d}` }),
710
- /* @__PURE__ */ t(qe, { index: d, disabled: r })
852
+ /* @__PURE__ */ e(j, { name: `titleContributions.${p}` }),
853
+ /* @__PURE__ */ e(pt, { index: p, disabled: r })
711
854
  ]
712
855
  },
713
856
  c.id
714
857
  )),
715
- l ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(
716
- H,
858
+ n ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ a(
859
+ w,
717
860
  {
718
861
  variant: "outline",
719
862
  size: "sm",
720
- onClick: () => n.append({ selector: "", ausgabeCodeSelector: "" }),
863
+ onClick: () => g.append({ selector: "", ausgabeCodeSelector: "" }),
721
864
  children: [
722
- /* @__PURE__ */ t(z, { size: 14, "aria-hidden": !0 }),
723
- e("editor.titles.add")
865
+ /* @__PURE__ */ e(D, { size: 14, "aria-hidden": !0 }),
866
+ t("editor.titles.add")
724
867
  ]
725
868
  }
726
869
  ) }) : null
727
870
  ] }) }),
728
- /* @__PURE__ */ t(y, { title: e("editor.assets.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
729
- /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: e("editor.assets.help") }),
730
- a.fields.length === 0 ? /* @__PURE__ */ t(g, { color: "fg.muted", children: e("editor.assets.none") }) : null,
731
- a.fields.map((c, d) => /* @__PURE__ */ s(
732
- h,
871
+ /* @__PURE__ */ e(v, { title: t("editor.assets.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
872
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: t("editor.assets.help") }),
873
+ u.fields.length === 0 ? /* @__PURE__ */ e(h, { color: "fg.muted", children: t("editor.assets.none") }) : null,
874
+ u.fields.map((c, p) => /* @__PURE__ */ a(
875
+ b,
733
876
  {
734
877
  gap: "4",
735
878
  role: "group",
736
- "aria-label": e("editor.assets.item", { index: d + 1 }),
879
+ "aria-label": t("editor.assets.item", { index: p + 1 }),
737
880
  children: [
738
- d > 0 ? /* @__PURE__ */ t(ae, {}) : null,
739
- /* @__PURE__ */ s(ee, { justify: "space-between", children: [
740
- /* @__PURE__ */ t(g, { fontWeight: "medium", children: e("editor.assets.item", { index: d + 1 }) }),
741
- l ? /* @__PURE__ */ t(
742
- B,
881
+ p > 0 ? /* @__PURE__ */ e(ce, {}) : null,
882
+ /* @__PURE__ */ a(R, { justify: "space-between", children: [
883
+ /* @__PURE__ */ e(h, { fontWeight: "medium", children: t("editor.assets.item", { index: p + 1 }) }),
884
+ n ? /* @__PURE__ */ e(
885
+ X,
743
886
  {
744
- "aria-label": e("editor.assets.remove", { index: d + 1 }),
887
+ "aria-label": t("editor.assets.remove", { index: p + 1 }),
745
888
  variant: "ghost",
746
889
  colorPalette: "red",
747
- onClick: () => a.remove(d),
748
- children: /* @__PURE__ */ t(A, { size: 16 })
890
+ onClick: () => u.remove(p),
891
+ children: /* @__PURE__ */ e(_, { size: 16 })
749
892
  }
750
893
  ) : null
751
894
  ] }),
752
- /* @__PURE__ */ t(O, { name: `placeholderAssets.${d}` }),
753
- /* @__PURE__ */ t(Xe, { index: d, disabled: r })
895
+ /* @__PURE__ */ e(j, { name: `placeholderAssets.${p}` }),
896
+ /* @__PURE__ */ e(mt, { index: p, disabled: r })
754
897
  ]
755
898
  },
756
899
  c.id
757
900
  )),
758
- l ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(
759
- H,
901
+ n ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ a(
902
+ w,
760
903
  {
761
904
  variant: "outline",
762
905
  size: "sm",
763
- onClick: () => a.append({ selector: "", assetType: "", keyParts: [] }),
906
+ onClick: () => u.append({ selector: "", assetType: "", keyParts: [] }),
764
907
  children: [
765
- /* @__PURE__ */ t(z, { size: 14, "aria-hidden": !0 }),
766
- e("editor.assets.add")
908
+ /* @__PURE__ */ e(D, { size: 14, "aria-hidden": !0 }),
909
+ t("editor.assets.add")
767
910
  ]
768
911
  }
769
912
  ) }) : null
770
913
  ] }) })
771
914
  ] }) });
772
915
  }
773
- function qe({ index: o, disabled: e }) {
774
- const { t: l } = $(F), { control: r } = R(), i = `titleContributions.${o}`, n = w({ control: r, name: `${i}.referenceSpecValues` });
775
- return /* @__PURE__ */ s(h, { gap: "4", children: [
776
- /* @__PURE__ */ t(
777
- p,
916
+ function pt({ index: i, disabled: t }) {
917
+ const { t: l } = E(I), { control: n } = k(), r = `titleContributions.${i}`, o = q({ control: n, name: `${r}.referenceSpecValues` });
918
+ return /* @__PURE__ */ a(b, { gap: "4", children: [
919
+ /* @__PURE__ */ e(
920
+ f,
778
921
  {
779
- name: `${i}.selector`,
922
+ name: `${r}.selector`,
780
923
  label: l("editor.titles.selector"),
781
924
  helperText: l("editor.titles.selectorHelp"),
782
- disabled: e
925
+ disabled: t
783
926
  }
784
927
  ),
785
- /* @__PURE__ */ t(
786
- p,
928
+ /* @__PURE__ */ e(
929
+ f,
787
930
  {
788
- name: `${i}.ausgabeCodeSelector`,
931
+ name: `${r}.ausgabeCodeSelector`,
789
932
  label: l("editor.titles.ausgabeCodeSelector"),
790
- disabled: e
933
+ disabled: t
791
934
  }
792
935
  ),
793
- /* @__PURE__ */ s(h, { gap: "3", role: "group", "aria-label": l("editor.titles.referenceSpecValues"), children: [
794
- /* @__PURE__ */ t(g, { fontWeight: "medium", children: l("editor.titles.referenceSpecValues") }),
795
- n.fields.map((a, c) => /* @__PURE__ */ s(he, { templateColumns: "1fr 1fr auto", gap: "3", alignItems: "end", children: [
796
- /* @__PURE__ */ t(
797
- p,
936
+ /* @__PURE__ */ a(b, { gap: "3", role: "group", "aria-label": l("editor.titles.referenceSpecValues"), children: [
937
+ /* @__PURE__ */ e(h, { fontWeight: "medium", children: l("editor.titles.referenceSpecValues") }),
938
+ o.fields.map((s, m) => /* @__PURE__ */ a(le, { templateColumns: "1fr 1fr auto", gap: "3", alignItems: "end", children: [
939
+ /* @__PURE__ */ e(
940
+ f,
798
941
  {
799
- name: `${i}.referenceSpecValues.${c}.field`,
800
- label: l("editor.titles.valueField", { index: c + 1 }),
801
- disabled: e
942
+ name: `${r}.referenceSpecValues.${m}.field`,
943
+ label: l("editor.titles.valueField", { index: m + 1 }),
944
+ disabled: t
802
945
  }
803
946
  ),
804
- /* @__PURE__ */ t(
805
- p,
947
+ /* @__PURE__ */ e(
948
+ f,
806
949
  {
807
- name: `${i}.referenceSpecValues.${c}.selector`,
808
- label: l("editor.titles.valueSelector", { index: c + 1 }),
809
- disabled: e
950
+ name: `${r}.referenceSpecValues.${m}.selector`,
951
+ label: l("editor.titles.valueSelector", { index: m + 1 }),
952
+ disabled: t
810
953
  }
811
954
  ),
812
- e ? /* @__PURE__ */ t("span", {}) : /* @__PURE__ */ t(
813
- B,
955
+ t ? /* @__PURE__ */ e("span", {}) : /* @__PURE__ */ e(
956
+ X,
814
957
  {
815
- "aria-label": l("editor.titles.removeValue", { index: c + 1 }),
958
+ "aria-label": l("editor.titles.removeValue", { index: m + 1 }),
816
959
  variant: "ghost",
817
960
  colorPalette: "red",
818
- onClick: () => n.remove(c),
819
- children: /* @__PURE__ */ t(A, { size: 16 })
961
+ onClick: () => o.remove(m),
962
+ children: /* @__PURE__ */ e(_, { size: 16 })
820
963
  }
821
964
  )
822
- ] }, a.id)),
823
- e ? null : /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(
824
- H,
965
+ ] }, s.id)),
966
+ t ? null : /* @__PURE__ */ e(x, { children: /* @__PURE__ */ a(
967
+ w,
825
968
  {
826
969
  variant: "outline",
827
970
  size: "sm",
828
- onClick: () => n.append({ field: "", selector: "" }),
971
+ onClick: () => o.append({ field: "", selector: "" }),
829
972
  children: [
830
- /* @__PURE__ */ t(z, { size: 14, "aria-hidden": !0 }),
973
+ /* @__PURE__ */ e(D, { size: 14, "aria-hidden": !0 }),
831
974
  l("editor.titles.addValue")
832
975
  ]
833
976
  }
834
977
  ) })
835
978
  ] }),
836
- /* @__PURE__ */ t(
837
- p,
979
+ /* @__PURE__ */ e(
980
+ f,
838
981
  {
839
- name: `${i}.referenceFilterSelector`,
982
+ name: `${r}.referenceFilterSelector`,
840
983
  label: l("editor.titles.referenceFilterSelector"),
841
- disabled: e
984
+ disabled: t
842
985
  }
843
986
  ),
844
- /* @__PURE__ */ t(
845
- j,
987
+ /* @__PURE__ */ e(
988
+ V,
846
989
  {
847
- name: `${i}.intent`,
990
+ name: `${r}.intent`,
848
991
  label: l("editor.titles.intent"),
849
992
  placeholder: l("editor.titles.intents.none"),
850
- disabled: e,
851
- options: Ye.map(([a, c]) => ({ id: a, label: l(`editor.titles.intents.${c}`) }))
993
+ disabled: t,
994
+ options: dt.map(([s, m]) => ({ id: s, label: l(`editor.titles.intents.${m}`) }))
852
995
  }
853
996
  ),
854
- /* @__PURE__ */ t(
855
- p,
997
+ /* @__PURE__ */ e(
998
+ f,
856
999
  {
857
- name: `${i}.intentTextSelector`,
1000
+ name: `${r}.intentTextSelector`,
858
1001
  label: l("editor.titles.intentTextSelector"),
859
1002
  helperText: l("editor.titles.intentTextSelectorHelp"),
860
- disabled: e
1003
+ disabled: t
861
1004
  }
862
1005
  )
863
1006
  ] });
864
1007
  }
865
- function Xe({ index: o, disabled: e }) {
866
- const { t: l } = $(F), r = `placeholderAssets.${o}`;
867
- return /* @__PURE__ */ s(h, { gap: "4", children: [
868
- /* @__PURE__ */ t(
869
- p,
1008
+ function mt({ index: i, disabled: t }) {
1009
+ const { t: l } = E(I), n = `placeholderAssets.${i}`;
1010
+ return /* @__PURE__ */ a(b, { gap: "4", children: [
1011
+ /* @__PURE__ */ e(
1012
+ f,
870
1013
  {
871
- name: `${r}.selector`,
1014
+ name: `${n}.selector`,
872
1015
  label: l("editor.assets.selector"),
873
1016
  helperText: l("editor.assets.selectorHelp"),
874
- disabled: e
1017
+ disabled: t
875
1018
  }
876
1019
  ),
877
- /* @__PURE__ */ t(
878
- p,
1020
+ /* @__PURE__ */ e(
1021
+ f,
879
1022
  {
880
- name: `${r}.assetType`,
1023
+ name: `${n}.assetType`,
881
1024
  label: l("editor.assets.assetType"),
882
- disabled: e
1025
+ disabled: t
883
1026
  }
884
1027
  ),
885
- /* @__PURE__ */ t(
886
- S,
1028
+ /* @__PURE__ */ e(
1029
+ F,
887
1030
  {
888
- name: `${r}.keyParts`,
1031
+ name: `${n}.keyParts`,
889
1032
  label: l("editor.assets.keyParts"),
890
1033
  helperText: l("editor.assets.keyPartsHelp"),
891
- disabled: e
1034
+ disabled: t
892
1035
  }
893
1036
  ),
894
- /* @__PURE__ */ t(
895
- p,
1037
+ /* @__PURE__ */ e(
1038
+ f,
896
1039
  {
897
- name: `${r}.nameSelector`,
1040
+ name: `${n}.nameSelector`,
898
1041
  label: l("editor.assets.nameSelector"),
899
- disabled: e
1042
+ disabled: t
900
1043
  }
901
1044
  ),
902
- /* @__PURE__ */ t(
903
- p,
1045
+ /* @__PURE__ */ e(
1046
+ f,
904
1047
  {
905
- name: `${r}.descriptionSelector`,
1048
+ name: `${n}.descriptionSelector`,
906
1049
  label: l("editor.assets.descriptionSelector"),
907
- disabled: e
1050
+ disabled: t
908
1051
  }
909
1052
  ),
910
- /* @__PURE__ */ t(
911
- S,
1053
+ /* @__PURE__ */ e(
1054
+ F,
912
1055
  {
913
- name: `${r}.metadata`,
1056
+ name: `${n}.metadata`,
914
1057
  kind: "map",
915
1058
  label: l("editor.assets.metadata"),
916
1059
  helperText: l("editor.assets.metadataHelp"),
917
- disabled: e
1060
+ disabled: t
918
1061
  }
919
1062
  ),
920
- /* @__PURE__ */ t(
921
- p,
1063
+ /* @__PURE__ */ e(
1064
+ f,
922
1065
  {
923
- name: `${r}.folderRoot`,
1066
+ name: `${n}.folderRoot`,
924
1067
  label: l("editor.assets.folderRoot"),
925
- disabled: e
1068
+ disabled: t
926
1069
  }
927
1070
  ),
928
- /* @__PURE__ */ t(
929
- p,
1071
+ /* @__PURE__ */ e(
1072
+ f,
930
1073
  {
931
- name: `${r}.folderPathSelector`,
1074
+ name: `${n}.folderPathSelector`,
932
1075
  label: l("editor.assets.folderPathSelector"),
933
1076
  helperText: l("editor.assets.folderPathSelectorHelp"),
934
- disabled: e
1077
+ disabled: t
935
1078
  }
936
1079
  )
937
1080
  ] });
938
1081
  }
939
- const de = {
1082
+ const ge = {
940
1083
  correct: "CHANGED_VERSION_HANDLING_CORRECT",
941
1084
  keep: "CHANGED_VERSION_HANDLING_KEEP",
942
1085
  fail: "CHANGED_VERSION_HANDLING_FAIL"
943
1086
  };
944
- function Qe({ notices: o }) {
945
- const { t: e } = $(F), { mapping: l, canConfigure: r } = D(), i = !r, { control: n } = R(), c = Te(l.content.blueprintReleaseId).release?.releaseSpecFields ?? [], d = Y(U({ control: n, name: "fields" })).map((u) => u.path), f = w({ control: n, name: "releaseSpec" }), b = c.map((u) => ({ id: u.path, label: u.label || u.path }));
946
- return /* @__PURE__ */ t(x, { px: "8", py: "6", children: /* @__PURE__ */ s(h, { gap: "4", children: [
947
- o,
948
- /* @__PURE__ */ t(y, { title: e("editor.sourceKey.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
949
- /* @__PURE__ */ t(O, { name: "sourceKey" }),
950
- /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: e("editor.sourceKey.help") }),
951
- /* @__PURE__ */ t(
952
- p,
1087
+ function ut({ notices: i }) {
1088
+ const { t } = E(I), { mapping: l, canConfigure: n } = O(), r = !n, { control: o } = k(), m = ie(l.content.blueprintReleaseId).release?.releaseSpecFields ?? [], d = re(B({ control: o, name: "fields" })).map((c) => c.path), g = q({ control: o, name: "releaseSpec" }), u = m.map((c) => ({ id: c.path, label: c.label || c.path }));
1089
+ return /* @__PURE__ */ e(x, { px: "8", py: "6", children: /* @__PURE__ */ a(b, { gap: "4", children: [
1090
+ i,
1091
+ /* @__PURE__ */ e(v, { title: t("editor.sourceKey.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
1092
+ /* @__PURE__ */ e(j, { name: "sourceKey" }),
1093
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: t("editor.sourceKey.help") }),
1094
+ /* @__PURE__ */ e(
1095
+ f,
953
1096
  {
954
1097
  name: "sourceKey.extractPattern",
955
- label: e("editor.sourceKey.extractPattern"),
956
- helperText: e("editor.sourceKey.extractPatternHelp"),
957
- disabled: i
1098
+ label: t("editor.sourceKey.extractPattern"),
1099
+ helperText: t("editor.sourceKey.extractPatternHelp"),
1100
+ disabled: r
958
1101
  }
959
1102
  ),
960
- /* @__PURE__ */ t(
961
- p,
1103
+ /* @__PURE__ */ e(
1104
+ f,
962
1105
  {
963
1106
  name: "sourceKey.extractSeparator",
964
- label: e("editor.sourceKey.extractSeparator"),
965
- helperText: e("editor.sourceKey.extractSeparatorHelp"),
966
- disabled: i
1107
+ label: t("editor.sourceKey.extractSeparator"),
1108
+ helperText: t("editor.sourceKey.extractSeparatorHelp"),
1109
+ disabled: r
967
1110
  }
968
1111
  ),
969
- /* @__PURE__ */ t(
970
- C,
1112
+ /* @__PURE__ */ e(
1113
+ H,
971
1114
  {
972
1115
  name: "sourceKey.normalize",
973
- label: e("editor.sourceKey.normalize"),
974
- disabled: i
1116
+ label: t("editor.sourceKey.normalize"),
1117
+ disabled: r
975
1118
  }
976
1119
  )
977
1120
  ] }) }),
978
- /* @__PURE__ */ t(y, { title: e("editor.versionMatch.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
979
- /* @__PURE__ */ t(g, { color: "fg.muted", fontSize: "sm", children: e("editor.versionMatch.help") }),
980
- /* @__PURE__ */ t(
981
- C,
1121
+ /* @__PURE__ */ e(v, { title: t("editor.versionMatch.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
1122
+ /* @__PURE__ */ e(h, { color: "fg.muted", fontSize: "sm", children: t("editor.versionMatch.help") }),
1123
+ /* @__PURE__ */ e(
1124
+ H,
982
1125
  {
983
1126
  name: "versionMatch.validityPeriod",
984
- label: e("editor.versionMatch.validityPeriod"),
985
- disabled: i
1127
+ label: t("editor.versionMatch.validityPeriod"),
1128
+ disabled: r
986
1129
  }
987
1130
  ),
988
- /* @__PURE__ */ t(
989
- pe,
1131
+ /* @__PURE__ */ e(
1132
+ be,
990
1133
  {
991
- title: e("editor.versionMatch.releaseSpecFields"),
992
- empty: e("editor.versionMatch.noReleaseSpecFields"),
1134
+ title: t("editor.versionMatch.releaseSpecFields"),
1135
+ empty: t("editor.versionMatch.noReleaseSpecFields"),
993
1136
  name: "versionMatch.releaseSpecFields",
994
- options: c.map((u) => ({ value: u.path, label: u.label || u.path })),
995
- disabled: i
1137
+ options: m.map((c) => ({ value: c.path, label: c.label || c.path })),
1138
+ disabled: r
996
1139
  }
997
1140
  ),
998
- /* @__PURE__ */ t(
999
- pe,
1141
+ /* @__PURE__ */ e(
1142
+ be,
1000
1143
  {
1001
- title: e("editor.versionMatch.contentFields"),
1002
- empty: e("editor.versionMatch.noContentFields"),
1144
+ title: t("editor.versionMatch.contentFields"),
1145
+ empty: t("editor.versionMatch.noContentFields"),
1003
1146
  name: "versionMatch.contentFields",
1004
- options: d.map((u) => ({ value: u, label: u })),
1005
- disabled: i
1147
+ options: d.map((c) => ({ value: c, label: c })),
1148
+ disabled: r
1006
1149
  }
1007
1150
  )
1008
1151
  ] }) }),
1009
- /* @__PURE__ */ t(y, { title: e("editor.validityPeriod.title"), children: /* @__PURE__ */ s(h, { gap: "4", children: [
1010
- /* @__PURE__ */ t(
1011
- p,
1152
+ /* @__PURE__ */ e(v, { title: t("editor.validityPeriod.title"), children: /* @__PURE__ */ a(b, { gap: "4", children: [
1153
+ /* @__PURE__ */ e(
1154
+ f,
1012
1155
  {
1013
1156
  name: "validityPeriod.validFromSelector",
1014
- label: e("editor.validityPeriod.validFrom"),
1015
- disabled: i
1157
+ label: t("editor.validityPeriod.validFrom"),
1158
+ disabled: r
1016
1159
  }
1017
1160
  ),
1018
- /* @__PURE__ */ t(
1019
- p,
1161
+ /* @__PURE__ */ e(
1162
+ f,
1020
1163
  {
1021
1164
  name: "validityPeriod.validToSelector",
1022
- label: e("editor.validityPeriod.validTo"),
1023
- helperText: e("editor.validityPeriod.validToHelp"),
1024
- disabled: i
1165
+ label: t("editor.validityPeriod.validTo"),
1166
+ helperText: t("editor.validityPeriod.validToHelp"),
1167
+ disabled: r
1025
1168
  }
1026
1169
  ),
1027
- /* @__PURE__ */ t(
1028
- S,
1170
+ /* @__PURE__ */ e(
1171
+ F,
1029
1172
  {
1030
1173
  name: "validityPeriod.dateFormats",
1031
- label: e("editor.validityPeriod.dateFormats"),
1032
- helperText: e("editor.validityPeriod.dateFormatsHelp"),
1033
- disabled: i
1174
+ label: t("editor.validityPeriod.dateFormats"),
1175
+ helperText: t("editor.validityPeriod.dateFormatsHelp"),
1176
+ disabled: r
1034
1177
  }
1035
1178
  )
1036
1179
  ] }) }),
1037
- /* @__PURE__ */ t(y, { title: e("editor.releaseSpec.title"), children: /* @__PURE__ */ s(h, { gap: "3", children: [
1038
- f.fields.length === 0 ? /* @__PURE__ */ t(g, { color: "fg.muted", children: e("editor.releaseSpec.none") }) : null,
1039
- f.fields.map((u, m) => /* @__PURE__ */ s(he, { templateColumns: "1fr 1fr auto", gap: "3", alignItems: "end", children: [
1040
- b.length > 0 ? /* @__PURE__ */ t(
1041
- j,
1180
+ /* @__PURE__ */ e(v, { title: t("editor.releaseSpec.title"), children: /* @__PURE__ */ a(b, { gap: "3", children: [
1181
+ g.fields.length === 0 ? /* @__PURE__ */ e(h, { color: "fg.muted", children: t("editor.releaseSpec.none") }) : null,
1182
+ g.fields.map((c, p) => /* @__PURE__ */ a(le, { templateColumns: "1fr 1fr auto", gap: "3", alignItems: "end", children: [
1183
+ u.length > 0 ? /* @__PURE__ */ e(
1184
+ V,
1042
1185
  {
1043
- name: `releaseSpec.${m}.field`,
1044
- label: e("editor.releaseSpec.field", { index: m + 1 }),
1045
- options: b,
1046
- disabled: i
1186
+ name: `releaseSpec.${p}.field`,
1187
+ label: t("editor.releaseSpec.field", { index: p + 1 }),
1188
+ options: u,
1189
+ disabled: r
1047
1190
  }
1048
- ) : /* @__PURE__ */ t(
1049
- p,
1191
+ ) : /* @__PURE__ */ e(
1192
+ f,
1050
1193
  {
1051
- name: `releaseSpec.${m}.field`,
1052
- label: e("editor.releaseSpec.field", { index: m + 1 }),
1053
- disabled: i
1194
+ name: `releaseSpec.${p}.field`,
1195
+ label: t("editor.releaseSpec.field", { index: p + 1 }),
1196
+ disabled: r
1054
1197
  }
1055
1198
  ),
1056
- /* @__PURE__ */ t(
1057
- p,
1199
+ /* @__PURE__ */ e(
1200
+ f,
1058
1201
  {
1059
- name: `releaseSpec.${m}.selector`,
1060
- label: e("editor.releaseSpec.selector", { index: m + 1 }),
1061
- disabled: i
1202
+ name: `releaseSpec.${p}.selector`,
1203
+ label: t("editor.releaseSpec.selector", { index: p + 1 }),
1204
+ disabled: r
1062
1205
  }
1063
1206
  ),
1064
- r ? /* @__PURE__ */ t(
1065
- B,
1207
+ n ? /* @__PURE__ */ e(
1208
+ X,
1066
1209
  {
1067
- "aria-label": e("editor.releaseSpec.remove", { index: m + 1 }),
1210
+ "aria-label": t("editor.releaseSpec.remove", { index: p + 1 }),
1068
1211
  variant: "ghost",
1069
1212
  colorPalette: "red",
1070
- onClick: () => f.remove(m),
1071
- children: /* @__PURE__ */ t(A, { size: 16 })
1213
+ onClick: () => g.remove(p),
1214
+ children: /* @__PURE__ */ e(_, { size: 16 })
1072
1215
  }
1073
- ) : /* @__PURE__ */ t("span", {})
1074
- ] }, u.id)),
1075
- r ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ s(
1076
- H,
1216
+ ) : /* @__PURE__ */ e("span", {})
1217
+ ] }, c.id)),
1218
+ n ? /* @__PURE__ */ e(x, { children: /* @__PURE__ */ a(
1219
+ w,
1077
1220
  {
1078
1221
  variant: "outline",
1079
1222
  size: "sm",
1080
- onClick: () => f.append({ field: "", selector: "" }),
1223
+ onClick: () => g.append({ field: "", selector: "" }),
1081
1224
  children: [
1082
- /* @__PURE__ */ t(z, { size: 14, "aria-hidden": !0 }),
1083
- e("editor.releaseSpec.add")
1225
+ /* @__PURE__ */ e(D, { size: 14, "aria-hidden": !0 }),
1226
+ t("editor.releaseSpec.add")
1084
1227
  ]
1085
1228
  }
1086
1229
  ) }) : null
1087
1230
  ] }) }),
1088
- /* @__PURE__ */ t(y, { title: e("editor.changedVersion.title"), children: /* @__PURE__ */ t(
1089
- fe,
1231
+ /* @__PURE__ */ e(v, { title: t("editor.changedVersion.title"), children: /* @__PURE__ */ e(
1232
+ xe,
1090
1233
  {
1091
1234
  name: "changedVersion",
1092
- label: e("editor.changedVersion.label"),
1093
- helperText: e("editor.changedVersion.help"),
1094
- disabled: i,
1095
- children: (u) => /* @__PURE__ */ t(
1096
- Fe,
1235
+ label: t("editor.changedVersion.label"),
1236
+ helperText: t("editor.changedVersion.help"),
1237
+ disabled: r,
1238
+ children: (c) => /* @__PURE__ */ e(
1239
+ Ve,
1097
1240
  {
1098
- value: !u.value || u.value === "CHANGED_VERSION_HANDLING_UNSPECIFIED" ? de.correct : String(u.value),
1099
- onValueChange: (m) => u.onChange(m.value),
1100
- "aria-describedby": u["aria-describedby"],
1101
- disabled: i,
1102
- children: /* @__PURE__ */ t(h, { gap: "2", children: ["correct", "keep", "fail"].map((m) => /* @__PURE__ */ t(Ne, { value: de[m], children: e(`editor.changedVersion.${m}`) }, m)) })
1241
+ value: !c.value || c.value === "CHANGED_VERSION_HANDLING_UNSPECIFIED" ? ge.correct : String(c.value),
1242
+ onValueChange: (p) => c.onChange(p.value),
1243
+ "aria-describedby": c["aria-describedby"],
1244
+ disabled: r,
1245
+ children: /* @__PURE__ */ e(b, { gap: "2", children: ["correct", "keep", "fail"].map((p) => /* @__PURE__ */ e(je, { value: ge[p], children: t(`editor.changedVersion.${p}`) }, p)) })
1103
1246
  }
1104
1247
  )
1105
1248
  }
1106
1249
  ) })
1107
1250
  ] }) });
1108
1251
  }
1109
- function pe({
1110
- title: o,
1111
- empty: e,
1252
+ function be({
1253
+ title: i,
1254
+ empty: t,
1112
1255
  name: l,
1113
- options: r,
1114
- disabled: i
1256
+ options: n,
1257
+ disabled: r
1115
1258
  }) {
1116
- return /* @__PURE__ */ s(h, { gap: "2", role: "group", "aria-label": o, children: [
1117
- /* @__PURE__ */ t(g, { fontWeight: "medium", children: o }),
1118
- r.length === 0 ? /* @__PURE__ */ t(g, { color: "fg.muted", children: e }) : null,
1119
- r.map((n) => /* @__PURE__ */ t(
1120
- Pe,
1259
+ return /* @__PURE__ */ a(b, { gap: "2", role: "group", "aria-label": i, children: [
1260
+ /* @__PURE__ */ e(h, { fontWeight: "medium", children: i }),
1261
+ n.length === 0 ? /* @__PURE__ */ e(h, { color: "fg.muted", children: t }) : null,
1262
+ n.map((o) => /* @__PURE__ */ e(
1263
+ We,
1121
1264
  {
1122
1265
  name: l,
1123
- value: n.value,
1124
- disabled: i,
1125
- children: n.label
1266
+ value: o.value,
1267
+ disabled: r,
1268
+ children: o.label
1126
1269
  },
1127
- n.value
1270
+ o.value
1128
1271
  )),
1129
- /* @__PURE__ */ t(be, { name: l })
1272
+ /* @__PURE__ */ e(Ie, { name: l })
1130
1273
  ] });
1131
1274
  }
1132
- function ut({ client: o, id: e, onDeleted: l }) {
1133
- const { t: r } = $(F), i = ve(
1275
+ function Nt({ client: i, id: t, onDeleted: l }) {
1276
+ const { t: n } = E(I), r = U(
1134
1277
  () => ({
1135
1278
  tabs: [
1136
- { value: "fields", label: r("editor.tabs.fields") },
1137
- { value: "versions", label: r("editor.tabs.versions") },
1138
- { value: "output", label: r("editor.tabs.output") }
1279
+ { value: "fields", label: n("editor.tabs.fields") },
1280
+ { value: "versions", label: n("editor.tabs.versions") },
1281
+ { value: "output", label: n("editor.tabs.output") },
1282
+ { value: "test", label: n("editor.tabs.test") }
1139
1283
  ],
1140
- render: (n, a) => n === "fields" ? /* @__PURE__ */ t(Ue, { notices: a }) : n === "versions" ? /* @__PURE__ */ t(Qe, { notices: a }) : /* @__PURE__ */ t(Je, { notices: a })
1284
+ render: (o, s) => o === "fields" ? /* @__PURE__ */ e(it, { notices: s }) : o === "versions" ? /* @__PURE__ */ e(ut, { notices: s }) : o === "test" ? /* @__PURE__ */ e(nt, { client: i, notices: s }) : /* @__PURE__ */ e(ct, { notices: s })
1141
1285
  }),
1142
- [r]
1286
+ [n, i]
1143
1287
  );
1144
- return /* @__PURE__ */ t(Ce, { client: o, id: e, onDeleted: l, editor: i });
1288
+ return /* @__PURE__ */ e(ze, { client: i, id: t, onDeleted: l, editor: r });
1145
1289
  }
1146
1290
  export {
1147
- ut as MappingEditor
1291
+ Nt as MappingEditor
1148
1292
  };
1149
1293
  //# sourceMappingURL=mapping-editor.js.map