@import-ai/omnibox-editor 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { jsx as l, jsxs as m, Fragment as B } from "react/jsx-runtime";
2
2
  import * as Jt from "react";
3
- import { useState as I, useEffect as T, useRef as $, useCallback as A, createContext as $e, useContext as ke, useMemo as V, useId as X1, forwardRef as P, isValidElement as $n, version as J1, cloneElement as Zn, Fragment as Q1, memo as S, useLayoutEffect as an, Children as li } from "react";
4
- import { useEditorState as ll, useCurrentEditor as ec, findParentNodeClosestToPos as tc, isNodeSelection as At, mergeAttributes as al, NodeViewWrapper as Tt, NodeViewContent as sl, ReactNodeViewRenderer as sn, Node as nc, posToDOMRect as oc, isTextSelection as cl, EditorContext as cn, useEditor as rc, EditorContent as ic } from "@tiptap/react";
3
+ import { useState as T, useEffect as I, useRef as $, useCallback as A, createContext as $e, useContext as ke, useMemo as V, useId as X1, forwardRef as P, isValidElement as $n, version as J1, cloneElement as Zn, Fragment as Q1, memo as S, useLayoutEffect as an, Children as li } from "react";
4
+ import { useEditorState as ll, useCurrentEditor as ec, findParentNodeClosestToPos as tc, isNodeSelection as At, mergeAttributes as al, NodeViewWrapper as It, NodeViewContent as sl, ReactNodeViewRenderer as sn, Node as nc, posToDOMRect as oc, isTextSelection as cl, EditorContext as cn, useEditor as rc, EditorContent as ic } from "@tiptap/react";
5
5
  import { createPortal as lc } from "react-dom";
6
6
  import ac from "@tiptap/extension-collaboration";
7
7
  import sc from "@tiptap/extension-collaboration-caret";
@@ -19,17 +19,17 @@ import { Mathematics as pl } from "@tiptap/extension-mathematics";
19
19
  import { UniqueID as wc } from "@tiptap/extension-unique-id";
20
20
  import { Emoji as vc, gitHubEmojis as yc } from "@tiptap/extension-emoji";
21
21
  import { TableOfContents as xc, getHierarchicalIndexes as Ac } from "@tiptap/extension-table-of-contents";
22
- import { NodeSelection as Y, Selection as It, TextSelection as se, AllSelection as Tc, PluginKey as it, Plugin as Ht } from "@tiptap/pm/state";
23
- import { Extension as Ue, Node as Ic, mergeAttributes as Lc } from "@tiptap/core";
22
+ import { NodeSelection as Y, Selection as Tt, TextSelection as se, AllSelection as Ic, PluginKey as it, Plugin as Ht } from "@tiptap/pm/state";
23
+ import { Extension as Ue, Node as Tc, mergeAttributes as Lc } from "@tiptap/core";
24
24
  import { clsx as kc } from "clsx";
25
25
  import { CellSelection as Q, cellAround as Me, TableMap as We, findTable as hl, selectedRect as Lt, selectionCell as gl, isInTable as Sc, columnResizing as Mc, tableEditing as Rc, TableView as Ec, moveTableRow as Cl, moveTableColumn as ml, addRowAfter as bl, addColumnAfter as wl, rowIsHeader as vl, columnIsHeader as yl, deleteCellSelection as Hc, toggleHeader as ai, addRowBefore as Nc, addColumnBefore as Vc, deleteRow as Bc, deleteColumn as Dc, columnResizingPluginKey as si, mergeCells as xl, splitCell as Al } from "@tiptap/pm/tables";
26
26
  import Uc from "@tiptap/extension-horizontal-rule";
27
- import { Image as Tl } from "@tiptap/extension-image";
27
+ import { Image as Il } from "@tiptap/extension-image";
28
28
  import { CodeBlock as Oc } from "@tiptap/extension-code-block";
29
29
  import * as Pc from "echarts";
30
30
  import Wc from "mermaid";
31
31
  import { DecorationSet as Qt, Decoration as mt } from "@tiptap/pm/view";
32
- import { useMergeRefs as yo, FloatingPortal as un, FloatingDelayGroup as $c, useFloating as Nt, autoUpdate as Il, offset as st, flip as xo, shift as Ao, useHover as Zc, useFocus as _c, useDismiss as Ll, useRole as zc, useInteractions as kl, size as To, useTransitionStyles as Io } from "@floating-ui/react";
32
+ import { useMergeRefs as yo, FloatingPortal as un, FloatingDelayGroup as $c, useFloating as Nt, autoUpdate as Tl, offset as st, flip as xo, shift as Ao, useHover as Zc, useFocus as _c, useDismiss as Ll, useRole as zc, useInteractions as kl, size as Io, useTransitionStyles as To } from "@floating-ui/react";
33
33
  import { Table as Fc } from "@tiptap/extension-table/table";
34
34
  import { TableCell as Sl, TableHeader as Ml, TableRow as Rl, Table as Gc } from "@tiptap/extension-table";
35
35
  import { Mapping as Kc, canJoin as jc } from "@tiptap/pm/transform";
@@ -90,8 +90,8 @@ function o2(e) {
90
90
  return !n || !("activeEditor" in n) ? null : n.activeEditor ?? null;
91
91
  }
92
92
  function k(e) {
93
- const { editor: t } = ec(), n = e ?? t, [o, r] = I(null);
94
- return T(() => {
93
+ const { editor: t } = ec(), n = e ?? t, [o, r] = T(null);
94
+ return I(() => {
95
95
  if (!n) {
96
96
  r(null);
97
97
  return;
@@ -100,7 +100,7 @@ function k(e) {
100
100
  return a(), n.on("update", a), n.on("selectionUpdate", a), () => {
101
101
  n.off("update", a), n.off("selectionUpdate", a);
102
102
  };
103
- }, [n]), T(() => {
103
+ }, [n]), I(() => {
104
104
  if (!o) return;
105
105
  const a = () => r(null);
106
106
  return o.on("destroy", a), () => {
@@ -159,7 +159,7 @@ const l2 = (e, t, n = !0) => {
159
159
  return t ? t.split(n).map((r) => r.trim()).map((r) => l2(r, i2(), o)) : [];
160
160
  }, Be = (e, t) => t?.schema ? t.schema.spec.marks.get(e) !== void 0 : !1, ae = (e, t) => t?.schema ? t.schema.spec.nodes.get(e) !== void 0 : !1;
161
161
  function a2(e) {
162
- const { state: t, view: n } = e, { doc: o, selection: r } = t, i = It.findFrom(r.$to, 1, !0);
162
+ const { state: t, view: n } = e, { doc: o, selection: r } = t, i = Tt.findFrom(r.$to, 1, !0);
163
163
  if (i)
164
164
  return n.dispatch(t.tr.setSelection(i).scrollIntoView()), !0;
165
165
  const a = t.schema.nodes.paragraph;
@@ -190,7 +190,7 @@ function s2(e, t) {
190
190
  return console.error(`Error getting node at position ${t}:`, n), null;
191
191
  }
192
192
  }
193
- function Te(e) {
193
+ function Ie(e) {
194
194
  const { editor: t, node: n, nodePos: o } = e;
195
195
  if (!t || !t.state?.doc) return null;
196
196
  const r = n != null, i = te(o);
@@ -233,7 +233,7 @@ function Ee(e, t = []) {
233
233
  const i = o.node?.type?.name;
234
234
  return !!i && r.has(i);
235
235
  }
236
- if (o instanceof se || o instanceof Tc) {
236
+ if (o instanceof se || o instanceof Ic) {
237
237
  let i = !0;
238
238
  return n.doc.nodesBetween(o.from, o.to, (a) => a.isTextblock && !r.has(a.type.name) ? (i = !1, !1) : i), i;
239
239
  }
@@ -393,8 +393,8 @@ function El(e, t) {
393
393
  }
394
394
  const Hl = "hideFloatingToolbar";
395
395
  function p2(e) {
396
- const { editor: t, isSelectionValid: n, extraHideWhen: o = !1 } = e, [r, i] = I(!1), a = $(!1);
397
- return T(() => {
396
+ const { editor: t, isSelectionValid: n, extraHideWhen: o = !1 } = e, [r, i] = T(!1), a = $(!1);
397
+ return I(() => {
398
398
  if (!t) return;
399
399
  const s = ({ transaction: c }) => {
400
400
  c.getMeta(Hl) ? a.current = !0 : (
@@ -406,7 +406,7 @@ function p2(e) {
406
406
  return t.on("transaction", s), () => {
407
407
  t.off("transaction", s);
408
408
  };
409
- }, [t]), T(() => {
409
+ }, [t]), I(() => {
410
410
  if (!t) return;
411
411
  const s = t.view.dom, c = (u) => {
412
412
  const d = t.state.selection;
@@ -421,7 +421,7 @@ function p2(e) {
421
421
  return s.addEventListener("pointerdown", c, { capture: !0 }), () => s.removeEventListener("pointerdown", c, {
422
422
  capture: !0
423
423
  });
424
- }, [t, o, n]), T(() => {
424
+ }, [t, o, n]), I(() => {
425
425
  if (!t) return;
426
426
  const s = () => {
427
427
  const { selection: c } = t.state, u = n(t, c);
@@ -472,9 +472,9 @@ function h2(e = {}) {
472
472
  },
473
473
  [c]
474
474
  );
475
- return T(() => {
475
+ return I(() => {
476
476
  r && u(500);
477
- }, [r, u]), T(() => {
477
+ }, [r, u]), I(() => {
478
478
  const d = () => u(), f = () => u(500);
479
479
  return window.addEventListener("hashchange", d), window.addEventListener("pageshow", f), window.addEventListener("popstate", d), () => {
480
480
  window.removeEventListener("hashchange", d), window.removeEventListener("pageshow", f), window.removeEventListener("popstate", d);
@@ -880,11 +880,11 @@ const v2 = ({
880
880
  i18n: p = Ze(),
881
881
  getPos: h
882
882
  }) => {
883
- const [g, C] = I(), [b, w] = I(a), [v, y] = I(!1), [x, L] = I({
883
+ const [g, C] = T(), [b, w] = T(a), [v, y] = T(!1), [x, L] = T({
884
884
  src: e,
885
885
  state: "loading"
886
886
  }), E = $(!1), R = $(!0), U = $(null), X = $(null), fe = $(null), Z = $(null);
887
- T(() => {
887
+ I(() => {
888
888
  if (!n || !s) return;
889
889
  const K = () => {
890
890
  const le = h();
@@ -964,16 +964,16 @@ const v2 = ({
964
964
  (K) => fi(K, e, "error")
965
965
  );
966
966
  };
967
- T(() => (window.addEventListener("mousemove", M), window.addEventListener("mouseup", N), window.addEventListener("touchmove", M, {
967
+ I(() => (window.addEventListener("mousemove", M), window.addEventListener("mouseup", N), window.addEventListener("touchmove", M, {
968
968
  passive: !1
969
969
  }), window.addEventListener("touchend", N), () => {
970
970
  window.removeEventListener("mousemove", M), window.removeEventListener("mouseup", N), window.removeEventListener("touchmove", M), window.removeEventListener("touchend", N);
971
- }), [M, N]), T(() => (R.current = !0, () => {
971
+ }), [M, N]), I(() => (R.current = !0, () => {
972
972
  R.current = !1;
973
973
  }), []);
974
974
  const oi = s || c, Pe = Vl(x, e) === "loading";
975
975
  return /* @__PURE__ */ l(
976
- Tt,
976
+ It,
977
977
  {
978
978
  onMouseEnter: G,
979
979
  onMouseLeave: ue,
@@ -1065,7 +1065,7 @@ function y2(e) {
1065
1065
  };
1066
1066
  return e.alt && (t.alt = e.alt), e.title && (t.title = e.title), e.width && (t.width = e.width), e.height && (t.height = e.height), t;
1067
1067
  }
1068
- const x2 = Tl.extend({
1068
+ const x2 = Il.extend({
1069
1069
  content: "inline*",
1070
1070
  addOptions() {
1071
1071
  return {
@@ -1192,7 +1192,7 @@ function A2(e, t) {
1192
1192
  return t;
1193
1193
  return null;
1194
1194
  }
1195
- const T2 = Ue.create({
1195
+ const I2 = Ue.create({
1196
1196
  name: "nodeBackground",
1197
1197
  addOptions() {
1198
1198
  return {
@@ -1270,7 +1270,7 @@ function hi(e, t, n) {
1270
1270
  return n;
1271
1271
  return null;
1272
1272
  }
1273
- const I2 = Ue.create({
1273
+ const T2 = Ue.create({
1274
1274
  name: "nodeAlignment",
1275
1275
  addOptions() {
1276
1276
  return {
@@ -1429,7 +1429,7 @@ const Dl = (e) => {
1429
1429
  }
1430
1430
  }
1431
1431
  }, M2 = ({ children: e }) => {
1432
- const [t, n] = I(null), o = A(
1432
+ const [t, n] = T(null), o = A(
1433
1433
  (r, i) => {
1434
1434
  const a = i?.topOffset ?? 0, s = i?.behavior ?? "smooth";
1435
1435
  S2(r, a, s);
@@ -1483,7 +1483,7 @@ function R2(e) {
1483
1483
  style: { backgroundColor: d || void 0 },
1484
1484
  ...y
1485
1485
  };
1486
- return C.length ? /* @__PURE__ */ m(Tt, { ...x, children: [
1486
+ return C.length ? /* @__PURE__ */ m(It, { ...x, children: [
1487
1487
  h && /* @__PURE__ */ l("div", { className: "tiptap-table-of-contents-title", children: "Table of contents" }),
1488
1488
  /* @__PURE__ */ l(
1489
1489
  "nav",
@@ -1505,9 +1505,9 @@ function R2(e) {
1505
1505
  ))
1506
1506
  }
1507
1507
  )
1508
- ] }) : /* @__PURE__ */ l(Tt, { ...x, children: /* @__PURE__ */ l("div", { className: "tiptap-table-of-contents-empty", children: "Add headings to create a table of contents." }) });
1508
+ ] }) : /* @__PURE__ */ l(It, { ...x, children: /* @__PURE__ */ l("div", { className: "tiptap-table-of-contents-empty", children: "Add headings to create a table of contents." }) });
1509
1509
  }
1510
- const E2 = Ic.create({
1510
+ const E2 = Tc.create({
1511
1511
  name: "tocNode",
1512
1512
  group: "block customNode",
1513
1513
  draggable: !0,
@@ -1646,8 +1646,8 @@ function $2({
1646
1646
  code: e,
1647
1647
  i18n: t
1648
1648
  }) {
1649
- const n = $(null), [o, r] = I(null);
1650
- return T(() => {
1649
+ const n = $(null), [o, r] = T(null);
1650
+ return I(() => {
1651
1651
  const i = n.current;
1652
1652
  if (!i)
1653
1653
  return;
@@ -1674,8 +1674,8 @@ function _2({
1674
1674
  code: e,
1675
1675
  i18n: t
1676
1676
  }) {
1677
- const n = X1(), [o, r] = I(""), [i, a] = I(null);
1678
- return T(() => {
1677
+ const n = X1(), [o, r] = T(""), [i, a] = T(null);
1678
+ return I(() => {
1679
1679
  let s = !1;
1680
1680
  async function c() {
1681
1681
  try {
@@ -1703,11 +1703,11 @@ function _2({
1703
1703
  ] });
1704
1704
  }
1705
1705
  function z2(e) {
1706
- const t = e.extension.options.i18n ?? Ze(), n = W2(e.node.attrs.language, t), r = !!Ul(n), [i, a] = I(r), s = e.node.textContent, c = r && e.editor.isEditable;
1707
- return T(() => {
1706
+ const t = e.extension.options.i18n ?? Ze(), n = W2(e.node.attrs.language, t), r = !!Ul(n), [i, a] = T(r), s = e.node.textContent, c = r && e.editor.isEditable;
1707
+ return I(() => {
1708
1708
  a(r);
1709
1709
  }, [r, n]), /* @__PURE__ */ m(
1710
- Tt,
1710
+ It,
1711
1711
  {
1712
1712
  className: "code-block-node",
1713
1713
  "data-collapsed": i ? "true" : "false",
@@ -1888,11 +1888,11 @@ function X2({
1888
1888
  delay: r = 600,
1889
1889
  closeDelay: i = 0
1890
1890
  } = {}) {
1891
- const [a, s] = I(e), c = n ?? a, u = o ?? s, d = Nt({
1891
+ const [a, s] = T(e), c = n ?? a, u = o ?? s, d = Nt({
1892
1892
  placement: t,
1893
1893
  open: c,
1894
1894
  onOpenChange: u,
1895
- whileElementsMounted: Il,
1895
+ whileElementsMounted: Tl,
1896
1896
  middleware: [
1897
1897
  st(4),
1898
1898
  xo({
@@ -2070,7 +2070,7 @@ const zl = S(({ className: e, ...t }) => /* @__PURE__ */ l(
2070
2070
  ));
2071
2071
  zl.displayName = "CloseIcon";
2072
2072
  function Q2(e) {
2073
- const [t, n] = I([]), o = async (s) => {
2073
+ const [t, n] = T([]), o = async (s) => {
2074
2074
  if (s.size > e.maxSize) {
2075
2075
  const f = new Error(
2076
2076
  `File size exceeds maximum allowed (${e.maxSize / 1024 / 1024}MB)`
@@ -2209,7 +2209,7 @@ const Fl = () => /* @__PURE__ */ m(
2209
2209
  onFile: e,
2210
2210
  children: t
2211
2211
  }) => {
2212
- const [n, o] = I(!1), [r, i] = I(!1);
2212
+ const [n, o] = T(!1), [r, i] = T(!1);
2213
2213
  return /* @__PURE__ */ l(
2214
2214
  "div",
2215
2215
  {
@@ -2338,7 +2338,7 @@ const Fl = () => /* @__PURE__ */ m(
2338
2338
  r.current && s.length === 0 && (r.current.value = "", r.current.click());
2339
2339
  }, g = s.length > 0;
2340
2340
  return /* @__PURE__ */ m(
2341
- Tt,
2341
+ It,
2342
2342
  {
2343
2343
  className: "tiptap-image-upload",
2344
2344
  tabIndex: 0,
@@ -2612,7 +2612,7 @@ function Vn(e, t) {
2612
2612
  const s = r.map(i).resolve(n.state.doc);
2613
2613
  return n.dispatch(n.state.tr.setSelection(s)), !0;
2614
2614
  } catch {
2615
- const s = i.map(o.from, -1), c = Ye(s, 0, n.state.doc.content.size), u = It.near(n.state.doc.resolve(c), -1);
2615
+ const s = i.map(o.from, -1), c = Ye(s, 0, n.state.doc.content.size), u = Tt.near(n.state.doc.resolve(c), -1);
2616
2616
  return n.dispatch(n.state.tr.setSelection(u)), !1;
2617
2617
  }
2618
2618
  }
@@ -3000,7 +3000,7 @@ const yu = Sl.extend({
3000
3000
  // Table specifics
3001
3001
  "backgroundClip"
3002
3002
  ], xi = (e) => e.replace(/[A-Z]/g, (t) => "-" + t.toLowerCase());
3003
- function Tu(e, t) {
3003
+ function Iu(e, t) {
3004
3004
  const n = getComputedStyle(e);
3005
3005
  for (const o of Au) {
3006
3006
  const r = String(o), i = n.getPropertyValue(xi(r));
@@ -3012,7 +3012,7 @@ function Jl(e) {
3012
3012
  const t = e.cloneNode(!0), n = [{ src: e, dst: t }];
3013
3013
  for (; n.length; ) {
3014
3014
  const { src: o, dst: r } = n.shift();
3015
- o instanceof HTMLElement && r instanceof HTMLElement && Tu(o, r);
3015
+ o instanceof HTMLElement && r instanceof HTMLElement && Iu(o, r);
3016
3016
  const i = Array.from(o.children), a = Array.from(r.children), s = Math.min(i.length, a.length);
3017
3017
  for (let c = 0; c < s; c++) {
3018
3018
  const u = i[c], d = a[c];
@@ -3021,7 +3021,7 @@ function Jl(e) {
3021
3021
  }
3022
3022
  return t;
3023
3023
  }
3024
- function Iu(e, t) {
3024
+ function Tu(e, t) {
3025
3025
  Object.assign(e.style, {
3026
3026
  position: "fixed",
3027
3027
  top: "-10000px",
@@ -3082,7 +3082,7 @@ function Su(e, t) {
3082
3082
  }
3083
3083
  function Mu(e, t, n, o) {
3084
3084
  const r = e.view.dom.getBoundingClientRect(), i = Math.max(0, r.width), a = document.createElement("div");
3085
- Iu(a, i);
3085
+ Tu(a, i);
3086
3086
  const s = e.view.nodeDOM(o);
3087
3087
  if (!s)
3088
3088
  return document.body.appendChild(a), a;
@@ -3556,7 +3556,7 @@ function Dn(e, t, n, o, r) {
3556
3556
  placement: i,
3557
3557
  middleware: [
3558
3558
  st(a),
3559
- To({
3559
+ Io({
3560
3560
  apply({ rects: h, elements: g }) {
3561
3561
  if (!g.floating) return;
3562
3562
  const C = (e === "col" ? n?.width ?? o?.width : o?.width) ?? h.reference.width, b = (e === "row" ? n?.height ?? o?.height : o?.height) ?? h.reference.height;
@@ -3575,8 +3575,8 @@ function Dn(e, t, n, o, r) {
3575
3575
  }
3576
3576
  })
3577
3577
  ]
3578
- }), { isMounted: f, styles: p } = Io(u);
3579
- return T(() => {
3578
+ }), { isMounted: f, styles: p } = To(u);
3579
+ return I(() => {
3580
3580
  c();
3581
3581
  }, [
3582
3582
  c,
@@ -3585,7 +3585,7 @@ function Dn(e, t, n, o, r) {
3585
3585
  n,
3586
3586
  o,
3587
3587
  r
3588
- ]), T(() => {
3588
+ ]), I(() => {
3589
3589
  !n || !o || r && e === "cell" || s.setReference({
3590
3590
  getBoundingClientRect: () => Zu(
3591
3591
  e,
@@ -3638,7 +3638,7 @@ function Vo(e = {}) {
3638
3638
  initialState: n = null,
3639
3639
  watchFields: o,
3640
3640
  onStateChange: r
3641
- } = e, { editor: i } = k(t), [a, s] = I(n), c = $(n), u = A(
3641
+ } = e, { editor: i } = k(t), [a, s] = T(n), c = $(n), u = A(
3642
3642
  (d) => {
3643
3643
  o && c.current && !o.some(
3644
3644
  (p) => c.current[p] !== d[p]
@@ -3646,7 +3646,7 @@ function Vo(e = {}) {
3646
3646
  },
3647
3647
  [o, r]
3648
3648
  );
3649
- return T(() => {
3649
+ return I(() => {
3650
3650
  if (!i) {
3651
3651
  s(null), c.current = null, r?.(null);
3652
3652
  return;
@@ -3775,12 +3775,12 @@ function Fu({ className: e, ...t }) {
3775
3775
  }
3776
3776
  );
3777
3777
  }
3778
- const Gu = typeof window < "u" ? an : T;
3778
+ const Gu = typeof window < "u" ? an : I;
3779
3779
  function Ku(e, t, n, o) {
3780
3780
  const r = $(t);
3781
3781
  Gu(() => {
3782
3782
  r.current = t;
3783
- }, [t]), T(() => {
3783
+ }, [t]), I(() => {
3784
3784
  const i = window;
3785
3785
  if (!(i && i.addEventListener)) return;
3786
3786
  const a = (s) => {
@@ -3824,7 +3824,7 @@ function ut({
3824
3824
  onValuesChange: i,
3825
3825
  ...a
3826
3826
  }) {
3827
- const s = !Ce.useMenuContext(), [c, u] = I(!1), d = !!i || s, f = A(
3827
+ const s = !Ce.useMenuContext(), [c, u] = T(!1), d = !!i || s, f = A(
3828
3828
  (g) => {
3829
3829
  a.open === void 0 && u(g), o?.(g);
3830
3830
  },
@@ -4660,7 +4660,7 @@ const fa = ["table"], pa = {
4660
4660
  nodeVerticalAlign: null,
4661
4661
  nodeTextAlign: null
4662
4662
  };
4663
- function Ti(e) {
4663
+ function Ii(e) {
4664
4664
  try {
4665
4665
  return du(pa)(e.state, e.view.dispatch);
4666
4666
  } catch (t) {
@@ -4714,13 +4714,13 @@ function pd(e, t = !1) {
4714
4714
  try {
4715
4715
  const { selection: n } = e.state;
4716
4716
  if (n instanceof Q)
4717
- return t && Ti(e), Hc(e.state, e.view.dispatch), !0;
4717
+ return t && Ii(e), Hc(e.state, e.view.dispatch), !0;
4718
4718
  const { $anchor: o } = n, r = Me(o);
4719
4719
  if (!r) return !1;
4720
4720
  const i = e.state.doc.nodeAt(r.pos);
4721
4721
  if (!i) return !1;
4722
4722
  const a = r.pos + 1, s = r.pos + i.nodeSize - 1;
4723
- return a >= s ? !1 : (t && Ti(e), e.view.dispatch(e.state.tr.delete(a, s)), !0);
4723
+ return a >= s ? !1 : (t && Ii(e), e.view.dispatch(e.state.tr.delete(a, s)), !0);
4724
4724
  } catch (n) {
4725
4725
  return console.error("Error clearing selected cells:", n), !1;
4726
4726
  }
@@ -5254,10 +5254,10 @@ function Fo({
5254
5254
  const { map: s, node: c } = i, u = a.index, d = a.orientation;
5255
5255
  return !(typeof u != "number" || u < 0 || d === "column" && u >= s.width || d === "row" && u >= s.height || r === "left" && d === "column" && xd(s, c, u) || r === "above" && d === "row" && Ad(s, c, u));
5256
5256
  }
5257
- function Td(e, t, n) {
5257
+ function Id(e, t, n) {
5258
5258
  return t === "row" ? n === "above" ? e : e + 1 : n === "left" ? e : e + 1;
5259
5259
  }
5260
- function Id({
5260
+ function Td({
5261
5261
  editor: e,
5262
5262
  index: t,
5263
5263
  orientation: n,
@@ -5283,7 +5283,7 @@ function Id({
5283
5283
  f = d(g, u);
5284
5284
  }
5285
5285
  if (f) {
5286
- const p = Td(s, a, o);
5286
+ const p = Id(s, a, o);
5287
5287
  No(e, a, p, r);
5288
5288
  }
5289
5289
  return f;
@@ -5324,7 +5324,7 @@ function Ge(e) {
5324
5324
  tablePos: i,
5325
5325
  side: r
5326
5326
  }), h = A(() => {
5327
- const b = Id({
5327
+ const b = Td({
5328
5328
  editor: c,
5329
5329
  index: n,
5330
5330
  orientation: o,
@@ -5624,11 +5624,11 @@ const Aa = S(({ className: e, ...t }) => /* @__PURE__ */ m(
5624
5624
  }
5625
5625
  ));
5626
5626
  Aa.displayName = "ArrowDownZAIcon";
5627
- const Ta = ["tableHandleExtension"], Ed = {
5627
+ const Ia = ["tableHandleExtension"], Ed = {
5628
5628
  asc: jo,
5629
5629
  desc: Aa
5630
5630
  };
5631
- function Ia(e) {
5631
+ function Ta(e) {
5632
5632
  return e ? e.type.name === "tableHeader" || e.type.name === "table_header" || e.attrs?.header === !0 : !1;
5633
5633
  }
5634
5634
  function Hd(e) {
@@ -5642,7 +5642,7 @@ function qo({
5642
5642
  orientation: n,
5643
5643
  tablePos: o
5644
5644
  }) {
5645
- if (!e || !e.isEditable || !F(e, Ta))
5645
+ if (!e || !e.isEditable || !F(e, Ia))
5646
5646
  return !1;
5647
5647
  try {
5648
5648
  const r = ce(e, o);
@@ -5652,7 +5652,7 @@ function qo({
5652
5652
  if (r.map.width < 2) return !1;
5653
5653
  } else if (r.map.height < 2) return !1;
5654
5654
  return !(i.mergedCells.length > 0 || !i.cells.some(
5655
- (s) => s.node && !Ia(s.node) && !je(s.node)
5655
+ (s) => s.node && !Ta(s.node) && !je(s.node)
5656
5656
  ));
5657
5657
  } catch {
5658
5658
  return !1;
@@ -5675,7 +5675,7 @@ function Nd({
5675
5675
  return !1;
5676
5676
  const u = c.cells.map(
5677
5677
  (C, b) => {
5678
- const w = Ia(C.node), v = C.node ? je(C.node) : !0;
5678
+ const w = Ta(C.node), v = C.node ? je(C.node) : !0;
5679
5679
  return {
5680
5680
  sortText: Hd(C.node),
5681
5681
  originalNode: C.node,
@@ -5732,7 +5732,7 @@ function Vd({
5732
5732
  hideWhenUnavailable: o,
5733
5733
  tablePos: r
5734
5734
  }) {
5735
- return !e || !e.isEditable || !F(e, Ta) || !ce(e, r) || !oe(
5735
+ return !e || !e.isEditable || !F(e, Ia) || !ce(e, r) || !oe(
5736
5736
  e,
5737
5737
  t,
5738
5738
  n,
@@ -5909,8 +5909,8 @@ const kt = P(
5909
5909
  );
5910
5910
  kt.displayName = "ColorTextButton";
5911
5911
  function de(e = "max", t = 768) {
5912
- const [n, o] = I(void 0);
5913
- return T(() => {
5912
+ const [n, o] = T(void 0);
5913
+ return I(() => {
5914
5914
  const r = e === "min" ? `(min-width: ${t}px)` : `(max-width: ${t - 1}px)`, i = window.matchMedia(r), a = (s) => o(s.matches);
5915
5915
  return o(i.matches), i.addEventListener("change", a), () => i.removeEventListener("change", a);
5916
5916
  }, [e, t]), !!n;
@@ -6012,8 +6012,8 @@ function La(e) {
6012
6012
  textColor: o,
6013
6013
  hideWhenUnavailable: r = !1,
6014
6014
  onApplied: i
6015
- } = e, { editor: a } = k(t), s = de(), [c, u] = I(!0), d = hn(a), f = Dd(a, o);
6016
- T(() => {
6015
+ } = e, { editor: a } = k(t), s = de(), [c, u] = T(!0), d = hn(a), f = Dd(a, o);
6016
+ I(() => {
6017
6017
  if (!a) return;
6018
6018
  const h = () => {
6019
6019
  u(Ud({ editor: a, hideWhenUnavailable: r }));
@@ -6282,8 +6282,8 @@ function Cn(e) {
6282
6282
  mode: i = "mark",
6283
6283
  useColorValue: a = !1,
6284
6284
  onApplied: s
6285
- } = e, { editor: c } = k(t), u = O(), d = de(), f = n || u.highlightColor, [p, h] = I(!0), g = Je(c, i), C = o && Pd(o, a), b = Wd(c, C, i);
6286
- T(() => {
6285
+ } = e, { editor: c } = k(t), u = O(), d = de(), f = n || u.highlightColor, [p, h] = T(!0), g = Je(c, i), C = o && Pd(o, a), b = Wd(c, C, i);
6286
+ I(() => {
6287
6287
  if (!c) return;
6288
6288
  const y = () => {
6289
6289
  h(Zd({ editor: c, hideWhenUnavailable: r, mode: i }));
@@ -6353,10 +6353,10 @@ function mn({
6353
6353
  orientation: a = "vertical",
6354
6354
  autoSelectFirstItem: s = !0
6355
6355
  }) {
6356
- const [c, u] = I(
6356
+ const [c, u] = T(
6357
6357
  s ? 0 : -1
6358
6358
  );
6359
- return T(() => {
6359
+ return I(() => {
6360
6360
  const d = (h) => {
6361
6361
  h.preventDefault(), h.stopPropagation();
6362
6362
  }, f = (h) => {
@@ -6402,7 +6402,7 @@ function mn({
6402
6402
  r,
6403
6403
  i,
6404
6404
  a
6405
- ]), T(() => {
6405
+ ]), I(() => {
6406
6406
  n && u(s ? 0 : -1);
6407
6407
  }, [n, s]), {
6408
6408
  selectedIndex: o.length ? c : void 0,
@@ -6578,7 +6578,7 @@ function Gd({
6578
6578
  }
6579
6579
  );
6580
6580
  }
6581
- function Ii({
6581
+ function Ti({
6582
6582
  type: e,
6583
6583
  colors: t,
6584
6584
  onColorSelected: n,
@@ -6722,7 +6722,7 @@ function jd({
6722
6722
  /* @__PURE__ */ m(De, { children: [
6723
6723
  /* @__PURE__ */ l(St, { children: i.textColor }),
6724
6724
  /* @__PURE__ */ l(
6725
- Ii,
6725
+ Ti,
6726
6726
  {
6727
6727
  type: "text",
6728
6728
  colors: d,
@@ -6737,7 +6737,7 @@ function jd({
6737
6737
  /* @__PURE__ */ m(De, { children: [
6738
6738
  /* @__PURE__ */ l(St, { children: i.highlightColor }),
6739
6739
  /* @__PURE__ */ l(
6740
- Ii,
6740
+ Ti,
6741
6741
  {
6742
6742
  type: "highlight",
6743
6743
  colors: f,
@@ -6761,7 +6761,7 @@ function qd({
6761
6761
  resolveColorValue: a,
6762
6762
  ...s
6763
6763
  }) {
6764
- const { editor: c } = k(e), u = O(), [d, f] = I(!1), {
6764
+ const { editor: c } = k(e), u = O(), [d, f] = T(!1), {
6765
6765
  isVisible: p,
6766
6766
  canToggle: h,
6767
6767
  activeTextStyle: g,
@@ -6841,8 +6841,8 @@ function Yd(e) {
6841
6841
  return t ? n ? t.isEditable ? t.isActive("code") ? !0 : hn(t) || Je(t) : !1 : !0 : !1;
6842
6842
  }
6843
6843
  function Ot(e = 3) {
6844
- const [t, n] = I([]), [o, r] = I(!1);
6845
- T(() => {
6844
+ const [t, n] = T([]), [o, r] = T(!1);
6845
+ I(() => {
6846
6846
  try {
6847
6847
  const a = localStorage.getItem("tiptapRecentlyUsedColors");
6848
6848
  if (a) {
@@ -6888,8 +6888,8 @@ function Xd(e) {
6888
6888
  editor: t,
6889
6889
  hideWhenUnavailable: n = !1,
6890
6890
  onColorChanged: o
6891
- } = e || {}, { editor: r } = k(t), i = O(), [a, s] = I(!0), c = Be("textStyle", r), u = Be("highlight", r), d = ui(r, "textStyle") || {}, f = ui(r, "highlight") || {}, p = hn(r) || Je(r);
6892
- T(() => {
6891
+ } = e || {}, { editor: r } = k(t), i = O(), [a, s] = T(!0), c = Be("textStyle", r), u = Be("highlight", r), d = ui(r, "textStyle") || {}, f = ui(r, "highlight") || {}, p = hn(r) || Je(r);
6892
+ I(() => {
6893
6893
  if (!r) return;
6894
6894
  const g = () => {
6895
6895
  s(
@@ -7151,7 +7151,7 @@ const Ma = ({ editor: e, color: t }) => {
7151
7151
  children: u,
7152
7152
  ...d
7153
7153
  }, f) => {
7154
- const { editor: p } = k(e), { isVisible: h, handleAlign: g, label: C, canAlignCell: b, Icon: w, isActive: v } = Ie({
7154
+ const { editor: p } = k(e), { isVisible: h, handleAlign: g, label: C, canAlignCell: b, Icon: w, isActive: v } = Te({
7155
7155
  editor: p,
7156
7156
  alignmentType: t,
7157
7157
  alignment: n,
@@ -7634,7 +7634,7 @@ function a7({
7634
7634
  }) {
7635
7635
  return !e || !e.isEditable || !F(e, ir) ? !1 : t ? typeof n == "number" && o ? lr({ editor: e, index: n, orientation: o }) : yn(e) : !0;
7636
7636
  }
7637
- function Ie(e) {
7637
+ function Te(e) {
7638
7638
  const {
7639
7639
  editor: t,
7640
7640
  alignmentType: n,
@@ -7784,38 +7784,38 @@ const ar = ({
7784
7784
  orientation: t
7785
7785
  }) => {
7786
7786
  const n = O(), o = {
7787
- left: Ie({
7787
+ left: Te({
7788
7788
  alignmentType: "text",
7789
7789
  alignment: "left",
7790
7790
  index: e,
7791
7791
  orientation: t
7792
7792
  }),
7793
- center: Ie({
7793
+ center: Te({
7794
7794
  alignmentType: "text",
7795
7795
  alignment: "center",
7796
7796
  index: e,
7797
7797
  orientation: t
7798
7798
  }),
7799
- right: Ie({
7799
+ right: Te({
7800
7800
  alignmentType: "text",
7801
7801
  alignment: "right",
7802
7802
  index: e,
7803
7803
  orientation: t
7804
7804
  })
7805
7805
  }, r = {
7806
- top: Ie({
7806
+ top: Te({
7807
7807
  alignmentType: "vertical",
7808
7808
  alignment: "top",
7809
7809
  index: e,
7810
7810
  orientation: t
7811
7811
  }),
7812
- middle: Ie({
7812
+ middle: Te({
7813
7813
  alignmentType: "vertical",
7814
7814
  alignment: "middle",
7815
7815
  index: e,
7816
7816
  orientation: t
7817
7817
  }),
7818
- bottom: Ie({
7818
+ bottom: Te({
7819
7819
  alignmentType: "vertical",
7820
7820
  alignment: "bottom",
7821
7821
  index: e,
@@ -7909,7 +7909,7 @@ function xn() {
7909
7909
  return e;
7910
7910
  }
7911
7911
  function Va(e, t) {
7912
- const { editor: n, orientation: o, index: r, tableNode: i, tablePos: a } = xn(), [s, c] = I(!1), [u, d] = I(!1), f = V(
7912
+ const { editor: n, orientation: o, index: r, tableNode: i, tablePos: a } = xn(), [s, c] = T(!1), [u, d] = T(!1), f = V(
7913
7913
  () => s7[o],
7914
7914
  [o]
7915
7915
  ), p = A(() => {
@@ -8313,7 +8313,7 @@ function Ba({
8313
8313
  rowButton: t,
8314
8314
  columnButton: n
8315
8315
  }) {
8316
- const { editor: o } = k(e), r = Vo({ editor: o }), [i, a] = I(!0), [s, c] = I(!0), [u, d] = I(null), f = V(() => {
8316
+ const { editor: o } = k(e), r = Vo({ editor: o }), [i, a] = T(!0), [s, c] = T(!0), [u, d] = T(null), f = V(() => {
8317
8317
  if (r?.draggingState)
8318
8318
  return {
8319
8319
  draggedCellOrientation: r.draggingState.draggedCellOrientation,
@@ -8378,7 +8378,7 @@ function p7(e, t) {
8378
8378
  };
8379
8379
  n.current = requestAnimationFrame(i);
8380
8380
  }, [e, t, o]);
8381
- T(() => {
8381
+ I(() => {
8382
8382
  if (!e) return;
8383
8383
  const i = ({ transaction: a }) => {
8384
8384
  t();
@@ -8492,10 +8492,10 @@ const g7 = 5, C7 = (e, t, n, o) => {
8492
8492
  showResizeHandles: n = !0,
8493
8493
  onMenuOpenChange: o
8494
8494
  }) => {
8495
- const { editor: r } = k(e), [i, a] = I(!0), [s, c] = I(null), [u, d] = I(null), [f, p] = I(null), [h, g] = I(!1), C = h7(r), b = $(null), w = $(null), v = $(null), { refs: y, floatingStyles: x, update: L } = Nt({
8495
+ const { editor: r } = k(e), [i, a] = T(!0), [s, c] = T(null), [u, d] = T(null), [f, p] = T(null), [h, g] = T(!1), C = h7(r), b = $(null), w = $(null), v = $(null), { refs: y, floatingStyles: x, update: L } = Nt({
8496
8496
  placement: "top-start"
8497
8497
  });
8498
- T(() => {
8498
+ I(() => {
8499
8499
  if (s) {
8500
8500
  const Z = w7(s);
8501
8501
  y.setPositionReference(Z);
@@ -8523,7 +8523,7 @@ const g7 = 5, C7 = (e, t, n, o) => {
8523
8523
  }
8524
8524
  a(!1), c((N) => N && null);
8525
8525
  }, [r, C]);
8526
- p7(r, E), T(() => {
8526
+ p7(r, E), I(() => {
8527
8527
  L && s && L();
8528
8528
  }, [L, s]);
8529
8529
  const R = A(
@@ -8608,7 +8608,7 @@ const g7 = 5, C7 = (e, t, n, o) => {
8608
8608
  },
8609
8609
  [o]
8610
8610
  );
8611
- if (T(() => {
8611
+ if (I(() => {
8612
8612
  if (!r || !C) return;
8613
8613
  const Z = () => {
8614
8614
  E(), U();
@@ -8616,7 +8616,7 @@ const g7 = 5, C7 = (e, t, n, o) => {
8616
8616
  return r.on("selectionUpdate", Z), E(), U(), () => {
8617
8617
  r.off("selectionUpdate", Z);
8618
8618
  };
8619
- }, [r, C, E, U]), T(() => {
8619
+ }, [r, C, E, U]), I(() => {
8620
8620
  const Z = f?.querySelector(
8621
8621
  ".table-selection-overlay-container"
8622
8622
  );
@@ -8728,7 +8728,7 @@ const g7 = 5, C7 = (e, t, n, o) => {
8728
8728
  ] })
8729
8729
  }
8730
8730
  ) });
8731
- }, T7 = P(
8731
+ }, I7 = P(
8732
8732
  ({
8733
8733
  editor: e,
8734
8734
  action: t,
@@ -8774,7 +8774,7 @@ const g7 = 5, C7 = (e, t, n, o) => {
8774
8774
  ) : null;
8775
8775
  }
8776
8776
  );
8777
- T7.displayName = "TableMergeSplitCellButton";
8777
+ I7.displayName = "TableMergeSplitCellButton";
8778
8778
  const Da = S(({ className: e, ...t }) => /* @__PURE__ */ m(
8779
8779
  "svg",
8780
8780
  {
@@ -8889,7 +8889,7 @@ const Ua = S(({ className: e, ...t }) => /* @__PURE__ */ m(
8889
8889
  }
8890
8890
  ));
8891
8891
  Ua.displayName = "TableCellSplitIcon";
8892
- const sr = ["table"], I7 = {
8892
+ const sr = ["table"], T7 = {
8893
8893
  merge: Da,
8894
8894
  split: Ua
8895
8895
  };
@@ -8969,7 +8969,7 @@ function Mt(e) {
8969
8969
  canExecute: c,
8970
8970
  handleExecute: u,
8971
8971
  label: n === "merge" ? a.mergeCells : a.splitCell,
8972
- Icon: I7[n]
8972
+ Icon: T7[n]
8973
8973
  };
8974
8974
  }
8975
8975
  const Oa = S(({ className: e, ...t }) => /* @__PURE__ */ l(
@@ -9023,7 +9023,7 @@ function E7(e) {
9023
9023
  };
9024
9024
  }
9025
9025
  function H7({ editor: e }) {
9026
- const [t, n] = I(!1), o = A(() => {
9026
+ const [t, n] = T(!1), o = A(() => {
9027
9027
  n(!1), e?.commands.unfreezeHandles();
9028
9028
  }, [e]), r = A(
9029
9029
  (i) => {
@@ -9084,7 +9084,7 @@ const Un = ({ action: e }) => {
9084
9084
  const { editor: i } = k(e), a = O(), { isMenuOpen: s, handleMenuToggle: c, closeMenu: u } = H7({
9085
9085
  editor: i
9086
9086
  });
9087
- return T(() => {
9087
+ return I(() => {
9088
9088
  t?.(s);
9089
9089
  }, [s, t]), /* @__PURE__ */ l(
9090
9090
  ut,
@@ -9306,7 +9306,7 @@ function z7(e, t) {
9306
9306
  e.view.focus();
9307
9307
  return;
9308
9308
  }
9309
- const o = It.near(
9309
+ const o = Tt.near(
9310
9310
  e.state.doc.resolve(n.pos)
9311
9311
  );
9312
9312
  e.view.dispatch(e.state.tr.setSelection(o)), e.view.focus();
@@ -9466,22 +9466,22 @@ function K7(e, t) {
9466
9466
  editor: e,
9467
9467
  resetAttrs: !0,
9468
9468
  hideWhenUnavailable: !0
9469
- }), i = Ie({
9469
+ }), i = Te({
9470
9470
  editor: e,
9471
9471
  alignmentType: "text",
9472
9472
  alignment: "left",
9473
9473
  hideWhenUnavailable: !0
9474
- }), a = Ie({
9474
+ }), a = Te({
9475
9475
  editor: e,
9476
9476
  alignmentType: "text",
9477
9477
  alignment: "center",
9478
9478
  hideWhenUnavailable: !0
9479
- }), s = Ie({
9479
+ }), s = Te({
9480
9480
  editor: e,
9481
9481
  alignmentType: "text",
9482
9482
  alignment: "right",
9483
9483
  hideWhenUnavailable: !0
9484
- }), c = Ie({
9484
+ }), c = Te({
9485
9485
  editor: e,
9486
9486
  alignmentType: "vertical",
9487
9487
  alignment: "middle",
@@ -9556,7 +9556,7 @@ function K7(e, t) {
9556
9556
  );
9557
9557
  }
9558
9558
  function j7({ editor: e }) {
9559
- const t = O(), n = $(null), [o, r] = I(null), [i, a] = I(null), s = A(() => {
9559
+ const t = O(), n = $(null), [o, r] = T(null), [i, a] = T(null), s = A(() => {
9560
9560
  r(null), a(null), e?.commands.unfreezeHandles?.();
9561
9561
  }, [e]), c = Ri({
9562
9562
  editor: e,
@@ -9592,7 +9592,7 @@ function j7({ editor: e }) {
9592
9592
  }),
9593
9593
  [f, t.fitToWidth]
9594
9594
  );
9595
- return T(() => {
9595
+ return I(() => {
9596
9596
  if (!e) return;
9597
9597
  const g = e.view.dom, C = (b) => {
9598
9598
  if (!e.isEditable || !P7(b.target)) {
@@ -9616,7 +9616,7 @@ function j7({ editor: e }) {
9616
9616
  n.current.getBoundingClientRect()
9617
9617
  );
9618
9618
  (g.x !== o.x || g.y !== o.y) && r(g);
9619
- }, [o]), T(() => {
9619
+ }, [o]), I(() => {
9620
9620
  if (!o) return;
9621
9621
  const g = (b) => {
9622
9622
  n.current?.contains(b.target) || s();
@@ -9694,7 +9694,7 @@ function Ei(e, t, n) {
9694
9694
  placement: o.placement,
9695
9695
  middleware: [
9696
9696
  st(4),
9697
- To({
9697
+ Io({
9698
9698
  apply({ rects: f, elements: p }) {
9699
9699
  const h = p.floating;
9700
9700
  if (!h) return;
@@ -9703,13 +9703,13 @@ function Ei(e, t, n) {
9703
9703
  }
9704
9704
  })
9705
9705
  ]
9706
- }), { isMounted: c, styles: u } = Io(a), d = A(
9706
+ }), { isMounted: c, styles: u } = To(a), d = A(
9707
9707
  (f) => ({
9708
9708
  getBoundingClientRect: () => f
9709
9709
  }),
9710
9710
  []
9711
9711
  );
9712
- return T(() => {
9712
+ return I(() => {
9713
9713
  n && (r.setReference(d(n)), i());
9714
9714
  }, [n, r, i, d]), V(
9715
9715
  () => ({
@@ -9749,7 +9749,7 @@ const Hi = ({
9749
9749
  orientation: o,
9750
9750
  children: r
9751
9751
  }) => {
9752
- const { editor: i } = k(e), a = Vo({ editor: i }), s = o === "row", c = $(!1), [u, d] = I(null), f = A(
9752
+ const { editor: i } = k(e), a = Vo({ editor: i }), s = o === "row", c = $(!1), [u, d] = T(null), f = A(
9753
9753
  (h) => {
9754
9754
  if (!a) return;
9755
9755
  const g = We.get(a.block);
@@ -9765,7 +9765,7 @@ const Hi = ({
9765
9765
  Bn(i, a.block, a.blockPos, o), s ? i.commands.addRowAfter() : i.commands.addColumnAfter();
9766
9766
  });
9767
9767
  }, [i, s, o, a]);
9768
- return T(() => {
9768
+ return I(() => {
9769
9769
  if (!u || !i || !a) return;
9770
9770
  const h = (C) => {
9771
9771
  c.current = !0;
@@ -9841,7 +9841,7 @@ function _a(e, t, n, o, r) {
9841
9841
  const { dismissOptions: i, ...a } = o || {}, { refs: s, context: c, floatingStyles: u } = Nt({
9842
9842
  open: e,
9843
9843
  whileElementsMounted(C, b, w) {
9844
- return Il(
9844
+ return Tl(
9845
9845
  C,
9846
9846
  b,
9847
9847
  w,
@@ -9849,8 +9849,8 @@ function _a(e, t, n, o, r) {
9849
9849
  );
9850
9850
  },
9851
9851
  ...a
9852
- }), { isMounted: d, styles: f } = Io(c), p = Ll(c, i), { getReferenceProps: h, getFloatingProps: g } = kl([p]);
9853
- return T(() => {
9852
+ }), { isMounted: d, styles: f } = To(c), p = Ll(c, i), { getReferenceProps: h, getFloatingProps: g } = kl([p]);
9853
+ return I(() => {
9854
9854
  if (t === null) {
9855
9855
  s.setReference(null);
9856
9856
  return;
@@ -9913,7 +9913,7 @@ const fr = ({
9913
9913
  pluginKey: i = qc,
9914
9914
  ...a
9915
9915
  }) => {
9916
- const { editor: s } = k(e), [c, u] = I(!1), [d, f] = I(null), [p, h] = I(null), [g, C] = I([]), [b, w] = I(""), [, v] = I(null), { ref: y, style: x, getFloatingProps: L, isMounted: E } = _a(
9916
+ const { editor: s } = k(e), [c, u] = T(!1), [d, f] = T(null), [p, h] = T(null), [g, C] = T([]), [b, w] = T(""), [, v] = T(null), { ref: y, style: x, getFloatingProps: L, isMounted: E } = _a(
9917
9917
  c,
9918
9918
  d,
9919
9919
  1e3,
@@ -9926,7 +9926,7 @@ const fr = ({
9926
9926
  crossAxis: !1
9927
9927
  }),
9928
9928
  Ao(),
9929
- To({
9929
+ Io({
9930
9930
  apply({ availableHeight: Z, elements: J }) {
9931
9931
  if (J.floating) {
9932
9932
  const M = r ? Math.min(r, Z) : Z;
@@ -9944,13 +9944,13 @@ const fr = ({
9944
9944
  ...t
9945
9945
  }
9946
9946
  ), R = $(a);
9947
- T(() => {
9947
+ I(() => {
9948
9948
  R.current = a;
9949
9949
  }, [a]);
9950
9950
  const U = A(() => {
9951
9951
  u(!1);
9952
9952
  }, []);
9953
- T(() => {
9953
+ I(() => {
9954
9954
  if (!s || s.isDestroyed)
9955
9955
  return;
9956
9956
  s.state.plugins.find(
@@ -10133,7 +10133,7 @@ const Ga = (e, t, n = ["imageUpload", "horizontalRule"]) => {
10133
10133
  return (o ? n.filter((i) => r4(o, i)).slice(0, Ni) : n.slice(0, Ni)).sort(o4);
10134
10134
  }, l4 = (e) => {
10135
10135
  const { emoji: t, isSelected: n, onSelect: o, selector: r } = e, i = $(null);
10136
- return T(() => {
10136
+ return I(() => {
10137
10137
  const a = document.querySelector(r);
10138
10138
  if (!i.current || !n || !a) return;
10139
10139
  const s = Fa(i.current, a);
@@ -10316,7 +10316,7 @@ const qa = $e(void 0), Ya = () => {
10316
10316
  throw new Error("Avatar components must be used within an Avatar.Root");
10317
10317
  return e;
10318
10318
  }, v4 = (e, t) => {
10319
- const n = e ? "loading" : "error", [o, r] = I(n);
10319
+ const n = e ? "loading" : "error", [o, r] = T(n);
10320
10320
  return an(() => {
10321
10321
  if (!e)
10322
10322
  return;
@@ -10328,9 +10328,9 @@ const qa = $e(void 0), Ya = () => {
10328
10328
  i = !1;
10329
10329
  };
10330
10330
  }, [e, t]), o;
10331
- }, Tn = P(
10331
+ }, In = P(
10332
10332
  ({ children: e, className: t = "", size: n = "default", userColor: o, ...r }, i) => {
10333
- const [a, s] = I("idle"), c = A(
10333
+ const [a, s] = T("idle"), c = A(
10334
10334
  (f) => {
10335
10335
  s(f);
10336
10336
  },
@@ -10356,7 +10356,7 @@ const qa = $e(void 0), Ya = () => {
10356
10356
  ) });
10357
10357
  }
10358
10358
  );
10359
- Tn.displayName = "Avatar";
10359
+ In.displayName = "Avatar";
10360
10360
  const hr = P(
10361
10361
  ({ onLoadingStatusChange: e, src: t, className: n = "", ...o }, r) => {
10362
10362
  const { onImageLoadingStatusChange: i } = Ya(), a = v4(t, o.referrerPolicy);
@@ -10375,10 +10375,10 @@ const hr = P(
10375
10375
  }
10376
10376
  );
10377
10377
  hr.displayName = "AvatarImage";
10378
- const In = P(
10378
+ const Tn = P(
10379
10379
  ({ delayMs: e, className: t = "", children: n, ...o }, r) => {
10380
- const i = Ya(), [a, s] = I(e === void 0);
10381
- return T(() => {
10380
+ const i = Ya(), [a, s] = T(e === void 0);
10381
+ return I(() => {
10382
10382
  if (e !== void 0) {
10383
10383
  const c = window.setTimeout(() => s(!0), e);
10384
10384
  return () => window.clearTimeout(c);
@@ -10397,7 +10397,7 @@ const In = P(
10397
10397
  ] });
10398
10398
  }
10399
10399
  );
10400
- In.displayName = "AvatarFallback";
10400
+ Tn.displayName = "AvatarFallback";
10401
10401
  const Xa = ({
10402
10402
  maxVisible: e,
10403
10403
  children: t,
@@ -10419,7 +10419,7 @@ const Xa = ({
10419
10419
  "data-max-user-visible": e,
10420
10420
  children: [
10421
10421
  i,
10422
- a > 0 && /* @__PURE__ */ l(Tn, { ...s, children: /* @__PURE__ */ m(In, { children: [
10422
+ a > 0 && /* @__PURE__ */ l(In, { ...s, children: /* @__PURE__ */ m(Tn, { children: [
10423
10423
  "+",
10424
10424
  a
10425
10425
  ] }) })
@@ -10433,7 +10433,7 @@ const y4 = ({
10433
10433
  ...t
10434
10434
  }) => {
10435
10435
  const n = $(e);
10436
- T(() => {
10436
+ I(() => {
10437
10437
  n.current = e;
10438
10438
  }, [e]);
10439
10439
  const o = (i) => {
@@ -10470,7 +10470,7 @@ const y4 = ({
10470
10470
  );
10471
10471
  }, x4 = ({ item: e, isSelected: t, onSelect: n }) => {
10472
10472
  const o = $(null);
10473
- return T(() => {
10473
+ return I(() => {
10474
10474
  const r = document.querySelector(
10475
10475
  '[data-selector="tiptap-mention-dropdown-menu"]'
10476
10476
  );
@@ -10486,9 +10486,9 @@ const y4 = ({
10486
10486
  onClick: n,
10487
10487
  "data-user-id": e.context?.id,
10488
10488
  children: [
10489
- /* @__PURE__ */ m(Tn, { userColor: e.context?.color, children: [
10489
+ /* @__PURE__ */ m(In, { userColor: e.context?.color, children: [
10490
10490
  /* @__PURE__ */ l(hr, { src: e.context?.avatar, alt: e.title }),
10491
- /* @__PURE__ */ l(In, { children: e.title[0]?.toUpperCase() })
10491
+ /* @__PURE__ */ l(Tn, { children: e.title[0]?.toUpperCase() })
10492
10492
  ] }),
10493
10493
  /* @__PURE__ */ l("span", { className: "tiptap-button-text", children: e.title })
10494
10494
  ]
@@ -10977,7 +10977,7 @@ const Ar = S(({ className: e, ...t }) => /* @__PURE__ */ l(
10977
10977
  }
10978
10978
  ));
10979
10979
  Ar.displayName = "TypeIcon";
10980
- const Tr = S(({ className: e, ...t }) => /* @__PURE__ */ l(
10980
+ const Ir = S(({ className: e, ...t }) => /* @__PURE__ */ l(
10981
10981
  "svg",
10982
10982
  {
10983
10983
  width: "24",
@@ -10998,8 +10998,8 @@ const Tr = S(({ className: e, ...t }) => /* @__PURE__ */ l(
10998
10998
  )
10999
10999
  }
11000
11000
  ));
11001
- Tr.displayName = "AtSignIcon";
11002
- const Ir = S(({ className: e, ...t }) => /* @__PURE__ */ l(
11001
+ Ir.displayName = "AtSignIcon";
11002
+ const Tr = S(({ className: e, ...t }) => /* @__PURE__ */ l(
11003
11003
  "svg",
11004
11004
  {
11005
11005
  width: "24",
@@ -11020,7 +11020,7 @@ const Ir = S(({ className: e, ...t }) => /* @__PURE__ */ l(
11020
11020
  )
11021
11021
  }
11022
11022
  ));
11023
- Ir.displayName = "SmilePlusIcon";
11023
+ Tr.displayName = "SmilePlusIcon";
11024
11024
  const es = S(({ className: e, ...t }) => /* @__PURE__ */ l(
11025
11025
  "svg",
11026
11026
  {
@@ -11145,12 +11145,12 @@ const eo = S(({ className: e, ...t }) => /* @__PURE__ */ m(
11145
11145
  }
11146
11146
  ));
11147
11147
  eo.displayName = "AiSparklesIcon";
11148
- function T4({
11148
+ function I4({
11149
11149
  shortcutKeys: e = to
11150
11150
  }) {
11151
11151
  return /* @__PURE__ */ l(re, { children: ne({ shortcutKeys: e }) });
11152
11152
  }
11153
- const I4 = P(
11153
+ const T4 = P(
11154
11154
  ({
11155
11155
  editor: e,
11156
11156
  node: t,
@@ -11201,20 +11201,20 @@ const I4 = P(
11201
11201
  children: u ?? /* @__PURE__ */ m(B, { children: [
11202
11202
  /* @__PURE__ */ l(v, { className: "tiptap-button-icon" }),
11203
11203
  o && /* @__PURE__ */ l("span", { className: "tiptap-button-text", children: o }),
11204
- s && /* @__PURE__ */ l(T4, { shortcutKeys: w })
11204
+ s && /* @__PURE__ */ l(I4, { shortcutKeys: w })
11205
11205
  ] })
11206
11206
  }
11207
11207
  ) : null;
11208
11208
  }
11209
11209
  );
11210
- I4.displayName = "EmojiTriggerButton";
11210
+ T4.displayName = "EmojiTriggerButton";
11211
11211
  const to = "mod+shift+e";
11212
11212
  function kr(e) {
11213
11213
  return !(!e || !e.isEditable || he(e, ["image"]));
11214
11214
  }
11215
11215
  function L4(e, t, n, o) {
11216
11216
  if (n != null || te(o)) {
11217
- const i = Te({
11217
+ const i = Ie({
11218
11218
  editor: e,
11219
11219
  node: n || void 0,
11220
11220
  nodePos: o || void 0
@@ -11237,7 +11237,7 @@ function L4(e, t, n, o) {
11237
11237
  }
11238
11238
  function k4(e, t, n, o) {
11239
11239
  if (n != null || te(o)) {
11240
- const s = Te({
11240
+ const s = Ie({
11241
11241
  editor: e,
11242
11242
  node: n || void 0,
11243
11243
  nodePos: o || void 0
@@ -11282,8 +11282,8 @@ function M4(e) {
11282
11282
  trigger: r = ":",
11283
11283
  hideWhenUnavailable: i = !1,
11284
11284
  onTriggerApplied: a
11285
- } = e || {}, { editor: s } = k(t), c = de(), [u, d] = I(!0), f = kr(s);
11286
- T(() => {
11285
+ } = e || {}, { editor: s } = k(t), c = de(), [u, d] = T(!0), f = kr(s);
11286
+ I(() => {
11287
11287
  if (!s) return;
11288
11288
  const h = () => {
11289
11289
  d(S4({ editor: s, hideWhenUnavailable: i }));
@@ -11314,7 +11314,7 @@ function M4(e) {
11314
11314
  label: "Add emoji",
11315
11315
  shortcutKeys: to,
11316
11316
  trigger: r,
11317
- Icon: Ir
11317
+ Icon: Tr
11318
11318
  };
11319
11319
  }
11320
11320
  function R4({
@@ -11379,13 +11379,13 @@ function Sr(e, t, n) {
11379
11379
  if (t || te(n)) {
11380
11380
  if (te(n) && n >= 0) return !0;
11381
11381
  if (t)
11382
- return Te({ editor: e, node: t }) !== null;
11382
+ return Ie({ editor: e, node: t }) !== null;
11383
11383
  }
11384
11384
  return !0;
11385
11385
  }
11386
11386
  function H4(e, t, n, o) {
11387
11387
  if (n != null || te(o)) {
11388
- const i = Te({
11388
+ const i = Ie({
11389
11389
  editor: e,
11390
11390
  node: n || void 0,
11391
11391
  nodePos: o || void 0
@@ -11406,7 +11406,7 @@ function H4(e, t, n, o) {
11406
11406
  }
11407
11407
  function N4(e, t, n, o) {
11408
11408
  if (n != null || te(o)) {
11409
- const s = Te({
11409
+ const s = Ie({
11410
11410
  editor: e,
11411
11411
  node: n || void 0,
11412
11412
  nodePos: o || void 0
@@ -11447,8 +11447,8 @@ function B4(e) {
11447
11447
  trigger: r = "@",
11448
11448
  hideWhenUnavailable: i = !1,
11449
11449
  onTriggered: a
11450
- } = e || {}, { editor: s } = k(t), c = de(), [u, d] = I(!0), f = Sr(s, n, o);
11451
- T(() => {
11450
+ } = e || {}, { editor: s } = k(t), c = de(), [u, d] = T(!0), f = Sr(s, n, o);
11451
+ I(() => {
11452
11452
  if (!s) return;
11453
11453
  const h = () => {
11454
11454
  d(
@@ -11481,7 +11481,7 @@ function B4(e) {
11481
11481
  label: "Add mention",
11482
11482
  shortcutKeys: no,
11483
11483
  trigger: r,
11484
- Icon: Tr
11484
+ Icon: Ir
11485
11485
  };
11486
11486
  }
11487
11487
  function D4(e) {
@@ -11570,14 +11570,14 @@ function D4(e) {
11570
11570
  title: e.mention,
11571
11571
  subtext: e.mentionSubtext,
11572
11572
  keywords: ["mention", "user", "item", "tag"],
11573
- badge: Tr,
11573
+ badge: Ir,
11574
11574
  group: e.insert
11575
11575
  },
11576
11576
  emoji: {
11577
11577
  title: e.emoji,
11578
11578
  subtext: e.emojiSubtext,
11579
11579
  keywords: ["emoji", "emoticon", "smiley"],
11580
- badge: Ir,
11580
+ badge: Tr,
11581
11581
  group: e.insert
11582
11582
  },
11583
11583
  table: {
@@ -11787,15 +11787,15 @@ const $4 = (e) => {
11787
11787
  );
11788
11788
  }, Oi = (e) => {
11789
11789
  const { item: t, isSelected: n, onSelect: o } = e, r = $(null);
11790
- T(() => {
11790
+ I(() => {
11791
11791
  const s = document.querySelector(
11792
11792
  '[data-selector="tiptap-slash-dropdown-menu"]'
11793
11793
  )?.querySelector(
11794
11794
  ".tiptap-slash-card-body"
11795
11795
  );
11796
11796
  if (!r.current || !n || !s) return;
11797
- const c = r.current.offsetTop - s.offsetTop, u = c + r.current.offsetHeight, d = s.scrollTop, f = d + s.clientHeight;
11798
- c < d ? s.scrollTop = c : u > f && (s.scrollTop = u - s.clientHeight);
11797
+ const c = r.current.getBoundingClientRect(), u = s.getBoundingClientRect();
11798
+ c.top < u.top ? s.scrollTop -= u.top - c.top : c.bottom > u.bottom && (s.scrollTop += c.bottom - u.bottom);
11799
11799
  }, [n]);
11800
11800
  const i = t.badge;
11801
11801
  return /* @__PURE__ */ m(
@@ -11886,10 +11886,10 @@ const $4 = (e) => {
11886
11886
  style: d,
11887
11887
  ...f
11888
11888
  }, p) => {
11889
- const [h, g] = I(
11889
+ const [h, g] = T(
11890
11890
  t !== void 0 ? t : !1
11891
11891
  ), C = $(null), b = $(!1), w = $(!1), v = $(null), y = $(a), { editor: x } = k(e);
11892
- T(() => {
11892
+ I(() => {
11893
11893
  v.current = x, y.current = a;
11894
11894
  }, [x, a]);
11895
11895
  const L = A(
@@ -11900,7 +11900,7 @@ const $4 = (e) => {
11900
11900
  ), E = (W) => {
11901
11901
  if (!W && x && c) {
11902
11902
  const D = x.state.tr.setSelection(
11903
- It.near(x.state.doc.resolve(0))
11903
+ Tt.near(x.state.doc.resolve(0))
11904
11904
  );
11905
11905
  x.view.dispatch(D);
11906
11906
  }
@@ -11933,13 +11933,13 @@ const $4 = (e) => {
11933
11933
  const D = Ga(x);
11934
11934
  W && !w.current && (D || b.current) ? L(!0) : !b.current && (!D || w.current || !x.isEditable) && L(!1);
11935
11935
  }, [x, a, L, t]);
11936
- T(() => {
11936
+ I(() => {
11937
11937
  if (!x || !s) return;
11938
11938
  const W = (D) => D.key === "Escape" && h ? (L(!1), !0) : !1;
11939
11939
  return x.view.dom.addEventListener("keydown", W), () => {
11940
11940
  x.view.dom.removeEventListener("keydown", W);
11941
11941
  };
11942
- }, [x, h, s, L]), T(() => {
11942
+ }, [x, h, s, L]), I(() => {
11943
11943
  if (!x) return;
11944
11944
  const W = (D) => {
11945
11945
  if (b.current) {
@@ -11954,7 +11954,7 @@ const $4 = (e) => {
11954
11954
  return x.view.dom.addEventListener("blur", W), () => {
11955
11955
  x.view.dom.removeEventListener("blur", W);
11956
11956
  };
11957
- }, [x, L, h]), T(() => {
11957
+ }, [x, L, h]), I(() => {
11958
11958
  if (!x) return;
11959
11959
  const W = () => {
11960
11960
  h && L(!1);
@@ -11962,7 +11962,7 @@ const $4 = (e) => {
11962
11962
  return x.view.dom.addEventListener("dragstart", W), x.view.dom.addEventListener("dragover", W), () => {
11963
11963
  x.view.dom.removeEventListener("dragstart", W), x.view.dom.removeEventListener("dragover", W);
11964
11964
  };
11965
- }, [x, h, L]), T(() => {
11965
+ }, [x, h, L]), I(() => {
11966
11966
  if (!x) return;
11967
11967
  const W = (z) => {
11968
11968
  if (z.button !== 0 || (w.current = !0, z.detail > 1)) return;
@@ -11974,7 +11974,7 @@ const $4 = (e) => {
11974
11974
  const xe = _.doc.resolve(G.pos).nodeBefore;
11975
11975
  if (!xe || xe.isBlock) return;
11976
11976
  const tt = _.tr.setSelection(
11977
- It.near(_.doc.resolve(G.pos))
11977
+ Tt.near(_.doc.resolve(G.pos))
11978
11978
  );
11979
11979
  q.dispatch(tt);
11980
11980
  }, D = () => {
@@ -11983,12 +11983,12 @@ const $4 = (e) => {
11983
11983
  return x.view.dom.addEventListener("mousedown", W), x.view.root.addEventListener("mouseup", D), () => {
11984
11984
  x.view.dom.removeEventListener("mousedown", W), x.view.root.removeEventListener("mouseup", D);
11985
11985
  };
11986
- }, [x, J]), T(() => {
11986
+ }, [x, J]), I(() => {
11987
11987
  if (x)
11988
11988
  return x.on("selectionUpdate", J), () => {
11989
11989
  x.off("selectionUpdate", J);
11990
11990
  };
11991
- }, [x, J]), T(() => {
11991
+ }, [x, J]), I(() => {
11992
11992
  x && J();
11993
11993
  }, [x, J]);
11994
11994
  const M = V(
@@ -12084,8 +12084,8 @@ function z4({
12084
12084
  onSubmit: r,
12085
12085
  signal: i
12086
12086
  }) {
12087
- const a = O(), s = $(null), [c, u] = I("");
12088
- T(() => {
12087
+ const a = O(), s = $(null), [c, u] = T("");
12088
+ I(() => {
12089
12089
  if (!n) {
12090
12090
  u("");
12091
12091
  return;
@@ -12417,7 +12417,7 @@ const a5 = /* @__PURE__ */ new Set([
12417
12417
  }),
12418
12418
  dl,
12419
12419
  fl.configure({ nested: !0 }),
12420
- Tl,
12420
+ Il,
12421
12421
  pl,
12422
12422
  Gc.configure({
12423
12423
  resizable: !1
@@ -12670,16 +12670,16 @@ function ss(e) {
12670
12670
  };
12671
12671
  }
12672
12672
  function A5(e) {
12673
- const t = e.content || [], n = T5(t);
12673
+ const t = e.content || [], n = I5(t);
12674
12674
  if (!n)
12675
12675
  return e;
12676
- const o = I5(t, n), r = L5(o, n);
12676
+ const o = T5(t, n), r = L5(o, n);
12677
12677
  return {
12678
12678
  ...e,
12679
12679
  content: r
12680
12680
  };
12681
12681
  }
12682
- function T5(e) {
12682
+ function I5(e) {
12683
12683
  const [t, n, ...o] = e;
12684
12684
  if (!t || !n)
12685
12685
  return null;
@@ -12698,7 +12698,7 @@ function T5(e) {
12698
12698
  logicalColumnCount: r.length
12699
12699
  };
12700
12700
  }
12701
- function I5(e, t) {
12701
+ function T5(e, t) {
12702
12702
  const [n, o, ...r] = e, i = n.content || [], s = (o.content || []).filter((u) => !rt(u)).map((u) => ({ ...u, type: "tableHeader" }));
12703
12703
  if (!n || !o)
12704
12704
  return e;
@@ -13007,8 +13007,8 @@ function hs(e) {
13007
13007
  onDownloaded: o,
13008
13008
  resolveFileUrl: r,
13009
13009
  downloadMethod: i = "auto"
13010
- } = e || {}, { editor: a } = k(t), s = de(), [c, u] = I(!0), d = Sn(a);
13011
- T(() => {
13010
+ } = e || {}, { editor: a } = k(t), s = de(), [c, u] = T(!0), d = Sn(a);
13011
+ I(() => {
13012
13012
  if (!a) return;
13013
13013
  const p = () => {
13014
13014
  u(N5({ editor: a, hideWhenUnavailable: n }));
@@ -13145,8 +13145,8 @@ function bs(e) {
13145
13145
  editor: t,
13146
13146
  hideWhenUnavailable: n = !1,
13147
13147
  onDuplicated: o
13148
- } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = I(!0), u = ms(r);
13149
- T(() => {
13148
+ } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = T(!0), u = ms(r);
13149
+ I(() => {
13150
13150
  if (!r) return;
13151
13151
  const f = () => {
13152
13152
  c(B5({ editor: r, hideWhenUnavailable: n }));
@@ -13196,7 +13196,7 @@ const vs = P(
13196
13196
  children: s,
13197
13197
  ...c
13198
13198
  }, u) => {
13199
- const { editor: d } = k(e), { isVisible: f, handleCopyToClipboard: p, label: h, shortcutKeys: g, Icon: C } = Ts({
13199
+ const { editor: d } = k(e), { isVisible: f, handleCopyToClipboard: p, label: h, shortcutKeys: g, Icon: C } = Is({
13200
13200
  editor: d,
13201
13201
  copyWithFormatting: n,
13202
13202
  hideWhenUnavailable: o,
@@ -13311,14 +13311,14 @@ function Z5(e) {
13311
13311
  const { editor: t, hideWhenUnavailable: n } = e;
13312
13312
  return t ? n ? t.isActive("code") ? !0 : As(t) : !0 : !1;
13313
13313
  }
13314
- function Ts(e) {
13314
+ function Is(e) {
13315
13315
  const {
13316
13316
  editor: t,
13317
13317
  copyWithFormatting: n = !0,
13318
13318
  hideWhenUnavailable: o = !1,
13319
13319
  onCopied: r
13320
- } = e || {}, { editor: i } = k(t), a = O(), s = de(), [c, u] = I(!0), d = As(i);
13321
- T(() => {
13320
+ } = e || {}, { editor: i } = k(t), a = O(), s = de(), [c, u] = T(!0), d = As(i);
13321
+ I(() => {
13322
13322
  if (!i) return;
13323
13323
  const p = () => {
13324
13324
  u(Z5({ editor: i, hideWhenUnavailable: o }));
@@ -13351,7 +13351,7 @@ function Ts(e) {
13351
13351
  Icon: xs
13352
13352
  };
13353
13353
  }
13354
- function Is({
13354
+ function Ts({
13355
13355
  shortcutKeys: e = uo
13356
13356
  }) {
13357
13357
  return /* @__PURE__ */ l(re, { children: ne({ shortcutKeys: e }) });
@@ -13392,7 +13392,7 @@ const Dr = P(
13392
13392
  children: a ?? /* @__PURE__ */ m(B, { children: [
13393
13393
  /* @__PURE__ */ l(g, { className: "tiptap-button-icon" }),
13394
13394
  t && /* @__PURE__ */ l("span", { className: "tiptap-button-text", children: t }),
13395
- r && /* @__PURE__ */ l(Is, { shortcutKeys: h })
13395
+ r && /* @__PURE__ */ l(Ts, { shortcutKeys: h })
13396
13396
  ] })
13397
13397
  }
13398
13398
  ) : null;
@@ -13445,8 +13445,8 @@ function ks(e) {
13445
13445
  editor: t,
13446
13446
  hideWhenUnavailable: n = !1,
13447
13447
  onDeleted: o
13448
- } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = I(!0), u = Ls(r);
13449
- T(() => {
13448
+ } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = T(!0), u = Ls(r);
13449
+ I(() => {
13450
13450
  if (!r) return;
13451
13451
  const f = () => {
13452
13452
  c(z5({ editor: r, hideWhenUnavailable: n }));
@@ -13614,8 +13614,8 @@ function Ns(e) {
13614
13614
  onNodeIdNotFound: o,
13615
13615
  onExtractedNodeId: r,
13616
13616
  onCopied: i
13617
- } = e || {}, { editor: a } = k(t), s = O(), c = de(), [u, d] = I(!0), f = Hs(a);
13618
- T(() => {
13617
+ } = e || {}, { editor: a } = k(t), s = O(), c = de(), [u, d] = T(!0), f = Hs(a);
13618
+ I(() => {
13619
13619
  if (!a) return;
13620
13620
  const h = () => {
13621
13621
  d(j5({ editor: a, hideWhenUnavailable: n }));
@@ -13782,8 +13782,8 @@ function Os(e) {
13782
13782
  preserveMarks: n = Ds,
13783
13783
  hideWhenUnavailable: o = !1,
13784
13784
  onResetAllFormatting: r
13785
- } = e || {}, { editor: i } = k(t), a = O(), s = de(), [c, u] = I(!0), d = Us(i, n);
13786
- T(() => {
13785
+ } = e || {}, { editor: i } = k(t), a = O(), s = de(), [c, u] = T(!0), d = Us(i, n);
13786
+ I(() => {
13787
13787
  if (!i) return;
13788
13788
  const p = () => {
13789
13789
  u(
@@ -13908,7 +13908,7 @@ function n0(e) {
13908
13908
  "codeBlock"
13909
13909
  ]) && r.length === 1;
13910
13910
  if ((n.selection.empty || n.selection instanceof se) && i) {
13911
- const c = Te({
13911
+ const c = Ie({
13912
13912
  editor: e,
13913
13913
  node: n.selection.$anchor.node(1)
13914
13914
  })?.pos;
@@ -13935,8 +13935,8 @@ function Ws(e) {
13935
13935
  editor: t,
13936
13936
  hideWhenUnavailable: n = !1,
13937
13937
  onToggled: o
13938
- } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = I(!0), u = Ur(r), d = t0(r);
13939
- T(() => {
13938
+ } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = T(!0), u = Ur(r), d = t0(r);
13939
+ I(() => {
13940
13940
  if (!r) return;
13941
13941
  const p = () => {
13942
13942
  c(o0({ editor: r, hideWhenUnavailable: n }));
@@ -14178,7 +14178,7 @@ function s0(e, t) {
14178
14178
  "codeBlock"
14179
14179
  ]) && s.length === 1;
14180
14180
  if ((i.selection.empty || i.selection instanceof se) && c) {
14181
- const h = Te({
14181
+ const h = Ie({
14182
14182
  editor: e,
14183
14183
  node: i.selection.$anchor.node(1)
14184
14184
  })?.pos;
@@ -14208,8 +14208,8 @@ function Gt(e) {
14208
14208
  level: n,
14209
14209
  hideWhenUnavailable: o = !1,
14210
14210
  onToggled: r
14211
- } = e, { editor: i } = k(t), a = O(), [s, c] = I(!0), u = rn(i, n), d = a0(i, n);
14212
- T(() => {
14211
+ } = e, { editor: i } = k(t), a = O(), [s, c] = T(!0), u = rn(i, n), d = a0(i, n);
14212
+ I(() => {
14213
14213
  if (!i) return;
14214
14214
  const p = () => {
14215
14215
  c(c0({ editor: i, level: n, hideWhenUnavailable: o }));
@@ -14376,7 +14376,7 @@ function h0(e, t) {
14376
14376
  "codeBlock"
14377
14377
  ]) && i.length === 1;
14378
14378
  if ((o.selection.empty || o.selection instanceof se) && a) {
14379
- const u = Te({
14379
+ const u = Ie({
14380
14380
  editor: e,
14381
14381
  node: o.selection.$anchor.node(1)
14382
14382
  })?.pos;
@@ -14415,8 +14415,8 @@ function jt(e) {
14415
14415
  type: n,
14416
14416
  hideWhenUnavailable: o = !1,
14417
14417
  onToggled: r
14418
- } = e, { editor: i } = k(t), a = O(), [s, c] = I(!0), u = Or(i, n), d = p0(i, n);
14419
- T(() => {
14418
+ } = e, { editor: i } = k(t), a = O(), [s, c] = T(!0), u = Or(i, n), d = p0(i, n);
14419
+ I(() => {
14420
14420
  if (!i) return;
14421
14421
  const p = () => {
14422
14422
  c(g0({ editor: i, type: n, hideWhenUnavailable: o }));
@@ -14527,7 +14527,7 @@ function m0(e) {
14527
14527
  "codeBlock"
14528
14528
  ]) && r.length === 1;
14529
14529
  if ((n.selection.empty || n.selection instanceof se) && i) {
14530
- const u = Te({
14530
+ const u = Ie({
14531
14531
  editor: e,
14532
14532
  node: n.selection.$anchor.node(1)
14533
14533
  })?.pos;
@@ -14554,8 +14554,8 @@ function qs(e) {
14554
14554
  editor: t,
14555
14555
  hideWhenUnavailable: n = !1,
14556
14556
  onToggled: o
14557
- } = e || {}, { editor: r } = k(t), i = O(), [a, s] = I(!0), c = Pr(r), u = r?.isActive("blockquote") || !1;
14558
- T(() => {
14557
+ } = e || {}, { editor: r } = k(t), i = O(), [a, s] = T(!0), c = Pr(r), u = r?.isActive("blockquote") || !1;
14558
+ I(() => {
14559
14559
  if (!r) return;
14560
14560
  const f = () => {
14561
14561
  s(b0({ editor: r, hideWhenUnavailable: n }));
@@ -14666,7 +14666,7 @@ function v0(e) {
14666
14666
  "codeBlock"
14667
14667
  ]) && r.length === 1;
14668
14668
  if ((n.selection.empty || n.selection instanceof se) && i) {
14669
- const u = Te({
14669
+ const u = Ie({
14670
14670
  editor: e,
14671
14671
  node: n.selection.$anchor.node(1)
14672
14672
  })?.pos;
@@ -14693,8 +14693,8 @@ function Js(e) {
14693
14693
  editor: t,
14694
14694
  hideWhenUnavailable: n = !1,
14695
14695
  onToggled: o
14696
- } = e || {}, { editor: r } = k(t), i = O(), [a, s] = I(!0), c = Wr(r), u = r?.isActive("codeBlock") || !1;
14697
- T(() => {
14696
+ } = e || {}, { editor: r } = k(t), i = O(), [a, s] = T(!0), c = Wr(r), u = r?.isActive("codeBlock") || !1;
14697
+ I(() => {
14698
14698
  if (!r) return;
14699
14699
  const f = () => {
14700
14700
  s(y0({ editor: r, hideWhenUnavailable: n }));
@@ -14744,7 +14744,7 @@ const $r = P(
14744
14744
  label: b,
14745
14745
  shortcutKeys: w,
14746
14746
  Icon: v
14747
- } = I0({
14747
+ } = T0({
14748
14748
  editor: p,
14749
14749
  node: t,
14750
14750
  nodePos: n,
@@ -14807,7 +14807,7 @@ function Zr(e, t, n) {
14807
14807
  if (t || te(n)) {
14808
14808
  if (te(n) && n >= 0) return !0;
14809
14809
  if (t)
14810
- return Te({ editor: e, node: t }) !== null;
14810
+ return Ie({ editor: e, node: t }) !== null;
14811
14811
  }
14812
14812
  return !0;
14813
14813
  }
@@ -14815,7 +14815,7 @@ function A0(e, t = "/", n, o) {
14815
14815
  if (!e || !e.isEditable || !Zr(e, n, o)) return !1;
14816
14816
  try {
14817
14817
  if (n != null || te(o)) {
14818
- const u = Te({
14818
+ const u = Ie({
14819
14819
  editor: e,
14820
14820
  node: n || void 0,
14821
14821
  nodePos: o || void 0
@@ -14842,11 +14842,11 @@ function A0(e, t = "/", n, o) {
14842
14842
  return !1;
14843
14843
  }
14844
14844
  }
14845
- function T0(e) {
14845
+ function I0(e) {
14846
14846
  const { editor: t, hideWhenUnavailable: n, node: o, nodePos: r } = e;
14847
14847
  return t ? n ? t.isEditable ? t.isActive("code") ? !0 : Zr(t, o, r) : !1 : !0 : !1;
14848
14848
  }
14849
- function I0(e) {
14849
+ function T0(e) {
14850
14850
  const {
14851
14851
  editor: t,
14852
14852
  node: n,
@@ -14854,12 +14854,12 @@ function I0(e) {
14854
14854
  trigger: r = "/",
14855
14855
  hideWhenUnavailable: i = !1,
14856
14856
  onTriggered: a
14857
- } = e || {}, { editor: s } = k(t), c = de(), [u, d] = I(!0), f = Zr(s, n, o);
14858
- T(() => {
14857
+ } = e || {}, { editor: s } = k(t), c = de(), [u, d] = T(!0), f = Zr(s, n, o);
14858
+ I(() => {
14859
14859
  if (!s) return;
14860
14860
  const h = () => {
14861
14861
  d(
14862
- T0({ editor: s, hideWhenUnavailable: i, node: n, nodePos: o })
14862
+ I0({ editor: s, hideWhenUnavailable: i, node: n, nodePos: o })
14863
14863
  );
14864
14864
  };
14865
14865
  return h(), s.on("selectionUpdate", h), () => {
@@ -14926,8 +14926,8 @@ function e1(e) {
14926
14926
  editor: t,
14927
14927
  hideWhenUnavailable: n = !1,
14928
14928
  onToggle: o
14929
- } = e || {}, { editor: r } = k(t), [i, a] = I(!0), [s, c] = I(!1), u = _r(r);
14930
- T(() => {
14929
+ } = e || {}, { editor: r } = k(t), [i, a] = T(!0), [s, c] = T(!1), u = _r(r);
14930
+ I(() => {
14931
14931
  if (!r) return;
14932
14932
  const f = () => {
14933
14933
  a(S0({ editor: r, hideWhenUnavailable: n })), c(L0(r));
@@ -15212,7 +15212,7 @@ const R0 = () => {
15212
15212
  canCopyToClipboard: i,
15213
15213
  label: a,
15214
15214
  Icon: s
15215
- } = Ts(), {
15215
+ } = Is(), {
15216
15216
  handleCopyAnchorLink: c,
15217
15217
  canCopyAnchorLink: u,
15218
15218
  label: d,
@@ -15263,7 +15263,7 @@ const R0 = () => {
15263
15263
  label: n,
15264
15264
  onClick: e,
15265
15265
  disabled: !t,
15266
- shortcutBadge: /* @__PURE__ */ l(Is, {})
15266
+ shortcutBadge: /* @__PURE__ */ l(Ts, {})
15267
15267
  }
15268
15268
  ) });
15269
15269
  }, O0 = ({
@@ -15272,10 +15272,10 @@ const R0 = () => {
15272
15272
  mobileBreakpoint: n = 768,
15273
15273
  ...o
15274
15274
  }) => {
15275
- const { editor: r } = k(e), i = O(), { isDragging: a } = ko(r), s = de("max", n), [c, u] = I(!1), [d, f] = I(null), [p, h] = I(-1), g = A((L) => {
15275
+ const { editor: r } = k(e), i = O(), { isDragging: a } = ko(r), s = de("max", n), [c, u] = T(!1), [d, f] = T(null), [p, h] = T(-1), g = A((L) => {
15276
15276
  L.node && f(L.node), h(L.pos);
15277
15277
  }, []);
15278
- T(() => {
15278
+ I(() => {
15279
15279
  r && (r.commands.setLockDragHandle(c), r.commands.setMeta("lockDragHandle", c));
15280
15280
  }, [r, c]);
15281
15281
  const C = 16, b = V(() => ({
@@ -15508,14 +15508,14 @@ const o1 = S(({ className: e, ...t }) => /* @__PURE__ */ m(
15508
15508
  ));
15509
15509
  o1.displayName = "MoonStarIcon";
15510
15510
  function P0() {
15511
- const { editor: e } = ke(cn), [t, n] = I(!1);
15512
- return T(() => {
15511
+ const { editor: e } = ke(cn), [t, n] = T(!1);
15512
+ return I(() => {
15513
15513
  const r = window.matchMedia("(prefers-color-scheme: dark)"), i = () => n(r.matches);
15514
15514
  return r.addEventListener("change", i), () => r.removeEventListener("change", i);
15515
- }, []), T(() => {
15515
+ }, []), I(() => {
15516
15516
  const r = !!document.querySelector('meta[name="color-scheme"][content="dark"]') || window.matchMedia("(prefers-color-scheme: dark)").matches;
15517
15517
  n(r);
15518
- }, []), T(() => {
15518
+ }, []), I(() => {
15519
15519
  e?.view.dom.closest(".omnibox-editor-root")?.classList.toggle("dark", t);
15520
15520
  }, [e, t]), /* @__PURE__ */ l(
15521
15521
  H,
@@ -15545,7 +15545,7 @@ function $0({
15545
15545
  mentionUsers: t,
15546
15546
  user: n
15547
15547
  }) {
15548
- const [o] = I(() => C4()), [r, i] = I([]), a = V(
15548
+ const [o] = T(() => C4()), [r, i] = T([]), a = V(
15549
15549
  () => Ka(n) ?? o,
15550
15550
  [o, n]
15551
15551
  ), s = V(
@@ -15701,8 +15701,8 @@ function K0(e) {
15701
15701
  action: n,
15702
15702
  hideWhenUnavailable: o = !1,
15703
15703
  onExecuted: r
15704
- } = e, { editor: i } = k(t), [a, s] = I(!0), c = Fr(i, n);
15705
- T(() => {
15704
+ } = e, { editor: i } = k(t), [a, s] = T(!0), c = Fr(i, n);
15705
+ I(() => {
15706
15706
  if (!i) return;
15707
15707
  const d = () => {
15708
15708
  s(G0({ editor: i, hideWhenUnavailable: o, action: n }));
@@ -15737,14 +15737,14 @@ function q0() {
15737
15737
  title: n.map((r) => r.name).join(", "),
15738
15738
  children: [
15739
15739
  /* @__PURE__ */ l(Xa, { maxVisible: 4, className: "omnibox-editor-users__avatars", children: n.map((r) => /* @__PURE__ */ m(
15740
- Tn,
15740
+ In,
15741
15741
  {
15742
15742
  size: "sm",
15743
15743
  userColor: r.color,
15744
15744
  title: r.name,
15745
15745
  children: [
15746
15746
  /* @__PURE__ */ l(hr, { src: r.avatar, alt: r.name }),
15747
- /* @__PURE__ */ l(In, { children: j0(r.name) })
15747
+ /* @__PURE__ */ l(Tn, { children: j0(r.name) })
15748
15748
  ]
15749
15749
  },
15750
15750
  r.id
@@ -15772,7 +15772,7 @@ function Y0() {
15772
15772
  }
15773
15773
  const X0 = (e) => {
15774
15774
  const t = $(e);
15775
- t.current = e, T(
15775
+ t.current = e, I(
15776
15776
  () => () => {
15777
15777
  t.current();
15778
15778
  },
@@ -15793,7 +15793,7 @@ function s1(e, t = 250, n = [], o = J0) {
15793
15793
  }), r;
15794
15794
  }
15795
15795
  function c1() {
15796
- const [e, t] = I({
15796
+ const [e, t] = T({
15797
15797
  width: 0,
15798
15798
  height: 0,
15799
15799
  offsetTop: 0,
@@ -15812,7 +15812,7 @@ function c1() {
15812
15812
  } = o;
15813
15813
  t((u) => r === u.width && i === u.height && a === u.offsetTop && s === u.offsetLeft && c === u.scale ? u : { width: r, height: i, offsetTop: a, offsetLeft: s, scale: c });
15814
15814
  }, 200);
15815
- return T(() => {
15815
+ return I(() => {
15816
15816
  const o = window.visualViewport;
15817
15817
  if (o)
15818
15818
  return o.addEventListener("resize", n), n(), () => {
@@ -15941,7 +15941,7 @@ function Q0({
15941
15941
  onApplied: r,
15942
15942
  ...i
15943
15943
  }) {
15944
- const { editor: a } = k(e), s = O(), [c, u] = I(!1), { isVisible: d, canColorHighlight: f, isActive: p, label: h, Icon: g } = Cn({
15944
+ const { editor: a } = k(e), s = O(), [c, u] = T(!1), { isVisible: d, canColorHighlight: f, isActive: p, label: h, Icon: g } = Cn({
15945
15945
  editor: a,
15946
15946
  hideWhenUnavailable: n,
15947
15947
  onApplied: r
@@ -16079,8 +16079,8 @@ function rf(e) {
16079
16079
  editor: t,
16080
16080
  hideWhenUnavailable: n = !1,
16081
16081
  onInserted: o
16082
- } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = I(!0), u = jr(r), d = tf(r);
16083
- T(() => {
16082
+ } = e || {}, { editor: r } = k(t), i = O(), a = de(), [s, c] = T(!0), u = jr(r), d = tf(r);
16083
+ I(() => {
16084
16084
  if (!r) return;
16085
16085
  const p = () => {
16086
16086
  c(of({ editor: r, hideWhenUnavailable: n }));
@@ -16282,7 +16282,7 @@ const g1 = ({
16282
16282
  children: a,
16283
16283
  ...s
16284
16284
  }, c) => {
16285
- const { editor: u } = k(e), [d, f] = I(!1), {
16285
+ const { editor: u } = k(e), [d, f] = T(!1), {
16286
16286
  isVisible: p,
16287
16287
  canSet: h,
16288
16288
  isActive: g,
@@ -16310,7 +16310,7 @@ const g1 = ({
16310
16310
  },
16311
16311
  [i, d]
16312
16312
  );
16313
- return T(() => {
16313
+ return I(() => {
16314
16314
  r && g && f(!0);
16315
16315
  }, [r, g]), p ? /* @__PURE__ */ m(bn, { open: d, onOpenChange: E, children: [
16316
16316
  /* @__PURE__ */ l(wn, { asChild: !0, children: /* @__PURE__ */ l(
@@ -16360,12 +16360,12 @@ function af(e) {
16360
16360
  return n ? o ? t.isActive("code") ? !0 : Xr(t) : !1 : !0;
16361
16361
  }
16362
16362
  function sf(e) {
16363
- const { editor: t, onSetLink: n } = e, [o, r] = I(null);
16364
- T(() => {
16363
+ const { editor: t, onSetLink: n } = e, [o, r] = T(null);
16364
+ I(() => {
16365
16365
  if (!t) return;
16366
16366
  const { href: c } = t.getAttributes("link");
16367
16367
  C1(t) && o === null && r(c || "");
16368
- }, [t, o]), T(() => {
16368
+ }, [t, o]), I(() => {
16369
16369
  if (!t) return;
16370
16370
  const c = () => {
16371
16371
  const { href: u } = t.getAttributes("link");
@@ -16399,8 +16399,8 @@ function sf(e) {
16399
16399
  };
16400
16400
  }
16401
16401
  function cf(e) {
16402
- const { editor: t, hideWhenUnavailable: n = !1 } = e, o = Xr(t), r = C1(t), [i, a] = I(!0);
16403
- return T(() => {
16402
+ const { editor: t, hideWhenUnavailable: n = !1 } = e, o = Xr(t), r = C1(t), [i, a] = T(!0);
16403
+ return I(() => {
16404
16404
  if (!t) return;
16405
16405
  const s = () => {
16406
16406
  a(
@@ -16442,7 +16442,7 @@ function m1(e) {
16442
16442
  }
16443
16443
  function uf({
16444
16444
  type: e,
16445
- shortcutKeys: t = I1[e]
16445
+ shortcutKeys: t = T1[e]
16446
16446
  }) {
16447
16447
  return /* @__PURE__ */ l(re, { children: ne({ shortcutKeys: t }) });
16448
16448
  }
@@ -16694,7 +16694,7 @@ const A1 = S(({ className: e, ...t }) => /* @__PURE__ */ m(
16694
16694
  }
16695
16695
  ));
16696
16696
  A1.displayName = "SuperscriptIcon";
16697
- const T1 = S(({ className: e, ...t }) => /* @__PURE__ */ l(
16697
+ const I1 = S(({ className: e, ...t }) => /* @__PURE__ */ l(
16698
16698
  "svg",
16699
16699
  {
16700
16700
  width: "24",
@@ -16715,16 +16715,16 @@ const T1 = S(({ className: e, ...t }) => /* @__PURE__ */ l(
16715
16715
  )
16716
16716
  }
16717
16717
  ));
16718
- T1.displayName = "UnderlineIcon";
16718
+ I1.displayName = "UnderlineIcon";
16719
16719
  const df = {
16720
16720
  bold: b1,
16721
16721
  italic: v1,
16722
- underline: T1,
16722
+ underline: I1,
16723
16723
  strike: y1,
16724
16724
  code: w1,
16725
16725
  superscript: A1,
16726
16726
  subscript: x1
16727
- }, I1 = {
16727
+ }, T1 = {
16728
16728
  bold: "mod+b",
16729
16729
  italic: "mod+i",
16730
16730
  underline: "mod+u",
@@ -16763,8 +16763,8 @@ function Cf(e) {
16763
16763
  type: n,
16764
16764
  hideWhenUnavailable: o = !1,
16765
16765
  onToggled: r
16766
- } = e, { editor: i } = k(t), a = O(), [s, c] = I(!0), u = Rn(i, n), d = ff(i, n);
16767
- T(() => {
16766
+ } = e, { editor: i } = k(t), a = O(), [s, c] = T(!0), u = Rn(i, n), d = ff(i, n);
16767
+ I(() => {
16768
16768
  if (!i) return;
16769
16769
  const p = () => {
16770
16770
  c(hf({ editor: i, type: n, hideWhenUnavailable: o }));
@@ -16784,7 +16784,7 @@ function Cf(e) {
16784
16784
  handleMark: f,
16785
16785
  canToggle: u,
16786
16786
  label: gf(n, a),
16787
- shortcutKeys: I1[n],
16787
+ shortcutKeys: T1[n],
16788
16788
  Icon: df[n]
16789
16789
  };
16790
16790
  }
@@ -16815,7 +16815,7 @@ const Ne = P(
16815
16815
  isActive: b,
16816
16816
  Icon: w,
16817
16817
  shortcutKeys: v
16818
- } = Tf({
16818
+ } = If({
16819
16819
  editor: f,
16820
16820
  align: t,
16821
16821
  hideWhenUnavailable: o,
@@ -16895,14 +16895,14 @@ function Af(e) {
16895
16895
  const { editor: t, hideWhenUnavailable: n, align: o } = e;
16896
16896
  return t ? n ? !t.isEditable || !F(t, "textAlign") ? !1 : t.isActive("code") ? !0 : En(t, o) : !0 : !1;
16897
16897
  }
16898
- function Tf(e) {
16898
+ function If(e) {
16899
16899
  const {
16900
16900
  editor: t,
16901
16901
  align: n,
16902
16902
  hideWhenUnavailable: o = !1,
16903
16903
  onAligned: r
16904
- } = e, { editor: i } = k(t), a = O(), [s, c] = I(!0), u = En(i, n), d = yf(i, n);
16905
- T(() => {
16904
+ } = e, { editor: i } = k(t), a = O(), [s, c] = T(!0), u = En(i, n), d = yf(i, n);
16905
+ I(() => {
16906
16906
  if (!i) return;
16907
16907
  const p = () => {
16908
16908
  c(Af({ editor: i, align: n, hideWhenUnavailable: o }));
@@ -17089,7 +17089,7 @@ function B1({
17089
17089
  return /* @__PURE__ */ m(qe, { children: [
17090
17090
  /* @__PURE__ */ l(xt, { children: n.turnInto }),
17091
17091
  o.map(
17092
- (r, i) => If(
17092
+ (r, i) => Tf(
17093
17093
  r,
17094
17094
  `${r.type}-${r.level ?? i}`,
17095
17095
  t
@@ -17097,7 +17097,7 @@ function B1({
17097
17097
  )
17098
17098
  ] });
17099
17099
  }
17100
- function If(e, t, n) {
17100
+ function Tf(e, t, n) {
17101
17101
  switch (e.type) {
17102
17102
  case "paragraph":
17103
17103
  return /* @__PURE__ */ l(me, { asChild: !0, children: /* @__PURE__ */ l(Ps, { editor: n, showTooltip: !1, text: e.label }) }, t);
@@ -17329,7 +17329,7 @@ function Rf(e) {
17329
17329
  hideWhenUnavailable: n = !1,
17330
17330
  blockTypes: o,
17331
17331
  onOpenChange: r
17332
- } = e || {}, { editor: i } = k(t), a = O(), [s, c] = I(!1), [u, d] = I(!0), f = U1(i, o), p = bo(
17332
+ } = e || {}, { editor: i } = k(t), a = O(), [s, c] = T(!1), [u, d] = T(!0), f = U1(i, o), p = bo(
17333
17333
  Sf(i, o),
17334
17334
  a
17335
17335
  ), h = ln(o).map(
@@ -17340,7 +17340,7 @@ function Rf(e) {
17340
17340
  },
17341
17341
  [f, i, r]
17342
17342
  );
17343
- return T(() => {
17343
+ return I(() => {
17344
17344
  if (!i) return;
17345
17345
  const C = () => {
17346
17346
  d(
@@ -17558,8 +17558,8 @@ function Df(e) {
17558
17558
  action: n,
17559
17559
  hideWhenUnavailable: o = !1,
17560
17560
  onIndented: r
17561
- } = e, { editor: i } = k(t), a = O(), [s, c] = I(!0), u = Jr(i, n);
17562
- T(() => {
17561
+ } = e, { editor: i } = k(t), a = O(), [s, c] = T(!0), u = Jr(i, n);
17562
+ I(() => {
17563
17563
  if (!i) return;
17564
17564
  const f = () => {
17565
17565
  c(
@@ -17585,12 +17585,12 @@ function Df(e) {
17585
17585
  };
17586
17586
  }
17587
17587
  const Uf = (e) => {
17588
- const [t, n] = I([]), o = A(() => e.current ? Array.from(
17588
+ const [t, n] = T([]), o = A(() => e.current ? Array.from(
17589
17589
  e.current.querySelectorAll(
17590
17590
  'button:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]:not([disabled])'
17591
17591
  )
17592
17592
  ) : [], [e]);
17593
- T(() => {
17593
+ I(() => {
17594
17594
  const i = e.current;
17595
17595
  if (!i) return;
17596
17596
  const a = () => n(o());
@@ -17605,7 +17605,7 @@ const Uf = (e) => {
17605
17605
  onSelect: (i) => i.click(),
17606
17606
  autoSelectFirstItem: !1
17607
17607
  });
17608
- T(() => {
17608
+ I(() => {
17609
17609
  const i = e.current;
17610
17610
  if (!i) return;
17611
17611
  const a = (c) => {
@@ -17618,7 +17618,7 @@ const Uf = (e) => {
17618
17618
  return i.addEventListener("focus", a, !0), i.addEventListener("blur", s, !0), () => {
17619
17619
  i.removeEventListener("focus", a, !0), i.removeEventListener("blur", s, !0);
17620
17620
  };
17621
- }, [e]), T(() => {
17621
+ }, [e]), I(() => {
17622
17622
  r !== void 0 && t[r] && t[r].focus();
17623
17623
  }, [r, t]);
17624
17624
  }, Hn = P(
@@ -17766,12 +17766,12 @@ function _f(e) {
17766
17766
  hideWhenUnavailable: n = !1,
17767
17767
  direction: o,
17768
17768
  onMoved: r
17769
- } = e, { editor: i } = k(t), a = de(), [s, c] = I(!0), [u, d] = I(!1), f = A(() => {
17769
+ } = e, { editor: i } = k(t), a = de(), [s, c] = T(!0), [u, d] = T(!1), f = A(() => {
17770
17770
  if (!u) return !1;
17771
17771
  const C = $f(i, o);
17772
17772
  return C && r?.(o), C;
17773
17773
  }, [i, o, r, u]);
17774
- T(() => {
17774
+ I(() => {
17775
17775
  if (!i) return;
17776
17776
  const C = () => {
17777
17777
  c(Zf({ editor: i, direction: o, hideWhenUnavailable: n })), d($1(i, o));
@@ -17817,7 +17817,7 @@ function Ff({
17817
17817
  throttleMs: n = 100,
17818
17818
  useResizeObserver: o = !0
17819
17819
  } = {}) {
17820
- const [r, i] = I(zt), a = A(() => !t || !qt() ? null : e ? typeof e == "string" ? document.querySelector(e) : "current" in e ? e.current : e : document.body, [e, t]), s = s1(
17820
+ const [r, i] = T(zt), a = A(() => !t || !qt() ? null : e ? typeof e == "string" ? document.querySelector(e) : "current" in e ? e.current : e : document.body, [e, t]), s = s1(
17821
17821
  () => {
17822
17822
  if (!t || !qt()) return;
17823
17823
  const c = a();
@@ -17841,7 +17841,7 @@ function Ff({
17841
17841
  [t, a],
17842
17842
  { leading: !0, trailing: !0 }
17843
17843
  );
17844
- return T(() => {
17844
+ return I(() => {
17845
17845
  if (!t || !qt()) {
17846
17846
  i(zt);
17847
17847
  return;
@@ -17879,7 +17879,7 @@ function Kf({
17879
17879
  throttleMs: 100,
17880
17880
  useResizeObserver: !0
17881
17881
  });
17882
- return T(() => {
17882
+ return I(() => {
17883
17883
  (() => {
17884
17884
  if (!e) return;
17885
17885
  const { state: i, view: a } = e;
@@ -18121,13 +18121,13 @@ function e9(e) {
18121
18121
  attributeName: r = "data-align",
18122
18122
  hideWhenUnavailable: i = !1,
18123
18123
  onAligned: a
18124
- } = e, { editor: s } = k(t), c = de(), [u, d] = I(!0), f = Qr(s, n, o, r), p = Xf(
18124
+ } = e, { editor: s } = k(t), c = de(), [u, d] = T(!0), f = Qr(s, n, o, r), p = Xf(
18125
18125
  s,
18126
18126
  n,
18127
18127
  o,
18128
18128
  r
18129
18129
  );
18130
- T(() => {
18130
+ I(() => {
18131
18131
  if (!s) return;
18132
18132
  const g = () => {
18133
18133
  d(
@@ -18292,8 +18292,8 @@ function r9(e) {
18292
18292
  editor: t,
18293
18293
  hideWhenUnavailable: n = !1,
18294
18294
  onSet: o
18295
- } = e || {}, { editor: r } = k(t), [i, a] = I(!0), [s, c] = I(!1), u = ei(r);
18296
- T(() => {
18295
+ } = e || {}, { editor: r } = k(t), [i, a] = T(!0), [s, c] = T(!1), u = ei(r);
18296
+ I(() => {
18297
18297
  if (!r) return;
18298
18298
  const f = () => {
18299
18299
  a(o9({ editor: r, hideWhenUnavailable: n })), c(t9(r));
@@ -18368,8 +18368,8 @@ const He = {
18368
18368
  LINK: "link"
18369
18369
  };
18370
18370
  function i9(e) {
18371
- const [t, n] = I(He.MAIN);
18372
- return T(() => {
18371
+ const [t, n] = T(He.MAIN);
18372
+ return I(() => {
18373
18373
  !e && t !== He.MAIN && n(He.MAIN);
18374
18374
  }, [e, t]), {
18375
18375
  viewId: t,
@@ -18725,7 +18725,7 @@ function y9() {
18725
18725
  ),
18726
18726
  /* @__PURE__ */ l(qd, { hideWhenUnavailable: !0 })
18727
18727
  ] }),
18728
- /* @__PURE__ */ l(T9, { hideWhenUnavailable: !0 })
18728
+ /* @__PURE__ */ l(I9, { hideWhenUnavailable: !0 })
18729
18729
  ] }) });
18730
18730
  }
18731
18731
  function x9(e) {
@@ -18742,13 +18742,13 @@ function A9(e) {
18742
18742
  const { editor: t, hideWhenUnavailable: n } = e;
18743
18743
  return t ? n && !t.isActive("code") ? x9(t) : !!t?.isEditable : !1;
18744
18744
  }
18745
- function T9({
18745
+ function I9({
18746
18746
  editor: e,
18747
18747
  hideWhenUnavailable: t = !1,
18748
18748
  ...n
18749
18749
  }) {
18750
- const { editor: o } = k(e), r = O(), [i, a] = I(!1);
18751
- return T(() => {
18750
+ const { editor: o } = k(e), r = O(), [i, a] = T(!1);
18751
+ return I(() => {
18752
18752
  if (!o) return;
18753
18753
  const s = () => {
18754
18754
  a(
@@ -18808,13 +18808,13 @@ function T9({
18808
18808
  ] }) })
18809
18809
  ] });
18810
18810
  }
18811
- function I9({
18811
+ function T9({
18812
18812
  className: e,
18813
18813
  maxShowCount: t = 20,
18814
18814
  topOffset: n = 0,
18815
18815
  ...o
18816
18816
  }) {
18817
- const { tocContent: r, navigateToHeading: i, normalizeHeadingDepths: a } = Eo(), s = $(!1), c = $(null), [u, d] = I(null), f = V(
18817
+ const { tocContent: r, navigateToHeading: i, normalizeHeadingDepths: a } = Eo(), s = $(!1), c = $(null), [u, d] = T(null), f = V(
18818
18818
  () => r ?? [],
18819
18819
  [r]
18820
18820
  ), p = V(
@@ -18840,7 +18840,7 @@ function I9({
18840
18840
  },
18841
18841
  [i, n]
18842
18842
  );
18843
- T(() => {
18843
+ I(() => {
18844
18844
  if (typeof window > "u" || s.current || !f.length)
18845
18845
  return;
18846
18846
  const E = window.location.hash.replace(/^#/, "");
@@ -18849,7 +18849,7 @@ function I9({
18849
18849
  R && (d(R.id), s.current = !0);
18850
18850
  }, [f]);
18851
18851
  const y = $(null), x = $(u);
18852
- x.current = u, T(() => {
18852
+ x.current = u, I(() => {
18853
18853
  if (typeof window > "u") return;
18854
18854
  const E = () => {
18855
18855
  const U = Date.now(), X = c.current;
@@ -19171,8 +19171,8 @@ function O9(e, t, n) {
19171
19171
  return t.type === "blockMath" ? e.commands.updateBlockMath({ latex: n, pos: t.pos }) : e.commands.updateInlineMath({ latex: n, pos: t.pos });
19172
19172
  }
19173
19173
  function P9({ editor: e, target: t, onOpenChange: n }) {
19174
- const o = O(), r = $(null), [i, a] = I("");
19175
- T(() => {
19174
+ const o = O(), r = $(null), [i, a] = T("");
19175
+ I(() => {
19176
19176
  if (!t) {
19177
19177
  a("");
19178
19178
  return;
@@ -19286,8 +19286,8 @@ function _9({
19286
19286
  mathEditTarget: t,
19287
19287
  onMathEditOpenChange: n
19288
19288
  }) {
19289
- const { editor: o } = ke(cn), { mentionUsers: r } = Mn(), { isDragging: i } = ko(o), [a, s] = I(null), c = $(null), u = $(null), d = $(""), f = $(""), p = $("ask"), h = "var(--tt-brand-color-500)", g = $9(e), C = Z9(e), b = O();
19290
- if (h2(), T(() => {
19289
+ const { editor: o } = ke(cn), { mentionUsers: r } = Mn(), { isDragging: i } = ko(o), [a, s] = T(null), c = $(null), u = $(null), d = $(""), f = $(""), p = $("ask"), h = "var(--tt-brand-color-500)", g = $9(e), C = Z9(e), b = O();
19290
+ if (h2(), I(() => {
19291
19291
  if (!o) return;
19292
19292
  const M = (N) => {
19293
19293
  o.storage.uiState?.isDragging && N.stopPropagation();
@@ -19515,7 +19515,7 @@ function j9({
19515
19515
  collaboration: e
19516
19516
  }) {
19517
19517
  const { setOnlineUsers: t } = Mn(), { editor: n } = ke(cn);
19518
- return T(() => {
19518
+ return I(() => {
19519
19519
  if (!n) {
19520
19520
  t([]);
19521
19521
  return;
@@ -19552,7 +19552,7 @@ function q9(e) {
19552
19552
  variant: w = "page",
19553
19553
  showHeader: v,
19554
19554
  showToc: y
19555
- } = e, { setTocContent: x } = Eo(), { user: L } = Mn(), E = w === "embedded", R = ol(!E, v), U = ol(!E, y), X = z9(b), fe = Ze(s, c), Z = r ?? fe.placeholder, J = Y1(i, { linkBase: a }), M = $(J), N = ti(n), W = g ?? ((G) => console.error(`${fe.uploadFailed}:`, G)), [D, z] = I(null), _ = $(
19555
+ } = e, { setTocContent: x } = Eo(), { user: L } = Mn(), E = w === "embedded", R = ol(!E, v), U = ol(!E, y), X = z9(b), fe = Ze(s, c), Z = r ?? fe.placeholder, J = Y1(i, { linkBase: a }), M = $(J), N = ti(n), W = g ?? ((G) => console.error(`${fe.uploadFailed}:`, G)), [D, z] = T(null), _ = $(
19556
19556
  null
19557
19557
  ), q = rc({
19558
19558
  immediatelyRender: !1,
@@ -19614,7 +19614,7 @@ function q9(e) {
19614
19614
  cellMinWidth: 120
19615
19615
  }
19616
19616
  }),
19617
- T2.configure({
19617
+ I2.configure({
19618
19618
  types: [
19619
19619
  "paragraph",
19620
19620
  "heading",
@@ -19627,7 +19627,7 @@ function q9(e) {
19627
19627
  "tocNode"
19628
19628
  ]
19629
19629
  }),
19630
- I2,
19630
+ T2,
19631
19631
  uc,
19632
19632
  pl.configure({
19633
19633
  blockOptions: {
@@ -19690,9 +19690,9 @@ function q9(e) {
19690
19690
  })
19691
19691
  ]
19692
19692
  });
19693
- return T(() => {
19693
+ return I(() => {
19694
19694
  _.current = q;
19695
- }, [q]), T(() => {
19695
+ }, [q]), I(() => {
19696
19696
  if (!q || !B9(n))
19697
19697
  return;
19698
19698
  const G = V9(
@@ -19735,7 +19735,7 @@ function q9(e) {
19735
19735
  }
19736
19736
  }
19737
19737
  ),
19738
- U ? /* @__PURE__ */ l(I9, { topOffset: 48 }) : null
19738
+ U ? /* @__PURE__ */ l(T9, { topOffset: 48 }) : null
19739
19739
  ]
19740
19740
  }
19741
19741
  ),