@blocklet/labels 1.5.32 → 1.5.33

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/dist/index.es.js CHANGED
@@ -1,28 +1,28 @@
1
- import { createContext as V, useRef as j, useState as I, useCallback as T, useEffect as D, useMemo as z, useContext as q } from "react";
2
- import F from "@mui/icons-material/ExpandMore";
1
+ import { createContext as q, useRef as D, useState as z, useCallback as A, useEffect as W, useMemo as k, useContext as $ } from "react";
2
+ import R from "@mui/icons-material/ExpandMore";
3
3
  import p from "@mui/material/Box";
4
4
  import { styled as H } from "@mui/material/styles";
5
5
  import { Tree as U } from "react-arborist";
6
6
  import { Icon as X } from "@iconify/react";
7
- import { jsx as n, jsxs as C, Fragment as P } from "react/jsx-runtime";
7
+ import { jsx as n, jsxs as v, Fragment as P } from "react/jsx-runtime";
8
8
  import ee from "lodash/omit";
9
9
  import te, { components as J } from "react-select";
10
10
  import ne from "@mui/material/Typography";
11
- import O from "@mui/material/Button";
11
+ import T from "@mui/material/Button";
12
12
  import N from "@mui/material/IconButton";
13
13
  import re from "@mui/icons-material/DeleteOutlineOutlined";
14
14
  import oe from "@mui/icons-material/EditOutlined";
15
15
  import le from "@mui/icons-material/Add";
16
- import M from "@mui/material/TextField";
16
+ import j from "@mui/material/TextField";
17
17
  import ie from "@mui/base/ClickAwayListener";
18
18
  import { GithubPicker as se } from "react-color";
19
19
  import _ from "@arcblock/ux/lib/Dialog";
20
- import { TextField as R, InputAdornment as ae, IconButton as ce, Box as B } from "@mui/material";
20
+ import { TextField as V, InputAdornment as ae, IconButton as ce, Box as B } from "@mui/material";
21
21
  import de from "@mui/icons-material/Translate";
22
22
  import ue from "@mui/material/Popover";
23
- import { useLocaleContext as $ } from "@arcblock/ux/lib/Locale/context";
24
- import he from "@mui/material/Alert";
25
- import pe from "@mui/icons-material/Edit";
23
+ import { useLocaleContext as K } from "@arcblock/ux/lib/Locale/context";
24
+ import pe from "@mui/material/Alert";
25
+ import he from "@mui/icons-material/Edit";
26
26
  import me from "@mui/icons-material/LabelOutlined";
27
27
  import fe from "@mui/material/ClickAwayListener";
28
28
  import ge from "@mui/material/Chip";
@@ -44,29 +44,29 @@ const xe = (e) => /* @__PURE__ */ n("svg", {
44
44
  fill: "currentColor",
45
45
  d: "m10 16.4l-4-4L7.4 11l2.6 2.6L16.6 7L18 8.4Z"
46
46
  })
47
- }), K = V({});
47
+ }), Q = q({});
48
48
  function Ce({
49
49
  selectable: e = !1,
50
50
  selected: t = [],
51
51
  onSelect: s,
52
- renderItem: o,
53
- children: l
52
+ renderItem: l,
53
+ children: o
54
54
  }) {
55
- const r = (h) => t.indexOf(h) !== -1, i = (h) => {
56
- Array.from(new Set(t).add(h)), s == null || s(h);
57
- }, a = z(
55
+ const r = (u) => t.indexOf(u) !== -1, i = (u) => {
56
+ Array.from(new Set(t).add(u)), s == null || s(u);
57
+ }, a = k(
58
58
  () => ({
59
59
  selectable: e,
60
60
  selected: t,
61
61
  isSelected: r,
62
62
  select: i,
63
- renderItem: o
63
+ renderItem: l
64
64
  }),
65
65
  [t]
66
66
  );
67
- return /* @__PURE__ */ n(K.Provider, {
67
+ return /* @__PURE__ */ n(Q.Provider, {
68
68
  value: a,
69
- children: l
69
+ children: o
70
70
  });
71
71
  }
72
72
  const ve = (e) => {
@@ -76,11 +76,11 @@ const ve = (e) => {
76
76
  function be({
77
77
  node: e
78
78
  }) {
79
- return ve(e) ? /* @__PURE__ */ n("span", {}) : e.isOpen ? /* @__PURE__ */ n(F, {
79
+ return ve(e) ? /* @__PURE__ */ n("span", {}) : e.isOpen ? /* @__PURE__ */ n(R, {
80
80
  style: {
81
81
  fontSize: 20
82
82
  }
83
- }) : /* @__PURE__ */ n(F, {
83
+ }) : /* @__PURE__ */ n(R, {
84
84
  style: {
85
85
  fontSize: 20,
86
86
  transform: "rotate(-90deg)"
@@ -93,13 +93,13 @@ function Se({
93
93
  dragHandle: s
94
94
  }) {
95
95
  const {
96
- selectable: o,
97
- select: l,
96
+ selectable: l,
97
+ select: o,
98
98
  isSelected: r,
99
99
  renderItem: i
100
- } = q(K), {
100
+ } = $(Q), {
101
101
  data: a
102
- } = e, h = a.icon ? /* @__PURE__ */ n(X, {
102
+ } = e, u = a.icon ? /* @__PURE__ */ n(X, {
103
103
  icon: a.icon,
104
104
  style: {
105
105
  fontSize: 18
@@ -109,12 +109,12 @@ function Se({
109
109
  fontSize: 18,
110
110
  color: a.color || "#ddd"
111
111
  }
112
- }), g = (c) => {
113
- c.stopPropagation(), e.isInternal && e.toggle();
114
- }, f = (c) => {
115
- c.stopPropagation(), o && l(e.id);
116
- }, x = /* @__PURE__ */ C(P, {
117
- children: [/* @__PURE__ */ C(p, {
112
+ }), m = (d) => {
113
+ d.stopPropagation(), e.isInternal && e.toggle();
114
+ }, g = (d) => {
115
+ d.stopPropagation(), l && o(e.id);
116
+ }, x = /* @__PURE__ */ v(P, {
117
+ children: [/* @__PURE__ */ v(p, {
118
118
  sx: {
119
119
  display: "flex",
120
120
  alignItems: "center",
@@ -125,7 +125,7 @@ function Se({
125
125
  display: "flex",
126
126
  cursor: "pointer"
127
127
  },
128
- onClick: g,
128
+ onClick: m,
129
129
  children: /* @__PURE__ */ n(be, {
130
130
  node: e
131
131
  })
@@ -136,7 +136,7 @@ function Se({
136
136
  width: 22,
137
137
  height: 22
138
138
  },
139
- children: h
139
+ children: u
140
140
  }), /* @__PURE__ */ n(p, {
141
141
  component: "span",
142
142
  sx: {
@@ -144,9 +144,9 @@ function Se({
144
144
  },
145
145
  children: e.data.name
146
146
  })]
147
- }), o && r(e.id) && /* @__PURE__ */ n(ye, {})]
147
+ }), l && r(e.id) && /* @__PURE__ */ n(ye, {})]
148
148
  });
149
- return /* @__PURE__ */ C(p, {
149
+ return /* @__PURE__ */ v(p, {
150
150
  className: "label-tree-item",
151
151
  style: t,
152
152
  sx: {
@@ -155,7 +155,7 @@ function Se({
155
155
  justifyContent: "space-between"
156
156
  },
157
157
  ref: s,
158
- onClick: f,
158
+ onClick: g,
159
159
  children: [!i && x, !!i && i(x, e.data)]
160
160
  });
161
161
  }
@@ -173,38 +173,38 @@ const we = H(p)`
173
173
  width: 100%;
174
174
  }
175
175
  `;
176
- function W({
176
+ function F({
177
177
  data: e,
178
178
  selectable: t,
179
179
  selected: s = [],
180
- onSelect: o,
181
- rowHeight: l = 28,
180
+ onSelect: l,
181
+ rowHeight: o = 28,
182
182
  renderItem: r,
183
183
  sx: i,
184
184
  ...a
185
185
  }) {
186
- const h = j(), g = [...Array.isArray(i) ? i : [i]], [f, x] = I(0), c = T(() => {
187
- var b, d;
188
- x((((d = (b = h.current) == null ? void 0 : b.visibleNodes) == null ? void 0 : d.length) || 0) * l);
189
- }, [l]);
190
- return D(() => {
191
- c();
192
- }, [e, c]), /* @__PURE__ */ n(Ce, {
186
+ const u = D(), m = [...Array.isArray(i) ? i : [i]], [g, x] = z(0), d = A(() => {
187
+ var y, b;
188
+ x((((b = (y = u.current) == null ? void 0 : y.visibleNodes) == null ? void 0 : b.length) || 0) * o);
189
+ }, [o]);
190
+ return W(() => {
191
+ d();
192
+ }, [e, d]), /* @__PURE__ */ n(Ce, {
193
193
  selectable: t,
194
194
  selected: s,
195
- onSelect: o,
195
+ onSelect: l,
196
196
  renderItem: r,
197
197
  children: /* @__PURE__ */ n(we, {
198
198
  ...a,
199
- sx: g,
199
+ sx: m,
200
200
  children: /* @__PURE__ */ n(U, {
201
201
  data: e,
202
- rowHeight: l,
203
- height: f,
202
+ rowHeight: o,
203
+ height: g,
204
204
  indent: 32,
205
- ref: h,
205
+ ref: u,
206
206
  onToggle: () => {
207
- setTimeout(c);
207
+ setTimeout(d);
208
208
  },
209
209
  children: Se
210
210
  })
@@ -212,11 +212,11 @@ function W({
212
212
  });
213
213
  }
214
214
  const L = (e) => e.reduce((t, s) => {
215
- var o;
216
- return t.push(s), (o = s.children) != null && o.length && t.push(...L(s.children)), t;
217
- }, []), Q = (e) => e.map((t) => {
215
+ var l;
216
+ return t.push(s), (l = s.children) != null && l.length && t.push(...L(s.children)), t;
217
+ }, []), Y = (e) => e.map((t) => {
218
218
  var s;
219
- return (s = t.children) != null && s.length && (t.children = Q(t.children)), t;
219
+ return (s = t.children) != null && s.length && (t.children = Y(t.children)), t;
220
220
  }), Ie = (e, t = null) => {
221
221
  try {
222
222
  return JSON.parse(e);
@@ -224,26 +224,26 @@ const L = (e) => e.reduce((t, s) => {
224
224
  return t;
225
225
  }
226
226
  }, ze = (e) => {
227
- const t = e.reduce((l, r) => (l[r.id] = l[r.id] || {}, r.parentId && (l[r.id].parent = r.parentId, l[r.parentId] = l[r.parentId] || {}, l[r.parentId].children = l[r.parentId].children || [], l[r.parentId].children.push(r.id)), l), {}), s = e.map(({ parentId: l, translation: r, ...i }) => ({
227
+ const t = e.reduce((o, r) => (o[r.id] = o[r.id] || {}, r.parentId && (o[r.id].parent = r.parentId, o[r.parentId] = o[r.parentId] || {}, o[r.parentId].children = o[r.parentId].children || [], o[r.parentId].children.push(r.id)), o), {}), s = e.map(({ parentId: o, translation: r, ...i }) => ({
228
228
  ...i,
229
229
  translation: Ie(r),
230
230
  children: []
231
- })), o = s.reduce((l, r) => ({ ...l, [r.id]: r }), {});
232
- return s.forEach((l) => {
233
- const r = t[l.id];
234
- r.parent && o[r.parent] && (l.parent = o[r.parent]), r.children && (l.children = r.children.map((i) => o[i]));
235
- }), s.filter((l) => !l.parent);
231
+ })), l = s.reduce((o, r) => ({ ...o, [r.id]: r }), {});
232
+ return s.forEach((o) => {
233
+ const r = t[o.id];
234
+ r.parent && l[r.parent] && (o.parent = l[r.parent]), r.children && (o.children = r.children.map((i) => l[i]));
235
+ }), s.filter((o) => !o.parent);
236
236
  }, ke = (e) => {
237
237
  const {
238
238
  options: t,
239
239
  getValue: s,
240
- selectProps: o,
241
- selectOption: l
240
+ selectProps: l,
241
+ selectOption: o
242
242
  } = e, r = s(), i = (a) => {
243
- const h = t.find((g) => g.data.id === a);
244
- h && l(h);
243
+ const u = t.find((m) => m.data.id === a);
244
+ u && o(u);
245
245
  };
246
- return /* @__PURE__ */ C(P, {
246
+ return /* @__PURE__ */ v(P, {
247
247
  children: [/* @__PURE__ */ n(J.MenuList, {
248
248
  ...ee(e, ["addon"]),
249
249
  children: /* @__PURE__ */ n(p, {
@@ -251,8 +251,8 @@ const L = (e) => e.reduce((t, s) => {
251
251
  px: 2,
252
252
  py: 1
253
253
  },
254
- children: /* @__PURE__ */ n(W, {
255
- data: o.data,
254
+ children: /* @__PURE__ */ n(F, {
255
+ data: l.data,
256
256
  selectable: !0,
257
257
  onSelect: i,
258
258
  selected: r.map((a) => a.data.id)
@@ -260,12 +260,12 @@ const L = (e) => e.reduce((t, s) => {
260
260
  })
261
261
  }), e.addon]
262
262
  });
263
- }, Te = ({
263
+ }, Ae = ({
264
264
  children: e,
265
265
  ...t
266
266
  }) => {
267
- const [s, o] = e, l = Array.isArray(s) ? s.length : 0;
268
- return /* @__PURE__ */ C(J.ValueContainer, {
267
+ const [s, l] = e, o = Array.isArray(s) ? s.length : 0;
268
+ return /* @__PURE__ */ v(J.ValueContainer, {
269
269
  ...t,
270
270
  children: [/* @__PURE__ */ n(p, {
271
271
  component: "span",
@@ -273,8 +273,8 @@ const L = (e) => e.reduce((t, s) => {
273
273
  fontSize: 13,
274
274
  fontWeight: "bold"
275
275
  },
276
- children: l ? "Labels" : "Filter by labels"
277
- }), !!l && /* @__PURE__ */ n(p, {
276
+ children: o ? "Labels" : "Filter by labels"
277
+ }), !!o && /* @__PURE__ */ n(p, {
278
278
  sx: {
279
279
  display: "inline-flex",
280
280
  justifyContent: "center",
@@ -286,10 +286,10 @@ const L = (e) => e.reduce((t, s) => {
286
286
  fontSize: 12,
287
287
  bgcolor: "grey.200"
288
288
  },
289
- children: l
290
- }), o]
289
+ children: o
290
+ }), l]
291
291
  });
292
- }, Oe = {
292
+ }, Te = {
293
293
  control: (e) => ({
294
294
  ...e,
295
295
  minHeight: 31
@@ -307,85 +307,88 @@ const L = (e) => e.reduce((t, s) => {
307
307
  padding: "4px"
308
308
  })
309
309
  };
310
- function Ae({
310
+ function Oe({
311
311
  data: e,
312
312
  value: t = [],
313
313
  editable: s = !1,
314
- addon: o,
315
- onChange: l,
314
+ addon: l,
315
+ onChange: o,
316
316
  compact: r,
317
- ...i
317
+ isMulti: i = !0,
318
+ maxHeight: a = 264,
319
+ ...u
318
320
  }) {
319
- const a = j(null), h = z(() => L(e).map((d) => ({
320
- data: d,
321
- label: d.name,
322
- value: d.id
323
- })), [e]), g = h.reduce((d, w) => ({
324
- ...d,
325
- [w.data.id]: w
326
- }), {}), f = Array.isArray(t) ? t : [t], x = f.map((d) => g[d]), c = j({
327
- prev: f.map((d) => g[d].data)
328
- }), m = (d, w) => {
329
- c.current.current = d.map((k) => k.data), ["clear", "remove-value"].includes(w.action) && a.current && setTimeout(() => {
330
- var k;
331
- return (k = a == null ? void 0 : a.current) == null ? void 0 : k.blur();
321
+ const m = D(null), g = k(() => L(e).map((h) => ({
322
+ data: h,
323
+ label: h.name,
324
+ value: h.id
325
+ })), [e]), x = g.reduce((h, I) => ({
326
+ ...h,
327
+ [I.data.id]: I
328
+ }), {}), d = Array.isArray(t) ? t : [t], f = d.map((h) => x[h]), y = D({
329
+ prev: d.map((h) => x[h].data)
330
+ }), b = (h, I) => {
331
+ !i || !Array.isArray(h) ? o(h ? [h.data] : []) : y.current.current = h.map((c) => c.data), ["clear", "remove-value"].includes(I.action) && m.current && setTimeout(() => {
332
+ var c;
333
+ return (c = m == null ? void 0 : m.current) == null ? void 0 : c.blur();
332
334
  }, 1);
333
- }, b = () => {
334
- c.current.current && JSON.stringify(c.current.prev.map((w) => w.id)) !== JSON.stringify(c.current.current.map((w) => w.id)) && (l(c.current.current), c.current.prev = c.current.current);
335
+ }, M = () => {
336
+ y.current.current && JSON.stringify(y.current.prev.map((I) => I.id)) !== JSON.stringify(y.current.current.map((I) => I.id)) && (o(y.current.current), y.current.prev = y.current.current);
335
337
  };
336
338
  return /* @__PURE__ */ n(p, {
337
- ...i,
339
+ ...u,
338
340
  children: /* @__PURE__ */ n(te, {
339
- ref: a,
340
- defaultValue: x,
341
- options: h,
342
- onChange: m,
341
+ ref: m,
342
+ defaultValue: f,
343
+ options: g,
344
+ onChange: b,
343
345
  components: {
344
- MenuList: (d) => /* @__PURE__ */ n(ke, {
345
- ...d,
346
- addon: o
346
+ MenuList: (h) => /* @__PURE__ */ n(ke, {
347
+ ...h,
348
+ addon: l
347
349
  }),
348
350
  ...r && {
349
- ValueContainer: Te
351
+ ValueContainer: Ae
350
352
  }
351
353
  },
352
354
  placeholder: "Select labels",
353
355
  styles: {
354
- ...r && Oe,
355
- menu: (d) => ({
356
- ...d,
356
+ ...r && Te,
357
+ menu: (h) => ({
358
+ ...h,
357
359
  ...s && {
358
360
  paddingBottom: "36px"
359
361
  },
360
362
  zIndex: 99
361
363
  }),
362
- menuList: (d) => ({
363
- ...d,
364
+ menuList: (h) => ({
365
+ ...h,
364
366
  overflowY: "auto",
365
- maxHeight: "264px"
367
+ maxHeight: `${a}px`
366
368
  })
367
369
  },
368
- theme: (d) => ({
369
- ...d,
370
+ theme: (h) => ({
371
+ ...h,
370
372
  colors: {
371
- ...d.colors,
373
+ ...h.colors,
372
374
  primary25: "#ddd",
373
375
  primary50: "#ddd",
374
376
  primary: "#ddd"
375
377
  }
376
378
  }),
377
379
  isSearchable: !1,
378
- isMulti: !0,
379
- closeMenuOnSelect: !1,
380
- onMenuClose: b,
380
+ isMulti: i,
381
+ closeMenuOnSelect: !i,
382
+ onMenuClose: M,
383
+ isClearable: !0,
381
384
  data: e
382
385
  })
383
386
  });
384
387
  }
385
388
  var E = function() {
386
389
  return E = Object.assign || function(t) {
387
- for (var s, o = 1, l = arguments.length; o < l; o++) {
388
- s = arguments[o];
390
+ for (var s, l = 1, o = arguments.length; l < o; l++) {
391
+ s = arguments[l];
389
392
  for (var r in s)
390
393
  Object.prototype.hasOwnProperty.call(s, r) && (t[r] = s[r]);
391
394
  }
@@ -396,15 +399,15 @@ function Pe(e, t) {
396
399
  var s = typeof Symbol == "function" && e[Symbol.iterator];
397
400
  if (!s)
398
401
  return e;
399
- var o = s.call(e), l, r = [], i;
402
+ var l = s.call(e), o, r = [], i;
400
403
  try {
401
- for (; (t === void 0 || t-- > 0) && !(l = o.next()).done; )
402
- r.push(l.value);
404
+ for (; (t === void 0 || t-- > 0) && !(o = l.next()).done; )
405
+ r.push(o.value);
403
406
  } catch (a) {
404
407
  i = { error: a };
405
408
  } finally {
406
409
  try {
407
- l && !l.done && (s = o.return) && s.call(o);
410
+ o && !o.done && (s = l.return) && s.call(l);
408
411
  } finally {
409
412
  if (i)
410
413
  throw i.error;
@@ -415,13 +418,13 @@ function Pe(e, t) {
415
418
  var Be = function(e) {
416
419
  return typeof e == "function";
417
420
  }, Ne = function(e) {
418
- var t = Pe(I(e), 2), s = t[0], o = t[1], l = T(function(r) {
419
- o(function(i) {
421
+ var t = Pe(z(e), 2), s = t[0], l = t[1], o = A(function(r) {
422
+ l(function(i) {
420
423
  var a = Be(r) ? r(i) : r;
421
424
  return a ? E(E({}, i), a) : i;
422
425
  });
423
426
  }, []);
424
- return [s, l];
427
+ return [s, o];
425
428
  };
426
429
  const Ee = Ne;
427
430
  function Le({
@@ -430,19 +433,19 @@ function Le({
430
433
  }) {
431
434
  const {
432
435
  languages: s
433
- } = $(), {
434
- translation: o,
435
- onChange: l
436
- } = e, [r, i] = I(null), a = (f) => {
437
- const x = f.currentTarget.closest(".MuiInputBase-root");
436
+ } = K(), {
437
+ translation: l,
438
+ onChange: o
439
+ } = e, [r, i] = z(null), a = (g) => {
440
+ const x = g.currentTarget.closest(".MuiInputBase-root");
438
441
  x && i(x);
439
- }, h = () => {
442
+ }, u = () => {
440
443
  i(null);
441
- }, g = s.filter((f) => f.code !== "en");
442
- return /* @__PURE__ */ n(R, {
444
+ }, m = s.filter((g) => g.code !== "en");
445
+ return /* @__PURE__ */ n(V, {
443
446
  ...t,
444
447
  InputProps: {
445
- endAdornment: /* @__PURE__ */ C(ae, {
448
+ endAdornment: /* @__PURE__ */ v(ae, {
446
449
  position: "end",
447
450
  children: [/* @__PURE__ */ n(ce, {
448
451
  edge: "end",
@@ -451,7 +454,7 @@ function Le({
451
454
  }), /* @__PURE__ */ n(ue, {
452
455
  open: !!r,
453
456
  anchorEl: r,
454
- onClose: h,
457
+ onClose: u,
455
458
  transformOrigin: {
456
459
  vertical: "top",
457
460
  horizontal: "right"
@@ -476,10 +479,10 @@ function Le({
476
479
  sx: {
477
480
  p: 2
478
481
  },
479
- children: g.map(({
480
- code: f,
482
+ children: m.map(({
483
+ code: g,
481
484
  name: x
482
- }) => /* @__PURE__ */ C(B, {
485
+ }) => /* @__PURE__ */ v(B, {
483
486
  sx: {
484
487
  display: "flex",
485
488
  alignItems: "center",
@@ -497,19 +500,19 @@ function Le({
497
500
  sx: {
498
501
  flex: 1
499
502
  },
500
- children: /* @__PURE__ */ n(R, {
501
- value: o[f] || "",
503
+ children: /* @__PURE__ */ n(V, {
504
+ value: l[g] || "",
502
505
  size: "small",
503
506
  sx: {
504
507
  width: 1
505
508
  },
506
- onChange: (c) => l({
507
- ...o,
508
- [f]: c.target.value
509
+ onChange: (d) => o({
510
+ ...l,
511
+ [g]: d.target.value
509
512
  })
510
513
  })
511
514
  })]
512
- }, f))
515
+ }, g))
513
516
  })
514
517
  })]
515
518
  })
@@ -520,15 +523,15 @@ function Me({
520
523
  open: e,
521
524
  initialLabel: t,
522
525
  onSubmit: s,
523
- onClose: o,
524
- ...l
526
+ onClose: l,
527
+ ...o
525
528
  }) {
526
529
  const r = !(t != null && t.id), [i, a] = Ee({
527
530
  name: (t == null ? void 0 : t.name) || "",
528
531
  color: (t == null ? void 0 : t.color) || "#ddd",
529
532
  slug: (t == null ? void 0 : t.id) || "",
530
533
  translation: (t == null ? void 0 : t.translation) || {}
531
- }), h = (d) => /^#([0-9A-F]{3}){1,2}$/i.test(d), g = z(() => r ? i.name && i.color && i.slug && h(i.color) : i.name && i.color && h(i.color), [i, r]), [f, x] = I(!1), c = () => {
534
+ }), u = (b) => /^#([0-9A-F]{3}){1,2}$/i.test(b), m = k(() => r ? i.name && i.color && i.slug && u(i.color) : i.name && i.color && u(i.color), [i, r]), [g, x] = z(!1), d = () => {
532
535
  s({
533
536
  ...t,
534
537
  name: i.name,
@@ -536,13 +539,13 @@ function Me({
536
539
  id: i.slug,
537
540
  translation: i.translation
538
541
  });
539
- }, m = (d) => {
542
+ }, f = (b) => {
540
543
  a({
541
- color: d.hex
544
+ color: b.hex
542
545
  }), setTimeout(() => x(!1));
543
- }, b = (d) => {
546
+ }, y = (b) => {
544
547
  a({
545
- color: d.target.value
548
+ color: b.target.value
546
549
  });
547
550
  };
548
551
  return /* @__PURE__ */ n(_, {
@@ -550,25 +553,25 @@ function Me({
550
553
  showCloseButton: !0,
551
554
  maxWidth: "lg",
552
555
  title: r ? "Create label" : "Edit label",
553
- actions: /* @__PURE__ */ C(P, {
554
- children: [/* @__PURE__ */ n(O, {
556
+ actions: /* @__PURE__ */ v(P, {
557
+ children: [/* @__PURE__ */ n(T, {
555
558
  color: "inherit",
556
559
  variant: "contained",
557
560
  size: "small",
558
- onClick: o,
561
+ onClick: l,
559
562
  children: "Cancel"
560
- }), /* @__PURE__ */ n(O, {
563
+ }), /* @__PURE__ */ n(T, {
561
564
  color: "primary",
562
565
  variant: "contained",
563
566
  size: "small",
564
- onClick: c,
565
- disabled: !g,
567
+ onClick: d,
568
+ disabled: !m,
566
569
  children: r ? "Create" : "Save Changes"
567
570
  })]
568
571
  }),
569
- onClose: o,
570
- ...l,
571
- children: /* @__PURE__ */ C(p, {
572
+ onClose: l,
573
+ ...o,
574
+ children: /* @__PURE__ */ v(p, {
572
575
  width: 600,
573
576
  minHeight: 280,
574
577
  children: [/* @__PURE__ */ n(Le, {
@@ -577,28 +580,28 @@ function Me({
577
580
  placeholder: "New label",
578
581
  size: "small",
579
582
  fullWidth: !0,
580
- onChange: (d) => a({
581
- name: d.target.value
583
+ onChange: (b) => a({
584
+ name: b.target.value
582
585
  }),
583
586
  I18NProps: {
584
587
  translation: i.translation,
585
- onChange: (d) => a({
586
- translation: d
588
+ onChange: (b) => a({
589
+ translation: b
587
590
  })
588
591
  }
589
- }), /* @__PURE__ */ n(M, {
592
+ }), /* @__PURE__ */ n(j, {
590
593
  label: "Slug",
591
594
  value: i.slug,
592
595
  size: "small",
593
596
  fullWidth: !0,
594
597
  disabled: !r,
595
- onChange: (d) => a({
596
- slug: d.target.value
598
+ onChange: (b) => a({
599
+ slug: b.target.value
597
600
  }),
598
601
  sx: {
599
602
  mt: 2
600
603
  }
601
- }), (t == null ? void 0 : t.parent) && /* @__PURE__ */ n(M, {
604
+ }), (t == null ? void 0 : t.parent) && /* @__PURE__ */ n(j, {
602
605
  label: "Parent",
603
606
  value: t.parent.name,
604
607
  size: "small",
@@ -609,12 +612,12 @@ function Me({
609
612
  }
610
613
  }), /* @__PURE__ */ n(ie, {
611
614
  onClickAway: () => x(!1),
612
- children: /* @__PURE__ */ C(p, {
615
+ children: /* @__PURE__ */ v(p, {
613
616
  sx: {
614
617
  position: "relative",
615
618
  mt: 2
616
619
  },
617
- children: [/* @__PURE__ */ C(p, {
620
+ children: [/* @__PURE__ */ v(p, {
618
621
  sx: {
619
622
  display: "flex",
620
623
  alignItems: "center",
@@ -628,11 +631,11 @@ function Me({
628
631
  borderRadius: 1
629
632
  },
630
633
  onClick: () => x(!0)
631
- }), /* @__PURE__ */ n(M, {
634
+ }), /* @__PURE__ */ n(j, {
632
635
  label: "",
633
636
  value: i.color,
634
637
  size: "small",
635
- onChange: b,
638
+ onChange: y,
636
639
  inputProps: {
637
640
  maxLength: 7
638
641
  },
@@ -643,7 +646,7 @@ function Me({
643
646
  }
644
647
  }
645
648
  })]
646
- }), f && /* @__PURE__ */ n(p, {
649
+ }), g && /* @__PURE__ */ n(p, {
647
650
  sx: {
648
651
  position: "absolute",
649
652
  top: 48,
@@ -651,7 +654,7 @@ function Me({
651
654
  },
652
655
  children: /* @__PURE__ */ n(se, {
653
656
  color: i.color,
654
- onChangeComplete: m
657
+ onChangeComplete: f
655
658
  })
656
659
  })]
657
660
  })
@@ -663,22 +666,22 @@ function je({
663
666
  open: e,
664
667
  label: t,
665
668
  onSubmit: s,
666
- onClose: o,
667
- ...l
669
+ onClose: l,
670
+ ...o
668
671
  }) {
669
672
  return /* @__PURE__ */ n(_, {
670
673
  open: e,
671
674
  showCloseButton: !0,
672
675
  maxWidth: "md",
673
676
  title: "Delete",
674
- actions: /* @__PURE__ */ C(P, {
675
- children: [/* @__PURE__ */ n(O, {
677
+ actions: /* @__PURE__ */ v(P, {
678
+ children: [/* @__PURE__ */ n(T, {
676
679
  color: "inherit",
677
680
  variant: "contained",
678
681
  size: "small",
679
- onClick: o,
682
+ onClick: l,
680
683
  children: "Cancel"
681
- }), /* @__PURE__ */ n(O, {
684
+ }), /* @__PURE__ */ n(T, {
682
685
  color: "primary",
683
686
  variant: "contained",
684
687
  size: "small",
@@ -686,24 +689,24 @@ function je({
686
689
  children: "Delete"
687
690
  })]
688
691
  }),
689
- onClose: o,
690
- ...l,
691
- children: /* @__PURE__ */ C(p, {
692
+ onClose: l,
693
+ ...o,
694
+ children: /* @__PURE__ */ v(p, {
692
695
  width: 600,
693
696
  minHeight: 280,
694
- children: [/* @__PURE__ */ n(he, {
697
+ children: [/* @__PURE__ */ n(pe, {
695
698
  severity: "info",
696
699
  sx: {
697
700
  mb: 2
698
701
  },
699
702
  children: "Are you sure you want to delete these labels ?"
700
- }), /* @__PURE__ */ n(W, {
703
+ }), /* @__PURE__ */ n(F, {
701
704
  data: [t]
702
705
  })]
703
706
  })
704
707
  });
705
708
  }
706
- const De = H(W)`
709
+ const De = H(F)`
707
710
  .label-tree-item {
708
711
  &:before {
709
712
  content: '';
@@ -728,7 +731,7 @@ function We({
728
731
  locale: e,
729
732
  value: t
730
733
  }) {
731
- return /* @__PURE__ */ C(p, {
734
+ return /* @__PURE__ */ v(p, {
732
735
  sx: {
733
736
  display: "flex",
734
737
  alignItems: "center",
@@ -754,83 +757,83 @@ function We({
754
757
  })]
755
758
  });
756
759
  }
757
- function pt({
760
+ function ht({
758
761
  data: e,
759
762
  api: t,
760
763
  ...s
761
764
  }) {
762
- const [o, l] = I(null), [r, i] = I(null), [a, h] = I(Q(e)), g = z(() => L(a), [a]), f = z(() => {
763
- const u = (y, S) => y.map((v) => (S && (v.parent = S), v.children && (v.children = u(v.children, v)), v));
764
- return u(a);
765
- }, [a]), x = (u) => {
766
- var y, S;
767
- u.parent ? (u.parent.children = (S = (y = u.parent) == null ? void 0 : y.children) == null ? void 0 : S.map((v) => v.id === u.id ? {
768
- ...u
769
- } : v), x(u.parent)) : h(a.map((v) => v.id === u.id ? {
770
- ...u
771
- } : v));
772
- }, c = (u) => {
773
- u.parent ? (u.parent.children = u.parent.children || [], u.parent.children.push(u), h([...a])) : h([...a, u]);
774
- }, m = (u) => {
775
- var y;
776
- u.parent ? u.parent.children = (y = u.parent.children) == null ? void 0 : y.filter((S) => S.id !== u.id) : h(a.filter((S) => S.id !== u.id));
777
- }, b = (u) => {
778
- if (o)
765
+ const [l, o] = z(null), [r, i] = z(null), [a, u] = z(Y(e)), m = k(() => L(a), [a]), g = k(() => {
766
+ const c = (C, w) => C.map((S) => (w && (S.parent = w), S.children && (S.children = c(S.children, S)), S));
767
+ return c(a);
768
+ }, [a]), x = (c) => {
769
+ var C, w;
770
+ c.parent ? (c.parent.children = (w = (C = c.parent) == null ? void 0 : C.children) == null ? void 0 : w.map((S) => S.id === c.id ? {
771
+ ...c
772
+ } : S), x(c.parent)) : u(a.map((S) => S.id === c.id ? {
773
+ ...c
774
+ } : S));
775
+ }, d = (c) => {
776
+ c.parent ? (c.parent.children = c.parent.children || [], c.parent.children.push(c), u([...a])) : u([...a, c]);
777
+ }, f = (c) => {
778
+ var C;
779
+ c.parent ? c.parent.children = (C = c.parent.children) == null ? void 0 : C.filter((w) => w.id !== c.id) : u(a.filter((w) => w.id !== c.id));
780
+ }, y = (c) => {
781
+ if (l)
779
782
  return;
780
- l({
783
+ o({
781
784
  id: "",
782
785
  name: "New label",
783
- parent: u,
786
+ parent: c,
784
787
  color: "#dddddd"
785
788
  });
786
- }, d = (u) => {
787
- o || l(u);
788
- }, w = async (u) => {
789
- if (!o)
789
+ }, b = (c) => {
790
+ l || o(c);
791
+ }, M = async (c) => {
792
+ if (!l)
790
793
  return;
791
794
  const {
792
- parent: y,
793
- children: S,
794
- translation: v,
795
- ...A
796
- } = u;
797
- o.id ? (await t.updateLabel({
798
- ...A,
799
- translation: JSON.stringify(v),
800
- parentId: y == null ? void 0 : y.id
801
- }), x(u)) : (await t.createLabel({
802
- ...A,
803
- translation: JSON.stringify(v),
804
- parentId: y == null ? void 0 : y.id
805
- }), c(u)), l(null);
806
- }, k = async () => {
807
- !r || (await t.deleteLabel(r.id), m(r), i(null));
808
- }, G = (u, y) => /* @__PURE__ */ C(P, {
809
- children: [/* @__PURE__ */ C(p, {
795
+ parent: C,
796
+ children: w,
797
+ translation: S,
798
+ ...O
799
+ } = c;
800
+ l.id ? (await t.updateLabel({
801
+ ...O,
802
+ translation: JSON.stringify(S),
803
+ parentId: C == null ? void 0 : C.id
804
+ }), x(c)) : (await t.createLabel({
805
+ ...O,
806
+ translation: JSON.stringify(S),
807
+ parentId: C == null ? void 0 : C.id
808
+ }), d(c)), o(null);
809
+ }, h = async () => {
810
+ !r || (await t.deleteLabel(r.id), f(r), i(null));
811
+ }, I = (c, C) => /* @__PURE__ */ v(P, {
812
+ children: [/* @__PURE__ */ v(p, {
810
813
  sx: {
811
814
  display: "flex",
812
815
  alignItems: "center",
813
816
  flexWrap: "wrap"
814
817
  },
815
818
  children: [/* @__PURE__ */ n(p, {
816
- children: u
817
- }), y.translation && /* @__PURE__ */ n(p, {
819
+ children: c
820
+ }), C.translation && /* @__PURE__ */ n(p, {
818
821
  sx: {
819
822
  display: "flex",
820
823
  alignItems: "center",
821
824
  gap: 0.5,
822
825
  ml: 2
823
826
  },
824
- children: Object.keys(y.translation).map((S) => {
825
- var A;
826
- const v = (A = y.translation) == null ? void 0 : A[S];
827
- return v ? /* @__PURE__ */ n(We, {
828
- locale: S,
829
- value: v
830
- }, S) : null;
827
+ children: Object.keys(C.translation).map((w) => {
828
+ var O;
829
+ const S = (O = C.translation) == null ? void 0 : O[w];
830
+ return S ? /* @__PURE__ */ n(We, {
831
+ locale: w,
832
+ value: S
833
+ }, w) : null;
831
834
  })
832
835
  })]
833
- }), /* @__PURE__ */ C(p, {
836
+ }), /* @__PURE__ */ v(p, {
834
837
  sx: {
835
838
  display: "flex",
836
839
  gap: 1,
@@ -842,7 +845,7 @@ function pt({
842
845
  sx: {
843
846
  color: "grey.500"
844
847
  },
845
- onClick: () => b(y),
848
+ onClick: () => y(C),
846
849
  children: /* @__PURE__ */ n(le, {
847
850
  sx: {
848
851
  fontSize: 20
@@ -854,7 +857,7 @@ function pt({
854
857
  sx: {
855
858
  color: "grey.500"
856
859
  },
857
- onClick: () => d(y),
860
+ onClick: () => b(C),
858
861
  children: /* @__PURE__ */ n(oe, {
859
862
  sx: {
860
863
  fontSize: 18
@@ -866,7 +869,7 @@ function pt({
866
869
  sx: {
867
870
  color: "grey.500"
868
871
  },
869
- onClick: () => i(y),
872
+ onClick: () => i(C),
870
873
  children: /* @__PURE__ */ n(re, {
871
874
  sx: {
872
875
  fontSize: 20
@@ -875,9 +878,9 @@ function pt({
875
878
  })]
876
879
  })]
877
880
  });
878
- return /* @__PURE__ */ C(p, {
881
+ return /* @__PURE__ */ v(p, {
879
882
  ...s,
880
- children: [/* @__PURE__ */ C(p, {
883
+ children: [/* @__PURE__ */ v(p, {
881
884
  sx: {
882
885
  display: "flex",
883
886
  alignItems: "center",
@@ -887,17 +890,17 @@ function pt({
887
890
  component: "h2",
888
891
  variant: "h6",
889
892
  children: "Manage labels"
890
- }), /* @__PURE__ */ n(O, {
893
+ }), /* @__PURE__ */ n(T, {
891
894
  color: "primary",
892
895
  variant: "contained",
893
896
  size: "small",
894
897
  sx: {
895
898
  textTransform: "none"
896
899
  },
897
- onClick: () => b(),
900
+ onClick: () => y(),
898
901
  children: "New label"
899
902
  })]
900
- }), /* @__PURE__ */ C(p, {
903
+ }), /* @__PURE__ */ v(p, {
901
904
  sx: {
902
905
  mt: 2,
903
906
  border: 1,
@@ -905,43 +908,43 @@ function pt({
905
908
  borderRadius: 1,
906
909
  overflow: "hidden"
907
910
  },
908
- children: [/* @__PURE__ */ C(p, {
911
+ children: [/* @__PURE__ */ v(p, {
909
912
  sx: {
910
913
  p: 2,
911
914
  fontSize: 14,
912
915
  fontWeight: "bold",
913
916
  bgcolor: "grey.200"
914
917
  },
915
- children: [g.length, " labels"]
918
+ children: [m.length, " labels"]
916
919
  }), /* @__PURE__ */ n(p, {
917
920
  sx: {
918
921
  pt: 0.5
919
922
  },
920
923
  children: /* @__PURE__ */ n(De, {
921
- data: f,
924
+ data: g,
922
925
  selected: [],
923
- renderItem: G,
926
+ renderItem: I,
924
927
  rowHeight: 64
925
928
  })
926
929
  })]
927
930
  }), /* @__PURE__ */ n(Me, {
928
- open: !!o,
929
- onClose: () => l(null),
930
- initialLabel: o,
931
- onSubmit: w
932
- }, o == null ? void 0 : o.id), /* @__PURE__ */ n(je, {
931
+ open: !!l,
932
+ onClose: () => o(null),
933
+ initialLabel: l,
934
+ onSubmit: M
935
+ }, l == null ? void 0 : l.id), /* @__PURE__ */ n(je, {
933
936
  open: !!r,
934
937
  onClose: () => i(null),
935
938
  label: r,
936
- onSubmit: k
939
+ onSubmit: h
937
940
  }, r == null ? void 0 : r.id)]
938
941
  });
939
942
  }
940
- const Y = V({}), Z = () => q(Y), mt = () => {
943
+ const Z = q({}), G = () => $(Z), mt = () => {
941
944
  const {
942
945
  updateLabels: e
943
- } = Z();
944
- D(() => () => {
946
+ } = G();
947
+ W(() => () => {
945
948
  e();
946
949
  }, []);
947
950
  };
@@ -951,61 +954,61 @@ function ft({
951
954
  }) {
952
955
  const {
953
956
  locale: s
954
- } = $(), [o, l] = I({
957
+ } = K(), [l, o] = z({
955
958
  loading: !0,
956
959
  labels: [],
957
960
  updateCounter: 1
958
961
  });
959
- D(() => {
962
+ W(() => {
960
963
  (async () => {
961
964
  try {
962
- l((b) => ({
963
- ...b,
965
+ o((y) => ({
966
+ ...y,
964
967
  loading: !0
965
968
  }));
966
- const m = await e();
967
- l((b) => ({
968
- ...b,
969
+ const f = await e();
970
+ o((y) => ({
971
+ ...y,
969
972
  loading: !1,
970
- labels: ze(m)
973
+ labels: ze(f)
971
974
  }));
972
- } catch (m) {
973
- console.error(m), l((b) => ({
974
- ...b,
975
+ } catch (f) {
976
+ console.error(f), o((y) => ({
977
+ ...y,
975
978
  loading: !1,
976
979
  labels: []
977
980
  }));
978
981
  }
979
982
  })();
980
- }, [o.updateCounter]);
981
- const r = z(() => {
982
- var m;
983
- return (m = o.labels) != null && m.length ? L(o.labels).reduce((b, d) => ({
984
- ...b,
985
- [d.id]: d
983
+ }, [l.updateCounter]);
984
+ const r = k(() => {
985
+ var f;
986
+ return (f = l.labels) != null && f.length ? L(l.labels).reduce((y, b) => ({
987
+ ...y,
988
+ [b.id]: b
986
989
  }), {}) : {};
987
- }, [o.labels]), i = T((c) => {
988
- var m;
990
+ }, [l.labels]), i = A((d) => {
991
+ var f;
989
992
  return {
990
- ...c,
991
- name: ((m = c.translation) == null ? void 0 : m[s]) || c.name
993
+ ...d,
994
+ name: ((f = d.translation) == null ? void 0 : f[s]) || d.name
992
995
  };
993
- }, [s]), a = T((c) => c.filter(Boolean).map((m) => r[m]).map(i), [r, i]), h = T((c) => (c == null ? void 0 : c.split(",")) || [], []), g = T((c = []) => {
994
- if (!!(c != null && c.length))
995
- return c.join(",");
996
- }, []), f = z(() => o.labels.map(i), [o.labels, i]), x = z(() => ({
997
- loading: o.loading,
998
- labels: o.labels || [],
999
- updateLabels: () => l((c) => ({
1000
- ...c,
1001
- updateCounter: ++o.updateCounter
996
+ }, [s]), a = A((d) => d.filter(Boolean).map((f) => r[f]).map(i), [r, i]), u = A((d) => (d == null ? void 0 : d.split(",")) || [], []), m = A((d = []) => {
997
+ if (!!(d != null && d.length))
998
+ return d.join(",");
999
+ }, []), g = k(() => l.labels.map(i), [l.labels, i]), x = k(() => ({
1000
+ loading: l.loading,
1001
+ labels: l.labels || [],
1002
+ updateLabels: () => o((d) => ({
1003
+ ...d,
1004
+ updateCounter: ++l.updateCounter
1002
1005
  })),
1003
1006
  getLabelsById: a,
1004
- parseLabelIds: h,
1005
- stringifyLabelIds: g,
1006
- localizedLabels: f
1007
- }), [o, a, h, g, f]);
1008
- return /* @__PURE__ */ n(Y.Provider, {
1007
+ parseLabelIds: u,
1008
+ stringifyLabelIds: m,
1009
+ localizedLabels: g
1010
+ }), [l, a, u, m, g]);
1011
+ return /* @__PURE__ */ n(Z.Provider, {
1009
1012
  value: x,
1010
1013
  children: t
1011
1014
  });
@@ -1014,74 +1017,74 @@ function gt({
1014
1017
  labels: e,
1015
1018
  editable: t,
1016
1019
  onChange: s,
1017
- sx: o
1020
+ sx: l
1018
1021
  }) {
1019
- const l = !(e != null && e.length), {
1022
+ const o = !(e != null && e.length), {
1020
1023
  labels: r,
1021
1024
  loading: i,
1022
1025
  getLabelsById: a
1023
- } = Z(), [h, g] = I(!1);
1024
- if (i || !t && l)
1026
+ } = G(), [u, m] = z(!1);
1027
+ if (i || !t && o)
1025
1028
  return null;
1026
- const f = (m) => {
1027
- s == null || s(m), setTimeout(() => {
1028
- g(!1);
1029
+ const g = (f) => {
1030
+ s == null || s(f), setTimeout(() => {
1031
+ m(!1);
1029
1032
  }, 300);
1030
1033
  };
1031
- if (h)
1034
+ if (u)
1032
1035
  return /* @__PURE__ */ n(fe, {
1033
- onClickAway: () => h && g(!1),
1036
+ onClickAway: () => u && m(!1),
1034
1037
  children: /* @__PURE__ */ n("div", {
1035
- children: /* @__PURE__ */ n(Ae, {
1038
+ children: /* @__PURE__ */ n(Oe, {
1036
1039
  data: r,
1037
1040
  value: e || [],
1038
- onChange: f
1041
+ onChange: g
1039
1042
  })
1040
1043
  })
1041
1044
  });
1042
- const x = a(e || []), c = [{
1045
+ const x = a(e || []), d = [{
1043
1046
  display: "flex",
1044
1047
  gap: 1,
1045
1048
  alignItems: "center",
1046
1049
  flexWrap: "wrap"
1047
- }, ...Array.isArray(o) ? o : [o]];
1048
- return /* @__PURE__ */ C(p, {
1049
- sx: c,
1050
- children: [x.map((m) => m ? /* @__PURE__ */ n(ge, {
1051
- label: m.name,
1050
+ }, ...Array.isArray(l) ? l : [l]];
1051
+ return /* @__PURE__ */ v(p, {
1052
+ sx: d,
1053
+ children: [x.map((f) => f ? /* @__PURE__ */ n(ge, {
1054
+ label: f.name,
1052
1055
  variant: "filled",
1053
1056
  size: "small",
1054
1057
  sx: {
1055
1058
  borderRadius: 1
1056
1059
  }
1057
- }, m.id) : null), t && !l && /* @__PURE__ */ n(N, {
1060
+ }, f.id) : null), t && !o && /* @__PURE__ */ n(N, {
1058
1061
  color: "inherit",
1059
1062
  size: "small",
1060
- onClick: () => g(!0),
1063
+ onClick: () => m(!0),
1061
1064
  sx: {
1062
1065
  color: "grey.400"
1063
1066
  },
1064
- children: /* @__PURE__ */ n(pe, {
1067
+ children: /* @__PURE__ */ n(he, {
1065
1068
  sx: {
1066
1069
  fontSize: 20
1067
1070
  }
1068
1071
  })
1069
- }), t && l && /* @__PURE__ */ n(O, {
1072
+ }), t && o && /* @__PURE__ */ n(T, {
1070
1073
  color: "inherit",
1071
1074
  variant: "outlined",
1072
1075
  startIcon: /* @__PURE__ */ n(me, {}),
1073
- onClick: () => g(!0),
1076
+ onClick: () => m(!0),
1074
1077
  children: "Edit labels"
1075
1078
  })]
1076
1079
  });
1077
1080
  }
1078
1081
  export {
1079
- pt as LabelManager,
1080
- Ae as LabelPicker,
1081
- W as LabelTree,
1082
+ ht as LabelManager,
1083
+ Oe as LabelPicker,
1084
+ F as LabelTree,
1082
1085
  gt as Labels,
1083
1086
  ft as LabelsProvider,
1084
1087
  ze as transformLabels,
1085
- Z as useLabelsContext,
1088
+ G as useLabelsContext,
1086
1089
  mt as useLabelsUpdateOnDestroy
1087
1090
  };