zs_library 0.4.13 → 0.4.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,56 +1,57 @@
1
- var Ut = Object.defineProperty;
2
- var Xt = (r, e, o) => e in r ? Ut(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
3
- var Ie = (r, e, o) => Xt(r, typeof e != "symbol" ? e + "" : e, o);
1
+ var qt = Object.defineProperty;
2
+ var Yt = (r, e, o) => e in r ? qt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[e] = o;
3
+ var Se = (r, e, o) => Yt(r, typeof e != "symbol" ? e + "" : e, o);
4
4
  import "./index.css";
5
- import Gt from "i18next";
6
- import { initReactI18next as qt } from "react-i18next";
7
- import { jsx as t, jsxs as d, Fragment as me } from "react/jsx-runtime";
8
- import { cx as y, css as f } from "@emotion/css";
5
+ import Vt from "i18next";
6
+ import { initReactI18next as Wt } from "react-i18next";
7
+ import { jsx as t, jsxs as m, Fragment as me } from "react/jsx-runtime";
8
+ import { cx as y, css as g } from "@emotion/css";
9
9
  import * as G from "react";
10
- import { createContext as Ze, useMemo as fe, useContext as Qe, useState as H, useRef as he, useEffect as ie, Fragment as Yt, forwardRef as Vt } from "react";
11
- import Wt from "react-slick";
12
- import { ReactSortable as ze } from "react-sortablejs";
13
- import { AnimatePresence as Ee, motion as R, useMotionValue as Kt, useTransform as xe, useSpring as Se } from "framer-motion";
14
- import { useLocalStorageState as Jt, useDebounceEffect as Zt } from "ahooks";
15
- import { v4 as Ye } from "uuid";
16
- import et from "rc-tooltip";
17
- import { RiPencilRuler2Line as Qt, RiShareLine as eo, RiInformationLine as to, RiCloseCircleLine as oo, RiArrowUpDownLine as ro, RiArrowLeftRightLine as no, RiArrowRightLine as ao, RiArrowLeftLine as so, RiCloseLine as io, RiZoomOutLine as lo, RiZoomInLine as co, RiClockwise2Line as mo, RiAnticlockwise2Line as uo, RiMoreLine as po, RiArrowDropDownLine as tt, RiCheckLine as ye, RiLink as go, RiDeleteBinLine as ot, RiText as rt, RiH1 as nt, RiH2 as at, RiH3 as st, RiListCheck as it, RiListUnordered as lt, RiListOrdered as ct, RiQuoteText as dt, RiCodeLine as mt, RiSparklingFill as $e, RiImageLine as fo, RiArrowRightSLine as ho, RiRepeatLine as bo, RiFileCopyLine as xo, RiAddLine as yo, RiDraggable as vo } from "@remixicon/react";
18
- import ut from "rc-dialog";
19
- import ko from "react-json-view";
20
- import { AdmonitionDirectiveDescriptor as Co, MDXEditor as wo, toolbarPlugin as No, diffSourcePlugin as Io, listsPlugin as So, quotePlugin as To, headingsPlugin as Mo, linkPlugin as Lo, linkDialogPlugin as Ao, imagePlugin as Ro, tablePlugin as Do, thematicBreakPlugin as Po, frontmatterPlugin as Bo, codeBlockPlugin as zo, codeMirrorPlugin as Eo, markdownShortcutPlugin as $o, directivesPlugin as Ho, DiffSourceToggleWrapper as Oo, UndoRedo as Fo, Separator as le, BoldItalicUnderlineToggles as _o, CodeToggle as jo, StrikeThroughSupSubToggles as Uo, ListsToggle as Xo, CreateLink as Go, InsertImage as qo, InsertTable as Yo, InsertThematicBreak as Vo, InsertCodeBlock as Wo, InsertFrontmatter as Ko } from "@mdxeditor/editor";
21
- import pt from "react-markdown";
22
- import Jo from "remark-gfm";
23
- import Zo from "remark-emoji";
24
- import Qo from "rehype-raw";
25
- import { Prism as er } from "react-syntax-highlighter";
26
- import { oneLight as tr } from "react-syntax-highlighter/dist/esm/styles/prism";
27
- import or from "rc-image";
28
- import { clsx as rr } from "clsx";
29
- import { twMerge as nr } from "tailwind-merge";
30
- import { Placeholder as ar, TiptapLink as sr, TiptapImage as ir, UploadImagesPlugin as lr, UpdatedImage as cr, TaskList as dr, TaskItem as mr, HorizontalRule as ur, StarterKit as pr, CodeBlockLowlight as gr, Mathematics as fr, CharacterCount as hr, AIHighlight as br, TiptapUnderline as xr, HighlightExtension as yr, TextStyle as vr, Color as kr, CustomKeymap as Cr, useEditor as Q, EditorBubbleItem as Le, getPrevText as wr, addAIHighlight as Nr, removeAIHighlight as Ir, EditorBubble as Sr, createImageUpload as gt, Command as Tr, createSuggestionItems as Mr, renderItems as Lr, EditorRoot as Ar, EditorContent as Rr, handleImageDrop as Dr, handleImagePaste as Pr, handleCommandNavigation as Br, EditorCommand as zr, EditorCommandEmpty as Er, EditorCommandList as $r, EditorCommandItem as Hr, ImageResizer as Or } from "novel";
31
- import { useDebouncedCallback as Fr } from "use-debounce";
32
- import { Markdown as _r } from "tiptap-markdown";
33
- import { cx as q, cva as jr } from "class-variance-authority";
34
- import { createLowlight as Ur, common as Xr } from "lowlight";
35
- import { Extension as Gr } from "@tiptap/core";
36
- import { Plugin as qr, PluginKey as Yr, NodeSelection as K, TextSelection as Vr } from "prosemirror-state";
37
- import { Slice as Wr, Fragment as Kr } from "prosemirror-model";
38
- import * as Jr from "prosemirror-view";
10
+ import { createContext as ot, useMemo as fe, useContext as rt, useState as H, useRef as he, useEffect as ie, Fragment as Kt, forwardRef as Jt } from "react";
11
+ import Zt from "react-slick";
12
+ import { ReactSortable as $e } from "react-sortablejs";
13
+ import { AnimatePresence as He, motion as D, useMotionValue as nt, useTransform as xe, useSpring as Te } from "framer-motion";
14
+ import { useMotionValue as Ms } from "framer-motion";
15
+ import { useLocalStorageState as Qt, useDebounceEffect as eo } from "ahooks";
16
+ import { v4 as Je } from "uuid";
17
+ import at from "rc-tooltip";
18
+ import { RiPencilRuler2Line as to, RiShareLine as oo, RiInformationLine as ro, RiCloseCircleLine as no, RiArrowUpDownLine as ao, RiArrowLeftRightLine as so, RiArrowRightLine as io, RiArrowLeftLine as lo, RiCloseLine as co, RiZoomOutLine as mo, RiZoomInLine as uo, RiClockwise2Line as po, RiAnticlockwise2Line as go, RiMoreLine as fo, RiArrowDropDownLine as st, RiCheckLine as ye, RiLink as ho, RiDeleteBinLine as it, RiText as lt, RiH1 as ct, RiH2 as dt, RiH3 as mt, RiListCheck as ut, RiListUnordered as pt, RiListOrdered as gt, RiQuoteText as ft, RiCodeLine as ht, RiSparklingFill as Oe, RiImageLine as bo, RiArrowRightSLine as xo, RiRepeatLine as yo, RiFileCopyLine as vo, RiAddLine as ko, RiDraggable as Co } from "@remixicon/react";
19
+ import bt from "rc-dialog";
20
+ import wo from "react-json-view";
21
+ import { AdmonitionDirectiveDescriptor as No, MDXEditor as Io, toolbarPlugin as So, diffSourcePlugin as To, listsPlugin as Mo, quotePlugin as Lo, headingsPlugin as Ao, linkPlugin as Do, linkDialogPlugin as Ro, imagePlugin as Po, tablePlugin as Bo, thematicBreakPlugin as zo, frontmatterPlugin as Eo, codeBlockPlugin as $o, codeMirrorPlugin as Ho, markdownShortcutPlugin as Oo, directivesPlugin as Fo, DiffSourceToggleWrapper as _o, UndoRedo as jo, Separator as le, BoldItalicUnderlineToggles as Xo, CodeToggle as Uo, StrikeThroughSupSubToggles as Go, ListsToggle as qo, CreateLink as Yo, InsertImage as Vo, InsertTable as Wo, InsertThematicBreak as Ko, InsertCodeBlock as Jo, InsertFrontmatter as Zo } from "@mdxeditor/editor";
22
+ import xt from "react-markdown";
23
+ import Qo from "remark-gfm";
24
+ import er from "remark-emoji";
25
+ import tr from "rehype-raw";
26
+ import { Prism as or } from "react-syntax-highlighter";
27
+ import { oneLight as rr } from "react-syntax-highlighter/dist/esm/styles/prism";
28
+ import nr from "rc-image";
29
+ import { clsx as ar } from "clsx";
30
+ import { twMerge as sr } from "tailwind-merge";
31
+ import { Placeholder as ir, TiptapLink as lr, TiptapImage as cr, UploadImagesPlugin as dr, UpdatedImage as mr, TaskList as ur, TaskItem as pr, HorizontalRule as gr, StarterKit as fr, CodeBlockLowlight as hr, Mathematics as br, CharacterCount as xr, AIHighlight as yr, TiptapUnderline as vr, HighlightExtension as kr, TextStyle as Cr, Color as wr, CustomKeymap as Nr, useEditor as Q, EditorBubbleItem as Ae, getPrevText as Ir, addAIHighlight as Sr, removeAIHighlight as Tr, EditorBubble as Mr, createImageUpload as yt, Command as Lr, createSuggestionItems as Ar, renderItems as Dr, EditorRoot as Rr, EditorContent as Pr, handleImageDrop as Br, handleImagePaste as zr, handleCommandNavigation as Er, EditorCommand as $r, EditorCommandEmpty as Hr, EditorCommandList as Or, EditorCommandItem as Fr, ImageResizer as _r } from "novel";
32
+ import { useDebouncedCallback as jr } from "use-debounce";
33
+ import { Markdown as Xr } from "tiptap-markdown";
34
+ import { cx as q, cva as Ur } from "class-variance-authority";
35
+ import { createLowlight as Gr, common as qr } from "lowlight";
36
+ import { Extension as Yr } from "@tiptap/core";
37
+ import { Plugin as Vr, PluginKey as Wr, NodeSelection as K, TextSelection as Kr } from "prosemirror-state";
38
+ import { Slice as Jr, Fragment as Zr } from "prosemirror-model";
39
+ import * as Qr from "prosemirror-view";
39
40
  import * as ve from "@radix-ui/react-popover";
40
- import { Popover as ft, PopoverTrigger as Zr } from "@radix-ui/react-popover";
41
- import { Slot as Qr } from "@radix-ui/react-slot";
42
- import { SigmaIcon as en, X as tn, Check as on, TextQuote as rn, TrashIcon as nn, RefreshCcwDot as an, CheckCheck as sn, ArrowDownWideNarrow as ln, WrapText as cn, StepForward as dn, ArrowUp as mn, BoldIcon as un, ItalicIcon as pn, UnderlineIcon as gn, StrikethroughIcon as fn, CodeIcon as hn } from "lucide-react";
43
- import * as ht from "@radix-ui/react-separator";
44
- import { useCompletion as bn } from "@ai-sdk/react";
41
+ import { Popover as vt, PopoverTrigger as en } from "@radix-ui/react-popover";
42
+ import { Slot as tn } from "@radix-ui/react-slot";
43
+ import { SigmaIcon as on, X as rn, Check as nn, TextQuote as an, TrashIcon as sn, RefreshCcwDot as ln, CheckCheck as cn, ArrowDownWideNarrow as dn, WrapText as mn, StepForward as un, ArrowUp as pn, BoldIcon as gn, ItalicIcon as fn, UnderlineIcon as hn, StrikethroughIcon as bn, CodeIcon as xn } from "lucide-react";
44
+ import * as kt from "@radix-ui/react-separator";
45
+ import { useCompletion as yn } from "@ai-sdk/react";
45
46
  import { toast as ke } from "sonner";
46
47
  import * as ce from "@radix-ui/react-scroll-area";
47
48
  import { Command as V } from "cmdk";
48
49
  import * as te from "@radix-ui/react-dialog";
49
- import xn from "highlight.js";
50
- import yn from "rc-dropdown";
51
- import Te from "rc-menu";
52
- import { generateHTML as vn } from "@tiptap/html";
53
- function kn(r, e) {
50
+ import vn from "highlight.js";
51
+ import kn from "rc-dropdown";
52
+ import Me from "rc-menu";
53
+ import { generateHTML as Cn } from "@tiptap/html";
54
+ function wn(r, e) {
54
55
  for (var o = 0; o < e.length; o++) {
55
56
  const a = e[o];
56
57
  if (typeof a != "string" && !Array.isArray(a)) {
@@ -66,7 +67,7 @@ function kn(r, e) {
66
67
  }
67
68
  return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
68
69
  }
69
- const Cn = {
70
+ const Nn = {
70
71
  common: {
71
72
  ok: "确定",
72
73
  cancel: "取消",
@@ -91,7 +92,7 @@ const Cn = {
91
92
  link: "链接",
92
93
  image: "图片"
93
94
  }
94
- }, wn = {
95
+ }, In = {
95
96
  common: {
96
97
  ok: "OK",
97
98
  cancel: "Cancel",
@@ -116,20 +117,20 @@ const Cn = {
116
117
  link: "Link",
117
118
  image: "Image"
118
119
  }
119
- }, Nn = "common";
120
- Gt.use(qt).init({
120
+ }, Sn = "common";
121
+ Vt.use(Wt).init({
121
122
  resources: {
122
- "zh-CN": Cn,
123
- "en-US": wn
123
+ "zh-CN": Nn,
124
+ "en-US": In
124
125
  },
125
126
  lng: "zh-CN",
126
127
  fallbackLng: "zh-CN",
127
- defaultNS: Nn,
128
+ defaultNS: Sn,
128
129
  interpolation: {
129
130
  escapeValue: !1
130
131
  }
131
132
  });
132
- const He = {
133
+ const Fe = {
133
134
  token: {
134
135
  itemNameColor: "#1a1a1a",
135
136
  itemIconBackgroundColor: "white",
@@ -142,7 +143,7 @@ const He = {
142
143
  contextMenuBackgroundColor: "white",
143
144
  contextMenuShadowColor: "rgba(0, 0, 0, 0.1)"
144
145
  }
145
- }, Oe = {
146
+ }, _e = {
146
147
  token: {
147
148
  itemNameColor: "white",
148
149
  itemIconBackgroundColor: "#1f2937",
@@ -155,27 +156,27 @@ const He = {
155
156
  contextMenuBackgroundColor: "#1a1a1a",
156
157
  contextMenuShadowColor: "rgba(255, 255, 255, 0.1)"
157
158
  }
158
- }, bt = Ze(
159
+ }, Ct = ot(
159
160
  {}
160
- ), xt = (r) => {
161
- const { children: e, theme: o, ...a } = r, n = fe(() => o === "light" ? He : o === "dark" ? Oe : o, [o]);
162
- return /* @__PURE__ */ t(bt.Provider, { value: { theme: n, ...a }, children: e });
163
- }, ue = () => Qe(bt), Fe = {
161
+ ), wt = (r) => {
162
+ const { children: e, theme: o, ...a } = r, n = fe(() => o === "light" ? Fe : o === "dark" ? _e : o, [o]);
163
+ return /* @__PURE__ */ t(Ct.Provider, { value: { theme: n, ...a }, children: e });
164
+ }, ue = () => rt(Ct), je = {
164
165
  maxRow: 2,
165
166
  maxCol: 2
166
- }, yt = {
167
- ...Fe
168
- }, _e = {
169
- app: Fe,
170
- group: yt
167
+ }, Nt = {
168
+ ...je
169
+ }, Xe = {
170
+ app: je,
171
+ group: Nt
171
172
  };
172
173
  class Y {
173
174
  }
174
175
  /** 清理重复id */
175
- Ie(Y, "uniqueArray", (e) => e.reduce((o, a) => o.find((s) => s.id === a.id) ? o : o.concat([a]), [])), Ie(Y, "getTheme", (e) => {
176
- const o = He.token, a = Oe.token, n = { ...o, ...e == null ? void 0 : e.token }, s = { ...a, ...e == null ? void 0 : e.token };
176
+ Se(Y, "uniqueArray", (e) => e.reduce((o, a) => o.find((s) => s.id === a.id) ? o : o.concat([a]), [])), Se(Y, "getTheme", (e) => {
177
+ const o = Fe.token, a = _e.token, n = { ...o, ...e == null ? void 0 : e.token }, s = { ...a, ...e == null ? void 0 : e.token };
177
178
  return { light: n, dark: s };
178
- }), Ie(Y, "quickJSONCheck", (e) => {
179
+ }), Se(Y, "quickJSONCheck", (e) => {
179
180
  if (typeof e != "string" || e.trim() === "") return !1;
180
181
  if (!/^\s*(\{.*\}|\[.*\])\s*$/.test(e))
181
182
  return /^\s*(".*?"|[\d.]+|true|false|null)\s*$/.test(e);
@@ -185,7 +186,7 @@ Ie(Y, "uniqueArray", (e) => e.reduce((o, a) => o.find((s) => s.id === a.id) ? o
185
186
  return !1;
186
187
  }
187
188
  });
188
- const vt = Ze({
189
+ const It = ot({
189
190
  list: [],
190
191
  setList: () => {
191
192
  },
@@ -220,57 +221,57 @@ const vt = Ze({
220
221
  moveTargetId: null,
221
222
  setMoveTargetId: () => {
222
223
  }
223
- }), kt = (r) => {
224
+ }), St = (r) => {
224
225
  const {
225
226
  children: e,
226
227
  list: o = [],
227
228
  onChange: a,
228
229
  storageKey: n = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
229
230
  enableCaching: s = !0
230
- } = r, [i, m] = H(), [p, C] = H(), [l, c] = H(null), b = he(l), [x, A] = H(null), [h, g] = H([]), [N, v] = H(
231
+ } = r, [i, c] = H(), [p, k] = H(), [l, d] = H(null), b = he(l), [x, A] = H(null), [f, h] = H([]), [w, v] = H(
231
232
  null
232
233
  ), [I, u] = H(
233
234
  null
234
- ), [T, D] = H(!1), [w, k] = H(null), [U, Z] = H(
235
+ ), [T, R] = H(!1), [N, C] = H(null), [X, Z] = H(
235
236
  null
236
- ), [_, ae] = H(!1), [oe, S] = Jt(n, {
237
+ ), [_, ae] = H(!1), [oe, S] = Qt(n, {
237
238
  defaultValue: [],
238
239
  listenStorageChange: !0
239
240
  }), O = () => {
240
- A(null), clearTimeout(i), m(void 0), b.current = null;
241
- }, B = (M, X) => {
242
- A({ ...M, pageX: M.pageX, pageY: M.pageY, data: X }), clearTimeout(i);
243
- }, W = (M, X = !0) => {
241
+ A(null), clearTimeout(i), c(void 0), b.current = null;
242
+ }, B = (M, U) => {
243
+ A({ ...M, pageX: M.pageX, pageY: M.pageY, data: U }), clearTimeout(i);
244
+ }, W = (M, U = !0) => {
244
245
  const { config: F = {} } = M;
245
246
  return F.allowContextMenu === !1 ? {} : {
246
247
  onMouseDown: (E) => {
247
- m(
248
+ c(
248
249
  setTimeout(() => {
249
- X && b.current === null && B(E, M);
250
+ U && b.current === null && B(E, M);
250
251
  }, 800)
251
- ), D(!1), C(
252
+ ), R(!1), k(
252
253
  setTimeout(() => {
253
- D(!0);
254
+ R(!0);
254
255
  }, 800)
255
256
  );
256
257
  },
257
258
  onMouseUp: () => {
258
- clearTimeout(p), C(void 0), clearTimeout(i), m(void 0);
259
+ clearTimeout(p), k(void 0), clearTimeout(i), c(void 0);
259
260
  },
260
261
  onContextMenu: (E) => {
261
- X && (E.preventDefault(), B(E, M));
262
+ U && (E.preventDefault(), B(E, M));
262
263
  }
263
264
  };
264
- }, re = (M, X) => {
265
- const F = [...X || []];
265
+ }, re = (M, U) => {
266
+ const F = [...U || []];
266
267
  if (F.length > 0)
267
- g((E) => {
268
+ h((E) => {
268
269
  const P = [...E], z = (L) => {
269
- var Ge, qe;
270
+ var We, Ke;
270
271
  const $ = F.shift(), j = L.find((ne) => ne.id === $), ee = L.findIndex((ne) => ne.id === $);
271
272
  if (F.length && j) {
272
- if (((Ge = j.children) == null ? void 0 : Ge.filter(
273
- (ne) => !M.some((jt) => jt.id === ne.id)
273
+ if (((We = j.children) == null ? void 0 : We.filter(
274
+ (ne) => !M.some((Gt) => Gt.id === ne.id)
274
275
  ).length) === 1 && M.length === 1) {
275
276
  const ne = { ...M[0] };
276
277
  return L.splice(ee, 1, ne), a == null || a(L), L;
@@ -278,9 +279,9 @@ const vt = Ze({
278
279
  return j.children = z(j.children || []), L.splice(ee, 1, j), a == null || a(L), L;
279
280
  }
280
281
  if (j) {
281
- if (!((qe = j.children) != null && qe.length) && M.length) {
282
+ if (!((Ke = j.children) != null && Ke.length) && M.length) {
282
283
  const ne = { ...j };
283
- return j.data = { name: "文件夹" }, j.type = "group", j.children = [ne, ...M], j.id = Ye(), L.splice(ee, 1, j), a == null || a(L), L;
284
+ return j.data = { name: "文件夹" }, j.type = "group", j.children = [ne, ...M], j.id = Je(), L.splice(ee, 1, j), a == null || a(L), L;
284
285
  }
285
286
  return j.children = Y.uniqueArray(M), L.splice(ee, 1, j), a == null || a(L), L;
286
287
  }
@@ -290,35 +291,35 @@ const vt = Ze({
290
291
  });
291
292
  else {
292
293
  const E = Y.uniqueArray(M);
293
- a == null || a(E), g(E);
294
+ a == null || a(E), h(E);
294
295
  }
295
- }, Re = (M, X) => {
296
- g((F) => {
296
+ }, Pe = (M, U) => {
297
+ h((F) => {
297
298
  const E = [...F], P = (z) => {
298
299
  var L;
299
300
  for (let $ = 0; $ < z.length; $++)
300
301
  if (z[$].id === M) {
301
- z[$].config = X;
302
+ z[$].config = U;
302
303
  break;
303
304
  } else ((L = z[$].children) == null ? void 0 : L.length) !== void 0 && P(z[$].children);
304
305
  };
305
306
  return P(E), a == null || a(E), E;
306
307
  });
307
- }, we = (M, X) => {
308
- g((F) => {
308
+ }, Ne = (M, U) => {
309
+ h((F) => {
309
310
  const E = [...F], P = (z) => {
310
311
  var L;
311
312
  for (let $ = 0; $ < z.length; $++)
312
313
  if (z[$].id === M) {
313
- z[$].data = X;
314
+ z[$].data = U;
314
315
  break;
315
316
  } else ((L = z[$].children) == null ? void 0 : L.length) !== void 0 && P(z[$].children);
316
317
  };
317
318
  return P(E), a == null || a(E), E;
318
319
  });
319
- }, Ne = (M) => {
320
- g((X) => {
321
- const F = [...X], E = (P) => {
320
+ }, Ie = (M) => {
321
+ h((U) => {
322
+ const F = [...U], E = (P) => {
322
323
  var z;
323
324
  for (let L = 0; L < P.length; L++)
324
325
  if (P[L].id === M) {
@@ -328,8 +329,8 @@ const vt = Ze({
328
329
  };
329
330
  return E(F), a == null || a(F), F;
330
331
  });
331
- }, se = (M, X) => {
332
- const F = [...h], E = (P, z) => {
332
+ }, se = (M, U) => {
333
+ const F = [...f], E = (P, z) => {
333
334
  const L = z.shift(), $ = P.find((ee) => ee.id === L), j = P.findIndex((ee) => ee.id === L);
334
335
  if ($) {
335
336
  if (z.length)
@@ -340,8 +341,8 @@ const vt = Ze({
340
341
  ...$.children ?? [],
341
342
  {
342
343
  ...M,
343
- id: Ye(),
344
- config: (M == null ? void 0 : M.config) ?? _e[ee]
344
+ id: Je(),
345
+ config: (M == null ? void 0 : M.config) ?? Xe[ee]
345
346
  }
346
347
  ];
347
348
  }
@@ -349,64 +350,64 @@ const vt = Ze({
349
350
  } else
350
351
  return P;
351
352
  };
352
- g(E(F, X));
353
+ h(E(F, U));
353
354
  };
354
355
  return ie(() => {
355
- (o == null ? void 0 : o.length) > 0 && h.length === 0 && re(o);
356
+ (o == null ? void 0 : o.length) > 0 && f.length === 0 && re(o);
356
357
  }, [o]), ie(() => {
357
358
  b.current = l, l !== null && O();
358
359
  }, [l]), ie(() => {
359
360
  s && oe != null && oe.length && !_ && (re(oe), ae(!0));
360
- }, [oe, _, s]), Zt(
361
+ }, [oe, _, s]), eo(
361
362
  () => {
362
- s && S(h);
363
+ s && S(f);
363
364
  },
364
- [h, s],
365
+ [f, s],
365
366
  {
366
367
  wait: 1e3
367
368
  }
368
369
  ), /* @__PURE__ */ t(
369
- vt.Provider,
370
+ It.Provider,
370
371
  {
371
372
  value: {
372
- list: h,
373
+ list: f,
373
374
  setList: re,
374
375
  contextMenu: x,
375
376
  setContextMenu: A,
376
377
  listStatus: l,
377
- setListStatus: c,
378
+ setListStatus: d,
378
379
  contextMenuFuns: W,
379
380
  hideContextMenu: O,
380
- showInfoItemData: N,
381
+ showInfoItemData: w,
381
382
  setShowInfoItemData: v,
382
383
  openGroupItemData: I,
383
384
  setOpenGroupItemData: u,
384
385
  longPressTriggered: T,
385
- updateItemConfig: Re,
386
- updateItem: we,
387
- removeItem: Ne,
386
+ updateItemConfig: Pe,
387
+ updateItem: Ne,
388
+ removeItem: Ie,
388
389
  addItem: se,
389
- moveItemId: w,
390
- setMoveItemId: k,
391
- moveTargetId: U,
390
+ moveItemId: N,
391
+ setMoveItemId: C,
392
+ moveTargetId: X,
392
393
  setMoveTargetId: Z
393
394
  },
394
395
  children: e
395
396
  }
396
397
  );
397
- }, be = () => Qe(vt), In = {
398
+ }, be = () => rt(It), Tn = {
398
399
  menuShow: {
399
400
  opacity: 1,
400
401
  y: 0,
401
402
  transition: { type: "spring", stiffness: 300, damping: 24 }
402
403
  },
403
404
  menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
404
- }, De = (r) => {
405
+ }, Be = (r) => {
405
406
  const { icon: e, title: o, onClick: a } = r, { theme: n } = ue(), { light: s, dark: i } = Y.getTheme(n);
406
407
  return /* @__PURE__ */ t(
407
- R.div,
408
+ D.div,
408
409
  {
409
- className: f`
410
+ className: g`
410
411
  &:hover {
411
412
  background-color: ${s.contextMenuActiveColor};
412
413
  @media (prefers-color-scheme: dark) {
@@ -423,16 +424,16 @@ const vt = Ze({
423
424
  user-select: none;
424
425
  border-radius: 0.5rem;
425
426
  `,
426
- onClick: (m) => {
427
- m.stopPropagation(), a == null || a();
427
+ onClick: (c) => {
428
+ c.stopPropagation(), a == null || a();
428
429
  },
429
- variants: In,
430
- children: /* @__PURE__ */ d(
431
- R.div,
430
+ variants: Tn,
431
+ children: /* @__PURE__ */ m(
432
+ D.div,
432
433
  {
433
434
  className: y(
434
435
  "py-1.5 px-3 rounded-lg",
435
- f`
436
+ g`
436
437
  padding-top: 0.375rem;
437
438
  padding-bottom: 0.375rem;
438
439
  padding-left: 0.75rem;
@@ -443,10 +444,10 @@ const vt = Ze({
443
444
  whileTap: { scale: 0.9 },
444
445
  children: [
445
446
  /* @__PURE__ */ t(
446
- R.div,
447
+ D.div,
447
448
  {
448
449
  className: y(
449
- f`
450
+ g`
450
451
  margin-bottom: 0.375rem;
451
452
  display: flex;
452
453
  justify-content: center;
@@ -455,13 +456,13 @@ const vt = Ze({
455
456
  children: e
456
457
  }
457
458
  ),
458
- /* @__PURE__ */ t(R.div, { children: o })
459
+ /* @__PURE__ */ t(D.div, { children: o })
459
460
  ]
460
461
  }
461
462
  )
462
463
  }
463
464
  );
464
- }, Sn = (r) => {
465
+ }, Mn = (r) => {
465
466
  const {
466
467
  showInfoButton: e = !0,
467
468
  showRemoveButton: o = !0,
@@ -469,24 +470,24 @@ const vt = Ze({
469
470
  showSizeButton: n = !0,
470
471
  onInfoClick: s,
471
472
  onShareClick: i,
472
- onRemoveClick: m
473
+ onRemoveClick: c
473
474
  } = r, {
474
475
  contextMenu: p,
475
- setContextMenu: C,
476
+ setContextMenu: k,
476
477
  hideContextMenu: l,
477
- setShowInfoItemData: c,
478
+ setShowInfoItemData: d,
478
479
  removeItem: b,
479
480
  updateItemConfig: x
480
- } = be(), { theme: A } = ue(), { light: h, dark: g } = Y.getTheme(A), { data: N } = p ?? {}, { config: v = {} } = N ?? {}, I = () => {
481
- var D;
482
- const u = _e[(D = p == null ? void 0 : p.data) == null ? void 0 : D.type], T = [];
483
- for (let w = 1; w <= ((u == null ? void 0 : u.maxRow) ?? 2); w++)
484
- for (let k = 1; k <= ((u == null ? void 0 : u.maxCol) ?? 2); k++)
485
- T.push(`${w}x${k}`);
481
+ } = be(), { theme: A } = ue(), { light: f, dark: h } = Y.getTheme(A), { data: w } = p ?? {}, { config: v = {} } = w ?? {}, I = () => {
482
+ var R;
483
+ const u = Xe[(R = p == null ? void 0 : p.data) == null ? void 0 : R.type], T = [];
484
+ for (let N = 1; N <= ((u == null ? void 0 : u.maxRow) ?? 2); N++)
485
+ for (let C = 1; C <= ((u == null ? void 0 : u.maxCol) ?? 2); C++)
486
+ T.push(`${N}x${C}`);
486
487
  return T;
487
488
  };
488
- return /* @__PURE__ */ t(Ee, { children: p && /* @__PURE__ */ d(
489
- R.div,
489
+ return /* @__PURE__ */ t(He, { children: p && /* @__PURE__ */ m(
490
+ D.div,
490
491
  {
491
492
  initial: { opacity: 0 },
492
493
  animate: { opacity: 1 },
@@ -496,24 +497,24 @@ const vt = Ze({
496
497
  },
497
498
  children: [
498
499
  /* @__PURE__ */ t(
499
- R.div,
500
+ D.div,
500
501
  {
501
502
  className: y(
502
- f`
503
+ g`
503
504
  border-radius: 0.5rem;
504
505
  overflow: hidden;
505
- background-color: ${h.contextMenuBackgroundColor};
506
- box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
506
+ background-color: ${f.contextMenuBackgroundColor};
507
+ box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
507
508
  @media (prefers-color-scheme: dark) {
508
- background-color: ${g.contextMenuBackgroundColor};
509
- box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
509
+ background-color: ${h.contextMenuBackgroundColor};
510
+ box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
510
511
  }
511
512
  `
512
513
  ),
513
514
  children: n && v.allowResize !== !1 && /* @__PURE__ */ t(
514
- R.ul,
515
+ D.ul,
515
516
  {
516
- className: f`
517
+ className: g`
517
518
  background-color: white;
518
519
  padding: 0.25rem;
519
520
  margin: 0;
@@ -522,33 +523,33 @@ const vt = Ze({
522
523
  {
523
524
  label: "修改大小",
524
525
  key: "size",
525
- icon: /* @__PURE__ */ t(Qt, { size: 14 }),
526
+ icon: /* @__PURE__ */ t(to, { size: 14 }),
526
527
  items: I().map((u) => ({
527
528
  label: u,
528
529
  key: u,
529
530
  onClick: () => {
530
- const [T, D] = u.split("x").map(Number);
531
+ const [T, R] = u.split("x").map(Number);
531
532
  x(p.data.id, {
532
533
  row: T,
533
- col: D
534
+ col: R
534
535
  });
535
536
  }
536
537
  }))
537
538
  }
538
- ].map((u) => /* @__PURE__ */ d(
539
- R.li,
539
+ ].map((u) => /* @__PURE__ */ m(
540
+ D.li,
540
541
  {
541
- className: f`
542
+ className: g`
542
543
  padding-top: 0.5rem;
543
544
  padding-bottom: 0.5rem;
544
545
  padding-left: 0.75rem;
545
546
  padding-right: 0.75rem;
546
547
  `,
547
548
  children: [
548
- /* @__PURE__ */ d(
549
- R.p,
549
+ /* @__PURE__ */ m(
550
+ D.p,
550
551
  {
551
- className: f`
552
+ className: g`
552
553
  display: flex;
553
554
  align-items: center;
554
555
  font-size: 0.875rem;
@@ -565,19 +566,19 @@ const vt = Ze({
565
566
  }
566
567
  ),
567
568
  /* @__PURE__ */ t(
568
- R.div,
569
+ D.div,
569
570
  {
570
- className: f`
571
+ className: g`
571
572
  display: grid;
572
573
  grid-template-columns: repeat(2, minmax(0, 1fr));
573
574
  gap: 0.25rem;
574
575
  `,
575
576
  children: u.items.map((T) => /* @__PURE__ */ t(
576
- R.div,
577
+ D.div,
577
578
  {
578
579
  className: y(
579
580
  "py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",
580
- f`
581
+ g`
581
582
  padding-top: 0.25rem;
582
583
  padding-bottom: 0.25rem;
583
584
  padding-left: 0.5rem;
@@ -588,21 +589,21 @@ const vt = Ze({
588
589
  line-height: 1.25rem;
589
590
  cursor: pointer;
590
591
  text-align: center;
591
- color: ${h.contextMenuTextColor};
592
+ color: ${f.contextMenuTextColor};
592
593
  @media (prefers-color-scheme: dark) {
593
- color: ${g.contextMenuTextColor};
594
+ color: ${h.contextMenuTextColor};
594
595
  }
595
596
  &:hover {
596
- background-color: ${h.contextMenuActiveColor};
597
+ background-color: ${f.contextMenuActiveColor};
597
598
  @media (prefers-color-scheme: dark) {
598
- background-color: ${g.contextMenuActiveColor};
599
+ background-color: ${h.contextMenuActiveColor};
599
600
  }
600
601
  }
601
602
  `,
602
- `${v.row}x${v.col}` === T.key && f`
603
- background-color: ${h.contextMenuActiveColor};
603
+ `${v.row}x${v.col}` === T.key && g`
604
+ background-color: ${f.contextMenuActiveColor};
604
605
  @media (prefers-color-scheme: dark) {
605
- background-color: ${g.contextMenuActiveColor};
606
+ background-color: ${h.contextMenuActiveColor};
606
607
  }
607
608
  `
608
609
  ),
@@ -621,16 +622,16 @@ const vt = Ze({
621
622
  )
622
623
  }
623
624
  ),
624
- /* @__PURE__ */ d(
625
- R.div,
625
+ /* @__PURE__ */ m(
626
+ D.div,
626
627
  {
627
628
  className: y(
628
- f`
629
- background-color: ${h.contextMenuBackgroundColor};
630
- box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
629
+ g`
630
+ background-color: ${f.contextMenuBackgroundColor};
631
+ box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
631
632
  @media (prefers-color-scheme: dark) {
632
- background-color: ${g.contextMenuBackgroundColor};
633
- box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
633
+ background-color: ${h.contextMenuBackgroundColor};
634
+ box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
634
635
  }
635
636
  display: flex;
636
637
  justify-content: space-around;
@@ -643,9 +644,9 @@ const vt = Ze({
643
644
  ),
644
645
  children: [
645
646
  a && /* @__PURE__ */ t(
646
- De,
647
+ Be,
647
648
  {
648
- icon: /* @__PURE__ */ t(eo, { size: 20 }),
649
+ icon: /* @__PURE__ */ t(oo, { size: 20 }),
649
650
  title: "分享",
650
651
  onClick: () => {
651
652
  if (i) {
@@ -656,16 +657,16 @@ const vt = Ze({
656
657
  }
657
658
  ),
658
659
  e && /* @__PURE__ */ t(
659
- De,
660
+ Be,
660
661
  {
661
- icon: /* @__PURE__ */ t(to, { size: 20 }),
662
+ icon: /* @__PURE__ */ t(ro, { size: 20 }),
662
663
  title: "信息",
663
664
  onClick: () => {
664
665
  if (s) {
665
666
  s(p.data);
666
667
  return;
667
668
  }
668
- c({
669
+ d({
669
670
  ...p.data,
670
671
  pageX: p.pageX,
671
672
  pageY: p.pageY
@@ -674,16 +675,16 @@ const vt = Ze({
674
675
  }
675
676
  ),
676
677
  o && /* @__PURE__ */ t(
677
- De,
678
+ Be,
678
679
  {
679
- icon: /* @__PURE__ */ t(oo, { size: 20 }),
680
+ icon: /* @__PURE__ */ t(no, { size: 20 }),
680
681
  title: "移除",
681
682
  onClick: () => {
682
- if (m) {
683
- m(p.data, b);
683
+ if (c) {
684
+ c(p.data, b);
684
685
  return;
685
686
  }
686
- C(null), b(p.data.id);
687
+ k(null), b(p.data.id);
687
688
  }
688
689
  }
689
690
  )
@@ -693,18 +694,18 @@ const vt = Ze({
693
694
  ]
694
695
  }
695
696
  ) });
696
- }, Tn = (r) => {
697
- const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: a } = be(), { itemIconBuilder: n, theme: s, contextMenu: i } = ue(), { light: m, dark: p } = Y.getTheme(s), { data: C = {} } = e, { name: l } = C;
698
- return /* @__PURE__ */ d(me, { children: [
697
+ }, Ln = (r) => {
698
+ const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: a } = be(), { itemIconBuilder: n, theme: s, contextMenu: i } = ue(), { light: c, dark: p } = Y.getTheme(s), { data: k = {} } = e, { name: l } = k;
699
+ return /* @__PURE__ */ m(me, { children: [
699
700
  /* @__PURE__ */ t(
700
- R.div,
701
+ D.div,
701
702
  {
702
- className: f`
703
+ className: g`
703
704
  width: 4rem;
704
705
  height: 4rem;
705
- background-color: ${m.itemIconBackgroundColor};
706
+ background-color: ${c.itemIconBackgroundColor};
706
707
  border-radius: 0.75rem;
707
- box-shadow: 0 0 0.5rem ${m.itemIconShadowColor};
708
+ box-shadow: 0 0 0.5rem ${c.itemIconShadowColor};
708
709
  cursor: pointer;
709
710
  position: relative;
710
711
  overflow: hidden;
@@ -717,13 +718,13 @@ const vt = Ze({
717
718
  children: /* @__PURE__ */ t(
718
719
  "div",
719
720
  {
720
- className: f`
721
+ className: g`
721
722
  position: absolute;
722
723
  left: 0;
723
724
  top: 0;
724
725
  width: 100%;
725
726
  height: 100%;
726
- color: ${m.itemNameColor};
727
+ color: ${c.itemNameColor};
727
728
  @media (prefers-color-scheme: dark) {
728
729
  color: ${p.itemNameColor};
729
730
  }
@@ -735,19 +736,19 @@ const vt = Ze({
735
736
  }
736
737
  ),
737
738
  /* @__PURE__ */ t(
738
- R.p,
739
+ D.p,
739
740
  {
740
741
  className: y(
741
- f`
742
+ g`
742
743
  text-align: center;
743
744
  margin-top: 0.25rem;
744
745
  margin-bottom: 0;
745
- color: ${m.itemNameColor};
746
+ color: ${c.itemNameColor};
746
747
  @media (prefers-color-scheme: dark) {
747
748
  color: ${p.itemNameColor};
748
749
  }
749
750
  `,
750
- o && f`
751
+ o && g`
751
752
  color: transparent;
752
753
  `
753
754
  ),
@@ -755,7 +756,7 @@ const vt = Ze({
755
756
  }
756
757
  )
757
758
  ] });
758
- }, je = (r) => {
759
+ }, Ue = (r) => {
759
760
  const {
760
761
  data: e,
761
762
  className: o,
@@ -763,14 +764,14 @@ const vt = Ze({
763
764
  onClick: n,
764
765
  disabledDrag: s = !1,
765
766
  children: i,
766
- parentIds: m,
767
+ parentIds: c,
767
768
  childrenLength: p
768
- } = r, { contextMenu: C, setContextMenu: l } = be(), { contextMenu: c } = ue();
769
+ } = r, { contextMenu: k, setContextMenu: l } = be(), { contextMenu: d } = ue();
769
770
  return /* @__PURE__ */ t(
770
- et,
771
+ at,
771
772
  {
772
773
  placement: "bottom",
773
- overlayClassName: f`
774
+ overlayClassName: g`
774
775
  background-color: transparent;
775
776
  .rc-tooltip-inner {
776
777
  background-color: transparent;
@@ -778,27 +779,27 @@ const vt = Ze({
778
779
  border: none;
779
780
  }
780
781
  `,
781
- overlay: /* @__PURE__ */ t(Sn, { ...c }),
782
- visible: (C == null ? void 0 : C.data.id) === e.id,
782
+ overlay: /* @__PURE__ */ t(Mn, { ...d }),
783
+ visible: (k == null ? void 0 : k.data.id) === e.id,
783
784
  onVisibleChange: (b) => {
784
785
  b || l(null);
785
786
  },
786
787
  destroyTooltipOnHide: !0,
787
788
  children: /* @__PURE__ */ t(
788
- R.div,
789
+ D.div,
789
790
  {
790
791
  "data-id": e.id,
791
792
  "data-index": a,
792
- "data-parent-ids": m == null ? void 0 : m.join(","),
793
+ "data-parent-ids": c == null ? void 0 : c.join(","),
793
794
  "data-children-length": p,
794
795
  onClick: () => n == null ? void 0 : n(e),
795
796
  className: y(s && "drag-disabled", o),
796
- children: i ?? /* @__PURE__ */ t(Tn, { ...r })
797
+ children: i ?? /* @__PURE__ */ t(Ln, { ...r })
797
798
  }
798
799
  )
799
800
  }
800
801
  );
801
- }, Mn = (r) => {
802
+ }, An = (r) => {
802
803
  const {
803
804
  data: e,
804
805
  className: o,
@@ -807,18 +808,18 @@ const vt = Ze({
807
808
  onClick: s,
808
809
  noLetters: i = !1
809
810
  } = r, {
810
- contextMenuFuns: m,
811
+ contextMenuFuns: c,
811
812
  setList: p,
812
- setOpenGroupItemData: C,
813
+ setOpenGroupItemData: k,
813
814
  longPressTriggered: l,
814
- moveItemId: c,
815
+ moveItemId: d,
815
816
  moveTargetId: b,
816
817
  setMoveTargetId: x,
817
818
  listStatus: A
818
- } = be(), { itemIconBuilder: h, theme: g, contextMenu: N } = ue(), { light: v, dark: I } = Y.getTheme(g), { children: u, data: T, config: D } = e, { row: w = 1, col: k = 1 } = D ?? {}, U = {
819
+ } = be(), { itemIconBuilder: f, theme: h, contextMenu: w } = ue(), { light: v, dark: I } = Y.getTheme(h), { children: u, data: T, config: R } = e, { row: N = 1, col: C = 1 } = R ?? {}, X = {
819
820
  visible: { opacity: 1, scale: 1 },
820
821
  hidden: { opacity: 0, scale: 0.95 }
821
- }, Z = ((u == null ? void 0 : u.length) ?? 0) === 0, _ = Z ? [e] : [...u ?? []].slice(0, 9), ae = fe(() => c === e.id.toString(), [e.id, c]), oe = fe(() => b === e.id, [e.id, b]), S = f`
822
+ }, Z = ((u == null ? void 0 : u.length) ?? 0) === 0, _ = Z ? [e] : [...u ?? []].slice(0, 9), ae = fe(() => d === e.id.toString(), [e.id, d]), oe = fe(() => b === e.id, [e.id, b]), S = g`
822
823
  overflow: hidden;
823
824
  cursor: pointer;
824
825
  background-color: ${v.itemIconBackgroundColor};
@@ -830,11 +831,11 @@ const vt = Ze({
830
831
  `, O = () => {
831
832
  if (Z)
832
833
  return /* @__PURE__ */ t(
833
- R.div,
834
+ D.div,
834
835
  {
835
836
  className: y(
836
837
  "sortable-group-item",
837
- f`
838
+ g`
838
839
  overflow: hidden;
839
840
  cursor: pointer;
840
841
  width: 100%;
@@ -852,30 +853,30 @@ const vt = Ze({
852
853
  onClick: (B) => {
853
854
  B.stopPropagation(), s == null || s(e);
854
855
  },
855
- children: h == null ? void 0 : h(e)
856
+ children: f == null ? void 0 : f(e)
856
857
  }
857
858
  );
858
- if (w === 1 && k === 1 || w === 2 && k === 2)
859
+ if (N === 1 && C === 1 || N === 2 && C === 2)
859
860
  return /* @__PURE__ */ t(
860
- R.div,
861
+ D.div,
861
862
  {
862
- className: f`
863
+ className: g`
863
864
  display: grid;
864
865
  width: 100%;
865
866
  height: 100%;
866
867
  grid-template-columns: repeat(3, minmax(0, 1fr));
867
868
  grid-template-rows: repeat(3, minmax(0, 1fr));
868
- padding: ${k === 1 ? "0.125rem" : "0.25rem"};
869
- gap: ${k === 1 ? "0.125rem" : "0.5rem"};
869
+ padding: ${C === 1 ? "0.125rem" : "0.25rem"};
870
+ gap: ${C === 1 ? "0.125rem" : "0.5rem"};
870
871
  place-items: center;
871
872
  `,
872
873
  children: _ == null ? void 0 : _.slice(0, 9).map((B) => /* @__PURE__ */ t(
873
- R.div,
874
+ D.div,
874
875
  {
875
876
  className: y(
876
877
  S,
877
- f`
878
- border-radius: ${k === 1 ? "0.25rem" : "0.5rem"};
878
+ g`
879
+ border-radius: ${C === 1 ? "0.25rem" : "0.5rem"};
879
880
  width: 100%;
880
881
  height: 100%;
881
882
  `
@@ -883,17 +884,17 @@ const vt = Ze({
883
884
  onClick: (W) => {
884
885
  W.stopPropagation(), s == null || s(B);
885
886
  },
886
- children: h == null ? void 0 : h(B)
887
+ children: f == null ? void 0 : f(B)
887
888
  },
888
889
  B.id
889
890
  ))
890
891
  }
891
892
  );
892
- if (w === 1 && k === 2)
893
+ if (N === 1 && C === 2)
893
894
  return /* @__PURE__ */ t(
894
- R.div,
895
+ D.div,
895
896
  {
896
- className: f`
897
+ className: g`
897
898
  display: grid;
898
899
  grid-template-columns: repeat(10, minmax(0, 1fr));
899
900
  grid-template-rows: repeat(4, minmax(0, 1fr));
@@ -904,17 +905,17 @@ const vt = Ze({
904
905
  place-items: center;
905
906
  `,
906
907
  children: _ == null ? void 0 : _.slice(0, 4).map((B, W) => /* @__PURE__ */ t(
907
- R.div,
908
+ D.div,
908
909
  {
909
910
  className: y(
910
911
  S,
911
- W < 2 ? f`
912
+ W < 2 ? g`
912
913
  width: 52px;
913
914
  height: 52px;
914
915
  border-radius: 0.5rem;
915
916
  grid-column: span 4 / span 4;
916
917
  grid-row: span 4 / span 4;
917
- ` : f`
918
+ ` : g`
918
919
  width: 1.5rem;
919
920
  height: 1.5rem;
920
921
  border-radius: 0.375rem;
@@ -925,17 +926,17 @@ const vt = Ze({
925
926
  onClick: (re) => {
926
927
  W > 2 || (re.stopPropagation(), s == null || s(B));
927
928
  },
928
- children: h == null ? void 0 : h(B)
929
+ children: f == null ? void 0 : f(B)
929
930
  },
930
931
  B.id
931
932
  ))
932
933
  }
933
934
  );
934
- if (w === 2 && k === 1)
935
+ if (N === 2 && C === 1)
935
936
  return /* @__PURE__ */ t(
936
- R.div,
937
+ D.div,
937
938
  {
938
- className: f`
939
+ className: g`
939
940
  display: grid;
940
941
  grid-template-columns: repeat(4, minmax(0, 1fr));
941
942
  grid-template-rows: repeat(10, minmax(0, 1fr));
@@ -946,17 +947,17 @@ const vt = Ze({
946
947
  place-items: center;
947
948
  `,
948
949
  children: _ == null ? void 0 : _.slice(0, 4).map((B, W) => /* @__PURE__ */ t(
949
- R.div,
950
+ D.div,
950
951
  {
951
952
  className: y(
952
953
  S,
953
- W < 2 ? f`
954
+ W < 2 ? g`
954
955
  width: 52px;
955
956
  height: 52px;
956
957
  border-radius: 0.5rem;
957
958
  grid-column: span 4 / span 4;
958
959
  grid-row: span 4 / span 4;
959
- ` : f`
960
+ ` : g`
960
961
  width: 1.5rem;
961
962
  height: 1.5rem;
962
963
  grid-column: span 2 / span 2;
@@ -966,35 +967,35 @@ const vt = Ze({
966
967
  onClick: (re) => {
967
968
  W > 2 || (re.stopPropagation(), s == null || s(B));
968
969
  },
969
- children: h == null ? void 0 : h(B)
970
+ children: f == null ? void 0 : f(B)
970
971
  },
971
972
  B.id
972
973
  ))
973
974
  }
974
975
  );
975
976
  };
976
- return /* @__PURE__ */ d(
977
- je,
977
+ return /* @__PURE__ */ m(
978
+ Ue,
978
979
  {
979
980
  data: e,
980
981
  itemIndex: n,
981
982
  parentIds: a,
982
983
  childrenLength: u == null ? void 0 : u.length,
983
984
  className: y(
984
- f`
985
- grid-row: span ${w};
986
- grid-column: span ${k};
985
+ g`
986
+ grid-row: span ${N};
987
+ grid-column: span ${C};
987
988
  `,
988
989
  o
989
990
  ),
990
991
  children: [
991
992
  /* @__PURE__ */ t(
992
- R.div,
993
+ D.div,
993
994
  {
994
995
  whileTap: { scale: 0.9 },
995
996
  className: y(
996
997
  oe ? "!scale-110" : "",
997
- f`
998
+ g`
998
999
  cursor: pointer;
999
1000
  position: relative;
1000
1001
  border-radius: 0.75rem;
@@ -1007,18 +1008,18 @@ const vt = Ze({
1007
1008
  /* overflow: hidden; */
1008
1009
  transition: all 0.3s;
1009
1010
  margin: 0 auto;
1010
- width: ${k * 64 + 32 * (k - 1)}px;
1011
- height: ${w * 64 + 32 * (w - 1)}px;
1011
+ width: ${C * 64 + 32 * (C - 1)}px;
1012
+ height: ${N * 64 + 32 * (N - 1)}px;
1012
1013
  `
1013
1014
  ),
1014
1015
  onClick: (B) => {
1015
- !Z && !l && (e.parentIds = a, e.pageX = B.pageX, e.pageY = B.pageY, C(e));
1016
+ !Z && !l && (e.parentIds = a, e.pageX = B.pageX, e.pageY = B.pageY, k(e));
1016
1017
  },
1017
- ...m(e, N !== !1),
1018
- children: /* @__PURE__ */ d(
1019
- R.div,
1018
+ ...c(e, w !== !1),
1019
+ children: /* @__PURE__ */ m(
1020
+ D.div,
1020
1021
  {
1021
- className: f`
1022
+ className: g`
1022
1023
  position: relative;
1023
1024
  width: 100%;
1024
1025
  height: 100%;
@@ -1030,11 +1031,11 @@ const vt = Ze({
1030
1031
  children: [
1031
1032
  O(),
1032
1033
  /* @__PURE__ */ t(
1033
- ze,
1034
+ $e,
1034
1035
  {
1035
1036
  className: y(
1036
1037
  "sortable-group-item",
1037
- f`
1038
+ g`
1038
1039
  position: absolute;
1039
1040
  cursor: pointer;
1040
1041
  left: 0.375rem;
@@ -1065,10 +1066,10 @@ const vt = Ze({
1065
1066
  }
1066
1067
  ),
1067
1068
  /* @__PURE__ */ t(
1068
- R.p,
1069
+ D.p,
1069
1070
  {
1070
1071
  className: y(
1071
- f`
1072
+ g`
1072
1073
  text-align: center;
1073
1074
  margin-top: 0.25rem;
1074
1075
  margin-bottom: 0;
@@ -1077,11 +1078,11 @@ const vt = Ze({
1077
1078
  color: ${I.itemNameColor};
1078
1079
  }
1079
1080
  `,
1080
- i && f`
1081
+ i && g`
1081
1082
  color: transparent;
1082
1083
  `
1083
1084
  ),
1084
- variants: U,
1085
+ variants: X,
1085
1086
  animate: ae ? "hidden" : "visible",
1086
1087
  children: (T == null ? void 0 : T.name) ?? "文件夹"
1087
1088
  }
@@ -1089,7 +1090,7 @@ const vt = Ze({
1089
1090
  ]
1090
1091
  }
1091
1092
  );
1092
- }, Ct = f`
1093
+ }, Tt = g`
1093
1094
  padding: 8px;
1094
1095
  transition: all 0.2s;
1095
1096
  > div {
@@ -1101,20 +1102,20 @@ const vt = Ze({
1101
1102
  transition: all 0.2s;
1102
1103
  }
1103
1104
  }
1104
- `, Ln = (r) => {
1105
+ `, Dn = (r) => {
1105
1106
  const { data: e, onClose: o, onItemClick: a } = r, {
1106
1107
  list: n,
1107
1108
  setList: s,
1108
1109
  setListStatus: i,
1109
- setMoveItemId: m,
1110
+ setMoveItemId: c,
1110
1111
  setMoveTargetId: p,
1111
- updateItem: C
1112
- } = be(), { theme: l } = ue(), { light: c, dark: b } = Y.getTheme(l), [x, A] = H("文件夹"), h = [...(e == null ? void 0 : e.children) ?? []];
1112
+ updateItem: k
1113
+ } = be(), { theme: l } = ue(), { light: d, dark: b } = Y.getTheme(l), [x, A] = H("文件夹"), f = [...(e == null ? void 0 : e.children) ?? []];
1113
1114
  return ie(() => {
1114
- var g;
1115
- e && A((g = e.data) == null ? void 0 : g.name);
1115
+ var h;
1116
+ e && A((h = e.data) == null ? void 0 : h.name);
1116
1117
  }, [e]), /* @__PURE__ */ t(
1117
- ut,
1118
+ bt,
1118
1119
  {
1119
1120
  visible: !!e,
1120
1121
  onClose: () => {
@@ -1129,7 +1130,7 @@ const vt = Ze({
1129
1130
  title: /* @__PURE__ */ t(
1130
1131
  "input",
1131
1132
  {
1132
- className: f`
1133
+ className: g`
1133
1134
  background-color: transparent;
1134
1135
  border-style: none;
1135
1136
  text-align: center;
@@ -1144,11 +1145,11 @@ const vt = Ze({
1144
1145
  }
1145
1146
  `,
1146
1147
  value: x,
1147
- onChange: (g) => {
1148
- A(g.target.value);
1148
+ onChange: (h) => {
1149
+ A(h.target.value);
1149
1150
  },
1150
1151
  onBlur: () => {
1151
- e && C(e.id, {
1152
+ e && k(e.id, {
1152
1153
  ...e.data,
1153
1154
  name: x
1154
1155
  });
@@ -1159,7 +1160,7 @@ const vt = Ze({
1159
1160
  closable: !1,
1160
1161
  className: y(
1161
1162
  "group-item-modal",
1162
- f`
1163
+ g`
1163
1164
  .rc-dialog-content {
1164
1165
  background-color: transparent;
1165
1166
  box-shadow: none;
@@ -1174,7 +1175,7 @@ const vt = Ze({
1174
1175
  }
1175
1176
  }
1176
1177
  .rc-dialog-body {
1177
- background-color: ${c.groupItemModalBackgroundColor};
1178
+ background-color: ${d.groupItemModalBackgroundColor};
1178
1179
  @media (prefers-color-scheme: dark) {
1179
1180
  background-color: ${b.groupItemModalBackgroundColor};
1180
1181
  }
@@ -1189,21 +1190,21 @@ const vt = Ze({
1189
1190
  children: /* @__PURE__ */ t(
1190
1191
  "div",
1191
1192
  {
1192
- className: f`
1193
+ className: g`
1193
1194
  overflow-y: auto;
1194
1195
  max-height: 60vh;
1195
1196
  padding: 1.25rem 0;
1196
1197
  `,
1197
- onDragLeave: (g) => {
1198
- const N = g.relatedTarget;
1199
- N && (g.currentTarget.contains(N) || setTimeout(() => {
1198
+ onDragLeave: (h) => {
1199
+ const w = h.relatedTarget;
1200
+ w && (h.currentTarget.contains(w) || setTimeout(() => {
1200
1201
  o();
1201
1202
  }, 500));
1202
1203
  },
1203
1204
  children: /* @__PURE__ */ t(
1204
- ze,
1205
+ $e,
1205
1206
  {
1206
- className: f`
1207
+ className: g`
1207
1208
  display: grid;
1208
1209
  gap: 1rem;
1209
1210
  place-items: center;
@@ -1215,28 +1216,28 @@ const vt = Ze({
1215
1216
  animation: 150,
1216
1217
  fallbackOnBody: !0,
1217
1218
  list: (e == null ? void 0 : e.children) ?? [],
1218
- setList: (g) => {
1219
+ setList: (h) => {
1219
1220
  var I, u;
1220
- const N = g.map((T) => T.id), v = (u = (I = n.find((T) => T.id === (e == null ? void 0 : e.id))) == null ? void 0 : I.children) == null ? void 0 : u.map((T) => T.id);
1221
- N.length === (v == null ? void 0 : v.length) && N.every((T, D) => T === v[D]) || N.length < ((v == null ? void 0 : v.length) ?? 0) || s(g, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1221
+ const w = h.map((T) => T.id), v = (u = (I = n.find((T) => T.id === (e == null ? void 0 : e.id))) == null ? void 0 : I.children) == null ? void 0 : u.map((T) => T.id);
1222
+ w.length === (v == null ? void 0 : v.length) && w.every((T, R) => T === v[R]) || w.length < ((v == null ? void 0 : v.length) ?? 0) || s(h, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1222
1223
  },
1223
1224
  onMove: () => (p(null), i("onMove"), !0),
1224
- onStart: (g) => {
1225
- const N = g.item.dataset;
1226
- N != null && N.id && m(N.id), i("onMove");
1225
+ onStart: (h) => {
1226
+ const w = h.item.dataset;
1227
+ w != null && w.id && c(w.id), i("onMove");
1227
1228
  },
1228
1229
  onEnd: () => {
1229
- m(null), p(null), i(null);
1230
+ c(null), p(null), i(null);
1230
1231
  },
1231
- ghostClass: Ct,
1232
- children: h.map((g, N) => /* @__PURE__ */ t(
1233
- je,
1232
+ ghostClass: Tt,
1233
+ children: f.map((h, w) => /* @__PURE__ */ t(
1234
+ Ue,
1234
1235
  {
1235
- data: g,
1236
- itemIndex: N,
1236
+ data: h,
1237
+ itemIndex: w,
1237
1238
  onClick: a
1238
1239
  },
1239
- g.id
1240
+ h.id
1240
1241
  ))
1241
1242
  }
1242
1243
  )
@@ -1244,11 +1245,11 @@ const vt = Ze({
1244
1245
  )
1245
1246
  }
1246
1247
  );
1247
- }, An = (r) => {
1248
+ }, Rn = (r) => {
1248
1249
  var a;
1249
1250
  const { data: e, onClose: o } = r;
1250
1251
  return /* @__PURE__ */ t(
1251
- ut,
1252
+ bt,
1252
1253
  {
1253
1254
  visible: !!e,
1254
1255
  onClose: () => {
@@ -1262,32 +1263,32 @@ const vt = Ze({
1262
1263
  } : null,
1263
1264
  footer: null,
1264
1265
  title: ((a = e == null ? void 0 : e.data) == null ? void 0 : a.name) ?? "信息",
1265
- children: e && /* @__PURE__ */ d("div", { children: [
1266
+ children: e && /* @__PURE__ */ m("div", { children: [
1266
1267
  /* @__PURE__ */ t("div", { className: "mb-2", children: "开发者信息" }),
1267
- /* @__PURE__ */ t("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ t(ko, { src: e, theme: "monokai" }) })
1268
+ /* @__PURE__ */ t("div", { className: "p-2 rounded-md bg-[#272822]", children: /* @__PURE__ */ t(wo, { src: e, theme: "monokai" }) })
1268
1269
  ] })
1269
1270
  }
1270
1271
  );
1271
- }, wt = (r) => {
1272
+ }, Mt = (r) => {
1272
1273
  const {
1273
1274
  pagination: e = { position: "bottom" },
1274
1275
  className: o,
1275
1276
  sliderProps: a,
1276
1277
  sliderRef: n,
1277
1278
  onItemClick: s
1278
- } = r, i = he(null), m = he(null), {
1279
+ } = r, i = he(null), c = he(null), {
1279
1280
  list: p,
1280
- setList: C,
1281
+ setList: k,
1281
1282
  setListStatus: l,
1282
- showInfoItemData: c,
1283
+ showInfoItemData: d,
1283
1284
  setShowInfoItemData: b,
1284
1285
  openGroupItemData: x,
1285
1286
  setOpenGroupItemData: A,
1286
- setMoveItemId: h,
1287
- setMoveTargetId: g,
1288
- addItem: N
1287
+ setMoveItemId: f,
1288
+ setMoveTargetId: h,
1289
+ addItem: w
1289
1290
  } = be(), { pagingDotBuilder: v, pagingDotsBuilder: I, itemBuilder: u } = ue(), T = fe(() => e === !1 ? {} : {
1290
- top: f`
1291
+ top: g`
1291
1292
  display: flex;
1292
1293
  flex-direction: column;
1293
1294
  .slick-list {
@@ -1297,12 +1298,12 @@ const vt = Ze({
1297
1298
  position: static;
1298
1299
  }
1299
1300
  `,
1300
- bottom: f`
1301
+ bottom: g`
1301
1302
  .slick-dots {
1302
1303
  position: static;
1303
1304
  }
1304
1305
  `,
1305
- left: f`
1306
+ left: g`
1306
1307
  .slick-dots {
1307
1308
  position: absolute;
1308
1309
  width: auto;
@@ -1318,7 +1319,7 @@ const vt = Ze({
1318
1319
  }
1319
1320
  }
1320
1321
  `,
1321
- right: f`
1322
+ right: g`
1322
1323
  .slick-dots {
1323
1324
  position: absolute;
1324
1325
  width: auto;
@@ -1335,9 +1336,9 @@ const vt = Ze({
1335
1336
  }
1336
1337
  `
1337
1338
  }[e.position ?? "bottom"], [e]);
1338
- return /* @__PURE__ */ d(me, { children: [
1339
+ return /* @__PURE__ */ m(me, { children: [
1339
1340
  /* @__PURE__ */ t(
1340
- Wt,
1341
+ Zt,
1341
1342
  {
1342
1343
  useCSS: !0,
1343
1344
  useTransform: !0,
@@ -1349,7 +1350,7 @@ const vt = Ze({
1349
1350
  lazyLoad: "anticipated",
1350
1351
  className: y(
1351
1352
  T,
1352
- f`
1353
+ g`
1353
1354
  .slick-track {
1354
1355
  display: flex;
1355
1356
  align-items: stretch;
@@ -1367,26 +1368,26 @@ const vt = Ze({
1367
1368
  `,
1368
1369
  o
1369
1370
  ),
1370
- customPaging: (D) => {
1371
- var w, k;
1372
- return v ? v(p[D], D) : /* @__PURE__ */ t(
1371
+ customPaging: (R) => {
1372
+ var N, C;
1373
+ return v ? v(p[R], R) : /* @__PURE__ */ t(
1373
1374
  "div",
1374
1375
  {
1375
1376
  onDragEnter: () => {
1376
- var U;
1377
- (U = (n ?? i).current) == null || U.slickGoTo(D);
1377
+ var X;
1378
+ (X = (n ?? i).current) == null || X.slickGoTo(R);
1378
1379
  },
1379
- children: (k = (w = p[D]) == null ? void 0 : w.data) == null ? void 0 : k.name
1380
+ children: (C = (N = p[R]) == null ? void 0 : N.data) == null ? void 0 : C.name
1380
1381
  }
1381
1382
  );
1382
1383
  },
1383
- appendDots: (D) => I ? I(D) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1384
+ appendDots: (R) => I ? I(R) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1384
1385
  "ul",
1385
1386
  {
1386
- ref: m,
1387
+ ref: c,
1387
1388
  className: y(
1388
1389
  "slick-dots-default",
1389
- f`
1390
+ g`
1390
1391
  padding: 0.5rem;
1391
1392
  display: inline-flex;
1392
1393
  justify-content: center;
@@ -1407,31 +1408,31 @@ const vt = Ze({
1407
1408
  }
1408
1409
  `
1409
1410
  ),
1410
- children: D
1411
+ children: R
1411
1412
  }
1412
1413
  ) }),
1413
1414
  ...a,
1414
- children: p.map((D) => /* @__PURE__ */ t(
1415
+ children: p.map((R) => /* @__PURE__ */ t(
1415
1416
  "div",
1416
1417
  {
1417
- onDrop: (w) => {
1418
- w.preventDefault();
1419
- const k = w.dataTransfer.getData("text/plain");
1420
- if (Y.quickJSONCheck(k))
1418
+ onDrop: (N) => {
1419
+ N.preventDefault();
1420
+ const C = N.dataTransfer.getData("text/plain");
1421
+ if (Y.quickJSONCheck(C))
1421
1422
  try {
1422
- N(JSON.parse(k), [D.id]);
1423
+ w(JSON.parse(C), [R.id]);
1423
1424
  } catch (Z) {
1424
1425
  console.log("drag error", Z);
1425
1426
  }
1426
1427
  },
1427
- onDragOver: (w) => {
1428
- w.preventDefault();
1428
+ onDragOver: (N) => {
1429
+ N.preventDefault();
1429
1430
  },
1430
1431
  children: /* @__PURE__ */ t(
1431
- ze,
1432
+ $e,
1432
1433
  {
1433
1434
  className: y(
1434
- f`
1435
+ g`
1435
1436
  display: grid;
1436
1437
  transition: all 0.3s;
1437
1438
  grid-template-columns: repeat(auto-fill, 96px);
@@ -1446,72 +1447,72 @@ const vt = Ze({
1446
1447
  fallbackOnBody: !0,
1447
1448
  swapThreshold: 0.65,
1448
1449
  group: "nested",
1449
- list: D.children ?? [],
1450
- setList: (w) => C(w, [D.id]),
1450
+ list: R.children ?? [],
1451
+ setList: (N) => k(N, [R.id]),
1451
1452
  filter: ".drag-disabled",
1452
- onMove: (w) => {
1453
+ onMove: (N) => {
1453
1454
  l("onMove");
1454
- const { dragged: k, related: U } = w, Z = k.dataset, _ = U.dataset;
1455
- return g(null), !((Object.keys(_).length === 0 || _.parentIds) && Number(Z.childrenLength) > 0 && U.classList.contains("sortable-group-item"));
1455
+ const { dragged: C, related: X } = N, Z = C.dataset, _ = X.dataset;
1456
+ return h(null), !((Object.keys(_).length === 0 || _.parentIds) && Number(Z.childrenLength) > 0 && X.classList.contains("sortable-group-item"));
1456
1457
  },
1457
- onStart: (w) => {
1458
- const k = w.item.dataset;
1459
- k != null && k.id && h(k.id), l("onMove");
1458
+ onStart: (N) => {
1459
+ const C = N.item.dataset;
1460
+ C != null && C.id && f(C.id), l("onMove");
1460
1461
  },
1461
1462
  onEnd: () => {
1462
- h(null), g(null), l(null);
1463
+ f(null), h(null), l(null);
1463
1464
  },
1464
- ghostClass: Ct,
1465
- children: (D.children ?? []).map((w, k) => {
1466
- let U;
1465
+ ghostClass: Tt,
1466
+ children: (R.children ?? []).map((N, C) => {
1467
+ let X;
1467
1468
  if (u)
1468
- return u(w);
1469
- switch (w.type) {
1469
+ return u(N);
1470
+ switch (N.type) {
1470
1471
  case "group":
1471
1472
  case "app":
1472
- U = /* @__PURE__ */ t(
1473
- Mn,
1473
+ X = /* @__PURE__ */ t(
1474
+ An,
1474
1475
  {
1475
- data: w,
1476
- itemIndex: k,
1477
- parentIds: [D.id, w.id],
1476
+ data: N,
1477
+ itemIndex: C,
1478
+ parentIds: [R.id, N.id],
1478
1479
  onClick: s
1479
1480
  },
1480
- w.id
1481
+ N.id
1481
1482
  );
1482
1483
  break;
1483
1484
  default:
1484
- U = /* @__PURE__ */ t(
1485
- je,
1485
+ X = /* @__PURE__ */ t(
1486
+ Ue,
1486
1487
  {
1487
- data: w,
1488
- itemIndex: k,
1488
+ data: N,
1489
+ itemIndex: C,
1489
1490
  onClick: s
1490
1491
  },
1491
- w.id
1492
+ N.id
1492
1493
  );
1493
1494
  break;
1494
1495
  }
1495
- return U;
1496
+ return X;
1496
1497
  })
1497
1498
  }
1498
1499
  )
1499
1500
  },
1500
- D.id
1501
+ R.id
1501
1502
  ))
1502
1503
  }
1503
1504
  ),
1504
1505
  /* @__PURE__ */ t(
1505
- An,
1506
+ Rn,
1506
1507
  {
1507
- data: c,
1508
+ data: d,
1508
1509
  onClose: () => {
1509
1510
  b(null);
1510
1511
  }
1511
1512
  }
1512
1513
  ),
1513
1514
  /* @__PURE__ */ t(
1514
- Ln,
1515
+ Dn,
1515
1516
  {
1516
1517
  data: x,
1517
1518
  onClose: () => {
@@ -1521,7 +1522,7 @@ const vt = Ze({
1521
1522
  }
1522
1523
  )
1523
1524
  ] });
1524
- }, Rn = (r) => {
1525
+ }, Pn = (r) => {
1525
1526
  const {
1526
1527
  list: e,
1527
1528
  onChange: o,
@@ -1529,30 +1530,30 @@ const vt = Ze({
1529
1530
  enableCaching: n,
1530
1531
  theme: s,
1531
1532
  noLetters: i,
1532
- contextMenu: m,
1533
+ contextMenu: c,
1533
1534
  contextMenuBuilder: p,
1534
- itemBuilder: C,
1535
+ itemBuilder: k,
1535
1536
  itemIconBuilder: l,
1536
- pagingDotBuilder: c,
1537
+ pagingDotBuilder: d,
1537
1538
  pagingDotsBuilder: b,
1538
1539
  ...x
1539
1540
  } = r;
1540
- return /* @__PURE__ */ t(kt, { ...{
1541
+ return /* @__PURE__ */ t(St, { ...{
1541
1542
  list: e,
1542
1543
  onChange: o,
1543
1544
  storageKey: a,
1544
1545
  enableCaching: n
1545
- }, children: /* @__PURE__ */ t(xt, { ...{
1546
+ }, children: /* @__PURE__ */ t(wt, { ...{
1546
1547
  theme: s,
1547
1548
  noLetters: i,
1548
- contextMenu: m,
1549
+ contextMenu: c,
1549
1550
  pagingDotsBuilder: b,
1550
- pagingDotBuilder: c,
1551
- itemBuilder: C,
1551
+ pagingDotBuilder: d,
1552
+ itemBuilder: k,
1552
1553
  itemIconBuilder: l,
1553
1554
  contextMenuBuilder: p
1554
- }, children: /* @__PURE__ */ t(wt, { ...x }) }) });
1555
- }, Dn = {
1555
+ }, children: /* @__PURE__ */ t(Mt, { ...x }) }) });
1556
+ }, Bn = {
1556
1557
  frontmatterEditor: {
1557
1558
  title: "编辑前置元数据",
1558
1559
  key: "键",
@@ -1669,13 +1670,13 @@ const vt = Ze({
1669
1670
  image: {
1670
1671
  delete: "删除图片"
1671
1672
  }
1672
- }, Pn = (r, e, o) => {
1673
+ }, zn = (r, e, o) => {
1673
1674
  const n = r.split(".").reduce(
1674
1675
  (s, i) => typeof s == "string" ? s : s[i],
1675
- Dn
1676
+ Bn
1676
1677
  );
1677
1678
  return typeof n != "string" ? e : o ? n.replace(/{{(.*?)}}/g, (s, i) => o[i]) : n;
1678
- }, Bn = f`
1679
+ }, En = g`
1679
1680
  --accentBase: var(--tomato-1);
1680
1681
  --accentBgSubtle: var(--tomato-2);
1681
1682
  --accentBg: var(--tomato-3);
@@ -1729,7 +1730,7 @@ const vt = Ze({
1729
1730
  rgba(255, 255, 255, 0.05),
1730
1731
  rgba(255, 255, 255, 0.05)
1731
1732
  );
1732
- `, zn = f`
1733
+ `, $n = g`
1733
1734
  [class*="_toolbarRoot"] {
1734
1735
  flex-wrap: wrap;
1735
1736
  transition: all 0.3s;
@@ -1799,9 +1800,9 @@ const vt = Ze({
1799
1800
  margin-bottom: 0;
1800
1801
  }
1801
1802
  }
1802
- `, Nt = y(
1803
+ `, Lt = y(
1803
1804
  "markdown-body",
1804
- f`
1805
+ g`
1805
1806
  p {
1806
1807
  margin-bottom: 8px;
1807
1808
  }
@@ -1822,7 +1823,7 @@ const vt = Ze({
1822
1823
  }
1823
1824
  }
1824
1825
  `
1825
- ), It = f`
1826
+ ), At = g`
1826
1827
  .markdown-body {
1827
1828
  /* light */
1828
1829
  color-scheme: light;
@@ -1877,7 +1878,7 @@ const vt = Ze({
1877
1878
  --color-prettylights-syntax-meta-diff-range: #8250df;
1878
1879
  --color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
1879
1880
  }
1880
- `, St = f`
1881
+ `, Dt = g`
1881
1882
  .markdown-body {
1882
1883
  /* dark */
1883
1884
  color-scheme: dark;
@@ -1932,10 +1933,10 @@ const vt = Ze({
1932
1933
  --color-prettylights-syntax-meta-diff-range: #d2a8ff;
1933
1934
  --color-prettylights-syntax-sublimelinter-gutter-mark: #3d444d;
1934
1935
  }
1935
- `, Pe = (r) => {
1936
+ `, ze = (r) => {
1936
1937
  var e, o;
1937
1938
  return r === "dark" ? !0 : r === "light" ? !1 : (e = document.documentElement.getAttribute("style")) != null && e.includes("color-scheme: dark;") ? !0 : (o = document.documentElement.getAttribute("style")) != null && o.includes("color-scheme: light;") ? !1 : window.matchMedia("(prefers-color-scheme: dark)").matches;
1938
- }, En = (r) => {
1939
+ }, Hn = (r) => {
1939
1940
  const {
1940
1941
  value: e,
1941
1942
  onChange: o,
@@ -1943,13 +1944,13 @@ const vt = Ze({
1943
1944
  pluginConfig: n,
1944
1945
  className: s,
1945
1946
  theme: i = "auto",
1946
- ...m
1947
+ ...c
1947
1948
  } = r, p = he(null), {
1948
- image: C,
1949
+ image: k,
1949
1950
  diffSource: l = {
1950
1951
  viewMode: "rich-text"
1951
1952
  },
1952
- headings: c,
1953
+ headings: d,
1953
1954
  link: b,
1954
1955
  codeBlock: x,
1955
1956
  codeMirror: A = {
@@ -1961,122 +1962,122 @@ const vt = Ze({
1961
1962
  "": "Unspecified"
1962
1963
  }
1963
1964
  },
1964
- directives: h = {
1965
- directiveDescriptors: [Co]
1965
+ directives: f = {
1966
+ directiveDescriptors: [No]
1966
1967
  }
1967
- } = n ?? {}, [g, N] = H("");
1968
+ } = n ?? {}, [h, w] = H("");
1968
1969
  return ie(() => {
1969
1970
  var v;
1970
- e !== void 0 && p.current && ((v = p.current) == null || v.setMarkdown(e), N(e));
1971
+ e !== void 0 && p.current && ((v = p.current) == null || v.setMarkdown(e), w(e));
1971
1972
  }, [e, p]), /* @__PURE__ */ t(
1972
- wo,
1973
+ Io,
1973
1974
  {
1974
1975
  ref: p,
1975
1976
  className: y(
1976
- zn,
1977
- Pe(i) ? Bn : "",
1978
- Pe(i) ? St : It,
1977
+ $n,
1978
+ ze(i) ? En : "",
1979
+ ze(i) ? Dt : At,
1979
1980
  s
1980
1981
  ),
1981
- contentEditableClassName: Nt,
1982
- markdown: g,
1982
+ contentEditableClassName: Lt,
1983
+ markdown: h,
1983
1984
  onChange: (v) => {
1984
- !e && !o && N(v), o && o(v);
1985
+ !e && !o && w(v), o && o(v);
1985
1986
  },
1986
- translation: a ?? Pn,
1987
+ translation: a ?? zn,
1987
1988
  plugins: [
1988
- No({
1989
- toolbarContents: () => /* @__PURE__ */ d(Oo, { options: ["rich-text", "source"], children: [
1990
- /* @__PURE__ */ t(Fo, {}),
1991
- /* @__PURE__ */ t(le, {}),
1992
- /* @__PURE__ */ t(_o, {}),
1989
+ So({
1990
+ toolbarContents: () => /* @__PURE__ */ m(_o, { options: ["rich-text", "source"], children: [
1993
1991
  /* @__PURE__ */ t(jo, {}),
1994
1992
  /* @__PURE__ */ t(le, {}),
1995
- /* @__PURE__ */ t(Uo, {}),
1996
- /* @__PURE__ */ t(le, {}),
1997
1993
  /* @__PURE__ */ t(Xo, {}),
1994
+ /* @__PURE__ */ t(Uo, {}),
1998
1995
  /* @__PURE__ */ t(le, {}),
1999
1996
  /* @__PURE__ */ t(Go, {}),
1997
+ /* @__PURE__ */ t(le, {}),
2000
1998
  /* @__PURE__ */ t(qo, {}),
2001
1999
  /* @__PURE__ */ t(le, {}),
2002
2000
  /* @__PURE__ */ t(Yo, {}),
2003
2001
  /* @__PURE__ */ t(Vo, {}),
2004
2002
  /* @__PURE__ */ t(le, {}),
2005
2003
  /* @__PURE__ */ t(Wo, {}),
2004
+ /* @__PURE__ */ t(Ko, {}),
2006
2005
  /* @__PURE__ */ t(le, {}),
2007
- /* @__PURE__ */ t(Ko, {})
2006
+ /* @__PURE__ */ t(Jo, {}),
2007
+ /* @__PURE__ */ t(le, {}),
2008
+ /* @__PURE__ */ t(Zo, {})
2008
2009
  ] })
2009
2010
  }),
2010
- Io(l),
2011
- So(),
2012
- To(),
2013
- Mo(c),
2014
- Lo(b),
2015
- Ao(),
2016
- Ro(C),
2017
- Do(),
2018
- Po(),
2011
+ To(l),
2012
+ Mo(),
2013
+ Lo(),
2014
+ Ao(d),
2015
+ Do(b),
2016
+ Ro(),
2017
+ Po(k),
2019
2018
  Bo(),
2020
- zo(x),
2021
- Eo(A),
2022
- $o(),
2023
- Ho(h)
2019
+ zo(),
2020
+ Eo(),
2021
+ $o(x),
2022
+ Ho(A),
2023
+ Oo(),
2024
+ Fo(f)
2024
2025
  ],
2025
- ...m
2026
+ ...c
2026
2027
  }
2027
2028
  );
2028
- }, Tt = (r) => {
2029
+ }, Rt = (r) => {
2029
2030
  const { children: e = "", className: o, theme: a = "auto", imageProps: n } = r;
2030
2031
  return /* @__PURE__ */ t(
2031
2032
  "div",
2032
2033
  {
2033
- className: Pe(a) ? St : It,
2034
+ className: ze(a) ? Dt : At,
2034
2035
  children: /* @__PURE__ */ t(
2035
- pt,
2036
+ xt,
2036
2037
  {
2037
- className: y(Nt, o),
2038
- remarkPlugins: [Jo, Zo],
2039
- rehypePlugins: [Qo],
2038
+ className: y(Lt, o),
2039
+ remarkPlugins: [Qo, er],
2040
+ rehypePlugins: [tr],
2040
2041
  components: {
2041
2042
  code(s) {
2042
- const { children: i, className: m, node: p, ref: C, ...l } = s, c = /language-(\w+)/.exec(m || "");
2043
- return c ? /* @__PURE__ */ t(
2044
- er,
2043
+ const { children: i, className: c, node: p, ref: k, ...l } = s, d = /language-(\w+)/.exec(c || "");
2044
+ return d ? /* @__PURE__ */ t(
2045
+ or,
2045
2046
  {
2046
2047
  ...l,
2047
2048
  PreTag: "div",
2048
2049
  children: String(i).replace(/\n$/, ""),
2049
- language: c[1],
2050
- style: tr
2050
+ language: d[1],
2051
+ style: rr
2051
2052
  }
2052
- ) : /* @__PURE__ */ t("code", { ...l, className: m, children: i });
2053
+ ) : /* @__PURE__ */ t("code", { ...l, className: c, children: i });
2053
2054
  },
2054
2055
  img(s) {
2055
- const { preview: i, ...m } = n ?? {};
2056
+ const { preview: i, ...c } = n ?? {};
2056
2057
  return /* @__PURE__ */ t(
2057
- or,
2058
+ nr,
2058
2059
  {
2059
2060
  ...s,
2060
2061
  preview: i instanceof Boolean ? i : {
2061
2062
  icons: {
2062
- rotateLeft: /* @__PURE__ */ t(uo, {}),
2063
- rotateRight: /* @__PURE__ */ t(mo, {}),
2064
- zoomIn: /* @__PURE__ */ t(co, {}),
2065
- zoomOut: /* @__PURE__ */ t(lo, {}),
2066
- close: /* @__PURE__ */ t(io, {}),
2067
- left: /* @__PURE__ */ t(so, {}),
2068
- right: /* @__PURE__ */ t(ao, {}),
2069
- flipX: /* @__PURE__ */ t(no, {}),
2070
- flipY: /* @__PURE__ */ t(ro, {})
2063
+ rotateLeft: /* @__PURE__ */ t(go, {}),
2064
+ rotateRight: /* @__PURE__ */ t(po, {}),
2065
+ zoomIn: /* @__PURE__ */ t(uo, {}),
2066
+ zoomOut: /* @__PURE__ */ t(mo, {}),
2067
+ close: /* @__PURE__ */ t(co, {}),
2068
+ left: /* @__PURE__ */ t(lo, {}),
2069
+ right: /* @__PURE__ */ t(io, {}),
2070
+ flipX: /* @__PURE__ */ t(so, {}),
2071
+ flipY: /* @__PURE__ */ t(ao, {})
2071
2072
  },
2072
2073
  zIndex: 9999,
2073
2074
  mask: " ",
2074
2075
  ...i
2075
2076
  },
2076
- className: f`
2077
+ className: g`
2077
2078
  cursor: zoom-in;
2078
2079
  `,
2079
- ...m
2080
+ ...c
2080
2081
  }
2081
2082
  );
2082
2083
  }
@@ -2086,52 +2087,52 @@ const vt = Ze({
2086
2087
  )
2087
2088
  }
2088
2089
  );
2089
- }, Mt = En;
2090
- Mt.Preview = Tt;
2091
- function Lt(...r) {
2092
- return nr(rr(r));
2090
+ }, Pt = Hn;
2091
+ Pt.Preview = Rt;
2092
+ function Bt(...r) {
2093
+ return sr(ar(r));
2093
2094
  }
2094
- const $n = (r) => {
2095
- const { mouseX: e, title: o, icon: a, href: n } = r, s = he(null), i = xe(e, (N) => {
2096
- var I;
2097
- const v = ((I = s.current) == null ? void 0 : I.getBoundingClientRect()) ?? { x: 0, width: 0 };
2098
- return N - v.x - v.width / 2;
2099
- }), m = xe(i, [-150, 0, 150], [40, 80, 40]), p = xe(i, [-150, 0, 150], [40, 80, 40]), C = xe(
2100
- i,
2095
+ const Ge = (r) => {
2096
+ const { mouseX: e, title: o, icon: a, href: n, children: s } = r, i = he(null), c = xe(e, (v) => {
2097
+ var u;
2098
+ const I = ((u = i.current) == null ? void 0 : u.getBoundingClientRect()) ?? { x: 0, width: 0 };
2099
+ return v - I.x - I.width / 2;
2100
+ }), p = xe(c, [-150, 0, 150], [40, 80, 40]), k = xe(c, [-150, 0, 150], [40, 80, 40]), l = xe(
2101
+ c,
2101
2102
  [-150, 0, 150],
2102
2103
  [20, 40, 20]
2103
- ), l = xe(
2104
- i,
2104
+ ), d = xe(
2105
+ c,
2105
2106
  [-150, 0, 150],
2106
2107
  [20, 40, 20]
2107
- ), c = Se(m, {
2108
+ ), b = Te(p, {
2108
2109
  mass: 0.1,
2109
2110
  stiffness: 150,
2110
2111
  damping: 12
2111
- }), b = Se(p, {
2112
+ }), x = Te(k, {
2112
2113
  mass: 0.1,
2113
2114
  stiffness: 150,
2114
2115
  damping: 12
2115
- }), x = Se(C, {
2116
+ }), A = Te(l, {
2116
2117
  mass: 0.1,
2117
2118
  stiffness: 150,
2118
2119
  damping: 12
2119
- }), A = Se(l, {
2120
+ }), f = Te(d, {
2120
2121
  mass: 0.1,
2121
2122
  stiffness: 150,
2122
2123
  damping: 12
2123
- }), [h, g] = H(!1);
2124
- return /* @__PURE__ */ t("a", { href: n, children: /* @__PURE__ */ d(
2125
- R.div,
2124
+ }), [h, w] = H(!1);
2125
+ return /* @__PURE__ */ t("a", { href: n, children: /* @__PURE__ */ m(
2126
+ D.div,
2126
2127
  {
2127
- ref: s,
2128
- style: { width: c, height: b },
2129
- onMouseEnter: () => g(!0),
2130
- onMouseLeave: () => g(!1),
2128
+ ref: i,
2129
+ style: { width: b, height: x },
2130
+ onMouseEnter: () => w(!0),
2131
+ onMouseLeave: () => w(!1),
2131
2132
  className: "aspect-square rounded-full bg-gray-200 dark:bg-neutral-800 flex items-center justify-center relative",
2132
2133
  children: [
2133
- /* @__PURE__ */ t(Ee, { children: h && /* @__PURE__ */ t(
2134
- R.div,
2134
+ /* @__PURE__ */ t(He, { children: h && /* @__PURE__ */ t(
2135
+ D.div,
2135
2136
  {
2136
2137
  initial: { opacity: 0, y: 10, x: "-50%" },
2137
2138
  animate: { opacity: 1, y: 0, x: "-50%" },
@@ -2140,132 +2141,189 @@ const $n = (r) => {
2140
2141
  children: o
2141
2142
  }
2142
2143
  ) }),
2144
+ " ",
2143
2145
  /* @__PURE__ */ t(
2144
- R.div,
2146
+ D.div,
2145
2147
  {
2146
- style: { width: x, height: A },
2148
+ style: { width: A, height: f },
2147
2149
  className: "flex items-center justify-center",
2148
- children: a
2150
+ children: s || a
2149
2151
  }
2150
2152
  )
2151
2153
  ]
2152
2154
  }
2153
2155
  ) });
2154
- }, At = (r) => {
2155
- const { items: e, className: o } = r, a = Kt(1 / 0);
2156
+ }, qe = (r) => {
2157
+ const {
2158
+ items: e = [],
2159
+ className: o,
2160
+ itemBuilder: a,
2161
+ children: n,
2162
+ mouseX: s
2163
+ } = r, i = nt(1 / 0), c = s ?? i;
2156
2164
  return /* @__PURE__ */ t(
2157
- R.div,
2165
+ D.div,
2158
2166
  {
2159
- onMouseMove: (n) => a.set(n.pageX),
2160
- onMouseLeave: () => a.set(1 / 0),
2161
- className: Lt(
2167
+ onMouseMove: (p) => c.set(p.pageX),
2168
+ onMouseLeave: () => c.set(1 / 0),
2169
+ className: Bt(
2162
2170
  "mx-auto hidden md:flex h-16 gap-4 items-end rounded-2xl bg-gray-50 dark:bg-neutral-900 px-4 pb-3",
2163
2171
  o
2164
2172
  ),
2165
- children: e.map((n) => /* @__PURE__ */ t($n, { mouseX: a, ...n }, n.title))
2173
+ children: n || e.map(
2174
+ (p) => a ? a(p, c) : /* @__PURE__ */ t(Ge, { mouseX: c, ...p }, p.title)
2175
+ )
2166
2176
  }
2167
2177
  );
2168
- }, Rt = (r) => {
2169
- const { items: e, className: o, collapseIcon: a, autoHidden: n = !1 } = r, [s, i] = H(!1), m = () => {
2170
- i(!s);
2178
+ }, De = (r) => {
2179
+ const { title: e, icon: o, href: a, index: n, totalItems: s, children: i } = r;
2180
+ return /* @__PURE__ */ t(
2181
+ D.div,
2182
+ {
2183
+ initial: { opacity: 0, y: 10 },
2184
+ animate: {
2185
+ opacity: 1,
2186
+ y: 0
2187
+ },
2188
+ exit: {
2189
+ opacity: 0,
2190
+ y: 10,
2191
+ transition: {
2192
+ delay: n * 0.05
2193
+ }
2194
+ },
2195
+ transition: { delay: (s - 1 - n) * 0.05 },
2196
+ children: i || /* @__PURE__ */ t(
2197
+ "a",
2198
+ {
2199
+ href: a,
2200
+ className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",
2201
+ children: /* @__PURE__ */ t("div", { className: "h-4 w-4", children: o })
2202
+ }
2203
+ )
2204
+ },
2205
+ e
2206
+ );
2207
+ }, Ye = (r) => {
2208
+ const {
2209
+ items: e = [],
2210
+ className: o,
2211
+ collapseIcon: a,
2212
+ autoHidden: n = !1,
2213
+ itemBuilder: s,
2214
+ children: i
2215
+ } = r, [c, p] = H(!1), k = () => {
2216
+ p(!c);
2171
2217
  };
2172
- return /* @__PURE__ */ d(
2218
+ return /* @__PURE__ */ m(
2173
2219
  "div",
2174
2220
  {
2175
- className: Lt(
2176
- "relative block",
2177
- n ? "md:hidden" : "",
2178
- o
2179
- ),
2221
+ className: Bt("relative block", n ? "md:hidden" : "", o),
2180
2222
  children: [
2181
- /* @__PURE__ */ t(Ee, { children: s && /* @__PURE__ */ t(
2182
- R.div,
2223
+ /* @__PURE__ */ t(He, { children: c && /* @__PURE__ */ t(
2224
+ D.div,
2183
2225
  {
2184
2226
  layoutId: "nav",
2185
2227
  className: "absolute bottom-full mb-2 inset-x-0 flex flex-col gap-2",
2186
- children: e.map((p, C) => /* @__PURE__ */ t(
2187
- R.div,
2188
- {
2189
- initial: { opacity: 0, y: 10 },
2190
- animate: {
2191
- opacity: 1,
2192
- y: 0
2228
+ children: i || e.map(
2229
+ (l, d) => s ? /* @__PURE__ */ t(
2230
+ De,
2231
+ {
2232
+ ...l,
2233
+ index: d,
2234
+ totalItems: e.length,
2235
+ children: s(l, d, e)
2193
2236
  },
2194
- exit: {
2195
- opacity: 0,
2196
- y: 10,
2197
- transition: {
2198
- delay: C * 0.05
2199
- }
2237
+ l.title
2238
+ ) : /* @__PURE__ */ t(
2239
+ De,
2240
+ {
2241
+ ...l,
2242
+ index: d,
2243
+ totalItems: e.length
2200
2244
  },
2201
- transition: { delay: (e.length - 1 - C) * 0.05 },
2202
- children: /* @__PURE__ */ t(
2203
- "a",
2204
- {
2205
- href: p.href,
2206
- className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-900 flex items-center justify-center",
2207
- children: /* @__PURE__ */ t("div", { className: "h-4 w-4", children: p.icon })
2208
- },
2209
- p.title
2210
- )
2211
- },
2212
- p.title
2213
- ))
2245
+ l.title
2246
+ )
2247
+ )
2214
2248
  }
2215
2249
  ) }),
2216
2250
  /* @__PURE__ */ t(
2217
2251
  "button",
2218
2252
  {
2219
- onClick: m,
2253
+ onClick: k,
2220
2254
  className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
2221
- children: a || /* @__PURE__ */ t(po, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2255
+ children: a || /* @__PURE__ */ t(fo, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2222
2256
  }
2223
2257
  )
2224
2258
  ]
2225
2259
  }
2226
2260
  );
2227
- }, Hn = (r) => {
2228
- const { items: e, desktopClassName: o, mobileClassName: a, ...n } = r;
2229
- return /* @__PURE__ */ d(me, { children: [
2230
- /* @__PURE__ */ t(At, { items: e, className: o, ...n }),
2261
+ }, On = (r) => {
2262
+ const {
2263
+ items: e,
2264
+ desktopClassName: o,
2265
+ mobileClassName: a,
2266
+ desktopItemBuilder: n,
2267
+ mobileItemBuilder: s,
2268
+ desktopChildren: i,
2269
+ mobileChildren: c,
2270
+ desktopMouseX: p,
2271
+ ...k
2272
+ } = r;
2273
+ return /* @__PURE__ */ m(me, { children: [
2274
+ /* @__PURE__ */ t(
2275
+ qe,
2276
+ {
2277
+ items: e,
2278
+ className: o,
2279
+ itemBuilder: n,
2280
+ children: i,
2281
+ mouseX: p,
2282
+ ...k
2283
+ }
2284
+ ),
2231
2285
  /* @__PURE__ */ t(
2232
- Rt,
2286
+ Ye,
2233
2287
  {
2234
2288
  items: e,
2235
2289
  className: a,
2290
+ itemBuilder: s,
2291
+ children: c,
2236
2292
  autoHidden: !0,
2237
- ...n
2293
+ ...k
2238
2294
  }
2239
2295
  )
2240
2296
  ] });
2241
- }, Ue = Hn;
2242
- Ue.Desktop = At;
2243
- Ue.Mobile = Rt;
2244
- const On = /* @__PURE__ */ kn({
2297
+ }, we = On;
2298
+ we.Desktop = qe;
2299
+ we.DesktopItem = Ge;
2300
+ we.Mobile = Ye;
2301
+ we.MobileItem = De;
2302
+ const Fn = /* @__PURE__ */ wn({
2245
2303
  __proto__: null
2246
- }, [Jr]);
2247
- function Fn() {
2304
+ }, [Qr]);
2305
+ function _n() {
2248
2306
  try {
2249
- return On;
2307
+ return Fn;
2250
2308
  } catch {
2251
2309
  return null;
2252
2310
  }
2253
2311
  }
2254
- function _n(r, e) {
2312
+ function jn(r, e) {
2255
2313
  if (r && typeof r.serializeForClipboard == "function")
2256
2314
  return r.serializeForClipboard(e);
2257
- const o = Fn();
2315
+ const o = _n();
2258
2316
  if (o && typeof (o == null ? void 0 : o.__serializeForClipboard) == "function")
2259
2317
  return o.__serializeForClipboard(r, e);
2260
2318
  throw new Error("No supported clipboard serialization method found.");
2261
2319
  }
2262
- function jn(r) {
2320
+ function Xn(r) {
2263
2321
  const e = r.getBoundingClientRect(), o = r.closest('[role="dialog"]'), a = r.closest(".ProseMirror"), n = a == null ? void 0 : a.getBoundingClientRect(), s = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop;
2264
2322
  if (o && window.getComputedStyle(o).transform !== "none") {
2265
- const m = o.getBoundingClientRect();
2323
+ const c = o.getBoundingClientRect();
2266
2324
  return {
2267
- top: e.top - m.top + i,
2268
- left: e.left - m.left + s,
2325
+ top: e.top - c.top + i,
2326
+ left: e.left - c.left + s,
2269
2327
  width: e.width
2270
2328
  };
2271
2329
  }
@@ -2275,7 +2333,7 @@ function jn(r) {
2275
2333
  width: e.width
2276
2334
  };
2277
2335
  }
2278
- function Ve(r, e) {
2336
+ function Ze(r, e) {
2279
2337
  const o = [
2280
2338
  "li",
2281
2339
  "p:not(:first-child)",
@@ -2296,7 +2354,7 @@ function Ve(r, e) {
2296
2354
  }
2297
2355
  );
2298
2356
  }
2299
- function We(r, e, o) {
2357
+ function Qe(r, e, o) {
2300
2358
  var n;
2301
2359
  const a = r.getBoundingClientRect();
2302
2360
  return (n = e.posAtCoords({
@@ -2304,15 +2362,15 @@ function We(r, e, o) {
2304
2362
  top: a.top + 1
2305
2363
  })) == null ? void 0 : n.inside;
2306
2364
  }
2307
- function Me(r, e) {
2365
+ function Le(r, e) {
2308
2366
  const o = e.state.doc.resolve(r);
2309
2367
  return o.depth > 1 ? o.before(o.depth) : r;
2310
2368
  }
2311
2369
  function Un(r) {
2312
2370
  let e = "", o = !1;
2313
- function a(l, c) {
2314
- if (c.focus(), !l.dataTransfer) return;
2315
- const b = Ve(
2371
+ function a(l, d) {
2372
+ if (d.focus(), !l.dataTransfer) return;
2373
+ const b = Ze(
2316
2374
  {
2317
2375
  x: l.clientX + 50 + r.dragHandleWidth,
2318
2376
  y: l.clientY
@@ -2320,35 +2378,35 @@ function Un(r) {
2320
2378
  r
2321
2379
  );
2322
2380
  if (!(b instanceof Element)) return;
2323
- let x = We(b, c, r);
2381
+ let x = Qe(b, d, r);
2324
2382
  if (x == null || x < 0) return;
2325
- x = Me(x, c);
2326
- const { from: A, to: h } = c.state.selection, g = A - h, N = Me(A, c);
2383
+ x = Le(x, d);
2384
+ const { from: A, to: f } = d.state.selection, h = A - f, w = Le(A, d);
2327
2385
  let v = !1;
2328
- const I = c.state.doc.resolve(N);
2386
+ const I = d.state.doc.resolve(w);
2329
2387
  if (I.node().type.name === "doc") v = !0;
2330
2388
  else {
2331
- const k = K.create(
2332
- c.state.doc,
2389
+ const C = K.create(
2390
+ d.state.doc,
2333
2391
  I.before()
2334
2392
  );
2335
- v = !(x + 1 >= k.$from.pos && x <= k.$to.pos);
2393
+ v = !(x + 1 >= C.$from.pos && x <= C.$to.pos);
2336
2394
  }
2337
- let u = c.state.selection;
2338
- if (!v && g !== 0 && !(c.state.selection instanceof K)) {
2339
- const k = K.create(c.state.doc, h - 1);
2340
- u = Vr.create(
2341
- c.state.doc,
2395
+ let u = d.state.selection;
2396
+ if (!v && h !== 0 && !(d.state.selection instanceof K)) {
2397
+ const C = K.create(d.state.doc, f - 1);
2398
+ u = Kr.create(
2399
+ d.state.doc,
2342
2400
  x,
2343
- k.$to.pos
2401
+ C.$to.pos
2344
2402
  );
2345
- } else if (u = K.create(c.state.doc, x), u.node.type.isInline || u.node.type.name === "tableRow") {
2346
- const k = c.state.doc.resolve(u.from);
2347
- u = K.create(c.state.doc, k.before());
2403
+ } else if (u = K.create(d.state.doc, x), u.node.type.isInline || u.node.type.name === "tableRow") {
2404
+ const C = d.state.doc.resolve(u.from);
2405
+ u = K.create(d.state.doc, C.before());
2348
2406
  }
2349
- c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof K && c.state.selection.node.type.name === "listItem" && (e = b.parentElement.tagName);
2350
- const T = c.state.selection.content(), { dom: D, text: w } = _n(c, T);
2351
- l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", D.innerHTML), l.dataTransfer.setData("text/plain", w), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(b, 0, 0), c.dragging = { slice: T, move: l.ctrlKey };
2407
+ d.dispatch(d.state.tr.setSelection(u)), d.state.selection instanceof K && d.state.selection.node.type.name === "listItem" && (e = b.parentElement.tagName);
2408
+ const T = d.state.selection.content(), { dom: R, text: N } = jn(d, T);
2409
+ l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", R.innerHTML), l.dataTransfer.setData("text/plain", N), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(b, 0, 0), d.dragging = { slice: T, move: l.ctrlKey };
2352
2410
  }
2353
2411
  let n = null;
2354
2412
  function s() {
@@ -2357,8 +2415,8 @@ function Un(r) {
2357
2415
  function i() {
2358
2416
  n && n.classList.remove("hide");
2359
2417
  }
2360
- function m(l, c) {
2361
- const b = Me(c, l), x = K.create(l.state.doc, b);
2418
+ function c(l, d) {
2419
+ const b = Le(d, l), x = K.create(l.state.doc, b);
2362
2420
  l.dispatch(l.state.tr.setSelection(x)), l.focus(), o = !0;
2363
2421
  }
2364
2422
  function p(l) {
@@ -2373,30 +2431,30 @@ function Un(r) {
2373
2431
  }
2374
2432
  o && n && !n.classList.contains("hide") ? i() : o || s();
2375
2433
  }
2376
- function C(l) {
2434
+ function k(l) {
2377
2435
  if (!(l.target instanceof Element)) return;
2378
- const c = l.relatedTarget;
2379
- if (!c) {
2436
+ const d = l.relatedTarget;
2437
+ if (!d) {
2380
2438
  o || s();
2381
2439
  return;
2382
2440
  }
2383
- const b = c.closest(".drag-handle") || c.classList.contains("drag-handle"), x = c.closest(".tiptap") || c.classList.contains("tiptap");
2441
+ const b = d.closest(".drag-handle") || d.classList.contains("drag-handle"), x = d.closest(".tiptap") || d.classList.contains("tiptap");
2384
2442
  !b && !x && !o && s();
2385
2443
  }
2386
- return new qr({
2387
- key: new Yr(r.pluginKey),
2444
+ return new Vr({
2445
+ key: new Wr(r.pluginKey),
2388
2446
  view: (l) => {
2389
- var h, g, N, v;
2390
- const c = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
2391
- n = c ?? document.createElement("div"), n.draggable = !0, n.dataset.dragHandle = "", n.classList.add("drag-handle");
2447
+ var f, h, w, v;
2448
+ const d = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
2449
+ n = d ?? document.createElement("div"), n.draggable = !0, n.dataset.dragHandle = "", n.classList.add("drag-handle");
2392
2450
  function b(I) {
2393
2451
  a(I, l);
2394
2452
  }
2395
2453
  n.addEventListener("dragstart", b);
2396
2454
  function x(I) {
2397
- c || (I.preventDefault(), I.stopPropagation());
2455
+ d || (I.preventDefault(), I.stopPropagation());
2398
2456
  const u = n == null ? void 0 : n.dataset.nodePos;
2399
- u && m(l, parseInt(u, 10));
2457
+ u && c(l, parseInt(u, 10));
2400
2458
  }
2401
2459
  n.addEventListener("click", x);
2402
2460
  function A(I) {
@@ -2404,31 +2462,31 @@ function Un(r) {
2404
2462
  const u = window.scrollY;
2405
2463
  I.clientY < r.scrollTreshold ? window.scrollTo({ top: u - 30, behavior: "smooth" }) : window.innerHeight - I.clientY < r.scrollTreshold && window.scrollTo({ top: u + 30, behavior: "smooth" });
2406
2464
  }
2407
- return n.addEventListener("drag", A), s(), c || (g = (h = l == null ? void 0 : l.dom) == null ? void 0 : h.parentElement) == null || g.appendChild(n), (v = (N = l == null ? void 0 : l.dom) == null ? void 0 : N.parentElement) == null || v.addEventListener(
2465
+ return n.addEventListener("drag", A), s(), d || (h = (f = l == null ? void 0 : l.dom) == null ? void 0 : f.parentElement) == null || h.appendChild(n), (v = (w = l == null ? void 0 : l.dom) == null ? void 0 : w.parentElement) == null || v.addEventListener(
2408
2466
  "mouseout",
2409
- C
2467
+ k
2410
2468
  ), {
2411
2469
  destroy: () => {
2412
2470
  var I, u, T;
2413
- c || (I = n == null ? void 0 : n.remove) == null || I.call(n), n == null || n.removeEventListener("drag", A), n == null || n.removeEventListener(
2471
+ d || (I = n == null ? void 0 : n.remove) == null || I.call(n), n == null || n.removeEventListener("drag", A), n == null || n.removeEventListener(
2414
2472
  "dragstart",
2415
2473
  b
2416
2474
  ), n == null || n.removeEventListener("click", x), n = null, (T = (u = l == null ? void 0 : l.dom) == null ? void 0 : u.parentElement) == null || T.removeEventListener(
2417
2475
  "mouseout",
2418
- C
2476
+ k
2419
2477
  );
2420
2478
  }
2421
2479
  };
2422
2480
  },
2423
2481
  props: {
2424
2482
  handleDOMEvents: {
2425
- mousemove: (l, c) => {
2483
+ mousemove: (l, d) => {
2426
2484
  if (!l.editable)
2427
2485
  return;
2428
- const b = Ve(
2486
+ const b = Ze(
2429
2487
  {
2430
- x: c.clientX + 50 + r.dragHandleWidth,
2431
- y: c.clientY
2488
+ x: d.clientX + 50 + r.dragHandleWidth,
2489
+ y: d.clientY
2432
2490
  },
2433
2491
  r
2434
2492
  ), x = b == null ? void 0 : b.closest(".not-draggable"), A = r.excludedTags.concat(["ol", "ul"]).join(", ");
@@ -2436,11 +2494,11 @@ function Un(r) {
2436
2494
  o || s();
2437
2495
  return;
2438
2496
  }
2439
- const h = We(b, l, r);
2440
- h != null && h >= 0 && (n.dataset.nodePos = String(
2441
- Me(h, l)
2497
+ const f = Qe(b, l, r);
2498
+ f != null && f >= 0 && (n.dataset.nodePos = String(
2499
+ Le(f, l)
2442
2500
  ));
2443
- const g = window.getComputedStyle(b), N = parseInt(g.lineHeight, 10), v = isNaN(N) ? parseInt(g.fontSize) * 1.2 : N, I = parseInt(g.paddingTop, 10), u = jn(b);
2501
+ const h = window.getComputedStyle(b), w = parseInt(h.lineHeight, 10), v = isNaN(w) ? parseInt(h.fontSize) * 1.2 : w, I = parseInt(h.paddingTop, 10), u = Xn(b);
2444
2502
  u.top += (v - 24) / 2, u.top += I, b.matches("ul:not([data-type=taskList]) li, ol li") && (u.left -= r.dragHandleWidth - 28), u.width = r.dragHandleWidth, n && (n.style.position = "absolute", n.style.left = `${u.left - u.width}px`, n.style.top = `${u.top}px`, i());
2445
2503
  },
2446
2504
  keydown: () => {
@@ -2457,22 +2515,22 @@ function Un(r) {
2457
2515
  dragstart: (l) => {
2458
2516
  l.dom.classList.add("dragging");
2459
2517
  },
2460
- drop: (l, c) => {
2461
- var g;
2518
+ drop: (l, d) => {
2519
+ var h;
2462
2520
  l.dom.classList.remove("dragging"), s();
2463
2521
  let b = null;
2464
2522
  const x = l.posAtCoords({
2465
- left: c.clientX,
2466
- top: c.clientY
2523
+ left: d.clientX,
2524
+ top: d.clientY
2467
2525
  });
2468
2526
  if (!x || (l.state.selection instanceof K && (b = l.state.selection.node), !b)) return;
2469
- const h = l.state.doc.resolve(x.pos).parent.type.name === "listItem";
2470
- if (l.state.selection instanceof K && l.state.selection.node.type.name === "listItem" && !h && e == "OL") {
2471
- const N = (g = l.state.schema.nodes.orderedList) == null ? void 0 : g.createAndFill(
2527
+ const f = l.state.doc.resolve(x.pos).parent.type.name === "listItem";
2528
+ if (l.state.selection instanceof K && l.state.selection.node.type.name === "listItem" && !f && e == "OL") {
2529
+ const w = (h = l.state.schema.nodes.orderedList) == null ? void 0 : h.createAndFill(
2472
2530
  null,
2473
2531
  b
2474
- ), v = new Wr(Kr.from(N), 0, 0);
2475
- l.dragging = { slice: v, move: c.ctrlKey };
2532
+ ), v = new Jr(Zr.from(w), 0, 0);
2533
+ l.dragging = { slice: v, move: d.ctrlKey };
2476
2534
  }
2477
2535
  },
2478
2536
  dragend: (l) => {
@@ -2485,22 +2543,22 @@ function Un(r) {
2485
2543
  init() {
2486
2544
  return {};
2487
2545
  },
2488
- apply(l, c, b, x) {
2546
+ apply(l, d, b, x) {
2489
2547
  if (l.docChanged && n && n.dataset.nodePos) {
2490
2548
  const A = parseInt(n.dataset.nodePos, 10);
2491
2549
  try {
2492
- const h = x.doc.resolve(A);
2493
- (!h || h.parent.type.name === "doc") && (o = !1, s());
2550
+ const f = x.doc.resolve(A);
2551
+ (!f || f.parent.type.name === "doc") && (o = !1, s());
2494
2552
  } catch {
2495
2553
  o = !1, s();
2496
2554
  }
2497
2555
  }
2498
- return c;
2556
+ return d;
2499
2557
  }
2500
2558
  }
2501
2559
  });
2502
2560
  }
2503
- const Xn = Gr.create({
2561
+ const Gn = Yr.create({
2504
2562
  name: "globalDragHandle",
2505
2563
  addOptions() {
2506
2564
  return {
@@ -2522,18 +2580,18 @@ const Xn = Gr.create({
2522
2580
  })
2523
2581
  ];
2524
2582
  }
2525
- }), Gn = br, qn = ar.configure({
2583
+ }), qn = yr, Yn = ir.configure({
2526
2584
  placeholder: "撰写任何内容,或者按“/”输入命令..."
2527
- }), Yn = sr.configure({
2585
+ }), Vn = lr.configure({
2528
2586
  HTMLAttributes: {
2529
2587
  class: q(
2530
2588
  "text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
2531
2589
  )
2532
2590
  }
2533
- }), Vn = ir.extend({
2591
+ }), Wn = cr.extend({
2534
2592
  addProseMirrorPlugins() {
2535
2593
  return [
2536
- lr({
2594
+ dr({
2537
2595
  imageClass: q("opacity-40 rounded-lg border border-stone-200")
2538
2596
  })
2539
2597
  ];
@@ -2543,24 +2601,24 @@ const Xn = Gr.create({
2543
2601
  HTMLAttributes: {
2544
2602
  class: q("rounded-lg border border-muted")
2545
2603
  }
2546
- }), Wn = cr.configure({
2604
+ }), Kn = mr.configure({
2547
2605
  HTMLAttributes: {
2548
2606
  class: q("rounded-lg border border-muted")
2549
2607
  }
2550
- }), Kn = dr.configure({
2608
+ }), Jn = ur.configure({
2551
2609
  HTMLAttributes: {
2552
2610
  class: q("not-prose pl-2 ")
2553
2611
  }
2554
- }), Jn = mr.configure({
2612
+ }), Zn = pr.configure({
2555
2613
  HTMLAttributes: {
2556
2614
  class: q("flex gap-2 items-start my-4")
2557
2615
  },
2558
2616
  nested: !0
2559
- }), Zn = ur.configure({
2617
+ }), Qn = gr.configure({
2560
2618
  HTMLAttributes: {
2561
2619
  class: q("mt-4 mb-6 border-t border-muted-foreground")
2562
2620
  }
2563
- }), Qn = pr.configure({
2621
+ }), ea = fr.configure({
2564
2622
  bulletList: {
2565
2623
  HTMLAttributes: {
2566
2624
  class: q("list-disc list-outside leading-3 -mt-2")
@@ -2600,18 +2658,18 @@ const Xn = Gr.create({
2600
2658
  width: 4
2601
2659
  },
2602
2660
  gapcursor: !1
2603
- }), ea = gr.configure({
2661
+ }), ta = hr.configure({
2604
2662
  // configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only
2605
2663
  // common: covers 37 language grammars which should be good enough in most cases
2606
- lowlight: Ur(Xr)
2607
- }), ta = fr.configure({
2664
+ lowlight: Gr(qr)
2665
+ }), oa = br.configure({
2608
2666
  HTMLAttributes: {
2609
2667
  class: q("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
2610
2668
  },
2611
2669
  katexOptions: {
2612
2670
  throwOnError: !1
2613
2671
  }
2614
- }), oa = hr.configure(), ra = _r.configure({
2672
+ }), ra = xr.configure(), na = Xr.configure({
2615
2673
  html: !0,
2616
2674
  tightLists: !0,
2617
2675
  tightListClass: "tight",
@@ -2620,30 +2678,30 @@ const Xn = Gr.create({
2620
2678
  breaks: !1,
2621
2679
  transformPastedText: !1,
2622
2680
  transformCopiedText: !1
2623
- }), na = Xn.configure({
2681
+ }), aa = Gn.configure({
2624
2682
  dragHandleWidth: 56,
2625
2683
  dragHandleSelector: ".custom-drag-handle"
2626
- }), Dt = [
2627
- Qn,
2628
- qn,
2684
+ }), zt = [
2685
+ ea,
2629
2686
  Yn,
2630
2687
  Vn,
2631
2688
  Wn,
2632
2689
  Kn,
2633
2690
  Jn,
2634
2691
  Zn,
2635
- Gn,
2636
- ea,
2692
+ Qn,
2693
+ qn,
2637
2694
  ta,
2638
2695
  oa,
2639
- xr,
2640
2696
  ra,
2641
- yr,
2642
2697
  vr,
2698
+ na,
2643
2699
  kr,
2644
2700
  Cr,
2645
- na
2646
- ], aa = ve.Root, Pt = ve.Trigger, Ae = G.forwardRef(({ className: r, align: e = "center", sideOffset: o = 4, ...a }, n) => /* @__PURE__ */ t(ve.Portal, { children: /* @__PURE__ */ t(
2701
+ wr,
2702
+ Nr,
2703
+ aa
2704
+ ], sa = ve.Root, Et = ve.Trigger, Re = G.forwardRef(({ className: r, align: e = "center", sideOffset: o = 4, ...a }, n) => /* @__PURE__ */ t(ve.Portal, { children: /* @__PURE__ */ t(
2647
2705
  ve.Content,
2648
2706
  {
2649
2707
  ref: n,
@@ -2656,8 +2714,8 @@ const Xn = Gr.create({
2656
2714
  ...a
2657
2715
  }
2658
2716
  ) }));
2659
- Ae.displayName = ve.Content.displayName;
2660
- const sa = jr(
2717
+ Re.displayName = ve.Content.displayName;
2718
+ const ia = Ur(
2661
2719
  "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",
2662
2720
  {
2663
2721
  variants: {
@@ -2683,16 +2741,16 @@ const sa = jr(
2683
2741
  }
2684
2742
  ), J = G.forwardRef(
2685
2743
  ({ className: r, variant: e, size: o, asChild: a = !1, ...n }, s) => /* @__PURE__ */ t(
2686
- a ? Qr : "button",
2744
+ a ? tn : "button",
2687
2745
  {
2688
- className: y(sa({ variant: e, size: o, className: r })),
2746
+ className: y(ia({ variant: e, size: o, className: r })),
2689
2747
  ref: s,
2690
2748
  ...n
2691
2749
  }
2692
2750
  )
2693
2751
  );
2694
2752
  J.displayName = "Button";
2695
- const Ke = [
2753
+ const et = [
2696
2754
  {
2697
2755
  name: "默认",
2698
2756
  // Default
@@ -2738,7 +2796,7 @@ const Ke = [
2738
2796
  // Gray
2739
2797
  color: "#A8A29E"
2740
2798
  }
2741
- ], Je = [
2799
+ ], tt = [
2742
2800
  {
2743
2801
  name: "默认背景",
2744
2802
  // Default
@@ -2785,10 +2843,10 @@ const Ke = [
2785
2843
  color: "var(--novel-highlight-gray)"
2786
2844
  }
2787
2845
  ], de = (r) => /* @__PURE__ */ t(
2788
- et,
2846
+ at,
2789
2847
  {
2790
2848
  classNames: {
2791
- root: f`
2849
+ root: g`
2792
2850
  background-color: transparent;
2793
2851
  padding: 0;
2794
2852
  .rc-tooltip-content {
@@ -2800,16 +2858,16 @@ const Ke = [
2800
2858
  showArrow: !1,
2801
2859
  ...r
2802
2860
  }
2803
- ), ia = ({ open: r, onOpenChange: e }) => {
2861
+ ), la = ({ open: r, onOpenChange: e }) => {
2804
2862
  const { editor: o } = Q();
2805
2863
  if (!o) return null;
2806
- const a = Ke.find(
2864
+ const a = et.find(
2807
2865
  ({ color: s }) => o.isActive("textStyle", { color: s })
2808
- ), n = Je.find(
2866
+ ), n = tt.find(
2809
2867
  ({ color: s }) => o.isActive("highlight", { color: s })
2810
2868
  );
2811
- return /* @__PURE__ */ d(aa, { modal: !0, open: r, onOpenChange: e, children: [
2812
- /* @__PURE__ */ t(de, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Pt, { asChild: !0, children: /* @__PURE__ */ d(J, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
2869
+ return /* @__PURE__ */ m(sa, { modal: !0, open: r, onOpenChange: e, children: [
2870
+ /* @__PURE__ */ t(de, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Et, { asChild: !0, children: /* @__PURE__ */ m(J, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
2813
2871
  /* @__PURE__ */ t(
2814
2872
  "span",
2815
2873
  {
@@ -2821,26 +2879,26 @@ const Ke = [
2821
2879
  children: "A"
2822
2880
  }
2823
2881
  ),
2824
- /* @__PURE__ */ t(tt, {})
2882
+ /* @__PURE__ */ t(st, {})
2825
2883
  ] }) }) }),
2826
- /* @__PURE__ */ d(
2827
- Ae,
2884
+ /* @__PURE__ */ m(
2885
+ Re,
2828
2886
  {
2829
2887
  sideOffset: 5,
2830
2888
  className: "my-1 flex max-h-80 w-48 flex-col overflow-hidden overflow-y-auto rounded border p-1 shadow-xl ",
2831
2889
  align: "start",
2832
2890
  children: [
2833
- /* @__PURE__ */ d("div", { className: "flex flex-col", children: [
2891
+ /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
2834
2892
  /* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "颜色" }),
2835
- Ke.map(({ name: s, color: i }) => /* @__PURE__ */ d(
2836
- Le,
2893
+ et.map(({ name: s, color: i }) => /* @__PURE__ */ m(
2894
+ Ae,
2837
2895
  {
2838
2896
  onSelect: () => {
2839
2897
  o.commands.unsetColor(), s !== "Default" && o.chain().focus().setColor(i || "").run(), e(!1);
2840
2898
  },
2841
2899
  className: "flex cursor-pointer items-center justify-between px-2 py-1 text-sm hover:bg-accent",
2842
2900
  children: [
2843
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2901
+ /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
2844
2902
  /* @__PURE__ */ t(
2845
2903
  "div",
2846
2904
  {
@@ -2857,17 +2915,17 @@ const Ke = [
2857
2915
  s
2858
2916
  ))
2859
2917
  ] }),
2860
- /* @__PURE__ */ d("div", { children: [
2918
+ /* @__PURE__ */ m("div", { children: [
2861
2919
  /* @__PURE__ */ t("div", { className: "my-1 px-2 text-sm font-semibold text-muted-foreground", children: "背景 " }),
2862
- Je.map(({ name: s, color: i }) => /* @__PURE__ */ d(
2863
- Le,
2920
+ tt.map(({ name: s, color: i }) => /* @__PURE__ */ m(
2921
+ Ae,
2864
2922
  {
2865
2923
  onSelect: () => {
2866
2924
  o.commands.unsetHighlight(), s !== "Default" && o.chain().focus().setHighlight({ color: i }).run(), e(!1);
2867
2925
  },
2868
2926
  className: "flex cursor-pointer items-center justify-between px-2 py-1 text-sm hover:bg-accent",
2869
2927
  children: [
2870
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
2928
+ /* @__PURE__ */ m("div", { className: "flex items-center gap-2", children: [
2871
2929
  /* @__PURE__ */ t(
2872
2930
  "div",
2873
2931
  {
@@ -2889,15 +2947,15 @@ const Ke = [
2889
2947
  )
2890
2948
  ] });
2891
2949
  };
2892
- function la(r) {
2950
+ function ca(r) {
2893
2951
  try {
2894
2952
  return new URL(r), !0;
2895
2953
  } catch {
2896
2954
  return !1;
2897
2955
  }
2898
2956
  }
2899
- function ca(r) {
2900
- if (la(r)) return r;
2957
+ function da(r) {
2958
+ if (ca(r)) return r;
2901
2959
  try {
2902
2960
  if (r.includes(".") && !r.includes(" "))
2903
2961
  return new URL(`https://${r}`).toString();
@@ -2905,20 +2963,20 @@ function ca(r) {
2905
2963
  return null;
2906
2964
  }
2907
2965
  }
2908
- const da = ({ open: r, onOpenChange: e }) => {
2966
+ const ma = ({ open: r, onOpenChange: e }) => {
2909
2967
  const o = he(null), { editor: a } = Q();
2910
2968
  return ie(() => {
2911
2969
  var n;
2912
2970
  (n = o.current) == null || n.focus();
2913
- }), a ? /* @__PURE__ */ d(ft, { modal: !0, open: r, onOpenChange: e, children: [
2914
- /* @__PURE__ */ t(de, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(Zr, { asChild: !0, children: /* @__PURE__ */ d(
2971
+ }), a ? /* @__PURE__ */ m(vt, { modal: !0, open: r, onOpenChange: e, children: [
2972
+ /* @__PURE__ */ t(de, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(en, { asChild: !0, children: /* @__PURE__ */ m(
2915
2973
  J,
2916
2974
  {
2917
2975
  size: "sm",
2918
2976
  variant: "ghost",
2919
2977
  className: "gap-2 rounded-md border-none",
2920
2978
  children: [
2921
- /* @__PURE__ */ t("p", { className: "text-base", children: /* @__PURE__ */ t(go, { size: 16 }) }),
2979
+ /* @__PURE__ */ t("p", { className: "text-base", children: /* @__PURE__ */ t(ho, { size: 16 }) }),
2922
2980
  /* @__PURE__ */ t(
2923
2981
  "p",
2924
2982
  {
@@ -2934,14 +2992,14 @@ const da = ({ open: r, onOpenChange: e }) => {
2934
2992
  ]
2935
2993
  }
2936
2994
  ) }) }),
2937
- /* @__PURE__ */ t(Ae, { align: "start", className: "w-60 p-0", sideOffset: 10, children: /* @__PURE__ */ d(
2995
+ /* @__PURE__ */ t(Re, { align: "start", className: "w-60 p-0", sideOffset: 10, children: /* @__PURE__ */ m(
2938
2996
  "form",
2939
2997
  {
2940
2998
  onSubmit: (n) => {
2941
2999
  const s = n.currentTarget;
2942
3000
  n.preventDefault();
2943
- const i = s[0], m = ca(i.value);
2944
- m && (a.chain().focus().setLink({ href: m }).run(), e(!1));
3001
+ const i = s[0], c = da(i.value);
3002
+ c && (a.chain().focus().setLink({ href: c }).run(), e(!1));
2945
3003
  },
2946
3004
  className: "flex p-1 ",
2947
3005
  children: [
@@ -2965,14 +3023,14 @@ const da = ({ open: r, onOpenChange: e }) => {
2965
3023
  onClick: () => {
2966
3024
  a.chain().focus().unsetLink().run(), o.current.value = "", e(!1);
2967
3025
  },
2968
- children: /* @__PURE__ */ t(ot, { className: "h-4 w-4" })
3026
+ children: /* @__PURE__ */ t(it, { className: "h-4 w-4" })
2969
3027
  }
2970
3028
  ) : /* @__PURE__ */ t(J, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ye, { className: "h-4 w-4" }) })
2971
3029
  ]
2972
3030
  }
2973
3031
  ) })
2974
3032
  ] }) : null;
2975
- }, ma = () => {
3033
+ }, ua = () => {
2976
3034
  const { editor: r } = Q();
2977
3035
  return r ? /* @__PURE__ */ t(de, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ t(
2978
3036
  J,
@@ -2990,7 +3048,7 @@ const da = ({ open: r, onOpenChange: e }) => {
2990
3048
  }
2991
3049
  },
2992
3050
  children: /* @__PURE__ */ t(
2993
- en,
3051
+ on,
2994
3052
  {
2995
3053
  className: y("size-4", { "text-blue-500": r.isActive("math") }),
2996
3054
  strokeWidth: 2.3
@@ -2998,103 +3056,103 @@ const da = ({ open: r, onOpenChange: e }) => {
2998
3056
  )
2999
3057
  }
3000
3058
  ) }) : null;
3001
- }, Be = [
3059
+ }, Ee = [
3002
3060
  {
3003
3061
  name: "正文",
3004
3062
  // Text
3005
- icon: rt,
3063
+ icon: lt,
3006
3064
  command: (r) => r.chain().focus().clearNodes().run(),
3007
3065
  isActive: (r) => r.isActive("paragraph") && !r.isActive("bulletList") && !r.isActive("orderedList")
3008
3066
  },
3009
3067
  {
3010
3068
  name: "标题 1",
3011
3069
  // Heading 1
3012
- icon: nt,
3070
+ icon: ct,
3013
3071
  command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 1 }).run(),
3014
3072
  isActive: (r) => r.isActive("heading", { level: 1 })
3015
3073
  },
3016
3074
  {
3017
3075
  name: "标题 2",
3018
3076
  // Heading 2
3019
- icon: at,
3077
+ icon: dt,
3020
3078
  command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 2 }).run(),
3021
3079
  isActive: (r) => r.isActive("heading", { level: 2 })
3022
3080
  },
3023
3081
  {
3024
3082
  name: "标题 3",
3025
3083
  // Heading 3
3026
- icon: st,
3084
+ icon: mt,
3027
3085
  command: (r) => r.chain().focus().clearNodes().toggleHeading({ level: 3 }).run(),
3028
3086
  isActive: (r) => r.isActive("heading", { level: 3 })
3029
3087
  },
3030
3088
  {
3031
3089
  name: "待办列表",
3032
3090
  // To-do List
3033
- icon: it,
3091
+ icon: ut,
3034
3092
  command: (r) => r.chain().focus().clearNodes().toggleTaskList().run(),
3035
3093
  isActive: (r) => r.isActive("taskItem")
3036
3094
  },
3037
3095
  {
3038
3096
  name: "无序列表",
3039
3097
  // Bullet List
3040
- icon: lt,
3098
+ icon: pt,
3041
3099
  command: (r) => r.chain().focus().clearNodes().toggleBulletList().run(),
3042
3100
  isActive: (r) => r.isActive("bulletList")
3043
3101
  },
3044
3102
  {
3045
3103
  name: "有序列表",
3046
3104
  // Numbered List
3047
- icon: ct,
3105
+ icon: gt,
3048
3106
  command: (r) => r.chain().focus().clearNodes().toggleOrderedList().run(),
3049
3107
  isActive: (r) => r.isActive("orderedList")
3050
3108
  },
3051
3109
  {
3052
3110
  name: "引用",
3053
3111
  // Quote
3054
- icon: dt,
3112
+ icon: ft,
3055
3113
  command: (r) => r.chain().focus().clearNodes().toggleBlockquote().run(),
3056
3114
  isActive: (r) => r.isActive("blockquote")
3057
3115
  },
3058
3116
  {
3059
3117
  name: "代码块",
3060
3118
  // Code
3061
- icon: mt,
3119
+ icon: ht,
3062
3120
  command: (r) => r.chain().focus().clearNodes().toggleCodeBlock().run(),
3063
3121
  isActive: (r) => r.isActive("codeBlock")
3064
3122
  }
3065
- ], ua = ({ open: r, onOpenChange: e }) => {
3123
+ ], pa = ({ open: r, onOpenChange: e }) => {
3066
3124
  const { editor: o } = Q();
3067
3125
  if (!o) return null;
3068
- const a = Be.filter(
3126
+ const a = Ee.filter(
3069
3127
  (n) => n.isActive(o)
3070
3128
  ).pop() ?? {
3071
3129
  name: "多个选中"
3072
3130
  // Multiple
3073
3131
  };
3074
- return /* @__PURE__ */ d(ft, { modal: !0, open: r, onOpenChange: e, children: [
3132
+ return /* @__PURE__ */ m(vt, { modal: !0, open: r, onOpenChange: e, children: [
3075
3133
  /* @__PURE__ */ t(de, { overlay: "转换成", placement: "top", children: /* @__PURE__ */ t(
3076
- Pt,
3134
+ Et,
3077
3135
  {
3078
3136
  asChild: !0,
3079
3137
  className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
3080
- children: /* @__PURE__ */ d(J, { size: "sm", variant: "ghost", children: [
3138
+ children: /* @__PURE__ */ m(J, { size: "sm", variant: "ghost", children: [
3081
3139
  /* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: a.name }),
3082
- /* @__PURE__ */ t(tt, {})
3140
+ /* @__PURE__ */ t(st, {})
3083
3141
  ] })
3084
3142
  }
3085
3143
  ) }),
3086
- /* @__PURE__ */ d(Ae, { sideOffset: 5, align: "start", className: "w-48 p-1", children: [
3144
+ /* @__PURE__ */ m(Re, { sideOffset: 5, align: "start", className: "w-48 p-1", children: [
3087
3145
  /* @__PURE__ */ t("p", { className: "mb-2 text-sm text-secondary-foreground", children: "转换成" }),
3088
3146
  " ",
3089
- Be.map((n) => /* @__PURE__ */ d(
3090
- Le,
3147
+ Ee.map((n) => /* @__PURE__ */ m(
3148
+ Ae,
3091
3149
  {
3092
3150
  onSelect: (s) => {
3093
3151
  n.command(s), e(!1);
3094
3152
  },
3095
3153
  className: "flex cursor-pointer items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-accent",
3096
3154
  children: [
3097
- /* @__PURE__ */ d("div", { className: "flex items-center space-x-2", children: [
3155
+ /* @__PURE__ */ m("div", { className: "flex items-center space-x-2", children: [
3098
3156
  /* @__PURE__ */ t("div", { className: "rounded-sm border p-1", children: /* @__PURE__ */ t(n.icon, { className: "h-3 w-3" }) }),
3099
3157
  /* @__PURE__ */ t("span", { children: n.name })
3100
3158
  ] }),
@@ -3107,7 +3165,7 @@ const da = ({ open: r, onOpenChange: e }) => {
3107
3165
  ] });
3108
3166
  }, pe = G.forwardRef(
3109
3167
  ({ className: r, orientation: e = "horizontal", decorative: o = !0, ...a }, n) => /* @__PURE__ */ t(
3110
- ht.Root,
3168
+ kt.Root,
3111
3169
  {
3112
3170
  ref: n,
3113
3171
  decorative: o,
@@ -3121,12 +3179,12 @@ const da = ({ open: r, onOpenChange: e }) => {
3121
3179
  }
3122
3180
  )
3123
3181
  );
3124
- pe.displayName = ht.Root.displayName;
3125
- const pa = () => /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-0.5", children: [
3182
+ pe.displayName = kt.Root.displayName;
3183
+ const ga = () => /* @__PURE__ */ m("div", { className: "flex items-center justify-center gap-0.5", children: [
3126
3184
  /* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.3s]" }),
3127
3185
  /* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500 [animation-delay:-0.15s]" }),
3128
3186
  /* @__PURE__ */ t("div", { className: "h-1.5 w-1.5 animate-bounce rounded-full bg-purple-500" })
3129
- ] }), Bt = G.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__ */ d(
3187
+ ] }), $t = G.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__ */ m(
3130
3188
  ce.Root,
3131
3189
  {
3132
3190
  ref: a,
@@ -3134,13 +3192,13 @@ const pa = () => /* @__PURE__ */ d("div", { className: "flex items-center justif
3134
3192
  ...o,
3135
3193
  children: [
3136
3194
  /* @__PURE__ */ t(ce.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
3137
- /* @__PURE__ */ t(zt, {}),
3195
+ /* @__PURE__ */ t(Ht, {}),
3138
3196
  /* @__PURE__ */ t(ce.Corner, {})
3139
3197
  ]
3140
3198
  }
3141
3199
  ));
3142
- Bt.displayName = ce.Root.displayName;
3143
- const zt = G.forwardRef(({ className: r, orientation: e = "vertical", ...o }, a) => /* @__PURE__ */ t(
3200
+ $t.displayName = ce.Root.displayName;
3201
+ const Ht = G.forwardRef(({ className: r, orientation: e = "vertical", ...o }, a) => /* @__PURE__ */ t(
3144
3202
  ce.ScrollAreaScrollbar,
3145
3203
  {
3146
3204
  ref: a,
@@ -3155,8 +3213,8 @@ const zt = G.forwardRef(({ className: r, orientation: e = "vertical", ...o }, a)
3155
3213
  children: /* @__PURE__ */ t(ce.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
3156
3214
  }
3157
3215
  ));
3158
- zt.displayName = ce.ScrollAreaScrollbar.displayName;
3159
- const ga = te.Portal, Et = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3216
+ Ht.displayName = ce.ScrollAreaScrollbar.displayName;
3217
+ const fa = te.Portal, Ot = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3160
3218
  te.Overlay,
3161
3219
  {
3162
3220
  ref: o,
@@ -3167,10 +3225,10 @@ const ga = te.Portal, Et = G.forwardRef(({ className: r, ...e }, o) => /* @__PUR
3167
3225
  ...e
3168
3226
  }
3169
3227
  ));
3170
- Et.displayName = te.Overlay.displayName;
3171
- const fa = G.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__ */ d(ga, { children: [
3172
- /* @__PURE__ */ t(Et, {}),
3173
- /* @__PURE__ */ d(
3228
+ Ot.displayName = te.Overlay.displayName;
3229
+ const ha = G.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__ */ m(fa, { children: [
3230
+ /* @__PURE__ */ t(Ot, {}),
3231
+ /* @__PURE__ */ m(
3174
3232
  te.Content,
3175
3233
  {
3176
3234
  ref: a,
@@ -3181,16 +3239,16 @@ const fa = G.forwardRef(({ className: r, children: e, ...o }, a) => /* @__PURE__
3181
3239
  ...o,
3182
3240
  children: [
3183
3241
  e,
3184
- /* @__PURE__ */ d(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: [
3185
- /* @__PURE__ */ t(tn, { className: "h-4 w-4" }),
3242
+ /* @__PURE__ */ m(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: [
3243
+ /* @__PURE__ */ t(rn, { className: "h-4 w-4" }),
3186
3244
  /* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
3187
3245
  ] })
3188
3246
  ]
3189
3247
  }
3190
3248
  )
3191
3249
  ] }));
3192
- fa.displayName = te.Content.displayName;
3193
- const ha = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3250
+ ha.displayName = te.Content.displayName;
3251
+ const ba = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3194
3252
  te.Title,
3195
3253
  {
3196
3254
  ref: o,
@@ -3201,8 +3259,8 @@ const ha = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3201
3259
  ...e
3202
3260
  }
3203
3261
  ));
3204
- ha.displayName = te.Title.displayName;
3205
- const ba = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3262
+ ba.displayName = te.Title.displayName;
3263
+ const xa = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3206
3264
  te.Description,
3207
3265
  {
3208
3266
  ref: o,
@@ -3210,8 +3268,8 @@ const ba = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3210
3268
  ...e
3211
3269
  }
3212
3270
  ));
3213
- ba.displayName = te.Description.displayName;
3214
- const $t = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3271
+ xa.displayName = te.Description.displayName;
3272
+ const Ft = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3215
3273
  V,
3216
3274
  {
3217
3275
  ref: o,
@@ -3222,9 +3280,9 @@ const $t = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3222
3280
  ...e
3223
3281
  }
3224
3282
  ));
3225
- $t.displayName = V.displayName;
3226
- const Ht = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ d("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
3227
- /* @__PURE__ */ t($e, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
3283
+ Ft.displayName = V.displayName;
3284
+ const _t = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
3285
+ /* @__PURE__ */ t(Oe, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
3228
3286
  /* @__PURE__ */ t(
3229
3287
  V.Input,
3230
3288
  {
@@ -3237,8 +3295,8 @@ const Ht = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ d("div",
3237
3295
  }
3238
3296
  )
3239
3297
  ] }));
3240
- Ht.displayName = V.Input.displayName;
3241
- const xa = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3298
+ _t.displayName = V.Input.displayName;
3299
+ const ya = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3242
3300
  V.List,
3243
3301
  {
3244
3302
  ref: o,
@@ -3246,8 +3304,8 @@ const xa = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3246
3304
  ...e
3247
3305
  }
3248
3306
  ));
3249
- xa.displayName = V.List.displayName;
3250
- const ya = G.forwardRef((r, e) => /* @__PURE__ */ t(
3307
+ ya.displayName = V.List.displayName;
3308
+ const va = G.forwardRef((r, e) => /* @__PURE__ */ t(
3251
3309
  V.Empty,
3252
3310
  {
3253
3311
  ref: e,
@@ -3255,7 +3313,7 @@ const ya = G.forwardRef((r, e) => /* @__PURE__ */ t(
3255
3313
  ...r
3256
3314
  }
3257
3315
  ));
3258
- ya.displayName = V.Empty.displayName;
3316
+ va.displayName = V.Empty.displayName;
3259
3317
  const Ce = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3260
3318
  V.Group,
3261
3319
  {
@@ -3268,7 +3326,7 @@ const Ce = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3268
3326
  }
3269
3327
  ));
3270
3328
  Ce.displayName = V.Group.displayName;
3271
- const Xe = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3329
+ const Ve = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3272
3330
  V.Separator,
3273
3331
  {
3274
3332
  ref: o,
@@ -3276,7 +3334,7 @@ const Xe = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3276
3334
  ...e
3277
3335
  }
3278
3336
  ));
3279
- Xe.displayName = V.Separator.displayName;
3337
+ Ve.displayName = V.Separator.displayName;
3280
3338
  const ge = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3281
3339
  V.Item,
3282
3340
  {
@@ -3289,14 +3347,14 @@ const ge = G.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3289
3347
  }
3290
3348
  ));
3291
3349
  ge.displayName = V.Item.displayName;
3292
- const va = ({
3350
+ const ka = ({
3293
3351
  completion: r,
3294
3352
  onDiscard: e
3295
3353
  }) => {
3296
3354
  const { editor: o } = Q();
3297
- return /* @__PURE__ */ d(me, { children: [
3298
- /* @__PURE__ */ d(Ce, { children: [
3299
- /* @__PURE__ */ d(
3355
+ return /* @__PURE__ */ m(me, { children: [
3356
+ /* @__PURE__ */ m(Ce, { children: [
3357
+ /* @__PURE__ */ m(
3300
3358
  ge,
3301
3359
  {
3302
3360
  className: "gap-2 px-4",
@@ -3312,12 +3370,12 @@ const va = ({
3312
3370
  ).run();
3313
3371
  },
3314
3372
  children: [
3315
- /* @__PURE__ */ t(on, { className: "h-4 w-4 text-muted-foreground" }),
3373
+ /* @__PURE__ */ t(nn, { className: "h-4 w-4 text-muted-foreground" }),
3316
3374
  "替换选择"
3317
3375
  ]
3318
3376
  }
3319
3377
  ),
3320
- /* @__PURE__ */ d(
3378
+ /* @__PURE__ */ m(
3321
3379
  ge,
3322
3380
  {
3323
3381
  className: "gap-2 px-4",
@@ -3327,49 +3385,49 @@ const va = ({
3327
3385
  o.chain().focus().insertContentAt(a.to + 1, r).run();
3328
3386
  },
3329
3387
  children: [
3330
- /* @__PURE__ */ t(rn, { className: "h-4 w-4 text-muted-foreground" }),
3388
+ /* @__PURE__ */ t(an, { className: "h-4 w-4 text-muted-foreground" }),
3331
3389
  "在下面插入"
3332
3390
  ]
3333
3391
  }
3334
3392
  )
3335
3393
  ] }),
3336
- /* @__PURE__ */ t(Xe, {}),
3337
- /* @__PURE__ */ t(Ce, { children: /* @__PURE__ */ d(ge, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
3338
- /* @__PURE__ */ t(nn, { className: "h-4 w-4 text-muted-foreground" }),
3394
+ /* @__PURE__ */ t(Ve, {}),
3395
+ /* @__PURE__ */ t(Ce, { children: /* @__PURE__ */ m(ge, { onSelect: e, value: "thrash", className: "gap-2 px-4", children: [
3396
+ /* @__PURE__ */ t(sn, { className: "h-4 w-4 text-muted-foreground" }),
3339
3397
  "丢弃"
3340
3398
  ] }) })
3341
3399
  ] });
3342
- }, ka = [
3400
+ }, Ca = [
3343
3401
  {
3344
3402
  value: "improve",
3345
3403
  label: "改进写作",
3346
3404
  // Improve writing
3347
- icon: an
3405
+ icon: ln
3348
3406
  },
3349
3407
  {
3350
3408
  value: "fix",
3351
3409
  label: "修正语法",
3352
3410
  // Fix grammar
3353
- icon: sn
3411
+ icon: cn
3354
3412
  },
3355
3413
  {
3356
3414
  value: "shorter",
3357
3415
  label: "缩短文本",
3358
3416
  // Make shorter
3359
- icon: ln
3417
+ icon: dn
3360
3418
  },
3361
3419
  {
3362
3420
  value: "longer",
3363
3421
  label: "扩展文本",
3364
3422
  // Make longer
3365
- icon: cn
3423
+ icon: mn
3366
3424
  }
3367
- ], Ca = ({ onSelect: r }) => {
3425
+ ], wa = ({ onSelect: r }) => {
3368
3426
  const { editor: e } = Q();
3369
- return /* @__PURE__ */ d(me, { children: [
3370
- /* @__PURE__ */ d(Ce, { heading: "编辑或校对选中文本", children: [
3427
+ return /* @__PURE__ */ m(me, { children: [
3428
+ /* @__PURE__ */ m(Ce, { heading: "编辑或校对选中文本", children: [
3371
3429
  " ",
3372
- ka.map((o) => /* @__PURE__ */ d(
3430
+ Ca.map((o) => /* @__PURE__ */ m(
3373
3431
  ge,
3374
3432
  {
3375
3433
  onSelect: (a) => {
@@ -3388,20 +3446,20 @@ const va = ({
3388
3446
  o.value
3389
3447
  ))
3390
3448
  ] }),
3391
- /* @__PURE__ */ t(Xe, {}),
3392
- /* @__PURE__ */ d(Ce, { heading: "使用 AI 完成更多", children: [
3449
+ /* @__PURE__ */ t(Ve, {}),
3450
+ /* @__PURE__ */ m(Ce, { heading: "使用 AI 完成更多", children: [
3393
3451
  " ",
3394
- /* @__PURE__ */ d(
3452
+ /* @__PURE__ */ m(
3395
3453
  ge,
3396
3454
  {
3397
3455
  onSelect: () => {
3398
- const o = e.state.selection.from, a = wr(e, o);
3456
+ const o = e.state.selection.from, a = Ir(e, o);
3399
3457
  r(a, "continue");
3400
3458
  },
3401
3459
  value: "continue",
3402
3460
  className: "gap-2 px-4",
3403
3461
  children: [
3404
- /* @__PURE__ */ t(dn, { className: "h-4 w-4 text-purple-500" }),
3462
+ /* @__PURE__ */ t(un, { className: "h-4 w-4 text-purple-500" }),
3405
3463
  "继续写作"
3406
3464
  ]
3407
3465
  }
@@ -3409,38 +3467,38 @@ const va = ({
3409
3467
  ] })
3410
3468
  ] });
3411
3469
  };
3412
- function wa({ onOpenChange: r, options: e }) {
3413
- const { editor: o } = Q(), [a, n] = H(""), { completion: s, complete: i, isLoading: m } = bn({
3470
+ function Na({ onOpenChange: r, options: e }) {
3471
+ const { editor: o } = Q(), [a, n] = H(""), { completion: s, complete: i, isLoading: c } = yn({
3414
3472
  // id: "novel",
3415
3473
  api: "/api/generate",
3416
- onResponse: (C) => {
3417
- if (C.status === 429) {
3474
+ onResponse: (k) => {
3475
+ if (k.status === 429) {
3418
3476
  ke.error("You have reached your request limit for the day.");
3419
3477
  return;
3420
3478
  }
3421
3479
  },
3422
- onError: (C) => {
3423
- ke.error(C.message);
3480
+ onError: (k) => {
3481
+ ke.error(k.message);
3424
3482
  },
3425
3483
  ...e
3426
3484
  }), p = s.length > 0;
3427
- return /* @__PURE__ */ d($t, { className: "w-[350px]", children: [
3428
- p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t(Bt, { children: /* @__PURE__ */ t("div", { className: "prose p-2 px-4 prose-sm", children: /* @__PURE__ */ t(pt, { children: s }) }) }) }),
3429
- m && /* @__PURE__ */ d("div", { className: "flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-purple-500", children: [
3430
- /* @__PURE__ */ t($e, { size: 14, className: "mr-2 shrink-0" }),
3485
+ return /* @__PURE__ */ m(Ft, { className: "w-[350px]", children: [
3486
+ p && /* @__PURE__ */ t("div", { className: "flex max-h-[400px]", children: /* @__PURE__ */ t($t, { children: /* @__PURE__ */ t("div", { className: "prose p-2 px-4 prose-sm", children: /* @__PURE__ */ t(xt, { children: s }) }) }) }),
3487
+ c && /* @__PURE__ */ m("div", { className: "flex h-12 w-full items-center px-4 text-sm font-medium text-muted-foreground text-purple-500", children: [
3488
+ /* @__PURE__ */ t(Oe, { size: 14, className: "mr-2 shrink-0" }),
3431
3489
  "AI正在思考",
3432
- /* @__PURE__ */ t("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ t(pa, {}) })
3490
+ /* @__PURE__ */ t("div", { className: "ml-2 mt-1", children: /* @__PURE__ */ t(ga, {}) })
3433
3491
  ] }),
3434
- !m && /* @__PURE__ */ d(me, { children: [
3435
- /* @__PURE__ */ d("div", { className: "relative", children: [
3492
+ !c && /* @__PURE__ */ m(me, { children: [
3493
+ /* @__PURE__ */ m("div", { className: "relative", children: [
3436
3494
  /* @__PURE__ */ t(
3437
- Ht,
3495
+ _t,
3438
3496
  {
3439
3497
  value: a,
3440
3498
  onValueChange: n,
3441
3499
  autoFocus: !0,
3442
3500
  placeholder: p ? "告诉AI下一步该怎么做" : "要求AI编辑或生成……",
3443
- onFocus: () => Nr(o)
3501
+ onFocus: () => Sr(o)
3444
3502
  }
3445
3503
  ),
3446
3504
  /* @__PURE__ */ t(
@@ -3453,19 +3511,19 @@ function wa({ onOpenChange: r, options: e }) {
3453
3511
  return i(s, {
3454
3512
  body: { option: "zap", command: a }
3455
3513
  }).then(() => n(""));
3456
- const C = o.state.selection.content(), l = o.storage.markdown.serializer.serialize(
3457
- C.content
3514
+ const k = o.state.selection.content(), l = o.storage.markdown.serializer.serialize(
3515
+ k.content
3458
3516
  );
3459
3517
  i(l, {
3460
3518
  body: { option: "zap", command: a }
3461
3519
  }).then(() => n(""));
3462
3520
  },
3463
- children: /* @__PURE__ */ t(mn, { className: "h-4 w-4" })
3521
+ children: /* @__PURE__ */ t(pn, { className: "h-4 w-4" })
3464
3522
  }
3465
3523
  )
3466
3524
  ] }),
3467
3525
  p ? /* @__PURE__ */ t(
3468
- va,
3526
+ ka,
3469
3527
  {
3470
3528
  onDiscard: () => {
3471
3529
  o.chain().unsetHighlight().focus().run(), r(!1);
@@ -3473,15 +3531,15 @@ function wa({ onOpenChange: r, options: e }) {
3473
3531
  completion: s
3474
3532
  }
3475
3533
  ) : /* @__PURE__ */ t(
3476
- Ca,
3534
+ wa,
3477
3535
  {
3478
- onSelect: (C, l) => i(C, { body: { option: l } })
3536
+ onSelect: (k, l) => i(k, { body: { option: l } })
3479
3537
  }
3480
3538
  )
3481
3539
  ] })
3482
3540
  ] });
3483
3541
  }
3484
- const Na = ({
3542
+ const Ia = ({
3485
3543
  children: r,
3486
3544
  open: e,
3487
3545
  onOpenChange: o,
@@ -3490,9 +3548,9 @@ const Na = ({
3490
3548
  }) => {
3491
3549
  const { editor: s } = Q();
3492
3550
  return ie(() => {
3493
- e || Ir(s);
3494
- }, [e]), /* @__PURE__ */ d(
3495
- Sr,
3551
+ e || Tr(s);
3552
+ }, [e]), /* @__PURE__ */ m(
3553
+ Mr,
3496
3554
  {
3497
3555
  tippyOptions: {
3498
3556
  placement: e ? "bottom-start" : "top",
@@ -3503,15 +3561,15 @@ const Na = ({
3503
3561
  className: "flex w-fit max-w-[90vw] overflow-hidden rounded-lg border border-muted bg-background shadow-xl p-1 gap-1",
3504
3562
  children: [
3505
3563
  e && a && /* @__PURE__ */ t(
3506
- wa,
3564
+ Na,
3507
3565
  {
3508
3566
  open: e,
3509
3567
  onOpenChange: o,
3510
3568
  options: n
3511
3569
  }
3512
3570
  ),
3513
- !e && /* @__PURE__ */ d(Yt, { children: [
3514
- a && /* @__PURE__ */ d(
3571
+ !e && /* @__PURE__ */ m(Kt, { children: [
3572
+ a && /* @__PURE__ */ m(
3515
3573
  J,
3516
3574
  {
3517
3575
  className: "gap-1 text-purple-500",
@@ -3519,7 +3577,7 @@ const Na = ({
3519
3577
  onClick: () => o(!0),
3520
3578
  size: "sm",
3521
3579
  children: [
3522
- /* @__PURE__ */ t($e, { size: 14 }),
3580
+ /* @__PURE__ */ t(Oe, { size: 14 }),
3523
3581
  "询问AI"
3524
3582
  ]
3525
3583
  }
@@ -3529,7 +3587,7 @@ const Na = ({
3529
3587
  ]
3530
3588
  }
3531
3589
  );
3532
- }, Ia = (r) => {
3590
+ }, Sa = (r) => {
3533
3591
  const e = fetch("/api/upload", {
3534
3592
  method: "POST",
3535
3593
  headers: {
@@ -3555,10 +3613,10 @@ const Na = ({
3555
3613
  }
3556
3614
  );
3557
3615
  });
3558
- }, Sa = gt({
3559
- onUpload: Ia,
3616
+ }, Ta = yt({
3617
+ onUpload: Sa,
3560
3618
  validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (ke.error("File size too big (max 20MB)."), !1) : !0 : (ke.error("File type not supported."), !1)
3561
- }), Ta = () => {
3619
+ }), Ma = () => {
3562
3620
  const { editor: r } = Q();
3563
3621
  return r ? /* @__PURE__ */ t("div", { className: "flex", children: [
3564
3622
  {
@@ -3566,38 +3624,38 @@ const Na = ({
3566
3624
  // bold
3567
3625
  isActive: (o) => o.isActive("bold"),
3568
3626
  command: (o) => o.chain().focus().toggleBold().run(),
3569
- icon: un
3627
+ icon: gn
3570
3628
  },
3571
3629
  {
3572
3630
  name: "斜体",
3573
3631
  // italic
3574
3632
  isActive: (o) => o.isActive("italic"),
3575
3633
  command: (o) => o.chain().focus().toggleItalic().run(),
3576
- icon: pn
3634
+ icon: fn
3577
3635
  },
3578
3636
  {
3579
3637
  name: "下划线",
3580
3638
  // underline
3581
3639
  isActive: (o) => o.isActive("underline"),
3582
3640
  command: (o) => o.chain().focus().toggleUnderline().run(),
3583
- icon: gn
3641
+ icon: hn
3584
3642
  },
3585
3643
  {
3586
3644
  name: "删除线",
3587
3645
  // strike
3588
3646
  isActive: (o) => o.isActive("strike"),
3589
3647
  command: (o) => o.chain().focus().toggleStrike().run(),
3590
- icon: fn
3648
+ icon: bn
3591
3649
  },
3592
3650
  {
3593
3651
  name: "代码",
3594
3652
  // code
3595
3653
  isActive: (o) => o.isActive("code"),
3596
3654
  command: (o) => o.chain().focus().toggleCode().run(),
3597
- icon: hn
3655
+ icon: xn
3598
3656
  }
3599
3657
  ].map((o) => /* @__PURE__ */ t(
3600
- Le,
3658
+ Ae,
3601
3659
  {
3602
3660
  onSelect: (a) => {
3603
3661
  o.command(a);
@@ -3622,14 +3680,14 @@ const Na = ({
3622
3680
  },
3623
3681
  o.name
3624
3682
  )) }) : null;
3625
- }, Ot = ({ uploadFn: r }) => Mr([
3683
+ }, jt = ({ uploadFn: r }) => Ar([
3626
3684
  {
3627
3685
  title: "文本",
3628
3686
  // "Text",
3629
3687
  description: "从纯文本开始编写。",
3630
3688
  // "Just start typing with plain text.",
3631
3689
  searchTerms: ["p", "paragraph"],
3632
- icon: /* @__PURE__ */ t(rt, { size: 18 }),
3690
+ icon: /* @__PURE__ */ t(lt, { size: 18 }),
3633
3691
  command: ({ editor: e, range: o }) => {
3634
3692
  e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").run();
3635
3693
  }
@@ -3640,7 +3698,7 @@ const Na = ({
3640
3698
  description: "大标题。",
3641
3699
  // "Big section heading.",
3642
3700
  searchTerms: ["title", "big", "large"],
3643
- icon: /* @__PURE__ */ t(nt, { size: 18 }),
3701
+ icon: /* @__PURE__ */ t(ct, { size: 18 }),
3644
3702
  command: ({ editor: e, range: o }) => {
3645
3703
  e.chain().focus().deleteRange(o).setNode("heading", { level: 1 }).run();
3646
3704
  }
@@ -3651,7 +3709,7 @@ const Na = ({
3651
3709
  description: "中标题。",
3652
3710
  // "Medium section heading.",
3653
3711
  searchTerms: ["subtitle", "medium"],
3654
- icon: /* @__PURE__ */ t(at, { size: 18 }),
3712
+ icon: /* @__PURE__ */ t(dt, { size: 18 }),
3655
3713
  command: ({ editor: e, range: o }) => {
3656
3714
  e.chain().focus().deleteRange(o).setNode("heading", { level: 2 }).run();
3657
3715
  }
@@ -3662,7 +3720,7 @@ const Na = ({
3662
3720
  description: "小标题。",
3663
3721
  // "Small section heading.",
3664
3722
  searchTerms: ["subtitle", "small"],
3665
- icon: /* @__PURE__ */ t(st, { size: 18 }),
3723
+ icon: /* @__PURE__ */ t(mt, { size: 18 }),
3666
3724
  command: ({ editor: e, range: o }) => {
3667
3725
  e.chain().focus().deleteRange(o).setNode("heading", { level: 3 }).run();
3668
3726
  }
@@ -3673,7 +3731,7 @@ const Na = ({
3673
3731
  description: "使用待办清单追踪任务。",
3674
3732
  // "Track tasks with a to-do list.",
3675
3733
  searchTerms: ["todo", "task", "list", "check", "checkbox"],
3676
- icon: /* @__PURE__ */ t(it, { size: 18 }),
3734
+ icon: /* @__PURE__ */ t(ut, { size: 18 }),
3677
3735
  command: ({ editor: e, range: o }) => {
3678
3736
  e.chain().focus().deleteRange(o).toggleTaskList().run();
3679
3737
  }
@@ -3684,7 +3742,7 @@ const Na = ({
3684
3742
  description: "创建一个简单的项目符号列表。",
3685
3743
  // "Create a simple bullet list.",
3686
3744
  searchTerms: ["unordered", "point"],
3687
- icon: /* @__PURE__ */ t(lt, { size: 18 }),
3745
+ icon: /* @__PURE__ */ t(pt, { size: 18 }),
3688
3746
  command: ({ editor: e, range: o }) => {
3689
3747
  e.chain().focus().deleteRange(o).toggleBulletList().run();
3690
3748
  }
@@ -3695,7 +3753,7 @@ const Na = ({
3695
3753
  description: "创建一个带有序号的列表。",
3696
3754
  // "Create a list with numbering.",
3697
3755
  searchTerms: ["ordered"],
3698
- icon: /* @__PURE__ */ t(ct, { size: 18 }),
3756
+ icon: /* @__PURE__ */ t(gt, { size: 18 }),
3699
3757
  command: ({ editor: e, range: o }) => {
3700
3758
  e.chain().focus().deleteRange(o).toggleOrderedList().run();
3701
3759
  }
@@ -3706,7 +3764,7 @@ const Na = ({
3706
3764
  description: "摘取引用。",
3707
3765
  // "Capture a quote.",
3708
3766
  searchTerms: ["blockquote"],
3709
- icon: /* @__PURE__ */ t(dt, { size: 18 }),
3767
+ icon: /* @__PURE__ */ t(ft, { size: 18 }),
3710
3768
  command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleNode("paragraph", "paragraph").toggleBlockquote().run()
3711
3769
  },
3712
3770
  {
@@ -3715,7 +3773,7 @@ const Na = ({
3715
3773
  description: "捕获代码段。",
3716
3774
  // "Capture a code snippet.",
3717
3775
  searchTerms: ["codeblock"],
3718
- icon: /* @__PURE__ */ t(mt, { size: 18 }),
3776
+ icon: /* @__PURE__ */ t(ht, { size: 18 }),
3719
3777
  command: ({ editor: e, range: o }) => e.chain().focus().deleteRange(o).toggleCodeBlock().run()
3720
3778
  },
3721
3779
  {
@@ -3724,7 +3782,7 @@ const Na = ({
3724
3782
  description: "从您的计算机上传图像。",
3725
3783
  // "Upload an image from your computer.",
3726
3784
  searchTerms: ["photo", "picture", "media"],
3727
- icon: /* @__PURE__ */ t(fo, { size: 18 }),
3785
+ icon: /* @__PURE__ */ t(bo, { size: 18 }),
3728
3786
  command: ({ editor: e, range: o }) => {
3729
3787
  e.chain().focus().deleteRange(o).run();
3730
3788
  const a = document.createElement("input");
@@ -3737,17 +3795,17 @@ const Na = ({
3737
3795
  }, a.click();
3738
3796
  }
3739
3797
  }
3740
- ]), Ma = (r) => Tr.configure({
3798
+ ]), La = (r) => Lr.configure({
3741
3799
  suggestion: {
3742
- items: () => Ot(r),
3743
- render: Lr
3800
+ items: () => jt(r),
3801
+ render: Dr
3744
3802
  }
3745
- }), La = {
3803
+ }), Aa = {
3746
3804
  type: "doc",
3747
3805
  content: []
3748
- }, Ft = Vt(({ children: r, items: e, ...o }, a) => {
3749
- const n = (i) => /* @__PURE__ */ d(
3750
- Te.Item,
3806
+ }, Xt = Jt(({ children: r, items: e, ...o }, a) => {
3807
+ const n = (i) => /* @__PURE__ */ m(
3808
+ Me.Item,
3751
3809
  {
3752
3810
  onClick: i.onClick,
3753
3811
  className: y(
@@ -3763,14 +3821,14 @@ const Na = ({
3763
3821
  },
3764
3822
  i.key
3765
3823
  ), s = (i) => {
3766
- var m;
3824
+ var c;
3767
3825
  return /* @__PURE__ */ t(
3768
- Te.SubMenu,
3826
+ Me.SubMenu,
3769
3827
  {
3770
- expandIcon: /* @__PURE__ */ t(ho, { size: 16 }),
3828
+ expandIcon: /* @__PURE__ */ t(xo, { size: 16 }),
3771
3829
  popupClassName: y(
3772
3830
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
3773
- f`
3831
+ g`
3774
3832
  .rc-menu {
3775
3833
  border: none !important;
3776
3834
  box-shadow: none !important;
@@ -3780,7 +3838,7 @@ const Na = ({
3780
3838
  popupOffset: [4, 0],
3781
3839
  className: y(
3782
3840
  "gap-2 !p-0 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
3783
- f`
3841
+ g`
3784
3842
  .rc-menu-submenu-title {
3785
3843
  display: flex;
3786
3844
  align-items: center;
@@ -3794,27 +3852,27 @@ const Na = ({
3794
3852
  }
3795
3853
  `
3796
3854
  ),
3797
- title: /* @__PURE__ */ d(me, { children: [
3855
+ title: /* @__PURE__ */ m(me, { children: [
3798
3856
  i.icon,
3799
3857
  i.label,
3800
3858
  /* @__PURE__ */ t("div", { className: "flex-1" })
3801
3859
  ] }),
3802
- children: (m = i.children) == null ? void 0 : m.map(n)
3860
+ children: (c = i.children) == null ? void 0 : c.map(n)
3803
3861
  },
3804
3862
  i.key
3805
3863
  );
3806
3864
  };
3807
3865
  return /* @__PURE__ */ t(
3808
- yn,
3866
+ kn,
3809
3867
  {
3810
3868
  ref: a,
3811
3869
  trigger: "click",
3812
3870
  overlay: /* @__PURE__ */ t(
3813
- Te,
3871
+ Me,
3814
3872
  {
3815
3873
  className: y(
3816
3874
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
3817
- f`
3875
+ g`
3818
3876
  .rc-menu-submenu-active {
3819
3877
  .rc-menu-submenu-title {
3820
3878
  background-color: hsl(var(--accent)) !important;
@@ -3823,7 +3881,7 @@ const Na = ({
3823
3881
  `
3824
3882
  ),
3825
3883
  ...o,
3826
- children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(Te.Divider, { className: "!my-1" }, i.key) : i.type === "submenu" ? s(i) : n(i))
3884
+ children: e.map((i) => i.type === "divider" ? /* @__PURE__ */ t(Me.Divider, { className: "!my-1" }, i.key) : i.type === "submenu" ? s(i) : n(i))
3827
3885
  }
3828
3886
  ),
3829
3887
  ...o,
@@ -3831,46 +3889,46 @@ const Na = ({
3831
3889
  }
3832
3890
  );
3833
3891
  });
3834
- Ft.displayName = "DropdownMenu";
3835
- const Aa = ({ children: r, ...e }) => {
3892
+ Xt.displayName = "DropdownMenu";
3893
+ const Da = ({ children: r, ...e }) => {
3836
3894
  const { editor: o } = Q(), a = () => {
3837
3895
  o && o.state.selection instanceof K && (o.commands.deleteSelection(), o.commands.focus());
3838
3896
  }, n = () => {
3839
3897
  if (o && o.state.selection instanceof K) {
3840
- const m = o.state.selection.node, p = o.state.selection.to;
3898
+ const c = o.state.selection.node, p = o.state.selection.to;
3841
3899
  o.chain().insertContentAt(p, {
3842
- type: m.type.name,
3843
- attrs: { ...m.attrs },
3844
- content: m.content.toJSON()
3900
+ type: c.type.name,
3901
+ attrs: { ...c.attrs },
3902
+ content: c.content.toJSON()
3845
3903
  }).focus().run();
3846
3904
  }
3847
- }, s = Be.map((m) => ({
3848
- key: `transform-${m.name}`,
3849
- icon: /* @__PURE__ */ t(m.icon, { size: 16 }),
3850
- label: m.name,
3905
+ }, s = Ee.map((c) => ({
3906
+ key: `transform-${c.name}`,
3907
+ icon: /* @__PURE__ */ t(c.icon, { size: 16 }),
3908
+ label: c.name,
3851
3909
  onClick: () => {
3852
- o && o.state.selection instanceof K && m.command(o);
3910
+ o && o.state.selection instanceof K && c.command(o);
3853
3911
  },
3854
- isActive: m.isActive(o)
3912
+ isActive: c.isActive(o)
3855
3913
  }));
3856
- return /* @__PURE__ */ t(Ft, { items: [
3914
+ return /* @__PURE__ */ t(Xt, { items: [
3857
3915
  {
3858
3916
  key: "transform",
3859
3917
  type: "submenu",
3860
- icon: /* @__PURE__ */ t(bo, { size: 16 }),
3918
+ icon: /* @__PURE__ */ t(yo, { size: 16 }),
3861
3919
  label: "转换成",
3862
3920
  children: s
3863
3921
  },
3864
3922
  {
3865
3923
  key: "duplicate",
3866
- icon: /* @__PURE__ */ t(xo, { size: 16 }),
3924
+ icon: /* @__PURE__ */ t(vo, { size: 16 }),
3867
3925
  label: "创建副本",
3868
3926
  onClick: n
3869
3927
  },
3870
3928
  { key: "divider", type: "divider" },
3871
3929
  {
3872
3930
  key: "delete",
3873
- icon: /* @__PURE__ */ t(ot, { size: 16 }),
3931
+ icon: /* @__PURE__ */ t(it, { size: 16 }),
3874
3932
  label: "删除",
3875
3933
  className: "text-red-500",
3876
3934
  onClick: a
@@ -3887,12 +3945,12 @@ const Aa = ({ children: r, ...e }) => {
3887
3945
  content: [{ type: "text", text: "/" }]
3888
3946
  }).run());
3889
3947
  };
3890
- return /* @__PURE__ */ d(
3948
+ return /* @__PURE__ */ m(
3891
3949
  "div",
3892
3950
  {
3893
3951
  className: y(
3894
3952
  "custom-drag-handle",
3895
- f`
3953
+ g`
3896
3954
  width: auto;
3897
3955
  background: none;
3898
3956
  display: flex;
@@ -3904,7 +3962,7 @@ const Aa = ({ children: r, ...e }) => {
3904
3962
  de,
3905
3963
  {
3906
3964
  placement: "bottom",
3907
- overlay: /* @__PURE__ */ d("div", { children: [
3965
+ overlay: /* @__PURE__ */ m("div", { children: [
3908
3966
  "点击",
3909
3967
  /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以在下方添加快" })
3910
3968
  ] }),
@@ -3915,26 +3973,26 @@ const Aa = ({ children: r, ...e }) => {
3915
3973
  variant: "ghost",
3916
3974
  className: "w-auto h-auto p-0.5",
3917
3975
  onClick: e,
3918
- children: /* @__PURE__ */ t(yo, { className: "cursor-pointer", size: 22 })
3976
+ children: /* @__PURE__ */ t(ko, { className: "cursor-pointer", size: 22 })
3919
3977
  }
3920
3978
  )
3921
3979
  }
3922
3980
  ),
3923
- /* @__PURE__ */ t(Aa, { children: /* @__PURE__ */ t(
3981
+ /* @__PURE__ */ t(Da, { children: /* @__PURE__ */ t(
3924
3982
  de,
3925
3983
  {
3926
3984
  placement: "bottom",
3927
- overlay: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ d("div", { children: [
3985
+ overlay: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ m("div", { children: [
3928
3986
  "拖动",
3929
3987
  /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以移动" })
3930
3988
  ] }) }),
3931
- children: /* @__PURE__ */ t(J, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(vo, { size: 22 }) })
3989
+ children: /* @__PURE__ */ t(J, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(Co, { size: 22 }) })
3932
3990
  }
3933
3991
  ) })
3934
3992
  ]
3935
3993
  }
3936
3994
  );
3937
- }, Da = (r) => {
3995
+ }, Pa = (r) => {
3938
3996
  const {
3939
3997
  className: e,
3940
3998
  initialContent: o = {},
@@ -3942,47 +4000,47 @@ const Aa = ({ children: r, ...e }) => {
3942
4000
  cacheKey: n = "novel-content",
3943
4001
  enableCache: s = !1,
3944
4002
  showSaveStatus: i = !0,
3945
- showWordCount: m = !0,
4003
+ showWordCount: c = !0,
3946
4004
  uploadImageProps: p,
3947
- editorRef: C,
4005
+ editorRef: k,
3948
4006
  enableAI: l = !1,
3949
- aiOptions: c
4007
+ aiOptions: d
3950
4008
  } = r, [b, x] = H(
3951
4009
  o
3952
- ), [A, h] = H("Saved"), [g, N] = H(), [v, I] = H(!1), [u, T] = H(!1), [D, w] = H(!1), [k, U] = H(!1), Z = (S) => {
4010
+ ), [A, f] = H("Saved"), [h, w] = H(), [v, I] = H(!1), [u, T] = H(!1), [R, N] = H(!1), [C, X] = H(!1), Z = (S) => {
3953
4011
  const O = new DOMParser().parseFromString(S, "text/html");
3954
4012
  return O.querySelectorAll("pre code").forEach((B) => {
3955
- xn.highlightElement(B);
4013
+ vn.highlightElement(B);
3956
4014
  }), new XMLSerializer().serializeToString(O);
3957
- }, _ = Fr(
4015
+ }, _ = jr(
3958
4016
  async (S) => {
3959
4017
  const O = S.getJSON();
3960
- N(S.storage.characterCount.words()), a == null || a(O), s && (window.localStorage.setItem(
4018
+ w(S.storage.characterCount.words()), a == null || a(O), s && (window.localStorage.setItem(
3961
4019
  "html-content",
3962
4020
  Z(S.getHTML())
3963
4021
  ), window.localStorage.setItem(n, JSON.stringify(O)), window.localStorage.setItem(
3964
4022
  "markdown",
3965
4023
  S.storage.markdown.getMarkdown()
3966
- ), h("Saved"));
4024
+ ), f("Saved"));
3967
4025
  },
3968
4026
  500
3969
4027
  ), ae = fe(() => {
3970
- if (!p) return Sa;
4028
+ if (!p) return Ta;
3971
4029
  const {
3972
4030
  beforeUpload: S,
3973
4031
  maxSize: O,
3974
4032
  action: B,
3975
4033
  headers: W,
3976
4034
  method: re,
3977
- name: Re,
3978
- onSuccess: we,
3979
- onError: Ne
4035
+ name: Pe,
4036
+ onSuccess: Ne,
4037
+ onError: Ie
3980
4038
  } = p;
3981
- return gt({
4039
+ return yt({
3982
4040
  onUpload: (se) => {
3983
4041
  const M = new FormData();
3984
- M.append(Re || "file", se);
3985
- const X = fetch(B, {
4042
+ M.append(Pe || "file", se);
4043
+ const U = fetch(B, {
3986
4044
  method: re || "POST",
3987
4045
  headers: {
3988
4046
  ...W
@@ -3990,10 +4048,10 @@ const Aa = ({ children: r, ...e }) => {
3990
4048
  body: M
3991
4049
  });
3992
4050
  return new Promise((F, E) => {
3993
- X.then(async (P) => {
3994
- if (we) {
4051
+ U.then(async (P) => {
4052
+ if (Ne) {
3995
4053
  const z = await P.json();
3996
- F(we(z));
4054
+ F(Ne(z));
3997
4055
  return;
3998
4056
  }
3999
4057
  if (P.status === 200) {
@@ -4005,7 +4063,7 @@ const Aa = ({ children: r, ...e }) => {
4005
4063
  "`BLOB_READ_WRITE_TOKEN` environment variable not found, reading image locally instead."
4006
4064
  )) : new Error("Error uploading image. Please try again.");
4007
4065
  }).catch((P) => {
4008
- Ne && Ne(P), E(P);
4066
+ Ie && Ie(P), E(P);
4009
4067
  });
4010
4068
  });
4011
4069
  },
@@ -4015,65 +4073,65 @@ const Aa = ({ children: r, ...e }) => {
4015
4073
  if (ie(() => {
4016
4074
  if (!s) return;
4017
4075
  const S = window.localStorage.getItem(n);
4018
- x(S ? JSON.parse(S) : La);
4076
+ x(S ? JSON.parse(S) : Aa);
4019
4077
  }, [n, s]), !b) return null;
4020
4078
  const oe = [
4021
- ...Dt,
4022
- Ma({
4079
+ ...zt,
4080
+ La({
4023
4081
  uploadFn: ae
4024
4082
  })
4025
4083
  ];
4026
- return /* @__PURE__ */ d("div", { className: y("relative w-full max-w-screen-lg", e), children: [
4027
- (s && i || m) && /* @__PURE__ */ d("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
4084
+ return /* @__PURE__ */ m("div", { className: y("relative w-full max-w-screen-lg", e), children: [
4085
+ (s && i || c) && /* @__PURE__ */ m("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
4028
4086
  s && i && /* @__PURE__ */ t("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children: A }),
4029
- m && /* @__PURE__ */ d(
4087
+ c && /* @__PURE__ */ m(
4030
4088
  "div",
4031
4089
  {
4032
- className: g ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
4090
+ className: h ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
4033
4091
  children: [
4034
- g,
4092
+ h,
4035
4093
  " Words"
4036
4094
  ]
4037
4095
  }
4038
4096
  )
4039
4097
  ] }),
4040
- /* @__PURE__ */ t(Ar, { children: /* @__PURE__ */ d(
4041
- Rr,
4098
+ /* @__PURE__ */ t(Rr, { children: /* @__PURE__ */ m(
4099
+ Pr,
4042
4100
  {
4043
4101
  onCreate: ({ editor: S }) => {
4044
- C && (C.current = S);
4102
+ k && (k.current = S);
4045
4103
  },
4046
4104
  initialContent: b,
4047
4105
  extensions: oe,
4048
4106
  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",
4049
4107
  editorProps: {
4050
4108
  handleDOMEvents: {
4051
- keydown: (S, O) => Br(O)
4109
+ keydown: (S, O) => Er(O)
4052
4110
  },
4053
- handlePaste: (S, O) => Pr(S, O, ae),
4054
- handleDrop: (S, O, B, W) => Dr(S, O, W, ae),
4111
+ handlePaste: (S, O) => zr(S, O, ae),
4112
+ handleDrop: (S, O, B, W) => Br(S, O, W, ae),
4055
4113
  attributes: {
4056
4114
  class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
4057
4115
  }
4058
4116
  },
4059
4117
  onUpdate: ({ editor: S }) => {
4060
- _(S), h("Unsaved");
4118
+ _(S), f("Unsaved");
4061
4119
  },
4062
- slotAfter: /* @__PURE__ */ t(Or, {}),
4120
+ slotAfter: /* @__PURE__ */ t(_r, {}),
4063
4121
  children: [
4064
- /* @__PURE__ */ d(zr, { 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: [
4065
- /* @__PURE__ */ t(Er, { className: "px-2 text-muted-foreground", children: "没有结果" }),
4066
- /* @__PURE__ */ t($r, { children: Ot({
4122
+ /* @__PURE__ */ m($r, { 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: [
4123
+ /* @__PURE__ */ t(Hr, { className: "px-2 text-muted-foreground", children: "没有结果" }),
4124
+ /* @__PURE__ */ t(Or, { children: jt({
4067
4125
  uploadFn: ae
4068
- }).map((S) => /* @__PURE__ */ d(
4069
- Hr,
4126
+ }).map((S) => /* @__PURE__ */ m(
4127
+ Fr,
4070
4128
  {
4071
4129
  value: S.title,
4072
4130
  onCommand: (O) => S.command(O),
4073
4131
  className: "flex w-full items-center space-x-2 rounded-md px-2 py-1 text-left text-sm hover:bg-accent aria-selected:bg-accent",
4074
4132
  children: [
4075
4133
  /* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: S.icon }),
4076
- /* @__PURE__ */ d("div", { children: [
4134
+ /* @__PURE__ */ m("div", { children: [
4077
4135
  /* @__PURE__ */ t("p", { className: "font-medium", children: S.title }),
4078
4136
  /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: S.description })
4079
4137
  ] })
@@ -4082,24 +4140,24 @@ const Aa = ({ children: r, ...e }) => {
4082
4140
  S.title
4083
4141
  )) })
4084
4142
  ] }),
4085
- /* @__PURE__ */ d(
4086
- Na,
4143
+ /* @__PURE__ */ m(
4144
+ Ia,
4087
4145
  {
4088
- open: k,
4089
- onOpenChange: U,
4146
+ open: C,
4147
+ onOpenChange: X,
4090
4148
  enableAI: l,
4091
- aiOptions: c,
4149
+ aiOptions: d,
4092
4150
  children: [
4093
4151
  l && /* @__PURE__ */ t(pe, { orientation: "vertical" }),
4094
- /* @__PURE__ */ t(ua, { open: v, onOpenChange: I }),
4152
+ /* @__PURE__ */ t(pa, { open: v, onOpenChange: I }),
4095
4153
  /* @__PURE__ */ t(pe, { orientation: "vertical" }),
4096
- /* @__PURE__ */ t(da, { open: D, onOpenChange: w }),
4154
+ /* @__PURE__ */ t(ma, { open: R, onOpenChange: N }),
4097
4155
  /* @__PURE__ */ t(pe, { orientation: "vertical" }),
4098
- /* @__PURE__ */ t(ma, {}),
4156
+ /* @__PURE__ */ t(ua, {}),
4099
4157
  /* @__PURE__ */ t(pe, { orientation: "vertical" }),
4100
- /* @__PURE__ */ t(Ta, {}),
4158
+ /* @__PURE__ */ t(Ma, {}),
4101
4159
  /* @__PURE__ */ t(pe, { orientation: "vertical" }),
4102
- /* @__PURE__ */ t(ia, { open: u, onOpenChange: T })
4160
+ /* @__PURE__ */ t(la, { open: u, onOpenChange: T })
4103
4161
  ]
4104
4162
  }
4105
4163
  ),
@@ -4108,42 +4166,52 @@ const Aa = ({ children: r, ...e }) => {
4108
4166
  }
4109
4167
  ) })
4110
4168
  ] });
4111
- }, Pa = ({ json: r }) => {
4112
- const e = fe(() => vn(r ?? {}, Dt), [r]);
4169
+ }, Ba = ({ json: r }) => {
4170
+ const e = fe(() => Cn(r ?? {}, zt), [r]);
4113
4171
  return /* @__PURE__ */ t("div", { className: "tiptap ProseMirror prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full", children: /* @__PURE__ */ t("div", { dangerouslySetInnerHTML: { __html: e } }) });
4114
- }, _t = Da;
4115
- _t.Preview = Pa;
4116
- const Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4172
+ }, Ut = Pa;
4173
+ Ut.Preview = Ba;
4174
+ const Is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4117
4175
  __proto__: null,
4118
- Desktop: Rn,
4119
- DesktopSortable: wt,
4120
- DesktopSortableConfigProvider: xt,
4121
- DesktopSortableStateProvider: kt,
4122
- Dock: Ue,
4123
- Editor: _t,
4124
- Markdown: Tt,
4125
- MdEditor: Mt,
4176
+ Desktop: Pn,
4177
+ DesktopSortable: Mt,
4178
+ DesktopSortableConfigProvider: wt,
4179
+ DesktopSortableStateProvider: St,
4180
+ Dock: we,
4181
+ DockDesktop: qe,
4182
+ DockDesktopItem: Ge,
4183
+ DockMobile: Ye,
4184
+ DockMobileItem: De,
4185
+ Editor: Ut,
4186
+ Markdown: Rt,
4187
+ MdEditor: Pt,
4126
4188
  SortableUtils: Y,
4127
- desktopAppConfig: Fe,
4128
- desktopConfigMap: _e,
4129
- desktopGroupConfig: yt,
4130
- desktopThemeDark: Oe,
4131
- desktopThemeLight: He
4189
+ desktopAppConfig: je,
4190
+ desktopConfigMap: Xe,
4191
+ desktopGroupConfig: Nt,
4192
+ desktopThemeDark: _e,
4193
+ desktopThemeLight: Fe,
4194
+ useDockDesktopMouseX: nt
4132
4195
  }, Symbol.toStringTag, { value: "Module" }));
4133
4196
  export {
4134
- Rn as Desktop,
4135
- wt as DesktopSortable,
4136
- xt as DesktopSortableConfigProvider,
4137
- kt as DesktopSortableStateProvider,
4138
- Ue as Dock,
4139
- _t as Editor,
4140
- Tt as Markdown,
4141
- Mt as MdEditor,
4197
+ Pn as Desktop,
4198
+ Mt as DesktopSortable,
4199
+ wt as DesktopSortableConfigProvider,
4200
+ St as DesktopSortableStateProvider,
4201
+ we as Dock,
4202
+ qe as DockDesktop,
4203
+ Ge as DockDesktopItem,
4204
+ Ye as DockMobile,
4205
+ De as DockMobileItem,
4206
+ Ut as Editor,
4207
+ Rt as Markdown,
4208
+ Pt as MdEditor,
4142
4209
  Y as SortableUtils,
4143
- Ns as default,
4144
- Fe as desktopAppConfig,
4145
- _e as desktopConfigMap,
4146
- yt as desktopGroupConfig,
4147
- Oe as desktopThemeDark,
4148
- He as desktopThemeLight
4210
+ Is as default,
4211
+ je as desktopAppConfig,
4212
+ Xe as desktopConfigMap,
4213
+ Nt as desktopGroupConfig,
4214
+ _e as desktopThemeDark,
4215
+ Fe as desktopThemeLight,
4216
+ Ms as useDockDesktopMouseX
4149
4217
  };