zs_library 0.4.3 → 0.4.5

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