zs_library 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -7,46 +7,46 @@ import { initReactI18next as Li } from "react-i18next";
7
7
  import { jsx as h, jsxs as x, Fragment as rt } from "react/jsx-runtime";
8
8
  import { cx as D, css as S } from "@emotion/css";
9
9
  import * as ne from "react";
10
- import { createContext as Qo, useMemo as pt, useContext as er, useState as J, useRef as mt, useCallback as Vi, useEffect as $e, Fragment as Fi, forwardRef as $i } from "react";
11
- import Hi from "react-slick";
10
+ import { createContext as Qo, useMemo as pt, useContext as er, useState as J, useRef as mt, useEffect as $e, Fragment as Vi, forwardRef as Fi } from "react";
11
+ import $i from "react-slick";
12
12
  import { ReactSortable as Ln } from "react-sortablejs";
13
- import { AnimatePresence as Vn, motion as B, useMotionValue as qi, useTransform as kt, useSpring as Ht } from "framer-motion";
14
- import { useLocalStorageState as Wi, useDebounceEffect as Ji } from "ahooks";
13
+ import { AnimatePresence as Vn, motion as B, useMotionValue as Hi, useTransform as kt, useSpring as Ht } from "framer-motion";
14
+ import { useLocalStorageState as qi, useDebounceEffect as Wi } from "ahooks";
15
15
  import { v4 as no } from "uuid";
16
16
  import tr from "rc-tooltip";
17
- import { RiPencilRuler2Line as Ki, RiShareLine as Ui, RiInformationLine as ji, RiCloseCircleLine as Yi, RiArrowUpDownLine as Gi, RiArrowLeftRightLine as Xi, RiArrowRightLine as _i, RiArrowLeftLine as Zi, RiCloseLine as Qi, RiZoomOutLine as es, RiZoomInLine as ts, RiClockwise2Line as ns, RiAnticlockwise2Line as os, RiMoreLine as rs, RiArrowDropDownLine as nr, RiCheckLine as Tt, RiLink as is, RiDeleteBinLine as or, RiText as rr, RiH1 as ir, RiH2 as sr, RiH3 as lr, RiListCheck as ar, RiListUnordered as cr, RiListOrdered as dr, RiQuoteText as ur, RiCodeLine as hr, RiSparklingFill as Fn, RiImageLine as ss, RiArrowRightSLine as ls, RiRepeatLine as as, RiFileCopyLine as cs, RiAddLine as ds, RiDraggable as us } from "@remixicon/react";
17
+ import { RiPencilRuler2Line as Ji, RiShareLine as Ki, RiInformationLine as Ui, RiCloseCircleLine as ji, RiArrowUpDownLine as Yi, RiArrowLeftRightLine as Gi, RiArrowRightLine as Xi, RiArrowLeftLine as _i, RiCloseLine as Zi, RiZoomOutLine as Qi, RiZoomInLine as es, RiClockwise2Line as ts, RiAnticlockwise2Line as ns, RiMoreLine as os, RiArrowDropDownLine as nr, RiCheckLine as Tt, RiLink as rs, RiDeleteBinLine as or, RiText as rr, RiH1 as ir, RiH2 as sr, RiH3 as lr, RiListCheck as ar, RiListUnordered as cr, RiListOrdered as dr, RiQuoteText as ur, RiCodeLine as hr, RiSparklingFill as Fn, RiImageLine as is, RiArrowRightSLine as ss, RiRepeatLine as ls, RiFileCopyLine as as, RiAddLine as cs, RiDraggable as ds } from "@remixicon/react";
18
18
  import fr from "rc-dialog";
19
- import hs from "react-json-view";
20
- import { AdmonitionDirectiveDescriptor as fs, MDXEditor as ps, toolbarPlugin as ms, diffSourcePlugin as gs, listsPlugin as bs, quotePlugin as ys, headingsPlugin as ks, linkPlugin as xs, linkDialogPlugin as Cs, imagePlugin as Ss, tablePlugin as Ns, thematicBreakPlugin as Ts, frontmatterPlugin as ws, codeBlockPlugin as Ds, codeMirrorPlugin as Ms, markdownShortcutPlugin as Os, directivesPlugin as vs, DiffSourceToggleWrapper as Is, UndoRedo as As, Separator as Ke, BoldItalicUnderlineToggles as Es, CodeToggle as Rs, StrikeThroughSupSubToggles as Ps, ListsToggle as zs, CreateLink as Bs, InsertImage as Ls, InsertTable as Vs, InsertThematicBreak as Fs, InsertCodeBlock as $s, InsertFrontmatter as Hs } from "@mdxeditor/editor";
19
+ import us from "react-json-view";
20
+ import { AdmonitionDirectiveDescriptor as hs, MDXEditor as fs, toolbarPlugin as ps, diffSourcePlugin as ms, listsPlugin as gs, quotePlugin as bs, headingsPlugin as ys, linkPlugin as ks, linkDialogPlugin as xs, imagePlugin as Cs, tablePlugin as Ss, thematicBreakPlugin as Ns, frontmatterPlugin as Ts, codeBlockPlugin as ws, codeMirrorPlugin as Ds, markdownShortcutPlugin as Ms, directivesPlugin as Os, DiffSourceToggleWrapper as vs, UndoRedo as Is, Separator as Ke, BoldItalicUnderlineToggles as As, CodeToggle as Es, StrikeThroughSupSubToggles as Rs, ListsToggle as Ps, CreateLink as zs, InsertImage as Bs, InsertTable as Ls, InsertThematicBreak as Vs, InsertCodeBlock as Fs, InsertFrontmatter as $s } from "@mdxeditor/editor";
21
21
  import pr from "react-markdown";
22
- import qs from "remark-gfm";
23
- import Ws from "remark-emoji";
24
- import Js from "rehype-raw";
25
- import { Prism as Ks } from "react-syntax-highlighter";
26
- import Us from "rc-image";
27
- import { clsx as js } from "clsx";
28
- import { twMerge as Ys } from "tailwind-merge";
29
- import { Placeholder as Gs, TiptapLink as Xs, TiptapImage as _s, UploadImagesPlugin as Zs, UpdatedImage as Qs, TaskList as el, TaskItem as tl, HorizontalRule as nl, StarterKit as ol, CodeBlockLowlight as rl, Mathematics as il, CharacterCount as sl, AIHighlight as ll, TiptapUnderline as al, HighlightExtension as cl, TextStyle as dl, Color as ul, CustomKeymap as hl, useEditor as xe, EditorBubbleItem as Xt, getPrevText as fl, addAIHighlight as pl, removeAIHighlight as ml, EditorBubble as gl, createImageUpload as mr, Command as bl, createSuggestionItems as yl, renderItems as kl, EditorRoot as xl, EditorContent as Cl, handleImageDrop as Sl, handleImagePaste as Nl, handleCommandNavigation as Tl, EditorCommand as wl, EditorCommandEmpty as Dl, EditorCommandList as Ml, EditorCommandItem as Ol, ImageResizer as vl } from "novel";
30
- import { useDebouncedCallback as Il } from "use-debounce";
31
- import { Markdown as Al } from "tiptap-markdown";
32
- import { cx as le, cva as El } from "class-variance-authority";
33
- import { createLowlight as Rl, common as Pl } from "lowlight";
34
- import { Extension as zl } from "@tiptap/core";
22
+ import Hs from "remark-gfm";
23
+ import qs from "remark-emoji";
24
+ import Ws from "rehype-raw";
25
+ import { Prism as Js } from "react-syntax-highlighter";
26
+ import Ks from "rc-image";
27
+ import { clsx as Us } from "clsx";
28
+ import { twMerge as js } from "tailwind-merge";
29
+ import { Placeholder as Ys, TiptapLink as Gs, TiptapImage as Xs, UploadImagesPlugin as _s, UpdatedImage as Zs, TaskList as Qs, TaskItem as el, HorizontalRule as tl, StarterKit as nl, CodeBlockLowlight as ol, Mathematics as rl, CharacterCount as il, AIHighlight as sl, TiptapUnderline as ll, HighlightExtension as al, TextStyle as cl, Color as dl, CustomKeymap as ul, useEditor as xe, EditorBubbleItem as Xt, getPrevText as hl, addAIHighlight as fl, removeAIHighlight as pl, EditorBubble as ml, createImageUpload as mr, Command as gl, createSuggestionItems as bl, renderItems as yl, EditorRoot as kl, EditorContent as xl, handleImageDrop as Cl, handleImagePaste as Sl, handleCommandNavigation as Nl, EditorCommand as Tl, EditorCommandEmpty as wl, EditorCommandList as Dl, EditorCommandItem as Ml, ImageResizer as Ol } from "novel";
30
+ import { useDebouncedCallback as vl } from "use-debounce";
31
+ import { Markdown as Il } from "tiptap-markdown";
32
+ import { cx as le, cva as Al } from "class-variance-authority";
33
+ import { createLowlight as El, common as Rl } from "lowlight";
34
+ import { Extension as Pl } from "@tiptap/core";
35
35
  import * as wt from "@radix-ui/react-popover";
36
- import { Popover as gr, PopoverTrigger as Bl } from "@radix-ui/react-popover";
37
- import { Slot as Ll } from "@radix-ui/react-slot";
38
- import { SigmaIcon as Vl, X as Fl, Check as $l, TextQuote as Hl, TrashIcon as ql, RefreshCcwDot as Wl, CheckCheck as Jl, ArrowDownWideNarrow as Kl, WrapText as Ul, StepForward as jl, ArrowUp as Yl, BoldIcon as Gl, ItalicIcon as Xl, UnderlineIcon as _l, StrikethroughIcon as Zl, CodeIcon as Ql } from "lucide-react";
36
+ import { Popover as gr, PopoverTrigger as zl } from "@radix-ui/react-popover";
37
+ import { Slot as Bl } from "@radix-ui/react-slot";
38
+ import { SigmaIcon as Ll, X as Vl, Check as Fl, TextQuote as $l, TrashIcon as Hl, RefreshCcwDot as ql, CheckCheck as Wl, ArrowDownWideNarrow as Jl, WrapText as Kl, StepForward as Ul, ArrowUp as jl, BoldIcon as Yl, ItalicIcon as Gl, UnderlineIcon as Xl, StrikethroughIcon as _l, CodeIcon as Zl } from "lucide-react";
39
39
  import * as br from "@radix-ui/react-separator";
40
- import { useCompletion as ea } from "@ai-sdk/react";
40
+ import { useCompletion as Ql } from "@ai-sdk/react";
41
41
  import { toast as Dt } from "sonner";
42
42
  import * as Ze from "@radix-ui/react-scroll-area";
43
43
  import { Command as ce } from "cmdk";
44
- import * as we from "@radix-ui/react-dialog";
45
- import ta from "highlight.js";
46
- import na from "rc-dropdown";
44
+ import * as Te from "@radix-ui/react-dialog";
45
+ import ea from "highlight.js";
46
+ import ta from "rc-dropdown";
47
47
  import qt from "rc-menu";
48
- import { generateHTML as oa } from "@tiptap/html";
49
- const ra = {
48
+ import { generateHTML as na } from "@tiptap/html";
49
+ const oa = {
50
50
  common: {
51
51
  ok: "确定",
52
52
  cancel: "取消",
@@ -71,7 +71,7 @@ const ra = {
71
71
  link: "链接",
72
72
  image: "图片"
73
73
  }
74
- }, ia = {
74
+ }, ra = {
75
75
  common: {
76
76
  ok: "OK",
77
77
  cancel: "Cancel",
@@ -96,15 +96,15 @@ const ra = {
96
96
  link: "Link",
97
97
  image: "Image"
98
98
  }
99
- }, sa = "common";
99
+ }, ia = "common";
100
100
  Bi.use(Li).init({
101
101
  resources: {
102
- "zh-CN": ra,
103
- "en-US": ia
102
+ "zh-CN": oa,
103
+ "en-US": ra
104
104
  },
105
105
  lng: "zh-CN",
106
106
  fallbackLng: "zh-CN",
107
- defaultNS: sa,
107
+ defaultNS: ia,
108
108
  interpolation: {
109
109
  escapeValue: !1
110
110
  }
@@ -137,17 +137,17 @@ const yr = {
137
137
  }
138
138
  }, xr = Qo(
139
139
  {}
140
- ), la = (n) => {
140
+ ), sa = (n) => {
141
141
  const { children: e, theme: t, ...o } = n, r = pt(() => t === "light" ? yr : t === "dark" ? kr : t, [t]);
142
142
  return /* @__PURE__ */ h(xr.Provider, { value: { theme: r, ...o }, children: e });
143
143
  }, it = () => er(xr), Cr = {
144
144
  maxRow: 2,
145
145
  maxCol: 2
146
- }, aa = {
146
+ }, la = {
147
147
  ...Cr
148
148
  }, Sr = {
149
149
  app: Cr,
150
- group: aa
150
+ group: la
151
151
  };
152
152
  class ye {
153
153
  }
@@ -191,7 +191,7 @@ const Nr = Qo({
191
191
  moveTargetId: null,
192
192
  setMoveTargetId: () => {
193
193
  }
194
- }), ca = (n) => {
194
+ }), aa = (n) => {
195
195
  const {
196
196
  children: e,
197
197
  list: t = [],
@@ -204,7 +204,7 @@ const Nr = Qo({
204
204
  null
205
205
  ), [I, M] = J(!1), [v, w] = J(null), [N, X] = J(
206
206
  null
207
- ), [K, Ce] = J(!1), [Oe, R] = Wi(r, {
207
+ ), [K, Ce] = J(!1), [Me, R] = qi(r, {
208
208
  defaultValue: [],
209
209
  listenStorageChange: !0
210
210
  }), U = () => {
@@ -232,41 +232,38 @@ const Nr = Qo({
232
232
  Q && (H.preventDefault(), V(H, P));
233
233
  }
234
234
  };
235
- }, Se = Vi(
236
- (P, Q) => {
237
- const Y = [...Q || []];
238
- if (Y.length > 0)
239
- g((H) => {
240
- const L = [...H], F = (z) => {
241
- var eo, to;
242
- const W = Y.shift(), _ = z.find((ve) => ve.id === W), Ne = z.findIndex((ve) => ve.id === W);
243
- if (Y.length && _) {
244
- if (((eo = _.children) == null ? void 0 : eo.filter(
245
- (ve) => !P.some((Ri) => Ri.id === ve.id)
246
- ).length) === 1 && P.length === 1) {
247
- const ve = { ...P[0] };
248
- return z.splice(Ne, 1, ve), o == null || o(z), z;
249
- }
250
- return _.children = F(_.children || []), z.splice(Ne, 1, _), o == null || o(z), z;
235
+ }, Oe = (P, Q) => {
236
+ const Y = [...Q || []];
237
+ if (Y.length > 0)
238
+ g((H) => {
239
+ const L = [...H], F = (z) => {
240
+ var eo, to;
241
+ const W = Y.shift(), _ = z.find((ve) => ve.id === W), Se = z.findIndex((ve) => ve.id === W);
242
+ if (Y.length && _) {
243
+ if (((eo = _.children) == null ? void 0 : eo.filter(
244
+ (ve) => !P.some((Ri) => Ri.id === ve.id)
245
+ ).length) === 1 && P.length === 1) {
246
+ const ve = { ...P[0] };
247
+ return z.splice(Se, 1, ve), o == null || o(z), z;
251
248
  }
252
- if (_) {
253
- if (!((to = _.children) != null && to.length) && P.length) {
254
- const ve = { ..._ };
255
- return _.data = { name: "文件夹" }, _.type = "group", _.children = [ve, ...P], _.id = no(), z.splice(Ne, 1, _), o == null || o(z), z;
256
- }
257
- return _.children = ye.uniqueArray(P), z.splice(Ne, 1, _), o == null || o(z), z;
249
+ return _.children = F(_.children || []), z.splice(Se, 1, _), o == null || o(z), z;
250
+ }
251
+ if (_) {
252
+ if (!((to = _.children) != null && to.length) && P.length) {
253
+ const ve = { ..._ };
254
+ return _.data = { name: "文件夹" }, _.type = "group", _.children = [ve, ...P], _.id = no(), z.splice(Se, 1, _), o == null || o(z), z;
258
255
  }
259
- return ye.uniqueArray(P);
260
- };
261
- return ye.uniqueArray(F(L));
262
- });
263
- else {
264
- const H = ye.uniqueArray(P);
265
- o == null || o(H), g(H);
266
- }
267
- },
268
- [o]
269
- ), an = (P, Q) => {
256
+ return _.children = ye.uniqueArray(P), z.splice(Se, 1, _), o == null || o(z), z;
257
+ }
258
+ return ye.uniqueArray(P);
259
+ };
260
+ return ye.uniqueArray(F(L));
261
+ });
262
+ else {
263
+ const H = ye.uniqueArray(P);
264
+ o == null || o(H), g(H);
265
+ }
266
+ }, an = (P, Q) => {
270
267
  g((Y) => {
271
268
  const H = [...Y], L = (F) => {
272
269
  var z;
@@ -304,18 +301,18 @@ const Nr = Qo({
304
301
  });
305
302
  }, ze = (P, Q) => {
306
303
  const Y = [...b], H = (L, F) => {
307
- const z = F.shift(), W = L.find((Ne) => Ne.id === z), _ = L.findIndex((Ne) => Ne.id === z);
304
+ const z = F.shift(), W = L.find((Se) => Se.id === z), _ = L.findIndex((Se) => Se.id === z);
308
305
  if (W) {
309
306
  if (F.length)
310
307
  W.children = H(W.children || [], F);
311
308
  else {
312
- const Ne = (P == null ? void 0 : P.type) ?? "app";
309
+ const Se = (P == null ? void 0 : P.type) ?? "app";
313
310
  W.children = [
314
311
  ...W.children ?? [],
315
312
  {
316
313
  ...P,
317
314
  id: no(),
318
- config: (P == null ? void 0 : P.config) ?? Sr[Ne]
315
+ config: (P == null ? void 0 : P.config) ?? Sr[Se]
319
316
  }
320
317
  ];
321
318
  }
@@ -326,12 +323,12 @@ const Nr = Qo({
326
323
  g(H(Y, Q));
327
324
  };
328
325
  return $e(() => {
329
- (t == null ? void 0 : t.length) > 0 && (b.length === 0 || JSON.stringify(b) !== JSON.stringify(t)) && Se(t);
330
- }, [Se, b, t]), $e(() => {
326
+ (t == null ? void 0 : t.length) > 0 && b.length === 0 && Oe(t);
327
+ }, [t]), $e(() => {
331
328
  f.current = d, d !== null && U();
332
329
  }, [d]), $e(() => {
333
- i && Oe != null && Oe.length && !K && (Se(Oe), Ce(!0));
334
- }, [Oe, K, i]), Ji(
330
+ i && Me != null && Me.length && !K && (Oe(Me), Ce(!0));
331
+ }, [Me, K, i]), Wi(
335
332
  () => {
336
333
  i && R(b);
337
334
  },
@@ -344,7 +341,7 @@ const Nr = Qo({
344
341
  {
345
342
  value: {
346
343
  list: b,
347
- setList: Se,
344
+ setList: Oe,
348
345
  contextMenu: m,
349
346
  setContextMenu: p,
350
347
  listStatus: d,
@@ -368,7 +365,7 @@ const Nr = Qo({
368
365
  children: e
369
366
  }
370
367
  );
371
- }, bt = () => er(Nr), da = {
368
+ }, bt = () => er(Nr), ca = {
372
369
  menuShow: {
373
370
  opacity: 1,
374
371
  y: 0,
@@ -400,7 +397,7 @@ const Nr = Qo({
400
397
  onClick: (l) => {
401
398
  l.stopPropagation(), o == null || o();
402
399
  },
403
- variants: da,
400
+ variants: ca,
404
401
  children: /* @__PURE__ */ x(
405
402
  B.div,
406
403
  {
@@ -435,7 +432,7 @@ const Nr = Qo({
435
432
  )
436
433
  }
437
434
  );
438
- }, ua = (n) => {
435
+ }, da = (n) => {
439
436
  const {
440
437
  showInfoButton: e = !0,
441
438
  showRemoveButton: t = !0,
@@ -496,7 +493,7 @@ const Nr = Qo({
496
493
  {
497
494
  label: "修改大小",
498
495
  key: "size",
499
- icon: /* @__PURE__ */ h(Ki, { size: 14 }),
496
+ icon: /* @__PURE__ */ h(Ji, { size: 14 }),
500
497
  items: O().map((k) => ({
501
498
  label: k,
502
499
  key: k,
@@ -619,7 +616,7 @@ const Nr = Qo({
619
616
  o && /* @__PURE__ */ h(
620
617
  dn,
621
618
  {
622
- icon: /* @__PURE__ */ h(Ui, { size: 20 }),
619
+ icon: /* @__PURE__ */ h(Ki, { size: 20 }),
623
620
  title: "分享",
624
621
  onClick: () => {
625
622
  if (s) {
@@ -632,7 +629,7 @@ const Nr = Qo({
632
629
  e && /* @__PURE__ */ h(
633
630
  dn,
634
631
  {
635
- icon: /* @__PURE__ */ h(ji, { size: 20 }),
632
+ icon: /* @__PURE__ */ h(Ui, { size: 20 }),
636
633
  title: "信息",
637
634
  onClick: () => {
638
635
  if (i) {
@@ -650,7 +647,7 @@ const Nr = Qo({
650
647
  t && /* @__PURE__ */ h(
651
648
  dn,
652
649
  {
653
- icon: /* @__PURE__ */ h(Yi, { size: 20 }),
650
+ icon: /* @__PURE__ */ h(ji, { size: 20 }),
654
651
  title: "移除",
655
652
  onClick: () => {
656
653
  if (l) {
@@ -667,7 +664,7 @@ const Nr = Qo({
667
664
  ]
668
665
  }
669
666
  ) });
670
- }, ha = (n) => {
667
+ }, ua = (n) => {
671
668
  const { data: e, noLetters: t = !1 } = n, { contextMenuFuns: o } = bt(), { itemIconBuilder: r, theme: i, contextMenu: s } = it(), { light: l, dark: a } = ye.getTheme(i), { data: c = {} } = e, { name: d } = c;
672
669
  return /* @__PURE__ */ x(rt, { children: [
673
670
  /* @__PURE__ */ h(
@@ -752,7 +749,7 @@ const Nr = Qo({
752
749
  border: none;
753
750
  }
754
751
  `,
755
- overlay: /* @__PURE__ */ h(ua, { ...u }),
752
+ overlay: /* @__PURE__ */ h(da, { ...u }),
756
753
  visible: (c == null ? void 0 : c.data.id) === e.id,
757
754
  onVisibleChange: (f) => {
758
755
  f || d(null);
@@ -767,12 +764,12 @@ const Nr = Qo({
767
764
  "data-children-length": a,
768
765
  onClick: () => r == null ? void 0 : r(e),
769
766
  className: D(i && "drag-disabled", t),
770
- children: s ?? /* @__PURE__ */ h(ha, { ...n })
767
+ children: s ?? /* @__PURE__ */ h(ua, { ...n })
771
768
  }
772
769
  )
773
770
  }
774
771
  );
775
- }, fa = (n) => {
772
+ }, ha = (n) => {
776
773
  const {
777
774
  data: e,
778
775
  className: t,
@@ -792,7 +789,7 @@ const Nr = Qo({
792
789
  } = bt(), { itemIconBuilder: b, theme: g, contextMenu: y } = it(), { light: C, dark: O } = ye.getTheme(g), { children: k, data: I, config: M } = e, { row: v = 1, col: w = 1 } = M ?? {}, N = {
793
790
  visible: { opacity: 1, scale: 1 },
794
791
  hidden: { opacity: 0, scale: 0.95 }
795
- }, X = ((k == null ? void 0 : k.length) ?? 0) === 0, K = X ? [e] : [...k ?? []].slice(0, 9), Ce = pt(() => u === e.id.toString(), [e.id, u]), Oe = pt(() => f === e.id, [e.id, f]), R = S`
792
+ }, X = ((k == null ? void 0 : k.length) ?? 0) === 0, K = X ? [e] : [...k ?? []].slice(0, 9), Ce = pt(() => u === e.id.toString(), [e.id, u]), Me = pt(() => f === e.id, [e.id, f]), R = S`
796
793
  overflow: hidden;
797
794
  cursor: pointer;
798
795
  background-color: ${C.itemIconBackgroundColor};
@@ -896,8 +893,8 @@ const Nr = Qo({
896
893
  grid-row: span 2 / span 2;
897
894
  `
898
895
  ),
899
- onClick: (Se) => {
900
- de > 2 || (Se.stopPropagation(), i == null || i(V));
896
+ onClick: (Oe) => {
897
+ de > 2 || (Oe.stopPropagation(), i == null || i(V));
901
898
  },
902
899
  children: b == null ? void 0 : b(V)
903
900
  },
@@ -937,8 +934,8 @@ const Nr = Qo({
937
934
  grid-row: span 2 / span 2;
938
935
  `
939
936
  ),
940
- onClick: (Se) => {
941
- de > 2 || (Se.stopPropagation(), i == null || i(V));
937
+ onClick: (Oe) => {
938
+ de > 2 || (Oe.stopPropagation(), i == null || i(V));
942
939
  },
943
940
  children: b == null ? void 0 : b(V)
944
941
  },
@@ -967,7 +964,7 @@ const Nr = Qo({
967
964
  {
968
965
  whileTap: { scale: 0.9 },
969
966
  className: D(
970
- Oe ? "!scale-110" : "",
967
+ Me ? "!scale-110" : "",
971
968
  S`
972
969
  cursor: pointer;
973
970
  position: relative;
@@ -1075,7 +1072,7 @@ const Nr = Qo({
1075
1072
  transition: all 0.2s;
1076
1073
  }
1077
1074
  }
1078
- `, pa = (n) => {
1075
+ `, fa = (n) => {
1079
1076
  const { data: e, onClose: t, onItemClick: o } = n, {
1080
1077
  list: r,
1081
1078
  setList: i,
@@ -1218,7 +1215,7 @@ const Nr = Qo({
1218
1215
  )
1219
1216
  }
1220
1217
  );
1221
- }, ma = (n) => {
1218
+ }, pa = (n) => {
1222
1219
  var o;
1223
1220
  const { data: e, onClose: t } = n;
1224
1221
  return /* @__PURE__ */ h(
@@ -1238,11 +1235,11 @@ const Nr = Qo({
1238
1235
  title: ((o = e == null ? void 0 : e.data) == null ? void 0 : o.name) ?? "信息",
1239
1236
  children: e && /* @__PURE__ */ x("div", { children: [
1240
1237
  /* @__PURE__ */ h("div", { className: "mb-2", children: "开发者信息" }),
1241
- /* @__PURE__ */ h("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ h(hs, { src: e, theme: "monokai" }) })
1238
+ /* @__PURE__ */ h("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ h(us, { src: e, theme: "monokai" }) })
1242
1239
  ] })
1243
1240
  }
1244
1241
  );
1245
- }, ga = (n) => {
1242
+ }, ma = (n) => {
1246
1243
  const {
1247
1244
  pagination: e = { position: "bottom" },
1248
1245
  className: t,
@@ -1313,7 +1310,7 @@ const Nr = Qo({
1313
1310
  }[e.position ?? "bottom"], [e]);
1314
1311
  return /* @__PURE__ */ x(rt, { children: [
1315
1312
  /* @__PURE__ */ h(
1316
- Hi,
1313
+ $i,
1317
1314
  {
1318
1315
  useCSS: !0,
1319
1316
  useTransform: !0,
@@ -1446,7 +1443,7 @@ const Nr = Qo({
1446
1443
  case "group":
1447
1444
  case "app":
1448
1445
  N = /* @__PURE__ */ h(
1449
- fa,
1446
+ ha,
1450
1447
  {
1451
1448
  data: v,
1452
1449
  itemIndex: w,
@@ -1478,7 +1475,7 @@ const Nr = Qo({
1478
1475
  }
1479
1476
  ),
1480
1477
  /* @__PURE__ */ h(
1481
- ma,
1478
+ pa,
1482
1479
  {
1483
1480
  data: u,
1484
1481
  onClose: () => {
@@ -1487,7 +1484,7 @@ const Nr = Qo({
1487
1484
  }
1488
1485
  ),
1489
1486
  /* @__PURE__ */ h(
1490
- pa,
1487
+ fa,
1491
1488
  {
1492
1489
  data: m,
1493
1490
  onClose: () => {
@@ -1497,7 +1494,7 @@ const Nr = Qo({
1497
1494
  }
1498
1495
  )
1499
1496
  ] });
1500
- }, lh = (n) => {
1497
+ }, sh = (n) => {
1501
1498
  const {
1502
1499
  list: e,
1503
1500
  onChange: t,
@@ -1513,12 +1510,12 @@ const Nr = Qo({
1513
1510
  pagingDotsBuilder: f,
1514
1511
  ...m
1515
1512
  } = n;
1516
- return /* @__PURE__ */ h(ca, { ...{
1513
+ return /* @__PURE__ */ h(aa, { ...{
1517
1514
  list: e,
1518
1515
  onChange: t,
1519
1516
  storageKey: o,
1520
1517
  enableCaching: r
1521
- }, children: /* @__PURE__ */ h(la, { ...{
1518
+ }, children: /* @__PURE__ */ h(sa, { ...{
1522
1519
  theme: i,
1523
1520
  noLetters: s,
1524
1521
  contextMenu: l,
@@ -1527,8 +1524,8 @@ const Nr = Qo({
1527
1524
  itemBuilder: c,
1528
1525
  itemIconBuilder: d,
1529
1526
  contextMenuBuilder: a
1530
- }, children: /* @__PURE__ */ h(ga, { ...m }) }) });
1531
- }, ba = {
1527
+ }, children: /* @__PURE__ */ h(ma, { ...m }) }) });
1528
+ }, ga = {
1532
1529
  frontmatterEditor: {
1533
1530
  title: "编辑前置元数据",
1534
1531
  key: "键",
@@ -1645,13 +1642,13 @@ const Nr = Qo({
1645
1642
  image: {
1646
1643
  delete: "删除图片"
1647
1644
  }
1648
- }, ya = (n, e, t) => {
1645
+ }, ba = (n, e, t) => {
1649
1646
  const r = n.split(".").reduce(
1650
1647
  (i, s) => typeof i == "string" ? i : i[s],
1651
- ba
1648
+ ga
1652
1649
  );
1653
1650
  return typeof r != "string" ? e : t ? r.replace(/{{(.*?)}}/g, (i, s) => t[s]) : r;
1654
- }, ka = S`
1651
+ }, ya = S`
1655
1652
  --accentBase: var(--tomato-1);
1656
1653
  --accentBgSubtle: var(--tomato-2);
1657
1654
  --accentBg: var(--tomato-3);
@@ -1705,7 +1702,7 @@ const Nr = Qo({
1705
1702
  rgba(255, 255, 255, 0.05),
1706
1703
  rgba(255, 255, 255, 0.05)
1707
1704
  );
1708
- `, xa = S`
1705
+ `, ka = S`
1709
1706
  [class*="_toolbarRoot"] {
1710
1707
  flex-wrap: wrap;
1711
1708
  transition: all 0.3s;
@@ -1911,7 +1908,7 @@ const Nr = Qo({
1911
1908
  `, Cn = (n) => {
1912
1909
  var e, t;
1913
1910
  return n === "dark" ? !0 : n === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (t = document.documentElement.getAttribute("style")) != null && t.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
1914
- }, Ca = (n) => {
1911
+ }, xa = (n) => {
1915
1912
  const {
1916
1913
  value: e,
1917
1914
  onChange: t,
@@ -1938,19 +1935,19 @@ const Nr = Qo({
1938
1935
  }
1939
1936
  },
1940
1937
  directives: b = {
1941
- directiveDescriptors: [fs]
1938
+ directiveDescriptors: [hs]
1942
1939
  }
1943
1940
  } = r ?? {}, [g, y] = J("");
1944
1941
  return $e(() => {
1945
1942
  var C;
1946
1943
  e !== void 0 && a.current && ((C = a.current) == null || C.setMarkdown(e), y(e));
1947
1944
  }, [e, a]), /* @__PURE__ */ h(
1948
- ps,
1945
+ fs,
1949
1946
  {
1950
1947
  ref: a,
1951
1948
  className: D(
1952
- xa,
1953
- Cn(s) ? ka : "",
1949
+ ka,
1950
+ Cn(s) ? ya : "",
1954
1951
  Cn(s) ? Mr : Dr,
1955
1952
  i
1956
1953
  ),
@@ -1959,49 +1956,49 @@ const Nr = Qo({
1959
1956
  onChange: (C) => {
1960
1957
  !e && !t && y(C), t && t(C);
1961
1958
  },
1962
- translation: o ?? ya,
1959
+ translation: o ?? ba,
1963
1960
  plugins: [
1964
- ms({
1965
- toolbarContents: () => /* @__PURE__ */ x(Is, { options: ["rich-text", "source"], children: [
1966
- /* @__PURE__ */ h(As, {}),
1961
+ ps({
1962
+ toolbarContents: () => /* @__PURE__ */ x(vs, { options: ["rich-text", "source"], children: [
1963
+ /* @__PURE__ */ h(Is, {}),
1967
1964
  /* @__PURE__ */ h(Ke, {}),
1965
+ /* @__PURE__ */ h(As, {}),
1968
1966
  /* @__PURE__ */ h(Es, {}),
1967
+ /* @__PURE__ */ h(Ke, {}),
1969
1968
  /* @__PURE__ */ h(Rs, {}),
1970
1969
  /* @__PURE__ */ h(Ke, {}),
1971
1970
  /* @__PURE__ */ h(Ps, {}),
1972
1971
  /* @__PURE__ */ h(Ke, {}),
1973
1972
  /* @__PURE__ */ h(zs, {}),
1974
- /* @__PURE__ */ h(Ke, {}),
1975
1973
  /* @__PURE__ */ h(Bs, {}),
1976
- /* @__PURE__ */ h(Ls, {}),
1977
1974
  /* @__PURE__ */ h(Ke, {}),
1975
+ /* @__PURE__ */ h(Ls, {}),
1978
1976
  /* @__PURE__ */ h(Vs, {}),
1979
- /* @__PURE__ */ h(Fs, {}),
1980
1977
  /* @__PURE__ */ h(Ke, {}),
1981
- /* @__PURE__ */ h($s, {}),
1978
+ /* @__PURE__ */ h(Fs, {}),
1982
1979
  /* @__PURE__ */ h(Ke, {}),
1983
- /* @__PURE__ */ h(Hs, {})
1980
+ /* @__PURE__ */ h($s, {})
1984
1981
  ] })
1985
1982
  }),
1986
- gs(d),
1983
+ ms(d),
1984
+ gs(),
1987
1985
  bs(),
1988
- ys(),
1989
- ks(u),
1990
- xs(f),
1991
- Cs(),
1992
- Ss(c),
1986
+ ys(u),
1987
+ ks(f),
1988
+ xs(),
1989
+ Cs(c),
1990
+ Ss(),
1993
1991
  Ns(),
1994
1992
  Ts(),
1995
- ws(),
1996
- Ds(m),
1997
- Ms(p),
1998
- Os(),
1999
- vs(b)
1993
+ ws(m),
1994
+ Ds(p),
1995
+ Ms(),
1996
+ Os(b)
2000
1997
  ],
2001
1998
  ...l
2002
1999
  }
2003
2000
  );
2004
- }, Sa = {
2001
+ }, Ca = {
2005
2002
  'code[class*="language-"]': {
2006
2003
  background: "hsl(230, 1%, 98%)",
2007
2004
  color: "hsl(230, 8%, 24%)",
@@ -2489,7 +2486,7 @@ const Nr = Qo({
2489
2486
  ".prism-previewer-easing.prism-previewer-easing line": {
2490
2487
  stroke: "hsl(230, 8%, 24%)"
2491
2488
  }
2492
- }, Na = (n) => {
2489
+ }, Sa = (n) => {
2493
2490
  const { children: e = "", className: t, theme: o = "auto", imageProps: r } = n;
2494
2491
  return /* @__PURE__ */ h(
2495
2492
  "div",
@@ -2499,39 +2496,39 @@ const Nr = Qo({
2499
2496
  pr,
2500
2497
  {
2501
2498
  className: D(wr, t),
2502
- remarkPlugins: [qs, Ws],
2503
- rehypePlugins: [Js],
2499
+ remarkPlugins: [Hs, qs],
2500
+ rehypePlugins: [Ws],
2504
2501
  components: {
2505
2502
  code(i) {
2506
2503
  const { children: s, className: l, node: a, ref: c, ...d } = i, u = /language-(\w+)/.exec(l || "");
2507
2504
  return u ? /* @__PURE__ */ h(
2508
- Ks,
2505
+ Js,
2509
2506
  {
2510
2507
  ...d,
2511
2508
  PreTag: "div",
2512
2509
  children: String(s).replace(/\n$/, ""),
2513
2510
  language: u[1],
2514
- style: Sa
2511
+ style: Ca
2515
2512
  }
2516
2513
  ) : /* @__PURE__ */ h("code", { ...d, className: l, children: s });
2517
2514
  },
2518
2515
  img(i) {
2519
2516
  const { preview: s, ...l } = r ?? {};
2520
2517
  return /* @__PURE__ */ h(
2521
- Us,
2518
+ Ks,
2522
2519
  {
2523
2520
  ...i,
2524
2521
  preview: s instanceof Boolean ? s : {
2525
2522
  icons: {
2526
- rotateLeft: /* @__PURE__ */ h(os, {}),
2527
- rotateRight: /* @__PURE__ */ h(ns, {}),
2528
- zoomIn: /* @__PURE__ */ h(ts, {}),
2529
- zoomOut: /* @__PURE__ */ h(es, {}),
2530
- close: /* @__PURE__ */ h(Qi, {}),
2531
- left: /* @__PURE__ */ h(Zi, {}),
2532
- right: /* @__PURE__ */ h(_i, {}),
2533
- flipX: /* @__PURE__ */ h(Xi, {}),
2534
- flipY: /* @__PURE__ */ h(Gi, {})
2523
+ rotateLeft: /* @__PURE__ */ h(ns, {}),
2524
+ rotateRight: /* @__PURE__ */ h(ts, {}),
2525
+ zoomIn: /* @__PURE__ */ h(es, {}),
2526
+ zoomOut: /* @__PURE__ */ h(Qi, {}),
2527
+ close: /* @__PURE__ */ h(Zi, {}),
2528
+ left: /* @__PURE__ */ h(_i, {}),
2529
+ right: /* @__PURE__ */ h(Xi, {}),
2530
+ flipX: /* @__PURE__ */ h(Gi, {}),
2531
+ flipY: /* @__PURE__ */ h(Yi, {})
2535
2532
  },
2536
2533
  zIndex: 9999,
2537
2534
  mask: " ",
@@ -2550,12 +2547,12 @@ const Nr = Qo({
2550
2547
  )
2551
2548
  }
2552
2549
  );
2553
- }, Ta = Ca;
2554
- Ta.Preview = Na;
2550
+ }, Na = xa;
2551
+ Na.Preview = Sa;
2555
2552
  function Or(...n) {
2556
- return Ys(js(n));
2553
+ return js(Us(n));
2557
2554
  }
2558
- const wa = (n) => {
2555
+ const Ta = (n) => {
2559
2556
  const { mouseX: e, title: t, icon: o, href: r } = n, i = mt(null), s = kt(e, (y) => {
2560
2557
  var O;
2561
2558
  const C = ((O = i.current) == null ? void 0 : O.getBoundingClientRect()) ?? { x: 0, width: 0 };
@@ -2616,7 +2613,7 @@ const wa = (n) => {
2616
2613
  }
2617
2614
  ) });
2618
2615
  }, vr = (n) => {
2619
- const { items: e, className: t } = n, o = qi(1 / 0);
2616
+ const { items: e, className: t } = n, o = Hi(1 / 0);
2620
2617
  return /* @__PURE__ */ h(
2621
2618
  B.div,
2622
2619
  {
@@ -2626,7 +2623,7 @@ const wa = (n) => {
2626
2623
  "mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",
2627
2624
  t
2628
2625
  ),
2629
- children: e.map((r) => /* @__PURE__ */ h(wa, { mouseX: o, ...r }, r.title))
2626
+ children: e.map((r) => /* @__PURE__ */ h(Ta, { mouseX: o, ...r }, r.title))
2630
2627
  }
2631
2628
  );
2632
2629
  }, Ir = (n) => {
@@ -2682,13 +2679,13 @@ const wa = (n) => {
2682
2679
  {
2683
2680
  onClick: l,
2684
2681
  className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
2685
- children: o || /* @__PURE__ */ h(rs, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2682
+ children: o || /* @__PURE__ */ h(os, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2686
2683
  }
2687
2684
  )
2688
2685
  ]
2689
2686
  }
2690
2687
  );
2691
- }, Da = (n) => {
2688
+ }, wa = (n) => {
2692
2689
  const { items: e, desktopClassName: t, mobileClassName: o, ...r } = n;
2693
2690
  return /* @__PURE__ */ x(rt, { children: [
2694
2691
  /* @__PURE__ */ h(vr, { items: e, className: t, ...r }),
@@ -2702,7 +2699,7 @@ const wa = (n) => {
2702
2699
  }
2703
2700
  )
2704
2701
  ] });
2705
- }, Ar = Da;
2702
+ }, Ar = wa;
2706
2703
  Ar.Desktop = vr;
2707
2704
  Ar.Mobile = Ir;
2708
2705
  function Er(n, e, t) {
@@ -3141,7 +3138,7 @@ class ue {
3141
3138
  }
3142
3139
  }
3143
3140
  ue.none = [];
3144
- class Ma extends Error {
3141
+ class Da extends Error {
3145
3142
  }
3146
3143
  class E {
3147
3144
  /**
@@ -3242,10 +3239,10 @@ function zr(n, e, t, o) {
3242
3239
  let l = zr(s.content, e - i - 1, t);
3243
3240
  return l && n.replaceChild(r, s.copy(l));
3244
3241
  }
3245
- function Oa(n) {
3242
+ function Ma(n) {
3246
3243
  return n.tag != null;
3247
3244
  }
3248
- function va(n) {
3245
+ function Oa(n) {
3249
3246
  return n.style != null;
3250
3247
  }
3251
3248
  let Br = class Nn {
@@ -3257,9 +3254,9 @@ let Br = class Nn {
3257
3254
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
3258
3255
  let o = this.matchedStyles = [];
3259
3256
  t.forEach((r) => {
3260
- if (Oa(r))
3257
+ if (Ma(r))
3261
3258
  this.tags.push(r);
3262
- else if (va(r)) {
3259
+ else if (Oa(r)) {
3263
3260
  let i = /[^=]*/.exec(r.style)[0];
3264
3261
  o.indexOf(i) < 0 && o.push(i), this.styles.push(r);
3265
3262
  }
@@ -3295,7 +3292,7 @@ let Br = class Nn {
3295
3292
  matchTag(e, t, o) {
3296
3293
  for (let r = o ? this.tags.indexOf(o) + 1 : 0; r < this.tags.length; r++) {
3297
3294
  let i = this.tags[r];
3298
- if (Ea(e, i.tag) && (i.namespace === void 0 || e.namespaceURI == i.namespace) && (!i.context || t.matchesContext(i.context))) {
3295
+ if (Aa(e, i.tag) && (i.namespace === void 0 || e.namespaceURI == i.namespace) && (!i.context || t.matchesContext(i.context))) {
3299
3296
  if (i.getAttrs) {
3300
3297
  let s = i.getAttrs(e);
3301
3298
  if (s === !1)
@@ -3396,7 +3393,7 @@ const Lr = {
3396
3393
  table: !0,
3397
3394
  tfoot: !0,
3398
3395
  ul: !0
3399
- }, Ia = {
3396
+ }, va = {
3400
3397
  head: !0,
3401
3398
  noscript: !0,
3402
3399
  object: !0,
@@ -3475,9 +3472,9 @@ class ro {
3475
3472
  let r = this.localPreserveWS, i = this.top;
3476
3473
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
3477
3474
  let s = e.nodeName.toLowerCase(), l;
3478
- Vr.hasOwnProperty(s) && this.parser.normalizeLists && Aa(e);
3475
+ Vr.hasOwnProperty(s) && this.parser.normalizeLists && Ia(e);
3479
3476
  let a = this.options.ruleFromNode && this.options.ruleFromNode(e) || (l = this.parser.matchTag(e, this, o));
3480
- e: if (a ? a.ignore : Ia.hasOwnProperty(s))
3477
+ e: if (a ? a.ignore : va.hasOwnProperty(s))
3481
3478
  this.findInside(e), this.ignoreFallback(e, t);
3482
3479
  else if (!a || a.skip || a.closeParent) {
3483
3480
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
@@ -3709,13 +3706,13 @@ class ro {
3709
3706
  }
3710
3707
  }
3711
3708
  }
3712
- function Aa(n) {
3709
+ function Ia(n) {
3713
3710
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
3714
3711
  let o = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
3715
3712
  o && Vr.hasOwnProperty(o) && t ? (t.appendChild(e), e = t) : o == "li" ? t = e : o && (t = null);
3716
3713
  }
3717
3714
  }
3718
- function Ea(n, e) {
3715
+ function Aa(n, e) {
3719
3716
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
3720
3717
  }
3721
3718
  function io(n) {
@@ -3858,11 +3855,11 @@ function hn(n) {
3858
3855
  return n.document || window.document;
3859
3856
  }
3860
3857
  const ao = /* @__PURE__ */ new WeakMap();
3861
- function Ra(n) {
3858
+ function Ea(n) {
3862
3859
  let e = ao.get(n);
3863
- return e === void 0 && ao.set(n, e = Pa(n)), e;
3860
+ return e === void 0 && ao.set(n, e = Ra(n)), e;
3864
3861
  }
3865
- function Pa(n) {
3862
+ function Ra(n) {
3866
3863
  let e = null;
3867
3864
  function t(o) {
3868
3865
  if (o && typeof o == "object")
@@ -3888,7 +3885,7 @@ function Yt(n, e, t, o) {
3888
3885
  let r = e[0], i;
3889
3886
  if (typeof r != "string")
3890
3887
  throw new RangeError("Invalid array passed to renderSpec");
3891
- if (o && (i = Ra(o)) && i.indexOf(e) > -1)
3888
+ if (o && (i = Ea(o)) && i.indexOf(e) > -1)
3892
3889
  throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
3893
3890
  let s = r.indexOf(" ");
3894
3891
  s > 0 && (t = r.slice(0, s), r = r.slice(s + 1));
@@ -3919,13 +3916,13 @@ function Yt(n, e, t, o) {
3919
3916
  return { dom: a, contentDOM: l };
3920
3917
  }
3921
3918
  const Fr = 65535, $r = Math.pow(2, 16);
3922
- function za(n, e) {
3919
+ function Pa(n, e) {
3923
3920
  return n + e * $r;
3924
3921
  }
3925
3922
  function co(n) {
3926
3923
  return n & Fr;
3927
3924
  }
3928
- function Ba(n) {
3925
+ function za(n) {
3929
3926
  return (n - (n & Fr)) / $r;
3930
3927
  }
3931
3928
  const Hr = 1, qr = 2, Gt = 4, Wr = 8;
@@ -3983,7 +3980,7 @@ class he {
3983
3980
  if (!this.inverted)
3984
3981
  for (let r = 0; r < o; r++)
3985
3982
  t += this.ranges[r * 3 + 2] - this.ranges[r * 3 + 1];
3986
- return this.ranges[o * 3] + t + Ba(e);
3983
+ return this.ranges[o * 3] + t + za(e);
3987
3984
  }
3988
3985
  mapResult(e, t = 1) {
3989
3986
  return this._map(e, t, !1);
@@ -4005,7 +4002,7 @@ class he {
4005
4002
  let f = c ? e == a ? -1 : e == u ? 1 : t : t, m = a + r + (f < 0 ? 0 : d);
4006
4003
  if (o)
4007
4004
  return m;
4008
- let p = e == (t < 0 ? a : u) ? null : za(l / 3, e - a), b = e == a ? qr : e == u ? Hr : Gt;
4005
+ let p = e == (t < 0 ? a : u) ? null : Pa(l / 3, e - a), b = e == a ? qr : e == u ? Hr : Gt;
4009
4006
  return (t < 0 ? e != a : e != u) && (b |= Wr), new uo(m, b, p);
4010
4007
  }
4011
4008
  r += d - c;
@@ -4132,7 +4129,7 @@ class j {
4132
4129
  try {
4133
4130
  return j.ok(e.replace(t, o, r));
4134
4131
  } catch (i) {
4135
- if (i instanceof Ma)
4132
+ if (i instanceof Da)
4136
4133
  return j.fail(i.message);
4137
4134
  throw i;
4138
4135
  }
@@ -4427,7 +4424,7 @@ function wn(n, e, t) {
4427
4424
  }
4428
4425
  return !1;
4429
4426
  }
4430
- function La(n, e, t) {
4427
+ function Ba(n, e, t) {
4431
4428
  let o = n.resolve(e);
4432
4429
  if (!t.content.size)
4433
4430
  return e;
@@ -4537,7 +4534,7 @@ class q {
4537
4534
  `$head`.
4538
4535
  */
4539
4536
  constructor(e, t, o) {
4540
- this.$anchor = e, this.$head = t, this.ranges = o || [new Va(e.min(t), e.max(t))];
4537
+ this.$anchor = e, this.$head = t, this.ranges = o || [new La(e.min(t), e.max(t))];
4541
4538
  }
4542
4539
  /**
4543
4540
  The selection's anchor, as an unresolved position.
@@ -4640,7 +4637,7 @@ class q {
4640
4637
  negative, it will search backwards first.
4641
4638
  */
4642
4639
  static near(e, t = 1) {
4643
- return this.findFrom(e, t) || this.findFrom(e, -t) || new Te(e.node(0));
4640
+ return this.findFrom(e, t) || this.findFrom(e, -t) || new Ne(e.node(0));
4644
4641
  }
4645
4642
  /**
4646
4643
  Find the cursor or leaf node selection closest to the start of
@@ -4649,14 +4646,14 @@ class q {
4649
4646
  exists.
4650
4647
  */
4651
4648
  static atStart(e) {
4652
- return at(e, e, 0, 0, 1) || new Te(e);
4649
+ return at(e, e, 0, 0, 1) || new Ne(e);
4653
4650
  }
4654
4651
  /**
4655
4652
  Find the cursor or leaf node selection closest to the end of the
4656
4653
  given document.
4657
4654
  */
4658
4655
  static atEnd(e) {
4659
- return at(e, e, e.content.size, e.childCount, -1) || new Te(e);
4656
+ return at(e, e, e.content.size, e.childCount, -1) || new Ne(e);
4660
4657
  }
4661
4658
  /**
4662
4659
  Deserialize the JSON representation of a selection. Must be
@@ -4695,7 +4692,7 @@ class q {
4695
4692
  }
4696
4693
  }
4697
4694
  q.prototype.visible = !0;
4698
- class Va {
4695
+ class La {
4699
4696
  /**
4700
4697
  Create a range.
4701
4698
  */
@@ -4852,7 +4849,7 @@ class qn {
4852
4849
  return o && T.isSelectable(o) ? new T(t) : q.near(t);
4853
4850
  }
4854
4851
  }
4855
- class Te extends q {
4852
+ class Ne extends q {
4856
4853
  /**
4857
4854
  Create an all-selection over the given document.
4858
4855
  */
@@ -4874,25 +4871,25 @@ class Te extends q {
4874
4871
  @internal
4875
4872
  */
4876
4873
  static fromJSON(e) {
4877
- return new Te(e);
4874
+ return new Ne(e);
4878
4875
  }
4879
4876
  map(e) {
4880
- return new Te(e);
4877
+ return new Ne(e);
4881
4878
  }
4882
4879
  eq(e) {
4883
- return e instanceof Te;
4880
+ return e instanceof Ne;
4884
4881
  }
4885
4882
  getBookmark() {
4886
- return Fa;
4883
+ return Va;
4887
4884
  }
4888
4885
  }
4889
- q.jsonID("all", Te);
4890
- const Fa = {
4886
+ q.jsonID("all", Ne);
4887
+ const Va = {
4891
4888
  map() {
4892
4889
  return this;
4893
4890
  },
4894
4891
  resolve(n) {
4895
- return new Te(n);
4892
+ return new Ne(n);
4896
4893
  }
4897
4894
  };
4898
4895
  function at(n, e, t, o, r, i = !1) {
@@ -4968,7 +4965,7 @@ function Jr(n, e, t) {
4968
4965
  }
4969
4966
  return t;
4970
4967
  }
4971
- class $a {
4968
+ class Fa {
4972
4969
  /**
4973
4970
  Create a plugin.
4974
4971
  */
@@ -4986,7 +4983,7 @@ const mn = /* @__PURE__ */ Object.create(null);
4986
4983
  function Kr(n) {
4987
4984
  return n in mn ? n + "$" + ++mn[n] : (mn[n] = 0, n + "$");
4988
4985
  }
4989
- class Ha {
4986
+ class $a {
4990
4987
  /**
4991
4988
  Create a plugin key.
4992
4989
  */
@@ -5019,18 +5016,18 @@ let Dn = null;
5019
5016
  const Ae = function(n, e, t) {
5020
5017
  let o = Dn || (Dn = document.createRange());
5021
5018
  return o.setEnd(n, t ?? n.nodeValue.length), o.setStart(n, e || 0), o;
5022
- }, qa = function() {
5019
+ }, Ha = function() {
5023
5020
  Dn = null;
5024
5021
  }, tt = function(n, e, t, o) {
5025
5022
  return t && (go(n, e, t, o, -1) || go(n, e, t, o, 1));
5026
- }, Wa = /^(img|br|input|textarea|hr)$/i;
5023
+ }, qa = /^(img|br|input|textarea|hr)$/i;
5027
5024
  function go(n, e, t, o, r) {
5028
5025
  for (; ; ) {
5029
5026
  if (n == t && e == o)
5030
5027
  return !0;
5031
5028
  if (e == (r < 0 ? 0 : pe(n))) {
5032
5029
  let i = n.parentNode;
5033
- if (!i || i.nodeType != 1 || Bt(n) || Wa.test(n.nodeName) || n.contentEditable == "false")
5030
+ if (!i || i.nodeType != 1 || Bt(n) || qa.test(n.nodeName) || n.contentEditable == "false")
5034
5031
  return !1;
5035
5032
  e = Z(n) + (r < 0 ? 0 : 1), n = i;
5036
5033
  } else if (n.nodeType == 1) {
@@ -5044,7 +5041,7 @@ function go(n, e, t, o, r) {
5044
5041
  function pe(n) {
5045
5042
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
5046
5043
  }
5047
- function Ja(n, e) {
5044
+ function Wa(n, e) {
5048
5045
  for (; ; ) {
5049
5046
  if (n.nodeType == 3 && e)
5050
5047
  return n;
@@ -5058,7 +5055,7 @@ function Ja(n, e) {
5058
5055
  return null;
5059
5056
  }
5060
5057
  }
5061
- function Ka(n, e) {
5058
+ function Ja(n, e) {
5062
5059
  for (; ; ) {
5063
5060
  if (n.nodeType == 3 && e < n.nodeValue.length)
5064
5061
  return n;
@@ -5072,7 +5069,7 @@ function Ka(n, e) {
5072
5069
  return null;
5073
5070
  }
5074
5071
  }
5075
- function Ua(n, e, t) {
5072
+ function Ka(n, e, t) {
5076
5073
  for (let o = e == 0, r = e == pe(n); o || r; ) {
5077
5074
  if (n == t)
5078
5075
  return !0;
@@ -5095,13 +5092,13 @@ function Ue(n, e) {
5095
5092
  let t = document.createEvent("Event");
5096
5093
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
5097
5094
  }
5098
- function ja(n) {
5095
+ function Ua(n) {
5099
5096
  let e = n.activeElement;
5100
5097
  for (; e && e.shadowRoot; )
5101
5098
  e = e.shadowRoot.activeElement;
5102
5099
  return e;
5103
5100
  }
5104
- function Ya(n, e, t) {
5101
+ function ja(n, e, t) {
5105
5102
  if (n.caretPositionFromPoint)
5106
5103
  try {
5107
5104
  let o = n.caretPositionFromPoint(e, t);
@@ -5115,10 +5112,10 @@ function Ya(n, e, t) {
5115
5112
  return { node: o.startContainer, offset: Math.min(pe(o.startContainer), o.startOffset) };
5116
5113
  }
5117
5114
  }
5118
- const De = typeof navigator < "u" ? navigator : null, bo = typeof document < "u" ? document : null, Je = De && De.userAgent || "", Mn = /Edge\/(\d+)/.exec(Je), Ur = /MSIE \d/.exec(Je), On = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je), ae = !!(Ur || On || Mn), He = Ur ? document.documentMode : On ? +On[1] : Mn ? +Mn[1] : 0, ke = !ae && /gecko\/(\d+)/i.test(Je);
5115
+ const we = typeof navigator < "u" ? navigator : null, bo = typeof document < "u" ? document : null, Je = we && we.userAgent || "", Mn = /Edge\/(\d+)/.exec(Je), Ur = /MSIE \d/.exec(Je), On = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Je), ae = !!(Ur || On || Mn), He = Ur ? document.documentMode : On ? +On[1] : Mn ? +Mn[1] : 0, ke = !ae && /gecko\/(\d+)/i.test(Je);
5119
5116
  ke && +(/Firefox\/(\d+)/.exec(Je) || [0, 0])[1];
5120
- const vn = !ae && /Chrome\/(\d+)/.exec(Je), te = !!vn, jr = vn ? +vn[1] : 0, re = !ae && !!De && /Apple Computer/.test(De.vendor), gt = re && (/Mobile\/\w+/.test(Je) || !!De && De.maxTouchPoints > 2), fe = gt || (De ? /Mac/.test(De.platform) : !1), Ga = De ? /Win/.test(De.platform) : !1, Re = /Android \d/.test(Je), Lt = !!bo && "webkitFontSmoothing" in bo.documentElement.style, Xa = Lt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5121
- function _a(n) {
5117
+ const vn = !ae && /Chrome\/(\d+)/.exec(Je), te = !!vn, jr = vn ? +vn[1] : 0, re = !ae && !!we && /Apple Computer/.test(we.vendor), gt = re && (/Mobile\/\w+/.test(Je) || !!we && we.maxTouchPoints > 2), fe = gt || (we ? /Mac/.test(we.platform) : !1), Ya = we ? /Win/.test(we.platform) : !1, Re = /Android \d/.test(Je), Lt = !!bo && "webkitFontSmoothing" in bo.documentElement.style, Ga = Lt ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
5118
+ function Xa(n) {
5122
5119
  let e = n.defaultView && n.defaultView.visualViewport;
5123
5120
  return e ? {
5124
5121
  left: 0,
@@ -5135,7 +5132,7 @@ function _a(n) {
5135
5132
  function Ie(n, e) {
5136
5133
  return typeof n == "number" ? n : n[e];
5137
5134
  }
5138
- function Za(n) {
5135
+ function _a(n) {
5139
5136
  let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, o = e.height / n.offsetHeight || 1;
5140
5137
  return {
5141
5138
  left: e.left,
@@ -5149,7 +5146,7 @@ function yo(n, e, t) {
5149
5146
  for (let s = t || n.dom; s; s = It(s)) {
5150
5147
  if (s.nodeType != 1)
5151
5148
  continue;
5152
- let l = s, a = l == i.body, c = a ? _a(i) : Za(l), d = 0, u = 0;
5149
+ let l = s, a = l == i.body, c = a ? Xa(i) : _a(l), d = 0, u = 0;
5153
5150
  if (e.top < c.top + Ie(o, "top") ? u = -(c.top - e.top + Ie(r, "top")) : e.bottom > c.bottom - Ie(o, "bottom") && (u = e.bottom - e.top > c.bottom - c.top ? e.top + Ie(r, "top") - c.top : e.bottom - c.bottom + Ie(r, "bottom")), e.left < c.left + Ie(o, "left") ? d = -(c.left - e.left + Ie(r, "left")) : e.right > c.right - Ie(o, "right") && (d = e.right - c.right + Ie(r, "right")), d || u)
5154
5151
  if (a)
5155
5152
  i.defaultView.scrollBy(d, u);
@@ -5163,7 +5160,7 @@ function yo(n, e, t) {
5163
5160
  break;
5164
5161
  }
5165
5162
  }
5166
- function Qa(n) {
5163
+ function Za(n) {
5167
5164
  let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), o, r;
5168
5165
  for (let i = (e.left + e.right) / 2, s = t + 1; s < Math.min(innerHeight, e.bottom); s += 5) {
5169
5166
  let l = n.root.elementFromPoint(i, s);
@@ -5183,7 +5180,7 @@ function Yr(n) {
5183
5180
  ;
5184
5181
  return e;
5185
5182
  }
5186
- function ec({ refDOM: n, refTop: e, stack: t }) {
5183
+ function Qa({ refDOM: n, refTop: e, stack: t }) {
5187
5184
  let o = n ? n.getBoundingClientRect().top : 0;
5188
5185
  Gr(t, o == 0 ? 0 : o - e);
5189
5186
  }
@@ -5194,7 +5191,7 @@ function Gr(n, e) {
5194
5191
  }
5195
5192
  }
5196
5193
  let st = null;
5197
- function tc(n) {
5194
+ function ec(n) {
5198
5195
  if (n.setActive)
5199
5196
  return n.setActive();
5200
5197
  if (st)
@@ -5232,9 +5229,9 @@ function Xr(n, e) {
5232
5229
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (i = u + 1);
5233
5230
  }
5234
5231
  }
5235
- return !t && a && (t = a, r = c, o = 0), t && t.nodeType == 3 ? nc(t, r) : !t || o && t.nodeType == 1 ? { node: n, offset: i } : Xr(t, r);
5232
+ return !t && a && (t = a, r = c, o = 0), t && t.nodeType == 3 ? tc(t, r) : !t || o && t.nodeType == 1 ? { node: n, offset: i } : Xr(t, r);
5236
5233
  }
5237
- function nc(n, e) {
5234
+ function tc(n, e) {
5238
5235
  let t = n.nodeValue.length, o = document.createRange();
5239
5236
  for (let r = 0; r < t; r++) {
5240
5237
  o.setEnd(n, r + 1), o.setStart(n, r);
@@ -5247,11 +5244,11 @@ function nc(n, e) {
5247
5244
  function Wn(n, e) {
5248
5245
  return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
5249
5246
  }
5250
- function oc(n, e) {
5247
+ function nc(n, e) {
5251
5248
  let t = n.parentNode;
5252
5249
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
5253
5250
  }
5254
- function rc(n, e, t) {
5251
+ function oc(n, e, t) {
5255
5252
  let { node: o, offset: r } = Xr(e, t), i = -1;
5256
5253
  if (o.nodeType == 1 && !o.firstChild) {
5257
5254
  let s = o.getBoundingClientRect();
@@ -5259,7 +5256,7 @@ function rc(n, e, t) {
5259
5256
  }
5260
5257
  return n.docView.posFromDOM(o, r, i);
5261
5258
  }
5262
- function ic(n, e, t, o) {
5259
+ function rc(n, e, t, o) {
5263
5260
  let r = -1;
5264
5261
  for (let i = e, s = !1; i != n.dom; ) {
5265
5262
  let l = n.docView.nearestDesc(i, !0), a;
@@ -5290,8 +5287,8 @@ function _r(n, e, t) {
5290
5287
  }
5291
5288
  return n;
5292
5289
  }
5293
- function sc(n, e) {
5294
- let t = n.dom.ownerDocument, o, r = 0, i = Ya(t, e.left, e.top);
5290
+ function ic(n, e) {
5291
+ let t = n.dom.ownerDocument, o, r = 0, i = ja(t, e.left, e.top);
5295
5292
  i && ({ node: o, offset: r } = i);
5296
5293
  let s = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
5297
5294
  if (!s || !n.dom.contains(s.nodeType != 1 ? s.parentNode : s)) {
@@ -5302,15 +5299,15 @@ function sc(n, e) {
5302
5299
  if (re)
5303
5300
  for (let c = s; o && c; c = It(c))
5304
5301
  c.draggable && (o = void 0);
5305
- if (s = oc(s, e), o) {
5302
+ if (s = nc(s, e), o) {
5306
5303
  if (ke && o.nodeType == 1 && (r = Math.min(r, o.childNodes.length), r < o.childNodes.length)) {
5307
5304
  let d = o.childNodes[r], u;
5308
5305
  d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && r++;
5309
5306
  }
5310
5307
  let c;
5311
- Lt && r && o.nodeType == 1 && (c = o.childNodes[r - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && r--, o == n.dom && r == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (r == 0 || o.nodeType != 1 || o.childNodes[r - 1].nodeName != "BR") && (l = ic(n, o, r, e));
5308
+ Lt && r && o.nodeType == 1 && (c = o.childNodes[r - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && r--, o == n.dom && r == o.childNodes.length - 1 && o.lastChild.nodeType == 1 && e.top > o.lastChild.getBoundingClientRect().bottom ? l = n.state.doc.content.size : (r == 0 || o.nodeType != 1 || o.childNodes[r - 1].nodeName != "BR") && (l = rc(n, o, r, e));
5312
5309
  }
5313
- l == null && (l = rc(n, s, e));
5310
+ l == null && (l = oc(n, s, e));
5314
5311
  let a = n.docView.nearestDesc(s, !0);
5315
5312
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
5316
5313
  }
@@ -5326,11 +5323,11 @@ function Be(n, e) {
5326
5323
  }
5327
5324
  return Array.prototype.find.call(t, ko) || n.getBoundingClientRect();
5328
5325
  }
5329
- const lc = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5326
+ const sc = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5330
5327
  function Zr(n, e, t) {
5331
5328
  let { node: o, offset: r, atom: i } = n.docView.domFromPos(e, t < 0 ? -1 : 1), s = Lt || ke;
5332
5329
  if (o.nodeType == 3)
5333
- if (s && (lc.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
5330
+ if (s && (sc.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
5334
5331
  let a = Be(Ae(o, r, r), t);
5335
5332
  if (ke && r && /\s/.test(o.nodeValue[r - 1]) && r < o.nodeValue.length) {
5336
5333
  let c = Be(Ae(o, r - 1, r - 1), -1);
@@ -5394,7 +5391,7 @@ function Qr(n, e, t) {
5394
5391
  o != e && n.updateState(o), r != n.dom && r && r.focus();
5395
5392
  }
5396
5393
  }
5397
- function ac(n, e, t) {
5394
+ function lc(n, e, t) {
5398
5395
  let o = e.selection, r = t == "up" ? o.$from : o.$to;
5399
5396
  return Qr(n, e, () => {
5400
5397
  let { node: i } = n.docView.domFromPos(r.pos, t == "up" ? -1 : 1);
@@ -5426,13 +5423,13 @@ function ac(n, e, t) {
5426
5423
  return !0;
5427
5424
  });
5428
5425
  }
5429
- const cc = /[\u0590-\u08ac]/;
5430
- function dc(n, e, t) {
5426
+ const ac = /[\u0590-\u08ac]/;
5427
+ function cc(n, e, t) {
5431
5428
  let { $head: o } = e.selection;
5432
5429
  if (!o.parent.isTextblock)
5433
5430
  return !1;
5434
5431
  let r = o.parentOffset, i = !r, s = r == o.parent.content.size, l = n.domSelection();
5435
- return l ? !cc.test(o.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : Qr(n, e, () => {
5432
+ return l ? !ac.test(o.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : Qr(n, e, () => {
5436
5433
  let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
5437
5434
  l.modify("move", t, "character");
5438
5435
  let m = o.depth ? n.docView.domAfterPos(o.before()) : n.dom, { focusNode: p, focusOffset: b } = n.domSelectionRange(), g = p && !m.contains(p.nodeType == 1 ? p : p.parentNode) || a == p && c == b;
@@ -5444,10 +5441,10 @@ function dc(n, e, t) {
5444
5441
  }) : o.pos == o.start() || o.pos == o.end();
5445
5442
  }
5446
5443
  let xo = null, Co = null, So = !1;
5447
- function uc(n, e, t) {
5448
- return xo == e && Co == t ? So : (xo = e, Co = t, So = t == "up" || t == "down" ? ac(n, e, t) : dc(n, e, t));
5444
+ function dc(n, e, t) {
5445
+ return xo == e && Co == t ? So : (xo = e, Co = t, So = t == "up" || t == "down" ? lc(n, e, t) : cc(n, e, t));
5449
5446
  }
5450
- const ge = 0, No = 1, Xe = 2, Me = 3;
5447
+ const ge = 0, No = 1, Xe = 2, De = 3;
5451
5448
  class Vt {
5452
5449
  constructor(e, t, o, r) {
5453
5450
  this.parent = e, this.children = t, this.dom = o, this.contentDOM = r, this.dirty = ge, o.pmViewDesc = this;
@@ -5763,10 +5760,10 @@ class Vt {
5763
5760
  if (o == s ? e <= s && t >= o : e < s && t > o) {
5764
5761
  let l = o + i.border, a = s - i.border;
5765
5762
  if (e >= l && t <= a) {
5766
- this.dirty = e == o || t == s ? Xe : No, e == l && t == a && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = Me : i.markDirty(e - l, t - l);
5763
+ this.dirty = e == o || t == s ? Xe : No, e == l && t == a && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = De : i.markDirty(e - l, t - l);
5767
5764
  return;
5768
5765
  } else
5769
- i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe : Me;
5766
+ i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe : De;
5770
5767
  }
5771
5768
  o = s;
5772
5769
  }
@@ -5829,7 +5826,7 @@ class ei extends Vt {
5829
5826
  return this.widget.type.side;
5830
5827
  }
5831
5828
  }
5832
- class hc extends Vt {
5829
+ class uc extends Vt {
5833
5830
  constructor(e, t, o, r) {
5834
5831
  super(e, [], t, null), this.textDOM = o, this.text = r;
5835
5832
  }
@@ -5855,10 +5852,10 @@ class nt extends Vt {
5855
5852
  return (!s || !s.dom) && (s = yt.renderSpec(document, t.type.spec.toDOM(t, o), null, t.attrs)), new nt(e, t, s.dom, s.contentDOM || s.dom, s);
5856
5853
  }
5857
5854
  parseRule() {
5858
- return this.dirty & Me || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
5855
+ return this.dirty & De || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
5859
5856
  }
5860
5857
  matchesMark(e) {
5861
- return this.dirty != Me && this.mark.eq(e);
5858
+ return this.dirty != De && this.mark.eq(e);
5862
5859
  }
5863
5860
  markDirty(e, t) {
5864
5861
  if (super.markDirty(e, t), this.dirty != ge) {
@@ -5910,7 +5907,7 @@ class qe extends Vt {
5910
5907
  } else d || ({ dom: d, contentDOM: u } = yt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
5911
5908
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
5912
5909
  let f = d;
5913
- return d = ri(d, o, t), c ? a = new fc(e, t, o, r, d, u || null, f, c, i, s + 1) : t.isText ? new rn(e, t, o, r, d, f, i) : new qe(e, t, o, r, d, u || null, f, i, s + 1);
5910
+ return d = ri(d, o, t), c ? a = new hc(e, t, o, r, d, u || null, f, c, i, s + 1) : t.isText ? new rn(e, t, o, r, d, f, i) : new qe(e, t, o, r, d, u || null, f, i, s + 1);
5914
5911
  }
5915
5912
  parseRule() {
5916
5913
  if (this.node.type.spec.reparseInView)
@@ -5946,14 +5943,14 @@ class qe extends Vt {
5946
5943
  // separate step, syncs the DOM inside `this.contentDOM` to
5947
5944
  // `this.children`.
5948
5945
  updateChildren(e, t) {
5949
- let o = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new mc(this, s && s.node, e);
5950
- yc(this.node, this.innerDeco, (c, d, u) => {
5946
+ let o = this.node.inlineContent, r = t, i = e.composing ? this.localCompositionInfo(e, t) : null, s = i && i.pos > -1 ? i : null, l = i && i.pos < 0, a = new pc(this, s && s.node, e);
5947
+ bc(this.node, this.innerDeco, (c, d, u) => {
5951
5948
  c.spec.marks ? a.syncToMarks(c.spec.marks, o, e) : c.type.side >= 0 && !u && a.syncToMarks(d == this.node.childCount ? ue.none : this.node.child(d).marks, o, e), a.placeWidget(c, e, r);
5952
5949
  }, (c, d, u, f) => {
5953
5950
  a.syncToMarks(c.marks, o, e);
5954
5951
  let m;
5955
5952
  a.findNodeMatch(c, d, u, f) || l && e.state.selection.from > r && e.state.selection.to < r + c.nodeSize && (m = a.findIndexWithChild(i.node)) > -1 && a.updateNodeAt(c, d, u, m, e) || a.updateNextNode(c, d, u, e, f, r) || a.addNode(c, d, u, e, r), r += c.nodeSize;
5956
- }), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (s && this.protectLocalComposition(e, s), ni(this.contentDOM, this.children, e), gt && kc(this.dom));
5953
+ }), a.syncToMarks([], o, e), this.node.isTextblock && a.addTextblockHacks(), a.destroyRest(), (a.changed || this.dirty == Xe) && (s && this.protectLocalComposition(e, s), ni(this.contentDOM, this.children, e), gt && yc(this.dom));
5957
5954
  }
5958
5955
  localCompositionInfo(e, t) {
5959
5956
  let { from: o, to: r } = e.state.selection;
@@ -5963,7 +5960,7 @@ class qe extends Vt {
5963
5960
  if (!i || !this.dom.contains(i.parentNode))
5964
5961
  return null;
5965
5962
  if (this.node.inlineContent) {
5966
- let s = i.nodeValue, l = xc(this.node.content, s, o - t, r - t);
5963
+ let s = i.nodeValue, l = kc(this.node.content, s, o - t, r - t);
5967
5964
  return l < 0 ? null : { node: i, pos: l, text: s };
5968
5965
  } else
5969
5966
  return { node: i, pos: -1, text: "" };
@@ -5979,13 +5976,13 @@ class qe extends Vt {
5979
5976
  i.parentNode.removeChild(i.nextSibling);
5980
5977
  i.pmViewDesc && (i.pmViewDesc = void 0);
5981
5978
  }
5982
- let s = new hc(this, i, t, r);
5979
+ let s = new uc(this, i, t, r);
5983
5980
  e.input.compositionNodes.push(s), this.children = An(this.children, o, o + r.length, e, s);
5984
5981
  }
5985
5982
  // If this desc must be updated to match the given node decoration,
5986
5983
  // do so and return true.
5987
5984
  update(e, t, o, r) {
5988
- return this.dirty == Me || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, o, r), !0);
5985
+ return this.dirty == De || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, o, r), !0);
5989
5986
  }
5990
5987
  updateInner(e, t, o, r) {
5991
5988
  this.updateOuterDeco(t), this.node = e, this.innerDeco = o, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = ge;
@@ -6024,7 +6021,7 @@ class rn extends qe {
6024
6021
  return { skip: e || !0 };
6025
6022
  }
6026
6023
  update(e, t, o, r) {
6027
- return this.dirty == Me || this.dirty != ge && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != ge || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = ge, !0);
6024
+ return this.dirty == De || this.dirty != ge && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(t), (this.dirty != ge || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, r.trackWrites == this.nodeDOM && (r.trackWrites = null)), this.node = e, this.dirty = ge, !0);
6028
6025
  }
6029
6026
  inParent() {
6030
6027
  let e = this.parent.contentDOM;
@@ -6047,7 +6044,7 @@ class rn extends qe {
6047
6044
  return new rn(this.parent, r, this.outerDeco, this.innerDeco, i, i, o);
6048
6045
  }
6049
6046
  markDirty(e, t) {
6050
- super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Me);
6047
+ super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = De);
6051
6048
  }
6052
6049
  get domAtom() {
6053
6050
  return !1;
@@ -6070,7 +6067,7 @@ class ti extends Vt {
6070
6067
  return this.dom.nodeName == "IMG";
6071
6068
  }
6072
6069
  }
6073
- class fc extends qe {
6070
+ class hc extends qe {
6074
6071
  constructor(e, t, o, r, i, s, l, a, c, d) {
6075
6072
  super(e, t, o, r, i, s, l, c, d), this.spec = a;
6076
6073
  }
@@ -6078,7 +6075,7 @@ class fc extends qe {
6078
6075
  // through. If it does, and there's a `contentDOM` node, our logic
6079
6076
  // updates the children.
6080
6077
  update(e, t, o, r) {
6081
- if (this.dirty == Me)
6078
+ if (this.dirty == De)
6082
6079
  return !1;
6083
6080
  if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
6084
6081
  let i = this.spec.update(e, t, o);
@@ -6154,11 +6151,11 @@ function oi(n, e, t, o) {
6154
6151
  let a;
6155
6152
  l && l.nodeName == s.nodeName && r != n && (a = r.parentNode) && a.nodeName.toLowerCase() == s.nodeName || (a = document.createElement(s.nodeName), a.pmIsDeco = !0, a.appendChild(r), l = _e[0]), r = a;
6156
6153
  }
6157
- pc(r, l || _e[0], s);
6154
+ fc(r, l || _e[0], s);
6158
6155
  }
6159
6156
  return r;
6160
6157
  }
6161
- function pc(n, e, t) {
6158
+ function fc(n, e, t) {
6162
6159
  for (let o in e)
6163
6160
  o != "class" && o != "style" && o != "nodeName" && !(o in t) && n.removeAttribute(o);
6164
6161
  for (let o in t)
@@ -6195,9 +6192,9 @@ function wo(n) {
6195
6192
  let e = n.nextSibling;
6196
6193
  return n.parentNode.removeChild(n), e;
6197
6194
  }
6198
- class mc {
6195
+ class pc {
6199
6196
  constructor(e, t, o) {
6200
- this.lock = t, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = gc(e.node.content, e);
6197
+ this.lock = t, this.view = o, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = mc(e.node.content, e);
6201
6198
  }
6202
6199
  // Destroy and remove the children between the given indices in
6203
6200
  // `this.top`.
@@ -6257,7 +6254,7 @@ class mc {
6257
6254
  }
6258
6255
  updateNodeAt(e, t, o, r, i) {
6259
6256
  let s = this.top.children[r];
6260
- return s.dirty == Me && s.dom == s.contentDOM && (s.dirty = Xe), s.update(e, t, o, i) ? (this.destroyBetween(this.index, r), this.index++, !0) : !1;
6257
+ return s.dirty == De && s.dom == s.contentDOM && (s.dirty = Xe), s.update(e, t, o, i) ? (this.destroyBetween(this.index, r), this.index++, !0) : !1;
6261
6258
  }
6262
6259
  findIndexWithChild(e) {
6263
6260
  for (; ; ) {
@@ -6285,7 +6282,7 @@ class mc {
6285
6282
  let c = this.preMatch.matched.get(a);
6286
6283
  if (c != null && c != i)
6287
6284
  return !1;
6288
- let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != Me && Zt(t, a.outerDeco));
6285
+ let d = a.dom, u, f = this.isLocked(d) && !(e.isText && a.node && a.node.isText && a.nodeDOM.nodeValue == e.text && a.dirty != De && Zt(t, a.outerDeco));
6289
6286
  if (!f && a.update(e, t, o, r))
6290
6287
  return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
6291
6288
  if (!f && (u = this.recreateWrapper(a, e, t, o, r, s)))
@@ -6345,7 +6342,7 @@ class mc {
6345
6342
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
6346
6343
  }
6347
6344
  }
6348
- function gc(n, e) {
6345
+ function mc(n, e) {
6349
6346
  let t = e, o = t.children.length, r = n.childCount, i = /* @__PURE__ */ new Map(), s = [];
6350
6347
  e: for (; r > 0; ) {
6351
6348
  let l;
@@ -6372,10 +6369,10 @@ function gc(n, e) {
6372
6369
  }
6373
6370
  return { index: r, matched: i, matches: s.reverse() };
6374
6371
  }
6375
- function bc(n, e) {
6372
+ function gc(n, e) {
6376
6373
  return n.type.side - e.type.side;
6377
6374
  }
6378
- function yc(n, e, t, o) {
6375
+ function bc(n, e, t, o) {
6379
6376
  let r = e.locals(n), i = 0;
6380
6377
  if (r.length == 0) {
6381
6378
  for (let c = 0; c < n.childCount; c++) {
@@ -6393,7 +6390,7 @@ function yc(n, e, t, o) {
6393
6390
  }
6394
6391
  if (d)
6395
6392
  if (u) {
6396
- u.sort(bc);
6393
+ u.sort(gc);
6397
6394
  for (let g = 0; g < u.length; g++)
6398
6395
  t(u[g], c, !!a);
6399
6396
  } else
@@ -6423,13 +6420,13 @@ function yc(n, e, t, o) {
6423
6420
  o(f, b, e.forChild(i, f), m), i = p;
6424
6421
  }
6425
6422
  }
6426
- function kc(n) {
6423
+ function yc(n) {
6427
6424
  if (n.nodeName == "UL" || n.nodeName == "OL") {
6428
6425
  let e = n.style.cssText;
6429
6426
  n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
6430
6427
  }
6431
6428
  }
6432
- function xc(n, e, t, o) {
6429
+ function kc(n, e, t, o) {
6433
6430
  for (let r = 0, i = 0; r < n.childCount && i <= o; ) {
6434
6431
  let s = n.child(r++), l = i;
6435
6432
  if (i += s.nodeSize, !s.isText)
@@ -6473,7 +6470,7 @@ function Jn(n, e = null) {
6473
6470
  for (a = s; r && !r.node; )
6474
6471
  r = r.parent;
6475
6472
  let u = r.node;
6476
- if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline && Ua(t.focusNode, t.focusOffset, r.dom))) {
6473
+ if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline && Ka(t.focusNode, t.focusOffset, r.dom))) {
6477
6474
  let f = r.posBefore;
6478
6475
  c = new T(s == f ? l : o.resolve(f));
6479
6476
  }
@@ -6513,10 +6510,10 @@ function Pe(n, e = !1) {
6513
6510
  }
6514
6511
  }
6515
6512
  if (n.domObserver.disconnectSelection(), n.cursorWrapper)
6516
- Sc(n);
6513
+ Cc(n);
6517
6514
  else {
6518
6515
  let { anchor: o, head: r } = t, i, s;
6519
- Do && !(t instanceof $) && (t.$from.parent.inlineContent || (i = Mo(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Mo(n, t.to))), n.docView.setSelection(o, r, n, e), Do && (i && Oo(i), s && Oo(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Cc(n));
6516
+ Do && !(t instanceof $) && (t.$from.parent.inlineContent || (i = Mo(n, t.from)), !t.empty && !t.$from.parent.inlineContent && (s = Mo(n, t.to))), n.docView.setSelection(o, r, n, e), Do && (i && Oo(i), s && Oo(s)), t.visible ? n.dom.classList.remove("ProseMirror-hideselection") : (n.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && xc(n));
6520
6517
  }
6521
6518
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
6522
6519
  }
@@ -6539,7 +6536,7 @@ function bn(n) {
6539
6536
  function Oo(n) {
6540
6537
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
6541
6538
  }
6542
- function Cc(n) {
6539
+ function xc(n) {
6543
6540
  let e = n.dom.ownerDocument;
6544
6541
  e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
6545
6542
  let t = n.domSelectionRange(), o = t.anchorNode, r = t.anchorOffset;
@@ -6549,7 +6546,7 @@ function Cc(n) {
6549
6546
  }, 20));
6550
6547
  });
6551
6548
  }
6552
- function Sc(n) {
6549
+ function Cc(n) {
6553
6550
  let e = n.domSelection(), t = document.createRange();
6554
6551
  if (!e)
6555
6552
  return;
@@ -6582,7 +6579,7 @@ function li(n) {
6582
6579
  return !1;
6583
6580
  }
6584
6581
  }
6585
- function Nc(n) {
6582
+ function Sc(n) {
6586
6583
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
6587
6584
  return tt(e.node, e.offset, t.anchorNode, t.anchorOffset);
6588
6585
  }
@@ -6631,9 +6628,9 @@ function Nt(n, e) {
6631
6628
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
6632
6629
  }
6633
6630
  function lt(n, e) {
6634
- return e < 0 ? Tc(n) : wc(n);
6631
+ return e < 0 ? Nc(n) : Tc(n);
6635
6632
  }
6636
- function Tc(n) {
6633
+ function Nc(n) {
6637
6634
  let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
6638
6635
  if (!t)
6639
6636
  return;
@@ -6669,7 +6666,7 @@ function Tc(n) {
6669
6666
  }
6670
6667
  s ? Rn(n, t, o) : r && Rn(n, r, i);
6671
6668
  }
6672
- function wc(n) {
6669
+ function Tc(n) {
6673
6670
  let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
6674
6671
  if (!t)
6675
6672
  return;
@@ -6705,7 +6702,7 @@ function ai(n) {
6705
6702
  let e = n.pmViewDesc;
6706
6703
  return e && e.node && e.node.isBlock;
6707
6704
  }
6708
- function Dc(n, e) {
6705
+ function wc(n, e) {
6709
6706
  for (; n && e == n.childNodes.length && !Bt(n); )
6710
6707
  e = Z(n) + 1, n = n.parentNode;
6711
6708
  for (; n && e < n.childNodes.length; ) {
@@ -6717,7 +6714,7 @@ function Dc(n, e) {
6717
6714
  n = t, e = 0;
6718
6715
  }
6719
6716
  }
6720
- function Mc(n, e) {
6717
+ function Dc(n, e) {
6721
6718
  for (; n && !e && !Bt(n); )
6722
6719
  e = Z(n), n = n.parentNode;
6723
6720
  for (; n && e; ) {
@@ -6732,7 +6729,7 @@ function Mc(n, e) {
6732
6729
  function Rn(n, e, t) {
6733
6730
  if (e.nodeType != 3) {
6734
6731
  let i, s;
6735
- (s = Dc(e, t)) ? (e = s, t = 0) : (i = Mc(e, t)) && (e = i, t = i.nodeValue.length);
6732
+ (s = wc(e, t)) ? (e = s, t = 0) : (i = Dc(e, t)) && (e = i, t = i.nodeValue.length);
6736
6733
  }
6737
6734
  let o = n.domSelection();
6738
6735
  if (!o)
@@ -6749,7 +6746,7 @@ function Rn(n, e, t) {
6749
6746
  }
6750
6747
  function Eo(n, e) {
6751
6748
  let t = n.state.doc.resolve(e);
6752
- if (!(te || Ga) && t.parent.inlineContent) {
6749
+ if (!(te || Ya) && t.parent.inlineContent) {
6753
6750
  let r = n.coordsAtPos(e);
6754
6751
  if (e > t.start()) {
6755
6752
  let i = n.coordsAtPos(e - 1), s = (i.top + i.bottom) / 2;
@@ -6775,7 +6772,7 @@ function Ro(n, e, t) {
6775
6772
  return Le(n, s);
6776
6773
  }
6777
6774
  if (!r.parent.inlineContent) {
6778
- let s = e < 0 ? r : i, l = o instanceof Te ? q.near(s, e) : q.findFrom(s, e);
6775
+ let s = e < 0 ? r : i, l = o instanceof Ne ? q.near(s, e) : q.findFrom(s, e);
6779
6776
  return l ? Le(n, l) : !1;
6780
6777
  }
6781
6778
  return !1;
@@ -6800,7 +6797,7 @@ function Po(n, e) {
6800
6797
  function zo(n, e, t) {
6801
6798
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
6802
6799
  }
6803
- function Oc(n) {
6800
+ function Mc(n) {
6804
6801
  if (!re || n.state.selection.$head.parentOffset > 0)
6805
6802
  return !1;
6806
6803
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
@@ -6810,12 +6807,12 @@ function Oc(n) {
6810
6807
  }
6811
6808
  return !1;
6812
6809
  }
6813
- function vc(n) {
6810
+ function Oc(n) {
6814
6811
  let e = "";
6815
6812
  return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
6816
6813
  }
6817
- function Ic(n, e) {
6818
- let t = e.keyCode, o = vc(e);
6814
+ function vc(n, e) {
6815
+ let t = e.keyCode, o = Oc(e);
6819
6816
  if (t == 8 || fe && t == 72 && o == "c")
6820
6817
  return Po(n, -1) || lt(n, -1);
6821
6818
  if (t == 46 && !e.shiftKey || fe && t == 68 && o == "c")
@@ -6832,7 +6829,7 @@ function Ic(n, e) {
6832
6829
  if (t == 38 || fe && t == 80 && o == "c")
6833
6830
  return Ro(n, -1, o) || lt(n, -1);
6834
6831
  if (t == 40 || fe && t == 78 && o == "c")
6835
- return Oc(n) || Ro(n, 1, o) || lt(n, 1);
6832
+ return Mc(n) || Ro(n, 1, o) || lt(n, 1);
6836
6833
  if (o == (fe ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
6837
6834
  return !0;
6838
6835
  }
@@ -6890,7 +6887,7 @@ function jn(n, e, t, o, r) {
6890
6887
  } else
6891
6888
  n.someProp("transformPastedHTML", (u) => {
6892
6889
  t = u(t, n);
6893
- }), s = Pc(t), Lt && zc(s);
6890
+ }), s = Rc(t), Lt && Pc(s);
6894
6891
  let c = s && s.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
6895
6892
  if (d && d[3])
6896
6893
  for (let u = +d[3]; u > 0; u--) {
@@ -6905,11 +6902,11 @@ function jn(n, e, t, o, r) {
6905
6902
  preserveWhitespace: !!(a || d),
6906
6903
  context: r,
6907
6904
  ruleFromNode(f) {
6908
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Ac.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
6905
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Ic.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
6909
6906
  }
6910
6907
  })), d)
6911
- l = Bc(Bo(l, +d[1], +d[2]), d[4]);
6912
- else if (l = E.maxOpen(Ec(l.content, r), !0), l.openStart || l.openEnd) {
6908
+ l = zc(Bo(l, +d[1], +d[2]), d[4]);
6909
+ else if (l = E.maxOpen(Ac(l.content, r), !0), l.openStart || l.openEnd) {
6913
6910
  let u = 0, f = 0;
6914
6911
  for (let m = l.content.firstChild; u < l.openStart && !m.type.spec.isolating; u++, m = m.firstChild)
6915
6912
  ;
@@ -6921,8 +6918,8 @@ function jn(n, e, t, o, r) {
6921
6918
  l = u(l, n);
6922
6919
  }), l;
6923
6920
  }
6924
- const Ac = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
6925
- function Ec(n, e) {
6921
+ const Ic = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
6922
+ function Ac(n, e) {
6926
6923
  if (n.childCount < 2)
6927
6924
  return n;
6928
6925
  for (let t = e.depth; t >= 0; t--) {
@@ -6988,27 +6985,27 @@ function fi() {
6988
6985
  return Lo || (Lo = document.implementation.createHTMLDocument("title"));
6989
6986
  }
6990
6987
  let yn = null;
6991
- function Rc(n) {
6988
+ function Ec(n) {
6992
6989
  let e = window.trustedTypes;
6993
6990
  return e ? (yn || (yn = e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), yn.createHTML(n)) : n;
6994
6991
  }
6995
- function Pc(n) {
6992
+ function Rc(n) {
6996
6993
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
6997
6994
  e && (n = n.slice(e[0].length));
6998
6995
  let t = fi().createElement("div"), o = /<([a-z][^>\s]+)/i.exec(n), r;
6999
- if ((r = o && hi[o[1].toLowerCase()]) && (n = r.map((i) => "<" + i + ">").join("") + n + r.map((i) => "</" + i + ">").reverse().join("")), t.innerHTML = Rc(n), r)
6996
+ if ((r = o && hi[o[1].toLowerCase()]) && (n = r.map((i) => "<" + i + ">").join("") + n + r.map((i) => "</" + i + ">").reverse().join("")), t.innerHTML = Ec(n), r)
7000
6997
  for (let i = 0; i < r.length; i++)
7001
6998
  t = t.querySelector(r[i]) || t;
7002
6999
  return t;
7003
7000
  }
7004
- function zc(n) {
7001
+ function Pc(n) {
7005
7002
  let e = n.querySelectorAll(te ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7006
7003
  for (let t = 0; t < e.length; t++) {
7007
7004
  let o = e[t];
7008
7005
  o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), o);
7009
7006
  }
7010
7007
  }
7011
- function Bc(n, e) {
7008
+ function zc(n, e) {
7012
7009
  if (!n.size)
7013
7010
  return n;
7014
7011
  let t = n.content.firstChild.type.schema, o;
@@ -7026,25 +7023,25 @@ function Bc(n, e) {
7026
7023
  }
7027
7024
  return new E(r, i, s);
7028
7025
  }
7029
- const ie = {}, se = {}, Lc = { touchstart: !0, touchmove: !0 };
7030
- class Vc {
7026
+ const ie = {}, se = {}, Bc = { touchstart: !0, touchmove: !0 };
7027
+ class Lc {
7031
7028
  constructor() {
7032
7029
  this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
7033
7030
  }
7034
7031
  }
7035
- function Fc(n) {
7032
+ function Vc(n) {
7036
7033
  for (let e in ie) {
7037
7034
  let t = ie[e];
7038
7035
  n.dom.addEventListener(e, n.input.eventHandlers[e] = (o) => {
7039
- Hc(n, o) && !Yn(n, o) && (n.editable || !(o.type in se)) && t(n, o);
7040
- }, Lc[e] ? { passive: !0 } : void 0);
7036
+ $c(n, o) && !Yn(n, o) && (n.editable || !(o.type in se)) && t(n, o);
7037
+ }, Bc[e] ? { passive: !0 } : void 0);
7041
7038
  }
7042
7039
  re && n.dom.addEventListener("input", () => null), zn(n);
7043
7040
  }
7044
7041
  function Fe(n, e) {
7045
7042
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7046
7043
  }
7047
- function $c(n) {
7044
+ function Fc(n) {
7048
7045
  n.domObserver.stop();
7049
7046
  for (let e in n.input.eventHandlers)
7050
7047
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -7062,7 +7059,7 @@ function Yn(n, e) {
7062
7059
  return o ? o(n, e) || e.defaultPrevented : !1;
7063
7060
  });
7064
7061
  }
7065
- function Hc(n, e) {
7062
+ function $c(n, e) {
7066
7063
  if (!e.bubbles)
7067
7064
  return !0;
7068
7065
  if (e.defaultPrevented)
@@ -7072,7 +7069,7 @@ function Hc(n, e) {
7072
7069
  return !1;
7073
7070
  return !0;
7074
7071
  }
7075
- function qc(n, e) {
7072
+ function Hc(n, e) {
7076
7073
  !Yn(n, e) && ie[e.type] && (n.editable || !(e.type in se)) && ie[e.type](n, e);
7077
7074
  }
7078
7075
  se.keydown = (n, e) => {
@@ -7083,7 +7080,7 @@ se.keydown = (n, e) => {
7083
7080
  n.input.lastIOSEnter = o, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
7084
7081
  n.input.lastIOSEnter == o && (n.someProp("handleKeyDown", (r) => r(n, Ue(13, "Enter"))), n.input.lastIOSEnter = 0);
7085
7082
  }, 200);
7086
- } else n.someProp("handleKeyDown", (o) => o(n, t)) || Ic(n, t) ? t.preventDefault() : Fe(n, "key");
7083
+ } else n.someProp("handleKeyDown", (o) => o(n, t)) || vc(n, t) ? t.preventDefault() : Fe(n, "key");
7087
7084
  };
7088
7085
  se.keyup = (n, e) => {
7089
7086
  e.keyCode == 16 && (n.input.shiftKey = !1);
@@ -7105,7 +7102,7 @@ se.keypress = (n, e) => {
7105
7102
  function sn(n) {
7106
7103
  return { left: n.clientX, top: n.clientY };
7107
7104
  }
7108
- function Wc(n, e) {
7105
+ function qc(n, e) {
7109
7106
  let t = e.x - n.clientX, o = e.y - n.clientY;
7110
7107
  return t * t + o * o < 100;
7111
7108
  }
@@ -7124,13 +7121,13 @@ function ht(n, e, t) {
7124
7121
  let o = n.state.tr.setSelection(e);
7125
7122
  o.setMeta("pointer", !0), n.dispatch(o);
7126
7123
  }
7127
- function Jc(n, e) {
7124
+ function Wc(n, e) {
7128
7125
  if (e == -1)
7129
7126
  return !1;
7130
7127
  let t = n.state.doc.resolve(e), o = t.nodeAfter;
7131
7128
  return o && o.isAtom && T.isSelectable(o) ? (ht(n, new T(t)), !0) : !1;
7132
7129
  }
7133
- function Kc(n, e) {
7130
+ function Jc(n, e) {
7134
7131
  if (e == -1)
7135
7132
  return !1;
7136
7133
  let t = n.state.selection, o, r;
@@ -7145,16 +7142,16 @@ function Kc(n, e) {
7145
7142
  }
7146
7143
  return r != null ? (ht(n, T.create(n.state.doc, r)), !0) : !1;
7147
7144
  }
7148
- function Uc(n, e, t, o, r) {
7149
- return Gn(n, "handleClickOn", e, t, o) || n.someProp("handleClick", (i) => i(n, e, o)) || (r ? Kc(n, t) : Jc(n, t));
7145
+ function Kc(n, e, t, o, r) {
7146
+ return Gn(n, "handleClickOn", e, t, o) || n.someProp("handleClick", (i) => i(n, e, o)) || (r ? Jc(n, t) : Wc(n, t));
7150
7147
  }
7151
- function jc(n, e, t, o) {
7148
+ function Uc(n, e, t, o) {
7152
7149
  return Gn(n, "handleDoubleClickOn", e, t, o) || n.someProp("handleDoubleClick", (r) => r(n, e, o));
7153
7150
  }
7154
- function Yc(n, e, t, o) {
7155
- return Gn(n, "handleTripleClickOn", e, t, o) || n.someProp("handleTripleClick", (r) => r(n, e, o)) || Gc(n, t, o);
7151
+ function jc(n, e, t, o) {
7152
+ return Gn(n, "handleTripleClickOn", e, t, o) || n.someProp("handleTripleClick", (r) => r(n, e, o)) || Yc(n, t, o);
7156
7153
  }
7157
- function Gc(n, e, t) {
7154
+ function Yc(n, e, t) {
7158
7155
  if (t.button != 0)
7159
7156
  return !1;
7160
7157
  let o = n.state.doc;
@@ -7180,11 +7177,11 @@ ie.mousedown = (n, e) => {
7180
7177
  let t = e;
7181
7178
  n.input.shiftKey = t.shiftKey;
7182
7179
  let o = Xn(n), r = Date.now(), i = "singleClick";
7183
- r - n.input.lastClick.time < 500 && Wc(t, n.input.lastClick) && !t[pi] && (n.input.lastClick.type == "singleClick" ? i = "doubleClick" : n.input.lastClick.type == "doubleClick" && (i = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: i };
7180
+ r - n.input.lastClick.time < 500 && qc(t, n.input.lastClick) && !t[pi] && (n.input.lastClick.type == "singleClick" ? i = "doubleClick" : n.input.lastClick.type == "doubleClick" && (i = "tripleClick")), n.input.lastClick = { time: r, x: t.clientX, y: t.clientY, type: i };
7184
7181
  let s = n.posAtCoords(sn(t));
7185
- s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Xc(n, s, t, !!o)) : (i == "doubleClick" ? jc : Yc)(n, s.pos, s.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
7182
+ s && (i == "singleClick" ? (n.input.mouseDown && n.input.mouseDown.done(), n.input.mouseDown = new Gc(n, s, t, !!o)) : (i == "doubleClick" ? Uc : jc)(n, s.pos, s.inside, t) ? t.preventDefault() : Fe(n, "pointer"));
7186
7183
  };
7187
- class Xc {
7184
+ class Gc {
7188
7185
  constructor(e, t, o, r) {
7189
7186
  this.view = e, this.pos = t, this.event = o, this.flushed = r, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!o[pi], this.allowDefault = o.shiftKey;
7190
7187
  let i, s;
@@ -7213,7 +7210,7 @@ class Xc {
7213
7210
  if (this.done(), !this.view.dom.contains(e.target))
7214
7211
  return;
7215
7212
  let t = this.pos;
7216
- this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") : Uc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7213
+ this.view.state.doc != this.startDoc && (t = this.view.posAtCoords(sn(e))), this.updateAllowDefault(e), this.allowDefault || !t ? Fe(this.view, "pointer") : Kc(this.view, t.pos, t.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
7217
7214
  re && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7218
7215
  // cursor, but still report that the node is selected
7219
7216
  // when asked through getSelection. You'll then get a
@@ -7240,7 +7237,7 @@ ie.contextmenu = (n) => Xn(n);
7240
7237
  function mi(n, e) {
7241
7238
  return n.composing ? !0 : re && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
7242
7239
  }
7243
- const _c = Re ? 5e3 : -1;
7240
+ const Xc = Re ? 5e3 : -1;
7244
7241
  se.compositionstart = se.compositionupdate = (n) => {
7245
7242
  if (!n.composing) {
7246
7243
  n.domObserver.flush();
@@ -7263,7 +7260,7 @@ se.compositionstart = se.compositionupdate = (n) => {
7263
7260
  }
7264
7261
  n.input.composing = !0;
7265
7262
  }
7266
- gi(n, _c);
7263
+ gi(n, Xc);
7267
7264
  };
7268
7265
  se.compositionend = (n, e) => {
7269
7266
  n.composing && (n.input.composing = !1, n.input.compositionEndedAt = e.timeStamp, n.input.compositionPendingChanges = n.domObserver.pendingRecords().length ? n.input.compositionID : 0, n.input.compositionNode = null, n.input.compositionPendingChanges && Promise.resolve().then(() => n.domObserver.flush()), n.input.compositionID++, gi(n, 20));
@@ -7272,14 +7269,14 @@ function gi(n, e) {
7272
7269
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => At(n), e));
7273
7270
  }
7274
7271
  function bi(n) {
7275
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Qc()); n.input.compositionNodes.length > 0; )
7272
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Zc()); n.input.compositionNodes.length > 0; )
7276
7273
  n.input.compositionNodes.pop().markParentsDirty();
7277
7274
  }
7278
- function Zc(n) {
7275
+ function _c(n) {
7279
7276
  let e = n.domSelectionRange();
7280
7277
  if (!e.focusNode)
7281
7278
  return null;
7282
- let t = Ja(e.focusNode, e.focusOffset), o = Ka(e.focusNode, e.focusOffset);
7279
+ let t = Wa(e.focusNode, e.focusOffset), o = Ja(e.focusNode, e.focusOffset);
7283
7280
  if (t && o && t != o) {
7284
7281
  let r = o.pmViewDesc, i = n.domObserver.lastChangedTextNode;
7285
7282
  if (t == i || o == i)
@@ -7294,7 +7291,7 @@ function Zc(n) {
7294
7291
  }
7295
7292
  return t || o;
7296
7293
  }
7297
- function Qc() {
7294
+ function Zc() {
7298
7295
  let n = document.createEvent("Event");
7299
7296
  return n.initEvent("event", !0, !0), n.timeStamp;
7300
7297
  }
@@ -7307,7 +7304,7 @@ function At(n, e = !1) {
7307
7304
  return !1;
7308
7305
  }
7309
7306
  }
7310
- function ed(n, e) {
7307
+ function Qc(n, e) {
7311
7308
  if (!n.dom.parentNode)
7312
7309
  return;
7313
7310
  let t = n.dom.parentNode.appendChild(document.createElement("div"));
@@ -7317,18 +7314,18 @@ function ed(n, e) {
7317
7314
  t.parentNode && t.parentNode.removeChild(t), n.focus();
7318
7315
  }, 50);
7319
7316
  }
7320
- const Et = ae && He < 15 || gt && Xa < 604;
7317
+ const Et = ae && He < 15 || gt && Ga < 604;
7321
7318
  ie.copy = se.cut = (n, e) => {
7322
7319
  let t = e, o = n.state.selection, r = t.type == "cut";
7323
7320
  if (o.empty)
7324
7321
  return;
7325
7322
  let i = Et ? null : t.clipboardData, s = o.content(), { dom: l, text: a } = Un(n, s);
7326
- i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) : ed(n, l), r && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
7323
+ i ? (t.preventDefault(), i.clearData(), i.setData("text/html", l.innerHTML), i.setData("text/plain", a)) : Qc(n, l), r && n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
7327
7324
  };
7328
- function td(n) {
7325
+ function ed(n) {
7329
7326
  return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
7330
7327
  }
7331
- function nd(n, e) {
7328
+ function td(n, e) {
7332
7329
  if (!n.dom.parentNode)
7333
7330
  return;
7334
7331
  let t = n.input.shiftKey || n.state.selection.$from.parent.type.spec.code, o = n.dom.parentNode.appendChild(document.createElement(t ? "textarea" : "div"));
@@ -7344,7 +7341,7 @@ function Rt(n, e, t, o, r) {
7344
7341
  return !0;
7345
7342
  if (!i)
7346
7343
  return !1;
7347
- let s = td(i), l = s ? n.state.tr.replaceSelectionWith(s, o) : n.state.tr.replaceSelection(i);
7344
+ let s = ed(i), l = s ? n.state.tr.replaceSelectionWith(s, o) : n.state.tr.replaceSelection(i);
7348
7345
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
7349
7346
  }
7350
7347
  function yi(n) {
@@ -7359,7 +7356,7 @@ se.paste = (n, e) => {
7359
7356
  if (n.composing && !Re)
7360
7357
  return;
7361
7358
  let o = Et ? null : t.clipboardData, r = n.input.shiftKey && n.input.lastKeyCode != 45;
7362
- o && Rt(n, yi(o), o.getData("text/html"), r, t) ? t.preventDefault() : nd(n, t);
7359
+ o && Rt(n, yi(o), o.getData("text/html"), r, t) ? t.preventDefault() : td(n, t);
7363
7360
  };
7364
7361
  class ki {
7365
7362
  constructor(e, t, o) {
@@ -7409,7 +7406,7 @@ se.drop = (n, e) => {
7409
7406
  if (!s)
7410
7407
  return;
7411
7408
  t.preventDefault();
7412
- let a = s ? La(n.state.doc, i.pos, s) : i.pos;
7409
+ let a = s ? Ba(n.state.doc, i.pos, s) : i.pos;
7413
7410
  a == null && (a = i.pos);
7414
7411
  let c = n.state.tr;
7415
7412
  if (l) {
@@ -7647,7 +7644,7 @@ class G {
7647
7644
  let a = this.local[l].map(e, o, r);
7648
7645
  a && a.type.valid(t, a) ? (s || (s = [])).push(a) : i.onRemove && i.onRemove(this.local[l].spec);
7649
7646
  }
7650
- return this.children.length ? od(this.children, s || [], e, t, o, r, i) : s ? new G(s.sort(et), ct) : ee;
7647
+ return this.children.length ? nd(this.children, s || [], e, t, o, r, i) : s ? new G(s.sort(et), ct) : ee;
7651
7648
  }
7652
7649
  /**
7653
7650
  Add the given array of decorations to the ones in the set,
@@ -7825,7 +7822,7 @@ class Ve {
7825
7822
  this.members[t].forEachSet(e);
7826
7823
  }
7827
7824
  }
7828
- function od(n, e, t, o, r, i, s) {
7825
+ function nd(n, e, t, o, r, i, s) {
7829
7826
  let l = n.slice();
7830
7827
  for (let c = 0, d = i; c < t.maps.length; c++) {
7831
7828
  let u = 0;
@@ -7861,7 +7858,7 @@ function od(n, e, t, o, r, i, s) {
7861
7858
  a = !0;
7862
7859
  }
7863
7860
  if (a) {
7864
- let c = rd(l, n, e, t, r, i, s), d = tn(c, o, 0, s);
7861
+ let c = od(l, n, e, t, r, i, s), d = tn(c, o, 0, s);
7865
7862
  e = d.local;
7866
7863
  for (let u = 0; u < l.length; u += 3)
7867
7864
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -7884,7 +7881,7 @@ function Ci(n, e) {
7884
7881
  }
7885
7882
  return t;
7886
7883
  }
7887
- function rd(n, e, t, o, r, i, s) {
7884
+ function od(n, e, t, o, r, i, s) {
7888
7885
  function l(a, c) {
7889
7886
  for (let d = 0; d < a.local.length; d++) {
7890
7887
  let u = a.local[d].map(o, r, c);
@@ -7959,15 +7956,15 @@ function kn(n) {
7959
7956
  o && o != ee && e.push(o);
7960
7957
  }), n.cursorWrapper && e.push(G.create(n.state.doc, [n.cursorWrapper.deco])), Ve.from(e);
7961
7958
  }
7962
- const id = {
7959
+ const rd = {
7963
7960
  childList: !0,
7964
7961
  characterData: !0,
7965
7962
  characterDataOldValue: !0,
7966
7963
  attributes: !0,
7967
7964
  attributeOldValue: !0,
7968
7965
  subtree: !0
7969
- }, sd = ae && He <= 11;
7970
- class ld {
7966
+ }, id = ae && He <= 11;
7967
+ class sd {
7971
7968
  constructor() {
7972
7969
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
7973
7970
  }
@@ -7981,13 +7978,13 @@ class ld {
7981
7978
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
7982
7979
  }
7983
7980
  }
7984
- class ad {
7981
+ class ld {
7985
7982
  constructor(e, t) {
7986
- this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new ld(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
7983
+ this.view = e, this.handleDOMChange = t, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new sd(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((o) => {
7987
7984
  for (let r = 0; r < o.length; r++)
7988
7985
  this.queue.push(o[r]);
7989
7986
  ae && He <= 11 && o.some((r) => r.type == "childList" && r.removedNodes.length || r.type == "characterData" && r.oldValue.length > r.target.nodeValue.length) ? this.flushSoon() : this.flush();
7990
- }), sd && (this.onCharData = (o) => {
7987
+ }), id && (this.onCharData = (o) => {
7991
7988
  this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
7992
7989
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
7993
7990
  }
@@ -8000,7 +7997,7 @@ class ad {
8000
7997
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
8001
7998
  }
8002
7999
  start() {
8003
- this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, id)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8000
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, rd)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8004
8001
  }
8005
8002
  stop() {
8006
8003
  if (this.observer) {
@@ -8083,12 +8080,12 @@ class ad {
8083
8080
  let { focusNode: u } = this.currentSelection;
8084
8081
  for (let f of d) {
8085
8082
  let m = f.parentNode;
8086
- m && m.nodeName == "LI" && (!u || ud(e, u) != m) && f.remove();
8083
+ m && m.nodeName == "LI" && (!u || dd(e, u) != m) && f.remove();
8087
8084
  }
8088
8085
  }
8089
8086
  }
8090
8087
  let c = null;
8091
- i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(o) && (c = Jn(e)) && c.eq(q.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Pe(e), this.currentSelection.set(o)) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, s), cd(e)), this.handleDOMChange(i, s, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || Pe(e), this.currentSelection.set(o));
8088
+ i < 0 && r && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && on(o) && (c = Jn(e)) && c.eq(q.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, Pe(e), this.currentSelection.set(o)) : (i > -1 || r) && (i > -1 && (e.docView.markDirty(i, s), ad(e)), this.handleDOMChange(i, s, l, a), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(o) || Pe(e), this.currentSelection.set(o));
8092
8089
  }
8093
8090
  registerMutation(e, t) {
8094
8091
  if (t.indexOf(e.target) > -1)
@@ -8124,7 +8121,7 @@ class ad {
8124
8121
  }
8125
8122
  }
8126
8123
  let Fo = /* @__PURE__ */ new WeakMap(), $o = !1;
8127
- function cd(n) {
8124
+ function ad(n) {
8128
8125
  if (!Fo.has(n) && (Fo.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
8129
8126
  if (n.requiresGeckoHackNode = ke, $o)
8130
8127
  return;
@@ -8135,7 +8132,7 @@ function Ho(n, e) {
8135
8132
  let t = e.startContainer, o = e.startOffset, r = e.endContainer, i = e.endOffset, s = n.domAtPos(n.state.selection.anchor);
8136
8133
  return tt(s.node, s.offset, r, i) && ([t, o, r, i] = [r, i, t, o]), { anchorNode: t, anchorOffset: o, focusNode: r, focusOffset: i };
8137
8134
  }
8138
- function dd(n, e) {
8135
+ function cd(n, e) {
8139
8136
  if (e.getComposedRanges) {
8140
8137
  let r = e.getComposedRanges(n.root)[0];
8141
8138
  if (r)
@@ -8147,7 +8144,7 @@ function dd(n, e) {
8147
8144
  }
8148
8145
  return n.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", o, !0), t ? Ho(n, t) : null;
8149
8146
  }
8150
- function ud(n, e) {
8147
+ function dd(n, e) {
8151
8148
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
8152
8149
  let o = n.docView.nearestDesc(t, !0);
8153
8150
  if (o && o.node.isBlock)
@@ -8155,7 +8152,7 @@ function ud(n, e) {
8155
8152
  }
8156
8153
  return null;
8157
8154
  }
8158
- function hd(n, e, t) {
8155
+ function ud(n, e, t) {
8159
8156
  let { node: o, fromOffset: r, toOffset: i, from: s, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
8160
8157
  if (d && n.dom.contains(d.nodeType == 1 ? d : d.parentNode) && (c = [{ node: d, offset: a.anchorOffset }], on(a) || c.push({ node: a.focusNode, offset: a.focusOffset })), te && n.input.lastKeyCode === 8)
8161
8158
  for (let g = i; g > r; g--) {
@@ -8175,7 +8172,7 @@ function hd(n, e, t) {
8175
8172
  to: i,
8176
8173
  preserveWhitespace: m.parent.type.whitespace == "pre" ? "full" : !0,
8177
8174
  findPositions: c,
8178
- ruleFromNode: fd,
8175
+ ruleFromNode: hd,
8179
8176
  context: m
8180
8177
  });
8181
8178
  if (c && c[0].pos != null) {
@@ -8184,7 +8181,7 @@ function hd(n, e, t) {
8184
8181
  }
8185
8182
  return { doc: b, sel: p, from: s, to: l };
8186
8183
  }
8187
- function fd(n) {
8184
+ function hd(n) {
8188
8185
  let e = n.pmViewDesc;
8189
8186
  if (e)
8190
8187
  return e.parseRule();
@@ -8198,8 +8195,8 @@ function fd(n) {
8198
8195
  return { ignore: !0 };
8199
8196
  return null;
8200
8197
  }
8201
- const pd = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8202
- function md(n, e, t, o, r) {
8198
+ const fd = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
8199
+ function pd(n, e, t, o, r) {
8203
8200
  let i = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
8204
8201
  if (n.input.compositionPendingChanges = 0, e < 0) {
8205
8202
  let N = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, X = Jn(n, N);
@@ -8213,10 +8210,10 @@ function md(n, e, t, o, r) {
8213
8210
  }
8214
8211
  let s = n.state.doc.resolve(e), l = s.sharedDepth(t);
8215
8212
  e = s.before(l + 1), t = n.state.doc.resolve(t).after(l + 1);
8216
- let a = n.state.selection, c = hd(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, m;
8213
+ let a = n.state.selection, c = ud(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, m;
8217
8214
  n.input.lastKeyCode === 8 && Date.now() - 100 < n.input.lastKeyCodeTime ? (f = n.state.selection.to, m = "end") : (f = n.state.selection.from, m = "start"), n.input.lastKeyCode = null;
8218
- let p = yd(u.content, c.doc.content, c.from, f, m);
8219
- if (p && n.input.domChangeCount++, (gt && n.input.lastIOSEnter > Date.now() - 225 || Re) && r.some((N) => N.nodeType == 1 && !pd.test(N.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (N) => N(n, Ue(13, "Enter")))) {
8215
+ let p = bd(u.content, c.doc.content, c.from, f, m);
8216
+ if (p && n.input.domChangeCount++, (gt && n.input.lastIOSEnter > Date.now() - 225 || Re) && r.some((N) => N.nodeType == 1 && !fd.test(N.nodeName)) && (!p || p.endA >= p.endB) && n.someProp("handleKeyDown", (N) => N(n, Ue(13, "Enter")))) {
8220
8217
  n.input.lastIOSEnter = 0;
8221
8218
  return;
8222
8219
  }
@@ -8239,7 +8236,7 @@ function md(n, e, t, o, r) {
8239
8236
  n.input.lastIOSEnter = 0;
8240
8237
  return;
8241
8238
  }
8242
- if (n.state.selection.anchor > p.start && bd(d, p.start, p.endA, b, g) && n.someProp("handleKeyDown", (N) => N(n, Ue(8, "Backspace")))) {
8239
+ if (n.state.selection.anchor > p.start && gd(d, p.start, p.endA, b, g) && n.someProp("handleKeyDown", (N) => N(n, Ue(8, "Backspace")))) {
8243
8240
  Re && te && n.domObserver.suppressSelectionUpdates();
8244
8241
  return;
8245
8242
  }
@@ -8254,7 +8251,7 @@ function md(n, e, t, o, r) {
8254
8251
  ae && He <= 11 && b.parentOffset == 0 && (n.domObserver.suppressSelectionUpdates(), setTimeout(() => Pe(n), 20)), M = n.state.tr.delete(k, I), v = d.resolve(p.start).marksAcross(d.resolve(p.endA));
8255
8252
  else if (
8256
8253
  // Adding or removing a mark
8257
- p.endA == p.endB && (w = gd(b.parent.content.cut(b.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8254
+ p.endA == p.endB && (w = md(b.parent.content.cut(b.parentOffset, g.parentOffset), y.parent.content.cut(y.parentOffset, p.endA - y.start())))
8258
8255
  )
8259
8256
  M = n.state.tr, w.type == "add" ? M.addMark(k, I, w.mark) : M.removeMark(k, I, w.mark);
8260
8257
  else if (b.parent.child(b.index()).isText && b.index() == g.index() - (g.textOffset ? 0 : 1)) {
@@ -8273,7 +8270,7 @@ function md(n, e, t, o, r) {
8273
8270
  function qo(n, e, t) {
8274
8271
  return Math.max(t.anchor, t.head) > e.content.size ? null : Kn(n, e.resolve(t.anchor), e.resolve(t.head));
8275
8272
  }
8276
- function gd(n, e) {
8273
+ function md(n, e) {
8277
8274
  let t = n.firstChild.marks, o = e.firstChild.marks, r = t, i = o, s, l, a;
8278
8275
  for (let d = 0; d < o.length; d++)
8279
8276
  r = o[d].removeFromSet(r);
@@ -8291,7 +8288,7 @@ function gd(n, e) {
8291
8288
  if (A.from(c).eq(n))
8292
8289
  return { mark: l, type: s };
8293
8290
  }
8294
- function bd(n, e, t, o, r) {
8291
+ function gd(n, e, t, o, r) {
8295
8292
  if (
8296
8293
  // The content must have shrunk
8297
8294
  t - e <= r.pos - o.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -8319,7 +8316,7 @@ function xn(n, e, t) {
8319
8316
  }
8320
8317
  return r;
8321
8318
  }
8322
- function yd(n, e, t, o, r) {
8319
+ function bd(n, e, t, o, r) {
8323
8320
  let i = n.findDiffStart(e, t);
8324
8321
  if (i == null)
8325
8322
  return null;
@@ -8343,8 +8340,8 @@ function Wo(n) {
8343
8340
  let e = n.charCodeAt(0), t = n.charCodeAt(1);
8344
8341
  return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
8345
8342
  }
8346
- const kd = jn, xd = At;
8347
- class Cd {
8343
+ const yd = jn, kd = At;
8344
+ class xd {
8348
8345
  /**
8349
8346
  Create a view. `place` may be a DOM node that the editor should
8350
8347
  be appended to, a function that will place it into the document,
@@ -8353,7 +8350,7 @@ class Cd {
8353
8350
  added to the document.
8354
8351
  */
8355
8352
  constructor(e, t) {
8356
- this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Vc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Yo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Uo(this), Ko(this), this.nodeViews = jo(this), this.docView = To(this.state.doc, Jo(this), kn(this), this.dom, this), this.domObserver = new ad(this, (o, r, i, s) => md(this, o, r, i, s)), this.domObserver.start(), Fc(this), this.updatePluginViews();
8353
+ this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Lc(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = t, this.state = t.state, this.directPlugins = t.plugins || [], this.directPlugins.forEach(Yo), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Uo(this), Ko(this), this.nodeViews = jo(this), this.docView = To(this.state.doc, Jo(this), kn(this), this.dom, this), this.domObserver = new ld(this, (o, r, i, s) => pd(this, o, r, i, s)), this.domObserver.start(), Vc(this), this.updatePluginViews();
8357
8354
  }
8358
8355
  /**
8359
8356
  Holds `true` when a
@@ -8413,22 +8410,22 @@ class Cd {
8413
8410
  let l = r.plugins != e.plugins || this._props.plugins != t.plugins;
8414
8411
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
8415
8412
  let m = jo(this);
8416
- Nd(m, this.nodeViews) && (this.nodeViews = m, i = !0);
8413
+ Sd(m, this.nodeViews) && (this.nodeViews = m, i = !0);
8417
8414
  }
8418
8415
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && zn(this), this.editable = Uo(this), Ko(this);
8419
8416
  let a = kn(this), c = Jo(this), d = r.plugins != e.plugins && !r.doc.eq(e.doc) ? "reset" : e.scrollToSelection > r.scrollToSelection ? "to selection" : "preserve", u = i || !this.docView.matchesNode(e.doc, c, a);
8420
8417
  (u || !e.selection.eq(r.selection)) && (s = !0);
8421
- let f = d == "preserve" && s && this.dom.style.overflowAnchor == null && Qa(this);
8418
+ let f = d == "preserve" && s && this.dom.style.overflowAnchor == null && Za(this);
8422
8419
  if (s) {
8423
8420
  this.domObserver.stop();
8424
- let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty && Sd(r.selection, e.selection);
8421
+ let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty && Cd(r.selection, e.selection);
8425
8422
  if (u) {
8426
8423
  let p = te ? this.trackWrites = this.domSelectionRange().focusNode : null;
8427
- this.composing && (this.input.compositionNode = Zc(this)), (i || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = To(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (m = !0);
8424
+ this.composing && (this.input.compositionNode = _c(this)), (i || !this.docView.update(e.doc, c, a, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = To(e.doc, c, a, this.dom, this)), p && !this.trackWrites && (m = !0);
8428
8425
  }
8429
- m || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Nc(this)) ? Pe(this, m) : (si(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
8426
+ m || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && Sc(this)) ? Pe(this, m) : (si(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
8430
8427
  }
8431
- this.updatePluginViews(r), !((o = this.dragging) === null || o === void 0) && o.node && !r.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, r), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && ec(f);
8428
+ this.updatePluginViews(r), !((o = this.dragging) === null || o === void 0) && o.node && !r.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, r), d == "reset" ? this.dom.scrollTop = 0 : d == "to selection" ? this.scrollToSelection() : f && Qa(f);
8432
8429
  }
8433
8430
  /**
8434
8431
  @internal
@@ -8515,7 +8512,7 @@ class Cd {
8515
8512
  Focus the editor.
8516
8513
  */
8517
8514
  focus() {
8518
- this.domObserver.stop(), this.editable && tc(this.dom), Pe(this), this.domObserver.start();
8515
+ this.domObserver.stop(), this.editable && ec(this.dom), Pe(this), this.domObserver.start();
8519
8516
  }
8520
8517
  /**
8521
8518
  Get the document root in which the editor exists. This will
@@ -8549,7 +8546,7 @@ class Cd {
8549
8546
  the top level, not in any node.
8550
8547
  */
8551
8548
  posAtCoords(e) {
8552
- return sc(this, e);
8549
+ return ic(this, e);
8553
8550
  }
8554
8551
  /**
8555
8552
  Returns the viewport rectangle at a given document position.
@@ -8614,7 +8611,7 @@ class Cd {
8614
8611
  pass a different state.
8615
8612
  */
8616
8613
  endOfTextblock(e, t) {
8617
- return uc(this, t || this.state, e);
8614
+ return dc(this, t || this.state, e);
8618
8615
  }
8619
8616
  /**
8620
8617
  Run the editor's paste logic with the given HTML string. The
@@ -8646,7 +8643,7 @@ class Cd {
8646
8643
  views](https://prosemirror.net/docs/ref/#view.NodeView).
8647
8644
  */
8648
8645
  destroy() {
8649
- this.docView && ($c(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], kn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, qa());
8646
+ this.docView && (Fc(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], kn(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, Ha());
8650
8647
  }
8651
8648
  /**
8652
8649
  This is true when the view has been
@@ -8660,7 +8657,7 @@ class Cd {
8660
8657
  Used for testing.
8661
8658
  */
8662
8659
  dispatchEvent(e) {
8663
- return qc(this, e);
8660
+ return Hc(this, e);
8664
8661
  }
8665
8662
  /**
8666
8663
  Dispatch a transaction. Will call
@@ -8680,7 +8677,7 @@ class Cd {
8680
8677
  */
8681
8678
  domSelectionRange() {
8682
8679
  let e = this.domSelection();
8683
- return e ? re && this.root.nodeType === 11 && ja(this.dom.ownerDocument) == this.dom && dd(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
8680
+ return e ? re && this.root.nodeType === 11 && Ua(this.dom.ownerDocument) == this.dom && cd(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
8684
8681
  }
8685
8682
  /**
8686
8683
  @internal
@@ -8707,7 +8704,7 @@ function Ko(n) {
8707
8704
  function Uo(n) {
8708
8705
  return !n.someProp("editable", (e) => e(n.state) === !1);
8709
8706
  }
8710
- function Sd(n, e) {
8707
+ function Cd(n, e) {
8711
8708
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
8712
8709
  return n.$anchor.start(t) != e.$anchor.start(t);
8713
8710
  }
@@ -8719,7 +8716,7 @@ function jo(n) {
8719
8716
  }
8720
8717
  return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
8721
8718
  }
8722
- function Nd(n, e) {
8719
+ function Sd(n, e) {
8723
8720
  let t = 0, o = 0;
8724
8721
  for (let r in n) {
8725
8722
  if (n[r] != e[r])
@@ -8734,31 +8731,31 @@ function Yo(n) {
8734
8731
  if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
8735
8732
  throw new RangeError("Plugins passed directly to the view must not have a state component");
8736
8733
  }
8737
- const Td = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8734
+ const Nd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8738
8735
  __proto__: null,
8739
8736
  Decoration: me,
8740
8737
  DecorationSet: G,
8741
- EditorView: Cd,
8742
- __endComposition: xd,
8743
- __parseFromClipboard: kd
8738
+ EditorView: xd,
8739
+ __endComposition: kd,
8740
+ __parseFromClipboard: yd
8744
8741
  }, Symbol.toStringTag, { value: "Module" }));
8745
- function wd() {
8742
+ function Td() {
8746
8743
  try {
8747
- return Td;
8744
+ return Nd;
8748
8745
  } catch {
8749
8746
  return null;
8750
8747
  }
8751
8748
  }
8752
- function Dd(n, e) {
8749
+ function wd(n, e) {
8753
8750
  if (n && typeof n.serializeForClipboard == "function")
8754
8751
  return n.serializeForClipboard(e);
8755
- const t = wd();
8752
+ const t = Td();
8756
8753
  if (t && // @ts-expect-error proseMirrorView is not a function
8757
8754
  typeof (t == null ? void 0 : t.__serializeForClipboard) == "function")
8758
8755
  return t.__serializeForClipboard(n, e);
8759
8756
  throw new Error("No supported clipboard serialization method found.");
8760
8757
  }
8761
- function Md(n) {
8758
+ function Dd(n) {
8762
8759
  const e = n.getBoundingClientRect(), t = n.closest('[role="dialog"]'), o = n.closest(".ProseMirror"), r = o == null ? void 0 : o.getBoundingClientRect(), i = window.pageXOffset || document.documentElement.scrollLeft, s = window.pageYOffset || document.documentElement.scrollTop;
8763
8760
  if (t && window.getComputedStyle(t).transform !== "none") {
8764
8761
  const l = t.getBoundingClientRect();
@@ -8807,7 +8804,7 @@ function Ut(n, e) {
8807
8804
  const t = e.state.doc.resolve(n);
8808
8805
  return t.depth > 1 ? t.before(t.depth) : n;
8809
8806
  }
8810
- function Od(n) {
8807
+ function Md(n) {
8811
8808
  let e = "", t = !1;
8812
8809
  function o(d, u) {
8813
8810
  if (u.focus(), !d.dataTransfer) return;
@@ -8846,7 +8843,7 @@ function Od(n) {
8846
8843
  k = T.create(u.state.doc, w.before());
8847
8844
  }
8848
8845
  u.dispatch(u.state.tr.setSelection(k)), u.state.selection instanceof T && u.state.selection.node.type.name === "listItem" && (e = f.parentElement.tagName);
8849
- const I = u.state.selection.content(), { dom: M, text: v } = Dd(u, I);
8846
+ const I = u.state.selection.content(), { dom: M, text: v } = wd(u, I);
8850
8847
  d.dataTransfer.clearData(), d.dataTransfer.setData("text/html", M.innerHTML), d.dataTransfer.setData("text/plain", v), d.dataTransfer.effectAllowed = "copyMove", d.dataTransfer.setDragImage(f, 0, 0), u.dragging = { slice: I, move: d.ctrlKey };
8851
8848
  }
8852
8849
  let r = null;
@@ -8882,8 +8879,8 @@ function Od(n) {
8882
8879
  const f = u.closest(".drag-handle") || u.classList.contains("drag-handle"), m = u.closest(".tiptap") || u.classList.contains("tiptap");
8883
8880
  !f && !m && !t && i();
8884
8881
  }
8885
- return new $a({
8886
- key: new Ha(n.pluginKey),
8882
+ return new Fa({
8883
+ key: new $a(n.pluginKey),
8887
8884
  view: (d) => {
8888
8885
  var b, g, y, C;
8889
8886
  const u = n.dragHandleSelector ? document.querySelector(n.dragHandleSelector) : null;
@@ -8939,7 +8936,7 @@ function Od(n) {
8939
8936
  b != null && b >= 0 && (r.dataset.nodePos = String(
8940
8937
  Ut(b, d)
8941
8938
  ));
8942
- const g = window.getComputedStyle(f), y = parseInt(g.lineHeight, 10), C = isNaN(y) ? parseInt(g.fontSize) * 1.2 : y, O = parseInt(g.paddingTop, 10), k = Md(f);
8939
+ const g = window.getComputedStyle(f), y = parseInt(g.lineHeight, 10), C = isNaN(y) ? parseInt(g.fontSize) * 1.2 : y, O = parseInt(g.paddingTop, 10), k = Dd(f);
8943
8940
  k.top += (C - 24) / 2, k.top += O, f.matches("ul:not([data-type=taskList]) li, ol li") && (k.left -= n.dragHandleWidth - 28), k.width = n.dragHandleWidth, r && (r.style.position = "absolute", r.style.left = `${k.left - k.width}px`, r.style.top = `${k.top}px`, s());
8944
8941
  },
8945
8942
  keydown: () => {
@@ -8999,7 +8996,7 @@ function Od(n) {
8999
8996
  }
9000
8997
  });
9001
8998
  }
9002
- const vd = zl.create({
8999
+ const Od = Pl.create({
9003
9000
  name: "globalDragHandle",
9004
9001
  addOptions() {
9005
9002
  return {
@@ -9011,7 +9008,7 @@ const vd = zl.create({
9011
9008
  },
9012
9009
  addProseMirrorPlugins() {
9013
9010
  return [
9014
- Od({
9011
+ Md({
9015
9012
  pluginKey: "globalDragHandle",
9016
9013
  dragHandleWidth: this.options.dragHandleWidth,
9017
9014
  scrollTreshold: this.options.scrollTreshold,
@@ -9021,18 +9018,18 @@ const vd = zl.create({
9021
9018
  })
9022
9019
  ];
9023
9020
  }
9024
- }), Id = ll, Ad = Gs.configure({
9021
+ }), vd = sl, Id = Ys.configure({
9025
9022
  placeholder: "撰写任何内容,或者按“/”输入命令..."
9026
- }), Ed = Xs.configure({
9023
+ }), Ad = Gs.configure({
9027
9024
  HTMLAttributes: {
9028
9025
  class: le(
9029
9026
  "text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
9030
9027
  )
9031
9028
  }
9032
- }), Rd = _s.extend({
9029
+ }), Ed = Xs.extend({
9033
9030
  addProseMirrorPlugins() {
9034
9031
  return [
9035
- Zs({
9032
+ _s({
9036
9033
  imageClass: le("opacity-40 rounded-lg border border-stone-200")
9037
9034
  })
9038
9035
  ];
@@ -9042,24 +9039,24 @@ const vd = zl.create({
9042
9039
  HTMLAttributes: {
9043
9040
  class: le("rounded-lg border border-muted")
9044
9041
  }
9045
- }), Pd = Qs.configure({
9042
+ }), Rd = Zs.configure({
9046
9043
  HTMLAttributes: {
9047
9044
  class: le("rounded-lg border border-muted")
9048
9045
  }
9049
- }), zd = el.configure({
9046
+ }), Pd = Qs.configure({
9050
9047
  HTMLAttributes: {
9051
9048
  class: le("not-prose pl-2 ")
9052
9049
  }
9053
- }), Bd = tl.configure({
9050
+ }), zd = el.configure({
9054
9051
  HTMLAttributes: {
9055
9052
  class: le("flex gap-2 items-start my-4")
9056
9053
  },
9057
9054
  nested: !0
9058
- }), Ld = nl.configure({
9055
+ }), Bd = tl.configure({
9059
9056
  HTMLAttributes: {
9060
9057
  class: le("mt-4 mb-6 border-t border-muted-foreground")
9061
9058
  }
9062
- }), Vd = ol.configure({
9059
+ }), Ld = nl.configure({
9063
9060
  bulletList: {
9064
9061
  HTMLAttributes: {
9065
9062
  class: le("list-disc list-outside leading-3 -mt-2")
@@ -9099,18 +9096,18 @@ const vd = zl.create({
9099
9096
  width: 4
9100
9097
  },
9101
9098
  gapcursor: !1
9102
- }), Fd = rl.configure({
9099
+ }), Vd = ol.configure({
9103
9100
  // configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
9104
9101
  // common: covers 37 language grammars which should be good enough in most cases
9105
- lowlight: Rl(Pl)
9106
- }), $d = il.configure({
9102
+ lowlight: El(Rl)
9103
+ }), Fd = rl.configure({
9107
9104
  HTMLAttributes: {
9108
9105
  class: le("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
9109
9106
  },
9110
9107
  katexOptions: {
9111
9108
  throwOnError: !1
9112
9109
  }
9113
- }), Hd = sl.configure(), qd = Al.configure({
9110
+ }), $d = il.configure(), Hd = Il.configure({
9114
9111
  html: !0,
9115
9112
  tightLists: !0,
9116
9113
  tightListClass: "tight",
@@ -9119,30 +9116,30 @@ const vd = zl.create({
9119
9116
  breaks: !1,
9120
9117
  transformPastedText: !1,
9121
9118
  transformCopiedText: !1
9122
- }), Wd = vd.configure({
9119
+ }), qd = Od.configure({
9123
9120
  dragHandleWidth: 56,
9124
9121
  dragHandleSelector: ".custom-drag-handle"
9125
9122
  }), Ti = [
9126
- Vd,
9123
+ Ld,
9124
+ Id,
9127
9125
  Ad,
9128
9126
  Ed,
9129
9127
  Rd,
9130
9128
  Pd,
9131
9129
  zd,
9132
9130
  Bd,
9133
- Ld,
9134
- Id,
9131
+ vd,
9132
+ Vd,
9135
9133
  Fd,
9136
9134
  $d,
9135
+ ll,
9137
9136
  Hd,
9138
9137
  al,
9139
- qd,
9140
9138
  cl,
9141
9139
  dl,
9142
9140
  ul,
9143
- hl,
9144
- Wd
9145
- ], Jd = wt.Root, wi = wt.Trigger, ln = ne.forwardRef(({ className: n, align: e = "center", sideOffset: t = 4, ...o }, r) => /* @__PURE__ */ h(wt.Portal, { children: /* @__PURE__ */ h(
9141
+ qd
9142
+ ], Wd = wt.Root, wi = wt.Trigger, ln = ne.forwardRef(({ className: n, align: e = "center", sideOffset: t = 4, ...o }, r) => /* @__PURE__ */ h(wt.Portal, { children: /* @__PURE__ */ h(
9146
9143
  wt.Content,
9147
9144
  {
9148
9145
  ref: r,
@@ -9156,7 +9153,7 @@ const vd = zl.create({
9156
9153
  }
9157
9154
  ) }));
9158
9155
  ln.displayName = wt.Content.displayName;
9159
- const Kd = El(
9156
+ const Jd = Al(
9160
9157
  "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
9161
9158
  {
9162
9159
  variants: {
@@ -9182,9 +9179,9 @@ const Kd = El(
9182
9179
  }
9183
9180
  ), be = ne.forwardRef(
9184
9181
  ({ className: n, variant: e, size: t, asChild: o = !1, ...r }, i) => /* @__PURE__ */ h(
9185
- o ? Ll : "button",
9182
+ o ? Bl : "button",
9186
9183
  {
9187
- className: D(Kd({ variant: e, size: t, className: n })),
9184
+ className: D(Jd({ variant: e, size: t, className: n })),
9188
9185
  ref: i,
9189
9186
  ...r
9190
9187
  }
@@ -9299,7 +9296,7 @@ const _o = [
9299
9296
  showArrow: !1,
9300
9297
  ...n
9301
9298
  }
9302
- ), Ud = ({ open: n, onOpenChange: e }) => {
9299
+ ), Kd = ({ open: n, onOpenChange: e }) => {
9303
9300
  const { editor: t } = xe();
9304
9301
  if (!t) return null;
9305
9302
  const o = _o.find(
@@ -9307,7 +9304,7 @@ const _o = [
9307
9304
  ), r = Zo.find(
9308
9305
  ({ color: i }) => t.isActive("highlight", { color: i })
9309
9306
  );
9310
- return /* @__PURE__ */ x(Jd, { modal: !0, open: n, onOpenChange: e, children: [
9307
+ return /* @__PURE__ */ x(Wd, { modal: !0, open: n, onOpenChange: e, children: [
9311
9308
  /* @__PURE__ */ h(ot, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ h(wi, { asChild: !0, children: /* @__PURE__ */ x(be, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
9312
9309
  /* @__PURE__ */ h(
9313
9310
  "span",
@@ -9388,15 +9385,15 @@ const _o = [
9388
9385
  )
9389
9386
  ] });
9390
9387
  };
9391
- function jd(n) {
9388
+ function Ud(n) {
9392
9389
  try {
9393
9390
  return new URL(n), !0;
9394
9391
  } catch {
9395
9392
  return !1;
9396
9393
  }
9397
9394
  }
9398
- function Yd(n) {
9399
- if (jd(n)) return n;
9395
+ function jd(n) {
9396
+ if (Ud(n)) return n;
9400
9397
  try {
9401
9398
  if (n.includes(".") && !n.includes(" "))
9402
9399
  return new URL(`https://${n}`).toString();
@@ -9404,20 +9401,20 @@ function Yd(n) {
9404
9401
  return null;
9405
9402
  }
9406
9403
  }
9407
- const Gd = ({ open: n, onOpenChange: e }) => {
9404
+ const Yd = ({ open: n, onOpenChange: e }) => {
9408
9405
  const t = mt(null), { editor: o } = xe();
9409
9406
  return $e(() => {
9410
9407
  var r;
9411
9408
  (r = t.current) == null || r.focus();
9412
9409
  }), o ? /* @__PURE__ */ x(gr, { modal: !0, open: n, onOpenChange: e, children: [
9413
- /* @__PURE__ */ h(ot, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ h(Bl, { asChild: !0, children: /* @__PURE__ */ x(
9410
+ /* @__PURE__ */ h(ot, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ h(zl, { asChild: !0, children: /* @__PURE__ */ x(
9414
9411
  be,
9415
9412
  {
9416
9413
  size: "sm",
9417
9414
  variant: "ghost",
9418
9415
  className: "gap-2 rounded-md border-none",
9419
9416
  children: [
9420
- /* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(is, { size: 16 }) }),
9417
+ /* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(rs, { size: 16 }) }),
9421
9418
  /* @__PURE__ */ h(
9422
9419
  "p",
9423
9420
  {
@@ -9439,7 +9436,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9439
9436
  onSubmit: (r) => {
9440
9437
  const i = r.currentTarget;
9441
9438
  r.preventDefault();
9442
- const s = i[0], l = Yd(s.value);
9439
+ const s = i[0], l = jd(s.value);
9443
9440
  l && (o.chain().focus().setLink({ href: l }).run(), e(!1));
9444
9441
  },
9445
9442
  className: "flex p-1 ",
@@ -9471,7 +9468,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9471
9468
  }
9472
9469
  ) })
9473
9470
  ] }) : null;
9474
- }, Xd = () => {
9471
+ }, Gd = () => {
9475
9472
  const { editor: n } = xe();
9476
9473
  return n ? /* @__PURE__ */ h(ot, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ h(
9477
9474
  be,
@@ -9489,7 +9486,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9489
9486
  }
9490
9487
  },
9491
9488
  children: /* @__PURE__ */ h(
9492
- Vl,
9489
+ Ll,
9493
9490
  {
9494
9491
  className: D("size-4", { "text-blue-500": n.isActive("math") }),
9495
9492
  strokeWidth: 2.3
@@ -9561,7 +9558,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9561
9558
  command: (n) => n.chain().focus().clearNodes().toggleCodeBlock().run(),
9562
9559
  isActive: (n) => n.isActive("codeBlock")
9563
9560
  }
9564
- ], _d = ({ open: n, onOpenChange: e }) => {
9561
+ ], Xd = ({ open: n, onOpenChange: e }) => {
9565
9562
  const { editor: t } = xe();
9566
9563
  if (!t) return null;
9567
9564
  const o = Bn.filter(
@@ -9621,7 +9618,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9621
9618
  )
9622
9619
  );
9623
9620
  dt.displayName = br.Root.displayName;
9624
- const Zd = () => /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-0.5", children: [
9621
+ const _d = () => /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-0.5", children: [
9625
9622
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
9626
9623
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
9627
9624
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
@@ -9655,8 +9652,8 @@ const Mi = ne.forwardRef(({ className: n, orientation: e = "vertical", ...t }, o
9655
9652
  }
9656
9653
  ));
9657
9654
  Mi.displayName = Ze.ScrollAreaScrollbar.displayName;
9658
- const Qd = we.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9659
- we.Overlay,
9655
+ const Zd = Te.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9656
+ Te.Overlay,
9660
9657
  {
9661
9658
  ref: t,
9662
9659
  className: D(
@@ -9666,11 +9663,11 @@ const Qd = we.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PU
9666
9663
  ...e
9667
9664
  }
9668
9665
  ));
9669
- Oi.displayName = we.Overlay.displayName;
9670
- const eu = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE__ */ x(Qd, { children: [
9666
+ Oi.displayName = Te.Overlay.displayName;
9667
+ const Qd = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE__ */ x(Zd, { children: [
9671
9668
  /* @__PURE__ */ h(Oi, {}),
9672
9669
  /* @__PURE__ */ x(
9673
- we.Content,
9670
+ Te.Content,
9674
9671
  {
9675
9672
  ref: o,
9676
9673
  className: D(
@@ -9680,17 +9677,17 @@ const eu = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE_
9680
9677
  ...t,
9681
9678
  children: [
9682
9679
  e,
9683
- /* @__PURE__ */ x(we.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
9684
- /* @__PURE__ */ h(Fl, { className: "h-4 w-4" }),
9680
+ /* @__PURE__ */ x(Te.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
9681
+ /* @__PURE__ */ h(Vl, { className: "h-4 w-4" }),
9685
9682
  /* @__PURE__ */ h("span", { className: "sr-only", children: "Close" })
9686
9683
  ] })
9687
9684
  ]
9688
9685
  }
9689
9686
  )
9690
9687
  ] }));
9691
- eu.displayName = we.Content.displayName;
9692
- const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9693
- we.Title,
9688
+ Qd.displayName = Te.Content.displayName;
9689
+ const eu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9690
+ Te.Title,
9694
9691
  {
9695
9692
  ref: t,
9696
9693
  className: D(
@@ -9700,16 +9697,16 @@ const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9700
9697
  ...e
9701
9698
  }
9702
9699
  ));
9703
- tu.displayName = we.Title.displayName;
9704
- const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9705
- we.Description,
9700
+ eu.displayName = Te.Title.displayName;
9701
+ const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9702
+ Te.Description,
9706
9703
  {
9707
9704
  ref: t,
9708
9705
  className: D("text-sm text-muted-foreground", n),
9709
9706
  ...e
9710
9707
  }
9711
9708
  ));
9712
- nu.displayName = we.Description.displayName;
9709
+ tu.displayName = Te.Description.displayName;
9713
9710
  const vi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9714
9711
  ce,
9715
9712
  {
@@ -9737,7 +9734,7 @@ const Ii = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ x("div",
9737
9734
  )
9738
9735
  ] }));
9739
9736
  Ii.displayName = ce.Input.displayName;
9740
- const ou = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9737
+ const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9741
9738
  ce.List,
9742
9739
  {
9743
9740
  ref: t,
@@ -9745,8 +9742,8 @@ const ou = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9745
9742
  ...e
9746
9743
  }
9747
9744
  ));
9748
- ou.displayName = ce.List.displayName;
9749
- const ru = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9745
+ nu.displayName = ce.List.displayName;
9746
+ const ou = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9750
9747
  ce.Empty,
9751
9748
  {
9752
9749
  ref: e,
@@ -9754,7 +9751,7 @@ const ru = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9754
9751
  ...n
9755
9752
  }
9756
9753
  ));
9757
- ru.displayName = ce.Empty.displayName;
9754
+ ou.displayName = ce.Empty.displayName;
9758
9755
  const zt = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9759
9756
  ce.Group,
9760
9757
  {
@@ -9788,7 +9785,7 @@ const ft = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9788
9785
  }
9789
9786
  ));
9790
9787
  ft.displayName = ce.Item.displayName;
9791
- const iu = ({
9788
+ const ru = ({
9792
9789
  completion: n,
9793
9790
  onDiscard: e
9794
9791
  }) => {
@@ -9811,7 +9808,7 @@ const iu = ({
9811
9808
  ).run();
9812
9809
  },
9813
9810
  children: [
9814
- /* @__PURE__ */ h($l, { className: "h-4 w-4 text-muted-foreground" }),
9811
+ /* @__PURE__ */ h(Fl, { className: "h-4 w-4 text-muted-foreground" }),
9815
9812
  "替换选择"
9816
9813
  ]
9817
9814
  }
@@ -9826,7 +9823,7 @@ const iu = ({
9826
9823
  t.chain().focus().insertContentAt(o.to + 1, n).run();
9827
9824
  },
9828
9825
  children: [
9829
- /* @__PURE__ */ h(Hl, { className: "h-4 w-4 text-muted-foreground" }),
9826
+ /* @__PURE__ */ h($l, { className: "h-4 w-4 text-muted-foreground" }),
9830
9827
  "在下面插入"
9831
9828
  ]
9832
9829
  }
@@ -9834,41 +9831,41 @@ const iu = ({
9834
9831
  ] }),
9835
9832
  /* @__PURE__ */ h(Qn, {}),
9836
9833
  /* @__PURE__ */ h(zt, { children: /* @__PURE__ */ x(ft, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
9837
- /* @__PURE__ */ h(ql, { className: "h-4 w-4 text-muted-foreground" }),
9834
+ /* @__PURE__ */ h(Hl, { className: "h-4 w-4 text-muted-foreground" }),
9838
9835
  "丢弃"
9839
9836
  ] }) })
9840
9837
  ] });
9841
- }, su = [
9838
+ }, iu = [
9842
9839
  {
9843
9840
  value: "improve",
9844
9841
  label: "改进写作",
9845
9842
  // Improve writing
9846
- icon: Wl
9843
+ icon: ql
9847
9844
  },
9848
9845
  {
9849
9846
  value: "fix",
9850
9847
  label: "修正语法",
9851
9848
  // Fix grammar
9852
- icon: Jl
9849
+ icon: Wl
9853
9850
  },
9854
9851
  {
9855
9852
  value: "shorter",
9856
9853
  label: "缩短文本",
9857
9854
  // Make shorter
9858
- icon: Kl
9855
+ icon: Jl
9859
9856
  },
9860
9857
  {
9861
9858
  value: "longer",
9862
9859
  label: "扩展文本",
9863
9860
  // Make longer
9864
- icon: Ul
9861
+ icon: Kl
9865
9862
  }
9866
- ], lu = ({ onSelect: n }) => {
9863
+ ], su = ({ onSelect: n }) => {
9867
9864
  const { editor: e } = xe();
9868
9865
  return /* @__PURE__ */ x(rt, { children: [
9869
9866
  /* @__PURE__ */ x(zt, { heading: "编辑或校对选中文本", children: [
9870
9867
  " ",
9871
- su.map((t) => /* @__PURE__ */ x(
9868
+ iu.map((t) => /* @__PURE__ */ x(
9872
9869
  ft,
9873
9870
  {
9874
9871
  onSelect: (o) => {
@@ -9894,13 +9891,13 @@ const iu = ({
9894
9891
  ft,
9895
9892
  {
9896
9893
  onSelect: () => {
9897
- const t = e.state.selection.from, o = fl(e, t);
9894
+ const t = e.state.selection.from, o = hl(e, t);
9898
9895
  n(o, "continue");
9899
9896
  },
9900
9897
  value: "continue",
9901
9898
  className: "gap-2 px-4",
9902
9899
  children: [
9903
- /* @__PURE__ */ h(jl, { className: "h-4 w-4 text-purple-500" }),
9900
+ /* @__PURE__ */ h(Ul, { className: "h-4 w-4 text-purple-500" }),
9904
9901
  "继续写作"
9905
9902
  ]
9906
9903
  }
@@ -9908,8 +9905,8 @@ const iu = ({
9908
9905
  ] })
9909
9906
  ] });
9910
9907
  };
9911
- function au({ onOpenChange: n, options: e }) {
9912
- const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } = ea({
9908
+ function lu({ onOpenChange: n, options: e }) {
9909
+ const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } = Ql({
9913
9910
  // id: "novel",
9914
9911
  api: "/api/generate",
9915
9912
  onResponse: (c) => {
@@ -9928,7 +9925,7 @@ function au({ onOpenChange: n, options: e }) {
9928
9925
  l && /* @__PURE__ */ x("div", { className: "flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-purple-500", children: [
9929
9926
  /* @__PURE__ */ h(Fn, { size: 14, className: "mr-2 shrink-0" }),
9930
9927
  "AI正在思考",
9931
- /* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(Zd, {}) })
9928
+ /* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(_d, {}) })
9932
9929
  ] }),
9933
9930
  !l && /* @__PURE__ */ x(rt, { children: [
9934
9931
  /* @__PURE__ */ x("div", { className: "relative", children: [
@@ -9939,7 +9936,7 @@ function au({ onOpenChange: n, options: e }) {
9939
9936
  onValueChange: r,
9940
9937
  autoFocus: !0,
9941
9938
  placeholder: a ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
9942
- onFocus: () => pl(t)
9939
+ onFocus: () => fl(t)
9943
9940
  }
9944
9941
  ),
9945
9942
  /* @__PURE__ */ h(
@@ -9959,12 +9956,12 @@ function au({ onOpenChange: n, options: e }) {
9959
9956
  body: { option: "zap", command: o }
9960
9957
  }).then(() => r(""));
9961
9958
  },
9962
- children: /* @__PURE__ */ h(Yl, { className: "h-4 w-4" })
9959
+ children: /* @__PURE__ */ h(jl, { className: "h-4 w-4" })
9963
9960
  }
9964
9961
  )
9965
9962
  ] }),
9966
9963
  a ? /* @__PURE__ */ h(
9967
- iu,
9964
+ ru,
9968
9965
  {
9969
9966
  onDiscard: () => {
9970
9967
  t.chain().unsetHighlight().focus().run(), n(!1);
@@ -9972,7 +9969,7 @@ function au({ onOpenChange: n, options: e }) {
9972
9969
  completion: i
9973
9970
  }
9974
9971
  ) : /* @__PURE__ */ h(
9975
- lu,
9972
+ su,
9976
9973
  {
9977
9974
  onSelect: (c, d) => s(c, { body: { option: d } })
9978
9975
  }
@@ -9980,7 +9977,7 @@ function au({ onOpenChange: n, options: e }) {
9980
9977
  ] })
9981
9978
  ] });
9982
9979
  }
9983
- const cu = ({
9980
+ const au = ({
9984
9981
  children: n,
9985
9982
  open: e,
9986
9983
  onOpenChange: t,
@@ -9989,9 +9986,9 @@ const cu = ({
9989
9986
  }) => {
9990
9987
  const { editor: i } = xe();
9991
9988
  return $e(() => {
9992
- e || ml(i);
9989
+ e || pl(i);
9993
9990
  }, [e]), /* @__PURE__ */ x(
9994
- gl,
9991
+ ml,
9995
9992
  {
9996
9993
  tippyOptions: {
9997
9994
  placement: e ? "bottom-start" : "top",
@@ -10002,14 +9999,14 @@ const cu = ({
10002
9999
  className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
10003
10000
  children: [
10004
10001
  e && o && /* @__PURE__ */ h(
10005
- au,
10002
+ lu,
10006
10003
  {
10007
10004
  open: e,
10008
10005
  onOpenChange: t,
10009
10006
  options: r
10010
10007
  }
10011
10008
  ),
10012
- !e && /* @__PURE__ */ x(Fi, { children: [
10009
+ !e && /* @__PURE__ */ x(Vi, { children: [
10013
10010
  o && /* @__PURE__ */ x(
10014
10011
  be,
10015
10012
  {
@@ -10028,7 +10025,7 @@ const cu = ({
10028
10025
  ]
10029
10026
  }
10030
10027
  );
10031
- }, du = (n) => {
10028
+ }, cu = (n) => {
10032
10029
  const e = fetch("/api/upload", {
10033
10030
  method: "POST",
10034
10031
  headers: {
@@ -10054,10 +10051,10 @@ const cu = ({
10054
10051
  }
10055
10052
  );
10056
10053
  });
10057
- }, uu = mr({
10058
- onUpload: du,
10054
+ }, du = mr({
10055
+ onUpload: cu,
10059
10056
  validateFn: (n) => n.type.includes("image/") ? n.size / 1024 / 1024 > 20 ? (Dt.error("File size too big (max 20MB)."), !1) : !0 : (Dt.error("File type not supported."), !1)
10060
- }), hu = () => {
10057
+ }), uu = () => {
10061
10058
  const { editor: n } = xe();
10062
10059
  return n ? /* @__PURE__ */ h("div", { className: "flex", children: [
10063
10060
  {
@@ -10065,35 +10062,35 @@ const cu = ({
10065
10062
  // bold
10066
10063
  isActive: (t) => t.isActive("bold"),
10067
10064
  command: (t) => t.chain().focus().toggleBold().run(),
10068
- icon: Gl
10065
+ icon: Yl
10069
10066
  },
10070
10067
  {
10071
10068
  name: "斜体",
10072
10069
  // italic
10073
10070
  isActive: (t) => t.isActive("italic"),
10074
10071
  command: (t) => t.chain().focus().toggleItalic().run(),
10075
- icon: Xl
10072
+ icon: Gl
10076
10073
  },
10077
10074
  {
10078
10075
  name: "下划线",
10079
10076
  // underline
10080
10077
  isActive: (t) => t.isActive("underline"),
10081
10078
  command: (t) => t.chain().focus().toggleUnderline().run(),
10082
- icon: _l
10079
+ icon: Xl
10083
10080
  },
10084
10081
  {
10085
10082
  name: "删除线",
10086
10083
  // strike
10087
10084
  isActive: (t) => t.isActive("strike"),
10088
10085
  command: (t) => t.chain().focus().toggleStrike().run(),
10089
- icon: Zl
10086
+ icon: _l
10090
10087
  },
10091
10088
  {
10092
10089
  name: "代码",
10093
10090
  // code
10094
10091
  isActive: (t) => t.isActive("code"),
10095
10092
  command: (t) => t.chain().focus().toggleCode().run(),
10096
- icon: Ql
10093
+ icon: Zl
10097
10094
  }
10098
10095
  ].map((t) => /* @__PURE__ */ h(
10099
10096
  Xt,
@@ -10121,7 +10118,7 @@ const cu = ({
10121
10118
  },
10122
10119
  t.name
10123
10120
  )) }) : null;
10124
- }, Ai = ({ uploadFn: n }) => yl([
10121
+ }, Ai = ({ uploadFn: n }) => bl([
10125
10122
  {
10126
10123
  title: "文本",
10127
10124
  // "Text",
@@ -10223,7 +10220,7 @@ const cu = ({
10223
10220
  description: "从您的计算机上传图像。",
10224
10221
  // "Upload an image from your computer.",
10225
10222
  searchTerms: ["photo", "picture", "media"],
10226
- icon: /* @__PURE__ */ h(ss, { size: 18 }),
10223
+ icon: /* @__PURE__ */ h(is, { size: 18 }),
10227
10224
  command: ({ editor: e, range: t }) => {
10228
10225
  e.chain().focus().deleteRange(t).run();
10229
10226
  const o = document.createElement("input");
@@ -10236,15 +10233,15 @@ const cu = ({
10236
10233
  }, o.click();
10237
10234
  }
10238
10235
  }
10239
- ]), fu = (n) => bl.configure({
10236
+ ]), hu = (n) => gl.configure({
10240
10237
  suggestion: {
10241
10238
  items: () => Ai(n),
10242
- render: kl
10239
+ render: yl
10243
10240
  }
10244
- }), pu = {
10241
+ }), fu = {
10245
10242
  type: "doc",
10246
10243
  content: []
10247
- }, Ei = $i(({ children: n, items: e, ...t }, o) => {
10244
+ }, Ei = Fi(({ children: n, items: e, ...t }, o) => {
10248
10245
  const r = (s) => /* @__PURE__ */ x(
10249
10246
  qt.Item,
10250
10247
  {
@@ -10266,7 +10263,7 @@ const cu = ({
10266
10263
  return /* @__PURE__ */ h(
10267
10264
  qt.SubMenu,
10268
10265
  {
10269
- expandIcon: /* @__PURE__ */ h(ls, { size: 16 }),
10266
+ expandIcon: /* @__PURE__ */ h(ss, { size: 16 }),
10270
10267
  popupClassName: D(
10271
10268
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
10272
10269
  S`
@@ -10304,7 +10301,7 @@ const cu = ({
10304
10301
  );
10305
10302
  };
10306
10303
  return /* @__PURE__ */ h(
10307
- na,
10304
+ ta,
10308
10305
  {
10309
10306
  ref: o,
10310
10307
  trigger: "click",
@@ -10331,7 +10328,7 @@ const cu = ({
10331
10328
  );
10332
10329
  });
10333
10330
  Ei.displayName = "DropdownMenu";
10334
- const mu = ({ children: n, ...e }) => {
10331
+ const pu = ({ children: n, ...e }) => {
10335
10332
  const { editor: t } = xe(), o = () => {
10336
10333
  t && t.state.selection instanceof T && (t.commands.deleteSelection(), t.commands.focus());
10337
10334
  }, r = () => {
@@ -10356,13 +10353,13 @@ const mu = ({ children: n, ...e }) => {
10356
10353
  {
10357
10354
  key: "transform",
10358
10355
  type: "submenu",
10359
- icon: /* @__PURE__ */ h(as, { size: 16 }),
10356
+ icon: /* @__PURE__ */ h(ls, { size: 16 }),
10360
10357
  label: "转换成",
10361
10358
  children: i
10362
10359
  },
10363
10360
  {
10364
10361
  key: "duplicate",
10365
- icon: /* @__PURE__ */ h(cs, { size: 16 }),
10362
+ icon: /* @__PURE__ */ h(as, { size: 16 }),
10366
10363
  label: "创建副本",
10367
10364
  onClick: r
10368
10365
  },
@@ -10375,7 +10372,7 @@ const mu = ({ children: n, ...e }) => {
10375
10372
  onClick: o
10376
10373
  }
10377
10374
  ], ...e, children: n });
10378
- }, gu = () => {
10375
+ }, mu = () => {
10379
10376
  const { editor: n } = xe(), e = (t) => {
10380
10377
  if (!n) return;
10381
10378
  const o = t.target.closest(".custom-drag-handle");
@@ -10414,12 +10411,12 @@ const mu = ({ children: n, ...e }) => {
10414
10411
  variant: "ghost",
10415
10412
  className: "w-auto h-auto p-0.5",
10416
10413
  onClick: e,
10417
- children: /* @__PURE__ */ h(ds, { className: "cursor-pointer", size: 22 })
10414
+ children: /* @__PURE__ */ h(cs, { className: "cursor-pointer", size: 22 })
10418
10415
  }
10419
10416
  )
10420
10417
  }
10421
10418
  ),
10422
- /* @__PURE__ */ h(mu, { children: /* @__PURE__ */ h(
10419
+ /* @__PURE__ */ h(pu, { children: /* @__PURE__ */ h(
10423
10420
  ot,
10424
10421
  {
10425
10422
  placement: "bottom",
@@ -10427,13 +10424,13 @@ const mu = ({ children: n, ...e }) => {
10427
10424
  "拖动",
10428
10425
  /* @__PURE__ */ h("span", { className: "text-muted-foreground", children: "以移动" })
10429
10426
  ] }) }),
10430
- children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(us, { size: 22 }) })
10427
+ children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(ds, { size: 22 }) })
10431
10428
  }
10432
10429
  ) })
10433
10430
  ]
10434
10431
  }
10435
10432
  );
10436
- }, bu = (n) => {
10433
+ }, gu = (n) => {
10437
10434
  const {
10438
10435
  className: e,
10439
10436
  initialContent: t = {},
@@ -10451,9 +10448,9 @@ const mu = ({ children: n, ...e }) => {
10451
10448
  ), [p, b] = J("Saved"), [g, y] = J(), [C, O] = J(!1), [k, I] = J(!1), [M, v] = J(!1), [w, N] = J(!1), X = (R) => {
10452
10449
  const U = new DOMParser().parseFromString(R, "text/html");
10453
10450
  return U.querySelectorAll("pre code").forEach((V) => {
10454
- ta.highlightElement(V);
10451
+ ea.highlightElement(V);
10455
10452
  }), new XMLSerializer().serializeToString(U);
10456
- }, K = Il(
10453
+ }, K = vl(
10457
10454
  async (R) => {
10458
10455
  const U = R.getJSON();
10459
10456
  y(R.storage.characterCount.words()), o == null || o(U), i && (window.localStorage.setItem(
@@ -10466,13 +10463,13 @@ const mu = ({ children: n, ...e }) => {
10466
10463
  },
10467
10464
  500
10468
10465
  ), Ce = pt(() => {
10469
- if (!a) return uu;
10466
+ if (!a) return du;
10470
10467
  const {
10471
10468
  beforeUpload: R,
10472
10469
  maxSize: U,
10473
10470
  action: V,
10474
10471
  headers: de,
10475
- method: Se,
10472
+ method: Oe,
10476
10473
  name: an,
10477
10474
  onSuccess: Ft,
10478
10475
  onError: $t
@@ -10482,7 +10479,7 @@ const mu = ({ children: n, ...e }) => {
10482
10479
  const P = new FormData();
10483
10480
  P.append(an || "file", ze);
10484
10481
  const Q = fetch(V, {
10485
- method: Se || "POST",
10482
+ method: Oe || "POST",
10486
10483
  headers: {
10487
10484
  ...de
10488
10485
  },
@@ -10514,11 +10511,11 @@ const mu = ({ children: n, ...e }) => {
10514
10511
  if ($e(() => {
10515
10512
  if (!i) return;
10516
10513
  const R = window.localStorage.getItem(r);
10517
- m(R ? JSON.parse(R) : pu);
10514
+ m(R ? JSON.parse(R) : fu);
10518
10515
  }, [r, i]), !f) return null;
10519
- const Oe = [
10516
+ const Me = [
10520
10517
  ...Ti,
10521
- fu({
10518
+ hu({
10522
10519
  uploadFn: Ce
10523
10520
  })
10524
10521
  ];
@@ -10536,21 +10533,21 @@ const mu = ({ children: n, ...e }) => {
10536
10533
  }
10537
10534
  )
10538
10535
  ] }),
10539
- /* @__PURE__ */ h(xl, { children: /* @__PURE__ */ x(
10540
- Cl,
10536
+ /* @__PURE__ */ h(kl, { children: /* @__PURE__ */ x(
10537
+ xl,
10541
10538
  {
10542
10539
  onCreate: ({ editor: R }) => {
10543
10540
  c && (c.current = R);
10544
10541
  },
10545
10542
  initialContent: f,
10546
- extensions: Oe,
10543
+ extensions: Me,
10547
10544
  className: "relative min-h-[500px] w-full max-w-screen-lg border-muted bg-background sm:mb-[calc(20vh)] sm:rounded-lg sm:border sm:shadow-lg editor-content",
10548
10545
  editorProps: {
10549
10546
  handleDOMEvents: {
10550
- keydown: (R, U) => Tl(U)
10547
+ keydown: (R, U) => Nl(U)
10551
10548
  },
10552
- handlePaste: (R, U) => Nl(R, U, Ce),
10553
- handleDrop: (R, U, V, de) => Sl(R, U, de, Ce),
10549
+ handlePaste: (R, U) => Sl(R, U, Ce),
10550
+ handleDrop: (R, U, V, de) => Cl(R, U, de, Ce),
10554
10551
  attributes: {
10555
10552
  class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
10556
10553
  }
@@ -10558,14 +10555,14 @@ const mu = ({ children: n, ...e }) => {
10558
10555
  onUpdate: ({ editor: R }) => {
10559
10556
  K(R), b("Unsaved");
10560
10557
  },
10561
- slotAfter: /* @__PURE__ */ h(vl, {}),
10558
+ slotAfter: /* @__PURE__ */ h(Ol, {}),
10562
10559
  children: [
10563
- /* @__PURE__ */ x(wl, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
10564
- /* @__PURE__ */ h(Dl, { className: "px-2 text-muted-foreground", children: "没有结果" }),
10565
- /* @__PURE__ */ h(Ml, { children: Ai({
10560
+ /* @__PURE__ */ x(Tl, { className: "z-50 h-auto max-h-[330px] overflow-y-auto rounded-md border border-muted bg-background px-1 py-2 shadow-md transition-all", children: [
10561
+ /* @__PURE__ */ h(wl, { className: "px-2 text-muted-foreground", children: "没有结果" }),
10562
+ /* @__PURE__ */ h(Dl, { children: Ai({
10566
10563
  uploadFn: Ce
10567
10564
  }).map((R) => /* @__PURE__ */ x(
10568
- Ol,
10565
+ Ml,
10569
10566
  {
10570
10567
  value: R.title,
10571
10568
  onCommand: (U) => R.command(U),
@@ -10582,7 +10579,7 @@ const mu = ({ children: n, ...e }) => {
10582
10579
  )) })
10583
10580
  ] }),
10584
10581
  /* @__PURE__ */ x(
10585
- cu,
10582
+ au,
10586
10583
  {
10587
10584
  open: w,
10588
10585
  onOpenChange: N,
@@ -10590,32 +10587,32 @@ const mu = ({ children: n, ...e }) => {
10590
10587
  aiOptions: u,
10591
10588
  children: [
10592
10589
  d && /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10593
- /* @__PURE__ */ h(_d, { open: C, onOpenChange: O }),
10590
+ /* @__PURE__ */ h(Xd, { open: C, onOpenChange: O }),
10594
10591
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10595
- /* @__PURE__ */ h(Gd, { open: M, onOpenChange: v }),
10592
+ /* @__PURE__ */ h(Yd, { open: M, onOpenChange: v }),
10596
10593
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10597
- /* @__PURE__ */ h(Xd, {}),
10594
+ /* @__PURE__ */ h(Gd, {}),
10598
10595
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10599
- /* @__PURE__ */ h(hu, {}),
10596
+ /* @__PURE__ */ h(uu, {}),
10600
10597
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10601
- /* @__PURE__ */ h(Ud, { open: k, onOpenChange: I })
10598
+ /* @__PURE__ */ h(Kd, { open: k, onOpenChange: I })
10602
10599
  ]
10603
10600
  }
10604
10601
  ),
10605
- /* @__PURE__ */ h(gu, {})
10602
+ /* @__PURE__ */ h(mu, {})
10606
10603
  ]
10607
10604
  }
10608
10605
  ) })
10609
10606
  ] });
10610
- }, yu = ({ json: n }) => {
10611
- const e = pt(() => oa(n ?? {}, Ti), [n]);
10607
+ }, bu = ({ json: n }) => {
10608
+ const e = pt(() => na(n ?? {}, Ti), [n]);
10612
10609
  return /* @__PURE__ */ h("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ h("div", { dangerouslySetInnerHTML: { __html: e } }) });
10613
- }, ku = bu;
10614
- ku.Preview = yu;
10610
+ }, yu = gu;
10611
+ yu.Preview = bu;
10615
10612
  export {
10616
- lh as Desktop,
10613
+ sh as Desktop,
10617
10614
  Ar as Dock,
10618
- ku as Editor,
10619
- Na as Markdown,
10620
- Ta as MdEditor
10615
+ yu as Editor,
10616
+ Sa as Markdown,
10617
+ Na as MdEditor
10621
10618
  };