bi-components-library 1.0.11 → 1.0.13

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,8 +1,8 @@
1
- import De, { useState as Y, useRef as G, useMemo as Ve, useCallback as H, useEffect as ne, useLayoutEffect as Me } from "react";
2
- import { Button as he, Card as Se, Modal as Ge, Table as qe, Flex as $e, Spin as Fe, Empty as ze, Select as Ae, Form as ve, Input as Pe, Space as He, Dropdown as We, Tooltip as Ue, Progress as Xe, Pagination as Ye, theme as Je } from "antd";
3
- import { createFromIconfontCN as Ke, LeftOutlined as Qe, SearchOutlined as Ze, ReloadOutlined as et, InfoCircleOutlined as tt, SendOutlined as nt, PauseCircleOutlined as rt, PlayCircleOutlined as at } from "@ant-design/icons";
4
- import { createPortal as ot } from "react-dom";
5
- var we = { exports: {} }, be = {};
1
+ import Ue, { useState as J, useRef as z, useMemo as Ge, useCallback as W, useEffect as oe, useLayoutEffect as Xe } from "react";
2
+ import { Button as xe, Card as Re, Modal as Ke, Table as Ie, Flex as Pe, Spin as Ye, Empty as Je, Select as Ve, Form as Ce, Input as Fe, Space as Qe, Dropdown as Ze, Tooltip as et, Progress as tt, Pagination as nt, theme as at } from "antd";
3
+ 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";
4
+ import { createPortal as pt } from "react-dom";
5
+ var Se = { exports: {} }, Ee = {};
6
6
  /**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
@@ -12,29 +12,29 @@ var we = { exports: {} }, be = {};
12
12
  * This source code is licensed under the MIT license found in the
13
13
  * LICENSE file in the root directory of this source tree.
14
14
  */
15
- var _e;
16
- function st() {
17
- if (_e) return be;
18
- _e = 1;
15
+ var Be;
16
+ function ft() {
17
+ if (Be) return Ee;
18
+ Be = 1;
19
19
  var t = Symbol.for("react.transitional.element"), p = Symbol.for("react.fragment");
20
- function o(r, a, m) {
21
- var C = null;
22
- if (m !== void 0 && (C = "" + m), a.key !== void 0 && (C = "" + a.key), "key" in a) {
20
+ function l(a, r, m) {
21
+ var A = null;
22
+ if (m !== void 0 && (A = "" + m), r.key !== void 0 && (A = "" + r.key), "key" in r) {
23
23
  m = {};
24
- for (var g in a)
25
- g !== "key" && (m[g] = a[g]);
26
- } else m = a;
27
- return a = m.ref, {
24
+ for (var g in r)
25
+ g !== "key" && (m[g] = r[g]);
26
+ } else m = r;
27
+ return r = m.ref, {
28
28
  $$typeof: t,
29
- type: r,
30
- key: C,
31
- ref: a !== void 0 ? a : null,
29
+ type: a,
30
+ key: A,
31
+ ref: r !== void 0 ? r : null,
32
32
  props: m
33
33
  };
34
34
  }
35
- return be.Fragment = p, be.jsx = o, be.jsxs = o, be;
35
+ return Ee.Fragment = p, Ee.jsx = l, Ee.jsxs = l, Ee;
36
36
  }
37
- var xe = {};
37
+ var ke = {};
38
38
  /**
39
39
  * @license React
40
40
  * react-jsx-runtime.development.js
@@ -44,47 +44,47 @@ var xe = {};
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
46
  */
47
- var Re;
48
- function lt() {
49
- return Re || (Re = 1, process.env.NODE_ENV !== "production" && function() {
47
+ var Oe;
48
+ function mt() {
49
+ return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && function() {
50
50
  function t(s) {
51
51
  if (s == null) return null;
52
52
  if (typeof s == "function")
53
- return s.$$typeof === W ? null : s.displayName || s.name || null;
53
+ return s.$$typeof === U ? null : s.displayName || s.name || null;
54
54
  if (typeof s == "string") return s;
55
55
  switch (s) {
56
- case T:
56
+ case S:
57
57
  return "Fragment";
58
- case v:
58
+ case w:
59
59
  return "Profiler";
60
60
  case c:
61
61
  return "StrictMode";
62
- case R:
62
+ case V:
63
63
  return "Suspense";
64
- case q:
64
+ case _:
65
65
  return "SuspenseList";
66
- case P:
66
+ case B:
67
67
  return "Activity";
68
68
  }
69
69
  if (typeof s == "object")
70
70
  switch (typeof s.tag == "number" && console.error(
71
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
72
72
  ), s.$$typeof) {
73
- case i:
73
+ case o:
74
74
  return "Portal";
75
- case S:
75
+ case $:
76
76
  return (s.displayName || "Context") + ".Provider";
77
- case w:
77
+ case k:
78
78
  return (s._context.displayName || "Context") + ".Consumer";
79
- case h:
80
- var I = s.render;
81
- return s = s.displayName, s || (s = I.displayName || I.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
82
- case L:
83
- return I = s.displayName || null, I !== null ? I : t(s.type) || "Memo";
79
+ case b:
80
+ var L = s.render;
81
+ return s = s.displayName, s || (s = L.displayName || L.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
82
+ case P:
83
+ return L = s.displayName || null, L !== null ? L : t(s.type) || "Memo";
84
84
  case D:
85
- I = s._payload, s = s._init;
85
+ L = s._payload, s = s._init;
86
86
  try {
87
- return t(s(I));
87
+ return t(s(L));
88
88
  } catch {
89
89
  }
90
90
  }
@@ -93,76 +93,76 @@ function lt() {
93
93
  function p(s) {
94
94
  return "" + s;
95
95
  }
96
- function o(s) {
96
+ function l(s) {
97
97
  try {
98
98
  p(s);
99
- var I = !1;
99
+ var L = !1;
100
100
  } catch {
101
- I = !0;
101
+ L = !0;
102
102
  }
103
- if (I) {
104
- I = console;
105
- var X = I.error, ee = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
106
- return X.call(
107
- I,
103
+ if (L) {
104
+ L = console;
105
+ var K = L.error, ae = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
106
+ return K.call(
107
+ L,
108
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
109
- ee
109
+ ae
110
110
  ), p(s);
111
111
  }
112
112
  }
113
- function r(s) {
114
- if (s === T) return "<>";
113
+ function a(s) {
114
+ if (s === S) return "<>";
115
115
  if (typeof s == "object" && s !== null && s.$$typeof === D)
116
116
  return "<...>";
117
117
  try {
118
- var I = t(s);
119
- return I ? "<" + I + ">" : "<...>";
118
+ var L = t(s);
119
+ return L ? "<" + L + ">" : "<...>";
120
120
  } catch {
121
121
  return "<...>";
122
122
  }
123
123
  }
124
- function a() {
125
- var s = F.A;
124
+ function r() {
125
+ var s = H.A;
126
126
  return s === null ? null : s.getOwner();
127
127
  }
128
128
  function m() {
129
129
  return Error("react-stack-top-frame");
130
130
  }
131
- function C(s) {
132
- if (U.call(s, "key")) {
133
- var I = Object.getOwnPropertyDescriptor(s, "key").get;
134
- if (I && I.isReactWarning) return !1;
131
+ function A(s) {
132
+ if (X.call(s, "key")) {
133
+ var L = Object.getOwnPropertyDescriptor(s, "key").get;
134
+ if (L && L.isReactWarning) return !1;
135
135
  }
136
136
  return s.key !== void 0;
137
137
  }
138
- function g(s, I) {
139
- function X() {
140
- _ || (_ = !0, console.error(
138
+ function g(s, L) {
139
+ function K() {
140
+ I || (I = !0, console.error(
141
141
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
142
- I
142
+ L
143
143
  ));
144
144
  }
145
- X.isReactWarning = !0, Object.defineProperty(s, "key", {
146
- get: X,
145
+ K.isReactWarning = !0, Object.defineProperty(s, "key", {
146
+ get: K,
147
147
  configurable: !0
148
148
  });
149
149
  }
150
- function l() {
150
+ function i() {
151
151
  var s = t(this.type);
152
- return J[s] || (J[s] = !0, console.error(
152
+ return Q[s] || (Q[s] = !0, console.error(
153
153
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
154
154
  )), s = this.props.ref, s !== void 0 ? s : null;
155
155
  }
156
- function e(s, I, X, ee, ue, re, ye, O) {
157
- return X = re.ref, s = {
156
+ function e(s, L, K, ae, ye, ce, be, O) {
157
+ return K = ce.ref, s = {
158
158
  $$typeof: d,
159
159
  type: s,
160
- key: I,
161
- props: re,
162
- _owner: ue
163
- }, (X !== void 0 ? X : null) !== null ? Object.defineProperty(s, "ref", {
160
+ key: L,
161
+ props: ce,
162
+ _owner: ye
163
+ }, (K !== void 0 ? K : null) !== null ? Object.defineProperty(s, "ref", {
164
164
  enumerable: !1,
165
- get: l
165
+ get: i
166
166
  }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
167
167
  configurable: !1,
168
168
  enumerable: !1,
@@ -177,7 +177,7 @@ function lt() {
177
177
  configurable: !1,
178
178
  enumerable: !1,
179
179
  writable: !0,
180
- value: ye
180
+ value: be
181
181
  }), Object.defineProperty(s, "_debugTask", {
182
182
  configurable: !1,
183
183
  enumerable: !1,
@@ -185,110 +185,110 @@ function lt() {
185
185
  value: O
186
186
  }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
187
187
  }
188
- function x(s, I, X, ee, ue, re, ye, O) {
189
- var M = I.children;
190
- if (M !== void 0)
191
- if (ee)
192
- if (Z(M)) {
193
- for (ee = 0; ee < M.length; ee++)
194
- u(M[ee]);
195
- Object.freeze && Object.freeze(M);
188
+ function x(s, L, K, ae, ye, ce, be, O) {
189
+ var G = L.children;
190
+ if (G !== void 0)
191
+ if (ae)
192
+ if (Z(G)) {
193
+ for (ae = 0; ae < G.length; ae++)
194
+ u(G[ae]);
195
+ Object.freeze && Object.freeze(G);
196
196
  } else
197
197
  console.error(
198
198
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
199
199
  );
200
- else u(M);
201
- if (U.call(I, "key")) {
202
- M = t(s);
203
- var ae = Object.keys(I).filter(function(Ee) {
204
- return Ee !== "key";
200
+ else u(G);
201
+ if (X.call(L, "key")) {
202
+ G = t(s);
203
+ var ue = Object.keys(L).filter(function(qe) {
204
+ return qe !== "key";
205
205
  });
206
- ee = 0 < ae.length ? "{key: someKey, " + ae.join(": ..., ") + ": ...}" : "{key: someKey}", de[M + ee] || (ae = 0 < ae.length ? "{" + ae.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ ae = 0 < ue.length ? "{key: someKey, " + ue.join(": ..., ") + ": ...}" : "{key: someKey}", he[G + ae] || (ue = 0 < ue.length ? "{" + ue.join(": ..., ") + ": ...}" : "{}", console.error(
207
207
  `A props object containing a "key" prop is being spread into JSX:
208
208
  let props = %s;
209
209
  <%s {...props} />
210
210
  React keys must be passed directly to JSX without using spread:
211
211
  let props = %s;
212
212
  <%s key={someKey} {...props} />`,
213
- ee,
214
- M,
215
213
  ae,
216
- M
217
- ), de[M + ee] = !0);
214
+ G,
215
+ ue,
216
+ G
217
+ ), he[G + ae] = !0);
218
218
  }
219
- if (M = null, X !== void 0 && (o(X), M = "" + X), C(I) && (o(I.key), M = "" + I.key), "key" in I) {
220
- X = {};
221
- for (var fe in I)
222
- fe !== "key" && (X[fe] = I[fe]);
223
- } else X = I;
224
- return M && g(
225
- X,
219
+ if (G = null, K !== void 0 && (l(K), G = "" + K), A(L) && (l(L.key), G = "" + L.key), "key" in L) {
220
+ K = {};
221
+ for (var ve in L)
222
+ ve !== "key" && (K[ve] = L[ve]);
223
+ } else K = L;
224
+ return G && g(
225
+ K,
226
226
  typeof s == "function" ? s.displayName || s.name || "Unknown" : s
227
227
  ), e(
228
228
  s,
229
- M,
230
- re,
231
- ue,
232
- a(),
233
- X,
229
+ G,
230
+ ce,
234
231
  ye,
232
+ r(),
233
+ K,
234
+ be,
235
235
  O
236
236
  );
237
237
  }
238
238
  function u(s) {
239
239
  typeof s == "object" && s !== null && s.$$typeof === d && s._store && (s._store.validated = 1);
240
240
  }
241
- var N = De, d = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), w = Symbol.for("react.consumer"), S = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), q = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), W = Symbol.for("react.client.reference"), F = N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, U = Object.prototype.hasOwnProperty, Z = Array.isArray, k = console.createTask ? console.createTask : function() {
241
+ var q = Ue, d = Symbol.for("react.transitional.element"), o = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), H = q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, T = console.createTask ? console.createTask : function() {
242
242
  return null;
243
243
  };
244
- N = {
244
+ q = {
245
245
  react_stack_bottom_frame: function(s) {
246
246
  return s();
247
247
  }
248
248
  };
249
- var _, J = {}, Q = N.react_stack_bottom_frame.bind(
250
- N,
249
+ var I, Q = {}, ee = q.react_stack_bottom_frame.bind(
250
+ q,
251
251
  m
252
- )(), ie = k(r(m)), de = {};
253
- xe.Fragment = T, xe.jsx = function(s, I, X, ee, ue) {
254
- var re = 1e4 > F.recentlyCreatedOwnerStacks++;
252
+ )(), pe = T(a(m)), he = {};
253
+ ke.Fragment = S, ke.jsx = function(s, L, K, ae, ye) {
254
+ var ce = 1e4 > H.recentlyCreatedOwnerStacks++;
255
255
  return x(
256
256
  s,
257
- I,
258
- X,
257
+ L,
258
+ K,
259
259
  !1,
260
- ee,
261
- ue,
262
- re ? Error("react-stack-top-frame") : Q,
263
- re ? k(r(s)) : ie
260
+ ae,
261
+ ye,
262
+ ce ? Error("react-stack-top-frame") : ee,
263
+ ce ? T(a(s)) : pe
264
264
  );
265
- }, xe.jsxs = function(s, I, X, ee, ue) {
266
- var re = 1e4 > F.recentlyCreatedOwnerStacks++;
265
+ }, ke.jsxs = function(s, L, K, ae, ye) {
266
+ var ce = 1e4 > H.recentlyCreatedOwnerStacks++;
267
267
  return x(
268
268
  s,
269
- I,
270
- X,
269
+ L,
270
+ K,
271
271
  !0,
272
- ee,
273
- ue,
274
- re ? Error("react-stack-top-frame") : Q,
275
- re ? k(r(s)) : ie
272
+ ae,
273
+ ye,
274
+ ce ? Error("react-stack-top-frame") : ee,
275
+ ce ? T(a(s)) : pe
276
276
  );
277
277
  };
278
- }()), xe;
278
+ }()), ke;
279
279
  }
280
- var Ie;
281
- function it() {
282
- return Ie || (Ie = 1, process.env.NODE_ENV === "production" ? we.exports = st() : we.exports = lt()), we.exports;
280
+ var Me;
281
+ function yt() {
282
+ return Me || (Me = 1, process.env.NODE_ENV === "production" ? Se.exports = ft() : Se.exports = mt()), Se.exports;
283
283
  }
284
- var n = it();
285
- const ct = ({
284
+ var n = yt();
285
+ const gt = ({
286
286
  variant: t = "primary",
287
287
  loading: p = !1,
288
- children: o,
289
- ...r
288
+ children: l,
289
+ ...a
290
290
  }) => {
291
- const a = (m) => {
291
+ const r = (m) => {
292
292
  switch (m) {
293
293
  case "primary":
294
294
  return "primary";
@@ -305,17 +305,17 @@ const ct = ({
305
305
  }
306
306
  };
307
307
  return /* @__PURE__ */ n.jsx(
308
- he,
308
+ xe,
309
309
  {
310
- ...r,
311
- type: a(t),
310
+ ...a,
311
+ type: r(t),
312
312
  loading: p,
313
313
  ghost: t === "ghost",
314
- children: o
314
+ children: l
315
315
  }
316
316
  );
317
317
  };
318
- ct.__docgenInfo = {
318
+ gt.__docgenInfo = {
319
319
  displayName: "Button",
320
320
  description: "基础按钮,用于触发操作",
321
321
  props: {
@@ -359,25 +359,25 @@ ct.__docgenInfo = {
359
359
  }
360
360
  }
361
361
  };
362
- const ut = ({
362
+ const ht = ({
363
363
  title: t,
364
364
  children: p,
365
- bordered: o = !0,
366
- hoverable: r = !1,
367
- size: a = "default",
365
+ bordered: l = !0,
366
+ hoverable: a = !1,
367
+ size: r = "default",
368
368
  ...m
369
369
  }) => /* @__PURE__ */ n.jsx(
370
- Se,
370
+ Re,
371
371
  {
372
372
  ...m,
373
373
  title: t,
374
- bordered: o,
375
- hoverable: r,
376
- size: a,
374
+ bordered: l,
375
+ hoverable: a,
376
+ size: r,
377
377
  children: p
378
378
  }
379
379
  );
380
- ut.__docgenInfo = {
380
+ ht.__docgenInfo = {
381
381
  displayName: "Card",
382
382
  description: "卡片容器,用于分组内容",
383
383
  props: {
@@ -428,23 +428,23 @@ ut.__docgenInfo = {
428
428
  }
429
429
  }
430
430
  };
431
- const dt = ({
431
+ const vt = ({
432
432
  showDefaultFooter: t = !0,
433
433
  ...p
434
434
  }) => {
435
- const o = p.footer !== void 0 ? p.footer : t ? (r, { OkBtn: a, CancelBtn: m }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
436
- /* @__PURE__ */ n.jsx(a, {}),
435
+ const l = p.footer !== void 0 ? p.footer : t ? (a, { OkBtn: r, CancelBtn: m }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
436
+ /* @__PURE__ */ n.jsx(r, {}),
437
437
  /* @__PURE__ */ n.jsx(m, {})
438
438
  ] }) : null;
439
439
  return /* @__PURE__ */ n.jsx(
440
- Ge,
440
+ Ke,
441
441
  {
442
442
  ...p,
443
- footer: o
443
+ footer: l
444
444
  }
445
445
  );
446
446
  };
447
- dt.__docgenInfo = {
447
+ vt.__docgenInfo = {
448
448
  displayName: "AppModal",
449
449
  description: "应用级模态框组件,基于 Ant Design Modal 封装",
450
450
  props: {
@@ -505,15 +505,15 @@ dt.__docgenInfo = {
505
505
  }
506
506
  }
507
507
  };
508
- const pt = ({
508
+ const bt = ({
509
509
  scrollX: t,
510
510
  showPagination: p = !0,
511
- defaultPageSize: o = 10,
512
- ...r
511
+ defaultPageSize: l = 10,
512
+ ...a
513
513
  }) => /* @__PURE__ */ n.jsx(
514
- qe,
514
+ Ie,
515
515
  {
516
- ...r,
516
+ ...a,
517
517
  scroll: {
518
518
  x: t || "max-content",
519
519
  y: "50vh"
@@ -522,12 +522,12 @@ const pt = ({
522
522
  hideOnSinglePage: !0,
523
523
  showSizeChanger: !0,
524
524
  showQuickJumper: !0,
525
- defaultPageSize: o,
526
- ...r.pagination
525
+ defaultPageSize: l,
526
+ ...a.pagination
527
527
  } : !1
528
528
  }
529
529
  );
530
- pt.__docgenInfo = {
530
+ bt.__docgenInfo = {
531
531
  displayName: "PageTable",
532
532
  description: "页面级表格组件,高度铺满容器,自动滚动",
533
533
  props: {
@@ -577,30 +577,30 @@ pt.__docgenInfo = {
577
577
  }
578
578
  }
579
579
  };
580
- const ft = Ke({
580
+ const xt = rt({
581
581
  scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
582
- }), mt = ({
582
+ }), wt = ({
583
583
  name: t,
584
584
  size: p,
585
- color: o,
586
- style: r,
587
- ...a
585
+ color: l,
586
+ style: a,
587
+ ...r
588
588
  }) => {
589
589
  const m = {
590
590
  fontSize: p,
591
- color: o,
592
- ...r
591
+ color: l,
592
+ ...a
593
593
  };
594
594
  return /* @__PURE__ */ n.jsx(
595
- ft,
595
+ xt,
596
596
  {
597
- ...a,
597
+ ...r,
598
598
  type: t,
599
599
  style: m
600
600
  }
601
601
  );
602
602
  };
603
- mt.__docgenInfo = {
603
+ wt.__docgenInfo = {
604
604
  displayName: "XcIcon",
605
605
  description: "自定义图标组件,基于 iconfont",
606
606
  props: {
@@ -636,43 +636,43 @@ mt.__docgenInfo = {
636
636
  }
637
637
  }
638
638
  };
639
- const yt = ({
639
+ const Et = ({
640
640
  loading: t,
641
641
  description: p = "暂无数据",
642
- className: o,
643
- emptyChildren: r,
644
- loadingText: a,
642
+ className: l,
643
+ emptyChildren: a,
644
+ loadingText: r,
645
645
  emptyImage: m
646
646
  }) => t ? /* @__PURE__ */ n.jsxs(
647
- $e,
647
+ Pe,
648
648
  {
649
- className: `pt-10 w-full ${o || ""}`,
649
+ className: `pt-10 w-full ${l || ""}`,
650
650
  align: "center",
651
651
  justify: "center",
652
652
  vertical: !0,
653
653
  children: [
654
- /* @__PURE__ */ n.jsx(Fe, { size: "large" }),
655
- a && /* @__PURE__ */ n.jsx("div", { className: "mt-4 text-gray-500", children: a })
654
+ /* @__PURE__ */ n.jsx(Ye, { size: "large" }),
655
+ r && /* @__PURE__ */ n.jsx("div", { className: "mt-4 text-gray-500", children: r })
656
656
  ]
657
657
  }
658
658
  ) : /* @__PURE__ */ n.jsx(
659
- $e,
659
+ Pe,
660
660
  {
661
- className: `pt-10 w-full ${o || ""}`,
661
+ className: `pt-10 w-full ${l || ""}`,
662
662
  align: "center",
663
663
  justify: "center",
664
664
  children: /* @__PURE__ */ n.jsx(
665
- ze,
665
+ Je,
666
666
  {
667
667
  image: m,
668
668
  description: p,
669
669
  imageStyle: { height: 180 },
670
- children: r
670
+ children: a
671
671
  }
672
672
  )
673
673
  }
674
674
  );
675
- yt.__docgenInfo = {
675
+ Et.__docgenInfo = {
676
676
  displayName: "EmptyAndSpin",
677
677
  description: "空状态和加载状态组合组件",
678
678
  props: {
@@ -715,24 +715,24 @@ yt.__docgenInfo = {
715
715
  }
716
716
  }
717
717
  };
718
- const gt = ({
718
+ const kt = ({
719
719
  onClick: t,
720
720
  showText: p = !1,
721
- className: o,
722
- size: r = "small",
723
- type: a = "default"
721
+ className: l,
722
+ size: a = "small",
723
+ type: r = "default"
724
724
  }) => /* @__PURE__ */ n.jsx(
725
- he,
725
+ xe,
726
726
  {
727
- size: r,
728
- type: a,
729
- icon: /* @__PURE__ */ n.jsx(Qe, {}),
730
- className: `cursor-pointer ${o || ""}`,
727
+ size: a,
728
+ type: r,
729
+ icon: /* @__PURE__ */ n.jsx(ot, {}),
730
+ className: `cursor-pointer ${l || ""}`,
731
731
  onClick: t,
732
732
  children: p && "返回"
733
733
  }
734
734
  );
735
- gt.__docgenInfo = {
735
+ kt.__docgenInfo = {
736
736
  displayName: "BackButton",
737
737
  description: "返回按钮组件",
738
738
  props: {
@@ -771,23 +771,23 @@ gt.__docgenInfo = {
771
771
  }
772
772
  }
773
773
  };
774
- const ht = ({
774
+ const Tt = ({
775
775
  removePadding: t = !0,
776
776
  className: p,
777
- ...o
777
+ ...l
778
778
  }) => {
779
- const r = t ? `px-0 h-auto ${p || ""}` : p;
779
+ const a = t ? `px-0 h-auto ${p || ""}` : p;
780
780
  return /* @__PURE__ */ n.jsx(
781
- he,
781
+ xe,
782
782
  {
783
783
  type: "link",
784
- ...o,
785
- className: r,
786
- children: o.children
784
+ ...l,
785
+ className: a,
786
+ children: l.children
787
787
  }
788
788
  );
789
789
  };
790
- ht.__docgenInfo = {
790
+ Tt.__docgenInfo = {
791
791
  displayName: "LinkButton",
792
792
  description: "链接样式按钮组件,适用于表格操作列",
793
793
  props: {
@@ -824,121 +824,121 @@ ht.__docgenInfo = {
824
824
  }
825
825
  }
826
826
  };
827
- const { Option: bt } = Ae, xt = ({
827
+ const { Option: Nt } = Ve, Ct = ({
828
828
  columns: t,
829
829
  request: p,
830
- searchFields: o = [],
831
- showSearch: r = !0,
832
- showRefresh: a = !0,
830
+ searchFields: l = [],
831
+ showSearch: a = !0,
832
+ showRefresh: r = !0,
833
833
  defaultPageSize: m = 10,
834
- pageSizeOptions: C = ["10", "20", "50", "100"],
834
+ pageSizeOptions: A = ["10", "20", "50", "100"],
835
835
  autoLoad: g = !0,
836
- externalParams: l = {},
836
+ externalParams: i = {},
837
837
  ...e
838
838
  }) => {
839
- const [x, u] = Y([]), [N, d] = Y(!1), [i, T] = Y({
839
+ const [x, u] = J([]), [q, d] = J(!1), [o, S] = J({
840
840
  current: 1,
841
841
  pageSize: m,
842
842
  total: 0
843
- }), [c, v] = Y({}), [w, S] = Y({}), [h] = ve.useForm(), R = G(i);
844
- R.current = i;
845
- const q = G(l);
846
- q.current = l;
847
- const L = G(!1), D = Ve(() => t.map((k) => {
848
- const { sortable: _, render: J, ...Q } = k;
843
+ }), [c, w] = J({}), [k, $] = J({}), [b] = Ce.useForm(), V = z(o);
844
+ V.current = o;
845
+ const _ = z(i);
846
+ _.current = i;
847
+ const P = z(!1), D = Ge(() => t.map((T) => {
848
+ const { sortable: I, render: Q, ...ee } = T;
849
849
  return {
850
- ...Q,
851
- sorter: _ ? !0 : void 0,
852
- render: J || ((ie) => ie)
850
+ ...ee,
851
+ sorter: I ? !0 : void 0,
852
+ render: Q || ((pe) => pe)
853
853
  };
854
- }), [t]), P = H(async (k = {}) => {
854
+ }), [t]), B = W(async (T = {}) => {
855
855
  if (p) {
856
856
  d(!0);
857
857
  try {
858
- const _ = {
859
- page: R.current.current,
860
- pageSize: R.current.pageSize,
861
- sortField: w.field,
862
- sortOrder: w.order,
863
- searchParams: { ...c, ...q.current },
864
- ...k
865
- }, J = await p(_);
866
- J.success && (u(J.data), T((Q) => ({
867
- ...Q,
868
- total: J.total,
869
- current: _.page || Q.current
858
+ const I = {
859
+ page: V.current.current,
860
+ pageSize: V.current.pageSize,
861
+ sortField: k.field,
862
+ sortOrder: k.order,
863
+ searchParams: { ...c, ..._.current },
864
+ ...T
865
+ }, Q = await p(I);
866
+ Q.success && (u(Q.data), S((ee) => ({
867
+ ...ee,
868
+ total: Q.total,
869
+ current: I.page || ee.current
870
870
  })));
871
- } catch (_) {
872
- console.error("加载数据失败:", _);
871
+ } catch (I) {
872
+ console.error("加载数据失败:", I);
873
873
  } finally {
874
874
  d(!1);
875
875
  }
876
876
  }
877
- }, [p, w, c]), W = H((k) => {
878
- v(k), T((_) => ({ ..._, current: 1 }));
879
- }, []), F = H(() => {
880
- h.resetFields(), v({}), T((k) => ({ ...k, current: 1 }));
881
- }, [h]), U = H(() => {
882
- P();
883
- }, [P]), Z = H((k, _, J) => {
884
- const Q = {
885
- current: k.current || 1,
886
- pageSize: k.pageSize || m,
887
- total: k.total || 0
888
- }, ie = {
889
- field: J?.field,
890
- order: J?.order
877
+ }, [p, k, c]), U = W((T) => {
878
+ w(T), S((I) => ({ ...I, current: 1 }));
879
+ }, []), H = W(() => {
880
+ b.resetFields(), w({}), S((T) => ({ ...T, current: 1 }));
881
+ }, [b]), X = W(() => {
882
+ B();
883
+ }, [B]), Z = W((T, I, Q) => {
884
+ const ee = {
885
+ current: T.current || 1,
886
+ pageSize: T.pageSize || m,
887
+ total: T.total || 0
888
+ }, pe = {
889
+ field: Q?.field,
890
+ order: Q?.order
891
891
  };
892
- T(Q), S(ie);
892
+ S(ee), $(pe);
893
893
  }, [m]);
894
- return ne(() => {
895
- const k = Object.keys(l).length > 0;
896
- (g && !L.current || k) && (P(), L.current = !0);
897
- }, [g, l, P]), /* @__PURE__ */ n.jsxs("div", { children: [
898
- r && o.length > 0 && /* @__PURE__ */ n.jsx(Se, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ n.jsxs(
899
- ve,
894
+ return oe(() => {
895
+ const T = Object.keys(i).length > 0;
896
+ (g && !P.current || T) && (B(), P.current = !0);
897
+ }, [g, i, B]), /* @__PURE__ */ n.jsxs("div", { children: [
898
+ a && l.length > 0 && /* @__PURE__ */ n.jsx(Re, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ n.jsxs(
899
+ Ce,
900
900
  {
901
- form: h,
901
+ form: b,
902
902
  layout: "inline",
903
- onFinish: W,
904
- initialValues: o.reduce((k, _) => (_.defaultValue !== void 0 && (k[_.key] = _.defaultValue), k), {}),
903
+ onFinish: U,
904
+ initialValues: l.reduce((T, I) => (I.defaultValue !== void 0 && (T[I.key] = I.defaultValue), T), {}),
905
905
  children: [
906
- o.map((k) => /* @__PURE__ */ n.jsx(ve.Item, { name: k.key, label: k.label, children: k.type === "input" ? /* @__PURE__ */ n.jsx(
907
- Pe,
906
+ l.map((T) => /* @__PURE__ */ n.jsx(Ce.Item, { name: T.key, label: T.label, children: T.type === "input" ? /* @__PURE__ */ n.jsx(
907
+ Fe,
908
908
  {
909
- placeholder: k.placeholder || `请输入${k.label}`,
909
+ placeholder: T.placeholder || `请输入${T.label}`,
910
910
  style: { width: 200 }
911
911
  }
912
912
  ) : /* @__PURE__ */ n.jsx(
913
- Ae,
913
+ Ve,
914
914
  {
915
- placeholder: k.placeholder || `请选择${k.label}`,
915
+ placeholder: T.placeholder || `请选择${T.label}`,
916
916
  style: { width: 200 },
917
917
  allowClear: !0,
918
- children: k.options?.map((_) => /* @__PURE__ */ n.jsx(bt, { value: _.value, children: _.label }, _.value))
918
+ children: T.options?.map((I) => /* @__PURE__ */ n.jsx(Nt, { value: I.value, children: I.label }, I.value))
919
919
  }
920
- ) }, k.key)),
921
- /* @__PURE__ */ n.jsx(ve.Item, { children: /* @__PURE__ */ n.jsxs(He, { children: [
922
- /* @__PURE__ */ n.jsx(he, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ n.jsx(Ze, {}), children: "查询" }),
923
- /* @__PURE__ */ n.jsx(he, { onClick: F, children: "重置" }),
924
- a && /* @__PURE__ */ n.jsx(he, { icon: /* @__PURE__ */ n.jsx(et, {}), onClick: U, children: "刷新" })
920
+ ) }, T.key)),
921
+ /* @__PURE__ */ n.jsx(Ce.Item, { children: /* @__PURE__ */ n.jsxs(Qe, { children: [
922
+ /* @__PURE__ */ n.jsx(xe, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ n.jsx(lt, {}), children: "查询" }),
923
+ /* @__PURE__ */ n.jsx(xe, { onClick: H, children: "重置" }),
924
+ r && /* @__PURE__ */ n.jsx(xe, { icon: /* @__PURE__ */ n.jsx(st, {}), onClick: X, children: "刷新" })
925
925
  ] }) })
926
926
  ]
927
927
  }
928
928
  ) }),
929
929
  /* @__PURE__ */ n.jsx(
930
- qe,
930
+ Ie,
931
931
  {
932
932
  ...e,
933
933
  columns: D,
934
934
  dataSource: x,
935
- loading: N,
935
+ loading: q,
936
936
  pagination: {
937
- ...i,
937
+ ...o,
938
938
  showSizeChanger: !0,
939
939
  showQuickJumper: !0,
940
- showTotal: (k, _) => `第 ${_[0]}-${_[1]} 条/共 ${k} 条`,
941
- pageSizeOptions: C
940
+ showTotal: (T, I) => `第 ${I[0]}-${I[1]} 条/共 ${T} 条`,
941
+ pageSizeOptions: A
942
942
  },
943
943
  onChange: Z,
944
944
  scroll: { x: "max-content", y: "50vh" }
@@ -946,7 +946,7 @@ const { Option: bt } = Ae, xt = ({
946
946
  )
947
947
  ] });
948
948
  };
949
- xt.__docgenInfo = {
949
+ Ct.__docgenInfo = {
950
950
  displayName: "AdvancedTable",
951
951
  description: "高阶表格组件,支持异步请求、搜索、排序等功能",
952
952
  props: {
@@ -1013,27 +1013,27 @@ xt.__docgenInfo = {
1013
1013
  }
1014
1014
  }
1015
1015
  };
1016
- function Ne(t, p, o) {
1016
+ function _e(t, p, l) {
1017
1017
  if (!t.current) return;
1018
- const r = /* @__PURE__ */ new Set(), a = {};
1018
+ const a = /* @__PURE__ */ new Set(), r = {};
1019
1019
  for (const u of p)
1020
- u.exclusionGroup && u.exclusionGroup !== "separator" && (r.add(u.exclusionGroup), a[u.exclusionGroup] || (a[u.exclusionGroup] = []), a[u.exclusionGroup].push({
1020
+ u.exclusionGroup && u.exclusionGroup !== "separator" && (a.add(u.exclusionGroup), r[u.exclusionGroup] || (r[u.exclusionGroup] = []), r[u.exclusionGroup].push({
1021
1021
  type: u.type,
1022
1022
  key: u.key,
1023
1023
  exclusionGroup: u.exclusionGroup
1024
1024
  }));
1025
1025
  const m = {};
1026
- for (const u of r) {
1026
+ for (const u of a) {
1027
1027
  m[u] = !1;
1028
- for (const N of a[u])
1029
- if (N.type === "upload" && N.key) {
1030
- if (o[N.key] !== null && o[N.key] !== void 0) {
1028
+ for (const q of r[u])
1029
+ if (q.type === "upload" && q.key) {
1030
+ if (l[q.key] !== null && l[q.key] !== void 0) {
1031
1031
  m[u] = !0;
1032
1032
  break;
1033
1033
  }
1034
- } else if (N.type === "variable" && N.key) {
1034
+ } else if (q.type === "variable" && q.key) {
1035
1035
  const d = t.current.querySelector(
1036
- `[data-type="variable"][data-key="${N.key}"]`
1036
+ `[data-type="variable"][data-key="${q.key}"]`
1037
1037
  );
1038
1038
  if (d && d.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1039
1039
  m[u] = !0;
@@ -1041,45 +1041,45 @@ function Ne(t, p, o) {
1041
1041
  }
1042
1042
  }
1043
1043
  }
1044
- const C = p.some((u) => u.exclusionGroup === "separator"), l = Object.keys(m).filter(
1044
+ const A = p.some((u) => u.exclusionGroup === "separator"), i = Object.keys(m).filter(
1045
1045
  (u) => m[u]
1046
1046
  ).length > 0;
1047
1047
  let e = null;
1048
- if (l && C) {
1048
+ if (i && A) {
1049
1049
  for (const u of p)
1050
1050
  if (u.exclusionGroup && u.exclusionGroup !== "separator" && m[u.exclusionGroup]) {
1051
1051
  e = u.exclusionGroup;
1052
1052
  break;
1053
1053
  }
1054
1054
  }
1055
- for (const u of r) {
1056
- const N = t.current.querySelectorAll(
1055
+ for (const u of a) {
1056
+ const q = t.current.querySelectorAll(
1057
1057
  `[data-group="${u}"]`
1058
1058
  );
1059
- C && l && e ? u === e ? N.forEach((d) => {
1059
+ A && i && e ? u === e ? q.forEach((d) => {
1060
1060
  d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
1061
- }) : N.forEach((d) => {
1061
+ }) : q.forEach((d) => {
1062
1062
  d.style.display = "none", d.style.setProperty("display", "none", "important");
1063
- }) : N.forEach((d) => {
1063
+ }) : q.forEach((d) => {
1064
1064
  d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
1065
1065
  });
1066
1066
  }
1067
1067
  t.current.querySelectorAll(
1068
1068
  '[data-group="separator"]'
1069
1069
  ).forEach((u) => {
1070
- u.style.display = l ? "none" : "inline";
1070
+ u.style.display = i ? "none" : "inline";
1071
1071
  });
1072
1072
  }
1073
- function Ce(t, p, o, r) {
1073
+ function je(t, p, l, a) {
1074
1074
  if (!t.current) {
1075
- r(!1);
1075
+ a(!1);
1076
1076
  return;
1077
1077
  }
1078
- const a = [];
1079
- for (let l = 0; l < p.length; l++) {
1080
- const e = p[l];
1078
+ const r = [];
1079
+ for (let i = 0; i < p.length; i++) {
1080
+ const e = p[i];
1081
1081
  if ((e.type === "variable" || e.type === "upload" || e.type === "multi-variable") && e.required && e.key) {
1082
- a.push({
1082
+ r.push({
1083
1083
  exclusionGroup: e.exclusionGroup || "",
1084
1084
  key: e.key,
1085
1085
  type: e.type === "multi-variable" ? "variable" : e.type,
@@ -1088,10 +1088,10 @@ function Ce(t, p, o, r) {
1088
1088
  continue;
1089
1089
  }
1090
1090
  if (e.type === "text" && e.className?.includes("rte-text-required") && e.exclusionGroup)
1091
- for (let x = l + 1; x < p.length; x++) {
1091
+ for (let x = i + 1; x < p.length; x++) {
1092
1092
  const u = p[x];
1093
1093
  if (u.exclusionGroup === e.exclusionGroup && (u.type === "variable" || u.type === "upload") && u.key) {
1094
- a.push({
1094
+ r.push({
1095
1095
  exclusionGroup: e.exclusionGroup,
1096
1096
  key: u.key,
1097
1097
  type: u.type
@@ -1100,46 +1100,46 @@ function Ce(t, p, o, r) {
1100
1100
  }
1101
1101
  }
1102
1102
  }
1103
- const m = p.some((l) => l.exclusionGroup === "separator");
1104
- let C = !1;
1105
- if (m && a.length > 1) {
1106
- const l = p.findIndex((u) => u.exclusionGroup === "separator"), e = a.filter((u) => p.findIndex(
1103
+ const m = p.some((i) => i.exclusionGroup === "separator");
1104
+ let A = !1;
1105
+ if (m && r.length > 1) {
1106
+ const i = p.findIndex((u) => u.exclusionGroup === "separator"), e = r.filter((u) => p.findIndex(
1107
1107
  (d) => (d.type === "variable" || d.type === "upload") && d.key === u.key && d.exclusionGroup === u.exclusionGroup
1108
- ) < l), x = a.filter((u) => p.findIndex(
1108
+ ) < i), x = r.filter((u) => p.findIndex(
1109
1109
  (d) => (d.type === "variable" || d.type === "upload") && d.key === u.key && d.exclusionGroup === u.exclusionGroup
1110
- ) > l);
1111
- C = e.length > 0 && x.length > 0;
1110
+ ) > i);
1111
+ A = e.length > 0 && x.length > 0;
1112
1112
  }
1113
- if (a.length === 0) {
1113
+ if (r.length === 0) {
1114
1114
  if (p.length === 0) {
1115
1115
  if (!t.current) {
1116
- r(!1);
1116
+ a(!1);
1117
1117
  return;
1118
1118
  }
1119
- const l = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1120
- r(l.length > 0);
1119
+ const i = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1120
+ a(i.length > 0);
1121
1121
  return;
1122
1122
  }
1123
- r(!0);
1123
+ a(!0);
1124
1124
  return;
1125
1125
  }
1126
- const g = a.filter((l) => {
1126
+ const g = r.filter((i) => {
1127
1127
  if (!t.current) return !1;
1128
1128
  const e = t.current.querySelectorAll(
1129
- `[data-group="${l.exclusionGroup}"]`
1129
+ `[data-group="${i.exclusionGroup}"]`
1130
1130
  );
1131
1131
  return e.length === 0 ? !1 : e[0].style.display !== "none";
1132
1132
  });
1133
1133
  if (g.length === 0) {
1134
- r(!0);
1134
+ a(!0);
1135
1135
  return;
1136
1136
  }
1137
- if (C) {
1138
- let l = !1;
1137
+ if (A) {
1138
+ let i = !1;
1139
1139
  for (const e of g)
1140
1140
  if (e.type === "upload" && e.key) {
1141
- if (o[e.key] !== null && o[e.key] !== void 0) {
1142
- l = !0;
1141
+ if (l[e.key] !== null && l[e.key] !== void 0) {
1142
+ i = !0;
1143
1143
  break;
1144
1144
  }
1145
1145
  } else if (e.type === "variable" && e.key)
@@ -1148,13 +1148,13 @@ function Ce(t, p, o, r) {
1148
1148
  `[data-type="variable"][data-multi-key="${e.key}"]`
1149
1149
  );
1150
1150
  let u = !1;
1151
- for (const N of Array.from(x))
1152
- if (N.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1151
+ for (const q of Array.from(x))
1152
+ if (q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1153
1153
  u = !0;
1154
1154
  break;
1155
1155
  }
1156
1156
  if (u) {
1157
- l = !0;
1157
+ i = !0;
1158
1158
  break;
1159
1159
  }
1160
1160
  } else {
@@ -1162,17 +1162,17 @@ function Ce(t, p, o, r) {
1162
1162
  `[data-type="variable"][data-key="${e.key}"]`
1163
1163
  );
1164
1164
  if (x && x.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1165
- l = !0;
1165
+ i = !0;
1166
1166
  break;
1167
1167
  }
1168
1168
  }
1169
- r(l);
1169
+ a(i);
1170
1170
  } else {
1171
- let l = !0;
1171
+ let i = !0;
1172
1172
  for (const e of g)
1173
1173
  if (e.type === "upload" && e.key) {
1174
- if (o[e.key] === null || o[e.key] === void 0) {
1175
- l = !1;
1174
+ if (l[e.key] === null || l[e.key] === void 0) {
1175
+ i = !1;
1176
1176
  break;
1177
1177
  }
1178
1178
  } else if (e.type === "variable" && e.key)
@@ -1181,13 +1181,13 @@ function Ce(t, p, o, r) {
1181
1181
  `[data-type="variable"][data-multi-key="${e.key}"]`
1182
1182
  );
1183
1183
  let u = !1;
1184
- for (const N of Array.from(x))
1185
- if (N.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1184
+ for (const q of Array.from(x))
1185
+ if (q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1186
1186
  u = !0;
1187
1187
  break;
1188
1188
  }
1189
1189
  if (!u) {
1190
- l = !1;
1190
+ i = !1;
1191
1191
  break;
1192
1192
  }
1193
1193
  } else {
@@ -1195,72 +1195,72 @@ function Ce(t, p, o, r) {
1195
1195
  `[data-type="variable"][data-key="${e.key}"]`
1196
1196
  );
1197
1197
  if (!x) {
1198
- l = !1;
1198
+ i = !1;
1199
1199
  break;
1200
1200
  }
1201
1201
  if (x.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
1202
- l = !1;
1202
+ i = !1;
1203
1203
  break;
1204
1204
  }
1205
1205
  }
1206
- r(l);
1206
+ a(i);
1207
1207
  }
1208
1208
  }
1209
- function Te(t, p) {
1209
+ function $e(t, p) {
1210
1210
  if (!t.current) return;
1211
- t.current.querySelectorAll('[data-type="variable"]').forEach((r) => {
1212
- const a = r.innerText.replace(/\n/g, "");
1213
- a.replace(/\u200B/g, "") ? r.classList.remove("show-placeholder") : (a !== "​" && (r.innerText = "​"), r.classList.add("show-placeholder"));
1211
+ t.current.querySelectorAll('[data-type="variable"]').forEach((a) => {
1212
+ const r = a.innerText.replace(/\n/g, "");
1213
+ r.replace(/\u200B/g, "") ? a.classList.remove("show-placeholder") : (r !== "​" && (a.innerText = "​"), a.classList.add("show-placeholder"));
1214
1214
  });
1215
1215
  }
1216
- function vt(t, p, o, r, a, m = {}, C) {
1216
+ function St(t, p, l, a, r, m = {}, A) {
1217
1217
  if (!t.current) return;
1218
- let g = "", l = 0;
1219
- for (; l < p.length; ) {
1220
- const e = p[l], x = l + 1 < p.length ? p[l + 1] : null;
1218
+ let g = "", i = 0;
1219
+ for (; i < p.length; ) {
1220
+ const e = p[i], x = i + 1 < p.length ? p[i + 1] : null;
1221
1221
  if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && x) {
1222
- const c = x.type === "upload" && x.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === x.exclusionGroup, v = x.type === "variable" && x.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === x.exclusionGroup;
1222
+ const c = x.type === "upload" && x.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === x.exclusionGroup, w = x.type === "variable" && x.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === x.exclusionGroup;
1223
1223
  if (c) {
1224
- const S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, h = "</span>";
1225
- let R = "";
1226
- e.className ? R = `<span class="${e.className}">${e.text ?? ""}</span>` : R = e.text ?? "";
1227
- const q = x, L = o[q.key] !== null && o[q.key] !== void 0, D = L ? o[q.key]?.name : q.text, P = L ? "" : "hidden", W = q.tooltip && !L ? "" : "hidden", F = L ? "has-file" : "", U = L && D ? ` data-file-name="${D.replace(/"/g, "&quot;")}"` : "", Z = `<span contenteditable="false" data-type="upload" data-key="${q.key}" class="upload-chip"><span class="upload-inner-wrapper ${F}"><span class="upload-icon">${L ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${U}>${D || q.text}</span>${q.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${W}" data-upload-key="${q.key}" data-tooltip="${q.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${P}" title="移除文件">×</span></span></span>`;
1228
- g += S + R + Z + h, l += 2;
1224
+ const $ = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
1225
+ let V = "";
1226
+ e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
1227
+ const _ = x, P = l[_.key] !== null && l[_.key] !== void 0, D = P ? l[_.key]?.name : _.text, B = P ? "" : "hidden", U = _.tooltip && !P ? "" : "hidden", H = P ? "has-file" : "", X = P && D ? ` data-file-name="${D.replace(/"/g, "&quot;")}"` : "", Z = `<span contenteditable="false" data-type="upload" data-key="${_.key}" class="upload-chip"><span class="upload-inner-wrapper ${H}"><span class="upload-icon">${P ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${X}>${D || _.text}</span>${_.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${U}" data-upload-key="${_.key}" data-tooltip="${_.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${B}" title="移除文件">×</span></span></span>`;
1228
+ g += $ + V + Z + b, i += 2;
1229
1229
  continue;
1230
1230
  }
1231
- if (v) {
1232
- const S = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, h = "</span>";
1233
- let R = "";
1234
- e.className ? R = `<span class="${e.className}">${e.text ?? ""}</span>` : R = e.text ?? "";
1235
- const q = x, D = (q.key ? a[q.key] : void 0) || q.text || "", P = !D, W = P ? "​" : D, F = P ? "show-placeholder" : "", U = q.exclusionGroup ? ` data-group="${q.exclusionGroup}"` : "", Z = q.tooltip ? ` data-tooltip="${q.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${q.key || ""}"` : "", k = q.tooltip && P ? "" : "hidden", _ = `<span contenteditable="true" data-type="variable" data-key="${q.key}" data-placeholder="${q.placeholder || ""}"${U}${Z} class="variable-chip ${F}">${W}${q.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${k}" data-variable-key="${q.key}" data-tooltip="${q.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1236
- g += S + R + _ + h, l += 2;
1231
+ if (w) {
1232
+ const $ = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
1233
+ let V = "";
1234
+ e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
1235
+ const _ = x, D = (_.key ? r[_.key] : void 0) || _.text || "", B = !D, U = B ? "​" : D, H = B ? "show-placeholder" : "", X = _.exclusionGroup ? ` data-group="${_.exclusionGroup}"` : "", Z = _.tooltip ? ` data-tooltip="${_.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${_.key || ""}"` : "", T = _.tooltip && B ? "" : "hidden", I = `<span contenteditable="true" data-type="variable" data-key="${_.key}" data-placeholder="${_.placeholder || ""}"${X}${Z} class="variable-chip ${H}">${U}${_.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${T}" data-variable-key="${_.key}" data-tooltip="${_.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1236
+ g += $ + V + I + b, i += 2;
1237
1237
  continue;
1238
1238
  }
1239
1239
  }
1240
- const N = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", d = e.exclusionGroup ? `<span ${N} class="exclusion-wrapper">` : "", i = e.exclusionGroup ? "</span>" : "";
1241
- let T = "";
1240
+ const q = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", d = e.exclusionGroup ? `<span ${q} class="exclusion-wrapper">` : "", o = e.exclusionGroup ? "</span>" : "";
1241
+ let S = "";
1242
1242
  if (e.type === "tag") {
1243
- const v = r || C === "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>', w = r ? ' data-locked="true"' : "", S = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1244
- T = `<span contenteditable="false" class="tag-node group"${w}${S}><span class="tag-label">${e.text}</span>${v}</span>`;
1243
+ const w = a || A === "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>', k = a ? ' data-locked="true"' : "", $ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1244
+ S = `<span contenteditable="false" class="tag-node group"${k}${$}><span class="tag-label">${e.text}</span>${w}</span>`;
1245
1245
  } else if (e.type === "text") {
1246
- const c = r ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
1247
- e.className ? T = `<span class="${e.className}"${c}>${e.text ?? ""}</span>` : T = r ? `<span${c}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
1246
+ const c = a ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
1247
+ e.className ? S = `<span class="${e.className}"${c}>${e.text ?? ""}</span>` : S = a ? `<span${c}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
1248
1248
  } else if (e.type === "variable" && e.key) {
1249
- const v = a[e.key] || e.text || "", w = !v, S = w ? "​" : v, h = w ? "show-placeholder" : "", R = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", q = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", L = e.tooltip && w ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${R}${q} class="variable-chip ${h}">${S}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${L}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1250
- e.required ? T = `<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>` : T = D;
1249
+ const w = r[e.key] || e.text || "", k = !w, $ = k ? "​" : w, b = k ? "show-placeholder" : "", V = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", _ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", P = e.tooltip && k ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${V}${_} class="variable-chip ${b}">${$}${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>`;
1250
+ 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>${D}</span>` : S = D;
1251
1251
  } else if (e.type === "upload" && e.key) {
1252
- const c = o[e.key] !== null && o[e.key] !== void 0, v = c ? o[e.key]?.name : e.text, w = c ? "" : "hidden", S = e.tooltip && !c ? "" : "hidden", h = c ? "has-file" : "", R = c && v ? ` data-file-name="${v.replace(/"/g, "&quot;")}"` : "", q = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${h}"><span class="upload-icon">${c ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${R}>${v || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${S}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${w}" title="移除文件">×</span></span></span>`;
1253
- e.required ? T = `<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>${q}</span>` : T = q;
1252
+ const c = l[e.key] !== null && l[e.key] !== void 0, w = c ? l[e.key]?.name : e.text, k = c ? "" : "hidden", $ = e.tooltip && !c ? "" : "hidden", b = c ? "has-file" : "", V = c && w ? ` data-file-name="${w.replace(/"/g, "&quot;")}"` : "", _ = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${b}"><span class="upload-icon">${c ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${V}>${w || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${$}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${k}" title="移除文件">×</span></span></span>`;
1253
+ 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>${_}</span>` : S = _;
1254
1254
  } else if (e.type === "multi-variable" && e.key) {
1255
- const c = e.maxCount || 9, v = m[e.key] || 1, w = Math.min(v, c);
1256
- let S = "";
1257
- for (let h = 0; h < w; h++) {
1258
- const R = `${e.key}_${h}`, q = a[R] || "", L = !q, D = L ? "​" : q, P = L ? "show-placeholder" : "", W = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", F = e.tooltip && L ? "" : "hidden", U = `<span contenteditable="true" data-type="variable" data-key="${R}" data-multi-key="${e.key}" data-index="${h}" data-placeholder="${e.placeholder || ""}"${W} class="variable-chip ${P}">${D}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${F}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1259
- S += U;
1255
+ const c = e.maxCount || 9, w = m[e.key] || 1, k = Math.min(w, c);
1256
+ let $ = "";
1257
+ for (let b = 0; b < k; b++) {
1258
+ const V = `${e.key}_${b}`, _ = r[V] || "", P = !_, D = P ? "​" : _, B = P ? "show-placeholder" : "", U = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", H = e.tooltip && P ? "" : "hidden", X = `<span contenteditable="true" data-type="variable" data-key="${V}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder || ""}"${U} class="variable-chip ${B}">${D}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${H}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1259
+ $ += X;
1260
1260
  }
1261
- e.required ? T = `<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>${S}</span>` : T = S;
1261
+ 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>${$}</span>` : S = $;
1262
1262
  }
1263
- g += d + T + i, l++;
1263
+ g += d + S + o, i++;
1264
1264
  }
1265
1265
  t.current && (t.current.innerHTML = g, setTimeout(() => {
1266
1266
  if (!t.current) return;
@@ -1270,8 +1270,8 @@ function vt(t, p, o, r, a, m = {}, C) {
1270
1270
  });
1271
1271
  }, 0));
1272
1272
  }
1273
- function wt(t, p, o, r, a = {}, m, C, g) {
1274
- const l = H(() => {
1273
+ function qt(t, p, l, a, r = {}, m, A, g) {
1274
+ const i = W(() => {
1275
1275
  if (!t.current) return;
1276
1276
  if (p.length === 0) {
1277
1277
  t.current.innerHTML = "";
@@ -1281,309 +1281,309 @@ function wt(t, p, o, r, a = {}, m, C, g) {
1281
1281
  const u = t.current.__tempVariableValues;
1282
1282
  if (u ? (e = u, setTimeout(() => {
1283
1283
  if (t.current) {
1284
- const N = t.current;
1285
- N.__tempVariableValues === u && delete N.__tempVariableValues;
1284
+ const q = t.current;
1285
+ q.__tempVariableValues === u && delete q.__tempVariableValues;
1286
1286
  }
1287
1287
  }, 100)) : t.current.querySelectorAll(
1288
1288
  '[data-type="variable"]'
1289
1289
  ).forEach((d) => {
1290
- const i = d.dataset.key;
1291
- if (i) {
1292
- const T = d.innerText.replace(/[\u200B\n]/g, "").trim();
1293
- T && (e[i] = T);
1290
+ const o = d.dataset.key;
1291
+ if (o) {
1292
+ const S = d.innerText.replace(/[\u200B\n]/g, "").trim();
1293
+ S && (e[o] = S);
1294
1294
  }
1295
- }), vt(t, p, o, r, e, a, g), m?.current) {
1296
- const { key: N, offset: d } = m.current;
1295
+ }), St(t, p, l, a, e, r, g), m?.current) {
1296
+ const { key: q, offset: d } = m.current;
1297
1297
  setTimeout(() => {
1298
1298
  if (!t.current) return;
1299
- const i = t.current.querySelector(
1300
- `[data-type="variable"][data-key="${N}"]`
1299
+ const o = t.current.querySelector(
1300
+ `[data-type="variable"][data-key="${q}"]`
1301
1301
  );
1302
- if (i) {
1302
+ if (o) {
1303
1303
  try {
1304
- const T = document.createRange(), c = document.createTreeWalker(
1305
- i,
1304
+ const S = document.createRange(), c = document.createTreeWalker(
1305
+ o,
1306
1306
  NodeFilter.SHOW_TEXT,
1307
1307
  null
1308
1308
  );
1309
- let v = 0, w = null, S = 0;
1309
+ let w = 0, k = null, $ = 0;
1310
1310
  for (; c.nextNode(); ) {
1311
- const h = c.currentNode, R = h.textContent?.length || 0;
1312
- if (v + R >= d) {
1313
- w = h, S = d - v;
1311
+ const b = c.currentNode, V = b.textContent?.length || 0;
1312
+ if (w + V >= d) {
1313
+ k = b, $ = d - w;
1314
1314
  break;
1315
1315
  }
1316
- v += R;
1316
+ w += V;
1317
1317
  }
1318
- if (w) {
1319
- T.setStart(w, Math.min(S, w.textContent?.length || 0)), T.collapse(!0);
1320
- const h = window.getSelection();
1321
- h && (h.removeAllRanges(), h.addRange(T), i.focus());
1318
+ if (k) {
1319
+ S.setStart(k, Math.min($, k.textContent?.length || 0)), S.collapse(!0);
1320
+ const b = window.getSelection();
1321
+ b && (b.removeAllRanges(), b.addRange(S), o.focus());
1322
1322
  } else {
1323
- T.selectNodeContents(i), T.collapse(!1);
1324
- const h = window.getSelection();
1325
- h && (h.removeAllRanges(), h.addRange(T), i.focus());
1323
+ S.selectNodeContents(o), S.collapse(!1);
1324
+ const b = window.getSelection();
1325
+ b && (b.removeAllRanges(), b.addRange(S), o.focus());
1326
1326
  }
1327
1327
  } catch {
1328
- const T = document.createRange();
1329
- T.selectNodeContents(i), T.collapse(!1);
1328
+ const S = document.createRange();
1329
+ S.selectNodeContents(o), S.collapse(!1);
1330
1330
  const c = window.getSelection();
1331
- c && (c.removeAllRanges(), c.addRange(T), i.focus());
1331
+ c && (c.removeAllRanges(), c.addRange(S), o.focus());
1332
1332
  }
1333
1333
  m.current = null;
1334
1334
  }
1335
1335
  }, 0);
1336
1336
  }
1337
- }, [p, o, r, t, a, m, C, g]);
1338
- ne(() => {
1339
- l();
1340
- }, [l]);
1337
+ }, [p, l, a, t, r, m, A, g]);
1338
+ oe(() => {
1339
+ i();
1340
+ }, [i]);
1341
1341
  }
1342
- function Et(t, p, o, r) {
1343
- ne(() => {
1344
- const a = t.current;
1345
- if (!a) return;
1342
+ function At(t, p, l, a) {
1343
+ oe(() => {
1344
+ const r = t.current;
1345
+ if (!r) return;
1346
1346
  const m = (g) => {
1347
- const l = g.target?.closest(".upload-info-icon");
1348
- if (l && l.classList.contains("upload-info-icon")) {
1349
- const e = l.dataset.uploadKey;
1350
- e && r({ key: e, anchorEl: l, type: "upload" });
1347
+ const i = g.target?.closest(".upload-info-icon");
1348
+ if (i && i.classList.contains("upload-info-icon")) {
1349
+ const e = i.dataset.uploadKey;
1350
+ e && a({ key: e, anchorEl: i, type: "upload" });
1351
1351
  }
1352
- }, C = (g) => {
1353
- const l = g.target?.closest(".upload-info-icon"), e = g.relatedTarget;
1354
- l && l.classList.contains("upload-info-icon") && (!e || !a.contains(e) ? r(null) : e.closest(".upload-info-icon") || r(null));
1352
+ }, A = (g) => {
1353
+ const i = g.target?.closest(".upload-info-icon"), e = g.relatedTarget;
1354
+ i && i.classList.contains("upload-info-icon") && (!e || !r.contains(e) ? a(null) : e.closest(".upload-info-icon") || a(null));
1355
1355
  };
1356
- return a.addEventListener("mouseover", m, !0), a.addEventListener("mouseout", C, !0), () => {
1357
- a.removeEventListener("mouseover", m, !0), a.removeEventListener("mouseout", C, !0);
1356
+ return r.addEventListener("mouseover", m, !0), r.addEventListener("mouseout", A, !0), () => {
1357
+ r.removeEventListener("mouseover", m, !0), r.removeEventListener("mouseout", A, !0);
1358
1358
  };
1359
- }, [p, o, t, r]);
1359
+ }, [p, l, t, a]);
1360
1360
  }
1361
- function kt(t, p, o, r) {
1362
- ne(() => {
1361
+ function $t(t, p, l, a) {
1362
+ oe(() => {
1363
1363
  if (!t.current) return;
1364
- const a = (l) => {
1365
- if (r === "hideTagClose")
1364
+ const r = (i) => {
1365
+ if (a === "hideTagClose")
1366
1366
  return;
1367
- const e = l.currentTarget, x = e.dataset.tooltip, u = e.dataset.tagKey || "";
1368
- x && o({ key: u, anchorEl: e, type: "tag" });
1367
+ const e = i.currentTarget, x = e.dataset.tooltip, u = e.dataset.tagKey || "";
1368
+ x && l({ key: u, anchorEl: e, type: "tag" });
1369
1369
  }, m = () => {
1370
- o(null);
1370
+ l(null);
1371
1371
  };
1372
- let C;
1372
+ let A;
1373
1373
  const g = () => {
1374
1374
  if (!t.current) return;
1375
1375
  t.current.querySelectorAll(
1376
1376
  ".tag-node[data-tooltip]"
1377
1377
  ).forEach((e) => {
1378
- e.addEventListener("mouseenter", a), e.addEventListener("mouseleave", m);
1378
+ e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", m);
1379
1379
  });
1380
1380
  };
1381
- return C = requestAnimationFrame(() => {
1382
- C = requestAnimationFrame(g);
1381
+ return A = requestAnimationFrame(() => {
1382
+ A = requestAnimationFrame(g);
1383
1383
  }), () => {
1384
- cancelAnimationFrame(C), t.current && t.current.querySelectorAll(
1384
+ cancelAnimationFrame(A), t.current && t.current.querySelectorAll(
1385
1385
  ".tag-node[data-tooltip]"
1386
1386
  ).forEach((e) => {
1387
- e.removeEventListener("mouseenter", a), e.removeEventListener("mouseleave", m);
1387
+ e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", m);
1388
1388
  });
1389
1389
  };
1390
- }, [p, t, o, r]);
1390
+ }, [p, t, l, a]);
1391
1391
  }
1392
- function Tt(t, p, o) {
1393
- ne(() => {
1394
- const r = t.current;
1395
- if (!r) return;
1396
- const a = (C) => {
1397
- const g = C.target?.closest(".variable-info-icon");
1392
+ function _t(t, p, l) {
1393
+ oe(() => {
1394
+ const a = t.current;
1395
+ if (!a) return;
1396
+ const r = (A) => {
1397
+ const g = A.target?.closest(".variable-info-icon");
1398
1398
  if (g && g.classList.contains("variable-info-icon")) {
1399
- const l = g.dataset.variableKey;
1400
- l && o({ key: l, anchorEl: g, type: "variable" });
1399
+ const i = g.dataset.variableKey;
1400
+ i && l({ key: i, anchorEl: g, type: "variable" });
1401
1401
  }
1402
- }, m = (C) => {
1403
- const g = C.target?.closest(".variable-info-icon"), l = C.relatedTarget;
1404
- g && g.classList.contains("variable-info-icon") && (!l || !r.contains(l) ? o(null) : l.closest(".variable-info-icon") || o(null));
1402
+ }, m = (A) => {
1403
+ const g = A.target?.closest(".variable-info-icon"), i = A.relatedTarget;
1404
+ g && g.classList.contains("variable-info-icon") && (!i || !a.contains(i) ? l(null) : i.closest(".variable-info-icon") || l(null));
1405
1405
  };
1406
- return r.addEventListener("mouseover", a, !0), r.addEventListener("mouseout", m, !0), () => {
1407
- r.removeEventListener("mouseover", a, !0), r.removeEventListener("mouseout", m, !0);
1406
+ return a.addEventListener("mouseover", r, !0), a.addEventListener("mouseout", m, !0), () => {
1407
+ a.removeEventListener("mouseover", r, !0), a.removeEventListener("mouseout", m, !0);
1408
1408
  };
1409
- }, [p, t, o]);
1409
+ }, [p, t, l]);
1410
1410
  }
1411
- function Nt(t, p, o, r) {
1412
- ne(() => {
1411
+ function jt(t, p, l, a) {
1412
+ oe(() => {
1413
1413
  if (!t.current) return;
1414
- const a = (l) => {
1415
- const e = l.currentTarget;
1416
- e.dataset.fileName && r({ key: "", anchorEl: e, type: "upload-label" });
1414
+ const r = (i) => {
1415
+ const e = i.currentTarget;
1416
+ e.dataset.fileName && a({ key: "", anchorEl: e, type: "upload-label" });
1417
1417
  }, m = () => {
1418
- r(null);
1418
+ a(null);
1419
1419
  };
1420
- let C;
1420
+ let A;
1421
1421
  const g = () => {
1422
1422
  if (!t.current) return;
1423
1423
  t.current.querySelectorAll(
1424
1424
  ".upload-label[data-file-name]"
1425
1425
  ).forEach((e) => {
1426
- e.addEventListener("mouseenter", a), e.addEventListener("mouseleave", m);
1426
+ e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", m);
1427
1427
  });
1428
1428
  };
1429
- return C = requestAnimationFrame(() => {
1430
- C = requestAnimationFrame(g);
1429
+ return A = requestAnimationFrame(() => {
1430
+ A = requestAnimationFrame(g);
1431
1431
  }), () => {
1432
- cancelAnimationFrame(C), t.current && t.current.querySelectorAll(
1432
+ cancelAnimationFrame(A), t.current && t.current.querySelectorAll(
1433
1433
  ".upload-label[data-file-name]"
1434
1434
  ).forEach((e) => {
1435
- e.removeEventListener("mouseenter", a), e.removeEventListener("mouseleave", m);
1435
+ e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", m);
1436
1436
  });
1437
1437
  };
1438
- }, [p, o, t, r]);
1438
+ }, [p, l, t, a]);
1439
1439
  }
1440
- function Ct(t, p, o, r) {
1441
- ne(() => {
1442
- Ne(t, p, o), Ce(t, p, o, r);
1443
- }, [o, p, t, r]);
1440
+ function Rt(t, p, l, a) {
1441
+ oe(() => {
1442
+ _e(t, p, l), je(t, p, l, a);
1443
+ }, [l, p, t, a]);
1444
1444
  }
1445
- function St(t, p) {
1446
- ne(() => {
1445
+ function It(t, p) {
1446
+ oe(() => {
1447
1447
  if (!t.current) return;
1448
- let o = !1, r = 0;
1449
- const a = () => {
1450
- o = !0;
1448
+ let l = !1, a = 0;
1449
+ const r = () => {
1450
+ l = !0;
1451
1451
  }, m = () => {
1452
- o = !1, r = Date.now();
1452
+ l = !1, a = Date.now();
1453
1453
  };
1454
- let C = !1, g = 0;
1455
- const l = () => {
1456
- C = !0;
1454
+ let A = !1, g = 0;
1455
+ const i = () => {
1456
+ A = !0;
1457
1457
  }, e = () => {
1458
- C = !1, g = Date.now();
1458
+ A = !1, g = Date.now();
1459
1459
  }, x = () => {
1460
1460
  g = Date.now();
1461
1461
  }, u = () => {
1462
1462
  if (!t.current) return;
1463
1463
  const d = window.getSelection();
1464
- if (!d || d.rangeCount === 0 || p.current || o || C || Date.now() - g < 500)
1464
+ if (!d || d.rangeCount === 0 || p.current || l || A || Date.now() - g < 500)
1465
1465
  return;
1466
- const i = d.getRangeAt(0);
1467
- if (!i.collapsed) {
1468
- t.current.contains(i.commonAncestorContainer) || d.removeAllRanges();
1466
+ const o = d.getRangeAt(0);
1467
+ if (!o.collapsed) {
1468
+ t.current.contains(o.commonAncestorContainer) || d.removeAllRanges();
1469
1469
  return;
1470
1470
  }
1471
- const T = d.anchorNode;
1472
- if (!T) return;
1473
- if (!t.current.contains(T)) {
1471
+ const S = d.anchorNode;
1472
+ if (!S) return;
1473
+ if (!t.current.contains(S)) {
1474
1474
  d.removeAllRanges();
1475
1475
  return;
1476
1476
  }
1477
1477
  let c = null;
1478
- if (T.nodeType === Node.ELEMENT_NODE ? c = T.closest('[data-type="variable"]') : T.nodeType === Node.TEXT_NODE && T.parentElement && (c = T.parentElement.closest('[data-type="variable"]')), !c) {
1479
- if (Date.now() - r > 500)
1478
+ if (S.nodeType === Node.ELEMENT_NODE ? c = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (c = S.parentElement.closest('[data-type="variable"]')), !c) {
1479
+ if (Date.now() - a > 500)
1480
1480
  return;
1481
- const v = t.current.querySelectorAll('[data-type="variable"]');
1482
- if (v.length > 0) {
1483
- let w = null;
1484
- for (const S of Array.from(v))
1485
- if (S.style.display !== "none") {
1486
- w = S;
1481
+ const w = t.current.querySelectorAll('[data-type="variable"]');
1482
+ if (w.length > 0) {
1483
+ let k = null;
1484
+ for (const $ of Array.from(w))
1485
+ if ($.style.display !== "none") {
1486
+ k = $;
1487
1487
  break;
1488
1488
  }
1489
- if (!w && v.length > 0 && (w = v[0]), w) {
1490
- const S = document.createRange();
1491
- S.selectNodeContents(w), S.collapse(!1), d.removeAllRanges(), d.addRange(S), w.focus();
1489
+ if (!k && w.length > 0 && (k = w[0]), k) {
1490
+ const $ = document.createRange();
1491
+ $.selectNodeContents(k), $.collapse(!1), d.removeAllRanges(), d.addRange($), k.focus();
1492
1492
  } else
1493
1493
  d.removeAllRanges();
1494
1494
  } else
1495
1495
  d.removeAllRanges();
1496
1496
  }
1497
- }, N = t.current;
1498
- return N && (N.addEventListener("compositionstart", l), N.addEventListener("compositionend", e), N.addEventListener("input", x)), document.addEventListener("mousedown", a), document.addEventListener("mouseup", m), document.addEventListener("selectionchange", u), () => {
1497
+ }, q = t.current;
1498
+ return q && (q.addEventListener("compositionstart", i), q.addEventListener("compositionend", e), q.addEventListener("input", x)), document.addEventListener("mousedown", r), document.addEventListener("mouseup", m), document.addEventListener("selectionchange", u), () => {
1499
1499
  const d = t.current;
1500
- d && (d.removeEventListener("compositionstart", l), d.removeEventListener("compositionend", e), d.removeEventListener("input", x)), document.removeEventListener("mousedown", a), document.removeEventListener("mouseup", m), document.removeEventListener("selectionchange", u);
1500
+ d && (d.removeEventListener("compositionstart", i), d.removeEventListener("compositionend", e), d.removeEventListener("input", x)), document.removeEventListener("mousedown", r), document.removeEventListener("mouseup", m), document.removeEventListener("selectionchange", u);
1501
1501
  };
1502
1502
  }, [t, p]);
1503
1503
  }
1504
- const qt = ({
1504
+ const Vt = ({
1505
1505
  config: t,
1506
1506
  onSend: p,
1507
- isProcessing: o = !1,
1508
- disabled: r = !1,
1509
- width: a,
1507
+ isProcessing: l = !1,
1508
+ disabled: a = !1,
1509
+ width: r,
1510
1510
  lockStructure: m = !1,
1511
- agentOptions: C = [],
1511
+ agentOptions: A = [],
1512
1512
  onAgentSelect: g,
1513
- onAgentExit: l,
1513
+ onAgentExit: i,
1514
1514
  loading: e = !1,
1515
1515
  placeholder: x,
1516
1516
  border: u,
1517
- background: N = "transparent",
1517
+ background: q = "transparent",
1518
1518
  hideButtons: d
1519
1519
  }) => {
1520
- const i = G(null), T = G(null), [c, v] = Y({}), [w, S] = Y(null), [h, R] = Y(null), q = G(!1), L = G(null), [D, P] = Y(!1), W = G(null), [F, U] = Y(!0), [Z, k] = Y(() => {
1520
+ const o = z(null), S = z(null), [c, w] = J({}), [k, $] = J(null), [b, V] = J(null), _ = z(!1), P = z(null), [D, B] = J(!1), U = z(null), [H, X] = J(!0), [Z, T] = J(() => {
1521
1521
  const f = {};
1522
1522
  return t.forEach((y) => {
1523
1523
  y.type === "multi-variable" && y.key && (f[y.key] = 1);
1524
1524
  }), f;
1525
- }), _ = G({}), J = G({}), Q = G({});
1526
- ne(() => {
1527
- J.current = c;
1528
- }, [c]), ne(() => {
1529
- Q.current = Z;
1525
+ }), I = z({}), Q = z({}), ee = z({});
1526
+ oe(() => {
1527
+ Q.current = c;
1528
+ }, [c]), oe(() => {
1529
+ ee.current = Z;
1530
1530
  }, [Z]);
1531
- const ie = H((f) => f.find((b) => b.type === "tag")?.text || null, []), de = G(t), s = G(null);
1532
- ne(() => {
1533
- const f = ie(de.current), y = ie(t);
1534
- if (f && f !== y && i.current) {
1535
- const b = {};
1536
- i.current.querySelectorAll('[data-type="variable"]').forEach((E) => {
1537
- const A = E.dataset.key;
1538
- if (A) {
1539
- const j = E.innerText.replace(/[\u200B\n]/g, "").trim();
1540
- j && (b[A] = j);
1531
+ const pe = W((f) => f.find((h) => h.type === "tag")?.text || null, []), he = z(t), s = z(null);
1532
+ oe(() => {
1533
+ const f = pe(he.current), y = pe(t);
1534
+ if (f && f !== y && o.current) {
1535
+ const h = {};
1536
+ o.current.querySelectorAll('[data-type="variable"]').forEach((v) => {
1537
+ const E = v.dataset.key;
1538
+ if (E) {
1539
+ const N = v.innerText.replace(/[\u200B\n]/g, "").trim();
1540
+ N && (h[E] = N);
1541
1541
  }
1542
- }), _.current[f] = {
1543
- variableValues: b,
1544
- files: { ...J.current },
1545
- multiVariableCounts: { ...Q.current }
1542
+ }), I.current[f] = {
1543
+ variableValues: h,
1544
+ files: { ...Q.current },
1545
+ multiVariableCounts: { ...ee.current }
1546
1546
  };
1547
1547
  }
1548
- if (y && _.current[y]) {
1549
- const b = _.current[y];
1550
- s.current = b, v(b.files), k(b.multiVariableCounts);
1548
+ if (y && I.current[y]) {
1549
+ const h = I.current[y];
1550
+ s.current = h, w(h.files), T(h.multiVariableCounts);
1551
1551
  } else if (y) {
1552
1552
  s.current = null;
1553
- const b = {};
1554
- t.forEach(($) => {
1555
- $.type === "multi-variable" && $.key && (b[$.key] = 1);
1556
- }), k(b), v({});
1553
+ const h = {};
1554
+ t.forEach((C) => {
1555
+ C.type === "multi-variable" && C.key && (h[C.key] = 1);
1556
+ }), T(h), w({});
1557
1557
  } else
1558
- s.current = null, k({}), v({});
1559
- de.current = t;
1560
- }, [t, ie]), Me(() => {
1561
- s.current && i.current && (i.current.__tempVariableValues = s.current.variableValues, setTimeout(() => {
1558
+ s.current = null, T({}), w({});
1559
+ he.current = t;
1560
+ }, [t, pe]), Xe(() => {
1561
+ s.current && o.current && (o.current.__tempVariableValues = s.current.variableValues, setTimeout(() => {
1562
1562
  s.current && (s.current = null);
1563
1563
  }, 0));
1564
- }), wt(i, t, c, m, Z, W, void 0, d), Et(i, t, c, R), kt(i, t, R, d), Nt(i, t, c, R), Tt(i, t, R), Ct(i, t, c, P), St(i, q), ne(() => {
1564
+ }), qt(o, t, c, m, Z, U, void 0, d), At(o, t, c, V), $t(o, t, V, d), jt(o, t, c, V), _t(o, t, V), Rt(o, t, c, B), It(o, _), oe(() => {
1565
1565
  if (t.length > 0) {
1566
- U(!1);
1566
+ X(!1);
1567
1567
  return;
1568
1568
  }
1569
1569
  const f = () => {
1570
- if (!i.current) {
1571
- U(!0);
1570
+ if (!o.current) {
1571
+ X(!0);
1572
1572
  return;
1573
1573
  }
1574
- const b = i.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", $ = i.current.querySelectorAll('[data-type="variable"]'), E = i.current.querySelectorAll('[data-type="upload"]');
1575
- let A = !1;
1576
- $.forEach((B) => {
1577
- (B.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (A = !0);
1578
- }), E.forEach((B) => {
1579
- B.querySelector(".upload-inner-wrapper.has-file") && (A = !0);
1574
+ const h = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", C = o.current.querySelectorAll('[data-type="variable"]'), v = o.current.querySelectorAll('[data-type="upload"]');
1575
+ let E = !1;
1576
+ C.forEach((R) => {
1577
+ (R.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (E = !0);
1578
+ }), v.forEach((R) => {
1579
+ R.querySelector(".upload-inner-wrapper.has-file") && (E = !0);
1580
1580
  });
1581
- const j = !b && !A;
1582
- U(j), t.length === 0 && P(!j);
1581
+ const N = !h && !E;
1582
+ X(N), t.length === 0 && B(!N);
1583
1583
  };
1584
1584
  f();
1585
1585
  const y = new MutationObserver(f);
1586
- return i.current && y.observe(i.current, {
1586
+ return o.current && y.observe(o.current, {
1587
1587
  childList: !0,
1588
1588
  subtree: !0,
1589
1589
  characterData: !0
@@ -1591,85 +1591,116 @@ const qt = ({
1591
1591
  y.disconnect();
1592
1592
  };
1593
1593
  }, [t]);
1594
- const I = (f) => {
1595
- if (r) {
1594
+ const L = (f) => {
1595
+ if (a) {
1596
1596
  f.preventDefault();
1597
1597
  return;
1598
1598
  }
1599
1599
  f.preventDefault();
1600
- const y = f.clipboardData.getData("text/plain"), b = window.getSelection();
1601
- if (b && b.rangeCount > 0) {
1602
- const $ = b.anchorNode;
1603
- if ($) {
1604
- let E = null;
1605
- if ($.nodeType === Node.ELEMENT_NODE ? E = $.closest('[data-type="variable"]') : $.nodeType === Node.TEXT_NODE && $.parentElement && (E = $.parentElement.closest('[data-type="variable"]')), E) {
1606
- const A = E.dataset.multiKey;
1607
- if (A) {
1608
- const j = y.split(/[,\n\r\t]+/).map((B) => B.trim()).filter((B) => B.length > 0);
1609
- if (j.length > 1) {
1610
- const B = parseInt(E.dataset.index || "0", 10), V = t.find((se) => se.type === "multi-variable" && se.key === A)?.maxCount || 9, z = Z[A] || 1, oe = Math.min(B + j.length, V);
1611
- oe > z && k((te) => ({
1612
- ...te,
1613
- [A]: oe
1614
- })), setTimeout(() => {
1615
- i.current && (j.forEach((te, se) => {
1616
- const ce = B + se;
1617
- if (ce >= V) return;
1618
- const K = `${A}_${ce}`, le = i.current.querySelector(
1619
- `[data-type="variable"][data-key="${K}"]`
1620
- );
1621
- le && (le.innerText = te, le.classList.remove("show-placeholder"));
1622
- }), ae());
1623
- }, 0);
1600
+ const y = f.clipboardData.getData("text/plain"), h = window.getSelection();
1601
+ if (h && h.rangeCount > 0) {
1602
+ const C = h.anchorNode;
1603
+ if (C) {
1604
+ let v = null;
1605
+ if (C.nodeType === Node.ELEMENT_NODE ? v = C.closest('[data-type="variable"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (v = C.parentElement.closest('[data-type="variable"]')), v) {
1606
+ const E = v.dataset.multiKey;
1607
+ if (E) {
1608
+ const N = /[、,,\s\n\r\t]+/, R = y.split(N).map((j) => j.trim()).filter((j) => j.length > 0);
1609
+ if (console.log("[Paste Event] 粘贴的内容:", y), console.log("[Paste Event] 拆分后的值:", R), R.length > 1) {
1610
+ const j = parseInt(v.dataset.index || "0", 10), M = t.find((se) => se.type === "multi-variable" && se.key === E)?.maxCount || 9, ne = Z[E] || 1, re = Math.min(j + R.length, M);
1611
+ re > ne && T((Y) => ({
1612
+ ...Y,
1613
+ [E]: re
1614
+ }));
1615
+ const ie = [];
1616
+ for (let Y = 0; Y < ne; Y++) {
1617
+ const se = `${E}_${Y}`, fe = o.current.querySelector(
1618
+ `[data-type="variable"][data-key="${se}"][data-multi-key="${E}"]`
1619
+ );
1620
+ if (fe) {
1621
+ const me = fe.innerText.replace(/[\u200B\n]/g, "").trim();
1622
+ ie.push(me);
1623
+ }
1624
+ }
1625
+ ie.splice(j, 1, ...R.slice(0, M - j));
1626
+ const le = ie.slice(0, M);
1627
+ le.length > 0 && le[le.length - 1] !== "" && le.length < M && le.push("");
1628
+ const F = Math.max(le.length, 1), te = {};
1629
+ le.forEach((Y, se) => {
1630
+ Y && (te[`${E}_${se}`] = Y);
1631
+ }), o.current.querySelectorAll(
1632
+ '[data-type="variable"]'
1633
+ ).forEach((Y) => {
1634
+ const se = Y.dataset.key, fe = Y.dataset.multiKey;
1635
+ if (se && fe !== E) {
1636
+ const me = Y.innerText.replace(/[\u200B\n]/g, "").trim();
1637
+ me && (te[se] = me);
1638
+ }
1639
+ }), o.current.__tempVariableValues = te, T((Y) => ({
1640
+ ...Y,
1641
+ [E]: F
1642
+ })), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", le);
1624
1643
  return;
1625
- }
1644
+ } else R.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
1626
1645
  }
1627
1646
  }
1628
1647
  }
1629
1648
  }
1630
- document.execCommand("insertText", !1, y), ae();
1631
- }, X = (f) => {
1632
- if (f.target.files && f.target.files[0] && w) {
1633
- const y = f.target.files[0], b = w;
1634
- v(($) => ({ ...$, [b]: y }));
1635
- }
1636
- f.target && (f.target.value = ""), S(null);
1637
- }, ee = (f) => {
1638
- v((y) => {
1639
- const b = { ...y };
1640
- return delete b[f], b;
1649
+ document.execCommand("insertText", !1, y), ue(), setTimeout(() => {
1650
+ const C = window.getSelection();
1651
+ if (C && C.rangeCount > 0) {
1652
+ const v = C.anchorNode;
1653
+ if (v) {
1654
+ let E = null;
1655
+ if (v.nodeType === Node.ELEMENT_NODE ? E = v.closest('[data-type="variable"][data-multi-key]') : v.nodeType === Node.TEXT_NODE && v.parentElement && (E = v.parentElement.closest('[data-type="variable"][data-multi-key]')), E) {
1656
+ const N = E.innerText.replace(/[\u200B\n]/g, "").trim();
1657
+ /[、,,\s]+/.test(N) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", N), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
1658
+ }
1659
+ }
1660
+ }
1661
+ }, 0);
1662
+ }, K = (f) => {
1663
+ if (f.target.files && f.target.files[0] && k) {
1664
+ const y = f.target.files[0], h = k;
1665
+ w((C) => ({ ...C, [h]: y }));
1666
+ }
1667
+ f.target && (f.target.value = ""), $(null);
1668
+ }, ae = (f) => {
1669
+ w((y) => {
1670
+ const h = { ...y };
1671
+ return delete h[f], h;
1641
1672
  });
1642
- }, ue = (f) => {
1673
+ }, ye = (f) => {
1643
1674
  const y = f.target;
1644
1675
  if (y.closest(".tag-close-btn")) {
1645
1676
  if (f.preventDefault(), f.stopPropagation(), m)
1646
1677
  return;
1647
- R(null), l ? l() : i.current && (i.current.innerHTML = "", i.current.focus());
1678
+ V(null), i ? i() : o.current && (o.current.innerHTML = "", o.current.focus());
1648
1679
  return;
1649
1680
  }
1650
1681
  if (m) {
1651
- const E = y.closest(".tag-node"), A = y.closest('[data-type="text"]');
1652
- if (E || A) {
1682
+ const v = y.closest(".tag-node"), E = y.closest('[data-type="text"]');
1683
+ if (v || E) {
1653
1684
  f.preventDefault(), f.stopPropagation();
1654
- const j = window.getSelection();
1655
- j && j.removeAllRanges();
1685
+ const N = window.getSelection();
1686
+ N && N.removeAllRanges();
1656
1687
  return;
1657
1688
  }
1658
1689
  }
1659
- y.closest('[data-type="variable"]') || (L.current = { x: f.clientX, y: f.clientY }, q.current = !1, y.closest(".file-remove-btn") && (f.preventDefault(), f.stopPropagation()));
1660
- }, re = (f) => {
1661
- if (!f.target.closest('[data-type="variable"]') && L.current) {
1662
- const $ = Math.abs(f.clientX - L.current.x), E = Math.abs(f.clientY - L.current.y);
1663
- ($ > 3 || E > 3) && (q.current = !0);
1690
+ y.closest('[data-type="variable"]') || (P.current = { x: f.clientX, y: f.clientY }, _.current = !1, y.closest(".file-remove-btn") && (f.preventDefault(), f.stopPropagation()));
1691
+ }, ce = (f) => {
1692
+ if (!f.target.closest('[data-type="variable"]') && P.current) {
1693
+ const C = Math.abs(f.clientX - P.current.x), v = Math.abs(f.clientY - P.current.y);
1694
+ (C > 3 || v > 3) && (_.current = !0);
1664
1695
  }
1665
- }, ye = (f) => {
1696
+ }, be = (f) => {
1666
1697
  if (f.target.closest('[data-type="variable"]')) {
1667
- L.current = null, q.current = !1;
1698
+ P.current = null, _.current = !1;
1668
1699
  return;
1669
1700
  }
1670
- L.current = null, q.current = !1;
1701
+ P.current = null, _.current = !1;
1671
1702
  }, O = (f) => {
1672
- if (r)
1703
+ if (a)
1673
1704
  return;
1674
1705
  const y = f.target;
1675
1706
  if (y.closest(".tag-close-btn")) {
@@ -1680,345 +1711,422 @@ const qt = ({
1680
1711
  return;
1681
1712
  if (y.closest('[data-type="text"]')) {
1682
1713
  f.preventDefault(), f.stopPropagation();
1683
- const B = window.getSelection();
1684
- B && B.removeAllRanges();
1714
+ const R = window.getSelection();
1715
+ R && R.removeAllRanges();
1685
1716
  return;
1686
1717
  }
1687
1718
  if (m && y.closest(".tag-node")) {
1688
1719
  f.preventDefault(), f.stopPropagation();
1689
- const V = window.getSelection();
1690
- V && V.removeAllRanges();
1720
+ const j = window.getSelection();
1721
+ j && j.removeAllRanges();
1691
1722
  return;
1692
1723
  }
1693
1724
  if (y.closest('[data-type="variable"]')) {
1694
- if (q.current)
1725
+ if (_.current)
1695
1726
  return;
1696
1727
  setTimeout(() => {
1697
- const B = window.getSelection();
1698
- B && !B.isCollapsed || Te(i);
1728
+ const R = window.getSelection();
1729
+ R && !R.isCollapsed || $e(o);
1699
1730
  }, 10);
1700
1731
  return;
1701
1732
  }
1702
- const A = y.closest(".file-remove-btn");
1703
- if (A) {
1733
+ const E = y.closest(".file-remove-btn");
1734
+ if (E) {
1704
1735
  f.preventDefault(), f.stopPropagation();
1705
- const V = A.closest('[data-type="upload"]')?.dataset.key;
1706
- V && ee(V);
1736
+ const j = E.closest('[data-type="upload"]')?.dataset.key;
1737
+ j && ae(j);
1707
1738
  return;
1708
1739
  }
1709
- const j = y.closest('[data-type="upload"]');
1710
- if (j) {
1711
- const B = j.dataset.key;
1712
- B && (S(B), T.current?.click());
1740
+ const N = y.closest('[data-type="upload"]');
1741
+ if (N) {
1742
+ const R = N.dataset.key;
1743
+ R && ($(R), S.current?.click());
1713
1744
  return;
1714
1745
  }
1715
- }, M = (f) => {
1716
- const b = f.target.closest('[data-type="variable"]');
1717
- if (b) {
1718
- const $ = window.getSelection();
1719
- if ($) {
1720
- const E = document.createRange(), A = b.textContent || "";
1721
- if (A.replace(/\u200B/g, "")) {
1722
- let B = 0, V = A.length;
1723
- A.startsWith("​") && (B = 1), A.endsWith("​") && A.length > 1 && (V = A.length - 1);
1724
- const z = b.firstChild;
1725
- z && z.nodeType === Node.TEXT_NODE ? (E.setStart(z, B), E.setEnd(z, V)) : E.selectNodeContents(b);
1746
+ }, G = (f) => {
1747
+ const h = f.target.closest('[data-type="variable"]');
1748
+ if (h) {
1749
+ const C = window.getSelection();
1750
+ if (C) {
1751
+ const v = document.createRange(), E = h.textContent || "";
1752
+ if (E.replace(/\u200B/g, "")) {
1753
+ let R = 0, j = E.length;
1754
+ E.startsWith("​") && (R = 1), E.endsWith("​") && E.length > 1 && (j = E.length - 1);
1755
+ const M = h.firstChild;
1756
+ M && M.nodeType === Node.TEXT_NODE ? (v.setStart(M, R), v.setEnd(M, j)) : v.selectNodeContents(h);
1726
1757
  } else
1727
- E.selectNodeContents(b), E.collapse(!0);
1728
- $.removeAllRanges(), $.addRange(E);
1758
+ v.selectNodeContents(h), v.collapse(!0);
1759
+ C.removeAllRanges(), C.addRange(v);
1729
1760
  }
1730
1761
  }
1731
- }, ae = () => {
1762
+ }, ue = () => {
1732
1763
  if (t.length === 0) {
1733
- if (i.current) {
1734
- const b = !(i.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
1735
- U(b), P(!b);
1764
+ if (o.current) {
1765
+ const h = !(o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
1766
+ X(h), B(!h);
1736
1767
  }
1737
1768
  return;
1738
1769
  }
1739
- if (Te(i), i.current && i.current.querySelectorAll('[data-type="variable"]').forEach((b) => {
1740
- const $ = b.querySelector(".variable-info-icon");
1741
- if ($) {
1742
- let E = !1;
1743
- const A = document.createTreeWalker(
1744
- b,
1770
+ if ($e(o), o.current && o.current.querySelectorAll('[data-type="variable"]').forEach((h) => {
1771
+ const C = h.querySelector(".variable-info-icon");
1772
+ if (C) {
1773
+ let v = !1;
1774
+ const E = document.createTreeWalker(
1775
+ h,
1745
1776
  NodeFilter.SHOW_TEXT,
1746
1777
  {
1747
- acceptNode: (j) => $.contains(j) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1778
+ acceptNode: (N) => C.contains(N) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1748
1779
  }
1749
1780
  );
1750
- for (; A.nextNode(); )
1751
- if (A.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1752
- E = !0;
1781
+ for (; E.nextNode(); )
1782
+ if (E.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1783
+ v = !0;
1753
1784
  break;
1754
1785
  }
1755
- E ? $.classList.add("hidden") : $.classList.remove("hidden");
1786
+ v ? C.classList.add("hidden") : C.classList.remove("hidden");
1756
1787
  }
1757
- }), Ne(i, t, c), Ce(i, t, c, P), !i.current) return;
1788
+ }), _e(o, t, c), je(o, t, c, B), !o.current) return;
1758
1789
  t.filter((y) => y.type === "multi-variable" && y.key).forEach((y) => {
1759
1790
  if (!y.key) return;
1760
- const b = y.maxCount || 9, $ = Z[y.key] || 1, E = [];
1761
- for (let z = 0; z < $; z++) {
1762
- const oe = `${y.key}_${z}`, te = i.current.querySelector(
1763
- `[data-type="variable"][data-key="${oe}"][data-multi-key="${y.key}"]`
1791
+ const h = y.maxCount || 9, C = Z[y.key] || 1, v = [];
1792
+ for (let M = 0; M < C; M++) {
1793
+ const ne = `${y.key}_${M}`, re = o.current.querySelector(
1794
+ `[data-type="variable"][data-key="${ne}"][data-multi-key="${y.key}"]`
1764
1795
  );
1765
- if (te) {
1766
- const se = te.innerText.replace(/[\u200B\n]/g, "").trim();
1767
- E.push(se);
1796
+ if (re) {
1797
+ const ie = re.innerText.replace(/[\u200B\n]/g, "").trim();
1798
+ v.push(ie);
1768
1799
  }
1769
1800
  }
1770
- const j = (E[E.length - 1] || "") === "";
1771
- let B = !1, V = -1;
1772
- for (let z = 0; z < E.length - 1; z++)
1773
- if (E[z] === "") {
1774
- B = !0, V = z;
1801
+ const N = (v[v.length - 1] || "") === "";
1802
+ let R = !1, j = -1;
1803
+ for (let M = 0; M < v.length - 1; M++)
1804
+ if (v[M] === "") {
1805
+ R = !0, j = M;
1775
1806
  break;
1776
1807
  }
1777
- if (B && V >= 0) {
1778
- const z = window.getSelection();
1779
- if (z && z.rangeCount > 0) {
1780
- const K = z.getRangeAt(0), le = K.startContainer, pe = le.nodeType === Node.ELEMENT_NODE ? le.closest('[data-type="variable"][data-multi-key]') : le.parentElement?.closest('[data-type="variable"][data-multi-key]');
1781
- if (pe) {
1782
- const me = pe.dataset.key;
1783
- if (me) {
1784
- const ge = document.createRange();
1785
- ge.setStartBefore(pe), ge.setEnd(K.startContainer, K.startOffset);
1786
- const ke = ge.toString().length;
1787
- W.current = { key: me, offset: ke };
1808
+ if (R && j >= 0) {
1809
+ const M = window.getSelection();
1810
+ if (M && M.rangeCount > 0) {
1811
+ const F = M.getRangeAt(0), te = F.startContainer, de = te.nodeType === Node.ELEMENT_NODE ? te.closest('[data-type="variable"][data-multi-key]') : te.parentElement?.closest('[data-type="variable"][data-multi-key]');
1812
+ if (de) {
1813
+ const Y = de.dataset.key;
1814
+ if (Y) {
1815
+ const se = document.createRange();
1816
+ se.setStartBefore(de), se.setEnd(F.startContainer, F.startOffset);
1817
+ const fe = se.toString().length;
1818
+ U.current = { key: Y, offset: fe };
1788
1819
  }
1789
1820
  }
1790
1821
  }
1791
- const oe = [...E];
1792
- for (let K = V; K < oe.length - 1; K++)
1793
- oe[K] = oe[K + 1];
1794
- oe.pop();
1795
- const te = {};
1796
- oe.forEach((K, le) => {
1797
- K && (te[`${y.key}_${le}`] = K);
1822
+ const ne = [...v];
1823
+ for (let F = j; F < ne.length - 1; F++)
1824
+ ne[F] = ne[F + 1];
1825
+ ne.pop();
1826
+ const re = {};
1827
+ ne.forEach((F, te) => {
1828
+ F && (re[`${y.key}_${te}`] = F);
1798
1829
  });
1799
- const se = Math.max(j ? oe.length : oe.length + 1, 1);
1800
- i.current.querySelectorAll(
1830
+ const ie = Math.max(N ? ne.length : ne.length + 1, 1);
1831
+ o.current.querySelectorAll(
1801
1832
  '[data-type="variable"]'
1802
- ).forEach((K) => {
1803
- const le = K.dataset.key, pe = K.dataset.multiKey;
1804
- if (le && pe !== y.key) {
1805
- const me = K.innerText.replace(/[\u200B\n]/g, "").trim();
1806
- me && (te[le] = me);
1833
+ ).forEach((F) => {
1834
+ const te = F.dataset.key, de = F.dataset.multiKey;
1835
+ if (te && de !== y.key) {
1836
+ const Y = F.innerText.replace(/[\u200B\n]/g, "").trim();
1837
+ Y && (re[te] = Y);
1807
1838
  }
1808
- }), i.current.__tempVariableValues = te, k((K) => ({
1809
- ...K,
1810
- [y.key]: se
1839
+ }), o.current.__tempVariableValues = re, T((F) => ({
1840
+ ...F,
1841
+ [y.key]: ie
1811
1842
  }));
1812
1843
  return;
1813
1844
  }
1814
- if (!j) {
1815
- const z = $ - 1, oe = `${y.key}_${z}`, te = i.current.querySelector(
1816
- `[data-type="variable"][data-key="${oe}"][data-multi-key="${y.key}"]`
1845
+ if (!N) {
1846
+ const M = C - 1, ne = `${y.key}_${M}`, re = o.current.querySelector(
1847
+ `[data-type="variable"][data-key="${ne}"][data-multi-key="${y.key}"]`
1817
1848
  );
1818
- if (te && te.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && $ < b) {
1819
- const ce = window.getSelection();
1820
- if (ce && ce.rangeCount > 0) {
1821
- const K = ce.getRangeAt(0), le = K.startContainer, pe = le.nodeType === Node.ELEMENT_NODE ? le.closest('[data-type="variable"][data-multi-key]') : le.parentElement?.closest('[data-type="variable"][data-multi-key]');
1822
- if (pe) {
1823
- const me = pe.dataset.key;
1824
- if (me) {
1825
- const ge = document.createRange();
1826
- ge.setStartBefore(pe), ge.setEnd(K.startContainer, K.startOffset);
1827
- const ke = ge.toString().length;
1828
- W.current = { key: me, offset: ke };
1849
+ if (re && re.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && C < h) {
1850
+ const le = window.getSelection();
1851
+ if (le && le.rangeCount > 0) {
1852
+ const F = le.getRangeAt(0), te = F.startContainer, de = te.nodeType === Node.ELEMENT_NODE ? te.closest('[data-type="variable"][data-multi-key]') : te.parentElement?.closest('[data-type="variable"][data-multi-key]');
1853
+ if (de) {
1854
+ const Y = de.dataset.key;
1855
+ if (Y) {
1856
+ const se = document.createRange();
1857
+ se.setStartBefore(de), se.setEnd(F.startContainer, F.startOffset);
1858
+ const fe = se.toString().length;
1859
+ U.current = { key: Y, offset: fe };
1829
1860
  }
1830
1861
  }
1831
1862
  }
1832
- k((K) => ({
1833
- ...K,
1834
- [y.key]: $ + 1
1863
+ T((F) => ({
1864
+ ...F,
1865
+ [y.key]: C + 1
1835
1866
  }));
1836
1867
  }
1837
1868
  }
1838
1869
  });
1839
- }, fe = () => {
1840
- if (i.current) {
1870
+ };
1871
+ oe(() => {
1872
+ const f = o.current;
1873
+ if (!f) return;
1874
+ const y = (h) => {
1875
+ const C = h.target;
1876
+ if (!C || !o.current || !o.current.contains(C))
1877
+ return;
1878
+ const v = h.relatedTarget, E = !v || !o.current.contains(v);
1879
+ if (console.log("[Blur Event] 事件触发:", {
1880
+ target: C,
1881
+ relatedTarget: v,
1882
+ isReallyBlurred: E,
1883
+ activeElement: document.activeElement,
1884
+ targetTagName: C.tagName,
1885
+ targetClassName: C.className
1886
+ }), !E) {
1887
+ console.log("[Blur Event] 焦点仍在编辑器内,跳过处理");
1888
+ return;
1889
+ }
1890
+ const N = C.closest('[data-type="variable"][data-multi-key]');
1891
+ if (N && o.current.contains(N)) {
1892
+ const R = N.dataset.multiKey, j = N.dataset.key, M = N.dataset.index;
1893
+ if (R && j && M !== void 0) {
1894
+ const ne = N.innerText.replace(/[\u200B\n]/g, "").trim();
1895
+ console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
1896
+ multiKey: R,
1897
+ currentKey: j,
1898
+ index: M,
1899
+ content: ne
1900
+ });
1901
+ const re = /[、,,\s]+/;
1902
+ if (re.test(ne)) {
1903
+ const ie = ne.split(re).map((te) => te.trim()).filter((te) => te.length > 0);
1904
+ console.log("[Blur Event] 拆分前的内容:", ne), console.log("[Blur Event] 拆分后的部分:", ie);
1905
+ const F = ie.slice(0, 9);
1906
+ if (console.log("[Blur Event] 有效的部分(最多9个):", F), F.length > 1) {
1907
+ const te = t.find((de) => de.type === "multi-variable" && de.key === R);
1908
+ if (te) {
1909
+ const de = Z[R] || 1, Y = parseInt(M, 10), se = te.maxCount || 9, fe = [];
1910
+ for (let ge = 0; ge < de; ge++) {
1911
+ const we = `${R}_${ge}`, Te = o.current.querySelector(
1912
+ `[data-type="variable"][data-key="${we}"][data-multi-key="${R}"]`
1913
+ );
1914
+ if (Te) {
1915
+ const Ne = Te.innerText.replace(/[\u200B\n]/g, "").trim();
1916
+ fe.push(Ne);
1917
+ }
1918
+ }
1919
+ console.log("[Blur Event] 拆分前的所有值:", fe), console.log("[Blur Event] 当前索引:", Y), console.log("[Blur Event] 要插入的值:", F), fe.splice(Y, 1, ...F);
1920
+ const me = fe.slice(0, se);
1921
+ console.log("[Blur Event] 拆分后的所有值:", me), me.length > 0 && me[me.length - 1] !== "" && me.length < se && me.push("");
1922
+ const We = Math.max(me.length, 1), Ae = {};
1923
+ me.forEach((ge, we) => {
1924
+ ge && (Ae[`${R}_${we}`] = ge);
1925
+ }), o.current.querySelectorAll(
1926
+ '[data-type="variable"]'
1927
+ ).forEach((ge) => {
1928
+ const we = ge.dataset.key, Te = ge.dataset.multiKey;
1929
+ if (we && Te !== R) {
1930
+ const Ne = ge.innerText.replace(/[\u200B\n]/g, "").trim();
1931
+ Ne && (Ae[we] = Ne);
1932
+ }
1933
+ }), o.current.__tempVariableValues = Ae, T((ge) => ({
1934
+ ...ge,
1935
+ [R]: We
1936
+ }));
1937
+ }
1938
+ }
1939
+ }
1940
+ }
1941
+ }
1942
+ };
1943
+ return f.addEventListener("blur", y, !0), () => {
1944
+ f.removeEventListener("blur", y, !0);
1945
+ };
1946
+ }, [t, Z]);
1947
+ const ve = () => {
1948
+ if (o.current) {
1841
1949
  if (t.length === 0) {
1842
- const f = i.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1843
- P(f.length > 0);
1950
+ const f = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1951
+ B(f.length > 0);
1844
1952
  return;
1845
1953
  }
1846
- Te(i), Ne(i, t, c), Ce(i, t, c, P);
1954
+ $e(o), _e(o, t, c), je(o, t, c, B);
1847
1955
  }
1848
- }, Ee = (f) => {
1849
- if (r) {
1956
+ }, qe = (f) => {
1957
+ if (a) {
1850
1958
  f.preventDefault();
1851
1959
  return;
1852
1960
  }
1853
1961
  const y = window.getSelection();
1854
1962
  if (y && y.rangeCount > 0) {
1855
- const b = y.anchorNode;
1856
- let $ = null;
1857
- if (b && (b.nodeType === Node.ELEMENT_NODE ? $ = b.closest('[data-type="text"]') : b.nodeType === Node.TEXT_NODE && b.parentElement && ($ = b.parentElement.closest('[data-type="text"]'))), $) {
1858
- if (f.preventDefault(), f.stopPropagation(), i.current) {
1859
- const E = i.current.querySelector(
1963
+ const h = y.anchorNode;
1964
+ let C = null;
1965
+ if (h && (h.nodeType === Node.ELEMENT_NODE ? C = h.closest('[data-type="text"]') : h.nodeType === Node.TEXT_NODE && h.parentElement && (C = h.parentElement.closest('[data-type="text"]'))), C) {
1966
+ if (f.preventDefault(), f.stopPropagation(), o.current) {
1967
+ const v = o.current.querySelector(
1860
1968
  '[data-type="variable"], [data-type="upload"]'
1861
1969
  );
1862
- E && E.focus();
1970
+ v && v.focus();
1863
1971
  }
1864
1972
  return;
1865
1973
  }
1866
1974
  }
1867
1975
  if (m && y && y.rangeCount > 0) {
1868
- const b = y.anchorNode;
1869
- let $ = null;
1870
- if (b && (b.nodeType === Node.ELEMENT_NODE ? $ = b.closest(".tag-node") : b.nodeType === Node.TEXT_NODE && b.parentElement && ($ = b.parentElement.closest(".tag-node"))), $) {
1871
- if (f.preventDefault(), f.stopPropagation(), i.current) {
1872
- const E = i.current.querySelector(
1976
+ const h = y.anchorNode;
1977
+ let C = null;
1978
+ if (h && (h.nodeType === Node.ELEMENT_NODE ? C = h.closest(".tag-node") : h.nodeType === Node.TEXT_NODE && h.parentElement && (C = h.parentElement.closest(".tag-node"))), C) {
1979
+ if (f.preventDefault(), f.stopPropagation(), o.current) {
1980
+ const v = o.current.querySelector(
1873
1981
  '[data-type="variable"], [data-type="upload"]'
1874
1982
  );
1875
- E && E.focus();
1983
+ v && v.focus();
1876
1984
  }
1877
1985
  return;
1878
1986
  }
1879
1987
  }
1880
- if (f.key === "Enter" && !f.shiftKey && (f.preventDefault(), je()), f.key === "Escape" && i.current) {
1988
+ if (f.key === "Enter" && !f.shiftKey && (f.preventDefault(), Le()), f.key === "Escape" && o.current) {
1881
1989
  if (m) {
1882
1990
  f.preventDefault();
1883
1991
  return;
1884
1992
  }
1885
- i.current.innerHTML = "", i.current.focus();
1993
+ o.current.innerHTML = "", o.current.focus();
1886
1994
  }
1887
1995
  if (f.key === "Backspace") {
1888
- const b = window.getSelection();
1889
- if (b && b.rangeCount > 0) {
1890
- const $ = b.getRangeAt(0), E = b.anchorNode;
1996
+ const h = window.getSelection();
1997
+ if (h && h.rangeCount > 0) {
1998
+ const C = h.getRangeAt(0), v = h.anchorNode;
1891
1999
  if (m) {
1892
- let j = null, B = null;
1893
- if (E && (E.nodeType === Node.ELEMENT_NODE ? (j = E.closest(".tag-node"), B = E.closest('[data-type="text"]')) : E.nodeType === Node.TEXT_NODE && E.parentElement && (j = E.parentElement.closest(".tag-node"), B = E.parentElement.closest('[data-type="text"]'))), (j || B) && $.collapsed && $.startOffset === 0) {
2000
+ let N = null, R = null;
2001
+ if (v && (v.nodeType === Node.ELEMENT_NODE ? (N = v.closest(".tag-node"), R = v.closest('[data-type="text"]')) : v.nodeType === Node.TEXT_NODE && v.parentElement && (N = v.parentElement.closest(".tag-node"), R = v.parentElement.closest('[data-type="text"]'))), (N || R) && C.collapsed && C.startOffset === 0) {
1894
2002
  f.preventDefault();
1895
2003
  return;
1896
2004
  }
1897
2005
  }
1898
- let A = null;
1899
- if (E && (E.nodeType === Node.ELEMENT_NODE ? A = E.closest(
2006
+ let E = null;
2007
+ if (v && (v.nodeType === Node.ELEMENT_NODE ? E = v.closest(
1900
2008
  '[data-type="variable"]'
1901
- ) : E.nodeType === Node.TEXT_NODE && E.parentElement && (A = E.parentElement.closest(
2009
+ ) : v.nodeType === Node.TEXT_NODE && v.parentElement && (E = v.parentElement.closest(
1902
2010
  '[data-type="variable"]'
1903
- ))), A) {
1904
- if (!$.collapsed)
2011
+ ))), E) {
2012
+ if (!C.collapsed)
1905
2013
  return;
1906
- const j = A.innerText;
1907
- if (j === "​" || j === "") {
2014
+ const N = E.innerText;
2015
+ if (N === "​" || N === "") {
1908
2016
  f.preventDefault();
1909
2017
  return;
1910
2018
  }
1911
- if ($.startOffset === 0) {
2019
+ if (C.startOffset === 0) {
1912
2020
  f.preventDefault();
1913
2021
  return;
1914
2022
  }
1915
- if (j.startsWith("​") && $.startOffset === 1) {
2023
+ if (N.startsWith("​") && C.startOffset === 1) {
1916
2024
  f.preventDefault();
1917
2025
  return;
1918
2026
  }
1919
2027
  }
1920
2028
  }
1921
2029
  }
1922
- }, je = () => {
1923
- if (o || r || e || !D || !i.current) return;
2030
+ }, Le = () => {
2031
+ if (l || a || e || !D || !o.current) return;
1924
2032
  if (t.length === 0) {
1925
- const A = i.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1926
- if (!A) return;
1927
- p(A, A);
2033
+ const E = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
2034
+ if (!E) return;
2035
+ p(E, E);
1928
2036
  return;
1929
2037
  }
1930
- const f = i.current;
2038
+ const f = o.current;
1931
2039
  let y = "";
1932
- const b = {}, $ = (A) => {
1933
- if (!(A.nodeType === Node.ELEMENT_NODE && A.style.display === "none")) {
1934
- if (A.nodeType === Node.TEXT_NODE)
1935
- y += (A.textContent || "").replace(/\u200B/g, "");
1936
- else if (A.nodeType === Node.ELEMENT_NODE) {
1937
- const j = A, B = j.dataset.type, V = j.dataset.key;
1938
- if (B === "variable" && V) {
1939
- let z = "";
1940
- const oe = document.createTreeWalker(
1941
- j,
2040
+ const h = {}, C = (E) => {
2041
+ if (!(E.nodeType === Node.ELEMENT_NODE && E.style.display === "none")) {
2042
+ if (E.nodeType === Node.TEXT_NODE)
2043
+ y += (E.textContent || "").replace(/\u200B/g, "");
2044
+ else if (E.nodeType === Node.ELEMENT_NODE) {
2045
+ const N = E, R = N.dataset.type, j = N.dataset.key;
2046
+ if (R === "variable" && j) {
2047
+ let M = "";
2048
+ const ne = document.createTreeWalker(
2049
+ N,
1942
2050
  NodeFilter.SHOW_TEXT,
1943
2051
  {
1944
- acceptNode: (se) => {
1945
- const ce = j.querySelector(".variable-info-icon");
1946
- return ce && ce.contains(se) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2052
+ acceptNode: (ie) => {
2053
+ const le = N.querySelector(".variable-info-icon");
2054
+ return le && le.contains(ie) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
1947
2055
  }
1948
2056
  }
1949
2057
  );
1950
- for (; oe.nextNode(); )
1951
- z += oe.currentNode.textContent || "";
1952
- const te = z.replace(/[\u200B\n]/g, "").trim();
1953
- if (te) {
1954
- const se = j.dataset.multiKey;
1955
- if (se) {
1956
- (!b[se] || !Array.isArray(b[se])) && (b[se] = []);
1957
- const ce = b[se];
1958
- ce.push(te), ce.length > 1 && (y += " "), y += te;
2058
+ for (; ne.nextNode(); )
2059
+ M += ne.currentNode.textContent || "";
2060
+ const re = M.replace(/[\u200B\n]/g, "").trim();
2061
+ if (re) {
2062
+ const ie = N.dataset.multiKey;
2063
+ if (ie) {
2064
+ (!h[ie] || !Array.isArray(h[ie])) && (h[ie] = []);
2065
+ const le = h[ie];
2066
+ le.push(re), le.length > 1 && (y += " "), y += re;
1959
2067
  } else
1960
- b[V] = te, y += te;
2068
+ h[j] = re, y += re;
1961
2069
  }
1962
- } else if (B === "upload" && V)
1963
- b[V] = c[V] ?? null, c[V] && (y += ` [附带文件: ${c[V]?.name}] `);
2070
+ } else if (R === "upload" && j)
2071
+ h[j] = c[j] ?? null, c[j] && (y += ` [附带文件: ${c[j]?.name}] `);
1964
2072
  else {
1965
- if (j.classList.contains("tag-close-btn") || j.classList.contains("file-remove-btn")) return;
1966
- j.getAttribute("contenteditable") === "false" && !B && j.classList.contains("tag-node") ? y += j.innerText : j.childNodes.forEach($);
2073
+ if (N.classList.contains("tag-close-btn") || N.classList.contains("file-remove-btn")) return;
2074
+ N.getAttribute("contenteditable") === "false" && !R && N.classList.contains("tag-node") ? y += N.innerText : N.childNodes.forEach(C);
1967
2075
  }
1968
2076
  }
1969
2077
  }
1970
2078
  };
1971
- if (f.childNodes.forEach($), y = y.trim(), !y) return;
1972
- const E = new FormData();
1973
- E.append("fullPrompt", y), Object.keys(b).forEach((A) => {
1974
- const j = b[A];
1975
- j != null && (j instanceof File ? E.append(A, j) : Array.isArray(j) ? t.some(
1976
- (V) => V.type === "multi-variable" && V.key === A
1977
- ) ? j.forEach((V) => {
1978
- V != null && V !== "" && E.append(A, String(V));
1979
- }) : j.forEach((V, z) => {
1980
- V != null && (V instanceof File ? E.append(`${A}[${z}]`, V) : typeof V == "string" ? E.append(`${A}[${z}]`, V) : E.append(`${A}[${z}]`, String(V)));
1981
- }) : typeof j == "string" ? E.append(A, j) : E.append(A, String(j)));
1982
- }), p(E, y);
1983
- }, Be = {
1984
- ...a ? { width: typeof a == "number" ? `${a}px` : a } : {},
2079
+ if (f.childNodes.forEach(C), y = y.trim(), !y) return;
2080
+ const v = new FormData();
2081
+ v.append("fullPrompt", y), Object.keys(h).forEach((E) => {
2082
+ const N = h[E];
2083
+ N != null && (N instanceof File ? v.append(E, N) : Array.isArray(N) ? t.some(
2084
+ (j) => j.type === "multi-variable" && j.key === E
2085
+ ) ? N.forEach((j) => {
2086
+ j != null && j !== "" && v.append(E, String(j));
2087
+ }) : N.forEach((j, M) => {
2088
+ j != null && (j instanceof File ? v.append(`${E}[${M}]`, j) : typeof j == "string" ? v.append(`${E}[${M}]`, j) : v.append(`${E}[${M}]`, String(j)));
2089
+ }) : typeof N == "string" ? v.append(E, N) : v.append(E, String(N)));
2090
+ }), p(v, y);
2091
+ }, He = {
2092
+ ...r ? { width: typeof r == "number" ? `${r}px` : r } : {},
1985
2093
  ...u ? { border: u } : {},
1986
- ...N ? { background: N } : {}
2094
+ ...q ? { background: q } : {}
1987
2095
  };
1988
2096
  return /* @__PURE__ */ n.jsxs(
1989
2097
  "div",
1990
2098
  {
1991
2099
  className: "rich-text-editor",
1992
- style: Be,
1993
- "data-disabled": r,
2100
+ style: He,
2101
+ "data-disabled": a,
1994
2102
  children: [
1995
2103
  /* @__PURE__ */ n.jsx(
1996
2104
  "div",
1997
2105
  {
1998
- ref: i,
1999
- className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${F && x ? "rte-editor-empty" : ""}`,
2106
+ ref: o,
2107
+ className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${H && x ? "rte-editor-empty" : ""}`,
2000
2108
  contentEditable: t.length === 0,
2001
2109
  suppressContentEditableWarning: !0,
2002
2110
  "data-placeholder": x,
2003
- onMouseDown: ue,
2004
- onMouseMove: re,
2005
- onMouseUp: ye,
2111
+ onMouseDown: ye,
2112
+ onMouseMove: ce,
2113
+ onMouseUp: be,
2006
2114
  onClick: O,
2007
- onDoubleClick: M,
2008
- onInput: ae,
2009
- onKeyDown: Ee,
2010
- onPaste: I,
2011
- onBlur: fe
2115
+ onDoubleClick: G,
2116
+ onInput: ue,
2117
+ onKeyDown: qe,
2118
+ onPaste: L,
2119
+ onBlur: ve
2012
2120
  }
2013
2121
  ),
2014
2122
  /* @__PURE__ */ n.jsx(
2015
2123
  "input",
2016
2124
  {
2017
2125
  type: "file",
2018
- ref: T,
2126
+ ref: S,
2019
2127
  className: "rte-file-input",
2020
2128
  accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
2021
- onChange: X
2129
+ onChange: K
2022
2130
  }
2023
2131
  ),
2024
2132
  /* @__PURE__ */ n.jsxs("div", { className: "rich-text-editor-footer", children: [
@@ -2028,11 +2136,11 @@ const qt = ({
2028
2136
  /* @__PURE__ */ n.jsx("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
2029
2137
  ] }),
2030
2138
  d !== "hideAgent" && /* @__PURE__ */ n.jsx(
2031
- We,
2139
+ Ze,
2032
2140
  {
2033
2141
  placement: "top",
2034
2142
  menu: {
2035
- items: C.map((f) => ({
2143
+ items: A.map((f) => ({
2036
2144
  key: f.key,
2037
2145
  label: /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
2038
2146
  f.icon && /* @__PURE__ */ n.jsx("i", { className: f.icon }),
@@ -2044,8 +2152,8 @@ const qt = ({
2044
2152
  }))
2045
2153
  },
2046
2154
  trigger: ["click"],
2047
- disabled: r || o,
2048
- children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor: C.length > 0 ? "pointer" : "default" }, children: [
2155
+ disabled: a || l,
2156
+ children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor: A.length > 0 ? "pointer" : "default" }, children: [
2049
2157
  /* @__PURE__ */ n.jsx("i", { className: "iconfont icon-zhinengti" }),
2050
2158
  /* @__PURE__ */ n.jsx("span", { className: "rte-agent-text", children: "智能体" })
2051
2159
  ] })
@@ -2056,22 +2164,22 @@ const qt = ({
2056
2164
  "button",
2057
2165
  {
2058
2166
  type: "button",
2059
- onClick: je,
2060
- disabled: o || r || e || !D,
2167
+ onClick: Le,
2168
+ disabled: l || a || e || !D,
2061
2169
  className: "rich-text-editor-send-button",
2062
- children: o || e ? /* @__PURE__ */ n.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ n.jsx("i", { className: "iconfont icon-fasong" })
2170
+ children: l || e ? /* @__PURE__ */ n.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ n.jsx("i", { className: "iconfont icon-fasong" })
2063
2171
  }
2064
2172
  )
2065
2173
  ] }),
2066
- h?.anchorEl && (() => {
2067
- if (!document.body.contains(h.anchorEl))
2174
+ b?.anchorEl && (() => {
2175
+ if (!document.body.contains(b.anchorEl))
2068
2176
  return null;
2069
2177
  let f = "";
2070
- return h.type === "upload" ? f = t.find(
2071
- (b) => b.type === "upload" && b.key === h.key
2072
- )?.tooltip || "" : h.type === "tag" ? f = h.anchorEl.dataset.tooltip || "" : h.type === "upload-label" ? f = h.anchorEl.dataset.fileName || "" : h.type === "variable" && (f = h.anchorEl.dataset.tooltip || ""), ot(
2178
+ return b.type === "upload" ? f = t.find(
2179
+ (h) => h.type === "upload" && h.key === b.key
2180
+ )?.tooltip || "" : b.type === "tag" ? f = b.anchorEl.dataset.tooltip || "" : b.type === "upload-label" ? f = b.anchorEl.dataset.fileName || "" : b.type === "variable" && (f = b.anchorEl.dataset.tooltip || ""), pt(
2073
2181
  /* @__PURE__ */ n.jsx(
2074
- Ue,
2182
+ et,
2075
2183
  {
2076
2184
  arrow: !1,
2077
2185
  title: /* @__PURE__ */ n.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children: f }),
@@ -2086,10 +2194,10 @@ const qt = ({
2086
2194
  {
2087
2195
  style: {
2088
2196
  position: "fixed",
2089
- left: `${h.anchorEl.getBoundingClientRect().left}px`,
2090
- top: `${h.anchorEl.getBoundingClientRect().top}px`,
2091
- width: `${h.anchorEl.offsetWidth}px`,
2092
- height: `${h.anchorEl.offsetHeight}px`,
2197
+ left: `${b.anchorEl.getBoundingClientRect().left}px`,
2198
+ top: `${b.anchorEl.getBoundingClientRect().top}px`,
2199
+ width: `${b.anchorEl.offsetWidth}px`,
2200
+ height: `${b.anchorEl.offsetHeight}px`,
2093
2201
  pointerEvents: "none"
2094
2202
  }
2095
2203
  }
@@ -2103,7 +2211,7 @@ const qt = ({
2103
2211
  }
2104
2212
  );
2105
2213
  };
2106
- qt.__docgenInfo = {
2214
+ Vt.__docgenInfo = {
2107
2215
  displayName: "RichTextEditor",
2108
2216
  description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
2109
2217
  props: {
@@ -2131,33 +2239,33 @@ qt.__docgenInfo = {
2131
2239
  }
2132
2240
  }
2133
2241
  };
2134
- const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", At = [
2242
+ const De = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Lt = [
2135
2243
  { label: "5页", value: 5 },
2136
2244
  { label: "10页", value: 10 },
2137
2245
  { label: "15页", value: 15 },
2138
2246
  { label: "30页", value: 30 }
2139
- ], jt = ({
2247
+ ], Pt = ({
2140
2248
  autoLoading: t,
2141
2249
  batchSize: p,
2142
- loadingProgress: o,
2143
- loadIcon: r,
2144
- onBatchSizeChange: a,
2250
+ loadingProgress: l,
2251
+ loadIcon: a,
2252
+ onBatchSizeChange: r,
2145
2253
  onLoadNextPage: m,
2146
- onStartAutoLoad: C,
2254
+ onStartAutoLoad: A,
2147
2255
  onStopLoad: g
2148
- }) => t && o ? /* @__PURE__ */ n.jsxs("div", { className: "auto_load_progress", children: [
2149
- r || /* @__PURE__ */ n.jsx("img", { src: Le, alt: "自动加载", width: 14, height: 14 }),
2256
+ }) => t && l ? /* @__PURE__ */ n.jsxs("div", { className: "auto_load_progress", children: [
2257
+ a || /* @__PURE__ */ n.jsx("img", { src: De, alt: "自动加载", width: 14, height: 14 }),
2150
2258
  /* @__PURE__ */ n.jsxs("span", { children: [
2151
2259
  "正在加载第",
2152
- o.currentPage,
2260
+ l.currentPage,
2153
2261
  "/",
2154
- o.totalPages,
2262
+ l.totalPages,
2155
2263
  "页"
2156
2264
  ] }),
2157
2265
  /* @__PURE__ */ n.jsx(
2158
- Xe,
2266
+ tt,
2159
2267
  {
2160
- percent: o.percentage,
2268
+ percent: l.percentage,
2161
2269
  type: "line",
2162
2270
  size: [160, 8]
2163
2271
  }
@@ -2187,19 +2295,19 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2187
2295
  "div",
2188
2296
  {
2189
2297
  className: "auto_load_btn",
2190
- onClick: t ? void 0 : C,
2298
+ onClick: t ? void 0 : A,
2191
2299
  children: [
2192
- r || /* @__PURE__ */ n.jsx("img", { src: Le, alt: "自动加载", width: 14, height: 14 }),
2300
+ a || /* @__PURE__ */ n.jsx("img", { src: De, alt: "自动加载", width: 14, height: 14 }),
2193
2301
  /* @__PURE__ */ n.jsx("span", { children: "自动加载" })
2194
2302
  ]
2195
2303
  }
2196
2304
  ),
2197
2305
  /* @__PURE__ */ n.jsx(
2198
- Ae,
2306
+ Ve,
2199
2307
  {
2200
2308
  value: p,
2201
- onChange: a,
2202
- options: At,
2309
+ onChange: r,
2310
+ options: Lt,
2203
2311
  disabled: t,
2204
2312
  size: "small",
2205
2313
  className: "auto_load_select",
@@ -2209,36 +2317,36 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2209
2317
  ]
2210
2318
  }
2211
2319
  )
2212
- ] }), $t = ({
2320
+ ] }), Bt = ({
2213
2321
  current: t,
2214
2322
  loadIcon: p,
2215
- pageSize: o,
2216
- total: r,
2217
- cachedPages: a,
2323
+ pageSize: l,
2324
+ total: a,
2325
+ cachedPages: r,
2218
2326
  loadedCount: m,
2219
- autoLoading: C = !1,
2327
+ autoLoading: A = !1,
2220
2328
  loadingProgress: g,
2221
- onChange: l,
2329
+ onChange: i,
2222
2330
  onLoadNextPage: e,
2223
2331
  onStartAutoLoad: x,
2224
2332
  onStopLoading: u
2225
2333
  }) => {
2226
- const [N, d] = Y(5), i = Math.ceil(r / o), T = Ve(() => a.length >= i, [a, i]), c = () => Array.from(
2227
- { length: i },
2228
- (S, h) => h + 1
2229
- ).filter((S) => !a.includes(S)).slice(0, N), v = (w, S, h) => {
2230
- const R = a.includes(w);
2231
- return S === "prev" || S === "next" || S === "jump-prev" || S === "jump-next" ? /* @__PURE__ */ n.jsx("div", { className: "pageBox", children: h }) : /* @__PURE__ */ n.jsxs(
2334
+ const [q, d] = J(5), o = Math.ceil(a / l), S = Ge(() => r.length >= o, [r, o]), c = () => Array.from(
2335
+ { length: o },
2336
+ ($, b) => b + 1
2337
+ ).filter(($) => !r.includes($)).slice(0, q), w = (k, $, b) => {
2338
+ const V = r.includes(k);
2339
+ return $ === "prev" || $ === "next" || $ === "jump-prev" || $ === "jump-next" ? /* @__PURE__ */ n.jsx("div", { className: "pageBox", children: b }) : /* @__PURE__ */ n.jsxs(
2232
2340
  "div",
2233
2341
  {
2234
2342
  className: "pageBox",
2235
2343
  style: {
2236
- backgroundColor: t === w ? "#2563EB" : "#f5f5f5",
2237
- color: t === w ? "#fff" : R ? "#171717" : "#a3a3a3"
2344
+ backgroundColor: t === k ? "#2563EB" : "#f5f5f5",
2345
+ color: t === k ? "#fff" : V ? "#171717" : "#a3a3a3"
2238
2346
  },
2239
2347
  children: [
2240
- w,
2241
- !R && /* @__PURE__ */ n.jsx("span", { className: "unload_spot" })
2348
+ k,
2349
+ !V && /* @__PURE__ */ n.jsx("span", { className: "unload_spot" })
2242
2350
  ]
2243
2351
  }
2244
2352
  );
@@ -2247,7 +2355,7 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2247
2355
  /* @__PURE__ */ n.jsxs("div", { className: "pagination_leftWrap", children: [
2248
2356
  /* @__PURE__ */ n.jsxs("span", { className: "pagination_total", children: [
2249
2357
  /* @__PURE__ */ n.jsx(
2250
- tt,
2358
+ it,
2251
2359
  {
2252
2360
  style: { color: "#2563EB", marginRight: "4px" }
2253
2361
  }
@@ -2255,97 +2363,97 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
2255
2363
  "已加载: ",
2256
2364
  m,
2257
2365
  "/",
2258
- r,
2366
+ a,
2259
2367
  "条数据"
2260
2368
  ] }),
2261
- !T && /* @__PURE__ */ n.jsx(
2262
- jt,
2369
+ !S && /* @__PURE__ */ n.jsx(
2370
+ Pt,
2263
2371
  {
2264
2372
  loadIcon: p || void 0,
2265
- autoLoading: C,
2266
- batchSize: N,
2373
+ autoLoading: A,
2374
+ batchSize: q,
2267
2375
  loadingProgress: g,
2268
2376
  disabled: !e || !x,
2269
2377
  onBatchSizeChange: d,
2270
2378
  onLoadNextPage: () => e?.(),
2271
2379
  onStartAutoLoad: () => {
2272
- const w = c();
2273
- x?.(w);
2380
+ const k = c();
2381
+ x?.(k);
2274
2382
  },
2275
2383
  onStopLoad: () => u?.()
2276
2384
  }
2277
2385
  )
2278
2386
  ] }),
2279
2387
  /* @__PURE__ */ n.jsx(
2280
- Ye,
2388
+ nt,
2281
2389
  {
2282
2390
  current: t,
2283
- pageSize: o,
2284
- total: r,
2285
- onChange: (w) => l(w),
2391
+ pageSize: l,
2392
+ total: a,
2393
+ onChange: (k) => i(k),
2286
2394
  showSizeChanger: !1,
2287
2395
  showQuickJumper: !1,
2288
- showTotal: (w, S) => "",
2289
- itemRender: v
2396
+ showTotal: (k, $) => "",
2397
+ itemRender: w
2290
2398
  }
2291
2399
  )
2292
2400
  ] });
2293
- }, _t = (t) => {
2401
+ }, Ot = (t) => {
2294
2402
  const {
2295
2403
  loading: p,
2296
- autoLoading: o,
2297
- loadingProgress: r,
2298
- columns: a = [],
2404
+ autoLoading: l,
2405
+ loadingProgress: a,
2406
+ columns: r = [],
2299
2407
  dataSource: m = [],
2300
- total: C,
2408
+ total: A,
2301
2409
  current: g,
2302
- pageSize: l,
2410
+ pageSize: i,
2303
2411
  cachedPages: e,
2304
2412
  onChangePage: x,
2305
2413
  onLoadNextPage: u,
2306
- onStartAutoLoad: N,
2414
+ onStartAutoLoad: q,
2307
2415
  onStopLoading: d,
2308
- ...i
2309
- } = t, T = G(null), c = H(
2310
- (v) => {
2311
- x(v), e.includes(v) && T.current?.scrollTo({
2312
- key: `${(v - 1) * l + 1}`
2416
+ ...o
2417
+ } = t, S = z(null), c = W(
2418
+ (w) => {
2419
+ x(w), e.includes(w) && S.current?.scrollTo({
2420
+ key: `${(w - 1) * i + 1}`
2313
2421
  });
2314
2422
  },
2315
2423
  [g]
2316
2424
  );
2317
2425
  return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col", children: [
2318
2426
  /* @__PURE__ */ n.jsx(
2319
- qe,
2427
+ Ie,
2320
2428
  {
2321
- ref: T,
2322
- ...i,
2323
- columns: a,
2429
+ ref: S,
2430
+ ...o,
2431
+ columns: r,
2324
2432
  dataSource: m,
2325
2433
  pagination: !1,
2326
2434
  virtual: !0
2327
2435
  }
2328
2436
  ),
2329
2437
  /* @__PURE__ */ n.jsx(
2330
- $t,
2438
+ Bt,
2331
2439
  {
2332
2440
  loading: p,
2333
- autoLoading: o,
2334
- loadingProgress: r,
2441
+ autoLoading: l,
2442
+ loadingProgress: a,
2335
2443
  current: g,
2336
- pageSize: l,
2337
- total: C,
2444
+ pageSize: i,
2445
+ total: A,
2338
2446
  loadedCount: m.length,
2339
2447
  cachedPages: e,
2340
2448
  onChange: c,
2341
2449
  onLoadNextPage: u,
2342
- onStartAutoLoad: N,
2450
+ onStartAutoLoad: q,
2343
2451
  onStopLoading: d
2344
2452
  }
2345
2453
  )
2346
2454
  ] });
2347
2455
  };
2348
- _t.__docgenInfo = {
2456
+ Ot.__docgenInfo = {
2349
2457
  displayName: "VirtualTable",
2350
2458
  description: "虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",
2351
2459
  props: {
@@ -2452,79 +2560,79 @@ _t.__docgenInfo = {
2452
2560
  }
2453
2561
  }
2454
2562
  };
2455
- const Rt = ({
2563
+ const Mt = ({
2456
2564
  texts: t = [],
2457
2565
  placeholder: p = "请输入内容",
2458
- animationSpeed: o = 100,
2459
- autoPlay: r = !0,
2460
- value: a,
2566
+ animationSpeed: l = 100,
2567
+ autoPlay: a = !0,
2568
+ value: r,
2461
2569
  onChange: m,
2462
- ...C
2570
+ ...A
2463
2571
  }) => {
2464
- const [g, l] = Y(""), [e, x] = Y(0), [u, N] = Y(!1), [d, i] = Y(!1), [T, c] = Y(!1), v = G(void 0), w = G(void 0), S = G(t), h = G(e), R = G(d), q = G(g);
2465
- ne(() => {
2466
- S.current = t, h.current = e, R.current = d, q.current = g;
2572
+ const [g, i] = J(""), [e, x] = J(0), [u, q] = J(!1), [d, o] = J(!1), [S, c] = J(!1), w = z(void 0), k = z(void 0), $ = z(t), b = z(e), V = z(d), _ = z(g);
2573
+ oe(() => {
2574
+ $.current = t, b.current = e, V.current = d, _.current = g;
2467
2575
  });
2468
- const L = H((k, _) => {
2469
- let J = 0;
2576
+ const P = W((T, I) => {
2577
+ let Q = 0;
2470
2578
  c(!0);
2579
+ const ee = () => {
2580
+ Q < T.length ? (i(T.slice(0, Q + 1)), Q++, k.current = window.setTimeout(ee, l)) : (c(!1), I?.());
2581
+ };
2582
+ ee();
2583
+ }, [l]), D = W((T) => {
2584
+ let I = _.current.length;
2471
2585
  const Q = () => {
2472
- J < k.length ? (l(k.slice(0, J + 1)), J++, w.current = window.setTimeout(Q, o)) : (c(!1), _?.());
2586
+ I > 0 ? (i(_.current.slice(0, I - 1)), I--, k.current = window.setTimeout(Q, l / 2)) : T?.();
2473
2587
  };
2474
2588
  Q();
2475
- }, [o]), D = H((k) => {
2476
- let _ = q.current.length;
2477
- const J = () => {
2478
- _ > 0 ? (l(q.current.slice(0, _ - 1)), _--, w.current = window.setTimeout(J, o / 2)) : k?.();
2479
- };
2480
- J();
2481
- }, [o]), P = H(() => {
2482
- if (S.current.length === 0 || R.current) return;
2483
- N(!0);
2484
- const k = S.current[h.current];
2485
- q.current ? D(() => {
2486
- L(k, () => {
2487
- v.current = window.setTimeout(() => {
2488
- x((_) => (_ + 1) % S.current.length), N(!1);
2589
+ }, [l]), B = W(() => {
2590
+ if ($.current.length === 0 || V.current) return;
2591
+ q(!0);
2592
+ const T = $.current[b.current];
2593
+ _.current ? D(() => {
2594
+ P(T, () => {
2595
+ w.current = window.setTimeout(() => {
2596
+ x((I) => (I + 1) % $.current.length), q(!1);
2489
2597
  }, 2e3);
2490
2598
  });
2491
- }) : L(k, () => {
2492
- v.current = window.setTimeout(() => {
2493
- x((_) => (_ + 1) % S.current.length), N(!1);
2599
+ }) : P(T, () => {
2600
+ w.current = window.setTimeout(() => {
2601
+ x((I) => (I + 1) % $.current.length), q(!1);
2494
2602
  }, 2e3);
2495
2603
  });
2496
- }, [D, L]);
2497
- ne(() => (r && t.length > 0 && !d && P(), () => {
2498
- v.current && window.clearTimeout(v.current), w.current && window.clearTimeout(w.current);
2499
- }), [e, d, r, t.length, P]), ne(() => {
2500
- !u && r && t.length > 0 && !d && P();
2501
- }, [e, u, r, t.length, d, P]);
2502
- const W = (k) => {
2503
- i(!0), v.current && window.clearTimeout(v.current), w.current && window.clearTimeout(w.current), N(!1), c(!1), C.onFocus?.(k);
2504
- }, F = (k) => {
2505
- i(!1), !a && t.length > 0 && (l(""), x(0)), C.onBlur?.(k);
2506
- }, U = (k) => {
2507
- m?.(k.target.value), C.onChange?.(k);
2508
- }, Z = () => d || a ? p : g || p;
2604
+ }, [D, P]);
2605
+ oe(() => (a && t.length > 0 && !d && B(), () => {
2606
+ w.current && window.clearTimeout(w.current), k.current && window.clearTimeout(k.current);
2607
+ }), [e, d, a, t.length, B]), oe(() => {
2608
+ !u && a && t.length > 0 && !d && B();
2609
+ }, [e, u, a, t.length, d, B]);
2610
+ const U = (T) => {
2611
+ o(!0), w.current && window.clearTimeout(w.current), k.current && window.clearTimeout(k.current), q(!1), c(!1), A.onFocus?.(T);
2612
+ }, H = (T) => {
2613
+ o(!1), !r && t.length > 0 && (i(""), x(0)), A.onBlur?.(T);
2614
+ }, X = (T) => {
2615
+ m?.(T.target.value), A.onChange?.(T);
2616
+ }, Z = () => d || r ? p : g || p;
2509
2617
  return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
2510
2618
  /* @__PURE__ */ n.jsx(
2511
- Pe,
2619
+ Fe,
2512
2620
  {
2513
- ...C,
2514
- value: a,
2515
- onChange: U,
2516
- onFocus: W,
2517
- onBlur: F,
2621
+ ...A,
2622
+ value: r,
2623
+ onChange: X,
2624
+ onFocus: U,
2625
+ onBlur: H,
2518
2626
  placeholder: Z(),
2519
2627
  style: {
2520
2628
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2521
- ...C.style,
2629
+ ...A.style,
2522
2630
  position: "relative",
2523
2631
  zIndex: 1
2524
2632
  }
2525
2633
  }
2526
2634
  ),
2527
- !d && !a && g && /* @__PURE__ */ n.jsxs(
2635
+ !d && !r && g && /* @__PURE__ */ n.jsxs(
2528
2636
  "div",
2529
2637
  {
2530
2638
  style: {
@@ -2545,7 +2653,7 @@ const Rt = ({
2545
2653
  },
2546
2654
  children: [
2547
2655
  /* @__PURE__ */ n.jsx("span", { children: g }),
2548
- T && /* @__PURE__ */ n.jsx(
2656
+ S && /* @__PURE__ */ n.jsx(
2549
2657
  "span",
2550
2658
  {
2551
2659
  style: {
@@ -2569,7 +2677,7 @@ const Rt = ({
2569
2677
  ` })
2570
2678
  ] });
2571
2679
  };
2572
- Rt.__docgenInfo = {
2680
+ Mt.__docgenInfo = {
2573
2681
  displayName: "DynamicInput",
2574
2682
  description: "动态文案输入框组件,支持流式文字动画效果",
2575
2683
  props: {
@@ -2614,24 +2722,24 @@ Rt.__docgenInfo = {
2614
2722
  }
2615
2723
  }
2616
2724
  };
2617
- const It = ({
2725
+ const Dt = ({
2618
2726
  texts: t = [],
2619
2727
  // 动态文案数组,默认为空数组
2620
2728
  placeholder: p = "请输入内容",
2621
2729
  // 占位符文本
2622
- animationSpeed: o = 100,
2730
+ animationSpeed: l = 100,
2623
2731
  // 打字机动画速度,毫秒
2624
- autoPlay: r = !0,
2732
+ autoPlay: a = !0,
2625
2733
  // 是否自动播放动画
2626
- value: a = "",
2734
+ value: r = "",
2627
2735
  // 受控模式的值
2628
2736
  onChange: m,
2629
2737
  // 受控模式的变化回调
2630
- onSubmit: C,
2738
+ onSubmit: A,
2631
2739
  // 提交回调
2632
2740
  maxLength: g = 500,
2633
2741
  // 最大字符数限制
2634
- showCount: l = !0,
2742
+ showCount: i = !0,
2635
2743
  // 是否显示字数统计
2636
2744
  submitText: e = "发送",
2637
2745
  // 提交按钮文本
@@ -2639,78 +2747,78 @@ const It = ({
2639
2747
  // 是否禁用组件
2640
2748
  rows: u = 4,
2641
2749
  // 文本域行数
2642
- style: N,
2750
+ style: q,
2643
2751
  // 自定义样式
2644
2752
  ...d
2645
2753
  // 其他原生属性
2646
2754
  }) => {
2647
- const [i, T] = Y(""), [c, v] = Y(0), [w, S] = Y(!1), [h, R] = Y(!1), [q, L] = Y(!1), [D, P] = Y(a || ""), W = G(void 0), F = G(void 0), U = G(t), Z = G(c), k = G(h), _ = G(i), J = G(null);
2648
- ne(() => {
2649
- U.current = t, Z.current = c, k.current = h, _.current = i;
2755
+ const [o, S] = J(""), [c, w] = J(0), [k, $] = J(!1), [b, V] = J(!1), [_, P] = J(!1), [D, B] = J(r || ""), U = z(void 0), H = z(void 0), X = z(t), Z = z(c), T = z(b), I = z(o), Q = z(null);
2756
+ oe(() => {
2757
+ X.current = t, Z.current = c, T.current = b, I.current = o;
2650
2758
  });
2651
- const Q = H((O, M) => {
2652
- let ae = 0;
2653
- L(!0);
2654
- const fe = () => {
2655
- ae < O.length ? (T(O.slice(0, ae + 1)), ae++, F.current = window.setTimeout(fe, o)) : (L(!1), M?.());
2759
+ const ee = W((O, G) => {
2760
+ let ue = 0;
2761
+ P(!0);
2762
+ const ve = () => {
2763
+ ue < O.length ? (S(O.slice(0, ue + 1)), ue++, H.current = window.setTimeout(ve, l)) : (P(!1), G?.());
2656
2764
  };
2657
- fe();
2658
- }, [o]), ie = H((O) => {
2659
- let M = _.current.length;
2660
- const ae = () => {
2661
- M > 0 ? (T(_.current.slice(0, M - 1)), M--, F.current = window.setTimeout(ae, o / 2)) : O?.();
2765
+ ve();
2766
+ }, [l]), pe = W((O) => {
2767
+ let G = I.current.length;
2768
+ const ue = () => {
2769
+ G > 0 ? (S(I.current.slice(0, G - 1)), G--, H.current = window.setTimeout(ue, l / 2)) : O?.();
2662
2770
  };
2663
- ae();
2664
- }, [o]), de = H(() => {
2665
- if (U.current.length === 0 || k.current) return;
2666
- S(!0);
2667
- const O = U.current[Z.current];
2668
- _.current ? ie(() => {
2669
- Q(O, () => {
2670
- W.current = window.setTimeout(() => {
2671
- v((M) => (M + 1) % U.current.length), S(!1);
2771
+ ue();
2772
+ }, [l]), he = W(() => {
2773
+ if (X.current.length === 0 || T.current) return;
2774
+ $(!0);
2775
+ const O = X.current[Z.current];
2776
+ I.current ? pe(() => {
2777
+ ee(O, () => {
2778
+ U.current = window.setTimeout(() => {
2779
+ w((G) => (G + 1) % X.current.length), $(!1);
2672
2780
  }, 2e3);
2673
2781
  });
2674
- }) : Q(O, () => {
2675
- W.current = window.setTimeout(() => {
2676
- v((M) => (M + 1) % U.current.length), S(!1);
2782
+ }) : ee(O, () => {
2783
+ U.current = window.setTimeout(() => {
2784
+ w((G) => (G + 1) % X.current.length), $(!1);
2677
2785
  }, 2e3);
2678
2786
  });
2679
- }, [ie, Q]);
2680
- ne(() => (r && t.length > 0 && !h && de(), () => {
2681
- W.current && window.clearTimeout(W.current), F.current && window.clearTimeout(F.current);
2682
- }), [c, h, r, t.length, de]), ne(() => {
2683
- !w && r && t.length > 0 && !h && de();
2684
- }, [c, w, r, t.length, h, de]);
2787
+ }, [pe, ee]);
2788
+ oe(() => (a && t.length > 0 && !b && he(), () => {
2789
+ U.current && window.clearTimeout(U.current), H.current && window.clearTimeout(H.current);
2790
+ }), [c, b, a, t.length, he]), oe(() => {
2791
+ !k && a && t.length > 0 && !b && he();
2792
+ }, [c, k, a, t.length, b, he]);
2685
2793
  const s = (O) => {
2686
- R(!0), W.current && window.clearTimeout(W.current), F.current && window.clearTimeout(F.current), S(!1), L(!1), d.onFocus?.(O);
2687
- }, I = (O) => {
2688
- R(!1), !a && t.length > 0 && (T(""), v(0)), d.onBlur?.(O);
2689
- }, X = (O) => {
2690
- const M = O.target.value;
2691
- g && M.length > g || (m ? m(M) : P(M), d.onChange?.(O));
2692
- }, ee = () => {
2693
- const O = m ? a : D;
2694
- O.trim() && !x && (C?.(O), m || P(""));
2695
- }, ue = (O) => {
2696
- (O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(), ee()), d.onKeyDown?.(O);
2697
- }, re = m ? a : D, ye = x || !re.trim() || (g ? re.length > g : !1);
2698
- return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative", ...N }, children: [
2794
+ V(!0), U.current && window.clearTimeout(U.current), H.current && window.clearTimeout(H.current), $(!1), P(!1), d.onFocus?.(O);
2795
+ }, L = (O) => {
2796
+ V(!1), !r && t.length > 0 && (S(""), w(0)), d.onBlur?.(O);
2797
+ }, K = (O) => {
2798
+ const G = O.target.value;
2799
+ g && G.length > g || (m ? m(G) : B(G), d.onChange?.(O));
2800
+ }, ae = () => {
2801
+ const O = m ? r : D;
2802
+ O.trim() && !x && (A?.(O), m || B(""));
2803
+ }, ye = (O) => {
2804
+ (O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(), ae()), d.onKeyDown?.(O);
2805
+ }, ce = m ? r : D, be = x || !ce.trim() || (g ? ce.length > g : !1);
2806
+ return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative", ...q }, children: [
2699
2807
  /* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
2700
2808
  /* @__PURE__ */ n.jsx(
2701
2809
  "textarea",
2702
2810
  {
2703
- ref: J,
2704
- value: m ? a : D,
2705
- onChange: X,
2811
+ ref: Q,
2812
+ value: m ? r : D,
2813
+ onChange: K,
2706
2814
  onFocus: (O) => {
2707
2815
  O.target.style.borderColor = "#1890ff", O.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", s(O);
2708
2816
  },
2709
2817
  onBlur: (O) => {
2710
- O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none", I(O);
2818
+ O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none", L(O);
2711
2819
  },
2712
- onKeyDown: ue,
2713
- placeholder: h || re ? p : "",
2820
+ onKeyDown: ye,
2821
+ placeholder: b || ce ? p : "",
2714
2822
  maxLength: g,
2715
2823
  rows: u,
2716
2824
  disabled: x,
@@ -2734,7 +2842,7 @@ const It = ({
2734
2842
  ...d
2735
2843
  }
2736
2844
  ),
2737
- !h && !re && i && /* @__PURE__ */ n.jsxs(
2845
+ !b && !ce && o && /* @__PURE__ */ n.jsxs(
2738
2846
  "div",
2739
2847
  {
2740
2848
  style: {
@@ -2756,8 +2864,8 @@ const It = ({
2756
2864
  lineHeight: "1.5"
2757
2865
  },
2758
2866
  children: [
2759
- /* @__PURE__ */ n.jsx("span", { children: i }),
2760
- q && /* @__PURE__ */ n.jsx(
2867
+ /* @__PURE__ */ n.jsx("span", { children: o }),
2868
+ _ && /* @__PURE__ */ n.jsx(
2761
2869
  "span",
2762
2870
  {
2763
2871
  style: {
@@ -2783,13 +2891,13 @@ const It = ({
2783
2891
  zIndex: 3
2784
2892
  },
2785
2893
  children: /* @__PURE__ */ n.jsx(
2786
- he,
2894
+ xe,
2787
2895
  {
2788
2896
  type: "primary",
2789
2897
  size: "small",
2790
- icon: /* @__PURE__ */ n.jsx(nt, {}),
2791
- onClick: ee,
2792
- disabled: ye,
2898
+ icon: /* @__PURE__ */ n.jsx(ct, {}),
2899
+ onClick: ae,
2900
+ disabled: be,
2793
2901
  style: {
2794
2902
  borderRadius: 6,
2795
2903
  minWidth: 32,
@@ -2804,7 +2912,7 @@ const It = ({
2804
2912
  }
2805
2913
  )
2806
2914
  ] }),
2807
- l && /* @__PURE__ */ n.jsxs(
2915
+ i && /* @__PURE__ */ n.jsxs(
2808
2916
  "div",
2809
2917
  {
2810
2918
  style: {
@@ -2814,7 +2922,7 @@ const It = ({
2814
2922
  color: "#999"
2815
2923
  },
2816
2924
  children: [
2817
- re.length,
2925
+ ce.length,
2818
2926
  "/",
2819
2927
  g
2820
2928
  ]
@@ -2828,7 +2936,7 @@ const It = ({
2828
2936
  ` })
2829
2937
  ] });
2830
2938
  };
2831
- It.__docgenInfo = {
2939
+ Dt.__docgenInfo = {
2832
2940
  displayName: "DynamicTextArea",
2833
2941
  description: "动态文案文本域组件,支持流式文字动画效果",
2834
2942
  props: {
@@ -2914,66 +3022,66 @@ It.__docgenInfo = {
2914
3022
  }
2915
3023
  }
2916
3024
  };
2917
- const Oe = ({
3025
+ const ze = ({
2918
3026
  src: t,
2919
3027
  poster: p,
2920
- width: o = 300,
2921
- height: r,
2922
- videoWidth: a,
3028
+ width: l = 300,
3029
+ height: a,
3030
+ videoWidth: r,
2923
3031
  // 参数保留但不使用,由CSS控制
2924
3032
  videoHeight: m,
2925
3033
  // 参数保留但不使用,由CSS控制
2926
- showPlayButton: C = !0,
3034
+ showPlayButton: A = !0,
2927
3035
  autoPlayOnHover: g = !0,
2928
- onClick: l,
3036
+ onClick: i,
2929
3037
  onVideoLoaded: e,
2930
3038
  onVideoPlay: x,
2931
3039
  onVideoPause: u,
2932
- onVideoEnded: N,
3040
+ onVideoEnded: q,
2933
3041
  className: d,
2934
- style: i,
2935
- ...T
3042
+ style: o,
3043
+ ...S
2936
3044
  }) => {
2937
- const c = G(null), [v, w] = Y(!1), [S, h] = Y(!1), [R, q] = Y(!1), L = H(() => {
2938
- c.current && (c.current.play(), w(!0), x?.());
2939
- }, [x]), D = H(() => {
2940
- c.current && (c.current.pause(), w(!1), u?.());
2941
- }, [u]), P = H((Q) => {
2942
- Q.stopPropagation(), v ? D() : L();
2943
- }, [v, L, D]), W = H(() => {
2944
- h(!0), g && !v && L();
2945
- }, [g, v, L]), F = H(() => {
2946
- h(!1), g && v && D();
2947
- }, [g, v, D]), U = H(() => {
2948
- q(!0), e?.();
2949
- }, [e]), Z = H(() => {
2950
- w(!0), x?.();
2951
- }, [x]), k = H(() => {
2952
- w(!1), u?.();
2953
- }, [u]), _ = H(() => {
2954
- w(!1), N?.();
2955
- }, [N]), J = H((Q) => {
2956
- l?.(Q);
2957
- }, [l]);
3045
+ const c = z(null), [w, k] = J(!1), [$, b] = J(!1), [V, _] = J(!1), P = W(() => {
3046
+ c.current && (c.current.play(), k(!0), x?.());
3047
+ }, [x]), D = W(() => {
3048
+ c.current && (c.current.pause(), k(!1), u?.());
3049
+ }, [u]), B = W((ee) => {
3050
+ ee.stopPropagation(), w ? D() : P();
3051
+ }, [w, P, D]), U = W(() => {
3052
+ b(!0), g && !w && P();
3053
+ }, [g, w, P]), H = W(() => {
3054
+ b(!1), g && w && D();
3055
+ }, [g, w, D]), X = W(() => {
3056
+ _(!0), e?.();
3057
+ }, [e]), Z = W(() => {
3058
+ k(!0), x?.();
3059
+ }, [x]), T = W(() => {
3060
+ k(!1), u?.();
3061
+ }, [u]), I = W(() => {
3062
+ k(!1), q?.();
3063
+ }, [q]), Q = W((ee) => {
3064
+ i?.(ee);
3065
+ }, [i]);
2958
3066
  return /* @__PURE__ */ n.jsx(
2959
- Se,
3067
+ Re,
2960
3068
  {
2961
- ...T,
3069
+ ...S,
2962
3070
  className: `video-card ${d || ""}`,
2963
3071
  style: {
2964
- width: o,
2965
- height: r,
3072
+ width: l,
3073
+ height: a,
2966
3074
  padding: 0,
2967
3075
  overflow: "hidden",
2968
- cursor: l ? "pointer" : "default",
3076
+ cursor: i ? "pointer" : "default",
2969
3077
  border: "none",
2970
3078
  borderRadius: 0,
2971
- ...i
3079
+ ...o
2972
3080
  },
2973
3081
  bordered: !1,
2974
- onMouseEnter: W,
2975
- onMouseLeave: F,
2976
- onClick: J,
3082
+ onMouseEnter: U,
3083
+ onMouseLeave: H,
3084
+ onClick: Q,
2977
3085
  children: /* @__PURE__ */ n.jsxs("div", { className: "video-card-container", children: [
2978
3086
  /* @__PURE__ */ n.jsx(
2979
3087
  "video",
@@ -2982,28 +3090,28 @@ const Oe = ({
2982
3090
  src: t,
2983
3091
  poster: p,
2984
3092
  preload: "metadata",
2985
- onLoadedData: U,
3093
+ onLoadedData: X,
2986
3094
  onPlay: Z,
2987
- onPause: k,
2988
- onEnded: _,
3095
+ onPause: T,
3096
+ onEnded: I,
2989
3097
  muted: !0,
2990
3098
  loop: !0
2991
3099
  }
2992
3100
  ),
2993
- C && /* @__PURE__ */ n.jsx(
3101
+ A && /* @__PURE__ */ n.jsx(
2994
3102
  "div",
2995
3103
  {
2996
- className: `video-play-button ${S ? "hovered" : ""}`,
2997
- onClick: P,
2998
- children: v ? /* @__PURE__ */ n.jsx(rt, { className: "play-icon" }) : /* @__PURE__ */ n.jsx(at, { className: "play-icon" })
3104
+ className: `video-play-button ${$ ? "hovered" : ""}`,
3105
+ onClick: B,
3106
+ children: w ? /* @__PURE__ */ n.jsx(ut, { className: "play-icon" }) : /* @__PURE__ */ n.jsx(dt, { className: "play-icon" })
2999
3107
  }
3000
3108
  ),
3001
- !R && /* @__PURE__ */ n.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ n.jsx("div", { className: "loading-spinner" }) })
3109
+ !V && /* @__PURE__ */ n.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ n.jsx("div", { className: "loading-spinner" }) })
3002
3110
  ] })
3003
3111
  }
3004
3112
  );
3005
3113
  };
3006
- Oe.__docgenInfo = {
3114
+ ze.__docgenInfo = {
3007
3115
  displayName: "VideoCard",
3008
3116
  description: "视频卡片组件,支持鼠标悬浮播放控制",
3009
3117
  props: {
@@ -3104,12 +3212,12 @@ Oe.__docgenInfo = {
3104
3212
  }
3105
3213
  }
3106
3214
  };
3107
- const Lt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((o) => t.toLowerCase().includes(o)), Vt = (t) => t.type ? t.type : Lt(t.url) ? "video" : "image", Pt = ({
3215
+ const Gt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((l) => t.toLowerCase().includes(l)), Ft = (t) => t.type ? t.type : Gt(t.url) ? "video" : "image", zt = ({
3108
3216
  items: t,
3109
3217
  columns: p,
3110
- gap: o = 0,
3111
- responsive: r = !0,
3112
- breakpoints: a = {
3218
+ gap: l = 0,
3219
+ responsive: a = !0,
3220
+ breakpoints: r = {
3113
3221
  xs: 1,
3114
3222
  sm: 2,
3115
3223
  md: 3,
@@ -3118,77 +3226,77 @@ const Lt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
3118
3226
  xxl: 6
3119
3227
  },
3120
3228
  className: m,
3121
- style: C,
3229
+ style: A,
3122
3230
  onClick: g
3123
3231
  }) => {
3124
- const l = G(null), [e, x] = Y(p || a.md || 3), u = G(/* @__PURE__ */ new Map()), N = H(() => {
3125
- if (!r || p)
3126
- return p || a.md || 3;
3232
+ const i = z(null), [e, x] = J(p || r.md || 3), u = z(/* @__PURE__ */ new Map()), q = W(() => {
3233
+ if (!a || p)
3234
+ return p || r.md || 3;
3127
3235
  const c = window.innerWidth;
3128
- return c < 576 ? a.xs || 1 : c < 768 ? a.sm || 2 : c < 992 ? a.md || 3 : c < 1200 ? a.lg || 4 : c < 1600 ? a.xl || 5 : a.xxl || 6;
3129
- }, [r, p, a]), d = H(() => {
3130
- if (!l.current) return;
3131
- const c = e, v = l.current, S = (v.offsetWidth - o * (c - 1)) / c, h = new Array(c).fill(0);
3132
- t.forEach((q, L) => {
3133
- const D = q.id || L, P = u.current.get(D);
3134
- if (!P) return;
3135
- const W = Math.min(...h), F = h.indexOf(W), U = F * (S + o), Z = h[F];
3136
- P.style.position = "absolute", P.style.left = `${U}px`, P.style.top = `${Z}px`, P.style.width = `${S}px`, h[F] += P.offsetHeight + o;
3236
+ return c < 576 ? r.xs || 1 : c < 768 ? r.sm || 2 : c < 992 ? r.md || 3 : c < 1200 ? r.lg || 4 : c < 1600 ? r.xl || 5 : r.xxl || 6;
3237
+ }, [a, p, r]), d = W(() => {
3238
+ if (!i.current) return;
3239
+ const c = e, w = i.current, $ = (w.offsetWidth - l * (c - 1)) / c, b = new Array(c).fill(0);
3240
+ t.forEach((_, P) => {
3241
+ const D = _.id || P, B = u.current.get(D);
3242
+ if (!B) return;
3243
+ const U = Math.min(...b), H = b.indexOf(U), X = H * ($ + l), Z = b[H];
3244
+ B.style.position = "absolute", B.style.left = `${X}px`, B.style.top = `${Z}px`, B.style.width = `${$}px`, b[H] += B.offsetHeight + l;
3137
3245
  });
3138
- const R = Math.max(...h);
3139
- v.style.height = `${R}px`;
3140
- }, [t, e, o]);
3141
- ne(() => {
3246
+ const V = Math.max(...b);
3247
+ w.style.height = `${V}px`;
3248
+ }, [t, e, l]);
3249
+ oe(() => {
3142
3250
  const c = () => {
3143
- const v = N();
3144
- v !== e && x(v);
3251
+ const w = q();
3252
+ w !== e && x(w);
3145
3253
  };
3146
- if (r)
3254
+ if (a)
3147
3255
  return window.addEventListener("resize", c), c(), () => window.removeEventListener("resize", c);
3148
- }, [r, N, e]), ne(() => {
3256
+ }, [a, q, e]), oe(() => {
3149
3257
  const c = setTimeout(() => {
3150
3258
  d();
3151
3259
  }, 100);
3152
3260
  return () => clearTimeout(c);
3153
3261
  }, [t, e, d]);
3154
- const i = H(() => {
3262
+ const o = W(() => {
3155
3263
  d();
3156
- }, [d]), T = H((c) => {
3264
+ }, [d]), S = W((c) => {
3157
3265
  g && g(c), c.onClick?.(c);
3158
3266
  }, [g]);
3159
3267
  return /* @__PURE__ */ n.jsx(
3160
3268
  "div",
3161
3269
  {
3162
- ref: l,
3270
+ ref: i,
3163
3271
  className: `waterfall-container ${m || ""}`,
3164
3272
  style: {
3165
3273
  position: "relative",
3166
3274
  width: "100%",
3167
- ...C
3275
+ ...A
3168
3276
  },
3169
- children: t.map((c, v) => {
3170
- const w = c.id || v, S = Vt(c);
3277
+ children: t.map((c, w) => {
3278
+ const k = c.id || w, $ = Ft(c);
3171
3279
  return /* @__PURE__ */ n.jsx(
3172
3280
  "div",
3173
3281
  {
3174
- ref: (h) => {
3175
- h ? u.current.set(w, h) : u.current.delete(w);
3282
+ ref: (b) => {
3283
+ b ? u.current.set(k, b) : u.current.delete(k);
3176
3284
  },
3177
3285
  className: "waterfall-item",
3178
- children: S === "video" ? /* @__PURE__ */ n.jsx("div", { style: {
3286
+ children: $ === "video" ? /* @__PURE__ */ n.jsx("div", { style: {
3179
3287
  width: "100%",
3180
3288
  position: "relative",
3181
3289
  paddingBottom: "56.25%",
3182
3290
  cursor: g || c.onClick ? "pointer" : "default"
3183
3291
  }, children: /* @__PURE__ */ n.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ n.jsx(
3184
- Oe,
3292
+ ze,
3185
3293
  {
3186
3294
  src: c.url,
3187
3295
  poster: c.poster,
3188
3296
  width: "100%",
3189
3297
  height: "100%",
3190
- onClick: () => T(c),
3191
- onVideoLoaded: i,
3298
+ onClick: () => S(c),
3299
+ onVideoLoaded: o,
3192
3300
  autoPlayOnHover: !0,
3193
3301
  showPlayButton: !1
3194
3302
  }
@@ -3196,29 +3304,29 @@ const Lt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
3196
3304
  "div",
3197
3305
  {
3198
3306
  className: "waterfall-image-wrapper",
3199
- onClick: () => T(c),
3307
+ onClick: () => S(c),
3200
3308
  style: { cursor: g || c.onClick ? "pointer" : "default" },
3201
3309
  children: /* @__PURE__ */ n.jsx(
3202
3310
  "img",
3203
3311
  {
3204
3312
  src: c.url,
3205
- alt: `瀑布流图片 ${v + 1}`,
3313
+ alt: `瀑布流图片 ${w + 1}`,
3206
3314
  className: "waterfall-image",
3207
- onLoad: i,
3208
- onError: i,
3315
+ onLoad: o,
3316
+ onError: o,
3209
3317
  style: { display: "block", width: "100%", height: "auto" }
3210
3318
  }
3211
3319
  )
3212
3320
  }
3213
3321
  )
3214
3322
  },
3215
- w
3323
+ k
3216
3324
  );
3217
3325
  })
3218
3326
  }
3219
3327
  );
3220
3328
  };
3221
- Pt.__docgenInfo = {
3329
+ zt.__docgenInfo = {
3222
3330
  displayName: "Waterfall",
3223
3331
  description: "瀑布流布局组件,支持图片和视频混合展示",
3224
3332
  props: {
@@ -3274,8 +3382,8 @@ Pt.__docgenInfo = {
3274
3382
  }
3275
3383
  }
3276
3384
  };
3277
- const Gt = {
3278
- algorithm: Je.defaultAlgorithm,
3385
+ const Yt = {
3386
+ algorithm: at.defaultAlgorithm,
3279
3387
  token: {
3280
3388
  // 主色
3281
3389
  colorPrimary: "#3b82f6",
@@ -3341,21 +3449,21 @@ const Gt = {
3341
3449
  }
3342
3450
  };
3343
3451
  export {
3344
- xt as AdvancedTable,
3345
- dt as AppModal,
3346
- gt as BackButton,
3347
- ct as Button,
3348
- ut as Card,
3349
- Rt as DynamicInput,
3350
- It as DynamicTextArea,
3351
- yt as EmptyAndSpin,
3352
- ht as LinkButton,
3353
- pt as PageTable,
3354
- qt as RichTextEditor,
3355
- Oe as VideoCard,
3356
- _t as VirtualTable,
3357
- Pt as Waterfall,
3358
- mt as XcIcon,
3359
- Gt as lightTheme
3452
+ Ct as AdvancedTable,
3453
+ vt as AppModal,
3454
+ kt as BackButton,
3455
+ gt as Button,
3456
+ ht as Card,
3457
+ Mt as DynamicInput,
3458
+ Dt as DynamicTextArea,
3459
+ Et as EmptyAndSpin,
3460
+ Tt as LinkButton,
3461
+ bt as PageTable,
3462
+ Vt as RichTextEditor,
3463
+ ze as VideoCard,
3464
+ Ot as VirtualTable,
3465
+ zt as Waterfall,
3466
+ wt as XcIcon,
3467
+ Yt as lightTheme
3360
3468
  };
3361
3469
  //# sourceMappingURL=index.es.js.map