bi-components-library 1.0.10 → 1.0.12

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