@instructure/platform-block-content-editor 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { Heading as lr } from "@instructure/ui-heading";
4
4
  import { Text as ue } from "@instructure/ui-text";
5
5
  import { ToggleDetails as vm } from "@instructure/ui-toggle-details";
6
6
  import { View as ae } from "@instructure/ui-view";
7
- import Y, { createContext as bt, useContext as Be, useMemo as le, useState as Q, createElement as Ul, useCallback as ie, useId as nn, useRef as W, useEffect as ve, useLayoutEffect as Ws, Children as ym, Component as wm, memo as Cm, useReducer as xm, forwardRef as Gs, cloneElement as Am, useImperativeHandle as _m, Suspense as Sm, isValidElement as Rm } from "react";
7
+ import Y, { createContext as bt, useContext as Be, useMemo as le, useState as J, createElement as Ul, useCallback as ie, useId as nn, useRef as W, useEffect as ve, useLayoutEffect as Ws, Children as ym, Component as wm, memo as Cm, useReducer as xm, forwardRef as Gs, cloneElement as Am, useImperativeHandle as _m, Suspense as Sm, isValidElement as Rm } from "react";
8
8
  import { sanitizeHtml as Im } from "@instructure/platform-sanitize";
9
9
  import { IconArrowOpenDownSolid as Wl, IconArrowOpenEndSolid as Df, IconArrowOpenUpSolid as Tm, IconArrowOpenStartSolid as km, IconCompleteSolid as Lf, IconTroubleSolid as Nf, ChevronLeftInstUIIcon as Gl, XInstUIIcon as Em, CircleStopInstUIIcon as Om, SendHorizontalInstUIIcon as Dm, OrbitInstUIIcon as Lm, ChevronRightInstUIIcon as mn, SpeechInstUIIcon as Nm, ScrollTextInstUIIcon as $m, BookAInstUIIcon as Pm, IconAiColoredSolid as $f, IconCheckLine as Mm, PencilSparklesInstUIIcon as zm, IconAiSolid as Pf, IconDragHandleLine as Jn, IconCopyLine as Bm, IconTrashLine as Ks, IconLinkLine as Fm, IconRefreshLine as Vm, LightbulbInstUIIcon as qm, ColumnsInstUIIcon as Hm, SquareInstUIIcon as jm, TableRowsSplitInstUIIcon as Um, ChevronDownSquareInstUIIcon as Wm, IconVideoLine as Mf, IconImageLine as zf, IconCodeLine as Gm, QuoteInstUIIcon as Km, IconDocumentLine as Ym, IconTextLine as Xm, IconAddLine as Ys, IconArrowOpenEndLine as Xs, IconEditLine as Zm, IconArrowOpenStartLine as Zs, IconExitFullScreenLine as Qm, IconFullScreenLine as Jm, IconXLine as eg, BlocksInstUIIcon as tg, ZapInstUIIcon as rg, Columns2InstUIIcon as ng, LayoutTemplateInstUIIcon as og } from "@instructure/ui-icons";
10
10
  import { z as F } from "zod";
@@ -340,9 +340,9 @@ function Pg({
340
340
  dropdownDirection: d = "down",
341
341
  editingItemId: u
342
342
  }) {
343
- const h = Nt(), { translations: f, translate: p } = we(Vf), m = Wt(), [b, g] = Q(
343
+ const h = Nt(), { translations: f, translate: p } = we(Vf), m = Wt(), [b, g] = J(
344
344
  new Set(u !== void 0 ? [u] : [])
345
- ), [I, w] = Q(u), [T, _] = Q(null);
345
+ ), [I, w] = J(u), [T, _] = J(null);
346
346
  u !== I && (w(u), g((P) => {
347
347
  const x = new Set(P);
348
348
  return I !== void 0 && x.delete(I), u !== void 0 && x.add(u), x;
@@ -2023,7 +2023,7 @@ function Cv({
2023
2023
  editingItemId: p
2024
2024
  }) {
2025
2025
  var N;
2026
- const m = Nt(), { translations: b, translate: g } = we(ph), I = Wt(), w = nn(), T = n.length, [_, y] = Q(p ?? ((N = n[0]) == null ? void 0 : N.id)), [R, C] = Q(p), [A, D] = Q(null), z = W(/* @__PURE__ */ new Map());
2026
+ const m = Nt(), { translations: b, translate: g } = we(ph), I = Wt(), w = nn(), T = n.length, [_, y] = J(p ?? ((N = n[0]) == null ? void 0 : N.id)), [R, C] = J(p), [A, D] = J(null), z = W(/* @__PURE__ */ new Map());
2027
2027
  p !== R && (C(p), p !== void 0 && y(p));
2028
2028
  const S = n.findIndex((L) => L.id === _), M = S >= 0 ? S : 0, $ = le(
2029
2029
  () => gv({
@@ -2485,11 +2485,11 @@ function jv({
2485
2485
  ), f = e ?? Hv, p = le(
2486
2486
  () => t && !o ? JSON.stringify(f.map(({ front: X, back: Z }) => [X, Z])) : null,
2487
2487
  [f, t, o]
2488
- ), [m, b] = Q(() => uc(p, f));
2488
+ ), [m, b] = J(() => uc(p, f));
2489
2489
  let g = m;
2490
2490
  g.key !== p && (g = uc(p, f), b(g));
2491
- const I = g.order ?? f, [w, T] = Q(0), [_, y] = Q(!1), [R, C] = Q("none"), [A, D] = Q(null), [z, S] = Q(""), M = I.length, $ = M === 0 ? 0 : Math.max(0, Math.min(w, M - 1)), P = I[$], x = W(null), N = W(null), L = W(null), E = W(!1), B = ie(() => y((X) => !X), []), q = ie(
2492
- (X, Z, te) => {
2491
+ const I = g.order ?? f, [w, T] = J(0), [_, y] = J(!1), [R, C] = J("none"), [A, D] = J(null), [z, S] = J(""), M = I.length, $ = M === 0 ? 0 : Math.max(0, Math.min(w, M - 1)), P = I[$], x = W(null), N = W(null), L = W(null), E = W(!1), B = ie(() => y((X) => !X), []), q = ie(
2492
+ (X, Z, re) => {
2493
2493
  var _e;
2494
2494
  if (c) {
2495
2495
  const { front: Le, back: be } = I[$] ?? {};
@@ -2498,7 +2498,7 @@ function jv({
2498
2498
  y(!1), C(Z), T(X);
2499
2499
  const oe = { current: X + 1, total: M }, me = (_e = I[X]) == null ? void 0 : _e.front;
2500
2500
  S(
2501
- me != null && me.trim() && !te ? a("flashCardsCardAnnouncement", { ...oe, question: me }) : a("flashCardsCounter", oe)
2501
+ me != null && me.trim() && !re ? a("flashCardsCardAnnouncement", { ...oe, question: me }) : a("flashCardsCounter", oe)
2502
2502
  );
2503
2503
  },
2504
2504
  [c, _, I, $, M, a]
@@ -2887,7 +2887,7 @@ function ay({
2887
2887
  );
2888
2888
  }
2889
2889
  function sy({ pairs: e, randomizeCards: t, isDesignerMode: r, view: n }) {
2890
- const { translations: o, translate: i } = we(ll), a = bh(), [s] = Q(() => iy(e, t, r)), [c, d] = Q(s.terms), [u, h] = Q(s.definitions), [f, p] = Q(null), [m, b] = Q(null), g = W([]), I = W(/* @__PURE__ */ new Map()), w = W(null), T = W(null), _ = W(null), y = ie(() => {
2890
+ const { translations: o, translate: i } = we(ll), a = bh(), [s] = J(() => iy(e, t, r)), [c, d] = J(s.terms), [u, h] = J(s.definitions), [f, p] = J(null), [m, b] = J(null), g = W([]), I = W(/* @__PURE__ */ new Map()), w = W(null), T = W(null), _ = W(null), y = ie(() => {
2891
2891
  for (const x of g.current)
2892
2892
  clearTimeout(x);
2893
2893
  g.current = [], _.current = null;
@@ -3266,11 +3266,11 @@ function by({
3266
3266
  );
3267
3267
  }
3268
3268
  function vy({ questionType: e, question: t, answerOrder: r, answers: n, isDesignerMode: o, view: i }) {
3269
- const { translations: a, translate: s } = we(cl), c = nn(), d = `${c}-answers`, u = `${c}-question`, h = `${c}-hint`, [f, p] = Q([]), [m, b] = Q("initial"), [g, I] = Q(null), w = W(null), T = W(null), _ = W(null), y = ie((L) => {
3269
+ const { translations: a, translate: s } = we(cl), c = nn(), d = `${c}-answers`, u = `${c}-question`, h = `${c}-hint`, [f, p] = J([]), [m, b] = J("initial"), [g, I] = J(null), w = W(null), T = W(null), _ = W(null), y = ie((L) => {
3270
3270
  T.current = L instanceof HTMLElement ? L : null;
3271
3271
  }, []), R = ie((L) => {
3272
3272
  w.current = L;
3273
- }, []), C = e === "Multiple choice", [A] = Q(
3273
+ }, []), C = e === "Multiple choice", [A] = J(
3274
3274
  () => r === "random" && C && !o ? Bn(n) : n
3275
3275
  ), D = m !== "initial", z = m === "correct", S = ie(
3276
3276
  (L, E) => {
@@ -5424,7 +5424,7 @@ function SC(e, t) {
5424
5424
  };
5425
5425
  }
5426
5426
  function RC(e, t) {
5427
- const r = W(SC(e, t)), [, n] = Q(0), o = ie(() => n((d) => d + 1), []), i = ie(
5427
+ const r = W(SC(e, t)), [, n] = J(0), o = ie(() => n((d) => d + 1), []), i = ie(
5428
5428
  (d, u) => {
5429
5429
  r.current.push(d, u), o();
5430
5430
  },
@@ -5583,7 +5583,7 @@ function lR({
5583
5583
  historyLimit: n,
5584
5584
  registry: o
5585
5585
  }) {
5586
- const [i, a] = Q(e), [s, c] = Q(t), [d, u] = Q(null), h = RC(
5586
+ const [i, a] = J(e), [s, c] = J(t), [d, u] = J(null), h = RC(
5587
5587
  { layout: t, data: e },
5588
5588
  n != null ? { limit: n } : void 0
5589
5589
  ), { pushState: f } = h, p = ie(
@@ -5799,7 +5799,7 @@ function dR(e, t, r, n) {
5799
5799
  const o = structuredClone(t);
5800
5800
  return OC(e, r).forEach((i) => Jh(o, i, n)), o;
5801
5801
  }
5802
- const ne = {
5802
+ const Q = {
5803
5803
  canvasSurface: "bce-designer-canvas-surface",
5804
5804
  canvas: "bce-designer-canvas",
5805
5805
  canvasMultiColumn: "bce-designer-canvas--multi",
@@ -5812,6 +5812,7 @@ const ne = {
5812
5812
  toolbarGroup: "bce-designer-toolbar-group",
5813
5813
  chip: "bce-designer-chip",
5814
5814
  overlay: "bce-designer-overlay",
5815
+ overlayHint: "bce-designer-overlay-hint",
5815
5816
  content: "bce-designer-content",
5816
5817
  dragOverlay: "bce-designer-drag-overlay",
5817
5818
  gridCell: "bce-designer-grid-cell",
@@ -5826,7 +5827,7 @@ function DC() {
5826
5827
  /* The full-width readable surface the centered grid sits on. Fills the scroll
5827
5828
  area (min-height) so blocks never float on a transparent backdrop, and its
5828
5829
  vertical padding clears the item toolbar/chip that overhang the first row. */
5829
- .${ne.canvasSurface} {
5830
+ .${Q.canvasSurface} {
5830
5831
  min-height: 100%;
5831
5832
  box-sizing: border-box;
5832
5833
  background-color: ${i.surfaceCardPrimary};
@@ -5834,7 +5835,7 @@ function DC() {
5834
5835
  padding-bottom: ${n.space24};
5835
5836
  }
5836
5837
 
5837
- .${ne.canvas} {
5838
+ .${Q.canvas} {
5838
5839
  position: relative;
5839
5840
  display: grid;
5840
5841
  height: fit-content;
@@ -5847,7 +5848,7 @@ function DC() {
5847
5848
  padding-right: 8px;
5848
5849
  }
5849
5850
 
5850
- .${ne.canvas}.${ne.canvasMultiColumn} {
5851
+ .${Q.canvas}.${Q.canvasMultiColumn} {
5851
5852
  width: fit-content;
5852
5853
  max-width: 1280px;
5853
5854
  padding-left: 0;
@@ -5856,14 +5857,14 @@ function DC() {
5856
5857
  grid-template-columns: repeat(${fC}, ${hC}px);
5857
5858
  }
5858
5859
 
5859
- .${ne.itemContainer} {
5860
+ .${Q.itemContainer} {
5860
5861
  position: relative;
5861
5862
  height: 100%;
5862
5863
  width: 100%;
5863
5864
  min-width: 0;
5864
5865
  }
5865
5866
 
5866
- .${ne.itemContainer}.${ne.itemContainerDragging} {
5867
+ .${Q.itemContainer}.${Q.itemContainerDragging} {
5867
5868
  pointer-events: none;
5868
5869
  border: 2px dashed ${a.grey30};
5869
5870
  border-radius: ${t.radiusMedium};
@@ -5871,7 +5872,7 @@ function DC() {
5871
5872
  background-color: ${a.grey12};
5872
5873
  }
5873
5874
 
5874
- .${ne.itemContainer}.${ne.itemContainerTrayGap}::before {
5875
+ .${Q.itemContainer}.${Q.itemContainerTrayGap}::before {
5875
5876
  content: '';
5876
5877
  position: absolute;
5877
5878
  left: 0;
@@ -5886,7 +5887,7 @@ function DC() {
5886
5887
  z-index: 1;
5887
5888
  }
5888
5889
 
5889
- .${ne.item} {
5890
+ .${Q.item} {
5890
5891
  position: relative;
5891
5892
  height: 100%;
5892
5893
  border-radius: ${t.radiusMedium};
@@ -5897,28 +5898,31 @@ function DC() {
5897
5898
  }
5898
5899
 
5899
5900
  /* Selected via focus (natural) or the data attribute (engine-driven / tool panel). */
5900
- .${ne.item}:focus-within:not(:has([data-designer-item]:focus-within)),
5901
- .${ne.item}[data-selected='true']:not(:has([data-designer-item][data-selected='true'])) {
5901
+ .${Q.item}:focus-within:not(:has([data-designer-item]:focus-within)),
5902
+ .${Q.item}[data-selected='true']:not(:has([data-designer-item][data-selected='true'])) {
5902
5903
  border-color: ${i.surfaceDark};
5903
5904
  }
5904
5905
 
5905
5906
  /* Keep the selection border while a popover has stolen focus to its portal. */
5906
- .${ne.item}.${ne.itemPopoverOpen}:not(:focus-within):not([data-selected='true']) {
5907
+ .${Q.item}.${Q.itemPopoverOpen}:not(:focus-within):not([data-selected='true']) {
5907
5908
  border-color: ${i.surfaceDark};
5908
5909
  }
5909
5910
 
5910
5911
  /* Hover border — only the innermost hovered item, and only when not selected. */
5911
- .${ne.item}:not(:focus-within):not([data-selected='true']):hover:not(:has([data-designer-item]:hover)) {
5912
+ .${Q.item}:not(:focus-within):not([data-selected='true']):hover:not(:has([data-designer-item]:hover)) {
5912
5913
  border-color: ${i.lineStroke};
5913
5914
  }
5914
5915
 
5915
- .${ne.item}:focus {
5916
+ .${Q.item}:focus {
5916
5917
  outline: none;
5917
5918
  }
5918
5919
 
5919
- .${ne.overlay} {
5920
+ .${Q.overlay} {
5920
5921
  position: absolute;
5921
5922
  inset: 0;
5923
+ display: flex;
5924
+ align-items: center;
5925
+ justify-content: center;
5922
5926
  background: transparent;
5923
5927
  border: none;
5924
5928
  padding: 0;
@@ -5927,23 +5931,43 @@ function DC() {
5927
5931
  border-radius: inherit;
5928
5932
  }
5929
5933
 
5930
- .${ne.overlay}:hover {
5934
+ .${Q.overlay}:hover {
5931
5935
  background-color: rgba(0, 0, 0, 0.02);
5932
5936
  }
5933
5937
 
5934
- .${ne.overlay}:focus-visible {
5938
+ .${Q.overlay}:focus-visible {
5935
5939
  outline: 2px solid ${i.surfaceDark};
5936
5940
  outline-offset: -2px;
5937
5941
  }
5938
5942
 
5939
- .${ne.content} {
5943
+ .${Q.overlayHint} {
5944
+ padding: ${n.space8} ${n.space16};
5945
+ border-radius: ${t.radiusSmall};
5946
+ background-color: ${i.surfaceDark};
5947
+ color: ${i.textSurfaceColored};
5948
+ font-size: 14px;
5949
+ line-height: 1.4;
5950
+ white-space: nowrap;
5951
+ pointer-events: none;
5952
+ opacity: 0;
5953
+ visibility: hidden;
5954
+ transition: opacity 200ms ease, visibility 200ms ease;
5955
+ }
5956
+
5957
+ /* Direct child, so a container's hint can never leak onto a focused child block. */
5958
+ .${Q.overlay}:focus-visible > .${Q.overlayHint} {
5959
+ opacity: 1;
5960
+ visibility: visible;
5961
+ }
5962
+
5963
+ .${Q.content} {
5940
5964
  height: 100%;
5941
5965
  width: 100%;
5942
5966
  min-width: 0;
5943
5967
  overflow: visible;
5944
5968
  }
5945
5969
 
5946
- .${ne.toolbar} {
5970
+ .${Q.toolbar} {
5947
5971
  position: absolute;
5948
5972
  top: -19px;
5949
5973
  left: 10px;
@@ -5960,13 +5984,13 @@ function DC() {
5960
5984
  pointer-events: none;
5961
5985
  }
5962
5986
 
5963
- .${ne.toolbarGroup} {
5987
+ .${Q.toolbarGroup} {
5964
5988
  display: flex;
5965
5989
  align-items: center;
5966
5990
  gap: ${n.space2};
5967
5991
  }
5968
5992
 
5969
- .${ne.chip} {
5993
+ .${Q.chip} {
5970
5994
  position: absolute;
5971
5995
  top: -11px;
5972
5996
  right: 10px;
@@ -5989,33 +6013,33 @@ function DC() {
5989
6013
  }
5990
6014
 
5991
6015
  /* Reveal the toolbar/chip for the innermost hovered/focused/selected item. */
5992
- .${ne.item}:hover:not(:has([data-designer-item]:hover)) > .${ne.toolbar},
5993
- .${ne.item}:focus:not(:has([data-designer-item]:focus)) > .${ne.toolbar},
5994
- .${ne.item}:focus-within:not(:has([data-designer-item]:focus-within)) > .${ne.toolbar},
5995
- .${ne.item}[data-selected='true']:not(:has([data-designer-item][data-selected='true'])) > .${ne.toolbar},
5996
- .${ne.item}.${ne.itemPopoverOpen} > .${ne.toolbar} {
6016
+ .${Q.item}:hover:not(:has([data-designer-item]:hover)) > .${Q.toolbar},
6017
+ .${Q.item}:focus:not(:has([data-designer-item]:focus)) > .${Q.toolbar},
6018
+ .${Q.item}:focus-within:not(:has([data-designer-item]:focus-within)) > .${Q.toolbar},
6019
+ .${Q.item}[data-selected='true']:not(:has([data-designer-item][data-selected='true'])) > .${Q.toolbar},
6020
+ .${Q.item}.${Q.itemPopoverOpen} > .${Q.toolbar} {
5997
6021
  opacity: 1;
5998
6022
  visibility: visible;
5999
6023
  pointer-events: auto;
6000
6024
  }
6001
6025
 
6002
- .${ne.item}:hover:not(:has([data-designer-item]:hover)) > .${ne.chip},
6003
- .${ne.item}:focus:not(:has([data-designer-item]:focus)) > .${ne.chip},
6004
- .${ne.item}:focus-within:not(:has([data-designer-item]:focus-within)) > .${ne.chip},
6005
- .${ne.item}[data-selected='true']:not(:has([data-designer-item][data-selected='true'])) > .${ne.chip},
6006
- .${ne.item}.${ne.itemPopoverOpen} > .${ne.chip} {
6026
+ .${Q.item}:hover:not(:has([data-designer-item]:hover)) > .${Q.chip},
6027
+ .${Q.item}:focus:not(:has([data-designer-item]:focus)) > .${Q.chip},
6028
+ .${Q.item}:focus-within:not(:has([data-designer-item]:focus-within)) > .${Q.chip},
6029
+ .${Q.item}[data-selected='true']:not(:has([data-designer-item][data-selected='true'])) > .${Q.chip},
6030
+ .${Q.item}.${Q.itemPopoverOpen} > .${Q.chip} {
6007
6031
  opacity: 1;
6008
6032
  visibility: visible;
6009
6033
  }
6010
6034
 
6011
- .${ne.dragOverlay} {
6035
+ .${Q.dragOverlay} {
6012
6036
  opacity: 0.8;
6013
6037
  max-height: 200px;
6014
6038
  overflow: hidden;
6015
6039
  transition: width 200ms ease;
6016
6040
  }
6017
6041
 
6018
- .${ne.gridCell} {
6042
+ .${Q.gridCell} {
6019
6043
  pointer-events: auto;
6020
6044
  border: 2px dashed ${a.grey30};
6021
6045
  border-radius: ${t.radiusMedium};
@@ -6024,16 +6048,16 @@ function DC() {
6024
6048
  min-height: 60px;
6025
6049
  }
6026
6050
 
6027
- .${ne.gridCell}.${ne.gridCellOver} {
6051
+ .${Q.gridCell}.${Q.gridCellOver} {
6028
6052
  border: 2px solid ${i.surfaceDark};
6029
6053
  background-color: ${a.grey12};
6030
6054
  }
6031
6055
 
6032
- .${ne.twoColumns} {
6056
+ .${Q.twoColumns} {
6033
6057
  display: contents;
6034
6058
  }
6035
6059
 
6036
- .${ne.twoColumnZone} {
6060
+ .${Q.twoColumnZone} {
6037
6061
  display: flex;
6038
6062
  flex-direction: column;
6039
6063
  gap: ${Ar}px;
@@ -6045,12 +6069,12 @@ function DC() {
6045
6069
  background-color: transparent;
6046
6070
  }
6047
6071
 
6048
- .${ne.twoColumnZone}.${ne.twoColumnZoneOver} {
6072
+ .${Q.twoColumnZone}.${Q.twoColumnZoneOver} {
6049
6073
  border-color: ${i.surfaceDark};
6050
6074
  background-color: ${i.surfacePageSecondary};
6051
6075
  }
6052
6076
 
6053
- .${ne.twoColumnEmpty} {
6077
+ .${Q.twoColumnEmpty} {
6054
6078
  display: flex;
6055
6079
  align-items: center;
6056
6080
  justify-content: center;
@@ -6310,7 +6334,7 @@ function FC(e) {
6310
6334
  }, r);
6311
6335
  }
6312
6336
  function VC() {
6313
- const [e, t] = Q("");
6337
+ const [e, t] = J("");
6314
6338
  return {
6315
6339
  announce: ie((n) => {
6316
6340
  n != null && t(n);
@@ -6328,7 +6352,7 @@ function np(e) {
6328
6352
  }, [e, t]);
6329
6353
  }
6330
6354
  function qC() {
6331
- const [e] = Q(() => /* @__PURE__ */ new Set()), t = ie((n) => (e.add(n), () => e.delete(n)), [e]);
6355
+ const [e] = J(() => /* @__PURE__ */ new Set()), t = ie((n) => (e.add(n), () => e.delete(n)), [e]);
6332
6356
  return [ie((n) => {
6333
6357
  let {
6334
6358
  type: o,
@@ -6384,7 +6408,7 @@ function UC(e) {
6384
6408
  const {
6385
6409
  announce: i,
6386
6410
  announcement: a
6387
- } = VC(), s = cn("DndLiveRegion"), [c, d] = Q(!1);
6411
+ } = VC(), s = cn("DndLiveRegion"), [c, d] = J(!1);
6388
6412
  if (ve(() => {
6389
6413
  d(!0);
6390
6414
  }, []), np(le(() => ({
@@ -7566,7 +7590,7 @@ function _x(e, t) {
7566
7590
  dependencies: n,
7567
7591
  config: o
7568
7592
  } = t;
7569
- const [i, a] = Q(null), {
7593
+ const [i, a] = J(null), {
7570
7594
  frequency: s,
7571
7595
  measure: c,
7572
7596
  strategy: d
@@ -7674,7 +7698,7 @@ function Ix(e) {
7674
7698
  }
7675
7699
  function fu(e, t, r) {
7676
7700
  t === void 0 && (t = Ix);
7677
- const [n, o] = Q(null);
7701
+ const [n, o] = J(null);
7678
7702
  function i() {
7679
7703
  o((c) => {
7680
7704
  if (!e)
@@ -7723,7 +7747,7 @@ function kx(e) {
7723
7747
  }, [e]), r;
7724
7748
  }
7725
7749
  function Ex(e) {
7726
- const [t, r] = Q(null), n = W(e), o = ie((i) => {
7750
+ const [t, r] = J(null), n = W(e), o = ie((i) => {
7727
7751
  const a = Ia(i.target);
7728
7752
  a && r((s) => s ? (s.set(a, Es(a)), new Map(s)) : null);
7729
7753
  }, []);
@@ -7807,7 +7831,7 @@ function gp(e) {
7807
7831
  const mu = [];
7808
7832
  function Lx(e, t) {
7809
7833
  t === void 0 && (t = Pr);
7810
- const [r] = e, n = gp(r ? vt(r) : null), [o, i] = Q(mu);
7834
+ const [r] = e, n = gp(r ? vt(r) : null), [o, i] = J(mu);
7811
7835
  function a() {
7812
7836
  i(() => e.length ? e.map((c) => up(c) ? n : new Il(t(c), c)) : mu);
7813
7837
  }
@@ -7830,7 +7854,7 @@ function Nx(e) {
7830
7854
  let {
7831
7855
  measure: t
7832
7856
  } = e;
7833
- const [r, n] = Q(null), o = ie((d) => {
7857
+ const [r, n] = J(null), o = ie((d) => {
7834
7858
  for (const {
7835
7859
  target: u
7836
7860
  } of d)
@@ -8170,7 +8194,7 @@ const Cp = /* @__PURE__ */ Cm(function(t) {
8170
8194
  modifiers: p,
8171
8195
  ...m
8172
8196
  } = t;
8173
- const b = xm(Bx, void 0, zx), [g, I] = b, [w, T] = qC(), [_, y] = Q(or.Uninitialized), R = _ === or.Initialized, {
8197
+ const b = xm(Bx, void 0, zx), [g, I] = b, [w, T] = qC(), [_, y] = J(or.Uninitialized), R = _ === or.Initialized, {
8174
8198
  draggable: {
8175
8199
  active: C,
8176
8200
  nodes: A,
@@ -8190,10 +8214,10 @@ const Cp = /* @__PURE__ */ Cm(function(t) {
8190
8214
  data: (ce = S == null ? void 0 : S.data) != null ? ce : Px,
8191
8215
  rect: M
8192
8216
  } : null;
8193
- }, [C, S]), P = W(null), [x, N] = Q(null), [L, E] = Q(null), B = en(m, Object.values(m)), q = cn("DndDescribedBy", a), K = le(() => z.getEnabled(), [z]), se = Vx(f), {
8217
+ }, [C, S]), P = W(null), [x, N] = J(null), [L, E] = J(null), B = en(m, Object.values(m)), q = cn("DndDescribedBy", a), K = le(() => z.getEnabled(), [z]), se = Vx(f), {
8194
8218
  droppableRects: X,
8195
8219
  measureDroppableContainers: Z,
8196
- measuringScheduled: te
8220
+ measuringScheduled: re
8197
8221
  } = _x(K, {
8198
8222
  dragging: R,
8199
8223
  dependencies: [D.x, D.y],
@@ -8244,7 +8268,7 @@ const Cp = /* @__PURE__ */ Cm(function(t) {
8244
8268
  droppableRects: X,
8245
8269
  droppableContainers: K,
8246
8270
  pointerCoordinates: Me
8247
- }) : null, Ue = Rl(de, "id"), [Ye, Mt] = Q(null), v = ye ? qe : Rr(qe, Pt), k = QC(v, (i = Ye == null ? void 0 : Ye.rect) != null ? i : null, be), O = W(null), j = ie(
8271
+ }) : null, Ue = Rl(de, "id"), [Ye, Mt] = J(null), v = ye ? qe : Rr(qe, Pt), k = QC(v, (i = Ye == null ? void 0 : Ye.rect) != null ? i : null, be), O = W(null), j = ie(
8248
8272
  (ce, Ae) => {
8249
8273
  let {
8250
8274
  sensor: Pe,
@@ -8384,7 +8408,7 @@ const Cp = /* @__PURE__ */ Cm(function(t) {
8384
8408
  ce(Pe, Ae.options, ft) === !0 && (tt.dndKit = {
8385
8409
  capturedBy: Ae.sensor
8386
8410
  }, P.current = We, j(Pe, Ae));
8387
- }, [A, j]), re = Ax(u, U);
8411
+ }, [A, j]), ne = Ax(u, U);
8388
8412
  Ox(u), Ft(() => {
8389
8413
  be && _ === or.Initializing && y(or.Initialized);
8390
8414
  }, [be, _]), ve(
@@ -8482,7 +8506,7 @@ const Cp = /* @__PURE__ */ Cm(function(t) {
8482
8506
  scrollableAncestors: Ke,
8483
8507
  scrollableAncestorRects: et
8484
8508
  });
8485
- const J = le(() => ({
8509
+ const ee = le(() => ({
8486
8510
  active: $,
8487
8511
  activeNode: oe,
8488
8512
  activeNodeRect: be,
@@ -8498,11 +8522,11 @@ const Cp = /* @__PURE__ */ Cm(function(t) {
8498
8522
  scrollableAncestors: Ke,
8499
8523
  scrollableAncestorRects: et,
8500
8524
  measuringConfiguration: se,
8501
- measuringScheduled: te,
8525
+ measuringScheduled: re,
8502
8526
  windowRect: Fe
8503
- }), [$, oe, be, L, de, xe, Ce, A, z, X, Ye, Z, Ke, et, se, te, Fe]), ee = le(() => ({
8527
+ }), [$, oe, be, L, de, xe, Ce, A, z, X, Ye, Z, Ke, et, se, re, Fe]), te = le(() => ({
8504
8528
  activatorEvent: L,
8505
- activators: re,
8529
+ activators: ne,
8506
8530
  active: $,
8507
8531
  activeNodeRect: be,
8508
8532
  ariaDescribedById: {
@@ -8512,13 +8536,13 @@ const Cp = /* @__PURE__ */ Cm(function(t) {
8512
8536
  draggableNodes: A,
8513
8537
  over: Ye,
8514
8538
  measureDroppableContainers: Z
8515
- }), [L, re, $, be, I, q, A, Ye, Z]);
8539
+ }), [L, ne, $, be, I, q, A, Ye, Z]);
8516
8540
  return Y.createElement(rp.Provider, {
8517
8541
  value: T
8518
8542
  }, Y.createElement(dn.Provider, {
8519
- value: ee
8543
+ value: te
8520
8544
  }, Y.createElement(yp.Provider, {
8521
- value: J
8545
+ value: ee
8522
8546
  }, Y.createElement(Lo.Provider, {
8523
8547
  value: k
8524
8548
  }, d)), Y.createElement(Fx, {
@@ -8679,7 +8703,7 @@ function Gx(e) {
8679
8703
  animation: t,
8680
8704
  children: r
8681
8705
  } = e;
8682
- const [n, o] = Q(null), [i, a] = Q(null), s = qn(r);
8706
+ const [n, o] = J(null), [i, a] = J(null), s = qn(r);
8683
8707
  return !r && !n && s && o(s), Ft(() => {
8684
8708
  if (!i)
8685
8709
  return;
@@ -9136,7 +9160,7 @@ function mA(e) {
9136
9160
  node: n,
9137
9161
  rect: o
9138
9162
  } = e;
9139
- const [i, a] = Q(null), s = W(r);
9163
+ const [i, a] = J(null), s = W(r);
9140
9164
  return Ft(() => {
9141
9165
  if (!t && r !== s.current && n.current) {
9142
9166
  const c = o.current;
@@ -9218,7 +9242,7 @@ function Tp(e) {
9218
9242
  ...r
9219
9243
  },
9220
9244
  disabled: T.draggable
9221
- }), K = LC(z, x), se = !!S, X = se && !m && An(f) && An(g), Z = !I && L, te = Z && X ? q : null, me = X ? te ?? (s ?? w)({
9245
+ }), K = LC(z, x), se = !!S, X = se && !m && An(f) && An(g), Z = !I && L, re = Z && X ? q : null, me = X ? re ?? (s ?? w)({
9222
9246
  rects: b,
9223
9247
  activeNodeRect: $,
9224
9248
  activeIndex: f,
@@ -9405,6 +9429,7 @@ const El = {
9405
9429
  deleteComponent: "Delete %{component}",
9406
9430
  delete: "Delete",
9407
9431
  editComponent: "Edit %{component} component",
9432
+ editBlock: "Edit block",
9408
9433
  componentGroup: "%{component} component",
9409
9434
  leftColumnLabel: "Left column",
9410
9435
  rightColumnLabel: "Right column",
@@ -9428,7 +9453,7 @@ const xA = ({ column: e, row: t }) => {
9428
9453
  "div",
9429
9454
  {
9430
9455
  ref: n,
9431
- className: `${ne.gridCell}${r ? ` ${ne.gridCellOver}` : ""}`,
9456
+ className: `${Q.gridCell}${r ? ` ${Q.gridCellOver}` : ""}`,
9432
9457
  style: { gridColumnStart: e + 1, gridRowStart: t + 1 }
9433
9458
  }
9434
9459
  );
@@ -9968,7 +9993,7 @@ function Cu(e) {
9968
9993
  return typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(e);
9969
9994
  }
9970
9995
  function PA(e) {
9971
- const [t, r] = Q(() => {
9996
+ const [t, r] = J(() => {
9972
9997
  var n;
9973
9998
  return ((n = Cu(e)) == null ? void 0 : n.matches) ?? !1;
9974
9999
  });
@@ -9994,9 +10019,9 @@ const MA = "(max-width: calc(48em - 0.0625em))", zA = ({
9994
10019
  componentRegistry: u,
9995
10020
  onUnresolvedBlock: h
9996
10021
  }) => {
9997
- const { translations: f } = we(Mr), p = PA(MA), [m, b] = Q(
10022
+ const { translations: f } = we(Mr), p = PA(MA), [m, b] = J(
9998
10023
  p ? Rt.AFTER : Rt.BOTH
9999
- ), [g, I] = Q("");
10024
+ ), [g, I] = J("");
10000
10025
  ve(() => {
10001
10026
  p && b((A) => A === Rt.BOTH ? Rt.AFTER : A);
10002
10027
  }, [p]);
@@ -10116,7 +10141,7 @@ const MA = "(max-width: calc(48em - 0.0625em))", zA = ({
10116
10141
  onApply: o,
10117
10142
  onClose: i
10118
10143
  }) => {
10119
- const a = fn(), { translations: s } = we(Mr), [c, d] = Q(""), [u, h] = Q(!1), [f, p] = Q(null), [m, b] = Q(!0), [g, I] = Q(null), w = W(null), T = (S) => n ? `${S}
10144
+ const a = fn(), { translations: s } = we(Mr), [c, d] = J(""), [u, h] = J(!1), [f, p] = J(null), [m, b] = J(!0), [g, I] = J(null), w = W(null), T = (S) => n ? `${S}
10120
10145
 
10121
10146
  Apply this to "${n}" only, and leave the rest of the block as it is.` : S, _ = async (S) => {
10122
10147
  var N, L, E;
@@ -10205,7 +10230,7 @@ Apply this to "${n}" only, and leave the rest of the block as it is.` : S, _ = a
10205
10230
  targetLabel: h,
10206
10231
  triggerSurface: f = "dark"
10207
10232
  }) => {
10208
- const { translate: p } = we(Mr), m = !(u ?? $A(s, e, t)), b = m ? "root" : "prompt", [g, I] = Q(b), [w, T] = Q(null), _ = ie(() => {
10233
+ const { translate: p } = we(Mr), m = !(u ?? $A(s, e, t)), b = m ? "root" : "prompt", [g, I] = J(b), [w, T] = J(null), _ = ie(() => {
10209
10234
  I(b), T(null), a();
10210
10235
  }, [b, a]), {
10211
10236
  prompt: y,
@@ -10246,7 +10271,7 @@ Apply this to "${n}" only, and leave the rest of the block as it is.` : S, _ = a
10246
10271
  }, !gt(s, e)) return null;
10247
10272
  const K = f === "light", se = p("aiAssistFor", {
10248
10273
  componentType: h ?? e
10249
- }), X = r ?? "block", Z = [{ component: e, id: X }], te = { [X]: t };
10274
+ }), X = r ?? "block", Z = [{ component: e, id: X }], re = { [X]: t };
10250
10275
  return /* @__PURE__ */ V(at, { children: [
10251
10276
  K && /* @__PURE__ */ l(TA, {}),
10252
10277
  M && /* @__PURE__ */ l(
@@ -10260,7 +10285,7 @@ Apply this to "${n}" only, and leave the rest of the block as it is.` : S, _ = a
10260
10285
  onRegenerate: x,
10261
10286
  isRegenerating: C,
10262
10287
  beforeLayout: Z,
10263
- beforeData: te,
10288
+ beforeData: re,
10264
10289
  afterLayout: Z,
10265
10290
  afterData: { [X]: M },
10266
10291
  componentRegistry: s
@@ -10352,7 +10377,7 @@ Apply this to "${n}" only, and leave the rest of the block as it is.` : S, _ = a
10352
10377
  canEditContent: b = !0,
10353
10378
  canDeleteContent: g = !0
10354
10379
  }, I) => {
10355
- const { translations: w, translate: T } = we(El), _ = fn(), y = ($) => !m.includes($), [R, C] = Q(!1), [A, D] = Q(!1), z = y(wr.Ai) && b && !!u && !!_ && !!h, S = r || t, M = A ? `${ne.item} ${ne.itemPopoverOpen}` : ne.item;
10380
+ const { translations: w, translate: T } = we(El), _ = fn(), y = ($) => !m.includes($), [R, C] = J(!1), [A, D] = J(!1), z = y(wr.Ai) && b && !!u && !!_ && !!h, S = r || t, M = A ? `${Q.item} ${Q.itemPopoverOpen}` : Q.item;
10356
10381
  return (
10357
10382
  // biome-ignore lint/a11y/useSemanticElements: a focusable group wrapper, not a native control
10358
10383
  /* @__PURE__ */ V(
@@ -10371,11 +10396,11 @@ Apply this to "${n}" only, and leave the rest of the block as it is.` : S, _ = a
10371
10396
  !i && /* @__PURE__ */ V(
10372
10397
  "div",
10373
10398
  {
10374
- className: ne.toolbar,
10399
+ className: Q.toolbar,
10375
10400
  role: "toolbar",
10376
10401
  "aria-label": w.componentActions,
10377
10402
  children: [
10378
- /* @__PURE__ */ V("div", { className: ne.toolbarGroup, children: [
10403
+ /* @__PURE__ */ V("div", { className: Q.toolbarGroup, children: [
10379
10404
  y(wr.Move) && !a && b && /* @__PURE__ */ l(xr, { renderTip: w.dragAndDrop, placement: "top", children: /* @__PURE__ */ l(
10380
10405
  Qe,
10381
10406
  {
@@ -10435,13 +10460,14 @@ Apply this to "${n}" only, and leave the rest of the block as it is.` : S, _ = a
10435
10460
  "button",
10436
10461
  {
10437
10462
  type: "button",
10438
- className: ne.overlay,
10463
+ className: Q.overlay,
10439
10464
  onClick: s,
10440
- "aria-label": T("editComponent", { component: S })
10465
+ "aria-label": T("editComponent", { component: S }),
10466
+ children: /* @__PURE__ */ l("span", { className: Q.overlayHint, "aria-hidden": "true", children: w.editBlock })
10441
10467
  }
10442
10468
  ),
10443
- /* @__PURE__ */ l("div", { className: ne.content, children: e }),
10444
- !i && r && /* @__PURE__ */ l("div", { className: ne.chip, "aria-hidden": "true", children: r })
10469
+ /* @__PURE__ */ l("div", { className: Q.content, children: e }),
10470
+ !i && r && /* @__PURE__ */ l("div", { className: Q.chip, "aria-hidden": "true", children: r })
10445
10471
  ]
10446
10472
  }
10447
10473
  )
@@ -10499,9 +10525,9 @@ const FA = ({
10499
10525
  const B = {};
10500
10526
  return typeof (x == null ? void 0 : x.gridColumn) == "number" && (B.gridColumnStart = x.gridColumn + 1), typeof (x == null ? void 0 : x.gridRow) == "number" && (B.gridRowStart = x.gridRow + 1), typeof (x == null ? void 0 : x.columnSpan) == "number" && (B.gridColumnEnd = `span ${x.columnSpan}`), typeof (x == null ? void 0 : x.rowSpan) == "number" && (B.gridRowEnd = `span ${x.rowSpan}`), u && typeof h == "number" && (B[Ts] = `${h}px`), B;
10501
10527
  }, [x, u, h]), L = (B) => [
10502
- ne.itemContainer,
10503
- B ? ne.itemContainerDragging : "",
10504
- u ? ne.itemContainerTrayGap : ""
10528
+ Q.itemContainer,
10529
+ B ? Q.itemContainerDragging : "",
10530
+ u ? Q.itemContainerTrayGap : ""
10505
10531
  ].filter(Boolean).join(" ");
10506
10532
  if (s) {
10507
10533
  const B = d != null && d === y;
@@ -10549,7 +10575,7 @@ function xu({
10549
10575
  "div",
10550
10576
  {
10551
10577
  ref: t,
10552
- className: `${ne.twoColumnZone}${e ? ` ${ne.twoColumnZoneOver}` : ""}`,
10578
+ className: `${Q.twoColumnZone}${e ? ` ${Q.twoColumnZoneOver}` : ""}`,
10553
10579
  "aria-label": n,
10554
10580
  role: "region",
10555
10581
  children: r
@@ -10578,16 +10604,16 @@ const VA = ({
10578
10604
  }) => {
10579
10605
  const { translations: w } = we(El), { leftChildren: T, rightChildren: _, leftIds: y, rightIds: R } = le(() => {
10580
10606
  var oe;
10581
- const Z = [], te = [];
10607
+ const Z = [], re = [];
10582
10608
  for (let me = 0; me < t.length; me++) {
10583
10609
  const _e = t[me];
10584
- ((oe = _e.props) == null ? void 0 : oe.gridColumn) === 1 ? te.push({ node: _e, index: me }) : Z.push({ node: _e, index: me });
10610
+ ((oe = _e.props) == null ? void 0 : oe.gridColumn) === 1 ? re.push({ node: _e, index: me }) : Z.push({ node: _e, index: me });
10585
10611
  }
10586
10612
  return {
10587
10613
  leftChildren: Z,
10588
- rightChildren: te,
10614
+ rightChildren: re,
10589
10615
  leftIds: Z.map((me) => me.node.id || `node-${[...h, me.index].join("-")}`),
10590
- rightIds: te.map((me) => me.node.id || `node-${[...h, me.index].join("-")}`)
10616
+ rightIds: re.map((me) => me.node.id || `node-${[...h, me.index].join("-")}`)
10591
10617
  };
10592
10618
  }, [t, h]), C = W(null), A = W(!1), D = W(!1);
10593
10619
  if (m !== C.current) {
@@ -10607,7 +10633,7 @@ const VA = ({
10607
10633
  ) : Ns, q = L ? $s(
10608
10634
  ou(_, (g == null ? void 0 : g.index) ?? 0),
10609
10635
  E
10610
- ) : Ns, K = N ? [...y, P.id] : y, se = L ? [...R, P.id] : R, X = (Z, te) => Z.length > 0 ? Z.map((oe) => /* @__PURE__ */ l(
10636
+ ) : Ns, K = N ? [...y, P.id] : y, se = L ? [...R, P.id] : R, X = (Z, re) => Z.length > 0 ? Z.map((oe) => /* @__PURE__ */ l(
10611
10637
  I,
10612
10638
  {
10613
10639
  node: oe.node,
@@ -10622,15 +10648,15 @@ const VA = ({
10622
10648
  onAIApply: d,
10623
10649
  currentPath: h,
10624
10650
  depth: u,
10625
- disabled: f || te,
10651
+ disabled: f || re,
10626
10652
  maxDepth: p,
10627
10653
  activeId: m,
10628
10654
  isSortingContainer: b,
10629
10655
  trayInsertTarget: g
10630
10656
  },
10631
10657
  oe.node.id
10632
- )) : /* @__PURE__ */ l("div", { className: ne.twoColumnEmpty, children: w.dropBlocksHere });
10633
- return /* @__PURE__ */ V("div", { className: ne.twoColumns, children: [
10658
+ )) : /* @__PURE__ */ l("div", { className: Q.twoColumnEmpty, children: w.dropBlocksHere });
10659
+ return /* @__PURE__ */ V("div", { className: Q.twoColumns, children: [
10634
10660
  /* @__PURE__ */ l(
10635
10661
  xu,
10636
10662
  {
@@ -10816,7 +10842,7 @@ const Lp = ({
10816
10842
  return /* @__PURE__ */ l(
10817
10843
  "div",
10818
10844
  {
10819
- className: ne.dragOverlay,
10845
+ className: Q.dragOverlay,
10820
10846
  style: { width: o != null ? `${o}px` : void 0 },
10821
10847
  children: e
10822
10848
  }
@@ -10834,7 +10860,7 @@ function HA({
10834
10860
  onAddFromTray: n,
10835
10861
  canvasRef: o
10836
10862
  }) {
10837
- const { translations: i, translate: a } = we(El), [s, c] = Q(null), [d, u] = Q(null), h = W(null), f = W(null), p = W(null), m = le(
10863
+ const { translations: i, translate: a } = we(El), [s, c] = J(null), [d, u] = J(null), h = W(null), f = W(null), p = W(null), m = le(
10838
10864
  () => ({
10839
10865
  onDragStart({ active: x }) {
10840
10866
  var L;
@@ -10921,22 +10947,22 @@ function HA({
10921
10947
  return Ra({
10922
10948
  ...x,
10923
10949
  droppableContainers: x.droppableContainers.filter((X) => {
10924
- var te;
10950
+ var re;
10925
10951
  const Z = X.id;
10926
- return g.includes(Z) || ((te = X.data.current) == null ? void 0 : te.type) === "grid-cell";
10952
+ return g.includes(Z) || ((re = X.data.current) == null ? void 0 : re.type) === "grid-cell";
10927
10953
  })
10928
10954
  });
10929
10955
  const N = ZC(x), L = N.length > 0 ? N : ip(x);
10930
10956
  let E = Rl(L, "id");
10931
10957
  if (E != null) {
10932
10958
  if (g.includes(E)) {
10933
- const X = e.find((te) => te.id === E), Z = (X == null ? void 0 : X.children) || [];
10959
+ const X = e.find((re) => re.id === E), Z = (X == null ? void 0 : X.children) || [];
10934
10960
  if (Z.length > 0) {
10935
- const te = Z.map((oe) => oe.id);
10961
+ const re = Z.map((oe) => oe.id);
10936
10962
  E = (K = Ra({
10937
10963
  ...x,
10938
10964
  droppableContainers: x.droppableContainers.filter(
10939
- (oe) => te.includes(oe.id)
10965
+ (oe) => re.includes(oe.id)
10940
10966
  )
10941
10967
  })[0]) == null ? void 0 : K.id;
10942
10968
  }
@@ -10950,7 +10976,7 @@ function HA({
10950
10976
  ), y = (x) => {
10951
10977
  c(x.active.id), typeof x.active.id == "string" && x.active.id.startsWith("tray-") || (p.current = e);
10952
10978
  }, R = (x) => {
10953
- var te, oe;
10979
+ var re, oe;
10954
10980
  if (!x) {
10955
10981
  h.current = null, u(null);
10956
10982
  return;
@@ -10973,7 +10999,7 @@ function HA({
10973
10999
  }
10974
11000
  L = me.id;
10975
11001
  }
10976
- const E = ((te = f.current) == null ? void 0 : te.y) ?? null, B = Math.min(48, x.rect.height / 2), q = x.rect.top + B, K = x.rect.top + x.rect.height - B;
11002
+ const E = ((re = f.current) == null ? void 0 : re.y) ?? null, B = Math.min(48, x.rect.height / 2), q = x.rect.top + B, K = x.rect.top + x.rect.height - B;
10977
11003
  let X = ((oe = h.current) == null ? void 0 : oe.overId) === L ? h.current.insertAfter : !1;
10978
11004
  E != null && (E <= q ? X = !1 : E >= K && (X = !0)), h.current = { overId: L, insertAfter: X };
10979
11005
  const Z = bC(e, L, X);
@@ -11018,10 +11044,10 @@ function HA({
11018
11044
  const q = w(N.id), K = w(E);
11019
11045
  if (!q || !K || q === K)
11020
11046
  return;
11021
- const se = N.data.current, X = L.data.current, Z = se == null ? void 0 : se.path, te = X == null ? void 0 : X.path;
11022
- if (!Z || !te)
11047
+ const se = N.data.current, X = L.data.current, Z = se == null ? void 0 : se.path, re = X == null ? void 0 : X.path;
11048
+ if (!Z || !re)
11023
11049
  return;
11024
- const oe = te[te.length - 1], me = te.slice(0, -1), _e = _a(e, Z, me, oe);
11050
+ const oe = re[re.length - 1], me = re.slice(0, -1), _e = _a(e, Z, me, oe);
11025
11051
  r(_e);
11026
11052
  }, D = (x) => {
11027
11053
  var Le, be;
@@ -11122,7 +11148,7 @@ function HA({
11122
11148
  }
11123
11149
  const Z = dt(B, E.id);
11124
11150
  if (!Z) return;
11125
- const te = Z.path, oe = te[te.length - 1], me = te.slice(0, -1), _e = _a(B, X, me, oe);
11151
+ const re = Z.path, oe = re[re.length - 1], me = re.slice(0, -1), _e = _a(B, X, me, oe);
11126
11152
  r(Is(_e));
11127
11153
  }, z = () => {
11128
11154
  c(null), u(null), h.current = null;
@@ -11170,7 +11196,7 @@ const jA = ({
11170
11196
  const { activeId: d, isSortingContainer: u, numRows: h, trayInsertTarget: f } = _A();
11171
11197
  return /* @__PURE__ */ V(at, { children: [
11172
11198
  /* @__PURE__ */ l(DC, {}),
11173
- /* @__PURE__ */ V("div", { className: ne.canvas, children: [
11199
+ /* @__PURE__ */ V("div", { className: Q.canvas, children: [
11174
11200
  d && /* @__PURE__ */ l(
11175
11201
  AA,
11176
11202
  {
@@ -11235,7 +11261,7 @@ function $p({
11235
11261
  canvasRef: d
11236
11262
  }) {
11237
11263
  const u = W(null), h = d ?? u;
11238
- return /* @__PURE__ */ l(on.Provider, { value: !0, children: /* @__PURE__ */ l("div", { ref: h, className: ne.canvasSurface, children: /* @__PURE__ */ l(
11264
+ return /* @__PURE__ */ l(on.Provider, { value: !0, children: /* @__PURE__ */ l("div", { ref: h, className: Q.canvasSurface, children: /* @__PURE__ */ l(
11239
11265
  jA,
11240
11266
  {
11241
11267
  templateLayout: e,
@@ -11553,13 +11579,13 @@ function e_({
11553
11579
  view: r,
11554
11580
  onViewChange: n
11555
11581
  }) {
11556
- const o = r !== void 0, [i, a] = Q({ view: t }), s = o ? r : i, c = W(s);
11582
+ const o = r !== void 0, [i, a] = J({ view: t }), s = o ? r : i, c = W(s);
11557
11583
  c.current = s;
11558
11584
  const d = W(o);
11559
11585
  d.current = o;
11560
11586
  const u = W(n);
11561
11587
  u.current = n;
11562
- const [h, f] = Q([]), p = ie((w) => {
11588
+ const [h, f] = J([]), p = ie((w) => {
11563
11589
  var T;
11564
11590
  d.current ? (T = u.current) == null || T.call(u, w) : a(w);
11565
11591
  }, []), m = ie(
@@ -11967,8 +11993,8 @@ var as, ef;
11967
11993
  function __() {
11968
11994
  if (ef) return as;
11969
11995
  ef = 1;
11970
- var e = Ph(), t = t_(), r = Hp(), n = n_(), o = a_(), i = s_(), a = l_(), s = c_(), c = d_(), d = Gh(), u = u_(), h = Ao(), f = f_(), p = b_(), m = y_(), b = xo(), g = pl(), I = C_(), w = an(), T = A_(), _ = vl(), y = Ll(), R = 1, C = 2, A = 4, D = "[object Arguments]", z = "[object Array]", S = "[object Boolean]", M = "[object Date]", $ = "[object Error]", P = "[object Function]", x = "[object GeneratorFunction]", N = "[object Map]", L = "[object Number]", E = "[object Object]", B = "[object RegExp]", q = "[object Set]", K = "[object String]", se = "[object Symbol]", X = "[object WeakMap]", Z = "[object ArrayBuffer]", te = "[object DataView]", oe = "[object Float32Array]", me = "[object Float64Array]", _e = "[object Int8Array]", Le = "[object Int16Array]", be = "[object Int32Array]", xe = "[object Uint8Array]", Se = "[object Uint8ClampedArray]", Ne = "[object Uint16Array]", Ce = "[object Uint32Array]", pe = {};
11971
- pe[D] = pe[z] = pe[Z] = pe[te] = pe[S] = pe[M] = pe[oe] = pe[me] = pe[_e] = pe[Le] = pe[be] = pe[N] = pe[L] = pe[E] = pe[B] = pe[q] = pe[K] = pe[se] = pe[xe] = pe[Se] = pe[Ne] = pe[Ce] = !0, pe[$] = pe[P] = pe[X] = !1;
11996
+ var e = Ph(), t = t_(), r = Hp(), n = n_(), o = a_(), i = s_(), a = l_(), s = c_(), c = d_(), d = Gh(), u = u_(), h = Ao(), f = f_(), p = b_(), m = y_(), b = xo(), g = pl(), I = C_(), w = an(), T = A_(), _ = vl(), y = Ll(), R = 1, C = 2, A = 4, D = "[object Arguments]", z = "[object Array]", S = "[object Boolean]", M = "[object Date]", $ = "[object Error]", P = "[object Function]", x = "[object GeneratorFunction]", N = "[object Map]", L = "[object Number]", E = "[object Object]", B = "[object RegExp]", q = "[object Set]", K = "[object String]", se = "[object Symbol]", X = "[object WeakMap]", Z = "[object ArrayBuffer]", re = "[object DataView]", oe = "[object Float32Array]", me = "[object Float64Array]", _e = "[object Int8Array]", Le = "[object Int16Array]", be = "[object Int32Array]", xe = "[object Uint8Array]", Se = "[object Uint8ClampedArray]", Ne = "[object Uint16Array]", Ce = "[object Uint32Array]", pe = {};
11997
+ pe[D] = pe[z] = pe[Z] = pe[re] = pe[S] = pe[M] = pe[oe] = pe[me] = pe[_e] = pe[Le] = pe[be] = pe[N] = pe[L] = pe[E] = pe[B] = pe[q] = pe[K] = pe[se] = pe[xe] = pe[Se] = pe[Ne] = pe[Ce] = !0, pe[$] = pe[P] = pe[X] = !1;
11972
11998
  function $e(ye, Je, Fe, Ke, et, qe) {
11973
11999
  var Me, St = Je & R, kt = Je & C, Pt = Je & A;
11974
12000
  if (Fe && (Me = et ? Fe(ye, Ke, et, qe) : Fe(ye)), Me !== void 0)
@@ -12962,21 +12988,21 @@ function Y_(e = {}) {
12962
12988
  }));
12963
12989
  }, R = () => {
12964
12990
  r.dirtyFields = fr(o, i, void 0, n);
12965
- }, C = (v, k = [], O, j, U = !0, re = !0) => {
12991
+ }, C = (v, k = [], O, j, U = !0, ne = !0) => {
12966
12992
  if (j && O && !t.disabled) {
12967
12993
  a.action = !0;
12968
- const J = G(n, v);
12969
- if (a.actionArrayLengths.has(v) || a.actionArrayLengths.set(v, Array.isArray(J) ? J.length : 0), re && Array.isArray(J)) {
12970
- const ce = O(J, j.argA, j.argB);
12994
+ const ee = G(n, v);
12995
+ if (a.actionArrayLengths.has(v) || a.actionArrayLengths.set(v, Array.isArray(ee) ? ee.length : 0), ne && Array.isArray(ee)) {
12996
+ const ce = O(ee, j.argA, j.argB);
12971
12997
  U && ke(n, v, ce);
12972
12998
  }
12973
- const ee = G(r.errors, v);
12974
- if (re && Array.isArray(ee)) {
12975
- const ce = ee.root, Ae = O(ee, j.argA, j.argB) || ee;
12999
+ const te = G(r.errors, v);
13000
+ if (ne && Array.isArray(te)) {
13001
+ const ce = te.root, Ae = O(te, j.argA, j.argB) || te;
12976
13002
  ce && (Ae.root = ce), U && ke(r.errors, v, Ae), W_(r.errors, v);
12977
13003
  }
12978
13004
  const fe = G(r.touchedFields, v);
12979
- if ((m.touchedFields || b.touchedFields) && re && Array.isArray(fe)) {
13005
+ if ((m.touchedFields || b.touchedFields) && ne && Array.isArray(fe)) {
12980
13006
  const ce = O(fe, j.argA, j.argB);
12981
13007
  U && ke(r.touchedFields, v, ce);
12982
13008
  }
@@ -13002,8 +13028,8 @@ function Y_(e = {}) {
13002
13028
  const k = hr(v) ? [v] : Or(v);
13003
13029
  let O = i, j = o;
13004
13030
  for (let U = 0; U < k.length - 1; U++) {
13005
- const re = k[U];
13006
- if (O = ot(O) ? O : O[re], j = ot(j) ? j : j[re], O === null && j !== null)
13031
+ const ne = k[U];
13032
+ if (O = ot(O) ? O : O[ne], j = ot(j) ? j : j[ne], O === null && j !== null)
13007
13033
  return !0;
13008
13034
  }
13009
13035
  return !1;
@@ -13011,14 +13037,14 @@ function Y_(e = {}) {
13011
13037
  if (!a.actionArrayLengths.size)
13012
13038
  return !1;
13013
13039
  const k = hr(v) ? [v] : Or(v);
13014
- let O = i, j = "", U = -1, re = 0;
13015
- for (let J = 0; J < k.length; J++) {
13040
+ let O = i, j = "", U = -1, ne = 0;
13041
+ for (let ee = 0; ee < k.length; ee++) {
13016
13042
  if (ot(O))
13017
13043
  return !1;
13018
- const ee = k[J];
13019
- if (j = j ? `${j}.${ee}` : ee, Array.isArray(O) && +ee >= O.length)
13020
- return U === -1 ? !1 : J === U ? +ee < re : !0;
13021
- a.actionArrayLengths.has(j) && (U = J + 1, re = a.actionArrayLengths.get(j)), O = O[ee];
13044
+ const te = k[ee];
13045
+ if (j = j ? `${j}.${te}` : te, Array.isArray(O) && +te >= O.length)
13046
+ return U === -1 ? !1 : ee === U ? +te < ne : !0;
13047
+ a.actionArrayLengths.has(j) && (U = ee + 1, ne = a.actionArrayLengths.get(j)), O = O[te];
13022
13048
  }
13023
13049
  return !1;
13024
13050
  }, M = (v, k, O, j) => {
@@ -13026,36 +13052,36 @@ function Y_(e = {}) {
13026
13052
  if (U) {
13027
13053
  if (z(v) || S(v))
13028
13054
  return;
13029
- const re = Te(G(i, v)), J = G(i, v, Te(O) ? G(o, v) : O);
13030
- Te(J) || j && j.defaultChecked || k ? ke(i, v, k ? J : ff(U._f)) : X(v, J), a.mount && !a.action && (_(), re && r.isDirty && (m.isDirty || b.isDirty) && (q() || (r.isDirty = !1, g.state.next({ ...r }))), e.shouldUnregister && re && !Te(G(i, v)) && Ln(v, s) && (a.watch = !0));
13055
+ const ne = Te(G(i, v)), ee = G(i, v, Te(O) ? G(o, v) : O);
13056
+ Te(ee) || j && j.defaultChecked || k ? ke(i, v, k ? ee : ff(U._f)) : X(v, ee), a.mount && !a.action && (_(), ne && r.isDirty && (m.isDirty || b.isDirty) && (q() || (r.isDirty = !1, g.state.next({ ...r }))), e.shouldUnregister && ne && !Te(G(i, v)) && Ln(v, s) && (a.watch = !0));
13031
13057
  }
13032
13058
  }, $ = (v, k, O, j, U) => {
13033
- let re = !1, J = !1;
13034
- const ee = {
13059
+ let ne = !1, ee = !1;
13060
+ const te = {
13035
13061
  name: v
13036
13062
  };
13037
13063
  if (!t.disabled || j === !0) {
13038
13064
  if (!O || j) {
13039
13065
  const fe = xt(G(o, v), k);
13040
- (m.isDirty || b.isDirty) && (J = r.isDirty, r.isDirty = ee.isDirty = !fe || q(), re = J !== ee.isDirty), J = !!G(r.dirtyFields, v), fe !== r.isDirty ? K_(r.dirtyFields, fr(o, i, void 0, n)) : fe ? He(r.dirtyFields, v) : ke(r.dirtyFields, v, !0), ee.dirtyFields = r.dirtyFields, re = re || (m.dirtyFields || b.dirtyFields) && J !== !fe;
13066
+ (m.isDirty || b.isDirty) && (ee = r.isDirty, r.isDirty = te.isDirty = !fe || q(), ne = ee !== te.isDirty), ee = !!G(r.dirtyFields, v), fe !== r.isDirty ? K_(r.dirtyFields, fr(o, i, void 0, n)) : fe ? He(r.dirtyFields, v) : ke(r.dirtyFields, v, !0), te.dirtyFields = r.dirtyFields, ne = ne || (m.dirtyFields || b.dirtyFields) && ee !== !fe;
13041
13067
  }
13042
13068
  if (O) {
13043
13069
  const fe = G(r.touchedFields, v);
13044
- fe || (ke(r.touchedFields, v, O), ee.touchedFields = r.touchedFields, re = re || (m.touchedFields || b.touchedFields) && fe !== O);
13070
+ fe || (ke(r.touchedFields, v, O), te.touchedFields = r.touchedFields, ne = ne || (m.touchedFields || b.touchedFields) && fe !== O);
13045
13071
  }
13046
- re && U && g.state.next(ee);
13072
+ ne && U && g.state.next(te);
13047
13073
  }
13048
- return re ? ee : {};
13074
+ return ne ? te : {};
13049
13075
  }, P = (v, k, O, j) => {
13050
- const U = G(r.errors, v), re = (m.isValid || b.isValid) && Ct(k) && r.isValid !== k;
13051
- if (t.delayError && O ? (c[v] = T(v, () => A(v, O)), c[v](t.delayError)) : (clearTimeout(d[v]), delete c[v], O ? ke(r.errors, v, O) : He(r.errors, v), r.errors = { ...r.errors }), (O ? !xt(U, O) : U) || !rt(j) || re) {
13052
- const J = {
13076
+ const U = G(r.errors, v), ne = (m.isValid || b.isValid) && Ct(k) && r.isValid !== k;
13077
+ if (t.delayError && O ? (c[v] = T(v, () => A(v, O)), c[v](t.delayError)) : (clearTimeout(d[v]), delete c[v], O ? ke(r.errors, v, O) : He(r.errors, v), r.errors = { ...r.errors }), (O ? !xt(U, O) : U) || !rt(j) || ne) {
13078
+ const ee = {
13053
13079
  ...j,
13054
- ...re && Ct(k) ? { isValid: k } : {},
13080
+ ...ne && Ct(k) ? { isValid: k } : {},
13055
13081
  errors: r.errors,
13056
13082
  name: v
13057
13083
  };
13058
- g.state.next(J);
13084
+ g.state.next(ee);
13059
13085
  }
13060
13086
  }, x = async (v) => (y(v, !0), await t.resolver(i, t.context, F_(v || s.mount, n, t.criteriaMode, t.shouldUseNativeValidation))), N = async (v) => {
13061
13087
  const { errors: k } = await x(v);
@@ -13100,22 +13126,22 @@ function Y_(e = {}) {
13100
13126
  eventType: j
13101
13127
  }) && (U.valid = !1, k)))
13102
13128
  return U.valid;
13103
- for (const re in v) {
13104
- const J = v[re];
13105
- if (J) {
13106
- const { _f: ee, ...fe } = J;
13107
- if (ee) {
13108
- const ce = s.array.has(ee.name), Ae = J._f && V_(J._f), Pe = m.validatingFields || m.isValidating || b.validatingFields || b.isValidating;
13109
- Ae && Pe && y([ee.name], !0);
13110
- const We = await Bs(J, s.disabled, i, w, t.shouldUseNativeValidation && !k, ce);
13111
- if (Ae && Pe && y([ee.name]), We[ee.name] && (U.valid = !1, k) || (!k && (G(We, ee.name) ? ce ? Xn(r.errors, We, ee.name) : ke(r.errors, ee.name, We[ee.name]) : He(r.errors, ee.name)), e.shouldUseNativeValidation && We[ee.name]))
13129
+ for (const ne in v) {
13130
+ const ee = v[ne];
13131
+ if (ee) {
13132
+ const { _f: te, ...fe } = ee;
13133
+ if (te) {
13134
+ const ce = s.array.has(te.name), Ae = ee._f && V_(ee._f), Pe = m.validatingFields || m.isValidating || b.validatingFields || b.isValidating;
13135
+ Ae && Pe && y([te.name], !0);
13136
+ const We = await Bs(ee, s.disabled, i, w, t.shouldUseNativeValidation && !k, ce);
13137
+ if (Ae && Pe && y([te.name]), We[te.name] && (U.valid = !1, k) || (!k && (G(We, te.name) ? ce ? Xn(r.errors, We, te.name) : ke(r.errors, te.name, We[te.name]) : He(r.errors, te.name)), e.shouldUseNativeValidation && We[te.name]))
13112
13138
  break;
13113
13139
  }
13114
13140
  !rt(fe) && await E({
13115
13141
  context: U,
13116
13142
  onlyCheckValid: k,
13117
13143
  fields: fe,
13118
- name: re,
13144
+ name: ne,
13119
13145
  eventType: j
13120
13146
  });
13121
13147
  }
@@ -13129,46 +13155,46 @@ function Y_(e = {}) {
13129
13155
  s.unMount = /* @__PURE__ */ new Set();
13130
13156
  }, q = (v, k) => (v && k && ke(i, v, k), !xt(a.mount ? i : o, o)), K = (v, k, O) => zs(v, s, {
13131
13157
  ...a.mount ? i : Te(k) || it(v) ? o : k
13132
- }, O, k), se = (v) => Vl(G(a.mount ? i : o, v, t.shouldUnregister ? G(o, v, []) : [])), X = (v, k, O = {}, j = !1, U = !1, re = !1) => {
13133
- const J = G(n, v);
13134
- let ee = k;
13135
- if (J) {
13136
- const fe = J._f;
13137
- fe && (!fe.disabled && ke(i, v, om(k, fe)), ee = Zn(fe.ref) && ot(k) ? "" : k, Jp(fe.ref) ? [...fe.ref.options].forEach((ce) => ce.selected = ee.includes(ce.value)) : fe.refs ? pn(fe.ref) ? fe.refs.forEach((ce) => {
13138
- (!ce.defaultChecked || !ce.disabled) && (Array.isArray(ee) ? ce.checked = !!ee.find((Ae) => Ae === ce.value) : ce.checked = ee === ce.value || !!ee);
13139
- }) : fe.refs.forEach((ce) => ce.checked = ce.value === ee) : $o(fe.ref) ? fe.ref.value = "" : (fe.ref.value = ee, !fe.ref.type && !U && !re && g.state.next({
13158
+ }, O, k), se = (v) => Vl(G(a.mount ? i : o, v, t.shouldUnregister ? G(o, v, []) : [])), X = (v, k, O = {}, j = !1, U = !1, ne = !1) => {
13159
+ const ee = G(n, v);
13160
+ let te = k;
13161
+ if (ee) {
13162
+ const fe = ee._f;
13163
+ fe && (!fe.disabled && ke(i, v, om(k, fe)), te = Zn(fe.ref) && ot(k) ? "" : k, Jp(fe.ref) ? [...fe.ref.options].forEach((ce) => ce.selected = te.includes(ce.value)) : fe.refs ? pn(fe.ref) ? fe.refs.forEach((ce) => {
13164
+ (!ce.defaultChecked || !ce.disabled) && (Array.isArray(te) ? ce.checked = !!te.find((Ae) => Ae === ce.value) : ce.checked = te === ce.value || !!te);
13165
+ }) : fe.refs.forEach((ce) => ce.checked = ce.value === te) : $o(fe.ref) ? fe.ref.value = "" : (fe.ref.value = te, !fe.ref.type && !U && !ne && g.state.next({
13140
13166
  name: v,
13141
13167
  values: j ? i : Ee(i)
13142
13168
  })));
13143
13169
  }
13144
- (O.shouldDirty || O.shouldTouch) && $(v, ee, O.shouldTouch, O.shouldDirty, !U), O.shouldValidate && be(v, {
13170
+ (O.shouldDirty || O.shouldTouch) && $(v, te, O.shouldTouch, O.shouldDirty, !U), O.shouldValidate && be(v, {
13145
13171
  delayError: O.delayError
13146
13172
  });
13147
- }, Z = (v, k, O, j = !1, U = !1, re = !1) => {
13173
+ }, Z = (v, k, O, j = !1, U = !1, ne = !1) => {
13148
13174
  s.array.has(v) && g.array.next({
13149
13175
  name: v,
13150
13176
  values: j ? i : Ee(i)
13151
13177
  });
13152
- for (const J in k) {
13153
- if (!k.hasOwnProperty(J))
13178
+ for (const ee in k) {
13179
+ if (!k.hasOwnProperty(ee))
13154
13180
  return;
13155
- const ee = k[J], fe = v + "." + J, ce = G(n, fe);
13156
- (s.array.has(v) || Ve(ee) || ce && !ce._f) && !ar(ee) ? Z(fe, ee, O, j, U, re) : X(fe, ee, O, j, U, re);
13181
+ const te = k[ee], fe = v + "." + ee, ce = G(n, fe);
13182
+ (s.array.has(v) || Ve(te) || ce && !ce._f) && !ar(te) ? Z(fe, te, O, j, U, ne) : X(fe, te, O, j, U, ne);
13157
13183
  }
13158
- }, te = (v, k, O, j, U = !1) => {
13159
- const re = G(n, v), J = s.array.has(v), ee = j ? k : Ee(k), fe = G(i, v), ce = xt(fe, ee);
13160
- if (ce || ke(i, v, ee), J)
13184
+ }, re = (v, k, O, j, U = !1) => {
13185
+ const ne = G(n, v), ee = s.array.has(v), te = j ? k : Ee(k), fe = G(i, v), ce = xt(fe, te);
13186
+ if (ce || ke(i, v, te), ee)
13161
13187
  g.array.next({
13162
13188
  name: v,
13163
13189
  values: j ? i : Ee(i)
13164
13190
  }), (m.isDirty || m.dirtyFields || b.isDirty || b.dirtyFields) && O.shouldDirty && (R(), U || g.state.next({
13165
13191
  name: v,
13166
13192
  dirtyFields: r.dirtyFields,
13167
- isDirty: q(v, ee)
13193
+ isDirty: q(v, te)
13168
13194
  }));
13169
13195
  else {
13170
- const Ae = Array.isArray(ee) && !ee.length || rt(ee), Pe = !ce && !U;
13171
- !re || re._f || ot(ee) || Ae ? X(v, ee, O, j, U, Pe) : Z(v, ee, O, j, U, Pe);
13196
+ const Ae = Array.isArray(te) && !te.length || rt(te), Pe = !ce && !U;
13197
+ !ne || ne._f || ot(te) || Ae ? X(v, te, O, j, U, Pe) : Z(v, te, O, j, U, Pe);
13172
13198
  }
13173
13199
  if (!ce && !U) {
13174
13200
  const Ae = Ln(v, s), Pe = j ? i : Ee(i);
@@ -13176,11 +13202,11 @@ function Y_(e = {}) {
13176
13202
  ...Ae && r,
13177
13203
  name: a.mount || Ae ? v : void 0,
13178
13204
  values: Pe
13179
- }), !J)
13205
+ }), !ee)
13180
13206
  for (const We of B_(s.array, v))
13181
13207
  g.state.next({ name: We, values: Pe });
13182
13208
  }
13183
- }, oe = (v, k, O = {}) => te(v, k, O, !1), me = (v, k = {}) => {
13209
+ }, oe = (v, k, O = {}) => re(v, k, O, !1), me = (v, k = {}) => {
13184
13210
  const O = ht(v) ? v(i) : v;
13185
13211
  if (!xt(i, O)) {
13186
13212
  i = {
@@ -13188,7 +13214,7 @@ function Y_(e = {}) {
13188
13214
  ...O
13189
13215
  };
13190
13216
  for (const j of s.mount)
13191
- P_(O, j) && te(j, G(O, j), k, !0, !0);
13217
+ P_(O, j) && re(j, G(O, j), k, !0, !0);
13192
13218
  g.state.next({
13193
13219
  ...r,
13194
13220
  name: void 0,
@@ -13200,11 +13226,11 @@ function Y_(e = {}) {
13200
13226
  a.mount = !0;
13201
13227
  const k = v.target;
13202
13228
  let O = k.name, j = !0;
13203
- const U = G(n, O), re = (J) => {
13204
- j = Number.isNaN(J) || ar(J) && isNaN(J.getTime()) || xt(J, G(i, O, J));
13229
+ const U = G(n, O), ne = (ee) => {
13230
+ j = Number.isNaN(ee) || ar(ee) && isNaN(ee.getTime()) || xt(ee, G(i, O, ee));
13205
13231
  };
13206
13232
  if (U) {
13207
- let J, ee;
13233
+ let ee, te;
13208
13234
  const fe = k.type ? ff(U._f) : Ps(v), ce = v.type === ir.BLUR || v.type === ir.FOCUS_OUT, Ae = !q_(U._f) && !e.validate && !t.resolver && !G(r.errors, O) && !U._f.deps, Pe = Ae || U_(ce, G(r.touchedFields, O), r.isSubmitted, f, h), We = Ln(O, s, ce);
13209
13235
  if (ke(i, O, fe), ce) {
13210
13236
  if (!k || !k.readOnly) {
@@ -13225,20 +13251,20 @@ function Y_(e = {}) {
13225
13251
  eventType: v.type
13226
13252
  }), !ce && We && g.state.next({ ...r }), t.resolver) {
13227
13253
  const { errors: ft } = await x([O]);
13228
- if (y([O]), re(fe), !j) {
13254
+ if (y([O]), ne(fe), !j) {
13229
13255
  !rt(tt) && g.state.next(tt);
13230
13256
  return;
13231
13257
  }
13232
13258
  const er = pf(r.errors, n, O), Ge = pf(ft, n, er.name || O);
13233
- J = Ge.error, O = Ge.name, ee = rt(ft);
13259
+ ee = Ge.error, O = Ge.name, te = rt(ft);
13234
13260
  } else
13235
- y([O], !0), J = (await Bs(U, s.disabled, i, w, t.shouldUseNativeValidation))[O], y([O]), re(fe), j && (J ? ee = !1 : (m.isValid || b.isValid) && (ee = await E({
13261
+ y([O], !0), ee = (await Bs(U, s.disabled, i, w, t.shouldUseNativeValidation))[O], y([O]), ne(fe), j && (ee ? te = !1 : (m.isValid || b.isValid) && (te = await E({
13236
13262
  fields: n,
13237
13263
  onlyCheckValid: !0,
13238
13264
  name: O,
13239
13265
  eventType: v.type
13240
13266
  })));
13241
- j && (U._f.deps && (!Array.isArray(U._f.deps) || U._f.deps.length > 0) && be(U._f.deps), P(O, ee, J, tt));
13267
+ j && (U._f.deps && (!Array.isArray(U._f.deps) || U._f.deps.length > 0) && be(U._f.deps), P(O, te, ee, tt));
13242
13268
  }
13243
13269
  }, Le = (v, k) => {
13244
13270
  if (G(r.errors, k) && v.focus)
@@ -13247,12 +13273,12 @@ function Y_(e = {}) {
13247
13273
  let O, j;
13248
13274
  const U = It(v);
13249
13275
  if (t.resolver) {
13250
- const re = await N(Te(v) ? v : U);
13251
- O = rt(re), j = v ? !U.some((J) => G(re, J)) : O;
13252
- } else v ? (j = (await Promise.all(U.map(async (re) => {
13253
- const J = G(n, re);
13276
+ const ne = await N(Te(v) ? v : U);
13277
+ O = rt(ne), j = v ? !U.some((ee) => G(ne, ee)) : O;
13278
+ } else v ? (j = (await Promise.all(U.map(async (ne) => {
13279
+ const ee = G(n, ne);
13254
13280
  return await E({
13255
- fields: J && J._f ? { [re]: J } : J,
13281
+ fields: ee && ee._f ? { [ne]: ee } : ee,
13256
13282
  eventType: ir.TRIGGER
13257
13283
  });
13258
13284
  }))).every(Boolean), !(!j && !r.isValid) && _()) : j = O = await E({
@@ -13261,8 +13287,8 @@ function Y_(e = {}) {
13261
13287
  eventType: ir.TRIGGER
13262
13288
  });
13263
13289
  if (k.delayError && t.delayError && it(v)) {
13264
- const re = G(r.errors, v);
13265
- re ? (He(r.errors, v), c[v] = T(v, () => A(v, re)), c[v](t.delayError)) : (clearTimeout(d[v]), delete c[v]);
13290
+ const ne = G(r.errors, v);
13291
+ ne ? (He(r.errors, v), c[v] = T(v, () => A(v, ne)), c[v](t.delayError)) : (clearTimeout(d[v]), delete c[v]);
13266
13292
  }
13267
13293
  return g.state.next({
13268
13294
  ...!it(v) || (m.isValid || b.isValid) && O !== r.isValid ? {} : { name: v },
@@ -13294,7 +13320,7 @@ function Y_(e = {}) {
13294
13320
  errors: r.errors
13295
13321
  }));
13296
13322
  }, pe = (v, k, O) => {
13297
- const j = (G(n, v, { _f: {} })._f || {}).ref, U = G(r.errors, v) || {}, { ref: re, message: J, type: ee, ...fe } = U;
13323
+ const j = (G(n, v, { _f: {} })._f || {}).ref, U = G(r.errors, v) || {}, { ref: ne, message: ee, type: te, ...fe } = U;
13298
13324
  ke(r.errors, v, {
13299
13325
  ...fe,
13300
13326
  ...k,
@@ -13323,13 +13349,13 @@ function Y_(e = {}) {
13323
13349
  const O = !!(!((k = v.formState) === null || k === void 0) && k.values);
13324
13350
  O && u++;
13325
13351
  const { unsubscribe: j } = g.state.subscribe({
13326
- next: (re) => {
13327
- if (j_(v.name, re.name, v.exact) && H_(re, v.formState || m, de, v.reRenderRoot)) {
13328
- const J = { ...i };
13352
+ next: (ne) => {
13353
+ if (j_(v.name, ne.name, v.exact) && H_(ne, v.formState || m, de, v.reRenderRoot)) {
13354
+ const ee = { ...i };
13329
13355
  v.callback({
13330
- values: J,
13356
+ values: ee,
13331
13357
  ...r,
13332
- ...re,
13358
+ ...ne,
13333
13359
  defaultValues: o
13334
13360
  });
13335
13361
  }
@@ -13391,22 +13417,22 @@ function Y_(e = {}) {
13391
13417
  name: v,
13392
13418
  onChange: _e,
13393
13419
  onBlur: _e,
13394
- ref: (re) => {
13395
- if (re) {
13420
+ ref: (ne) => {
13421
+ if (ne) {
13396
13422
  s.registerName.add(v), et(v, k), s.registerName.delete(v), O = G(n, v);
13397
- const J = Te(re.value) && re.querySelectorAll && re.querySelectorAll("input,select,textarea")[0] || re, ee = M_(J), fe = O._f.refs || [];
13398
- if (ee ? fe.find((Ae) => Ae === J) : J === O._f.ref)
13423
+ const ee = Te(ne.value) && ne.querySelectorAll && ne.querySelectorAll("input,select,textarea")[0] || ne, te = M_(ee), fe = O._f.refs || [];
13424
+ if (te ? fe.find((Ae) => Ae === ee) : ee === O._f.ref)
13399
13425
  return;
13400
13426
  const ce = {
13401
13427
  ...O._f
13402
13428
  };
13403
- ee ? (ce.refs = [
13429
+ te ? (ce.refs = [
13404
13430
  ...fe.filter(ms),
13405
- J,
13431
+ ee,
13406
13432
  ...Array.isArray(G(o, v)) ? [{}] : []
13407
- ], ce.ref = { type: J.type, name: v }) : (ce.ref = J, delete ce.refs), ke(n, v, {
13433
+ ], ce.ref = { type: ee.type, name: v }) : (ce.ref = ee, delete ce.refs), ke(n, v, {
13408
13434
  _f: ce
13409
- }), M(v, !1, void 0, J);
13435
+ }), M(v, !1, void 0, ee);
13410
13436
  } else
13411
13437
  O = G(n, v, {}), O._f && (O._f.mount = !1), (t.shouldUnregister || k.shouldUnregister) && !(Wp(s.array, v) && a.action) && s.unMount.add(v);
13412
13438
  }
@@ -13421,28 +13447,28 @@ function Y_(e = {}) {
13421
13447
  }, St = (v, k) => async (O) => {
13422
13448
  let j, U;
13423
13449
  O && (O.preventDefault && O.preventDefault(), O.persist && O.persist());
13424
- let re = Ee(i);
13450
+ let ne = Ee(i);
13425
13451
  if (g.state.next({
13426
13452
  isSubmitting: !0
13427
13453
  }), t.resolver) {
13428
- const { errors: J, values: ee } = await x();
13429
- y(), r.errors = J, re = Ee(ee);
13454
+ const { errors: ee, values: te } = await x();
13455
+ y(), r.errors = ee, ne = Ee(te);
13430
13456
  } else
13431
13457
  await E({
13432
13458
  fields: n,
13433
13459
  eventType: ir.SUBMIT
13434
13460
  });
13435
13461
  if (s.disabled.size)
13436
- for (const J of s.disabled)
13437
- He(re, J);
13462
+ for (const ee of s.disabled)
13463
+ He(ne, ee);
13438
13464
  if (He(r.errors, Gp), rt(r.errors)) {
13439
13465
  g.state.next({
13440
13466
  errors: {}
13441
13467
  });
13442
13468
  try {
13443
- j = await v(re, O);
13444
- } catch (J) {
13445
- U = J;
13469
+ j = await v(ne, O);
13470
+ } catch (ee) {
13471
+ U = ee;
13446
13472
  }
13447
13473
  } else
13448
13474
  k && await k({ ...r.errors }, O), qe(), setTimeout(qe);
@@ -13458,21 +13484,21 @@ function Y_(e = {}) {
13458
13484
  }, kt = (v, k = {}) => {
13459
13485
  G(n, v) && (Te(k.defaultValue) ? oe(v, Ee(G(o, v))) : (oe(v, k.defaultValue), ke(o, v, Ee(k.defaultValue))), k.keepTouched || He(r.touchedFields, v), k.keepDirty || (He(r.dirtyFields, v), r.isDirty = k.defaultValue ? q(v, Ee(G(o, v))) : q()), k.keepError || (He(r.errors, v), m.isValid && _()), g.state.next({ ...r }));
13460
13486
  }, Pt = (v, k = {}) => {
13461
- const O = v ? Ee(v) : o, j = Ee(O), U = rt(v), re = j, J = n;
13487
+ const O = v ? Ee(v) : o, j = Ee(O), U = rt(v), ne = j, ee = n;
13462
13488
  if (k.keepDefaultValues || (o = O), !k.keepValues) {
13463
13489
  if (k.keepDirtyValues) {
13464
- const ee = /* @__PURE__ */ new Set([
13490
+ const te = /* @__PURE__ */ new Set([
13465
13491
  ...s.mount,
13466
- ...em(fr(o, i, void 0, J), r.dirtyFields)
13492
+ ...em(fr(o, i, void 0, ee), r.dirtyFields)
13467
13493
  ]);
13468
- for (const fe of ee) {
13469
- const ce = G(r.dirtyFields, fe), Ae = G(i, fe), Pe = G(re, fe);
13470
- ce && !Te(Ae) ? ke(re, fe, Ae) : !ce && !Te(Pe) && oe(fe, Pe);
13494
+ for (const fe of te) {
13495
+ const ce = G(r.dirtyFields, fe), Ae = G(i, fe), Pe = G(ne, fe);
13496
+ ce && !Te(Ae) ? ke(ne, fe, Ae) : !ce && !Te(Pe) && oe(fe, Pe);
13471
13497
  }
13472
13498
  } else {
13473
13499
  if (Po && Te(v))
13474
- for (const ee of s.mount) {
13475
- const fe = G(n, ee);
13500
+ for (const te of s.mount) {
13501
+ const fe = G(n, te);
13476
13502
  if (fe && fe._f) {
13477
13503
  const ce = Array.isArray(fe._f.refs) ? fe._f.refs[0] : fe._f.ref;
13478
13504
  if (Zn(ce)) {
@@ -13485,23 +13511,23 @@ function Y_(e = {}) {
13485
13511
  }
13486
13512
  }
13487
13513
  if (k.keepFieldsRef)
13488
- for (const ee of s.mount)
13489
- oe(ee, G(re, ee));
13514
+ for (const te of s.mount)
13515
+ oe(te, G(ne, te));
13490
13516
  else
13491
13517
  n = {};
13492
13518
  }
13493
13519
  if (t.shouldUnregister) {
13494
13520
  if (i = k.keepDefaultValues ? Ee(o) : {}, k.keepFieldsRef)
13495
- for (const ee of s.mount)
13496
- ke(i, ee, G(re, ee));
13521
+ for (const te of s.mount)
13522
+ ke(i, te, G(ne, te));
13497
13523
  } else
13498
- i = Ee(re);
13524
+ i = Ee(ne);
13499
13525
  g.array.next({
13500
- values: { ...re }
13526
+ values: { ...ne }
13501
13527
  }), g.state.next({
13502
13528
  name: void 0,
13503
13529
  type: void 0,
13504
- values: { ...re }
13530
+ values: { ...ne }
13505
13531
  });
13506
13532
  }
13507
13533
  s = {
@@ -13513,11 +13539,11 @@ function Y_(e = {}) {
13513
13539
  watch: /* @__PURE__ */ new Set(),
13514
13540
  watchAll: !1,
13515
13541
  focus: ""
13516
- }, a.mount = !m.isValid || !!k.keepIsValid || !!k.keepDirtyValues || !t.shouldUnregister && !rt(re), a.watch = !!t.shouldUnregister, a.keepIsValid = !!k.keepIsValid, a.action = !1, a.actionArrayLengths.clear(), k.keepErrors || (r.errors = {}), g.state.next({
13542
+ }, a.mount = !m.isValid || !!k.keepIsValid || !!k.keepDirtyValues || !t.shouldUnregister && !rt(ne), a.watch = !!t.shouldUnregister, a.keepIsValid = !!k.keepIsValid, a.action = !1, a.actionArrayLengths.clear(), k.keepErrors || (r.errors = {}), g.state.next({
13517
13543
  submitCount: k.keepSubmitCount ? r.submitCount : 0,
13518
13544
  isDirty: U ? !1 : k.keepDirty ? r.isDirty : k.keepValues ? q() : !!(k.keepDefaultValues && !xt(v, o)),
13519
13545
  isSubmitted: k.keepIsSubmitted ? r.isSubmitted : !1,
13520
- dirtyFields: U ? {} : k.keepDirtyValues ? k.keepDefaultValues && i ? fr(o, i, void 0, J) : r.dirtyFields : k.keepDefaultValues && v ? fr(o, v, void 0, J) : k.keepDirty ? r.dirtyFields : {},
13546
+ dirtyFields: U ? {} : k.keepDirtyValues ? k.keepDefaultValues && i ? fr(o, i, void 0, ee) : r.dirtyFields : k.keepDefaultValues && v ? fr(o, v, void 0, ee) : k.keepDirty ? r.dirtyFields : {},
13521
13547
  touchedFields: k.keepTouched ? r.touchedFields : {},
13522
13548
  errors: k.keepErrors ? r.errors : {},
13523
13549
  isSubmitSuccessful: k.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
@@ -13859,7 +13885,7 @@ function i0({
13859
13885
  scope: a
13860
13886
  }) {
13861
13887
  var m;
13862
- const s = fn(), [c, d] = Q(!1), u = W(null), h = W(!1);
13888
+ const s = fn(), [c, d] = J(!1), u = W(null), h = W(!1);
13863
13889
  if (ve(() => {
13864
13890
  var b, g;
13865
13891
  h.current && !c && ((g = (b = u.current) == null ? void 0 : b.querySelector("button")) == null || g.focus()), h.current = c;
@@ -13885,7 +13911,7 @@ function i0({
13885
13911
  }
13886
13912
  const sm = bt(void 0);
13887
13913
  function a0({ children: e }) {
13888
- const [t, r] = Q(null), n = le(
13914
+ const [t, r] = J(null), n = le(
13889
13915
  () => ({ setHeaderActions: r, headerActions: t }),
13890
13916
  [t]
13891
13917
  );
@@ -13991,7 +14017,7 @@ async function d0(e) {
13991
14017
  }), mediaType: t };
13992
14018
  }
13993
14019
  function u0() {
13994
- const e = fn(), { translations: t } = we(Mr), [r, n] = Q(!1), [o, i] = Q(null);
14020
+ const e = fn(), { translations: t } = we(Mr), [r, n] = J(!1), [o, i] = J(null);
13995
14021
  return { isLoading: r, error: o, generateAltText: async (s) => {
13996
14022
  if (!e) return null;
13997
14023
  n(!0), i(null);
@@ -14029,7 +14055,7 @@ function f0({
14029
14055
  }) {
14030
14056
  const { translations: a } = we(Mr), { name: s, label: c, required: d } = e, u = Qt(r), h = fn(), f = sr({ control: t, name: "asset_id" }) ?? "", p = W(f);
14031
14057
  p.current = f;
14032
- const { fetchAsset: m } = Cb(), { error: b, generateAltText: g } = u0(), [I, w] = Q(null), [T, _] = Q(null), [y, R] = Q(!1), C = !y && T === f ? I ?? b : null, A = async () => {
14058
+ const { fetchAsset: m } = Cb(), { error: b, generateAltText: g } = u0(), [I, w] = J(null), [T, _] = J(null), [y, R] = J(!1), C = !y && T === f ? I ?? b : null, A = async () => {
14033
14059
  if (!f || y) return;
14034
14060
  const D = f;
14035
14061
  R(!0), _(f), w(null);
@@ -14222,7 +14248,7 @@ function cm({
14222
14248
  header: o,
14223
14249
  mediaType: i = "image"
14224
14250
  }) {
14225
- const { translations: a } = we(Jt), [s, c] = Q(null), d = W(null), {
14251
+ const { translations: a } = we(Jt), [s, c] = J(null), d = W(null), {
14226
14252
  field: { value: u, onChange: h }
14227
14253
  } = zl({ name: "asset_id", control: e }), f = yb(u || ""), { upload: p, isUploading: m } = wb(), b = async (T) => {
14228
14254
  if (T.size > r.maxFileSizeBytes) {
@@ -15434,7 +15460,7 @@ const xf = {
15434
15460
  height: "100%"
15435
15461
  }, Af = 260, _f = 20;
15436
15462
  function H0({ componentRegistry: e }) {
15437
- const t = le(() => JA(e), [e]), [r, n] = Q(null), [o, i] = Q(null), a = W({ x: 0, y: 0 }), [, s] = Q(0), c = ie((f) => {
15463
+ const t = le(() => JA(e), [e]), [r, n] = J(null), [o, i] = J(null), a = W({ x: 0, y: 0 }), [, s] = J(0), c = ie((f) => {
15438
15464
  a.current = { x: f.clientX, y: f.clientY }, s((p) => p + 1);
15439
15465
  }, []);
15440
15466
  if (ve(() => {
@@ -16017,7 +16043,7 @@ function Tf(e) {
16017
16043
  return !e || typeof window > "u" || typeof window.matchMedia != "function" ? null : window.matchMedia(U0);
16018
16044
  }
16019
16045
  function mm(e = !0) {
16020
- const [t, r] = Q(() => {
16046
+ const [t, r] = J(() => {
16021
16047
  const n = Tf(e);
16022
16048
  return n ? !n.matches : !1;
16023
16049
  });
@@ -16056,24 +16082,24 @@ function oS({
16056
16082
  (de, Ue) => (de.priority ?? Number.POSITIVE_INFINITY) - (Ue.priority ?? Number.POSITIVE_INFINITY)
16057
16083
  ),
16058
16084
  [e]
16059
- ), { translations: T } = we(Zt), _ = nn().replace(/:/g, ""), y = `bce-tool-panel-content-${_}`, R = `bce-tool-panel-heading-${_}`, C = mm(p), A = d !== void 0, [D, z] = Q(
16085
+ ), { translations: T } = we(Zt), _ = nn().replace(/:/g, ""), y = `bce-tool-panel-content-${_}`, R = `bce-tool-panel-heading-${_}`, C = mm(p), A = d !== void 0, [D, z] = J(
16060
16086
  () => t ? w.find((de) => de.id === t) ?? null : null
16061
16087
  ), S = A ? d != null ? w.find((de) => de.id === d) ?? null : null : D, M = (de) => {
16062
16088
  A ? u == null || u((de == null ? void 0 : de.id) ?? null) : z(de);
16063
- }, [$, P] = Q(null), x = !!S, N = W(null), L = W(!!(t ?? d));
16089
+ }, [$, P] = J(null), x = !!S, N = W(null), L = W(!!(t ?? d));
16064
16090
  tS(!!S, N);
16065
- const [E] = Q(() => nS()), B = (de) => {
16091
+ const [E] = J(() => nS()), B = (de) => {
16066
16092
  const Ue = E != null ? Math.min(de, E) : de;
16067
16093
  return If(Math.max(Ue, vs));
16068
- }, [q, K] = Q(
16094
+ }, [q, K] = J(
16069
16095
  () => B((S == null ? void 0 : S.expandedWidth) ?? vs)
16070
- ), [se, X] = Q(!1), [Z, te] = Q(!1), [oe, me] = Q(!1), _e = W(q), Le = W(!1), [be, xe] = Q(S == null ? void 0 : S.id), Se = W(null), Ne = W(q);
16096
+ ), [se, X] = J(!1), [Z, re] = J(!1), [oe, me] = J(!1), _e = W(q), Le = W(!1), [be, xe] = J(S == null ? void 0 : S.id), Se = W(null), Ne = W(q);
16071
16097
  Ne.current = q;
16072
16098
  const Ce = W(null), pe = W(void 0);
16073
16099
  ve(() => {
16074
16100
  S && P(S), a == null || a((S == null ? void 0 : S.id) ?? null);
16075
16101
  }, [S, a]), ve(() => {
16076
- !S && Z && (te(!1), s == null || s(!1));
16102
+ !S && Z && (re(!1), s == null || s(!1));
16077
16103
  }, [S, Z, s]);
16078
16104
  const $e = (de) => {
16079
16105
  document.activeElement instanceof HTMLElement && (N.current = document.activeElement), (S == null ? void 0 : S.id) === de ? M(null) : M(w.find((Ue) => Ue.id === de) ?? null);
@@ -16092,17 +16118,17 @@ function oS({
16092
16118
  const Fe = () => {
16093
16119
  if (Z) {
16094
16120
  const de = Se.current instanceof HTMLElement ? Se.current.offsetWidth : _e.current;
16095
- me(!0), K(de), te(!1), s == null || s(!1), requestAnimationFrame(() => {
16121
+ me(!0), K(de), re(!1), s == null || s(!1), requestAnimationFrame(() => {
16096
16122
  requestAnimationFrame(() => {
16097
16123
  me(!1), K(_e.current);
16098
16124
  });
16099
16125
  });
16100
16126
  } else
16101
- _e.current = q, te(!0), s == null || s(!0);
16127
+ _e.current = q, re(!0), s == null || s(!0);
16102
16128
  }, Ke = (de) => {
16103
16129
  de.preventDefault();
16104
16130
  const Ue = de.clientX, Ye = q;
16105
- X(!0), Z && (s == null || s(!1)), te(!1), document.body.style.userSelect = "none";
16131
+ X(!0), Z && (s == null || s(!1)), re(!1), document.body.style.userSelect = "none";
16106
16132
  const Mt = (k) => {
16107
16133
  Le.current = !0, K(If(Ye + (k.clientX - Ue)));
16108
16134
  }, v = () => {
@@ -16244,7 +16270,7 @@ function aS({
16244
16270
  }, [e]), a = ie(
16245
16271
  () => {
16246
16272
  var f;
16247
- return !!((f = e.current) != null && f.querySelector(`.${ne.itemPopoverOpen}`)) || !!document.querySelector(kA);
16273
+ return !!((f = e.current) != null && f.querySelector(`.${Q.itemPopoverOpen}`)) || !!document.querySelector(kA);
16248
16274
  },
16249
16275
  [e]
16250
16276
  ), s = ie(() => {
@@ -16341,48 +16367,48 @@ function hR({
16341
16367
  hasExpandPanelButton: a
16342
16368
  }) {
16343
16369
  var Z;
16344
- const { translations: s } = we(Zt), c = Ut(), { selectedComponentId: d, templateData: u, templateLayout: h } = e, f = new Set(n), p = Us.find((te) => f.has(te)), m = sS.find((te) => f.has(te)), b = (te) => f.has(te) || (r == null ? void 0 : r.some((oe) => oe.id === te)) === !0, [g, I] = Q(
16370
+ const { translations: s } = we(Zt), c = Ut(), { selectedComponentId: d, templateData: u, templateLayout: h } = e, f = new Set(n), p = Us.find((re) => f.has(re)), m = sS.find((re) => f.has(re)), b = (re) => f.has(re) || (r == null ? void 0 : r.some((oe) => oe.id === re)) === !0, [g, I] = J(
16345
16371
  (o && b(o) ? o : void 0) ?? p ?? ((Z = r == null ? void 0 : r[0]) == null ? void 0 : Z.id) ?? null
16346
- ), [w, T] = Q({ view: "main" }), _ = mm(), [y, R] = Q(null), C = W(null);
16372
+ ), [w, T] = J({ view: "main" }), _ = mm(), [y, R] = J(null), C = W(null);
16347
16373
  _ !== y && (R(_), _ ? (C.current = d ? null : g, C.current && I(null)) : (C.current && !g && I(C.current), C.current = null));
16348
16374
  const A = W(null), D = le(() => {
16349
- var te;
16375
+ var re;
16350
16376
  if (d)
16351
- return (te = dt(h, d)) == null ? void 0 : te.node.component;
16377
+ return (re = dt(h, d)) == null ? void 0 : re.node.component;
16352
16378
  }, [d, h]), z = d ? u[d] ?? null : null, S = le(() => {
16353
16379
  var oe;
16354
16380
  if (!D) return !1;
16355
- const te = (oe = gt(t, D)) == null ? void 0 : oe.schema;
16356
- return te ? cS(te) : !1;
16357
- }, [t, D]), M = (te, oe) => {
16381
+ const re = (oe = gt(t, D)) == null ? void 0 : oe.schema;
16382
+ return re ? cS(re) : !1;
16383
+ }, [t, D]), M = (re, oe) => {
16358
16384
  var be, xe;
16359
16385
  const me = (be = Zf(oe)) == null ? void 0 : be.category, _e = gm[me ?? "activityContent"];
16360
- e.setSelectedComponentId(te);
16386
+ e.setSelectedComponentId(re);
16361
16387
  const Le = f.has(_e) ? _e : m;
16362
16388
  Le && I(Le), T({ view: lS, subtitle: (xe = gt(t, oe)) == null ? void 0 : xe.label });
16363
16389
  }, $ = () => {
16364
16390
  e.setSelectedComponentId(null), T({ view: "main" });
16365
- }, P = (te, oe, me) => {
16366
- const _e = e.addComponent(te, oe, me);
16391
+ }, P = (re, oe, me) => {
16392
+ const _e = e.addComponent(re, oe, me);
16367
16393
  _e && M(_e.componentId, _e.componentType);
16368
- }, x = (te) => {
16394
+ }, x = (re) => {
16369
16395
  var me;
16370
- if (!te) {
16396
+ if (!re) {
16371
16397
  $();
16372
16398
  return;
16373
16399
  }
16374
- const oe = (me = dt(h, te)) == null ? void 0 : me.node.component;
16375
- oe && M(te, oe);
16376
- }, N = (te) => {
16377
- const oe = e.deleteComponent(te);
16400
+ const oe = (me = dt(h, re)) == null ? void 0 : me.node.component;
16401
+ oe && M(re, oe);
16402
+ }, N = (re) => {
16403
+ const oe = e.deleteComponent(re);
16378
16404
  d && (oe != null && oe.deletedIds.includes(d)) && T({ view: "main" });
16379
16405
  }, { canvasProps: L, panelProps: E, suppressNextDeselect: B } = aS({
16380
16406
  canvasRef: A,
16381
16407
  onDeselect: $
16382
16408
  }), K = {
16383
16409
  registry: t,
16384
- onAddComponent: (te) => {
16385
- B(), P(te);
16410
+ onAddComponent: (re) => {
16411
+ B(), P(re);
16386
16412
  },
16387
16413
  selectedComponentType: D,
16388
16414
  selectedComponentId: d,
@@ -16427,7 +16453,7 @@ function hR({
16427
16453
  icon: /* @__PURE__ */ l(og, { size: "sm" }),
16428
16454
  content: /* @__PURE__ */ l(j0, {})
16429
16455
  }
16430
- ].filter((te) => f.has(te.id)),
16456
+ ].filter((re) => f.has(re.id)),
16431
16457
  ...r ?? []
16432
16458
  ];
16433
16459
  return /* @__PURE__ */ l(
@@ -16445,8 +16471,8 @@ function hR({
16445
16471
  {
16446
16472
  tools: X,
16447
16473
  selectedToolId: g,
16448
- onSelectedToolIdChange: (te) => {
16449
- C.current = null, I(te), T({ view: "main" });
16474
+ onSelectedToolIdChange: (re) => {
16475
+ C.current = null, I(re), T({ view: "main" });
16450
16476
  },
16451
16477
  view: w,
16452
16478
  onViewChange: T,
@@ -16479,7 +16505,7 @@ function hR({
16479
16505
  onSelectComponent: x,
16480
16506
  onDeleteNode: N,
16481
16507
  onDuplicateNode: e.duplicateComponent,
16482
- onAIApply: (te, oe) => e.changeComponent(oe, te)
16508
+ onAIApply: (re, oe) => e.changeComponent(oe, re)
16483
16509
  }
16484
16510
  )
16485
16511
  }