zs_library 0.4.23 → 0.4.25

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
@@ -6,8 +6,8 @@ import Zt from "i18next";
6
6
  import { initReactI18next as Qt } from "react-i18next";
7
7
  import { jsx as t, jsxs as m, Fragment as ue } from "react/jsx-runtime";
8
8
  import * as q from "react";
9
- import eo, { createContext as st, useMemo as be, useContext as it, useState as j, useRef as xe, useCallback as to, useEffect as ae, forwardRef as lt, Fragment as oo } from "react";
10
- import { cx as k, css as b } from "@emotion/css";
9
+ import eo, { createContext as st, useMemo as be, useContext as it, useState as O, useRef as xe, useCallback as to, useEffect as se, forwardRef as lt, Fragment as oo } from "react";
10
+ import { cx as C, css as h } from "@emotion/css";
11
11
  import ro from "react-slick";
12
12
  import { ReactSortable as Xe } from "react-sortablejs";
13
13
  import { AnimatePresence as Ue, motion as R, useMotionValue as ct, useTransform as ge, useSpring as Ae } from "framer-motion";
@@ -28,13 +28,13 @@ import { oneLight as lr } from "react-syntax-highlighter/dist/esm/styles/prism";
28
28
  import cr from "rc-image";
29
29
  import { clsx as dr } from "clsx";
30
30
  import { twMerge as mr } from "tailwind-merge";
31
- import { Placeholder as ur, TiptapLink as pr, TiptapImage as gr, UploadImagesPlugin as fr, UpdatedImage as hr, TaskList as br, TaskItem as xr, HorizontalRule as yr, StarterKit as vr, CodeBlockLowlight as kr, Mathematics as Cr, CharacterCount as wr, AIHighlight as Nr, TiptapUnderline as Ir, HighlightExtension as Sr, TextStyle as Tr, Color as Mr, CustomKeymap as Lr, useEditor as Q, EditorBubbleItem as Pe, getPrevText as Ar, addAIHighlight as Dr, removeAIHighlight as Rr, EditorBubble as Pr, createImageUpload as Nt, Command as Br, createSuggestionItems as zr, renderItems as Er, EditorRoot as $r, EditorContent as Hr, handleImageDrop as Or, handleImagePaste as Fr, handleCommandNavigation as _r, EditorCommand as jr, EditorCommandEmpty as Xr, EditorCommandList as Ur, EditorCommandItem as Gr, ImageResizer as qr } from "novel";
31
+ import { Placeholder as ur, TiptapLink as pr, TiptapImage as gr, UploadImagesPlugin as fr, UpdatedImage as hr, TaskList as br, TaskItem as xr, HorizontalRule as yr, StarterKit as vr, CodeBlockLowlight as kr, Mathematics as Cr, CharacterCount as wr, AIHighlight as Nr, TiptapUnderline as Ir, HighlightExtension as Sr, TextStyle as Tr, Color as Mr, CustomKeymap as Lr, useEditor as te, EditorBubbleItem as Pe, getPrevText as Ar, addAIHighlight as Dr, removeAIHighlight as Rr, EditorBubble as Pr, createImageUpload as Nt, Command as Br, createSuggestionItems as zr, renderItems as Er, EditorRoot as $r, EditorContent as Hr, handleImageDrop as Or, handleImagePaste as Fr, handleCommandNavigation as _r, EditorCommand as jr, EditorCommandEmpty as Xr, EditorCommandList as Ur, EditorCommandItem as Gr, ImageResizer as qr } from "novel";
32
32
  import { useDebouncedCallback as Yr } from "use-debounce";
33
33
  import { Markdown as Vr } from "tiptap-markdown";
34
- import { cx as Y, cva as Wr } from "class-variance-authority";
34
+ import { cx as W, cva as Wr } from "class-variance-authority";
35
35
  import { createLowlight as Kr, common as Jr } from "lowlight";
36
36
  import { Extension as Zr } from "@tiptap/core";
37
- import { Plugin as Qr, PluginKey as en, NodeSelection as J, TextSelection as tn } from "prosemirror-state";
37
+ import { Plugin as Qr, PluginKey as en, NodeSelection as Q, TextSelection as tn } from "prosemirror-state";
38
38
  import { Slice as on, Fragment as rn } from "prosemirror-model";
39
39
  import * as nn from "prosemirror-view";
40
40
  import * as Ce from "@radix-ui/react-popover";
@@ -45,8 +45,8 @@ import * as St from "@radix-ui/react-separator";
45
45
  import { useCompletion as Nn } from "@ai-sdk/react";
46
46
  import { toast as we } from "sonner";
47
47
  import * as de from "@radix-ui/react-scroll-area";
48
- import { Command as W } from "cmdk";
49
- import * as oe from "@radix-ui/react-dialog";
48
+ import { Command as J } from "cmdk";
49
+ import * as ne from "@radix-ui/react-dialog";
50
50
  import In from "highlight.js";
51
51
  import Sn from "rc-dropdown";
52
52
  import De from "rc-menu";
@@ -170,13 +170,13 @@ const qe = {
170
170
  app: Ve,
171
171
  group: Lt
172
172
  };
173
- class V {
173
+ class K {
174
174
  }
175
175
  /** 清理重复id */
176
- Le(V, "uniqueArray", (e) => e.reduce((o, n) => o.find((s) => s.id === n.id) ? o : o.concat([n]), [])), Le(V, "getTheme", (e) => {
176
+ Le(K, "uniqueArray", (e) => e.reduce((o, n) => o.find((s) => s.id === n.id) ? o : o.concat([n]), [])), Le(K, "getTheme", (e) => {
177
177
  const o = qe.token, n = Ye.token, a = { ...o, ...e == null ? void 0 : e.token }, s = { ...n, ...e == null ? void 0 : e.token };
178
178
  return { light: a, dark: s };
179
- }), Le(V, "quickJSONCheck", (e) => {
179
+ }), Le(K, "quickJSONCheck", (e) => {
180
180
  if (typeof e != "string" || e.trim() === "") return !1;
181
181
  if (!/^\s*(\{.*\}|\[.*\])\s*$/.test(e))
182
182
  return /^\s*(".*?"|[\d.]+|true|false|null)\s*$/.test(e);
@@ -234,163 +234,163 @@ const At = st({
234
234
  onChange: n,
235
235
  storageKey: a = "ZS_LIBRARY_DESKTOP_SORTABLE_CONFIG",
236
236
  enableCaching: s = !0
237
- } = r, [i, d] = j(), [p, x] = j(), [l, c] = j(null), f = xe(l), [v, D] = j(null), [h, g] = j([]), [S, y] = j(
237
+ } = r, [i, d] = O(), [p, y] = O(), [l, c] = O(null), g = xe(l), [k, D] = O(null), [b, f] = O([]), [I, v] = O(
238
238
  null
239
- ), [N, u] = j(
239
+ ), [N, u] = O(
240
240
  null
241
- ), [T, A] = j(!1), [I, C] = j(null), [H, G] = j(
241
+ ), [S, U] = O(!1), [j, x] = O(null), [L, E] = O(
242
242
  null
243
- ), [O, se] = j(!1), [re, L] = no(a, {
243
+ ), [A, V] = O(!1), [Y, M] = no(a, {
244
244
  defaultValue: [],
245
245
  listenStorageChange: !0
246
246
  }), X = () => {
247
- D(null), clearTimeout(i), d(void 0), f.current = null;
248
- }, E = (w, B) => {
247
+ D(null), clearTimeout(i), d(void 0), g.current = null;
248
+ }, $ = (w, B) => {
249
249
  D({ ...w, pageX: w.pageX, pageY: w.pageY, data: B }), clearTimeout(i);
250
- }, K = (w, B = !0) => {
250
+ }, Z = (w, B = !0) => {
251
251
  const { config: z = {} } = w;
252
252
  return z.allowContextMenu === !1 ? {} : {
253
- onMouseDown: (M) => {
253
+ onMouseDown: (T) => {
254
254
  d(
255
255
  setTimeout(() => {
256
- B && f.current === null && E(M, w);
256
+ B && g.current === null && $(T, w);
257
257
  }, 800)
258
- ), A(!1), x(
258
+ ), U(!1), y(
259
259
  setTimeout(() => {
260
- A(!0);
260
+ U(!0);
261
261
  }, 800)
262
262
  );
263
263
  },
264
264
  onMouseUp: () => {
265
- clearTimeout(p), x(void 0), clearTimeout(i), d(void 0);
265
+ clearTimeout(p), y(void 0), clearTimeout(i), d(void 0);
266
266
  },
267
- onContextMenu: (M) => {
268
- B && (M.preventDefault(), E(M, w));
267
+ onContextMenu: (T) => {
268
+ B && (T.preventDefault(), $(T, w));
269
269
  }
270
270
  };
271
- }, ee = to(
271
+ }, oe = to(
272
272
  (w, B) => {
273
273
  const z = [...B || []];
274
274
  if (z.length > 0)
275
- g((M) => {
276
- const $ = [...M], F = (P) => {
275
+ f((T) => {
276
+ const H = [...T], F = (P) => {
277
277
  var et, tt;
278
- const _ = z.shift(), U = P.find((ne) => ne.id === _), te = P.findIndex((ne) => ne.id === _);
279
- if (z.length && U) {
280
- if (((et = U.children) == null ? void 0 : et.filter(
281
- (ne) => !w.some((Wt) => Wt.id === ne.id)
278
+ const _ = z.shift(), G = P.find((ae) => ae.id === _), re = P.findIndex((ae) => ae.id === _);
279
+ if (z.length && G) {
280
+ if (((et = G.children) == null ? void 0 : et.filter(
281
+ (ae) => !w.some((Wt) => Wt.id === ae.id)
282
282
  ).length) === 1 && w.length === 1) {
283
- const ne = { ...w[0] };
284
- return P.splice(te, 1, ne), n == null || n(P), P;
283
+ const ae = { ...w[0] };
284
+ return P.splice(re, 1, ae), n == null || n(P), P;
285
285
  }
286
- return U.children = F(U.children || []), P.splice(te, 1, U), n == null || n(P), P;
286
+ return G.children = F(G.children || []), P.splice(re, 1, G), n == null || n(P), P;
287
287
  }
288
- if (U) {
289
- if (!((tt = U.children) != null && tt.length) && w.length) {
290
- const ne = { ...U };
291
- return U.data = { name: "文件夹" }, U.type = "group", U.children = [ne, ...w], U.id = Oe(), P.splice(te, 1, U), n == null || n(P), P;
288
+ if (G) {
289
+ if (!((tt = G.children) != null && tt.length) && w.length) {
290
+ const ae = { ...G };
291
+ return G.data = { name: "文件夹" }, G.type = "group", G.children = [ae, ...w], G.id = Oe(), P.splice(re, 1, G), n == null || n(P), P;
292
292
  }
293
- return U.children = V.uniqueArray(w), P.splice(te, 1, U), n == null || n(P), P;
293
+ return G.children = K.uniqueArray(w), P.splice(re, 1, G), n == null || n(P), P;
294
294
  }
295
- return V.uniqueArray(w);
295
+ return K.uniqueArray(w);
296
296
  };
297
- return V.uniqueArray(F($));
297
+ return K.uniqueArray(F(H));
298
298
  });
299
299
  else {
300
- const M = V.uniqueArray(w);
301
- n == null || n(M), g(M);
300
+ const T = K.uniqueArray(w);
301
+ n == null || n(T), f(T);
302
302
  }
303
303
  },
304
304
  [n]
305
305
  ), $e = (w, B) => {
306
- g((z) => {
307
- const M = [...z], $ = (F) => {
306
+ f((z) => {
307
+ const T = [...z], H = (F) => {
308
308
  var P;
309
309
  for (let _ = 0; _ < F.length; _++)
310
310
  if (F[_].id === w) {
311
311
  F[_].config = B;
312
312
  break;
313
- } else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && $(F[_].children);
313
+ } else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && H(F[_].children);
314
314
  };
315
- return $(M), n == null || n(M), M;
315
+ return H(T), n == null || n(T), T;
316
316
  });
317
317
  }, Se = (w, B) => {
318
- g((z) => {
319
- const M = [...z], $ = (F) => {
318
+ f((z) => {
319
+ const T = [...z], H = (F) => {
320
320
  var P;
321
321
  for (let _ = 0; _ < F.length; _++)
322
322
  if (F[_].id === w) {
323
323
  F[_].data = B;
324
324
  break;
325
- } else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && $(F[_].children);
325
+ } else ((P = F[_].children) == null ? void 0 : P.length) !== void 0 && H(F[_].children);
326
326
  };
327
- return $(M), n == null || n(M), M;
327
+ return H(T), n == null || n(T), T;
328
328
  });
329
329
  }, Te = (w) => {
330
- g((B) => {
331
- const z = [...B], M = ($) => {
330
+ f((B) => {
331
+ const z = [...B], T = (H) => {
332
332
  var F;
333
- for (let P = 0; P < $.length; P++)
334
- if ($[P].id === w) {
335
- $.splice(P, 1);
333
+ for (let P = 0; P < H.length; P++)
334
+ if (H[P].id === w) {
335
+ H.splice(P, 1);
336
336
  break;
337
- } else ((F = $[P].children) == null ? void 0 : F.length) !== void 0 && M($[P].children);
337
+ } else ((F = H[P].children) == null ? void 0 : F.length) !== void 0 && T(H[P].children);
338
338
  };
339
- return M(z), n == null || n(z), z;
339
+ return T(z), n == null || n(z), z;
340
340
  });
341
341
  }, ie = (w, B) => {
342
- const z = [...h], M = ($, F) => {
343
- const P = F.shift(), _ = $.find((te) => te.id === P), U = $.findIndex((te) => te.id === P);
342
+ const z = [...b], T = (H, F) => {
343
+ const P = F.shift(), _ = H.find((re) => re.id === P), G = H.findIndex((re) => re.id === P);
344
344
  if (_) {
345
345
  if (F.length)
346
- _.children = M(_.children || [], F);
346
+ _.children = T(_.children || [], F);
347
347
  else {
348
- const te = (w == null ? void 0 : w.type) ?? "app";
348
+ const re = (w == null ? void 0 : w.type) ?? "app";
349
349
  _.children = [
350
350
  ..._.children ?? [],
351
351
  {
352
352
  ...w,
353
353
  id: Oe(),
354
- config: (w == null ? void 0 : w.config) ?? Be[te]
354
+ config: (w == null ? void 0 : w.config) ?? Be[re]
355
355
  }
356
356
  ];
357
357
  }
358
- return $.splice(U, 1, _), $;
358
+ return H.splice(G, 1, _), H;
359
359
  } else
360
- return $;
360
+ return H;
361
361
  };
362
- g(M(z, B));
362
+ f(T(z, B));
363
363
  }, Me = (w) => {
364
- g((B) => {
365
- const z = (w == null ? void 0 : w.type) ?? "app", M = {
364
+ f((B) => {
365
+ const z = (w == null ? void 0 : w.type) ?? "app", T = {
366
366
  ...w,
367
367
  id: Oe(),
368
368
  config: (w == null ? void 0 : w.config) ?? Be[z]
369
- }, $ = [...B, M];
370
- return n == null || n($), $;
369
+ }, H = [...B, T];
370
+ return n == null || n(H), H;
371
371
  });
372
372
  }, He = (w, B) => {
373
- g((z) => {
374
- const M = [...z], $ = M.findIndex((F) => F.id === w);
375
- return $ !== -1 && (M[$] = { ...M[$], ...B }, n == null || n(M)), M;
373
+ f((z) => {
374
+ const T = [...z], H = T.findIndex((F) => F.id === w);
375
+ return H !== -1 && (T[H] = { ...T[H], ...B }, n == null || n(T)), T;
376
376
  });
377
377
  }, ye = (w) => {
378
- g((B) => {
379
- const z = B.filter((M) => M.id !== w);
378
+ f((B) => {
379
+ const z = B.filter((T) => T.id !== w);
380
380
  return n == null || n(z), z;
381
381
  });
382
382
  };
383
- return ae(() => {
384
- (o == null ? void 0 : o.length) > 0 && h.length === 0 && ee(o);
385
- }, [o]), ae(() => {
386
- f.current = l, l !== null && X();
387
- }, [l]), ae(() => {
388
- s && re != null && re.length && !O && (ee(re), se(!0));
389
- }, [re, O, s, ee]), ao(
383
+ return se(() => {
384
+ (o == null ? void 0 : o.length) > 0 && b.length === 0 && oe(o);
385
+ }, [o]), se(() => {
386
+ g.current = l, l !== null && X();
387
+ }, [l]), se(() => {
388
+ s && Y != null && Y.length && !A && (oe(Y), V(!0));
389
+ }, [Y, A, s, oe]), ao(
390
390
  () => {
391
- s && L(h);
391
+ s && M(b);
392
392
  },
393
- [h, s],
393
+ [b, s],
394
394
  {
395
395
  wait: 1e3
396
396
  }
@@ -398,19 +398,19 @@ const At = st({
398
398
  At.Provider,
399
399
  {
400
400
  value: {
401
- list: h,
402
- setList: ee,
403
- contextMenu: v,
401
+ list: b,
402
+ setList: oe,
403
+ contextMenu: k,
404
404
  setContextMenu: D,
405
405
  listStatus: l,
406
406
  setListStatus: c,
407
- contextMenuFuns: K,
407
+ contextMenuFuns: Z,
408
408
  hideContextMenu: X,
409
- showInfoItemData: S,
410
- setShowInfoItemData: y,
409
+ showInfoItemData: I,
410
+ setShowInfoItemData: v,
411
411
  openGroupItemData: N,
412
412
  setOpenGroupItemData: u,
413
- longPressTriggered: T,
413
+ longPressTriggered: S,
414
414
  updateItemConfig: $e,
415
415
  updateItem: Se,
416
416
  removeItem: Te,
@@ -418,10 +418,10 @@ const At = st({
418
418
  addRootItem: Me,
419
419
  updateRootItem: He,
420
420
  removeRootItem: ye,
421
- moveItemId: I,
422
- setMoveItemId: C,
423
- moveTargetId: H,
424
- setMoveTargetId: G
421
+ moveItemId: j,
422
+ setMoveItemId: x,
423
+ moveTargetId: L,
424
+ setMoveTargetId: E
425
425
  },
426
426
  children: e
427
427
  }
@@ -434,11 +434,11 @@ const At = st({
434
434
  },
435
435
  menuHide: { opacity: 0, y: 20, transition: { duration: 0.2 } }
436
436
  }, Fe = (r) => {
437
- const { icon: e, title: o, onClick: n } = r, { theme: a } = le(), { light: s, dark: i } = V.getTheme(a);
437
+ const { icon: e, title: o, onClick: n } = r, { theme: a } = le(), { light: s, dark: i } = K.getTheme(a);
438
438
  return /* @__PURE__ */ t(
439
439
  R.div,
440
440
  {
441
- className: b`
441
+ className: h`
442
442
  &:hover {
443
443
  background-color: ${s.contextMenuActiveColor};
444
444
  @media (prefers-color-scheme: dark) {
@@ -462,9 +462,9 @@ const At = st({
462
462
  children: /* @__PURE__ */ m(
463
463
  R.div,
464
464
  {
465
- className: k(
465
+ className: C(
466
466
  "py-1.5 px-3 rounded-lg",
467
- b`
467
+ h`
468
468
  padding-top: 0.375rem;
469
469
  padding-bottom: 0.375rem;
470
470
  padding-left: 0.75rem;
@@ -477,8 +477,8 @@ const At = st({
477
477
  /* @__PURE__ */ t(
478
478
  R.div,
479
479
  {
480
- className: k(
481
- b`
480
+ className: C(
481
+ h`
482
482
  margin-bottom: 0.375rem;
483
483
  display: flex;
484
484
  justify-content: center;
@@ -504,18 +504,18 @@ const At = st({
504
504
  onRemoveClick: d
505
505
  } = r, {
506
506
  contextMenu: p,
507
- setContextMenu: x,
507
+ setContextMenu: y,
508
508
  hideContextMenu: l,
509
509
  setShowInfoItemData: c,
510
- removeItem: f,
511
- updateItemConfig: v
512
- } = pe(), { theme: D } = le(), { light: h, dark: g } = V.getTheme(D), { data: S } = p ?? {}, { config: y = {} } = S ?? {}, N = () => {
513
- var A;
514
- const u = Be[(A = p == null ? void 0 : p.data) == null ? void 0 : A.type], T = [];
515
- for (let I = 1; I <= ((u == null ? void 0 : u.maxRow) ?? 2); I++)
516
- for (let C = 1; C <= ((u == null ? void 0 : u.maxCol) ?? 2); C++)
517
- T.push(`${I}x${C}`);
518
- return T;
510
+ removeItem: g,
511
+ updateItemConfig: k
512
+ } = pe(), { theme: D } = le(), { light: b, dark: f } = K.getTheme(D), { data: I } = p ?? {}, { config: v = {} } = I ?? {}, N = () => {
513
+ var U;
514
+ const u = Be[(U = p == null ? void 0 : p.data) == null ? void 0 : U.type], S = [];
515
+ for (let j = 1; j <= ((u == null ? void 0 : u.maxRow) ?? 2); j++)
516
+ for (let x = 1; x <= ((u == null ? void 0 : u.maxCol) ?? 2); x++)
517
+ S.push(`${j}x${x}`);
518
+ return S;
519
519
  };
520
520
  return /* @__PURE__ */ t(Ue, { children: p && /* @__PURE__ */ m(
521
521
  R.div,
@@ -530,22 +530,22 @@ const At = st({
530
530
  /* @__PURE__ */ t(
531
531
  R.div,
532
532
  {
533
- className: k(
534
- b`
533
+ className: C(
534
+ h`
535
535
  border-radius: 0.5rem;
536
536
  overflow: hidden;
537
- background-color: ${h.contextMenuBackgroundColor};
538
- box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
537
+ background-color: ${b.contextMenuBackgroundColor};
538
+ box-shadow: 0 0 0.5rem ${b.contextMenuShadowColor};
539
539
  @media (prefers-color-scheme: dark) {
540
- background-color: ${g.contextMenuBackgroundColor};
541
- box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
540
+ background-color: ${f.contextMenuBackgroundColor};
541
+ box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
542
542
  }
543
543
  `
544
544
  ),
545
- children: a && y.allowResize !== !1 && /* @__PURE__ */ t(
545
+ children: a && v.allowResize !== !1 && /* @__PURE__ */ t(
546
546
  R.ul,
547
547
  {
548
- className: b`
548
+ className: h`
549
549
  background-color: white;
550
550
  padding: 0.25rem;
551
551
  margin: 0;
@@ -559,10 +559,10 @@ const At = st({
559
559
  label: u,
560
560
  key: u,
561
561
  onClick: () => {
562
- const [T, A] = u.split("x").map(Number);
563
- v(p.data.id, {
564
- row: T,
565
- col: A
562
+ const [S, U] = u.split("x").map(Number);
563
+ k(p.data.id, {
564
+ row: S,
565
+ col: U
566
566
  });
567
567
  }
568
568
  }))
@@ -570,7 +570,7 @@ const At = st({
570
570
  ].map((u) => /* @__PURE__ */ m(
571
571
  R.li,
572
572
  {
573
- className: b`
573
+ className: h`
574
574
  padding-top: 0.5rem;
575
575
  padding-bottom: 0.5rem;
576
576
  padding-left: 0.75rem;
@@ -580,7 +580,7 @@ const At = st({
580
580
  /* @__PURE__ */ m(
581
581
  R.p,
582
582
  {
583
- className: b`
583
+ className: h`
584
584
  display: flex;
585
585
  align-items: center;
586
586
  font-size: 0.875rem;
@@ -588,9 +588,9 @@ const At = st({
588
588
  gap: 0.5rem;
589
589
  padding-bottom: 0.5rem;
590
590
  margin: 0;
591
- color: ${h.contextMenuTextColor};
591
+ color: ${b.contextMenuTextColor};
592
592
  @media (prefers-color-scheme: dark) {
593
- color: ${g.contextMenuTextColor};
593
+ color: ${f.contextMenuTextColor};
594
594
  }
595
595
  `,
596
596
  children: [
@@ -603,17 +603,17 @@ const At = st({
603
603
  /* @__PURE__ */ t(
604
604
  R.div,
605
605
  {
606
- className: b`
606
+ className: h`
607
607
  display: grid;
608
608
  grid-template-columns: repeat(2, minmax(0, 1fr));
609
609
  gap: 0.25rem;
610
610
  `,
611
- children: u.items.map((T) => /* @__PURE__ */ t(
611
+ children: u.items.map((S) => /* @__PURE__ */ t(
612
612
  R.div,
613
613
  {
614
- className: k(
614
+ className: C(
615
615
  "py-1 px-2 hover:bg-gray-100 rounded transition-all cursor-pointer text-center text-sm",
616
- b`
616
+ h`
617
617
  padding-top: 0.25rem;
618
618
  padding-bottom: 0.25rem;
619
619
  padding-left: 0.5rem;
@@ -624,28 +624,28 @@ const At = st({
624
624
  line-height: 1.25rem;
625
625
  cursor: pointer;
626
626
  text-align: center;
627
- color: ${h.contextMenuTextColor};
627
+ color: ${b.contextMenuTextColor};
628
628
  @media (prefers-color-scheme: dark) {
629
- color: ${g.contextMenuTextColor};
629
+ color: ${f.contextMenuTextColor};
630
630
  }
631
631
  &:hover {
632
- background-color: ${h.contextMenuActiveColor};
632
+ background-color: ${b.contextMenuActiveColor};
633
633
  @media (prefers-color-scheme: dark) {
634
- background-color: ${g.contextMenuActiveColor};
634
+ background-color: ${f.contextMenuActiveColor};
635
635
  }
636
636
  }
637
637
  `,
638
- `${y.row}x${y.col}` === T.key && b`
639
- background-color: ${h.contextMenuActiveColor};
638
+ `${v.row}x${v.col}` === S.key && h`
639
+ background-color: ${b.contextMenuActiveColor};
640
640
  @media (prefers-color-scheme: dark) {
641
- background-color: ${g.contextMenuActiveColor};
641
+ background-color: ${f.contextMenuActiveColor};
642
642
  }
643
643
  `
644
644
  ),
645
- onClick: T.onClick,
646
- children: T.label
645
+ onClick: S.onClick,
646
+ children: S.label
647
647
  },
648
- T.key
648
+ S.key
649
649
  ))
650
650
  }
651
651
  )
@@ -660,13 +660,13 @@ const At = st({
660
660
  /* @__PURE__ */ m(
661
661
  R.div,
662
662
  {
663
- className: k(
664
- b`
665
- background-color: ${h.contextMenuBackgroundColor};
666
- box-shadow: 0 0 0.5rem ${h.contextMenuShadowColor};
663
+ className: C(
664
+ h`
665
+ background-color: ${b.contextMenuBackgroundColor};
666
+ box-shadow: 0 0 0.5rem ${b.contextMenuShadowColor};
667
667
  @media (prefers-color-scheme: dark) {
668
- background-color: ${g.contextMenuBackgroundColor};
669
- box-shadow: 0 0 0.5rem ${g.contextMenuShadowColor};
668
+ background-color: ${f.contextMenuBackgroundColor};
669
+ box-shadow: 0 0 0.5rem ${f.contextMenuShadowColor};
670
670
  }
671
671
  display: flex;
672
672
  justify-content: space-around;
@@ -716,10 +716,10 @@ const At = st({
716
716
  title: "移除",
717
717
  onClick: () => {
718
718
  if (d) {
719
- d(p.data, f);
719
+ d(p.data, g);
720
720
  return;
721
721
  }
722
- x(null), f(p.data.id);
722
+ y(null), g(p.data.id);
723
723
  }
724
724
  }
725
725
  )
@@ -730,12 +730,12 @@ const At = st({
730
730
  }
731
731
  ) });
732
732
  }, Bn = (r) => {
733
- const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: n } = pe(), { itemIconBuilder: a, theme: s, contextMenu: i } = le(), { light: d, dark: p } = V.getTheme(s), { data: x = {} } = e, { name: l } = x;
733
+ const { data: e, noLetters: o = !1 } = r, { contextMenuFuns: n } = pe(), { itemIconBuilder: a, theme: s, contextMenu: i } = le(), { light: d, dark: p } = K.getTheme(s), { data: y = {} } = e, { name: l } = y;
734
734
  return /* @__PURE__ */ m(ue, { children: [
735
735
  /* @__PURE__ */ t(
736
736
  R.div,
737
737
  {
738
- className: b`
738
+ className: h`
739
739
  width: 4rem;
740
740
  height: 4rem;
741
741
  background-color: ${d.itemIconBackgroundColor};
@@ -753,7 +753,7 @@ const At = st({
753
753
  children: /* @__PURE__ */ t(
754
754
  "div",
755
755
  {
756
- className: b`
756
+ className: h`
757
757
  position: absolute;
758
758
  left: 0;
759
759
  top: 0;
@@ -773,15 +773,15 @@ const At = st({
773
773
  /* @__PURE__ */ t(
774
774
  R.p,
775
775
  {
776
- className: k(
776
+ className: C(
777
777
  "whitespace-nowrap text-ellipsis overflow-hidden text-center mt-1 mb-0 max-w-16",
778
- b`
778
+ h`
779
779
  color: ${d.itemNameColor};
780
780
  @media (prefers-color-scheme: dark) {
781
781
  color: ${p.itemNameColor};
782
782
  }
783
783
  `,
784
- o && b`
784
+ o && h`
785
785
  color: transparent;
786
786
  `
787
787
  ),
@@ -799,12 +799,12 @@ const At = st({
799
799
  children: i,
800
800
  parentIds: d,
801
801
  childrenLength: p
802
- } = r, { contextMenu: x, setContextMenu: l } = pe(), { contextMenu: c } = le();
802
+ } = r, { contextMenu: y, setContextMenu: l } = pe(), { contextMenu: c } = le();
803
803
  return /* @__PURE__ */ t(
804
804
  dt,
805
805
  {
806
806
  placement: "bottom",
807
- overlayClassName: b`
807
+ overlayClassName: h`
808
808
  background-color: transparent;
809
809
  .rc-tooltip-inner {
810
810
  background-color: transparent;
@@ -813,9 +813,9 @@ const At = st({
813
813
  }
814
814
  `,
815
815
  overlay: /* @__PURE__ */ t(Pn, { ...c }),
816
- visible: (x == null ? void 0 : x.data.id) === e.id,
817
- onVisibleChange: (f) => {
818
- f || l(null);
816
+ visible: (y == null ? void 0 : y.data.id) === e.id,
817
+ onVisibleChange: (g) => {
818
+ g || l(null);
819
819
  },
820
820
  destroyTooltipOnHide: !0,
821
821
  children: /* @__PURE__ */ t(
@@ -826,7 +826,7 @@ const At = st({
826
826
  "data-parent-ids": d == null ? void 0 : d.join(","),
827
827
  "data-children-length": p,
828
828
  onClick: () => a == null ? void 0 : a(e),
829
- className: k(s && "drag-disabled", o),
829
+ className: C(s && "drag-disabled", o),
830
830
  children: i ?? /* @__PURE__ */ t(Bn, { ...r })
831
831
  }
832
832
  )
@@ -843,37 +843,37 @@ const At = st({
843
843
  } = r, {
844
844
  contextMenuFuns: d,
845
845
  setList: p,
846
- setOpenGroupItemData: x,
846
+ setOpenGroupItemData: y,
847
847
  longPressTriggered: l,
848
848
  moveItemId: c,
849
- moveTargetId: f,
850
- setMoveTargetId: v,
849
+ moveTargetId: g,
850
+ setMoveTargetId: k,
851
851
  listStatus: D
852
- } = pe(), { itemIconBuilder: h, theme: g, contextMenu: S } = le(), { light: y, dark: N } = V.getTheme(g), { children: u, data: T, config: A } = e, { row: I = 1, col: C = 1 } = A ?? {}, H = {
852
+ } = pe(), { itemIconBuilder: b, theme: f, contextMenu: I } = le(), { light: v, dark: N } = K.getTheme(f), { children: u, data: S, config: U } = e, { row: j = 1, col: x = 1 } = U ?? {}, L = {
853
853
  visible: { opacity: 1, scale: 1 },
854
854
  hidden: { opacity: 0, scale: 0.95 }
855
- }, G = ((u == null ? void 0 : u.length) ?? 0) === 0, O = G ? [e] : [...u ?? []].slice(0, 9), se = be(() => c === e.id.toString(), [e.id, c]), re = be(() => f === e.id, [e.id, f]), L = b`
855
+ }, E = ((u == null ? void 0 : u.length) ?? 0) === 0, A = E ? [e] : [...u ?? []].slice(0, 9), V = be(() => c === e.id.toString(), [e.id, c]), Y = be(() => g === e.id, [e.id, g]), M = h`
856
856
  overflow: hidden;
857
857
  cursor: pointer;
858
- background-color: ${y.itemIconBackgroundColor};
859
- box-shadow: 0 0 0.5rem ${y.itemIconShadowColor};
858
+ background-color: ${v.itemIconBackgroundColor};
859
+ box-shadow: 0 0 0.5rem ${v.itemIconShadowColor};
860
860
  @media (prefers-color-scheme: dark) {
861
861
  background-color: ${N.itemIconBackgroundColor};
862
862
  box-shadow: 0 0 0.5rem ${N.itemIconShadowColor};
863
863
  }
864
864
  `, X = () => {
865
- if (G)
865
+ if (E)
866
866
  return /* @__PURE__ */ t(
867
867
  R.div,
868
868
  {
869
- className: k(
869
+ className: C(
870
870
  "sortable-group-item",
871
- b`
871
+ h`
872
872
  overflow: hidden;
873
873
  cursor: pointer;
874
874
  width: 100%;
875
875
  height: 100%;
876
- background-color: ${y.itemIconBackgroundColor};
876
+ background-color: ${v.itemIconBackgroundColor};
877
877
  position: absolute;
878
878
  left: 0;
879
879
  top: 0;
@@ -883,51 +883,51 @@ const At = st({
883
883
  }
884
884
  `
885
885
  ),
886
- onClick: (E) => {
887
- E.stopPropagation(), s == null || s(e);
886
+ onClick: ($) => {
887
+ $.stopPropagation(), s == null || s(e);
888
888
  },
889
- children: h == null ? void 0 : h(e)
889
+ children: b == null ? void 0 : b(e)
890
890
  }
891
891
  );
892
- if (I === 1 && C === 1 || I === 2 && C === 2)
892
+ if (j === 1 && x === 1 || j === 2 && x === 2)
893
893
  return /* @__PURE__ */ t(
894
894
  R.div,
895
895
  {
896
- className: b`
896
+ className: h`
897
897
  display: grid;
898
898
  width: 100%;
899
899
  height: 100%;
900
900
  grid-template-columns: repeat(3, minmax(0, 1fr));
901
901
  grid-template-rows: repeat(3, minmax(0, 1fr));
902
- padding: ${C === 1 ? "0.125rem" : "0.25rem"};
903
- gap: ${C === 1 ? "0.125rem" : "0.5rem"};
902
+ padding: ${x === 1 ? "0.125rem" : "0.25rem"};
903
+ gap: ${x === 1 ? "0.125rem" : "0.5rem"};
904
904
  place-items: center;
905
905
  `,
906
- children: O == null ? void 0 : O.slice(0, 9).map((E) => /* @__PURE__ */ t(
906
+ children: A == null ? void 0 : A.slice(0, 9).map(($) => /* @__PURE__ */ t(
907
907
  R.div,
908
908
  {
909
- className: k(
910
- L,
911
- b`
912
- border-radius: ${C === 1 ? "0.25rem" : "0.5rem"};
909
+ className: C(
910
+ M,
911
+ h`
912
+ border-radius: ${x === 1 ? "0.25rem" : "0.5rem"};
913
913
  width: 100%;
914
914
  height: 100%;
915
915
  `
916
916
  ),
917
- onClick: (K) => {
918
- K.stopPropagation(), s == null || s(E);
917
+ onClick: (Z) => {
918
+ Z.stopPropagation(), s == null || s($);
919
919
  },
920
- children: h == null ? void 0 : h(E)
920
+ children: b == null ? void 0 : b($)
921
921
  },
922
- E.id
922
+ $.id
923
923
  ))
924
924
  }
925
925
  );
926
- if (I === 1 && C === 2)
926
+ if (j === 1 && x === 2)
927
927
  return /* @__PURE__ */ t(
928
928
  R.div,
929
929
  {
930
- className: b`
930
+ className: h`
931
931
  display: grid;
932
932
  grid-template-columns: repeat(10, minmax(0, 1fr));
933
933
  grid-template-rows: repeat(4, minmax(0, 1fr));
@@ -937,18 +937,18 @@ const At = st({
937
937
  height: 52px;
938
938
  place-items: center;
939
939
  `,
940
- children: O == null ? void 0 : O.slice(0, 4).map((E, K) => /* @__PURE__ */ t(
940
+ children: A == null ? void 0 : A.slice(0, 4).map(($, Z) => /* @__PURE__ */ t(
941
941
  R.div,
942
942
  {
943
- className: k(
944
- L,
945
- K < 2 ? b`
943
+ className: C(
944
+ M,
945
+ Z < 2 ? h`
946
946
  width: 52px;
947
947
  height: 52px;
948
948
  border-radius: 0.5rem;
949
949
  grid-column: span 4 / span 4;
950
950
  grid-row: span 4 / span 4;
951
- ` : b`
951
+ ` : h`
952
952
  width: 1.5rem;
953
953
  height: 1.5rem;
954
954
  border-radius: 0.375rem;
@@ -956,20 +956,20 @@ const At = st({
956
956
  grid-row: span 2 / span 2;
957
957
  `
958
958
  ),
959
- onClick: (ee) => {
960
- K > 2 || (ee.stopPropagation(), s == null || s(E));
959
+ onClick: (oe) => {
960
+ Z > 2 || (oe.stopPropagation(), s == null || s($));
961
961
  },
962
- children: h == null ? void 0 : h(E)
962
+ children: b == null ? void 0 : b($)
963
963
  },
964
- E.id
964
+ $.id
965
965
  ))
966
966
  }
967
967
  );
968
- if (I === 2 && C === 1)
968
+ if (j === 2 && x === 1)
969
969
  return /* @__PURE__ */ t(
970
970
  R.div,
971
971
  {
972
- className: b`
972
+ className: h`
973
973
  display: grid;
974
974
  grid-template-columns: repeat(4, minmax(0, 1fr));
975
975
  grid-template-rows: repeat(10, minmax(0, 1fr));
@@ -979,30 +979,30 @@ const At = st({
979
979
  height: 144px;
980
980
  place-items: center;
981
981
  `,
982
- children: O == null ? void 0 : O.slice(0, 4).map((E, K) => /* @__PURE__ */ t(
982
+ children: A == null ? void 0 : A.slice(0, 4).map(($, Z) => /* @__PURE__ */ t(
983
983
  R.div,
984
984
  {
985
- className: k(
986
- L,
987
- K < 2 ? b`
985
+ className: C(
986
+ M,
987
+ Z < 2 ? h`
988
988
  width: 52px;
989
989
  height: 52px;
990
990
  border-radius: 0.5rem;
991
991
  grid-column: span 4 / span 4;
992
992
  grid-row: span 4 / span 4;
993
- ` : b`
993
+ ` : h`
994
994
  width: 1.5rem;
995
995
  height: 1.5rem;
996
996
  grid-column: span 2 / span 2;
997
997
  grid-row: span 2 / span 2;
998
998
  `
999
999
  ),
1000
- onClick: (ee) => {
1001
- K > 2 || (ee.stopPropagation(), s == null || s(E));
1000
+ onClick: (oe) => {
1001
+ Z > 2 || (oe.stopPropagation(), s == null || s($));
1002
1002
  },
1003
- children: h == null ? void 0 : h(E)
1003
+ children: b == null ? void 0 : b($)
1004
1004
  },
1005
- E.id
1005
+ $.id
1006
1006
  ))
1007
1007
  }
1008
1008
  );
@@ -1014,10 +1014,10 @@ const At = st({
1014
1014
  itemIndex: a,
1015
1015
  parentIds: n,
1016
1016
  childrenLength: u == null ? void 0 : u.length,
1017
- className: k(
1018
- b`
1019
- grid-row: span ${I};
1020
- grid-column: span ${C};
1017
+ className: C(
1018
+ h`
1019
+ grid-row: span ${j};
1020
+ grid-column: span ${x};
1021
1021
  `,
1022
1022
  o
1023
1023
  ),
@@ -1026,14 +1026,14 @@ const At = st({
1026
1026
  R.div,
1027
1027
  {
1028
1028
  whileTap: { scale: 0.9 },
1029
- className: k(
1030
- re ? "!scale-110" : "",
1031
- b`
1029
+ className: C(
1030
+ Y ? "!scale-110" : "",
1031
+ h`
1032
1032
  cursor: pointer;
1033
1033
  position: relative;
1034
1034
  border-radius: 0.75rem;
1035
- background-color: ${y.groupItemIconBackgroundColor};
1036
- box-shadow: 0 0 0.5rem ${y.groupItemIconShadowColor};
1035
+ background-color: ${v.groupItemIconBackgroundColor};
1036
+ box-shadow: 0 0 0.5rem ${v.groupItemIconShadowColor};
1037
1037
  @media (prefers-color-scheme: dark) {
1038
1038
  background-color: ${N.groupItemIconBackgroundColor};
1039
1039
  box-shadow: 0 0 0.5rem ${N.groupItemIconShadowColor};
@@ -1041,18 +1041,18 @@ const At = st({
1041
1041
  /* overflow: hidden; */
1042
1042
  transition: all 0.3s;
1043
1043
  margin: 0 auto;
1044
- width: ${C * 64 + 32 * (C - 1)}px;
1045
- height: ${I * 64 + 32 * (I - 1)}px;
1044
+ width: ${x * 64 + 32 * (x - 1)}px;
1045
+ height: ${j * 64 + 32 * (j - 1)}px;
1046
1046
  `
1047
1047
  ),
1048
- onClick: (E) => {
1049
- !G && !l && (e.parentIds = n, e.pageX = E.pageX, e.pageY = E.pageY, x(e));
1048
+ onClick: ($) => {
1049
+ !E && !l && (e.parentIds = n, e.pageX = $.pageX, e.pageY = $.pageY, y(e));
1050
1050
  },
1051
- ...d(e, S !== !1),
1051
+ ...d(e, I !== !1),
1052
1052
  children: /* @__PURE__ */ m(
1053
1053
  R.div,
1054
1054
  {
1055
- className: b`
1055
+ className: h`
1056
1056
  position: relative;
1057
1057
  width: 100%;
1058
1058
  height: 100%;
@@ -1066,9 +1066,9 @@ const At = st({
1066
1066
  /* @__PURE__ */ t(
1067
1067
  Xe,
1068
1068
  {
1069
- className: k(
1069
+ className: C(
1070
1070
  "sortable-group-item",
1071
- b`
1071
+ h`
1072
1072
  position: absolute;
1073
1073
  cursor: pointer;
1074
1074
  left: 0.375rem;
@@ -1085,11 +1085,11 @@ const At = st({
1085
1085
  animation: 150,
1086
1086
  fallbackOnBody: !0,
1087
1087
  list: u ?? [],
1088
- setList: (E) => p(E, n),
1088
+ setList: ($) => p($, n),
1089
1089
  filter: () => !0,
1090
1090
  "data-id": e.id,
1091
1091
  onChange: () => {
1092
- v(e.id);
1092
+ k(e.id);
1093
1093
  }
1094
1094
  }
1095
1095
  )
@@ -1101,27 +1101,27 @@ const At = st({
1101
1101
  /* @__PURE__ */ t(
1102
1102
  R.p,
1103
1103
  {
1104
- className: k(
1104
+ className: C(
1105
1105
  "whitespace-nowrap text-ellipsis overflow-hidden text-center mt-1 mb-0 max-w-16",
1106
- b`
1107
- color: ${y.itemNameColor};
1106
+ h`
1107
+ color: ${v.itemNameColor};
1108
1108
  @media (prefers-color-scheme: dark) {
1109
1109
  color: ${N.itemNameColor};
1110
1110
  }
1111
1111
  `,
1112
- i && b`
1112
+ i && h`
1113
1113
  color: transparent;
1114
1114
  `
1115
1115
  ),
1116
- variants: H,
1117
- animate: se ? "hidden" : "visible",
1118
- children: (T == null ? void 0 : T.name) ?? "文件夹"
1116
+ variants: L,
1117
+ animate: V ? "hidden" : "visible",
1118
+ children: (S == null ? void 0 : S.name) ?? "文件夹"
1119
1119
  }
1120
1120
  )
1121
1121
  ]
1122
1122
  }
1123
1123
  );
1124
- }, Rt = b`
1124
+ }, Rt = h`
1125
1125
  padding: 8px;
1126
1126
  transition: all 0.2s;
1127
1127
  > div {
@@ -1140,11 +1140,11 @@ const At = st({
1140
1140
  setListStatus: i,
1141
1141
  setMoveItemId: d,
1142
1142
  setMoveTargetId: p,
1143
- updateItem: x
1144
- } = pe(), { theme: l } = le(), { light: c, dark: f } = V.getTheme(l), [v, D] = j("文件夹"), h = [...(e == null ? void 0 : e.children) ?? []];
1145
- return ae(() => {
1146
- var g;
1147
- e && D((g = e.data) == null ? void 0 : g.name);
1143
+ updateItem: y
1144
+ } = pe(), { theme: l } = le(), { light: c, dark: g } = K.getTheme(l), [k, D] = O("文件夹"), b = [...(e == null ? void 0 : e.children) ?? []];
1145
+ return se(() => {
1146
+ var f;
1147
+ e && D((f = e.data) == null ? void 0 : f.name);
1148
1148
  }, [e]), /* @__PURE__ */ t(
1149
1149
  Ct,
1150
1150
  {
@@ -1161,7 +1161,7 @@ const At = st({
1161
1161
  title: /* @__PURE__ */ t(
1162
1162
  "input",
1163
1163
  {
1164
- className: b`
1164
+ className: h`
1165
1165
  background-color: transparent;
1166
1166
  border-style: none;
1167
1167
  text-align: center;
@@ -1175,23 +1175,23 @@ const At = st({
1175
1175
  outline: none;
1176
1176
  }
1177
1177
  `,
1178
- value: v,
1179
- onChange: (g) => {
1180
- D(g.target.value);
1178
+ value: k,
1179
+ onChange: (f) => {
1180
+ D(f.target.value);
1181
1181
  },
1182
1182
  onBlur: () => {
1183
- e && x(e.id, {
1183
+ e && y(e.id, {
1184
1184
  ...e.data,
1185
- name: v
1185
+ name: k
1186
1186
  });
1187
1187
  }
1188
1188
  }
1189
1189
  ),
1190
1190
  footer: null,
1191
1191
  closable: !1,
1192
- className: k(
1192
+ className: C(
1193
1193
  "group-item-modal",
1194
- b`
1194
+ h`
1195
1195
  .rc-dialog-content {
1196
1196
  background-color: transparent;
1197
1197
  box-shadow: none;
@@ -1208,7 +1208,7 @@ const At = st({
1208
1208
  .rc-dialog-body {
1209
1209
  background-color: ${c.groupItemModalBackgroundColor};
1210
1210
  @media (prefers-color-scheme: dark) {
1211
- background-color: ${f.groupItemModalBackgroundColor};
1211
+ background-color: ${g.groupItemModalBackgroundColor};
1212
1212
  }
1213
1213
  border-radius: 0.5rem;
1214
1214
  overflow: hidden;
@@ -1221,21 +1221,21 @@ const At = st({
1221
1221
  children: /* @__PURE__ */ t(
1222
1222
  "div",
1223
1223
  {
1224
- className: b`
1224
+ className: h`
1225
1225
  overflow-y: auto;
1226
1226
  max-height: 60vh;
1227
1227
  padding: 1.25rem 0;
1228
1228
  `,
1229
- onDragLeave: (g) => {
1230
- const S = g.relatedTarget;
1231
- S && (g.currentTarget.contains(S) || setTimeout(() => {
1229
+ onDragLeave: (f) => {
1230
+ const I = f.relatedTarget;
1231
+ I && (f.currentTarget.contains(I) || setTimeout(() => {
1232
1232
  o();
1233
1233
  }, 500));
1234
1234
  },
1235
1235
  children: /* @__PURE__ */ t(
1236
1236
  Xe,
1237
1237
  {
1238
- className: b`
1238
+ className: h`
1239
1239
  display: grid;
1240
1240
  gap: 1rem;
1241
1241
  place-items: center;
@@ -1247,28 +1247,28 @@ const At = st({
1247
1247
  animation: 150,
1248
1248
  fallbackOnBody: !0,
1249
1249
  list: (e == null ? void 0 : e.children) ?? [],
1250
- setList: (g) => {
1250
+ setList: (f) => {
1251
1251
  var N, u;
1252
- const S = g.map((T) => T.id), y = (u = (N = a.find((T) => T.id === (e == null ? void 0 : e.id))) == null ? void 0 : N.children) == null ? void 0 : u.map((T) => T.id);
1253
- S.length === (y == null ? void 0 : y.length) && S.every((T, A) => T === y[A]) || S.length < ((y == null ? void 0 : y.length) ?? 0) || s(g, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1252
+ const I = f.map((S) => S.id), v = (u = (N = a.find((S) => S.id === (e == null ? void 0 : e.id))) == null ? void 0 : N.children) == null ? void 0 : u.map((S) => S.id);
1253
+ I.length === (v == null ? void 0 : v.length) && I.every((S, U) => S === v[U]) || I.length < ((v == null ? void 0 : v.length) ?? 0) || s(f, [...(e == null ? void 0 : e.parentIds) ?? [], e == null ? void 0 : e.id]);
1254
1254
  },
1255
1255
  onMove: () => (p(null), i("onMove"), !0),
1256
- onStart: (g) => {
1257
- const S = g.item.dataset;
1258
- S != null && S.id && d(S.id), i("onMove");
1256
+ onStart: (f) => {
1257
+ const I = f.item.dataset;
1258
+ I != null && I.id && d(I.id), i("onMove");
1259
1259
  },
1260
1260
  onEnd: () => {
1261
1261
  d(null), p(null), i(null);
1262
1262
  },
1263
1263
  ghostClass: Rt,
1264
- children: h.map((g, S) => /* @__PURE__ */ t(
1264
+ children: b.map((f, I) => /* @__PURE__ */ t(
1265
1265
  We,
1266
1266
  {
1267
- data: g,
1268
- itemIndex: S,
1267
+ data: f,
1268
+ itemIndex: I,
1269
1269
  onClick: n
1270
1270
  },
1271
- g.id
1271
+ f.id
1272
1272
  ))
1273
1273
  }
1274
1274
  )
@@ -1307,19 +1307,19 @@ const At = st({
1307
1307
  sliderProps: n,
1308
1308
  sliderRef: a,
1309
1309
  onItemClick: s
1310
- } = r, i = xe(null), d = xe(null), {
1311
- list: p,
1312
- setList: x,
1313
- setListStatus: l,
1314
- showInfoItemData: c,
1315
- setShowInfoItemData: f,
1316
- openGroupItemData: v,
1317
- setOpenGroupItemData: D,
1318
- setMoveItemId: h,
1319
- setMoveTargetId: g,
1320
- addItem: S
1321
- } = pe(), { pagingDotBuilder: y, pagingDotsBuilder: N, itemBuilder: u } = le(), T = be(() => e === !1 ? {} : {
1322
- top: b`
1310
+ } = r, i = xe(null), d = xe(null), [p, y] = O(0), {
1311
+ list: l,
1312
+ setList: c,
1313
+ setListStatus: g,
1314
+ showInfoItemData: k,
1315
+ setShowInfoItemData: D,
1316
+ openGroupItemData: b,
1317
+ setOpenGroupItemData: f,
1318
+ setMoveItemId: I,
1319
+ setMoveTargetId: v,
1320
+ addItem: N
1321
+ } = pe(), { pagingDotBuilder: u, pagingDotsBuilder: S, itemBuilder: U } = le(), j = be(() => e === !1 ? {} : {
1322
+ top: h`
1323
1323
  display: flex;
1324
1324
  flex-direction: column;
1325
1325
  .slick-list {
@@ -1329,12 +1329,12 @@ const At = st({
1329
1329
  position: static;
1330
1330
  }
1331
1331
  `,
1332
- bottom: b`
1332
+ bottom: h`
1333
1333
  .slick-dots {
1334
1334
  position: static;
1335
1335
  }
1336
1336
  `,
1337
- left: b`
1337
+ left: h`
1338
1338
  .slick-dots {
1339
1339
  position: absolute;
1340
1340
  width: auto;
@@ -1350,7 +1350,7 @@ const At = st({
1350
1350
  }
1351
1351
  }
1352
1352
  `,
1353
- right: b`
1353
+ right: h`
1354
1354
  .slick-dots {
1355
1355
  position: absolute;
1356
1356
  width: auto;
@@ -1368,7 +1368,7 @@ const At = st({
1368
1368
  `
1369
1369
  }[e.position ?? "bottom"], [e]);
1370
1370
  return /* @__PURE__ */ m(ue, { children: [
1371
- /* @__PURE__ */ t(
1371
+ /* @__PURE__ */ m(
1372
1372
  ro,
1373
1373
  {
1374
1374
  useCSS: !0,
@@ -1379,9 +1379,9 @@ const At = st({
1379
1379
  dots: !0,
1380
1380
  touchMove: !1,
1381
1381
  lazyLoad: "anticipated",
1382
- className: k(
1383
- T,
1384
- b`
1382
+ className: C(
1383
+ j,
1384
+ h`
1385
1385
  .slick-track {
1386
1386
  display: flex;
1387
1387
  align-items: stretch;
@@ -1399,14 +1399,14 @@ const At = st({
1399
1399
  `,
1400
1400
  o
1401
1401
  ),
1402
- customPaging: (A) => {
1403
- var I, C;
1404
- if (y) {
1405
- const H = y(p[A], A);
1406
- return eo.cloneElement(H, {
1407
- onDragEnter: (G) => {
1408
- var O;
1409
- (O = (a ?? i).current) == null || O.slickGoTo(A), H.props && H.props.onDragEnter && H.props.onDragEnter(G);
1402
+ customPaging: (x) => {
1403
+ var L, E;
1404
+ if (u) {
1405
+ const A = u(l[x], x, p === x);
1406
+ return eo.cloneElement(A, {
1407
+ onDragEnter: (V) => {
1408
+ var Y;
1409
+ (Y = (a ?? i).current) == null || Y.slickGoTo(x), A.props && A.props.onDragEnter && A.props.onDragEnter(V);
1410
1410
  }
1411
1411
  });
1412
1412
  }
@@ -1414,20 +1414,20 @@ const At = st({
1414
1414
  "div",
1415
1415
  {
1416
1416
  onDragEnter: () => {
1417
- var H;
1418
- (H = (a ?? i).current) == null || H.slickGoTo(A);
1417
+ var A;
1418
+ (A = (a ?? i).current) == null || A.slickGoTo(x);
1419
1419
  },
1420
- children: (C = (I = p[A]) == null ? void 0 : I.data) == null ? void 0 : C.name
1420
+ children: (E = (L = l[x]) == null ? void 0 : L.data) == null ? void 0 : E.name
1421
1421
  }
1422
1422
  );
1423
1423
  },
1424
- appendDots: (A) => N ? N(A) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1424
+ appendDots: (x) => (x instanceof Array && delete x[x.length - 1], S ? S(x) : e === !1 ? /* @__PURE__ */ t("div", {}) : /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
1425
1425
  "ul",
1426
1426
  {
1427
1427
  ref: d,
1428
- className: k(
1428
+ className: C(
1429
1429
  "slick-dots-default",
1430
- b`
1430
+ h`
1431
1431
  padding: 0.5rem;
1432
1432
  display: inline-flex;
1433
1433
  justify-content: center;
@@ -1448,31 +1448,35 @@ const At = st({
1448
1448
  }
1449
1449
  `
1450
1450
  ),
1451
- children: A
1451
+ children: x
1452
1452
  }
1453
- ) }),
1453
+ ) })),
1454
+ beforeChange: (x, L) => {
1455
+ y(L);
1456
+ },
1454
1457
  ...n,
1455
- children: p.map((A) => /* @__PURE__ */ t(
1456
- "div",
1457
- {
1458
- onDrop: (I) => {
1459
- I.preventDefault();
1460
- const C = I.dataTransfer.getData("text/plain");
1461
- if (V.quickJSONCheck(C))
1462
- try {
1463
- S(JSON.parse(C), [A.id]);
1464
- } catch (G) {
1465
- console.log("drag error", G);
1466
- }
1467
- },
1468
- onDragOver: (I) => {
1469
- I.preventDefault();
1470
- },
1471
- children: /* @__PURE__ */ t(
1472
- Xe,
1473
- {
1474
- className: k(
1475
- b`
1458
+ children: [
1459
+ l.map((x) => /* @__PURE__ */ t(
1460
+ "div",
1461
+ {
1462
+ onDrop: (L) => {
1463
+ L.preventDefault();
1464
+ const E = L.dataTransfer.getData("text/plain");
1465
+ if (K.quickJSONCheck(E))
1466
+ try {
1467
+ N(JSON.parse(E), [x.id]);
1468
+ } catch (V) {
1469
+ console.log("drag error", V);
1470
+ }
1471
+ },
1472
+ onDragOver: (L) => {
1473
+ L.preventDefault();
1474
+ },
1475
+ children: /* @__PURE__ */ t(
1476
+ Xe,
1477
+ {
1478
+ className: C(
1479
+ h`
1476
1480
  display: grid;
1477
1481
  transition: all 0.3s;
1478
1482
  grid-template-columns: repeat(auto-fill, 96px);
@@ -1482,81 +1486,83 @@ const At = st({
1482
1486
  justify-content: center;
1483
1487
  align-items: center;
1484
1488
  `
1485
- ),
1486
- animation: 150,
1487
- fallbackOnBody: !0,
1488
- swapThreshold: 0.65,
1489
- group: "nested",
1490
- list: A.children ?? [],
1491
- setList: (I) => x(I, [A.id]),
1492
- filter: ".drag-disabled",
1493
- onMove: (I) => {
1494
- l("onMove");
1495
- const { dragged: C, related: H } = I, G = C.dataset, O = H.dataset;
1496
- return g(null), !((Object.keys(O).length === 0 || O.parentIds) && Number(G.childrenLength) > 0 && H.classList.contains("sortable-group-item"));
1497
- },
1498
- onStart: (I) => {
1499
- const C = I.item.dataset;
1500
- C != null && C.id && h(C.id), l("onMove");
1501
- },
1502
- onEnd: () => {
1503
- h(null), g(null), l(null);
1504
- },
1505
- ghostClass: Rt,
1506
- children: (A.children ?? []).map((I, C) => {
1507
- let H;
1508
- if (u)
1509
- return u(I);
1510
- switch (I.type) {
1511
- case "group":
1512
- case "app":
1513
- H = /* @__PURE__ */ t(
1514
- zn,
1515
- {
1516
- data: I,
1517
- itemIndex: C,
1518
- parentIds: [A.id, I.id],
1519
- onClick: s
1520
- },
1521
- I.id
1522
- );
1523
- break;
1524
- default:
1525
- H = /* @__PURE__ */ t(
1526
- We,
1527
- {
1528
- data: I,
1529
- itemIndex: C,
1530
- onClick: s
1531
- },
1532
- I.id
1533
- );
1534
- break;
1535
- }
1536
- return H;
1537
- })
1538
- }
1539
- )
1540
- },
1541
- A.id
1542
- ))
1489
+ ),
1490
+ animation: 150,
1491
+ fallbackOnBody: !0,
1492
+ swapThreshold: 0.65,
1493
+ group: "nested",
1494
+ list: x.children ?? [],
1495
+ setList: (L) => c(L, [x.id]),
1496
+ filter: ".drag-disabled",
1497
+ onMove: (L) => {
1498
+ g("onMove");
1499
+ const { dragged: E, related: A } = L, V = E.dataset, Y = A.dataset;
1500
+ return v(null), !((Object.keys(Y).length === 0 || Y.parentIds) && Number(V.childrenLength) > 0 && A.classList.contains("sortable-group-item"));
1501
+ },
1502
+ onStart: (L) => {
1503
+ const E = L.item.dataset;
1504
+ E != null && E.id && I(E.id), g("onMove");
1505
+ },
1506
+ onEnd: () => {
1507
+ I(null), v(null), g(null);
1508
+ },
1509
+ ghostClass: Rt,
1510
+ children: (x.children ?? []).map((L, E) => {
1511
+ let A;
1512
+ if (U)
1513
+ return U(L);
1514
+ switch (L.type) {
1515
+ case "group":
1516
+ case "app":
1517
+ A = /* @__PURE__ */ t(
1518
+ zn,
1519
+ {
1520
+ data: L,
1521
+ itemIndex: E,
1522
+ parentIds: [x.id, L.id],
1523
+ onClick: s
1524
+ },
1525
+ L.id
1526
+ );
1527
+ break;
1528
+ default:
1529
+ A = /* @__PURE__ */ t(
1530
+ We,
1531
+ {
1532
+ data: L,
1533
+ itemIndex: E,
1534
+ onClick: s
1535
+ },
1536
+ L.id
1537
+ );
1538
+ break;
1539
+ }
1540
+ return A;
1541
+ })
1542
+ }
1543
+ )
1544
+ },
1545
+ x.id
1546
+ )),
1547
+ /* @__PURE__ */ t("div", {})
1548
+ ]
1543
1549
  }
1544
1550
  ),
1545
1551
  /* @__PURE__ */ t(
1546
1552
  $n,
1547
1553
  {
1548
- data: c,
1554
+ data: k,
1549
1555
  onClose: () => {
1550
- f(null);
1556
+ D(null);
1551
1557
  }
1552
1558
  }
1553
1559
  ),
1554
1560
  /* @__PURE__ */ t(
1555
1561
  En,
1556
1562
  {
1557
- data: v,
1563
+ data: b,
1558
1564
  onClose: () => {
1559
- D(null);
1565
+ f(null);
1560
1566
  },
1561
1567
  onItemClick: s
1562
1568
  }
@@ -1572,11 +1578,11 @@ const At = st({
1572
1578
  theme: i,
1573
1579
  noLetters: d,
1574
1580
  contextMenu: p,
1575
- contextMenuBuilder: x,
1581
+ contextMenuBuilder: y,
1576
1582
  itemBuilder: l,
1577
1583
  itemIconBuilder: c,
1578
- pagingDotBuilder: f,
1579
- pagingDotsBuilder: v,
1584
+ pagingDotBuilder: g,
1585
+ pagingDotsBuilder: k,
1580
1586
  ...D
1581
1587
  } = r;
1582
1588
  return /* @__PURE__ */ t(Dt, { ...{
@@ -1588,17 +1594,17 @@ const At = st({
1588
1594
  theme: i,
1589
1595
  noLetters: d,
1590
1596
  contextMenu: p,
1591
- pagingDotsBuilder: v,
1592
- pagingDotBuilder: f,
1597
+ pagingDotsBuilder: k,
1598
+ pagingDotBuilder: g,
1593
1599
  itemBuilder: l,
1594
1600
  itemIconBuilder: c,
1595
- contextMenuBuilder: x
1601
+ contextMenuBuilder: y
1596
1602
  }, children: [
1597
1603
  /* @__PURE__ */ t(() => {
1598
- const y = pe(), N = le();
1599
- return ae(() => {
1600
- e && (typeof e == "function" ? e({ state: y, config: N }) : e.current = { state: y, config: N });
1601
- }, [y, N]), null;
1604
+ const v = pe(), N = le();
1605
+ return se(() => {
1606
+ e && (typeof e == "function" ? e({ state: v, config: N }) : e.current = { state: v, config: N });
1607
+ }, [v, N]), null;
1602
1608
  }, {}),
1603
1609
  /* @__PURE__ */ t(Pt, { ...D })
1604
1610
  ] }) });
@@ -1726,7 +1732,7 @@ const At = st({
1726
1732
  On
1727
1733
  );
1728
1734
  return typeof a != "string" ? e : o ? a.replace(/{{(.*?)}}/g, (s, i) => o[i]) : a;
1729
- }, _n = b`
1735
+ }, _n = h`
1730
1736
  --accentBase: var(--tomato-1);
1731
1737
  --accentBgSubtle: var(--tomato-2);
1732
1738
  --accentBg: var(--tomato-3);
@@ -1780,7 +1786,7 @@ const At = st({
1780
1786
  rgba(255, 255, 255, 0.05),
1781
1787
  rgba(255, 255, 255, 0.05)
1782
1788
  );
1783
- `, jn = b`
1789
+ `, jn = h`
1784
1790
  [class*="_toolbarRoot"] {
1785
1791
  flex-wrap: wrap;
1786
1792
  transition: all 0.3s;
@@ -1850,9 +1856,9 @@ const At = st({
1850
1856
  margin-bottom: 0;
1851
1857
  }
1852
1858
  }
1853
- `, Bt = k(
1859
+ `, Bt = C(
1854
1860
  "markdown-body",
1855
- b`
1861
+ h`
1856
1862
  p {
1857
1863
  margin-bottom: 8px;
1858
1864
  }
@@ -1873,7 +1879,7 @@ const At = st({
1873
1879
  }
1874
1880
  }
1875
1881
  `
1876
- ), zt = b`
1882
+ ), zt = h`
1877
1883
  .markdown-body {
1878
1884
  /* light */
1879
1885
  color-scheme: light;
@@ -1928,7 +1934,7 @@ const At = st({
1928
1934
  --color-prettylights-syntax-meta-diff-range: #8250df;
1929
1935
  --color-prettylights-syntax-sublimelinter-gutter-mark: #818b98;
1930
1936
  }
1931
- `, Et = b`
1937
+ `, Et = h`
1932
1938
  .markdown-body {
1933
1939
  /* dark */
1934
1940
  color-scheme: dark;
@@ -1996,13 +2002,13 @@ const At = st({
1996
2002
  theme: i = "auto",
1997
2003
  ...d
1998
2004
  } = r, p = xe(null), {
1999
- image: x,
2005
+ image: y,
2000
2006
  diffSource: l = {
2001
2007
  viewMode: "rich-text"
2002
2008
  },
2003
2009
  headings: c,
2004
- link: f,
2005
- codeBlock: v,
2010
+ link: g,
2011
+ codeBlock: k,
2006
2012
  codeMirror: D = {
2007
2013
  codeBlockLanguages: {
2008
2014
  js: "JavaScript",
@@ -2012,27 +2018,27 @@ const At = st({
2012
2018
  "": "Unspecified"
2013
2019
  }
2014
2020
  },
2015
- directives: h = {
2021
+ directives: b = {
2016
2022
  directiveDescriptors: [Lo]
2017
2023
  }
2018
- } = a ?? {}, [g, S] = j("");
2019
- return ae(() => {
2020
- var y;
2021
- e !== void 0 && p.current && ((y = p.current) == null || y.setMarkdown(e), S(e));
2024
+ } = a ?? {}, [f, I] = O("");
2025
+ return se(() => {
2026
+ var v;
2027
+ e !== void 0 && p.current && ((v = p.current) == null || v.setMarkdown(e), I(e));
2022
2028
  }, [e, p]), /* @__PURE__ */ t(
2023
2029
  Ao,
2024
2030
  {
2025
2031
  ref: p,
2026
- className: k(
2032
+ className: C(
2027
2033
  jn,
2028
2034
  _e(i) ? _n : "",
2029
2035
  _e(i) ? Et : zt,
2030
2036
  s
2031
2037
  ),
2032
2038
  contentEditableClassName: Bt,
2033
- markdown: g,
2034
- onChange: (y) => {
2035
- !e && !o && S(y), o && o(y);
2039
+ markdown: f,
2040
+ onChange: (v) => {
2041
+ !e && !o && I(v), o && o(v);
2036
2042
  },
2037
2043
  translation: n ?? Fn,
2038
2044
  plugins: [
@@ -2062,16 +2068,16 @@ const At = st({
2062
2068
  Po(),
2063
2069
  Bo(),
2064
2070
  zo(c),
2065
- Eo(f),
2071
+ Eo(g),
2066
2072
  $o(),
2067
- Ho(x),
2073
+ Ho(y),
2068
2074
  Oo(),
2069
2075
  Fo(),
2070
2076
  _o(),
2071
- jo(v),
2077
+ jo(k),
2072
2078
  Xo(D),
2073
2079
  Uo(),
2074
- Go(h)
2080
+ Go(b)
2075
2081
  ],
2076
2082
  ...d
2077
2083
  }
@@ -2085,12 +2091,12 @@ const At = st({
2085
2091
  children: /* @__PURE__ */ t(
2086
2092
  wt,
2087
2093
  {
2088
- className: k(Bt, o),
2094
+ className: C(Bt, o),
2089
2095
  remarkPlugins: [nr, ar],
2090
2096
  rehypePlugins: [sr],
2091
2097
  components: {
2092
2098
  code(s) {
2093
- const { children: i, className: d, node: p, ref: x, ...l } = s, c = /language-(\w+)/.exec(d || "");
2099
+ const { children: i, className: d, node: p, ref: y, ...l } = s, c = /language-(\w+)/.exec(d || "");
2094
2100
  return c ? /* @__PURE__ */ t(
2095
2101
  ir,
2096
2102
  {
@@ -2124,7 +2130,7 @@ const At = st({
2124
2130
  mask: " ",
2125
2131
  ...i
2126
2132
  },
2127
- className: b`
2133
+ className: h`
2128
2134
  cursor: zoom-in;
2129
2135
  `,
2130
2136
  ...d
@@ -2152,50 +2158,50 @@ const Ke = (r) => {
2152
2158
  as: i = R.div,
2153
2159
  componentClassName: d = "rounded-full bg-gray-200 dark:bg-neutral-800",
2154
2160
  titleClassName: p = "rounded-md bg-gray-100 border dark:bg-neutral-800 dark:border-neutral-900 dark:text-white border-gray-200 text-neutral-700",
2155
- childrenClassName: x,
2161
+ childrenClassName: y,
2156
2162
  ...l
2157
- } = r, c = xe(null), f = ge(e, (H) => {
2158
- var O;
2159
- const G = ((O = c.current) == null ? void 0 : O.getBoundingClientRect()) ?? { x: 0, width: 0 };
2160
- return H - G.x - G.width / 2;
2161
- }), v = ge(f, [-150, 0, 150], [40, 80, 40]), D = ge(f, [-150, 0, 150], [40, 80, 40]), h = ge(
2162
- f,
2163
+ } = r, c = xe(null), g = ge(e, (L) => {
2164
+ var A;
2165
+ const E = ((A = c.current) == null ? void 0 : A.getBoundingClientRect()) ?? { x: 0, width: 0 };
2166
+ return L - E.x - E.width / 2;
2167
+ }), k = ge(g, [-150, 0, 150], [40, 80, 40]), D = ge(g, [-150, 0, 150], [40, 80, 40]), b = ge(
2168
+ g,
2163
2169
  [-150, 0, 150],
2164
2170
  [20, 40, 20]
2165
- ), g = ge(
2166
- f,
2171
+ ), f = ge(
2172
+ g,
2167
2173
  [-150, 0, 150],
2168
2174
  [20, 40, 20]
2169
- ), S = Ae(v, {
2175
+ ), I = Ae(k, {
2170
2176
  mass: 0.1,
2171
2177
  stiffness: 150,
2172
2178
  damping: 12
2173
- }), y = Ae(D, {
2179
+ }), v = Ae(D, {
2174
2180
  mass: 0.1,
2175
2181
  stiffness: 150,
2176
2182
  damping: 12
2177
- }), N = Ae(h, {
2183
+ }), N = Ae(b, {
2178
2184
  mass: 0.1,
2179
2185
  stiffness: 150,
2180
2186
  damping: 12
2181
- }), u = Ae(g, {
2187
+ }), u = Ae(f, {
2182
2188
  mass: 0.1,
2183
2189
  stiffness: 150,
2184
2190
  damping: 12
2185
- }), T = ge(N, (H) => `${H}px`), [A, I] = j(!1), C = /* @__PURE__ */ m(
2191
+ }), S = ge(N, (L) => `${L}px`), [U, j] = O(!1), x = /* @__PURE__ */ m(
2186
2192
  i,
2187
2193
  {
2188
2194
  ref: c,
2189
- style: { width: S, height: y },
2190
- onMouseEnter: () => I(!0),
2191
- onMouseLeave: () => I(!1),
2195
+ style: { width: I, height: v },
2196
+ onMouseEnter: () => j(!0),
2197
+ onMouseLeave: () => j(!1),
2192
2198
  className: ve(
2193
2199
  "aspect-square flex items-center justify-center relative",
2194
2200
  d
2195
2201
  ),
2196
2202
  ...l,
2197
2203
  children: [
2198
- o && /* @__PURE__ */ t(Ue, { children: A && /* @__PURE__ */ t(
2204
+ o && /* @__PURE__ */ t(Ue, { children: U && /* @__PURE__ */ t(
2199
2205
  R.div,
2200
2206
  {
2201
2207
  initial: { opacity: 0, y: 10, x: "-50%" },
@@ -2208,23 +2214,22 @@ const Ke = (r) => {
2208
2214
  children: o
2209
2215
  }
2210
2216
  ) }),
2211
- " ",
2212
2217
  /* @__PURE__ */ t(
2213
2218
  R.div,
2214
2219
  {
2215
2220
  style: {
2216
2221
  width: N,
2217
2222
  height: u,
2218
- fontSize: T
2223
+ fontSize: S
2219
2224
  },
2220
- className: ve("flex items-center justify-center", x),
2221
- children: typeof s == "function" ? s({ widthIcon: N, heightIcon: u, fontSizeTransform: T }) : s || n
2225
+ className: ve("flex items-center justify-center", y),
2226
+ children: typeof s == "function" ? s({ widthIcon: N, heightIcon: u, fontSizeTransform: S }) : s || n
2222
2227
  }
2223
2228
  )
2224
2229
  ]
2225
2230
  }
2226
2231
  );
2227
- return a ? /* @__PURE__ */ t("a", { href: a, children: C }) : C;
2232
+ return a ? /* @__PURE__ */ t("a", { href: a, children: x }) : x;
2228
2233
  }, Je = (r) => {
2229
2234
  const {
2230
2235
  items: e = [],
@@ -2237,14 +2242,14 @@ const Ke = (r) => {
2237
2242
  return /* @__PURE__ */ t(
2238
2243
  i,
2239
2244
  {
2240
- onMouseMove: (x) => p.set(x.pageX),
2245
+ onMouseMove: (y) => p.set(y.pageX),
2241
2246
  onMouseLeave: () => p.set(1 / 0),
2242
2247
  className: ve(
2243
2248
  "mx-auto hidden md:flex h-16 gap-4 items-end px-4 pb-3",
2244
2249
  o
2245
2250
  ),
2246
2251
  children: a || e.map(
2247
- (x) => n ? n(x, p) : /* @__PURE__ */ t(Ke, { mouseX: p, ...x }, x.title)
2252
+ (y) => n ? n(y, p) : /* @__PURE__ */ t(Ke, { mouseX: p, ...y }, y.title)
2248
2253
  )
2249
2254
  }
2250
2255
  );
@@ -2286,7 +2291,7 @@ const Ke = (r) => {
2286
2291
  autoHidden: a = !1,
2287
2292
  itemBuilder: s,
2288
2293
  children: i
2289
- } = r, [d, p] = j(!1), x = () => {
2294
+ } = r, [d, p] = O(!1), y = () => {
2290
2295
  p(!d);
2291
2296
  };
2292
2297
  return /* @__PURE__ */ m(
@@ -2324,7 +2329,7 @@ const Ke = (r) => {
2324
2329
  /* @__PURE__ */ t(
2325
2330
  "button",
2326
2331
  {
2327
- onClick: x,
2332
+ onClick: y,
2328
2333
  className: "h-10 w-10 rounded-full bg-gray-50 dark:bg-neutral-800 flex items-center justify-center",
2329
2334
  children: n || /* @__PURE__ */ t(vo, { className: "h-5 w-5 text-neutral-500 dark:text-neutral-400" })
2330
2335
  }
@@ -2342,7 +2347,7 @@ const Ke = (r) => {
2342
2347
  desktopChildren: i,
2343
2348
  mobileChildren: d,
2344
2349
  desktopMouseX: p,
2345
- ...x
2350
+ ...y
2346
2351
  } = r;
2347
2352
  return /* @__PURE__ */ m(ue, { children: [
2348
2353
  /* @__PURE__ */ t(
@@ -2353,7 +2358,7 @@ const Ke = (r) => {
2353
2358
  itemBuilder: a,
2354
2359
  children: i,
2355
2360
  mouseX: p,
2356
- ...x
2361
+ ...y
2357
2362
  }
2358
2363
  ),
2359
2364
  /* @__PURE__ */ t(
@@ -2364,7 +2369,7 @@ const Ke = (r) => {
2364
2369
  itemBuilder: s,
2365
2370
  children: d,
2366
2371
  autoHidden: !0,
2367
- ...x
2372
+ ...y
2368
2373
  }
2369
2374
  )
2370
2375
  ] });
@@ -2444,43 +2449,43 @@ function Wn(r) {
2444
2449
  let e = "", o = !1;
2445
2450
  function n(l, c) {
2446
2451
  if (c.focus(), !l.dataTransfer) return;
2447
- const f = ot(
2452
+ const g = ot(
2448
2453
  {
2449
2454
  x: l.clientX + 50 + r.dragHandleWidth,
2450
2455
  y: l.clientY
2451
2456
  },
2452
2457
  r
2453
2458
  );
2454
- if (!(f instanceof Element)) return;
2455
- let v = rt(f, c, r);
2456
- if (v == null || v < 0) return;
2457
- v = Re(v, c);
2458
- const { from: D, to: h } = c.state.selection, g = D - h, S = Re(D, c);
2459
- let y = !1;
2460
- const N = c.state.doc.resolve(S);
2461
- if (N.node().type.name === "doc") y = !0;
2459
+ if (!(g instanceof Element)) return;
2460
+ let k = rt(g, c, r);
2461
+ if (k == null || k < 0) return;
2462
+ k = Re(k, c);
2463
+ const { from: D, to: b } = c.state.selection, f = D - b, I = Re(D, c);
2464
+ let v = !1;
2465
+ const N = c.state.doc.resolve(I);
2466
+ if (N.node().type.name === "doc") v = !0;
2462
2467
  else {
2463
- const C = J.create(
2468
+ const x = Q.create(
2464
2469
  c.state.doc,
2465
2470
  N.before()
2466
2471
  );
2467
- y = !(v + 1 >= C.$from.pos && v <= C.$to.pos);
2472
+ v = !(k + 1 >= x.$from.pos && k <= x.$to.pos);
2468
2473
  }
2469
2474
  let u = c.state.selection;
2470
- if (!y && g !== 0 && !(c.state.selection instanceof J)) {
2471
- const C = J.create(c.state.doc, h - 1);
2475
+ if (!v && f !== 0 && !(c.state.selection instanceof Q)) {
2476
+ const x = Q.create(c.state.doc, b - 1);
2472
2477
  u = tn.create(
2473
2478
  c.state.doc,
2474
- v,
2475
- C.$to.pos
2479
+ k,
2480
+ x.$to.pos
2476
2481
  );
2477
- } else if (u = J.create(c.state.doc, v), u.node.type.isInline || u.node.type.name === "tableRow") {
2478
- const C = c.state.doc.resolve(u.from);
2479
- u = J.create(c.state.doc, C.before());
2482
+ } else if (u = Q.create(c.state.doc, k), u.node.type.isInline || u.node.type.name === "tableRow") {
2483
+ const x = c.state.doc.resolve(u.from);
2484
+ u = Q.create(c.state.doc, x.before());
2480
2485
  }
2481
- c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof J && c.state.selection.node.type.name === "listItem" && (e = f.parentElement.tagName);
2482
- const T = c.state.selection.content(), { dom: A, text: I } = Yn(c, T);
2483
- l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", A.innerHTML), l.dataTransfer.setData("text/plain", I), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(f, 0, 0), c.dragging = { slice: T, move: l.ctrlKey };
2486
+ c.dispatch(c.state.tr.setSelection(u)), c.state.selection instanceof Q && c.state.selection.node.type.name === "listItem" && (e = g.parentElement.tagName);
2487
+ const S = c.state.selection.content(), { dom: U, text: j } = Yn(c, S);
2488
+ l.dataTransfer.clearData(), l.dataTransfer.setData("text/html", U.innerHTML), l.dataTransfer.setData("text/plain", j), l.dataTransfer.effectAllowed = "copyMove", l.dataTransfer.setDragImage(g, 0, 0), c.dragging = { slice: S, move: l.ctrlKey };
2484
2489
  }
2485
2490
  let a = null;
2486
2491
  function s() {
@@ -2490,64 +2495,64 @@ function Wn(r) {
2490
2495
  a && a.classList.remove("hide");
2491
2496
  }
2492
2497
  function d(l, c) {
2493
- const f = Re(c, l), v = J.create(l.state.doc, f);
2494
- l.dispatch(l.state.tr.setSelection(v)), l.focus(), o = !0;
2498
+ const g = Re(c, l), k = Q.create(l.state.doc, g);
2499
+ l.dispatch(l.state.tr.setSelection(k)), l.focus(), o = !0;
2495
2500
  }
2496
2501
  function p(l) {
2497
- if (o = l.state.selection instanceof J, o && (a != null && a.dataset.nodePos)) {
2498
- const f = parseInt(a.dataset.nodePos, 10);
2502
+ if (o = l.state.selection instanceof Q, o && (a != null && a.dataset.nodePos)) {
2503
+ const g = parseInt(a.dataset.nodePos, 10);
2499
2504
  try {
2500
- const v = l.state.doc.resolve(f);
2501
- v && v.parent && v.parent.type.name !== "doc" || (o = !1, s());
2505
+ const k = l.state.doc.resolve(g);
2506
+ k && k.parent && k.parent.type.name !== "doc" || (o = !1, s());
2502
2507
  } catch {
2503
2508
  o = !1, s();
2504
2509
  }
2505
2510
  }
2506
2511
  o && a && !a.classList.contains("hide") ? i() : o || s();
2507
2512
  }
2508
- function x(l) {
2513
+ function y(l) {
2509
2514
  if (!(l.target instanceof Element)) return;
2510
2515
  const c = l.relatedTarget;
2511
2516
  if (!c) {
2512
2517
  o || s();
2513
2518
  return;
2514
2519
  }
2515
- const f = c.closest(".drag-handle") || c.classList.contains("drag-handle"), v = c.closest(".tiptap") || c.classList.contains("tiptap");
2516
- !f && !v && !o && s();
2520
+ const g = c.closest(".drag-handle") || c.classList.contains("drag-handle"), k = c.closest(".tiptap") || c.classList.contains("tiptap");
2521
+ !g && !k && !o && s();
2517
2522
  }
2518
2523
  return new Qr({
2519
2524
  key: new en(r.pluginKey),
2520
2525
  view: (l) => {
2521
- var h, g, S, y;
2526
+ var b, f, I, v;
2522
2527
  const c = r.dragHandleSelector ? document.querySelector(r.dragHandleSelector) : null;
2523
2528
  a = c ?? document.createElement("div"), a.draggable = !0, a.dataset.dragHandle = "", a.classList.add("drag-handle");
2524
- function f(N) {
2529
+ function g(N) {
2525
2530
  n(N, l);
2526
2531
  }
2527
- a.addEventListener("dragstart", f);
2528
- function v(N) {
2532
+ a.addEventListener("dragstart", g);
2533
+ function k(N) {
2529
2534
  c || (N.preventDefault(), N.stopPropagation());
2530
2535
  const u = a == null ? void 0 : a.dataset.nodePos;
2531
2536
  u && d(l, parseInt(u, 10));
2532
2537
  }
2533
- a.addEventListener("click", v);
2538
+ a.addEventListener("click", k);
2534
2539
  function D(N) {
2535
2540
  s();
2536
2541
  const u = window.scrollY;
2537
2542
  N.clientY < r.scrollTreshold ? window.scrollTo({ top: u - 30, behavior: "smooth" }) : window.innerHeight - N.clientY < r.scrollTreshold && window.scrollTo({ top: u + 30, behavior: "smooth" });
2538
2543
  }
2539
- return a.addEventListener("drag", D), s(), c || (g = (h = l == null ? void 0 : l.dom) == null ? void 0 : h.parentElement) == null || g.appendChild(a), (y = (S = l == null ? void 0 : l.dom) == null ? void 0 : S.parentElement) == null || y.addEventListener(
2544
+ return a.addEventListener("drag", D), s(), c || (f = (b = l == null ? void 0 : l.dom) == null ? void 0 : b.parentElement) == null || f.appendChild(a), (v = (I = l == null ? void 0 : l.dom) == null ? void 0 : I.parentElement) == null || v.addEventListener(
2540
2545
  "mouseout",
2541
- x
2546
+ y
2542
2547
  ), {
2543
2548
  destroy: () => {
2544
- var N, u, T;
2549
+ var N, u, S;
2545
2550
  c || (N = a == null ? void 0 : a.remove) == null || N.call(a), a == null || a.removeEventListener("drag", D), a == null || a.removeEventListener(
2546
2551
  "dragstart",
2547
- f
2548
- ), a == null || a.removeEventListener("click", v), a = null, (T = (u = l == null ? void 0 : l.dom) == null ? void 0 : u.parentElement) == null || T.removeEventListener(
2552
+ g
2553
+ ), a == null || a.removeEventListener("click", k), a = null, (S = (u = l == null ? void 0 : l.dom) == null ? void 0 : u.parentElement) == null || S.removeEventListener(
2549
2554
  "mouseout",
2550
- x
2555
+ y
2551
2556
  );
2552
2557
  }
2553
2558
  };
@@ -2557,23 +2562,23 @@ function Wn(r) {
2557
2562
  mousemove: (l, c) => {
2558
2563
  if (!l.editable)
2559
2564
  return;
2560
- const f = ot(
2565
+ const g = ot(
2561
2566
  {
2562
2567
  x: c.clientX + 50 + r.dragHandleWidth,
2563
2568
  y: c.clientY
2564
2569
  },
2565
2570
  r
2566
- ), v = f == null ? void 0 : f.closest(".not-draggable"), D = r.excludedTags.concat(["ol", "ul"]).join(", ");
2567
- if (!(f instanceof Element) || f.matches(D) || v) {
2571
+ ), k = g == null ? void 0 : g.closest(".not-draggable"), D = r.excludedTags.concat(["ol", "ul"]).join(", ");
2572
+ if (!(g instanceof Element) || g.matches(D) || k) {
2568
2573
  o || s();
2569
2574
  return;
2570
2575
  }
2571
- const h = rt(f, l, r);
2572
- h != null && h >= 0 && (a.dataset.nodePos = String(
2573
- Re(h, l)
2576
+ const b = rt(g, l, r);
2577
+ b != null && b >= 0 && (a.dataset.nodePos = String(
2578
+ Re(b, l)
2574
2579
  ));
2575
- const g = window.getComputedStyle(f), S = parseInt(g.lineHeight, 10), y = isNaN(S) ? parseInt(g.fontSize) * 1.2 : S, N = parseInt(g.paddingTop, 10), u = Vn(f);
2576
- u.top += (y - 24) / 2, u.top += N, f.matches("ul:not([data-type=taskList]) li, ol li") && (u.left -= r.dragHandleWidth - 28), u.width = r.dragHandleWidth, a && (a.style.position = "absolute", a.style.left = `${u.left - u.width}px`, a.style.top = `${u.top}px`, i());
2580
+ const f = window.getComputedStyle(g), I = parseInt(f.lineHeight, 10), v = isNaN(I) ? parseInt(f.fontSize) * 1.2 : I, N = parseInt(f.paddingTop, 10), u = Vn(g);
2581
+ u.top += (v - 24) / 2, u.top += N, g.matches("ul:not([data-type=taskList]) li, ol li") && (u.left -= r.dragHandleWidth - 28), u.width = r.dragHandleWidth, a && (a.style.position = "absolute", a.style.left = `${u.left - u.width}px`, a.style.top = `${u.top}px`, i());
2577
2582
  },
2578
2583
  keydown: () => {
2579
2584
  o || s();
@@ -2590,21 +2595,21 @@ function Wn(r) {
2590
2595
  l.dom.classList.add("dragging");
2591
2596
  },
2592
2597
  drop: (l, c) => {
2593
- var g;
2598
+ var f;
2594
2599
  l.dom.classList.remove("dragging"), s();
2595
- let f = null;
2596
- const v = l.posAtCoords({
2600
+ let g = null;
2601
+ const k = l.posAtCoords({
2597
2602
  left: c.clientX,
2598
2603
  top: c.clientY
2599
2604
  });
2600
- if (!v || (l.state.selection instanceof J && (f = l.state.selection.node), !f)) return;
2601
- const h = l.state.doc.resolve(v.pos).parent.type.name === "listItem";
2602
- if (l.state.selection instanceof J && l.state.selection.node.type.name === "listItem" && !h && e == "OL") {
2603
- const S = (g = l.state.schema.nodes.orderedList) == null ? void 0 : g.createAndFill(
2605
+ if (!k || (l.state.selection instanceof Q && (g = l.state.selection.node), !g)) return;
2606
+ const b = l.state.doc.resolve(k.pos).parent.type.name === "listItem";
2607
+ if (l.state.selection instanceof Q && l.state.selection.node.type.name === "listItem" && !b && e == "OL") {
2608
+ const I = (f = l.state.schema.nodes.orderedList) == null ? void 0 : f.createAndFill(
2604
2609
  null,
2605
- f
2606
- ), y = new on(rn.from(S), 0, 0);
2607
- l.dragging = { slice: y, move: c.ctrlKey };
2610
+ g
2611
+ ), v = new on(rn.from(I), 0, 0);
2612
+ l.dragging = { slice: v, move: c.ctrlKey };
2608
2613
  }
2609
2614
  },
2610
2615
  dragend: (l) => {
@@ -2617,12 +2622,12 @@ function Wn(r) {
2617
2622
  init() {
2618
2623
  return {};
2619
2624
  },
2620
- apply(l, c, f, v) {
2625
+ apply(l, c, g, k) {
2621
2626
  if (l.docChanged && a && a.dataset.nodePos) {
2622
2627
  const D = parseInt(a.dataset.nodePos, 10);
2623
2628
  try {
2624
- const h = v.doc.resolve(D);
2625
- (!h || h.parent.type.name === "doc") && (o = !1, s());
2629
+ const b = k.doc.resolve(D);
2630
+ (!b || b.parent.type.name === "doc") && (o = !1, s());
2626
2631
  } catch {
2627
2632
  o = !1, s();
2628
2633
  }
@@ -2658,7 +2663,7 @@ const Kn = Zr.create({
2658
2663
  placeholder: "撰写任何内容,或者按“/”输入命令..."
2659
2664
  }), Qn = pr.configure({
2660
2665
  HTMLAttributes: {
2661
- class: Y(
2666
+ class: W(
2662
2667
  "text-muted-foreground underline underline-offset-[3px] hover:text-primary transition-colors cursor-pointer"
2663
2668
  )
2664
2669
  }
@@ -2666,63 +2671,63 @@ const Kn = Zr.create({
2666
2671
  addProseMirrorPlugins() {
2667
2672
  return [
2668
2673
  fr({
2669
- imageClass: Y("opacity-40 rounded-lg border border-stone-200")
2674
+ imageClass: W("opacity-40 rounded-lg border border-stone-200")
2670
2675
  })
2671
2676
  ];
2672
2677
  }
2673
2678
  }).configure({
2674
2679
  allowBase64: !0,
2675
2680
  HTMLAttributes: {
2676
- class: Y("rounded-lg border border-muted")
2681
+ class: W("rounded-lg border border-muted")
2677
2682
  }
2678
2683
  }), ta = hr.configure({
2679
2684
  HTMLAttributes: {
2680
- class: Y("rounded-lg border border-muted")
2685
+ class: W("rounded-lg border border-muted")
2681
2686
  }
2682
2687
  }), oa = br.configure({
2683
2688
  HTMLAttributes: {
2684
- class: Y("not-prose pl-2 ")
2689
+ class: W("not-prose pl-2 ")
2685
2690
  }
2686
2691
  }), ra = xr.configure({
2687
2692
  HTMLAttributes: {
2688
- class: Y("flex gap-2 items-start my-4")
2693
+ class: W("flex gap-2 items-start my-4")
2689
2694
  },
2690
2695
  nested: !0
2691
2696
  }), na = yr.configure({
2692
2697
  HTMLAttributes: {
2693
- class: Y("mt-4 mb-6 border-t border-muted-foreground")
2698
+ class: W("mt-4 mb-6 border-t border-muted-foreground")
2694
2699
  }
2695
2700
  }), aa = vr.configure({
2696
2701
  bulletList: {
2697
2702
  HTMLAttributes: {
2698
- class: Y("list-disc list-outside leading-3 -mt-2")
2703
+ class: W("list-disc list-outside leading-3 -mt-2")
2699
2704
  }
2700
2705
  },
2701
2706
  orderedList: {
2702
2707
  HTMLAttributes: {
2703
- class: Y("list-decimal list-outside leading-3 -mt-2")
2708
+ class: W("list-decimal list-outside leading-3 -mt-2")
2704
2709
  }
2705
2710
  },
2706
2711
  listItem: {
2707
2712
  HTMLAttributes: {
2708
- class: Y("leading-normal -mb-2")
2713
+ class: W("leading-normal -mb-2")
2709
2714
  }
2710
2715
  },
2711
2716
  blockquote: {
2712
2717
  HTMLAttributes: {
2713
- class: Y("border-l-4 border-primary")
2718
+ class: W("border-l-4 border-primary")
2714
2719
  }
2715
2720
  },
2716
2721
  codeBlock: {
2717
2722
  HTMLAttributes: {
2718
- class: Y(
2723
+ class: W(
2719
2724
  "rounded-md bg-muted text-muted-foreground border p-5 font-mono font-medium"
2720
2725
  )
2721
2726
  }
2722
2727
  },
2723
2728
  code: {
2724
2729
  HTMLAttributes: {
2725
- class: Y("rounded-md bg-muted px-1.5 py-1 font-mono font-medium"),
2730
+ class: W("rounded-md bg-muted px-1.5 py-1 font-mono font-medium"),
2726
2731
  spellcheck: "false"
2727
2732
  }
2728
2733
  },
@@ -2738,7 +2743,7 @@ const Kn = Zr.create({
2738
2743
  lowlight: Kr(Jr)
2739
2744
  }), ia = Cr.configure({
2740
2745
  HTMLAttributes: {
2741
- class: Y("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
2746
+ class: W("text-foreground rounded p-1 hover:bg-accent cursor-pointer")
2742
2747
  },
2743
2748
  katexOptions: {
2744
2749
  throwOnError: !1
@@ -2781,7 +2786,7 @@ const Kn = Zr.create({
2781
2786
  ref: a,
2782
2787
  align: e,
2783
2788
  sideOffset: o,
2784
- className: k(
2789
+ className: C(
2785
2790
  "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
2786
2791
  r
2787
2792
  ),
@@ -2813,17 +2818,17 @@ const ua = Wr(
2813
2818
  size: "default"
2814
2819
  }
2815
2820
  }
2816
- ), Z = q.forwardRef(
2821
+ ), ee = q.forwardRef(
2817
2822
  ({ className: r, variant: e, size: o, asChild: n = !1, ...a }, s) => /* @__PURE__ */ t(
2818
2823
  n ? sn : "button",
2819
2824
  {
2820
- className: k(ua({ variant: e, size: o, className: r })),
2825
+ className: C(ua({ variant: e, size: o, className: r })),
2821
2826
  ref: s,
2822
2827
  ...a
2823
2828
  }
2824
2829
  )
2825
2830
  );
2826
- Z.displayName = "Button";
2831
+ ee.displayName = "Button";
2827
2832
  const nt = [
2828
2833
  {
2829
2834
  name: "默认",
@@ -2920,7 +2925,7 @@ const nt = [
2920
2925
  dt,
2921
2926
  {
2922
2927
  classNames: {
2923
- root: b`
2928
+ root: h`
2924
2929
  background-color: transparent;
2925
2930
  padding: 0;
2926
2931
  .rc-tooltip-content {
@@ -2933,7 +2938,7 @@ const nt = [
2933
2938
  ...r
2934
2939
  }
2935
2940
  ), pa = ({ open: r, onOpenChange: e }) => {
2936
- const { editor: o } = Q();
2941
+ const { editor: o } = te();
2937
2942
  if (!o) return null;
2938
2943
  const n = nt.find(
2939
2944
  ({ color: s }) => o.isActive("textStyle", { color: s })
@@ -2941,7 +2946,7 @@ const nt = [
2941
2946
  ({ color: s }) => o.isActive("highlight", { color: s })
2942
2947
  );
2943
2948
  return /* @__PURE__ */ m(ma, { modal: !0, open: r, onOpenChange: e, children: [
2944
- /* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Ft, { asChild: !0, children: /* @__PURE__ */ m(Z, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
2949
+ /* @__PURE__ */ t(me, { overlay: "文本颜色", placement: "top", children: /* @__PURE__ */ t(Ft, { asChild: !0, children: /* @__PURE__ */ m(ee, { size: "sm", className: "gap-1 rounded-md pr-0", variant: "ghost", children: [
2945
2950
  /* @__PURE__ */ t(
2946
2951
  "span",
2947
2952
  {
@@ -3038,13 +3043,13 @@ function fa(r) {
3038
3043
  }
3039
3044
  }
3040
3045
  const ha = ({ open: r, onOpenChange: e }) => {
3041
- const o = xe(null), { editor: n } = Q();
3042
- return ae(() => {
3046
+ const o = xe(null), { editor: n } = te();
3047
+ return se(() => {
3043
3048
  var a;
3044
3049
  (a = o.current) == null || a.focus();
3045
3050
  }), n ? /* @__PURE__ */ m(It, { modal: !0, open: r, onOpenChange: e, children: [
3046
3051
  /* @__PURE__ */ t(me, { overlay: "添加链接", placement: "top", children: /* @__PURE__ */ t(an, { asChild: !0, children: /* @__PURE__ */ m(
3047
- Z,
3052
+ ee,
3048
3053
  {
3049
3054
  size: "sm",
3050
3055
  variant: "ghost",
@@ -3054,7 +3059,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
3054
3059
  /* @__PURE__ */ t(
3055
3060
  "p",
3056
3061
  {
3057
- className: k(
3062
+ className: C(
3058
3063
  "underline decoration-stone-400 underline-offset-4",
3059
3064
  {
3060
3065
  "text-blue-500": n.isActive("link")
@@ -3088,7 +3093,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
3088
3093
  }
3089
3094
  ),
3090
3095
  n.getAttributes("link").href ? /* @__PURE__ */ t(
3091
- Z,
3096
+ ee,
3092
3097
  {
3093
3098
  size: "icon",
3094
3099
  variant: "outline",
@@ -3099,15 +3104,15 @@ const ha = ({ open: r, onOpenChange: e }) => {
3099
3104
  },
3100
3105
  children: /* @__PURE__ */ t(ut, { className: "h-4 w-4" })
3101
3106
  }
3102
- ) : /* @__PURE__ */ t(Z, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ke, { className: "h-4 w-4" }) })
3107
+ ) : /* @__PURE__ */ t(ee, { size: "icon", className: "h-8", children: /* @__PURE__ */ t(ke, { className: "h-4 w-4" }) })
3103
3108
  ]
3104
3109
  }
3105
3110
  ) })
3106
3111
  ] }) : null;
3107
3112
  }, ba = () => {
3108
- const { editor: r } = Q();
3113
+ const { editor: r } = te();
3109
3114
  return r ? /* @__PURE__ */ t(me, { overlay: "标记为公式", placement: "top", children: /* @__PURE__ */ t(
3110
- Z,
3115
+ ee,
3111
3116
  {
3112
3117
  variant: "ghost",
3113
3118
  size: "sm",
@@ -3124,7 +3129,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
3124
3129
  children: /* @__PURE__ */ t(
3125
3130
  ln,
3126
3131
  {
3127
- className: k("size-4", { "text-blue-500": r.isActive("math") }),
3132
+ className: C("size-4", { "text-blue-500": r.isActive("math") }),
3128
3133
  strokeWidth: 2.3
3129
3134
  }
3130
3135
  )
@@ -3195,7 +3200,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
3195
3200
  isActive: (r) => r.isActive("codeBlock")
3196
3201
  }
3197
3202
  ], xa = ({ open: r, onOpenChange: e }) => {
3198
- const { editor: o } = Q();
3203
+ const { editor: o } = te();
3199
3204
  if (!o) return null;
3200
3205
  const n = je.filter(
3201
3206
  (a) => a.isActive(o)
@@ -3209,7 +3214,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
3209
3214
  {
3210
3215
  asChild: !0,
3211
3216
  className: "rounded-md border-none hover:bg-accent focus:ring-0 pr-0",
3212
- children: /* @__PURE__ */ m(Z, { size: "sm", variant: "ghost", children: [
3217
+ children: /* @__PURE__ */ m(ee, { size: "sm", variant: "ghost", children: [
3213
3218
  /* @__PURE__ */ t("span", { className: "whitespace-nowrap text-sm", children: n.name }),
3214
3219
  /* @__PURE__ */ t(mt, {})
3215
3220
  ] })
@@ -3244,7 +3249,7 @@ const ha = ({ open: r, onOpenChange: e }) => {
3244
3249
  ref: a,
3245
3250
  decorative: o,
3246
3251
  orientation: e,
3247
- className: k(
3252
+ className: C(
3248
3253
  "shrink-0 bg-border",
3249
3254
  e === "horizontal" ? "h-[1px] w-full" : " w-[1px]",
3250
3255
  r
@@ -3262,7 +3267,7 @@ const ya = () => /* @__PURE__ */ m("div", { className: "flex items-center justif
3262
3267
  de.Root,
3263
3268
  {
3264
3269
  ref: n,
3265
- className: k("relative overflow-hidden", r),
3270
+ className: C("relative overflow-hidden", r),
3266
3271
  ...o,
3267
3272
  children: [
3268
3273
  /* @__PURE__ */ t(de.Viewport, { className: "h-full w-full rounded-[inherit]", children: e }),
@@ -3277,7 +3282,7 @@ const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n)
3277
3282
  {
3278
3283
  ref: n,
3279
3284
  orientation: e,
3280
- className: k(
3285
+ className: C(
3281
3286
  "flex touch-none select-none transition-colors",
3282
3287
  e === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
3283
3288
  e === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
@@ -3288,32 +3293,32 @@ const jt = q.forwardRef(({ className: r, orientation: e = "vertical", ...o }, n)
3288
3293
  }
3289
3294
  ));
3290
3295
  jt.displayName = de.ScrollAreaScrollbar.displayName;
3291
- const va = oe.Portal, Xt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3292
- oe.Overlay,
3296
+ const va = ne.Portal, Xt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3297
+ ne.Overlay,
3293
3298
  {
3294
3299
  ref: o,
3295
- className: k(
3300
+ className: C(
3296
3301
  "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
3297
3302
  r
3298
3303
  ),
3299
3304
  ...e
3300
3305
  }
3301
3306
  ));
3302
- Xt.displayName = oe.Overlay.displayName;
3307
+ Xt.displayName = ne.Overlay.displayName;
3303
3308
  const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__ */ m(va, { children: [
3304
3309
  /* @__PURE__ */ t(Xt, {}),
3305
3310
  /* @__PURE__ */ m(
3306
- oe.Content,
3311
+ ne.Content,
3307
3312
  {
3308
3313
  ref: n,
3309
- className: k(
3314
+ className: C(
3310
3315
  "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
3311
3316
  r
3312
3317
  ),
3313
3318
  ...o,
3314
3319
  children: [
3315
3320
  e,
3316
- /* @__PURE__ */ m(oe.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: [
3321
+ /* @__PURE__ */ m(ne.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: [
3317
3322
  /* @__PURE__ */ t(cn, { className: "h-4 w-4" }),
3318
3323
  /* @__PURE__ */ t("span", { className: "sr-only", children: "Close" })
3319
3324
  ] })
@@ -3321,47 +3326,47 @@ const ka = q.forwardRef(({ className: r, children: e, ...o }, n) => /* @__PURE__
3321
3326
  }
3322
3327
  )
3323
3328
  ] }));
3324
- ka.displayName = oe.Content.displayName;
3329
+ ka.displayName = ne.Content.displayName;
3325
3330
  const Ca = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3326
- oe.Title,
3331
+ ne.Title,
3327
3332
  {
3328
3333
  ref: o,
3329
- className: k(
3334
+ className: C(
3330
3335
  "text-lg font-semibold leading-none tracking-tight",
3331
3336
  r
3332
3337
  ),
3333
3338
  ...e
3334
3339
  }
3335
3340
  ));
3336
- Ca.displayName = oe.Title.displayName;
3341
+ Ca.displayName = ne.Title.displayName;
3337
3342
  const wa = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3338
- oe.Description,
3343
+ ne.Description,
3339
3344
  {
3340
3345
  ref: o,
3341
- className: k("text-sm text-muted-foreground", r),
3346
+ className: C("text-sm text-muted-foreground", r),
3342
3347
  ...e
3343
3348
  }
3344
3349
  ));
3345
- wa.displayName = oe.Description.displayName;
3350
+ wa.displayName = ne.Description.displayName;
3346
3351
  const Ut = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3347
- W,
3352
+ J,
3348
3353
  {
3349
3354
  ref: o,
3350
- className: k(
3355
+ className: C(
3351
3356
  "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
3352
3357
  r
3353
3358
  ),
3354
3359
  ...e
3355
3360
  }
3356
3361
  ));
3357
- Ut.displayName = W.displayName;
3362
+ Ut.displayName = J.displayName;
3358
3363
  const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div", { className: "flex items-center border-b px-4", "cmdk-input-wrapper": "", children: [
3359
3364
  /* @__PURE__ */ t(Ge, { size: 14, className: "mr-2 shrink-0 text-purple-500 " }),
3360
3365
  /* @__PURE__ */ t(
3361
- W.Input,
3366
+ J.Input,
3362
3367
  {
3363
3368
  ref: o,
3364
- className: k(
3369
+ className: C(
3365
3370
  "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
3366
3371
  r
3367
3372
  ),
@@ -3369,63 +3374,63 @@ const Gt = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ m("div",
3369
3374
  }
3370
3375
  )
3371
3376
  ] }));
3372
- Gt.displayName = W.Input.displayName;
3377
+ Gt.displayName = J.Input.displayName;
3373
3378
  const Na = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3374
- W.List,
3379
+ J.List,
3375
3380
  {
3376
3381
  ref: o,
3377
- className: k("max-h-[300px] overflow-y-auto overflow-x-hidden", r),
3382
+ className: C("max-h-[300px] overflow-y-auto overflow-x-hidden", r),
3378
3383
  ...e
3379
3384
  }
3380
3385
  ));
3381
- Na.displayName = W.List.displayName;
3386
+ Na.displayName = J.List.displayName;
3382
3387
  const Ia = q.forwardRef((r, e) => /* @__PURE__ */ t(
3383
- W.Empty,
3388
+ J.Empty,
3384
3389
  {
3385
3390
  ref: e,
3386
3391
  className: "py-6 text-center text-sm",
3387
3392
  ...r
3388
3393
  }
3389
3394
  ));
3390
- Ia.displayName = W.Empty.displayName;
3395
+ Ia.displayName = J.Empty.displayName;
3391
3396
  const Ne = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3392
- W.Group,
3397
+ J.Group,
3393
3398
  {
3394
3399
  ref: o,
3395
- className: k(
3400
+ className: C(
3396
3401
  "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
3397
3402
  r
3398
3403
  ),
3399
3404
  ...e
3400
3405
  }
3401
3406
  ));
3402
- Ne.displayName = W.Group.displayName;
3407
+ Ne.displayName = J.Group.displayName;
3403
3408
  const Qe = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3404
- W.Separator,
3409
+ J.Separator,
3405
3410
  {
3406
3411
  ref: o,
3407
- className: k("-mx-1 h-px bg-border", r),
3412
+ className: C("-mx-1 h-px bg-border", r),
3408
3413
  ...e
3409
3414
  }
3410
3415
  ));
3411
- Qe.displayName = W.Separator.displayName;
3416
+ Qe.displayName = J.Separator.displayName;
3412
3417
  const he = q.forwardRef(({ className: r, ...e }, o) => /* @__PURE__ */ t(
3413
- W.Item,
3418
+ J.Item,
3414
3419
  {
3415
3420
  ref: o,
3416
- className: k(
3421
+ className: C(
3417
3422
  "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
3418
3423
  r
3419
3424
  ),
3420
3425
  ...e
3421
3426
  }
3422
3427
  ));
3423
- he.displayName = W.Item.displayName;
3428
+ he.displayName = J.Item.displayName;
3424
3429
  const Sa = ({
3425
3430
  completion: r,
3426
3431
  onDiscard: e
3427
3432
  }) => {
3428
- const { editor: o } = Q();
3433
+ const { editor: o } = te();
3429
3434
  return /* @__PURE__ */ m(ue, { children: [
3430
3435
  /* @__PURE__ */ m(Ne, { children: [
3431
3436
  /* @__PURE__ */ m(
@@ -3497,7 +3502,7 @@ const Sa = ({
3497
3502
  icon: hn
3498
3503
  }
3499
3504
  ], Ma = ({ onSelect: r }) => {
3500
- const { editor: e } = Q();
3505
+ const { editor: e } = te();
3501
3506
  return /* @__PURE__ */ m(ue, { children: [
3502
3507
  /* @__PURE__ */ m(Ne, { heading: "编辑或校对选中文本", children: [
3503
3508
  " ",
@@ -3542,17 +3547,17 @@ const Sa = ({
3542
3547
  ] });
3543
3548
  };
3544
3549
  function La({ onOpenChange: r, options: e }) {
3545
- const { editor: o } = Q(), [n, a] = j(""), { completion: s, complete: i, isLoading: d } = Nn({
3550
+ const { editor: o } = te(), [n, a] = O(""), { completion: s, complete: i, isLoading: d } = Nn({
3546
3551
  // id: "novel",
3547
3552
  api: "/api/generate",
3548
- onResponse: (x) => {
3549
- if (x.status === 429) {
3553
+ onResponse: (y) => {
3554
+ if (y.status === 429) {
3550
3555
  we.error("You have reached your request limit for the day.");
3551
3556
  return;
3552
3557
  }
3553
3558
  },
3554
- onError: (x) => {
3555
- we.error(x.message);
3559
+ onError: (y) => {
3560
+ we.error(y.message);
3556
3561
  },
3557
3562
  ...e
3558
3563
  }), p = s.length > 0;
@@ -3576,7 +3581,7 @@ function La({ onOpenChange: r, options: e }) {
3576
3581
  }
3577
3582
  ),
3578
3583
  /* @__PURE__ */ t(
3579
- Z,
3584
+ ee,
3580
3585
  {
3581
3586
  size: "icon",
3582
3587
  className: "absolute right-2 top-1/2 h-6 w-6 -translate-y-1/2 rounded-full bg-purple-500 hover:bg-purple-900",
@@ -3585,8 +3590,8 @@ function La({ onOpenChange: r, options: e }) {
3585
3590
  return i(s, {
3586
3591
  body: { option: "zap", command: n }
3587
3592
  }).then(() => a(""));
3588
- const x = o.state.selection.content(), l = o.storage.markdown.serializer.serialize(
3589
- x.content
3593
+ const y = o.state.selection.content(), l = o.storage.markdown.serializer.serialize(
3594
+ y.content
3590
3595
  );
3591
3596
  i(l, {
3592
3597
  body: { option: "zap", command: n }
@@ -3607,7 +3612,7 @@ function La({ onOpenChange: r, options: e }) {
3607
3612
  ) : /* @__PURE__ */ t(
3608
3613
  Ma,
3609
3614
  {
3610
- onSelect: (x, l) => i(x, { body: { option: l } })
3615
+ onSelect: (y, l) => i(y, { body: { option: l } })
3611
3616
  }
3612
3617
  )
3613
3618
  ] })
@@ -3620,8 +3625,8 @@ const Aa = ({
3620
3625
  enableAI: n = !1,
3621
3626
  aiOptions: a
3622
3627
  }) => {
3623
- const { editor: s } = Q();
3624
- return ae(() => {
3628
+ const { editor: s } = te();
3629
+ return se(() => {
3625
3630
  e || Rr(s);
3626
3631
  }, [e]), /* @__PURE__ */ m(
3627
3632
  Pr,
@@ -3644,7 +3649,7 @@ const Aa = ({
3644
3649
  ),
3645
3650
  !e && /* @__PURE__ */ m(oo, { children: [
3646
3651
  n && /* @__PURE__ */ m(
3647
- Z,
3652
+ ee,
3648
3653
  {
3649
3654
  className: "gap-1 text-purple-500",
3650
3655
  variant: "ghost",
@@ -3691,7 +3696,7 @@ const Aa = ({
3691
3696
  onUpload: Da,
3692
3697
  validateFn: (r) => r.type.includes("image/") ? r.size / 1024 / 1024 > 20 ? (we.error("File size too big (max 20MB)."), !1) : !0 : (we.error("File type not supported."), !1)
3693
3698
  }), Pa = () => {
3694
- const { editor: r } = Q();
3699
+ const { editor: r } = te();
3695
3700
  return r ? /* @__PURE__ */ t("div", { className: "flex", children: [
3696
3701
  {
3697
3702
  name: "粗体",
@@ -3735,7 +3740,7 @@ const Aa = ({
3735
3740
  o.command(n);
3736
3741
  },
3737
3742
  children: /* @__PURE__ */ t(me, { overlay: o.name, placement: "top", children: /* @__PURE__ */ t(
3738
- Z,
3743
+ ee,
3739
3744
  {
3740
3745
  size: "sm",
3741
3746
  className: "rounded-md",
@@ -3744,7 +3749,7 @@ const Aa = ({
3744
3749
  children: /* @__PURE__ */ t(
3745
3750
  o.icon,
3746
3751
  {
3747
- className: k("h-4 w-4", {
3752
+ className: C("h-4 w-4", {
3748
3753
  "text-blue-500": o.isActive(r)
3749
3754
  })
3750
3755
  }
@@ -3882,7 +3887,7 @@ const Aa = ({
3882
3887
  De.Item,
3883
3888
  {
3884
3889
  onClick: i.onClick,
3885
- className: k(
3890
+ className: C(
3886
3891
  "gap-2 !p-1.5 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
3887
3892
  i.className
3888
3893
  ),
@@ -3900,9 +3905,9 @@ const Aa = ({
3900
3905
  De.SubMenu,
3901
3906
  {
3902
3907
  expandIcon: /* @__PURE__ */ t(wo, { size: 16 }),
3903
- popupClassName: k(
3908
+ popupClassName: C(
3904
3909
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0 z-[1080]",
3905
- b`
3910
+ h`
3906
3911
  .rc-menu {
3907
3912
  border: none !important;
3908
3913
  box-shadow: none !important;
@@ -3910,9 +3915,9 @@ const Aa = ({
3910
3915
  `
3911
3916
  ),
3912
3917
  popupOffset: [4, 0],
3913
- className: k(
3918
+ className: C(
3914
3919
  "gap-2 !p-0 text-sm hover:bg-accent focus:ring-0 rounded-md cursor-pointer",
3915
- b`
3920
+ h`
3916
3921
  .rc-menu-submenu-title {
3917
3922
  display: flex;
3918
3923
  align-items: center;
@@ -3944,9 +3949,9 @@ const Aa = ({
3944
3949
  overlay: /* @__PURE__ */ t(
3945
3950
  De,
3946
3951
  {
3947
- className: k(
3952
+ className: C(
3948
3953
  "!rounded-lg border border-muted bg-background shadow-xl !p-2 min-w-48 !m-0",
3949
- b`
3954
+ h`
3950
3955
  .rc-menu-submenu-active {
3951
3956
  .rc-menu-submenu-title {
3952
3957
  background-color: hsl(var(--accent)) !important;
@@ -3965,10 +3970,10 @@ const Aa = ({
3965
3970
  });
3966
3971
  Yt.displayName = "DropdownMenu";
3967
3972
  const Ea = ({ children: r, ...e }) => {
3968
- const { editor: o } = Q(), n = () => {
3969
- o && o.state.selection instanceof J && (o.commands.deleteSelection(), o.commands.focus());
3973
+ const { editor: o } = te(), n = () => {
3974
+ o && o.state.selection instanceof Q && (o.commands.deleteSelection(), o.commands.focus());
3970
3975
  }, a = () => {
3971
- if (o && o.state.selection instanceof J) {
3976
+ if (o && o.state.selection instanceof Q) {
3972
3977
  const d = o.state.selection.node, p = o.state.selection.to;
3973
3978
  o.chain().insertContentAt(p, {
3974
3979
  type: d.type.name,
@@ -3981,7 +3986,7 @@ const Ea = ({ children: r, ...e }) => {
3981
3986
  icon: /* @__PURE__ */ t(d.icon, { size: 16 }),
3982
3987
  label: d.name,
3983
3988
  onClick: () => {
3984
- o && o.state.selection instanceof J && d.command(o);
3989
+ o && o.state.selection instanceof Q && d.command(o);
3985
3990
  },
3986
3991
  isActive: d.isActive(o)
3987
3992
  }));
@@ -4009,7 +4014,7 @@ const Ea = ({ children: r, ...e }) => {
4009
4014
  }
4010
4015
  ], ...e, children: r });
4011
4016
  }, $a = () => {
4012
- const { editor: r } = Q(), e = (o) => {
4017
+ const { editor: r } = te(), e = (o) => {
4013
4018
  if (!r) return;
4014
4019
  const n = o.target.closest(".custom-drag-handle");
4015
4020
  if (!n) return;
@@ -4022,9 +4027,9 @@ const Ea = ({ children: r, ...e }) => {
4022
4027
  return /* @__PURE__ */ m(
4023
4028
  "div",
4024
4029
  {
4025
- className: k(
4030
+ className: C(
4026
4031
  "custom-drag-handle",
4027
- b`
4032
+ h`
4028
4033
  width: auto;
4029
4034
  background: none;
4030
4035
  display: flex;
@@ -4041,7 +4046,7 @@ const Ea = ({ children: r, ...e }) => {
4041
4046
  /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以在下方添加快" })
4042
4047
  ] }),
4043
4048
  children: /* @__PURE__ */ t(
4044
- Z,
4049
+ ee,
4045
4050
  {
4046
4051
  size: "icon",
4047
4052
  variant: "ghost",
@@ -4060,7 +4065,7 @@ const Ea = ({ children: r, ...e }) => {
4060
4065
  "拖动",
4061
4066
  /* @__PURE__ */ t("span", { className: "text-muted-foreground", children: "以移动" })
4062
4067
  ] }) }),
4063
- children: /* @__PURE__ */ t(Z, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(To, { size: 22 }) })
4068
+ children: /* @__PURE__ */ t(ee, { size: "icon", variant: "ghost", className: "w-auto h-auto p-0.5", children: /* @__PURE__ */ t(To, { size: 22 }) })
4064
4069
  }
4065
4070
  ) })
4066
4071
  ]
@@ -4076,36 +4081,36 @@ const Ea = ({ children: r, ...e }) => {
4076
4081
  showSaveStatus: i = !0,
4077
4082
  showWordCount: d = !0,
4078
4083
  uploadImageProps: p,
4079
- editorRef: x,
4084
+ editorRef: y,
4080
4085
  enableAI: l = !1,
4081
4086
  aiOptions: c
4082
- } = r, [f, v] = j(
4087
+ } = r, [g, k] = O(
4083
4088
  o
4084
- ), [D, h] = j("Saved"), [g, S] = j(), [y, N] = j(!1), [u, T] = j(!1), [A, I] = j(!1), [C, H] = j(!1), G = (L) => {
4085
- const X = new DOMParser().parseFromString(L, "text/html");
4086
- return X.querySelectorAll("pre code").forEach((E) => {
4087
- In.highlightElement(E);
4089
+ ), [D, b] = O("Saved"), [f, I] = O(), [v, N] = O(!1), [u, S] = O(!1), [U, j] = O(!1), [x, L] = O(!1), E = (M) => {
4090
+ const X = new DOMParser().parseFromString(M, "text/html");
4091
+ return X.querySelectorAll("pre code").forEach(($) => {
4092
+ In.highlightElement($);
4088
4093
  }), new XMLSerializer().serializeToString(X);
4089
- }, O = Yr(
4090
- async (L) => {
4091
- const X = L.getJSON();
4092
- S(L.storage.characterCount.words()), n == null || n(X), s && (window.localStorage.setItem(
4094
+ }, A = Yr(
4095
+ async (M) => {
4096
+ const X = M.getJSON();
4097
+ I(M.storage.characterCount.words()), n == null || n(X), s && (window.localStorage.setItem(
4093
4098
  "html-content",
4094
- G(L.getHTML())
4099
+ E(M.getHTML())
4095
4100
  ), window.localStorage.setItem(a, JSON.stringify(X)), window.localStorage.setItem(
4096
4101
  "markdown",
4097
- L.storage.markdown.getMarkdown()
4098
- ), h("Saved"));
4102
+ M.storage.markdown.getMarkdown()
4103
+ ), b("Saved"));
4099
4104
  },
4100
4105
  500
4101
- ), se = be(() => {
4106
+ ), V = be(() => {
4102
4107
  if (!p) return Ra;
4103
4108
  const {
4104
- beforeUpload: L,
4109
+ beforeUpload: M,
4105
4110
  maxSize: X,
4106
- action: E,
4107
- headers: K,
4108
- method: ee,
4111
+ action: $,
4112
+ headers: Z,
4113
+ method: oe,
4109
4114
  name: $e,
4110
4115
  onSuccess: Se,
4111
4116
  onError: Te
@@ -4114,10 +4119,10 @@ const Ea = ({ children: r, ...e }) => {
4114
4119
  onUpload: (ie) => {
4115
4120
  const Me = new FormData();
4116
4121
  Me.append($e || "file", ie);
4117
- const He = fetch(E, {
4118
- method: ee || "POST",
4122
+ const He = fetch($, {
4123
+ method: oe || "POST",
4119
4124
  headers: {
4120
- ...K
4125
+ ...Z
4121
4126
  },
4122
4127
  body: Me
4123
4128
  });
@@ -4129,8 +4134,8 @@ const Ea = ({ children: r, ...e }) => {
4129
4134
  return;
4130
4135
  }
4131
4136
  if (B.status === 200) {
4132
- const { url: z } = await B.json(), M = new Image();
4133
- M.src = z, M.onload = () => {
4137
+ const { url: z } = await B.json(), T = new Image();
4138
+ T.src = z, T.onload = () => {
4134
4139
  ye(z);
4135
4140
  };
4136
4141
  } else throw B.status === 401 ? (ye(ie), new Error(
@@ -4141,29 +4146,29 @@ const Ea = ({ children: r, ...e }) => {
4141
4146
  });
4142
4147
  });
4143
4148
  },
4144
- validateFn: (ie) => L ? L(ie) : ie.type.includes("image/") ? X && ie.size > X ? (console.error("File size too big (max 20MB)."), !1) : !0 : (console.error("File type not supported."), !1)
4149
+ validateFn: (ie) => M ? M(ie) : ie.type.includes("image/") ? X && ie.size > X ? (console.error("File size too big (max 20MB)."), !1) : !0 : (console.error("File type not supported."), !1)
4145
4150
  });
4146
4151
  }, [p]);
4147
- if (ae(() => {
4152
+ if (se(() => {
4148
4153
  if (!s) return;
4149
- const L = window.localStorage.getItem(a);
4150
- v(L ? JSON.parse(L) : za);
4151
- }, [a, s]), !f) return null;
4152
- const re = [
4154
+ const M = window.localStorage.getItem(a);
4155
+ k(M ? JSON.parse(M) : za);
4156
+ }, [a, s]), !g) return null;
4157
+ const Y = [
4153
4158
  ...Ot,
4154
4159
  Ba({
4155
- uploadFn: se
4160
+ uploadFn: V
4156
4161
  })
4157
4162
  ];
4158
- return /* @__PURE__ */ m("div", { className: k("relative w-full max-w-screen-lg", e), children: [
4163
+ return /* @__PURE__ */ m("div", { className: C("relative w-full max-w-screen-lg", e), children: [
4159
4164
  (s && i || d) && /* @__PURE__ */ m("div", { className: "flex absolute right-5 top-5 z-10 mb-5 gap-2", children: [
4160
4165
  s && i && /* @__PURE__ */ t("div", { className: "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground", children: D }),
4161
4166
  d && /* @__PURE__ */ m(
4162
4167
  "div",
4163
4168
  {
4164
- className: g ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
4169
+ className: f ? "rounded-lg bg-accent px-2 py-1 text-sm text-muted-foreground" : "hidden",
4165
4170
  children: [
4166
- g,
4171
+ f,
4167
4172
  " Words"
4168
4173
  ]
4169
4174
  }
@@ -4172,66 +4177,66 @@ const Ea = ({ children: r, ...e }) => {
4172
4177
  /* @__PURE__ */ t($r, { children: /* @__PURE__ */ m(
4173
4178
  Hr,
4174
4179
  {
4175
- onCreate: ({ editor: L }) => {
4176
- x && (x.current = L);
4180
+ onCreate: ({ editor: M }) => {
4181
+ y && (y.current = M);
4177
4182
  },
4178
- initialContent: f,
4179
- extensions: re,
4183
+ initialContent: g,
4184
+ extensions: Y,
4180
4185
  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",
4181
4186
  editorProps: {
4182
4187
  handleDOMEvents: {
4183
- keydown: (L, X) => _r(X)
4188
+ keydown: (M, X) => _r(X)
4184
4189
  },
4185
- handlePaste: (L, X) => Fr(L, X, se),
4186
- handleDrop: (L, X, E, K) => Or(L, X, K, se),
4190
+ handlePaste: (M, X) => Fr(M, X, V),
4191
+ handleDrop: (M, X, $, Z) => Or(M, X, Z, V),
4187
4192
  attributes: {
4188
4193
  class: "prose prose-lg dark:prose-invert prose-headings:font-title font-default focus:outline-none max-w-full"
4189
4194
  }
4190
4195
  },
4191
- onUpdate: ({ editor: L }) => {
4192
- O(L), h("Unsaved");
4196
+ onUpdate: ({ editor: M }) => {
4197
+ A(M), b("Unsaved");
4193
4198
  },
4194
4199
  slotAfter: /* @__PURE__ */ t(qr, {}),
4195
4200
  children: [
4196
4201
  /* @__PURE__ */ m(jr, { 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: [
4197
4202
  /* @__PURE__ */ t(Xr, { className: "px-2 text-muted-foreground", children: "没有结果" }),
4198
4203
  /* @__PURE__ */ t(Ur, { children: qt({
4199
- uploadFn: se
4200
- }).map((L) => /* @__PURE__ */ m(
4204
+ uploadFn: V
4205
+ }).map((M) => /* @__PURE__ */ m(
4201
4206
  Gr,
4202
4207
  {
4203
- value: L.title,
4204
- onCommand: (X) => L.command(X),
4208
+ value: M.title,
4209
+ onCommand: (X) => M.command(X),
4205
4210
  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",
4206
4211
  children: [
4207
- /* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: L.icon }),
4212
+ /* @__PURE__ */ t("div", { className: "flex h-10 w-10 items-center justify-center rounded-md border border-muted bg-background", children: M.icon }),
4208
4213
  /* @__PURE__ */ m("div", { children: [
4209
- /* @__PURE__ */ t("p", { className: "font-medium", children: L.title }),
4210
- /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: L.description })
4214
+ /* @__PURE__ */ t("p", { className: "font-medium", children: M.title }),
4215
+ /* @__PURE__ */ t("p", { className: "text-xs text-muted-foreground", children: M.description })
4211
4216
  ] })
4212
4217
  ]
4213
4218
  },
4214
- L.title
4219
+ M.title
4215
4220
  )) })
4216
4221
  ] }),
4217
4222
  /* @__PURE__ */ m(
4218
4223
  Aa,
4219
4224
  {
4220
- open: C,
4221
- onOpenChange: H,
4225
+ open: x,
4226
+ onOpenChange: L,
4222
4227
  enableAI: l,
4223
4228
  aiOptions: c,
4224
4229
  children: [
4225
4230
  l && /* @__PURE__ */ t(fe, { orientation: "vertical" }),
4226
- /* @__PURE__ */ t(xa, { open: y, onOpenChange: N }),
4231
+ /* @__PURE__ */ t(xa, { open: v, onOpenChange: N }),
4227
4232
  /* @__PURE__ */ t(fe, { orientation: "vertical" }),
4228
- /* @__PURE__ */ t(ha, { open: A, onOpenChange: I }),
4233
+ /* @__PURE__ */ t(ha, { open: U, onOpenChange: j }),
4229
4234
  /* @__PURE__ */ t(fe, { orientation: "vertical" }),
4230
4235
  /* @__PURE__ */ t(ba, {}),
4231
4236
  /* @__PURE__ */ t(fe, { orientation: "vertical" }),
4232
4237
  /* @__PURE__ */ t(Pa, {}),
4233
4238
  /* @__PURE__ */ t(fe, { orientation: "vertical" }),
4234
- /* @__PURE__ */ t(pa, { open: u, onOpenChange: T })
4239
+ /* @__PURE__ */ t(pa, { open: u, onOpenChange: S })
4235
4240
  ]
4236
4241
  }
4237
4242
  ),
@@ -4259,7 +4264,7 @@ const As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4259
4264
  Editor: Vt,
4260
4265
  Markdown: $t,
4261
4266
  MdEditor: Ht,
4262
- SortableUtils: V,
4267
+ SortableUtils: K,
4263
4268
  desktopAppConfig: Ve,
4264
4269
  desktopConfigMap: Be,
4265
4270
  desktopGroupConfig: Lt,
@@ -4280,7 +4285,7 @@ export {
4280
4285
  Vt as Editor,
4281
4286
  $t as Markdown,
4282
4287
  Ht as MdEditor,
4283
- V as SortableUtils,
4288
+ K as SortableUtils,
4284
4289
  As as default,
4285
4290
  Ve as desktopAppConfig,
4286
4291
  Be as desktopConfigMap,