@blocklet/pages-kit-inner-components 0.6.51 → 0.6.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/setting.js CHANGED
@@ -1,146 +1,147 @@
1
- import { jsx as r, jsxs as v, Fragment as F } from "react/jsx-runtime";
2
- import { Box as P, Alert as Xe, Typography as T, TextField as z, Stack as k, FormLabel as ee, TableContainer as Ze, Paper as G, Table as Ne, TableHead as je, TableRow as re, TableCell as te, TableBody as ze, Button as E, IconButton as Y, FormControlLabel as ge, Switch as Ve, InputAdornment as $, alpha as ae, Tooltip as _, buttonClasses as er, Dialog as ye, DialogTitle as Re, DialogContent as Ee, DialogActions as Ae, Checkbox as rr, Autocomplete as Te, MenuItem as ce, Collapse as tr, Divider as nr, Popper as ir } from "@mui/material";
3
- import { t as xe, f as ne, a as oe, h as ve } from "./chunks/state-DRjnlQY_.js";
4
- import q from "@arcblock/ux/lib/Empty";
5
- import { useLocaleContext as V } from "@arcblock/ux/lib/Locale/context";
1
+ import { jsx as r, jsxs as v, Fragment as M } from "react/jsx-runtime";
2
+ import { Box as P, Alert as Xe, Typography as D, TextField as V, Stack as k, FormLabel as Z, TableContainer as Ze, Paper as $, Table as je, TableHead as ze, TableRow as ee, TableCell as re, TableBody as Ve, Button as A, IconButton as G, FormControlLabel as ge, Switch as Re, InputAdornment as _, alpha as ae, Tooltip as J, buttonClasses as er, Dialog as ye, DialogTitle as Ee, DialogContent as Ae, DialogActions as De, Checkbox as rr, Autocomplete as Te, MenuItem as ce, Collapse as tr, Divider as nr, Popper as ir } from "@mui/material";
3
+ import { t as xe, f as te, a as ie, h as ve } from "./chunks/state-DdT-7UdS.js";
4
+ import Y from "@arcblock/ux/lib/Empty";
5
+ import { useLocaleContext as R } from "@arcblock/ux/lib/Locale/context";
6
6
  import { CodeEditor as Ce } from "@blocklet/code-editor";
7
7
  import or from "@mui/icons-material/AddRounded";
8
8
  import lr from "@mui/icons-material/ArrowDownward";
9
9
  import sr from "@mui/icons-material/ArrowUpward";
10
10
  import ar from "@mui/icons-material/DeleteOutline";
11
- import D from "lodash/sortBy";
12
- import { useCallback as A, useMemo as H, useState as B, useEffect as U, useImperativeHandle as cr, useRef as M, useId as dr } from "react";
13
- import { useUpdate as De, useDebounce as ur } from "react-use";
14
- import { ColorItem as pr, ConfigColorDialog as mr } from "@blocklet/pages-kit/builtin/color-picker";
15
- import { getImageSize as de, getVideoSize as ue, UploaderButton as Pe, UploaderProvider as le, useUploader as hr } from "@blocklet/pages-kit/builtin/uploader";
16
- import { Icon as fr } from "@iconify-icon/react";
11
+ import T from "lodash/sortBy";
12
+ import { useCallback as W, useMemo as H, useState as U, useEffect as B, useImperativeHandle as cr, useRef as oe } from "react";
13
+ import { useUpdate as We, useDebounce as dr } from "react-use";
14
+ import { ColorItem as ur, ConfigColorDialog as pr } from "@blocklet/pages-kit/builtin/color-picker";
15
+ import { getImageSize as de, getVideoSize as ue, UploaderButton as Pe, UploaderProvider as le, useUploader as mr } from "@blocklet/pages-kit/builtin/uploader";
16
+ import { Icon as hr } from "@iconify-icon/react";
17
17
  import K from "lodash/isEmpty";
18
- import We from "lodash/set";
18
+ import Ue from "lodash/set";
19
19
  import * as pe from "yaml";
20
20
  import me from "lodash/cloneDeep";
21
21
  import he from "@arcblock/ux/lib/Toast";
22
- import { CustomComponentRenderer as Ue, transpileAndLoadScript as br, getPropertiesFromCode as gr } from "@blocklet/pages-kit/components";
23
- import { parsePropertyValue as yr } from "@blocklet/pages-kit/utils/property";
24
- import { unstable_useNumberInput as xr, ClickAwayListener as vr } from "@mui/base";
25
- import { VisibilityOffRounded as Cr, VisibilityRounded as Pr, DeleteOutlineRounded as kr, DragIndicatorRounded as wr, TranslateRounded as Ke, AddRounded as Be, InfoRounded as Me, PsychologyAlt as Ir, StarRounded as Sr, SettingsRounded as Le } from "@mui/icons-material";
26
- import { getYjsValue as Q } from "@syncedstore/core";
27
- import { useUpdate as Or, useReactive as Nr } from "ahooks";
28
- import jr from "lodash/assign";
29
- import zr from "lodash/get";
30
- import Vr from "lodash/has";
31
- import Rr from "lodash/isEqual";
32
- import ie from "lodash/isNil";
33
- import Er from "lodash/isObject";
34
- import Ar from "lodash/keyBy";
35
- import Tr from "lodash/omit";
36
- import Dr from "lodash/pick";
37
- import Wr from "lodash/reduce";
38
- import { usePopupState as ke, bindTrigger as we, bindDialog as Fe, bindPopper as Ur } from "material-ui-popup-state/hooks";
39
- import { ErrorBoundary as Kr } from "react-error-boundary";
40
- import { cx as Br } from "@emotion/css";
41
- import { useDrop as Je, useDrag as Mr } from "react-dnd";
22
+ import { CustomComponentRenderer as Ke, transpileAndLoadScript as fr, getPropertiesFromCode as br } from "@blocklet/pages-kit/components";
23
+ import { parsePropertyValue as gr } from "@blocklet/pages-kit/utils/property";
24
+ import { unstable_useNumberInput as yr, ClickAwayListener as xr } from "@mui/base";
25
+ import { VisibilityOffRounded as vr, VisibilityRounded as Cr, DeleteOutlineRounded as Pr, DragIndicatorRounded as kr, TranslateRounded as Be, AddRounded as Le, InfoRounded as Me, PsychologyAlt as wr, StarRounded as Sr, SettingsRounded as Fe } from "@mui/icons-material";
26
+ import { getYjsValue as q } from "@syncedstore/core";
27
+ import { useReactive as Ir } from "ahooks";
28
+ import Or from "lodash/assign";
29
+ import Nr from "lodash/get";
30
+ import jr from "lodash/has";
31
+ import zr from "lodash/isEqual";
32
+ import ne from "lodash/isNil";
33
+ import Vr from "lodash/isObject";
34
+ import Rr from "lodash/keyBy";
35
+ import Er from "lodash/omit";
36
+ import Ar from "lodash/pick";
37
+ import Dr from "lodash/reduce";
38
+ import { usePopupState as ke, bindTrigger as we, bindDialog as Je, bindPopper as Tr } from "material-ui-popup-state/hooks";
39
+ import { ErrorBoundary as Wr } from "react-error-boundary";
40
+ import { useSensors as Ur, useSensor as Ie, PointerSensor as Kr, KeyboardSensor as Br, DndContext as Lr, closestCorners as Mr, DragOverlay as Fr } from "@dnd-kit/core";
41
+ import { SortableContext as Jr, verticalListSortingStrategy as _r, useSortable as Hr } from "@dnd-kit/sortable";
42
+ import { CSS as $r } from "@dnd-kit/utilities";
42
43
  import { nextId as _e } from "@blocklet/pages-kit/utils/common";
43
- function Lr({ error: e }) {
44
+ function Gr({ error: e }) {
44
45
  return /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(Xe, { severity: "error", children: e.message }) });
45
46
  }
46
- function Fr({
47
+ function Yr({
47
48
  onClick: e,
48
49
  disabled: t,
49
- sx: o,
50
+ sx: n,
50
51
  ...l
51
52
  }) {
52
- return /* @__PURE__ */ r(Y, { size: "small", color: "warning", variant: "outlined", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(ar, { fontSize: "small" }) });
53
+ return /* @__PURE__ */ r(G, { size: "small", color: "warning", variant: "outlined", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(ar, { fontSize: "small" }) });
53
54
  }
54
- function Jr({
55
+ function qr({
55
56
  onClick: e,
56
57
  disabled: t,
57
- sx: o,
58
+ sx: n,
58
59
  ...l
59
60
  }) {
60
- return /* @__PURE__ */ r(Y, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(sr, { fontSize: "small" }) });
61
+ return /* @__PURE__ */ r(G, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(sr, { fontSize: "small" }) });
61
62
  }
62
- function _r({
63
+ function Qr({
63
64
  onClick: e,
64
65
  disabled: t,
65
- sx: o,
66
+ sx: n,
66
67
  ...l
67
68
  }) {
68
- return /* @__PURE__ */ r(Y, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(lr, { fontSize: "small" }) });
69
+ return /* @__PURE__ */ r(G, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(lr, { fontSize: "small" }) });
69
70
  }
70
- function $r({
71
+ function Xr({
71
72
  label: e,
72
73
  value: t,
73
- onChange: o,
74
+ onChange: n,
74
75
  disabled: l = !1,
75
76
  itemLabel: h = "",
76
77
  emptyHeight: p = 40,
77
- property: d,
78
- renderItem: b,
78
+ property: c,
79
+ renderItem: g,
79
80
  ...m
80
81
  }) {
81
- const { t: c, locale: s } = V(), a = De(), i = A(
82
- (y) => {
83
- o(xe(y, d.type));
82
+ const { t: d, locale: s } = R(), a = We(), i = W(
83
+ (b) => {
84
+ n(xe(b, c.type));
84
85
  },
85
- [o, d.type]
86
- ), n = H(() => Array.isArray(t) ? t : [], [t]), f = A(() => {
87
- const y = [...n, ""];
88
- i(y), a();
89
- }, [n, i, a]), g = A(() => {
90
- if (!d || !d.subProperties)
86
+ [n, c.type]
87
+ ), o = H(() => Array.isArray(t) ? t : [], [t]), f = W(() => {
88
+ const b = [...o, ""];
89
+ i(b), a();
90
+ }, [o, i, a]), y = W(() => {
91
+ if (!c || !c.subProperties)
91
92
  return f();
92
- const y = {};
93
- D(Object.values(d.subProperties), "index").forEach(({ data: R }) => {
94
- if (!R.key) return;
95
- const W = R.locales?.[s]?.defaultValue ?? "";
96
- y[R.key] = W;
93
+ const b = {};
94
+ T(Object.values(c.subProperties), "index").forEach(({ data: z }) => {
95
+ if (!z.key) return;
96
+ const E = z.locales?.[s]?.defaultValue ?? "";
97
+ b[z.key] = E;
97
98
  });
98
- const O = [...n, y];
99
+ const O = [...o, b];
99
100
  i(O), a();
100
- }, [n, i, a, d, s, f]), u = A(
101
- (y) => {
101
+ }, [o, i, a, c, s, f]), u = W(
102
+ (b) => {
102
103
  try {
103
- const C = JSON.parse(y);
104
- Array.isArray(C) ? i(C) : console.error("JSON解析结果不是数组");
105
- } catch (C) {
106
- console.error("JSON解析错误:", C);
104
+ const x = JSON.parse(b);
105
+ Array.isArray(x) ? i(x) : console.error("JSON解析结果不是数组");
106
+ } catch (x) {
107
+ console.error("JSON解析错误:", x);
107
108
  }
108
109
  },
109
110
  [i]
110
- ), x = A(
111
- (y) => {
112
- const C = n.filter((O, R) => R !== y);
113
- i(C), a();
111
+ ), C = W(
112
+ (b) => {
113
+ const x = o.filter((O, z) => z !== b);
114
+ i(x), a();
114
115
  },
115
- [n, i, a]
116
- ), I = A(
117
- (y) => {
118
- if (y <= 0) return;
119
- const C = [...n], O = C[y];
120
- C[y] = C[y - 1], C[y - 1] = O, i(C), a();
116
+ [o, i, a]
117
+ ), w = W(
118
+ (b) => {
119
+ if (b <= 0) return;
120
+ const x = [...o], O = x[b];
121
+ x[b] = x[b - 1], x[b - 1] = O, i(x), a();
121
122
  },
122
- [n, i, a]
123
- ), N = A(
124
- (y) => {
125
- if (y >= n.length - 1) return;
126
- const C = [...n], O = C[y];
127
- C[y] = C[y + 1], C[y + 1] = O, i(C), a();
123
+ [o, i, a]
124
+ ), N = W(
125
+ (b) => {
126
+ if (b >= o.length - 1) return;
127
+ const x = [...o], O = x[b];
128
+ x[b] = x[b + 1], x[b + 1] = O, i(x), a();
128
129
  },
129
- [n, i, a]
130
- ), S = A(
131
- (y, C) => {
132
- const O = [...n];
133
- O[y] = C, i(O);
130
+ [o, i, a]
131
+ ), S = W(
132
+ (b, x) => {
133
+ const O = [...o];
134
+ O[b] = x, i(O);
134
135
  },
135
- [n, i]
136
- ), w = d && d.subProperties && Object.keys(d.subProperties).length > 0, j = H(() => [
136
+ [o, i]
137
+ ), I = c && c.subProperties && Object.keys(c.subProperties).length > 0, j = H(() => [
137
138
  {
138
139
  field: "index",
139
140
  headerName: "#",
140
141
  width: 40,
141
142
  align: "center",
142
- renderCell: ({ index: y }) => /* @__PURE__ */ r(
143
- T,
143
+ renderCell: ({ index: b }) => /* @__PURE__ */ r(
144
+ D,
144
145
  {
145
146
  variant: "body1",
146
147
  sx: {
@@ -153,27 +154,27 @@ function $r({
153
154
  justifyContent: "center",
154
155
  color: "text.secondary"
155
156
  },
156
- children: y + 1
157
+ children: b + 1
157
158
  }
158
159
  )
159
160
  },
160
161
  {
161
162
  field: "content",
162
163
  headerName: "",
163
- renderCell: ({ row: y, index: C }) => b && w ? b({
164
- item: y,
165
- index: C,
166
- property: d,
167
- onChange: (O) => S(C, O)
164
+ renderCell: ({ row: b, index: x }) => g && I ? g({
165
+ item: b,
166
+ index: x,
167
+ property: c,
168
+ onChange: (O) => S(x, O)
168
169
  }) : /* @__PURE__ */ r(
169
- z,
170
+ V,
170
171
  {
171
172
  fullWidth: !0,
172
173
  size: "small",
173
174
  disabled: l,
174
- value: y,
175
- placeholder: h || `${c("item")} ${C + 1}`,
176
- onChange: (O) => S(C, O.target.value),
175
+ value: b,
176
+ placeholder: h || `${d("item")} ${x + 1}`,
177
+ onChange: (O) => S(x, O.target.value),
177
178
  ...m
178
179
  }
179
180
  )
@@ -184,33 +185,33 @@ function $r({
184
185
  width: 30,
185
186
  // 增加宽度以容纳更多按钮
186
187
  align: "center",
187
- renderCell: ({ index: y }) => /* @__PURE__ */ v(k, { direction: "column", spacing: 0.25, children: [
188
- /* @__PURE__ */ r(Jr, { disabled: l || y === 0, onClick: () => I(y) }),
188
+ renderCell: ({ index: b }) => /* @__PURE__ */ v(k, { direction: "column", spacing: 0.25, children: [
189
+ /* @__PURE__ */ r(qr, { disabled: l || b === 0, onClick: () => w(b) }),
189
190
  /* @__PURE__ */ r(
190
- _r,
191
+ Qr,
191
192
  {
192
- disabled: l || y === n.length - 1,
193
- onClick: () => N(y)
193
+ disabled: l || b === o.length - 1,
194
+ onClick: () => N(b)
194
195
  }
195
196
  ),
196
- /* @__PURE__ */ r(Fr, { disabled: l, onClick: () => x(y) })
197
+ /* @__PURE__ */ r(Yr, { disabled: l, onClick: () => C(b) })
197
198
  ] })
198
199
  }
199
200
  ], [
200
- b,
201
- w,
202
- d,
201
+ g,
202
+ I,
203
+ c,
203
204
  S,
204
205
  h,
205
- c,
206
+ d,
206
207
  l,
207
208
  m,
208
- x,
209
- I,
209
+ C,
210
+ w,
210
211
  N,
211
- n.length
212
+ o.length
212
213
  ]);
213
- return w ? /* @__PURE__ */ v(
214
+ return I ? /* @__PURE__ */ v(
214
215
  k,
215
216
  {
216
217
  sx: {
@@ -218,9 +219,9 @@ function $r({
218
219
  gap: 1
219
220
  },
220
221
  children: [
221
- e && /* @__PURE__ */ r(ee, { children: e }),
222
- n.length > 0 ? /* @__PURE__ */ r(Ze, { component: G, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ v(
223
- Ne,
222
+ e && /* @__PURE__ */ r(Z, { children: e }),
223
+ o.length > 0 ? /* @__PURE__ */ r(Ze, { component: $, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ v(
224
+ je,
224
225
  {
225
226
  size: "small",
226
227
  sx: {
@@ -237,58 +238,58 @@ function $r({
237
238
  borderCollapse: "collapse"
238
239
  },
239
240
  children: [
240
- /* @__PURE__ */ r(je, { sx: { display: "none" }, children: /* @__PURE__ */ r(re, { children: j.map((y) => /* @__PURE__ */ r(
241
- te,
241
+ /* @__PURE__ */ r(ze, { sx: { display: "none" }, children: /* @__PURE__ */ r(ee, { children: j.map((b) => /* @__PURE__ */ r(
242
+ re,
242
243
  {
243
- width: y.width,
244
- align: y.align || "left",
244
+ width: b.width,
245
+ align: b.align || "left",
245
246
  sx: { fontWeight: "bold" },
246
- children: y.renderHeader ? y.renderHeader() : y.headerName
247
+ children: b.renderHeader ? b.renderHeader() : b.headerName
247
248
  },
248
- y.field
249
+ b.field
249
250
  )) }) }),
250
- /* @__PURE__ */ r(ze, { children: n.map((y, C, O) => /* @__PURE__ */ r(
251
- re,
251
+ /* @__PURE__ */ r(Ve, { children: o.map((b, x, O) => /* @__PURE__ */ r(
252
+ ee,
252
253
  {
253
254
  sx: {
254
- borderBottom: C < O.length - 1 ? "1px solid" : "none",
255
+ borderBottom: x < O.length - 1 ? "1px solid" : "none",
255
256
  borderColor: "divider",
256
257
  "&:hover": {
257
258
  backgroundColor: "action.hover"
258
259
  }
259
260
  },
260
- children: j.map((R) => /* @__PURE__ */ r(
261
- te,
261
+ children: j.map((z) => /* @__PURE__ */ r(
262
+ re,
262
263
  {
263
- width: R.width,
264
- align: R.align || "left",
264
+ width: z.width,
265
+ align: z.align || "left",
265
266
  sx: {
266
267
  borderBottom: "none"
267
268
  },
268
- children: R.renderCell({
269
- row: y,
270
- index: C,
271
- onChange: (W) => S(C, W)
269
+ children: z.renderCell({
270
+ row: b,
271
+ index: x,
272
+ onChange: (E) => S(x, E)
272
273
  })
273
274
  },
274
- `${C}-${R.field}`
275
+ `${x}-${z.field}`
275
276
  ))
276
277
  },
277
- C
278
+ x
278
279
  )) })
279
280
  ]
280
281
  }
281
- ) }) : /* @__PURE__ */ r(q, { style: { fontSize: 12, height: p }, children: c("maker.properties.arrayEmpty") }),
282
+ ) }) : /* @__PURE__ */ r(Y, { style: { fontSize: 12, height: p }, children: d("maker.properties.arrayEmpty") }),
282
283
  /* @__PURE__ */ r(
283
- E,
284
+ A,
284
285
  {
285
286
  fullWidth: !0,
286
287
  size: "small",
287
288
  variant: "outlined",
288
289
  disabled: l,
289
290
  startIcon: /* @__PURE__ */ r(or, {}),
290
- onClick: g,
291
- children: c("maker.properties.addArrayItem")
291
+ onClick: y,
292
+ children: d("maker.properties.addArrayItem")
292
293
  }
293
294
  )
294
295
  ]
@@ -301,73 +302,73 @@ function $r({
301
302
  gap: 1
302
303
  },
303
304
  children: [
304
- e && /* @__PURE__ */ r(ee, { children: e }),
305
+ e && /* @__PURE__ */ r(Z, { children: e }),
305
306
  /* @__PURE__ */ r(P, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ r(
306
307
  Ce,
307
308
  {
308
- keyId: d.id,
309
+ keyId: c.id,
309
310
  locale: s,
310
311
  language: "json",
311
- value: JSON.stringify(n, null, 2),
312
- onChange: (y) => u(y || ""),
312
+ value: JSON.stringify(o, null, 2),
313
+ onChange: (b) => u(b || ""),
313
314
  fullScreenOptions: {
314
315
  enableEscExit: !0,
315
316
  targetContainer: () => document.getElementById("parameters-config-dialog") || null
316
317
  }
317
318
  },
318
- d.id
319
+ c.id
319
320
  ) })
320
321
  ]
321
322
  }
322
323
  );
323
324
  }
324
- function Hr({
325
+ function Zr({
325
326
  ref: e,
326
327
  showMarkdown: t,
327
- markdown: o,
328
+ markdown: n,
328
329
  onMarkdownChange: l,
329
330
  showUploader: h,
330
331
  value: p,
331
- meta: d,
332
- onChange: b,
332
+ meta: c,
333
+ onChange: g,
333
334
  ...m
334
335
  }) {
335
- const [c, s] = B("");
336
- U(() => {
336
+ const [d, s] = U("");
337
+ B(() => {
337
338
  s(p || "");
338
339
  }, [p, s]);
339
340
  const a = async () => {
340
- if (c !== p) {
341
- const n = ne(c);
342
- if (!n) {
343
- b(c, void 0);
341
+ if (d !== p) {
342
+ const o = te(d);
343
+ if (!o) {
344
+ g(d, void 0);
344
345
  return;
345
346
  }
346
- const f = await de(n).catch(() => ue(n)).catch(() => {
347
+ const f = await de(o).catch(() => ue(o)).catch(() => {
347
348
  });
348
- b(c, { ...f, filename: c });
349
+ g(d, { ...f, filename: d });
349
350
  }
350
351
  };
351
- ur(
352
+ dr(
352
353
  () => {
353
- c !== p && b(c);
354
+ d !== p && g(d);
354
355
  },
355
356
  300,
356
- [c]
357
+ [d]
357
358
  ), cr(e, () => ({
358
359
  submit: a
359
360
  }));
360
361
  const i = {};
361
362
  return h && (i.InputProps = {
362
363
  sx: { pr: 0 },
363
- endAdornment: /* @__PURE__ */ r($, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ r(
364
+ endAdornment: /* @__PURE__ */ r(_, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ r(
364
365
  Pe,
365
366
  {
366
- onChange: async ({ response: n }) => {
367
- const f = n?.data?.filename, g = ne(f) || "";
367
+ onChange: async ({ response: o }) => {
368
+ const f = o?.data?.filename, y = te(f) || "";
368
369
  let u = {};
369
- g && (u = await de(g).catch(() => ue(g)).catch(() => {
370
- })), b(f, {
370
+ y && (u = await de(y).catch(() => ue(y)).catch(() => {
371
+ })), g(f, {
371
372
  ...u,
372
373
  filename: f
373
374
  });
@@ -375,7 +376,7 @@ function Hr({
375
376
  }
376
377
  ) })
377
378
  }), /* @__PURE__ */ r(
378
- z,
379
+ V,
379
380
  {
380
381
  size: "small",
381
382
  fullWidth: !0,
@@ -390,17 +391,17 @@ function Hr({
390
391
  },
391
392
  children: [
392
393
  m.label,
393
- t && /* @__PURE__ */ v(F, { children: [
394
+ t && /* @__PURE__ */ v(M, { children: [
394
395
  " (",
395
396
  /* @__PURE__ */ r(
396
397
  ge,
397
398
  {
398
- checked: o,
399
- label: /* @__PURE__ */ r(P, { component: fr, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
399
+ checked: n,
400
+ label: /* @__PURE__ */ r(P, { component: hr, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
400
401
  labelPlacement: "start",
401
- control: /* @__PURE__ */ r(Ve, { size: "small" }),
402
+ control: /* @__PURE__ */ r(Re, { size: "small" }),
402
403
  sx: { ml: 0.25, pr: 1 },
403
- onChange: (n, f) => l?.(f)
404
+ onChange: (o, f) => l?.(f)
404
405
  }
405
406
  ),
406
407
  ")"
@@ -408,11 +409,11 @@ function Hr({
408
409
  ]
409
410
  }
410
411
  ),
411
- value: c,
412
- onChange: (n) => s(n.target.value),
412
+ value: d,
413
+ onChange: (o) => s(o.target.value),
413
414
  ...i,
414
- onKeyDown: (n) => {
415
- n.keyCode !== 229 && n.key === "Enter" && a();
415
+ onKeyDown: (o) => {
416
+ o.keyCode !== 229 && o.key === "Enter" && a();
416
417
  },
417
418
  slotProps: {
418
419
  inputLabel: { shrink: !0, ...m.InputLabelProps }
@@ -420,23 +421,23 @@ function Hr({
420
421
  }
421
422
  );
422
423
  }
423
- function Gr({
424
+ function et({
424
425
  value: e,
425
426
  onChange: t,
426
- disableGradient: o = !1,
427
+ disableGradient: n = !1,
427
428
  ...l
428
429
  }) {
429
- const h = M(null);
430
- return /* @__PURE__ */ v(F, { children: [
430
+ const h = oe(null);
431
+ return /* @__PURE__ */ v(M, { children: [
431
432
  /* @__PURE__ */ r(
432
- Hr,
433
+ Zr,
433
434
  {
434
435
  ...l,
435
436
  value: e,
436
437
  onChange: t,
437
438
  InputProps: {
438
- endAdornment: /* @__PURE__ */ r($, { position: "end", children: /* @__PURE__ */ r(
439
- pr,
439
+ endAdornment: /* @__PURE__ */ r(_, { position: "end", children: /* @__PURE__ */ r(
440
+ ur,
440
441
  {
441
442
  color: e ?? "",
442
443
  style: { width: "1.5rem", height: "1.5rem", padding: 0 },
@@ -449,32 +450,32 @@ function Gr({
449
450
  }
450
451
  ),
451
452
  /* @__PURE__ */ r(
452
- mr,
453
+ pr,
453
454
  {
454
455
  ref: h,
455
- onSave: ({ value: p }, d) => {
456
- t(p), d();
456
+ onSave: ({ value: p }, c) => {
457
+ t(p), c();
457
458
  },
458
- disableGradient: o
459
+ disableGradient: n
459
460
  }
460
461
  )
461
462
  ] });
462
463
  }
463
- function Yr({
464
+ function rt({
464
465
  label: e,
465
466
  value: t,
466
- onChange: o,
467
+ onChange: n,
467
468
  property: l,
468
469
  component: h,
469
470
  defaultLocale: p,
470
- allComponents: d,
471
- PropertyValueField: b,
471
+ allComponents: c,
472
+ PropertyValueField: g,
472
473
  onUpload: m
473
474
  }) {
474
- const { locale: c } = V(), s = M(null);
475
+ const { locale: d } = R(), s = oe(null);
475
476
  if (!K(l.subProperties)) {
476
- const i = D(Object.values(l.subProperties || {}), "index").filter(
477
- (n) => n.data.visible !== !1 && n.data.key
477
+ const i = T(Object.values(l.subProperties || {}), "index").filter(
478
+ (o) => o.data.visible !== !1 && o.data.key
478
479
  );
479
480
  return /* @__PURE__ */ v(
480
481
  k,
@@ -483,16 +484,16 @@ function Yr({
483
484
  width: "100%"
484
485
  },
485
486
  children: [
486
- /* @__PURE__ */ r(ee, { sx: { px: 0.25, py: 0.5 }, children: e }),
487
- /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(P, { sx: { position: "relative" }, children: i.map((n, f) => {
488
- const { data: g } = n, u = g.key ?? g.id, x = f === i.length - 1;
489
- let I = null;
487
+ /* @__PURE__ */ r(Z, { sx: { px: 0.25, py: 0.5 }, children: e }),
488
+ /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(P, { sx: { position: "relative" }, children: i.map((o, f) => {
489
+ const { data: y } = o, u = y.key ?? y.id, C = f === i.length - 1;
490
+ let w = null;
490
491
  try {
491
- t && typeof t == "object" ? I = t[u] : typeof t == "string" && (I = (l.type === "yaml" ? pe.parse(t || "") : JSON.parse(t || "{}"))[u]);
492
+ t && typeof t == "object" ? w = t[u] : typeof t == "string" && (w = (l.type === "yaml" ? pe.parse(t || "") : JSON.parse(t || "{}"))[u]);
492
493
  } catch {
493
494
  }
494
- I == null && (g.locales && c && g.locales[c] ? I = g.locales[c].defaultValue : g.locales && p && g.locales[p] && (I = g.locales[p].defaultValue));
495
- const N = (w) => {
495
+ w == null && (y.locales && d && y.locales[d] ? w = y.locales[d].defaultValue : y.locales && p && y.locales[p] && (w = y.locales[p].defaultValue));
496
+ const N = (I) => {
496
497
  try {
497
498
  let j = {};
498
499
  if (typeof t == "string")
@@ -501,9 +502,9 @@ function Yr({
501
502
  } catch {
502
503
  }
503
504
  else typeof t == "object" && t !== null && (j = { ...t });
504
- We(j, u, w);
505
- const y = xe(j, l.type);
506
- o?.(y);
505
+ Ue(j, u, I);
506
+ const b = xe(j, l.type);
507
+ n?.(b);
507
508
  } catch (j) {
508
509
  console.error("Error updating property:", j);
509
510
  }
@@ -512,7 +513,7 @@ function Yr({
512
513
  P,
513
514
  {
514
515
  sx: {
515
- mb: x ? 0 : 1,
516
+ mb: C ? 0 : 1,
516
517
  // 底部边距,最后一项不需要
517
518
  display: "flex",
518
519
  flexDirection: "row"
@@ -557,7 +558,7 @@ function Yr({
557
558
  }
558
559
  }
559
560
  ),
560
- !x && /* @__PURE__ */ r(
561
+ !C && /* @__PURE__ */ r(
561
562
  P,
562
563
  {
563
564
  sx: {
@@ -577,21 +578,21 @@ function Yr({
577
578
  }
578
579
  ),
579
580
  /* @__PURE__ */ r(P, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ r(
580
- b,
581
+ g,
581
582
  {
582
583
  component: h,
583
- property: g,
584
- value: I,
584
+ property: y,
585
+ value: w,
585
586
  onChange: N,
586
587
  size: "small",
587
588
  fullWidth: !0,
588
589
  defaultLocale: p,
589
- allComponents: d
590
+ allComponents: c
590
591
  }
591
592
  ) })
592
593
  ]
593
594
  },
594
- g.id
595
+ y.id
595
596
  );
596
597
  }) }) })
597
598
  ]
@@ -619,7 +620,7 @@ function Yr({
619
620
  },
620
621
  children: [
621
622
  /* @__PURE__ */ r(
622
- ee,
623
+ Z,
623
624
  {
624
625
  sx: {
625
626
  position: "absolute",
@@ -634,11 +635,11 @@ function Yr({
634
635
  Ce,
635
636
  {
636
637
  keyId: l.id,
637
- locale: c,
638
+ locale: d,
638
639
  language: l.type === "yaml" ? "yaml" : "json",
639
640
  value: typeof t == "string" ? t : "",
640
641
  onChange: (i) => {
641
- o?.(i);
642
+ n?.(i);
642
643
  },
643
644
  onUpload: (i) => {
644
645
  s.current = i, m && m(i);
@@ -676,145 +677,141 @@ function Yr({
676
677
  }
677
678
  );
678
679
  }
679
- const qr = ["string", "multiline", "json", "yaml", "url", "component", "custom", "array"];
680
- function Se(e) {
681
- return e.type ? !qr.includes(e.type) : !1;
680
+ const tt = ["string", "multiline", "json", "yaml", "url", "component", "custom", "array"];
681
+ function Oe(e) {
682
+ return e.type ? !tt.includes(e.type) : !1;
682
683
  }
683
- function $e({
684
+ function He({
684
685
  disabled: e,
685
686
  list: t,
686
- renderItem: o,
687
+ renderItem: n,
687
688
  ...l
688
689
  }) {
689
- const h = M(null), p = dr(), d = Or(), b = D(Object.entries(t), (n) => n[1].index).map((n) => n[0]), m = M(b), c = A(
690
- (n) => {
691
- m.current = n, d();
692
- },
693
- [d]
694
- ), s = A(
695
- ({ index: n }, { index: f }) => {
696
- const g = [...m.current];
697
- g.splice(f, 0, ...g.splice(n, 1)), c(g);
698
- },
699
- [c]
700
- );
701
- U(() => {
702
- c(b);
703
- }, [b.join("-")]);
704
- const [{ isOver: a }, i] = Je({
705
- accept: p,
706
- collect: (n) => ({
707
- isOver: n.isOver()
690
+ const h = T(Object.entries(t), ([, f]) => f.index), p = h.map(([f]) => f), [c, g] = U(null), [m, d] = U(null), s = Ur(
691
+ Ie(Kr, {
692
+ activationConstraint: {
693
+ distance: 8
694
+ // 8px movement required to start drag
695
+ }
708
696
  }),
709
- canDrop: () => !e,
710
- drop: () => {
711
- const n = () => {
712
- m.current.forEach((g, u) => {
713
- const x = t[g];
714
- x && (x.index = u);
715
- });
716
- }, f = Q(t)?.doc;
717
- f ? f.transact(() => {
718
- n();
719
- }) : n();
720
- }
721
- });
722
- return U(() => {
723
- a || c(b);
724
- }, [a]), i(h), /* @__PURE__ */ r(P, { ...l, ref: h, className: Br(a && "isDragging"), children: m.current.map((n, f) => /* @__PURE__ */ r(
725
- Qr,
697
+ Ie(Br)
698
+ );
699
+ return /* @__PURE__ */ v(
700
+ Lr,
726
701
  {
727
- type: p,
728
- disabled: e,
729
- id: n,
730
- index: f,
731
- itemIndex: (g) => m.current.indexOf(g),
732
- move: s,
733
- children: (g) => {
734
- const u = t[n];
735
- return u ? o(u.data, f, g) : null;
736
- }
737
- },
738
- n
739
- )) });
702
+ sensors: s,
703
+ collisionDetection: Mr,
704
+ onDragStart: (f) => {
705
+ const { active: y } = f, u = t[y.id];
706
+ u && (d(y.id), g(u.data));
707
+ },
708
+ onDragOver: () => {
709
+ },
710
+ onDragEnd: (f) => {
711
+ const { active: y, over: u } = f;
712
+ if (d(null), g(null), !u || y.id === u.id)
713
+ return;
714
+ const C = y.id, w = u.id;
715
+ if (t[C] && t[w]) {
716
+ const N = () => {
717
+ const j = Object.entries(t).sort(([, z], [, E]) => z.index - E.index), b = j.findIndex(([z]) => z === C), x = j.findIndex(([z]) => z === w), [O] = j.splice(b, 1);
718
+ O && j.splice(x, 0, O), j.forEach(([, z], E) => {
719
+ z.index = E;
720
+ });
721
+ }, S = q(t)?.doc;
722
+ S ? S.transact(() => {
723
+ N();
724
+ }) : N();
725
+ }
726
+ },
727
+ children: [
728
+ /* @__PURE__ */ r(Jr, { items: p, strategy: _r, children: /* @__PURE__ */ r(k, { ...l, children: h.map(([f, y], u) => /* @__PURE__ */ r(nt, { id: f, disabled: e, isDragging: m === f, children: n(y.data, u, {
729
+ isDragging: m === f,
730
+ drag: null,
731
+ // Legacy compatibility
732
+ drop: null,
733
+ // Legacy compatibility
734
+ preview: null
735
+ // Legacy compatibility
736
+ }) }, f)) }) }),
737
+ /* @__PURE__ */ r(Fr, { children: c && m ? /* @__PURE__ */ r(
738
+ P,
739
+ {
740
+ sx: {
741
+ opacity: 0.8,
742
+ backgroundColor: "background.paper",
743
+ border: "1px solid",
744
+ borderColor: "primary.main",
745
+ borderRadius: 1,
746
+ boxShadow: 2,
747
+ maxWidth: 400
748
+ },
749
+ children: n(c, 0, {
750
+ isDragging: !0,
751
+ drag: null,
752
+ drop: null,
753
+ preview: null
754
+ })
755
+ }
756
+ ) : null })
757
+ ]
758
+ }
759
+ );
740
760
  }
741
- function Qr({
742
- disabled: e,
743
- id: t,
744
- index: o,
745
- type: l,
746
- children: h,
747
- itemIndex: p,
748
- move: d
761
+ function nt({
762
+ id: e,
763
+ disabled: t,
764
+ isDragging: n,
765
+ children: l
749
766
  }) {
750
- const b = M(void 0), [{ isDragging: m }, c, s] = Mr({
751
- type: l,
752
- item: () => ({ id: t }),
753
- canDrag: () => !e,
754
- collect: (i) => ({ isDragging: i.isDragging() })
755
- }), [, a] = Je({
756
- accept: l,
757
- canDrop: () => !e,
758
- hover(i, n) {
759
- if (!b.current)
760
- return;
761
- const f = p(i.id), g = o;
762
- if (f === g)
763
- return;
764
- const u = b.current?.getBoundingClientRect(), x = (u.bottom - u.top) / 2, N = n.getClientOffset().y - u.top;
765
- f < g && N < x || f > g && N > x || d({ id: i.id, index: f }, { id: t, index: o });
766
- }
767
- });
768
- return typeof h == "function" ? h({
769
- isDragging: m,
770
- drag: c,
771
- drop: (i) => (b.current = i, a(i)),
772
- preview: s
773
- }) : (c(a(s(b))), /* @__PURE__ */ r(P, { ref: b, children: h }));
767
+ const { attributes: h, listeners: p, setNodeRef: c, transform: g, transition: m } = Hr({
768
+ id: e,
769
+ disabled: t
770
+ }), d = {
771
+ transform: $r.Transform.toString(g),
772
+ transition: m,
773
+ opacity: n ? 0.5 : 1
774
+ };
775
+ return /* @__PURE__ */ r(P, { ref: c, style: d, ...h, ...p, children: l });
774
776
  }
775
- function Xr({
776
- drop: e,
777
- preview: t,
778
- drag: o,
779
- disabled: l,
780
- isDragging: h,
781
- children: p,
782
- onDelete: d,
783
- onVisibilityChange: b,
784
- visible: m = !0,
777
+ function it({
778
+ disabled: e,
779
+ isDragging: t,
780
+ children: n,
781
+ onDelete: l,
782
+ onVisibilityChange: h,
783
+ visible: p = !0,
785
784
  actions: c,
786
- alwaysShowActions: s = !1
785
+ alwaysShowActions: g = !1
787
786
  }) {
788
- const { t: a } = V();
787
+ const { t: m } = R();
789
788
  return /* @__PURE__ */ r(
790
789
  P,
791
790
  {
792
- ref: e,
793
791
  sx: {
794
792
  ":hover .hover-visible": { maxWidth: "100%" },
795
- opacity: m ? 1 : 0.5
793
+ opacity: p ? 1 : 0.5
796
794
  },
797
795
  children: /* @__PURE__ */ v(P, { sx: { position: "relative" }, children: [
798
796
  /* @__PURE__ */ r(
799
797
  P,
800
798
  {
801
- ref: t,
802
799
  sx: {
803
800
  flex: 1,
804
801
  borderRadius: 0.5,
805
- bgcolor: h ? "action.hover" : "background.paper",
802
+ bgcolor: t ? "action.hover" : "background.paper",
806
803
  opacity: 0.9999
807
804
  // NOTE: make preview effective
808
805
  },
809
- children: p
806
+ children: n
810
807
  }
811
808
  ),
812
- !l && /* @__PURE__ */ r(
809
+ !e && /* @__PURE__ */ r(
813
810
  P,
814
811
  {
815
- className: s ? "" : "hover-visible",
812
+ className: g ? "" : "hover-visible",
816
813
  sx: {
817
- maxWidth: s ? "100%" : 0,
814
+ maxWidth: g ? "100%" : 0,
818
815
  overflow: "hidden",
819
816
  position: "absolute",
820
817
  right: 2,
@@ -826,7 +823,7 @@ function Xr({
826
823
  {
827
824
  direction: "row",
828
825
  sx: {
829
- bgcolor: (i) => ae(i.palette.grey[200], 0.9),
826
+ bgcolor: (d) => ae(d.palette.grey[200], 0.9),
830
827
  borderRadius: 1,
831
828
  p: 0.5,
832
829
  [`.${er.root}`]: {
@@ -838,9 +835,9 @@ function Xr({
838
835
  },
839
836
  children: [
840
837
  c,
841
- b && /* @__PURE__ */ r(_, { title: a(m ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ r(E, { onClick: () => b(!m), children: m ? /* @__PURE__ */ r(Cr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ r(Pr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
842
- d && /* @__PURE__ */ r(_, { title: a("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ r(E, { onClick: d, children: /* @__PURE__ */ r(kr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
843
- /* @__PURE__ */ r(_, { title: a("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ r(E, { ref: o, children: /* @__PURE__ */ r(wr, { sx: { color: "grey.500" } }) }) })
838
+ h && /* @__PURE__ */ r(J, { title: m(p ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ r(A, { onClick: () => h(!p), children: p ? /* @__PURE__ */ r(vr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ r(Cr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
839
+ l && /* @__PURE__ */ r(J, { title: m("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ r(A, { onClick: l, children: /* @__PURE__ */ r(Pr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
840
+ /* @__PURE__ */ r(J, { title: m("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(kr, { sx: { color: "grey.500" } }) }) })
844
841
  ]
845
842
  }
846
843
  )
@@ -850,122 +847,122 @@ function Xr({
850
847
  }
851
848
  );
852
849
  }
853
- function Zr(e) {
854
- const t = ["string", "json", "array", "url", "multiline"], o = ["style", "fontSize", "color", "content", "type"];
855
- return !!(t.includes(e.type || "") && !o.includes(e.key || ""));
850
+ function ot(e) {
851
+ const t = ["string", "json", "array", "url", "multiline"], n = ["style", "fontSize", "color", "content", "type"];
852
+ return !!(t.includes(e.type || "") && !n.includes(e.key || ""));
856
853
  }
857
- function et(e, t, o) {
858
- return e.locales && e.locales[t] && e.locales[t].name ? e.locales[t].name : o && e.locales && e.locales[o] && e.locales[o].name ? e.locales[o].name : e.key ? e.key : e.id;
854
+ function lt(e, t, n) {
855
+ return e.locales && e.locales[t] && e.locales[t].name ? e.locales[t].name : n && e.locales && e.locales[n] && e.locales[n].name ? e.locales[n].name : e.key ? e.key : e.id;
859
856
  }
860
- const He = (e, t, o, l) => {
857
+ const $e = (e, t, n, l) => {
861
858
  const h = {};
862
- return D(Object.entries(e), ([, d]) => d.index).forEach(([d, b]) => {
863
- const m = b.data;
859
+ return T(Object.entries(e), ([, c]) => c.index).forEach(([c, g]) => {
860
+ const m = g.data;
864
861
  if (!m) return;
865
- const c = m.key || m.id, s = o ? et(m, o, l || "") : c, a = t?.[m.id], i = {
866
- key: c,
867
- isNeedGenerate: a?.isNeedGenerate ?? Zr(m),
862
+ const d = m.key || m.id, s = n ? lt(m, n, l || "") : d, a = t?.[m.id], i = {
863
+ key: d,
864
+ isNeedGenerate: a?.isNeedGenerate ?? ot(m),
868
865
  // 如果存在使用现有值,否则默认勾选
869
866
  describe: a?.describe ?? "",
870
867
  displayName: s
871
868
  };
872
- m.subProperties && !K(m.subProperties) && (i.subProperties = He(
869
+ m.subProperties && !K(m.subProperties) && (i.subProperties = $e(
873
870
  m.subProperties,
874
871
  a?.subProperties,
875
- o,
872
+ n,
876
873
  l
877
874
  )), h[m.id] = i;
878
875
  }), h;
879
876
  };
880
- function rt({
877
+ function st({
881
878
  open: e,
882
879
  onClose: t,
883
- onConfirm: o,
880
+ onConfirm: n,
884
881
  component: l,
885
882
  initialConfig: h,
886
883
  locale: p,
887
- defaultLocale: d,
888
- title: b,
884
+ defaultLocale: c,
885
+ title: g,
889
886
  loading: m = !1
890
887
  }) {
891
- const { t: c } = V(), [s, a] = B(null);
892
- U(() => {
888
+ const { t: d } = R(), [s, a] = U(null);
889
+ B(() => {
893
890
  if (e && l) {
894
891
  const u = { properties: {} };
895
892
  if (l.properties) {
896
- const x = h?.properties;
897
- u.properties = He(l.properties, x, p, d);
893
+ const C = h?.properties;
894
+ u.properties = $e(l.properties, C, p, c);
898
895
  }
899
896
  a(u);
900
897
  }
901
- }, [e, l, h, p, d]);
898
+ }, [e, l, h, p, c]);
902
899
  const i = () => {
903
900
  t();
904
- }, n = () => {
905
- s && (o(s), t());
906
- }, f = (u, x, I) => {
901
+ }, o = () => {
902
+ s && (n(s), t());
903
+ }, f = (u, C, w) => {
907
904
  if (!s || !u.length) return;
908
905
  const N = JSON.parse(JSON.stringify(s));
909
- let S = N.properties, w = null;
910
- for (let y = 0; y < u.length - 1; y++) {
911
- const C = u[y];
912
- if (!C || !S[C])
906
+ let S = N.properties, I = null;
907
+ for (let b = 0; b < u.length - 1; b++) {
908
+ const x = u[b];
909
+ if (!x || !S[x])
913
910
  return;
914
- w = S;
915
- const O = S[C];
911
+ I = S;
912
+ const O = S[x];
916
913
  O.subProperties || (O.subProperties = {}), S = O.subProperties;
917
914
  }
918
915
  const j = u[u.length - 1];
919
916
  if (j) {
920
- if ("isNeedGenerate" in I) {
921
- const y = I.isNeedGenerate, C = {
922
- ...x,
923
- ...I
917
+ if ("isNeedGenerate" in w) {
918
+ const b = w.isNeedGenerate, x = {
919
+ ...C,
920
+ ...w
924
921
  };
925
- if (x.subProperties && !K(x.subProperties)) {
926
- const O = (R, W) => {
927
- const J = {};
928
- return Object.entries(R).forEach(([Qe, X]) => {
929
- const se = { ...X };
930
- W !== null && (se.isNeedGenerate = W), X.subProperties && !K(X.subProperties) && (se.subProperties = O(
931
- X.subProperties,
932
- W !== null ? W : null
933
- )), J[Qe] = se;
934
- }), J;
922
+ if (C.subProperties && !K(C.subProperties)) {
923
+ const O = (z, E) => {
924
+ const F = {};
925
+ return Object.entries(z).forEach(([Qe, Q]) => {
926
+ const se = { ...Q };
927
+ E !== null && (se.isNeedGenerate = E), Q.subProperties && !K(Q.subProperties) && (se.subProperties = O(
928
+ Q.subProperties,
929
+ E !== null ? E : null
930
+ )), F[Qe] = se;
931
+ }), F;
935
932
  };
936
- C.subProperties = O(
937
- x.subProperties,
938
- y === !1 ? !1 : null
933
+ x.subProperties = O(
934
+ C.subProperties,
935
+ b === !1 ? !1 : null
939
936
  );
940
937
  }
941
938
  if (u.length === 1)
942
- N.properties[j] = C;
943
- else if (w && u.length >= 2) {
939
+ N.properties[j] = x;
940
+ else if (I && u.length >= 2) {
944
941
  const O = u[u.length - 2];
945
- O && w[O] && (w[O].subProperties || (w[O].subProperties = {}), w[O].subProperties[j] = C);
942
+ O && I[O] && (I[O].subProperties || (I[O].subProperties = {}), I[O].subProperties[j] = x);
946
943
  }
947
944
  } else if (u.length === 1)
948
945
  N.properties[j] = {
949
- ...x,
950
- ...I
946
+ ...C,
947
+ ...w
951
948
  };
952
- else if (w && u.length >= 2) {
953
- const y = u[u.length - 2];
954
- y && w[y] && w[y].subProperties && (w[y].subProperties[j] = {
955
- ...x,
956
- ...I
949
+ else if (I && u.length >= 2) {
950
+ const b = u[u.length - 2];
951
+ b && I[b] && I[b].subProperties && (I[b].subProperties[j] = {
952
+ ...C,
953
+ ...w
957
954
  });
958
955
  }
959
956
  a(N);
960
957
  }
961
- }, g = (u, x = [], I = !0) => {
958
+ }, y = (u, C = [], w = !0) => {
962
959
  if (!u || K(u))
963
- return /* @__PURE__ */ r(q, { children: c("maker.properties.noProperties") });
964
- const N = D(Object.entries(u), ([, S]) => S.displayName);
965
- return /* @__PURE__ */ r(k, { spacing: 1.5, children: N.map(([S, w], j) => {
966
- const y = [...x, S], C = j === N.length - 1, O = w.subProperties && !K(w.subProperties), R = w.displayName || S, W = !I;
960
+ return /* @__PURE__ */ r(Y, { children: d("maker.properties.noProperties") });
961
+ const N = T(Object.entries(u), ([, S]) => S.displayName);
962
+ return /* @__PURE__ */ r(k, { spacing: 1.5, children: N.map(([S, I], j) => {
963
+ const b = [...C, S], x = j === N.length - 1, O = I.subProperties && !K(I.subProperties), z = I.displayName || S, E = !w;
967
964
  return /* @__PURE__ */ r(P, { sx: { position: "relative" }, children: /* @__PURE__ */ v(k, { direction: "row", children: [
968
- x.length > 0 && /* @__PURE__ */ v(
965
+ C.length > 0 && /* @__PURE__ */ v(
969
966
  P,
970
967
  {
971
968
  sx: {
@@ -1002,7 +999,7 @@ function rt({
1002
999
  }
1003
1000
  }
1004
1001
  ),
1005
- !C && /* @__PURE__ */ r(
1002
+ !x && /* @__PURE__ */ r(
1006
1003
  P,
1007
1004
  {
1008
1005
  sx: {
@@ -1036,16 +1033,16 @@ function rt({
1036
1033
  control: /* @__PURE__ */ r(
1037
1034
  rr,
1038
1035
  {
1039
- checked: w.isNeedGenerate,
1040
- disabled: W,
1041
- onChange: (J) => {
1042
- f(y, w, {
1043
- isNeedGenerate: J.target.checked
1036
+ checked: I.isNeedGenerate,
1037
+ disabled: E,
1038
+ onChange: (F) => {
1039
+ f(b, I, {
1040
+ isNeedGenerate: F.target.checked
1044
1041
  });
1045
1042
  }
1046
1043
  }
1047
1044
  ),
1048
- label: R,
1045
+ label: z,
1049
1046
  sx: {
1050
1047
  minWidth: "180px",
1051
1048
  maxWidth: "280px",
@@ -1057,58 +1054,58 @@ function rt({
1057
1054
  }
1058
1055
  ),
1059
1056
  /* @__PURE__ */ r(
1060
- z,
1057
+ V,
1061
1058
  {
1062
1059
  size: "small",
1063
1060
  fullWidth: !0,
1064
- label: c("maker.properties.llmPropertyDescribe"),
1065
- value: w.describe,
1066
- onChange: (J) => {
1067
- f(y, w, {
1068
- describe: J.target.value
1061
+ label: d("maker.properties.llmPropertyDescribe"),
1062
+ value: I.describe,
1063
+ onChange: (F) => {
1064
+ f(b, I, {
1065
+ describe: F.target.value
1069
1066
  });
1070
1067
  },
1071
- disabled: !w.isNeedGenerate
1068
+ disabled: !I.isNeedGenerate
1072
1069
  }
1073
1070
  )
1074
1071
  ]
1075
1072
  }
1076
1073
  ),
1077
- O && /* @__PURE__ */ r(P, { sx: { ml: 3 }, children: g(
1078
- w.subProperties,
1079
- y,
1080
- w.isNeedGenerate && I
1074
+ O && /* @__PURE__ */ r(P, { sx: { ml: 3 }, children: y(
1075
+ I.subProperties,
1076
+ b,
1077
+ I.isNeedGenerate && w
1081
1078
  ) })
1082
1079
  ] })
1083
1080
  ] }) }, S);
1084
1081
  }) });
1085
1082
  };
1086
1083
  return /* @__PURE__ */ v(ye, { open: e, onClose: i, maxWidth: "lg", fullWidth: !0, children: [
1087
- /* @__PURE__ */ r(Re, { children: b || c("maker.properties.llmConfigTitle") }),
1088
- /* @__PURE__ */ r(Ee, { children: /* @__PURE__ */ r(
1084
+ /* @__PURE__ */ r(Ee, { children: g || d("maker.properties.llmConfigTitle") }),
1085
+ /* @__PURE__ */ r(Ae, { children: /* @__PURE__ */ r(
1089
1086
  P,
1090
1087
  {
1091
1088
  sx: {
1092
1089
  my: 3
1093
1090
  },
1094
- children: m ? /* @__PURE__ */ r(T, { children: c("maker.properties.loading") }) : l ? s ? /* @__PURE__ */ v(k, { spacing: 3, children: [
1095
- /* @__PURE__ */ r(T, { variant: "subtitle2", children: c("maker.properties.llmConfigInstructions") }),
1096
- g(s.properties)
1097
- ] }) : /* @__PURE__ */ r(T, { children: c("maker.properties.loading") }) : /* @__PURE__ */ r(T, { color: "error", children: c("maker.properties.componentNotFound") })
1091
+ children: m ? /* @__PURE__ */ r(D, { children: d("maker.properties.loading") }) : l ? s ? /* @__PURE__ */ v(k, { spacing: 3, children: [
1092
+ /* @__PURE__ */ r(D, { variant: "subtitle2", children: d("maker.properties.llmConfigInstructions") }),
1093
+ y(s.properties)
1094
+ ] }) : /* @__PURE__ */ r(D, { children: d("maker.properties.loading") }) : /* @__PURE__ */ r(D, { color: "error", children: d("maker.properties.componentNotFound") })
1098
1095
  }
1099
1096
  ) }),
1100
- /* @__PURE__ */ v(Ae, { children: [
1101
- /* @__PURE__ */ r(E, { onClick: i, children: c("common.cancel") }),
1102
- /* @__PURE__ */ r(E, { variant: "contained", onClick: n, disabled: !s || m, children: c("common.confirm") })
1097
+ /* @__PURE__ */ v(De, { children: [
1098
+ /* @__PURE__ */ r(A, { onClick: i, children: d("common.cancel") }),
1099
+ /* @__PURE__ */ r(A, { variant: "contained", onClick: o, disabled: !s || m, children: d("common.confirm") })
1103
1100
  ] })
1104
1101
  ] });
1105
1102
  }
1106
- function tt({
1103
+ function at({
1107
1104
  label: e,
1108
1105
  value: t,
1109
- onChange: o
1106
+ onChange: n
1110
1107
  }) {
1111
- const [l, h] = B(!1);
1108
+ const [l, h] = U(!1);
1112
1109
  return /* @__PURE__ */ v(
1113
1110
  k,
1114
1111
  {
@@ -1117,23 +1114,23 @@ function tt({
1117
1114
  },
1118
1115
  children: [
1119
1116
  /* @__PURE__ */ r(
1120
- z,
1117
+ V,
1121
1118
  {
1122
1119
  label: e,
1123
1120
  size: "small",
1124
1121
  value: t,
1125
- onChange: (p) => o?.(p.target.value),
1122
+ onChange: (p) => n?.(p.target.value),
1126
1123
  slotProps: {
1127
1124
  input: {
1128
1125
  sx: {
1129
1126
  pr: 0
1130
1127
  },
1131
- endAdornment: /* @__PURE__ */ r($, { position: "end", children: /* @__PURE__ */ r(
1128
+ endAdornment: /* @__PURE__ */ r(_, { position: "end", children: /* @__PURE__ */ r(
1132
1129
  Pe,
1133
1130
  {
1134
1131
  onChange: ({ response: p }) => {
1135
- const d = p?.data?.filename;
1136
- d && o?.(d);
1132
+ const c = p?.data?.filename;
1133
+ c && n?.(c);
1137
1134
  }
1138
1135
  }
1139
1136
  ) })
@@ -1145,7 +1142,7 @@ function tt({
1145
1142
  P,
1146
1143
  {
1147
1144
  component: "img",
1148
- src: ne(t),
1145
+ src: te(t),
1149
1146
  alt: e,
1150
1147
  onClick: () => h(!0),
1151
1148
  sx: {
@@ -1158,18 +1155,18 @@ function tt({
1158
1155
  }
1159
1156
  }
1160
1157
  ),
1161
- /* @__PURE__ */ r(ye, { open: l, onClose: () => h(!1), children: /* @__PURE__ */ r(P, { component: "img", sx: { objectFit: "contain" }, src: ne(t), alt: e }) })
1158
+ /* @__PURE__ */ r(ye, { open: l, onClose: () => h(!1), children: /* @__PURE__ */ r(P, { component: "img", sx: { objectFit: "contain" }, src: te(t), alt: e }) })
1162
1159
  ]
1163
1160
  }
1164
1161
  );
1165
1162
  }
1166
1163
  function fe(e, t = "") {
1167
- return Wr(e, (o, l, h) => {
1164
+ return Dr(e, (n, l, h) => {
1168
1165
  const p = t ? `${t}.${h}` : h;
1169
- return Er(l) ? jr(o, fe(l, p)) : o[p] = l, o;
1166
+ return Vr(l) ? Or(n, fe(l, p)) : n[p] = l, n;
1170
1167
  }, {});
1171
1168
  }
1172
- const nt = [
1169
+ const ct = [
1173
1170
  { value: "string", label: "Text" },
1174
1171
  { value: "multiline", label: "Text (Multiline)" },
1175
1172
  { value: "number", label: "Number" },
@@ -1183,14 +1180,14 @@ const nt = [
1183
1180
  { value: "component", label: "Component" },
1184
1181
  { value: "custom", label: "Custom (Render by a Component)" }
1185
1182
  ];
1186
- function Z(e, t, o) {
1187
- return !e || !o ? !1 : Object.values(e).some(({ data: l }) => l.id !== t && l.key === o);
1183
+ function X(e, t, n) {
1184
+ return !e || !n ? !1 : Object.values(e).some(({ data: l }) => l.id !== t && l.key === n);
1188
1185
  }
1189
1186
  function be(e, t) {
1190
1187
  return !e || !t ? !1 : e[t]?.data.visible ?? !0;
1191
1188
  }
1192
- function on({ componentId: e }) {
1193
- const { state: { components: t } } = oe(), l = t[e]?.data;
1189
+ function pn({ componentId: e }) {
1190
+ const { state: { components: t } } = ie(), l = t[e]?.data;
1194
1191
  return l ? /* @__PURE__ */ r(k, {
1195
1192
  sx: {
1196
1193
  maxHeight: "100%",
@@ -1200,34 +1197,34 @@ function on({ componentId: e }) {
1200
1197
  sx: {
1201
1198
  p: 2
1202
1199
  },
1203
- children: /* @__PURE__ */ r(Kr, { FallbackComponent: Lr, resetKeys: [e], children: /* @__PURE__ */ r(it, { value: l, componentId: e }) })
1200
+ children: /* @__PURE__ */ r(Wr, { FallbackComponent: Gr, resetKeys: [e], children: /* @__PURE__ */ r(dt, { value: l, componentId: e }) })
1204
1201
  })
1205
1202
  }) : null;
1206
1203
  }
1207
- function it({ value: e, componentId: t }) {
1208
- const { t: o } = V(), { localState: { currentLocale: l, customComponentPreviewerProperties: h }, state: { config: { defaultLocale: p } }, localActions: { setCustomComponentPreviewerProperties: d } } = oe(), b = Q(e).doc, m = ve(), c = H(() => h?.[t] ?? {}, [t, h]), s = Nr({
1204
+ function dt({ value: e, componentId: t }) {
1205
+ const { t: n } = R(), { localState: { currentLocale: l, customComponentPreviewerProperties: h }, state: { config: { defaultLocale: p } }, localActions: { setCustomComponentPreviewerProperties: c } } = ie(), g = q(e).doc, m = ve(), d = H(() => h?.[t] ?? {}, [t, h]), s = Ir({
1209
1206
  componentId: t,
1210
1207
  propertiesValue: {
1211
- ...c
1208
+ ...d
1212
1209
  }
1213
1210
  });
1214
- return U(() => {
1211
+ return B(() => {
1215
1212
  s.componentId !== t && (s.componentId = t, s.propertiesValue = {
1216
- ...c
1213
+ ...d
1217
1214
  });
1218
- }, [t, c, s]), U(() => {
1215
+ }, [t, d, s]), B(() => {
1219
1216
  if (s.componentId !== t)
1220
1217
  return;
1221
1218
  const a = Object.fromEntries(Object.values(e.properties ?? {}).map(({ data: i }) => [
1222
1219
  i.id,
1223
1220
  {
1224
- value: s.propertiesValue[i.id]?.value ?? yr(i, i.locales?.[l]?.defaultValue ?? i.locales?.[p]?.defaultValue, {
1221
+ value: s.propertiesValue[i.id]?.value ?? gr(i, i.locales?.[l]?.defaultValue ?? i.locales?.[p]?.defaultValue, {
1225
1222
  locale: l,
1226
1223
  defaultLocale: p
1227
1224
  })
1228
1225
  }
1229
1226
  ]));
1230
- d(t, a);
1227
+ c(t, a);
1231
1228
  }, [JSON.stringify(s.propertiesValue), t, s.componentId]), /* @__PURE__ */ r(k, {
1232
1229
  sx: {
1233
1230
  height: "100%"
@@ -1237,14 +1234,14 @@ function it({ value: e, componentId: t }) {
1237
1234
  gap: 2
1238
1235
  },
1239
1236
  children: [
1240
- /* @__PURE__ */ r(ot, { config: e }),
1241
- /* @__PURE__ */ r(st, {
1237
+ /* @__PURE__ */ r(ut, { config: e }),
1238
+ /* @__PURE__ */ r(mt, {
1242
1239
  config: e,
1243
1240
  currentLocale: l,
1244
1241
  defaultLocale: p,
1245
1242
  allComponents: m,
1246
1243
  onUpdateConfig: (a) => {
1247
- b.transact(() => {
1244
+ g.transact(() => {
1248
1245
  a(e);
1249
1246
  });
1250
1247
  }
@@ -1257,14 +1254,14 @@ function it({ value: e, componentId: t }) {
1257
1254
  alignItems: "center"
1258
1255
  },
1259
1256
  children: [
1260
- /* @__PURE__ */ r(T, { variant: "subtitle1", children: o("renderer") }),
1261
- /* @__PURE__ */ v(z, {
1257
+ /* @__PURE__ */ r(D, { variant: "subtitle1", children: n("renderer") }),
1258
+ /* @__PURE__ */ v(V, {
1262
1259
  hiddenLabel: !0,
1263
1260
  size: "small",
1264
1261
  select: !0,
1265
1262
  value: e.renderer?.type || "react-component",
1266
1263
  onChange: (a) => {
1267
- b.transact(() => {
1264
+ g.transact(() => {
1268
1265
  const i = a.target.value;
1269
1266
  e.renderer ??= { type: i }, e.renderer.type = i;
1270
1267
  });
@@ -1279,18 +1276,18 @@ function it({ value: e, componentId: t }) {
1279
1276
  })
1280
1277
  ]
1281
1278
  }),
1282
- e.renderer?.type === "component" && /* @__PURE__ */ r(ft, { value: e }),
1283
- e.renderer?.type === "react-component" && /* @__PURE__ */ r(ht, { value: e }),
1279
+ e.renderer?.type === "component" && /* @__PURE__ */ r(Ct, { value: e }),
1280
+ e.renderer?.type === "react-component" && /* @__PURE__ */ r(vt, { value: e }),
1284
1281
  /* @__PURE__ */ r(qe, {
1285
1282
  config: e,
1286
1283
  currentLocale: l,
1287
1284
  defaultLocale: p,
1288
1285
  allComponents: m,
1289
1286
  propertiesValue: s.propertiesValue,
1290
- onChange: ({ value: a, id: i, path: n }) => {
1291
- const f = [...n, "data"];
1292
- if (!zr(e, f)) {
1293
- he.warning(o("cannotFindPropertyKey", {
1287
+ onChange: ({ value: a, id: i, path: o }) => {
1288
+ const f = [...o, "data"];
1289
+ if (!Nr(e, f)) {
1290
+ he.warning(n("cannotFindPropertyKey", {
1294
1291
  key: f.join(".")
1295
1292
  }));
1296
1293
  return;
@@ -1304,31 +1301,31 @@ function it({ value: e, componentId: t }) {
1304
1301
  })
1305
1302
  });
1306
1303
  }
1307
- function ot({ config: e }) {
1308
- const { t } = V();
1304
+ function ut({ config: e }) {
1305
+ const { t } = R();
1309
1306
  return /* @__PURE__ */ r(le, { children: /* @__PURE__ */ v(k, {
1310
1307
  sx: {
1311
1308
  gap: 2
1312
1309
  },
1313
1310
  children: [
1314
- /* @__PURE__ */ r(T, { variant: "subtitle1", children: t("basicInfo") }),
1315
- /* @__PURE__ */ r(z, {
1311
+ /* @__PURE__ */ r(D, { variant: "subtitle1", children: t("basicInfo") }),
1312
+ /* @__PURE__ */ r(V, {
1316
1313
  label: t("name"),
1317
1314
  size: "small",
1318
1315
  value: e.name || "",
1319
- onChange: (o) => e.name = o.target.value
1316
+ onChange: (n) => e.name = n.target.value
1320
1317
  }),
1321
- /* @__PURE__ */ r(z, {
1318
+ /* @__PURE__ */ r(V, {
1322
1319
  label: t("description"),
1323
1320
  size: "small",
1324
1321
  multiline: !0,
1325
1322
  minRows: 2,
1326
1323
  maxRows: 10,
1327
1324
  value: e.description || "",
1328
- onChange: (o) => e.description = o.target.value,
1325
+ onChange: (n) => e.description = n.target.value,
1329
1326
  slotProps: {
1330
1327
  input: {
1331
- endAdornment: /* @__PURE__ */ r($, { position: "end", sx: { mt: -1.5 }, children: /* @__PURE__ */ r(bt, { config: e }) })
1328
+ endAdornment: /* @__PURE__ */ r(_, { position: "end", sx: { mt: -1.5 }, children: /* @__PURE__ */ r(Pt, { config: e }) })
1332
1329
  },
1333
1330
  htmlInput: { maxLength: 200 }
1334
1331
  }
@@ -1339,37 +1336,37 @@ function ot({ config: e }) {
1339
1336
  multiple: !0,
1340
1337
  freeSolo: !0,
1341
1338
  value: e.tags ?? [],
1342
- onChange: (o, l) => e.tags = l,
1343
- renderInput: (o) => /* @__PURE__ */ r(z, { label: t("tags"), ...o })
1339
+ onChange: (n, l) => e.tags = l,
1340
+ renderInput: (n) => /* @__PURE__ */ r(V, { label: t("tags"), ...n })
1344
1341
  }),
1345
- /* @__PURE__ */ r(tt, {
1342
+ /* @__PURE__ */ r(at, {
1346
1343
  label: t("previewImage"),
1347
1344
  value: e.previewImage || "",
1348
- onChange: (o) => e.previewImage = o
1345
+ onChange: (n) => e.previewImage = n
1349
1346
  })
1350
1347
  ]
1351
1348
  }) });
1352
1349
  }
1353
- function Ge({ data: e, params: t, visible: o, config: l, currentLocale: h, defaultLocale: p, allComponents: d, onUpdateConfig: b }) {
1354
- const { t: m } = V(), c = H(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? dt : L, [e.type]);
1355
- return /* @__PURE__ */ r(Xr, {
1350
+ function Ge({ data: e, params: t, visible: n, config: l, currentLocale: h, defaultLocale: p, allComponents: c, onUpdateConfig: g }) {
1351
+ const { t: m } = R(), d = H(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? bt : L, [e.type]);
1352
+ return /* @__PURE__ */ r(it, {
1356
1353
  preview: t.preview,
1357
1354
  drop: t.drop,
1358
1355
  drag: t.drag,
1359
1356
  isDragging: t.isDragging,
1360
1357
  onDelete: () => {
1361
- b((s) => {
1358
+ g((s) => {
1362
1359
  if (s.properties) {
1363
- const i = Object.entries(s.properties).sort(([, f], [, g]) => f.index - g.index);
1364
- delete s.properties[e.id], i.filter(([f]) => f !== e.id).forEach(([, f], g) => {
1365
- f.index = g;
1360
+ const i = Object.entries(s.properties).sort(([, f], [, y]) => f.index - y.index);
1361
+ delete s.properties[e.id], i.filter(([f]) => f !== e.id).forEach(([, f], y) => {
1362
+ f.index = y;
1366
1363
  });
1367
1364
  }
1368
1365
  });
1369
1366
  },
1370
- visible: o,
1367
+ visible: n,
1371
1368
  onVisibilityChange: (s) => {
1372
- b((a) => {
1369
+ g((a) => {
1373
1370
  const i = a.properties[e.id].data;
1374
1371
  i.visible = s;
1375
1372
  });
@@ -1381,7 +1378,7 @@ function Ge({ data: e, params: t, visible: o, config: l, currentLocale: h, defau
1381
1378
  gap: 2
1382
1379
  },
1383
1380
  children: [
1384
- /* @__PURE__ */ r(z, {
1381
+ /* @__PURE__ */ r(V, {
1385
1382
  label: m("key"),
1386
1383
  size: "small",
1387
1384
  required: !0,
@@ -1389,31 +1386,31 @@ function Ge({ data: e, params: t, visible: o, config: l, currentLocale: h, defau
1389
1386
  width: "calc(100% - 80px - 8px)",
1390
1387
  flex: 1,
1391
1388
  "& .MuiOutlinedInput-root": {
1392
- borderColor: e.key ? Z(l.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
1389
+ borderColor: e.key ? X(l.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
1393
1390
  },
1394
1391
  "& .MuiFormLabel-root": {
1395
- color: e.key ? Z(l.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
1392
+ color: e.key ? X(l.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
1396
1393
  },
1397
1394
  "& .MuiFormLabel-root.Mui-focused": {
1398
- color: e.key ? Z(l.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
1395
+ color: e.key ? X(l.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
1399
1396
  }
1400
1397
  },
1401
1398
  value: e.key || "",
1402
1399
  onChange: (s) => {
1403
- b((a) => {
1400
+ g((a) => {
1404
1401
  const i = a.properties[e.id].data;
1405
1402
  i.key = s.target.value.trim();
1406
1403
  });
1407
1404
  },
1408
1405
  slotProps: {
1409
1406
  input: {
1410
- endAdornment: !e.key || e.key && Z(l.properties, e.id, e.key) ? /* @__PURE__ */ r($, {
1407
+ endAdornment: !e.key || e.key && X(l.properties, e.id, e.key) ? /* @__PURE__ */ r(_, {
1411
1408
  position: "end",
1412
1409
  sx: {
1413
1410
  width: 16,
1414
1411
  ml: 0
1415
1412
  },
1416
- children: /* @__PURE__ */ r(_, { title: e.key ? m("duplicateKey") : m("requiredKey"), children: /* @__PURE__ */ r(Me, {
1413
+ children: /* @__PURE__ */ r(J, { title: e.key ? m("duplicateKey") : m("requiredKey"), children: /* @__PURE__ */ r(Me, {
1417
1414
  sx: {
1418
1415
  color: e.key ? "warning.main" : "error.main",
1419
1416
  fontSize: 16
@@ -1429,35 +1426,35 @@ function Ge({ data: e, params: t, visible: o, config: l, currentLocale: h, defau
1429
1426
  gap: 1
1430
1427
  },
1431
1428
  children: [
1432
- /* @__PURE__ */ r(z, {
1429
+ /* @__PURE__ */ r(V, {
1433
1430
  label: m("label"),
1434
1431
  size: "small",
1435
1432
  sx: { flex: 1 },
1436
1433
  value: (e.locales?.[h]?.name ?? e.locales?.[p]?.name) || "",
1437
1434
  onChange: (s) => {
1438
- b((a) => {
1435
+ g((a) => {
1439
1436
  const i = a.properties[e.id].data;
1440
1437
  i.locales ??= {}, i.locales[h] ??= {}, i.locales[h].name = s.target.value;
1441
1438
  });
1442
1439
  }
1443
1440
  }),
1444
- /* @__PURE__ */ r(z, {
1441
+ /* @__PURE__ */ r(V, {
1445
1442
  label: m("type"),
1446
1443
  size: "small",
1447
1444
  select: !0,
1448
1445
  sx: { flex: 1 },
1449
1446
  value: e.type === "string" && e.multiline ? "multiline" : e.type || "string",
1450
1447
  onChange: (s) => {
1451
- b((a) => {
1448
+ g((a) => {
1452
1449
  const i = a.properties[e.id].data;
1453
1450
  if (i.locales)
1454
1451
  for (const f of Object.keys(i.locales))
1455
1452
  i.locales[f].defaultValue = void 0;
1456
- const n = s.target.value;
1457
- n === "multiline" ? (i.type = "string", i.multiline = !0) : (typeof i.multiline < "u" && delete i.multiline, i.type = n);
1453
+ const o = s.target.value;
1454
+ o === "multiline" ? (i.type = "string", i.multiline = !0) : (typeof i.multiline < "u" && delete i.multiline, i.type = o);
1458
1455
  });
1459
1456
  },
1460
- children: nt.map((s) => /* @__PURE__ */ r(ce, { value: s.value, children: s.label }, s.value))
1457
+ children: ct.map((s) => /* @__PURE__ */ r(ce, { value: s.value, children: s.label }, s.value))
1461
1458
  })
1462
1459
  ]
1463
1460
  }),
@@ -1467,8 +1464,8 @@ function Ge({ data: e, params: t, visible: o, config: l, currentLocale: h, defau
1467
1464
  gap: 1
1468
1465
  },
1469
1466
  children: [
1470
- /* @__PURE__ */ r(c, {
1471
- allComponents: d,
1467
+ /* @__PURE__ */ r(d, {
1468
+ allComponents: c,
1472
1469
  defaultLocale: p,
1473
1470
  component: l,
1474
1471
  property: e,
@@ -1477,41 +1474,41 @@ function Ge({ data: e, params: t, visible: o, config: l, currentLocale: h, defau
1477
1474
  fullWidth: !0,
1478
1475
  value: e.locales?.[h]?.defaultValue,
1479
1476
  onChange: (s, a) => {
1480
- b((i) => {
1481
- const n = i.properties[e.id].data;
1477
+ g((i) => {
1478
+ const o = i.properties[e.id].data;
1482
1479
  if (a?.forceUpdateProperty) {
1483
- const f = fe(n), g = fe(s);
1484
- Object.keys(g).forEach((u) => {
1485
- f[u] || We(n, u, g[u]);
1480
+ const f = fe(o), y = fe(s);
1481
+ Object.keys(y).forEach((u) => {
1482
+ f[u] || Ue(o, u, y[u]);
1486
1483
  });
1487
1484
  } else
1488
- n.locales ??= {}, n.locales[h] ??= {}, n.locales[h].defaultValue = s;
1485
+ o.locales ??= {}, o.locales[h] ??= {}, o.locales[h].defaultValue = s;
1489
1486
  });
1490
1487
  }
1491
1488
  }),
1492
- e.type === "custom" ? /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(at, { property: e, allComponents: d }) }) : null
1489
+ e.type === "custom" ? /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(ht, { property: e, allComponents: c }) }) : null
1493
1490
  ]
1494
1491
  })
1495
1492
  ]
1496
1493
  })
1497
1494
  });
1498
1495
  }
1499
- function lt(e, t) {
1500
- const [o, l] = B(0);
1501
- return U(() => {
1496
+ function pt(e, t) {
1497
+ const [n, l] = U(0);
1498
+ return B(() => {
1502
1499
  const p = setTimeout(() => {
1503
1500
  if (e.current) {
1504
- let d = e.current.parentElement, b = 0;
1505
- for (; d; )
1506
- d.classList.contains("property-container") && b++, d = d.parentElement;
1507
- l(b);
1501
+ let c = e.current.parentElement, g = 0;
1502
+ for (; c; )
1503
+ c.classList.contains("property-container") && g++, c = c.parentElement;
1504
+ l(g);
1508
1505
  }
1509
1506
  }, 100);
1510
1507
  return () => clearTimeout(p);
1511
- }, [e, t]), o;
1508
+ }, [e, t]), n;
1512
1509
  }
1513
- function st({ config: e, currentLocale: t, defaultLocale: o, allComponents: l, onUpdateConfig: h, useI18nEditor: p = !0 }) {
1514
- const { t: d } = V(), b = ke({ variant: "dialog" }), m = e.properties && D(Object.values(e.properties), "index");
1510
+ function mt({ config: e, currentLocale: t, defaultLocale: n, allComponents: l, onUpdateConfig: h, useI18nEditor: p = !0 }) {
1511
+ const { t: c } = R(), g = ke({ variant: "dialog" }), m = e.properties && T(Object.values(e.properties), "index");
1515
1512
  return /* @__PURE__ */ r(le, { children: /* @__PURE__ */ v(k, {
1516
1513
  sx: {
1517
1514
  gap: 2
@@ -1525,22 +1522,22 @@ function st({ config: e, currentLocale: t, defaultLocale: o, allComponents: l, o
1525
1522
  justifyContent: "space-between"
1526
1523
  },
1527
1524
  children: [
1528
- /* @__PURE__ */ r(T, { variant: "subtitle1", children: d("properties") }),
1525
+ /* @__PURE__ */ r(D, { variant: "subtitle1", children: c("properties") }),
1529
1526
  /* @__PURE__ */ r(P, {
1530
1527
  sx: {
1531
1528
  flex: 1
1532
1529
  }
1533
1530
  }),
1534
- p && /* @__PURE__ */ r(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(b), children: /* @__PURE__ */ r(Ke, { fontSize: "small" }) })
1531
+ p && /* @__PURE__ */ r(A, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(g), children: /* @__PURE__ */ r(Be, { fontSize: "small" }) })
1535
1532
  ]
1536
1533
  }),
1537
- e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ r($e, {
1534
+ e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ r(He, {
1538
1535
  component: k,
1539
1536
  gap: 2,
1540
1537
  list: e.properties,
1541
- renderItem: (c, s, a) => {
1542
- const i = be(e.properties, c.id);
1543
- return /* @__PURE__ */ r(G, {
1538
+ renderItem: (d, s, a) => {
1539
+ const i = be(e.properties, d.id);
1540
+ return /* @__PURE__ */ r($, {
1544
1541
  elevation: 0,
1545
1542
  className: "property-container",
1546
1543
  sx: {
@@ -1554,46 +1551,46 @@ function st({ config: e, currentLocale: t, defaultLocale: o, allComponents: l, o
1554
1551
  gap: 2
1555
1552
  },
1556
1553
  children: /* @__PURE__ */ r(Ge, {
1557
- data: c,
1554
+ data: d,
1558
1555
  params: a,
1559
1556
  visible: i,
1560
1557
  config: e,
1561
1558
  currentLocale: t,
1562
- defaultLocale: o,
1559
+ defaultLocale: n,
1563
1560
  allComponents: l,
1564
1561
  onUpdateConfig: h
1565
1562
  })
1566
1563
  })
1567
- }, c.id);
1564
+ }, d.id);
1568
1565
  }
1569
- }) : /* @__PURE__ */ r(q, { style: { fontSize: 12 }, children: d("maker.properties.noProperties") }),
1570
- /* @__PURE__ */ r(E, {
1566
+ }) : /* @__PURE__ */ r(Y, { style: { fontSize: 12 }, children: c("maker.properties.noProperties") }),
1567
+ /* @__PURE__ */ r(A, {
1571
1568
  fullWidth: !0,
1572
1569
  variant: "outlined",
1573
1570
  className: "ignore-style-override",
1574
1571
  onClick: () => {
1575
- h((c) => {
1572
+ h((d) => {
1576
1573
  const s = _e();
1577
- c.properties ??= {}, c.properties[s] ??= { index: m?.length || 0, data: { id: s } };
1574
+ d.properties ??= {}, d.properties[s] ??= { index: m?.length || 0, data: { id: s } };
1578
1575
  });
1579
1576
  },
1580
- startIcon: /* @__PURE__ */ r(Be, {}),
1581
- children: d("addObject", { object: d("property") })
1577
+ startIcon: /* @__PURE__ */ r(Le, {}),
1578
+ children: c("addObject", { object: c("property") })
1582
1579
  }),
1583
- p && /* @__PURE__ */ r(Ye, { ...Fe(b), component: e })
1580
+ p && /* @__PURE__ */ r(Ye, { ...Je(g), component: e })
1584
1581
  ]
1585
1582
  }) });
1586
1583
  }
1587
- function at({ property: e, allComponents: t }) {
1588
- const o = ke({ variant: "popper" });
1589
- return /* @__PURE__ */ v(F, { children: [
1590
- /* @__PURE__ */ r(E, { sx: { minWidth: 0 }, ...we(o), children: /* @__PURE__ */ r(Le, { fontSize: "small" }) }),
1591
- /* @__PURE__ */ r(ir, { ...Ur(o), children: /* @__PURE__ */ r(vr, { onClickAway: o.close, children: /* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(P, {
1584
+ function ht({ property: e, allComponents: t }) {
1585
+ const n = ke({ variant: "popper" });
1586
+ return /* @__PURE__ */ v(M, { children: [
1587
+ /* @__PURE__ */ r(A, { sx: { minWidth: 0 }, ...we(n), children: /* @__PURE__ */ r(Fe, { fontSize: "small" }) }),
1588
+ /* @__PURE__ */ r(ir, { ...Tr(n), children: /* @__PURE__ */ r(xr, { onClickAway: n.close, children: /* @__PURE__ */ r($, { children: /* @__PURE__ */ r(P, {
1592
1589
  sx: {
1593
1590
  width: 500,
1594
1591
  p: 2
1595
1592
  },
1596
- children: /* @__PURE__ */ r(Ie, {
1593
+ children: /* @__PURE__ */ r(Se, {
1597
1594
  value: e.componentId,
1598
1595
  onChange: (l, h) => e.componentId = h,
1599
1596
  allComponents: t
@@ -1601,18 +1598,18 @@ function at({ property: e, allComponents: t }) {
1601
1598
  }) }) }) })
1602
1599
  ] });
1603
1600
  }
1604
- function ct({ value: e, valueImmutable: t, onChange: o, defaultLocale: l, allComponents: h }) {
1605
- const [p, d] = B(!1), { t: b, locale: m } = V(), c = typeof e?.componentId == "string" ? h[e.componentId]?.data : void 0;
1606
- return c ? /* @__PURE__ */ v(P, { sx: { width: "100%", position: "relative" }, children: [
1607
- /* @__PURE__ */ r(Y, {
1601
+ function ft({ value: e, valueImmutable: t, onChange: n, defaultLocale: l, allComponents: h }) {
1602
+ const [p, c] = U(!1), { t: g, locale: m } = R(), d = typeof e?.componentId == "string" ? h[e.componentId]?.data : void 0;
1603
+ return d ? /* @__PURE__ */ v(P, { sx: { width: "100%", position: "relative" }, children: [
1604
+ /* @__PURE__ */ r(G, {
1608
1605
  sx: { minWidth: 0 },
1609
- disabled: !c,
1606
+ disabled: !d,
1610
1607
  size: "small",
1611
- onClick: () => d(!p),
1608
+ onClick: () => c(!p),
1612
1609
  color: p ? "primary" : "default",
1613
- children: /* @__PURE__ */ r(Le, { fontSize: "small" })
1610
+ children: /* @__PURE__ */ r(Fe, { fontSize: "small" })
1614
1611
  }),
1615
- p && /* @__PURE__ */ r(tr, { in: p, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ v(G, {
1612
+ p && /* @__PURE__ */ r(tr, { in: p, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ v($, {
1616
1613
  elevation: 1,
1617
1614
  sx: {
1618
1615
  mt: 1,
@@ -1629,215 +1626,215 @@ function ct({ value: e, valueImmutable: t, onChange: o, defaultLocale: l, allCom
1629
1626
  mb: 2
1630
1627
  },
1631
1628
  children: /* @__PURE__ */ r(qe, {
1632
- config: c,
1629
+ config: d,
1633
1630
  currentLocale: m,
1634
1631
  defaultLocale: l,
1635
1632
  allComponents: h,
1636
1633
  propertiesValue: e?.properties,
1637
1634
  onChange: ({ id: s, value: a }) => {
1638
- const i = me(a.value), n = JSON.parse(JSON.stringify(e));
1639
- n?.componentId && (t ? o?.({ ...n, properties: { ...n.properties, [s]: { value: i } } }) : (n.properties = n.properties ?? {}, n.properties[s] = { value: i }, o?.(n)));
1635
+ const i = me(a.value), o = JSON.parse(JSON.stringify(e));
1636
+ o?.componentId && (t ? n?.({ ...o, properties: { ...o.properties, [s]: { value: i } } }) : (o.properties = o.properties ?? {}, o.properties[s] = { value: i }, n?.(o)));
1640
1637
  }
1641
1638
  })
1642
1639
  }),
1643
- /* @__PURE__ */ r(E, { size: "small", onClick: () => d(!1), sx: { mt: 1 }, children: b("close") })
1640
+ /* @__PURE__ */ r(A, { size: "small", onClick: () => c(!1), sx: { mt: 1 }, children: g("close") })
1644
1641
  ]
1645
1642
  }) })
1646
1643
  ] }) : null;
1647
1644
  }
1648
- function Ye({ type: e = "properties", component: t, ...o }) {
1649
- const { t: l } = V(), { state: { components: h, supportedLocales: p, config: { defaultLocale: d } } } = oe(), b = ve(), m = Q(t).doc, c = e === "properties" ? t.properties : e === "parameters" && t.renderer?.type === "component" ? h[t.renderer.componentId]?.data.properties : void 0, s = t.renderer?.type === "component" ? t : void 0;
1650
- return /* @__PURE__ */ v(ye, { ...o, fullWidth: !0, maxWidth: "lg", children: [
1651
- /* @__PURE__ */ r(Re, { children: l("i18nEditorTitle") }),
1652
- /* @__PURE__ */ r(Ee, { children: c && /* @__PURE__ */ r(k, { children: /* @__PURE__ */ v(Ne, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1653
- /* @__PURE__ */ r(je, { children: /* @__PURE__ */ r(re, { children: p.map(({ locale: a, name: i }) => /* @__PURE__ */ r(te, { children: /* @__PURE__ */ v(T, {
1645
+ function Ye({ type: e = "properties", component: t, ...n }) {
1646
+ const { t: l } = R(), { state: { components: h, supportedLocales: p, config: { defaultLocale: c } } } = ie(), g = ve(), m = q(t).doc, d = e === "properties" ? t.properties : e === "parameters" && t.renderer?.type === "component" ? h[t.renderer.componentId]?.data.properties : void 0, s = t.renderer?.type === "component" ? t : void 0;
1647
+ return /* @__PURE__ */ v(ye, { ...n, fullWidth: !0, maxWidth: "lg", children: [
1648
+ /* @__PURE__ */ r(Ee, { children: l("i18nEditorTitle") }),
1649
+ /* @__PURE__ */ r(Ae, { children: d && /* @__PURE__ */ r(k, { children: /* @__PURE__ */ v(je, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1650
+ /* @__PURE__ */ r(ze, { children: /* @__PURE__ */ r(ee, { children: p.map(({ locale: a, name: i }) => /* @__PURE__ */ r(re, { children: /* @__PURE__ */ v(D, {
1654
1651
  sx: {
1655
1652
  color: "text.primary"
1656
1653
  },
1657
1654
  children: [
1658
1655
  i,
1659
- d === a && /* @__PURE__ */ r(Sr, { sx: { fontSize: 12 } })
1656
+ c === a && /* @__PURE__ */ r(Sr, { sx: { fontSize: 12 } })
1660
1657
  ]
1661
1658
  }) }, a)) }) }),
1662
- /* @__PURE__ */ r(ze, { children: D(Object.values(c), "index").map(({ data: a }) => /* @__PURE__ */ r(re, { children: p.map(({ locale: i }) => /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(k, {
1659
+ /* @__PURE__ */ r(Ve, { children: T(Object.values(d), "index").map(({ data: a }) => /* @__PURE__ */ r(ee, { children: p.map(({ locale: i }) => /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(k, {
1663
1660
  sx: {
1664
1661
  gap: 1
1665
1662
  },
1666
- children: e === "properties" ? /* @__PURE__ */ v(F, { children: [
1667
- /* @__PURE__ */ r(z, {
1663
+ children: e === "properties" ? /* @__PURE__ */ v(M, { children: [
1664
+ /* @__PURE__ */ r(V, {
1668
1665
  size: "small",
1669
1666
  label: "Key",
1670
1667
  value: a.key || "",
1671
- onChange: (n) => {
1668
+ onChange: (o) => {
1672
1669
  m.transact(() => {
1673
- a.key = n.target.value.trim();
1670
+ a.key = o.target.value.trim();
1674
1671
  });
1675
1672
  }
1676
1673
  }),
1677
- /* @__PURE__ */ r(z, {
1674
+ /* @__PURE__ */ r(V, {
1678
1675
  size: "small",
1679
1676
  label: l("label"),
1680
- value: (a.locales?.[i]?.name ?? a.locales?.[d]?.name) || "",
1681
- onChange: (n) => {
1677
+ value: (a.locales?.[i]?.name ?? a.locales?.[c]?.name) || "",
1678
+ onChange: (o) => {
1682
1679
  m.transact(() => {
1683
- a.locales ??= {}, a.locales[i] ??= {}, a.locales[i].name = n.target.value;
1680
+ a.locales ??= {}, a.locales[i] ??= {}, a.locales[i].name = o.target.value;
1684
1681
  });
1685
1682
  }
1686
1683
  }),
1687
1684
  /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(L, {
1688
- allComponents: b,
1689
- defaultLocale: d,
1685
+ allComponents: g,
1686
+ defaultLocale: c,
1690
1687
  component: t,
1691
1688
  property: a,
1692
1689
  size: "small",
1693
1690
  fullWidth: !0,
1694
1691
  label: "Default Value",
1695
- valueImmutable: ie(a.locales?.[i]?.defaultValue),
1696
- value: a.locales?.[i]?.defaultValue ?? a.locales?.[d]?.defaultValue,
1697
- onChange: (n) => {
1692
+ valueImmutable: ne(a.locales?.[i]?.defaultValue),
1693
+ value: a.locales?.[i]?.defaultValue ?? a.locales?.[c]?.defaultValue,
1694
+ onChange: (o) => {
1698
1695
  m.transact(() => {
1699
- a.locales ??= {}, a.locales[i] ??= {}, a.locales[i].defaultValue = n;
1696
+ a.locales ??= {}, a.locales[i] ??= {}, a.locales[i].defaultValue = o;
1700
1697
  });
1701
1698
  }
1702
1699
  }) })
1703
1700
  ] }) : e === "parameters" && s ? /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(L, {
1704
- allComponents: b,
1705
- defaultLocale: d,
1701
+ allComponents: g,
1702
+ defaultLocale: c,
1706
1703
  component: t,
1707
1704
  property: a,
1708
1705
  size: "small",
1709
1706
  fullWidth: !0,
1710
- valueImmutable: ie(s.renderer.properties?.[a.id]?.locales?.[i]?.value),
1711
- value: s.renderer.properties?.[a.id]?.locales?.[i]?.value ?? s.renderer.properties?.[a.id]?.locales?.[d]?.value ?? a.locales?.[i]?.defaultValue ?? a.locales?.[d]?.defaultValue,
1712
- onChange: (n) => {
1707
+ valueImmutable: ne(s.renderer.properties?.[a.id]?.locales?.[i]?.value),
1708
+ value: s.renderer.properties?.[a.id]?.locales?.[i]?.value ?? s.renderer.properties?.[a.id]?.locales?.[c]?.value ?? a.locales?.[i]?.defaultValue ?? a.locales?.[c]?.defaultValue,
1709
+ onChange: (o) => {
1713
1710
  m.transact(() => {
1714
- s.renderer.properties ??= {}, s.renderer.properties[a.id] ??= {}, s.renderer.properties[a.id].locales ??= {}, s.renderer.properties[a.id].locales[i] ??= {}, s.renderer.properties[a.id].locales[i].value = n;
1711
+ s.renderer.properties ??= {}, s.renderer.properties[a.id] ??= {}, s.renderer.properties[a.id].locales ??= {}, s.renderer.properties[a.id].locales[i] ??= {}, s.renderer.properties[a.id].locales[i].value = o;
1715
1712
  });
1716
1713
  }
1717
1714
  }) }) : null
1718
1715
  }, a.id) }, i)) }, a.id)) })
1719
1716
  ] }) }) }),
1720
- /* @__PURE__ */ r(Ae, { children: /* @__PURE__ */ r(E, { onClick: (a) => o.onClose?.(a, "escapeKeyDown"), children: l("close") }) })
1717
+ /* @__PURE__ */ r(De, { children: /* @__PURE__ */ r(A, { onClick: (a) => n.onClose?.(a, "escapeKeyDown"), children: l("close") }) })
1721
1718
  ] });
1722
1719
  }
1723
- const Oe = (e, t) => (o) => {
1720
+ const Ne = (e, t) => (n) => {
1724
1721
  const l = [
1725
- o.palette.info.main,
1726
- o.palette.primary.main,
1727
- o.palette.secondary.main,
1728
- o.palette.success.main,
1729
- o.palette.warning.main
1730
- ], h = Math.min(l.length - 1, e), p = l[h], d = ae(p, 0.5), b = ae(p, 1);
1722
+ n.palette.info.main,
1723
+ n.palette.primary.main,
1724
+ n.palette.secondary.main,
1725
+ n.palette.success.main,
1726
+ n.palette.warning.main
1727
+ ], h = Math.min(l.length - 1, e), p = l[h], c = ae(p, 0.5), g = ae(p, 1);
1731
1728
  return {
1732
1729
  // 保留原有的边框样式
1733
- borderColor: `${d} !important`,
1730
+ borderColor: `${c} !important`,
1734
1731
  borderLeft: "3px solid !important",
1735
1732
  // 稍粗的左侧边框
1736
- borderLeftColor: d,
1733
+ borderLeftColor: c,
1737
1734
  // 使用透明度适应深色/浅色模式
1738
- color: b,
1735
+ color: g,
1739
1736
  ...t
1740
1737
  };
1741
1738
  };
1742
- function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
1743
- const { t: h, locale: p } = V(), d = M(null), b = lt(d, e), m = A(() => {
1739
+ function bt({ property: e, onChange: t, defaultLocale: n, allComponents: l }) {
1740
+ const { t: h, locale: p } = R(), c = oe(null), g = pt(c, e), m = W(() => {
1744
1741
  if (!(e.type !== "json" && e.type !== "yaml" && e.type !== "array") && e.subProperties)
1745
1742
  try {
1746
- let c = {};
1747
- D(Object.values(e.subProperties), "index").filter((i) => i.data.visible !== !1 && i.data.key).forEach(({ data: i }) => {
1743
+ let d = {};
1744
+ T(Object.values(e.subProperties), "index").filter((i) => i.data.visible !== !1 && i.data.key).forEach(({ data: i }) => {
1748
1745
  if (!i.key)
1749
1746
  return;
1750
- let n = i.locales?.[p]?.defaultValue ?? i.locales?.[o]?.defaultValue;
1747
+ let o = i.locales?.[p]?.defaultValue ?? i.locales?.[n]?.defaultValue;
1751
1748
  if (i.type === "number")
1752
- n = Number(n);
1749
+ o = Number(o);
1753
1750
  else if (i.type === "boolean")
1754
- n = n === !0 || n === "true";
1755
- else if ((i.type === "json" || i.type === "yaml") && typeof n == "string")
1751
+ o = o === !0 || o === "true";
1752
+ else if ((i.type === "json" || i.type === "yaml") && typeof o == "string")
1756
1753
  try {
1757
- i.type === "json" ? n = JSON.parse(n) : n = pe.parse(n);
1754
+ i.type === "json" ? o = JSON.parse(o) : o = pe.parse(o);
1758
1755
  } catch (f) {
1759
- console.error("Error parsing nested value", n, f), n = {};
1756
+ console.error("Error parsing nested value", o, f), o = {};
1760
1757
  }
1761
- c[i.key] = n;
1762
- }), e.type === "array" && !Array.isArray(c) && (c = K(c) ? [] : [c]);
1763
- const a = xe(c, e.type);
1758
+ d[i.key] = o;
1759
+ }), e.type === "array" && !Array.isArray(d) && (d = K(d) ? [] : [d]);
1760
+ const a = xe(d, e.type);
1764
1761
  t?.(a);
1765
- } catch (c) {
1766
- console.error("Error converting structure to text:", c);
1762
+ } catch (d) {
1763
+ console.error("Error converting structure to text:", d);
1767
1764
  }
1768
- }, [e, p, o, t]);
1765
+ }, [e, p, n, t]);
1769
1766
  return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ v(k, {
1770
1767
  direction: "column",
1771
- ref: d,
1768
+ ref: c,
1772
1769
  sx: {
1773
1770
  gap: 1.5,
1774
1771
  width: "100%"
1775
1772
  },
1776
1773
  children: [
1777
- /* @__PURE__ */ r(nr, { sx: { mt: -1 }, children: /* @__PURE__ */ r(T, {
1774
+ /* @__PURE__ */ r(nr, { sx: { mt: -1 }, children: /* @__PURE__ */ r(D, {
1778
1775
  variant: "caption",
1779
1776
  sx: {
1780
1777
  color: "text.secondary"
1781
1778
  },
1782
1779
  children: h("maker.properties.subProperties")
1783
1780
  }) }),
1784
- e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ r($e, {
1781
+ e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ r(He, {
1785
1782
  component: k,
1786
1783
  gap: 2,
1787
1784
  list: e.subProperties,
1788
- renderItem: (c, s, a) => {
1789
- const i = c.visible !== !1;
1790
- return /* @__PURE__ */ r(G, {
1785
+ renderItem: (d, s, a) => {
1786
+ const i = d.visible !== !1;
1787
+ return /* @__PURE__ */ r($, {
1791
1788
  elevation: 0,
1792
1789
  className: "property-container",
1793
1790
  sx: {
1794
1791
  p: 1.25,
1795
1792
  borderRadius: 1,
1796
1793
  border: i ? "1px solid" : "1px dashed",
1797
- "&": Oe(b)
1794
+ "&": Ne(g)
1798
1795
  },
1799
1796
  children: /* @__PURE__ */ r(k, {
1800
1797
  sx: {
1801
1798
  gap: 2
1802
1799
  },
1803
1800
  children: /* @__PURE__ */ r(Ge, {
1804
- data: c,
1801
+ data: d,
1805
1802
  params: a,
1806
1803
  visible: i,
1807
1804
  config: {
1808
1805
  properties: e.subProperties
1809
1806
  },
1810
1807
  currentLocale: p,
1811
- defaultLocale: o,
1808
+ defaultLocale: n,
1812
1809
  allComponents: l,
1813
- onUpdateConfig: (n) => {
1810
+ onUpdateConfig: (o) => {
1814
1811
  try {
1815
1812
  const f = { properties: e.subProperties || {} };
1816
- n(f);
1817
- const g = {
1813
+ o(f);
1814
+ const y = {
1818
1815
  ...e,
1819
1816
  subProperties: f.properties
1820
1817
  };
1821
- t?.(g, { forceUpdateProperty: !0 }), m();
1818
+ t?.(y, { forceUpdateProperty: !0 }), m();
1822
1819
  } catch (f) {
1823
1820
  console.error("Error updating property:", f);
1824
1821
  }
1825
1822
  }
1826
1823
  })
1827
1824
  })
1828
- }, c.id);
1825
+ }, d.id);
1829
1826
  }
1830
- }) : /* @__PURE__ */ r(q, { style: { fontSize: 12, height: 100 }, children: h("maker.properties.noSubProperties") }),
1831
- /* @__PURE__ */ r(E, {
1827
+ }) : /* @__PURE__ */ r(Y, { style: { fontSize: 12, height: 100 }, children: h("maker.properties.noSubProperties") }),
1828
+ /* @__PURE__ */ r(A, {
1832
1829
  fullWidth: !0,
1833
1830
  variant: "outlined",
1834
1831
  className: "ignore-style-override",
1835
1832
  size: "small",
1836
- startIcon: /* @__PURE__ */ r(Be, {}),
1833
+ startIcon: /* @__PURE__ */ r(Le, {}),
1837
1834
  onClick: () => {
1838
1835
  try {
1839
- const c = e.subProperties || {}, s = _e(), i = {
1840
- index: Object.values(c).length,
1836
+ const d = e.subProperties || {}, s = _e(), i = {
1837
+ index: Object.values(d).length,
1841
1838
  data: {
1842
1839
  id: s,
1843
1840
  key: "",
@@ -1852,20 +1849,20 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
1852
1849
  // 为嵌套属性预初始化
1853
1850
  subProperties: {}
1854
1851
  }
1855
- }, n = {
1852
+ }, o = {
1856
1853
  ...e,
1857
1854
  subProperties: {
1858
- ...c,
1855
+ ...d,
1859
1856
  [s]: i
1860
1857
  }
1861
1858
  };
1862
- t?.(n, { forceUpdateProperty: !0 }), m();
1863
- } catch (c) {
1864
- console.error("Error adding property:", c);
1859
+ t?.(o, { forceUpdateProperty: !0 }), m();
1860
+ } catch (d) {
1861
+ console.error("Error adding property:", d);
1865
1862
  }
1866
1863
  },
1867
1864
  sx: {
1868
- "&": Oe(b, {
1865
+ "&": Ne(g, {
1869
1866
  // borderLeft: undefined,
1870
1867
  })
1871
1868
  },
@@ -1874,31 +1871,31 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
1874
1871
  ]
1875
1872
  });
1876
1873
  }
1877
- function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h, defaultLocale: p, allComponents: d, ...b }) {
1878
- const { locale: m } = V(), c = hr(), s = M(null), a = () => {
1879
- const n = c?.current?.getUploader();
1880
- n?.open(), s.current && n.onceUploadSuccess(({ response: f }) => {
1881
- let g = f?.data?.filename || "";
1882
- g && (g = `mediakit://${g}`, o && !o.includes("mediakit://") && (g += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), s.current?.(g);
1874
+ function L({ component: e, property: t, value: n, onChange: l, valueImmutable: h, defaultLocale: p, allComponents: c, ...g }) {
1875
+ const { locale: m } = R(), d = mr(), s = oe(null), a = () => {
1876
+ const o = d?.current?.getUploader();
1877
+ o?.open(), s.current && o.onceUploadSuccess(({ response: f }) => {
1878
+ let y = f?.data?.filename || "";
1879
+ y && (y = `mediakit://${y}`, n && !n.includes("mediakit://") && (y += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), s.current?.(y);
1883
1880
  });
1884
- }, i = b.label ?? (t.locales?.[m]?.name || t.locales?.[p]?.name || t.key || t.id);
1881
+ }, i = g.label ?? (t.locales?.[m]?.name || t.locales?.[p]?.name || t.key || t.id);
1885
1882
  if (t.type === "number")
1886
- return /* @__PURE__ */ r(ut, {
1887
- ...b,
1883
+ return /* @__PURE__ */ r(gt, {
1884
+ ...g,
1888
1885
  label: i,
1889
1886
  NumberProps: {
1890
- value: ["number", "string"].includes(typeof o) ? o : null,
1891
- onChange: (n, f) => l?.(f)
1887
+ value: ["number", "string"].includes(typeof n) ? n : null,
1888
+ onChange: (o, f) => l?.(f)
1892
1889
  }
1893
1890
  });
1894
1891
  if (t.type === "decimal")
1895
- return /* @__PURE__ */ r(z, {
1896
- ...b,
1892
+ return /* @__PURE__ */ r(V, {
1893
+ ...g,
1897
1894
  label: i,
1898
1895
  type: "text",
1899
- value: o ?? "",
1900
- onChange: (n) => {
1901
- const f = n.target.value;
1896
+ value: n ?? "",
1897
+ onChange: (o) => {
1898
+ const f = o.target.value;
1902
1899
  if (f === "" || f === "-") {
1903
1900
  l?.(f);
1904
1901
  return;
@@ -1913,49 +1910,49 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
1913
1910
  return /* @__PURE__ */ r(ge, {
1914
1911
  label: i,
1915
1912
  labelPlacement: "start",
1916
- control: /* @__PURE__ */ r(Ve, { checked: o === !0, onChange: (n, f) => l?.(f) })
1913
+ control: /* @__PURE__ */ r(Re, { checked: n === !0, onChange: (o, f) => l?.(f) })
1917
1914
  });
1918
1915
  if (t.type === "color")
1919
- return /* @__PURE__ */ r(Gr, {
1916
+ return /* @__PURE__ */ r(et, {
1920
1917
  label: i,
1921
- value: o,
1922
- onChange: (n) => {
1923
- l?.(n);
1918
+ value: n,
1919
+ onChange: (o) => {
1920
+ l?.(o);
1924
1921
  }
1925
1922
  });
1926
1923
  if (t.type === "json" || t.type === "yaml")
1927
- return /* @__PURE__ */ r(Yr, {
1924
+ return /* @__PURE__ */ r(rt, {
1928
1925
  label: i,
1929
- value: o,
1930
- onChange: (n) => {
1931
- l?.(n);
1926
+ value: n,
1927
+ onChange: (o) => {
1928
+ l?.(o);
1932
1929
  },
1933
1930
  property: t,
1934
1931
  component: e,
1935
1932
  defaultLocale: p,
1936
- allComponents: d,
1933
+ allComponents: c,
1937
1934
  PropertyValueField: L,
1938
- onUpload: (n) => {
1939
- s.current = n, a();
1935
+ onUpload: (o) => {
1936
+ s.current = o, a();
1940
1937
  }
1941
1938
  });
1942
1939
  if (t.type === "custom") {
1943
- const n = d[t.componentId]?.data;
1944
- return n ? /* @__PURE__ */ r(P, {
1940
+ const o = c[t.componentId]?.data;
1941
+ return o ? /* @__PURE__ */ r(P, {
1945
1942
  sx: {
1946
1943
  width: "100%"
1947
1944
  },
1948
- children: /* @__PURE__ */ r(Ue, {
1949
- componentId: n.id,
1950
- props: { label: i, value: o, onChange: l },
1945
+ children: /* @__PURE__ */ r(Ke, {
1946
+ componentId: o.id,
1947
+ props: { label: i, value: n, onChange: l },
1951
1948
  locale: m,
1952
1949
  dev: {
1953
1950
  mode: "draft",
1954
- components: d,
1951
+ components: c,
1955
1952
  defaultLocale: p
1956
1953
  }
1957
1954
  })
1958
- }) : /* @__PURE__ */ r(z, { ...b, label: i, disabled: !0, placeholder: "Click right button select a component" });
1955
+ }) : /* @__PURE__ */ r(V, { ...g, label: i, disabled: !0, placeholder: "Click right button select a component" });
1959
1956
  }
1960
1957
  if (t.type === "component")
1961
1958
  return /* @__PURE__ */ v(k, {
@@ -1965,41 +1962,41 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
1965
1962
  gap: 1
1966
1963
  },
1967
1964
  children: [
1968
- /* @__PURE__ */ r(Ie, {
1969
- allComponents: d,
1965
+ /* @__PURE__ */ r(Se, {
1966
+ allComponents: c,
1970
1967
  label: i,
1971
- value: o?.componentId,
1972
- onChange: (n, f) => {
1973
- h || !o ? l?.({ ...o && JSON.parse(JSON.stringify(o)), componentId: f }) : typeof o == "object" && (o.componentId = f, l?.({ ...o && JSON.parse(JSON.stringify(o)), componentId: f }));
1968
+ value: n?.componentId,
1969
+ onChange: (o, f) => {
1970
+ h || !n ? l?.({ ...n && JSON.parse(JSON.stringify(n)), componentId: f }) : typeof n == "object" && (n.componentId = f, l?.({ ...n && JSON.parse(JSON.stringify(n)), componentId: f }));
1974
1971
  }
1975
1972
  }),
1976
- o?.componentId && /* @__PURE__ */ r(ct, {
1977
- value: o,
1973
+ n?.componentId && /* @__PURE__ */ r(ft, {
1974
+ value: n,
1978
1975
  valueImmutable: h,
1979
1976
  onChange: l,
1980
1977
  defaultLocale: p,
1981
- allComponents: d
1978
+ allComponents: c
1982
1979
  })
1983
1980
  ]
1984
1981
  });
1985
1982
  if (!t.type || ["string", "url", "multiline"].includes(t.type)) {
1986
- let n = t.type === "string" ? t.multiline : void 0;
1987
- t.type === "multiline" && (n = !0);
1988
- const f = t.type === "url" ? o?.url : o;
1989
- return /* @__PURE__ */ r(z, {
1990
- ...b,
1983
+ let o = t.type === "string" ? t.multiline : void 0;
1984
+ t.type === "multiline" && (o = !0);
1985
+ const f = t.type === "url" ? n?.url : n;
1986
+ return /* @__PURE__ */ r(V, {
1987
+ ...g,
1991
1988
  label: i,
1992
1989
  value: typeof f == "string" ? f : "",
1993
- multiline: n,
1994
- minRows: n ? 2 : void 0,
1995
- maxRows: n ? 10 : void 0,
1996
- onChange: (g) => l?.(t.type === "url" ? { ...o, url: g.target.value, mediaKitUrl: g.target.value } : g.target.value),
1990
+ multiline: o,
1991
+ minRows: o ? 2 : void 0,
1992
+ maxRows: o ? 10 : void 0,
1993
+ onChange: (y) => l?.(t.type === "url" ? { ...n, url: y.target.value, mediaKitUrl: y.target.value } : y.target.value),
1997
1994
  slotProps: {
1998
1995
  input: t.type === "url" ? {
1999
1996
  sx: {
2000
1997
  pr: 0
2001
1998
  },
2002
- endAdornment: /* @__PURE__ */ v($, {
1999
+ endAdornment: /* @__PURE__ */ v(_, {
2003
2000
  position: "end",
2004
2001
  sx: {
2005
2002
  display: "flex",
@@ -2008,63 +2005,63 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
2008
2005
  },
2009
2006
  children: [
2010
2007
  /* @__PURE__ */ r(Pe, {
2011
- onChange: async ({ response: g }) => {
2012
- const u = g?.data?.url || g?.data?.fileUrl;
2013
- let x;
2014
- u && (x = await de(u).catch(() => ue(u)).catch(() => {
2008
+ onChange: async ({ response: y }) => {
2009
+ const u = y?.data?.url || y?.data?.fileUrl;
2010
+ let C;
2011
+ u && (C = await de(u).catch(() => ue(u)).catch(() => {
2015
2012
  }));
2016
- let I = g?.data?.filename || "";
2017
- I && (I = `mediakit://${I}`), l?.({
2013
+ let w = y?.data?.filename || "";
2014
+ w && (w = `mediakit://${w}`), l?.({
2018
2015
  url: u,
2019
- mediaKitUrl: I,
2020
- width: x?.naturalWidth,
2021
- height: x?.naturalHeight
2016
+ mediaKitUrl: w,
2017
+ width: C?.naturalWidth,
2018
+ height: C?.naturalHeight
2022
2019
  });
2023
2020
  }
2024
2021
  }),
2025
- /* @__PURE__ */ r(_, { title: "If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.", children: /* @__PURE__ */ r(Me, { sx: { cursor: "default", mr: 1 }, fontSize: "small" }) })
2022
+ /* @__PURE__ */ r(J, { title: "If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.", children: /* @__PURE__ */ r(Me, { sx: { cursor: "default", mr: 1 }, fontSize: "small" }) })
2026
2023
  ]
2027
2024
  })
2028
2025
  } : void 0
2029
2026
  }
2030
2027
  });
2031
2028
  }
2032
- return t.type === "array" ? /* @__PURE__ */ r($r, {
2029
+ return t.type === "array" ? /* @__PURE__ */ r(Xr, {
2033
2030
  label: i,
2034
- value: Array.isArray(o) ? o : [],
2035
- onChange: (n) => l?.(n),
2031
+ value: Array.isArray(n) ? n : [],
2032
+ onChange: (o) => l?.(o),
2036
2033
  property: t,
2037
- renderItem: ({ item: n, index: f, onChange: g }) => t.subProperties && Object.keys(t.subProperties).length > 0 ? /* @__PURE__ */ r(k, {
2034
+ renderItem: ({ item: o, index: f, onChange: y }) => t.subProperties && Object.keys(t.subProperties).length > 0 ? /* @__PURE__ */ r(k, {
2038
2035
  sx: {
2039
2036
  gap: 1,
2040
2037
  width: "100%"
2041
2038
  },
2042
- children: D(Object.values(t.subProperties), "index").filter((u) => u.data.visible !== !1).map(({ data: u }) => u.key ? /* @__PURE__ */ r(L, {
2039
+ children: T(Object.values(t.subProperties), "index").filter((u) => u.data.visible !== !1).map(({ data: u }) => u.key ? /* @__PURE__ */ r(L, {
2043
2040
  component: e,
2044
2041
  property: u,
2045
- value: n[u.key],
2046
- onChange: (x) => {
2047
- const I = { ...n, [u.key]: x };
2048
- g(I);
2042
+ value: o[u.key],
2043
+ onChange: (C) => {
2044
+ const w = { ...o, [u.key]: C };
2045
+ y(w);
2049
2046
  },
2050
2047
  size: "small",
2051
2048
  fullWidth: !0,
2052
2049
  defaultLocale: p,
2053
- allComponents: d
2050
+ allComponents: c
2054
2051
  }, u.id) : null)
2055
- }, f) : /* @__PURE__ */ r(z, { size: b.size, fullWidth: !0, value: n, onChange: (u) => g(u.target.value) })
2052
+ }, f) : /* @__PURE__ */ r(V, { size: g.size, fullWidth: !0, value: o, onChange: (u) => y(u.target.value) })
2056
2053
  }) : (console.error("Unsupported property type", t.type), null);
2057
2054
  }
2058
- function ut({ NumberProps: e, ...t }) {
2059
- const { getInputProps: o } = xr(e), l = o();
2060
- return /* @__PURE__ */ r(z, {
2055
+ function gt({ NumberProps: e, ...t }) {
2056
+ const { getInputProps: n } = yr(e), l = n();
2057
+ return /* @__PURE__ */ r(V, {
2061
2058
  ...t,
2062
2059
  slotProps: {
2063
2060
  htmlInput: l
2064
2061
  }
2065
2062
  });
2066
2063
  }
2067
- const pt = `import React from '@blocklet/pages-kit/builtin/react'
2064
+ const yt = `import React from '@blocklet/pages-kit/builtin/react'
2068
2065
  import { Box } from '@blocklet/pages-kit/builtin/mui/material'
2069
2066
 
2070
2067
  export default function () {
@@ -2073,14 +2070,14 @@ export default function () {
2073
2070
  Hello World
2074
2071
  </Box>
2075
2072
  )
2076
- }`, mt = `console.log('hello')
2073
+ }`, xt = `console.log('hello')
2077
2074
  `;
2078
- function ht({ value: e }) {
2079
- const { locale: t } = V(), o = De(), l = Q(e).doc;
2080
- return U(() => {
2075
+ function vt({ value: e }) {
2076
+ const { locale: t } = R(), n = We(), l = q(e).doc;
2077
+ return B(() => {
2081
2078
  e.renderer?.script || (l.transact(() => {
2082
- e.renderer.script = e.renderer.type === "react-component" ? pt : mt;
2083
- }), o());
2079
+ e.renderer.script = e.renderer.type === "react-component" ? yt : xt;
2080
+ }), n());
2084
2081
  }, [e]), /* @__PURE__ */ r(P, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ r(Ce, {
2085
2082
  keyId: e.id,
2086
2083
  locale: t,
@@ -2093,20 +2090,20 @@ function ht({ value: e }) {
2093
2090
  }
2094
2091
  }, e.id) });
2095
2092
  }
2096
- function ft({ value: e }) {
2097
- const { t } = V(), o = Q(e).doc, { state: { components: l, config: { defaultLocale: h }, resources: p }, localState: { currentLocale: d } } = oe(), b = ve(), m = l[e.renderer.componentId]?.data ?? p.components?.[e.renderer.componentId]?.component, c = ke({ variant: "dialog" });
2093
+ function Ct({ value: e }) {
2094
+ const { t } = R(), n = q(e).doc, { state: { components: l, config: { defaultLocale: h }, resources: p }, localState: { currentLocale: c } } = ie(), g = ve(), m = l[e.renderer.componentId]?.data ?? p.components?.[e.renderer.componentId]?.component, d = ke({ variant: "dialog" });
2098
2095
  return /* @__PURE__ */ r(le, { children: /* @__PURE__ */ v(k, {
2099
2096
  sx: {
2100
2097
  gap: 1
2101
2098
  },
2102
2099
  children: [
2103
- /* @__PURE__ */ r(Ie, {
2104
- allComponents: b,
2100
+ /* @__PURE__ */ r(Se, {
2101
+ allComponents: g,
2105
2102
  excludes: [e.id],
2106
2103
  value: e.renderer.componentId,
2107
2104
  onChange: (s, a) => e.renderer.componentId = a
2108
2105
  }),
2109
- m && /* @__PURE__ */ v(F, { children: [
2106
+ m && /* @__PURE__ */ v(M, { children: [
2110
2107
  /* @__PURE__ */ v(k, {
2111
2108
  direction: "row",
2112
2109
  sx: {
@@ -2114,42 +2111,42 @@ function ft({ value: e }) {
2114
2111
  alignItems: "center"
2115
2112
  },
2116
2113
  children: [
2117
- /* @__PURE__ */ r(T, { variant: "subtitle2", children: t("parameters") }),
2118
- /* @__PURE__ */ r(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(c), children: /* @__PURE__ */ r(Ke, { fontSize: "small" }) })
2114
+ /* @__PURE__ */ r(D, { variant: "subtitle2", children: t("parameters") }),
2115
+ /* @__PURE__ */ r(A, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(d), children: /* @__PURE__ */ r(Be, { fontSize: "small" }) })
2119
2116
  ]
2120
2117
  }),
2121
- m.properties && D(Object.values(m.properties), "index").map(({ data: s }) => /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(L, {
2122
- allComponents: b,
2118
+ m.properties && T(Object.values(m.properties), "index").map(({ data: s }) => /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(L, {
2119
+ allComponents: g,
2123
2120
  defaultLocale: h,
2124
2121
  component: m,
2125
2122
  property: s,
2126
2123
  fullWidth: !0,
2127
2124
  size: "small",
2128
- valueImmutable: ie(e.renderer.properties?.[s.id]?.locales?.[d]?.value),
2129
- value: e.renderer.properties?.[s.id]?.locales?.[d]?.value ?? e.renderer.properties?.[s.id]?.locales?.[h]?.value ?? s.locales?.[d]?.defaultValue ?? s.locales?.[h]?.defaultValue,
2125
+ valueImmutable: ne(e.renderer.properties?.[s.id]?.locales?.[c]?.value),
2126
+ value: e.renderer.properties?.[s.id]?.locales?.[c]?.value ?? e.renderer.properties?.[s.id]?.locales?.[h]?.value ?? s.locales?.[c]?.defaultValue ?? s.locales?.[h]?.defaultValue,
2130
2127
  onChange: (a) => {
2131
- o.transact(() => {
2132
- e.renderer.properties ??= {}, e.renderer.properties[s.id] ??= {}, e.renderer.properties[s.id].locales ??= {}, e.renderer.properties[s.id].locales[d] ??= {}, e.renderer.properties[s.id].locales[d].value = a;
2128
+ n.transact(() => {
2129
+ e.renderer.properties ??= {}, e.renderer.properties[s.id] ??= {}, e.renderer.properties[s.id].locales ??= {}, e.renderer.properties[s.id].locales[c] ??= {}, e.renderer.properties[s.id].locales[c].value = a;
2133
2130
  });
2134
2131
  }
2135
2132
  }) }, s.id)),
2136
- /* @__PURE__ */ r(Ye, { ...Fe(c), component: e, type: "parameters" })
2133
+ /* @__PURE__ */ r(Ye, { ...Je(d), component: e, type: "parameters" })
2137
2134
  ] })
2138
2135
  ]
2139
2136
  }) });
2140
2137
  }
2141
- function Ie({ label: e, options: t, excludes: o, value: l, onChange: h, allComponents: p, ...d }) {
2142
- const { t: b } = V(), m = t ?? D(Object.values(Tr(p, ...o ?? [])), "index").map((s) => s.data), c = (typeof l == "string" ? p[l]?.data : void 0) ?? null;
2138
+ function Se({ label: e, options: t, excludes: n, value: l, onChange: h, allComponents: p, ...c }) {
2139
+ const { t: g } = R(), m = t ?? T(Object.values(Er(p, ...n ?? [])), "index").map((s) => s.data), d = (typeof l == "string" ? p[l]?.data : void 0) ?? null;
2143
2140
  return /* @__PURE__ */ r(Te, {
2144
- ...d,
2141
+ ...c,
2145
2142
  size: "small",
2146
2143
  options: m,
2147
2144
  autoHighlight: !0,
2148
2145
  isOptionEqualToValue: (s, a) => s.id === a.id,
2149
2146
  getOptionKey: (s) => s.id,
2150
2147
  getOptionLabel: (s) => s.name || s.id,
2151
- renderInput: (s) => /* @__PURE__ */ r(z, { label: e || b("component"), ...s }),
2152
- value: c,
2148
+ renderInput: (s) => /* @__PURE__ */ r(V, { label: e || g("component"), ...s }),
2149
+ value: d,
2153
2150
  onChange: (s, a) => {
2154
2151
  let i = {};
2155
2152
  a && (i = {
@@ -2160,64 +2157,64 @@ function Ie({ label: e, options: t, excludes: o, value: l, onChange: h, allCompo
2160
2157
  }
2161
2158
  });
2162
2159
  }
2163
- function qe({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l, currentLocale: h, onChange: p, props: d }) {
2164
- const { t: b } = V(), [m, c] = B(me(e?.properties)), [s, a] = B(null);
2165
- U(() => {
2160
+ function qe({ config: e, allComponents: t, defaultLocale: n, propertiesValue: l, currentLocale: h, onChange: p, props: c }) {
2161
+ const { t: g } = R(), [m, d] = U(me(e?.properties)), [s, a] = U(null);
2162
+ B(() => {
2166
2163
  (() => {
2167
- e?.renderer?.type === "react-component" && K(e?.properties) ? br(e?.renderer?.script).then((x) => {
2168
- const I = gr(x);
2169
- c(I);
2170
- }) : c(me(e?.properties));
2164
+ e?.renderer?.type === "react-component" && K(e?.properties) ? fr(e?.renderer?.script).then((C) => {
2165
+ const w = br(C);
2166
+ d(w);
2167
+ }) : d(me(e?.properties));
2171
2168
  })();
2172
2169
  }, [JSON.stringify(e)]);
2173
- const i = A(() => !e || !m ? {} : Object.values(m).reduce((u, { data: x }) => {
2174
- const I = x.key || x.id;
2175
- return u[x.id] = {
2176
- key: I,
2177
- value: d?.[I] ?? l?.[x.id]?.value ?? x.locales?.[h]?.defaultValue ?? x.locales?.[o]?.defaultValue,
2178
- id: x.id,
2179
- type: x.type
2170
+ const i = W(() => !e || !m ? {} : Object.values(m).reduce((u, { data: C }) => {
2171
+ const w = C.key || C.id;
2172
+ return u[C.id] = {
2173
+ key: w,
2174
+ value: c?.[w] ?? l?.[C.id]?.value ?? C.locales?.[h]?.defaultValue ?? C.locales?.[n]?.defaultValue,
2175
+ id: C.id,
2176
+ type: C.type
2180
2177
  }, u;
2181
- }, {}), [JSON.stringify(m), e, l, h, o]), n = H(() => {
2178
+ }, {}), [JSON.stringify(m), e, l, h, n]), o = H(() => {
2182
2179
  if (!m)
2183
2180
  return {
2184
2181
  canUseProperties: [],
2185
2182
  visibleProperties: [],
2186
2183
  canUsePropertiesKeys: []
2187
2184
  };
2188
- const u = D(Object.values(m), "index"), x = u.filter(({ data: S }) => S.key && be(m, S.id)), I = u.filter(({ data: S }) => S.key && S.type !== "component"), N = I.map(({ data: S }) => S.key);
2185
+ const u = T(Object.values(m), "index"), C = u.filter(({ data: S }) => S.key && be(m, S.id)), w = u.filter(({ data: S }) => S.key && S.type !== "component"), N = w.map(({ data: S }) => S.key);
2189
2186
  return {
2190
- canUseProperties: I,
2191
- visibleProperties: x,
2187
+ canUseProperties: w,
2188
+ visibleProperties: C,
2192
2189
  canUsePropertiesKeys: N
2193
2190
  };
2194
- }, [JSON.stringify(m)]), f = i(), g = Ar(f, "key");
2191
+ }, [JSON.stringify(m)]), f = i(), y = Rr(f, "key");
2195
2192
  return /* @__PURE__ */ r(le, { children: /* @__PURE__ */ v(k, {
2196
2193
  sx: {
2197
2194
  gap: 2
2198
2195
  },
2199
2196
  children: [
2200
- /* @__PURE__ */ r(T, { variant: "subtitle1", children: b("maker.properties.parameters") }),
2201
- !e || n.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ r(q, { style: { fontSize: 12 }, children: b("maker.properties.noParameters") }) : /* @__PURE__ */ v(F, { children: [
2197
+ /* @__PURE__ */ r(D, { variant: "subtitle1", children: g("maker.properties.parameters") }),
2198
+ !e || o.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ r(Y, { style: { fontSize: 12 }, children: g("maker.properties.noParameters") }) : /* @__PURE__ */ v(M, { children: [
2202
2199
  /* @__PURE__ */ r(k, {
2203
2200
  sx: {
2204
2201
  gap: 2
2205
2202
  },
2206
- children: n.visibleProperties.map(({ data: u }) => /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(L, {
2203
+ children: o.visibleProperties.map(({ data: u }) => /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(L, {
2207
2204
  allComponents: t,
2208
- defaultLocale: o,
2205
+ defaultLocale: n,
2209
2206
  size: "small",
2210
2207
  fullWidth: !0,
2211
2208
  component: e,
2212
2209
  property: u,
2213
- valueImmutable: ie(l?.[u.id]?.value),
2214
- value: d?.[u.key || u.id] ?? f[u.id]?.value,
2215
- onChange: (x) => {
2210
+ valueImmutable: ne(l?.[u.id]?.value),
2211
+ value: c?.[u.key || u.id] ?? f[u.id]?.value,
2212
+ onChange: (C) => {
2216
2213
  p({
2217
2214
  path: ["properties", u.id],
2218
2215
  id: u.id,
2219
- value: { value: x },
2220
- shouldSync: Se(u),
2216
+ value: { value: C },
2217
+ shouldSync: Oe(u),
2221
2218
  excludeKeys: [],
2222
2219
  key: u.key || u.id
2223
2220
  });
@@ -2229,37 +2226,37 @@ function qe({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l,
2229
2226
  gap: 2,
2230
2227
  width: "100%"
2231
2228
  },
2232
- children: /* @__PURE__ */ r(Ue, {
2229
+ children: /* @__PURE__ */ r(Ke, {
2233
2230
  componentId: e?.id || "",
2234
2231
  renderType: "setting",
2235
2232
  locale: h,
2236
2233
  properties: f,
2237
- dev: { mode: "draft", components: t, defaultLocale: o },
2234
+ dev: { mode: "draft", components: t, defaultLocale: n },
2238
2235
  props: {
2239
- ...Dr(d ?? {}, n.canUsePropertiesKeys),
2236
+ ...Ar(c ?? {}, o.canUsePropertiesKeys),
2240
2237
  onChange: (u) => {
2241
- const { canUsePropertiesKeys: x } = n;
2242
- Object.keys(u).filter((N) => !Rr(u[N], g?.[N]?.value)).filter((N) => !(N === "locale" && !Vr(g[N], "locale") || g[N]?.type === "component" || (g[N]?.type === "yaml" || g[N]?.type === "json") && be(m, g[N]?.id))).reduce((N, S) => N.then(() => {
2243
- const w = g[S], j = x.includes(S);
2244
- if (w?.id && j)
2238
+ const { canUsePropertiesKeys: C } = o;
2239
+ Object.keys(u).filter((N) => !zr(u[N], y?.[N]?.value)).filter((N) => !(N === "locale" && !jr(y[N], "locale") || y[N]?.type === "component" || (y[N]?.type === "yaml" || y[N]?.type === "json") && be(m, y[N]?.id))).reduce((N, S) => N.then(() => {
2240
+ const I = y[S], j = C.includes(S);
2241
+ if (I?.id && j)
2245
2242
  return p({
2246
- path: ["properties", w.id],
2247
- id: w.id,
2243
+ path: ["properties", I.id],
2244
+ id: I.id,
2248
2245
  value: { value: u[S] },
2249
- shouldSync: Se(w),
2246
+ shouldSync: Oe(I),
2250
2247
  excludeKeys: [],
2251
- key: w.key || w.id
2248
+ key: I.key || I.id
2252
2249
  }), Promise.resolve();
2253
- const y = `propertyNotFound${S}`;
2254
- if (s === y)
2250
+ const b = `propertyNotFound${S}`;
2251
+ if (s === b)
2255
2252
  return Promise.resolve();
2256
2253
  he.close(s);
2257
- const C = he.warning(b("maker.properties.propertyNotFound", {
2254
+ const x = he.warning(g("maker.properties.propertyNotFound", {
2258
2255
  key: S
2259
2256
  }), {
2260
- key: y
2257
+ key: b
2261
2258
  });
2262
- return a(C), Promise.resolve();
2259
+ return a(x), Promise.resolve();
2263
2260
  }), Promise.resolve());
2264
2261
  }
2265
2262
  }
@@ -2269,31 +2266,31 @@ function qe({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l,
2269
2266
  ]
2270
2267
  }) });
2271
2268
  }
2272
- function bt({ config: e }) {
2273
- const { t, locale: o } = V(), [l, h] = B(!1), p = (d) => {
2274
- e.llmConfig = d;
2269
+ function Pt({ config: e }) {
2270
+ const { t, locale: n } = R(), [l, h] = U(!1), p = (c) => {
2271
+ e.llmConfig = c;
2275
2272
  };
2276
- return /* @__PURE__ */ v(F, { children: [
2277
- /* @__PURE__ */ r(_, { title: t("maker.properties.configLLMDescription"), children: /* @__PURE__ */ r(Y, { color: "primary", onClick: () => h(!0), size: "small", children: /* @__PURE__ */ r(Ir, {}) }) }),
2278
- l && /* @__PURE__ */ r(rt, {
2273
+ return /* @__PURE__ */ v(M, { children: [
2274
+ /* @__PURE__ */ r(J, { title: t("maker.properties.configLLMDescription"), children: /* @__PURE__ */ r(G, { color: "primary", onClick: () => h(!0), size: "small", children: /* @__PURE__ */ r(wr, {}) }) }),
2275
+ l && /* @__PURE__ */ r(st, {
2279
2276
  open: l,
2280
2277
  onClose: () => h(!1),
2281
2278
  onConfirm: p,
2282
2279
  component: e,
2283
2280
  initialConfig: e.llmConfig,
2284
- locale: o,
2281
+ locale: n,
2285
2282
  defaultLocale: "en",
2286
2283
  title: t("maker.properties.llmConfigTitle")
2287
2284
  })
2288
2285
  ] });
2289
2286
  }
2290
2287
  export {
2291
- ot as BasicInfo,
2292
- Ie as CustomComponentAutocomplete,
2293
- on as CustomComponentSettings,
2294
- pt as DefaultReactComponentScriptTemplate,
2295
- mt as DefaultWebComponentScriptTemplate,
2288
+ ut as BasicInfo,
2289
+ Se as CustomComponentAutocomplete,
2290
+ pn as CustomComponentSettings,
2291
+ yt as DefaultReactComponentScriptTemplate,
2292
+ xt as DefaultWebComponentScriptTemplate,
2296
2293
  qe as ParametersConfig,
2297
- st as PropertiesConfig,
2294
+ mt as PropertiesConfig,
2298
2295
  L as PropertyValueField
2299
2296
  };