bi-components-library 1.0.26 → 1.0.27

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.es.js CHANGED
@@ -1,17 +1,17 @@
1
- import { jsx as h, jsxs as F, Fragment as Ue } from "react/jsx-runtime";
2
- import { useState as X, useRef as W, useMemo as ze, useCallback as K, useEffect as oe, useLayoutEffect as Me } from "react";
3
- import { Button as ge, Card as Be, Modal as Xe, Table as _e, Flex as He, Spin as Je, Empty as Qe, Select as Pe, Form as qe, Input as Fe, Space as Ye, Dropdown as Ze, Tooltip as et, Progress as tt, Pagination as nt, theme as at } from "antd";
1
+ import { jsx as m, jsxs as W, Fragment as Ue } from "react/jsx-runtime";
2
+ import { useState as X, useRef as j, useMemo as Oe, useCallback as U, useEffect as ae, useLayoutEffect as Re } from "react";
3
+ import { Button as ge, Card as Be, Modal as Xe, Table as _e, Flex as He, Spin as Je, Empty as Qe, Select as Ge, Form as Ce, Input as Fe, Space as Ye, Dropdown as Ze, Tooltip as et, Progress as tt, Pagination as nt, theme as at } from "antd";
4
4
  import { createFromIconfontCN as rt, LeftOutlined as ot, SearchOutlined as lt, ReloadOutlined as st, InfoCircleOutlined as it, SendOutlined as ct, PauseCircleOutlined as ut, PlayCircleOutlined as dt } from "@ant-design/icons";
5
5
  import { createPortal as pt } from "react-dom";
6
6
  const ft = ({
7
7
  variant: t = "primary",
8
- loading: g = !1,
9
- children: i,
10
- ...l
11
- }) => /* @__PURE__ */ h(
8
+ loading: y = !1,
9
+ children: u,
10
+ ...i
11
+ }) => /* @__PURE__ */ m(
12
12
  ge,
13
13
  {
14
- ...l,
14
+ ...i,
15
15
  type: ((k) => {
16
16
  switch (k) {
17
17
  case "primary":
@@ -28,9 +28,9 @@ const ft = ({
28
28
  return "primary";
29
29
  }
30
30
  })(t),
31
- loading: g,
31
+ loading: y,
32
32
  ghost: t === "ghost",
33
- children: i
33
+ children: u
34
34
  }
35
35
  );
36
36
  ft.__docgenInfo = {
@@ -79,20 +79,20 @@ ft.__docgenInfo = {
79
79
  };
80
80
  const yt = ({
81
81
  title: t,
82
- children: g,
83
- bordered: i = !0,
84
- hoverable: l = !1,
85
- size: u = "default",
82
+ children: y,
83
+ bordered: u = !0,
84
+ hoverable: i = !1,
85
+ size: c = "default",
86
86
  ...k
87
- }) => /* @__PURE__ */ h(
87
+ }) => /* @__PURE__ */ m(
88
88
  Be,
89
89
  {
90
90
  ...k,
91
91
  title: t,
92
- bordered: i,
93
- hoverable: l,
94
- size: u,
95
- children: g
92
+ bordered: u,
93
+ hoverable: i,
94
+ size: c,
95
+ children: y
96
96
  }
97
97
  );
98
98
  yt.__docgenInfo = {
@@ -148,17 +148,17 @@ yt.__docgenInfo = {
148
148
  };
149
149
  const mt = ({
150
150
  showDefaultFooter: t = !0,
151
- ...g
151
+ ...y
152
152
  }) => {
153
- const i = g.footer !== void 0 ? g.footer : t ? (l, { OkBtn: u, CancelBtn: k }) => /* @__PURE__ */ F(Ue, { children: [
154
- /* @__PURE__ */ h(u, {}),
155
- /* @__PURE__ */ h(k, {})
153
+ const u = y.footer !== void 0 ? y.footer : t ? (i, { OkBtn: c, CancelBtn: k }) => /* @__PURE__ */ W(Ue, { children: [
154
+ /* @__PURE__ */ m(c, {}),
155
+ /* @__PURE__ */ m(k, {})
156
156
  ] }) : null;
157
- return /* @__PURE__ */ h(
157
+ return /* @__PURE__ */ m(
158
158
  Xe,
159
159
  {
160
- ...g,
161
- footer: i
160
+ ...y,
161
+ footer: u
162
162
  }
163
163
  );
164
164
  };
@@ -225,23 +225,23 @@ mt.__docgenInfo = {
225
225
  };
226
226
  const gt = ({
227
227
  scrollX: t,
228
- showPagination: g = !0,
229
- defaultPageSize: i = 10,
230
- ...l
231
- }) => /* @__PURE__ */ h(
228
+ showPagination: y = !0,
229
+ defaultPageSize: u = 10,
230
+ ...i
231
+ }) => /* @__PURE__ */ m(
232
232
  _e,
233
233
  {
234
- ...l,
234
+ ...i,
235
235
  scroll: {
236
236
  x: t || "max-content",
237
237
  y: "50vh"
238
238
  },
239
- pagination: g ? {
239
+ pagination: y ? {
240
240
  hideOnSinglePage: !0,
241
241
  showSizeChanger: !0,
242
242
  showQuickJumper: !0,
243
- defaultPageSize: i,
244
- ...l.pagination
243
+ defaultPageSize: u,
244
+ ...i.pagination
245
245
  } : !1
246
246
  }
247
247
  );
@@ -299,20 +299,20 @@ const ht = rt({
299
299
  scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
300
300
  }), vt = ({
301
301
  name: t,
302
- size: g,
303
- color: i,
304
- style: l,
305
- ...u
302
+ size: y,
303
+ color: u,
304
+ style: i,
305
+ ...c
306
306
  }) => {
307
307
  const k = {
308
- fontSize: g,
309
- color: i,
310
- ...l
308
+ fontSize: y,
309
+ color: u,
310
+ ...i
311
311
  };
312
- return /* @__PURE__ */ h(
312
+ return /* @__PURE__ */ m(
313
313
  ht,
314
314
  {
315
- ...u,
315
+ ...c,
316
316
  type: t,
317
317
  style: k
318
318
  }
@@ -356,36 +356,36 @@ vt.__docgenInfo = {
356
356
  };
357
357
  const xt = ({
358
358
  loading: t,
359
- description: g = "暂无数据",
360
- className: i,
361
- emptyChildren: l,
362
- loadingText: u,
359
+ description: y = "暂无数据",
360
+ className: u,
361
+ emptyChildren: i,
362
+ loadingText: c,
363
363
  emptyImage: k
364
- }) => t ? /* @__PURE__ */ F(
364
+ }) => t ? /* @__PURE__ */ W(
365
365
  He,
366
366
  {
367
- className: `pt-10 w-full ${i || ""}`,
367
+ className: `pt-10 w-full ${u || ""}`,
368
368
  align: "center",
369
369
  justify: "center",
370
370
  vertical: !0,
371
371
  children: [
372
- /* @__PURE__ */ h(Je, { size: "large" }),
373
- u && /* @__PURE__ */ h("div", { className: "mt-4 text-gray-500", children: u })
372
+ /* @__PURE__ */ m(Je, { size: "large" }),
373
+ c && /* @__PURE__ */ m("div", { className: "mt-4 text-gray-500", children: c })
374
374
  ]
375
375
  }
376
- ) : /* @__PURE__ */ h(
376
+ ) : /* @__PURE__ */ m(
377
377
  He,
378
378
  {
379
- className: `pt-10 w-full ${i || ""}`,
379
+ className: `pt-10 w-full ${u || ""}`,
380
380
  align: "center",
381
381
  justify: "center",
382
- children: /* @__PURE__ */ h(
382
+ children: /* @__PURE__ */ m(
383
383
  Qe,
384
384
  {
385
385
  image: k,
386
- description: g,
386
+ description: y,
387
387
  imageStyle: { height: 180 },
388
- children: l
388
+ children: i
389
389
  }
390
390
  )
391
391
  }
@@ -435,19 +435,19 @@ xt.__docgenInfo = {
435
435
  };
436
436
  const bt = ({
437
437
  onClick: t,
438
- showText: g = !1,
439
- className: i,
440
- size: l = "small",
441
- type: u = "default"
442
- }) => /* @__PURE__ */ h(
438
+ showText: y = !1,
439
+ className: u,
440
+ size: i = "small",
441
+ type: c = "default"
442
+ }) => /* @__PURE__ */ m(
443
443
  ge,
444
444
  {
445
- size: l,
446
- type: u,
447
- icon: /* @__PURE__ */ h(ot, {}),
448
- className: `cursor-pointer ${i || ""}`,
445
+ size: i,
446
+ type: c,
447
+ icon: /* @__PURE__ */ m(ot, {}),
448
+ className: `cursor-pointer ${u || ""}`,
449
449
  onClick: t,
450
- children: g && "返回"
450
+ children: y && "返回"
451
451
  }
452
452
  );
453
453
  bt.__docgenInfo = {
@@ -489,23 +489,23 @@ bt.__docgenInfo = {
489
489
  }
490
490
  }
491
491
  };
492
- const wt = ({
492
+ const kt = ({
493
493
  removePadding: t = !0,
494
- className: g,
495
- ...i
494
+ className: y,
495
+ ...u
496
496
  }) => {
497
- const l = t ? `px-0 h-auto ${g || ""}` : g;
498
- return /* @__PURE__ */ h(
497
+ const i = t ? `px-0 h-auto ${y || ""}` : y;
498
+ return /* @__PURE__ */ m(
499
499
  ge,
500
500
  {
501
501
  type: "link",
502
- ...i,
503
- className: l,
504
- children: i.children
502
+ ...u,
503
+ className: i,
504
+ children: u.children
505
505
  }
506
506
  );
507
507
  };
508
- wt.__docgenInfo = {
508
+ kt.__docgenInfo = {
509
509
  displayName: "LinkButton",
510
510
  description: "链接样式按钮组件,适用于表格操作列",
511
511
  props: {
@@ -542,123 +542,123 @@ wt.__docgenInfo = {
542
542
  }
543
543
  }
544
544
  };
545
- const { Option: kt } = Pe, Et = ({
545
+ const { Option: wt } = Ge, Et = ({
546
546
  columns: t,
547
- request: g,
548
- searchFields: i = [],
549
- showSearch: l = !0,
550
- showRefresh: u = !0,
547
+ request: y,
548
+ searchFields: u = [],
549
+ showSearch: i = !0,
550
+ showRefresh: c = !0,
551
551
  defaultPageSize: k = 10,
552
- pageSizeOptions: V = ["10", "20", "50", "100"],
552
+ pageSizeOptions: L = ["10", "20", "50", "100"],
553
553
  autoLoad: E = !0,
554
- externalParams: n = {},
554
+ externalParams: C = {},
555
555
  ...e
556
556
  }) => {
557
- const [a, o] = X([]), [L, f] = X(!1), [r, S] = X({
557
+ const [A, g] = X([]), [l, a] = X(!1), [n, o] = X({
558
558
  current: 1,
559
559
  pageSize: k,
560
560
  total: 0
561
- }), [s, y] = X({}), [p, x] = X({}), [m] = qe.useForm(), _ = W(r);
562
- _.current = r;
563
- const T = W(n);
564
- T.current = n;
565
- const P = W(!1), H = ze(() => t.map(($) => {
566
- const { sortable: D, render: te, ...re } = $;
561
+ }), [r, s] = X({}), [d, h] = X({}), [x] = Ce.useForm(), G = j(n);
562
+ G.current = n;
563
+ const T = j(C);
564
+ T.current = C;
565
+ const _ = j(!1), H = Oe(() => t.map((N) => {
566
+ const { sortable: M, render: ne, ...re } = N;
567
567
  return {
568
568
  ...re,
569
- sorter: D ? !0 : void 0,
570
- render: te || ((ce) => ce)
569
+ sorter: M ? !0 : void 0,
570
+ render: ne || ((ce) => ce)
571
571
  };
572
- }), [t]), R = K(async ($ = {}) => {
573
- if (g) {
574
- f(!0);
572
+ }), [t]), D = U(async (N = {}) => {
573
+ if (y) {
574
+ a(!0);
575
575
  try {
576
- const D = {
577
- page: _.current.current,
578
- pageSize: _.current.pageSize,
579
- sortField: p.field,
580
- sortOrder: p.order,
581
- searchParams: { ...s, ...T.current },
582
- ...$
583
- }, te = await g(D);
584
- te.success && (o(te.data), S((re) => ({
576
+ const M = {
577
+ page: G.current.current,
578
+ pageSize: G.current.pageSize,
579
+ sortField: d.field,
580
+ sortOrder: d.order,
581
+ searchParams: { ...r, ...T.current },
582
+ ...N
583
+ }, ne = await y(M);
584
+ ne.success && (g(ne.data), o((re) => ({
585
585
  ...re,
586
- total: te.total,
587
- current: D.page || re.current
586
+ total: ne.total,
587
+ current: M.page || re.current
588
588
  })));
589
- } catch (D) {
590
- console.error("加载数据失败:", D);
589
+ } catch (M) {
590
+ console.error("加载数据失败:", M);
591
591
  } finally {
592
- f(!1);
592
+ a(!1);
593
593
  }
594
594
  }
595
- }, [g, p, s]), j = K(($) => {
596
- y($), S((D) => ({ ...D, current: 1 }));
597
- }, []), Y = K(() => {
598
- m.resetFields(), y({}), S(($) => ({ ...$, current: 1 }));
599
- }, [m]), Z = K(() => {
600
- R();
601
- }, [R]), ee = K(($, D, te) => {
595
+ }, [y, d, r]), K = U((N) => {
596
+ s(N), o((M) => ({ ...M, current: 1 }));
597
+ }, []), Q = U(() => {
598
+ x.resetFields(), s({}), o((N) => ({ ...N, current: 1 }));
599
+ }, [x]), Y = U(() => {
600
+ D();
601
+ }, [D]), te = U((N, M, ne) => {
602
602
  const re = {
603
- current: $.current || 1,
604
- pageSize: $.pageSize || k,
605
- total: $.total || 0
603
+ current: N.current || 1,
604
+ pageSize: N.pageSize || k,
605
+ total: N.total || 0
606
606
  }, ce = {
607
- field: te?.field,
608
- order: te?.order
607
+ field: ne?.field,
608
+ order: ne?.order
609
609
  };
610
- S(re), x(ce);
610
+ o(re), h(ce);
611
611
  }, [k]);
612
- return oe(() => {
613
- const $ = Object.keys(n).length > 0;
614
- (E && !P.current || $) && (R(), P.current = !0);
615
- }, [E, n, R]), /* @__PURE__ */ F("div", { children: [
616
- l && i.length > 0 && /* @__PURE__ */ h(Be, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ F(
617
- qe,
612
+ return ae(() => {
613
+ const N = Object.keys(C).length > 0;
614
+ (E && !_.current || N) && (D(), _.current = !0);
615
+ }, [E, C, D]), /* @__PURE__ */ W("div", { children: [
616
+ i && u.length > 0 && /* @__PURE__ */ m(Be, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ W(
617
+ Ce,
618
618
  {
619
- form: m,
619
+ form: x,
620
620
  layout: "inline",
621
- onFinish: j,
622
- initialValues: i.reduce(($, D) => (D.defaultValue !== void 0 && ($[D.key] = D.defaultValue), $), {}),
621
+ onFinish: K,
622
+ initialValues: u.reduce((N, M) => (M.defaultValue !== void 0 && (N[M.key] = M.defaultValue), N), {}),
623
623
  children: [
624
- i.map(($) => /* @__PURE__ */ h(qe.Item, { name: $.key, label: $.label, children: $.type === "input" ? /* @__PURE__ */ h(
624
+ u.map((N) => /* @__PURE__ */ m(Ce.Item, { name: N.key, label: N.label, children: N.type === "input" ? /* @__PURE__ */ m(
625
625
  Fe,
626
626
  {
627
- placeholder: $.placeholder || `请输入${$.label}`,
627
+ placeholder: N.placeholder || `请输入${N.label}`,
628
628
  style: { width: 200 }
629
629
  }
630
- ) : /* @__PURE__ */ h(
631
- Pe,
630
+ ) : /* @__PURE__ */ m(
631
+ Ge,
632
632
  {
633
- placeholder: $.placeholder || `请选择${$.label}`,
633
+ placeholder: N.placeholder || `请选择${N.label}`,
634
634
  style: { width: 200 },
635
635
  allowClear: !0,
636
- children: $.options?.map((D) => /* @__PURE__ */ h(kt, { value: D.value, children: D.label }, D.value))
636
+ children: N.options?.map((M) => /* @__PURE__ */ m(wt, { value: M.value, children: M.label }, M.value))
637
637
  }
638
- ) }, $.key)),
639
- /* @__PURE__ */ h(qe.Item, { children: /* @__PURE__ */ F(Ye, { children: [
640
- /* @__PURE__ */ h(ge, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ h(lt, {}), children: "查询" }),
641
- /* @__PURE__ */ h(ge, { onClick: Y, children: "重置" }),
642
- u && /* @__PURE__ */ h(ge, { icon: /* @__PURE__ */ h(st, {}), onClick: Z, children: "刷新" })
638
+ ) }, N.key)),
639
+ /* @__PURE__ */ m(Ce.Item, { children: /* @__PURE__ */ W(Ye, { children: [
640
+ /* @__PURE__ */ m(ge, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ m(lt, {}), children: "查询" }),
641
+ /* @__PURE__ */ m(ge, { onClick: Q, children: "重置" }),
642
+ c && /* @__PURE__ */ m(ge, { icon: /* @__PURE__ */ m(st, {}), onClick: Y, children: "刷新" })
643
643
  ] }) })
644
644
  ]
645
645
  }
646
646
  ) }),
647
- /* @__PURE__ */ h(
647
+ /* @__PURE__ */ m(
648
648
  _e,
649
649
  {
650
650
  ...e,
651
651
  columns: H,
652
- dataSource: a,
653
- loading: L,
652
+ dataSource: A,
653
+ loading: l,
654
654
  pagination: {
655
- ...r,
655
+ ...n,
656
656
  showSizeChanger: !0,
657
657
  showQuickJumper: !0,
658
- showTotal: ($, D) => `第 ${D[0]}-${D[1]} 条/共 ${$} 条`,
659
- pageSizeOptions: V
658
+ showTotal: (N, M) => `第 ${M[0]}-${M[1]} 条/共 ${N} 条`,
659
+ pageSizeOptions: L
660
660
  },
661
- onChange: ee,
661
+ onChange: te,
662
662
  scroll: { x: "max-content", y: "50vh" }
663
663
  }
664
664
  )
@@ -731,837 +731,910 @@ Et.__docgenInfo = {
731
731
  }
732
732
  }
733
733
  };
734
- function Le(t, g, i) {
734
+ function Te(t, y, u) {
735
735
  if (!t.current) return;
736
- const l = /* @__PURE__ */ new Set(), u = {};
737
- for (const o of g)
738
- o.exclusionGroup && o.exclusionGroup !== "separator" && (l.add(o.exclusionGroup), u[o.exclusionGroup] || (u[o.exclusionGroup] = []), u[o.exclusionGroup].push({
739
- type: o.type,
740
- key: o.key,
741
- exclusionGroup: o.exclusionGroup
736
+ const i = /* @__PURE__ */ new Set(), c = {};
737
+ for (const g of y)
738
+ g.exclusionGroup && g.exclusionGroup !== "separator" && (i.add(g.exclusionGroup), c[g.exclusionGroup] || (c[g.exclusionGroup] = []), c[g.exclusionGroup].push({
739
+ type: g.type,
740
+ key: g.key,
741
+ exclusionGroup: g.exclusionGroup
742
742
  }));
743
743
  const k = {};
744
- for (const o of l) {
745
- k[o] = !1;
746
- for (const L of u[o])
747
- if (L.type === "upload" && L.key) {
748
- if (i[L.key] !== null && i[L.key] !== void 0) {
749
- k[o] = !0;
744
+ for (const g of i) {
745
+ k[g] = !1;
746
+ for (const l of c[g])
747
+ if (l.type === "upload" && l.key) {
748
+ if (u[l.key] !== null && u[l.key] !== void 0) {
749
+ k[g] = !0;
750
750
  break;
751
751
  }
752
- } else if (L.type === "variable" && L.key) {
753
- const f = t.current.querySelector(
754
- `[data-type="variable"][data-key="${L.key}"]`
752
+ } else if (l.type === "variable" && l.key) {
753
+ const a = t.current.querySelector(
754
+ `[data-type="variable"][data-key="${l.key}"]`
755
755
  );
756
- if (f && f.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
757
- k[o] = !0;
756
+ if (a && a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
757
+ k[g] = !0;
758
758
  break;
759
759
  }
760
760
  }
761
761
  }
762
- const V = g.some((o) => o.exclusionGroup === "separator"), n = Object.keys(k).filter(
763
- (o) => k[o]
762
+ const L = y.some((g) => g.exclusionGroup === "separator"), C = Object.keys(k).filter(
763
+ (g) => k[g]
764
764
  ).length > 0;
765
765
  let e = null;
766
- if (n && V) {
767
- for (const o of g)
768
- if (o.exclusionGroup && o.exclusionGroup !== "separator" && k[o.exclusionGroup]) {
769
- e = o.exclusionGroup;
766
+ if (C && L) {
767
+ for (const g of y)
768
+ if (g.exclusionGroup && g.exclusionGroup !== "separator" && k[g.exclusionGroup]) {
769
+ e = g.exclusionGroup;
770
770
  break;
771
771
  }
772
772
  }
773
- for (const o of l) {
774
- const L = t.current.querySelectorAll(
775
- `[data-group="${o}"]`
773
+ for (const g of i) {
774
+ const l = t.current.querySelectorAll(
775
+ `[data-group="${g}"]`
776
776
  );
777
- V && n && e ? o === e ? L.forEach((f) => {
778
- f.classList.contains("required-upload-group") ? f.style.setProperty("display", "inline-flex", "important") : (f.classList.contains("exclusion-wrapper"), f.style.setProperty("display", "inline-block", "important"));
779
- }) : L.forEach((f) => {
780
- f.style.display = "none", f.style.setProperty("display", "none", "important");
781
- }) : L.forEach((f) => {
782
- f.classList.contains("required-upload-group") ? f.style.setProperty("display", "inline-flex", "important") : (f.classList.contains("exclusion-wrapper"), f.style.setProperty("display", "inline-block", "important"));
777
+ L && C && e ? g === e ? l.forEach((a) => {
778
+ a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
779
+ }) : l.forEach((a) => {
780
+ a.style.display = "none", a.style.setProperty("display", "none", "important");
781
+ }) : l.forEach((a) => {
782
+ a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
783
783
  });
784
784
  }
785
785
  t.current.querySelectorAll(
786
786
  '[data-group="separator"]'
787
- ).forEach((o) => {
788
- o.style.display = n ? "none" : "inline";
787
+ ).forEach((g) => {
788
+ g.style.display = C ? "none" : "inline";
789
789
  });
790
790
  }
791
- function Ve(t, g, i, l) {
791
+ function $e(t, y, u, i) {
792
792
  if (!t.current) {
793
- l(!1);
793
+ i(!1);
794
794
  return;
795
795
  }
796
- const u = [];
797
- for (let n = 0; n < g.length; n++) {
798
- const e = g[n];
799
- if ((e.type === "variable" || e.type === "upload" || e.type === "multi-variable" || e.type === "select" || e.type === "textarea" || e.type === "richtext" || e.type === "datepicker") && e.required && e.key) {
800
- u.push({
801
- exclusionGroup: e.exclusionGroup || "",
802
- key: e.key,
803
- type: e.type === "multi-variable" ? "variable" : e.type,
804
- isMultiVariable: e.type === "multi-variable",
805
- minCount: e.type === "multi-variable" ? e.minCount : void 0
796
+ const c = [];
797
+ for (let l = 0; l < y.length; l++) {
798
+ const a = y[l];
799
+ if ((a.type === "variable" || a.type === "upload" || a.type === "multi-variable" || a.type === "select" || a.type === "textarea" || a.type === "richtext" || a.type === "datepicker") && a.required && a.key) {
800
+ c.push({
801
+ exclusionGroup: a.exclusionGroup || "",
802
+ key: a.key,
803
+ type: a.type === "multi-variable" ? "variable" : a.type,
804
+ isMultiVariable: a.type === "multi-variable",
805
+ minCount: a.type === "multi-variable" ? a.minCount : void 0
806
806
  });
807
807
  continue;
808
808
  }
809
- if (e.type === "text" && e.className?.includes("rte-text-required") && e.exclusionGroup)
810
- for (let a = n + 1; a < g.length; a++) {
811
- const o = g[a];
812
- if (o.exclusionGroup === e.exclusionGroup && (o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
813
- u.push({
814
- exclusionGroup: e.exclusionGroup,
815
- key: o.key,
816
- type: o.type
817
- });
818
- break;
809
+ if (a.type === "text" && a.className?.includes("rte-text-required"))
810
+ if (a.exclusionGroup)
811
+ for (let n = l + 1; n < y.length; n++) {
812
+ const o = y[n];
813
+ if (o.exclusionGroup === a.exclusionGroup && (o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
814
+ c.push({
815
+ exclusionGroup: a.exclusionGroup,
816
+ key: o.key,
817
+ type: o.type
818
+ });
819
+ break;
820
+ }
821
+ }
822
+ else
823
+ for (let n = l + 1; n < y.length; n++) {
824
+ const o = y[n];
825
+ if ((o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
826
+ c.push({
827
+ exclusionGroup: o.exclusionGroup || "",
828
+ key: o.key,
829
+ type: o.type
830
+ });
831
+ break;
832
+ }
819
833
  }
820
- }
821
834
  }
822
- const k = g.some((n) => n.exclusionGroup === "separator");
823
- let V = !1;
824
- if (k && u.length > 1) {
825
- const n = g.findIndex((o) => o.exclusionGroup === "separator"), e = u.filter((o) => g.findIndex(
826
- (f) => (f.type === "variable" || f.type === "upload" || f.type === "select" || f.type === "textarea" || f.type === "richtext" || f.type === "datepicker") && f.key === o.key && f.exclusionGroup === o.exclusionGroup
827
- ) < n), a = u.filter((o) => g.findIndex(
828
- (f) => (f.type === "variable" || f.type === "upload" || f.type === "select" || f.type === "textarea" || f.type === "richtext") && f.key === o.key && f.exclusionGroup === o.exclusionGroup
829
- ) > n);
830
- V = e.length > 0 && a.length > 0;
835
+ const k = y.some((l) => l.exclusionGroup === "separator"), L = [];
836
+ if (k && c.length > 1) {
837
+ const l = [];
838
+ y.forEach((a, n) => {
839
+ a.exclusionGroup === "separator" && l.push(n);
840
+ });
841
+ for (const a of l) {
842
+ let n = null;
843
+ for (let r = a - 1; r >= 0; r--) {
844
+ const s = y[r];
845
+ if ((s.type === "variable" || s.type === "upload" || s.type === "select" || s.type === "textarea" || s.type === "richtext" || s.type === "datepicker") && s.key) {
846
+ const d = c.find((h) => h.key === s.key);
847
+ if (d) {
848
+ n = d;
849
+ break;
850
+ }
851
+ }
852
+ }
853
+ let o = null;
854
+ for (let r = a + 1; r < y.length; r++) {
855
+ const s = y[r];
856
+ if ((s.type === "variable" || s.type === "upload" || s.type === "select" || s.type === "textarea" || s.type === "richtext" || s.type === "datepicker") && s.key) {
857
+ const d = c.find((h) => h.key === s.key);
858
+ if (d) {
859
+ o = d;
860
+ break;
861
+ }
862
+ }
863
+ }
864
+ n && o && L.push([n, o]);
865
+ }
831
866
  }
832
- if (u.length === 0) {
833
- if (g.length === 0) {
867
+ if (c.length === 0) {
868
+ if (y.length === 0) {
834
869
  if (!t.current) {
835
- l(!1);
870
+ i(!1);
836
871
  return;
837
872
  }
838
- const n = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
839
- l(n.length > 0);
873
+ const l = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
874
+ i(l.length > 0);
840
875
  return;
841
876
  }
842
- l(!0);
877
+ i(!0);
843
878
  return;
844
879
  }
845
- const E = u.filter((n) => {
880
+ const E = c.filter((l) => {
846
881
  if (!t.current) return !1;
847
- if (n.exclusionGroup) {
848
- const e = t.current.querySelectorAll(
849
- `[data-group="${n.exclusionGroup}"]`
882
+ if (l.exclusionGroup) {
883
+ const a = t.current.querySelectorAll(
884
+ `[data-group="${l.exclusionGroup}"]`
850
885
  );
851
- if (e.length > 0)
852
- return e[0].style.display !== "none";
886
+ if (a.length > 0)
887
+ return a[0].style.display !== "none";
853
888
  }
854
- if (n.type === "upload" && n.key) {
855
- const e = t.current.querySelector(
856
- `[data-type="upload"][data-key="${n.key}"]`
889
+ if (l.type === "upload" && l.key) {
890
+ const a = t.current.querySelector(
891
+ `[data-type="upload"][data-key="${l.key}"]`
857
892
  );
858
- if (e) {
859
- const a = e.closest("[data-group]") || e.parentElement;
860
- return a ? a.style.display !== "none" : !0;
893
+ if (a) {
894
+ const n = a.closest("[data-group]") || a.parentElement;
895
+ return n ? n.style.display !== "none" : !0;
861
896
  }
862
- } else if (n.type === "variable" && n.key)
863
- if (n.isMultiVariable) {
864
- const e = t.current.querySelectorAll(
865
- `[data-type="variable"][data-multi-key="${n.key}"]`
897
+ } else if (l.type === "variable" && l.key)
898
+ if (l.isMultiVariable) {
899
+ const a = t.current.querySelectorAll(
900
+ `[data-type="variable"][data-multi-key="${l.key}"]`
866
901
  );
867
- if (e.length > 0) {
868
- const a = e[0], o = a.closest("[data-group]") || a.parentElement;
902
+ if (a.length > 0) {
903
+ const n = a[0], o = n.closest("[data-group]") || n.parentElement;
869
904
  return o ? o.style.display !== "none" : !0;
870
905
  }
871
906
  } else {
872
- const e = t.current.querySelector(
873
- `[data-type="variable"][data-key="${n.key}"]`
907
+ const a = t.current.querySelector(
908
+ `[data-type="variable"][data-key="${l.key}"]`
874
909
  );
875
- if (e) {
876
- const a = e.closest("[data-group]") || e.parentElement;
877
- return a ? a.style.display !== "none" : !0;
910
+ if (a) {
911
+ const n = a.closest("[data-group]") || a.parentElement;
912
+ return n ? n.style.display !== "none" : !0;
878
913
  }
879
914
  }
880
- else if (n.type === "select" && n.key) {
881
- const e = t.current.querySelector(
882
- `[data-type="select"][data-key="${n.key}"]`
915
+ else if (l.type === "select" && l.key) {
916
+ const a = t.current.querySelector(
917
+ `[data-type="select"][data-key="${l.key}"]`
883
918
  );
884
- if (e) {
885
- const a = e.closest("[data-group]") || e.parentElement;
886
- return a ? a.style.display !== "none" : !0;
919
+ if (a) {
920
+ const n = a.closest("[data-group]") || a.parentElement;
921
+ return n ? n.style.display !== "none" : !0;
887
922
  }
888
- } else if (n.type === "textarea" && n.key) {
889
- const e = t.current.querySelector(
890
- `[data-type="textarea"][data-key="${n.key}"]`
923
+ } else if (l.type === "textarea" && l.key) {
924
+ const a = t.current.querySelector(
925
+ `[data-type="textarea"][data-key="${l.key}"]`
891
926
  );
892
- if (e) {
893
- const a = e.closest("[data-group]") || e.parentElement;
894
- return a ? a.style.display !== "none" : !0;
927
+ if (a) {
928
+ const n = a.closest("[data-group]") || a.parentElement;
929
+ return n ? n.style.display !== "none" : !0;
895
930
  }
896
- } else if (n.type === "richtext" && n.key) {
897
- const e = t.current.querySelector(
898
- `[data-type="richtext"][data-key="${n.key}"]`
931
+ } else if (l.type === "richtext" && l.key) {
932
+ const a = t.current.querySelector(
933
+ `[data-type="richtext"][data-key="${l.key}"]`
899
934
  );
900
- if (e) {
901
- const a = e.closest("[data-group]") || e.parentElement;
902
- return a ? a.style.display !== "none" : !0;
935
+ if (a) {
936
+ const n = a.closest("[data-group]") || a.parentElement;
937
+ return n ? n.style.display !== "none" : !0;
903
938
  }
904
- } else if (n.type === "datepicker" && n.key) {
905
- const e = t.current.querySelector(
906
- `[data-type="datepicker"][data-key="${n.key}"]`
939
+ } else if (l.type === "datepicker" && l.key) {
940
+ const a = t.current.querySelector(
941
+ `[data-type="datepicker"][data-key="${l.key}"]`
907
942
  );
908
- if (e) {
909
- const a = e.closest("[data-group]") || e.parentElement;
910
- return a ? a.style.display !== "none" : !0;
943
+ if (a) {
944
+ const n = a.closest("[data-group]") || a.parentElement;
945
+ return n ? n.style.display !== "none" : !0;
911
946
  }
912
947
  }
913
948
  return !1;
914
949
  });
915
950
  if (E.length === 0) {
916
- l(!0);
951
+ i(!0);
917
952
  return;
918
953
  }
919
- if (V) {
954
+ const C = /* @__PURE__ */ new Set();
955
+ L.forEach((l) => {
956
+ l.forEach((a) => {
957
+ a.key && C.add(a.key);
958
+ });
959
+ });
960
+ const e = E.filter(
961
+ (l) => !l.key || !C.has(l.key)
962
+ );
963
+ let A = (L.length === 0, !0);
964
+ for (const l of L) {
965
+ const a = l.filter((o) => {
966
+ if (!t.current) return !1;
967
+ if (o.exclusionGroup) {
968
+ const r = t.current.querySelectorAll(
969
+ `[data-group="${o.exclusionGroup}"]`
970
+ );
971
+ if (r.length > 0)
972
+ return r[0].style.display !== "none";
973
+ }
974
+ return !0;
975
+ });
976
+ if (a.length === 0)
977
+ continue;
920
978
  let n = !1;
921
- for (const e of E)
922
- if (e.type === "upload" && e.key) {
923
- if (i[e.key] !== null && i[e.key] !== void 0) {
979
+ for (const o of a)
980
+ if (o.type === "upload" && o.key) {
981
+ if (u[o.key] !== null && u[o.key] !== void 0) {
924
982
  n = !0;
925
983
  break;
926
984
  }
927
- } else if (e.type === "variable" && e.key)
928
- if (e.isMultiVariable) {
929
- const a = t.current.querySelectorAll(
930
- `[data-type="variable"][data-multi-key="${e.key}"]`
985
+ } else if (o.type === "variable" && o.key)
986
+ if (o.isMultiVariable) {
987
+ const r = t.current.querySelectorAll(
988
+ `[data-type="variable"][data-multi-key="${o.key}"]`
931
989
  );
932
- let o = 0;
933
- for (const f of Array.from(a))
934
- f.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (o += 1);
935
- const L = e.minCount && e.minCount > 0 ? e.minCount : 1;
936
- if (o >= L) {
990
+ let s = 0;
991
+ for (const h of Array.from(r))
992
+ h.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (s += 1);
993
+ const d = o.minCount && o.minCount > 0 ? o.minCount : 1;
994
+ if (s >= d) {
937
995
  n = !0;
938
996
  break;
939
997
  }
940
998
  } else {
941
- const a = t.current.querySelector(
942
- `[data-type="variable"][data-key="${e.key}"]`
999
+ const r = t.current.querySelector(
1000
+ `[data-type="variable"][data-key="${o.key}"]`
943
1001
  );
944
- if (a && a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1002
+ if (r && r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
945
1003
  n = !0;
946
1004
  break;
947
1005
  }
948
1006
  }
949
- else if (e.type === "select" && e.key) {
950
- const a = t.current.querySelector(
951
- `[data-type="select"][data-key="${e.key}"]`
1007
+ else if (o.type === "select" && o.key) {
1008
+ const r = t.current.querySelector(
1009
+ `[data-type="select"][data-key="${o.key}"]`
952
1010
  );
953
- if (a && (a.value || "").trim().length > 0) {
1011
+ if (r && (r.value || "").trim().length > 0) {
954
1012
  n = !0;
955
1013
  break;
956
1014
  }
957
- } else if (e.type === "textarea" && e.key) {
958
- const a = t.current.querySelector(
959
- `[data-type="textarea"][data-key="${e.key}"]`
1015
+ } else if (o.type === "textarea" && o.key) {
1016
+ const r = t.current.querySelector(
1017
+ `[data-type="textarea"][data-key="${o.key}"]`
960
1018
  );
961
- if (a && (a.value || "").trim().length > 0) {
1019
+ if (r && (r.value || "").trim().length > 0) {
962
1020
  n = !0;
963
1021
  break;
964
1022
  }
965
- } else if (e.type === "richtext" && e.key) {
966
- const a = t.current.querySelector(
967
- `[data-type="richtext"][data-key="${e.key}"]`
1023
+ } else if (o.type === "richtext" && o.key) {
1024
+ const r = t.current.querySelector(
1025
+ `[data-type="richtext"][data-key="${o.key}"]`
968
1026
  );
969
- if (a && (a.textContent || "").replace(/[\u200B]/g, "").trim().length > 0) {
1027
+ if (r && (r.textContent || "").replace(/[\u200B]/g, "").trim().length > 0) {
970
1028
  n = !0;
971
1029
  break;
972
1030
  }
973
- } else if (e.type === "datepicker" && e.key) {
974
- const a = t.current.querySelector(
975
- `[data-type="datepicker"][data-key="${e.key}"]`
1031
+ } else if (o.type === "datepicker" && o.key) {
1032
+ const r = t.current.querySelector(
1033
+ `[data-type="datepicker"][data-key="${o.key}"]`
976
1034
  );
977
- if (a && (a.getAttribute("data-value") || "").trim().length > 0) {
1035
+ if (r && (r.getAttribute("data-value") || "").trim().length > 0) {
978
1036
  n = !0;
979
1037
  break;
980
1038
  }
981
1039
  }
982
- l(n);
983
- } else {
984
- let n = !0;
985
- for (const e of E)
986
- if (e.type === "upload" && e.key) {
987
- if (i[e.key] === null || i[e.key] === void 0) {
988
- n = !1;
989
- break;
990
- }
991
- } else if (e.type === "variable" && e.key)
992
- if (e.isMultiVariable) {
993
- const a = t.current.querySelectorAll(
994
- `[data-type="variable"][data-multi-key="${e.key}"]`
995
- );
996
- let o = 0;
997
- for (const f of Array.from(a))
998
- f.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (o += 1);
999
- const L = e.minCount && e.minCount > 0 ? e.minCount : 1;
1000
- if (o < L) {
1001
- n = !1;
1002
- break;
1003
- }
1004
- } else {
1005
- const a = t.current.querySelector(
1006
- `[data-type="variable"][data-key="${e.key}"]`
1007
- );
1008
- if (!a) {
1009
- n = !1;
1010
- break;
1011
- }
1012
- if (a.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
1013
- n = !1;
1014
- break;
1015
- }
1016
- }
1017
- else if (e.type === "select" && e.key) {
1018
- const a = t.current.querySelector(
1019
- `[data-type="select"][data-key="${e.key}"]`
1020
- );
1021
- if (!a || (a.value || "").trim().length === 0) {
1022
- n = !1;
1023
- break;
1024
- }
1025
- } else if (e.type === "textarea" && e.key) {
1026
- const a = t.current.querySelector(
1027
- `[data-type="textarea"][data-key="${e.key}"]`
1040
+ if (!n) {
1041
+ A = !1;
1042
+ break;
1043
+ }
1044
+ }
1045
+ let g = !0;
1046
+ for (const l of e)
1047
+ if (l.type === "upload" && l.key) {
1048
+ if (u[l.key] === null || u[l.key] === void 0) {
1049
+ g = !1;
1050
+ break;
1051
+ }
1052
+ } else if (l.type === "variable" && l.key)
1053
+ if (l.isMultiVariable) {
1054
+ const a = t.current.querySelectorAll(
1055
+ `[data-type="variable"][data-multi-key="${l.key}"]`
1028
1056
  );
1029
- if (!a || (a.value || "").trim().length === 0) {
1030
- n = !1;
1057
+ let n = 0;
1058
+ for (const r of Array.from(a))
1059
+ r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (n += 1);
1060
+ const o = l.minCount && l.minCount > 0 ? l.minCount : 1;
1061
+ if (n < o) {
1062
+ g = !1;
1031
1063
  break;
1032
1064
  }
1033
- } else if (e.type === "richtext" && e.key) {
1065
+ } else {
1034
1066
  const a = t.current.querySelector(
1035
- `[data-type="richtext"][data-key="${e.key}"]`
1067
+ `[data-type="variable"][data-key="${l.key}"]`
1036
1068
  );
1037
- if (!a || (a.textContent || "").replace(/[\u200B]/g, "").trim().length === 0) {
1038
- n = !1;
1069
+ if (!a) {
1070
+ g = !1;
1039
1071
  break;
1040
1072
  }
1041
- } else if (e.type === "datepicker" && e.key) {
1042
- const a = t.current.querySelector(
1043
- `[data-type="datepicker"][data-key="${e.key}"]`
1044
- );
1045
- if (!a || (a.getAttribute("data-value") || "").trim().length === 0) {
1046
- n = !1;
1073
+ if (a.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
1074
+ g = !1;
1047
1075
  break;
1048
1076
  }
1049
1077
  }
1050
- l(n);
1051
- }
1078
+ else if (l.type === "select" && l.key) {
1079
+ const a = t.current.querySelector(
1080
+ `[data-type="select"][data-key="${l.key}"]`
1081
+ );
1082
+ if (!a || (a.value || "").trim().length === 0) {
1083
+ g = !1;
1084
+ break;
1085
+ }
1086
+ } else if (l.type === "textarea" && l.key) {
1087
+ const a = t.current.querySelector(
1088
+ `[data-type="textarea"][data-key="${l.key}"]`
1089
+ );
1090
+ if (!a || (a.value || "").trim().length === 0) {
1091
+ g = !1;
1092
+ break;
1093
+ }
1094
+ } else if (l.type === "richtext" && l.key) {
1095
+ const a = t.current.querySelector(
1096
+ `[data-type="richtext"][data-key="${l.key}"]`
1097
+ );
1098
+ if (!a || (a.textContent || "").replace(/[\u200B]/g, "").trim().length === 0) {
1099
+ g = !1;
1100
+ break;
1101
+ }
1102
+ } else if (l.type === "datepicker" && l.key) {
1103
+ const a = t.current.querySelector(
1104
+ `[data-type="datepicker"][data-key="${l.key}"]`
1105
+ );
1106
+ if (!a || (a.getAttribute("data-value") || "").trim().length === 0) {
1107
+ g = !1;
1108
+ break;
1109
+ }
1110
+ }
1111
+ i(A && g);
1052
1112
  }
1053
- function Ie(t, g) {
1113
+ function Ve(t, y) {
1054
1114
  if (!t.current) return;
1055
- t.current.querySelectorAll('[data-type="variable"]').forEach((l) => {
1056
- const u = l.innerText.replace(/\n/g, "");
1057
- u.replace(/\u200B/g, "") ? l.classList.remove("show-placeholder") : (u !== "​" && (l.innerText = "​"), l.classList.add("show-placeholder"));
1115
+ t.current.querySelectorAll('[data-type="variable"]').forEach((i) => {
1116
+ const c = i.innerText.replace(/\n/g, "");
1117
+ c.replace(/\u200B/g, "") ? i.classList.remove("show-placeholder") : (c !== "​" && (i.innerText = "​"), i.classList.add("show-placeholder"));
1058
1118
  });
1059
1119
  }
1060
- function Ct(t, g, i, l, u, k = {}, V) {
1120
+ function qt(t, y, u, i, c, k = {}, L) {
1061
1121
  if (!t.current) return;
1062
- let E = "", n = 0;
1063
- for (; n < g.length; ) {
1064
- const e = g[n], a = n + 1 < g.length ? g[n + 1] : null;
1065
- if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && a) {
1066
- const s = a.type === "upload" && a.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === a.exclusionGroup, y = a.type === "variable" && a.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === a.exclusionGroup;
1067
- if (s) {
1068
- const x = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, m = "</span>";
1069
- let _ = "";
1070
- e.className ? _ = `<span class="${e.className}">${e.text ?? ""}</span>` : _ = e.text ?? "";
1071
- const T = a, P = i[T.key] !== null && i[T.key] !== void 0, H = P ? i[T.key] : null, R = P ? i[T.key]?.name : T.text, j = P ? "" : "hidden", Y = T.tooltip && !P ? "" : "hidden", Z = P ? "has-file" : "", ee = P && R ? ` data-file-name="${R.replace(/"/g, "&quot;")}"` : "";
1072
- let $ = "";
1073
- P && H && (H.type?.startsWith("image/") ? $ = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(H)}" alt="preview" />` : $ = "<i class='iconfont icon-exlwenjian'></i>");
1074
- const D = `<span contenteditable="false" data-type="upload" data-key="${T.key}" class="upload-chip"><span class="upload-inner-wrapper ${Z}"><span class="upload-icon">${$}</span><span class="upload-label"${ee}>${R || T.text}</span>${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${Y}" data-upload-key="${T.key}" data-tooltip="${T.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${j}" title="移除文件">×</span></span></span>`;
1075
- E += x + _ + D + m, n += 2;
1122
+ let E = "", C = 0;
1123
+ for (; C < y.length; ) {
1124
+ const e = y[C], A = C + 1 < y.length ? y[C + 1] : null;
1125
+ if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && A) {
1126
+ const r = A.type === "upload" && A.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === A.exclusionGroup, s = A.type === "variable" && A.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === A.exclusionGroup;
1127
+ if (r) {
1128
+ const h = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, x = "</span>";
1129
+ let G = "";
1130
+ e.className ? G = `<span class="${e.className}">${e.text ?? ""}</span>` : G = e.text ?? "";
1131
+ const T = A, _ = u[T.key] !== null && u[T.key] !== void 0, H = _ ? u[T.key] : null, D = _ ? u[T.key]?.name : T.text, K = _ ? "" : "hidden", Q = T.tooltip && !_ ? "" : "hidden", Y = _ ? "has-file" : "", te = _ && D ? ` data-file-name="${D.replace(/"/g, "&quot;")}"` : "";
1132
+ let N = "";
1133
+ _ && H && (H.type?.startsWith("image/") ? N = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(H)}" alt="preview" />` : N = "<i class='iconfont icon-exlwenjian'></i>");
1134
+ const M = `<span contenteditable="false" data-type="upload" data-key="${T.key}" class="upload-chip"><span class="upload-inner-wrapper ${Y}"><span class="upload-icon">${N}</span><span class="upload-label"${te}>${D || T.text}</span>${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${Q}" data-upload-key="${T.key}" data-tooltip="${T.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${K}" title="移除文件">×</span></span></span>`;
1135
+ E += h + G + M + x, C += 2;
1076
1136
  continue;
1077
1137
  }
1078
- if (y) {
1079
- const x = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, m = "</span>";
1080
- let _ = "";
1081
- e.className ? _ = `<span class="${e.className}">${e.text ?? ""}</span>` : _ = e.text ?? "";
1082
- const T = a, H = (T.key ? u[T.key] : void 0) || T.text || "", R = !H, j = R ? "​" : H, Y = R ? "show-placeholder" : "", Z = T.exclusionGroup ? ` data-group="${T.exclusionGroup}"` : "", ee = T.tooltip ? ` data-tooltip="${T.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${T.key || ""}"` : "", $ = T.tooltip && R ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${T.key}" data-placeholder="${T.placeholder || ""}"${Z}${ee} class="variable-chip ${Y}">${j}${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${$}" data-variable-key="${T.key}" data-tooltip="${T.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1083
- E += x + _ + D + m, n += 2;
1138
+ if (s) {
1139
+ const h = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, x = "</span>";
1140
+ let G = "";
1141
+ e.className ? G = `<span class="${e.className}">${e.text ?? ""}</span>` : G = e.text ?? "";
1142
+ const T = A, H = (T.key ? c[T.key] : void 0) || T.text || "", D = !H, K = D ? "​" : H, Q = D ? "show-placeholder" : "", Y = T.exclusionGroup ? ` data-group="${T.exclusionGroup}"` : "", te = T.tooltip ? ` data-tooltip="${T.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${T.key || ""}"` : "", N = T.tooltip && D ? "" : "hidden", M = `<span contenteditable="true" data-type="variable" data-key="${T.key}" data-placeholder="${T.placeholder || ""}"${Y}${te} class="variable-chip ${Q}">${K}${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${N}" data-variable-key="${T.key}" data-tooltip="${T.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1143
+ E += h + G + M + x, C += 2;
1084
1144
  continue;
1085
1145
  }
1086
1146
  }
1087
- const L = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", f = e.exclusionGroup ? `<span ${L} class="exclusion-wrapper">` : "", r = e.exclusionGroup ? "</span>" : "";
1088
- let S = "";
1147
+ const l = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", a = e.exclusionGroup ? `<span ${l} class="exclusion-wrapper">` : "", n = e.exclusionGroup ? "</span>" : "";
1148
+ let o = "";
1089
1149
  if (e.type === "tag") {
1090
- const y = l || V === "hideTagClose" ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', p = l ? ' data-locked="true"' : "", x = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1091
- S = `<span contenteditable="false" class="tag-node group"${p}${x}><span class="tag-label">${e.text}</span>${y}</span>`;
1150
+ const s = i || L === "hideTagClose" ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', d = i ? ' data-locked="true"' : "", h = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1151
+ o = `<span contenteditable="false" class="tag-node group"${d}${h}><span class="tag-label">${e.text}</span>${s}</span>`;
1092
1152
  } else if (e.type === "text") {
1093
- const s = l ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', p = (e.text ?? "").replace(/\n/g, "<br/>");
1094
- e.className ? S = `<span class="${e.className}"${s}>${p}</span>` : S = l ? `<span${s}>${p}</span>` : `<span contenteditable="false">${p}</span>`;
1153
+ const r = i ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', d = (e.text ?? "").replace(/\n/g, "<br/>");
1154
+ e.className ? o = `<span class="${e.className}"${r}>${d}</span>` : o = i ? `<span${r}>${d}</span>` : `<span contenteditable="false">${d}</span>`;
1095
1155
  } else if (e.type === "variable" && e.key) {
1096
- const y = u[e.key] || e.text || "", p = !y, x = p ? "​" : y, m = p ? "show-placeholder" : "", _ = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", T = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", P = e.tooltip && p ? "" : "hidden", H = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${_}${T} class="variable-chip ${m}">${x}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${P}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1097
- e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</span>` : S = H;
1156
+ const s = c[e.key] || e.text || "", d = !s, h = d ? "​" : s, x = d ? "show-placeholder" : "", G = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", T = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", _ = e.tooltip && d ? "" : "hidden", H = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${G}${T} class="variable-chip ${x}">${h}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${_}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1157
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</span>` : o = H;
1098
1158
  } else if (e.type === "upload" && e.key) {
1099
- const s = i[e.key] !== null && i[e.key] !== void 0, y = s ? i[e.key] : null, p = s ? i[e.key]?.name : e.text, x = s ? "" : "hidden", m = e.tooltip && !s ? "" : "hidden", _ = s ? "has-file" : "", T = s && p ? ` data-file-name="${p.replace(/"/g, "&quot;")}"` : "";
1100
- let P = "";
1101
- s && y && (y.type?.startsWith("image/") ? P = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(y)}" alt="preview" />` : P = "<i class='iconfont icon-exlwenjian'></i>");
1102
- const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${_}"><span class="upload-icon">${P}</span><span class="upload-label"${T}>${p || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${m}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${x}" title="移除文件">×</span></span></span>`;
1103
- e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</span>` : S = H;
1159
+ const r = u[e.key] !== null && u[e.key] !== void 0, s = r ? u[e.key] : null, d = r ? u[e.key]?.name : e.text, h = r ? "" : "hidden", x = e.tooltip && !r ? "" : "hidden", G = r ? "has-file" : "", T = r && d ? ` data-file-name="${d.replace(/"/g, "&quot;")}"` : "";
1160
+ let _ = "";
1161
+ r && s && (s.type?.startsWith("image/") ? _ = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(s)}" alt="preview" />` : _ = "<i class='iconfont icon-exlwenjian'></i>");
1162
+ const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${G}"><span class="upload-icon">${_}</span><span class="upload-label"${T}>${d || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${x}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${h}" title="移除文件">×</span></span></span>`;
1163
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</span>` : o = H;
1104
1164
  } else if (e.type === "select" && e.key) {
1105
- const s = u[e.key] || "", y = (e.options || []).map((m) => {
1106
- const _ = s === m.value ? "selected" : "";
1107
- return `<option value="${m.value}" ${_}>${m.label}</option>`;
1108
- }).join(""), p = e.placeholder ? `<option value="" ${s ? "" : "selected"} disabled hidden>${e.placeholder}</option>` : "", x = `<select data-type="select" data-key="${e.key}" class="rte-select">${p}${y}</select>`;
1109
- e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${x}</span>` : S = x;
1165
+ const r = c[e.key] ?? e.text ?? "", s = (e.options || []).map((T) => {
1166
+ const _ = r === T.value ? "selected" : "";
1167
+ return `<option value="${T.value}" ${_}>${T.label}</option>`;
1168
+ }).join(""), d = e.placeholder ? `<option value="" ${r ? "" : "selected"} disabled hidden>${e.placeholder}</option>` : "", G = `<span class="rte-select-wrapper">${`<select data-type="select" data-key="${e.key}" class="rte-select rte-select-has-icon">${d}${s}</select>`}<i class="iconfont icon-qiehuan-xiayizhang rte-select-icon"></i></span>`;
1169
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${G}</span>` : o = G;
1110
1170
  } else if (e.type === "textarea" && e.key) {
1111
- const s = u[e.key] || "", y = e.maxHeight || 252, p = e.expandable !== !1, x = e.placeholder ? ` placeholder="${e.placeholder}"` : "", m = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${y}" style="max-height:${y}px;"${x}>${s}</textarea>`, _ = p ? `<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", T = `<div class="rte-textarea-wrapper" data-key="${e.key}">${m}${_}</div>`;
1112
- e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${T}</span>` : S = T;
1171
+ const r = c[e.key] || "", s = e.maxHeight || 252, d = e.expandable !== !1, h = e.placeholder ? ` placeholder="${e.placeholder}"` : "", x = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${s}" style="max-height:${s}px;"${h}>${r}</textarea>`, G = d ? `<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", T = `<div class="rte-textarea-wrapper" data-key="${e.key}">${x}${G}</div>`;
1172
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${T}</span>` : o = T;
1113
1173
  } else if (e.type === "richtext" && e.key) {
1114
- const s = u[e.key] || e.text || "", y = e.minHeight || 140, p = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", x = e.expandable !== !1, m = s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), _ = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${p} style="min-height:${y}px;">${m}</div>`, T = x ? `<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", P = `<div class="rte-richtext-wrapper" data-key="${e.key}">${_}${T}</div>`, H = `<div class="rte-richtext-container" data-key="${e.key}">${P}</div>`;
1115
- e.required ? S = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group rte-richtext-required"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</div>` : S = H;
1174
+ const r = c[e.key] || e.text || "", s = e.minHeight || 140, d = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", h = e.expandable !== !1, x = r.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), G = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${d} style="min-height:${s}px;">${x}</div>`, T = h ? `<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>` : "", _ = `<div class="rte-richtext-wrapper" data-key="${e.key}">${G}${T}</div>`, H = `<div class="rte-richtext-container" data-key="${e.key}">${_}</div>`;
1175
+ e.required ? o = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group rte-richtext-required"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</div>` : o = H;
1116
1176
  } else if (e.type === "datepicker" && e.key) {
1117
- const s = u[e.key] || "", y = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", p = `<div data-type="datepicker" data-key="${e.key}" data-value="${s}" class="rte-datepicker-host"${y}></div>`;
1118
- e.required ? S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${p}</span>` : S = p;
1177
+ const r = c[e.key] || "", s = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", d = `<div data-type="datepicker" data-key="${e.key}" data-value="${r}" class="rte-datepicker-host"${s}></div>`;
1178
+ e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${d}</span>` : o = d;
1119
1179
  } else if (e.type === "multi-variable" && e.key) {
1120
- const s = e.maxCount || 9, y = k[e.key] || 1, p = Math.min(y, s);
1180
+ const r = e.maxCount || 9, s = k[e.key] || 1, d = Math.min(s, r);
1121
1181
  if (e.required) {
1122
- const x = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, m = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
1123
- let _ = "";
1124
- for (let T = 0; T < p; T++) {
1125
- const P = `${e.key}_${T}`, H = u[P] || "", R = !H, j = R ? "​" : H, Y = R ? "show-placeholder" : "", Z = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", ee = e.tooltip && R ? "" : "hidden", $ = `<span contenteditable="true" data-type="variable" data-key="${P}" data-multi-key="${e.key}" data-index="${T}" data-placeholder="${e.placeholder || ""}"${Z} class="variable-chip ${Y}">${j}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${ee}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1126
- T === 0 ? _ += `<span ${m} class="exclusion-wrapper required-upload-group required-multi-first">${x}${$}</span>` : _ += $;
1182
+ const h = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, x = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
1183
+ let G = "";
1184
+ for (let T = 0; T < d; T++) {
1185
+ const _ = `${e.key}_${T}`, H = c[_] || "", D = !H, K = D ? "​" : H, Q = D ? "show-placeholder" : "", Y = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", te = e.tooltip && D ? "" : "hidden", N = `<span contenteditable="true" data-type="variable" data-key="${_}" data-multi-key="${e.key}" data-index="${T}" data-placeholder="${e.placeholder || ""}"${Y} class="variable-chip ${Q}">${K}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${te}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1186
+ T === 0 ? G += `<span ${x} class="exclusion-wrapper required-upload-group required-multi-first">${h}${N}</span>` : G += N;
1127
1187
  }
1128
- S = _;
1188
+ o = G;
1129
1189
  } else {
1130
- let x = "";
1131
- for (let m = 0; m < p; m++) {
1132
- const _ = `${e.key}_${m}`, T = u[_] || "", P = !T, H = P ? "​" : T, R = P ? "show-placeholder" : "", j = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", Y = e.tooltip && P ? "" : "hidden", Z = `<span contenteditable="true" data-type="variable" data-key="${_}" data-multi-key="${e.key}" data-index="${m}" data-placeholder="${e.placeholder || ""}"${j} class="variable-chip ${R}">${H}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Y}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1133
- x += Z;
1190
+ let h = "";
1191
+ for (let x = 0; x < d; x++) {
1192
+ const G = `${e.key}_${x}`, T = c[G] || "", _ = !T, H = _ ? "​" : T, D = _ ? "show-placeholder" : "", K = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", Q = e.tooltip && _ ? "" : "hidden", Y = `<span contenteditable="true" data-type="variable" data-key="${G}" data-multi-key="${e.key}" data-index="${x}" data-placeholder="${e.placeholder || ""}"${K} class="variable-chip ${D}">${H}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Q}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1193
+ h += Y;
1134
1194
  }
1135
- S = x;
1195
+ o = h;
1136
1196
  }
1137
1197
  }
1138
- E += f + S + r, n++;
1198
+ E += a + o + n, C++;
1139
1199
  }
1140
1200
  t.current && (t.current.innerHTML = E, setTimeout(() => {
1141
1201
  if (!t.current) return;
1142
- t.current.querySelectorAll('[data-type="variable"]').forEach((a) => {
1143
- const o = a.innerText.replace(/\n/g, "");
1144
- o.replace(/\u200B/g, "") ? a.classList.remove("show-placeholder") : (o !== "​" && (a.innerText = "​"), a.classList.add("show-placeholder"));
1202
+ t.current.querySelectorAll('[data-type="variable"]').forEach((A) => {
1203
+ const g = A.innerText.replace(/\n/g, "");
1204
+ g.replace(/\u200B/g, "") ? A.classList.remove("show-placeholder") : (g !== "​" && (A.innerText = "​"), A.classList.add("show-placeholder"));
1145
1205
  });
1146
1206
  }, 0));
1147
1207
  }
1148
- function qt(t, g, i, l, u = {}, k, V, E) {
1149
- const n = K(() => {
1208
+ function Ct(t, y, u, i, c = {}, k, L, E) {
1209
+ const C = U(() => {
1150
1210
  if (!t.current) return;
1151
- if (g.length === 0) {
1211
+ if (y.length === 0) {
1152
1212
  t.current.innerHTML = "";
1153
1213
  return;
1154
1214
  }
1155
1215
  let e = {};
1156
- const o = t.current.__tempVariableValues;
1157
- if (o ? (e = o, setTimeout(() => {
1216
+ const g = t.current.__tempVariableValues;
1217
+ if (g ? (e = g, setTimeout(() => {
1158
1218
  if (t.current) {
1159
- const L = t.current;
1160
- L.__tempVariableValues === o && delete L.__tempVariableValues;
1219
+ const l = t.current;
1220
+ l.__tempVariableValues === g && delete l.__tempVariableValues;
1161
1221
  }
1162
- }, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((y) => {
1163
- const p = y.dataset.key;
1164
- if (p) {
1165
- const x = y.innerText.replace(/[\u200B\n]/g, "").trim();
1166
- x && (e[p] = x);
1222
+ }, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((s) => {
1223
+ const d = s.dataset.key;
1224
+ if (d) {
1225
+ const h = s.innerText.replace(/[\u200B\n]/g, "").trim();
1226
+ h && (e[d] = h);
1167
1227
  }
1168
- }), t.current.querySelectorAll('[data-type="select"]').forEach((y) => {
1169
- const p = y.dataset.key;
1170
- if (p) {
1171
- const x = y.value.trim();
1172
- x && (e[p] = x);
1228
+ }), t.current.querySelectorAll('[data-type="select"]').forEach((s) => {
1229
+ const d = s.dataset.key;
1230
+ if (d) {
1231
+ const h = s.value.trim();
1232
+ h && (e[d] = h);
1173
1233
  }
1174
- }), t.current.querySelectorAll('[data-type="textarea"]').forEach((y) => {
1175
- const p = y.dataset.key;
1176
- if (p) {
1177
- const x = y.value.replace(/[\u200B]/g, "").trim();
1178
- x && (e[p] = x);
1234
+ }), t.current.querySelectorAll('[data-type="textarea"]').forEach((s) => {
1235
+ const d = s.dataset.key;
1236
+ if (d) {
1237
+ const h = s.value.replace(/[\u200B]/g, "").trim();
1238
+ h && (e[d] = h);
1179
1239
  }
1180
- }), t.current.querySelectorAll('[data-type="richtext"]').forEach((y) => {
1181
- const p = y.dataset.key;
1182
- if (p) {
1183
- const x = (y.textContent || "").replace(/[\u200B]/g, "").trim();
1184
- x && (e[p] = x);
1240
+ }), t.current.querySelectorAll('[data-type="richtext"]').forEach((s) => {
1241
+ const d = s.dataset.key;
1242
+ if (d) {
1243
+ const h = (s.textContent || "").replace(/[\u200B]/g, "").trim();
1244
+ h && (e[d] = h);
1185
1245
  }
1186
- }), t.current.querySelectorAll('[data-type="datepicker"]').forEach((y) => {
1187
- const p = y.dataset.key;
1188
- if (p) {
1189
- const x = (y.getAttribute("data-value") || "").trim();
1190
- x && (e[p] = x);
1246
+ }), t.current.querySelectorAll('[data-type="datepicker"]').forEach((s) => {
1247
+ const d = s.dataset.key;
1248
+ if (d) {
1249
+ const h = (s.getAttribute("data-value") || "").trim();
1250
+ h && (e[d] = h);
1191
1251
  }
1192
- })), Ct(t, g, i, l, e, u, E), k?.current) {
1193
- const { key: L, offset: f } = k.current;
1252
+ })), qt(t, y, u, i, e, c, E), k?.current) {
1253
+ const { key: l, offset: a } = k.current;
1194
1254
  setTimeout(() => {
1195
1255
  if (!t.current) return;
1196
- const r = t.current.querySelector(
1197
- `[data-type="variable"][data-key="${L}"]`
1256
+ const n = t.current.querySelector(
1257
+ `[data-type="variable"][data-key="${l}"]`
1198
1258
  );
1199
- if (r) {
1259
+ if (n) {
1200
1260
  try {
1201
- const S = document.createRange(), s = document.createTreeWalker(
1202
- r,
1261
+ const o = document.createRange(), r = document.createTreeWalker(
1262
+ n,
1203
1263
  NodeFilter.SHOW_TEXT,
1204
1264
  null
1205
1265
  );
1206
- let y = 0, p = null, x = 0;
1207
- for (; s.nextNode(); ) {
1208
- const m = s.currentNode, _ = m.textContent?.length || 0;
1209
- if (y + _ >= f) {
1210
- p = m, x = f - y;
1266
+ let s = 0, d = null, h = 0;
1267
+ for (; r.nextNode(); ) {
1268
+ const x = r.currentNode, G = x.textContent?.length || 0;
1269
+ if (s + G >= a) {
1270
+ d = x, h = a - s;
1211
1271
  break;
1212
1272
  }
1213
- y += _;
1273
+ s += G;
1214
1274
  }
1215
- if (p) {
1216
- S.setStart(p, Math.min(x, p.textContent?.length || 0)), S.collapse(!0);
1217
- const m = window.getSelection();
1218
- m && (m.removeAllRanges(), m.addRange(S), r.focus());
1275
+ if (d) {
1276
+ o.setStart(d, Math.min(h, d.textContent?.length || 0)), o.collapse(!0);
1277
+ const x = window.getSelection();
1278
+ x && (x.removeAllRanges(), x.addRange(o), n.focus());
1219
1279
  } else {
1220
- S.selectNodeContents(r), S.collapse(!1);
1221
- const m = window.getSelection();
1222
- m && (m.removeAllRanges(), m.addRange(S), r.focus());
1280
+ o.selectNodeContents(n), o.collapse(!1);
1281
+ const x = window.getSelection();
1282
+ x && (x.removeAllRanges(), x.addRange(o), n.focus());
1223
1283
  }
1224
1284
  } catch {
1225
- const S = document.createRange();
1226
- S.selectNodeContents(r), S.collapse(!1);
1227
- const s = window.getSelection();
1228
- s && (s.removeAllRanges(), s.addRange(S), r.focus());
1285
+ const o = document.createRange();
1286
+ o.selectNodeContents(n), o.collapse(!1);
1287
+ const r = window.getSelection();
1288
+ r && (r.removeAllRanges(), r.addRange(o), n.focus());
1229
1289
  }
1230
1290
  k.current = null;
1231
1291
  }
1232
1292
  }, 0);
1233
1293
  }
1234
- }, [g, i, l, t, u, k, V, E]);
1235
- oe(() => {
1236
- n();
1237
- }, [n]);
1294
+ }, [y, u, i, t, c, k, L, E]);
1295
+ ae(() => {
1296
+ C();
1297
+ }, [C]);
1238
1298
  }
1239
- function $t(t, g, i, l) {
1240
- oe(() => {
1241
- const u = t.current;
1242
- if (!u) return;
1299
+ function Tt(t, y, u, i) {
1300
+ ae(() => {
1301
+ const c = t.current;
1302
+ if (!c) return;
1243
1303
  const k = (E) => {
1244
- const n = E.target?.closest(".upload-info-icon");
1245
- if (n && n.classList.contains("upload-info-icon")) {
1246
- const a = n.dataset.uploadKey;
1247
- a && l({ key: a, anchorEl: n, type: "upload" });
1304
+ const C = E.target?.closest(".upload-info-icon");
1305
+ if (C && C.classList.contains("upload-info-icon")) {
1306
+ const A = C.dataset.uploadKey;
1307
+ A && i({ key: A, anchorEl: C, type: "upload" });
1248
1308
  return;
1249
1309
  }
1250
1310
  const e = E.target?.closest('[data-type="upload"]');
1251
1311
  if (e) {
1252
- const a = e.dataset.key;
1253
- if (a) {
1254
- const o = i[a];
1255
- o && o.type && o.type.startsWith("image/") && l({ key: a, anchorEl: e, type: "upload-preview" });
1312
+ const A = e.dataset.key;
1313
+ if (A) {
1314
+ const g = u[A];
1315
+ g && g.type && g.type.startsWith("image/") && i({ key: A, anchorEl: e, type: "upload-preview" });
1256
1316
  }
1257
1317
  }
1258
- }, V = (E) => {
1259
- const n = E.target?.closest(".upload-info-icon"), e = E.relatedTarget;
1260
- if (n && n.classList.contains("upload-info-icon")) {
1261
- !e || !u.contains(e) ? l(null) : e.closest(".upload-info-icon") || l(null);
1318
+ }, L = (E) => {
1319
+ const C = E.target?.closest(".upload-info-icon"), e = E.relatedTarget;
1320
+ if (C && C.classList.contains("upload-info-icon")) {
1321
+ !e || !c.contains(e) ? i(null) : e.closest(".upload-info-icon") || i(null);
1262
1322
  return;
1263
1323
  }
1264
- const a = E.target?.closest('[data-type="upload"]');
1265
- if (a) {
1266
- const o = e;
1267
- if (o && a.contains(o))
1324
+ const A = E.target?.closest('[data-type="upload"]');
1325
+ if (A) {
1326
+ const g = e;
1327
+ if (g && A.contains(g))
1268
1328
  return;
1269
- l(null);
1329
+ i(null);
1270
1330
  }
1271
1331
  };
1272
- return u.addEventListener("mouseover", k, !0), u.addEventListener("mouseout", V, !0), () => {
1273
- u.removeEventListener("mouseover", k, !0), u.removeEventListener("mouseout", V, !0);
1332
+ return c.addEventListener("mouseover", k, !0), c.addEventListener("mouseout", L, !0), () => {
1333
+ c.removeEventListener("mouseover", k, !0), c.removeEventListener("mouseout", L, !0);
1274
1334
  };
1275
- }, [g, i, t, l]);
1335
+ }, [y, u, t, i]);
1276
1336
  }
1277
- function Tt(t, g, i, l) {
1278
- oe(() => {
1337
+ function $t(t, y, u, i) {
1338
+ ae(() => {
1279
1339
  if (!t.current) return;
1280
- const u = (n) => {
1281
- if (l === "hideTagClose")
1340
+ const c = (C) => {
1341
+ if (i === "hideTagClose")
1282
1342
  return;
1283
- const e = n.currentTarget, a = e.dataset.tooltip, o = e.dataset.tagKey || "";
1284
- a && i({ key: o, anchorEl: e, type: "tag" });
1343
+ const e = C.currentTarget, A = e.dataset.tooltip, g = e.dataset.tagKey || "";
1344
+ A && u({ key: g, anchorEl: e, type: "tag" });
1285
1345
  }, k = () => {
1286
- i(null);
1346
+ u(null);
1287
1347
  };
1288
- let V;
1348
+ let L;
1289
1349
  const E = () => {
1290
1350
  if (!t.current) return;
1291
1351
  t.current.querySelectorAll(
1292
1352
  ".tag-node[data-tooltip]"
1293
1353
  ).forEach((e) => {
1294
- e.addEventListener("mouseenter", u), e.addEventListener("mouseleave", k);
1354
+ e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", k);
1295
1355
  });
1296
1356
  };
1297
- return V = requestAnimationFrame(() => {
1298
- V = requestAnimationFrame(E);
1357
+ return L = requestAnimationFrame(() => {
1358
+ L = requestAnimationFrame(E);
1299
1359
  }), () => {
1300
- cancelAnimationFrame(V), t.current && t.current.querySelectorAll(
1360
+ cancelAnimationFrame(L), t.current && t.current.querySelectorAll(
1301
1361
  ".tag-node[data-tooltip]"
1302
1362
  ).forEach((e) => {
1303
- e.removeEventListener("mouseenter", u), e.removeEventListener("mouseleave", k);
1363
+ e.removeEventListener("mouseenter", c), e.removeEventListener("mouseleave", k);
1304
1364
  });
1305
1365
  };
1306
- }, [g, t, i, l]);
1366
+ }, [y, t, u, i]);
1307
1367
  }
1308
- function Nt(t, g, i) {
1309
- oe(() => {
1310
- const l = t.current;
1311
- if (!l) return;
1312
- const u = (V) => {
1313
- const E = V.target?.closest(".variable-info-icon");
1368
+ function Nt(t, y, u) {
1369
+ ae(() => {
1370
+ const i = t.current;
1371
+ if (!i) return;
1372
+ const c = (L) => {
1373
+ const E = L.target?.closest(".variable-info-icon");
1314
1374
  if (E && E.classList.contains("variable-info-icon")) {
1315
- const n = E.dataset.variableKey;
1316
- n && i({ key: n, anchorEl: E, type: "variable" });
1375
+ const C = E.dataset.variableKey;
1376
+ C && u({ key: C, anchorEl: E, type: "variable" });
1317
1377
  }
1318
- }, k = (V) => {
1319
- const E = V.target?.closest(".variable-info-icon"), n = V.relatedTarget;
1320
- E && E.classList.contains("variable-info-icon") && (!n || !l.contains(n) ? i(null) : n.closest(".variable-info-icon") || i(null));
1378
+ }, k = (L) => {
1379
+ const E = L.target?.closest(".variable-info-icon"), C = L.relatedTarget;
1380
+ E && E.classList.contains("variable-info-icon") && (!C || !i.contains(C) ? u(null) : C.closest(".variable-info-icon") || u(null));
1321
1381
  };
1322
- return l.addEventListener("mouseover", u, !0), l.addEventListener("mouseout", k, !0), () => {
1323
- l.removeEventListener("mouseover", u, !0), l.removeEventListener("mouseout", k, !0);
1382
+ return i.addEventListener("mouseover", c, !0), i.addEventListener("mouseout", k, !0), () => {
1383
+ i.removeEventListener("mouseover", c, !0), i.removeEventListener("mouseout", k, !0);
1324
1384
  };
1325
- }, [g, t, i]);
1385
+ }, [y, t, u]);
1326
1386
  }
1327
- function St(t, g, i, l) {
1328
- oe(() => {
1387
+ function St(t, y, u, i) {
1388
+ ae(() => {
1329
1389
  if (!t.current) return;
1330
- const u = (n) => {
1331
- const e = n.currentTarget;
1332
- e.dataset.fileName && l({ key: "", anchorEl: e, type: "upload-label" });
1390
+ const c = (C) => {
1391
+ const e = C.currentTarget;
1392
+ e.dataset.fileName && i({ key: "", anchorEl: e, type: "upload-label" });
1333
1393
  }, k = () => {
1334
- l(null);
1394
+ i(null);
1335
1395
  };
1336
- let V;
1396
+ let L;
1337
1397
  const E = () => {
1338
1398
  if (!t.current) return;
1339
1399
  t.current.querySelectorAll(
1340
1400
  ".upload-label[data-file-name]"
1341
1401
  ).forEach((e) => {
1342
- e.addEventListener("mouseenter", u), e.addEventListener("mouseleave", k);
1402
+ e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", k);
1343
1403
  });
1344
1404
  };
1345
- return V = requestAnimationFrame(() => {
1346
- V = requestAnimationFrame(E);
1405
+ return L = requestAnimationFrame(() => {
1406
+ L = requestAnimationFrame(E);
1347
1407
  }), () => {
1348
- cancelAnimationFrame(V), t.current && t.current.querySelectorAll(
1408
+ cancelAnimationFrame(L), t.current && t.current.querySelectorAll(
1349
1409
  ".upload-label[data-file-name]"
1350
1410
  ).forEach((e) => {
1351
- e.removeEventListener("mouseenter", u), e.removeEventListener("mouseleave", k);
1411
+ e.removeEventListener("mouseenter", c), e.removeEventListener("mouseleave", k);
1352
1412
  });
1353
1413
  };
1354
- }, [g, i, t, l]);
1414
+ }, [y, u, t, i]);
1355
1415
  }
1356
- function At(t, g, i, l) {
1357
- oe(() => {
1358
- Le(t, g, i), Ve(t, g, i, l);
1359
- }, [i, g, t, l]);
1416
+ function At(t, y, u, i) {
1417
+ ae(() => {
1418
+ const c = setTimeout(() => {
1419
+ Te(t, y, u), $e(t, y, u, i);
1420
+ }, 0);
1421
+ return () => clearTimeout(c);
1422
+ }, [u, y, t, i]), ae(() => {
1423
+ const c = t.current;
1424
+ if (!c) return;
1425
+ const k = (L) => {
1426
+ const E = L.target;
1427
+ E && E.matches('[data-type="select"]') && (Te(t, y, u), $e(t, y, u, i));
1428
+ };
1429
+ return c.addEventListener("change", k, !0), () => {
1430
+ c.removeEventListener("change", k, !0);
1431
+ };
1432
+ }, [y, u, t, i]);
1360
1433
  }
1361
- function It(t, g) {
1362
- oe(() => {
1434
+ function Lt(t, y) {
1435
+ ae(() => {
1363
1436
  if (!t.current) return;
1364
- let i = !1, l = 0;
1365
- const u = () => {
1366
- i = !0;
1437
+ let u = !1, i = 0;
1438
+ const c = () => {
1439
+ u = !0;
1367
1440
  }, k = () => {
1368
- i = !1, l = Date.now();
1441
+ u = !1, i = Date.now();
1369
1442
  };
1370
- let V = !1, E = 0;
1371
- const n = () => {
1372
- V = !0;
1443
+ let L = !1, E = 0;
1444
+ const C = () => {
1445
+ L = !0;
1373
1446
  }, e = () => {
1374
- V = !1, E = Date.now();
1375
- }, a = () => {
1447
+ L = !1, E = Date.now();
1448
+ }, A = () => {
1376
1449
  E = Date.now();
1377
- }, o = () => {
1450
+ }, g = () => {
1378
1451
  if (!t.current) return;
1379
- const f = window.getSelection();
1380
- if (!f || f.rangeCount === 0 || g.current || i || V || Date.now() - E < 500)
1452
+ const a = window.getSelection();
1453
+ if (!a || a.rangeCount === 0 || y.current || u || L || Date.now() - E < 500)
1381
1454
  return;
1382
- const r = f.getRangeAt(0);
1383
- if (!r.collapsed)
1384
- return t.current.contains(r.commonAncestorContainer), void 0;
1385
- const S = f.anchorNode;
1386
- if (!S || !t.current.contains(S))
1455
+ const n = a.getRangeAt(0);
1456
+ if (!n.collapsed)
1457
+ return t.current.contains(n.commonAncestorContainer), void 0;
1458
+ const o = a.anchorNode;
1459
+ if (!o || !t.current.contains(o))
1387
1460
  return;
1388
- let s = null;
1389
- if (S.nodeType === Node.ELEMENT_NODE ? s = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (s = S.parentElement.closest('[data-type="variable"]')), !s) {
1390
- if (Date.now() - l > 500)
1461
+ let r = null;
1462
+ if (o.nodeType === Node.ELEMENT_NODE ? r = o.closest('[data-type="variable"]') : o.nodeType === Node.TEXT_NODE && o.parentElement && (r = o.parentElement.closest('[data-type="variable"]')), !r) {
1463
+ if (Date.now() - i > 500)
1391
1464
  return;
1392
- const y = t.current.querySelectorAll('[data-type="variable"]');
1393
- if (y.length > 0) {
1394
- let p = null;
1395
- for (const x of Array.from(y))
1396
- if (x.style.display !== "none") {
1397
- p = x;
1465
+ const s = t.current.querySelectorAll('[data-type="variable"]');
1466
+ if (s.length > 0) {
1467
+ let d = null;
1468
+ for (const h of Array.from(s))
1469
+ if (h.style.display !== "none") {
1470
+ d = h;
1398
1471
  break;
1399
1472
  }
1400
- if (!p && y.length > 0 && (p = y[0]), p) {
1401
- const x = document.createRange();
1402
- x.selectNodeContents(p), x.collapse(!1), f.removeAllRanges(), f.addRange(x), p.focus();
1473
+ if (!d && s.length > 0 && (d = s[0]), d) {
1474
+ const h = document.createRange();
1475
+ h.selectNodeContents(d), h.collapse(!1), a.removeAllRanges(), a.addRange(h), d.focus();
1403
1476
  } else
1404
- f.removeAllRanges();
1477
+ a.removeAllRanges();
1405
1478
  } else
1406
- f.removeAllRanges();
1479
+ a.removeAllRanges();
1407
1480
  }
1408
- }, L = t.current;
1409
- return L && (L.addEventListener("compositionstart", n), L.addEventListener("compositionend", e), L.addEventListener("input", a)), document.addEventListener("mousedown", u), document.addEventListener("mouseup", k), document.addEventListener("selectionchange", o), () => {
1410
- const f = t.current;
1411
- f && (f.removeEventListener("compositionstart", n), f.removeEventListener("compositionend", e), f.removeEventListener("input", a)), document.removeEventListener("mousedown", u), document.removeEventListener("mouseup", k), document.removeEventListener("selectionchange", o);
1481
+ }, l = t.current;
1482
+ return l && (l.addEventListener("compositionstart", C), l.addEventListener("compositionend", e), l.addEventListener("input", A)), document.addEventListener("mousedown", c), document.addEventListener("mouseup", k), document.addEventListener("selectionchange", g), () => {
1483
+ const a = t.current;
1484
+ a && (a.removeEventListener("compositionstart", C), a.removeEventListener("compositionend", e), a.removeEventListener("input", A)), document.removeEventListener("mousedown", c), document.removeEventListener("mouseup", k), document.removeEventListener("selectionchange", g);
1412
1485
  };
1413
- }, [t, g]);
1486
+ }, [t, y]);
1414
1487
  }
1415
- const Lt = ({
1488
+ const It = ({
1416
1489
  config: t,
1417
- onSend: g,
1418
- isProcessing: i = !1,
1419
- disabled: l = !1,
1420
- width: u,
1490
+ onSend: y,
1491
+ isProcessing: u = !1,
1492
+ disabled: i = !1,
1493
+ width: c,
1421
1494
  lockStructure: k = !1,
1422
- agentOptions: V = [],
1495
+ agentOptions: L = [],
1423
1496
  onAgentSelect: E,
1424
- onAgentExit: n,
1497
+ onAgentExit: C,
1425
1498
  loading: e = !1,
1426
- placeholder: a,
1427
- border: o,
1428
- background: L = "transparent",
1429
- hideButtons: f
1499
+ placeholder: A,
1500
+ border: g,
1501
+ background: l = "transparent",
1502
+ hideButtons: a
1430
1503
  }) => {
1431
- const r = W(null), S = W(null), [s, y] = X({}), [p, x] = X(null), [m, _] = X(null), T = W(!1), P = W(null), [H, R] = X(!1), j = W(null), [Y, Z] = X(!0), [ee, $] = X(() => {
1432
- const c = {};
1433
- return t.forEach((d) => {
1434
- d.type === "multi-variable" && d.key && (c[d.key] = 1);
1435
- }), c;
1436
- }), D = W({}), te = W({}), re = W({});
1437
- oe(() => {
1438
- te.current = s;
1439
- }, [s]), oe(() => {
1440
- re.current = ee;
1441
- }, [ee]);
1442
- const ce = K((c) => c.find((v) => v.type === "tag")?.text || null, []), ye = W(t), ue = W(null);
1443
- oe(() => {
1444
- const c = ce(ye.current), d = ce(t);
1445
- if (c && c !== d && r.current) {
1504
+ const n = j(null), o = j(null), [r, s] = X({}), [d, h] = X(null), [x, G] = X(null), T = j(!1), _ = j(null), [H, D] = X(!1), K = j(null), [Q, Y] = X(!0), [te, N] = X(() => {
1505
+ const p = {};
1506
+ return t.forEach((f) => {
1507
+ f.type === "multi-variable" && f.key && (p[f.key] = 1);
1508
+ }), p;
1509
+ }), M = j({}), ne = j({}), re = j({});
1510
+ ae(() => {
1511
+ ne.current = r;
1512
+ }, [r]), ae(() => {
1513
+ re.current = te;
1514
+ }, [te]);
1515
+ const ce = U((p) => p.find((v) => v.type === "tag")?.text || null, []), ye = j(t), ue = j(null);
1516
+ ae(() => {
1517
+ const p = ce(ye.current), f = ce(t);
1518
+ if (p && p !== f && n.current) {
1446
1519
  const v = {};
1447
- r.current.querySelectorAll('[data-type="variable"]').forEach((w) => {
1520
+ n.current.querySelectorAll('[data-type="variable"]').forEach((w) => {
1448
1521
  const B = w.dataset.key;
1449
1522
  if (B) {
1450
- const q = w.innerText.replace(/[\u200B\n]/g, "").trim();
1451
- q && (v[B] = q);
1523
+ const $ = w.innerText.replace(/[\u200B\n]/g, "").trim();
1524
+ $ && (v[B] = $);
1452
1525
  }
1453
- }), r.current.querySelectorAll('[data-type="select"]').forEach((w) => {
1526
+ }), n.current.querySelectorAll('[data-type="select"]').forEach((w) => {
1454
1527
  const B = w.dataset.key;
1455
1528
  if (B) {
1456
- const q = w.value.trim();
1457
- q && (v[B] = q);
1529
+ const $ = w.value.trim();
1530
+ $ && (v[B] = $);
1458
1531
  }
1459
- }), r.current.querySelectorAll('[data-type="textarea"]').forEach((w) => {
1532
+ }), n.current.querySelectorAll('[data-type="textarea"]').forEach((w) => {
1460
1533
  const B = w.dataset.key;
1461
1534
  if (B) {
1462
- const q = w.value.replace(/[\u200B]/g, "").trim();
1463
- q && (v[B] = q);
1535
+ const $ = w.value.replace(/[\u200B]/g, "").trim();
1536
+ $ && (v[B] = $);
1464
1537
  }
1465
- }), D.current[c] = {
1538
+ }), M.current[p] = {
1466
1539
  variableValues: v,
1467
- files: { ...te.current },
1540
+ files: { ...ne.current },
1468
1541
  multiVariableCounts: { ...re.current }
1469
1542
  };
1470
1543
  }
1471
- if (d && D.current[d]) {
1472
- const v = D.current[d];
1473
- ue.current = v, y(v.files), $(v.multiVariableCounts);
1474
- } else if (d) {
1544
+ if (f && M.current[f]) {
1545
+ const v = M.current[f];
1546
+ ue.current = v, s(v.files), N(v.multiVariableCounts);
1547
+ } else if (f) {
1475
1548
  ue.current = null;
1476
1549
  const v = {};
1477
- t.forEach((N) => {
1478
- N.type === "multi-variable" && N.key && (v[N.key] = 1);
1479
- }), $(v), y({});
1550
+ t.forEach((S) => {
1551
+ S.type === "multi-variable" && S.key && (v[S.key] = 1);
1552
+ }), N(v), s({});
1480
1553
  } else
1481
- ue.current = null, $({}), y({});
1554
+ ue.current = null, N({}), s({});
1482
1555
  ye.current = t;
1483
- }, [t, ce]), Me(() => {
1484
- ue.current && r.current && (r.current.__tempVariableValues = ue.current.variableValues, setTimeout(() => {
1556
+ }, [t, ce]), Re(() => {
1557
+ ue.current && n.current && (n.current.__tempVariableValues = ue.current.variableValues, setTimeout(() => {
1485
1558
  ue.current && (ue.current = null);
1486
1559
  }, 0));
1487
- }), qt(r, t, s, k, ee, j, void 0, f), $t(r, t, s, _), Tt(r, t, _, f), St(r, t, s, _), Nt(r, t, _), At(r, t, s, R), It(r, T), oe(() => {
1560
+ }), Ct(n, t, r, k, te, K, void 0, a), Tt(n, t, r, G), $t(n, t, G, a), St(n, t, r, G), Nt(n, t, G), At(n, t, r, D), Lt(n, T), ae(() => {
1488
1561
  if (t.length > 0) {
1489
- Z(!1);
1562
+ Y(!1);
1490
1563
  return;
1491
1564
  }
1492
- const c = () => {
1493
- if (!r.current) {
1494
- Z(!0);
1565
+ const p = () => {
1566
+ if (!n.current) {
1567
+ Y(!0);
1495
1568
  return;
1496
1569
  }
1497
- const v = r.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", N = r.current.querySelectorAll('[data-type="variable"]'), b = r.current.querySelectorAll('[data-type="upload"]');
1498
- let C = !1;
1499
- N.forEach((B) => {
1500
- (B.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (C = !0);
1570
+ const v = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", S = n.current.querySelectorAll('[data-type="variable"]'), b = n.current.querySelectorAll('[data-type="upload"]');
1571
+ let q = !1;
1572
+ S.forEach((B) => {
1573
+ (B.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (q = !0);
1501
1574
  }), b.forEach((B) => {
1502
- B.querySelector(".upload-inner-wrapper.has-file") && (C = !0);
1575
+ B.querySelector(".upload-inner-wrapper.has-file") && (q = !0);
1503
1576
  });
1504
- const w = !v && !C;
1505
- Z(w), t.length === 0 && R(!w);
1577
+ const w = !v && !q;
1578
+ Y(w), t.length === 0 && D(!w);
1506
1579
  };
1507
- c();
1508
- const d = new MutationObserver(c);
1509
- return r.current && d.observe(r.current, {
1580
+ p();
1581
+ const f = new MutationObserver(p);
1582
+ return n.current && f.observe(n.current, {
1510
1583
  childList: !0,
1511
1584
  subtree: !0,
1512
1585
  characterData: !0
1513
1586
  }), () => {
1514
- d.disconnect();
1587
+ f.disconnect();
1515
1588
  };
1516
1589
  }, [t]);
1517
- const $e = (c) => {
1518
- if (l) {
1519
- c.preventDefault();
1590
+ const Ne = (p) => {
1591
+ if (i) {
1592
+ p.preventDefault();
1520
1593
  return;
1521
1594
  }
1522
- c.preventDefault();
1523
- const d = c.clipboardData.getData("text/plain"), v = window.getSelection();
1595
+ p.preventDefault();
1596
+ const f = p.clipboardData.getData("text/plain"), v = window.getSelection();
1524
1597
  if (v && v.rangeCount > 0) {
1525
- const N = v.anchorNode;
1526
- if (N) {
1598
+ const S = v.anchorNode;
1599
+ if (S) {
1527
1600
  let b = null;
1528
- if (N.nodeType === Node.ELEMENT_NODE ? b = N.closest('[data-type="variable"]') : N.nodeType === Node.TEXT_NODE && N.parentElement && (b = N.parentElement.closest('[data-type="variable"]')), b) {
1529
- const C = b.dataset.multiKey;
1530
- if (C) {
1531
- const w = /[、,,\s\n\r\t]+/, B = d.split(w).map((q) => q.trim()).filter((q) => q.length > 0);
1532
- if (console.log("[Paste Event] 粘贴的内容:", d), console.log("[Paste Event] 拆分后的值:", B), B.length > 1) {
1533
- const q = parseInt(b.dataset.index || "0", 10), G = t.find((ae) => ae.type === "multi-variable" && ae.key === C)?.maxCount || 9, O = ee[C] || 1, A = Math.min(q + B.length, G);
1534
- A > O && $((U) => ({
1535
- ...U,
1536
- [C]: A
1601
+ if (S.nodeType === Node.ELEMENT_NODE ? b = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (b = S.parentElement.closest('[data-type="variable"]')), b) {
1602
+ const q = b.dataset.multiKey;
1603
+ if (q) {
1604
+ const w = /[、,,\s\n\r\t]+/, B = f.split(w).map(($) => $.trim()).filter(($) => $.length > 0);
1605
+ if (console.log("[Paste Event] 粘贴的内容:", f), console.log("[Paste Event] 拆分后的值:", B), B.length > 1) {
1606
+ const $ = parseInt(b.dataset.index || "0", 10), P = t.find((ee) => ee.type === "multi-variable" && ee.key === q)?.maxCount || 9, z = te[q] || 1, I = Math.min($ + B.length, P);
1607
+ I > z && N((F) => ({
1608
+ ...F,
1609
+ [q]: I
1537
1610
  }));
1538
- const M = [];
1539
- for (let U = 0; U < O; U++) {
1540
- const ae = `${C}_${U}`, se = r.current.querySelector(
1541
- `[data-type="variable"][data-key="${ae}"][data-multi-key="${C}"]`
1611
+ const R = [];
1612
+ for (let F = 0; F < z; F++) {
1613
+ const ee = `${q}_${F}`, se = n.current.querySelector(
1614
+ `[data-type="variable"][data-key="${ee}"][data-multi-key="${q}"]`
1542
1615
  );
1543
1616
  if (se) {
1544
1617
  const pe = se.innerText.replace(/[\u200B\n]/g, "").trim();
1545
- M.push(pe);
1618
+ R.push(pe);
1546
1619
  }
1547
1620
  }
1548
- M.splice(q, 1, ...B.slice(0, G - q));
1549
- const J = M.slice(0, G);
1550
- J.length > 0 && J[J.length - 1] !== "" && J.length < G && J.push("");
1551
- const I = Math.max(J.length, 1), Q = {};
1552
- J.forEach((U, ae) => {
1553
- U && (Q[`${C}_${ae}`] = U);
1554
- }), r.current.querySelectorAll(
1621
+ R.splice($, 1, ...B.slice(0, P - $));
1622
+ const J = R.slice(0, P);
1623
+ J.length > 0 && J[J.length - 1] !== "" && J.length < P && J.push("");
1624
+ const V = Math.max(J.length, 1), Z = {};
1625
+ J.forEach((F, ee) => {
1626
+ F && (Z[`${q}_${ee}`] = F);
1627
+ }), n.current.querySelectorAll(
1555
1628
  '[data-type="variable"]'
1556
- ).forEach((U) => {
1557
- const ae = U.dataset.key, se = U.dataset.multiKey;
1558
- if (ae && se !== C) {
1559
- const pe = U.innerText.replace(/[\u200B\n]/g, "").trim();
1560
- pe && (Q[ae] = pe);
1629
+ ).forEach((F) => {
1630
+ const ee = F.dataset.key, se = F.dataset.multiKey;
1631
+ if (ee && se !== q) {
1632
+ const pe = F.innerText.replace(/[\u200B\n]/g, "").trim();
1633
+ pe && (Z[ee] = pe);
1561
1634
  }
1562
- }), r.current.__tempVariableValues = Q, $((U) => ({
1563
- ...U,
1564
- [C]: I
1635
+ }), n.current.__tempVariableValues = Z, N((F) => ({
1636
+ ...F,
1637
+ [q]: V
1565
1638
  })), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", J);
1566
1639
  return;
1567
1640
  } else B.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
@@ -1569,383 +1642,385 @@ const Lt = ({
1569
1642
  }
1570
1643
  }
1571
1644
  }
1572
- document.execCommand("insertText", !1, d), de(), setTimeout(() => {
1573
- const N = window.getSelection();
1574
- if (N && N.rangeCount > 0) {
1575
- const b = N.anchorNode;
1645
+ document.execCommand("insertText", !1, f), de(), setTimeout(() => {
1646
+ const S = window.getSelection();
1647
+ if (S && S.rangeCount > 0) {
1648
+ const b = S.anchorNode;
1576
1649
  if (b) {
1577
- let C = null;
1578
- if (b.nodeType === Node.ELEMENT_NODE ? C = b.closest('[data-type="variable"][data-multi-key]') : b.nodeType === Node.TEXT_NODE && b.parentElement && (C = b.parentElement.closest('[data-type="variable"][data-multi-key]')), C) {
1579
- const w = C.innerText.replace(/[\u200B\n]/g, "").trim();
1650
+ let q = null;
1651
+ if (b.nodeType === Node.ELEMENT_NODE ? q = b.closest('[data-type="variable"][data-multi-key]') : b.nodeType === Node.TEXT_NODE && b.parentElement && (q = b.parentElement.closest('[data-type="variable"][data-multi-key]')), q) {
1652
+ const w = q.innerText.replace(/[\u200B\n]/g, "").trim();
1580
1653
  /[、,,\s]+/.test(w) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", w), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
1581
1654
  }
1582
1655
  }
1583
1656
  }
1584
1657
  }, 0);
1585
- }, Te = (c) => {
1586
- if (c.target.files && c.target.files[0] && p) {
1587
- const d = c.target.files[0], v = p;
1588
- y((N) => ({ ...N, [v]: d }));
1658
+ }, Se = (p) => {
1659
+ if (p.target.files && p.target.files[0] && d) {
1660
+ const f = p.target.files[0], v = d;
1661
+ s((S) => ({ ...S, [v]: f }));
1589
1662
  }
1590
- c.target && (c.target.value = ""), x(null);
1591
- }, xe = (c) => {
1592
- y((d) => {
1593
- const v = { ...d };
1594
- return delete v[c], v;
1663
+ p.target && (p.target.value = ""), h(null);
1664
+ }, xe = (p) => {
1665
+ s((f) => {
1666
+ const v = { ...f };
1667
+ return delete v[p], v;
1595
1668
  });
1596
- }, Ne = (c) => {
1597
- const d = c.target;
1598
- if (d.closest(".tag-close-btn")) {
1599
- if (c.preventDefault(), c.stopPropagation(), k)
1669
+ }, Ae = (p) => {
1670
+ const f = p.target;
1671
+ if (f.closest(".tag-close-btn")) {
1672
+ if (p.preventDefault(), p.stopPropagation(), k)
1600
1673
  return;
1601
- _(null), n ? n() : r.current && (r.current.innerHTML = "", r.current.focus());
1674
+ G(null), C ? C() : n.current && (n.current.innerHTML = "", n.current.focus());
1602
1675
  return;
1603
1676
  }
1604
1677
  if (k) {
1605
- const b = d.closest(".tag-node"), C = d.closest('[data-type="text"]');
1606
- if (b || C) {
1607
- c.preventDefault(), c.stopPropagation();
1678
+ const b = f.closest(".tag-node"), q = f.closest('[data-type="text"]');
1679
+ if (b || q) {
1680
+ p.preventDefault(), p.stopPropagation();
1608
1681
  const w = window.getSelection();
1609
1682
  w && w.removeAllRanges();
1610
1683
  return;
1611
1684
  }
1612
1685
  }
1613
- d.closest('[data-type="variable"]') || (P.current = { x: c.clientX, y: c.clientY }, T.current = !1, d.closest(".file-remove-btn") && (c.preventDefault(), c.stopPropagation()));
1614
- }, me = (c) => {
1615
- if (!c.target.closest('[data-type="variable"]') && P.current) {
1616
- const N = Math.abs(c.clientX - P.current.x), b = Math.abs(c.clientY - P.current.y);
1617
- (N > 3 || b > 3) && (T.current = !0);
1686
+ f.closest('[data-type="variable"]') || (_.current = { x: p.clientX, y: p.clientY }, T.current = !1, f.closest(".file-remove-btn") && (p.preventDefault(), p.stopPropagation()));
1687
+ }, me = (p) => {
1688
+ if (!p.target.closest('[data-type="variable"]') && _.current) {
1689
+ const S = Math.abs(p.clientX - _.current.x), b = Math.abs(p.clientY - _.current.y);
1690
+ (S > 3 || b > 3) && (T.current = !0);
1618
1691
  }
1619
- }, Se = (c) => {
1620
- if (c.target.closest('[data-type="variable"]')) {
1621
- P.current = null, T.current = !1;
1692
+ }, Le = (p) => {
1693
+ if (p.target.closest('[data-type="variable"]')) {
1694
+ _.current = null, T.current = !1;
1622
1695
  return;
1623
1696
  }
1624
- P.current = null, T.current = !1;
1625
- }, z = (c) => {
1626
- if (l)
1697
+ _.current = null, T.current = !1;
1698
+ }, O = (p) => {
1699
+ if (i)
1627
1700
  return;
1628
- const d = c.target;
1629
- if (d.closest('[data-type="datepicker"]'))
1701
+ const f = p.target;
1702
+ if (f.closest('[data-type="datepicker"]'))
1630
1703
  return;
1631
- if (d.closest(".tag-close-btn")) {
1632
- c.preventDefault(), c.stopPropagation();
1704
+ if (f.closest(".tag-close-btn")) {
1705
+ p.preventDefault(), p.stopPropagation();
1633
1706
  return;
1634
1707
  }
1635
1708
  if (t.length === 0)
1636
1709
  return;
1637
- const b = (A, M) => {
1638
- if (!r.current) return;
1639
- Array.from(r.current.children).forEach((I) => {
1640
- if (I !== A)
1641
- if (M)
1642
- I.dataset.prevDisplay === void 0 && (I.dataset.prevDisplay = I.style.display || ""), I.style.setProperty("display", "none", "important");
1643
- else if (I.dataset.prevDisplay !== void 0) {
1644
- const Q = I.dataset.prevDisplay;
1645
- Q ? I.style.display = Q : I.style.removeProperty("display"), delete I.dataset.prevDisplay;
1710
+ const b = (I, R) => {
1711
+ if (!n.current) return;
1712
+ Array.from(n.current.children).forEach((V) => {
1713
+ if (V !== I)
1714
+ if (R)
1715
+ V.dataset.prevDisplay === void 0 && (V.dataset.prevDisplay = V.style.display || ""), V.style.setProperty("display", "none", "important");
1716
+ else if (V.dataset.prevDisplay !== void 0) {
1717
+ const Z = V.dataset.prevDisplay;
1718
+ Z ? V.style.display = Z : V.style.removeProperty("display"), delete V.dataset.prevDisplay;
1646
1719
  } else
1647
- I.style.removeProperty("display");
1720
+ V.style.removeProperty("display");
1648
1721
  });
1649
- }, C = d.closest(".rte-textarea-toggle");
1650
- if (C) {
1651
- c.preventDefault(), c.stopPropagation();
1652
- const A = C.closest(".rte-textarea-wrapper"), M = A?.querySelector('[data-type="textarea"]'), I = !(C.getAttribute("data-expanded") === "true");
1653
- C.setAttribute("data-expanded", String(I)), C.textContent = I ? "收起" : "展开", A && A.classList.toggle("rte-textarea-expanded", I);
1654
- const Q = A?.closest(".rte-textarea-required");
1655
- if (Q ? Q.classList.toggle("rte-textarea-overlay", I) : A && A.classList.toggle("rte-textarea-overlay", I), M)
1656
- if (I)
1657
- M.classList.add("rte-textarea-expanded"), M.style.maxHeight = "none", M.style.height = "100%";
1722
+ }, q = f.closest(".rte-textarea-toggle");
1723
+ if (q) {
1724
+ p.preventDefault(), p.stopPropagation();
1725
+ const I = q.closest(".rte-textarea-wrapper"), R = I?.querySelector('[data-type="textarea"]'), V = !(q.getAttribute("data-expanded") === "true");
1726
+ q.setAttribute("data-expanded", String(V)), q.textContent = V ? "收起" : "展开", I && I.classList.toggle("rte-textarea-expanded", V);
1727
+ const Z = I?.closest(".rte-textarea-required");
1728
+ if (Z ? Z.classList.toggle("rte-textarea-overlay", V) : I && I.classList.toggle("rte-textarea-overlay", V), R)
1729
+ if (V)
1730
+ R.classList.add("rte-textarea-expanded"), R.style.maxHeight = "none", R.style.height = "100%";
1658
1731
  else {
1659
- M.classList.remove("rte-textarea-expanded");
1660
- const ne = M.dataset.maxHeight || "252";
1661
- M.style.maxHeight = `${ne}px`, M.style.height = "auto";
1732
+ R.classList.remove("rte-textarea-expanded");
1733
+ const oe = R.dataset.maxHeight || "252";
1734
+ R.style.maxHeight = `${oe}px`, R.style.height = "auto";
1662
1735
  }
1663
- r.current && (I ? r.current.classList.add("rte-overlay-active") : r.current.classList.remove("rte-overlay-active"));
1736
+ n.current && (V ? n.current.classList.add("rte-overlay-active") : n.current.classList.remove("rte-overlay-active"));
1664
1737
  return;
1665
1738
  }
1666
- const w = d.closest(".rte-richtext-toggle");
1739
+ const w = f.closest(".rte-richtext-toggle");
1667
1740
  if (w) {
1668
- c.preventDefault(), c.stopPropagation();
1669
- const A = w.closest(".rte-richtext-wrapper"), M = A?.querySelector('[data-type="richtext"]'), I = !(w.getAttribute("data-expanded") === "true");
1670
- w.setAttribute("data-expanded", String(I)), w.textContent = I ? "收起" : "展开";
1671
- const Q = A?.closest(".rte-richtext-required");
1672
- Q ? Q.classList.toggle("rte-richtext-expanded", I) : A && A.classList.toggle("rte-richtext-expanded", I);
1673
- const ne = A?.closest(".exclusion-wrapper") || A?.parentElement;
1674
- M && (I ? (M.style.height = "100%", M.style.overflow = "auto") : (M.style.height = "", M.style.overflow = "")), ne && (ne.classList.toggle("rte-richtext-host-expanded", I), b(ne, I)), r.current && r.current.classList.toggle("rte-richtext-fullscreen-active", I);
1741
+ p.preventDefault(), p.stopPropagation();
1742
+ const I = w.closest(".rte-richtext-wrapper"), R = I?.querySelector('[data-type="richtext"]'), V = !(w.getAttribute("data-expanded") === "true");
1743
+ ((ee, se) => {
1744
+ ee.setAttribute("data-expanded", String(se)), ee.innerHTML = se ? '<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>' : '<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>';
1745
+ })(w, V);
1746
+ const oe = I?.closest(".rte-richtext-required");
1747
+ oe ? oe.classList.toggle("rte-richtext-expanded", V) : I && I.classList.toggle("rte-richtext-expanded", V);
1748
+ const F = I?.closest(".exclusion-wrapper") || I?.parentElement;
1749
+ R && (V ? (R.style.height = "100%", R.style.overflow = "auto") : (R.style.height = "", R.style.overflow = "")), F && (F.classList.toggle("rte-richtext-host-expanded", V), b(F, V)), n.current && n.current.classList.toggle("rte-richtext-fullscreen-active", V);
1675
1750
  return;
1676
1751
  }
1677
- if (d.closest('[data-type="text"]')) {
1678
- c.preventDefault(), c.stopPropagation();
1679
- const A = window.getSelection();
1680
- A && A.removeAllRanges();
1752
+ if (f.closest('[data-type="text"]')) {
1753
+ p.preventDefault(), p.stopPropagation();
1754
+ const I = window.getSelection();
1755
+ I && I.removeAllRanges();
1681
1756
  return;
1682
1757
  }
1683
- if (k && d.closest(".tag-node")) {
1684
- c.preventDefault(), c.stopPropagation();
1685
- const M = window.getSelection();
1686
- M && M.removeAllRanges();
1758
+ if (k && f.closest(".tag-node")) {
1759
+ p.preventDefault(), p.stopPropagation();
1760
+ const R = window.getSelection();
1761
+ R && R.removeAllRanges();
1687
1762
  return;
1688
1763
  }
1689
- if (d.closest('[data-type="variable"]')) {
1764
+ if (f.closest('[data-type="variable"]')) {
1690
1765
  if (T.current)
1691
1766
  return;
1692
1767
  setTimeout(() => {
1693
- const A = window.getSelection();
1694
- A && !A.isCollapsed || Ie(r);
1768
+ const I = window.getSelection();
1769
+ I && !I.isCollapsed || Ve(n);
1695
1770
  }, 10);
1696
1771
  return;
1697
1772
  }
1698
- const G = d.closest(".file-remove-btn");
1699
- if (G) {
1700
- c.preventDefault(), c.stopPropagation();
1701
- const M = G.closest('[data-type="upload"]')?.dataset.key;
1702
- M && xe(M);
1773
+ const P = f.closest(".file-remove-btn");
1774
+ if (P) {
1775
+ p.preventDefault(), p.stopPropagation();
1776
+ const R = P.closest('[data-type="upload"]')?.dataset.key;
1777
+ R && xe(R);
1703
1778
  return;
1704
1779
  }
1705
- const O = d.closest('[data-type="upload"]');
1706
- if (O) {
1707
- const A = O.dataset.key;
1708
- A && (x(A), S.current?.click());
1780
+ const z = f.closest('[data-type="upload"]');
1781
+ if (z) {
1782
+ const I = z.dataset.key;
1783
+ I && (h(I), o.current?.click());
1709
1784
  return;
1710
1785
  }
1711
- }, le = (c) => {
1712
- const v = c.target.closest('[data-type="variable"]');
1786
+ }, le = (p) => {
1787
+ const v = p.target.closest('[data-type="variable"]');
1713
1788
  if (v) {
1714
- const N = window.getSelection();
1715
- if (N) {
1716
- const b = document.createRange(), C = v.textContent || "";
1717
- if (C.replace(/\u200B/g, "")) {
1718
- let B = 0, q = C.length;
1719
- C.startsWith("​") && (B = 1), C.endsWith("​") && C.length > 1 && (q = C.length - 1);
1720
- const G = v.firstChild;
1721
- G && G.nodeType === Node.TEXT_NODE ? (b.setStart(G, B), b.setEnd(G, q)) : b.selectNodeContents(v);
1789
+ const S = window.getSelection();
1790
+ if (S) {
1791
+ const b = document.createRange(), q = v.textContent || "";
1792
+ if (q.replace(/\u200B/g, "")) {
1793
+ let B = 0, $ = q.length;
1794
+ q.startsWith("​") && (B = 1), q.endsWith("​") && q.length > 1 && ($ = q.length - 1);
1795
+ const P = v.firstChild;
1796
+ P && P.nodeType === Node.TEXT_NODE ? (b.setStart(P, B), b.setEnd(P, $)) : b.selectNodeContents(v);
1722
1797
  } else
1723
1798
  b.selectNodeContents(v), b.collapse(!0);
1724
- N.removeAllRanges(), N.addRange(b);
1799
+ S.removeAllRanges(), S.addRange(b);
1725
1800
  }
1726
1801
  }
1727
1802
  }, de = () => {
1728
1803
  if (t.length === 0) {
1729
- if (r.current) {
1730
- const v = !(r.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
1731
- Z(v), R(!v);
1804
+ if (n.current) {
1805
+ const v = !(n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
1806
+ Y(v), D(!v);
1732
1807
  }
1733
1808
  return;
1734
1809
  }
1735
- if (Ie(r), r.current && r.current.querySelectorAll('[data-type="variable"]').forEach((v) => {
1736
- const N = v.querySelector(".variable-info-icon");
1737
- if (N) {
1810
+ if (Ve(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((v) => {
1811
+ const S = v.querySelector(".variable-info-icon");
1812
+ if (S) {
1738
1813
  let b = !1;
1739
- const C = document.createTreeWalker(
1814
+ const q = document.createTreeWalker(
1740
1815
  v,
1741
1816
  NodeFilter.SHOW_TEXT,
1742
1817
  {
1743
- acceptNode: (w) => N.contains(w) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1818
+ acceptNode: (w) => S.contains(w) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1744
1819
  }
1745
1820
  );
1746
- for (; C.nextNode(); )
1747
- if (C.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1821
+ for (; q.nextNode(); )
1822
+ if (q.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1748
1823
  b = !0;
1749
1824
  break;
1750
1825
  }
1751
- b ? N.classList.add("hidden") : N.classList.remove("hidden");
1826
+ b ? S.classList.add("hidden") : S.classList.remove("hidden");
1752
1827
  }
1753
- }), Le(r, t, s), Ve(r, t, s, R), !r.current) return;
1754
- t.filter((d) => d.type === "multi-variable" && d.key).forEach((d) => {
1755
- if (!d.key) return;
1756
- const v = d.maxCount || 9, N = ee[d.key] || 1, b = [];
1757
- for (let G = 0; G < N; G++) {
1758
- const O = `${d.key}_${G}`, A = r.current.querySelector(
1759
- `[data-type="variable"][data-key="${O}"][data-multi-key="${d.key}"]`
1828
+ }), Te(n, t, r), $e(n, t, r, D), !n.current) return;
1829
+ t.filter((f) => f.type === "multi-variable" && f.key).forEach((f) => {
1830
+ if (!f.key) return;
1831
+ const v = f.maxCount || 9, S = te[f.key] || 1, b = [];
1832
+ for (let P = 0; P < S; P++) {
1833
+ const z = `${f.key}_${P}`, I = n.current.querySelector(
1834
+ `[data-type="variable"][data-key="${z}"][data-multi-key="${f.key}"]`
1760
1835
  );
1761
- if (A) {
1762
- const M = A.innerText.replace(/[\u200B\n]/g, "").trim();
1763
- b.push(M);
1836
+ if (I) {
1837
+ const R = I.innerText.replace(/[\u200B\n]/g, "").trim();
1838
+ b.push(R);
1764
1839
  }
1765
1840
  }
1766
1841
  const w = (b[b.length - 1] || "") === "";
1767
- let B = !1, q = -1;
1768
- for (let G = 0; G < b.length - 1; G++)
1769
- if (b[G] === "") {
1770
- B = !0, q = G;
1842
+ let B = !1, $ = -1;
1843
+ for (let P = 0; P < b.length - 1; P++)
1844
+ if (b[P] === "") {
1845
+ B = !0, $ = P;
1771
1846
  break;
1772
1847
  }
1773
- if (B && q >= 0) {
1774
- const G = window.getSelection();
1775
- if (G && G.rangeCount > 0) {
1776
- const I = G.getRangeAt(0), Q = I.startContainer, ne = Q.nodeType === Node.ELEMENT_NODE ? Q.closest('[data-type="variable"][data-multi-key]') : Q.parentElement?.closest('[data-type="variable"][data-multi-key]');
1777
- if (ne) {
1778
- const U = ne.dataset.key;
1779
- if (U) {
1780
- const ae = document.createRange();
1781
- ae.setStartBefore(ne), ae.setEnd(I.startContainer, I.startOffset);
1782
- const se = ae.toString().length;
1783
- j.current = { key: U, offset: se };
1848
+ if (B && $ >= 0) {
1849
+ const P = window.getSelection();
1850
+ if (P && P.rangeCount > 0) {
1851
+ const V = P.getRangeAt(0), Z = V.startContainer, oe = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1852
+ if (oe) {
1853
+ const F = oe.dataset.key;
1854
+ if (F) {
1855
+ const ee = document.createRange();
1856
+ ee.setStartBefore(oe), ee.setEnd(V.startContainer, V.startOffset);
1857
+ const se = ee.toString().length;
1858
+ K.current = { key: F, offset: se };
1784
1859
  }
1785
1860
  }
1786
1861
  }
1787
- const O = [...b];
1788
- for (let I = q; I < O.length - 1; I++)
1789
- O[I] = O[I + 1];
1790
- O.pop();
1791
- const A = {};
1792
- O.forEach((I, Q) => {
1793
- I && (A[`${d.key}_${Q}`] = I);
1862
+ const z = [...b];
1863
+ for (let V = $; V < z.length - 1; V++)
1864
+ z[V] = z[V + 1];
1865
+ z.pop();
1866
+ const I = {};
1867
+ z.forEach((V, Z) => {
1868
+ V && (I[`${f.key}_${Z}`] = V);
1794
1869
  });
1795
- const M = Math.max(w ? O.length : O.length + 1, 1);
1796
- r.current.querySelectorAll(
1870
+ const R = Math.max(w ? z.length : z.length + 1, 1);
1871
+ n.current.querySelectorAll(
1797
1872
  '[data-type="variable"]'
1798
- ).forEach((I) => {
1799
- const Q = I.dataset.key, ne = I.dataset.multiKey;
1800
- if (Q && ne !== d.key) {
1801
- const U = I.innerText.replace(/[\u200B\n]/g, "").trim();
1802
- U && (A[Q] = U);
1873
+ ).forEach((V) => {
1874
+ const Z = V.dataset.key, oe = V.dataset.multiKey;
1875
+ if (Z && oe !== f.key) {
1876
+ const F = V.innerText.replace(/[\u200B\n]/g, "").trim();
1877
+ F && (I[Z] = F);
1803
1878
  }
1804
- }), r.current.__tempVariableValues = A, $((I) => ({
1805
- ...I,
1806
- [d.key]: M
1879
+ }), n.current.__tempVariableValues = I, N((V) => ({
1880
+ ...V,
1881
+ [f.key]: R
1807
1882
  }));
1808
1883
  return;
1809
1884
  }
1810
1885
  if (!w) {
1811
- const G = N - 1, O = `${d.key}_${G}`, A = r.current.querySelector(
1812
- `[data-type="variable"][data-key="${O}"][data-multi-key="${d.key}"]`
1886
+ const P = S - 1, z = `${f.key}_${P}`, I = n.current.querySelector(
1887
+ `[data-type="variable"][data-key="${z}"][data-multi-key="${f.key}"]`
1813
1888
  );
1814
- if (A && A.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && N < v) {
1889
+ if (I && I.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && S < v) {
1815
1890
  const J = window.getSelection();
1816
1891
  if (J && J.rangeCount > 0) {
1817
- const I = J.getRangeAt(0), Q = I.startContainer, ne = Q.nodeType === Node.ELEMENT_NODE ? Q.closest('[data-type="variable"][data-multi-key]') : Q.parentElement?.closest('[data-type="variable"][data-multi-key]');
1818
- if (ne) {
1819
- const U = ne.dataset.key;
1820
- if (U) {
1821
- const ae = document.createRange();
1822
- ae.setStartBefore(ne), ae.setEnd(I.startContainer, I.startOffset);
1823
- const se = ae.toString().length;
1824
- j.current = { key: U, offset: se };
1892
+ const V = J.getRangeAt(0), Z = V.startContainer, oe = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1893
+ if (oe) {
1894
+ const F = oe.dataset.key;
1895
+ if (F) {
1896
+ const ee = document.createRange();
1897
+ ee.setStartBefore(oe), ee.setEnd(V.startContainer, V.startOffset);
1898
+ const se = ee.toString().length;
1899
+ K.current = { key: F, offset: se };
1825
1900
  }
1826
1901
  }
1827
1902
  }
1828
- $((I) => ({
1829
- ...I,
1830
- [d.key]: N + 1
1903
+ N((V) => ({
1904
+ ...V,
1905
+ [f.key]: S + 1
1831
1906
  }));
1832
1907
  }
1833
1908
  }
1834
1909
  });
1835
1910
  };
1836
- Me(() => {
1837
- const c = r.current;
1838
- if (!c) return;
1839
- const d = /* @__PURE__ */ new Map(), v = (C) => {
1840
- const w = C.target, B = C.relatedTarget;
1841
- !w || !r.current || !r.current.contains(w) || B && r.current.contains(B) || setTimeout(() => {
1842
- if (r.current) {
1911
+ Re(() => {
1912
+ const p = n.current;
1913
+ if (!p) return;
1914
+ const f = /* @__PURE__ */ new Map(), v = (q) => {
1915
+ const w = q.target, B = q.relatedTarget;
1916
+ !w || !n.current || !n.current.contains(w) || B && n.current.contains(B) || setTimeout(() => {
1917
+ if (n.current) {
1843
1918
  if (t.length === 0) {
1844
- const q = r.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1845
- R(q.length > 0);
1919
+ const $ = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1920
+ D($.length > 0);
1846
1921
  return;
1847
1922
  }
1848
- Ie(r), Le(r, t, s), Ve(r, t, s, R);
1923
+ Ve(n), Te(n, t, r), $e(n, t, r, D);
1849
1924
  }
1850
1925
  }, 0);
1851
1926
  };
1852
- c.addEventListener("blur", v, !0);
1853
- const N = () => {
1854
- if (!r.current) return;
1855
- d.forEach((B, q) => {
1856
- q.removeEventListener("blur", B, !1);
1857
- }), d.clear();
1858
- const C = r.current.querySelectorAll(
1927
+ p.addEventListener("blur", v, !0);
1928
+ const S = () => {
1929
+ if (!n.current) return;
1930
+ f.forEach((B, $) => {
1931
+ $.removeEventListener("blur", B, !1);
1932
+ }), f.clear();
1933
+ const q = n.current.querySelectorAll(
1859
1934
  '[data-type="variable"][data-multi-key]'
1860
1935
  ), w = (B) => {
1861
1936
  B.stopPropagation(), B.stopImmediatePropagation();
1862
- const q = B.target;
1863
- if (!q || !r.current || !r.current.contains(q))
1937
+ const $ = B.target;
1938
+ if (!$ || !n.current || !n.current.contains($))
1864
1939
  return;
1865
- const G = q.closest('[data-type="variable"][data-multi-key]');
1866
- if (!G || !r.current.contains(G))
1940
+ const P = $.closest('[data-type="variable"][data-multi-key]');
1941
+ if (!P || !n.current.contains(P))
1867
1942
  return;
1868
- let O = !1;
1869
- if (d.forEach((ae, se) => {
1870
- (se === G || se.contains(q)) && (O = !0);
1871
- }), !O)
1943
+ let z = !1;
1944
+ if (f.forEach((ee, se) => {
1945
+ (se === P || se.contains($)) && (z = !0);
1946
+ }), !z)
1872
1947
  return;
1873
- const A = G.dataset.multiKey, M = G.dataset.key, J = G.dataset.index;
1874
- if (!A || !M || J === void 0) return;
1875
- const I = B.relatedTarget;
1876
- if (!(!I || !r.current.contains(I)))
1948
+ const I = P.dataset.multiKey, R = P.dataset.key, J = P.dataset.index;
1949
+ if (!I || !R || J === void 0) return;
1950
+ const V = B.relatedTarget;
1951
+ if (!(!V || !n.current.contains(V)))
1877
1952
  return;
1878
- const ne = G.innerText.replace(/[\u200B\n]/g, "").trim();
1953
+ const oe = P.innerText.replace(/[\u200B\n]/g, "").trim();
1879
1954
  console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
1880
- multiKey: A,
1881
- currentKey: M,
1955
+ multiKey: I,
1956
+ currentKey: R,
1882
1957
  index: J,
1883
- content: ne
1958
+ content: oe
1884
1959
  });
1885
- const U = /[、,,\s]+/;
1886
- if (U.test(ne)) {
1887
- const ae = ne.split(U).map((he) => he.trim()).filter((he) => he.length > 0);
1888
- console.log("[Blur Event] 拆分前的内容:", ne), console.log("[Blur Event] 拆分后的部分:", ae);
1889
- const pe = ae.slice(0, 9);
1960
+ const F = /[、,,\s]+/;
1961
+ if (F.test(oe)) {
1962
+ const ee = oe.split(F).map((he) => he.trim()).filter((he) => he.length > 0);
1963
+ console.log("[Blur Event] 拆分前的内容:", oe), console.log("[Blur Event] 拆分后的部分:", ee);
1964
+ const pe = ee.slice(0, 9);
1890
1965
  if (console.log("[Blur Event] 有效的部分(最多9个):", pe), pe.length > 1) {
1891
- const he = t.find((we) => we.type === "multi-variable" && we.key === A);
1966
+ const he = t.find((ke) => ke.type === "multi-variable" && ke.key === I);
1892
1967
  if (he) {
1893
- const we = ee[A] || 1, Re = parseInt(J, 10), De = he.maxCount || 9, ke = [];
1894
- for (let ie = 0; ie < we; ie++) {
1895
- const ve = `${A}_${ie}`, Ee = r.current.querySelector(
1896
- `[data-type="variable"][data-key="${ve}"][data-multi-key="${A}"]`
1968
+ const ke = te[I] || 1, De = parseInt(J, 10), Me = he.maxCount || 9, we = [];
1969
+ for (let ie = 0; ie < ke; ie++) {
1970
+ const ve = `${I}_${ie}`, Ee = n.current.querySelector(
1971
+ `[data-type="variable"][data-key="${ve}"][data-multi-key="${I}"]`
1897
1972
  );
1898
1973
  if (Ee) {
1899
- const Ce = Ee.innerText.replace(/[\u200B\n]/g, "").trim();
1900
- ke.push(Ce);
1974
+ const qe = Ee.innerText.replace(/[\u200B\n]/g, "").trim();
1975
+ we.push(qe);
1901
1976
  }
1902
1977
  }
1903
- console.log("[Blur Event] 拆分前的所有值:", ke), console.log("[Blur Event] 当前索引:", Re), console.log("[Blur Event] 要插入的值:", pe), ke.splice(Re, 1, ...pe);
1904
- const fe = ke.slice(0, De);
1905
- console.log("[Blur Event] 拆分后的所有值:", fe), fe.length > 0 && fe[fe.length - 1] !== "" && fe.length < De && fe.push("");
1906
- const Ke = Math.max(fe.length, 1), Ae = {};
1978
+ console.log("[Blur Event] 拆分前的所有值:", we), console.log("[Blur Event] 当前索引:", De), console.log("[Blur Event] 要插入的值:", pe), we.splice(De, 1, ...pe);
1979
+ const fe = we.slice(0, Me);
1980
+ console.log("[Blur Event] 拆分后的所有值:", fe), fe.length > 0 && fe[fe.length - 1] !== "" && fe.length < Me && fe.push("");
1981
+ const Ke = Math.max(fe.length, 1), Ie = {};
1907
1982
  fe.forEach((ie, ve) => {
1908
- ie && (Ae[`${A}_${ve}`] = ie);
1909
- }), r.current.querySelectorAll(
1983
+ ie && (Ie[`${I}_${ve}`] = ie);
1984
+ }), n.current.querySelectorAll(
1910
1985
  '[data-type="variable"]'
1911
1986
  ).forEach((ie) => {
1912
1987
  const ve = ie.dataset.key, Ee = ie.dataset.multiKey;
1913
- if (ve && Ee !== A) {
1914
- const Ce = ie.innerText.replace(/[\u200B\n]/g, "").trim();
1915
- Ce && (Ae[ve] = Ce);
1988
+ if (ve && Ee !== I) {
1989
+ const qe = ie.innerText.replace(/[\u200B\n]/g, "").trim();
1990
+ qe && (Ie[ve] = qe);
1916
1991
  }
1917
- }), r.current.__tempVariableValues = Ae, $((ie) => ({
1992
+ }), n.current.__tempVariableValues = Ie, N((ie) => ({
1918
1993
  ...ie,
1919
- [A]: Ke
1994
+ [I]: Ke
1920
1995
  }));
1921
1996
  }
1922
1997
  }
1923
1998
  }
1924
1999
  };
1925
- C.forEach((B) => {
1926
- B.addEventListener("blur", w, !1), d.set(B, w);
2000
+ q.forEach((B) => {
2001
+ B.addEventListener("blur", w, !1), f.set(B, w);
1927
2002
  });
1928
2003
  }, b = setTimeout(() => {
1929
- N();
2004
+ S();
1930
2005
  }, 0);
1931
2006
  return () => {
1932
- clearTimeout(b), c.removeEventListener("blur", v, !0), d.forEach((C, w) => {
1933
- w.removeEventListener("blur", C, !1);
1934
- }), d.clear();
2007
+ clearTimeout(b), p.removeEventListener("blur", v, !0), f.forEach((q, w) => {
2008
+ w.removeEventListener("blur", q, !1);
2009
+ }), f.clear();
1935
2010
  };
1936
- }, [t, ee, s]);
1937
- const be = (c) => {
1938
- if (l) {
1939
- c.preventDefault();
2011
+ }, [t, te, r]);
2012
+ const be = (p) => {
2013
+ if (i) {
2014
+ p.preventDefault();
1940
2015
  return;
1941
2016
  }
1942
- const d = window.getSelection();
1943
- if (d && d.rangeCount > 0) {
1944
- const v = d.anchorNode;
1945
- let N = null;
1946
- if (v && (v.nodeType === Node.ELEMENT_NODE ? N = v.closest('[data-type="text"]') : v.nodeType === Node.TEXT_NODE && v.parentElement && (N = v.parentElement.closest('[data-type="text"]'))), N) {
1947
- if (c.preventDefault(), c.stopPropagation(), r.current) {
1948
- const b = r.current.querySelector(
2017
+ const f = window.getSelection();
2018
+ if (f && f.rangeCount > 0) {
2019
+ const v = f.anchorNode;
2020
+ let S = null;
2021
+ if (v && (v.nodeType === Node.ELEMENT_NODE ? S = v.closest('[data-type="text"]') : v.nodeType === Node.TEXT_NODE && v.parentElement && (S = v.parentElement.closest('[data-type="text"]'))), S) {
2022
+ if (p.preventDefault(), p.stopPropagation(), n.current) {
2023
+ const b = n.current.querySelector(
1949
2024
  '[data-type="variable"], [data-type="upload"]'
1950
2025
  );
1951
2026
  b && b.focus();
@@ -1953,12 +2028,12 @@ const Lt = ({
1953
2028
  return;
1954
2029
  }
1955
2030
  }
1956
- if (k && d && d.rangeCount > 0) {
1957
- const v = d.anchorNode;
1958
- let N = null;
1959
- if (v && (v.nodeType === Node.ELEMENT_NODE ? N = v.closest(".tag-node") : v.nodeType === Node.TEXT_NODE && v.parentElement && (N = v.parentElement.closest(".tag-node"))), N) {
1960
- if (c.preventDefault(), c.stopPropagation(), r.current) {
1961
- const b = r.current.querySelector(
2031
+ if (k && f && f.rangeCount > 0) {
2032
+ const v = f.anchorNode;
2033
+ let S = null;
2034
+ if (v && (v.nodeType === Node.ELEMENT_NODE ? S = v.closest(".tag-node") : v.nodeType === Node.TEXT_NODE && v.parentElement && (S = v.parentElement.closest(".tag-node"))), S) {
2035
+ if (p.preventDefault(), p.stopPropagation(), n.current) {
2036
+ const b = n.current.querySelector(
1962
2037
  '[data-type="variable"], [data-type="upload"]'
1963
2038
  );
1964
2039
  b && b.focus();
@@ -1966,269 +2041,269 @@ const Lt = ({
1966
2041
  return;
1967
2042
  }
1968
2043
  }
1969
- if (c.key === "Enter" && !c.shiftKey && (c.preventDefault(), Ge()), c.key === "Escape" && r.current) {
2044
+ if (p.key === "Enter" && !p.shiftKey && (p.preventDefault(), Pe()), p.key === "Escape" && n.current) {
1970
2045
  if (k) {
1971
- c.preventDefault();
2046
+ p.preventDefault();
1972
2047
  return;
1973
2048
  }
1974
- r.current.innerHTML = "", r.current.focus();
2049
+ n.current.innerHTML = "", n.current.focus();
1975
2050
  }
1976
- if (c.key === "Backspace") {
2051
+ if (p.key === "Backspace") {
1977
2052
  const v = window.getSelection();
1978
2053
  if (v && v.rangeCount > 0) {
1979
- const N = v.getRangeAt(0), b = v.anchorNode;
2054
+ const S = v.getRangeAt(0), b = v.anchorNode;
1980
2055
  if (k) {
1981
2056
  let w = null, B = null;
1982
- if (b && (b.nodeType === Node.ELEMENT_NODE ? (w = b.closest(".tag-node"), B = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (w = b.parentElement.closest(".tag-node"), B = b.parentElement.closest('[data-type="text"]'))), (w || B) && N.collapsed && N.startOffset === 0) {
1983
- c.preventDefault();
2057
+ if (b && (b.nodeType === Node.ELEMENT_NODE ? (w = b.closest(".tag-node"), B = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (w = b.parentElement.closest(".tag-node"), B = b.parentElement.closest('[data-type="text"]'))), (w || B) && S.collapsed && S.startOffset === 0) {
2058
+ p.preventDefault();
1984
2059
  return;
1985
2060
  }
1986
2061
  }
1987
- let C = null;
1988
- if (b && (b.nodeType === Node.ELEMENT_NODE ? C = b.closest(
2062
+ let q = null;
2063
+ if (b && (b.nodeType === Node.ELEMENT_NODE ? q = b.closest(
1989
2064
  '[data-type="variable"]'
1990
- ) : b.nodeType === Node.TEXT_NODE && b.parentElement && (C = b.parentElement.closest(
2065
+ ) : b.nodeType === Node.TEXT_NODE && b.parentElement && (q = b.parentElement.closest(
1991
2066
  '[data-type="variable"]'
1992
- ))), C) {
1993
- if (!N.collapsed)
2067
+ ))), q) {
2068
+ if (!S.collapsed)
1994
2069
  return;
1995
- const w = C.innerText;
2070
+ const w = q.innerText;
1996
2071
  if (w === "​" || w === "") {
1997
- c.preventDefault();
2072
+ p.preventDefault();
1998
2073
  return;
1999
2074
  }
2000
- if (N.startOffset === 0) {
2001
- c.preventDefault();
2075
+ if (S.startOffset === 0) {
2076
+ p.preventDefault();
2002
2077
  return;
2003
2078
  }
2004
- if (w.startsWith("​") && N.startOffset === 1) {
2005
- c.preventDefault();
2079
+ if (w.startsWith("​") && S.startOffset === 1) {
2080
+ p.preventDefault();
2006
2081
  return;
2007
2082
  }
2008
2083
  }
2009
2084
  }
2010
2085
  }
2011
- }, Ge = () => {
2012
- if (i || l || e || !H || !r.current) return;
2086
+ }, Pe = () => {
2087
+ if (u || i || e || !H || !n.current) return;
2013
2088
  if (t.length === 0) {
2014
- const C = r.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
2015
- if (!C) return;
2016
- g(C, C);
2089
+ const q = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
2090
+ if (!q) return;
2091
+ y(q, q);
2017
2092
  return;
2018
2093
  }
2019
- const c = r.current;
2020
- let d = "";
2021
- const v = {}, N = (C) => {
2022
- if (!(C.nodeType === Node.ELEMENT_NODE && C.style.display === "none")) {
2023
- if (C.nodeType === Node.TEXT_NODE)
2024
- d += (C.textContent || "").replace(/\u200B/g, "");
2025
- else if (C.nodeType === Node.ELEMENT_NODE) {
2026
- const w = C, B = w.dataset.type, q = w.dataset.key;
2027
- if (B === "variable" && q) {
2028
- let G = "";
2029
- const O = document.createTreeWalker(
2094
+ const p = n.current;
2095
+ let f = "";
2096
+ const v = {}, S = (q) => {
2097
+ if (!(q.nodeType === Node.ELEMENT_NODE && q.style.display === "none")) {
2098
+ if (q.nodeType === Node.TEXT_NODE)
2099
+ f += (q.textContent || "").replace(/\u200B/g, "");
2100
+ else if (q.nodeType === Node.ELEMENT_NODE) {
2101
+ const w = q, B = w.dataset.type, $ = w.dataset.key;
2102
+ if (B === "variable" && $) {
2103
+ let P = "";
2104
+ const z = document.createTreeWalker(
2030
2105
  w,
2031
2106
  NodeFilter.SHOW_TEXT,
2032
2107
  {
2033
- acceptNode: (M) => {
2108
+ acceptNode: (R) => {
2034
2109
  const J = w.querySelector(".variable-info-icon");
2035
- return J && J.contains(M) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2110
+ return J && J.contains(R) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2036
2111
  }
2037
2112
  }
2038
2113
  );
2039
- for (; O.nextNode(); )
2040
- G += O.currentNode.textContent || "";
2041
- const A = G.replace(/[\u200B\n]/g, "").trim();
2042
- if (A) {
2043
- const M = w.dataset.multiKey;
2044
- if (M) {
2045
- (!v[M] || !Array.isArray(v[M])) && (v[M] = []);
2046
- const J = v[M];
2047
- J.push(A), J.length > 1 && (d += " "), d += A;
2114
+ for (; z.nextNode(); )
2115
+ P += z.currentNode.textContent || "";
2116
+ const I = P.replace(/[\u200B\n]/g, "").trim();
2117
+ if (I) {
2118
+ const R = w.dataset.multiKey;
2119
+ if (R) {
2120
+ (!v[R] || !Array.isArray(v[R])) && (v[R] = []);
2121
+ const J = v[R];
2122
+ J.push(I), J.length > 1 && (f += " "), f += I;
2048
2123
  } else
2049
- v[q] = A, d += A;
2124
+ v[$] = I, f += I;
2050
2125
  }
2051
- } else if (B === "select" && q) {
2052
- const G = w, O = (G.value || "").trim();
2053
- if (O) {
2054
- v[q] = O;
2055
- const A = G.selectedOptions?.[0];
2056
- d += A?.textContent || O;
2126
+ } else if (B === "select" && $) {
2127
+ const P = w, z = (P.value || "").trim();
2128
+ if (z) {
2129
+ v[$] = z;
2130
+ const I = P.selectedOptions?.[0];
2131
+ f += I?.textContent || z;
2057
2132
  }
2058
- } else if (B === "textarea" && q) {
2059
- const O = (w.value || "").replace(/\u200B/g, "").trim();
2060
- O && (v[q] = O, d += O);
2061
- } else if (B === "richtext" && q) {
2062
- const O = (w.textContent || "").replace(/\u200B/g, "").trim();
2063
- O && (v[q] = O, d += O);
2064
- } else if (B === "datepicker" && q) {
2065
- const O = (w.getAttribute("data-value") || "").trim();
2066
- O && (v[q] = O, d += O);
2067
- } else if (B === "upload" && q)
2068
- v[q] = s[q] ?? null, s[q] && (d += ` [附带文件: ${s[q]?.name}] `);
2133
+ } else if (B === "textarea" && $) {
2134
+ const z = (w.value || "").replace(/\u200B/g, "").trim();
2135
+ z && (v[$] = z, f += z);
2136
+ } else if (B === "richtext" && $) {
2137
+ const z = (w.textContent || "").replace(/\u200B/g, "").trim();
2138
+ z && (v[$] = z, f += z);
2139
+ } else if (B === "datepicker" && $) {
2140
+ const z = (w.getAttribute("data-value") || "").trim();
2141
+ z && (v[$] = z, f += z);
2142
+ } else if (B === "upload" && $)
2143
+ v[$] = r[$] ?? null, r[$] && (f += ` [附带文件: ${r[$]?.name}] `);
2069
2144
  else {
2070
2145
  if (w.classList.contains("tag-close-btn") || w.classList.contains("file-remove-btn")) return;
2071
- w.getAttribute("contenteditable") === "false" && !B && w.classList.contains("tag-node") ? d += w.innerText : w.childNodes.forEach(N);
2146
+ w.getAttribute("contenteditable") === "false" && !B && w.classList.contains("tag-node") ? f += w.innerText : w.childNodes.forEach(S);
2072
2147
  }
2073
2148
  }
2074
2149
  }
2075
2150
  };
2076
- if (c.childNodes.forEach(N), d = d.trim(), !d) return;
2151
+ if (p.childNodes.forEach(S), f = f.trim(), !f) return;
2077
2152
  const b = new FormData();
2078
- b.append("fullPrompt", d), Object.keys(v).forEach((C) => {
2079
- const w = v[C];
2080
- w != null && (w instanceof File ? b.append(C, w) : Array.isArray(w) ? t.some(
2081
- (q) => q.type === "multi-variable" && q.key === C
2082
- ) ? w.forEach((q) => {
2083
- q != null && q !== "" && b.append(C, String(q));
2084
- }) : w.forEach((q, G) => {
2085
- q != null && (q instanceof File ? b.append(`${C}[${G}]`, q) : typeof q == "string" ? b.append(`${C}[${G}]`, q) : b.append(`${C}[${G}]`, String(q)));
2086
- }) : typeof w == "string" ? b.append(C, w) : b.append(C, String(w)));
2087
- }), g(b, d);
2153
+ b.append("fullPrompt", f), Object.keys(v).forEach((q) => {
2154
+ const w = v[q];
2155
+ w != null && (w instanceof File ? b.append(q, w) : Array.isArray(w) ? t.some(
2156
+ ($) => $.type === "multi-variable" && $.key === q
2157
+ ) ? w.forEach(($) => {
2158
+ $ != null && $ !== "" && b.append(q, String($));
2159
+ }) : w.forEach(($, P) => {
2160
+ $ != null && ($ instanceof File ? b.append(`${q}[${P}]`, $) : typeof $ == "string" ? b.append(`${q}[${P}]`, $) : b.append(`${q}[${P}]`, String($)));
2161
+ }) : typeof w == "string" ? b.append(q, w) : b.append(q, String(w)));
2162
+ }), y(b, f);
2088
2163
  }, je = {
2089
- ...u ? { width: typeof u == "number" ? `${u}px` : u } : {},
2090
- ...o ? { border: o } : {},
2091
- ...L ? { background: L } : {}
2164
+ ...c ? { width: typeof c == "number" ? `${c}px` : c } : {},
2165
+ ...g ? { border: g } : {},
2166
+ ...l ? { background: l } : {}
2092
2167
  };
2093
- return /* @__PURE__ */ F(
2168
+ return /* @__PURE__ */ W(
2094
2169
  "div",
2095
2170
  {
2096
2171
  className: "rich-text-editor",
2097
2172
  style: je,
2098
- "data-disabled": l,
2173
+ "data-disabled": i,
2099
2174
  children: [
2100
- /* @__PURE__ */ h(
2175
+ /* @__PURE__ */ m(
2101
2176
  "div",
2102
2177
  {
2103
- ref: r,
2104
- className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${Y && a ? "rte-editor-empty" : ""}`,
2178
+ ref: n,
2179
+ className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${Q && A ? "rte-editor-empty" : ""}`,
2105
2180
  contentEditable: t.length === 0,
2106
2181
  suppressContentEditableWarning: !0,
2107
- "data-placeholder": a,
2108
- onMouseDown: Ne,
2182
+ "data-placeholder": A,
2183
+ onMouseDown: Ae,
2109
2184
  onMouseMove: me,
2110
- onMouseUp: Se,
2111
- onClick: z,
2185
+ onMouseUp: Le,
2186
+ onClick: O,
2112
2187
  onDoubleClick: le,
2113
2188
  onInput: de,
2114
2189
  onKeyDown: be,
2115
- onPaste: $e
2190
+ onPaste: Ne
2116
2191
  }
2117
2192
  ),
2118
- /* @__PURE__ */ h(
2193
+ /* @__PURE__ */ m(
2119
2194
  "input",
2120
2195
  {
2121
2196
  type: "file",
2122
- ref: S,
2197
+ ref: o,
2123
2198
  className: "rte-file-input",
2124
2199
  accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
2125
- onChange: Te
2200
+ onChange: Se
2126
2201
  }
2127
2202
  ),
2128
- /* @__PURE__ */ F("div", { className: "rich-text-editor-footer", children: [
2129
- /* @__PURE__ */ h("div", { className: "rich-text-editor-footer-left", children: /* @__PURE__ */ F("div", { className: "rich-text-editor-brand", children: [
2130
- /* @__PURE__ */ F("div", { className: "rte-brand-badge", children: [
2131
- /* @__PURE__ */ h("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
2132
- /* @__PURE__ */ h("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
2203
+ /* @__PURE__ */ W("div", { className: "rich-text-editor-footer", children: [
2204
+ /* @__PURE__ */ m("div", { className: "rich-text-editor-footer-left", children: /* @__PURE__ */ W("div", { className: "rich-text-editor-brand", children: [
2205
+ /* @__PURE__ */ W("div", { className: "rte-brand-badge", children: [
2206
+ /* @__PURE__ */ m("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
2207
+ /* @__PURE__ */ m("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
2133
2208
  ] }),
2134
- f !== "hideAgent" && /* @__PURE__ */ h(
2209
+ a !== "hideAgent" && /* @__PURE__ */ m(
2135
2210
  Ze,
2136
2211
  {
2137
2212
  placement: "top",
2138
2213
  menu: {
2139
- items: V.map((c) => ({
2140
- key: c.key,
2141
- label: /* @__PURE__ */ F("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2142
- c.icon && /* @__PURE__ */ h("i", { className: c.icon }),
2143
- /* @__PURE__ */ h("span", { children: c.label })
2214
+ items: L.map((p) => ({
2215
+ key: p.key,
2216
+ label: /* @__PURE__ */ W("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2217
+ p.icon && /* @__PURE__ */ m("i", { className: p.icon }),
2218
+ /* @__PURE__ */ m("span", { children: p.label })
2144
2219
  ] }),
2145
2220
  onClick: () => {
2146
- E?.(c);
2221
+ E?.(p);
2147
2222
  }
2148
2223
  }))
2149
2224
  },
2150
2225
  trigger: ["click"],
2151
- disabled: l || i,
2152
- children: /* @__PURE__ */ F("div", { className: "rte-agent-badge", style: { cursor: V.length > 0 ? "pointer" : "default" }, children: [
2153
- /* @__PURE__ */ h("i", { className: "iconfont icon-zhinengti" }),
2154
- /* @__PURE__ */ h("span", { className: "rte-agent-text", children: "智能体" })
2226
+ disabled: i || u,
2227
+ children: /* @__PURE__ */ W("div", { className: "rte-agent-badge", style: { cursor: L.length > 0 ? "pointer" : "default" }, children: [
2228
+ /* @__PURE__ */ m("i", { className: "iconfont icon-zhinengti" }),
2229
+ /* @__PURE__ */ m("span", { className: "rte-agent-text", children: "智能体" })
2155
2230
  ] })
2156
2231
  }
2157
2232
  )
2158
2233
  ] }) }),
2159
- /* @__PURE__ */ F("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2234
+ /* @__PURE__ */ W("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2160
2235
  (() => {
2161
- const c = t.find((v) => v.type === "tag");
2162
- if (!c || !c.text) return null;
2163
- const d = V.find((v) => v.label === c.text);
2164
- return !d || d.points === void 0 || d.points === null ? null : /* @__PURE__ */ F("div", { className: "rte-points-badge", children: [
2165
- /* @__PURE__ */ h("i", { className: "iconfont icon-jifen", style: { marginRight: "4px" } }),
2166
- /* @__PURE__ */ F("span", { style: { fontSize: "16px" }, children: [
2236
+ const p = t.find((v) => v.type === "tag");
2237
+ if (!p || !p.text) return null;
2238
+ const f = L.find((v) => v.label === p.text);
2239
+ return !f || f.points === void 0 || f.points === null ? null : /* @__PURE__ */ W("div", { className: "rte-points-badge", children: [
2240
+ /* @__PURE__ */ m("i", { className: "iconfont icon-jifen", style: { marginRight: "4px" } }),
2241
+ /* @__PURE__ */ W("span", { style: { fontSize: "16px" }, children: [
2167
2242
  "-",
2168
- String(d.points)
2243
+ String(f.points)
2169
2244
  ] })
2170
2245
  ] });
2171
2246
  })(),
2172
- /* @__PURE__ */ h(
2247
+ /* @__PURE__ */ m(
2173
2248
  "button",
2174
2249
  {
2175
2250
  type: "button",
2176
- onClick: Ge,
2177
- disabled: i || l || e || !H,
2251
+ onClick: Pe,
2252
+ disabled: u || i || e || !H,
2178
2253
  className: "rich-text-editor-send-button",
2179
- children: i || e ? /* @__PURE__ */ h("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ h("i", { className: "iconfont icon-fasong" })
2254
+ children: u || e ? /* @__PURE__ */ m("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ m("i", { className: "iconfont icon-fasong" })
2180
2255
  }
2181
2256
  )
2182
2257
  ] })
2183
2258
  ] }),
2184
- m?.anchorEl && (() => {
2185
- if (!document.body.contains(m.anchorEl))
2259
+ x?.anchorEl && (() => {
2260
+ if (!document.body.contains(x.anchorEl))
2186
2261
  return null;
2187
- let c = "", d = {
2262
+ let p = "", f = {
2188
2263
  background: "var(--neutral-800, #262626)"
2189
2264
  };
2190
- if (m.type === "upload")
2191
- c = t.find(
2192
- (b) => b.type === "upload" && b.key === m.key
2265
+ if (x.type === "upload")
2266
+ p = t.find(
2267
+ (b) => b.type === "upload" && b.key === x.key
2193
2268
  )?.tooltip || "";
2194
- else if (m.type === "tag")
2195
- c = m.anchorEl.dataset.tooltip || "";
2196
- else if (m.type === "upload-label")
2197
- c = m.anchorEl.dataset.fileName || "";
2198
- else if (m.type === "variable")
2199
- c = m.anchorEl.dataset.tooltip || "";
2200
- else if (m.type === "upload-preview") {
2201
- const N = s[m.key];
2202
- if (N && N.type && N.type.startsWith("image/")) {
2203
- const b = URL.createObjectURL(N);
2204
- c = /* @__PURE__ */ h("div", { style: { width: 120, height: 120, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ h("img", { src: b, style: { maxWidth: 120, maxHeight: 120, objectFit: "contain" } }) }), d = {
2269
+ else if (x.type === "tag")
2270
+ p = x.anchorEl.dataset.tooltip || "";
2271
+ else if (x.type === "upload-label")
2272
+ p = x.anchorEl.dataset.fileName || "";
2273
+ else if (x.type === "variable")
2274
+ p = x.anchorEl.dataset.tooltip || "";
2275
+ else if (x.type === "upload-preview") {
2276
+ const S = r[x.key];
2277
+ if (S && S.type && S.type.startsWith("image/")) {
2278
+ const b = URL.createObjectURL(S);
2279
+ p = /* @__PURE__ */ m("div", { style: { width: 120, height: 120, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ m("img", { src: b, style: { maxWidth: 120, maxHeight: 120, objectFit: "contain" } }) }), f = {
2205
2280
  background: "#fff",
2206
2281
  padding: 4
2207
2282
  }, setTimeout(() => URL.revokeObjectURL(b), 1e3);
2208
2283
  } else
2209
- c = "";
2284
+ p = "";
2210
2285
  }
2211
- if (!c) return null;
2212
- const v = m.type === "upload-preview" ? "#0A0A0A" : "#fff";
2286
+ if (!p) return null;
2287
+ const v = x.type === "upload-preview" ? "#0A0A0A" : "#fff";
2213
2288
  return pt(
2214
- /* @__PURE__ */ h(
2289
+ /* @__PURE__ */ m(
2215
2290
  et,
2216
2291
  {
2217
2292
  arrow: !1,
2218
- title: /* @__PURE__ */ h("div", { style: { maxWidth: "200px", fontSize: "12px", color: v }, children: c }),
2293
+ title: /* @__PURE__ */ m("div", { style: { maxWidth: "200px", fontSize: "12px", color: v }, children: p }),
2219
2294
  open: !0,
2220
2295
  placement: "top",
2221
2296
  getPopupContainer: () => document.body,
2222
- overlayInnerStyle: d,
2223
- children: /* @__PURE__ */ h(
2297
+ overlayInnerStyle: f,
2298
+ children: /* @__PURE__ */ m(
2224
2299
  "div",
2225
2300
  {
2226
2301
  style: {
2227
2302
  position: "fixed",
2228
- left: `${m.anchorEl.getBoundingClientRect().left}px`,
2229
- top: `${m.anchorEl.getBoundingClientRect().top}px`,
2230
- width: `${m.anchorEl.offsetWidth}px`,
2231
- height: `${m.anchorEl.offsetHeight}px`,
2303
+ left: `${x.anchorEl.getBoundingClientRect().left}px`,
2304
+ top: `${x.anchorEl.getBoundingClientRect().top}px`,
2305
+ width: `${x.anchorEl.offsetWidth}px`,
2306
+ height: `${x.anchorEl.offsetHeight}px`,
2232
2307
  pointerEvents: "none"
2233
2308
  }
2234
2309
  }
@@ -2242,7 +2317,7 @@ const Lt = ({
2242
2317
  }
2243
2318
  );
2244
2319
  };
2245
- Lt.__docgenInfo = {
2320
+ It.__docgenInfo = {
2246
2321
  displayName: "RichTextEditor",
2247
2322
  description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
2248
2323
  props: {
@@ -2270,40 +2345,40 @@ Lt.__docgenInfo = {
2270
2345
  }
2271
2346
  }
2272
2347
  };
2273
- const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Vt = [
2348
+ const ze = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Vt = [
2274
2349
  { label: "5页", value: 5 },
2275
2350
  { label: "10页", value: 10 },
2276
2351
  { label: "15页", value: 15 },
2277
2352
  { label: "30页", value: 30 }
2278
2353
  ], Bt = ({
2279
2354
  autoLoading: t,
2280
- batchSize: g,
2281
- loadingProgress: i,
2282
- loadIcon: l,
2283
- onBatchSizeChange: u,
2355
+ batchSize: y,
2356
+ loadingProgress: u,
2357
+ loadIcon: i,
2358
+ onBatchSizeChange: c,
2284
2359
  onLoadNextPage: k,
2285
- onStartAutoLoad: V,
2360
+ onStartAutoLoad: L,
2286
2361
  onStopLoad: E
2287
- }) => t && i ? /* @__PURE__ */ F("div", { className: "auto_load_progress", children: [
2288
- l || /* @__PURE__ */ h("img", { src: Oe, alt: "自动加载", width: 14, height: 14 }),
2289
- /* @__PURE__ */ F("span", { children: [
2362
+ }) => t && u ? /* @__PURE__ */ W("div", { className: "auto_load_progress", children: [
2363
+ i || /* @__PURE__ */ m("img", { src: ze, alt: "自动加载", width: 14, height: 14 }),
2364
+ /* @__PURE__ */ W("span", { children: [
2290
2365
  "正在加载第",
2291
- i.currentPage,
2366
+ u.currentPage,
2292
2367
  "/",
2293
- i.totalPages,
2368
+ u.totalPages,
2294
2369
  "页"
2295
2370
  ] }),
2296
- /* @__PURE__ */ h(
2371
+ /* @__PURE__ */ m(
2297
2372
  tt,
2298
2373
  {
2299
- percent: i.percentage,
2374
+ percent: u.percentage,
2300
2375
  type: "line",
2301
2376
  size: [160, 8]
2302
2377
  }
2303
2378
  ),
2304
- /* @__PURE__ */ h("span", { onClick: E, className: "auto_load_stop_btn", children: "停止加载" })
2305
- ] }) : /* @__PURE__ */ F("div", { className: "auto_load_container", children: [
2306
- /* @__PURE__ */ h(
2379
+ /* @__PURE__ */ m("span", { onClick: E, className: "auto_load_stop_btn", children: "停止加载" })
2380
+ ] }) : /* @__PURE__ */ W("div", { className: "auto_load_container", children: [
2381
+ /* @__PURE__ */ m(
2307
2382
  "div",
2308
2383
  {
2309
2384
  onClick: k,
@@ -2314,7 +2389,7 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2314
2389
  children: "加载下一页"
2315
2390
  }
2316
2391
  ),
2317
- /* @__PURE__ */ F(
2392
+ /* @__PURE__ */ W(
2318
2393
  "div",
2319
2394
  {
2320
2395
  className: "right_control_wrap",
@@ -2322,22 +2397,22 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2322
2397
  backgroundColor: t ? "#f5f5f5" : "#2563eb"
2323
2398
  },
2324
2399
  children: [
2325
- /* @__PURE__ */ F(
2400
+ /* @__PURE__ */ W(
2326
2401
  "div",
2327
2402
  {
2328
2403
  className: "auto_load_btn",
2329
- onClick: t ? void 0 : V,
2404
+ onClick: t ? void 0 : L,
2330
2405
  children: [
2331
- l || /* @__PURE__ */ h("img", { src: Oe, alt: "自动加载", width: 14, height: 14 }),
2332
- /* @__PURE__ */ h("span", { children: "自动加载" })
2406
+ i || /* @__PURE__ */ m("img", { src: ze, alt: "自动加载", width: 14, height: 14 }),
2407
+ /* @__PURE__ */ m("span", { children: "自动加载" })
2333
2408
  ]
2334
2409
  }
2335
2410
  ),
2336
- /* @__PURE__ */ h(
2337
- Pe,
2411
+ /* @__PURE__ */ m(
2412
+ Ge,
2338
2413
  {
2339
- value: g,
2340
- onChange: u,
2414
+ value: y,
2415
+ onChange: c,
2341
2416
  options: Vt,
2342
2417
  disabled: t,
2343
2418
  size: "small",
@@ -2350,26 +2425,26 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2350
2425
  )
2351
2426
  ] }), _t = ({
2352
2427
  current: t,
2353
- loadIcon: g,
2354
- pageSize: i,
2355
- total: l,
2356
- cachedPages: u,
2428
+ loadIcon: y,
2429
+ pageSize: u,
2430
+ total: i,
2431
+ cachedPages: c,
2357
2432
  loadedCount: k,
2358
- autoLoading: V = !1,
2433
+ autoLoading: L = !1,
2359
2434
  loadingProgress: E,
2360
- onChange: n,
2435
+ onChange: C,
2361
2436
  onLoadNextPage: e,
2362
- onStartAutoLoad: a,
2363
- onStopLoading: o
2437
+ onStartAutoLoad: A,
2438
+ onStopLoading: g
2364
2439
  }) => {
2365
- const [L, f] = X(5), r = Math.ceil(l / i), S = ze(() => u.length >= r, [u, r]), s = () => Array.from(
2366
- { length: r },
2367
- (x, m) => m + 1
2368
- ).filter((x) => !u.includes(x)).slice(0, L);
2369
- return /* @__PURE__ */ F("div", { className: "pagination_footer", children: [
2370
- /* @__PURE__ */ F("div", { className: "pagination_leftWrap", children: [
2371
- /* @__PURE__ */ F("span", { className: "pagination_total", children: [
2372
- /* @__PURE__ */ h(
2440
+ const [l, a] = X(5), n = Math.ceil(i / u), o = Oe(() => c.length >= n, [c, n]), r = () => Array.from(
2441
+ { length: n },
2442
+ (h, x) => x + 1
2443
+ ).filter((h) => !c.includes(h)).slice(0, l);
2444
+ return /* @__PURE__ */ W("div", { className: "pagination_footer", children: [
2445
+ /* @__PURE__ */ W("div", { className: "pagination_leftWrap", children: [
2446
+ /* @__PURE__ */ W("span", { className: "pagination_total", children: [
2447
+ /* @__PURE__ */ m(
2373
2448
  it,
2374
2449
  {
2375
2450
  style: { color: "#2563EB", marginRight: "4px" }
@@ -2378,50 +2453,50 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2378
2453
  "已加载: ",
2379
2454
  k,
2380
2455
  "/",
2381
- l,
2456
+ i,
2382
2457
  "条数据"
2383
2458
  ] }),
2384
- !S && /* @__PURE__ */ h(
2459
+ !o && /* @__PURE__ */ m(
2385
2460
  Bt,
2386
2461
  {
2387
- loadIcon: g || void 0,
2388
- autoLoading: V,
2389
- batchSize: L,
2462
+ loadIcon: y || void 0,
2463
+ autoLoading: L,
2464
+ batchSize: l,
2390
2465
  loadingProgress: E,
2391
- disabled: !e || !a,
2392
- onBatchSizeChange: f,
2466
+ disabled: !e || !A,
2467
+ onBatchSizeChange: a,
2393
2468
  onLoadNextPage: () => e?.(),
2394
2469
  onStartAutoLoad: () => {
2395
- const p = s();
2396
- a?.(p);
2470
+ const d = r();
2471
+ A?.(d);
2397
2472
  },
2398
- onStopLoad: () => o?.()
2473
+ onStopLoad: () => g?.()
2399
2474
  }
2400
2475
  )
2401
2476
  ] }),
2402
- /* @__PURE__ */ h(
2477
+ /* @__PURE__ */ m(
2403
2478
  nt,
2404
2479
  {
2405
2480
  current: t,
2406
- pageSize: i,
2407
- total: l,
2408
- onChange: (p) => n(p),
2481
+ pageSize: u,
2482
+ total: i,
2483
+ onChange: (d) => C(d),
2409
2484
  showSizeChanger: !1,
2410
2485
  showQuickJumper: !1,
2411
- showTotal: (p, x) => "",
2412
- itemRender: (p, x, m) => {
2413
- const _ = u.includes(p);
2414
- return x === "prev" || x === "next" || x === "jump-prev" || x === "jump-next" ? /* @__PURE__ */ h("div", { className: "pageBox", children: m }) : /* @__PURE__ */ F(
2486
+ showTotal: (d, h) => "",
2487
+ itemRender: (d, h, x) => {
2488
+ const G = c.includes(d);
2489
+ return h === "prev" || h === "next" || h === "jump-prev" || h === "jump-next" ? /* @__PURE__ */ m("div", { className: "pageBox", children: x }) : /* @__PURE__ */ W(
2415
2490
  "div",
2416
2491
  {
2417
2492
  className: "pageBox",
2418
2493
  style: {
2419
- backgroundColor: t === p ? "#2563EB" : "#f5f5f5",
2420
- color: t === p ? "#fff" : _ ? "#171717" : "#a3a3a3"
2494
+ backgroundColor: t === d ? "#2563EB" : "#f5f5f5",
2495
+ color: t === d ? "#fff" : G ? "#171717" : "#a3a3a3"
2421
2496
  },
2422
2497
  children: [
2423
- p,
2424
- !_ && /* @__PURE__ */ h("span", { className: "unload_spot" })
2498
+ d,
2499
+ !G && /* @__PURE__ */ m("span", { className: "unload_spot" })
2425
2500
  ]
2426
2501
  }
2427
2502
  );
@@ -2429,62 +2504,62 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2429
2504
  }
2430
2505
  )
2431
2506
  ] });
2432
- }, Pt = (t) => {
2507
+ }, Gt = (t) => {
2433
2508
  const {
2434
- loading: g,
2435
- autoLoading: i,
2436
- loadingProgress: l,
2437
- columns: u = [],
2509
+ loading: y,
2510
+ autoLoading: u,
2511
+ loadingProgress: i,
2512
+ columns: c = [],
2438
2513
  dataSource: k = [],
2439
- total: V,
2514
+ total: L,
2440
2515
  current: E,
2441
- pageSize: n,
2516
+ pageSize: C,
2442
2517
  cachedPages: e,
2443
- onChangePage: a,
2444
- onLoadNextPage: o,
2445
- onStartAutoLoad: L,
2446
- onStopLoading: f,
2447
- ...r
2448
- } = t, S = W(null), s = K(
2449
- (y) => {
2450
- a(y), e.includes(y) && S.current?.scrollTo({
2451
- key: `${(y - 1) * n + 1}`
2518
+ onChangePage: A,
2519
+ onLoadNextPage: g,
2520
+ onStartAutoLoad: l,
2521
+ onStopLoading: a,
2522
+ ...n
2523
+ } = t, o = j(null), r = U(
2524
+ (s) => {
2525
+ A(s), e.includes(s) && o.current?.scrollTo({
2526
+ key: `${(s - 1) * C + 1}`
2452
2527
  });
2453
2528
  },
2454
2529
  [E]
2455
2530
  );
2456
- return /* @__PURE__ */ F("div", { className: "flex flex-col", children: [
2457
- /* @__PURE__ */ h(
2531
+ return /* @__PURE__ */ W("div", { className: "flex flex-col", children: [
2532
+ /* @__PURE__ */ m(
2458
2533
  _e,
2459
2534
  {
2460
- ref: S,
2461
- ...r,
2462
- columns: u,
2535
+ ref: o,
2536
+ ...n,
2537
+ columns: c,
2463
2538
  dataSource: k,
2464
2539
  pagination: !1,
2465
2540
  virtual: !0
2466
2541
  }
2467
2542
  ),
2468
- /* @__PURE__ */ h(
2543
+ /* @__PURE__ */ m(
2469
2544
  _t,
2470
2545
  {
2471
- loading: g,
2472
- autoLoading: i,
2473
- loadingProgress: l,
2546
+ loading: y,
2547
+ autoLoading: u,
2548
+ loadingProgress: i,
2474
2549
  current: E,
2475
- pageSize: n,
2476
- total: V,
2550
+ pageSize: C,
2551
+ total: L,
2477
2552
  loadedCount: k.length,
2478
2553
  cachedPages: e,
2479
- onChange: s,
2480
- onLoadNextPage: o,
2481
- onStartAutoLoad: L,
2482
- onStopLoading: f
2554
+ onChange: r,
2555
+ onLoadNextPage: g,
2556
+ onStartAutoLoad: l,
2557
+ onStopLoading: a
2483
2558
  }
2484
2559
  )
2485
2560
  ] });
2486
2561
  };
2487
- Pt.__docgenInfo = {
2562
+ Gt.__docgenInfo = {
2488
2563
  displayName: "VirtualTable",
2489
2564
  description: "虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",
2490
2565
  props: {
@@ -2591,77 +2666,77 @@ Pt.__docgenInfo = {
2591
2666
  }
2592
2667
  }
2593
2668
  };
2594
- const Gt = ({
2669
+ const Pt = ({
2595
2670
  texts: t = [],
2596
- placeholder: g = "请输入内容",
2597
- animationSpeed: i = 100,
2598
- autoPlay: l = !0,
2599
- value: u,
2671
+ placeholder: y = "请输入内容",
2672
+ animationSpeed: u = 100,
2673
+ autoPlay: i = !0,
2674
+ value: c,
2600
2675
  onChange: k,
2601
- ...V
2676
+ ...L
2602
2677
  }) => {
2603
- const [E, n] = X(""), [e, a] = X(0), [o, L] = X(!1), [f, r] = X(!1), [S, s] = X(!1), y = W(void 0), p = W(void 0), x = W(t), m = W(e), _ = W(f), T = W(E);
2604
- oe(() => {
2605
- x.current = t, m.current = e, _.current = f, T.current = E;
2678
+ const [E, C] = X(""), [e, A] = X(0), [g, l] = X(!1), [a, n] = X(!1), [o, r] = X(!1), s = j(void 0), d = j(void 0), h = j(t), x = j(e), G = j(a), T = j(E);
2679
+ ae(() => {
2680
+ h.current = t, x.current = e, G.current = a, T.current = E;
2606
2681
  });
2607
- const P = K(($, D) => {
2608
- let te = 0;
2609
- s(!0);
2682
+ const _ = U((N, M) => {
2683
+ let ne = 0;
2684
+ r(!0);
2610
2685
  const re = () => {
2611
- te < $.length ? (n($.slice(0, te + 1)), te++, p.current = window.setTimeout(re, i)) : (s(!1), D?.());
2686
+ ne < N.length ? (C(N.slice(0, ne + 1)), ne++, d.current = window.setTimeout(re, u)) : (r(!1), M?.());
2612
2687
  };
2613
2688
  re();
2614
- }, [i]), H = K(($) => {
2615
- let D = T.current.length;
2616
- const te = () => {
2617
- D > 0 ? (n(T.current.slice(0, D - 1)), D--, p.current = window.setTimeout(te, i / 2)) : $?.();
2689
+ }, [u]), H = U((N) => {
2690
+ let M = T.current.length;
2691
+ const ne = () => {
2692
+ M > 0 ? (C(T.current.slice(0, M - 1)), M--, d.current = window.setTimeout(ne, u / 2)) : N?.();
2618
2693
  };
2619
- te();
2620
- }, [i]), R = K(() => {
2621
- if (x.current.length === 0 || _.current) return;
2622
- L(!0);
2623
- const $ = x.current[m.current];
2694
+ ne();
2695
+ }, [u]), D = U(() => {
2696
+ if (h.current.length === 0 || G.current) return;
2697
+ l(!0);
2698
+ const N = h.current[x.current];
2624
2699
  T.current ? H(() => {
2625
- P($, () => {
2626
- y.current = window.setTimeout(() => {
2627
- a((D) => (D + 1) % x.current.length), L(!1);
2700
+ _(N, () => {
2701
+ s.current = window.setTimeout(() => {
2702
+ A((M) => (M + 1) % h.current.length), l(!1);
2628
2703
  }, 2e3);
2629
2704
  });
2630
- }) : P($, () => {
2631
- y.current = window.setTimeout(() => {
2632
- a((D) => (D + 1) % x.current.length), L(!1);
2705
+ }) : _(N, () => {
2706
+ s.current = window.setTimeout(() => {
2707
+ A((M) => (M + 1) % h.current.length), l(!1);
2633
2708
  }, 2e3);
2634
2709
  });
2635
- }, [H, P]);
2636
- return oe(() => (l && t.length > 0 && !f && R(), () => {
2637
- y.current && window.clearTimeout(y.current), p.current && window.clearTimeout(p.current);
2638
- }), [e, f, l, t.length, R]), oe(() => {
2639
- !o && l && t.length > 0 && !f && R();
2640
- }, [e, o, l, t.length, f, R]), /* @__PURE__ */ F("div", { style: { position: "relative" }, children: [
2641
- /* @__PURE__ */ h(
2710
+ }, [H, _]);
2711
+ return ae(() => (i && t.length > 0 && !a && D(), () => {
2712
+ s.current && window.clearTimeout(s.current), d.current && window.clearTimeout(d.current);
2713
+ }), [e, a, i, t.length, D]), ae(() => {
2714
+ !g && i && t.length > 0 && !a && D();
2715
+ }, [e, g, i, t.length, a, D]), /* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
2716
+ /* @__PURE__ */ m(
2642
2717
  Fe,
2643
2718
  {
2644
- ...V,
2645
- value: u,
2646
- onChange: ($) => {
2647
- k?.($.target.value), V.onChange?.($);
2719
+ ...L,
2720
+ value: c,
2721
+ onChange: (N) => {
2722
+ k?.(N.target.value), L.onChange?.(N);
2648
2723
  },
2649
- onFocus: ($) => {
2650
- r(!0), y.current && window.clearTimeout(y.current), p.current && window.clearTimeout(p.current), L(!1), s(!1), V.onFocus?.($);
2724
+ onFocus: (N) => {
2725
+ n(!0), s.current && window.clearTimeout(s.current), d.current && window.clearTimeout(d.current), l(!1), r(!1), L.onFocus?.(N);
2651
2726
  },
2652
- onBlur: ($) => {
2653
- r(!1), !u && t.length > 0 && (n(""), a(0)), V.onBlur?.($);
2727
+ onBlur: (N) => {
2728
+ n(!1), !c && t.length > 0 && (C(""), A(0)), L.onBlur?.(N);
2654
2729
  },
2655
- placeholder: f || u ? g : E || g,
2730
+ placeholder: a || c ? y : E || y,
2656
2731
  style: {
2657
2732
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2658
- ...V.style,
2733
+ ...L.style,
2659
2734
  position: "relative",
2660
2735
  zIndex: 1
2661
2736
  }
2662
2737
  }
2663
2738
  ),
2664
- !f && !u && E && /* @__PURE__ */ F(
2739
+ !a && !c && E && /* @__PURE__ */ W(
2665
2740
  "div",
2666
2741
  {
2667
2742
  style: {
@@ -2681,8 +2756,8 @@ const Gt = ({
2681
2756
  fontFamily: "inherit"
2682
2757
  },
2683
2758
  children: [
2684
- /* @__PURE__ */ h("span", { children: E }),
2685
- S && /* @__PURE__ */ h(
2759
+ /* @__PURE__ */ m("span", { children: E }),
2760
+ o && /* @__PURE__ */ m(
2686
2761
  "span",
2687
2762
  {
2688
2763
  style: {
@@ -2698,7 +2773,7 @@ const Gt = ({
2698
2773
  ]
2699
2774
  }
2700
2775
  ),
2701
- /* @__PURE__ */ h("style", { children: `
2776
+ /* @__PURE__ */ m("style", { children: `
2702
2777
  @keyframes blink {
2703
2778
  0%, 50% { opacity: 1; }
2704
2779
  51%, 100% { opacity: 0; }
@@ -2706,7 +2781,7 @@ const Gt = ({
2706
2781
  ` })
2707
2782
  ] });
2708
2783
  };
2709
- Gt.__docgenInfo = {
2784
+ Pt.__docgenInfo = {
2710
2785
  displayName: "DynamicInput",
2711
2786
  description: "动态文案输入框组件,支持流式文字动画效果",
2712
2787
  props: {
@@ -2751,109 +2826,109 @@ Gt.__docgenInfo = {
2751
2826
  }
2752
2827
  }
2753
2828
  };
2754
- const Rt = ({
2829
+ const Dt = ({
2755
2830
  texts: t = [],
2756
2831
  // 动态文案数组,默认为空数组
2757
- placeholder: g = "请输入内容",
2832
+ placeholder: y = "请输入内容",
2758
2833
  // 占位符文本
2759
- animationSpeed: i = 100,
2834
+ animationSpeed: u = 100,
2760
2835
  // 打字机动画速度,毫秒
2761
- autoPlay: l = !0,
2836
+ autoPlay: i = !0,
2762
2837
  // 是否自动播放动画
2763
- value: u = "",
2838
+ value: c = "",
2764
2839
  // 受控模式的值
2765
2840
  onChange: k,
2766
2841
  // 受控模式的变化回调
2767
- onSubmit: V,
2842
+ onSubmit: L,
2768
2843
  // 提交回调
2769
2844
  maxLength: E = 500,
2770
2845
  // 最大字符数限制
2771
- showCount: n = !0,
2846
+ showCount: C = !0,
2772
2847
  // 是否显示字数统计
2773
2848
  submitText: e = "发送",
2774
2849
  // 提交按钮文本
2775
- disabled: a = !1,
2850
+ disabled: A = !1,
2776
2851
  // 是否禁用组件
2777
- rows: o = 4,
2852
+ rows: g = 4,
2778
2853
  // 文本域行数
2779
- style: L,
2854
+ style: l,
2780
2855
  // 自定义样式
2781
- ...f
2856
+ ...a
2782
2857
  // 其他原生属性
2783
2858
  }) => {
2784
- const [r, S] = X(""), [s, y] = X(0), [p, x] = X(!1), [m, _] = X(!1), [T, P] = X(!1), [H, R] = X(u || ""), j = W(void 0), Y = W(void 0), Z = W(t), ee = W(s), $ = W(m), D = W(r), te = W(null);
2785
- oe(() => {
2786
- Z.current = t, ee.current = s, $.current = m, D.current = r;
2859
+ const [n, o] = X(""), [r, s] = X(0), [d, h] = X(!1), [x, G] = X(!1), [T, _] = X(!1), [H, D] = X(c || ""), K = j(void 0), Q = j(void 0), Y = j(t), te = j(r), N = j(x), M = j(n), ne = j(null);
2860
+ ae(() => {
2861
+ Y.current = t, te.current = r, N.current = x, M.current = n;
2787
2862
  });
2788
- const re = K((z, le) => {
2863
+ const re = U((O, le) => {
2789
2864
  let de = 0;
2790
- P(!0);
2865
+ _(!0);
2791
2866
  const be = () => {
2792
- de < z.length ? (S(z.slice(0, de + 1)), de++, Y.current = window.setTimeout(be, i)) : (P(!1), le?.());
2867
+ de < O.length ? (o(O.slice(0, de + 1)), de++, Q.current = window.setTimeout(be, u)) : (_(!1), le?.());
2793
2868
  };
2794
2869
  be();
2795
- }, [i]), ce = K((z) => {
2796
- let le = D.current.length;
2870
+ }, [u]), ce = U((O) => {
2871
+ let le = M.current.length;
2797
2872
  const de = () => {
2798
- le > 0 ? (S(D.current.slice(0, le - 1)), le--, Y.current = window.setTimeout(de, i / 2)) : z?.();
2873
+ le > 0 ? (o(M.current.slice(0, le - 1)), le--, Q.current = window.setTimeout(de, u / 2)) : O?.();
2799
2874
  };
2800
2875
  de();
2801
- }, [i]), ye = K(() => {
2802
- if (Z.current.length === 0 || $.current) return;
2803
- x(!0);
2804
- const z = Z.current[ee.current];
2805
- D.current ? ce(() => {
2806
- re(z, () => {
2807
- j.current = window.setTimeout(() => {
2808
- y((le) => (le + 1) % Z.current.length), x(!1);
2876
+ }, [u]), ye = U(() => {
2877
+ if (Y.current.length === 0 || N.current) return;
2878
+ h(!0);
2879
+ const O = Y.current[te.current];
2880
+ M.current ? ce(() => {
2881
+ re(O, () => {
2882
+ K.current = window.setTimeout(() => {
2883
+ s((le) => (le + 1) % Y.current.length), h(!1);
2809
2884
  }, 2e3);
2810
2885
  });
2811
- }) : re(z, () => {
2812
- j.current = window.setTimeout(() => {
2813
- y((le) => (le + 1) % Z.current.length), x(!1);
2886
+ }) : re(O, () => {
2887
+ K.current = window.setTimeout(() => {
2888
+ s((le) => (le + 1) % Y.current.length), h(!1);
2814
2889
  }, 2e3);
2815
2890
  });
2816
2891
  }, [ce, re]);
2817
- oe(() => (l && t.length > 0 && !m && ye(), () => {
2818
- j.current && window.clearTimeout(j.current), Y.current && window.clearTimeout(Y.current);
2819
- }), [s, m, l, t.length, ye]), oe(() => {
2820
- !p && l && t.length > 0 && !m && ye();
2821
- }, [s, p, l, t.length, m, ye]);
2822
- const ue = (z) => {
2823
- _(!0), j.current && window.clearTimeout(j.current), Y.current && window.clearTimeout(Y.current), x(!1), P(!1), f.onFocus?.(z);
2824
- }, $e = (z) => {
2825
- _(!1), !u && t.length > 0 && (S(""), y(0)), f.onBlur?.(z);
2826
- }, Te = (z) => {
2827
- const le = z.target.value;
2828
- E && le.length > E || (k ? k(le) : R(le), f.onChange?.(z));
2892
+ ae(() => (i && t.length > 0 && !x && ye(), () => {
2893
+ K.current && window.clearTimeout(K.current), Q.current && window.clearTimeout(Q.current);
2894
+ }), [r, x, i, t.length, ye]), ae(() => {
2895
+ !d && i && t.length > 0 && !x && ye();
2896
+ }, [r, d, i, t.length, x, ye]);
2897
+ const ue = (O) => {
2898
+ G(!0), K.current && window.clearTimeout(K.current), Q.current && window.clearTimeout(Q.current), h(!1), _(!1), a.onFocus?.(O);
2899
+ }, Ne = (O) => {
2900
+ G(!1), !c && t.length > 0 && (o(""), s(0)), a.onBlur?.(O);
2901
+ }, Se = (O) => {
2902
+ const le = O.target.value;
2903
+ E && le.length > E || (k ? k(le) : D(le), a.onChange?.(O));
2829
2904
  }, xe = () => {
2830
- const z = k ? u : H;
2831
- z.trim() && !a && (V?.(z), k || R(""));
2832
- }, Ne = (z) => {
2833
- (z.ctrlKey || z.metaKey) && z.key === "Enter" && (z.preventDefault(), xe()), f.onKeyDown?.(z);
2834
- }, me = k ? u : H, Se = a || !me.trim() || (E ? me.length > E : !1);
2835
- return /* @__PURE__ */ F("div", { style: { position: "relative", ...L }, children: [
2836
- /* @__PURE__ */ F("div", { style: { position: "relative" }, children: [
2837
- /* @__PURE__ */ h(
2905
+ const O = k ? c : H;
2906
+ O.trim() && !A && (L?.(O), k || D(""));
2907
+ }, Ae = (O) => {
2908
+ (O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(), xe()), a.onKeyDown?.(O);
2909
+ }, me = k ? c : H, Le = A || !me.trim() || (E ? me.length > E : !1);
2910
+ return /* @__PURE__ */ W("div", { style: { position: "relative", ...l }, children: [
2911
+ /* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
2912
+ /* @__PURE__ */ m(
2838
2913
  "textarea",
2839
2914
  {
2840
- ref: te,
2841
- value: k ? u : H,
2842
- onChange: Te,
2843
- onFocus: (z) => {
2844
- z.target.style.borderColor = "#1890ff", z.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", ue(z);
2915
+ ref: ne,
2916
+ value: k ? c : H,
2917
+ onChange: Se,
2918
+ onFocus: (O) => {
2919
+ O.target.style.borderColor = "#1890ff", O.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", ue(O);
2845
2920
  },
2846
- onBlur: (z) => {
2847
- z.target.style.borderColor = "#d9d9d9", z.target.style.boxShadow = "none", $e(z);
2921
+ onBlur: (O) => {
2922
+ O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none", Ne(O);
2848
2923
  },
2849
- onKeyDown: Ne,
2850
- placeholder: m || me ? g : "",
2924
+ onKeyDown: Ae,
2925
+ placeholder: x || me ? y : "",
2851
2926
  maxLength: E,
2852
- rows: o,
2853
- disabled: a,
2927
+ rows: g,
2928
+ disabled: A,
2854
2929
  style: {
2855
2930
  width: "100%",
2856
- minHeight: `${o * 24 + 16}px`,
2931
+ minHeight: `${g * 24 + 16}px`,
2857
2932
  padding: "8px 60px 8px 12px",
2858
2933
  // 右侧留出按钮空间
2859
2934
  border: "1px solid #d9d9d9",
@@ -2866,12 +2941,12 @@ const Rt = ({
2866
2941
  transition: "border-color 0.3s, box-shadow 0.3s",
2867
2942
  backgroundColor: "#fff",
2868
2943
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2869
- ...f.style
2944
+ ...a.style
2870
2945
  },
2871
- ...f
2946
+ ...a
2872
2947
  }
2873
2948
  ),
2874
- !m && !me && r && /* @__PURE__ */ F(
2949
+ !x && !me && n && /* @__PURE__ */ W(
2875
2950
  "div",
2876
2951
  {
2877
2952
  style: {
@@ -2893,8 +2968,8 @@ const Rt = ({
2893
2968
  lineHeight: "1.5"
2894
2969
  },
2895
2970
  children: [
2896
- /* @__PURE__ */ h("span", { children: r }),
2897
- T && /* @__PURE__ */ h(
2971
+ /* @__PURE__ */ m("span", { children: n }),
2972
+ T && /* @__PURE__ */ m(
2898
2973
  "span",
2899
2974
  {
2900
2975
  style: {
@@ -2910,7 +2985,7 @@ const Rt = ({
2910
2985
  ]
2911
2986
  }
2912
2987
  ),
2913
- /* @__PURE__ */ h(
2988
+ /* @__PURE__ */ m(
2914
2989
  "div",
2915
2990
  {
2916
2991
  style: {
@@ -2919,14 +2994,14 @@ const Rt = ({
2919
2994
  right: 8,
2920
2995
  zIndex: 3
2921
2996
  },
2922
- children: /* @__PURE__ */ h(
2997
+ children: /* @__PURE__ */ m(
2923
2998
  ge,
2924
2999
  {
2925
3000
  type: "primary",
2926
3001
  size: "small",
2927
- icon: /* @__PURE__ */ h(ct, {}),
3002
+ icon: /* @__PURE__ */ m(ct, {}),
2928
3003
  onClick: xe,
2929
- disabled: Se,
3004
+ disabled: Le,
2930
3005
  style: {
2931
3006
  borderRadius: 6,
2932
3007
  minWidth: 32,
@@ -2941,7 +3016,7 @@ const Rt = ({
2941
3016
  }
2942
3017
  )
2943
3018
  ] }),
2944
- n && /* @__PURE__ */ F(
3019
+ C && /* @__PURE__ */ W(
2945
3020
  "div",
2946
3021
  {
2947
3022
  style: {
@@ -2957,7 +3032,7 @@ const Rt = ({
2957
3032
  ]
2958
3033
  }
2959
3034
  ),
2960
- /* @__PURE__ */ h("style", { children: `
3035
+ /* @__PURE__ */ m("style", { children: `
2961
3036
  @keyframes blink {
2962
3037
  0%, 50% { opacity: 1; }
2963
3038
  51%, 100% { opacity: 0; }
@@ -2965,7 +3040,7 @@ const Rt = ({
2965
3040
  ` })
2966
3041
  ] });
2967
3042
  };
2968
- Rt.__docgenInfo = {
3043
+ Dt.__docgenInfo = {
2969
3044
  displayName: "DynamicTextArea",
2970
3045
  description: "动态文案文本域组件,支持流式文字动画效果",
2971
3046
  props: {
@@ -3053,89 +3128,89 @@ Rt.__docgenInfo = {
3053
3128
  };
3054
3129
  const We = ({
3055
3130
  src: t,
3056
- poster: g,
3057
- width: i = 300,
3058
- height: l,
3059
- videoWidth: u,
3131
+ poster: y,
3132
+ width: u = 300,
3133
+ height: i,
3134
+ videoWidth: c,
3060
3135
  // 参数保留但不使用,由CSS控制
3061
3136
  videoHeight: k,
3062
3137
  // 参数保留但不使用,由CSS控制
3063
- showPlayButton: V = !0,
3138
+ showPlayButton: L = !0,
3064
3139
  autoPlayOnHover: E = !0,
3065
- onClick: n,
3140
+ onClick: C,
3066
3141
  onVideoLoaded: e,
3067
- onVideoPlay: a,
3068
- onVideoPause: o,
3069
- onVideoEnded: L,
3070
- className: f,
3071
- style: r,
3072
- ...S
3142
+ onVideoPlay: A,
3143
+ onVideoPause: g,
3144
+ onVideoEnded: l,
3145
+ className: a,
3146
+ style: n,
3147
+ ...o
3073
3148
  }) => {
3074
- const s = W(null), [y, p] = X(!1), [x, m] = X(!1), [_, T] = X(!1), P = K(() => {
3075
- s.current && (s.current.play(), p(!0), a?.());
3076
- }, [a]), H = K(() => {
3077
- s.current && (s.current.pause(), p(!1), o?.());
3078
- }, [o]), R = K((re) => {
3079
- re.stopPropagation(), y ? H() : P();
3080
- }, [y, P, H]), j = K(() => {
3081
- m(!0), E && !y && P();
3082
- }, [E, y, P]), Y = K(() => {
3083
- m(!1), E && y && H();
3084
- }, [E, y, H]), Z = K(() => {
3149
+ const r = j(null), [s, d] = X(!1), [h, x] = X(!1), [G, T] = X(!1), _ = U(() => {
3150
+ r.current && (r.current.play(), d(!0), A?.());
3151
+ }, [A]), H = U(() => {
3152
+ r.current && (r.current.pause(), d(!1), g?.());
3153
+ }, [g]), D = U((re) => {
3154
+ re.stopPropagation(), s ? H() : _();
3155
+ }, [s, _, H]), K = U(() => {
3156
+ x(!0), E && !s && _();
3157
+ }, [E, s, _]), Q = U(() => {
3158
+ x(!1), E && s && H();
3159
+ }, [E, s, H]), Y = U(() => {
3085
3160
  T(!0), e?.();
3086
- }, [e]), ee = K(() => {
3087
- p(!0), a?.();
3088
- }, [a]), $ = K(() => {
3089
- p(!1), o?.();
3090
- }, [o]), D = K(() => {
3091
- p(!1), L?.();
3092
- }, [L]), te = K((re) => {
3093
- n?.(re);
3094
- }, [n]);
3095
- return /* @__PURE__ */ h(
3161
+ }, [e]), te = U(() => {
3162
+ d(!0), A?.();
3163
+ }, [A]), N = U(() => {
3164
+ d(!1), g?.();
3165
+ }, [g]), M = U(() => {
3166
+ d(!1), l?.();
3167
+ }, [l]), ne = U((re) => {
3168
+ C?.(re);
3169
+ }, [C]);
3170
+ return /* @__PURE__ */ m(
3096
3171
  Be,
3097
3172
  {
3098
- ...S,
3099
- className: `video-card ${f || ""}`,
3173
+ ...o,
3174
+ className: `video-card ${a || ""}`,
3100
3175
  style: {
3101
- width: i,
3102
- height: l,
3176
+ width: u,
3177
+ height: i,
3103
3178
  padding: 0,
3104
3179
  overflow: "hidden",
3105
- cursor: n ? "pointer" : "default",
3180
+ cursor: C ? "pointer" : "default",
3106
3181
  border: "none",
3107
3182
  borderRadius: 0,
3108
- ...r
3183
+ ...n
3109
3184
  },
3110
3185
  bordered: !1,
3111
- onMouseEnter: j,
3112
- onMouseLeave: Y,
3113
- onClick: te,
3114
- children: /* @__PURE__ */ F("div", { className: "video-card-container", children: [
3115
- /* @__PURE__ */ h(
3186
+ onMouseEnter: K,
3187
+ onMouseLeave: Q,
3188
+ onClick: ne,
3189
+ children: /* @__PURE__ */ W("div", { className: "video-card-container", children: [
3190
+ /* @__PURE__ */ m(
3116
3191
  "video",
3117
3192
  {
3118
- ref: s,
3193
+ ref: r,
3119
3194
  src: t,
3120
- poster: g,
3195
+ poster: y,
3121
3196
  preload: "metadata",
3122
- onLoadedData: Z,
3123
- onPlay: ee,
3124
- onPause: $,
3125
- onEnded: D,
3197
+ onLoadedData: Y,
3198
+ onPlay: te,
3199
+ onPause: N,
3200
+ onEnded: M,
3126
3201
  muted: !0,
3127
3202
  loop: !0
3128
3203
  }
3129
3204
  ),
3130
- V && /* @__PURE__ */ h(
3205
+ L && /* @__PURE__ */ m(
3131
3206
  "div",
3132
3207
  {
3133
- className: `video-play-button ${x ? "hovered" : ""}`,
3134
- onClick: R,
3135
- children: y ? /* @__PURE__ */ h(ut, { className: "play-icon" }) : /* @__PURE__ */ h(dt, { className: "play-icon" })
3208
+ className: `video-play-button ${h ? "hovered" : ""}`,
3209
+ onClick: D,
3210
+ children: s ? /* @__PURE__ */ m(ut, { className: "play-icon" }) : /* @__PURE__ */ m(dt, { className: "play-icon" })
3136
3211
  }
3137
3212
  ),
3138
- !_ && /* @__PURE__ */ h("div", { className: "video-loading-mask", children: /* @__PURE__ */ h("div", { className: "loading-spinner" }) })
3213
+ !G && /* @__PURE__ */ m("div", { className: "video-loading-mask", children: /* @__PURE__ */ m("div", { className: "loading-spinner" }) })
3139
3214
  ] })
3140
3215
  }
3141
3216
  );
@@ -3241,12 +3316,12 @@ We.__docgenInfo = {
3241
3316
  }
3242
3317
  }
3243
3318
  };
3244
- const Dt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((i) => t.toLowerCase().includes(i)), Mt = (t) => t.type ? t.type : Dt(t.url) ? "video" : "image", Ht = ({
3319
+ const Mt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((u) => t.toLowerCase().includes(u)), Rt = (t) => t.type ? t.type : Mt(t.url) ? "video" : "image", Ht = ({
3245
3320
  items: t,
3246
- columns: g,
3247
- gap: i = 0,
3248
- responsive: l = !0,
3249
- breakpoints: u = {
3321
+ columns: y,
3322
+ gap: u = 0,
3323
+ responsive: i = !0,
3324
+ breakpoints: c = {
3250
3325
  xs: 1,
3251
3326
  sm: 2,
3252
3327
  md: 3,
@@ -3255,101 +3330,101 @@ const Dt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
3255
3330
  xxl: 6
3256
3331
  },
3257
3332
  className: k,
3258
- style: V,
3333
+ style: L,
3259
3334
  onClick: E
3260
3335
  }) => {
3261
- const n = W(null), [e, a] = X(g || u.md || 3), o = W(/* @__PURE__ */ new Map()), L = K(() => {
3262
- if (!l || g)
3263
- return g || u.md || 3;
3264
- const s = window.innerWidth;
3265
- return s < 576 ? u.xs || 1 : s < 768 ? u.sm || 2 : s < 992 ? u.md || 3 : s < 1200 ? u.lg || 4 : s < 1600 ? u.xl || 5 : u.xxl || 6;
3266
- }, [l, g, u]), f = K(() => {
3267
- if (!n.current) return;
3268
- const s = e, y = n.current, x = (y.offsetWidth - i * (s - 1)) / s, m = new Array(s).fill(0);
3269
- t.forEach((T, P) => {
3270
- const H = T.id || P, R = o.current.get(H);
3271
- if (!R) return;
3272
- const j = Math.min(...m), Y = m.indexOf(j), Z = Y * (x + i), ee = m[Y];
3273
- R.style.position = "absolute", R.style.left = `${Z}px`, R.style.top = `${ee}px`, R.style.width = `${x}px`, m[Y] += R.offsetHeight + i;
3336
+ const C = j(null), [e, A] = X(y || c.md || 3), g = j(/* @__PURE__ */ new Map()), l = U(() => {
3337
+ if (!i || y)
3338
+ return y || c.md || 3;
3339
+ const r = window.innerWidth;
3340
+ return r < 576 ? c.xs || 1 : r < 768 ? c.sm || 2 : r < 992 ? c.md || 3 : r < 1200 ? c.lg || 4 : r < 1600 ? c.xl || 5 : c.xxl || 6;
3341
+ }, [i, y, c]), a = U(() => {
3342
+ if (!C.current) return;
3343
+ const r = e, s = C.current, h = (s.offsetWidth - u * (r - 1)) / r, x = new Array(r).fill(0);
3344
+ t.forEach((T, _) => {
3345
+ const H = T.id || _, D = g.current.get(H);
3346
+ if (!D) return;
3347
+ const K = Math.min(...x), Q = x.indexOf(K), Y = Q * (h + u), te = x[Q];
3348
+ D.style.position = "absolute", D.style.left = `${Y}px`, D.style.top = `${te}px`, D.style.width = `${h}px`, x[Q] += D.offsetHeight + u;
3274
3349
  });
3275
- const _ = Math.max(...m);
3276
- y.style.height = `${_}px`;
3277
- }, [t, e, i]);
3278
- oe(() => {
3279
- const s = () => {
3280
- const y = L();
3281
- y !== e && a(y);
3350
+ const G = Math.max(...x);
3351
+ s.style.height = `${G}px`;
3352
+ }, [t, e, u]);
3353
+ ae(() => {
3354
+ const r = () => {
3355
+ const s = l();
3356
+ s !== e && A(s);
3282
3357
  };
3283
- if (l)
3284
- return window.addEventListener("resize", s), s(), () => window.removeEventListener("resize", s);
3285
- }, [l, L, e]), oe(() => {
3286
- const s = setTimeout(() => {
3287
- f();
3358
+ if (i)
3359
+ return window.addEventListener("resize", r), r(), () => window.removeEventListener("resize", r);
3360
+ }, [i, l, e]), ae(() => {
3361
+ const r = setTimeout(() => {
3362
+ a();
3288
3363
  }, 100);
3289
- return () => clearTimeout(s);
3290
- }, [t, e, f]);
3291
- const r = K(() => {
3292
- f();
3293
- }, [f]), S = K((s) => {
3294
- E && E(s), s.onClick?.(s);
3364
+ return () => clearTimeout(r);
3365
+ }, [t, e, a]);
3366
+ const n = U(() => {
3367
+ a();
3368
+ }, [a]), o = U((r) => {
3369
+ E && E(r), r.onClick?.(r);
3295
3370
  }, [E]);
3296
- return /* @__PURE__ */ h(
3371
+ return /* @__PURE__ */ m(
3297
3372
  "div",
3298
3373
  {
3299
- ref: n,
3374
+ ref: C,
3300
3375
  className: `waterfall-container ${k || ""}`,
3301
3376
  style: {
3302
3377
  position: "relative",
3303
3378
  width: "100%",
3304
- ...V
3379
+ ...L
3305
3380
  },
3306
- children: t.map((s, y) => {
3307
- const p = s.id || y, x = Mt(s);
3308
- return /* @__PURE__ */ h(
3381
+ children: t.map((r, s) => {
3382
+ const d = r.id || s, h = Rt(r);
3383
+ return /* @__PURE__ */ m(
3309
3384
  "div",
3310
3385
  {
3311
- ref: (m) => {
3312
- m ? o.current.set(p, m) : o.current.delete(p);
3386
+ ref: (x) => {
3387
+ x ? g.current.set(d, x) : g.current.delete(d);
3313
3388
  },
3314
3389
  className: "waterfall-item",
3315
- children: x === "video" ? /* @__PURE__ */ h("div", { style: {
3390
+ children: h === "video" ? /* @__PURE__ */ m("div", { style: {
3316
3391
  width: "100%",
3317
3392
  position: "relative",
3318
3393
  paddingBottom: "56.25%",
3319
- cursor: E || s.onClick ? "pointer" : "default"
3320
- }, children: /* @__PURE__ */ h("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ h(
3394
+ cursor: E || r.onClick ? "pointer" : "default"
3395
+ }, children: /* @__PURE__ */ m("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ m(
3321
3396
  We,
3322
3397
  {
3323
- src: s.url,
3324
- poster: s.poster,
3398
+ src: r.url,
3399
+ poster: r.poster,
3325
3400
  width: "100%",
3326
3401
  height: "100%",
3327
- onClick: () => S(s),
3328
- onVideoLoaded: r,
3402
+ onClick: () => o(r),
3403
+ onVideoLoaded: n,
3329
3404
  autoPlayOnHover: !0,
3330
3405
  showPlayButton: !1
3331
3406
  }
3332
- ) }) }) : /* @__PURE__ */ h(
3407
+ ) }) }) : /* @__PURE__ */ m(
3333
3408
  "div",
3334
3409
  {
3335
3410
  className: "waterfall-image-wrapper",
3336
- onClick: () => S(s),
3337
- style: { cursor: E || s.onClick ? "pointer" : "default" },
3338
- children: /* @__PURE__ */ h(
3411
+ onClick: () => o(r),
3412
+ style: { cursor: E || r.onClick ? "pointer" : "default" },
3413
+ children: /* @__PURE__ */ m(
3339
3414
  "img",
3340
3415
  {
3341
- src: s.url,
3342
- alt: `瀑布流图片 ${y + 1}`,
3416
+ src: r.url,
3417
+ alt: `瀑布流图片 ${s + 1}`,
3343
3418
  className: "waterfall-image",
3344
- onLoad: r,
3345
- onError: r,
3419
+ onLoad: n,
3420
+ onError: n,
3346
3421
  style: { display: "block", width: "100%", height: "auto" }
3347
3422
  }
3348
3423
  )
3349
3424
  }
3350
3425
  )
3351
3426
  },
3352
- p
3427
+ d
3353
3428
  );
3354
3429
  })
3355
3430
  }
@@ -3483,14 +3558,14 @@ export {
3483
3558
  bt as BackButton,
3484
3559
  ft as Button,
3485
3560
  yt as Card,
3486
- Gt as DynamicInput,
3487
- Rt as DynamicTextArea,
3561
+ Pt as DynamicInput,
3562
+ Dt as DynamicTextArea,
3488
3563
  xt as EmptyAndSpin,
3489
- wt as LinkButton,
3564
+ kt as LinkButton,
3490
3565
  gt as PageTable,
3491
- Lt as RichTextEditor,
3566
+ It as RichTextEditor,
3492
3567
  We as VideoCard,
3493
- Pt as VirtualTable,
3568
+ Gt as VirtualTable,
3494
3569
  Ht as Waterfall,
3495
3570
  vt as XcIcon,
3496
3571
  Ut as lightTheme