@yuku123/z-frontend-common 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- import { jsxs as m, jsx as t, Fragment as Se } from "react/jsx-runtime";
2
- import { useState as A, useRef as M, useEffect as D, useCallback as ke, useMemo as G, useLayoutEffect as we, createElement as le, Fragment as O } from "react";
3
- import { Button as V, Skeleton as _, Input as Ce, Breadcrumb as Re, Space as ae, Tag as se, Card as Te, Table as Ee } from "antd";
4
- import { InboxOutlined as Ie, ExclamationCircleOutlined as ze, ReloadOutlined as re, SearchOutlined as Ae, ReadOutlined as Be } from "@ant-design/icons";
5
- import { useNavigate as he, useInRouterContext as De } from "react-router-dom";
1
+ import { jsxs as m, jsx as t, Fragment as Ce } from "react/jsx-runtime";
2
+ import { useState as B, useRef as N, useEffect as L, useMemo as q, useCallback as be, useLayoutEffect as Re, createElement as ae, Fragment as O } from "react";
3
+ import { Button as V, Skeleton as _, Input as Te, Card as me, Table as ye, Breadcrumb as Ee, Space as se, Tag as ce } from "antd";
4
+ import { InboxOutlined as Ie, ExclamationCircleOutlined as Ae, ReloadOutlined as re, SearchOutlined as ze, ReadOutlined as Be } from "@ant-design/icons";
5
+ import { useNavigate as xe, useInRouterContext as De } from "react-router-dom";
6
6
  const T = {
7
7
  // 主色 (蓝紫) - 顶导/重点按钮/链接
8
8
  primary: "#7c3aed",
@@ -83,15 +83,15 @@ const T = {
83
83
  lg: 16,
84
84
  xl: 20,
85
85
  pill: 999
86
- }, z = {
86
+ }, D = {
87
87
  sm: "0 1px 2px 0 rgba(15, 23, 42, 0.04), 0 1px 3px 0 rgba(15, 23, 42, 0.06)",
88
88
  md: "0 2px 4px -1px rgba(15, 23, 42, 0.04), 0 4px 8px -1px rgba(15, 23, 42, 0.08)",
89
89
  lg: "0 4px 6px -2px rgba(15, 23, 42, 0.05), 0 12px 16px -4px rgba(15, 23, 42, 0.10)",
90
90
  xl: "0 8px 24px -6px rgba(15, 23, 42, 0.10), 0 24px 48px -12px rgba(15, 23, 42, 0.18)"
91
- }, nt = {
92
- rest: z.md,
91
+ }, at = {
92
+ rest: D.md,
93
93
  hover: "0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 20px 32px -8px rgba(15, 23, 42, 0.14)"
94
- }, H = {
94
+ }, P = {
95
95
  1: 4,
96
96
  2: 8,
97
97
  3: 12,
@@ -102,7 +102,7 @@ const T = {
102
102
  10: 40,
103
103
  12: 48,
104
104
  16: 64
105
- }, ce = {
105
+ }, de = {
106
106
  xs: 11,
107
107
  sm: 12,
108
108
  base: 14,
@@ -112,7 +112,7 @@ const T = {
112
112
  "2xl": 24,
113
113
  "3xl": 30,
114
114
  "4xl": 36
115
- }, L = {
115
+ }, H = {
116
116
  token: {
117
117
  // 主色
118
118
  colorPrimary: T.primary,
@@ -141,11 +141,11 @@ const T = {
141
141
  borderRadiusLG: C.lg,
142
142
  borderRadiusSM: C.sm,
143
143
  // 字体
144
- fontSize: ce.base,
144
+ fontSize: de.base,
145
145
  fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif",
146
146
  // 阴影
147
- boxShadow: z.md,
148
- boxShadowSecondary: z.lg
147
+ boxShadow: D.md,
148
+ boxShadowSecondary: D.lg
149
149
  },
150
150
  components: {
151
151
  // Layout: 顶导白底更现代
@@ -169,7 +169,7 @@ const T = {
169
169
  // Card: 更柔和
170
170
  Card: {
171
171
  borderRadiusLG: C.lg,
172
- boxShadowTertiary: z.sm
172
+ boxShadowTertiary: D.sm
173
173
  },
174
174
  // Button: 主按钮圆角统一
175
175
  Button: {
@@ -181,7 +181,7 @@ const T = {
181
181
  Tabs: {
182
182
  itemSelectedColor: T.primary,
183
183
  inkBarColor: T.primary,
184
- titleFontSize: ce.base
184
+ titleFontSize: de.base
185
185
  },
186
186
  // Tag: 更小巧
187
187
  Tag: {
@@ -189,39 +189,39 @@ const T = {
189
189
  }
190
190
  }
191
191
  };
192
- function it({
192
+ function st({
193
193
  icon: e,
194
194
  label: n,
195
195
  value: s,
196
- suffix: l,
196
+ suffix: o,
197
197
  color: c = "blue",
198
198
  trend: a,
199
199
  href: r,
200
- loading: o = !1,
200
+ loading: l = !1,
201
201
  precision: i = 0
202
202
  }) {
203
- const d = E[c] || E.blue, [f, g] = A(0), p = M(0);
204
- D(() => {
205
- if (o || s == null) return;
203
+ const d = E[c] || E.blue, [f, g] = B(0), p = N(0);
204
+ L(() => {
205
+ if (l || s == null) return;
206
206
  const b = p.current, S = Number(s) || 0;
207
207
  if (b === S) {
208
208
  g(S);
209
209
  return;
210
210
  }
211
- const k = 600, P = performance.now();
212
- let N;
213
- const q = (Y) => {
214
- const j = Math.min(1, (Y - P) / k), J = 1 - Math.pow(1 - j, 3), u = b + (S - b) * J;
215
- g(u), j < 1 ? N = requestAnimationFrame(q) : p.current = S;
211
+ const w = 600, A = performance.now();
212
+ let $;
213
+ const G = (U) => {
214
+ const j = Math.min(1, (U - A) / w), J = 1 - Math.pow(1 - j, 3), u = b + (S - b) * J;
215
+ g(u), j < 1 ? $ = requestAnimationFrame(G) : p.current = S;
216
216
  };
217
- return N = requestAnimationFrame(q), () => N && cancelAnimationFrame(N);
218
- }, [s, o]);
217
+ return $ = requestAnimationFrame(G), () => $ && cancelAnimationFrame($);
218
+ }, [s, l]);
219
219
  const h = () => {
220
220
  r && typeof window < "u" && (window.location.href = r);
221
- }, w = o ? "--" : Number(f).toLocaleString("zh-CN", {
221
+ }, k = l ? "--" : Number(f).toLocaleString("zh-CN", {
222
222
  minimumFractionDigits: i,
223
223
  maximumFractionDigits: i
224
- }), v = a != null ? Number(a) : null, B = v != null && v >= 0;
224
+ }), v = a != null ? Number(a) : null, I = v != null && v >= 0;
225
225
  return /* @__PURE__ */ m(
226
226
  "div",
227
227
  {
@@ -230,10 +230,10 @@ function it({
230
230
  position: "relative",
231
231
  background: d.gradient,
232
232
  borderRadius: C.lg,
233
- padding: H[5],
233
+ padding: P[5],
234
234
  color: d.fg,
235
235
  cursor: r ? "pointer" : "default",
236
- boxShadow: z.md,
236
+ boxShadow: D.md,
237
237
  overflow: "hidden",
238
238
  transition: "transform 200ms ease, box-shadow 200ms ease",
239
239
  minHeight: 110,
@@ -242,10 +242,10 @@ function it({
242
242
  justifyContent: "space-between"
243
243
  },
244
244
  onMouseEnter: (b) => {
245
- b.currentTarget.style.transform = "translateY(-2px)", b.currentTarget.style.boxShadow = z.lg;
245
+ b.currentTarget.style.transform = "translateY(-2px)", b.currentTarget.style.boxShadow = D.lg;
246
246
  },
247
247
  onMouseLeave: (b) => {
248
- b.currentTarget.style.transform = "translateY(0)", b.currentTarget.style.boxShadow = z.md;
248
+ b.currentTarget.style.transform = "translateY(0)", b.currentTarget.style.boxShadow = D.md;
249
249
  },
250
250
  children: [
251
251
  /* @__PURE__ */ t(
@@ -266,7 +266,7 @@ function it({
266
266
  /* @__PURE__ */ m("div", { style: {
267
267
  display: "flex",
268
268
  alignItems: "center",
269
- gap: H[2],
269
+ gap: P[2],
270
270
  position: "relative"
271
271
  }, children: [
272
272
  /* @__PURE__ */ t("div", { style: {
@@ -289,9 +289,9 @@ function it({
289
289
  /* @__PURE__ */ m("div", { style: {
290
290
  display: "flex",
291
291
  alignItems: "baseline",
292
- gap: H[2],
292
+ gap: P[2],
293
293
  position: "relative",
294
- marginTop: H[3]
294
+ marginTop: P[3]
295
295
  }, children: [
296
296
  /* @__PURE__ */ t("div", { style: {
297
297
  fontSize: 30,
@@ -299,20 +299,20 @@ function it({
299
299
  lineHeight: 1.1,
300
300
  letterSpacing: "-0.02em",
301
301
  fontVariantNumeric: "tabular-nums"
302
- }, children: w }),
303
- l && /* @__PURE__ */ t("div", { style: { fontSize: 14, opacity: 0.85, fontWeight: 500 }, children: l }),
302
+ }, children: k }),
303
+ o && /* @__PURE__ */ t("div", { style: { fontSize: 14, opacity: 0.85, fontWeight: 500 }, children: o }),
304
304
  v != null && /* @__PURE__ */ m("div", { style: {
305
305
  marginLeft: "auto",
306
306
  fontSize: 12,
307
307
  fontWeight: 600,
308
308
  padding: "2px 8px",
309
309
  borderRadius: 999,
310
- background: B ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.18)",
310
+ background: I ? "rgba(255, 255, 255, 0.22)" : "rgba(0, 0, 0, 0.18)",
311
311
  display: "flex",
312
312
  alignItems: "center",
313
313
  gap: 2
314
314
  }, children: [
315
- /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: B ? "▲" : "▼" }),
315
+ /* @__PURE__ */ t("span", { style: { fontSize: 10 }, children: I ? "▲" : "▼" }),
316
316
  Math.abs(v).toFixed(1),
317
317
  "%"
318
318
  ] })
@@ -321,8 +321,8 @@ function it({
321
321
  }
322
322
  );
323
323
  }
324
- function $e({ color: e = "blue", label: n, size: s = 8 }) {
325
- const l = E[e] || E.blue;
324
+ function Le({ color: e = "blue", label: n, size: s = 8 }) {
325
+ const o = E[e] || E.blue;
326
326
  return /* @__PURE__ */ m("span", { style: {
327
327
  display: "inline-flex",
328
328
  alignItems: "center",
@@ -335,18 +335,18 @@ function $e({ color: e = "blue", label: n, size: s = 8 }) {
335
335
  width: s,
336
336
  height: s,
337
337
  borderRadius: "50%",
338
- background: l.bg,
339
- boxShadow: `0 0 0 3px ${l.soft}`,
338
+ background: o.bg,
339
+ boxShadow: `0 0 0 3px ${o.soft}`,
340
340
  flexShrink: 0
341
341
  } }),
342
342
  n && /* @__PURE__ */ t("span", { children: n })
343
343
  ] });
344
344
  }
345
- function ot({
345
+ function ct({
346
346
  color: e = "blue",
347
347
  title: n,
348
348
  subtitle: s,
349
- moreText: l = "全部",
349
+ moreText: o = "全部",
350
350
  moreHref: c,
351
351
  onMore: a
352
352
  }) {
@@ -357,7 +357,7 @@ function ot({
357
357
  marginBottom: 16
358
358
  }, children: [
359
359
  /* @__PURE__ */ m("div", { style: { display: "flex", alignItems: "baseline", gap: 12 }, children: [
360
- /* @__PURE__ */ t($e, { color: e, label: n, size: 10 }),
360
+ /* @__PURE__ */ t(Le, { color: e, label: n, size: 10 }),
361
361
  s && /* @__PURE__ */ t("span", { style: {
362
362
  fontSize: 13,
363
363
  color: "#6b7280",
@@ -388,30 +388,30 @@ function ot({
388
388
  r.currentTarget.style.color = "#6b7280";
389
389
  },
390
390
  children: [
391
- l,
391
+ o,
392
392
  /* @__PURE__ */ t("span", { style: { fontSize: 12 }, children: "›" })
393
393
  ]
394
394
  }
395
395
  )
396
396
  ] });
397
397
  }
398
- function lt({
398
+ function dt({
399
399
  title: e,
400
400
  description: n,
401
401
  icon: s,
402
- cover: l,
402
+ cover: o,
403
403
  color: c = "violet",
404
404
  tags: a = [],
405
405
  meta: r,
406
- href: o,
406
+ href: l,
407
407
  extra: i
408
408
  }) {
409
- const d = E[c] || E.violet, [f, g] = A(!1);
409
+ const d = E[c] || E.violet, [f, g] = B(!1);
410
410
  return /* @__PURE__ */ m(
411
411
  "div",
412
412
  {
413
413
  onClick: () => {
414
- o && typeof window < "u" && (window.location.href = o);
414
+ l && typeof window < "u" && (window.location.href = l);
415
415
  },
416
416
  onMouseEnter: () => g(!0),
417
417
  onMouseLeave: () => g(!1),
@@ -419,8 +419,8 @@ function lt({
419
419
  background: "#ffffff",
420
420
  borderRadius: C.lg,
421
421
  overflow: "hidden",
422
- cursor: o ? "pointer" : "default",
423
- boxShadow: f ? z.lg : z.sm,
422
+ cursor: l ? "pointer" : "default",
423
+ boxShadow: f ? D.lg : D.sm,
424
424
  transform: f ? "translateY(-2px)" : "translateY(0)",
425
425
  transition: "transform 200ms ease, box-shadow 200ms ease",
426
426
  border: "1px solid #f1f5f9",
@@ -431,16 +431,16 @@ function lt({
431
431
  /* @__PURE__ */ m("div", { style: {
432
432
  position: "relative",
433
433
  aspectRatio: "16 / 9",
434
- background: l ? "#f1f5f9" : d.gradient,
434
+ background: o ? "#f1f5f9" : d.gradient,
435
435
  display: "flex",
436
436
  alignItems: "center",
437
437
  justifyContent: "center",
438
438
  overflow: "hidden"
439
439
  }, children: [
440
- l ? /* @__PURE__ */ t(
440
+ o ? /* @__PURE__ */ t(
441
441
  "img",
442
442
  {
443
- src: l,
443
+ src: o,
444
444
  alt: e,
445
445
  style: {
446
446
  width: "100%",
@@ -453,7 +453,7 @@ function lt({
453
453
  color: "rgba(255, 255, 255, 0.9)",
454
454
  display: "flex"
455
455
  }, children: s }),
456
- !l && /* @__PURE__ */ t("div", { style: {
456
+ !o && /* @__PURE__ */ t("div", { style: {
457
457
  position: "absolute",
458
458
  top: -24,
459
459
  right: -24,
@@ -469,17 +469,17 @@ function lt({
469
469
  }, children: i })
470
470
  ] }),
471
471
  /* @__PURE__ */ m("div", { style: {
472
- padding: H[4],
472
+ padding: P[4],
473
473
  display: "flex",
474
474
  flexDirection: "column",
475
- gap: H[2],
475
+ gap: P[2],
476
476
  flex: 1
477
477
  }, children: [
478
478
  a.length > 0 && /* @__PURE__ */ t("div", { style: {
479
479
  display: "flex",
480
480
  flexWrap: "wrap",
481
481
  gap: 6
482
- }, children: a.slice(0, 3).map((h, w) => {
482
+ }, children: a.slice(0, 3).map((h, k) => {
483
483
  const v = E[h.color] || E.blue;
484
484
  return /* @__PURE__ */ t(
485
485
  "span",
@@ -494,7 +494,7 @@ function lt({
494
494
  },
495
495
  children: h.label
496
496
  },
497
- w
497
+ k
498
498
  );
499
499
  }) }),
500
500
  /* @__PURE__ */ t("div", { style: {
@@ -523,7 +523,7 @@ function lt({
523
523
  fontSize: 11,
524
524
  color: "#9ca3af",
525
525
  marginTop: "auto",
526
- paddingTop: H[2],
526
+ paddingTop: P[2],
527
527
  borderTop: "1px dashed #f1f5f9"
528
528
  }, children: r })
529
529
  ] })
@@ -531,11 +531,11 @@ function lt({
531
531
  }
532
532
  );
533
533
  }
534
- function at({
534
+ function ft({
535
535
  tag: e,
536
536
  title: n,
537
537
  description: s,
538
- buttonText: l,
538
+ buttonText: o,
539
539
  buttonHref: c,
540
540
  onButtonClick: a
541
541
  }) {
@@ -546,7 +546,7 @@ function at({
546
546
  background: "linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%)",
547
547
  color: "#ffffff",
548
548
  overflow: "hidden",
549
- boxShadow: z.lg
549
+ boxShadow: D.lg
550
550
  }, children: [
551
551
  /* @__PURE__ */ t("div", { style: {
552
552
  position: "absolute",
@@ -598,7 +598,7 @@ function at({
598
598
  maxWidth: 540
599
599
  }, children: s })
600
600
  ] }),
601
- l && (c || a) && /* @__PURE__ */ m(
601
+ o && (c || a) && /* @__PURE__ */ m(
602
602
  "a",
603
603
  {
604
604
  href: c || "#",
@@ -627,7 +627,7 @@ function at({
627
627
  r.currentTarget.style.transform = "translateY(0)", r.currentTarget.style.boxShadow = "0 4px 12px rgba(16, 185, 129, 0.4)";
628
628
  },
629
629
  children: [
630
- l,
630
+ o,
631
631
  /* @__PURE__ */ t("span", { children: "→" })
632
632
  ]
633
633
  }
@@ -635,23 +635,23 @@ function at({
635
635
  ] })
636
636
  ] });
637
637
  }
638
- function be({
638
+ function ne({
639
639
  icon: e,
640
640
  title: n = "暂无数据",
641
641
  description: s,
642
- actionText: l,
642
+ actionText: o,
643
643
  onAction: c,
644
644
  size: a = "md",
645
645
  style: r
646
646
  }) {
647
- const o = { sm: 24, md: 40, lg: 64 }, i = { sm: 14, md: 16, lg: 20 };
647
+ const l = { sm: 24, md: 40, lg: 64 }, i = { sm: 14, md: 16, lg: 20 };
648
648
  return /* @__PURE__ */ m(
649
649
  "div",
650
650
  {
651
651
  role: "status",
652
652
  "aria-live": "polite",
653
653
  style: {
654
- padding: o[a] || o.md,
654
+ padding: l[a] || l.md,
655
655
  textAlign: "center",
656
656
  background: "#ffffff",
657
657
  borderRadius: C.md,
@@ -684,7 +684,7 @@ function be({
684
684
  maxWidth: 360,
685
685
  margin: "0 auto 16px"
686
686
  }, children: s }),
687
- l && c && /* @__PURE__ */ t(
687
+ o && c && /* @__PURE__ */ t(
688
688
  V,
689
689
  {
690
690
  type: "primary",
@@ -694,39 +694,39 @@ function be({
694
694
  border: "none",
695
695
  minHeight: 36
696
696
  },
697
- children: l
697
+ children: o
698
698
  }
699
699
  )
700
700
  ]
701
701
  }
702
702
  );
703
703
  }
704
- function We({
704
+ function $e({
705
705
  error: e,
706
706
  title: n = "加载失败",
707
707
  description: s,
708
- onRetry: l,
708
+ onRetry: o,
709
709
  retryText: c = "重新加载",
710
710
  variant: a = "inline",
711
711
  style: r
712
712
  }) {
713
713
  var p;
714
- const o = a === "full", i = (p = e == null ? void 0 : e.response) == null ? void 0 : p.data, d = i && typeof i == "object" && (typeof i.message == "string" && i.message || typeof i.msg == "string" && i.msg) || null, f = d || (typeof e == "string" ? e : (e == null ? void 0 : e.message) || (e == null ? void 0 : e.msg) || (e ? String(e) : null)), g = s || (d ? `原因: ${d}` : f ? `原因: ${f}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
714
+ const l = a === "full", i = (p = e == null ? void 0 : e.response) == null ? void 0 : p.data, d = i && typeof i == "object" && (typeof i.message == "string" && i.message || typeof i.msg == "string" && i.msg) || null, f = d || (typeof e == "string" ? e : (e == null ? void 0 : e.message) || (e == null ? void 0 : e.msg) || (e ? String(e) : null)), g = s || (d ? `原因: ${d}` : f ? `原因: ${f}。请检查网络或稍后重试。` : "请检查网络或稍后重试。");
715
715
  return /* @__PURE__ */ m(
716
716
  "div",
717
717
  {
718
718
  role: "alert",
719
719
  "aria-live": "assertive",
720
720
  style: {
721
- padding: o ? "48px 24px" : "20px 24px",
722
- background: o ? "#ffffff" : "#fef2f2",
723
- border: o ? `1px dashed ${x.border}` : "1px solid #fecaca",
721
+ padding: l ? "48px 24px" : "20px 24px",
722
+ background: l ? "#ffffff" : "#fef2f2",
723
+ border: l ? `1px dashed ${x.border}` : "1px solid #fecaca",
724
724
  borderRadius: C.md,
725
- textAlign: o ? "center" : "left",
725
+ textAlign: l ? "center" : "left",
726
726
  display: "flex",
727
- flexDirection: o ? "column" : "row",
728
- alignItems: o ? "center" : "flex-start",
729
- gap: o ? 12 : 16,
727
+ flexDirection: l ? "column" : "row",
728
+ alignItems: l ? "center" : "flex-start",
729
+ gap: l ? 12 : 16,
730
730
  ...r
731
731
  },
732
732
  children: [
@@ -734,17 +734,17 @@ function We({
734
734
  display: "inline-flex",
735
735
  alignItems: "center",
736
736
  justifyContent: "center",
737
- width: o ? 56 : 36,
738
- height: o ? 56 : 36,
737
+ width: l ? 56 : 36,
738
+ height: l ? 56 : 36,
739
739
  borderRadius: "50%",
740
- background: o ? "#fef2f2" : "#ffffff",
740
+ background: l ? "#fef2f2" : "#ffffff",
741
741
  color: "#dc2626",
742
- fontSize: o ? 28 : 18,
742
+ fontSize: l ? 28 : 18,
743
743
  flexShrink: 0
744
- }, children: /* @__PURE__ */ t(ze, {}) }),
744
+ }, children: /* @__PURE__ */ t(Ae, {}) }),
745
745
  /* @__PURE__ */ m("div", { style: { flex: 1, minWidth: 0 }, children: [
746
746
  /* @__PURE__ */ t("div", { style: {
747
- fontSize: o ? 16 : 14,
747
+ fontSize: l ? 16 : 14,
748
748
  fontWeight: 600,
749
749
  color: "#991b1b",
750
750
  marginBottom: 4
@@ -755,14 +755,14 @@ function We({
755
755
  lineHeight: 1.6,
756
756
  wordBreak: "break-word"
757
757
  }, children: g }),
758
- l && /* @__PURE__ */ t(
758
+ o && /* @__PURE__ */ t(
759
759
  V,
760
760
  {
761
761
  type: "primary",
762
762
  danger: !0,
763
763
  icon: /* @__PURE__ */ t(re, {}),
764
- onClick: l,
765
- size: o ? "middle" : "small",
764
+ onClick: o,
765
+ size: l ? "middle" : "small",
766
766
  style: { marginTop: 12 },
767
767
  children: c
768
768
  }
@@ -772,11 +772,11 @@ function We({
772
772
  }
773
773
  );
774
774
  }
775
- function st({
775
+ function gt({
776
776
  variant: e = "cards",
777
777
  rows: n = 4,
778
778
  active: s = !0,
779
- style: l
779
+ style: o
780
780
  }) {
781
781
  return e === "cards" ? /* @__PURE__ */ t(
782
782
  "div",
@@ -788,7 +788,7 @@ function st({
788
788
  display: "grid",
789
789
  gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))",
790
790
  gap: 16,
791
- ...l
791
+ ...o
792
792
  },
793
793
  children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
794
794
  "div",
@@ -823,11 +823,11 @@ function st({
823
823
  background: "#ffffff",
824
824
  padding: 24,
825
825
  borderRadius: C.md,
826
- ...l
826
+ ...o
827
827
  },
828
828
  children: /* @__PURE__ */ t(_, { active: s, paragraph: { rows: n } })
829
829
  }
830
- ) : e === "list" ? /* @__PURE__ */ t("div", { role: "status", "aria-busy": "true", "aria-label": "加载中", style: l, children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
830
+ ) : e === "list" ? /* @__PURE__ */ t("div", { role: "status", "aria-busy": "true", "aria-label": "加载中", style: o, children: Array.from({ length: n }).map((c, a) => /* @__PURE__ */ m(
831
831
  "div",
832
832
  {
833
833
  style: {
@@ -853,58 +853,58 @@ function st({
853
853
  background: "#ffffff",
854
854
  padding: 32,
855
855
  borderRadius: C.md,
856
- ...l
856
+ ...o
857
857
  },
858
858
  children: /* @__PURE__ */ t(_, { active: s, title: { width: "40%" }, paragraph: { rows: n } })
859
859
  }
860
860
  );
861
861
  }
862
- function ct({
862
+ function We({
863
863
  value: e,
864
864
  onChange: n,
865
865
  onSearch: s,
866
- placeholder: l = "搜索...",
866
+ placeholder: o = "搜索...",
867
867
  debounceMs: c = 300,
868
868
  width: a = 280,
869
869
  allowClear: r = !0,
870
870
  // antd v6: enterButton 已被废弃,SearchInput 已通过 onKeyDown 自行处理 Enter 键,
871
871
  // 所以从 rest 里过滤掉,避免透传到原生 <input> 报 React 警告。
872
- enterButton: o,
872
+ enterButton: l,
873
873
  ...i
874
874
  }) {
875
- const [d, f] = A(e || ""), g = M(null), p = M(e || "");
876
- D(() => {
875
+ const [d, f] = B(e || ""), g = N(null), p = N(e || "");
876
+ L(() => {
877
877
  e !== void 0 && e !== d && (f(e || ""), p.current = e || "");
878
- }, [e]), D(() => () => {
878
+ }, [e]), L(() => () => {
879
879
  g.current && clearTimeout(g.current);
880
880
  }, []);
881
881
  const h = (S) => {
882
882
  p.current = S, n && n(S);
883
- }, w = (S) => {
884
- const k = S.target.value;
885
- if (f(k), g.current && clearTimeout(g.current), k === "") {
883
+ }, k = (S) => {
884
+ const w = S.target.value;
885
+ if (f(w), g.current && clearTimeout(g.current), w === "") {
886
886
  h("");
887
887
  return;
888
888
  }
889
- g.current = setTimeout(() => h(k), c);
889
+ g.current = setTimeout(() => h(w), c);
890
890
  }, v = (S) => {
891
891
  g.current && clearTimeout(g.current), h(S), s && s(S);
892
892
  };
893
893
  return /* @__PURE__ */ t(
894
- Ce,
894
+ Te,
895
895
  {
896
896
  ...i,
897
897
  value: d,
898
- onChange: w,
898
+ onChange: k,
899
899
  onPressEnter: v,
900
900
  onKeyDown: (S) => {
901
901
  S.key === "Enter" ? (S.preventDefault(), v(d)) : S.key === "Escape" && (f(""), v(""));
902
902
  },
903
- placeholder: l,
903
+ placeholder: o,
904
904
  allowClear: r ? { clearIcon: /* @__PURE__ */ t("span", { onClick: () => {
905
905
  f(""), v("");
906
906
  }, children: "×" }) } : !1,
907
- prefix: /* @__PURE__ */ t(Ae, { style: { color: "#9ca3af" } }),
907
+ prefix: /* @__PURE__ */ t(ze, { style: { color: "#9ca3af" } }),
908
908
  style: {
909
909
  width: a,
910
910
  borderRadius: C.md,
@@ -913,15 +913,94 @@ function ct({
913
913
  }
914
914
  );
915
915
  }
916
- function me({
916
+ function Me(e, n, s) {
917
+ const o = Array.isArray(e) ? e : [], c = String(s ?? "").trim().toLowerCase();
918
+ if (!c) return o;
919
+ const a = (Array.isArray(n) ? n : String(n || "").split(",")).map((r) => String(r || "").trim()).filter(Boolean);
920
+ return a.length ? o.filter((r) => !r || typeof r != "object" ? !1 : a.some((l) => {
921
+ const i = r[l];
922
+ return i == null ? !1 : String(i).toLowerCase().includes(c);
923
+ })) : o;
924
+ }
925
+ function He(e, n) {
926
+ const [s, o] = B(""), c = (Array.isArray(n) ? n.join(",") : String(n || "")).trim(), a = q(
927
+ () => Me(e, c, s),
928
+ [e, c, s]
929
+ ), r = be(() => o(""), []);
930
+ return { keyword: s, setKeyword: o, filtered: a, reset: r };
931
+ }
932
+ const Ne = {
933
+ pageSize: 10,
934
+ showSizeChanger: !0,
935
+ pageSizeOptions: ["10", "20", "50", "100"],
936
+ showTotal: (e) => `共 ${e} 条`
937
+ };
938
+ function ut({
939
+ rows: e,
940
+ columns: n,
941
+ rowKey: s,
942
+ loading: o,
943
+ searchKeys: c,
944
+ searchPlaceholder: a = "过滤",
945
+ searchWidth: r = 220,
946
+ cardTitle: l,
947
+ cardExtra: i,
948
+ emptyTitle: d = "暂无数据",
949
+ emptyDescription: f,
950
+ emptyActionText: g,
951
+ emptyOnAction: p,
952
+ pagination: h = Ne,
953
+ cardProps: k = {},
954
+ tableProps: v = {},
955
+ ...I
956
+ }) {
957
+ const { keyword: b, setKeyword: S, filtered: w } = He(e, c), A = c ? /* @__PURE__ */ t(
958
+ We,
959
+ {
960
+ allowClear: !0,
961
+ width: r,
962
+ placeholder: a,
963
+ value: b,
964
+ onChange: S
965
+ }
966
+ ) : null;
967
+ return /* @__PURE__ */ t(me, { title: l, extra: A && i ? /* @__PURE__ */ m("span", { style: { display: "inline-flex", alignItems: "center", gap: 8 }, children: [
968
+ A,
969
+ i
970
+ ] }) : A || i, ...k, children: /* @__PURE__ */ t(
971
+ ye,
972
+ {
973
+ rowKey: s,
974
+ columns: n,
975
+ dataSource: w,
976
+ loading: o,
977
+ size: "small",
978
+ pagination: h,
979
+ locale: {
980
+ emptyText: /* @__PURE__ */ t(
981
+ ne,
982
+ {
983
+ title: d,
984
+ description: f,
985
+ actionText: g,
986
+ onAction: p
987
+ }
988
+ )
989
+ },
990
+ ...v,
991
+ ...I
992
+ }
993
+ ) });
994
+ }
995
+ function ve({
917
996
  title: e,
918
997
  subtitle: n,
919
998
  breadcrumb: s,
920
- extra: l,
999
+ extra: o,
921
1000
  back: c,
922
1001
  onBack: a
923
1002
  }) {
924
- const r = he();
1003
+ const r = xe();
925
1004
  return /* @__PURE__ */ t("div", { style: {
926
1005
  marginBottom: 12,
927
1006
  paddingBottom: 10,
@@ -972,7 +1051,7 @@ function me({
972
1051
  }
973
1052
  ),
974
1053
  s && s.length > 0 ? /* @__PURE__ */ t(
975
- Re,
1054
+ Ee,
976
1055
  {
977
1056
  items: s.map((i, d) => {
978
1057
  const f = d === s.length - 1;
@@ -1002,14 +1081,14 @@ function me({
1002
1081
  maxWidth: 360
1003
1082
  }, children: n })
1004
1083
  ] }),
1005
- l && /* @__PURE__ */ t("div", { style: {
1084
+ o && /* @__PURE__ */ t("div", { style: {
1006
1085
  display: "flex",
1007
1086
  gap: 8,
1008
1087
  flexShrink: 0
1009
- }, children: l })
1088
+ }, children: o })
1010
1089
  ] }) });
1011
1090
  }
1012
- function dt({ left: e, right: n, extra: s }) {
1091
+ function pt({ left: e, right: n, extra: s }) {
1013
1092
  return /* @__PURE__ */ m(
1014
1093
  "div",
1015
1094
  {
@@ -1022,8 +1101,8 @@ function dt({ left: e, right: n, extra: s }) {
1022
1101
  flexWrap: "wrap"
1023
1102
  },
1024
1103
  children: [
1025
- /* @__PURE__ */ t(ae, { size: 8, wrap: !0, children: e }),
1026
- /* @__PURE__ */ m(ae, { size: 8, wrap: !0, children: [
1104
+ /* @__PURE__ */ t(se, { size: 8, wrap: !0, children: e }),
1105
+ /* @__PURE__ */ m(se, { size: 8, wrap: !0, children: [
1027
1106
  n,
1028
1107
  s
1029
1108
  ] })
@@ -1031,72 +1110,72 @@ function dt({ left: e, right: n, extra: s }) {
1031
1110
  }
1032
1111
  );
1033
1112
  }
1034
- function ft({ onClick: e, loading: n, title: s = "刷新" }) {
1113
+ function ht({ onClick: e, loading: n, title: s = "刷新" }) {
1035
1114
  return /* @__PURE__ */ t(V, { icon: /* @__PURE__ */ t(re, {}), onClick: e, loading: n, title: s, children: s });
1036
1115
  }
1037
- const Le = {
1116
+ const Pe = {
1038
1117
  0: { label: "待办", color: "default" },
1039
1118
  1: { label: "进行中", color: "blue" },
1040
1119
  2: { label: "已完成", color: "green" }
1041
- }, Me = {
1120
+ }, _e = {
1042
1121
  ACTIVE: { label: "正常", color: "green" },
1043
1122
  INACTIVE: { label: "禁用", color: "red" },
1044
1123
  ENABLED: { label: "启用", color: "green" },
1045
1124
  DISABLED: { label: "禁用", color: "red" }
1046
- }, He = {
1125
+ }, Oe = {
1047
1126
  low: { label: "低", color: "default" },
1048
1127
  medium: { label: "中", color: "orange" },
1049
1128
  high: { label: "高", color: "red" },
1050
1129
  1: { label: "低", color: "default" },
1051
1130
  2: { label: "中", color: "orange" },
1052
1131
  3: { label: "高", color: "red" }
1053
- }, Pe = {
1132
+ }, Fe = {
1054
1133
  PENDING: { label: "待审批", color: "orange" },
1055
1134
  APPROVED: { label: "已通过", color: "green" },
1056
1135
  REJECTED: { label: "已拒绝", color: "red" },
1057
1136
  CANCELLED: { label: "已撤回", color: "default" }
1058
- }, Ne = {
1137
+ }, je = {
1059
1138
  RUNNING: { label: "运行中", color: "green" },
1060
1139
  PAUSED: { label: "已暂停", color: "orange" },
1061
1140
  STOPPED: { label: "已停止", color: "default" },
1062
1141
  FAILED: { label: "失败", color: "red" },
1063
1142
  SUCCESS: { label: "成功", color: "green" }
1064
- }, _e = {
1065
- task: Le,
1066
- model: Me,
1067
- priority: He,
1068
- approval: Pe,
1069
- schedule: Ne
1143
+ }, qe = {
1144
+ task: Pe,
1145
+ model: _e,
1146
+ priority: Oe,
1147
+ approval: Fe,
1148
+ schedule: je
1070
1149
  };
1071
- function gt({ status: e, type: n = "task", mapping: s, ...l }) {
1072
- const a = (s || _e[n] || {})[e];
1073
- return a ? /* @__PURE__ */ t(se, { color: a.color, ...l, children: a.label }) : /* @__PURE__ */ t(se, { ...l, children: String(e) });
1150
+ function bt({ status: e, type: n = "task", mapping: s, ...o }) {
1151
+ const a = (s || qe[n] || {})[e];
1152
+ return a ? /* @__PURE__ */ t(ce, { color: a.color, ...o, children: a.label }) : /* @__PURE__ */ t(ce, { ...o, children: String(e) });
1074
1153
  }
1075
- function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", extra: a, expandable: r }) {
1076
- const [o, i] = A([]), [d, f] = A({ current: 1, size: 10, total: null }), [g, p] = A(!1), [h, w] = A(null), v = ke(async (b = d.current, S = d.size) => {
1077
- p(!0), w(null);
1154
+ function mt({ title: e, description: n, load: s, columns: o, rowKey: c = "id", extra: a, expandable: r }) {
1155
+ const [l, i] = B([]), [d, f] = B({ current: 1, size: 10, total: null }), [g, p] = B(!1), [h, k] = B(null), v = be(async (b = d.current, S = d.size) => {
1156
+ p(!0), k(null);
1078
1157
  try {
1079
- const k = await s(b, S);
1080
- if (Array.isArray(k))
1081
- i(k || []), f({ current: b, size: S, total: k.length });
1158
+ const w = await s(b, S);
1159
+ if (Array.isArray(w))
1160
+ i(w || []), f({ current: b, size: S, total: w.length });
1082
1161
  else {
1083
- const P = (k == null ? void 0 : k.records) || [];
1084
- i(P), f({ current: b, size: S, total: (k == null ? void 0 : k.total) == null ? null : Number(k.total) });
1162
+ const A = (w == null ? void 0 : w.records) || [];
1163
+ i(A), f({ current: b, size: S, total: (w == null ? void 0 : w.total) == null ? null : Number(w.total) });
1085
1164
  }
1086
- } catch (k) {
1087
- i([]), w(k);
1165
+ } catch (w) {
1166
+ i([]), k(w);
1088
1167
  } finally {
1089
1168
  p(!1);
1090
1169
  }
1091
1170
  }, [s, d.current, d.size]);
1092
- D(() => {
1171
+ L(() => {
1093
1172
  v(1);
1094
1173
  }, []);
1095
- const B = d.total != null && d.total > 0;
1174
+ const I = d.total != null && d.total > 0;
1096
1175
  return /* @__PURE__ */ m("div", { children: [
1097
- /* @__PURE__ */ t(me, { title: e, subtitle: n }),
1176
+ /* @__PURE__ */ t(ve, { title: e, subtitle: n }),
1098
1177
  /* @__PURE__ */ m(
1099
- Te,
1178
+ me,
1100
1179
  {
1101
1180
  extra: /* @__PURE__ */ t(
1102
1181
  V,
@@ -1109,24 +1188,24 @@ function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", e
1109
1188
  ),
1110
1189
  children: [
1111
1190
  a,
1112
- h ? /* @__PURE__ */ t(We, { error: h, onRetry: () => v(d.current, d.size), type: "inline" }) : /* @__PURE__ */ t(
1113
- Ee,
1191
+ h ? /* @__PURE__ */ t($e, { error: h, onRetry: () => v(d.current, d.size), type: "inline" }) : /* @__PURE__ */ t(
1192
+ ye,
1114
1193
  {
1115
1194
  size: "small",
1116
- columns: l,
1117
- dataSource: o,
1195
+ columns: o,
1196
+ dataSource: l,
1118
1197
  loading: g,
1119
1198
  rowKey: (b) => (b == null ? void 0 : b[c]) ?? (b == null ? void 0 : b.key) ?? JSON.stringify(b).slice(0, 32),
1120
1199
  pagination: {
1121
1200
  current: d.current,
1122
1201
  pageSize: d.size,
1123
- total: B ? d.total : o.length,
1202
+ total: I ? d.total : l.length,
1124
1203
  showSizeChanger: !0,
1125
- showTotal: () => B ? `共 ${d.total} 条` : `本页 ${o.length} 条(接口 total 未返回有效值)`
1204
+ showTotal: () => I ? `共 ${d.total} 条` : `本页 ${l.length} 条(接口 total 未返回有效值)`
1126
1205
  },
1127
1206
  onChange: (b) => v(b.current, b.pageSize),
1128
1207
  expandable: r,
1129
- locale: { emptyText: /* @__PURE__ */ t(be, { title: "暂无数据", description: "接口返回空列表" }) }
1208
+ locale: { emptyText: /* @__PURE__ */ t(ne, { title: "暂无数据", description: "接口返回空列表" }) }
1130
1209
  }
1131
1210
  )
1132
1211
  ]
@@ -1134,104 +1213,104 @@ function ut({ title: e, description: n, load: s, columns: l, rowKey: c = "id", e
1134
1213
  )
1135
1214
  ] });
1136
1215
  }
1137
- const Oe = 240, de = 96, Fe = { behavior: "smooth", block: "start" }, je = `
1216
+ const Ge = 240, fe = 96, Ue = { behavior: "smooth", block: "start" }, Ye = `
1138
1217
  .zfc-doc-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
1139
1218
  @media (max-width: 800px) { .zfc-doc-table-wrap > table { min-width: 520px; } }
1140
- `, qe = (e) => String(e || "").trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\p{L}\p{N}\p{M}\p{Pc}-]/gu, "").replace(/-+/g, "-").replace(/^-|-$/g, ""), ne = (e) => String(e || "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]*)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/__([^_]+)__/g, "$1").replace(/\*([^*]+)\*/g, "$1").trim(), ye = () => {
1219
+ `, Ke = (e) => String(e || "").trim().toLowerCase().replace(/\s+/g, "-").replace(/[^\p{L}\p{N}\p{M}\p{Pc}-]/gu, "").replace(/-+/g, "-").replace(/^-|-$/g, ""), ie = (e) => String(e || "").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]*)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/__([^_]+)__/g, "$1").replace(/\*([^*]+)\*/g, "$1").trim(), Se = () => {
1141
1220
  const e = /* @__PURE__ */ new Map();
1142
1221
  let n = 0;
1143
1222
  return (s) => {
1144
1223
  n += 1;
1145
- const l = qe(s) || `section-${n}`, c = e.get(l) || 0;
1146
- return e.set(l, c + 1), c > 0 ? `${l}-${c}` : l;
1224
+ const o = Ke(s) || `section-${n}`, c = e.get(o) || 0;
1225
+ return e.set(o, c + 1), c > 0 ? `${o}-${c}` : o;
1147
1226
  };
1148
- }, Ye = (e) => {
1149
- const n = [], s = ye();
1150
- let l = !1;
1227
+ }, Ve = (e) => {
1228
+ const n = [], s = Se();
1229
+ let o = !1;
1151
1230
  for (const c of String(e || "").split(`
1152
1231
  `)) {
1153
1232
  const a = c.replace(/\s+$/, "");
1154
1233
  if (/^\s*(```|~~~)/.test(a)) {
1155
- l = !l;
1234
+ o = !o;
1156
1235
  continue;
1157
1236
  }
1158
- if (l) continue;
1237
+ if (o) continue;
1159
1238
  const r = /^(#{1,6})[ \t]+(.+?)[ \t]*#*[ \t]*$/.exec(a);
1160
1239
  if (!r) continue;
1161
- const o = r[1].length;
1162
- if (o > 3) continue;
1163
- const i = ne(r[2]);
1164
- i && n.push({ level: o, text: i, id: s(i) });
1240
+ const l = r[1].length;
1241
+ if (l > 3) continue;
1242
+ const i = ie(r[2]);
1243
+ i && n.push({ level: l, text: i, id: s(i) });
1165
1244
  }
1166
1245
  return n;
1167
- }, X = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(X).join("") : e.props ? X(e.props.children) : "", fe = (e) => String(e).replace(/["\\]/g, "\\$&"), ge = (e, n = Fe) => !e || typeof e.scrollIntoView != "function" ? !1 : (e.scrollIntoView(n), !0), Z = /^\s*(`{3,}|~{3,})\s*([\w+#-]*)\s*$/, ee = /^(#{1,6})\s+(.*?)\s*#*$/, te = /^\s*([-*_])\s*(\1\s*){2,}$/, F = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/, U = /^\s*>\s?(.*)$/, Ge = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
1246
+ }, X = (e) => e == null || typeof e == "boolean" ? "" : typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(X).join("") : e.props ? X(e.props.children) : "", ge = (e) => String(e).replace(/["\\]/g, "\\$&"), ue = (e, n = Ue) => !e || typeof e.scrollIntoView != "function" ? !1 : (e.scrollIntoView(n), !0), Z = /^\s*(`{3,}|~{3,})\s*([\w+#-]*)\s*$/, ee = /^(#{1,6})\s+(.*?)\s*#*$/, te = /^\s*([-*_])\s*(\1\s*){2,}$/, F = /^(\s*)([-*+]|\d+[.)])(\s+)(.*)$/, Y = /^\s*>\s?(.*)$/, Je = /(!?\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)|`([^`]+)`|\*\*([^*]+)\*\*|__([^_]+)__|~~([^~]+)~~|\*([^*\n]+)\*|<((?:https?:\/\/|mailto:)[^>\s]+)>)/g, K = (e) => {
1168
1247
  let n = String(e).trim();
1169
1248
  return n.startsWith("|") && (n = n.slice(1)), n.endsWith("|") && (n = n.slice(0, -1)), n.split("|").map((s) => s.trim());
1170
- }, Ue = (e) => {
1249
+ }, Qe = (e) => {
1171
1250
  if (!String(e).includes("-")) return !1;
1172
1251
  const n = K(e);
1173
1252
  return n.length > 0 && n.every((s) => /^:?-+:?$/.test(s));
1174
- }, Ke = (e) => {
1253
+ }, Xe = (e) => {
1175
1254
  const n = e.startsWith(":"), s = e.endsWith(":");
1176
1255
  return n && s ? "center" : s ? "right" : "left";
1177
- }, Ve = (e, n) => {
1178
- const s = F.exec(e[n]), l = /\d/.test(s[2]), c = [];
1256
+ }, Ze = (e, n) => {
1257
+ const s = F.exec(e[n]), o = /\d/.test(s[2]), c = [];
1179
1258
  let a = n;
1180
1259
  for (; a < e.length; ) {
1181
1260
  const r = F.exec(e[a]);
1182
1261
  if (!r) break;
1183
- const o = r[1].length, i = o + r[2].length + r[3].length, d = [r[4]];
1262
+ const l = r[1].length, i = l + r[2].length + r[3].length, d = [r[4]];
1184
1263
  for (a += 1; a < e.length; ) {
1185
1264
  const f = e[a];
1186
1265
  if (!f.trim()) {
1187
1266
  let h = a;
1188
1267
  for (; h < e.length && !e[h].trim(); ) h += 1;
1189
- const w = h < e.length ? F.exec(e[h]) : null;
1190
- if (w && w[1].length >= o) {
1268
+ const k = h < e.length ? F.exec(e[h]) : null;
1269
+ if (k && k[1].length >= l) {
1191
1270
  a = h;
1192
1271
  continue;
1193
1272
  }
1194
1273
  break;
1195
1274
  }
1196
1275
  const g = /^[ \t]*/.exec(f)[0].length, p = F.exec(f);
1197
- if (p && p[1].length <= o) break;
1276
+ if (p && p[1].length <= l) break;
1198
1277
  if (g >= i) {
1199
1278
  d.push(f.slice(i)), a += 1;
1200
1279
  continue;
1201
1280
  }
1202
- if (g > o) {
1281
+ if (g > l) {
1203
1282
  d.push(f.slice(g)), a += 1;
1204
1283
  continue;
1205
1284
  }
1206
- if (!p && !Z.test(f) && !ee.test(f) && !te.test(f) && !U.test(f)) {
1285
+ if (!p && !Z.test(f) && !ee.test(f) && !te.test(f) && !Y.test(f)) {
1207
1286
  d.push(f.trim()), a += 1;
1208
1287
  continue;
1209
1288
  }
1210
1289
  break;
1211
1290
  }
1212
- c.push({ blocks: xe(d, !0) });
1291
+ c.push({ blocks: we(d, !0) });
1213
1292
  }
1214
- return { block: { type: "list", ordered: l, items: c }, next: a };
1293
+ return { block: { type: "list", ordered: o, items: c }, next: a };
1215
1294
  };
1216
- function xe(e, n = !1) {
1295
+ function we(e, n = !1) {
1217
1296
  const s = [];
1218
- let l = 0;
1219
- for (; l < e.length; ) {
1220
- const c = e[l];
1297
+ let o = 0;
1298
+ for (; o < e.length; ) {
1299
+ const c = e[o];
1221
1300
  if (!c.trim()) {
1222
- l += 1;
1301
+ o += 1;
1223
1302
  continue;
1224
1303
  }
1225
1304
  const a = Z.exec(c);
1226
1305
  if (a) {
1227
1306
  const i = a[1][0], d = a[1].length, f = [];
1228
- for (l += 1; l < e.length; ) {
1229
- const g = e[l];
1307
+ for (o += 1; o < e.length; ) {
1308
+ const g = e[o];
1230
1309
  if (new RegExp(`^\\s*\\${i}{${d},}\\s*$`).test(g)) {
1231
- l += 1;
1310
+ o += 1;
1232
1311
  break;
1233
1312
  }
1234
- f.push(g), l += 1;
1313
+ f.push(g), o += 1;
1235
1314
  }
1236
1315
  s.push({ type: "code", lang: a[2] || "", text: f.join(`
1237
1316
  `) });
@@ -1239,104 +1318,104 @@ function xe(e, n = !1) {
1239
1318
  }
1240
1319
  const r = ee.exec(c);
1241
1320
  if (r) {
1242
- if (l += 1, !ne(r[2]).trim()) continue;
1321
+ if (o += 1, !ie(r[2]).trim()) continue;
1243
1322
  n ? s.push({ type: "paragraph", text: r[2] }) : s.push({ type: "heading", level: r[1].length, text: r[2] });
1244
1323
  continue;
1245
1324
  }
1246
1325
  if (te.test(c)) {
1247
- s.push({ type: "hr" }), l += 1;
1326
+ s.push({ type: "hr" }), o += 1;
1248
1327
  continue;
1249
1328
  }
1250
- if (c.includes("|") && l + 1 < e.length && Ue(e[l + 1])) {
1251
- const i = K(c), d = K(e[l + 1]).map(Ke);
1252
- l += 2;
1329
+ if (c.includes("|") && o + 1 < e.length && Qe(e[o + 1])) {
1330
+ const i = K(c), d = K(e[o + 1]).map(Xe);
1331
+ o += 2;
1253
1332
  const f = [];
1254
- for (; l < e.length && e[l].trim() && e[l].includes("|"); )
1255
- f.push(K(e[l])), l += 1;
1333
+ for (; o < e.length && e[o].trim() && e[o].includes("|"); )
1334
+ f.push(K(e[o])), o += 1;
1256
1335
  s.push({ type: "table", header: i, aligns: d, rows: f });
1257
1336
  continue;
1258
1337
  }
1259
- if (U.test(c)) {
1338
+ if (Y.test(c)) {
1260
1339
  const i = [];
1261
- for (; l < e.length; ) {
1262
- const d = U.exec(e[l]);
1340
+ for (; o < e.length; ) {
1341
+ const d = Y.exec(e[o]);
1263
1342
  if (!d) break;
1264
- i.push(d[1]), l += 1;
1343
+ i.push(d[1]), o += 1;
1265
1344
  }
1266
1345
  s.push({ type: "quote", lines: i });
1267
1346
  continue;
1268
1347
  }
1269
1348
  if (F.test(c)) {
1270
- const i = Ve(e, l);
1271
- s.push(i.block), l = i.next;
1349
+ const i = Ze(e, o);
1350
+ s.push(i.block), o = i.next;
1272
1351
  continue;
1273
1352
  }
1274
- const o = [];
1275
- for (; l < e.length; ) {
1276
- const i = e[l];
1277
- if (!i.trim() || o.length && (Z.test(i) || ee.test(i) || te.test(i) || F.test(i) || U.test(i))) break;
1278
- o.push(i.trim()), l += 1;
1353
+ const l = [];
1354
+ for (; o < e.length; ) {
1355
+ const i = e[o];
1356
+ if (!i.trim() || l.length && (Z.test(i) || ee.test(i) || te.test(i) || F.test(i) || Y.test(i))) break;
1357
+ l.push(i.trim()), o += 1;
1279
1358
  }
1280
- s.push({ type: "paragraph", text: o.join(" ") });
1359
+ s.push({ type: "paragraph", text: l.join(" ") });
1281
1360
  }
1282
1361
  return s;
1283
1362
  }
1284
- const I = (e, n) => {
1363
+ const z = (e, n) => {
1285
1364
  const s = [];
1286
- let l = 0, c = 0;
1365
+ let o = 0, c = 0;
1287
1366
  const a = (r) => s.push(/* @__PURE__ */ t(O, { children: r }, `i${c++}`));
1288
- for (const r of e.matchAll(Ge)) {
1289
- if (r.index > l && a(e.slice(l, r.index)), r[1] !== void 0)
1367
+ for (const r of e.matchAll(Je)) {
1368
+ if (r.index > o && a(e.slice(o, r.index)), r[1] !== void 0)
1290
1369
  if (r[0].startsWith("!"))
1291
1370
  a(n.img ? n.img({ src: r[3], alt: r[2] }) : /* @__PURE__ */ t("img", { src: r[3], alt: r[2] || "" }));
1292
1371
  else {
1293
- const o = I(r[2], n);
1294
- a(n.a ? n.a({ href: r[3], children: o }) : /* @__PURE__ */ t("a", { href: r[3], children: o }));
1372
+ const l = z(r[2], n);
1373
+ a(n.a ? n.a({ href: r[3], children: l }) : /* @__PURE__ */ t("a", { href: r[3], children: l }));
1295
1374
  }
1296
- else r[4] !== void 0 ? a(n.code ? n.code({ children: r[4] }) : /* @__PURE__ */ t("code", { children: r[4] })) : r[5] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: I(r[5], n) })) : r[6] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: I(r[6], n) })) : r[7] !== void 0 ? a(/* @__PURE__ */ t("del", { children: I(r[7], n) })) : r[8] !== void 0 ? a(/* @__PURE__ */ t("em", { children: I(r[8], n) })) : r[9] !== void 0 && a(n.a ? n.a({ href: r[9], children: r[9] }) : /* @__PURE__ */ t("a", { href: r[9], children: r[9] }));
1297
- l = r.index + r[0].length;
1375
+ else r[4] !== void 0 ? a(n.code ? n.code({ children: r[4] }) : /* @__PURE__ */ t("code", { children: r[4] })) : r[5] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: z(r[5], n) })) : r[6] !== void 0 ? a(/* @__PURE__ */ t("strong", { children: z(r[6], n) })) : r[7] !== void 0 ? a(/* @__PURE__ */ t("del", { children: z(r[7], n) })) : r[8] !== void 0 ? a(/* @__PURE__ */ t("em", { children: z(r[8], n) })) : r[9] !== void 0 && a(n.a ? n.a({ href: r[9], children: r[9] }) : /* @__PURE__ */ t("a", { href: r[9], children: r[9] }));
1376
+ o = r.index + r[0].length;
1298
1377
  }
1299
- return l < e.length && a(e.slice(l)), s;
1300
- }, ve = (e, n, s) => {
1301
- const l = [];
1378
+ return o < e.length && a(e.slice(o)), s;
1379
+ }, ke = (e, n, s) => {
1380
+ const o = [];
1302
1381
  return e.forEach((c, a) => {
1303
- const r = `b${a}`, o = (i) => l.push(/* @__PURE__ */ t(O, { children: i }, r));
1382
+ const r = `b${a}`, l = (i) => o.push(/* @__PURE__ */ t(O, { children: i }, r));
1304
1383
  if (c.type === "heading") {
1305
- const i = Math.min(c.level, 6), d = `h${i}`, f = n[d], g = I(c.text, n), p = i <= 3 ? s(ne(c.text)) : void 0;
1306
- o(f ? f({ children: g, id: p }) : le(d, { id: p }, g));
1384
+ const i = Math.min(c.level, 6), d = `h${i}`, f = n[d], g = z(c.text, n), p = i <= 3 ? s(ie(c.text)) : void 0;
1385
+ l(f ? f({ children: g, id: p }) : ae(d, { id: p }, g));
1307
1386
  } else if (c.type === "paragraph") {
1308
- const i = I(c.text, n);
1309
- o(n.p ? n.p({ children: i }) : /* @__PURE__ */ t("p", { children: i }));
1387
+ const i = z(c.text, n);
1388
+ l(n.p ? n.p({ children: i }) : /* @__PURE__ */ t("p", { children: i }));
1310
1389
  } else if (c.type === "code") {
1311
1390
  const i = /* @__PURE__ */ t("code", { className: c.lang ? `language-${c.lang}` : void 0, children: c.text });
1312
- o(n.pre ? n.pre({ children: i }) : /* @__PURE__ */ t("pre", { children: i }));
1391
+ l(n.pre ? n.pre({ children: i }) : /* @__PURE__ */ t("pre", { children: i }));
1313
1392
  } else if (c.type === "list") {
1314
1393
  const i = c.ordered ? "ol" : "ul", d = n[i], f = c.items.map((g, p) => {
1315
- const h = ve(g.blocks, n, s), w = n.li ? n.li({ children: h }) : /* @__PURE__ */ t("li", { children: h });
1316
- return /* @__PURE__ */ t(O, { children: w }, `li${p}`);
1394
+ const h = ke(g.blocks, n, s), k = n.li ? n.li({ children: h }) : /* @__PURE__ */ t("li", { children: h });
1395
+ return /* @__PURE__ */ t(O, { children: k }, `li${p}`);
1317
1396
  });
1318
- o(d ? d({ children: f }) : le(i, null, f));
1397
+ l(d ? d({ children: f }) : ae(i, null, f));
1319
1398
  } else if (c.type === "table") {
1320
1399
  const i = /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: c.header.map((g, p) => {
1321
- const h = n.th ? n.th({ children: I(g, n), align: c.aligns[p] }) : /* @__PURE__ */ t("th", { children: g });
1400
+ const h = n.th ? n.th({ children: z(g, n), align: c.aligns[p] }) : /* @__PURE__ */ t("th", { children: g });
1322
1401
  return /* @__PURE__ */ t(O, { children: h }, `th${p}`);
1323
- }) }) }, "thead"), d = /* @__PURE__ */ t("tbody", { children: c.rows.map((g, p) => /* @__PURE__ */ t("tr", { children: g.map((h, w) => {
1324
- const v = n.td ? n.td({ children: I(h, n), align: c.aligns[w] }) : /* @__PURE__ */ t("td", { children: h });
1325
- return /* @__PURE__ */ t(O, { children: v }, `td${w}`);
1402
+ }) }) }, "thead"), d = /* @__PURE__ */ t("tbody", { children: c.rows.map((g, p) => /* @__PURE__ */ t("tr", { children: g.map((h, k) => {
1403
+ const v = n.td ? n.td({ children: z(h, n), align: c.aligns[k] }) : /* @__PURE__ */ t("td", { children: h });
1404
+ return /* @__PURE__ */ t(O, { children: v }, `td${k}`);
1326
1405
  }) }, `tr${p}`)) }, "tbody"), f = n.table ? n.table({ children: [i, d] }) : /* @__PURE__ */ t("table", { children: [i, d] });
1327
- o(f);
1406
+ l(f);
1328
1407
  } else if (c.type === "quote") {
1329
1408
  const i = c.lines.filter((d) => d.trim()).map((d, f) => {
1330
- const g = n.p ? n.p({ children: I(d, n) }) : /* @__PURE__ */ t("p", { children: d });
1409
+ const g = n.p ? n.p({ children: z(d, n) }) : /* @__PURE__ */ t("p", { children: d });
1331
1410
  return /* @__PURE__ */ t(O, { children: g }, `q${f}`);
1332
1411
  });
1333
- o(n.blockquote ? n.blockquote({ children: i }) : /* @__PURE__ */ t("blockquote", { children: i }));
1334
- } else c.type === "hr" && o(n.hr ? n.hr({}) : /* @__PURE__ */ t("hr", {}));
1335
- }), l;
1336
- }, Je = (e, n = {}) => ve(xe(String(e || "").split(`
1337
- `)), n, ye());
1338
- let ue = null;
1339
- const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s, onAnchorClick: l }) => {
1412
+ l(n.blockquote ? n.blockquote({ children: i }) : /* @__PURE__ */ t("blockquote", { children: i }));
1413
+ } else c.type === "hr" && l(n.hr ? n.hr({}) : /* @__PURE__ */ t("hr", {}));
1414
+ }), o;
1415
+ }, et = (e, n = {}) => ke(we(String(e || "").split(`
1416
+ `)), n, Se());
1417
+ let pe = null;
1418
+ const he = /* @__PURE__ */ new Set(), tt = ({ navigate: e, Prism: n, oneDark: s, onAnchorClick: o }) => {
1340
1419
  const c = {
1341
1420
  background: T.primarySoft,
1342
1421
  color: T.primary,
@@ -1346,7 +1425,7 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1346
1425
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace"
1347
1426
  };
1348
1427
  return {
1349
- h1: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h1", { ...o, style: {
1428
+ h1: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("h1", { ...l, style: {
1350
1429
  fontSize: 22,
1351
1430
  fontWeight: 700,
1352
1431
  margin: "8px 0 16px",
@@ -1354,56 +1433,56 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1354
1433
  paddingBottom: 8,
1355
1434
  scrollMarginTop: 16
1356
1435
  }, children: r }),
1357
- h2: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h2", { ...o, style: {
1436
+ h2: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("h2", { ...l, style: {
1358
1437
  fontSize: 18,
1359
1438
  fontWeight: 700,
1360
1439
  margin: "24px 0 12px",
1361
1440
  color: x.text,
1362
1441
  scrollMarginTop: 16
1363
1442
  }, children: r }),
1364
- h3: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("h3", { ...o, style: {
1443
+ h3: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("h3", { ...l, style: {
1365
1444
  fontSize: 15,
1366
1445
  fontWeight: 600,
1367
1446
  margin: "16px 0 8px",
1368
1447
  color: "#334155",
1369
1448
  scrollMarginTop: 16
1370
1449
  }, children: r }),
1371
- p: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("p", { ...o, style: { margin: "8px 0", color: "#1f2937" }, children: r }),
1372
- ul: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("ul", { ...o, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1373
- ol: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("ol", { ...o, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1374
- li: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("li", { ...o, style: { margin: "4px 0" }, children: r }),
1375
- blockquote: ({ node: a, children: r, ...o }) => /* @__PURE__ */ t("blockquote", { ...o, style: {
1450
+ p: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("p", { ...l, style: { margin: "8px 0", color: "#1f2937" }, children: r }),
1451
+ ul: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("ul", { ...l, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1452
+ ol: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("ol", { ...l, style: { margin: "8px 0", paddingLeft: 22 }, children: r }),
1453
+ li: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("li", { ...l, style: { margin: "4px 0" }, children: r }),
1454
+ blockquote: ({ node: a, children: r, ...l }) => /* @__PURE__ */ t("blockquote", { ...l, style: {
1376
1455
  margin: "12px 0",
1377
1456
  padding: "8px 14px",
1378
- borderLeft: `3px solid ${L.token.colorPrimary}`,
1457
+ borderLeft: `3px solid ${H.token.colorPrimary}`,
1379
1458
  background: T.primarySoft,
1380
1459
  color: "#475569",
1381
1460
  borderRadius: 4
1382
1461
  }, children: r }),
1383
1462
  hr: () => /* @__PURE__ */ t("hr", { style: { border: "none", borderTop: `1px solid ${x.border}`, margin: "20px 0" } }),
1384
- img: ({ node: a, src: r, alt: o, ...i }) => /* @__PURE__ */ t("img", { ...i, src: r, alt: o || "", style: { maxWidth: "100%", height: "auto", display: "block" } }),
1385
- table: ({ node: a, children: r, ...o }) => (
1463
+ img: ({ node: a, src: r, alt: l, ...i }) => /* @__PURE__ */ t("img", { ...i, src: r, alt: l || "", style: { maxWidth: "100%", height: "auto", display: "block" } }),
1464
+ table: ({ node: a, children: r, ...l }) => (
1386
1465
  // §7:窄屏表格要能横向滚动,不能把列挤成一团
1387
- /* @__PURE__ */ t("div", { className: "zfc-doc-table-wrap", children: /* @__PURE__ */ t("table", { ...o, style: { width: "100%", borderCollapse: "collapse", fontSize: 13 }, children: r }) })
1466
+ /* @__PURE__ */ t("div", { className: "zfc-doc-table-wrap", children: /* @__PURE__ */ t("table", { ...l, style: { width: "100%", borderCollapse: "collapse", fontSize: 13 }, children: r }) })
1388
1467
  ),
1389
- th: ({ node: a, children: r, align: o, ...i }) => /* @__PURE__ */ t("th", { ...i, style: {
1468
+ th: ({ node: a, children: r, align: l, ...i }) => /* @__PURE__ */ t("th", { ...i, style: {
1390
1469
  padding: "8px 10px",
1391
1470
  background: x.surfaceAlt,
1392
1471
  border: `1px solid ${x.border}`,
1393
- textAlign: o || "left",
1472
+ textAlign: l || "left",
1394
1473
  fontWeight: 600,
1395
1474
  color: "#334155"
1396
1475
  }, children: r }),
1397
- td: ({ node: a, children: r, align: o, ...i }) => /* @__PURE__ */ t("td", { ...i, style: {
1476
+ td: ({ node: a, children: r, align: l, ...i }) => /* @__PURE__ */ t("td", { ...i, style: {
1398
1477
  padding: "8px 10px",
1399
1478
  border: `1px solid ${x.border}`,
1400
- textAlign: o || "left",
1479
+ textAlign: l || "left",
1401
1480
  color: "#1f2937"
1402
1481
  }, children: r }),
1403
1482
  pre: ({ node: a, children: r }) => {
1404
- const o = Array.isArray(r) ? r[0] : r;
1405
- o && o.props && o.props.className;
1406
- const i = X(o).replace(/\n$/, "");
1483
+ const l = Array.isArray(r) ? r[0] : r;
1484
+ l && l.props && l.props.className;
1485
+ const i = X(l).replace(/\n$/, "");
1407
1486
  return /* @__PURE__ */ t("pre", { style: {
1408
1487
  margin: "12px 0",
1409
1488
  padding: "12px 14px",
@@ -1414,8 +1493,8 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1414
1493
  fontSize: 13
1415
1494
  }, children: /* @__PURE__ */ t("code", { style: { background: "transparent", color: "inherit", padding: 0, fontSize: "inherit" }, children: i }) });
1416
1495
  },
1417
- code: ({ node: a, className: r, children: o, ...i }) => /* @__PURE__ */ t("code", { ...i, className: r, style: c, children: o }),
1418
- a: ({ node: a, href: r, children: o, ...i }) => {
1496
+ code: ({ node: a, className: r, children: l, ...i }) => /* @__PURE__ */ t("code", { ...i, className: r, style: c, children: l }),
1497
+ a: ({ node: a, href: r, children: l, ...i }) => {
1419
1498
  const d = r || "";
1420
1499
  return /^https?:\/\//i.test(d) || d.startsWith("//") ? /* @__PURE__ */ t(
1421
1500
  "a",
@@ -1424,128 +1503,128 @@ const pe = /* @__PURE__ */ new Set(), Qe = ({ navigate: e, Prism: n, oneDark: s,
1424
1503
  href: d,
1425
1504
  target: "_blank",
1426
1505
  rel: "noopener noreferrer",
1427
- style: { color: L.token.colorPrimary },
1428
- children: o
1506
+ style: { color: H.token.colorPrimary },
1507
+ children: l
1429
1508
  }
1430
1509
  ) : d.startsWith("#") ? /* @__PURE__ */ t(
1431
1510
  "a",
1432
1511
  {
1433
1512
  ...i,
1434
1513
  href: d,
1435
- style: { color: L.token.colorPrimary },
1436
- onClick: (g) => l(g, d.slice(1)),
1437
- children: o
1514
+ style: { color: H.token.colorPrimary },
1515
+ onClick: (g) => o(g, d.slice(1)),
1516
+ children: l
1438
1517
  }
1439
1518
  ) : d.startsWith("/") ? /* @__PURE__ */ t(
1440
1519
  "a",
1441
1520
  {
1442
1521
  ...i,
1443
1522
  href: d,
1444
- style: { color: L.token.colorPrimary },
1523
+ style: { color: H.token.colorPrimary },
1445
1524
  onClick: (g) => {
1446
1525
  g.preventDefault(), e ? e(d) : typeof window < "u" && (window.location.href = d);
1447
1526
  },
1448
- children: o
1527
+ children: l
1449
1528
  }
1450
- ) : /* @__PURE__ */ t("a", { ...i, href: d, style: { color: L.token.colorPrimary }, children: o });
1529
+ ) : /* @__PURE__ */ t("a", { ...i, href: d, style: { color: H.token.colorPrimary }, children: l });
1451
1530
  }
1452
1531
  };
1453
1532
  };
1454
- function pt({
1533
+ function yt({
1455
1534
  markdown: e,
1456
1535
  title: n,
1457
- tocWidth: s = Oe,
1458
- tocLevels: l = [2],
1536
+ tocWidth: s = Ge,
1537
+ tocLevels: o = [2],
1459
1538
  height: c = "calc(100vh - 120px)",
1460
1539
  markdownComponents: a,
1461
1540
  renderMarkdown: r
1462
1541
  }) {
1463
- const i = De() ? he() : null, d = M(null), f = M(null), g = M(""), p = M(null), [h, w] = A(""), [v, B] = A(0), b = G(() => Ye(e), [e]), S = G(
1464
- () => b.filter((u) => l.includes(u.level)),
1465
- [b, l]
1542
+ const i = De() ? xe() : null, d = N(null), f = N(null), g = N(""), p = N(null), [h, k] = B(""), [v, I] = B(0), b = q(() => Ve(e), [e]), S = q(
1543
+ () => b.filter((u) => o.includes(u.level)),
1544
+ [b, o]
1466
1545
  );
1467
- D(() => {
1468
- const u = () => B((y) => y + 1);
1469
- return pe.add(u), () => {
1470
- pe.delete(u);
1546
+ L(() => {
1547
+ const u = () => I((y) => y + 1);
1548
+ return he.add(u), () => {
1549
+ he.delete(u);
1471
1550
  };
1472
1551
  }, []);
1473
- const k = (u) => {
1552
+ const w = (u) => {
1474
1553
  g.current = u, p.current && clearTimeout(p.current), p.current = setTimeout(() => {
1475
1554
  g.current = "";
1476
1555
  }, 700);
1477
1556
  };
1478
- D(() => () => {
1557
+ L(() => () => {
1479
1558
  p.current && clearTimeout(p.current);
1480
- }, []), we(() => {
1559
+ }, []), Re(() => {
1481
1560
  const u = d.current;
1482
1561
  if (!u) return;
1483
1562
  const y = Array.from(u.querySelectorAll("h1, h2, h3"));
1484
- b.forEach((R, $) => {
1485
- const W = y[$];
1486
- W && (W.id !== R.id && (W.id = R.id), W.setAttribute("data-anchor", R.id));
1563
+ b.forEach((R, W) => {
1564
+ const M = y[W];
1565
+ M && (M.id !== R.id && (M.id = R.id), M.setAttribute("data-anchor", R.id));
1487
1566
  });
1488
- }, [b, v, r]), D(() => {
1567
+ }, [b, v, r]), L(() => {
1489
1568
  const u = d.current;
1490
1569
  if (!u) return;
1491
1570
  const y = Array.from(u.querySelectorAll("h1, h2, h3"));
1492
1571
  if (!y.length) return;
1493
1572
  const R = () => {
1494
1573
  const Q = u.getBoundingClientRect().top;
1495
- let ie = y[0];
1496
- for (const oe of y)
1497
- if (oe.getBoundingClientRect().top - Q <= de) ie = oe;
1574
+ let oe = y[0];
1575
+ for (const le of y)
1576
+ if (le.getBoundingClientRect().top - Q <= fe) oe = le;
1498
1577
  else break;
1499
- g.current || w(ie.id);
1500
- }, $ = new IntersectionObserver(R, {
1578
+ g.current || k(oe.id);
1579
+ }, W = new IntersectionObserver(R, {
1501
1580
  root: u,
1502
- rootMargin: `-${de}px 0px 0px 0px`,
1581
+ rootMargin: `-${fe}px 0px 0px 0px`,
1503
1582
  threshold: 0
1504
1583
  });
1505
- y.forEach((Q) => $.observe(Q)), R();
1506
- const W = () => {
1584
+ y.forEach((Q) => W.observe(Q)), R();
1585
+ const M = () => {
1507
1586
  g.current = "";
1508
1587
  };
1509
- return u.addEventListener("scrollend", W), () => {
1510
- $.disconnect(), u.removeEventListener("scrollend", W);
1588
+ return u.addEventListener("scrollend", M), () => {
1589
+ W.disconnect(), u.removeEventListener("scrollend", M);
1511
1590
  };
1512
- }, [b, v, r]), D(() => {
1591
+ }, [b, v, r]), L(() => {
1513
1592
  const u = f.current;
1514
1593
  if (!u || !h) return;
1515
- const y = u.querySelector(`[data-toc-id="${fe(h)}"]`);
1594
+ const y = u.querySelector(`[data-toc-id="${ge(h)}"]`);
1516
1595
  if (!y) return;
1517
- const R = u.getBoundingClientRect(), $ = y.getBoundingClientRect();
1518
- ($.top < R.top + 24 || $.bottom > R.bottom - 24) && y.scrollIntoView({ block: "nearest", behavior: "smooth" });
1596
+ const R = u.getBoundingClientRect(), W = y.getBoundingClientRect();
1597
+ (W.top < R.top + 24 || W.bottom > R.bottom - 24) && y.scrollIntoView({ block: "nearest", behavior: "smooth" });
1519
1598
  }, [h]);
1520
- const P = (u) => {
1599
+ const A = (u) => {
1521
1600
  const y = d.current;
1522
- return y && y.querySelector(`[data-anchor="${fe(u)}"]`) || (typeof document < "u" ? document.getElementById(u) : null);
1523
- }, N = (u, y) => {
1524
- u.preventDefault(), k(y), ge(P(y)), w(y);
1525
- }, q = (u, y) => {
1526
- u.preventDefault(), k(y), ge(P(y)), w(y);
1527
- }, Y = G(
1528
- () => Qe({
1601
+ return y && y.querySelector(`[data-anchor="${ge(u)}"]`) || (typeof document < "u" ? document.getElementById(u) : null);
1602
+ }, $ = (u, y) => {
1603
+ u.preventDefault(), w(y), ue(A(y)), k(y);
1604
+ }, G = (u, y) => {
1605
+ u.preventDefault(), w(y), ue(A(y)), k(y);
1606
+ }, U = q(
1607
+ () => tt({
1529
1608
  navigate: i,
1530
- Prism: ue,
1531
- oneDark: ue,
1532
- onAnchorClick: q
1609
+ Prism: pe,
1610
+ oneDark: pe,
1611
+ onAnchorClick: G
1533
1612
  }),
1534
1613
  // eslint-disable-next-line react-hooks/exhaustive-deps
1535
1614
  [i, v]
1536
- ), j = G(
1537
- () => ({ ...Y, ...a || {} }),
1538
- [Y, a]
1615
+ ), j = q(
1616
+ () => ({ ...U, ...a || {} }),
1617
+ [U, a]
1539
1618
  ), J = () => !e || !String(e).trim() ? /* @__PURE__ */ t(
1540
- be,
1619
+ ne,
1541
1620
  {
1542
1621
  title: "暂无文档",
1543
1622
  description: "把组件说明写成 DOC.md,用编译期 import 的字符串传给 ComponentDoc 即可"
1544
1623
  }
1545
- ) : r ? r({ markdown: e, components: j }) : /* @__PURE__ */ t(Se, { children: Je(e, j) });
1624
+ ) : r ? r({ markdown: e, components: j }) : /* @__PURE__ */ t(Ce, { children: et(e, j) });
1546
1625
  return /* @__PURE__ */ m("div", { style: { display: "flex", flexDirection: "column", minHeight: 0, flex: 1 }, children: [
1547
- /* @__PURE__ */ t("style", { children: je }),
1548
- n ? /* @__PURE__ */ t(me, { title: n }) : null,
1626
+ /* @__PURE__ */ t("style", { children: Ye }),
1627
+ n ? /* @__PURE__ */ t(ve, { title: n }) : null,
1549
1628
  /* @__PURE__ */ m("div", { style: { display: "flex", gap: 16, alignItems: "flex-start", minHeight: 0 }, children: [
1550
1629
  /* @__PURE__ */ m(
1551
1630
  "aside",
@@ -1583,13 +1662,13 @@ function pt({
1583
1662
  "a",
1584
1663
  {
1585
1664
  href: "#" + u.id,
1586
- onClick: (R) => N(R, u.id),
1665
+ onClick: (R) => $(R, u.id),
1587
1666
  style: {
1588
1667
  display: "block",
1589
1668
  padding: "6px 10px",
1590
- borderLeft: `3px solid ${y ? L.token.colorPrimary : "transparent"}`,
1669
+ borderLeft: `3px solid ${y ? H.token.colorPrimary : "transparent"}`,
1591
1670
  background: y ? T.primarySoft : "transparent",
1592
- color: y ? L.token.colorPrimary : "#475569",
1671
+ color: y ? H.token.colorPrimary : "#475569",
1593
1672
  fontWeight: y ? 600 : 400,
1594
1673
  fontSize: 13,
1595
1674
  lineHeight: 1.5,
@@ -1630,28 +1709,32 @@ function pt({
1630
1709
  ] });
1631
1710
  }
1632
1711
  export {
1633
- $e as C,
1634
- at as D,
1635
- be as E,
1636
- lt as F,
1637
- it as G,
1638
- st as L,
1639
- me as P,
1640
- ft as R,
1641
- ct as S,
1642
- dt as T,
1643
- pt as a,
1644
- We as b,
1645
- ut as c,
1646
- ot as d,
1647
- gt as e,
1648
- L as f,
1649
- T as g,
1650
- ce as h,
1651
- H as i,
1652
- nt as l,
1712
+ Le as C,
1713
+ Ne as D,
1714
+ ne as E,
1715
+ dt as F,
1716
+ st as G,
1717
+ ut as L,
1718
+ ve as P,
1719
+ ht as R,
1720
+ We as S,
1721
+ pt as T,
1722
+ yt as a,
1723
+ ft as b,
1724
+ $e as c,
1725
+ gt as d,
1726
+ mt as e,
1727
+ ct as f,
1728
+ bt as g,
1729
+ H as h,
1730
+ T as i,
1731
+ Me as j,
1732
+ de as k,
1733
+ at as l,
1734
+ P as m,
1653
1735
  x as n,
1654
1736
  E as p,
1655
1737
  C as r,
1656
- z as s
1738
+ D as s,
1739
+ He as u
1657
1740
  };