zs_library 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +1,52 @@
1
1
  var Pi = Object.defineProperty;
2
2
  var zi = (n, e, t) => e in n ? Pi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var cn = (n, e, t) => zi(n, typeof e != "symbol" ? e + "" : e, t);
4
- import "./zs_library.css";
4
+ import "./index.css";
5
5
  import Bi from "i18next";
6
6
  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,
@@ -1260,9 +1257,7 @@ const Nr = Qo({
1260
1257
  setMoveItemId: b,
1261
1258
  setMoveTargetId: g,
1262
1259
  addItem: y
1263
- } = bt();
1264
- console.log("🚀 ~ list:", a);
1265
- const { pagingDotBuilder: C, pagingDotsBuilder: O, itemBuilder: k } = it(), I = pt(() => e === !1 ? {} : {
1260
+ } = bt(), { pagingDotBuilder: C, pagingDotsBuilder: O, itemBuilder: k } = it(), I = pt(() => e === !1 ? {} : {
1266
1261
  top: S`
1267
1262
  display: flex;
1268
1263
  flex-direction: column;
@@ -1313,7 +1308,7 @@ const Nr = Qo({
1313
1308
  }[e.position ?? "bottom"], [e]);
1314
1309
  return /* @__PURE__ */ x(rt, { children: [
1315
1310
  /* @__PURE__ */ h(
1316
- Hi,
1311
+ $i,
1317
1312
  {
1318
1313
  useCSS: !0,
1319
1314
  useTransform: !0,
@@ -1446,7 +1441,7 @@ const Nr = Qo({
1446
1441
  case "group":
1447
1442
  case "app":
1448
1443
  N = /* @__PURE__ */ h(
1449
- fa,
1444
+ ha,
1450
1445
  {
1451
1446
  data: v,
1452
1447
  itemIndex: w,
@@ -1478,7 +1473,7 @@ const Nr = Qo({
1478
1473
  }
1479
1474
  ),
1480
1475
  /* @__PURE__ */ h(
1481
- ma,
1476
+ pa,
1482
1477
  {
1483
1478
  data: u,
1484
1479
  onClose: () => {
@@ -1487,7 +1482,7 @@ const Nr = Qo({
1487
1482
  }
1488
1483
  ),
1489
1484
  /* @__PURE__ */ h(
1490
- pa,
1485
+ fa,
1491
1486
  {
1492
1487
  data: m,
1493
1488
  onClose: () => {
@@ -1497,7 +1492,7 @@ const Nr = Qo({
1497
1492
  }
1498
1493
  )
1499
1494
  ] });
1500
- }, lh = (n) => {
1495
+ }, sh = (n) => {
1501
1496
  const {
1502
1497
  list: e,
1503
1498
  onChange: t,
@@ -1513,12 +1508,12 @@ const Nr = Qo({
1513
1508
  pagingDotsBuilder: f,
1514
1509
  ...m
1515
1510
  } = n;
1516
- return /* @__PURE__ */ h(ca, { ...{
1511
+ return /* @__PURE__ */ h(aa, { ...{
1517
1512
  list: e,
1518
1513
  onChange: t,
1519
1514
  storageKey: o,
1520
1515
  enableCaching: r
1521
- }, children: /* @__PURE__ */ h(la, { ...{
1516
+ }, children: /* @__PURE__ */ h(sa, { ...{
1522
1517
  theme: i,
1523
1518
  noLetters: s,
1524
1519
  contextMenu: l,
@@ -1527,8 +1522,8 @@ const Nr = Qo({
1527
1522
  itemBuilder: c,
1528
1523
  itemIconBuilder: d,
1529
1524
  contextMenuBuilder: a
1530
- }, children: /* @__PURE__ */ h(ga, { ...m }) }) });
1531
- }, ba = {
1525
+ }, children: /* @__PURE__ */ h(ma, { ...m }) }) });
1526
+ }, ga = {
1532
1527
  frontmatterEditor: {
1533
1528
  title: "编辑前置元数据",
1534
1529
  key: "键",
@@ -1645,13 +1640,13 @@ const Nr = Qo({
1645
1640
  image: {
1646
1641
  delete: "删除图片"
1647
1642
  }
1648
- }, ya = (n, e, t) => {
1643
+ }, ba = (n, e, t) => {
1649
1644
  const r = n.split(".").reduce(
1650
1645
  (i, s) => typeof i == "string" ? i : i[s],
1651
- ba
1646
+ ga
1652
1647
  );
1653
1648
  return typeof r != "string" ? e : t ? r.replace(/{{(.*?)}}/g, (i, s) => t[s]) : r;
1654
- }, ka = S`
1649
+ }, ya = S`
1655
1650
  --accentBase: var(--tomato-1);
1656
1651
  --accentBgSubtle: var(--tomato-2);
1657
1652
  --accentBg: var(--tomato-3);
@@ -1705,7 +1700,7 @@ const Nr = Qo({
1705
1700
  rgba(255, 255, 255, 0.05),
1706
1701
  rgba(255, 255, 255, 0.05)
1707
1702
  );
1708
- `, xa = S`
1703
+ `, ka = S`
1709
1704
  [class*="_toolbarRoot"] {
1710
1705
  flex-wrap: wrap;
1711
1706
  transition: all 0.3s;
@@ -1911,7 +1906,7 @@ const Nr = Qo({
1911
1906
  `, Cn = (n) => {
1912
1907
  var e, t;
1913
1908
  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) => {
1909
+ }, xa = (n) => {
1915
1910
  const {
1916
1911
  value: e,
1917
1912
  onChange: t,
@@ -1938,19 +1933,19 @@ const Nr = Qo({
1938
1933
  }
1939
1934
  },
1940
1935
  directives: b = {
1941
- directiveDescriptors: [fs]
1936
+ directiveDescriptors: [hs]
1942
1937
  }
1943
1938
  } = r ?? {}, [g, y] = J("");
1944
1939
  return $e(() => {
1945
1940
  var C;
1946
1941
  e !== void 0 && a.current && ((C = a.current) == null || C.setMarkdown(e), y(e));
1947
1942
  }, [e, a]), /* @__PURE__ */ h(
1948
- ps,
1943
+ fs,
1949
1944
  {
1950
1945
  ref: a,
1951
1946
  className: D(
1952
- xa,
1953
- Cn(s) ? ka : "",
1947
+ ka,
1948
+ Cn(s) ? ya : "",
1954
1949
  Cn(s) ? Mr : Dr,
1955
1950
  i
1956
1951
  ),
@@ -1959,49 +1954,49 @@ const Nr = Qo({
1959
1954
  onChange: (C) => {
1960
1955
  !e && !t && y(C), t && t(C);
1961
1956
  },
1962
- translation: o ?? ya,
1957
+ translation: o ?? ba,
1963
1958
  plugins: [
1964
- ms({
1965
- toolbarContents: () => /* @__PURE__ */ x(Is, { options: ["rich-text", "source"], children: [
1966
- /* @__PURE__ */ h(As, {}),
1959
+ ps({
1960
+ toolbarContents: () => /* @__PURE__ */ x(vs, { options: ["rich-text", "source"], children: [
1961
+ /* @__PURE__ */ h(Is, {}),
1967
1962
  /* @__PURE__ */ h(Ke, {}),
1963
+ /* @__PURE__ */ h(As, {}),
1968
1964
  /* @__PURE__ */ h(Es, {}),
1965
+ /* @__PURE__ */ h(Ke, {}),
1969
1966
  /* @__PURE__ */ h(Rs, {}),
1970
1967
  /* @__PURE__ */ h(Ke, {}),
1971
1968
  /* @__PURE__ */ h(Ps, {}),
1972
1969
  /* @__PURE__ */ h(Ke, {}),
1973
1970
  /* @__PURE__ */ h(zs, {}),
1974
- /* @__PURE__ */ h(Ke, {}),
1975
1971
  /* @__PURE__ */ h(Bs, {}),
1976
- /* @__PURE__ */ h(Ls, {}),
1977
1972
  /* @__PURE__ */ h(Ke, {}),
1973
+ /* @__PURE__ */ h(Ls, {}),
1978
1974
  /* @__PURE__ */ h(Vs, {}),
1979
- /* @__PURE__ */ h(Fs, {}),
1980
1975
  /* @__PURE__ */ h(Ke, {}),
1981
- /* @__PURE__ */ h($s, {}),
1976
+ /* @__PURE__ */ h(Fs, {}),
1982
1977
  /* @__PURE__ */ h(Ke, {}),
1983
- /* @__PURE__ */ h(Hs, {})
1978
+ /* @__PURE__ */ h($s, {})
1984
1979
  ] })
1985
1980
  }),
1986
- gs(d),
1981
+ ms(d),
1982
+ gs(),
1987
1983
  bs(),
1988
- ys(),
1989
- ks(u),
1990
- xs(f),
1991
- Cs(),
1992
- Ss(c),
1984
+ ys(u),
1985
+ ks(f),
1986
+ xs(),
1987
+ Cs(c),
1988
+ Ss(),
1993
1989
  Ns(),
1994
1990
  Ts(),
1995
- ws(),
1996
- Ds(m),
1997
- Ms(p),
1998
- Os(),
1999
- vs(b)
1991
+ ws(m),
1992
+ Ds(p),
1993
+ Ms(),
1994
+ Os(b)
2000
1995
  ],
2001
1996
  ...l
2002
1997
  }
2003
1998
  );
2004
- }, Sa = {
1999
+ }, Ca = {
2005
2000
  'code[class*="language-"]': {
2006
2001
  background: "hsl(230, 1%, 98%)",
2007
2002
  color: "hsl(230, 8%, 24%)",
@@ -2489,7 +2484,7 @@ const Nr = Qo({
2489
2484
  ".prism-previewer-easing.prism-previewer-easing line": {
2490
2485
  stroke: "hsl(230, 8%, 24%)"
2491
2486
  }
2492
- }, Na = (n) => {
2487
+ }, Sa = (n) => {
2493
2488
  const { children: e = "", className: t, theme: o = "auto", imageProps: r } = n;
2494
2489
  return /* @__PURE__ */ h(
2495
2490
  "div",
@@ -2499,39 +2494,39 @@ const Nr = Qo({
2499
2494
  pr,
2500
2495
  {
2501
2496
  className: D(wr, t),
2502
- remarkPlugins: [qs, Ws],
2503
- rehypePlugins: [Js],
2497
+ remarkPlugins: [Hs, qs],
2498
+ rehypePlugins: [Ws],
2504
2499
  components: {
2505
2500
  code(i) {
2506
2501
  const { children: s, className: l, node: a, ref: c, ...d } = i, u = /language-(\w+)/.exec(l || "");
2507
2502
  return u ? /* @__PURE__ */ h(
2508
- Ks,
2503
+ Js,
2509
2504
  {
2510
2505
  ...d,
2511
2506
  PreTag: "div",
2512
2507
  children: String(s).replace(/\n$/, ""),
2513
2508
  language: u[1],
2514
- style: Sa
2509
+ style: Ca
2515
2510
  }
2516
2511
  ) : /* @__PURE__ */ h("code", { ...d, className: l, children: s });
2517
2512
  },
2518
2513
  img(i) {
2519
2514
  const { preview: s, ...l } = r ?? {};
2520
2515
  return /* @__PURE__ */ h(
2521
- Us,
2516
+ Ks,
2522
2517
  {
2523
2518
  ...i,
2524
2519
  preview: s instanceof Boolean ? s : {
2525
2520
  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, {})
2521
+ rotateLeft: /* @__PURE__ */ h(ns, {}),
2522
+ rotateRight: /* @__PURE__ */ h(ts, {}),
2523
+ zoomIn: /* @__PURE__ */ h(es, {}),
2524
+ zoomOut: /* @__PURE__ */ h(Qi, {}),
2525
+ close: /* @__PURE__ */ h(Zi, {}),
2526
+ left: /* @__PURE__ */ h(_i, {}),
2527
+ right: /* @__PURE__ */ h(Xi, {}),
2528
+ flipX: /* @__PURE__ */ h(Gi, {}),
2529
+ flipY: /* @__PURE__ */ h(Yi, {})
2535
2530
  },
2536
2531
  zIndex: 9999,
2537
2532
  mask: " ",
@@ -2550,12 +2545,12 @@ const Nr = Qo({
2550
2545
  )
2551
2546
  }
2552
2547
  );
2553
- }, Ta = Ca;
2554
- Ta.Preview = Na;
2548
+ }, Na = xa;
2549
+ Na.Preview = Sa;
2555
2550
  function Or(...n) {
2556
- return Ys(js(n));
2551
+ return js(Us(n));
2557
2552
  }
2558
- const wa = (n) => {
2553
+ const Ta = (n) => {
2559
2554
  const { mouseX: e, title: t, icon: o, href: r } = n, i = mt(null), s = kt(e, (y) => {
2560
2555
  var O;
2561
2556
  const C = ((O = i.current) == null ? void 0 : O.getBoundingClientRect()) ?? { x: 0, width: 0 };
@@ -2616,7 +2611,7 @@ const wa = (n) => {
2616
2611
  }
2617
2612
  ) });
2618
2613
  }, vr = (n) => {
2619
- const { items: e, className: t } = n, o = qi(1 / 0);
2614
+ const { items: e, className: t } = n, o = Hi(1 / 0);
2620
2615
  return /* @__PURE__ */ h(
2621
2616
  B.div,
2622
2617
  {
@@ -2626,7 +2621,7 @@ const wa = (n) => {
2626
2621
  "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
2622
  t
2628
2623
  ),
2629
- children: e.map((r) => /* @__PURE__ */ h(wa, { mouseX: o, ...r }, r.title))
2624
+ children: e.map((r) => /* @__PURE__ */ h(Ta, { mouseX: o, ...r }, r.title))
2630
2625
  }
2631
2626
  );
2632
2627
  }, Ir = (n) => {
@@ -2682,13 +2677,13 @@ const wa = (n) => {
2682
2677
  {
2683
2678
  onClick: l,
2684
2679
  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" })
2680
+ children: o || /* @__PURE__ */ h(os, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2686
2681
  }
2687
2682
  )
2688
2683
  ]
2689
2684
  }
2690
2685
  );
2691
- }, Da = (n) => {
2686
+ }, wa = (n) => {
2692
2687
  const { items: e, desktopClassName: t, mobileClassName: o, ...r } = n;
2693
2688
  return /* @__PURE__ */ x(rt, { children: [
2694
2689
  /* @__PURE__ */ h(vr, { items: e, className: t, ...r }),
@@ -2702,7 +2697,7 @@ const wa = (n) => {
2702
2697
  }
2703
2698
  )
2704
2699
  ] });
2705
- }, Ar = Da;
2700
+ }, Ar = wa;
2706
2701
  Ar.Desktop = vr;
2707
2702
  Ar.Mobile = Ir;
2708
2703
  function Er(n, e, t) {
@@ -3141,7 +3136,7 @@ class ue {
3141
3136
  }
3142
3137
  }
3143
3138
  ue.none = [];
3144
- class Ma extends Error {
3139
+ class Da extends Error {
3145
3140
  }
3146
3141
  class E {
3147
3142
  /**
@@ -3242,10 +3237,10 @@ function zr(n, e, t, o) {
3242
3237
  let l = zr(s.content, e - i - 1, t);
3243
3238
  return l && n.replaceChild(r, s.copy(l));
3244
3239
  }
3245
- function Oa(n) {
3240
+ function Ma(n) {
3246
3241
  return n.tag != null;
3247
3242
  }
3248
- function va(n) {
3243
+ function Oa(n) {
3249
3244
  return n.style != null;
3250
3245
  }
3251
3246
  let Br = class Nn {
@@ -3257,9 +3252,9 @@ let Br = class Nn {
3257
3252
  this.schema = e, this.rules = t, this.tags = [], this.styles = [];
3258
3253
  let o = this.matchedStyles = [];
3259
3254
  t.forEach((r) => {
3260
- if (Oa(r))
3255
+ if (Ma(r))
3261
3256
  this.tags.push(r);
3262
- else if (va(r)) {
3257
+ else if (Oa(r)) {
3263
3258
  let i = /[^=]*/.exec(r.style)[0];
3264
3259
  o.indexOf(i) < 0 && o.push(i), this.styles.push(r);
3265
3260
  }
@@ -3295,7 +3290,7 @@ let Br = class Nn {
3295
3290
  matchTag(e, t, o) {
3296
3291
  for (let r = o ? this.tags.indexOf(o) + 1 : 0; r < this.tags.length; r++) {
3297
3292
  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))) {
3293
+ if (Aa(e, i.tag) && (i.namespace === void 0 || e.namespaceURI == i.namespace) && (!i.context || t.matchesContext(i.context))) {
3299
3294
  if (i.getAttrs) {
3300
3295
  let s = i.getAttrs(e);
3301
3296
  if (s === !1)
@@ -3396,7 +3391,7 @@ const Lr = {
3396
3391
  table: !0,
3397
3392
  tfoot: !0,
3398
3393
  ul: !0
3399
- }, Ia = {
3394
+ }, va = {
3400
3395
  head: !0,
3401
3396
  noscript: !0,
3402
3397
  object: !0,
@@ -3475,9 +3470,9 @@ class ro {
3475
3470
  let r = this.localPreserveWS, i = this.top;
3476
3471
  (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
3477
3472
  let s = e.nodeName.toLowerCase(), l;
3478
- Vr.hasOwnProperty(s) && this.parser.normalizeLists && Aa(e);
3473
+ Vr.hasOwnProperty(s) && this.parser.normalizeLists && Ia(e);
3479
3474
  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))
3475
+ e: if (a ? a.ignore : va.hasOwnProperty(s))
3481
3476
  this.findInside(e), this.ignoreFallback(e, t);
3482
3477
  else if (!a || a.skip || a.closeParent) {
3483
3478
  a && a.closeParent ? this.open = Math.max(0, this.open - 1) : a && a.skip.nodeType && (e = a.skip);
@@ -3709,13 +3704,13 @@ class ro {
3709
3704
  }
3710
3705
  }
3711
3706
  }
3712
- function Aa(n) {
3707
+ function Ia(n) {
3713
3708
  for (let e = n.firstChild, t = null; e; e = e.nextSibling) {
3714
3709
  let o = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
3715
3710
  o && Vr.hasOwnProperty(o) && t ? (t.appendChild(e), e = t) : o == "li" ? t = e : o && (t = null);
3716
3711
  }
3717
3712
  }
3718
- function Ea(n, e) {
3713
+ function Aa(n, e) {
3719
3714
  return (n.matches || n.msMatchesSelector || n.webkitMatchesSelector || n.mozMatchesSelector).call(n, e);
3720
3715
  }
3721
3716
  function io(n) {
@@ -3858,11 +3853,11 @@ function hn(n) {
3858
3853
  return n.document || window.document;
3859
3854
  }
3860
3855
  const ao = /* @__PURE__ */ new WeakMap();
3861
- function Ra(n) {
3856
+ function Ea(n) {
3862
3857
  let e = ao.get(n);
3863
- return e === void 0 && ao.set(n, e = Pa(n)), e;
3858
+ return e === void 0 && ao.set(n, e = Ra(n)), e;
3864
3859
  }
3865
- function Pa(n) {
3860
+ function Ra(n) {
3866
3861
  let e = null;
3867
3862
  function t(o) {
3868
3863
  if (o && typeof o == "object")
@@ -3888,7 +3883,7 @@ function Yt(n, e, t, o) {
3888
3883
  let r = e[0], i;
3889
3884
  if (typeof r != "string")
3890
3885
  throw new RangeError("Invalid array passed to renderSpec");
3891
- if (o && (i = Ra(o)) && i.indexOf(e) > -1)
3886
+ if (o && (i = Ea(o)) && i.indexOf(e) > -1)
3892
3887
  throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
3893
3888
  let s = r.indexOf(" ");
3894
3889
  s > 0 && (t = r.slice(0, s), r = r.slice(s + 1));
@@ -3919,13 +3914,13 @@ function Yt(n, e, t, o) {
3919
3914
  return { dom: a, contentDOM: l };
3920
3915
  }
3921
3916
  const Fr = 65535, $r = Math.pow(2, 16);
3922
- function za(n, e) {
3917
+ function Pa(n, e) {
3923
3918
  return n + e * $r;
3924
3919
  }
3925
3920
  function co(n) {
3926
3921
  return n & Fr;
3927
3922
  }
3928
- function Ba(n) {
3923
+ function za(n) {
3929
3924
  return (n - (n & Fr)) / $r;
3930
3925
  }
3931
3926
  const Hr = 1, qr = 2, Gt = 4, Wr = 8;
@@ -3983,7 +3978,7 @@ class he {
3983
3978
  if (!this.inverted)
3984
3979
  for (let r = 0; r < o; r++)
3985
3980
  t += this.ranges[r * 3 + 2] - this.ranges[r * 3 + 1];
3986
- return this.ranges[o * 3] + t + Ba(e);
3981
+ return this.ranges[o * 3] + t + za(e);
3987
3982
  }
3988
3983
  mapResult(e, t = 1) {
3989
3984
  return this._map(e, t, !1);
@@ -4005,7 +4000,7 @@ class he {
4005
4000
  let f = c ? e == a ? -1 : e == u ? 1 : t : t, m = a + r + (f < 0 ? 0 : d);
4006
4001
  if (o)
4007
4002
  return m;
4008
- let p = e == (t < 0 ? a : u) ? null : za(l / 3, e - a), b = e == a ? qr : e == u ? Hr : Gt;
4003
+ let p = e == (t < 0 ? a : u) ? null : Pa(l / 3, e - a), b = e == a ? qr : e == u ? Hr : Gt;
4009
4004
  return (t < 0 ? e != a : e != u) && (b |= Wr), new uo(m, b, p);
4010
4005
  }
4011
4006
  r += d - c;
@@ -4132,7 +4127,7 @@ class j {
4132
4127
  try {
4133
4128
  return j.ok(e.replace(t, o, r));
4134
4129
  } catch (i) {
4135
- if (i instanceof Ma)
4130
+ if (i instanceof Da)
4136
4131
  return j.fail(i.message);
4137
4132
  throw i;
4138
4133
  }
@@ -4427,7 +4422,7 @@ function wn(n, e, t) {
4427
4422
  }
4428
4423
  return !1;
4429
4424
  }
4430
- function La(n, e, t) {
4425
+ function Ba(n, e, t) {
4431
4426
  let o = n.resolve(e);
4432
4427
  if (!t.content.size)
4433
4428
  return e;
@@ -4537,7 +4532,7 @@ class q {
4537
4532
  `$head`.
4538
4533
  */
4539
4534
  constructor(e, t, o) {
4540
- this.$anchor = e, this.$head = t, this.ranges = o || [new Va(e.min(t), e.max(t))];
4535
+ this.$anchor = e, this.$head = t, this.ranges = o || [new La(e.min(t), e.max(t))];
4541
4536
  }
4542
4537
  /**
4543
4538
  The selection's anchor, as an unresolved position.
@@ -4640,7 +4635,7 @@ class q {
4640
4635
  negative, it will search backwards first.
4641
4636
  */
4642
4637
  static near(e, t = 1) {
4643
- return this.findFrom(e, t) || this.findFrom(e, -t) || new Te(e.node(0));
4638
+ return this.findFrom(e, t) || this.findFrom(e, -t) || new Ne(e.node(0));
4644
4639
  }
4645
4640
  /**
4646
4641
  Find the cursor or leaf node selection closest to the start of
@@ -4649,14 +4644,14 @@ class q {
4649
4644
  exists.
4650
4645
  */
4651
4646
  static atStart(e) {
4652
- return at(e, e, 0, 0, 1) || new Te(e);
4647
+ return at(e, e, 0, 0, 1) || new Ne(e);
4653
4648
  }
4654
4649
  /**
4655
4650
  Find the cursor or leaf node selection closest to the end of the
4656
4651
  given document.
4657
4652
  */
4658
4653
  static atEnd(e) {
4659
- return at(e, e, e.content.size, e.childCount, -1) || new Te(e);
4654
+ return at(e, e, e.content.size, e.childCount, -1) || new Ne(e);
4660
4655
  }
4661
4656
  /**
4662
4657
  Deserialize the JSON representation of a selection. Must be
@@ -4695,7 +4690,7 @@ class q {
4695
4690
  }
4696
4691
  }
4697
4692
  q.prototype.visible = !0;
4698
- class Va {
4693
+ class La {
4699
4694
  /**
4700
4695
  Create a range.
4701
4696
  */
@@ -4852,7 +4847,7 @@ class qn {
4852
4847
  return o && T.isSelectable(o) ? new T(t) : q.near(t);
4853
4848
  }
4854
4849
  }
4855
- class Te extends q {
4850
+ class Ne extends q {
4856
4851
  /**
4857
4852
  Create an all-selection over the given document.
4858
4853
  */
@@ -4874,25 +4869,25 @@ class Te extends q {
4874
4869
  @internal
4875
4870
  */
4876
4871
  static fromJSON(e) {
4877
- return new Te(e);
4872
+ return new Ne(e);
4878
4873
  }
4879
4874
  map(e) {
4880
- return new Te(e);
4875
+ return new Ne(e);
4881
4876
  }
4882
4877
  eq(e) {
4883
- return e instanceof Te;
4878
+ return e instanceof Ne;
4884
4879
  }
4885
4880
  getBookmark() {
4886
- return Fa;
4881
+ return Va;
4887
4882
  }
4888
4883
  }
4889
- q.jsonID("all", Te);
4890
- const Fa = {
4884
+ q.jsonID("all", Ne);
4885
+ const Va = {
4891
4886
  map() {
4892
4887
  return this;
4893
4888
  },
4894
4889
  resolve(n) {
4895
- return new Te(n);
4890
+ return new Ne(n);
4896
4891
  }
4897
4892
  };
4898
4893
  function at(n, e, t, o, r, i = !1) {
@@ -4968,7 +4963,7 @@ function Jr(n, e, t) {
4968
4963
  }
4969
4964
  return t;
4970
4965
  }
4971
- class $a {
4966
+ class Fa {
4972
4967
  /**
4973
4968
  Create a plugin.
4974
4969
  */
@@ -4986,7 +4981,7 @@ const mn = /* @__PURE__ */ Object.create(null);
4986
4981
  function Kr(n) {
4987
4982
  return n in mn ? n + "$" + ++mn[n] : (mn[n] = 0, n + "$");
4988
4983
  }
4989
- class Ha {
4984
+ class $a {
4990
4985
  /**
4991
4986
  Create a plugin key.
4992
4987
  */
@@ -5019,18 +5014,18 @@ let Dn = null;
5019
5014
  const Ae = function(n, e, t) {
5020
5015
  let o = Dn || (Dn = document.createRange());
5021
5016
  return o.setEnd(n, t ?? n.nodeValue.length), o.setStart(n, e || 0), o;
5022
- }, qa = function() {
5017
+ }, Ha = function() {
5023
5018
  Dn = null;
5024
5019
  }, tt = function(n, e, t, o) {
5025
5020
  return t && (go(n, e, t, o, -1) || go(n, e, t, o, 1));
5026
- }, Wa = /^(img|br|input|textarea|hr)$/i;
5021
+ }, qa = /^(img|br|input|textarea|hr)$/i;
5027
5022
  function go(n, e, t, o, r) {
5028
5023
  for (; ; ) {
5029
5024
  if (n == t && e == o)
5030
5025
  return !0;
5031
5026
  if (e == (r < 0 ? 0 : pe(n))) {
5032
5027
  let i = n.parentNode;
5033
- if (!i || i.nodeType != 1 || Bt(n) || Wa.test(n.nodeName) || n.contentEditable == "false")
5028
+ if (!i || i.nodeType != 1 || Bt(n) || qa.test(n.nodeName) || n.contentEditable == "false")
5034
5029
  return !1;
5035
5030
  e = Z(n) + (r < 0 ? 0 : 1), n = i;
5036
5031
  } else if (n.nodeType == 1) {
@@ -5044,7 +5039,7 @@ function go(n, e, t, o, r) {
5044
5039
  function pe(n) {
5045
5040
  return n.nodeType == 3 ? n.nodeValue.length : n.childNodes.length;
5046
5041
  }
5047
- function Ja(n, e) {
5042
+ function Wa(n, e) {
5048
5043
  for (; ; ) {
5049
5044
  if (n.nodeType == 3 && e)
5050
5045
  return n;
@@ -5058,7 +5053,7 @@ function Ja(n, e) {
5058
5053
  return null;
5059
5054
  }
5060
5055
  }
5061
- function Ka(n, e) {
5056
+ function Ja(n, e) {
5062
5057
  for (; ; ) {
5063
5058
  if (n.nodeType == 3 && e < n.nodeValue.length)
5064
5059
  return n;
@@ -5072,7 +5067,7 @@ function Ka(n, e) {
5072
5067
  return null;
5073
5068
  }
5074
5069
  }
5075
- function Ua(n, e, t) {
5070
+ function Ka(n, e, t) {
5076
5071
  for (let o = e == 0, r = e == pe(n); o || r; ) {
5077
5072
  if (n == t)
5078
5073
  return !0;
@@ -5095,13 +5090,13 @@ function Ue(n, e) {
5095
5090
  let t = document.createEvent("Event");
5096
5091
  return t.initEvent("keydown", !0, !0), t.keyCode = n, t.key = t.code = e, t;
5097
5092
  }
5098
- function ja(n) {
5093
+ function Ua(n) {
5099
5094
  let e = n.activeElement;
5100
5095
  for (; e && e.shadowRoot; )
5101
5096
  e = e.shadowRoot.activeElement;
5102
5097
  return e;
5103
5098
  }
5104
- function Ya(n, e, t) {
5099
+ function ja(n, e, t) {
5105
5100
  if (n.caretPositionFromPoint)
5106
5101
  try {
5107
5102
  let o = n.caretPositionFromPoint(e, t);
@@ -5115,10 +5110,10 @@ function Ya(n, e, t) {
5115
5110
  return { node: o.startContainer, offset: Math.min(pe(o.startContainer), o.startOffset) };
5116
5111
  }
5117
5112
  }
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);
5113
+ 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
5114
  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) {
5115
+ 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;
5116
+ function Xa(n) {
5122
5117
  let e = n.defaultView && n.defaultView.visualViewport;
5123
5118
  return e ? {
5124
5119
  left: 0,
@@ -5135,7 +5130,7 @@ function _a(n) {
5135
5130
  function Ie(n, e) {
5136
5131
  return typeof n == "number" ? n : n[e];
5137
5132
  }
5138
- function Za(n) {
5133
+ function _a(n) {
5139
5134
  let e = n.getBoundingClientRect(), t = e.width / n.offsetWidth || 1, o = e.height / n.offsetHeight || 1;
5140
5135
  return {
5141
5136
  left: e.left,
@@ -5149,7 +5144,7 @@ function yo(n, e, t) {
5149
5144
  for (let s = t || n.dom; s; s = It(s)) {
5150
5145
  if (s.nodeType != 1)
5151
5146
  continue;
5152
- let l = s, a = l == i.body, c = a ? _a(i) : Za(l), d = 0, u = 0;
5147
+ let l = s, a = l == i.body, c = a ? Xa(i) : _a(l), d = 0, u = 0;
5153
5148
  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
5149
  if (a)
5155
5150
  i.defaultView.scrollBy(d, u);
@@ -5163,7 +5158,7 @@ function yo(n, e, t) {
5163
5158
  break;
5164
5159
  }
5165
5160
  }
5166
- function Qa(n) {
5161
+ function Za(n) {
5167
5162
  let e = n.dom.getBoundingClientRect(), t = Math.max(0, e.top), o, r;
5168
5163
  for (let i = (e.left + e.right) / 2, s = t + 1; s < Math.min(innerHeight, e.bottom); s += 5) {
5169
5164
  let l = n.root.elementFromPoint(i, s);
@@ -5183,7 +5178,7 @@ function Yr(n) {
5183
5178
  ;
5184
5179
  return e;
5185
5180
  }
5186
- function ec({ refDOM: n, refTop: e, stack: t }) {
5181
+ function Qa({ refDOM: n, refTop: e, stack: t }) {
5187
5182
  let o = n ? n.getBoundingClientRect().top : 0;
5188
5183
  Gr(t, o == 0 ? 0 : o - e);
5189
5184
  }
@@ -5194,7 +5189,7 @@ function Gr(n, e) {
5194
5189
  }
5195
5190
  }
5196
5191
  let st = null;
5197
- function tc(n) {
5192
+ function ec(n) {
5198
5193
  if (n.setActive)
5199
5194
  return n.setActive();
5200
5195
  if (st)
@@ -5232,9 +5227,9 @@ function Xr(n, e) {
5232
5227
  !t && (e.left >= p.right && e.top >= p.top || e.left >= p.left && e.top >= p.bottom) && (i = u + 1);
5233
5228
  }
5234
5229
  }
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);
5230
+ 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
5231
  }
5237
- function nc(n, e) {
5232
+ function tc(n, e) {
5238
5233
  let t = n.nodeValue.length, o = document.createRange();
5239
5234
  for (let r = 0; r < t; r++) {
5240
5235
  o.setEnd(n, r + 1), o.setStart(n, r);
@@ -5247,11 +5242,11 @@ function nc(n, e) {
5247
5242
  function Wn(n, e) {
5248
5243
  return n.left >= e.left - 1 && n.left <= e.right + 1 && n.top >= e.top - 1 && n.top <= e.bottom + 1;
5249
5244
  }
5250
- function oc(n, e) {
5245
+ function nc(n, e) {
5251
5246
  let t = n.parentNode;
5252
5247
  return t && /^li$/i.test(t.nodeName) && e.left < n.getBoundingClientRect().left ? t : n;
5253
5248
  }
5254
- function rc(n, e, t) {
5249
+ function oc(n, e, t) {
5255
5250
  let { node: o, offset: r } = Xr(e, t), i = -1;
5256
5251
  if (o.nodeType == 1 && !o.firstChild) {
5257
5252
  let s = o.getBoundingClientRect();
@@ -5259,7 +5254,7 @@ function rc(n, e, t) {
5259
5254
  }
5260
5255
  return n.docView.posFromDOM(o, r, i);
5261
5256
  }
5262
- function ic(n, e, t, o) {
5257
+ function rc(n, e, t, o) {
5263
5258
  let r = -1;
5264
5259
  for (let i = e, s = !1; i != n.dom; ) {
5265
5260
  let l = n.docView.nearestDesc(i, !0), a;
@@ -5290,8 +5285,8 @@ function _r(n, e, t) {
5290
5285
  }
5291
5286
  return n;
5292
5287
  }
5293
- function sc(n, e) {
5294
- let t = n.dom.ownerDocument, o, r = 0, i = Ya(t, e.left, e.top);
5288
+ function ic(n, e) {
5289
+ let t = n.dom.ownerDocument, o, r = 0, i = ja(t, e.left, e.top);
5295
5290
  i && ({ node: o, offset: r } = i);
5296
5291
  let s = (n.root.elementFromPoint ? n.root : t).elementFromPoint(e.left, e.top), l;
5297
5292
  if (!s || !n.dom.contains(s.nodeType != 1 ? s.parentNode : s)) {
@@ -5302,15 +5297,15 @@ function sc(n, e) {
5302
5297
  if (re)
5303
5298
  for (let c = s; o && c; c = It(c))
5304
5299
  c.draggable && (o = void 0);
5305
- if (s = oc(s, e), o) {
5300
+ if (s = nc(s, e), o) {
5306
5301
  if (ke && o.nodeType == 1 && (r = Math.min(r, o.childNodes.length), r < o.childNodes.length)) {
5307
5302
  let d = o.childNodes[r], u;
5308
5303
  d.nodeName == "IMG" && (u = d.getBoundingClientRect()).right <= e.left && u.bottom > e.top && r++;
5309
5304
  }
5310
5305
  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));
5306
+ 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
5307
  }
5313
- l == null && (l = rc(n, s, e));
5308
+ l == null && (l = oc(n, s, e));
5314
5309
  let a = n.docView.nearestDesc(s, !0);
5315
5310
  return { pos: l, inside: a ? a.posAtStart - a.border : -1 };
5316
5311
  }
@@ -5326,11 +5321,11 @@ function Be(n, e) {
5326
5321
  }
5327
5322
  return Array.prototype.find.call(t, ko) || n.getBoundingClientRect();
5328
5323
  }
5329
- const lc = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5324
+ const sc = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
5330
5325
  function Zr(n, e, t) {
5331
5326
  let { node: o, offset: r, atom: i } = n.docView.domFromPos(e, t < 0 ? -1 : 1), s = Lt || ke;
5332
5327
  if (o.nodeType == 3)
5333
- if (s && (lc.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
5328
+ if (s && (sc.test(o.nodeValue) || (t < 0 ? !r : r == o.nodeValue.length))) {
5334
5329
  let a = Be(Ae(o, r, r), t);
5335
5330
  if (ke && r && /\s/.test(o.nodeValue[r - 1]) && r < o.nodeValue.length) {
5336
5331
  let c = Be(Ae(o, r - 1, r - 1), -1);
@@ -5394,7 +5389,7 @@ function Qr(n, e, t) {
5394
5389
  o != e && n.updateState(o), r != n.dom && r && r.focus();
5395
5390
  }
5396
5391
  }
5397
- function ac(n, e, t) {
5392
+ function lc(n, e, t) {
5398
5393
  let o = e.selection, r = t == "up" ? o.$from : o.$to;
5399
5394
  return Qr(n, e, () => {
5400
5395
  let { node: i } = n.docView.domFromPos(r.pos, t == "up" ? -1 : 1);
@@ -5426,13 +5421,13 @@ function ac(n, e, t) {
5426
5421
  return !0;
5427
5422
  });
5428
5423
  }
5429
- const cc = /[\u0590-\u08ac]/;
5430
- function dc(n, e, t) {
5424
+ const ac = /[\u0590-\u08ac]/;
5425
+ function cc(n, e, t) {
5431
5426
  let { $head: o } = e.selection;
5432
5427
  if (!o.parent.isTextblock)
5433
5428
  return !1;
5434
5429
  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, () => {
5430
+ return l ? !ac.test(o.parent.textContent) || !l.modify ? t == "left" || t == "backward" ? i : s : Qr(n, e, () => {
5436
5431
  let { focusNode: a, focusOffset: c, anchorNode: d, anchorOffset: u } = n.domSelectionRange(), f = l.caretBidiLevel;
5437
5432
  l.modify("move", t, "character");
5438
5433
  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 +5439,10 @@ function dc(n, e, t) {
5444
5439
  }) : o.pos == o.start() || o.pos == o.end();
5445
5440
  }
5446
5441
  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));
5442
+ function dc(n, e, t) {
5443
+ return xo == e && Co == t ? So : (xo = e, Co = t, So = t == "up" || t == "down" ? lc(n, e, t) : cc(n, e, t));
5449
5444
  }
5450
- const ge = 0, No = 1, Xe = 2, Me = 3;
5445
+ const ge = 0, No = 1, Xe = 2, De = 3;
5451
5446
  class Vt {
5452
5447
  constructor(e, t, o, r) {
5453
5448
  this.parent = e, this.children = t, this.dom = o, this.contentDOM = r, this.dirty = ge, o.pmViewDesc = this;
@@ -5763,10 +5758,10 @@ class Vt {
5763
5758
  if (o == s ? e <= s && t >= o : e < s && t > o) {
5764
5759
  let l = o + i.border, a = s - i.border;
5765
5760
  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);
5761
+ 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
5762
  return;
5768
5763
  } else
5769
- i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe : Me;
5764
+ i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? Xe : De;
5770
5765
  }
5771
5766
  o = s;
5772
5767
  }
@@ -5829,7 +5824,7 @@ class ei extends Vt {
5829
5824
  return this.widget.type.side;
5830
5825
  }
5831
5826
  }
5832
- class hc extends Vt {
5827
+ class uc extends Vt {
5833
5828
  constructor(e, t, o, r) {
5834
5829
  super(e, [], t, null), this.textDOM = o, this.text = r;
5835
5830
  }
@@ -5855,10 +5850,10 @@ class nt extends Vt {
5855
5850
  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
5851
  }
5857
5852
  parseRule() {
5858
- return this.dirty & Me || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
5853
+ return this.dirty & De || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
5859
5854
  }
5860
5855
  matchesMark(e) {
5861
- return this.dirty != Me && this.mark.eq(e);
5856
+ return this.dirty != De && this.mark.eq(e);
5862
5857
  }
5863
5858
  markDirty(e, t) {
5864
5859
  if (super.markDirty(e, t), this.dirty != ge) {
@@ -5910,7 +5905,7 @@ class qe extends Vt {
5910
5905
  } else d || ({ dom: d, contentDOM: u } = yt.renderSpec(document, t.type.spec.toDOM(t), null, t.attrs));
5911
5906
  !u && !t.isText && d.nodeName != "BR" && (d.hasAttribute("contenteditable") || (d.contentEditable = "false"), t.type.spec.draggable && (d.draggable = !0));
5912
5907
  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);
5908
+ 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
5909
  }
5915
5910
  parseRule() {
5916
5911
  if (this.node.type.spec.reparseInView)
@@ -5946,14 +5941,14 @@ class qe extends Vt {
5946
5941
  // separate step, syncs the DOM inside `this.contentDOM` to
5947
5942
  // `this.children`.
5948
5943
  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) => {
5944
+ 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);
5945
+ bc(this.node, this.innerDeco, (c, d, u) => {
5951
5946
  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
5947
  }, (c, d, u, f) => {
5953
5948
  a.syncToMarks(c.marks, o, e);
5954
5949
  let m;
5955
5950
  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));
5951
+ }), 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
5952
  }
5958
5953
  localCompositionInfo(e, t) {
5959
5954
  let { from: o, to: r } = e.state.selection;
@@ -5963,7 +5958,7 @@ class qe extends Vt {
5963
5958
  if (!i || !this.dom.contains(i.parentNode))
5964
5959
  return null;
5965
5960
  if (this.node.inlineContent) {
5966
- let s = i.nodeValue, l = xc(this.node.content, s, o - t, r - t);
5961
+ let s = i.nodeValue, l = kc(this.node.content, s, o - t, r - t);
5967
5962
  return l < 0 ? null : { node: i, pos: l, text: s };
5968
5963
  } else
5969
5964
  return { node: i, pos: -1, text: "" };
@@ -5979,13 +5974,13 @@ class qe extends Vt {
5979
5974
  i.parentNode.removeChild(i.nextSibling);
5980
5975
  i.pmViewDesc && (i.pmViewDesc = void 0);
5981
5976
  }
5982
- let s = new hc(this, i, t, r);
5977
+ let s = new uc(this, i, t, r);
5983
5978
  e.input.compositionNodes.push(s), this.children = An(this.children, o, o + r.length, e, s);
5984
5979
  }
5985
5980
  // If this desc must be updated to match the given node decoration,
5986
5981
  // do so and return true.
5987
5982
  update(e, t, o, r) {
5988
- return this.dirty == Me || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, o, r), !0);
5983
+ return this.dirty == De || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, t, o, r), !0);
5989
5984
  }
5990
5985
  updateInner(e, t, o, r) {
5991
5986
  this.updateOuterDeco(t), this.node = e, this.innerDeco = o, this.contentDOM && this.updateChildren(r, this.posAtStart), this.dirty = ge;
@@ -6024,7 +6019,7 @@ class rn extends qe {
6024
6019
  return { skip: e || !0 };
6025
6020
  }
6026
6021
  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);
6022
+ 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
6023
  }
6029
6024
  inParent() {
6030
6025
  let e = this.parent.contentDOM;
@@ -6047,7 +6042,7 @@ class rn extends qe {
6047
6042
  return new rn(this.parent, r, this.outerDeco, this.innerDeco, i, i, o);
6048
6043
  }
6049
6044
  markDirty(e, t) {
6050
- super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = Me);
6045
+ super.markDirty(e, t), this.dom != this.nodeDOM && (e == 0 || t == this.nodeDOM.nodeValue.length) && (this.dirty = De);
6051
6046
  }
6052
6047
  get domAtom() {
6053
6048
  return !1;
@@ -6070,7 +6065,7 @@ class ti extends Vt {
6070
6065
  return this.dom.nodeName == "IMG";
6071
6066
  }
6072
6067
  }
6073
- class fc extends qe {
6068
+ class hc extends qe {
6074
6069
  constructor(e, t, o, r, i, s, l, a, c, d) {
6075
6070
  super(e, t, o, r, i, s, l, c, d), this.spec = a;
6076
6071
  }
@@ -6078,7 +6073,7 @@ class fc extends qe {
6078
6073
  // through. If it does, and there's a `contentDOM` node, our logic
6079
6074
  // updates the children.
6080
6075
  update(e, t, o, r) {
6081
- if (this.dirty == Me)
6076
+ if (this.dirty == De)
6082
6077
  return !1;
6083
6078
  if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
6084
6079
  let i = this.spec.update(e, t, o);
@@ -6154,11 +6149,11 @@ function oi(n, e, t, o) {
6154
6149
  let a;
6155
6150
  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
6151
  }
6157
- pc(r, l || _e[0], s);
6152
+ fc(r, l || _e[0], s);
6158
6153
  }
6159
6154
  return r;
6160
6155
  }
6161
- function pc(n, e, t) {
6156
+ function fc(n, e, t) {
6162
6157
  for (let o in e)
6163
6158
  o != "class" && o != "style" && o != "nodeName" && !(o in t) && n.removeAttribute(o);
6164
6159
  for (let o in t)
@@ -6195,9 +6190,9 @@ function wo(n) {
6195
6190
  let e = n.nextSibling;
6196
6191
  return n.parentNode.removeChild(n), e;
6197
6192
  }
6198
- class mc {
6193
+ class pc {
6199
6194
  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);
6195
+ 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
6196
  }
6202
6197
  // Destroy and remove the children between the given indices in
6203
6198
  // `this.top`.
@@ -6257,7 +6252,7 @@ class mc {
6257
6252
  }
6258
6253
  updateNodeAt(e, t, o, r, i) {
6259
6254
  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;
6255
+ 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
6256
  }
6262
6257
  findIndexWithChild(e) {
6263
6258
  for (; ; ) {
@@ -6285,7 +6280,7 @@ class mc {
6285
6280
  let c = this.preMatch.matched.get(a);
6286
6281
  if (c != null && c != i)
6287
6282
  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));
6283
+ 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
6284
  if (!f && a.update(e, t, o, r))
6290
6285
  return this.destroyBetween(this.index, l), a.dom != d && (this.changed = !0), this.index++, !0;
6291
6286
  if (!f && (u = this.recreateWrapper(a, e, t, o, r, s)))
@@ -6345,7 +6340,7 @@ class mc {
6345
6340
  return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
6346
6341
  }
6347
6342
  }
6348
- function gc(n, e) {
6343
+ function mc(n, e) {
6349
6344
  let t = e, o = t.children.length, r = n.childCount, i = /* @__PURE__ */ new Map(), s = [];
6350
6345
  e: for (; r > 0; ) {
6351
6346
  let l;
@@ -6372,10 +6367,10 @@ function gc(n, e) {
6372
6367
  }
6373
6368
  return { index: r, matched: i, matches: s.reverse() };
6374
6369
  }
6375
- function bc(n, e) {
6370
+ function gc(n, e) {
6376
6371
  return n.type.side - e.type.side;
6377
6372
  }
6378
- function yc(n, e, t, o) {
6373
+ function bc(n, e, t, o) {
6379
6374
  let r = e.locals(n), i = 0;
6380
6375
  if (r.length == 0) {
6381
6376
  for (let c = 0; c < n.childCount; c++) {
@@ -6393,7 +6388,7 @@ function yc(n, e, t, o) {
6393
6388
  }
6394
6389
  if (d)
6395
6390
  if (u) {
6396
- u.sort(bc);
6391
+ u.sort(gc);
6397
6392
  for (let g = 0; g < u.length; g++)
6398
6393
  t(u[g], c, !!a);
6399
6394
  } else
@@ -6423,13 +6418,13 @@ function yc(n, e, t, o) {
6423
6418
  o(f, b, e.forChild(i, f), m), i = p;
6424
6419
  }
6425
6420
  }
6426
- function kc(n) {
6421
+ function yc(n) {
6427
6422
  if (n.nodeName == "UL" || n.nodeName == "OL") {
6428
6423
  let e = n.style.cssText;
6429
6424
  n.style.cssText = e + "; list-style: square !important", window.getComputedStyle(n).listStyle, n.style.cssText = e;
6430
6425
  }
6431
6426
  }
6432
- function xc(n, e, t, o) {
6427
+ function kc(n, e, t, o) {
6433
6428
  for (let r = 0, i = 0; r < n.childCount && i <= o; ) {
6434
6429
  let s = n.child(r++), l = i;
6435
6430
  if (i += s.nodeSize, !s.isText)
@@ -6473,7 +6468,7 @@ function Jn(n, e = null) {
6473
6468
  for (a = s; r && !r.node; )
6474
6469
  r = r.parent;
6475
6470
  let u = r.node;
6476
- if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline && Ua(t.focusNode, t.focusOffset, r.dom))) {
6471
+ if (r && u.isAtom && T.isSelectable(u) && r.parent && !(u.isInline && Ka(t.focusNode, t.focusOffset, r.dom))) {
6477
6472
  let f = r.posBefore;
6478
6473
  c = new T(s == f ? l : o.resolve(f));
6479
6474
  }
@@ -6513,10 +6508,10 @@ function Pe(n, e = !1) {
6513
6508
  }
6514
6509
  }
6515
6510
  if (n.domObserver.disconnectSelection(), n.cursorWrapper)
6516
- Sc(n);
6511
+ Cc(n);
6517
6512
  else {
6518
6513
  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));
6514
+ 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
6515
  }
6521
6516
  n.domObserver.setCurSelection(), n.domObserver.connectSelection();
6522
6517
  }
@@ -6539,7 +6534,7 @@ function bn(n) {
6539
6534
  function Oo(n) {
6540
6535
  n.contentEditable = "false", n.wasDraggable && (n.draggable = !0, n.wasDraggable = null);
6541
6536
  }
6542
- function Cc(n) {
6537
+ function xc(n) {
6543
6538
  let e = n.dom.ownerDocument;
6544
6539
  e.removeEventListener("selectionchange", n.input.hideSelectionGuard);
6545
6540
  let t = n.domSelectionRange(), o = t.anchorNode, r = t.anchorOffset;
@@ -6549,7 +6544,7 @@ function Cc(n) {
6549
6544
  }, 20));
6550
6545
  });
6551
6546
  }
6552
- function Sc(n) {
6547
+ function Cc(n) {
6553
6548
  let e = n.domSelection(), t = document.createRange();
6554
6549
  if (!e)
6555
6550
  return;
@@ -6582,7 +6577,7 @@ function li(n) {
6582
6577
  return !1;
6583
6578
  }
6584
6579
  }
6585
- function Nc(n) {
6580
+ function Sc(n) {
6586
6581
  let e = n.docView.domFromPos(n.state.selection.anchor, 0), t = n.domSelectionRange();
6587
6582
  return tt(e.node, e.offset, t.anchorNode, t.anchorOffset);
6588
6583
  }
@@ -6631,9 +6626,9 @@ function Nt(n, e) {
6631
6626
  return t && t.size == 0 && (e < 0 || n.nextSibling || n.nodeName != "BR");
6632
6627
  }
6633
6628
  function lt(n, e) {
6634
- return e < 0 ? Tc(n) : wc(n);
6629
+ return e < 0 ? Nc(n) : Tc(n);
6635
6630
  }
6636
- function Tc(n) {
6631
+ function Nc(n) {
6637
6632
  let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
6638
6633
  if (!t)
6639
6634
  return;
@@ -6669,7 +6664,7 @@ function Tc(n) {
6669
6664
  }
6670
6665
  s ? Rn(n, t, o) : r && Rn(n, r, i);
6671
6666
  }
6672
- function wc(n) {
6667
+ function Tc(n) {
6673
6668
  let e = n.domSelectionRange(), t = e.focusNode, o = e.focusOffset;
6674
6669
  if (!t)
6675
6670
  return;
@@ -6705,7 +6700,7 @@ function ai(n) {
6705
6700
  let e = n.pmViewDesc;
6706
6701
  return e && e.node && e.node.isBlock;
6707
6702
  }
6708
- function Dc(n, e) {
6703
+ function wc(n, e) {
6709
6704
  for (; n && e == n.childNodes.length && !Bt(n); )
6710
6705
  e = Z(n) + 1, n = n.parentNode;
6711
6706
  for (; n && e < n.childNodes.length; ) {
@@ -6717,7 +6712,7 @@ function Dc(n, e) {
6717
6712
  n = t, e = 0;
6718
6713
  }
6719
6714
  }
6720
- function Mc(n, e) {
6715
+ function Dc(n, e) {
6721
6716
  for (; n && !e && !Bt(n); )
6722
6717
  e = Z(n), n = n.parentNode;
6723
6718
  for (; n && e; ) {
@@ -6732,7 +6727,7 @@ function Mc(n, e) {
6732
6727
  function Rn(n, e, t) {
6733
6728
  if (e.nodeType != 3) {
6734
6729
  let i, s;
6735
- (s = Dc(e, t)) ? (e = s, t = 0) : (i = Mc(e, t)) && (e = i, t = i.nodeValue.length);
6730
+ (s = wc(e, t)) ? (e = s, t = 0) : (i = Dc(e, t)) && (e = i, t = i.nodeValue.length);
6736
6731
  }
6737
6732
  let o = n.domSelection();
6738
6733
  if (!o)
@@ -6749,7 +6744,7 @@ function Rn(n, e, t) {
6749
6744
  }
6750
6745
  function Eo(n, e) {
6751
6746
  let t = n.state.doc.resolve(e);
6752
- if (!(te || Ga) && t.parent.inlineContent) {
6747
+ if (!(te || Ya) && t.parent.inlineContent) {
6753
6748
  let r = n.coordsAtPos(e);
6754
6749
  if (e > t.start()) {
6755
6750
  let i = n.coordsAtPos(e - 1), s = (i.top + i.bottom) / 2;
@@ -6775,7 +6770,7 @@ function Ro(n, e, t) {
6775
6770
  return Le(n, s);
6776
6771
  }
6777
6772
  if (!r.parent.inlineContent) {
6778
- let s = e < 0 ? r : i, l = o instanceof Te ? q.near(s, e) : q.findFrom(s, e);
6773
+ let s = e < 0 ? r : i, l = o instanceof Ne ? q.near(s, e) : q.findFrom(s, e);
6779
6774
  return l ? Le(n, l) : !1;
6780
6775
  }
6781
6776
  return !1;
@@ -6800,7 +6795,7 @@ function Po(n, e) {
6800
6795
  function zo(n, e, t) {
6801
6796
  n.domObserver.stop(), e.contentEditable = t, n.domObserver.start();
6802
6797
  }
6803
- function Oc(n) {
6798
+ function Mc(n) {
6804
6799
  if (!re || n.state.selection.$head.parentOffset > 0)
6805
6800
  return !1;
6806
6801
  let { focusNode: e, focusOffset: t } = n.domSelectionRange();
@@ -6810,12 +6805,12 @@ function Oc(n) {
6810
6805
  }
6811
6806
  return !1;
6812
6807
  }
6813
- function vc(n) {
6808
+ function Oc(n) {
6814
6809
  let e = "";
6815
6810
  return n.ctrlKey && (e += "c"), n.metaKey && (e += "m"), n.altKey && (e += "a"), n.shiftKey && (e += "s"), e;
6816
6811
  }
6817
- function Ic(n, e) {
6818
- let t = e.keyCode, o = vc(e);
6812
+ function vc(n, e) {
6813
+ let t = e.keyCode, o = Oc(e);
6819
6814
  if (t == 8 || fe && t == 72 && o == "c")
6820
6815
  return Po(n, -1) || lt(n, -1);
6821
6816
  if (t == 46 && !e.shiftKey || fe && t == 68 && o == "c")
@@ -6832,7 +6827,7 @@ function Ic(n, e) {
6832
6827
  if (t == 38 || fe && t == 80 && o == "c")
6833
6828
  return Ro(n, -1, o) || lt(n, -1);
6834
6829
  if (t == 40 || fe && t == 78 && o == "c")
6835
- return Oc(n) || Ro(n, 1, o) || lt(n, 1);
6830
+ return Mc(n) || Ro(n, 1, o) || lt(n, 1);
6836
6831
  if (o == (fe ? "m" : "c") && (t == 66 || t == 73 || t == 89 || t == 90))
6837
6832
  return !0;
6838
6833
  }
@@ -6890,7 +6885,7 @@ function jn(n, e, t, o, r) {
6890
6885
  } else
6891
6886
  n.someProp("transformPastedHTML", (u) => {
6892
6887
  t = u(t, n);
6893
- }), s = Pc(t), Lt && zc(s);
6888
+ }), s = Rc(t), Lt && Pc(s);
6894
6889
  let c = s && s.querySelector("[data-pm-slice]"), d = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
6895
6890
  if (d && d[3])
6896
6891
  for (let u = +d[3]; u > 0; u--) {
@@ -6905,11 +6900,11 @@ function jn(n, e, t, o, r) {
6905
6900
  preserveWhitespace: !!(a || d),
6906
6901
  context: r,
6907
6902
  ruleFromNode(f) {
6908
- return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Ac.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
6903
+ return f.nodeName == "BR" && !f.nextSibling && f.parentNode && !Ic.test(f.parentNode.nodeName) ? { ignore: !0 } : null;
6909
6904
  }
6910
6905
  })), 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) {
6906
+ l = zc(Bo(l, +d[1], +d[2]), d[4]);
6907
+ else if (l = E.maxOpen(Ac(l.content, r), !0), l.openStart || l.openEnd) {
6913
6908
  let u = 0, f = 0;
6914
6909
  for (let m = l.content.firstChild; u < l.openStart && !m.type.spec.isolating; u++, m = m.firstChild)
6915
6910
  ;
@@ -6921,8 +6916,8 @@ function jn(n, e, t, o, r) {
6921
6916
  l = u(l, n);
6922
6917
  }), l;
6923
6918
  }
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) {
6919
+ 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;
6920
+ function Ac(n, e) {
6926
6921
  if (n.childCount < 2)
6927
6922
  return n;
6928
6923
  for (let t = e.depth; t >= 0; t--) {
@@ -6988,27 +6983,27 @@ function fi() {
6988
6983
  return Lo || (Lo = document.implementation.createHTMLDocument("title"));
6989
6984
  }
6990
6985
  let yn = null;
6991
- function Rc(n) {
6986
+ function Ec(n) {
6992
6987
  let e = window.trustedTypes;
6993
6988
  return e ? (yn || (yn = e.createPolicy("ProseMirrorClipboard", { createHTML: (t) => t })), yn.createHTML(n)) : n;
6994
6989
  }
6995
- function Pc(n) {
6990
+ function Rc(n) {
6996
6991
  let e = /^(\s*<meta [^>]*>)*/.exec(n);
6997
6992
  e && (n = n.slice(e[0].length));
6998
6993
  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)
6994
+ 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
6995
  for (let i = 0; i < r.length; i++)
7001
6996
  t = t.querySelector(r[i]) || t;
7002
6997
  return t;
7003
6998
  }
7004
- function zc(n) {
6999
+ function Pc(n) {
7005
7000
  let e = n.querySelectorAll(te ? "span:not([class]):not([style])" : "span.Apple-converted-space");
7006
7001
  for (let t = 0; t < e.length; t++) {
7007
7002
  let o = e[t];
7008
7003
  o.childNodes.length == 1 && o.textContent == " " && o.parentNode && o.parentNode.replaceChild(n.ownerDocument.createTextNode(" "), o);
7009
7004
  }
7010
7005
  }
7011
- function Bc(n, e) {
7006
+ function zc(n, e) {
7012
7007
  if (!n.size)
7013
7008
  return n;
7014
7009
  let t = n.content.firstChild.type.schema, o;
@@ -7026,25 +7021,25 @@ function Bc(n, e) {
7026
7021
  }
7027
7022
  return new E(r, i, s);
7028
7023
  }
7029
- const ie = {}, se = {}, Lc = { touchstart: !0, touchmove: !0 };
7030
- class Vc {
7024
+ const ie = {}, se = {}, Bc = { touchstart: !0, touchmove: !0 };
7025
+ class Lc {
7031
7026
  constructor() {
7032
7027
  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
7028
  }
7034
7029
  }
7035
- function Fc(n) {
7030
+ function Vc(n) {
7036
7031
  for (let e in ie) {
7037
7032
  let t = ie[e];
7038
7033
  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);
7034
+ $c(n, o) && !Yn(n, o) && (n.editable || !(o.type in se)) && t(n, o);
7035
+ }, Bc[e] ? { passive: !0 } : void 0);
7041
7036
  }
7042
7037
  re && n.dom.addEventListener("input", () => null), zn(n);
7043
7038
  }
7044
7039
  function Fe(n, e) {
7045
7040
  n.input.lastSelectionOrigin = e, n.input.lastSelectionTime = Date.now();
7046
7041
  }
7047
- function $c(n) {
7042
+ function Fc(n) {
7048
7043
  n.domObserver.stop();
7049
7044
  for (let e in n.input.eventHandlers)
7050
7045
  n.dom.removeEventListener(e, n.input.eventHandlers[e]);
@@ -7062,7 +7057,7 @@ function Yn(n, e) {
7062
7057
  return o ? o(n, e) || e.defaultPrevented : !1;
7063
7058
  });
7064
7059
  }
7065
- function Hc(n, e) {
7060
+ function $c(n, e) {
7066
7061
  if (!e.bubbles)
7067
7062
  return !0;
7068
7063
  if (e.defaultPrevented)
@@ -7072,7 +7067,7 @@ function Hc(n, e) {
7072
7067
  return !1;
7073
7068
  return !0;
7074
7069
  }
7075
- function qc(n, e) {
7070
+ function Hc(n, e) {
7076
7071
  !Yn(n, e) && ie[e.type] && (n.editable || !(e.type in se)) && ie[e.type](n, e);
7077
7072
  }
7078
7073
  se.keydown = (n, e) => {
@@ -7083,7 +7078,7 @@ se.keydown = (n, e) => {
7083
7078
  n.input.lastIOSEnter = o, n.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
7084
7079
  n.input.lastIOSEnter == o && (n.someProp("handleKeyDown", (r) => r(n, Ue(13, "Enter"))), n.input.lastIOSEnter = 0);
7085
7080
  }, 200);
7086
- } else n.someProp("handleKeyDown", (o) => o(n, t)) || Ic(n, t) ? t.preventDefault() : Fe(n, "key");
7081
+ } else n.someProp("handleKeyDown", (o) => o(n, t)) || vc(n, t) ? t.preventDefault() : Fe(n, "key");
7087
7082
  };
7088
7083
  se.keyup = (n, e) => {
7089
7084
  e.keyCode == 16 && (n.input.shiftKey = !1);
@@ -7105,7 +7100,7 @@ se.keypress = (n, e) => {
7105
7100
  function sn(n) {
7106
7101
  return { left: n.clientX, top: n.clientY };
7107
7102
  }
7108
- function Wc(n, e) {
7103
+ function qc(n, e) {
7109
7104
  let t = e.x - n.clientX, o = e.y - n.clientY;
7110
7105
  return t * t + o * o < 100;
7111
7106
  }
@@ -7124,13 +7119,13 @@ function ht(n, e, t) {
7124
7119
  let o = n.state.tr.setSelection(e);
7125
7120
  o.setMeta("pointer", !0), n.dispatch(o);
7126
7121
  }
7127
- function Jc(n, e) {
7122
+ function Wc(n, e) {
7128
7123
  if (e == -1)
7129
7124
  return !1;
7130
7125
  let t = n.state.doc.resolve(e), o = t.nodeAfter;
7131
7126
  return o && o.isAtom && T.isSelectable(o) ? (ht(n, new T(t)), !0) : !1;
7132
7127
  }
7133
- function Kc(n, e) {
7128
+ function Jc(n, e) {
7134
7129
  if (e == -1)
7135
7130
  return !1;
7136
7131
  let t = n.state.selection, o, r;
@@ -7145,16 +7140,16 @@ function Kc(n, e) {
7145
7140
  }
7146
7141
  return r != null ? (ht(n, T.create(n.state.doc, r)), !0) : !1;
7147
7142
  }
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));
7143
+ function Kc(n, e, t, o, r) {
7144
+ return Gn(n, "handleClickOn", e, t, o) || n.someProp("handleClick", (i) => i(n, e, o)) || (r ? Jc(n, t) : Wc(n, t));
7150
7145
  }
7151
- function jc(n, e, t, o) {
7146
+ function Uc(n, e, t, o) {
7152
7147
  return Gn(n, "handleDoubleClickOn", e, t, o) || n.someProp("handleDoubleClick", (r) => r(n, e, o));
7153
7148
  }
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);
7149
+ function jc(n, e, t, o) {
7150
+ return Gn(n, "handleTripleClickOn", e, t, o) || n.someProp("handleTripleClick", (r) => r(n, e, o)) || Yc(n, t, o);
7156
7151
  }
7157
- function Gc(n, e, t) {
7152
+ function Yc(n, e, t) {
7158
7153
  if (t.button != 0)
7159
7154
  return !1;
7160
7155
  let o = n.state.doc;
@@ -7180,11 +7175,11 @@ ie.mousedown = (n, e) => {
7180
7175
  let t = e;
7181
7176
  n.input.shiftKey = t.shiftKey;
7182
7177
  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 };
7178
+ 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
7179
  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"));
7180
+ 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
7181
  };
7187
- class Xc {
7182
+ class Gc {
7188
7183
  constructor(e, t, o, r) {
7189
7184
  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
7185
  let i, s;
@@ -7213,7 +7208,7 @@ class Xc {
7213
7208
  if (this.done(), !this.view.dom.contains(e.target))
7214
7209
  return;
7215
7210
  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
7211
+ 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
7212
  re && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
7218
7213
  // cursor, but still report that the node is selected
7219
7214
  // when asked through getSelection. You'll then get a
@@ -7240,7 +7235,7 @@ ie.contextmenu = (n) => Xn(n);
7240
7235
  function mi(n, e) {
7241
7236
  return n.composing ? !0 : re && Math.abs(e.timeStamp - n.input.compositionEndedAt) < 500 ? (n.input.compositionEndedAt = -2e8, !0) : !1;
7242
7237
  }
7243
- const _c = Re ? 5e3 : -1;
7238
+ const Xc = Re ? 5e3 : -1;
7244
7239
  se.compositionstart = se.compositionupdate = (n) => {
7245
7240
  if (!n.composing) {
7246
7241
  n.domObserver.flush();
@@ -7263,7 +7258,7 @@ se.compositionstart = se.compositionupdate = (n) => {
7263
7258
  }
7264
7259
  n.input.composing = !0;
7265
7260
  }
7266
- gi(n, _c);
7261
+ gi(n, Xc);
7267
7262
  };
7268
7263
  se.compositionend = (n, e) => {
7269
7264
  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 +7267,14 @@ function gi(n, e) {
7272
7267
  clearTimeout(n.input.composingTimeout), e > -1 && (n.input.composingTimeout = setTimeout(() => At(n), e));
7273
7268
  }
7274
7269
  function bi(n) {
7275
- for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Qc()); n.input.compositionNodes.length > 0; )
7270
+ for (n.composing && (n.input.composing = !1, n.input.compositionEndedAt = Zc()); n.input.compositionNodes.length > 0; )
7276
7271
  n.input.compositionNodes.pop().markParentsDirty();
7277
7272
  }
7278
- function Zc(n) {
7273
+ function _c(n) {
7279
7274
  let e = n.domSelectionRange();
7280
7275
  if (!e.focusNode)
7281
7276
  return null;
7282
- let t = Ja(e.focusNode, e.focusOffset), o = Ka(e.focusNode, e.focusOffset);
7277
+ let t = Wa(e.focusNode, e.focusOffset), o = Ja(e.focusNode, e.focusOffset);
7283
7278
  if (t && o && t != o) {
7284
7279
  let r = o.pmViewDesc, i = n.domObserver.lastChangedTextNode;
7285
7280
  if (t == i || o == i)
@@ -7294,7 +7289,7 @@ function Zc(n) {
7294
7289
  }
7295
7290
  return t || o;
7296
7291
  }
7297
- function Qc() {
7292
+ function Zc() {
7298
7293
  let n = document.createEvent("Event");
7299
7294
  return n.initEvent("event", !0, !0), n.timeStamp;
7300
7295
  }
@@ -7307,7 +7302,7 @@ function At(n, e = !1) {
7307
7302
  return !1;
7308
7303
  }
7309
7304
  }
7310
- function ed(n, e) {
7305
+ function Qc(n, e) {
7311
7306
  if (!n.dom.parentNode)
7312
7307
  return;
7313
7308
  let t = n.dom.parentNode.appendChild(document.createElement("div"));
@@ -7317,18 +7312,18 @@ function ed(n, e) {
7317
7312
  t.parentNode && t.parentNode.removeChild(t), n.focus();
7318
7313
  }, 50);
7319
7314
  }
7320
- const Et = ae && He < 15 || gt && Xa < 604;
7315
+ const Et = ae && He < 15 || gt && Ga < 604;
7321
7316
  ie.copy = se.cut = (n, e) => {
7322
7317
  let t = e, o = n.state.selection, r = t.type == "cut";
7323
7318
  if (o.empty)
7324
7319
  return;
7325
7320
  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"));
7321
+ 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
7322
  };
7328
- function td(n) {
7323
+ function ed(n) {
7329
7324
  return n.openStart == 0 && n.openEnd == 0 && n.content.childCount == 1 ? n.content.firstChild : null;
7330
7325
  }
7331
- function nd(n, e) {
7326
+ function td(n, e) {
7332
7327
  if (!n.dom.parentNode)
7333
7328
  return;
7334
7329
  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 +7339,7 @@ function Rt(n, e, t, o, r) {
7344
7339
  return !0;
7345
7340
  if (!i)
7346
7341
  return !1;
7347
- let s = td(i), l = s ? n.state.tr.replaceSelectionWith(s, o) : n.state.tr.replaceSelection(i);
7342
+ let s = ed(i), l = s ? n.state.tr.replaceSelectionWith(s, o) : n.state.tr.replaceSelection(i);
7348
7343
  return n.dispatch(l.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
7349
7344
  }
7350
7345
  function yi(n) {
@@ -7359,7 +7354,7 @@ se.paste = (n, e) => {
7359
7354
  if (n.composing && !Re)
7360
7355
  return;
7361
7356
  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);
7357
+ o && Rt(n, yi(o), o.getData("text/html"), r, t) ? t.preventDefault() : td(n, t);
7363
7358
  };
7364
7359
  class ki {
7365
7360
  constructor(e, t, o) {
@@ -7409,7 +7404,7 @@ se.drop = (n, e) => {
7409
7404
  if (!s)
7410
7405
  return;
7411
7406
  t.preventDefault();
7412
- let a = s ? La(n.state.doc, i.pos, s) : i.pos;
7407
+ let a = s ? Ba(n.state.doc, i.pos, s) : i.pos;
7413
7408
  a == null && (a = i.pos);
7414
7409
  let c = n.state.tr;
7415
7410
  if (l) {
@@ -7647,7 +7642,7 @@ class G {
7647
7642
  let a = this.local[l].map(e, o, r);
7648
7643
  a && a.type.valid(t, a) ? (s || (s = [])).push(a) : i.onRemove && i.onRemove(this.local[l].spec);
7649
7644
  }
7650
- return this.children.length ? od(this.children, s || [], e, t, o, r, i) : s ? new G(s.sort(et), ct) : ee;
7645
+ return this.children.length ? nd(this.children, s || [], e, t, o, r, i) : s ? new G(s.sort(et), ct) : ee;
7651
7646
  }
7652
7647
  /**
7653
7648
  Add the given array of decorations to the ones in the set,
@@ -7825,7 +7820,7 @@ class Ve {
7825
7820
  this.members[t].forEachSet(e);
7826
7821
  }
7827
7822
  }
7828
- function od(n, e, t, o, r, i, s) {
7823
+ function nd(n, e, t, o, r, i, s) {
7829
7824
  let l = n.slice();
7830
7825
  for (let c = 0, d = i; c < t.maps.length; c++) {
7831
7826
  let u = 0;
@@ -7861,7 +7856,7 @@ function od(n, e, t, o, r, i, s) {
7861
7856
  a = !0;
7862
7857
  }
7863
7858
  if (a) {
7864
- let c = rd(l, n, e, t, r, i, s), d = tn(c, o, 0, s);
7859
+ let c = od(l, n, e, t, r, i, s), d = tn(c, o, 0, s);
7865
7860
  e = d.local;
7866
7861
  for (let u = 0; u < l.length; u += 3)
7867
7862
  l[u + 1] < 0 && (l.splice(u, 3), u -= 3);
@@ -7884,7 +7879,7 @@ function Ci(n, e) {
7884
7879
  }
7885
7880
  return t;
7886
7881
  }
7887
- function rd(n, e, t, o, r, i, s) {
7882
+ function od(n, e, t, o, r, i, s) {
7888
7883
  function l(a, c) {
7889
7884
  for (let d = 0; d < a.local.length; d++) {
7890
7885
  let u = a.local[d].map(o, r, c);
@@ -7959,15 +7954,15 @@ function kn(n) {
7959
7954
  o && o != ee && e.push(o);
7960
7955
  }), n.cursorWrapper && e.push(G.create(n.state.doc, [n.cursorWrapper.deco])), Ve.from(e);
7961
7956
  }
7962
- const id = {
7957
+ const rd = {
7963
7958
  childList: !0,
7964
7959
  characterData: !0,
7965
7960
  characterDataOldValue: !0,
7966
7961
  attributes: !0,
7967
7962
  attributeOldValue: !0,
7968
7963
  subtree: !0
7969
- }, sd = ae && He <= 11;
7970
- class ld {
7964
+ }, id = ae && He <= 11;
7965
+ class sd {
7971
7966
  constructor() {
7972
7967
  this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
7973
7968
  }
@@ -7981,13 +7976,13 @@ class ld {
7981
7976
  return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
7982
7977
  }
7983
7978
  }
7984
- class ad {
7979
+ class ld {
7985
7980
  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) => {
7981
+ 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
7982
  for (let r = 0; r < o.length; r++)
7988
7983
  this.queue.push(o[r]);
7989
7984
  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) => {
7985
+ }), id && (this.onCharData = (o) => {
7991
7986
  this.queue.push({ target: o.target, type: "characterData", oldValue: o.prevValue }), this.flushSoon();
7992
7987
  }), this.onSelectionChange = this.onSelectionChange.bind(this);
7993
7988
  }
@@ -8000,7 +7995,7 @@ class ad {
8000
7995
  this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
8001
7996
  }
8002
7997
  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();
7998
+ this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, rd)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
8004
7999
  }
8005
8000
  stop() {
8006
8001
  if (this.observer) {
@@ -8083,12 +8078,12 @@ class ad {
8083
8078
  let { focusNode: u } = this.currentSelection;
8084
8079
  for (let f of d) {
8085
8080
  let m = f.parentNode;
8086
- m && m.nodeName == "LI" && (!u || ud(e, u) != m) && f.remove();
8081
+ m && m.nodeName == "LI" && (!u || dd(e, u) != m) && f.remove();
8087
8082
  }
8088
8083
  }
8089
8084
  }
8090
8085
  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));
8086
+ 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
8087
  }
8093
8088
  registerMutation(e, t) {
8094
8089
  if (t.indexOf(e.target) > -1)
@@ -8124,7 +8119,7 @@ class ad {
8124
8119
  }
8125
8120
  }
8126
8121
  let Fo = /* @__PURE__ */ new WeakMap(), $o = !1;
8127
- function cd(n) {
8122
+ function ad(n) {
8128
8123
  if (!Fo.has(n) && (Fo.set(n, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace) !== -1)) {
8129
8124
  if (n.requiresGeckoHackNode = ke, $o)
8130
8125
  return;
@@ -8135,7 +8130,7 @@ function Ho(n, e) {
8135
8130
  let t = e.startContainer, o = e.startOffset, r = e.endContainer, i = e.endOffset, s = n.domAtPos(n.state.selection.anchor);
8136
8131
  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
8132
  }
8138
- function dd(n, e) {
8133
+ function cd(n, e) {
8139
8134
  if (e.getComposedRanges) {
8140
8135
  let r = e.getComposedRanges(n.root)[0];
8141
8136
  if (r)
@@ -8147,7 +8142,7 @@ function dd(n, e) {
8147
8142
  }
8148
8143
  return n.dom.addEventListener("beforeinput", o, !0), document.execCommand("indent"), n.dom.removeEventListener("beforeinput", o, !0), t ? Ho(n, t) : null;
8149
8144
  }
8150
- function ud(n, e) {
8145
+ function dd(n, e) {
8151
8146
  for (let t = e.parentNode; t && t != n.dom; t = t.parentNode) {
8152
8147
  let o = n.docView.nearestDesc(t, !0);
8153
8148
  if (o && o.node.isBlock)
@@ -8155,7 +8150,7 @@ function ud(n, e) {
8155
8150
  }
8156
8151
  return null;
8157
8152
  }
8158
- function hd(n, e, t) {
8153
+ function ud(n, e, t) {
8159
8154
  let { node: o, fromOffset: r, toOffset: i, from: s, to: l } = n.docView.parseRange(e, t), a = n.domSelectionRange(), c, d = a.anchorNode;
8160
8155
  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
8156
  for (let g = i; g > r; g--) {
@@ -8175,7 +8170,7 @@ function hd(n, e, t) {
8175
8170
  to: i,
8176
8171
  preserveWhitespace: m.parent.type.whitespace == "pre" ? "full" : !0,
8177
8172
  findPositions: c,
8178
- ruleFromNode: fd,
8173
+ ruleFromNode: hd,
8179
8174
  context: m
8180
8175
  });
8181
8176
  if (c && c[0].pos != null) {
@@ -8184,7 +8179,7 @@ function hd(n, e, t) {
8184
8179
  }
8185
8180
  return { doc: b, sel: p, from: s, to: l };
8186
8181
  }
8187
- function fd(n) {
8182
+ function hd(n) {
8188
8183
  let e = n.pmViewDesc;
8189
8184
  if (e)
8190
8185
  return e.parseRule();
@@ -8198,8 +8193,8 @@ function fd(n) {
8198
8193
  return { ignore: !0 };
8199
8194
  return null;
8200
8195
  }
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) {
8196
+ 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;
8197
+ function pd(n, e, t, o, r) {
8203
8198
  let i = n.input.compositionPendingChanges || (n.composing ? n.input.compositionID : 0);
8204
8199
  if (n.input.compositionPendingChanges = 0, e < 0) {
8205
8200
  let N = n.input.lastSelectionTime > Date.now() - 50 ? n.input.lastSelectionOrigin : null, X = Jn(n, N);
@@ -8213,10 +8208,10 @@ function md(n, e, t, o, r) {
8213
8208
  }
8214
8209
  let s = n.state.doc.resolve(e), l = s.sharedDepth(t);
8215
8210
  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;
8211
+ let a = n.state.selection, c = ud(n, e, t), d = n.state.doc, u = d.slice(c.from, c.to), f, m;
8217
8212
  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")))) {
8213
+ let p = bd(u.content, c.doc.content, c.from, f, m);
8214
+ 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
8215
  n.input.lastIOSEnter = 0;
8221
8216
  return;
8222
8217
  }
@@ -8239,7 +8234,7 @@ function md(n, e, t, o, r) {
8239
8234
  n.input.lastIOSEnter = 0;
8240
8235
  return;
8241
8236
  }
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")))) {
8237
+ 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
8238
  Re && te && n.domObserver.suppressSelectionUpdates();
8244
8239
  return;
8245
8240
  }
@@ -8254,7 +8249,7 @@ function md(n, e, t, o, r) {
8254
8249
  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
8250
  else if (
8256
8251
  // 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())))
8252
+ 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
8253
  )
8259
8254
  M = n.state.tr, w.type == "add" ? M.addMark(k, I, w.mark) : M.removeMark(k, I, w.mark);
8260
8255
  else if (b.parent.child(b.index()).isText && b.index() == g.index() - (g.textOffset ? 0 : 1)) {
@@ -8273,7 +8268,7 @@ function md(n, e, t, o, r) {
8273
8268
  function qo(n, e, t) {
8274
8269
  return Math.max(t.anchor, t.head) > e.content.size ? null : Kn(n, e.resolve(t.anchor), e.resolve(t.head));
8275
8270
  }
8276
- function gd(n, e) {
8271
+ function md(n, e) {
8277
8272
  let t = n.firstChild.marks, o = e.firstChild.marks, r = t, i = o, s, l, a;
8278
8273
  for (let d = 0; d < o.length; d++)
8279
8274
  r = o[d].removeFromSet(r);
@@ -8291,7 +8286,7 @@ function gd(n, e) {
8291
8286
  if (A.from(c).eq(n))
8292
8287
  return { mark: l, type: s };
8293
8288
  }
8294
- function bd(n, e, t, o, r) {
8289
+ function gd(n, e, t, o, r) {
8295
8290
  if (
8296
8291
  // The content must have shrunk
8297
8292
  t - e <= r.pos - o.pos || // newEnd must point directly at or after the end of the block that newStart points into
@@ -8319,7 +8314,7 @@ function xn(n, e, t) {
8319
8314
  }
8320
8315
  return r;
8321
8316
  }
8322
- function yd(n, e, t, o, r) {
8317
+ function bd(n, e, t, o, r) {
8323
8318
  let i = n.findDiffStart(e, t);
8324
8319
  if (i == null)
8325
8320
  return null;
@@ -8343,8 +8338,8 @@ function Wo(n) {
8343
8338
  let e = n.charCodeAt(0), t = n.charCodeAt(1);
8344
8339
  return e >= 56320 && e <= 57343 && t >= 55296 && t <= 56319;
8345
8340
  }
8346
- const kd = jn, xd = At;
8347
- class Cd {
8341
+ const yd = jn, kd = At;
8342
+ class xd {
8348
8343
  /**
8349
8344
  Create a view. `place` may be a DOM node that the editor should
8350
8345
  be appended to, a function that will place it into the document,
@@ -8353,7 +8348,7 @@ class Cd {
8353
8348
  added to the document.
8354
8349
  */
8355
8350
  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();
8351
+ 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
8352
  }
8358
8353
  /**
8359
8354
  Holds `true` when a
@@ -8413,22 +8408,22 @@ class Cd {
8413
8408
  let l = r.plugins != e.plugins || this._props.plugins != t.plugins;
8414
8409
  if (l || this._props.plugins != t.plugins || this._props.nodeViews != t.nodeViews) {
8415
8410
  let m = jo(this);
8416
- Nd(m, this.nodeViews) && (this.nodeViews = m, i = !0);
8411
+ Sd(m, this.nodeViews) && (this.nodeViews = m, i = !0);
8417
8412
  }
8418
8413
  (l || t.handleDOMEvents != this._props.handleDOMEvents) && zn(this), this.editable = Uo(this), Ko(this);
8419
8414
  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
8415
  (u || !e.selection.eq(r.selection)) && (s = !0);
8421
- let f = d == "preserve" && s && this.dom.style.overflowAnchor == null && Qa(this);
8416
+ let f = d == "preserve" && s && this.dom.style.overflowAnchor == null && Za(this);
8422
8417
  if (s) {
8423
8418
  this.domObserver.stop();
8424
- let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty && Sd(r.selection, e.selection);
8419
+ let m = u && (ae || te) && !this.composing && !r.selection.empty && !e.selection.empty && Cd(r.selection, e.selection);
8425
8420
  if (u) {
8426
8421
  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);
8422
+ 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
8423
  }
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();
8424
+ 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
8425
  }
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);
8426
+ 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
8427
  }
8433
8428
  /**
8434
8429
  @internal
@@ -8515,7 +8510,7 @@ class Cd {
8515
8510
  Focus the editor.
8516
8511
  */
8517
8512
  focus() {
8518
- this.domObserver.stop(), this.editable && tc(this.dom), Pe(this), this.domObserver.start();
8513
+ this.domObserver.stop(), this.editable && ec(this.dom), Pe(this), this.domObserver.start();
8519
8514
  }
8520
8515
  /**
8521
8516
  Get the document root in which the editor exists. This will
@@ -8549,7 +8544,7 @@ class Cd {
8549
8544
  the top level, not in any node.
8550
8545
  */
8551
8546
  posAtCoords(e) {
8552
- return sc(this, e);
8547
+ return ic(this, e);
8553
8548
  }
8554
8549
  /**
8555
8550
  Returns the viewport rectangle at a given document position.
@@ -8614,7 +8609,7 @@ class Cd {
8614
8609
  pass a different state.
8615
8610
  */
8616
8611
  endOfTextblock(e, t) {
8617
- return uc(this, t || this.state, e);
8612
+ return dc(this, t || this.state, e);
8618
8613
  }
8619
8614
  /**
8620
8615
  Run the editor's paste logic with the given HTML string. The
@@ -8646,7 +8641,7 @@ class Cd {
8646
8641
  views](https://prosemirror.net/docs/ref/#view.NodeView).
8647
8642
  */
8648
8643
  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());
8644
+ 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
8645
  }
8651
8646
  /**
8652
8647
  This is true when the view has been
@@ -8660,7 +8655,7 @@ class Cd {
8660
8655
  Used for testing.
8661
8656
  */
8662
8657
  dispatchEvent(e) {
8663
- return qc(this, e);
8658
+ return Hc(this, e);
8664
8659
  }
8665
8660
  /**
8666
8661
  Dispatch a transaction. Will call
@@ -8680,7 +8675,7 @@ class Cd {
8680
8675
  */
8681
8676
  domSelectionRange() {
8682
8677
  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 };
8678
+ 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
8679
  }
8685
8680
  /**
8686
8681
  @internal
@@ -8707,7 +8702,7 @@ function Ko(n) {
8707
8702
  function Uo(n) {
8708
8703
  return !n.someProp("editable", (e) => e(n.state) === !1);
8709
8704
  }
8710
- function Sd(n, e) {
8705
+ function Cd(n, e) {
8711
8706
  let t = Math.min(n.$anchor.sharedDepth(n.head), e.$anchor.sharedDepth(e.head));
8712
8707
  return n.$anchor.start(t) != e.$anchor.start(t);
8713
8708
  }
@@ -8719,7 +8714,7 @@ function jo(n) {
8719
8714
  }
8720
8715
  return n.someProp("nodeViews", t), n.someProp("markViews", t), e;
8721
8716
  }
8722
- function Nd(n, e) {
8717
+ function Sd(n, e) {
8723
8718
  let t = 0, o = 0;
8724
8719
  for (let r in n) {
8725
8720
  if (n[r] != e[r])
@@ -8734,31 +8729,30 @@ function Yo(n) {
8734
8729
  if (n.spec.state || n.spec.filterTransaction || n.spec.appendTransaction)
8735
8730
  throw new RangeError("Plugins passed directly to the view must not have a state component");
8736
8731
  }
8737
- const Td = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8732
+ const Nd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
8738
8733
  __proto__: null,
8739
8734
  Decoration: me,
8740
8735
  DecorationSet: G,
8741
- EditorView: Cd,
8742
- __endComposition: xd,
8743
- __parseFromClipboard: kd
8736
+ EditorView: xd,
8737
+ __endComposition: kd,
8738
+ __parseFromClipboard: yd
8744
8739
  }, Symbol.toStringTag, { value: "Module" }));
8745
- function wd() {
8740
+ function Td() {
8746
8741
  try {
8747
- return Td;
8742
+ return Nd;
8748
8743
  } catch {
8749
8744
  return null;
8750
8745
  }
8751
8746
  }
8752
- function Dd(n, e) {
8747
+ function wd(n, e) {
8753
8748
  if (n && typeof n.serializeForClipboard == "function")
8754
8749
  return n.serializeForClipboard(e);
8755
- const t = wd();
8756
- if (t && // @ts-expect-error proseMirrorView is not a function
8757
- typeof (t == null ? void 0 : t.__serializeForClipboard) == "function")
8750
+ const t = Td();
8751
+ if (t && typeof (t == null ? void 0 : t.__serializeForClipboard) == "function")
8758
8752
  return t.__serializeForClipboard(n, e);
8759
8753
  throw new Error("No supported clipboard serialization method found.");
8760
8754
  }
8761
- function Md(n) {
8755
+ function Dd(n) {
8762
8756
  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
8757
  if (t && window.getComputedStyle(t).transform !== "none") {
8764
8758
  const l = t.getBoundingClientRect();
@@ -8807,7 +8801,7 @@ function Ut(n, e) {
8807
8801
  const t = e.state.doc.resolve(n);
8808
8802
  return t.depth > 1 ? t.before(t.depth) : n;
8809
8803
  }
8810
- function Od(n) {
8804
+ function Md(n) {
8811
8805
  let e = "", t = !1;
8812
8806
  function o(d, u) {
8813
8807
  if (u.focus(), !d.dataTransfer) return;
@@ -8846,7 +8840,7 @@ function Od(n) {
8846
8840
  k = T.create(u.state.doc, w.before());
8847
8841
  }
8848
8842
  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);
8843
+ const I = u.state.selection.content(), { dom: M, text: v } = wd(u, I);
8850
8844
  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
8845
  }
8852
8846
  let r = null;
@@ -8882,8 +8876,8 @@ function Od(n) {
8882
8876
  const f = u.closest(".drag-handle") || u.classList.contains("drag-handle"), m = u.closest(".tiptap") || u.classList.contains("tiptap");
8883
8877
  !f && !m && !t && i();
8884
8878
  }
8885
- return new $a({
8886
- key: new Ha(n.pluginKey),
8879
+ return new Fa({
8880
+ key: new $a(n.pluginKey),
8887
8881
  view: (d) => {
8888
8882
  var b, g, y, C;
8889
8883
  const u = n.dragHandleSelector ? document.querySelector(n.dragHandleSelector) : null;
@@ -8939,7 +8933,7 @@ function Od(n) {
8939
8933
  b != null && b >= 0 && (r.dataset.nodePos = String(
8940
8934
  Ut(b, d)
8941
8935
  ));
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);
8936
+ 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
8937
  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
8938
  },
8945
8939
  keydown: () => {
@@ -8999,7 +8993,7 @@ function Od(n) {
8999
8993
  }
9000
8994
  });
9001
8995
  }
9002
- const vd = zl.create({
8996
+ const Od = Pl.create({
9003
8997
  name: "globalDragHandle",
9004
8998
  addOptions() {
9005
8999
  return {
@@ -9011,7 +9005,7 @@ const vd = zl.create({
9011
9005
  },
9012
9006
  addProseMirrorPlugins() {
9013
9007
  return [
9014
- Od({
9008
+ Md({
9015
9009
  pluginKey: "globalDragHandle",
9016
9010
  dragHandleWidth: this.options.dragHandleWidth,
9017
9011
  scrollTreshold: this.options.scrollTreshold,
@@ -9021,18 +9015,18 @@ const vd = zl.create({
9021
9015
  })
9022
9016
  ];
9023
9017
  }
9024
- }), Id = ll, Ad = Gs.configure({
9018
+ }), vd = sl, Id = Ys.configure({
9025
9019
  placeholder: "撰写任何内容,或者按“/”输入命令..."
9026
- }), Ed = Xs.configure({
9020
+ }), Ad = Gs.configure({
9027
9021
  HTMLAttributes: {
9028
9022
  class: le(
9029
9023
  "text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
9030
9024
  )
9031
9025
  }
9032
- }), Rd = _s.extend({
9026
+ }), Ed = Xs.extend({
9033
9027
  addProseMirrorPlugins() {
9034
9028
  return [
9035
- Zs({
9029
+ _s({
9036
9030
  imageClass: le("opacity-40 rounded-lg border border-stone-200")
9037
9031
  })
9038
9032
  ];
@@ -9042,24 +9036,24 @@ const vd = zl.create({
9042
9036
  HTMLAttributes: {
9043
9037
  class: le("rounded-lg border border-muted")
9044
9038
  }
9045
- }), Pd = Qs.configure({
9039
+ }), Rd = Zs.configure({
9046
9040
  HTMLAttributes: {
9047
9041
  class: le("rounded-lg border border-muted")
9048
9042
  }
9049
- }), zd = el.configure({
9043
+ }), Pd = Qs.configure({
9050
9044
  HTMLAttributes: {
9051
9045
  class: le("not-prose pl-2 ")
9052
9046
  }
9053
- }), Bd = tl.configure({
9047
+ }), zd = el.configure({
9054
9048
  HTMLAttributes: {
9055
9049
  class: le("flex gap-2 items-start my-4")
9056
9050
  },
9057
9051
  nested: !0
9058
- }), Ld = nl.configure({
9052
+ }), Bd = tl.configure({
9059
9053
  HTMLAttributes: {
9060
9054
  class: le("mt-4 mb-6 border-t border-muted-foreground")
9061
9055
  }
9062
- }), Vd = ol.configure({
9056
+ }), Ld = nl.configure({
9063
9057
  bulletList: {
9064
9058
  HTMLAttributes: {
9065
9059
  class: le("list-disc list-outside leading-3 -mt-2")
@@ -9099,18 +9093,18 @@ const vd = zl.create({
9099
9093
  width: 4
9100
9094
  },
9101
9095
  gapcursor: !1
9102
- }), Fd = rl.configure({
9096
+ }), Vd = ol.configure({
9103
9097
  // configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
9104
9098
  // common: covers 37 language grammars which should be good enough in most cases
9105
- lowlight: Rl(Pl)
9106
- }), $d = il.configure({
9099
+ lowlight: El(Rl)
9100
+ }), Fd = rl.configure({
9107
9101
  HTMLAttributes: {
9108
9102
  class: le("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
9109
9103
  },
9110
9104
  katexOptions: {
9111
9105
  throwOnError: !1
9112
9106
  }
9113
- }), Hd = sl.configure(), qd = Al.configure({
9107
+ }), $d = il.configure(), Hd = Il.configure({
9114
9108
  html: !0,
9115
9109
  tightLists: !0,
9116
9110
  tightListClass: "tight",
@@ -9119,30 +9113,30 @@ const vd = zl.create({
9119
9113
  breaks: !1,
9120
9114
  transformPastedText: !1,
9121
9115
  transformCopiedText: !1
9122
- }), Wd = vd.configure({
9116
+ }), qd = Od.configure({
9123
9117
  dragHandleWidth: 56,
9124
9118
  dragHandleSelector: ".custom-drag-handle"
9125
9119
  }), Ti = [
9126
- Vd,
9120
+ Ld,
9121
+ Id,
9127
9122
  Ad,
9128
9123
  Ed,
9129
9124
  Rd,
9130
9125
  Pd,
9131
9126
  zd,
9132
9127
  Bd,
9133
- Ld,
9134
- Id,
9128
+ vd,
9129
+ Vd,
9135
9130
  Fd,
9136
9131
  $d,
9132
+ ll,
9137
9133
  Hd,
9138
9134
  al,
9139
- qd,
9140
9135
  cl,
9141
9136
  dl,
9142
9137
  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(
9138
+ qd
9139
+ ], 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
9140
  wt.Content,
9147
9141
  {
9148
9142
  ref: r,
@@ -9156,7 +9150,7 @@ const vd = zl.create({
9156
9150
  }
9157
9151
  ) }));
9158
9152
  ln.displayName = wt.Content.displayName;
9159
- const Kd = El(
9153
+ const Jd = Al(
9160
9154
  "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
9155
  {
9162
9156
  variants: {
@@ -9182,9 +9176,9 @@ const Kd = El(
9182
9176
  }
9183
9177
  ), be = ne.forwardRef(
9184
9178
  ({ className: n, variant: e, size: t, asChild: o = !1, ...r }, i) => /* @__PURE__ */ h(
9185
- o ? Ll : "button",
9179
+ o ? Bl : "button",
9186
9180
  {
9187
- className: D(Kd({ variant: e, size: t, className: n })),
9181
+ className: D(Jd({ variant: e, size: t, className: n })),
9188
9182
  ref: i,
9189
9183
  ...r
9190
9184
  }
@@ -9299,7 +9293,7 @@ const _o = [
9299
9293
  showArrow: !1,
9300
9294
  ...n
9301
9295
  }
9302
- ), Ud = ({ open: n, onOpenChange: e }) => {
9296
+ ), Kd = ({ open: n, onOpenChange: e }) => {
9303
9297
  const { editor: t } = xe();
9304
9298
  if (!t) return null;
9305
9299
  const o = _o.find(
@@ -9307,7 +9301,7 @@ const _o = [
9307
9301
  ), r = Zo.find(
9308
9302
  ({ color: i }) => t.isActive("highlight", { color: i })
9309
9303
  );
9310
- return /* @__PURE__ */ x(Jd, { modal: !0, open: n, onOpenChange: e, children: [
9304
+ return /* @__PURE__ */ x(Wd, { modal: !0, open: n, onOpenChange: e, children: [
9311
9305
  /* @__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
9306
  /* @__PURE__ */ h(
9313
9307
  "span",
@@ -9388,15 +9382,15 @@ const _o = [
9388
9382
  )
9389
9383
  ] });
9390
9384
  };
9391
- function jd(n) {
9385
+ function Ud(n) {
9392
9386
  try {
9393
9387
  return new URL(n), !0;
9394
9388
  } catch {
9395
9389
  return !1;
9396
9390
  }
9397
9391
  }
9398
- function Yd(n) {
9399
- if (jd(n)) return n;
9392
+ function jd(n) {
9393
+ if (Ud(n)) return n;
9400
9394
  try {
9401
9395
  if (n.includes(".") && !n.includes(" "))
9402
9396
  return new URL(`https://${n}`).toString();
@@ -9404,20 +9398,20 @@ function Yd(n) {
9404
9398
  return null;
9405
9399
  }
9406
9400
  }
9407
- const Gd = ({ open: n, onOpenChange: e }) => {
9401
+ const Yd = ({ open: n, onOpenChange: e }) => {
9408
9402
  const t = mt(null), { editor: o } = xe();
9409
9403
  return $e(() => {
9410
9404
  var r;
9411
9405
  (r = t.current) == null || r.focus();
9412
9406
  }), 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(
9407
+ /* @__PURE__ */ h(ot, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ h(zl, { asChild: !0, children: /* @__PURE__ */ x(
9414
9408
  be,
9415
9409
  {
9416
9410
  size: "sm",
9417
9411
  variant: "ghost",
9418
9412
  className: "gap-2 rounded-md border-none",
9419
9413
  children: [
9420
- /* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(is, { size: 16 }) }),
9414
+ /* @__PURE__ */ h("p", { className: "text-base", children: /* @__PURE__ */ h(rs, { size: 16 }) }),
9421
9415
  /* @__PURE__ */ h(
9422
9416
  "p",
9423
9417
  {
@@ -9439,7 +9433,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9439
9433
  onSubmit: (r) => {
9440
9434
  const i = r.currentTarget;
9441
9435
  r.preventDefault();
9442
- const s = i[0], l = Yd(s.value);
9436
+ const s = i[0], l = jd(s.value);
9443
9437
  l && (o.chain().focus().setLink({ href: l }).run(), e(!1));
9444
9438
  },
9445
9439
  className: "flex p-1 ",
@@ -9471,7 +9465,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9471
9465
  }
9472
9466
  ) })
9473
9467
  ] }) : null;
9474
- }, Xd = () => {
9468
+ }, Gd = () => {
9475
9469
  const { editor: n } = xe();
9476
9470
  return n ? /* @__PURE__ */ h(ot, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ h(
9477
9471
  be,
@@ -9489,7 +9483,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9489
9483
  }
9490
9484
  },
9491
9485
  children: /* @__PURE__ */ h(
9492
- Vl,
9486
+ Ll,
9493
9487
  {
9494
9488
  className: D("size-4", { "text-blue-500": n.isActive("math") }),
9495
9489
  strokeWidth: 2.3
@@ -9561,7 +9555,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9561
9555
  command: (n) => n.chain().focus().clearNodes().toggleCodeBlock().run(),
9562
9556
  isActive: (n) => n.isActive("codeBlock")
9563
9557
  }
9564
- ], _d = ({ open: n, onOpenChange: e }) => {
9558
+ ], Xd = ({ open: n, onOpenChange: e }) => {
9565
9559
  const { editor: t } = xe();
9566
9560
  if (!t) return null;
9567
9561
  const o = Bn.filter(
@@ -9621,7 +9615,7 @@ const Gd = ({ open: n, onOpenChange: e }) => {
9621
9615
  )
9622
9616
  );
9623
9617
  dt.displayName = br.Root.displayName;
9624
- const Zd = () => /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-0.5", children: [
9618
+ const _d = () => /* @__PURE__ */ x("div", { className: "flex items-center justify-center gap-0.5", children: [
9625
9619
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
9626
9620
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
9627
9621
  /* @__PURE__ */ h("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
@@ -9655,8 +9649,8 @@ const Mi = ne.forwardRef(({ className: n, orientation: e = "vertical", ...t }, o
9655
9649
  }
9656
9650
  ));
9657
9651
  Mi.displayName = Ze.ScrollAreaScrollbar.displayName;
9658
- const Qd = we.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9659
- we.Overlay,
9652
+ const Zd = Te.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9653
+ Te.Overlay,
9660
9654
  {
9661
9655
  ref: t,
9662
9656
  className: D(
@@ -9666,11 +9660,11 @@ const Qd = we.Portal, Oi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PU
9666
9660
  ...e
9667
9661
  }
9668
9662
  ));
9669
- Oi.displayName = we.Overlay.displayName;
9670
- const eu = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE__ */ x(Qd, { children: [
9663
+ Oi.displayName = Te.Overlay.displayName;
9664
+ const Qd = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE__ */ x(Zd, { children: [
9671
9665
  /* @__PURE__ */ h(Oi, {}),
9672
9666
  /* @__PURE__ */ x(
9673
- we.Content,
9667
+ Te.Content,
9674
9668
  {
9675
9669
  ref: o,
9676
9670
  className: D(
@@ -9680,17 +9674,17 @@ const eu = ne.forwardRef(({ className: n, children: e, ...t }, o) => /* @__PURE_
9680
9674
  ...t,
9681
9675
  children: [
9682
9676
  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" }),
9677
+ /* @__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: [
9678
+ /* @__PURE__ */ h(Vl, { className: "h-4 w-4" }),
9685
9679
  /* @__PURE__ */ h("span", { className: "sr-only", children: "Close" })
9686
9680
  ] })
9687
9681
  ]
9688
9682
  }
9689
9683
  )
9690
9684
  ] }));
9691
- eu.displayName = we.Content.displayName;
9692
- const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9693
- we.Title,
9685
+ Qd.displayName = Te.Content.displayName;
9686
+ const eu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9687
+ Te.Title,
9694
9688
  {
9695
9689
  ref: t,
9696
9690
  className: D(
@@ -9700,16 +9694,16 @@ const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9700
9694
  ...e
9701
9695
  }
9702
9696
  ));
9703
- tu.displayName = we.Title.displayName;
9704
- const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9705
- we.Description,
9697
+ eu.displayName = Te.Title.displayName;
9698
+ const tu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9699
+ Te.Description,
9706
9700
  {
9707
9701
  ref: t,
9708
9702
  className: D("text-sm text-muted-foreground", n),
9709
9703
  ...e
9710
9704
  }
9711
9705
  ));
9712
- nu.displayName = we.Description.displayName;
9706
+ tu.displayName = Te.Description.displayName;
9713
9707
  const vi = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9714
9708
  ce,
9715
9709
  {
@@ -9737,7 +9731,7 @@ const Ii = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ x("div",
9737
9731
  )
9738
9732
  ] }));
9739
9733
  Ii.displayName = ce.Input.displayName;
9740
- const ou = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9734
+ const nu = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9741
9735
  ce.List,
9742
9736
  {
9743
9737
  ref: t,
@@ -9745,8 +9739,8 @@ const ou = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9745
9739
  ...e
9746
9740
  }
9747
9741
  ));
9748
- ou.displayName = ce.List.displayName;
9749
- const ru = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9742
+ nu.displayName = ce.List.displayName;
9743
+ const ou = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9750
9744
  ce.Empty,
9751
9745
  {
9752
9746
  ref: e,
@@ -9754,7 +9748,7 @@ const ru = ne.forwardRef((n, e) => /* @__PURE__ */ h(
9754
9748
  ...n
9755
9749
  }
9756
9750
  ));
9757
- ru.displayName = ce.Empty.displayName;
9751
+ ou.displayName = ce.Empty.displayName;
9758
9752
  const zt = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9759
9753
  ce.Group,
9760
9754
  {
@@ -9788,7 +9782,7 @@ const ft = ne.forwardRef(({ className: n, ...e }, t) => /* @__PURE__ */ h(
9788
9782
  }
9789
9783
  ));
9790
9784
  ft.displayName = ce.Item.displayName;
9791
- const iu = ({
9785
+ const ru = ({
9792
9786
  completion: n,
9793
9787
  onDiscard: e
9794
9788
  }) => {
@@ -9811,7 +9805,7 @@ const iu = ({
9811
9805
  ).run();
9812
9806
  },
9813
9807
  children: [
9814
- /* @__PURE__ */ h($l, { className: "h-4 w-4 text-muted-foreground" }),
9808
+ /* @__PURE__ */ h(Fl, { className: "h-4 w-4 text-muted-foreground" }),
9815
9809
  "替换选择"
9816
9810
  ]
9817
9811
  }
@@ -9826,7 +9820,7 @@ const iu = ({
9826
9820
  t.chain().focus().insertContentAt(o.to + 1, n).run();
9827
9821
  },
9828
9822
  children: [
9829
- /* @__PURE__ */ h(Hl, { className: "h-4 w-4 text-muted-foreground" }),
9823
+ /* @__PURE__ */ h($l, { className: "h-4 w-4 text-muted-foreground" }),
9830
9824
  "在下面插入"
9831
9825
  ]
9832
9826
  }
@@ -9834,41 +9828,41 @@ const iu = ({
9834
9828
  ] }),
9835
9829
  /* @__PURE__ */ h(Qn, {}),
9836
9830
  /* @__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" }),
9831
+ /* @__PURE__ */ h(Hl, { className: "h-4 w-4 text-muted-foreground" }),
9838
9832
  "丢弃"
9839
9833
  ] }) })
9840
9834
  ] });
9841
- }, su = [
9835
+ }, iu = [
9842
9836
  {
9843
9837
  value: "improve",
9844
9838
  label: "改进写作",
9845
9839
  // Improve writing
9846
- icon: Wl
9840
+ icon: ql
9847
9841
  },
9848
9842
  {
9849
9843
  value: "fix",
9850
9844
  label: "修正语法",
9851
9845
  // Fix grammar
9852
- icon: Jl
9846
+ icon: Wl
9853
9847
  },
9854
9848
  {
9855
9849
  value: "shorter",
9856
9850
  label: "缩短文本",
9857
9851
  // Make shorter
9858
- icon: Kl
9852
+ icon: Jl
9859
9853
  },
9860
9854
  {
9861
9855
  value: "longer",
9862
9856
  label: "扩展文本",
9863
9857
  // Make longer
9864
- icon: Ul
9858
+ icon: Kl
9865
9859
  }
9866
- ], lu = ({ onSelect: n }) => {
9860
+ ], su = ({ onSelect: n }) => {
9867
9861
  const { editor: e } = xe();
9868
9862
  return /* @__PURE__ */ x(rt, { children: [
9869
9863
  /* @__PURE__ */ x(zt, { heading: "编辑或校对选中文本", children: [
9870
9864
  " ",
9871
- su.map((t) => /* @__PURE__ */ x(
9865
+ iu.map((t) => /* @__PURE__ */ x(
9872
9866
  ft,
9873
9867
  {
9874
9868
  onSelect: (o) => {
@@ -9894,13 +9888,13 @@ const iu = ({
9894
9888
  ft,
9895
9889
  {
9896
9890
  onSelect: () => {
9897
- const t = e.state.selection.from, o = fl(e, t);
9891
+ const t = e.state.selection.from, o = hl(e, t);
9898
9892
  n(o, "continue");
9899
9893
  },
9900
9894
  value: "continue",
9901
9895
  className: "gap-2 px-4",
9902
9896
  children: [
9903
- /* @__PURE__ */ h(jl, { className: "h-4 w-4 text-purple-500" }),
9897
+ /* @__PURE__ */ h(Ul, { className: "h-4 w-4 text-purple-500" }),
9904
9898
  "继续写作"
9905
9899
  ]
9906
9900
  }
@@ -9908,8 +9902,8 @@ const iu = ({
9908
9902
  ] })
9909
9903
  ] });
9910
9904
  };
9911
- function au({ onOpenChange: n, options: e }) {
9912
- const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } = ea({
9905
+ function lu({ onOpenChange: n, options: e }) {
9906
+ const { editor: t } = xe(), [o, r] = J(""), { completion: i, complete: s, isLoading: l } = Ql({
9913
9907
  // id: "novel",
9914
9908
  api: "/api/generate",
9915
9909
  onResponse: (c) => {
@@ -9928,7 +9922,7 @@ function au({ onOpenChange: n, options: e }) {
9928
9922
  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
9923
  /* @__PURE__ */ h(Fn, { size: 14, className: "mr-2 shrink-0" }),
9930
9924
  "AI正在思考",
9931
- /* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(Zd, {}) })
9925
+ /* @__PURE__ */ h("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ h(_d, {}) })
9932
9926
  ] }),
9933
9927
  !l && /* @__PURE__ */ x(rt, { children: [
9934
9928
  /* @__PURE__ */ x("div", { className: "relative", children: [
@@ -9939,7 +9933,7 @@ function au({ onOpenChange: n, options: e }) {
9939
9933
  onValueChange: r,
9940
9934
  autoFocus: !0,
9941
9935
  placeholder: a ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
9942
- onFocus: () => pl(t)
9936
+ onFocus: () => fl(t)
9943
9937
  }
9944
9938
  ),
9945
9939
  /* @__PURE__ */ h(
@@ -9959,12 +9953,12 @@ function au({ onOpenChange: n, options: e }) {
9959
9953
  body: { option: "zap", command: o }
9960
9954
  }).then(() => r(""));
9961
9955
  },
9962
- children: /* @__PURE__ */ h(Yl, { className: "h-4 w-4" })
9956
+ children: /* @__PURE__ */ h(jl, { className: "h-4 w-4" })
9963
9957
  }
9964
9958
  )
9965
9959
  ] }),
9966
9960
  a ? /* @__PURE__ */ h(
9967
- iu,
9961
+ ru,
9968
9962
  {
9969
9963
  onDiscard: () => {
9970
9964
  t.chain().unsetHighlight().focus().run(), n(!1);
@@ -9972,7 +9966,7 @@ function au({ onOpenChange: n, options: e }) {
9972
9966
  completion: i
9973
9967
  }
9974
9968
  ) : /* @__PURE__ */ h(
9975
- lu,
9969
+ su,
9976
9970
  {
9977
9971
  onSelect: (c, d) => s(c, { body: { option: d } })
9978
9972
  }
@@ -9980,7 +9974,7 @@ function au({ onOpenChange: n, options: e }) {
9980
9974
  ] })
9981
9975
  ] });
9982
9976
  }
9983
- const cu = ({
9977
+ const au = ({
9984
9978
  children: n,
9985
9979
  open: e,
9986
9980
  onOpenChange: t,
@@ -9989,9 +9983,9 @@ const cu = ({
9989
9983
  }) => {
9990
9984
  const { editor: i } = xe();
9991
9985
  return $e(() => {
9992
- e || ml(i);
9986
+ e || pl(i);
9993
9987
  }, [e]), /* @__PURE__ */ x(
9994
- gl,
9988
+ ml,
9995
9989
  {
9996
9990
  tippyOptions: {
9997
9991
  placement: e ? "bottom-start" : "top",
@@ -10002,14 +9996,14 @@ const cu = ({
10002
9996
  className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
10003
9997
  children: [
10004
9998
  e && o && /* @__PURE__ */ h(
10005
- au,
9999
+ lu,
10006
10000
  {
10007
10001
  open: e,
10008
10002
  onOpenChange: t,
10009
10003
  options: r
10010
10004
  }
10011
10005
  ),
10012
- !e && /* @__PURE__ */ x(Fi, { children: [
10006
+ !e && /* @__PURE__ */ x(Vi, { children: [
10013
10007
  o && /* @__PURE__ */ x(
10014
10008
  be,
10015
10009
  {
@@ -10028,7 +10022,7 @@ const cu = ({
10028
10022
  ]
10029
10023
  }
10030
10024
  );
10031
- }, du = (n) => {
10025
+ }, cu = (n) => {
10032
10026
  const e = fetch("/api/upload", {
10033
10027
  method: "POST",
10034
10028
  headers: {
@@ -10054,10 +10048,10 @@ const cu = ({
10054
10048
  }
10055
10049
  );
10056
10050
  });
10057
- }, uu = mr({
10058
- onUpload: du,
10051
+ }, du = mr({
10052
+ onUpload: cu,
10059
10053
  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 = () => {
10054
+ }), uu = () => {
10061
10055
  const { editor: n } = xe();
10062
10056
  return n ? /* @__PURE__ */ h("div", { className: "flex", children: [
10063
10057
  {
@@ -10065,35 +10059,35 @@ const cu = ({
10065
10059
  // bold
10066
10060
  isActive: (t) => t.isActive("bold"),
10067
10061
  command: (t) => t.chain().focus().toggleBold().run(),
10068
- icon: Gl
10062
+ icon: Yl
10069
10063
  },
10070
10064
  {
10071
10065
  name: "斜体",
10072
10066
  // italic
10073
10067
  isActive: (t) => t.isActive("italic"),
10074
10068
  command: (t) => t.chain().focus().toggleItalic().run(),
10075
- icon: Xl
10069
+ icon: Gl
10076
10070
  },
10077
10071
  {
10078
10072
  name: "下划线",
10079
10073
  // underline
10080
10074
  isActive: (t) => t.isActive("underline"),
10081
10075
  command: (t) => t.chain().focus().toggleUnderline().run(),
10082
- icon: _l
10076
+ icon: Xl
10083
10077
  },
10084
10078
  {
10085
10079
  name: "删除线",
10086
10080
  // strike
10087
10081
  isActive: (t) => t.isActive("strike"),
10088
10082
  command: (t) => t.chain().focus().toggleStrike().run(),
10089
- icon: Zl
10083
+ icon: _l
10090
10084
  },
10091
10085
  {
10092
10086
  name: "代码",
10093
10087
  // code
10094
10088
  isActive: (t) => t.isActive("code"),
10095
10089
  command: (t) => t.chain().focus().toggleCode().run(),
10096
- icon: Ql
10090
+ icon: Zl
10097
10091
  }
10098
10092
  ].map((t) => /* @__PURE__ */ h(
10099
10093
  Xt,
@@ -10121,7 +10115,7 @@ const cu = ({
10121
10115
  },
10122
10116
  t.name
10123
10117
  )) }) : null;
10124
- }, Ai = ({ uploadFn: n }) => yl([
10118
+ }, Ai = ({ uploadFn: n }) => bl([
10125
10119
  {
10126
10120
  title: "文本",
10127
10121
  // "Text",
@@ -10223,7 +10217,7 @@ const cu = ({
10223
10217
  description: "从您的计算机上传图像。",
10224
10218
  // "Upload an image from your computer.",
10225
10219
  searchTerms: ["photo", "picture", "media"],
10226
- icon: /* @__PURE__ */ h(ss, { size: 18 }),
10220
+ icon: /* @__PURE__ */ h(is, { size: 18 }),
10227
10221
  command: ({ editor: e, range: t }) => {
10228
10222
  e.chain().focus().deleteRange(t).run();
10229
10223
  const o = document.createElement("input");
@@ -10236,15 +10230,15 @@ const cu = ({
10236
10230
  }, o.click();
10237
10231
  }
10238
10232
  }
10239
- ]), fu = (n) => bl.configure({
10233
+ ]), hu = (n) => gl.configure({
10240
10234
  suggestion: {
10241
10235
  items: () => Ai(n),
10242
- render: kl
10236
+ render: yl
10243
10237
  }
10244
- }), pu = {
10238
+ }), fu = {
10245
10239
  type: "doc",
10246
10240
  content: []
10247
- }, Ei = $i(({ children: n, items: e, ...t }, o) => {
10241
+ }, Ei = Fi(({ children: n, items: e, ...t }, o) => {
10248
10242
  const r = (s) => /* @__PURE__ */ x(
10249
10243
  qt.Item,
10250
10244
  {
@@ -10266,7 +10260,7 @@ const cu = ({
10266
10260
  return /* @__PURE__ */ h(
10267
10261
  qt.SubMenu,
10268
10262
  {
10269
- expandIcon: /* @__PURE__ */ h(ls, { size: 16 }),
10263
+ expandIcon: /* @__PURE__ */ h(ss, { size: 16 }),
10270
10264
  popupClassName: D(
10271
10265
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
10272
10266
  S`
@@ -10304,7 +10298,7 @@ const cu = ({
10304
10298
  );
10305
10299
  };
10306
10300
  return /* @__PURE__ */ h(
10307
- na,
10301
+ ta,
10308
10302
  {
10309
10303
  ref: o,
10310
10304
  trigger: "click",
@@ -10331,7 +10325,7 @@ const cu = ({
10331
10325
  );
10332
10326
  });
10333
10327
  Ei.displayName = "DropdownMenu";
10334
- const mu = ({ children: n, ...e }) => {
10328
+ const pu = ({ children: n, ...e }) => {
10335
10329
  const { editor: t } = xe(), o = () => {
10336
10330
  t && t.state.selection instanceof T && (t.commands.deleteSelection(), t.commands.focus());
10337
10331
  }, r = () => {
@@ -10356,13 +10350,13 @@ const mu = ({ children: n, ...e }) => {
10356
10350
  {
10357
10351
  key: "transform",
10358
10352
  type: "submenu",
10359
- icon: /* @__PURE__ */ h(as, { size: 16 }),
10353
+ icon: /* @__PURE__ */ h(ls, { size: 16 }),
10360
10354
  label: "转换成",
10361
10355
  children: i
10362
10356
  },
10363
10357
  {
10364
10358
  key: "duplicate",
10365
- icon: /* @__PURE__ */ h(cs, { size: 16 }),
10359
+ icon: /* @__PURE__ */ h(as, { size: 16 }),
10366
10360
  label: "创建副本",
10367
10361
  onClick: r
10368
10362
  },
@@ -10375,7 +10369,7 @@ const mu = ({ children: n, ...e }) => {
10375
10369
  onClick: o
10376
10370
  }
10377
10371
  ], ...e, children: n });
10378
- }, gu = () => {
10372
+ }, mu = () => {
10379
10373
  const { editor: n } = xe(), e = (t) => {
10380
10374
  if (!n) return;
10381
10375
  const o = t.target.closest(".custom-drag-handle");
@@ -10414,12 +10408,12 @@ const mu = ({ children: n, ...e }) => {
10414
10408
  variant: "ghost",
10415
10409
  className: "w-auto h-auto p-0.5",
10416
10410
  onClick: e,
10417
- children: /* @__PURE__ */ h(ds, { className: "cursor-pointer", size: 22 })
10411
+ children: /* @__PURE__ */ h(cs, { className: "cursor-pointer", size: 22 })
10418
10412
  }
10419
10413
  )
10420
10414
  }
10421
10415
  ),
10422
- /* @__PURE__ */ h(mu, { children: /* @__PURE__ */ h(
10416
+ /* @__PURE__ */ h(pu, { children: /* @__PURE__ */ h(
10423
10417
  ot,
10424
10418
  {
10425
10419
  placement: "bottom",
@@ -10427,13 +10421,13 @@ const mu = ({ children: n, ...e }) => {
10427
10421
  "拖动",
10428
10422
  /* @__PURE__ */ h("span", { className: "text-muted-foreground", children: "以移动" })
10429
10423
  ] }) }),
10430
- children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(us, { size: 22 }) })
10424
+ children: /* @__PURE__ */ h(be, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ h(ds, { size: 22 }) })
10431
10425
  }
10432
10426
  ) })
10433
10427
  ]
10434
10428
  }
10435
10429
  );
10436
- }, bu = (n) => {
10430
+ }, gu = (n) => {
10437
10431
  const {
10438
10432
  className: e,
10439
10433
  initialContent: t = {},
@@ -10451,9 +10445,9 @@ const mu = ({ children: n, ...e }) => {
10451
10445
  ), [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
10446
  const U = new DOMParser().parseFromString(R, "text/html");
10453
10447
  return U.querySelectorAll("pre code").forEach((V) => {
10454
- ta.highlightElement(V);
10448
+ ea.highlightElement(V);
10455
10449
  }), new XMLSerializer().serializeToString(U);
10456
- }, K = Il(
10450
+ }, K = vl(
10457
10451
  async (R) => {
10458
10452
  const U = R.getJSON();
10459
10453
  y(R.storage.characterCount.words()), o == null || o(U), i && (window.localStorage.setItem(
@@ -10466,13 +10460,13 @@ const mu = ({ children: n, ...e }) => {
10466
10460
  },
10467
10461
  500
10468
10462
  ), Ce = pt(() => {
10469
- if (!a) return uu;
10463
+ if (!a) return du;
10470
10464
  const {
10471
10465
  beforeUpload: R,
10472
10466
  maxSize: U,
10473
10467
  action: V,
10474
10468
  headers: de,
10475
- method: Se,
10469
+ method: Oe,
10476
10470
  name: an,
10477
10471
  onSuccess: Ft,
10478
10472
  onError: $t
@@ -10482,7 +10476,7 @@ const mu = ({ children: n, ...e }) => {
10482
10476
  const P = new FormData();
10483
10477
  P.append(an || "file", ze);
10484
10478
  const Q = fetch(V, {
10485
- method: Se || "POST",
10479
+ method: Oe || "POST",
10486
10480
  headers: {
10487
10481
  ...de
10488
10482
  },
@@ -10514,11 +10508,11 @@ const mu = ({ children: n, ...e }) => {
10514
10508
  if ($e(() => {
10515
10509
  if (!i) return;
10516
10510
  const R = window.localStorage.getItem(r);
10517
- m(R ? JSON.parse(R) : pu);
10511
+ m(R ? JSON.parse(R) : fu);
10518
10512
  }, [r, i]), !f) return null;
10519
- const Oe = [
10513
+ const Me = [
10520
10514
  ...Ti,
10521
- fu({
10515
+ hu({
10522
10516
  uploadFn: Ce
10523
10517
  })
10524
10518
  ];
@@ -10536,21 +10530,21 @@ const mu = ({ children: n, ...e }) => {
10536
10530
  }
10537
10531
  )
10538
10532
  ] }),
10539
- /* @__PURE__ */ h(xl, { children: /* @__PURE__ */ x(
10540
- Cl,
10533
+ /* @__PURE__ */ h(kl, { children: /* @__PURE__ */ x(
10534
+ xl,
10541
10535
  {
10542
10536
  onCreate: ({ editor: R }) => {
10543
10537
  c && (c.current = R);
10544
10538
  },
10545
10539
  initialContent: f,
10546
- extensions: Oe,
10540
+ extensions: Me,
10547
10541
  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
10542
  editorProps: {
10549
10543
  handleDOMEvents: {
10550
- keydown: (R, U) => Tl(U)
10544
+ keydown: (R, U) => Nl(U)
10551
10545
  },
10552
- handlePaste: (R, U) => Nl(R, U, Ce),
10553
- handleDrop: (R, U, V, de) => Sl(R, U, de, Ce),
10546
+ handlePaste: (R, U) => Sl(R, U, Ce),
10547
+ handleDrop: (R, U, V, de) => Cl(R, U, de, Ce),
10554
10548
  attributes: {
10555
10549
  class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
10556
10550
  }
@@ -10558,14 +10552,14 @@ const mu = ({ children: n, ...e }) => {
10558
10552
  onUpdate: ({ editor: R }) => {
10559
10553
  K(R), b("Unsaved");
10560
10554
  },
10561
- slotAfter: /* @__PURE__ */ h(vl, {}),
10555
+ slotAfter: /* @__PURE__ */ h(Ol, {}),
10562
10556
  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({
10557
+ /* @__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: [
10558
+ /* @__PURE__ */ h(wl, { className: "px-2 text-muted-foreground", children: "没有结果" }),
10559
+ /* @__PURE__ */ h(Dl, { children: Ai({
10566
10560
  uploadFn: Ce
10567
10561
  }).map((R) => /* @__PURE__ */ x(
10568
- Ol,
10562
+ Ml,
10569
10563
  {
10570
10564
  value: R.title,
10571
10565
  onCommand: (U) => R.command(U),
@@ -10582,7 +10576,7 @@ const mu = ({ children: n, ...e }) => {
10582
10576
  )) })
10583
10577
  ] }),
10584
10578
  /* @__PURE__ */ x(
10585
- cu,
10579
+ au,
10586
10580
  {
10587
10581
  open: w,
10588
10582
  onOpenChange: N,
@@ -10590,32 +10584,32 @@ const mu = ({ children: n, ...e }) => {
10590
10584
  aiOptions: u,
10591
10585
  children: [
10592
10586
  d && /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10593
- /* @__PURE__ */ h(_d, { open: C, onOpenChange: O }),
10587
+ /* @__PURE__ */ h(Xd, { open: C, onOpenChange: O }),
10594
10588
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10595
- /* @__PURE__ */ h(Gd, { open: M, onOpenChange: v }),
10589
+ /* @__PURE__ */ h(Yd, { open: M, onOpenChange: v }),
10596
10590
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10597
- /* @__PURE__ */ h(Xd, {}),
10591
+ /* @__PURE__ */ h(Gd, {}),
10598
10592
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10599
- /* @__PURE__ */ h(hu, {}),
10593
+ /* @__PURE__ */ h(uu, {}),
10600
10594
  /* @__PURE__ */ h(dt, { orientation: "vertical" }),
10601
- /* @__PURE__ */ h(Ud, { open: k, onOpenChange: I })
10595
+ /* @__PURE__ */ h(Kd, { open: k, onOpenChange: I })
10602
10596
  ]
10603
10597
  }
10604
10598
  ),
10605
- /* @__PURE__ */ h(gu, {})
10599
+ /* @__PURE__ */ h(mu, {})
10606
10600
  ]
10607
10601
  }
10608
10602
  ) })
10609
10603
  ] });
10610
- }, yu = ({ json: n }) => {
10611
- const e = pt(() => oa(n ?? {}, Ti), [n]);
10604
+ }, bu = ({ json: n }) => {
10605
+ const e = pt(() => na(n ?? {}, Ti), [n]);
10612
10606
  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;
10607
+ }, yu = gu;
10608
+ yu.Preview = bu;
10615
10609
  export {
10616
- lh as Desktop,
10610
+ sh as Desktop,
10617
10611
  Ar as Dock,
10618
- ku as Editor,
10619
- Na as Markdown,
10620
- Ta as MdEditor
10612
+ yu as Editor,
10613
+ Sa as Markdown,
10614
+ Na as MdEditor
10621
10615
  };