zs_library 0.7.12 → 0.7.13

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
@@ -372,10 +372,10 @@ zt(Be, "uniqueArray", (t) => t.reduce((o, n) => o.find((i) => i.id === n.id) ? o
372
372
  zt(Be, "computeRowWidth", (t, o = 112) => {
373
373
  const n = window.getComputedStyle(t), r = parseFloat(n.paddingLeft) || 0, i = parseFloat(n.paddingRight) || 0, l = parseFloat(n.columnGap) || 0, s = t.clientWidth - r - i;
374
374
  let c = Math.max(1, Math.floor((s + l) / (o + l)));
375
- const p = c * o + (c - 1) * l;
376
- s - p >= o * 0.9 && (c += 1);
377
- const u = c * o + (c - 1) * l, f = u > s ? Math.round((s - u) / 2) : 0;
378
- return { cols: c, width: u, marginLeft: f };
375
+ const u = c * o + (c - 1) * l;
376
+ s - u >= o * 0.9 && (c += 1);
377
+ const p = c * o + (c - 1) * l, f = p > s ? Math.round((s - p) / 2) : 0;
378
+ return { cols: c, width: p, marginLeft: f };
379
379
  });
380
380
  const _n = Tt({
381
381
  list: [],
@@ -432,7 +432,7 @@ const _n = Tt({
432
432
  onChange: n,
433
433
  storageKey: r = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
434
434
  enableCaching: i = !0
435
- } = e, { typeConfigMap: l } = Ce(), [s, c] = N(), [p, h] = N(), [u, f] = N(null), g = K(u), [d, m] = N(null), [b, v] = N([]), [y, k] = N(null), [S, x] = N(null), [w, z] = N(!1), [I, M] = N(null), [R, V] = N(null), [$, _] = N(null), [j, J] = N(0), [ie, ue] = N(!1), [H, ae] = vi(r, {
435
+ } = e, { typeConfigMap: l } = Ce(), [s, c] = N(), [u, h] = N(), [p, f] = N(null), g = K(p), [d, m] = N(null), [b, v] = N([]), [y, k] = N(null), [S, x] = N(null), [w, z] = N(!1), [I, M] = N(null), [R, V] = N(null), [$, _] = N(null), [j, J] = N(0), [ie, ue] = N(!1), [H, ae] = vi(r, {
436
436
  defaultValue: [],
437
437
  listenStorageChange: !0
438
438
  }), be = () => {
@@ -467,7 +467,7 @@ const _n = Tt({
467
467
  ));
468
468
  },
469
469
  onMouseUp: () => {
470
- clearTimeout(p), h(void 0), clearTimeout(s), c(void 0);
470
+ clearTimeout(u), h(void 0), clearTimeout(s), c(void 0);
471
471
  },
472
472
  onContextMenu: (q) => {
473
473
  Y(W) && pe && (q.preventDefault(), se(q, W));
@@ -579,8 +579,8 @@ const _n = Tt({
579
579
  D(() => {
580
580
  (o == null ? void 0 : o.length) > 0 && b.length === 0 && X(o);
581
581
  }, [o]), D(() => {
582
- g.current = u, u !== null && be();
583
- }, [u]), D(() => {
582
+ g.current = p, p !== null && be();
583
+ }, [p]), D(() => {
584
584
  i && H != null && H.length && !ie && (X(H), ue(!0));
585
585
  }, [H, ie, i, X]), xi(
586
586
  () => {
@@ -602,7 +602,7 @@ const _n = Tt({
602
602
  setList: X,
603
603
  contextMenu: d,
604
604
  setContextMenu: m,
605
- listStatus: u,
605
+ listStatus: p,
606
606
  setListStatus: f,
607
607
  contextMenuFuns: xe,
608
608
  hideContextMenu: be,
@@ -642,8 +642,8 @@ const _n = Tt({
642
642
  triggerZoneWidth: l = 80,
643
643
  containerRef: s,
644
644
  onCreateNewPage: c
645
- }, p) => {
646
- const h = K(null), [u, f] = N(null), g = K(0), d = K(!1), m = U(() => {
645
+ }, u) => {
646
+ const h = K(null), [p, f] = N(null), g = K(0), d = K(!1), m = U(() => {
647
647
  h.current && (clearTimeout(h.current), h.current = null), d.current = !1;
648
648
  }, []), b = U(
649
649
  (x) => {
@@ -652,7 +652,7 @@ const _n = Tt({
652
652
  if (x === "right" && w && z)
653
653
  return;
654
654
  const I = Date.now();
655
- d.current || I - g.current < i + 200 || u !== x && (f(x), m(), h.current = setTimeout(() => {
655
+ d.current || I - g.current < i + 200 || p !== x && (f(x), m(), h.current = setTimeout(() => {
656
656
  const M = e.current;
657
657
  if (!M) {
658
658
  f(null);
@@ -670,7 +670,7 @@ const _n = Tt({
670
670
  n,
671
671
  m,
672
672
  e,
673
- u,
673
+ p,
674
674
  i,
675
675
  c
676
676
  ]
@@ -689,7 +689,7 @@ const _n = Tt({
689
689
  return;
690
690
  b("right");
691
691
  } else
692
- u && v();
692
+ p && v();
693
693
  },
694
694
  [
695
695
  r,
@@ -699,12 +699,12 @@ const _n = Tt({
699
699
  o,
700
700
  n,
701
701
  b,
702
- u,
702
+ p,
703
703
  v
704
704
  ]
705
705
  );
706
706
  tt(
707
- p,
707
+ u,
708
708
  () => ({
709
709
  handleDragMove: y
710
710
  }),
@@ -781,7 +781,7 @@ const _n = Tt({
781
781
  t > 0 && /* @__PURE__ */ a(
782
782
  "div",
783
783
  {
784
- className: F(k, "left", u === "left" && "active"),
784
+ className: F(k, "left", p === "left" && "active"),
785
785
  onMouseEnter: () => {
786
786
  r && b("left");
787
787
  },
@@ -793,7 +793,7 @@ const _n = Tt({
793
793
  /* @__PURE__ */ a(
794
794
  "div",
795
795
  {
796
- className: F(k, "right", u === "right" && "active"),
796
+ className: F(k, "right", p === "right" && "active"),
797
797
  onMouseEnter: () => {
798
798
  const x = t >= o - 1, w = typeof n == "number" && o >= n;
799
799
  r && !(x && w) && b("right");
@@ -1012,11 +1012,11 @@ const os = Fe(({ src: e }) => {
1012
1012
  }
1013
1013
  return i ? typeof i == "string" && (i.startsWith("http") || i.startsWith("https")) ? /* @__PURE__ */ a(os, { src: i }) : i : n ? typeof n == "function" ? n(e) : n : null;
1014
1014
  }, Kn = (e) => {
1015
- var u, f;
1015
+ var p, f;
1016
1016
  const { data: t, noLetters: o = !1, name: n, defaultName: r, className: i } = e, { moveItemId: l } = $e(), { theme: s } = Ce(), c = {
1017
1017
  visible: { opacity: 1, scale: 1 },
1018
1018
  hidden: { opacity: 0, scale: 0.95 }
1019
- }, p = te(() => l === t.id.toString(), [t.id, l]), h = n || ((u = t.data) == null ? void 0 : u.name) || r || "";
1019
+ }, u = te(() => l === t.id.toString(), [t.id, l]), h = n || ((p = t.data) == null ? void 0 : p.name) || r || "";
1020
1020
  return /* @__PURE__ */ a(
1021
1021
  re.p,
1022
1022
  {
@@ -1031,19 +1031,19 @@ const os = Fe(({ src: e }) => {
1031
1031
  i
1032
1032
  ),
1033
1033
  variants: c,
1034
- animate: p ? "hidden" : "visible",
1034
+ animate: u ? "hidden" : "visible",
1035
1035
  children: h
1036
1036
  }
1037
1037
  );
1038
1038
  }, Xn = ({ className: e, data: t, children: o, iconSize: n = 64, ...r }) => {
1039
1039
  var g;
1040
- const { moveTargetId: i, listStatus: l } = $e(), { typeConfigMap: s, computeGap: c } = Ce(), { row: p, col: h } = ho(t.type, (g = t.config) == null ? void 0 : g.sizeId, s), u = te(() => i === t.id, [t.id, i]), f = c(n);
1040
+ const { moveTargetId: i, listStatus: l } = $e(), { typeConfigMap: s, computeGap: c } = Ce(), { row: u, col: h } = ho(t.type, (g = t.config) == null ? void 0 : g.sizeId, s), p = te(() => i === t.id, [t.id, i]), f = c(n);
1041
1041
  return /* @__PURE__ */ a(
1042
1042
  re.div,
1043
1043
  {
1044
1044
  whileTap: { scale: 0.9 },
1045
1045
  className: F(
1046
- u ? "!scale-110" : "",
1046
+ p ? "!scale-110" : "",
1047
1047
  "zs-cursor-pointer zs-relative my-0",
1048
1048
  B`
1049
1049
  border-radius: 0.75rem;
@@ -1051,7 +1051,7 @@ const os = Fe(({ src: e }) => {
1051
1051
  transition: all 0.3s;
1052
1052
  transform-origin: ${l === null ? "center" : "top left"};
1053
1053
  width: ${h * n + f * (h - 1)}px;
1054
- height: ${p * n + f * (p - 1)}px;
1054
+ height: ${u * n + f * (u - 1)}px;
1055
1055
  `,
1056
1056
  e
1057
1057
  ),
@@ -1062,9 +1062,9 @@ const os = Fe(({ src: e }) => {
1062
1062
  }, ns = (e) => {
1063
1063
  var v, y, k;
1064
1064
  const { data: t, noLetters: o = !1, icon: n, iconColor: r, from: i, iconSize: l = 64, contextMenuProps: s } = e, { contextMenuFuns: c } = $e(), {
1065
- itemIconBuilder: p,
1065
+ itemIconBuilder: u,
1066
1066
  itemIconBuilderAllowNull: h,
1067
- theme: u,
1067
+ theme: p,
1068
1068
  contextMenu: f
1069
1069
  } = Ce(), g = s != !1 ? s || f : s, { data: d = {} } = t, { name: m, iconColor: b } = d;
1070
1070
  return /* @__PURE__ */ L(ve, { children: [
@@ -1074,8 +1074,8 @@ const os = Fe(({ src: e }) => {
1074
1074
  data: t,
1075
1075
  iconSize: l,
1076
1076
  className: B`
1077
- background-color: ${r ?? b ?? ((v = u.token.items) == null ? void 0 : v.iconBackgroundColor)};
1078
- box-shadow: 0 0 0.5rem ${(y = u.token.items) == null ? void 0 : y.iconShadowColor};
1077
+ background-color: ${r ?? b ?? ((v = p.token.items) == null ? void 0 : v.iconBackgroundColor)};
1078
+ box-shadow: 0 0 0.5rem ${(y = p.token.items) == null ? void 0 : y.iconShadowColor};
1079
1079
  `,
1080
1080
  children: /* @__PURE__ */ a(
1081
1081
  "div",
@@ -1083,14 +1083,14 @@ const os = Fe(({ src: e }) => {
1083
1083
  className: F(
1084
1084
  "zs-absolute zs-left-0 zs-top-0 zs-w-full zs-h-full",
1085
1085
  B`
1086
- color: ${(k = u.token.items) == null ? void 0 : k.textColor};
1086
+ color: ${(k = p.token.items) == null ? void 0 : k.textColor};
1087
1087
  `
1088
1088
  ),
1089
1089
  ...c(
1090
1090
  { ...t, ...i === "dock" ? { config: { allowResize: !1 } } : {} },
1091
1091
  g !== !1
1092
1092
  ),
1093
- children: ht(t, n, h, p)
1093
+ children: ht(t, n, h, u)
1094
1094
  }
1095
1095
  )
1096
1096
  }
@@ -1125,8 +1125,8 @@ const os = Fe(({ src: e }) => {
1125
1125
  noLetters: l = !1,
1126
1126
  disabledDrag: s = !1,
1127
1127
  icon: c,
1128
- iconSize: p = 64
1129
- } = e, { setList: h, listStatus: u, longPressTriggered: f, setMoveTargetId: g, setOpenGroupItemData: d, contextMenuFuns: m } = $e(), {
1128
+ iconSize: u = 64
1129
+ } = e, { setList: h, listStatus: p, longPressTriggered: f, setMoveTargetId: g, setOpenGroupItemData: d, contextMenuFuns: m } = $e(), {
1130
1130
  itemIconBuilder: b,
1131
1131
  itemIconBuilderAllowNull: v,
1132
1132
  theme: y,
@@ -1254,7 +1254,7 @@ const os = Fe(({ src: e }) => {
1254
1254
  Xn,
1255
1255
  {
1256
1256
  data: t,
1257
- iconSize: p,
1257
+ iconSize: u,
1258
1258
  className: B`
1259
1259
  background-color: ${(J = y.token.items) == null ? void 0 : J.groupIconBackgroundColor};
1260
1260
  box-shadow: 0 0 0.5rem ${(ie = y.token.items) == null ? void 0 : ie.groupIconShadowColor};
@@ -1285,7 +1285,7 @@ const os = Fe(({ src: e }) => {
1285
1285
  top: 0.375rem;
1286
1286
  width: calc(100% - 0.75rem);
1287
1287
  height: calc(100% - 0.75rem);
1288
- pointer-events: ${u === null ? "none" : "auto"};
1288
+ pointer-events: ${p === null ? "none" : "auto"};
1289
1289
  > * {
1290
1290
  opacity: 0;
1291
1291
  }
@@ -1314,7 +1314,7 @@ const os = Fe(({ src: e }) => {
1314
1314
  }
1315
1315
  );
1316
1316
  }, Jn = es, rs = ({ value: e, onChange: t, onBlur: o, placeholder: n = "标题" }) => {
1317
- var p, h, u, f, g, d, m, b, v, y, k, S, x, w, z, I, M, R, V, $, _;
1317
+ var u, h, p, f, g, d, m, b, v, y, k, S, x, w, z, I, M, R, V, $, _;
1318
1318
  const [r, i] = N(e), { theme: l } = Ce(), s = (j) => {
1319
1319
  const J = j.target.value;
1320
1320
  i(J), t(J);
@@ -1328,7 +1328,7 @@ const os = Fe(({ src: e }) => {
1328
1328
  "zs-bg-transparent zs-text-center zs-text-xl zs-w-full zs-rounded-lg py-2 px-4",
1329
1329
  B`
1330
1330
  border-style: none;
1331
- color: ${(u = (h = (p = l.token.items) == null ? void 0 : p.groupModal) == null ? void 0 : h.title) == null ? void 0 : u.textColor};
1331
+ color: ${(p = (h = (u = l.token.items) == null ? void 0 : u.groupModal) == null ? void 0 : h.title) == null ? void 0 : p.textColor};
1332
1332
  font-weight: 600;
1333
1333
  letter-spacing: -0.5px;
1334
1334
  transition: all 0.2s ease-out;
@@ -1373,9 +1373,9 @@ const os = Fe(({ src: e }) => {
1373
1373
  mousePosition: l,
1374
1374
  destroyOnClose: s = !0,
1375
1375
  closable: c = !1,
1376
- footer: p = null,
1376
+ footer: u = null,
1377
1377
  className: h,
1378
- contentClassName: u,
1378
+ contentClassName: p,
1379
1379
  disableMaxHeight: f = !1
1380
1380
  } = e, { theme: g } = Ce(), d = g.token.modal, [m, b] = N(!1), [v, y] = N(!1);
1381
1381
  return D(() => {
@@ -1393,7 +1393,7 @@ const os = Fe(({ src: e }) => {
1393
1393
  maskAnimation: "fade",
1394
1394
  mousePosition: l,
1395
1395
  title: n,
1396
- footer: p,
1396
+ footer: u,
1397
1397
  closable: c,
1398
1398
  className: F(
1399
1399
  "base-modal",
@@ -1562,7 +1562,7 @@ const os = Fe(({ src: e }) => {
1562
1562
  background: ${(fe = d == null ? void 0 : d.scrollbar) == null ? void 0 : fe.thumbHoverColor};
1563
1563
  }
1564
1564
  `,
1565
- u
1565
+ p
1566
1566
  ),
1567
1567
  children: r
1568
1568
  }
@@ -1570,15 +1570,15 @@ const os = Fe(({ src: e }) => {
1570
1570
  }
1571
1571
  ) });
1572
1572
  }, is = (e) => {
1573
- const { data: t, onClose: o, onItemClick: n } = e, { list: r, setList: i, setListStatus: l, setMoveItemId: s, setMoveTargetId: c, updateItem: p } = $e(), [h, u] = N("文件夹"), f = K(null), g = K(null), [d, m] = N(), [b, v] = N(), y = [...(t == null ? void 0 : t.children) ?? []];
1573
+ const { data: t, onClose: o, onItemClick: n } = e, { list: r, setList: i, setListStatus: l, setMoveItemId: s, setMoveTargetId: c, updateItem: u } = $e(), [h, p] = N("文件夹"), f = K(null), g = K(null), [d, m] = N(), [b, v] = N(), y = [...(t == null ? void 0 : t.children) ?? []];
1574
1574
  D(() => {
1575
1575
  var I;
1576
- t && u((I = t.data) == null ? void 0 : I.name);
1576
+ t && p((I = t.data) == null ? void 0 : I.name);
1577
1577
  }, [t]);
1578
1578
  const k = (I) => {
1579
- u(I);
1579
+ p(I);
1580
1580
  }, S = () => {
1581
- t && p(t.id, {
1581
+ t && u(t.id, {
1582
1582
  ...t.data,
1583
1583
  name: h
1584
1584
  });
@@ -1744,7 +1744,7 @@ const os = Fe(({ src: e }) => {
1744
1744
  );
1745
1745
  }, ds = ({ onClick: e, className: t }) => {
1746
1746
  var g, d, m;
1747
- const [o, n] = N(!1), { theme: r } = Ce(), i = (m = (d = (g = r == null ? void 0 : r.token) == null ? void 0 : g.dock) == null ? void 0 : d.launchpad) == null ? void 0 : m.icon, l = i.textColor, s = i.backgroundColor, c = i.borderColor, p = i.shadowColor, h = i.hoverGlowColor, u = (b, v) => {
1747
+ const [o, n] = N(!1), { theme: r } = Ce(), i = (m = (d = (g = r == null ? void 0 : r.token) == null ? void 0 : g.dock) == null ? void 0 : d.launchpad) == null ? void 0 : m.icon, l = i.textColor, s = i.backgroundColor, c = i.borderColor, u = i.shadowColor, h = i.hoverGlowColor, p = (b, v) => {
1748
1748
  if (b.startsWith("#")) {
1749
1749
  const k = b.slice(1), S = parseInt(k.slice(0, 2), 16), x = parseInt(k.slice(2, 4), 16), w = parseInt(k.slice(4, 6), 16), z = v * 15, I = Math.max(0, S - z), M = Math.max(0, x - z), R = Math.max(0, w - z);
1750
1750
  return `rgb(${I}, ${M}, ${R})`;
@@ -1798,7 +1798,7 @@ const os = Fe(({ src: e }) => {
1798
1798
  overflow: "visible"
1799
1799
  },
1800
1800
  children: f.map((b, v) => {
1801
- const y = v * 4, k = 0, S = o ? y + v * 2 : y, x = k, w = 0, z = 1 - v * 0.05, I = f.length - v, M = (R) => R === 0 ? s : u(s, R);
1801
+ const y = v * 4, k = 0, S = o ? y + v * 2 : y, x = k, w = 0, z = 1 - v * 0.05, I = f.length - v, M = (R) => R === 0 ? s : p(s, R);
1802
1802
  return /* @__PURE__ */ a(
1803
1803
  re.div,
1804
1804
  {
@@ -1809,7 +1809,7 @@ const os = Fe(({ src: e }) => {
1809
1809
  color: ${l};
1810
1810
  z-index: ${I};
1811
1811
  box-shadow: 0 ${1 + v * 0.5}px ${4 + v * 1}px
1812
- ${p.replace(/[\d.]+\)$/, `${0.1 + v * 0.02})`)};
1812
+ ${u.replace(/[\d.]+\)$/, `${0.1 + v * 0.02})`)};
1813
1813
  border: 0.5px solid ${c};
1814
1814
  `
1815
1815
  ),
@@ -1873,11 +1873,11 @@ const tr = ({
1873
1873
  showLaunchpad: l = !0,
1874
1874
  onLaunchpadClick: s,
1875
1875
  onDrop: c,
1876
- onDockItemsChange: p,
1876
+ onDockItemsChange: u,
1877
1877
  itemSize: h = 56
1878
1878
  }) => {
1879
1879
  var V;
1880
- const { setListStatus: u } = $e(), { theme: f } = Ce(), g = f.token.dock, d = f.token.base, m = er(), [b, v] = N(null), [y, k] = N(null), [S, x] = N(0), [w, z] = N(!1), I = ($, _) => r ? r($, _) : /* @__PURE__ */ a(et, { data: $, itemIndex: _, noLetters: !0, from: "dock", iconSize: h }, $.id), M = ($, _) => i ? i($, _) : /* @__PURE__ */ a(
1880
+ const { setListStatus: p } = $e(), { theme: f } = Ce(), g = f.token.dock, d = f.token.base, m = er(), [b, v] = N(null), [y, k] = N(null), [S, x] = N(0), [w, z] = N(!1), I = ($, _) => r ? r($, _) : /* @__PURE__ */ a(et, { data: $, itemIndex: _, noLetters: !0, from: "dock", iconSize: h }, $.id), M = ($, _) => i ? i($, _) : /* @__PURE__ */ a(
1881
1881
  et,
1882
1882
  {
1883
1883
  data: $,
@@ -1942,7 +1942,7 @@ const tr = ({
1942
1942
  {
1943
1943
  list: e,
1944
1944
  setList: ($) => {
1945
- p && p($);
1945
+ u && u($);
1946
1946
  },
1947
1947
  ...Wn,
1948
1948
  className: F(
@@ -1976,9 +1976,9 @@ const tr = ({
1976
1976
  `,
1977
1977
  e.length === 0 && "zs-ml-2.5 zs-w-14"
1978
1978
  ),
1979
- onMove: () => (u("onMove"), !0),
1979
+ onMove: () => (p("onMove"), !0),
1980
1980
  onEnd: () => {
1981
- u(null);
1981
+ p(null);
1982
1982
  },
1983
1983
  children: e.length > 0 ? e.map(($, _) => I($, _)) : /* @__PURE__ */ a(
1984
1984
  re.div,
@@ -2050,10 +2050,10 @@ const tr = ({
2050
2050
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
2051
2051
  `, us = ({ value: e, onChange: t, placeholder: o = "搜索应用", className: n = "" }) => {
2052
2052
  var g, d, m, b, v, y, k, S, x, w, z, I, M, R, V, $, _, j, J, ie, ue, H, ae, be, Y, se, xe, X, fe, ye, ce, oe, Q, we, Le, ze, Ie, W, pe, Z, q, A, O;
2053
- const { theme: r } = Ce(), i = K(null), l = K(null), s = K(null), [c, p] = N(!1), h = () => {
2054
- p(!0), l.current && (l.current.style.transform = "translateY(-50%) translateX(-0.5rem)"), s.current && (s.current.style.transform = "translateY(-50%) translateX(0.5rem)");
2055
- }, u = () => {
2056
- p(!1), l.current && (l.current.style.transform = "translateY(-50%) translateX(0)"), s.current && (s.current.style.transform = "translateY(-50%) translateX(0)");
2053
+ const { theme: r } = Ce(), i = K(null), l = K(null), s = K(null), [c, u] = N(!1), h = () => {
2054
+ u(!0), l.current && (l.current.style.transform = "translateY(-50%) translateX(-0.5rem)"), s.current && (s.current.style.transform = "translateY(-50%) translateX(0.5rem)");
2055
+ }, p = () => {
2056
+ u(!1), l.current && (l.current.style.transform = "translateY(-50%) translateX(0)"), s.current && (s.current.style.transform = "translateY(-50%) translateX(0)");
2057
2057
  }, f = () => {
2058
2058
  var P;
2059
2059
  t(""), (P = i.current) == null || P.focus();
@@ -2097,7 +2097,7 @@ const tr = ({
2097
2097
  value: e,
2098
2098
  onChange: (P) => t(P.target.value),
2099
2099
  onFocus: h,
2100
- onBlur: u
2100
+ onBlur: p
2101
2101
  }
2102
2102
  ),
2103
2103
  e && /* @__PURE__ */ a(
@@ -2132,9 +2132,9 @@ const tr = ({
2132
2132
  width: l = 320,
2133
2133
  height: s,
2134
2134
  mask: c = !0,
2135
- maskClosable: p = !0,
2135
+ maskClosable: u = !0,
2136
2136
  className: h,
2137
- contentClassName: u,
2137
+ contentClassName: p,
2138
2138
  ...f
2139
2139
  } = e, { theme: g } = Ce(), d = g.token.modal, [m, b] = N(!1), [v, y] = N(!1);
2140
2140
  D(() => {
@@ -2152,7 +2152,7 @@ const tr = ({
2152
2152
  onClose: k,
2153
2153
  placement: i,
2154
2154
  mask: c,
2155
- maskClosable: p,
2155
+ maskClosable: u,
2156
2156
  className: F(
2157
2157
  "base-drawer",
2158
2158
  { "drawer-closing": v },
@@ -2286,7 +2286,7 @@ const tr = ({
2286
2286
  background: ${(ye = d == null ? void 0 : d.scrollbar) == null ? void 0 : ye.thumbHoverColor};
2287
2287
  }
2288
2288
  `,
2289
- u
2289
+ p
2290
2290
  ),
2291
2291
  children: [
2292
2292
  r && /* @__PURE__ */ a(
@@ -2334,13 +2334,13 @@ const tr = ({
2334
2334
  groups: y,
2335
2335
  groupCounts: S
2336
2336
  };
2337
- }, [n, r]), p = (g) => {
2337
+ }, [n, r]), u = (g) => {
2338
2338
  const d = c[g], m = document.getElementById(`group-${d}`);
2339
2339
  m && m.scrollIntoView({ behavior: "smooth", block: "start" });
2340
2340
  }, h = /* @__PURE__ */ L("div", { className: "zs-py-4 zs-flex zs-items-center zs-gap-2", children: [
2341
2341
  /* @__PURE__ */ a(us, { className: "zs-grow", value: r, onChange: i, placeholder: "搜索应用" }),
2342
2342
  l && /* @__PURE__ */ a(Ve, { onClick: t, "aria-label": "关闭", className: "zs-shrink-0" })
2343
- ] }), u = /* @__PURE__ */ a("div", { className: F("zs-flex-1 zs-overflow-y-auto zs-h-full zs-p-1"), children: s.length === 0 ? /* @__PURE__ */ L("div", { className: "zs-flex zs-items-center zs-justify-center zs-flex-col zs-text-[#8e8e93] zs-text-xl zs-font-medium zs-text-center zs-h-full", children: [
2343
+ ] }), p = /* @__PURE__ */ a("div", { className: F("zs-flex-1 zs-overflow-y-auto zs-h-full zs-p-1"), children: s.length === 0 ? /* @__PURE__ */ L("div", { className: "zs-flex zs-items-center zs-justify-center zs-flex-col zs-text-[#8e8e93] zs-text-xl zs-font-medium zs-text-center zs-h-full", children: [
2344
2344
  /* @__PURE__ */ a("div", { className: "zs-text-6xl zs-mb-4 zs-opacity-60", children: r.trim() ? "🔍" : "📱" }),
2345
2345
  /* @__PURE__ */ a("div", { className: "zs-mb-2", children: r.trim() ? "未找到相关应用" : "暂无应用" }),
2346
2346
  /* @__PURE__ */ a("div", { className: "zs-text-base zs-text-[#c7c7cc] zs-font-normal", children: r.trim() ? "尝试使用其他关键词搜索" : "请添加应用到启动台" })
@@ -2375,7 +2375,7 @@ const tr = ({
2375
2375
  },
2376
2376
  whileTap: { scale: 0.95 },
2377
2377
  className: "zs-text-sm zs-p-2 zs-cursor-pointer zs-rounded-xl zs-w-8 zs-h-8 zs-flex zs-items-center zs-justify-center zs-bg-transparent zs-border-none zs-font-semibold zs-my-1 zs-text-[#666] zs-leading-none",
2378
- onClick: () => p(d),
2378
+ onClick: () => u(d),
2379
2379
  title: `跳转到 ${g}`,
2380
2380
  children: g
2381
2381
  },
@@ -2406,12 +2406,12 @@ const tr = ({
2406
2406
  `,
2407
2407
  children: /* @__PURE__ */ L("div", { className: "zs-relative zs-h-full zs-flex", children: [
2408
2408
  f,
2409
- u
2409
+ p
2410
2410
  ] })
2411
2411
  }
2412
2412
  ) : /* @__PURE__ */ a(Dt, { visible: e, onClose: t, title: h, width: 900, children: /* @__PURE__ */ L("div", { className: "zs-relative zs-flex zs-h-[60vh] zs-max-h-[600px] zs-overflow-hidden", children: [
2413
2413
  f,
2414
- u
2414
+ p
2415
2415
  ] }) });
2416
2416
  }, ps = ({
2417
2417
  renderFn: e,
@@ -2438,8 +2438,8 @@ const tr = ({
2438
2438
  position: "bottom",
2439
2439
  showLaunchpad: !0
2440
2440
  },
2441
- iconSize: p = 64
2442
- } = e, h = K(null), u = K(null), f = K(null), [g, d] = N(0), [m, b] = N(!1), [v, y] = N(!1), [k, S] = N(!0), {
2441
+ iconSize: u = 64
2442
+ } = e, h = K(null), p = K(null), f = K(null), [g, d] = N(0), [m, b] = N(!1), [v, y] = N(!1), [k, S] = N(!0), {
2443
2443
  list: x,
2444
2444
  setList: w,
2445
2445
  setListStatus: z,
@@ -2455,7 +2455,7 @@ const tr = ({
2455
2455
  addRootItem: ue,
2456
2456
  removeRootItem: H,
2457
2457
  setCurrentSliderIndex: ae
2458
- } = $e(), { pagingDotBuilder: be, pagingDotsBuilder: Y, itemBuilder: se, itemBuilderAllowNull: xe, typeConfigMap: X, computeCellSize: fe } = Ce(), ye = fe(p), ce = te(() => {
2458
+ } = $e(), { pagingDotBuilder: be, pagingDotsBuilder: Y, itemBuilder: se, itemBuilderAllowNull: xe, typeConfigMap: X, computeCellSize: fe } = Ce(), ye = fe(u), ce = te(() => {
2459
2459
  const C = x.find((E) => E.type === "dock");
2460
2460
  return (C == null ? void 0 : C.children) ?? [];
2461
2461
  }, [x]), oe = te(() => x.filter((C) => C.type !== "dock"), [x]), Q = U(() => {
@@ -2611,7 +2611,7 @@ const tr = ({
2611
2611
  /* @__PURE__ */ L(
2612
2612
  "div",
2613
2613
  {
2614
- ref: u,
2614
+ ref: p,
2615
2615
  className: F("zs-relative zs-w-full zs-h-full", ze),
2616
2616
  onDragOver: (C) => {
2617
2617
  C.preventDefault(), f.current && f.current.handleDragMove(C);
@@ -2661,7 +2661,7 @@ const tr = ({
2661
2661
  totalSlides: oe.length,
2662
2662
  maxSlides: i,
2663
2663
  sliderRef: r ?? h,
2664
- containerRef: u,
2664
+ containerRef: p,
2665
2665
  onCreateNewPage: Q
2666
2666
  }
2667
2667
  ),
@@ -2819,7 +2819,7 @@ const tr = ({
2819
2819
  itemIndex: T,
2820
2820
  parentIds: [C.id, E.id],
2821
2821
  onClick: l,
2822
- iconSize: p
2822
+ iconSize: u
2823
2823
  }
2824
2824
  )
2825
2825
  },
@@ -2843,7 +2843,7 @@ const tr = ({
2843
2843
  transition: m ? { duration: 0 } : { type: "spring", stiffness: 380, damping: 38 },
2844
2844
  onMouseEnter: () => S(!1),
2845
2845
  onMouseLeave: () => S(!0),
2846
- children: /* @__PURE__ */ a(et, { data: E, itemIndex: T, onClick: l, iconSize: p })
2846
+ children: /* @__PURE__ */ a(et, { data: E, itemIndex: T, onClick: l, iconSize: u })
2847
2847
  },
2848
2848
  E.id
2849
2849
  );
@@ -2886,7 +2886,7 @@ const tr = ({
2886
2886
  v && /* @__PURE__ */ a(nr, { visible: v, onClose: () => y(!1), onItemClick: l })
2887
2887
  ] });
2888
2888
  }, ir = (e) => {
2889
- var i, l, s, c, p;
2889
+ var i, l, s, c, u;
2890
2890
  const { className: t, children: o, ...n } = e, { theme: r } = Ce();
2891
2891
  return /* @__PURE__ */ a(
2892
2892
  re.div,
@@ -2899,7 +2899,7 @@ const tr = ({
2899
2899
  0 0 0 0.75px ${(s = r.token.contextMenu) == null ? void 0 : s.boxShadowBorderColor};
2900
2900
  min-width: 200px;
2901
2901
  border: 0.75px solid ${(c = r.token.contextMenu) == null ? void 0 : c.borderColor};
2902
- backdrop-filter: ${(p = r.token.contextMenu) == null ? void 0 : p.backdropFilter};
2902
+ backdrop-filter: ${(u = r.token.contextMenu) == null ? void 0 : u.backdropFilter};
2903
2903
  `,
2904
2904
  t
2905
2905
  ),
@@ -2925,7 +2925,7 @@ const tr = ({
2925
2925
  }
2926
2926
  }), Lt = ({ icon: e, text: t, color: o, textColor: n, onClick: r, index: i, children: l, ...s }) => {
2927
2927
  var m, b, v;
2928
- const { hoveredIndex: c, setHoveredIndex: p } = De(fo), { theme: h } = Ce(), u = c === i, f = n || ((m = h.token.contextMenu) == null ? void 0 : m.textColor) || "#1d1d1f", g = o || ((b = h.token.contextMenu) == null ? void 0 : b.textColor) || "black";
2928
+ const { hoveredIndex: c, setHoveredIndex: u } = De(fo), { theme: h } = Ce(), p = c === i, f = n || ((m = h.token.contextMenu) == null ? void 0 : m.textColor) || "#1d1d1f", g = o || ((b = h.token.contextMenu) == null ? void 0 : b.textColor) || "black";
2929
2929
  return /* @__PURE__ */ L(
2930
2930
  re.div,
2931
2931
  {
@@ -2935,12 +2935,12 @@ const tr = ({
2935
2935
  z-index: 1;
2936
2936
  `
2937
2937
  ),
2938
- onMouseEnter: () => p(i),
2939
- onMouseLeave: () => p(null),
2938
+ onMouseEnter: () => u(i),
2939
+ onMouseLeave: () => u(null),
2940
2940
  onClick: r,
2941
2941
  ...s,
2942
2942
  children: [
2943
- /* @__PURE__ */ a(Ne, { children: u && /* @__PURE__ */ a(
2943
+ /* @__PURE__ */ a(Ne, { children: p && /* @__PURE__ */ a(
2944
2944
  re.div,
2945
2945
  {
2946
2946
  layoutId: "menuHover",
@@ -2996,25 +2996,25 @@ const tr = ({
2996
2996
  );
2997
2997
  }, hs = ({ text: e, index: t, children: o, color: n, textColor: r, ...i }) => {
2998
2998
  var w, z, I;
2999
- const [l, s] = N(!1), [c, p] = N({ x: 0, y: 0 }), h = K(null), u = K(null), { hoveredIndex: f, setHoveredIndex: g } = De(fo), { theme: d } = Ce(), m = f === t, b = r || ((w = d.token.contextMenu) == null ? void 0 : w.textColor) || "#1d1d1f", v = n || ((z = d.token.contextMenu) == null ? void 0 : z.textColor) || "black", y = () => {
3000
- if (u.current && clearTimeout(u.current), g(t), s(!0), h.current) {
2999
+ const [l, s] = N(!1), [c, u] = N({ x: 0, y: 0 }), h = K(null), p = K(null), { hoveredIndex: f, setHoveredIndex: g } = De(fo), { theme: d } = Ce(), m = f === t, b = r || ((w = d.token.contextMenu) == null ? void 0 : w.textColor) || "#1d1d1f", v = n || ((z = d.token.contextMenu) == null ? void 0 : z.textColor) || "black", y = () => {
3000
+ if (p.current && clearTimeout(p.current), g(t), s(!0), h.current) {
3001
3001
  const M = h.current.getBoundingClientRect();
3002
- p({
3002
+ u({
3003
3003
  x: M.width - 4,
3004
3004
  y: 0
3005
3005
  });
3006
3006
  }
3007
3007
  }, k = () => {
3008
- u.current = setTimeout(() => {
3008
+ p.current = setTimeout(() => {
3009
3009
  s(!1);
3010
3010
  }, 150);
3011
3011
  }, S = () => {
3012
- u.current && clearTimeout(u.current);
3012
+ p.current && clearTimeout(p.current);
3013
3013
  }, x = () => {
3014
3014
  s(!1);
3015
3015
  };
3016
3016
  return D(() => () => {
3017
- u.current && clearTimeout(u.current);
3017
+ p.current && clearTimeout(p.current);
3018
3018
  }, []), /* @__PURE__ */ L(
3019
3019
  re.div,
3020
3020
  {
@@ -3105,7 +3105,7 @@ const tr = ({
3105
3105
  }, fs = ({ sizes: e, currentSize: t, onSizeChange: o }) => {
3106
3106
  const [n, r] = N(null), { theme: i } = Ce();
3107
3107
  return /* @__PURE__ */ a(ve, { children: e.map((l) => {
3108
- var p, h, u;
3108
+ var u, h, p;
3109
3109
  const s = n === l, c = t === l;
3110
3110
  return /* @__PURE__ */ L(
3111
3111
  re.div,
@@ -3128,7 +3128,7 @@ const tr = ({
3128
3128
  "zs-absolute zs-top-0.5 zs-left-2 zs-right-2 zs-bottom-0.5 zs-rounded-lg",
3129
3129
  B`
3130
3130
  z-index: -1;
3131
- background-color: ${((p = i.token.contextMenu) == null ? void 0 : p.activeColor) || "rgba(0, 0, 0, 0.05)"};
3131
+ background-color: ${((u = i.token.contextMenu) == null ? void 0 : u.activeColor) || "rgba(0, 0, 0, 0.05)"};
3132
3132
  `
3133
3133
  ),
3134
3134
  initial: { opacity: 0 },
@@ -3162,7 +3162,7 @@ const tr = ({
3162
3162
  className: F(
3163
3163
  "zs-flex zs-items-center zs-justify-center zs-shrink-0",
3164
3164
  B`
3165
- color: ${((u = i.token.contextMenu) == null ? void 0 : u.textColor) || "#1d1d1f"};
3165
+ color: ${((p = i.token.contextMenu) == null ? void 0 : p.textColor) || "#1d1d1f"};
3166
3166
  width: 18px;
3167
3167
  height: 18px;
3168
3168
  `
@@ -3186,13 +3186,13 @@ const tr = ({
3186
3186
  isOpen: l = !0,
3187
3187
  onInfoClick: s,
3188
3188
  onShareClick: c,
3189
- onRemoveClick: p
3190
- } = e, { contextMenu: h, setContextMenu: u, hideContextMenu: f, setShowInfoItemData: g, removeItem: d, updateItemConfig: m } = $e(), { typeConfigMap: b, dataTypeMenuConfigMap: v, theme: y } = Ce(), [k, S] = N(null), { data: x } = h ?? {}, { config: w = {} } = x ?? {}, z = po(((Y = h == null ? void 0 : h.data) == null ? void 0 : Y.type) || "app", b) ?? {}, { sizeConfigs: I = [], defaultSizeId: M, allowResize: R, allowShare: V, allowDelete: $, allowInfo: _ } = z, j = $ ?? o, J = V ?? n, ie = _ ?? t, ue = R ?? r, H = () => I.map((X) => X.name), ae = () => {
3189
+ onRemoveClick: u
3190
+ } = e, { contextMenu: h, setContextMenu: p, hideContextMenu: f, setShowInfoItemData: g, removeItem: d, updateItemConfig: m } = $e(), { typeConfigMap: b, dataTypeMenuConfigMap: v, theme: y } = Ce(), [k, S] = N(null), { data: x } = h ?? {}, { config: w = {} } = x ?? {}, z = po(((Y = h == null ? void 0 : h.data) == null ? void 0 : Y.type) || "app", b) ?? {}, { sizeConfigs: I = [], defaultSizeId: M, allowResize: R, allowShare: V, allowDelete: $, allowInfo: _ } = z, j = $ ?? o, J = V ?? n, ie = _ ?? t, ue = R ?? r, H = () => I.map((X) => X.name), ae = () => {
3191
3191
  var fe;
3192
3192
  const X = (fe = h == null ? void 0 : h.data) == null ? void 0 : fe.dataType;
3193
3193
  return !X || !v ? [] : v[X] || [];
3194
3194
  }, be = {
3195
- setContextMenu: u,
3195
+ setContextMenu: p,
3196
3196
  hideContextMenu: f,
3197
3197
  setShowInfoItemData: g,
3198
3198
  removeItem: d,
@@ -3214,11 +3214,11 @@ const tr = ({
3214
3214
  textColor: ((xe = y.token.contextMenu) == null ? void 0 : xe.dangerColor) || "#ff3b30",
3215
3215
  index: 0,
3216
3216
  onClick: () => {
3217
- if (p) {
3218
- p(h.data, d);
3217
+ if (u) {
3218
+ u(h.data, d);
3219
3219
  return;
3220
3220
  }
3221
- u(null), d(h.data.id);
3221
+ p(null), d(h.data.id);
3222
3222
  }
3223
3223
  }
3224
3224
  ),
@@ -3271,7 +3271,7 @@ const tr = ({
3271
3271
  const oe = I.find((Q) => Q.name === ce);
3272
3272
  oe && (m(h.data.id, {
3273
3273
  sizeId: oe.id || ce
3274
- }), u(null));
3274
+ }), p(null));
3275
3275
  }
3276
3276
  }
3277
3277
  ) });
@@ -3311,7 +3311,7 @@ const tr = ({
3311
3311
  const { contextMenu: t, setContextMenu: o } = $e(), [n, r] = N(!1), [i, l] = N(!1), [s, c] = N({
3312
3312
  left: 0,
3313
3313
  top: 0
3314
- }), [p, h] = N("center"), u = U(
3314
+ }), [u, h] = N("center"), p = U(
3315
3315
  (v) => ({
3316
3316
  left: v.left,
3317
3317
  right: v.right,
@@ -3385,7 +3385,7 @@ const tr = ({
3385
3385
  return D(() => {
3386
3386
  if (t) {
3387
3387
  l(!0), r(!0);
3388
- const { rect: v } = t, y = u(v), { left: k, top: S } = g(
3388
+ const { rect: v } = t, y = p(v), { left: k, top: S } = g(
3389
3389
  y,
3390
3390
  Ge.ESTIMATED_MENU_WIDTH,
3391
3391
  Ge.ESTIMATED_MENU_HEIGHT
@@ -3398,12 +3398,12 @@ const tr = ({
3398
3398
  }, Ge.ANIMATION_DELAY);
3399
3399
  return () => clearTimeout(v);
3400
3400
  }
3401
- }, [t, u, g]), D(() => {
3401
+ }, [t, p, g]), D(() => {
3402
3402
  n && m.floating.current && t && i && requestAnimationFrame(() => {
3403
- const { rect: v } = t, y = u(v), k = m.floating.current, S = (k == null ? void 0 : k.offsetWidth) || Ge.ESTIMATED_MENU_WIDTH, x = (k == null ? void 0 : k.offsetHeight) || Ge.ESTIMATED_MENU_HEIGHT, { left: w, top: z } = g(y, S, x), I = b(w, z, y);
3403
+ const { rect: v } = t, y = p(v), k = m.floating.current, S = (k == null ? void 0 : k.offsetWidth) || Ge.ESTIMATED_MENU_WIDTH, x = (k == null ? void 0 : k.offsetHeight) || Ge.ESTIMATED_MENU_HEIGHT, { left: w, top: z } = g(y, S, x), I = b(w, z, y);
3404
3404
  h(I), c({ left: w, top: z });
3405
3405
  });
3406
- }, [n, t, m, i, u, g]), D(() => {
3406
+ }, [n, t, m, i, p, g]), D(() => {
3407
3407
  if (!n) return;
3408
3408
  const v = (S) => {
3409
3409
  const x = S.target, w = m.floating.current;
@@ -3425,13 +3425,13 @@ const tr = ({
3425
3425
  left: s.left,
3426
3426
  top: s.top,
3427
3427
  zIndex: 9999,
3428
- transformOrigin: p
3428
+ transformOrigin: u
3429
3429
  // 只设置变换原点,让内部的 motion/react 处理动画
3430
3430
  },
3431
3431
  onMouseDown: (v) => {
3432
3432
  v.stopPropagation();
3433
3433
  },
3434
- children: /* @__PURE__ */ a(gs, { ...e, animationOrigin: p, isOpen: n })
3434
+ children: /* @__PURE__ */ a(gs, { ...e, animationOrigin: u, isOpen: n })
3435
3435
  }
3436
3436
  ) }) : null;
3437
3437
  }, ys = ee((e, t) => {
@@ -3443,9 +3443,9 @@ const tr = ({
3443
3443
  theme: l,
3444
3444
  noLetters: s,
3445
3445
  typeConfigMap: c,
3446
- contextMenu: p,
3446
+ contextMenu: u,
3447
3447
  contextMenuBuilder: h,
3448
- itemBuilder: u,
3448
+ itemBuilder: p,
3449
3449
  itemBuilderAllowNull: f,
3450
3450
  itemIconBuilder: g,
3451
3451
  itemIconBuilderAllowNull: d,
@@ -3462,10 +3462,10 @@ const tr = ({
3462
3462
  noLetters: s,
3463
3463
  typeConfigMap: c,
3464
3464
  dataTypeMenuConfigMap: e.dataTypeMenuConfigMap,
3465
- contextMenu: p,
3465
+ contextMenu: u,
3466
3466
  pagingDotsBuilder: b,
3467
3467
  pagingDotBuilder: m,
3468
- itemBuilder: u,
3468
+ itemBuilder: p,
3469
3469
  itemBuilderAllowNull: f,
3470
3470
  itemIconBuilder: g,
3471
3471
  itemIconBuilderAllowNull: d,
@@ -3874,11 +3874,11 @@ const tr = ({
3874
3874
  theme: l = "auto",
3875
3875
  ...s
3876
3876
  } = e, c = K(null), {
3877
- image: p,
3877
+ image: u,
3878
3878
  diffSource: h = {
3879
3879
  viewMode: "rich-text"
3880
3880
  },
3881
- headings: u,
3881
+ headings: p,
3882
3882
  link: f,
3883
3883
  codeBlock: g,
3884
3884
  codeMirror: d = {
@@ -3943,10 +3943,10 @@ const tr = ({
3943
3943
  Da(h),
3944
3944
  $a(),
3945
3945
  Ua(),
3946
- Pa(u),
3946
+ Pa(p),
3947
3947
  Oa(f),
3948
3948
  Fa(),
3949
- _a(p),
3949
+ _a(u),
3950
3950
  Ha(),
3951
3951
  Va(),
3952
3952
  ja(),
@@ -3972,14 +3972,14 @@ const tr = ({
3972
3972
  rehypePlugins: [dl],
3973
3973
  components: {
3974
3974
  code(i) {
3975
- const { children: l, className: s, node: c, ref: p, ...h } = i, u = /language-(\w+)/.exec(s || "");
3976
- return u ? /* @__PURE__ */ a(
3975
+ const { children: l, className: s, node: c, ref: u, ...h } = i, p = /language-(\w+)/.exec(s || "");
3976
+ return p ? /* @__PURE__ */ a(
3977
3977
  ul,
3978
3978
  {
3979
3979
  ...h,
3980
3980
  PreTag: "div",
3981
3981
  children: String(l).replace(/\n$/, ""),
3982
- language: u[1],
3982
+ language: p[1],
3983
3983
  style: pl
3984
3984
  }
3985
3985
  ) : /* @__PURE__ */ a("code", { ...h, className: s, children: l });
@@ -4037,11 +4037,11 @@ const go = (e) => {
4037
4037
  as: l = re.div,
4038
4038
  componentClassName: s = "zs-rounded-full zs-bg-gray-200 dark:zs-bg-neutral-800",
4039
4039
  titleClassName: c = "zs-rounded-md zs-bg-gray-100 zs-border dark:zs-bg-neutral-800 dark:zs-border-neutral-900 dark:zs-text-white zs-border-gray-200 zs-text-neutral-700",
4040
- childrenClassName: p,
4040
+ childrenClassName: u,
4041
4041
  ...h
4042
- } = e, u = K(null), f = it(t, (M) => {
4042
+ } = e, p = K(null), f = it(t, (M) => {
4043
4043
  var V;
4044
- const R = ((V = u.current) == null ? void 0 : V.getBoundingClientRect()) ?? { x: 0, width: 0 };
4044
+ const R = ((V = p.current) == null ? void 0 : V.getBoundingClientRect()) ?? { x: 0, width: 0 };
4045
4045
  return M - R.x - R.width / 2;
4046
4046
  }), g = it(f, [-150, 0, 150], [40, 80, 40]), d = it(f, [-150, 0, 150], [40, 80, 40]), m = it(f, [-150, 0, 150], [20, 40, 20]), b = it(f, [-150, 0, 150], [20, 40, 20]), v = St(g, {
4047
4047
  mass: 0.1,
@@ -4062,7 +4062,7 @@ const go = (e) => {
4062
4062
  }), x = it(k, (M) => `${M}px`), [w, z] = N(!1), I = /* @__PURE__ */ L(
4063
4063
  l,
4064
4064
  {
4065
- ref: u,
4065
+ ref: p,
4066
4066
  style: { width: v, height: y },
4067
4067
  onMouseEnter: () => z(!0),
4068
4068
  onMouseLeave: () => z(!1),
@@ -4090,7 +4090,7 @@ const go = (e) => {
4090
4090
  height: S,
4091
4091
  fontSize: x
4092
4092
  },
4093
- className: gt("zs-flex zs-items-center zs-justify-center", p),
4093
+ className: gt("zs-flex zs-items-center zs-justify-center", u),
4094
4094
  children: typeof i == "function" ? i({ widthIcon: k, heightIcon: S, fontSizeTransform: x }) : i || n
4095
4095
  }
4096
4096
  )
@@ -4110,11 +4110,11 @@ const go = (e) => {
4110
4110
  return /* @__PURE__ */ a(
4111
4111
  l,
4112
4112
  {
4113
- onMouseMove: (p) => c.set(p.pageX),
4113
+ onMouseMove: (u) => c.set(u.pageX),
4114
4114
  onMouseLeave: () => c.set(1 / 0),
4115
4115
  className: gt("zs-mx-auto zs-hidden md:zs-flex zs-h-16 zs-gap-4 zs-items-end zs-px-4 zs-pb-3", o),
4116
4116
  children: r || t.map(
4117
- (p) => n ? n(p, c) : /* @__PURE__ */ a(go, { mouseX: c, ...p }, p.title)
4117
+ (u) => n ? n(u, c) : /* @__PURE__ */ a(go, { mouseX: c, ...u }, u.title)
4118
4118
  )
4119
4119
  }
4120
4120
  );
@@ -4149,7 +4149,7 @@ const go = (e) => {
4149
4149
  t
4150
4150
  );
4151
4151
  }, bo = (e) => {
4152
- const { items: t = [], className: o, collapseIcon: n, autoHidden: r = !1, itemBuilder: i, children: l } = e, [s, c] = N(!1), p = () => {
4152
+ const { items: t = [], className: o, collapseIcon: n, autoHidden: r = !1, itemBuilder: i, children: l } = e, [s, c] = N(!1), u = () => {
4153
4153
  c(!s);
4154
4154
  };
4155
4155
  return /* @__PURE__ */ L("div", { className: gt("zs-relative zs-block", r ? "md:zs-hidden" : "", o), children: [
@@ -4159,14 +4159,14 @@ const go = (e) => {
4159
4159
  layoutId: "nav",
4160
4160
  className: "zs-absolute zs-bottom-full zs-mb-2 zs-inset-x-0 zs-flex zs-flex-col zs-gap-2",
4161
4161
  children: l || t.map(
4162
- (h, u) => i ? /* @__PURE__ */ a(Et, { ...h, index: u, totalItems: t.length, children: i(h, u, t) }, h.title) : /* @__PURE__ */ a(Et, { ...h, index: u, totalItems: t.length }, h.title)
4162
+ (h, p) => i ? /* @__PURE__ */ a(Et, { ...h, index: p, totalItems: t.length, children: i(h, p, t) }, h.title) : /* @__PURE__ */ a(Et, { ...h, index: p, totalItems: t.length }, h.title)
4163
4163
  )
4164
4164
  }
4165
4165
  ) }),
4166
4166
  /* @__PURE__ */ a(
4167
4167
  "button",
4168
4168
  {
4169
- onClick: p,
4169
+ onClick: u,
4170
4170
  className: "zs-h-10 zs-w-10 zs-rounded-full zs-bg-gray-50 dark:zs-bg-neutral-800 zs-flex zs-items-center zs-justify-center",
4171
4171
  children: n || /* @__PURE__ */ a(Oi, { className: "zs-h-5 zs-w-5 zs-text-neutral-500 dark:zs-text-neutral-400" })
4172
4172
  }
@@ -4182,7 +4182,7 @@ const go = (e) => {
4182
4182
  desktopChildren: l,
4183
4183
  mobileChildren: s,
4184
4184
  desktopMouseX: c,
4185
- ...p
4185
+ ...u
4186
4186
  } = e;
4187
4187
  return /* @__PURE__ */ L(ve, { children: [
4188
4188
  /* @__PURE__ */ a(
@@ -4193,7 +4193,7 @@ const go = (e) => {
4193
4193
  itemBuilder: r,
4194
4194
  children: l,
4195
4195
  mouseX: c,
4196
- ...p
4196
+ ...u
4197
4197
  }
4198
4198
  ),
4199
4199
  /* @__PURE__ */ a(
@@ -4204,7 +4204,7 @@ const go = (e) => {
4204
4204
  itemBuilder: i,
4205
4205
  children: s,
4206
4206
  autoHidden: !0,
4207
- ...p
4207
+ ...u
4208
4208
  }
4209
4209
  )
4210
4210
  ] });
@@ -4587,9 +4587,9 @@ const st = Ke.createContext(null);
4587
4587
  function Ds(e, t) {
4588
4588
  const o = De(Ss), [n, r] = N(null), i = K(), { current: l } = K({ mapLib: null, map: null });
4589
4589
  D(() => {
4590
- const p = e.mapLib;
4591
- let h = !0, u;
4592
- return Promise.resolve(p || import("maplibre-gl")).then((f) => {
4590
+ const u = e.mapLib;
4591
+ let h = !0, p;
4592
+ return Promise.resolve(u || import("maplibre-gl")).then((f) => {
4593
4593
  if (!h)
4594
4594
  return;
4595
4595
  if (!f)
@@ -4597,7 +4597,7 @@ function Ds(e, t) {
4597
4597
  const g = "Map" in f ? f : f.default;
4598
4598
  if (!g.Map)
4599
4599
  throw new Error("Invalid mapLib");
4600
- Bs(g, e), e.reuseMaps && (u = lt.reuse(e, i.current)), u || (u = new lt(g.Map, e, i.current)), l.map = As(u), l.mapLib = g, r(u), o == null || o.onMapMount(l.map, e.id);
4600
+ Bs(g, e), e.reuseMaps && (p = lt.reuse(e, i.current)), p || (p = new lt(g.Map, e, i.current)), l.map = As(p), l.mapLib = g, r(p), o == null || o.onMapMount(l.map, e.id);
4601
4601
  }).catch((f) => {
4602
4602
  const { onError: g } = e;
4603
4603
  g ? g({
@@ -4607,7 +4607,7 @@ function Ds(e, t) {
4607
4607
  error: f
4608
4608
  }) : console.error(f);
4609
4609
  }), () => {
4610
- h = !1, u && (o == null || o.onMapUnmount(e.id), e.reuseMaps ? u.recycle() : u.destroy());
4610
+ h = !1, p && (o == null || o.onMapUnmount(e.id), e.reuseMaps ? p.recycle() : p.destroy());
4611
4611
  };
4612
4612
  }, []), Rs(() => {
4613
4613
  n && n.setProps(e);
@@ -4683,12 +4683,12 @@ const jt = Fe(ee((e, t) => {
4683
4683
  D(() => (i.addTo(o.getMap()), () => {
4684
4684
  i.remove();
4685
4685
  }), []);
4686
- const { longitude: l, latitude: s, offset: c, style: p, draggable: h = !1, popup: u = null, rotation: f = 0, rotationAlignment: g = "auto", pitchAlignment: d = "auto" } = e;
4686
+ const { longitude: l, latitude: s, offset: c, style: u, draggable: h = !1, popup: p = null, rotation: f = 0, rotationAlignment: g = "auto", pitchAlignment: d = "auto" } = e;
4687
4687
  D(() => {
4688
- We(i.getElement(), p);
4689
- }, [p]), tt(t, () => i, []);
4688
+ We(i.getElement(), u);
4689
+ }, [u]), tt(t, () => i, []);
4690
4690
  const m = r.current.props;
4691
- (i.getLngLat().lng !== l || i.getLngLat().lat !== s) && i.setLngLat([l, s]), c && !Ls(i.getOffset(), c) && i.setOffset(c), i.isDraggable() !== h && i.setDraggable(h), i.getRotation() !== f && i.setRotation(f), i.getRotationAlignment() !== g && i.setRotationAlignment(g), i.getPitchAlignment() !== d && i.setPitchAlignment(d), i.getPopup() !== u && i.setPopup(u);
4691
+ (i.getLngLat().lng !== l || i.getLngLat().lat !== s) && i.setLngLat([l, s]), c && !Ls(i.getOffset(), c) && i.setOffset(c), i.isDraggable() !== h && i.setDraggable(h), i.getRotation() !== f && i.setRotation(f), i.getRotationAlignment() !== g && i.setRotationAlignment(g), i.getPitchAlignment() !== d && i.setPitchAlignment(d), i.getPopup() !== p && i.setPopup(p);
4692
4692
  const b = ur(m.className, e.className);
4693
4693
  if (b)
4694
4694
  for (const v of b)
@@ -4698,15 +4698,15 @@ const jt = Fe(ee((e, t) => {
4698
4698
  Fe(ee((e, t) => {
4699
4699
  const { map: o, mapLib: n } = De(st), r = te(() => document.createElement("div"), []), i = K({ props: e }), l = te(() => {
4700
4700
  const s = { ...e }, c = new n.Popup(s);
4701
- return c.setLngLat([e.longitude, e.latitude]), c.once("open", (p) => {
4702
- var h, u;
4703
- (u = (h = i.current.props).onOpen) == null || u.call(h, p);
4701
+ return c.setLngLat([e.longitude, e.latitude]), c.once("open", (u) => {
4702
+ var h, p;
4703
+ (p = (h = i.current.props).onOpen) == null || p.call(h, u);
4704
4704
  }), c;
4705
4705
  }, []);
4706
4706
  if (D(() => {
4707
4707
  const s = (c) => {
4708
- var p, h;
4709
- (h = (p = i.current.props).onClose) == null || h.call(p, c);
4708
+ var u, h;
4709
+ (h = (u = i.current.props).onClose) == null || h.call(u, c);
4710
4710
  };
4711
4711
  return l.on("close", s), l.setDOMContent(r).addTo(o.getMap()), () => {
4712
4712
  l.off("close", s), l.isOpen() && l.remove();
@@ -4718,8 +4718,8 @@ Fe(ee((e, t) => {
4718
4718
  (l.getLngLat().lng !== e.longitude || l.getLngLat().lat !== e.latitude) && l.setLngLat([e.longitude, e.latitude]), e.offset && !Me(s.offset, e.offset) && l.setOffset(e.offset), (s.anchor !== e.anchor || s.maxWidth !== e.maxWidth) && (l.options.anchor = e.anchor, l.setMaxWidth(e.maxWidth));
4719
4719
  const c = ur(s.className, e.className);
4720
4720
  if (c)
4721
- for (const p of c)
4722
- l.toggleClassName(p);
4721
+ for (const u of c)
4722
+ l.toggleClassName(u);
4723
4723
  i.current.props = e;
4724
4724
  }
4725
4725
  return xn(e.children, r);
@@ -4727,9 +4727,9 @@ Fe(ee((e, t) => {
4727
4727
  function ot(e, t, o, n) {
4728
4728
  const r = De(st), i = te(() => e(r), []);
4729
4729
  return D(() => {
4730
- const l = t, s = null, c = typeof t == "function" ? t : null, { map: p } = r;
4731
- return p.hasControl(i) || (p.addControl(i, l == null ? void 0 : l.position), s && s(r)), () => {
4732
- c && c(r), p.hasControl(i) && p.removeControl(i);
4730
+ const l = t, s = null, c = typeof t == "function" ? t : null, { map: u } = r;
4731
+ return u.hasControl(i) || (u.addControl(i, l == null ? void 0 : l.position), s && s(r)), () => {
4732
+ c && c(r), u.hasControl(i) && u.removeControl(i);
4733
4733
  };
4734
4734
  }, []), i;
4735
4735
  }
@@ -4757,20 +4757,20 @@ function Fs(e, t) {
4757
4757
  return i._setupUI = () => {
4758
4758
  i._container.hasChildNodes() || l();
4759
4759
  }, i.on("geolocate", (s) => {
4760
- var c, p;
4761
- (p = (c = o.current.props).onGeolocate) == null || p.call(c, s);
4760
+ var c, u;
4761
+ (u = (c = o.current.props).onGeolocate) == null || u.call(c, s);
4762
4762
  }), i.on("error", (s) => {
4763
- var c, p;
4764
- (p = (c = o.current.props).onError) == null || p.call(c, s);
4763
+ var c, u;
4764
+ (u = (c = o.current.props).onError) == null || u.call(c, s);
4765
4765
  }), i.on("outofmaxbounds", (s) => {
4766
- var c, p;
4767
- (p = (c = o.current.props).onOutOfMaxBounds) == null || p.call(c, s);
4766
+ var c, u;
4767
+ (u = (c = o.current.props).onOutOfMaxBounds) == null || u.call(c, s);
4768
4768
  }), i.on("trackuserlocationstart", (s) => {
4769
- var c, p;
4770
- (p = (c = o.current.props).onTrackUserLocationStart) == null || p.call(c, s);
4769
+ var c, u;
4770
+ (u = (c = o.current.props).onTrackUserLocationStart) == null || u.call(c, s);
4771
4771
  }), i.on("trackuserlocationend", (s) => {
4772
- var c, p;
4773
- (p = (c = o.current.props).onTrackUserLocationEnd) == null || p.call(c, s);
4772
+ var c, u;
4773
+ (u = (c = o.current.props).onTrackUserLocationEnd) == null || u.call(c, s);
4774
4774
  }), i;
4775
4775
  }, { position: e.position });
4776
4776
  return o.current.props = e, tt(t, () => n, []), D(() => {
@@ -4830,8 +4830,8 @@ function qs(e, t, o) {
4830
4830
  var l, s, c;
4831
4831
  At(t.id === o.id, "source id changed"), At(t.type === o.type, "source type changed");
4832
4832
  let n = "", r = 0;
4833
- for (const p in t)
4834
- p !== "children" && p !== "id" && !Me(o[p], t[p]) && (n = p, r++);
4833
+ for (const u in t)
4834
+ u !== "children" && u !== "id" && !Me(o[u], t[u]) && (n = u, r++);
4835
4835
  if (!r)
4836
4836
  return;
4837
4837
  const i = t.type;
@@ -4867,8 +4867,8 @@ function Wt(e) {
4867
4867
  if (t.off("styledata", l), t.style && t.style._loaded && t.getSource(r)) {
4868
4868
  const c = (s = t.getStyle()) == null ? void 0 : s.layers;
4869
4869
  if (c)
4870
- for (const p of c)
4871
- p.source === r && t.removeLayer(p.id);
4870
+ for (const u of c)
4871
+ u.source === r && t.removeLayer(u.id);
4872
4872
  t.removeSource(r);
4873
4873
  }
4874
4874
  };
@@ -4882,20 +4882,20 @@ function Wt(e) {
4882
4882
  function Ys(e, t, o, n) {
4883
4883
  if (At(o.id === n.id, "layer id changed"), At(o.type === n.type, "layer type changed"), o.type === "custom" || n.type === "custom")
4884
4884
  return;
4885
- const { layout: r = {}, paint: i = {}, filter: l, minzoom: s, maxzoom: c, beforeId: p } = o;
4886
- if (p !== n.beforeId && e.moveLayer(t, p), r !== n.layout) {
4885
+ const { layout: r = {}, paint: i = {}, filter: l, minzoom: s, maxzoom: c, beforeId: u } = o;
4886
+ if (u !== n.beforeId && e.moveLayer(t, u), r !== n.layout) {
4887
4887
  const h = n.layout || {};
4888
- for (const u in r)
4889
- Me(r[u], h[u]) || e.setLayoutProperty(t, u, r[u]);
4890
- for (const u in h)
4891
- r.hasOwnProperty(u) || e.setLayoutProperty(t, u, void 0);
4888
+ for (const p in r)
4889
+ Me(r[p], h[p]) || e.setLayoutProperty(t, p, r[p]);
4890
+ for (const p in h)
4891
+ r.hasOwnProperty(p) || e.setLayoutProperty(t, p, void 0);
4892
4892
  }
4893
4893
  if (i !== n.paint) {
4894
4894
  const h = n.paint || {};
4895
- for (const u in i)
4896
- Me(i[u], h[u]) || e.setPaintProperty(t, u, i[u]);
4897
- for (const u in h)
4898
- i.hasOwnProperty(u) || e.setPaintProperty(t, u, void 0);
4895
+ for (const p in i)
4896
+ Me(i[p], h[p]) || e.setPaintProperty(t, p, i[p]);
4897
+ for (const p in h)
4898
+ i.hasOwnProperty(p) || e.setPaintProperty(t, p, void 0);
4899
4899
  }
4900
4900
  Me(l, n.filter) || e.setFilter(t, l), (s !== n.minzoom || c !== n.maxzoom) && e.setLayerZoomRange(t, s, c);
4901
4901
  }
@@ -4933,8 +4933,8 @@ const Zs = (e) => {
4933
4933
  let t = 180, o = 90, n = -180, r = -90;
4934
4934
  const i = (s) => {
4935
4935
  if (s.length >= 2) {
4936
- const [c, p] = s;
4937
- t = Math.min(t, c), o = Math.min(o, p), n = Math.max(n, c), r = Math.max(r, p);
4936
+ const [c, u] = s;
4937
+ t = Math.min(t, c), o = Math.min(o, u), n = Math.max(n, c), r = Math.max(r, u);
4938
4938
  }
4939
4939
  }, l = (s) => {
4940
4940
  Array.isArray(s) && (typeof s[0] == "number" ? i(s) : s.forEach((c) => l(c)));
@@ -4966,22 +4966,22 @@ const Zs = (e) => {
4966
4966
  return null;
4967
4967
  }, Js = (e, t, o) => {
4968
4968
  if (!e || !t) return [];
4969
- const n = e.getBounds(), r = n.getWest(), i = n.getEast(), l = n.getSouth(), s = n.getNorth(), c = Math.abs(i - r), p = Math.abs(s - l);
4969
+ const n = e.getBounds(), r = n.getWest(), i = n.getEast(), l = n.getSouth(), s = n.getNorth(), c = Math.abs(i - r), u = Math.abs(s - l);
4970
4970
  if (console.log("视图边界:", {
4971
4971
  west: r,
4972
4972
  east: i,
4973
4973
  south: l,
4974
4974
  north: s,
4975
4975
  width: c,
4976
- height: p
4977
- }), c > 50 && p > 30)
4976
+ height: u
4977
+ }), c > 50 && u > 30)
4978
4978
  return console.log("视图范围很大,返回所有省份"), [...o];
4979
- const h = [], u = new Map(
4979
+ const h = [], p = new Map(
4980
4980
  o.map((f) => [f.code, f])
4981
4981
  );
4982
4982
  if (t.features.forEach((f) => {
4983
4983
  if (!f.properties || !f.properties.adcode) return;
4984
- const { adcode: g } = f.properties, d = u.get(g);
4984
+ const { adcode: g } = f.properties, d = p.get(g);
4985
4985
  if (!d) return;
4986
4986
  let m = Zs(f);
4987
4987
  if (!m && d) {
@@ -4998,7 +4998,7 @@ const Zs = (e) => {
4998
4998
  if (h.some((b) => b.code === f.code)) return;
4999
4999
  const { longitude: d, latitude: m } = f;
5000
5000
  d >= r && d <= i && m >= l && m <= s && h.push(f);
5001
- }), h.length < 3 && (c > 10 || p > 10))) {
5001
+ }), h.length < 3 && (c > 10 || u > 10))) {
5002
5002
  console.log("扩大检查范围...");
5003
5003
  const f = r - 2, g = i + 2, d = l - 2, m = s + 2;
5004
5004
  o.forEach((b) => {
@@ -5035,9 +5035,9 @@ const Zs = (e) => {
5035
5035
  style: l,
5036
5036
  onVisibleAreasChanged: s,
5037
5037
  cityMinZoom: c = 5,
5038
- districtMinZoom: p = 7,
5038
+ districtMinZoom: u = 7,
5039
5039
  fetchGeoData: h,
5040
- children: u
5040
+ children: p
5041
5041
  }) => {
5042
5042
  const f = K(null), [g, d] = N(Jo), [m, b] = N(null), [v, y] = N(e), [k, S] = N([]), x = K({}), [w, z] = N({}), [I, M] = N({}), [R, V] = N(!1), [$, _] = N([]), [j, J] = N({}), [ie, ue] = N({}), [H, ae] = N(!1), [be, Y] = N([]), se = te(
5043
5043
  () => h || ec,
@@ -5189,7 +5189,7 @@ const Zs = (e) => {
5189
5189
  bounds: O,
5190
5190
  visibleAreasCount: P.length,
5191
5191
  zoom: v
5192
- }, console.debug("计算结果:", P.length, "个区域在视图内"), s && s(P), v > p) {
5192
+ }, console.debug("计算结果:", P.length, "个区域在视图内"), s && s(P), v > u) {
5193
5193
  V(!0), ae(!0), fe(P);
5194
5194
  const de = Object.values(I).flat().filter(
5195
5195
  (C) => {
@@ -5209,7 +5209,7 @@ const Zs = (e) => {
5209
5209
  ye,
5210
5210
  I,
5211
5211
  c,
5212
- p
5212
+ u
5213
5213
  ]);
5214
5214
  D(() => {
5215
5215
  xe(g);
@@ -5421,7 +5421,7 @@ const Zs = (e) => {
5421
5421
  },
5422
5422
  `district-${A.code}`
5423
5423
  )),
5424
- u
5424
+ p
5425
5425
  ]
5426
5426
  }
5427
5427
  )
@@ -5436,10 +5436,10 @@ function oc({
5436
5436
  delay: r = 600,
5437
5437
  closeDelay: i = 0
5438
5438
  } = {}) {
5439
- const [l, s] = N(e), c = o ?? l, p = n ?? s, h = hn({
5439
+ const [l, s] = N(e), c = o ?? l, u = n ?? s, h = hn({
5440
5440
  placement: t,
5441
5441
  open: c,
5442
- onOpenChange: p,
5442
+ onOpenChange: u,
5443
5443
  whileElementsMounted: fn,
5444
5444
  middleware: [
5445
5445
  gn(4),
@@ -5450,7 +5450,7 @@ function oc({
5450
5450
  }),
5451
5451
  bn({ padding: 4 })
5452
5452
  ]
5453
- }), u = h.context, f = Ia(u, {
5453
+ }), p = h.context, f = Ia(p, {
5454
5454
  mouseOnly: !0,
5455
5455
  move: !1,
5456
5456
  restMs: r,
@@ -5458,17 +5458,17 @@ function oc({
5458
5458
  delay: {
5459
5459
  close: i
5460
5460
  }
5461
- }), g = Ma(u, {
5461
+ }), g = Ma(p, {
5462
5462
  enabled: o == null
5463
- }), d = Na(u), m = Ea(u, { role: "tooltip" }), b = Aa([f, g, d, m]);
5463
+ }), d = Na(p), m = Ea(p, { role: "tooltip" }), b = Aa([f, g, d, m]);
5464
5464
  return te(
5465
5465
  () => ({
5466
5466
  open: c,
5467
- setOpen: p,
5467
+ setOpen: u,
5468
5468
  ...b,
5469
5469
  ...h
5470
5470
  }),
5471
- [c, p, b, h]
5471
+ [c, u, b, h]
5472
5472
  );
5473
5473
  }
5474
5474
  const Kt = Tt(null);
@@ -5508,7 +5508,7 @@ const fr = ee(function({ children: t, asChild: o = !1, ...n }, r) {
5508
5508
  }), gr = ee(function({ style: t, children: o, portal: n = !0, portalProps: r = {}, ...i }, l) {
5509
5509
  const s = pr(), c = vn([s.refs.setFloating, l]);
5510
5510
  if (!s.open) return null;
5511
- const p = /* @__PURE__ */ a(
5511
+ const u = /* @__PURE__ */ a(
5512
5512
  "div",
5513
5513
  {
5514
5514
  ref: c,
@@ -5521,7 +5521,7 @@ const fr = ee(function({ children: t, asChild: o = !1, ...n }, r) {
5521
5521
  children: o
5522
5522
  }
5523
5523
  );
5524
- return n ? /* @__PURE__ */ a(yn, { ...r, children: p }) : p;
5524
+ return n ? /* @__PURE__ */ a(yn, { ...r, children: u }) : u;
5525
5525
  });
5526
5526
  hr.displayName = "Tooltip";
5527
5527
  fr.displayName = "TooltipTrigger";
@@ -5565,9 +5565,9 @@ function ac(e) {
5565
5565
  if (!l)
5566
5566
  return console.warn("No paragraph node type found in schema."), !1;
5567
5567
  const s = n.content.size, c = l.create();
5568
- let p = t.tr.insert(s, c);
5569
- const h = p.doc.resolve(s + 1);
5570
- return p = p.setSelection(Te.near(h)).scrollIntoView(), o.dispatch(p), !0;
5568
+ let u = t.tr.insert(s, c);
5569
+ const h = u.doc.resolve(s + 1);
5570
+ return u = u.setSelection(Te.near(h)).scrollIntoView(), o.dispatch(u), !0;
5571
5571
  }
5572
5572
  function ct(e) {
5573
5573
  return typeof e == "number" && e >= 0;
@@ -5598,7 +5598,7 @@ function $t(e) {
5598
5598
  return null;
5599
5599
  if (r) {
5600
5600
  let s = -1, c = null;
5601
- if (t.state.doc.descendants((p, h) => p === o ? (s = h, c = p, !1) : !0), s !== -1 && c !== null)
5601
+ if (t.state.doc.descendants((u, h) => u === o ? (s = h, c = u, !1) : !0), s !== -1 && c !== null)
5602
5602
  return { pos: s, node: c };
5603
5603
  }
5604
5604
  if (i) {
@@ -5741,13 +5741,13 @@ function yo({
5741
5741
  orientation: l = "vertical",
5742
5742
  autoSelectFirstItem: s = !0
5743
5743
  }) {
5744
- const [c, p] = N(
5744
+ const [c, u] = N(
5745
5745
  s ? 0 : -1
5746
5746
  );
5747
5747
  return D(() => {
5748
5748
  const h = (f) => {
5749
5749
  if (!n.length) return !1;
5750
- const g = () => p((m) => m === -1 ? 0 : (m + 1) % n.length), d = () => p((m) => m === -1 ? n.length - 1 : (m - 1 + n.length) % n.length);
5750
+ const g = () => u((m) => m === -1 ? 0 : (m + 1) % n.length), d = () => u((m) => m === -1 ? n.length - 1 : (m - 1 + n.length) % n.length);
5751
5751
  switch (f.key) {
5752
5752
  case "ArrowUp":
5753
5753
  return l === "horizontal" ? !1 : (f.preventDefault(), d(), !0);
@@ -5760,9 +5760,9 @@ function yo({
5760
5760
  case "Tab":
5761
5761
  return f.preventDefault(), f.shiftKey ? d() : g(), !0;
5762
5762
  case "Home":
5763
- return f.preventDefault(), p(0), !0;
5763
+ return f.preventDefault(), u(0), !0;
5764
5764
  case "End":
5765
- return f.preventDefault(), p(n.length - 1), !0;
5765
+ return f.preventDefault(), u(n.length - 1), !0;
5766
5766
  case "Enter":
5767
5767
  return f.isComposing ? !1 : (f.preventDefault(), c !== -1 && n[c] && (r == null || r(n[c])), !0);
5768
5768
  case "Escape":
@@ -5771,10 +5771,10 @@ function yo({
5771
5771
  return !1;
5772
5772
  }
5773
5773
  };
5774
- let u = null;
5775
- if (e ? u = e.view.dom : t != null && t.current && (u = t.current), u)
5776
- return u.addEventListener("keydown", h, !0), () => {
5777
- u == null || u.removeEventListener(
5774
+ let p = null;
5775
+ if (e ? p = e.view.dom : t != null && t.current && (p = t.current), p)
5776
+ return p.addEventListener("keydown", h, !0), () => {
5777
+ p == null || p.removeEventListener(
5778
5778
  "keydown",
5779
5779
  h,
5780
5780
  !0
@@ -5789,10 +5789,10 @@ function yo({
5789
5789
  i,
5790
5790
  l
5791
5791
  ]), D(() => {
5792
- o && p(s ? 0 : -1);
5792
+ o && u(s ? 0 : -1);
5793
5793
  }, [o, s]), {
5794
5794
  selectedIndex: n.length ? c : void 0,
5795
- setSelectedIndex: p
5795
+ setSelectedIndex: u
5796
5796
  };
5797
5797
  }
5798
5798
  const tn = (e, t) => {
@@ -5830,11 +5830,11 @@ const tn = (e, t) => {
5830
5830
  const i = e.current;
5831
5831
  if (!i) return;
5832
5832
  const l = (c) => {
5833
- const p = c.target;
5834
- i.contains(p) && p.setAttribute("data-focus-visible", "true");
5833
+ const u = c.target;
5834
+ i.contains(u) && u.setAttribute("data-focus-visible", "true");
5835
5835
  }, s = (c) => {
5836
- const p = c.target;
5837
- i.contains(p) && p.removeAttribute("data-focus-visible");
5836
+ const u = c.target;
5837
+ i.contains(u) && u.removeAttribute("data-focus-visible");
5838
5838
  };
5839
5839
  return i.addEventListener("focus", l, !0), i.addEventListener("blur", s, !0), () => {
5840
5840
  i.removeEventListener("focus", l, !0), i.removeEventListener("blur", s, !0);
@@ -5920,22 +5920,22 @@ function fc(e, t) {
5920
5920
  if (!n) return !1;
5921
5921
  try {
5922
5922
  const s = e.view;
5923
- let c = s.state, p = c.tr;
5923
+ let c = s.state, u = c.tr;
5924
5924
  if (c.selection.empty || c.selection instanceof Te) {
5925
5925
  const d = (r = $t({
5926
5926
  editor: e,
5927
5927
  node: c.selection.$anchor.node(1)
5928
5928
  })) == null ? void 0 : r.pos;
5929
5929
  if (!ct(d)) return !1;
5930
- p = p.setSelection(Oe.create(c.doc, d)), s.dispatch(p), c = s.state;
5930
+ u = u.setSelection(Oe.create(c.doc, d)), s.dispatch(u), c = s.state;
5931
5931
  }
5932
5932
  const h = c.selection;
5933
- let u = e.chain().focus();
5933
+ let p = e.chain().focus();
5934
5934
  if (h instanceof Oe) {
5935
5935
  const d = (i = h.node.firstChild) == null ? void 0 : i.firstChild, m = (l = h.node.lastChild) == null ? void 0 : l.lastChild, b = d ? h.from + d.nodeSize : h.from + 1, v = m ? h.to - m.nodeSize : h.to - 1, y = c.doc.resolve(b), k = c.doc.resolve(v);
5936
- u = u.setTextSelection(Te.between(y, k)).clearNodes();
5936
+ p = p.setTextSelection(Te.between(y, k)).clearNodes();
5937
5937
  }
5938
- return (o.some((d) => e.isActive("heading", { level: d })) ? u.setNode("paragraph") : u.setNode("heading", { level: n })).run(), e.chain().focus().selectTextblockEnd().run(), !0;
5938
+ return (o.some((d) => e.isActive("heading", { level: d })) ? p.setNode("paragraph") : p.setNode("heading", { level: n })).run(), e.chain().focus().selectTextblockEnd().run(), !0;
5939
5939
  } catch {
5940
5940
  return !1;
5941
5941
  }
@@ -5945,24 +5945,24 @@ function vr(e) {
5945
5945
  return !t || !t.isEditable || !Ue("heading", t) ? !1 : n && !t.isActive("code") ? Array.isArray(o) ? o.some((r) => bt(t, r)) : bt(t, o) : !0;
5946
5946
  }
5947
5947
  function gc(e) {
5948
- const { editor: t, level: o, hideWhenUnavailable: n = !1, onToggled: r } = e, { editor: i } = me(t), [l, s] = N(!0), c = bt(i, o), p = vo(i, o);
5948
+ const { editor: t, level: o, hideWhenUnavailable: n = !1, onToggled: r } = e, { editor: i } = me(t), [l, s] = N(!0), c = bt(i, o), u = vo(i, o);
5949
5949
  D(() => {
5950
5950
  if (!i) return;
5951
- const u = () => {
5951
+ const p = () => {
5952
5952
  s(vr({ editor: i, level: o, hideWhenUnavailable: n }));
5953
5953
  };
5954
- return u(), i.on("selectionUpdate", u), () => {
5955
- i.off("selectionUpdate", u);
5954
+ return p(), i.on("selectionUpdate", p), () => {
5955
+ i.off("selectionUpdate", p);
5956
5956
  };
5957
5957
  }, [i, o, n]);
5958
5958
  const h = U(() => {
5959
5959
  if (!i) return !1;
5960
- const u = fc(i, o);
5961
- return u && (r == null || r()), u;
5960
+ const p = fc(i, o);
5961
+ return p && (r == null || r()), p;
5962
5962
  }, [i, o, r]);
5963
5963
  return {
5964
5964
  isVisible: l,
5965
- isActive: p,
5965
+ isActive: u,
5966
5966
  handleToggle: h,
5967
5967
  canToggle: c,
5968
5968
  label: `Heading ${o}`,
@@ -6003,8 +6003,8 @@ const xr = ee(
6003
6003
  onClick: l,
6004
6004
  children: s,
6005
6005
  ...c
6006
- }, p) => {
6007
- const { editor: h } = me(e), { isVisible: u, canToggle: f, isActive: g, handleToggle: d, label: m, Icon: b, shortcutKeys: v } = gc({
6006
+ }, u) => {
6007
+ const { editor: h } = me(e), { isVisible: p, canToggle: f, isActive: g, handleToggle: d, label: m, Icon: b, shortcutKeys: v } = gc({
6008
6008
  editor: h,
6009
6009
  level: t,
6010
6010
  hideWhenUnavailable: n,
@@ -6015,7 +6015,7 @@ const xr = ee(
6015
6015
  },
6016
6016
  [d, l]
6017
6017
  );
6018
- return u ? /* @__PURE__ */ a(
6018
+ return p ? /* @__PURE__ */ a(
6019
6019
  G,
6020
6020
  {
6021
6021
  type: "button",
@@ -6030,7 +6030,7 @@ const xr = ee(
6030
6030
  tooltip: m,
6031
6031
  onClick: y,
6032
6032
  ...c,
6033
- ref: p,
6033
+ ref: u,
6034
6034
  children: s ?? /* @__PURE__ */ L(ve, { children: [
6035
6035
  /* @__PURE__ */ a(b, { className: "tiptap-button-icon" }),
6036
6036
  o && /* @__PURE__ */ a("span", { className: "tiptap-button-text", children: o }),
@@ -6046,19 +6046,19 @@ function bc(e, t = [1, 2, 3, 4, 5, 6]) {
6046
6046
  return t.find((o) => vo(e, o));
6047
6047
  }
6048
6048
  function yc(e) {
6049
- const { editor: t, levels: o = [1, 2, 3, 4, 5, 6], hideWhenUnavailable: n = !1 } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = bc(i, o), p = vo(i), h = bt(i);
6049
+ const { editor: t, levels: o = [1, 2, 3, 4, 5, 6], hideWhenUnavailable: n = !1 } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = bc(i, o), u = vo(i), h = bt(i);
6050
6050
  return D(() => {
6051
6051
  if (!i) return;
6052
- const u = () => {
6052
+ const p = () => {
6053
6053
  s(vr({ editor: i, hideWhenUnavailable: n, level: o }));
6054
6054
  };
6055
- return u(), i.on("selectionUpdate", u), () => {
6056
- i.off("selectionUpdate", u);
6055
+ return p(), i.on("selectionUpdate", p), () => {
6056
+ i.off("selectionUpdate", p);
6057
6057
  };
6058
6058
  }, [i, n, o]), {
6059
6059
  isVisible: l,
6060
6060
  activeLevel: c,
6061
- isActive: p,
6061
+ isActive: u,
6062
6062
  canToggle: h,
6063
6063
  levels: o,
6064
6064
  label: r("toolbar.heading.label"),
@@ -6152,7 +6152,7 @@ const wr = ee(
6152
6152
  onOpenChange: r,
6153
6153
  ...i
6154
6154
  }, l) => {
6155
- const { t: s } = he("simpleEditor"), { editor: c } = me(e), [p, h] = N(!1), { isVisible: u, isActive: f, canToggle: g, Icon: d } = yc({
6155
+ const { t: s } = he("simpleEditor"), { editor: c } = me(e), [u, h] = N(!1), { isVisible: p, isActive: f, canToggle: g, Icon: d } = yc({
6156
6156
  editor: c,
6157
6157
  levels: t,
6158
6158
  hideWhenUnavailable: o
@@ -6162,7 +6162,7 @@ const wr = ee(
6162
6162
  },
6163
6163
  [g, c, r]
6164
6164
  );
6165
- return u ? /* @__PURE__ */ L(xo, { modal: !0, open: p, onOpenChange: m, children: [
6165
+ return p ? /* @__PURE__ */ L(xo, { modal: !0, open: u, onOpenChange: m, children: [
6166
6166
  /* @__PURE__ */ a(Pt, { asChild: !0, children: /* @__PURE__ */ L(
6167
6167
  G,
6168
6168
  {
@@ -6226,7 +6226,7 @@ function Sc(e) {
6226
6226
  return !t || !t.isEditable || !Ze(t, "imageUpload") ? !1 : o && !t.isActive("code") ? wo(t) : !0;
6227
6227
  }
6228
6228
  function Lc(e) {
6229
- const { editor: t, hideWhenUnavailable: o = !1, onInserted: n } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), l = dt(), [s, c] = N(!0), p = wo(i), h = Cc(i);
6229
+ const { editor: t, hideWhenUnavailable: o = !1, onInserted: n } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), l = dt(), [s, c] = N(!0), u = wo(i), h = Cc(i);
6230
6230
  D(() => {
6231
6231
  if (!i) return;
6232
6232
  const f = () => {
@@ -6236,7 +6236,7 @@ function Lc(e) {
6236
6236
  i.off("selectionUpdate", f);
6237
6237
  };
6238
6238
  }, [i, o]);
6239
- const u = U(() => {
6239
+ const p = U(() => {
6240
6240
  if (!i) return !1;
6241
6241
  const f = zc(i);
6242
6242
  return f && (n == null || n()), f;
@@ -6244,18 +6244,18 @@ function Lc(e) {
6244
6244
  return zn(
6245
6245
  Zt,
6246
6246
  (f) => {
6247
- f.preventDefault(), u();
6247
+ f.preventDefault(), p();
6248
6248
  },
6249
6249
  {
6250
- enabled: s && p,
6250
+ enabled: s && u,
6251
6251
  enableOnContentEditable: !l,
6252
6252
  enableOnFormTags: !0
6253
6253
  }
6254
6254
  ), {
6255
6255
  isVisible: s,
6256
6256
  isActive: h,
6257
- handleImage: u,
6258
- canInsert: p,
6257
+ handleImage: p,
6258
+ canInsert: u,
6259
6259
  label: r("toolbar.image.label"),
6260
6260
  shortcutKeys: Zt,
6261
6261
  Icon: qi
@@ -6275,8 +6275,8 @@ const Cr = ee(
6275
6275
  icon: l,
6276
6276
  children: s,
6277
6277
  ...c
6278
- }, p) => {
6279
- const { editor: h } = me(e), { isVisible: u, canInsert: f, handleImage: g, label: d, isActive: m, shortcutKeys: b, Icon: v } = Lc({
6278
+ }, u) => {
6279
+ const { editor: h } = me(e), { isVisible: p, canInsert: f, handleImage: g, label: d, isActive: m, shortcutKeys: b, Icon: v } = Lc({
6280
6280
  editor: h,
6281
6281
  hideWhenUnavailable: o,
6282
6282
  onInserted: n
@@ -6286,7 +6286,7 @@ const Cr = ee(
6286
6286
  },
6287
6287
  [g, i]
6288
6288
  );
6289
- return u ? /* @__PURE__ */ a(
6289
+ return p ? /* @__PURE__ */ a(
6290
6290
  G,
6291
6291
  {
6292
6292
  type: "button",
@@ -6301,7 +6301,7 @@ const Cr = ee(
6301
6301
  tooltip: d,
6302
6302
  onClick: y,
6303
6303
  ...c,
6304
- ref: p,
6304
+ ref: u,
6305
6305
  children: s ?? /* @__PURE__ */ L(ve, { children: [
6306
6306
  /* @__PURE__ */ a(l ?? v, { className: "tiptap-button-icon" }),
6307
6307
  t && /* @__PURE__ */ a("span", { className: "tiptap-button-text", children: t }),
@@ -6387,21 +6387,21 @@ function Nc(e, t) {
6387
6387
  s = s.setSelection(Oe.create(l.doc, h)), i.dispatch(s), l = i.state;
6388
6388
  }
6389
6389
  const c = l.selection;
6390
- let p = e.chain().focus();
6390
+ let u = e.chain().focus();
6391
6391
  if (c instanceof Oe) {
6392
- const h = (n = c.node.firstChild) == null ? void 0 : n.firstChild, u = (r = c.node.lastChild) == null ? void 0 : r.lastChild, f = h ? c.from + h.nodeSize : c.from + 1, g = u ? c.to - u.nodeSize : c.to - 1, d = l.doc.resolve(f), m = l.doc.resolve(g);
6393
- p = p.setTextSelection(Te.between(d, m)).clearNodes();
6392
+ const h = (n = c.node.firstChild) == null ? void 0 : n.firstChild, p = (r = c.node.lastChild) == null ? void 0 : r.lastChild, f = h ? c.from + h.nodeSize : c.from + 1, g = p ? c.to - p.nodeSize : c.to - 1, d = l.doc.resolve(f), m = l.doc.resolve(g);
6393
+ u = u.setTextSelection(Te.between(d, m)).clearNodes();
6394
6394
  }
6395
6395
  if (e.isActive(t))
6396
- p.liftListItem("listItem").lift("bulletList").lift("orderedList").lift("taskList").run();
6396
+ u.liftListItem("listItem").lift("bulletList").lift("orderedList").lift("taskList").run();
6397
6397
  else {
6398
- const u = {
6399
- bulletList: () => p.toggleBulletList(),
6400
- orderedList: () => p.toggleOrderedList(),
6401
- taskList: () => p.toggleList("taskList", "taskItem")
6398
+ const p = {
6399
+ bulletList: () => u.toggleBulletList(),
6400
+ orderedList: () => u.toggleOrderedList(),
6401
+ taskList: () => u.toggleList("taskList", "taskItem")
6402
6402
  }[t];
6403
- if (!u) return !1;
6404
- u().run();
6403
+ if (!p) return !1;
6404
+ p().run();
6405
6405
  }
6406
6406
  return e.chain().focus().selectTextblockEnd().run(), !0;
6407
6407
  } catch {
@@ -6413,24 +6413,24 @@ function Ec(e) {
6413
6413
  return !t || !t.isEditable || !Ue(o, t) ? !1 : n && !t.isActive("code") ? _t(t, o) : !0;
6414
6414
  }
6415
6415
  function Ac(e) {
6416
- const { editor: t, type: o, hideWhenUnavailable: n = !1, onToggled: r } = e, { editor: i } = me(t), [l, s] = N(!0), c = _t(i, o), p = Co(i, o);
6416
+ const { editor: t, type: o, hideWhenUnavailable: n = !1, onToggled: r } = e, { editor: i } = me(t), [l, s] = N(!0), c = _t(i, o), u = Co(i, o);
6417
6417
  D(() => {
6418
6418
  if (!i) return;
6419
- const u = () => {
6419
+ const p = () => {
6420
6420
  s(Ec({ editor: i, type: o, hideWhenUnavailable: n }));
6421
6421
  };
6422
- return u(), i.on("selectionUpdate", u), () => {
6423
- i.off("selectionUpdate", u);
6422
+ return p(), i.on("selectionUpdate", p), () => {
6423
+ i.off("selectionUpdate", p);
6424
6424
  };
6425
6425
  }, [i, o, n]);
6426
6426
  const h = U(() => {
6427
6427
  if (!i) return !1;
6428
- const u = Nc(i, o);
6429
- return u && (r == null || r()), u;
6428
+ const p = Nc(i, o);
6429
+ return p && (r == null || r()), p;
6430
6430
  }, [i, o, r]);
6431
6431
  return {
6432
6432
  isVisible: l,
6433
- isActive: p,
6433
+ isActive: u,
6434
6434
  handleToggle: h,
6435
6435
  canToggle: c,
6436
6436
  label: Mc[o],
@@ -6455,8 +6455,8 @@ const Lr = ee(
6455
6455
  onClick: l,
6456
6456
  children: s,
6457
6457
  ...c
6458
- }, p) => {
6459
- const { editor: h } = me(e), { isVisible: u, canToggle: f, isActive: g, handleToggle: d, label: m, shortcutKeys: b, Icon: v } = Ac({
6458
+ }, u) => {
6459
+ const { editor: h } = me(e), { isVisible: p, canToggle: f, isActive: g, handleToggle: d, label: m, shortcutKeys: b, Icon: v } = Ac({
6460
6460
  editor: h,
6461
6461
  type: t,
6462
6462
  hideWhenUnavailable: n,
@@ -6467,7 +6467,7 @@ const Lr = ee(
6467
6467
  },
6468
6468
  [d, l]
6469
6469
  );
6470
- return u ? /* @__PURE__ */ a(
6470
+ return p ? /* @__PURE__ */ a(
6471
6471
  G,
6472
6472
  {
6473
6473
  type: "button",
@@ -6482,7 +6482,7 @@ const Lr = ee(
6482
6482
  tooltip: m,
6483
6483
  onClick: y,
6484
6484
  ...c,
6485
- ref: p,
6485
+ ref: u,
6486
6486
  children: s ?? /* @__PURE__ */ L(ve, { children: [
6487
6487
  /* @__PURE__ */ a(v, { className: "tiptap-button-icon" }),
6488
6488
  o && /* @__PURE__ */ a("span", { className: "tiptap-button-text", children: o }),
@@ -6532,7 +6532,7 @@ function Oc(e) {
6532
6532
  editor: t,
6533
6533
  types: o = ["bulletList", "orderedList", "taskList"],
6534
6534
  hideWhenUnavailable: n = !1
6535
- } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = o.some((d) => Ue(d, i)), p = te(() => $c(o).map((m) => {
6535
+ } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = o.some((d) => Ue(d, i)), u = te(() => $c(o).map((m) => {
6536
6536
  let b = "";
6537
6537
  switch (m.type) {
6538
6538
  case "bulletList":
@@ -6549,7 +6549,7 @@ function Oc(e) {
6549
6549
  ...m,
6550
6550
  label: r(`toolbar.list.${b}`)
6551
6551
  };
6552
- }), [o, r]), h = Bc(i, o), u = Dc(i, o), f = Pc(i, o), g = p.find((d) => d.type === f);
6552
+ }), [o, r]), h = Bc(i, o), p = Dc(i, o), f = Pc(i, o), g = u.find((d) => d.type === f);
6553
6553
  return D(() => {
6554
6554
  if (!i) return;
6555
6555
  const d = () => {
@@ -6568,10 +6568,10 @@ function Oc(e) {
6568
6568
  }, [h, i, n, c, o]), {
6569
6569
  isVisible: l,
6570
6570
  activeType: f,
6571
- isActive: u,
6571
+ isActive: p,
6572
6572
  canToggle: h,
6573
6573
  types: o,
6574
- filteredLists: p,
6574
+ filteredLists: u,
6575
6575
  label: r("toolbar.list.label"),
6576
6576
  Icon: g ? zr[g.type] : to
6577
6577
  };
@@ -6584,13 +6584,13 @@ function Fc({
6584
6584
  portal: r = !1,
6585
6585
  ...i
6586
6586
  }) {
6587
- const { t: l } = he("simpleEditor"), { editor: s } = me(e), [c, p] = N(!1), { filteredLists: h, canToggle: u, isActive: f, isVisible: g, Icon: d } = Oc({
6587
+ const { t: l } = he("simpleEditor"), { editor: s } = me(e), [c, u] = N(!1), { filteredLists: h, canToggle: p, isActive: f, isVisible: g, Icon: d } = Oc({
6588
6588
  editor: s,
6589
6589
  types: t,
6590
6590
  hideWhenUnavailable: o
6591
6591
  }), m = U(
6592
6592
  (b) => {
6593
- p(b), n == null || n(b);
6593
+ u(b), n == null || n(b);
6594
6594
  },
6595
6595
  [n]
6596
6596
  );
@@ -6603,8 +6603,8 @@ function Fc({
6603
6603
  "data-active-state": f ? "on" : "off",
6604
6604
  role: "button",
6605
6605
  tabIndex: -1,
6606
- disabled: !u,
6607
- "data-disabled": !u,
6606
+ disabled: !p,
6607
+ "data-disabled": !p,
6608
6608
  "aria-label": l("toolbar.list.label"),
6609
6609
  tooltip: l("toolbar.list.label"),
6610
6610
  ...i,
@@ -6646,7 +6646,7 @@ function _c(e) {
6646
6646
  const s = i.selection;
6647
6647
  let c = e.chain().focus();
6648
6648
  if (s instanceof Oe) {
6649
- const h = (o = s.node.firstChild) == null ? void 0 : o.firstChild, u = (n = s.node.lastChild) == null ? void 0 : n.lastChild, f = h ? s.from + h.nodeSize : s.from + 1, g = u ? s.to - u.nodeSize : s.to - 1, d = i.doc.resolve(f), m = i.doc.resolve(g);
6649
+ const h = (o = s.node.firstChild) == null ? void 0 : o.firstChild, p = (n = s.node.lastChild) == null ? void 0 : n.lastChild, f = h ? s.from + h.nodeSize : s.from + 1, g = p ? s.to - p.nodeSize : s.to - 1, d = i.doc.resolve(f), m = i.doc.resolve(g);
6650
6650
  c = c.setTextSelection(Te.between(d, m)).clearNodes();
6651
6651
  }
6652
6652
  return (e.isActive("blockquote") ? c.lift("blockquote") : c.wrapIn("blockquote")).run(), e.chain().focus().selectTextblockEnd().run(), !0;
@@ -6659,24 +6659,24 @@ function Hc(e) {
6659
6659
  return !t || !t.isEditable || !Ue("blockquote", t) ? !1 : o && !t.isActive("code") ? zo(t) : !0;
6660
6660
  }
6661
6661
  function Vc(e) {
6662
- const { editor: t, hideWhenUnavailable: o = !1, onToggled: n } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = zo(i), p = (i == null ? void 0 : i.isActive("blockquote")) || !1;
6662
+ const { editor: t, hideWhenUnavailable: o = !1, onToggled: n } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = zo(i), u = (i == null ? void 0 : i.isActive("blockquote")) || !1;
6663
6663
  D(() => {
6664
6664
  if (!i) return;
6665
- const u = () => {
6665
+ const p = () => {
6666
6666
  s(Hc({ editor: i, hideWhenUnavailable: o }));
6667
6667
  };
6668
- return u(), i.on("selectionUpdate", u), () => {
6669
- i.off("selectionUpdate", u);
6668
+ return p(), i.on("selectionUpdate", p), () => {
6669
+ i.off("selectionUpdate", p);
6670
6670
  };
6671
6671
  }, [i, o]);
6672
6672
  const h = U(() => {
6673
6673
  if (!i) return !1;
6674
- const u = _c(i);
6675
- return u && (n == null || n()), u;
6674
+ const p = _c(i);
6675
+ return p && (n == null || n()), p;
6676
6676
  }, [i, n]);
6677
6677
  return {
6678
6678
  isVisible: l,
6679
- isActive: p,
6679
+ isActive: u,
6680
6680
  handleToggle: h,
6681
6681
  canToggle: c,
6682
6682
  label: r("toolbar.blockquote"),
@@ -6698,7 +6698,7 @@ const Mr = ee(
6698
6698
  children: l,
6699
6699
  ...s
6700
6700
  }, c) => {
6701
- const { t: p } = he("simpleEditor"), { editor: h } = me(e), { isVisible: u, canToggle: f, isActive: g, handleToggle: d, label: m, shortcutKeys: b, Icon: v } = Vc({
6701
+ const { t: u } = he("simpleEditor"), { editor: h } = me(e), { isVisible: p, canToggle: f, isActive: g, handleToggle: d, label: m, shortcutKeys: b, Icon: v } = Vc({
6702
6702
  editor: h,
6703
6703
  hideWhenUnavailable: o,
6704
6704
  onToggled: n
@@ -6708,7 +6708,7 @@ const Mr = ee(
6708
6708
  },
6709
6709
  [d, i]
6710
6710
  );
6711
- return u ? /* @__PURE__ */ a(
6711
+ return p ? /* @__PURE__ */ a(
6712
6712
  G,
6713
6713
  {
6714
6714
  type: "button",
@@ -6720,7 +6720,7 @@ const Mr = ee(
6720
6720
  "data-disabled": !f,
6721
6721
  "aria-label": m,
6722
6722
  "aria-pressed": g,
6723
- tooltip: p("toolbar.blockquote"),
6723
+ tooltip: u("toolbar.blockquote"),
6724
6724
  onClick: y,
6725
6725
  ...s,
6726
6726
  ref: c,
@@ -6763,7 +6763,7 @@ function Wc(e) {
6763
6763
  const s = i.selection;
6764
6764
  let c = e.chain().focus();
6765
6765
  if (s instanceof Oe) {
6766
- const h = (o = s.node.firstChild) == null ? void 0 : o.firstChild, u = (n = s.node.lastChild) == null ? void 0 : n.lastChild, f = h ? s.from + h.nodeSize : s.from + 1, g = u ? s.to - u.nodeSize : s.to - 1, d = i.doc.resolve(f), m = i.doc.resolve(g);
6766
+ const h = (o = s.node.firstChild) == null ? void 0 : o.firstChild, p = (n = s.node.lastChild) == null ? void 0 : n.lastChild, f = h ? s.from + h.nodeSize : s.from + 1, g = p ? s.to - p.nodeSize : s.to - 1, d = i.doc.resolve(f), m = i.doc.resolve(g);
6767
6767
  c = c.setTextSelection(Te.between(d, m)).clearNodes();
6768
6768
  }
6769
6769
  return (e.isActive("codeBlock") ? c.setNode("paragraph") : c.toggleNode("codeBlock", "paragraph")).run(), e.chain().focus().selectTextblockEnd().run(), !0;
@@ -6776,24 +6776,24 @@ function Gc(e) {
6776
6776
  return !t || !t.isEditable || !Ue("codeBlock", t) ? !1 : o && !t.isActive("code") ? So(t) : !0;
6777
6777
  }
6778
6778
  function qc(e) {
6779
- const { editor: t, hideWhenUnavailable: o = !1, onToggled: n } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = So(i), p = (i == null ? void 0 : i.isActive("codeBlock")) || !1;
6779
+ const { editor: t, hideWhenUnavailable: o = !1, onToggled: n } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), [l, s] = N(!0), c = So(i), u = (i == null ? void 0 : i.isActive("codeBlock")) || !1;
6780
6780
  D(() => {
6781
6781
  if (!i) return;
6782
- const u = () => {
6782
+ const p = () => {
6783
6783
  s(Gc({ editor: i, hideWhenUnavailable: o }));
6784
6784
  };
6785
- return u(), i.on("selectionUpdate", u), () => {
6786
- i.off("selectionUpdate", u);
6785
+ return p(), i.on("selectionUpdate", p), () => {
6786
+ i.off("selectionUpdate", p);
6787
6787
  };
6788
6788
  }, [i, o]);
6789
6789
  const h = U(() => {
6790
6790
  if (!i) return !1;
6791
- const u = Wc(i);
6792
- return u && (n == null || n()), u;
6791
+ const p = Wc(i);
6792
+ return p && (n == null || n()), p;
6793
6793
  }, [i, n]);
6794
6794
  return {
6795
6795
  isVisible: l,
6796
- isActive: p,
6796
+ isActive: u,
6797
6797
  handleToggle: h,
6798
6798
  canToggle: c,
6799
6799
  label: r("toolbar.codeBlock"),
@@ -6815,7 +6815,7 @@ const Er = ee(
6815
6815
  children: l,
6816
6816
  ...s
6817
6817
  }, c) => {
6818
- const { t: p } = he("simpleEditor"), { editor: h } = me(e), { isVisible: u, canToggle: f, isActive: g, handleToggle: d, label: m, shortcutKeys: b, Icon: v } = qc({
6818
+ const { t: u } = he("simpleEditor"), { editor: h } = me(e), { isVisible: p, canToggle: f, isActive: g, handleToggle: d, label: m, shortcutKeys: b, Icon: v } = qc({
6819
6819
  editor: h,
6820
6820
  hideWhenUnavailable: o,
6821
6821
  onToggled: n
@@ -6825,7 +6825,7 @@ const Er = ee(
6825
6825
  },
6826
6826
  [d, i]
6827
6827
  );
6828
- return u ? /* @__PURE__ */ a(
6828
+ return p ? /* @__PURE__ */ a(
6829
6829
  G,
6830
6830
  {
6831
6831
  type: "button",
@@ -6837,7 +6837,7 @@ const Er = ee(
6837
6837
  tabIndex: -1,
6838
6838
  "aria-label": m,
6839
6839
  "aria-pressed": g,
6840
- tooltip: p("toolbar.codeBlock"),
6840
+ tooltip: u("toolbar.codeBlock"),
6841
6841
  onClick: y,
6842
6842
  ...s,
6843
6843
  ref: c,
@@ -6912,23 +6912,23 @@ const Tr = ee(
6912
6912
  className: i,
6913
6913
  ...l
6914
6914
  }, s) => {
6915
- const { editor: c } = me(e), { t: p } = he("simpleEditor"), { isVisible: h, canInsert: u, label: f } = Zc({ editor: c, hideWhenUnavailable: t }), [g, d] = N(!1), [m, b] = N(0), [v, y] = N(0), k = U(() => {
6915
+ const { editor: c } = me(e), { t: u } = he("simpleEditor"), { isVisible: h, canInsert: p, label: f } = Zc({ editor: c, hideWhenUnavailable: t }), [g, d] = N(!1), [m, b] = N(0), [v, y] = N(0), k = U(() => {
6916
6916
  b(0), y(0);
6917
6917
  }, []), S = U(
6918
6918
  (I, M) => {
6919
- if (!c || !u) return;
6919
+ if (!c || !p) return;
6920
6920
  c.chain().focus().insertTable({ rows: I, cols: M, withHeaderRow: !0 }).run() && (r == null || r(I, M)), d(!1), k();
6921
6921
  },
6922
- [u, c, r, k]
6922
+ [p, c, r, k]
6923
6923
  ), x = U(
6924
6924
  (I) => {
6925
- !c || !u || (d(I), I || k());
6925
+ !c || !p || (d(I), I || k());
6926
6926
  },
6927
- [u, c, k]
6927
+ [p, c, k]
6928
6928
  );
6929
6929
  if (!h)
6930
6930
  return null;
6931
- const w = v > 0 && m > 0 ? p("toolbar.table.size", { cols: v, rows: m }) : f, z = { "--tt-table-trigger-grid-cols": n };
6931
+ const w = v > 0 && m > 0 ? u("toolbar.table.size", { cols: v, rows: m }) : f, z = { "--tt-table-trigger-grid-cols": n };
6932
6932
  return /* @__PURE__ */ L(xt, { open: g, onOpenChange: x, children: [
6933
6933
  /* @__PURE__ */ a(kt, { asChild: !0, children: /* @__PURE__ */ a(
6934
6934
  G,
@@ -6938,8 +6938,8 @@ const Tr = ee(
6938
6938
  "data-active-state": c != null && c.isActive("table") ? "on" : "off",
6939
6939
  role: "button",
6940
6940
  tabIndex: -1,
6941
- disabled: !u,
6942
- "data-disabled": !u,
6941
+ disabled: !p,
6942
+ "data-disabled": !p,
6943
6943
  "aria-label": f,
6944
6944
  "aria-pressed": c == null ? void 0 : c.isActive("table"),
6945
6945
  tooltip: f,
@@ -7210,7 +7210,7 @@ function Io(e) {
7210
7210
  hideWhenUnavailable: r = !1,
7211
7211
  mode: i = "mark",
7212
7212
  onApplied: l
7213
- } = e, { editor: s } = me(t), c = dt(), [p, h] = N(!0), u = Lo(s, i), f = ed(s, n, i);
7213
+ } = e, { editor: s } = me(t), c = dt(), [u, h] = N(!0), p = Lo(s, i), f = ed(s, n, i);
7214
7214
  D(() => {
7215
7215
  if (!s) return;
7216
7216
  const m = () => {
@@ -7221,7 +7221,7 @@ function Io(e) {
7221
7221
  };
7222
7222
  }, [s, r, i]);
7223
7223
  const g = U(() => {
7224
- if (!s || !u || !n || !o) return !1;
7224
+ if (!s || !p || !n || !o) return !1;
7225
7225
  if (i === "mark") {
7226
7226
  if (s.state.storedMarks) {
7227
7227
  const m = s.schema.marks.highlight;
@@ -7235,7 +7235,7 @@ function Io(e) {
7235
7235
  const m = s.chain().focus().toggleNodeBackgroundColor(n).run();
7236
7236
  return m && (l == null || l({ color: n, label: o, mode: i })), m;
7237
7237
  }
7238
- }, [u, n, s, o, l, i]), d = U(() => {
7238
+ }, [p, n, s, o, l, i]), d = U(() => {
7239
7239
  const m = td(s, i);
7240
7240
  return m && (l == null || l({ color: "", label: "Remove highlight", mode: i })), m;
7241
7241
  }, [s, l, i]);
@@ -7245,16 +7245,16 @@ function Io(e) {
7245
7245
  m.preventDefault(), g();
7246
7246
  },
7247
7247
  {
7248
- enabled: p && u,
7248
+ enabled: u && p,
7249
7249
  enableOnContentEditable: !c,
7250
7250
  enableOnFormTags: !0
7251
7251
  }
7252
7252
  ), {
7253
- isVisible: p,
7253
+ isVisible: u,
7254
7254
  isActive: f,
7255
7255
  handleColorHighlight: g,
7256
7256
  handleRemoveHighlight: d,
7257
- canColorHighlight: u,
7257
+ canColorHighlight: p,
7258
7258
  label: o || "Highlight",
7259
7259
  shortcutKeys: Jt,
7260
7260
  Icon: oo,
@@ -7277,9 +7277,9 @@ const Br = ee(
7277
7277
  showShortcut: l = !1,
7278
7278
  onClick: s,
7279
7279
  children: c,
7280
- style: p,
7280
+ style: u,
7281
7281
  ...h
7282
- }, u) => {
7282
+ }, p) => {
7283
7283
  const { t: f } = he("simpleEditor"), { editor: g } = me(e), { isVisible: d, canColorHighlight: m, isActive: b, handleColorHighlight: v, label: y, shortcutKeys: k } = Io({
7284
7284
  editor: g,
7285
7285
  highlightColor: t,
@@ -7294,10 +7294,10 @@ const Br = ee(
7294
7294
  [v, s]
7295
7295
  ), x = te(
7296
7296
  () => ({
7297
- ...p,
7297
+ ...u,
7298
7298
  "--highlight-color": t
7299
7299
  }),
7300
- [t, p]
7300
+ [t, u]
7301
7301
  );
7302
7302
  return d ? /* @__PURE__ */ a(
7303
7303
  G,
@@ -7315,7 +7315,7 @@ const Br = ee(
7315
7315
  onClick: S,
7316
7316
  style: x,
7317
7317
  ...h,
7318
- ref: u,
7318
+ ref: p,
7319
7319
  children: c ?? /* @__PURE__ */ L(ve, { children: [
7320
7320
  /* @__PURE__ */ a(
7321
7321
  "span",
@@ -7370,21 +7370,21 @@ function Dr({
7370
7370
  orientation: "both",
7371
7371
  onSelect: (c) => {
7372
7372
  if (!i.current) return !1;
7373
- const p = i.current.querySelector('[data-highlighted="true"]');
7374
- return p && p.click(), c.value === "none" && n(), !0;
7373
+ const u = i.current.querySelector('[data-highlighted="true"]');
7374
+ return u && u.click(), c.value === "none" && n(), !0;
7375
7375
  },
7376
7376
  autoSelectFirstItem: !1
7377
7377
  });
7378
7378
  return /* @__PURE__ */ a(nt, { ref: i, tabIndex: 0, style: r ? { boxShadow: "none", border: 0 } : {}, children: /* @__PURE__ */ a(rt, { style: r ? { padding: 0 } : {}, children: /* @__PURE__ */ L(Ft, { orientation: "horizontal", children: [
7379
- /* @__PURE__ */ a(Ae, { orientation: "horizontal", children: t.map((c, p) => /* @__PURE__ */ a(
7379
+ /* @__PURE__ */ a(Ae, { orientation: "horizontal", children: t.map((c, u) => /* @__PURE__ */ a(
7380
7380
  Br,
7381
7381
  {
7382
7382
  editor: e,
7383
7383
  highlightColor: c.value,
7384
7384
  tooltip: o(`toolbar.highlight.colors.${c.label}`),
7385
7385
  "aria-label": o(`toolbar.highlight.colors.${c.label}`),
7386
- tabIndex: p === s ? 0 : -1,
7387
- "data-highlighted": s === p
7386
+ tabIndex: u === s ? 0 : -1,
7387
+ "data-highlighted": s === u
7388
7388
  },
7389
7389
  c.value
7390
7390
  )) }),
@@ -7418,19 +7418,19 @@ function rd({
7418
7418
  onApplied: n,
7419
7419
  ...r
7420
7420
  }) {
7421
- const { t: i } = he("simpleEditor"), l = i("toolbar.highlight.label"), { editor: s } = me(e), [c, p] = N(!1), { isVisible: h, canColorHighlight: u, isActive: f, Icon: g } = Io({
7421
+ const { t: i } = he("simpleEditor"), l = i("toolbar.highlight.label"), { editor: s } = me(e), [c, u] = N(!1), { isVisible: h, canColorHighlight: p, isActive: f, Icon: g } = Io({
7422
7422
  editor: s,
7423
7423
  hideWhenUnavailable: o,
7424
7424
  onApplied: n,
7425
7425
  label: l
7426
7426
  });
7427
- return h ? /* @__PURE__ */ L(xt, { open: c, onOpenChange: p, children: [
7427
+ return h ? /* @__PURE__ */ L(xt, { open: c, onOpenChange: u, children: [
7428
7428
  /* @__PURE__ */ a(kt, { asChild: !0, children: /* @__PURE__ */ a(
7429
7429
  Mo,
7430
7430
  {
7431
- disabled: !u,
7431
+ disabled: !p,
7432
7432
  "data-active-state": f ? "on" : "off",
7433
- "data-disabled": !u,
7433
+ "data-disabled": !p,
7434
7434
  "aria-pressed": f,
7435
7435
  "aria-label": l,
7436
7436
  tooltip: l,
@@ -7513,7 +7513,7 @@ function sd(e) {
7513
7513
  }
7514
7514
  function Eo(e) {
7515
7515
  var d;
7516
- const { editor: t, label: o, color: n, hideWhenUnavailable: r = !1, onApplied: i } = e, { editor: l } = me(t), [s, c] = N(!0), p = te(() => No(l), [l]), h = te(() => ad(l, n), [l, n]);
7516
+ const { editor: t, label: o, color: n, hideWhenUnavailable: r = !1, onApplied: i } = e, { editor: l } = me(t), [s, c] = N(!0), u = te(() => No(l), [l]), h = te(() => ad(l, n), [l, n]);
7517
7517
  D(() => {
7518
7518
  if (!l) return;
7519
7519
  const m = () => {
@@ -7523,19 +7523,19 @@ function Eo(e) {
7523
7523
  l.off("selectionUpdate", m);
7524
7524
  };
7525
7525
  }, [l, r]);
7526
- const u = U(() => {
7527
- if (!l || !p || !n || !o) return !1;
7526
+ const p = U(() => {
7527
+ if (!l || !u || !n || !o) return !1;
7528
7528
  const m = l.chain().focus().setColor(n).run();
7529
7529
  return m && (i == null || i({ color: n, label: o })), m;
7530
- }, [l, p, n, o, i]), f = U(() => {
7530
+ }, [l, u, n, o, i]), f = U(() => {
7531
7531
  const m = ld(l);
7532
7532
  return m && (i == null || i({ color: "", label: "Remove text color" })), m;
7533
7533
  }, [l, i]), g = (d = l == null ? void 0 : l.getAttributes("textStyle")) == null ? void 0 : d.color;
7534
7534
  return {
7535
7535
  isVisible: s,
7536
7536
  isActive: h,
7537
- canSetTextColor: p,
7538
- handleSetTextColor: u,
7537
+ canSetTextColor: u,
7538
+ handleSetTextColor: p,
7539
7539
  handleRemoveTextColor: f,
7540
7540
  label: o || "Text color",
7541
7541
  Icon: no,
@@ -7543,9 +7543,9 @@ function Eo(e) {
7543
7543
  };
7544
7544
  }
7545
7545
  const Ur = ee(
7546
- ({ editor: e, color: t, text: o, hideWhenUnavailable: n = !1, onApplied: r, onClick: i, children: l, style: s, ...c }, p) => {
7547
- const { t: h } = he("simpleEditor"), { editor: u } = me(e), { isVisible: f, canSetTextColor: g, isActive: d, handleSetTextColor: m, label: b } = Eo({
7548
- editor: u,
7546
+ ({ editor: e, color: t, text: o, hideWhenUnavailable: n = !1, onApplied: r, onClick: i, children: l, style: s, ...c }, u) => {
7547
+ const { t: h } = he("simpleEditor"), { editor: p } = me(e), { isVisible: f, canSetTextColor: g, isActive: d, handleSetTextColor: m, label: b } = Eo({
7548
+ editor: p,
7549
7549
  color: t,
7550
7550
  label: o || h("toolbar.textColor.toggle", { color: t }),
7551
7551
  hideWhenUnavailable: n,
@@ -7578,7 +7578,7 @@ const Ur = ee(
7578
7578
  onClick: v,
7579
7579
  style: y,
7580
7580
  ...c,
7581
- ref: p,
7581
+ ref: u,
7582
7582
  children: l ?? /* @__PURE__ */ L(ve, { children: [
7583
7583
  /* @__PURE__ */ a("span", { className: "tiptap-button-text-color-swatch", style: { "--text-color": t }, children: "A" }),
7584
7584
  o && /* @__PURE__ */ a("span", { className: "tiptap-button-text", children: o })
@@ -7626,21 +7626,21 @@ function Pr({
7626
7626
  orientation: "both",
7627
7627
  onSelect: (c) => {
7628
7628
  if (!i.current) return !1;
7629
- const p = i.current.querySelector('[data-highlighted="true"]');
7630
- return p && p.click(), c.value === "none" && n(), !0;
7629
+ const u = i.current.querySelector('[data-highlighted="true"]');
7630
+ return u && u.click(), c.value === "none" && n(), !0;
7631
7631
  },
7632
7632
  autoSelectFirstItem: !1
7633
7633
  });
7634
7634
  return /* @__PURE__ */ a(nt, { ref: i, tabIndex: 0, style: r ? { boxShadow: "none", border: 0 } : {}, children: /* @__PURE__ */ a(rt, { style: r ? { padding: 0 } : {}, children: /* @__PURE__ */ L(Ft, { orientation: "horizontal", children: [
7635
- /* @__PURE__ */ a(Ae, { orientation: "horizontal", children: t.map((c, p) => /* @__PURE__ */ a(
7635
+ /* @__PURE__ */ a(Ae, { orientation: "horizontal", children: t.map((c, u) => /* @__PURE__ */ a(
7636
7636
  Ur,
7637
7637
  {
7638
7638
  editor: e,
7639
7639
  color: c.value,
7640
7640
  tooltip: o(`toolbar.textColor.colors.${c.label}`),
7641
7641
  "aria-label": o(`toolbar.textColor.colors.${c.label}`),
7642
- tabIndex: p === s ? 0 : -1,
7643
- "data-highlighted": s === p
7642
+ tabIndex: u === s ? 0 : -1,
7643
+ "data-highlighted": s === u
7644
7644
  },
7645
7645
  c.value
7646
7646
  )) }),
@@ -7674,19 +7674,19 @@ function cd({
7674
7674
  onApplied: n,
7675
7675
  ...r
7676
7676
  }) {
7677
- const { t: i } = he("simpleEditor"), l = i("toolbar.textColor.label"), { editor: s } = me(e), [c, p] = N(!1), { isVisible: h, canSetTextColor: u, isActive: f, Icon: g } = Eo({
7677
+ const { t: i } = he("simpleEditor"), l = i("toolbar.textColor.label"), { editor: s } = me(e), [c, u] = N(!1), { isVisible: h, canSetTextColor: p, isActive: f, Icon: g } = Eo({
7678
7678
  editor: s,
7679
7679
  hideWhenUnavailable: o,
7680
7680
  onApplied: n,
7681
7681
  label: l
7682
7682
  });
7683
- return h ? /* @__PURE__ */ L(xt, { open: c, onOpenChange: p, children: [
7683
+ return h ? /* @__PURE__ */ L(xt, { open: c, onOpenChange: u, children: [
7684
7684
  /* @__PURE__ */ a(kt, { asChild: !0, children: /* @__PURE__ */ a(
7685
7685
  Ao,
7686
7686
  {
7687
- disabled: !u,
7687
+ disabled: !p,
7688
7688
  "data-active-state": f ? "on" : "off",
7689
- "data-disabled": !u,
7689
+ "data-disabled": !p,
7690
7690
  "aria-pressed": f,
7691
7691
  "aria-label": l,
7692
7692
  tooltip: l,
@@ -7716,8 +7716,8 @@ function ud(e) {
7716
7716
  }, [t, n]), D(() => {
7717
7717
  if (!t) return;
7718
7718
  const c = () => {
7719
- const { href: p } = t.getAttributes("link");
7720
- r(p || "");
7719
+ const { href: u } = t.getAttributes("link");
7720
+ r(u || "");
7721
7721
  };
7722
7722
  return t.on("selectionUpdate", c), () => {
7723
7723
  t.off("selectionUpdate", c);
@@ -7725,16 +7725,16 @@ function ud(e) {
7725
7725
  }, [t]);
7726
7726
  const i = U(() => {
7727
7727
  if (!n || !t) return;
7728
- const { selection: c } = t.state, p = c.empty;
7728
+ const { selection: c } = t.state, u = c.empty;
7729
7729
  let h = t.chain().focus();
7730
- h = h.extendMarkRange("link").setLink({ href: n }), p && (h = h.insertContent({ type: "text", text: n })), h.run(), r(null), o == null || o();
7730
+ h = h.extendMarkRange("link").setLink({ href: n }), u && (h = h.insertContent({ type: "text", text: n })), h.run(), r(null), o == null || o();
7731
7731
  }, [t, o, n]), l = U(() => {
7732
7732
  t && (t.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink", !0).run(), r(""));
7733
7733
  }, [t]), s = U(
7734
- (c = "_blank", p = "noopener,noreferrer") => {
7734
+ (c = "_blank", u = "noopener,noreferrer") => {
7735
7735
  if (!n) return;
7736
7736
  const h = dc(n, window.location.href);
7737
- h !== "#" && window.open(h, c, p);
7737
+ h !== "#" && window.open(h, c, u);
7738
7738
  },
7739
7739
  [n]
7740
7740
  );
@@ -7771,7 +7771,7 @@ function _r(e) {
7771
7771
  const { editor: t, hideWhenUnavailable: o = !1, onSetLink: n } = e || {}, { t: r } = he("simpleEditor"), { editor: i } = me(t), { isVisible: l, canSet: s, isActive: c } = pd({
7772
7772
  editor: i,
7773
7773
  hideWhenUnavailable: o
7774
- }), p = ud({
7774
+ }), u = ud({
7775
7775
  editor: i,
7776
7776
  onSetLink: n
7777
7777
  });
@@ -7781,7 +7781,7 @@ function _r(e) {
7781
7781
  isActive: c,
7782
7782
  label: r("toolbar.link.label"),
7783
7783
  Icon: ro,
7784
- ...p
7784
+ ...u
7785
7785
  };
7786
7786
  }
7787
7787
  function hd({ className: e, type: t, ...o }) {
@@ -7814,8 +7814,8 @@ const To = ee(({ className: e, children: t, ...o }, n) => {
7814
7814
  });
7815
7815
  To.displayName = "LinkButton";
7816
7816
  const Hr = ({ url: e, setUrl: t, setLink: o, removeLink: n, openLink: r, isActive: i }) => {
7817
- const { t: l } = he("simpleEditor"), s = dt(), c = (p) => {
7818
- p.key === "Enter" && (p.preventDefault(), o());
7817
+ const { t: l } = he("simpleEditor"), s = dt(), c = (u) => {
7818
+ u.key === "Enter" && (u.preventDefault(), o());
7819
7819
  };
7820
7820
  return /* @__PURE__ */ a(
7821
7821
  nt,
@@ -7836,7 +7836,7 @@ const Hr = ({ url: e, setUrl: t, setLink: o, removeLink: n, openLink: r, isActiv
7836
7836
  type: "url",
7837
7837
  placeholder: l("toolbar.link.placeholder"),
7838
7838
  value: e,
7839
- onChange: (p) => t(p.target.value),
7839
+ onChange: (u) => t(u.target.value),
7840
7840
  onKeyDown: c,
7841
7841
  autoFocus: !0,
7842
7842
  autoComplete: "off",
@@ -7901,25 +7901,25 @@ const Hr = ({ url: e, setUrl: t, setLink: o, removeLink: n, openLink: r, isActiv
7901
7901
  children: l,
7902
7902
  ...s
7903
7903
  }, c) => {
7904
- const { editor: p } = me(e), [h, u] = N(!1), { isVisible: f, canSet: g, isActive: d, url: m, setUrl: b, setLink: v, removeLink: y, openLink: k, label: S, Icon: x } = _r({
7905
- editor: p,
7904
+ const { editor: u } = me(e), [h, p] = N(!1), { isVisible: f, canSet: g, isActive: d, url: m, setUrl: b, setLink: v, removeLink: y, openLink: k, label: S, Icon: x } = _r({
7905
+ editor: u,
7906
7906
  hideWhenUnavailable: t,
7907
7907
  onSetLink: o
7908
7908
  }), w = U(
7909
7909
  (M) => {
7910
- u(M), n == null || n(M);
7910
+ p(M), n == null || n(M);
7911
7911
  },
7912
7912
  [n]
7913
7913
  ), z = U(() => {
7914
- v(), u(!1);
7914
+ v(), p(!1);
7915
7915
  }, [v]), I = U(
7916
7916
  (M) => {
7917
- i == null || i(M), !M.defaultPrevented && u(!h);
7917
+ i == null || i(M), !M.defaultPrevented && p(!h);
7918
7918
  },
7919
7919
  [i, h]
7920
7920
  );
7921
7921
  return D(() => {
7922
- r && d && u(!0);
7922
+ r && d && p(!0);
7923
7923
  }, [r, d]), f ? /* @__PURE__ */ L(xt, { open: h, onOpenChange: w, children: [
7924
7924
  /* @__PURE__ */ a(kt, { asChild: !0, children: /* @__PURE__ */ a(
7925
7925
  To,
@@ -7981,7 +7981,7 @@ function vd(e) {
7981
7981
  return !t || !t.isEditable || !Xe(o, t) ? !1 : n && !t.isActive("code") ? Ro(t, o) : !0;
7982
7982
  }
7983
7983
  function xd(e) {
7984
- const { editor: t, type: o, hideWhenUnavailable: n = !1, onToggled: r } = e, { t: i } = he("simpleEditor"), { editor: l } = me(t), [s, c] = N(!0), p = Ro(l, o), h = bd(l, o);
7984
+ const { editor: t, type: o, hideWhenUnavailable: n = !1, onToggled: r } = e, { t: i } = he("simpleEditor"), { editor: l } = me(t), [s, c] = N(!0), u = Ro(l, o), h = bd(l, o);
7985
7985
  D(() => {
7986
7986
  if (!l) return;
7987
7987
  const f = () => {
@@ -7991,7 +7991,7 @@ function xd(e) {
7991
7991
  l.off("selectionUpdate", f);
7992
7992
  };
7993
7993
  }, [l, o, n]);
7994
- const u = U(() => {
7994
+ const p = U(() => {
7995
7995
  if (!l) return !1;
7996
7996
  const f = yd(l, o);
7997
7997
  return f && (r == null || r()), f;
@@ -7999,8 +7999,8 @@ function xd(e) {
7999
7999
  return {
8000
8000
  isVisible: s,
8001
8001
  isActive: h,
8002
- handleMark: u,
8003
- canToggle: p,
8002
+ handleMark: p,
8003
+ canToggle: u,
8004
8004
  label: i(`toolbar.marks.${o}`),
8005
8005
  shortcutKeys: jr[o],
8006
8006
  Icon: md[o]
@@ -8023,8 +8023,8 @@ const qe = ee(
8023
8023
  onClick: l,
8024
8024
  children: s,
8025
8025
  ...c
8026
- }, p) => {
8027
- const { editor: h } = me(e), { isVisible: u, handleMark: f, label: g, canToggle: d, isActive: m, Icon: b, shortcutKeys: v } = xd({
8026
+ }, u) => {
8027
+ const { editor: h } = me(e), { isVisible: p, handleMark: f, label: g, canToggle: d, isActive: m, Icon: b, shortcutKeys: v } = xd({
8028
8028
  editor: h,
8029
8029
  type: t,
8030
8030
  hideWhenUnavailable: n,
@@ -8035,7 +8035,7 @@ const qe = ee(
8035
8035
  },
8036
8036
  [f, l]
8037
8037
  );
8038
- return u ? /* @__PURE__ */ a(
8038
+ return p ? /* @__PURE__ */ a(
8039
8039
  G,
8040
8040
  {
8041
8041
  type: "button",
@@ -8050,7 +8050,7 @@ const qe = ee(
8050
8050
  tooltip: g,
8051
8051
  onClick: y,
8052
8052
  ...c,
8053
- ref: p,
8053
+ ref: u,
8054
8054
  children: s ?? /* @__PURE__ */ L(ve, { children: [
8055
8055
  /* @__PURE__ */ a(b, { className: "tiptap-button-icon" }),
8056
8056
  o && /* @__PURE__ */ a("span", { className: "tiptap-button-text", children: o }),
@@ -8091,7 +8091,7 @@ function Ld(e) {
8091
8091
  return !t || !t.isEditable || !Ze(t, "textAlign") ? !1 : o && !t.isActive("code") ? Bo(t, n) : !0;
8092
8092
  }
8093
8093
  function Id(e) {
8094
- const { editor: t, align: o, hideWhenUnavailable: n = !1, onAligned: r } = e, { t: i } = he("simpleEditor"), { editor: l } = me(t), [s, c] = N(!0), p = Bo(l, o), h = zd(l, o);
8094
+ const { editor: t, align: o, hideWhenUnavailable: n = !1, onAligned: r } = e, { t: i } = he("simpleEditor"), { editor: l } = me(t), [s, c] = N(!0), u = Bo(l, o), h = zd(l, o);
8095
8095
  D(() => {
8096
8096
  if (!l) return;
8097
8097
  const f = () => {
@@ -8101,7 +8101,7 @@ function Id(e) {
8101
8101
  l.off("selectionUpdate", f);
8102
8102
  };
8103
8103
  }, [l, n, o]);
8104
- const u = U(() => {
8104
+ const p = U(() => {
8105
8105
  if (!l) return !1;
8106
8106
  const f = Sd(l, o);
8107
8107
  return f && (r == null || r()), f;
@@ -8109,8 +8109,8 @@ function Id(e) {
8109
8109
  return {
8110
8110
  isVisible: s,
8111
8111
  isActive: h,
8112
- handleTextAlign: u,
8113
- canAlign: p,
8112
+ handleTextAlign: p,
8113
+ canAlign: u,
8114
8114
  label: i(`toolbar.align.${o}`),
8115
8115
  shortcutKeys: Wr[o],
8116
8116
  Icon: wd[o]
@@ -8133,10 +8133,10 @@ const ft = ee(
8133
8133
  onClick: l,
8134
8134
  icon: s,
8135
8135
  children: c,
8136
- ...p
8136
+ ...u
8137
8137
  }, h) => {
8138
- const { editor: u } = me(e), { isVisible: f, handleTextAlign: g, label: d, canAlign: m, isActive: b, Icon: v, shortcutKeys: y } = Id({
8139
- editor: u,
8138
+ const { editor: p } = me(e), { isVisible: f, handleTextAlign: g, label: d, canAlign: m, isActive: b, Icon: v, shortcutKeys: y } = Id({
8139
+ editor: p,
8140
8140
  align: t,
8141
8141
  hideWhenUnavailable: n,
8142
8142
  onAligned: r
@@ -8160,7 +8160,7 @@ const ft = ee(
8160
8160
  "aria-pressed": b,
8161
8161
  tooltip: d,
8162
8162
  onClick: k,
8163
- ...p,
8163
+ ...u,
8164
8164
  ref: h,
8165
8165
  children: c ?? /* @__PURE__ */ L(ve, { children: [
8166
8166
  /* @__PURE__ */ a(s ?? v, { className: "tiptap-button-icon" }),
@@ -8192,25 +8192,25 @@ function Ad(e) {
8192
8192
  return !t || !t.isEditable ? !1 : o && !t.isActive("code") ? Do(t, n) : !0;
8193
8193
  }
8194
8194
  function Td(e) {
8195
- const { editor: t, action: o, hideWhenUnavailable: n = !1, onExecuted: r } = e, { t: i } = he("simpleEditor"), { editor: l } = me(t), [s, c] = N(!0), p = Do(l, o);
8195
+ const { editor: t, action: o, hideWhenUnavailable: n = !1, onExecuted: r } = e, { t: i } = he("simpleEditor"), { editor: l } = me(t), [s, c] = N(!0), u = Do(l, o);
8196
8196
  D(() => {
8197
8197
  if (!l) return;
8198
- const u = () => {
8198
+ const p = () => {
8199
8199
  c(Ad({ editor: l, hideWhenUnavailable: n, action: o }));
8200
8200
  };
8201
- return u(), l.on("transaction", u), () => {
8202
- l.off("transaction", u);
8201
+ return p(), l.on("transaction", p), () => {
8202
+ l.off("transaction", p);
8203
8203
  };
8204
8204
  }, [l, n, o]);
8205
8205
  const h = U(() => {
8206
8206
  if (!l) return !1;
8207
- const u = Ed(l, o);
8208
- return u && (r == null || r()), u;
8207
+ const p = Ed(l, o);
8208
+ return p && (r == null || r()), p;
8209
8209
  }, [l, o, r]);
8210
8210
  return {
8211
8211
  isVisible: s,
8212
8212
  handleAction: h,
8213
- canExecute: p,
8213
+ canExecute: u,
8214
8214
  label: i(`toolbar.${o}`),
8215
8215
  shortcutKeys: Gr[o],
8216
8216
  Icon: Nd[o]
@@ -8233,8 +8233,8 @@ const Qt = ee(
8233
8233
  onClick: l,
8234
8234
  children: s,
8235
8235
  ...c
8236
- }, p) => {
8237
- const { editor: h } = me(e), { isVisible: u, handleAction: f, label: g, canExecute: d, Icon: m, shortcutKeys: b } = Td({
8236
+ }, u) => {
8237
+ const { editor: h } = me(e), { isVisible: p, handleAction: f, label: g, canExecute: d, Icon: m, shortcutKeys: b } = Td({
8238
8238
  editor: h,
8239
8239
  action: t,
8240
8240
  hideWhenUnavailable: n,
@@ -8245,7 +8245,7 @@ const Qt = ee(
8245
8245
  },
8246
8246
  [f, l]
8247
8247
  );
8248
- return u ? /* @__PURE__ */ a(
8248
+ return p ? /* @__PURE__ */ a(
8249
8249
  G,
8250
8250
  {
8251
8251
  type: "button",
@@ -8258,7 +8258,7 @@ const Qt = ee(
8258
8258
  tooltip: g,
8259
8259
  onClick: v,
8260
8260
  ...c,
8261
- ref: p,
8261
+ ref: u,
8262
8262
  children: s ?? /* @__PURE__ */ L(ve, { children: [
8263
8263
  /* @__PURE__ */ a(m, { className: "tiptap-button-icon" }),
8264
8264
  o && /* @__PURE__ */ a("span", { className: "tiptap-button-text", children: o }),
@@ -8280,9 +8280,9 @@ const Bd = async (e) => {
8280
8280
  model: l = "deepseek-chat",
8281
8281
  onUpdate: s,
8282
8282
  signal: c,
8283
- headers: p = {},
8283
+ headers: u = {},
8284
8284
  params: h = {},
8285
- body: u = {},
8285
+ body: p = {},
8286
8286
  request: f
8287
8287
  } = e;
8288
8288
  if (f)
@@ -8305,13 +8305,13 @@ ${n}` }] : [],
8305
8305
  headers: {
8306
8306
  "Content-Type": "application/json",
8307
8307
  Authorization: `Bearer ${r}`,
8308
- ...p
8308
+ ...u
8309
8309
  },
8310
8310
  body: JSON.stringify({
8311
8311
  model: l,
8312
8312
  messages: d,
8313
8313
  stream: !0,
8314
- ...u
8314
+ ...p
8315
8315
  }),
8316
8316
  signal: c
8317
8317
  });
@@ -8352,9 +8352,9 @@ function Dd({
8352
8352
  model: l,
8353
8353
  headers: s,
8354
8354
  params: c,
8355
- body: p,
8355
+ body: u,
8356
8356
  request: h,
8357
- onStart: u,
8357
+ onStart: p,
8358
8358
  onSuccess: f,
8359
8359
  onError: g
8360
8360
  }) {
@@ -8404,7 +8404,7 @@ function Dd({
8404
8404
  const { from: Q, to: we } = e.state.selection, Le = e.state.doc.slice(Q, we);
8405
8405
  J.current = { from: Q, to: we, slice: Le }, ie.current = Q;
8406
8406
  }
8407
- j.current && j.current.abort(), j.current = new AbortController(), k("generating"), z(null), oe !== b && v(oe), _(oe), u && u();
8407
+ j.current && j.current.abort(), j.current = new AbortController(), k("generating"), z(null), oe !== b && v(oe), _(oe), p && p();
8408
8408
  try {
8409
8409
  const Q = e.state.selection, we = Q && !Q.empty ? e.state.doc.textBetween(Q.from, Q.to, " ") : "", Le = await Bd({
8410
8410
  prompt: oe,
@@ -8415,7 +8415,7 @@ function Dd({
8415
8415
  model: l || o,
8416
8416
  headers: s,
8417
8417
  params: c,
8418
- body: p,
8418
+ body: u,
8419
8419
  request: h,
8420
8420
  onUpdate: (ze) => {
8421
8421
  if (!e) return;
@@ -8452,9 +8452,9 @@ function Dd({
8452
8452
  Y,
8453
8453
  s,
8454
8454
  c,
8455
- p,
8456
- h,
8457
8455
  u,
8456
+ h,
8457
+ p,
8458
8458
  f,
8459
8459
  g,
8460
8460
  l,
@@ -8513,9 +8513,9 @@ const qr = ee(
8513
8513
  headers: l,
8514
8514
  params: s,
8515
8515
  body: c,
8516
- request: p,
8516
+ request: u,
8517
8517
  onStart: h,
8518
- onSuccess: u,
8518
+ onSuccess: p,
8519
8519
  onError: f,
8520
8520
  className: g,
8521
8521
  hideWhenUnavailable: d = !1,
@@ -8549,9 +8549,9 @@ const qr = ee(
8549
8549
  headers: l,
8550
8550
  params: s,
8551
8551
  body: c,
8552
- request: p,
8552
+ request: u,
8553
8553
  onStart: h,
8554
- onSuccess: u,
8554
+ onSuccess: p,
8555
8555
  onError: f
8556
8556
  }), H = K(null);
8557
8557
  if (D(() => {
@@ -8760,7 +8760,7 @@ function Kr() {
8760
8760
  const n = window.visualViewport;
8761
8761
  if (!n) return;
8762
8762
  const { width: r = 0, height: i = 0, offsetTop: l = 0, offsetLeft: s = 0, scale: c = 0 } = n;
8763
- t((p) => r === p.width && i === p.height && l === p.offsetTop && s === p.offsetLeft && c === p.scale ? p : { width: r, height: i, offsetTop: l, offsetLeft: s, scale: c });
8763
+ t((u) => r === u.width && i === u.height && l === u.offsetTop && s === u.offsetLeft && c === u.scale ? u : { width: r, height: i, offsetTop: l, offsetLeft: s, scale: c });
8764
8764
  }, 200);
8765
8765
  return D(() => {
8766
8766
  const n = window.visualViewport;
@@ -8794,16 +8794,16 @@ function Od({
8794
8794
  i(It);
8795
8795
  return;
8796
8796
  }
8797
- const p = c.getBoundingClientRect();
8797
+ const u = c.getBoundingClientRect();
8798
8798
  i({
8799
- x: p.x,
8800
- y: p.y,
8801
- width: p.width,
8802
- height: p.height,
8803
- top: p.top,
8804
- right: p.right,
8805
- bottom: p.bottom,
8806
- left: p.left
8799
+ x: u.x,
8800
+ y: u.y,
8801
+ width: u.width,
8802
+ height: u.height,
8803
+ top: u.top,
8804
+ right: u.right,
8805
+ bottom: u.bottom,
8806
+ left: u.left
8807
8807
  });
8808
8808
  },
8809
8809
  o,
@@ -8818,18 +8818,18 @@ function Od({
8818
8818
  const c = l();
8819
8819
  if (!c) return;
8820
8820
  s();
8821
- const p = [];
8821
+ const u = [];
8822
8822
  if (n && Pd) {
8823
- const u = new ResizeObserver(() => {
8823
+ const p = new ResizeObserver(() => {
8824
8824
  window.requestAnimationFrame(s);
8825
8825
  });
8826
- u.observe(c), p.push(() => u.disconnect());
8826
+ p.observe(c), u.push(() => p.disconnect());
8827
8827
  }
8828
8828
  const h = () => s();
8829
- return window.addEventListener("scroll", h, !0), window.addEventListener("resize", h, !0), p.push(() => {
8829
+ return window.addEventListener("scroll", h, !0), window.addEventListener("resize", h, !0), u.push(() => {
8830
8830
  window.removeEventListener("scroll", h), window.removeEventListener("resize", h);
8831
8831
  }), () => {
8832
- p.forEach((u) => u()), i(It);
8832
+ u.forEach((p) => p()), i(It);
8833
8833
  };
8834
8834
  }, [t, l, s, n]), r;
8835
8835
  }
@@ -8852,7 +8852,7 @@ function _d({ editor: e, overlayHeight: t = 0 }) {
8852
8852
  if (!l.hasFocus()) return;
8853
8853
  const { from: s } = i.selection, c = l.coordsAtPos(s);
8854
8854
  if (o < n.height && c && o - c.top < t) {
8855
- const h = Math.max(o / 2, t), u = window.scrollY, g = c.top + u - h;
8855
+ const h = Math.max(o / 2, t), p = window.scrollY, g = c.top + p - h;
8856
8856
  window.scrollTo({
8857
8857
  top: Math.max(0, g),
8858
8858
  behavior: "smooth"
@@ -8907,7 +8907,7 @@ const Vd = { contentAriaLabel: "Main content area, start typing to enter text.",
8907
8907
  return i ? i.label : o;
8908
8908
  }, [o]), r = U(
8909
8909
  (i) => {
8910
- console.log("🚀 ~ CodeBlockNodeView ~ lang:", i), t({ language: i });
8910
+ t({ language: i });
8911
8911
  },
8912
8912
  [t]
8913
8913
  );
@@ -8917,7 +8917,7 @@ const Vd = { contentAriaLabel: "Main content area, start typing to enter text.",
8917
8917
  /* @__PURE__ */ a("span", { className: "mr-1", children: n }),
8918
8918
  /* @__PURE__ */ a(eo, { className: "tiptap-button-dropdown-small" })
8919
8919
  ] }) }),
8920
- /* @__PURE__ */ a(Ot, { align: "end", portal: !0, children: /* @__PURE__ */ a(nt, { children: /* @__PURE__ */ a(rt, { className: "p-1", children: nn.map((i) => /* @__PURE__ */ a(ko, { asChild: !0, children: /* @__PURE__ */ a(
8920
+ /* @__PURE__ */ a(Ot, { align: "end", portal: !1, children: /* @__PURE__ */ a(nt, { children: /* @__PURE__ */ a(rt, { className: "p-1", children: nn.map((i) => /* @__PURE__ */ a(ko, { asChild: !0, children: /* @__PURE__ */ a(
8921
8921
  G,
8922
8922
  {
8923
8923
  type: "button",
@@ -8933,15 +8933,15 @@ const Vd = { contentAriaLabel: "Main content area, start typing to enter text.",
8933
8933
  ] });
8934
8934
  };
8935
8935
  function Xd(e) {
8936
- const { t } = he("simpleEditor"), [o, n] = N([]), [r, i] = N(null), l = () => i(null), s = async (u) => {
8936
+ const { t } = he("simpleEditor"), [o, n] = N([]), [r, i] = N(null), l = () => i(null), s = async (p) => {
8937
8937
  var m, b, v;
8938
- if (e.maxSize && u.size > e.maxSize) {
8938
+ if (e.maxSize && p.size > e.maxSize) {
8939
8939
  const y = t("imageUpload.errors.tooLarge", { size: e.maxSize / 1024 / 1024 }), k = new Error(y);
8940
8940
  return (m = e.onError) == null || m.call(e, k), i(y), null;
8941
8941
  }
8942
8942
  const f = new AbortController(), g = crypto.randomUUID(), d = {
8943
8943
  id: g,
8944
- file: u,
8944
+ file: p,
8945
8945
  progress: 0,
8946
8946
  status: "uploading",
8947
8947
  abortController: f
@@ -8951,7 +8951,7 @@ function Xd(e) {
8951
8951
  if (!e.upload)
8952
8952
  throw new Error("Upload function is not defined");
8953
8953
  const y = await e.upload(
8954
- u,
8954
+ p,
8955
8955
  (k) => {
8956
8956
  n(
8957
8957
  (S) => S.map((x) => x.id === g ? { ...x, progress: k.progress } : x)
@@ -8976,31 +8976,31 @@ function Xd(e) {
8976
8976
  };
8977
8977
  return {
8978
8978
  fileItems: o,
8979
- uploadFiles: async (u) => {
8979
+ uploadFiles: async (p) => {
8980
8980
  var d, m;
8981
- if (l(), !u || u.length === 0) {
8981
+ if (l(), !p || p.length === 0) {
8982
8982
  const b = t("imageUpload.errors.noFiles");
8983
8983
  return (d = e.onError) == null || d.call(e, new Error(b)), i(b), [];
8984
8984
  }
8985
- if (e.limit && u.length > e.limit) {
8985
+ if (e.limit && p.length > e.limit) {
8986
8986
  const b = t("imageUpload.errors.limitExceeded", {
8987
8987
  limit: e.limit,
8988
8988
  plural: e.limit === 1 ? "" : "s"
8989
8989
  });
8990
8990
  return (m = e.onError) == null || m.call(e, new Error(b)), i(b), [];
8991
8991
  }
8992
- const f = u.map((b) => s(b));
8992
+ const f = p.map((b) => s(b));
8993
8993
  return (await Promise.all(f)).filter((b) => b !== null);
8994
8994
  },
8995
- removeFileItem: (u) => {
8995
+ removeFileItem: (p) => {
8996
8996
  n((f) => {
8997
- const g = f.find((d) => d.id === u);
8998
- return g != null && g.abortController && g.abortController.abort(), g != null && g.url && URL.revokeObjectURL(g.url), f.filter((d) => d.id !== u);
8997
+ const g = f.find((d) => d.id === p);
8998
+ return g != null && g.abortController && g.abortController.abort(), g != null && g.url && URL.revokeObjectURL(g.url), f.filter((d) => d.id !== p);
8999
8999
  });
9000
9000
  },
9001
9001
  clearAllFiles: () => {
9002
- o.forEach((u) => {
9003
- u.abortController && u.abortController.abort(), u.url && URL.revokeObjectURL(u.url);
9002
+ o.forEach((p) => {
9003
+ p.abortController && p.abortController.abort(), p.url && URL.revokeObjectURL(p.url);
9004
9004
  }), n([]), l();
9005
9005
  },
9006
9006
  error: r,
@@ -9087,8 +9087,8 @@ const Qr = () => /* @__PURE__ */ L(
9087
9087
  },
9088
9088
  onDrop: (h) => {
9089
9089
  h.preventDefault(), h.stopPropagation(), i(!1), n(!1);
9090
- const u = Array.from(h.dataTransfer.files);
9091
- u.length > 0 && e(u);
9090
+ const p = Array.from(h.dataTransfer.files);
9091
+ p.length > 0 && e(p);
9092
9092
  },
9093
9093
  children: t
9094
9094
  }
@@ -9157,8 +9157,8 @@ const Qr = () => /* @__PURE__ */ L(
9157
9157
  upload: i.options.upload,
9158
9158
  onSuccess: i.options.onSuccess,
9159
9159
  onError: i.options.onError
9160
- }, { fileItems: c, uploadFiles: p, removeFileItem: h, clearAllFiles: u, error: f, clearError: g } = Xd(s), d = async (y) => {
9161
- const k = await p(y);
9160
+ }, { fileItems: c, uploadFiles: u, removeFileItem: h, clearAllFiles: p, error: f, clearError: g } = Xd(s), d = async (y) => {
9161
+ const k = await u(y);
9162
9162
  if (k.length > 0) {
9163
9163
  const S = e.getPos();
9164
9164
  if (ct(S)) {
@@ -9230,7 +9230,7 @@ const Qr = () => /* @__PURE__ */ L(
9230
9230
  type: "button",
9231
9231
  "data-style": "ghost",
9232
9232
  onClick: (y) => {
9233
- y.stopPropagation(), u();
9233
+ y.stopPropagation(), p();
9234
9234
  },
9235
9235
  children: l("imageUpload.clearAll")
9236
9236
  }
@@ -9316,7 +9316,7 @@ const Qr = () => /* @__PURE__ */ L(
9316
9316
  var c;
9317
9317
  const o = Array.from(((c = t.clipboardData) == null ? void 0 : c.files) || []);
9318
9318
  if (o.length === 0) return !1;
9319
- const n = o.filter((p) => p.type.match(this.options.accept || "image/*"));
9319
+ const n = o.filter((u) => u.type.match(this.options.accept || "image/*"));
9320
9320
  if (n.length === 0) return !1;
9321
9321
  const r = crypto.randomUUID();
9322
9322
  this.storage.pendingFiles.set(r, n);
@@ -9352,7 +9352,7 @@ const Qr = () => /* @__PURE__ */ L(
9352
9352
  };
9353
9353
  }
9354
9354
  }), nu = (e) => {
9355
- const { node: t, updateAttributes: o, selected: n } = e, { src: r, alt: i, title: l, width: s, textAlign: c } = t.attrs, [p, h] = N(!1), [u, f] = N(s), g = K(null), d = K(null), m = K(s), b = K(!1);
9355
+ const { node: t, updateAttributes: o, selected: n } = e, { src: r, alt: i, title: l, width: s, textAlign: c } = t.attrs, [u, h] = N(!1), [p, f] = N(s), g = K(null), d = K(null), m = K(s), b = K(!1);
9356
9356
  D(() => {
9357
9357
  f(s), m.current = s;
9358
9358
  }, [s]);
@@ -9417,9 +9417,9 @@ const Qr = () => /* @__PURE__ */ L(
9417
9417
  {
9418
9418
  className: "tiptap-image-container",
9419
9419
  style: {
9420
- width: u || "100%",
9420
+ width: p || "100%",
9421
9421
  position: "relative",
9422
- transition: p ? "none" : "width 0.2s ease",
9422
+ transition: u ? "none" : "width 0.2s ease",
9423
9423
  ...x
9424
9424
  },
9425
9425
  children: [
@@ -9537,21 +9537,21 @@ const Qr = () => /* @__PURE__ */ L(
9537
9537
  }
9538
9538
  if (!s || c < 0)
9539
9539
  return pt.empty;
9540
- const p = c + 1, h = Ml.get(s), u = /* @__PURE__ */ new Set();
9540
+ const u = c + 1, h = Ml.get(s), p = /* @__PURE__ */ new Set();
9541
9541
  t.forEachCell((d, m) => {
9542
- u.add(m);
9542
+ p.add(m);
9543
9543
  });
9544
9544
  const f = (d, m) => {
9545
9545
  if (d < 0 || m < 0 || d >= h.height || m >= h.width) return !1;
9546
9546
  const b = h.map[d * h.width + m];
9547
- return u.has(p + b);
9547
+ return p.has(u + b);
9548
9548
  }, g = [];
9549
- return u.forEach((d) => {
9549
+ return p.forEach((d) => {
9550
9550
  const m = o.nodeAt(d);
9551
9551
  if (!m) return;
9552
9552
  let b = null;
9553
9553
  try {
9554
- b = h.findCell(d - p);
9554
+ b = h.findCell(d - u);
9555
9555
  } catch {
9556
9556
  b = null;
9557
9557
  }
@@ -9657,9 +9657,9 @@ const Qr = () => /* @__PURE__ */ L(
9657
9657
  try {
9658
9658
  const n = typeof o.action == "function" ? await o.action(e) : o.action, r = new FormData(), i = o.name || "file";
9659
9659
  if (r.append(i, e), o.data) {
9660
- const p = typeof o.data == "function" ? await o.data(e) : o.data;
9661
- Object.entries(p || {}).forEach(([h, u]) => {
9662
- u instanceof Blob ? r.append(h, u) : r.append(h, String(u));
9660
+ const u = typeof o.data == "function" ? await o.data(e) : o.data;
9661
+ Object.entries(u || {}).forEach(([h, p]) => {
9662
+ p instanceof Blob ? r.append(h, p) : r.append(h, String(p));
9663
9663
  });
9664
9664
  }
9665
9665
  const l = typeof o.headers == "function" ? await o.headers(e) : o.headers;
@@ -9696,12 +9696,12 @@ function lu(e) {
9696
9696
  function ri({ value: e, onChange: t, placeholder: o, features: n, output: r = "html" }) {
9697
9697
  const { t: i, i18n: l } = he("simpleEditor");
9698
9698
  lu(l);
9699
- const s = ke(n == null ? void 0 : n.image), c = s, p = K(c);
9700
- p.current = c;
9699
+ const s = ke(n == null ? void 0 : n.image), c = s, u = K(c);
9700
+ u.current = c;
9701
9701
  const h = (g) => {
9702
9702
  if (g !== void 0)
9703
9703
  return typeof g == "string" ? so.parse(g, { async: !1 }) : g;
9704
- }, u = xl({
9704
+ }, p = xl({
9705
9705
  immediatelyRender: !1,
9706
9706
  editorProps: {
9707
9707
  attributes: {
@@ -9776,7 +9776,7 @@ function ri({ value: e, onChange: t, placeholder: o, features: n, output: r = "h
9776
9776
  upload: (g, d) => iu({
9777
9777
  file: g,
9778
9778
  onProgress: d,
9779
- imageProps: p.current
9779
+ imageProps: u.current
9780
9780
  }),
9781
9781
  onError: (g) => console.error("Upload failed:", g),
9782
9782
  ...s
@@ -9788,8 +9788,8 @@ function ri({ value: e, onChange: t, placeholder: o, features: n, output: r = "h
9788
9788
  content: h(e)
9789
9789
  }), f = K(!1);
9790
9790
  return D(() => {
9791
- f.current || u && e !== void 0 && (u.commands.setContent(h(e) || ""), f.current = !0);
9792
- }, [e, u]), u;
9791
+ f.current || p && e !== void 0 && (p.commands.setContent(h(e) || ""), f.current = !0);
9792
+ }, [e, p]), p;
9793
9793
  }
9794
9794
  function su(e) {
9795
9795
  e.hasResourceBundle("en-US", "simpleEditor") || e.addResourceBundle("en-US", "simpleEditor", Zr, !0, !0), e.hasResourceBundle("zh-CN", "simpleEditor") || e.addResourceBundle("zh-CN", "simpleEditor", Jr, !0, !0);
@@ -9802,7 +9802,7 @@ const cu = ({
9802
9802
  features: r,
9803
9803
  editor: i
9804
9804
  }) => {
9805
- const l = ne(r == null ? void 0 : r.undoRedo), s = ne(r == null ? void 0 : r.heading), c = ne(r == null ? void 0 : r.list), p = ne(r == null ? void 0 : r.blockquote), h = ne(r == null ? void 0 : r.codeBlock), u = ne(r == null ? void 0 : r.bold), f = ne(r == null ? void 0 : r.italic), g = ne(r == null ? void 0 : r.strike), d = ne(r == null ? void 0 : r.code), m = ne(r == null ? void 0 : r.underline), b = ne(r == null ? void 0 : r.textColor), v = ne(r == null ? void 0 : r.highlight), y = ne(r == null ? void 0 : r.link), k = ne(r == null ? void 0 : r.subscript), S = ne(r == null ? void 0 : r.superscript), x = ne(r == null ? void 0 : r.textAlign), w = ne(r == null ? void 0 : r.image), z = ne(r == null ? void 0 : r.ai), I = ne(r == null ? void 0 : r.themeToggle), M = ke(r == null ? void 0 : r.undoRedo), R = ke(r == null ? void 0 : r.heading), V = ke(r == null ? void 0 : r.list), $ = ke(r == null ? void 0 : r.blockquote), _ = ke(r == null ? void 0 : r.codeBlock), j = ke(r == null ? void 0 : r.bold), J = ke(r == null ? void 0 : r.italic), ie = ke(r == null ? void 0 : r.strike), ue = ke(r == null ? void 0 : r.code), H = ke(r == null ? void 0 : r.underline), ae = ke(r == null ? void 0 : r.textColor), be = ke(r == null ? void 0 : r.highlight), Y = ke(r == null ? void 0 : r.link), se = ke(r == null ? void 0 : r.subscript), xe = ke(r == null ? void 0 : r.superscript), X = ke(r == null ? void 0 : r.textAlign), fe = ke(r == null ? void 0 : r.image), ye = ke(r == null ? void 0 : r.ai);
9805
+ const l = ne(r == null ? void 0 : r.undoRedo), s = ne(r == null ? void 0 : r.heading), c = ne(r == null ? void 0 : r.list), u = ne(r == null ? void 0 : r.blockquote), h = ne(r == null ? void 0 : r.codeBlock), p = ne(r == null ? void 0 : r.bold), f = ne(r == null ? void 0 : r.italic), g = ne(r == null ? void 0 : r.strike), d = ne(r == null ? void 0 : r.code), m = ne(r == null ? void 0 : r.underline), b = ne(r == null ? void 0 : r.textColor), v = ne(r == null ? void 0 : r.highlight), y = ne(r == null ? void 0 : r.link), k = ne(r == null ? void 0 : r.subscript), S = ne(r == null ? void 0 : r.superscript), x = ne(r == null ? void 0 : r.textAlign), w = ne(r == null ? void 0 : r.image), z = ne(r == null ? void 0 : r.ai), I = ne(r == null ? void 0 : r.themeToggle), M = ke(r == null ? void 0 : r.undoRedo), R = ke(r == null ? void 0 : r.heading), V = ke(r == null ? void 0 : r.list), $ = ke(r == null ? void 0 : r.blockquote), _ = ke(r == null ? void 0 : r.codeBlock), j = ke(r == null ? void 0 : r.bold), J = ke(r == null ? void 0 : r.italic), ie = ke(r == null ? void 0 : r.strike), ue = ke(r == null ? void 0 : r.code), H = ke(r == null ? void 0 : r.underline), ae = ke(r == null ? void 0 : r.textColor), be = ke(r == null ? void 0 : r.highlight), Y = ke(r == null ? void 0 : r.link), se = ke(r == null ? void 0 : r.subscript), xe = ke(r == null ? void 0 : r.superscript), X = ke(r == null ? void 0 : r.textAlign), fe = ke(r == null ? void 0 : r.image), ye = ke(r == null ? void 0 : r.ai);
9806
9806
  return /* @__PURE__ */ L(ve, { children: [
9807
9807
  /* @__PURE__ */ a(en, {}),
9808
9808
  l && /* @__PURE__ */ L(ve, { children: [
@@ -9812,7 +9812,7 @@ const cu = ({
9812
9812
  ] }),
9813
9813
  /* @__PURE__ */ a(Ye, {})
9814
9814
  ] }),
9815
- (s || c || p || h) && /* @__PURE__ */ L(ve, { children: [
9815
+ (s || c || u || h) && /* @__PURE__ */ L(ve, { children: [
9816
9816
  /* @__PURE__ */ L(Re, { children: [
9817
9817
  s && /* @__PURE__ */ a(
9818
9818
  wr,
@@ -9830,14 +9830,14 @@ const cu = ({
9830
9830
  ...V
9831
9831
  }
9832
9832
  ),
9833
- p && /* @__PURE__ */ a(Mr, { ...$ }),
9833
+ u && /* @__PURE__ */ a(Mr, { ...$ }),
9834
9834
  h && /* @__PURE__ */ a(Er, { ..._ })
9835
9835
  ] }),
9836
9836
  /* @__PURE__ */ a(Ye, {})
9837
9837
  ] }),
9838
- (u || f || g || d || m || b || v || y) && /* @__PURE__ */ L(ve, { children: [
9838
+ (p || f || g || d || m || b || v || y) && /* @__PURE__ */ L(ve, { children: [
9839
9839
  /* @__PURE__ */ L(Re, { children: [
9840
- u && /* @__PURE__ */ a(qe, { type: "bold", ...j }),
9840
+ p && /* @__PURE__ */ a(qe, { type: "bold", ...j }),
9841
9841
  f && /* @__PURE__ */ a(qe, { type: "italic", ...J }),
9842
9842
  g && /* @__PURE__ */ a(qe, { type: "strike", ...ie }),
9843
9843
  d && /* @__PURE__ */ a(qe, { type: "code", ...ue }),
@@ -9883,8 +9883,8 @@ const cu = ({
9883
9883
  e === "highlighter" ? /* @__PURE__ */ a(Dr, {}) : e === "textColor" ? /* @__PURE__ */ a(Pr, {}) : /* @__PURE__ */ a(gd, {})
9884
9884
  ] }), ii = ({ editor: e, className: t, style: o, features: n }) => {
9885
9885
  var f;
9886
- const r = dt(), { height: i } = Kr(), [l, s] = N("main"), c = K(null), { i18n: p } = he("simpleEditor");
9887
- su(p);
9886
+ const r = dt(), { height: i } = Kr(), [l, s] = N("main"), c = K(null), { i18n: u } = he("simpleEditor");
9887
+ su(u);
9888
9888
  const h = _d({
9889
9889
  editor: e,
9890
9890
  overlayHeight: ((f = c.current) == null ? void 0 : f.getBoundingClientRect().height) ?? 0
@@ -9892,7 +9892,7 @@ const cu = ({
9892
9892
  D(() => {
9893
9893
  !r && l !== "main" && s("main");
9894
9894
  }, [r, l]);
9895
- const u = (g) => {
9895
+ const p = (g) => {
9896
9896
  if (e && e.state.selection.toJSON().type === "node") {
9897
9897
  const d = g.target;
9898
9898
  if (d.classList.contains("ProseMirror") || d.classList.contains("simple-editor-content")) {
@@ -9937,7 +9937,7 @@ const cu = ({
9937
9937
  editor: e,
9938
9938
  role: "presentation",
9939
9939
  className: "simple-editor-content",
9940
- onClick: u
9940
+ onClick: p
9941
9941
  }
9942
9942
  )
9943
9943
  ] }) });
@@ -10015,9 +10015,17 @@ function hu({ value: e, className: t, sanitize: o = !0, theme: n }) {
10015
10015
  typeof e == "string" ? i = so.parse(e, { async: !1 }) : i = $o(e);
10016
10016
  const l = o ? Vl.sanitize(i) : i, s = n === "dark" ? "dark" : "";
10017
10017
  return D(() => {
10018
- r.current && r.current.querySelectorAll("pre code").forEach((c) => {
10018
+ r.current && (r.current.querySelectorAll("table").forEach((c) => {
10019
+ var p;
10020
+ if ((p = c.parentElement) != null && p.classList.contains("tableWrapper"))
10021
+ return;
10022
+ const u = document.createElement("div");
10023
+ u.className = "tableWrapper";
10024
+ const h = c.parentNode;
10025
+ h && (h.insertBefore(u, c), u.appendChild(c));
10026
+ }), r.current.querySelectorAll("pre code").forEach((c) => {
10019
10027
  Wl.highlightElement(c);
10020
- });
10028
+ }));
10021
10029
  }, [l]), /* @__PURE__ */ a("div", { className: `simple-editor-wrapper simple-editor-viewer ${s} ${t || ""}`, children: /* @__PURE__ */ a("div", { className: "simple-editor-content", children: /* @__PURE__ */ a(
10022
10030
  "div",
10023
10031
  {