bi-components-library 1.0.4 → 1.0.6

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,7 +1,8 @@
1
- import me, { useState as j, useRef as z, useMemo as pe, useCallback as v, useEffect as U } from "react";
2
- import { Button as X, Card as te, Modal as ye, Table as le, Flex as ae, Spin as ge, Empty as he, Select as ce, Form as re, Input as ue, Space as be, theme as we } from "antd";
3
- import { createFromIconfontCN as ve, LeftOutlined as xe, SearchOutlined as Re, ReloadOutlined as Te, SendOutlined as Se, PauseCircleOutlined as qe, PlayCircleOutlined as Ce } from "@ant-design/icons";
4
- var ne = { exports: {} }, Z = {};
1
+ import $e, { useState as z, useRef as K, useMemo as Re, useCallback as F, useEffect as Z } from "react";
2
+ import { Button as de, Card as ve, Modal as Ae, Table as Ne, Flex as we, Spin as Ie, Empty as _e, Select as Ce, Form as me, Input as qe, Space as je, Dropdown as Le, Tooltip as Ve, theme as Oe } from "antd";
3
+ import { createFromIconfontCN as Me, LeftOutlined as Pe, SearchOutlined as De, ReloadOutlined as Be, SendOutlined as Ge, PauseCircleOutlined as Fe, PlayCircleOutlined as ze } from "@ant-design/icons";
4
+ import { createPortal as He } from "react-dom";
5
+ var ye = { exports: {} }, pe = {};
5
6
  /**
6
7
  * @license React
7
8
  * react-jsx-runtime.production.js
@@ -11,29 +12,29 @@ var ne = { exports: {} }, Z = {};
11
12
  * This source code is licensed under the MIT license found in the
12
13
  * LICENSE file in the root directory of this source tree.
13
14
  */
14
- var oe;
15
- function je() {
16
- if (oe) return Z;
17
- oe = 1;
18
- var n = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
19
- function i(l, o, d) {
20
- var E = null;
21
- if (d !== void 0 && (E = "" + d), o.key !== void 0 && (E = "" + o.key), "key" in o) {
22
- d = {};
23
- for (var m in o)
24
- m !== "key" && (d[m] = o[m]);
25
- } else d = o;
26
- return o = d.ref, {
27
- $$typeof: n,
28
- type: l,
29
- key: E,
30
- ref: o !== void 0 ? o : null,
31
- props: d
15
+ var Ee;
16
+ function We() {
17
+ if (Ee) return pe;
18
+ Ee = 1;
19
+ var t = Symbol.for("react.transitional.element"), p = Symbol.for("react.fragment");
20
+ function u(s, i, m) {
21
+ var C = null;
22
+ if (m !== void 0 && (C = "" + m), i.key !== void 0 && (C = "" + i.key), "key" in i) {
23
+ m = {};
24
+ for (var h in i)
25
+ h !== "key" && (m[h] = i[h]);
26
+ } else m = i;
27
+ return i = m.ref, {
28
+ $$typeof: t,
29
+ type: s,
30
+ key: C,
31
+ ref: i !== void 0 ? i : null,
32
+ props: m
32
33
  };
33
34
  }
34
- return Z.Fragment = s, Z.jsx = i, Z.jsxs = i, Z;
35
+ return pe.Fragment = p, pe.jsx = u, pe.jsxs = u, pe;
35
36
  }
36
- var ee = {};
37
+ var fe = {};
37
38
  /**
38
39
  * @license React
39
40
  * react-jsx-runtime.development.js
@@ -43,252 +44,252 @@ var ee = {};
43
44
  * This source code is licensed under the MIT license found in the
44
45
  * LICENSE file in the root directory of this source tree.
45
46
  */
46
- var ie;
47
- function Ee() {
48
- return ie || (ie = 1, process.env.NODE_ENV !== "production" && function() {
49
- function n(e) {
50
- if (e == null) return null;
51
- if (typeof e == "function")
52
- return e.$$typeof === L ? null : e.displayName || e.name || null;
53
- if (typeof e == "string") return e;
54
- switch (e) {
55
- case V:
47
+ var ke;
48
+ function Xe() {
49
+ return ke || (ke = 1, process.env.NODE_ENV !== "production" && function() {
50
+ function t(l) {
51
+ if (l == null) return null;
52
+ if (typeof l == "function")
53
+ return l.$$typeof === G ? null : l.displayName || l.name || null;
54
+ if (typeof l == "string") return l;
55
+ switch (l) {
56
+ case T:
56
57
  return "Fragment";
57
- case p:
58
+ case x:
58
59
  return "Profiler";
59
- case a:
60
+ case g:
60
61
  return "StrictMode";
61
62
  case $:
62
63
  return "Suspense";
63
- case D:
64
+ case L:
64
65
  return "SuspenseList";
65
- case x:
66
+ case O:
66
67
  return "Activity";
67
68
  }
68
- if (typeof e == "object")
69
- switch (typeof e.tag == "number" && console.error(
69
+ if (typeof l == "object")
70
+ switch (typeof l.tag == "number" && console.error(
70
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
71
- ), e.$$typeof) {
72
- case P:
73
- return "Portal";
74
- case T:
75
- return (e.displayName || "Context") + ".Provider";
76
- case b:
77
- return (e._context.displayName || "Context") + ".Consumer";
78
- case g:
79
- var u = e.render;
80
- return e = e.displayName, e || (e = u.displayName || u.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
72
+ ), l.$$typeof) {
81
73
  case A:
82
- return u = e.displayName || null, u !== null ? u : n(e.type) || "Memo";
83
- case F:
84
- u = e._payload, e = e._init;
74
+ return "Portal";
75
+ case v:
76
+ return (l.displayName || "Context") + ".Provider";
77
+ case N:
78
+ return (l._context.displayName || "Context") + ".Consumer";
79
+ case k:
80
+ var j = l.render;
81
+ return l = l.displayName, l || (l = j.displayName || j.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
82
+ case V:
83
+ return j = l.displayName || null, j !== null ? j : t(l.type) || "Memo";
84
+ case P:
85
+ j = l._payload, l = l._init;
85
86
  try {
86
- return n(e(u));
87
+ return t(l(j));
87
88
  } catch {
88
89
  }
89
90
  }
90
91
  return null;
91
92
  }
92
- function s(e) {
93
- return "" + e;
93
+ function p(l) {
94
+ return "" + l;
94
95
  }
95
- function i(e) {
96
+ function u(l) {
96
97
  try {
97
- s(e);
98
- var u = !1;
98
+ p(l);
99
+ var j = !1;
99
100
  } catch {
100
- u = !0;
101
+ j = !0;
101
102
  }
102
- if (u) {
103
- u = console;
104
- var w = u.error, O = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
105
- return w.call(
106
- u,
103
+ if (j) {
104
+ j = console;
105
+ var B = j.error, J = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
106
+ return B.call(
107
+ j,
107
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
108
- O
109
- ), s(e);
109
+ J
110
+ ), p(l);
110
111
  }
111
112
  }
112
- function l(e) {
113
- if (e === V) return "<>";
114
- if (typeof e == "object" && e !== null && e.$$typeof === F)
113
+ function s(l) {
114
+ if (l === T) return "<>";
115
+ if (typeof l == "object" && l !== null && l.$$typeof === P)
115
116
  return "<...>";
116
117
  try {
117
- var u = n(e);
118
- return u ? "<" + u + ">" : "<...>";
118
+ var j = t(l);
119
+ return j ? "<" + j + ">" : "<...>";
119
120
  } catch {
120
121
  return "<...>";
121
122
  }
122
123
  }
123
- function o() {
124
- var e = q.A;
125
- return e === null ? null : e.getOwner();
124
+ function i() {
125
+ var l = M.A;
126
+ return l === null ? null : l.getOwner();
126
127
  }
127
- function d() {
128
+ function m() {
128
129
  return Error("react-stack-top-frame");
129
130
  }
130
- function E(e) {
131
- if (B.call(e, "key")) {
132
- var u = Object.getOwnPropertyDescriptor(e, "key").get;
133
- if (u && u.isReactWarning) return !1;
131
+ function C(l) {
132
+ if (Y.call(l, "key")) {
133
+ var j = Object.getOwnPropertyDescriptor(l, "key").get;
134
+ if (j && j.isReactWarning) return !1;
134
135
  }
135
- return e.key !== void 0;
136
+ return l.key !== void 0;
136
137
  }
137
- function m(e, u) {
138
- function w() {
139
- c || (c = !0, console.error(
138
+ function h(l, j) {
139
+ function B() {
140
+ _ || (_ = !0, console.error(
140
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)",
141
- u
142
+ j
142
143
  ));
143
144
  }
144
- w.isReactWarning = !0, Object.defineProperty(e, "key", {
145
- get: w,
145
+ B.isReactWarning = !0, Object.defineProperty(l, "key", {
146
+ get: B,
146
147
  configurable: !0
147
148
  });
148
149
  }
149
- function S() {
150
- var e = n(this.type);
151
- return R[e] || (R[e] = !0, console.error(
150
+ function e() {
151
+ var l = t(this.type);
152
+ return W[l] || (W[l] = !0, console.error(
152
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."
153
- )), e = this.props.ref, e !== void 0 ? e : null;
154
+ )), l = this.props.ref, l !== void 0 ? l : null;
154
155
  }
155
- function _(e, u, w, O, Y, M, Q, f) {
156
- return w = M.ref, e = {
157
- $$typeof: h,
158
- type: e,
159
- key: u,
160
- props: M,
161
- _owner: Y
162
- }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(e, "ref", {
156
+ function r(l, j, B, J, oe, c, f, o) {
157
+ return B = c.ref, l = {
158
+ $$typeof: a,
159
+ type: l,
160
+ key: j,
161
+ props: c,
162
+ _owner: oe
163
+ }, (B !== void 0 ? B : null) !== null ? Object.defineProperty(l, "ref", {
163
164
  enumerable: !1,
164
- get: S
165
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
165
+ get: e
166
+ }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
166
167
  configurable: !1,
167
168
  enumerable: !1,
168
169
  writable: !0,
169
170
  value: 0
170
- }), Object.defineProperty(e, "_debugInfo", {
171
+ }), Object.defineProperty(l, "_debugInfo", {
171
172
  configurable: !1,
172
173
  enumerable: !1,
173
174
  writable: !0,
174
175
  value: null
175
- }), Object.defineProperty(e, "_debugStack", {
176
+ }), Object.defineProperty(l, "_debugStack", {
176
177
  configurable: !1,
177
178
  enumerable: !1,
178
179
  writable: !0,
179
- value: Q
180
- }), Object.defineProperty(e, "_debugTask", {
180
+ value: f
181
+ }), Object.defineProperty(l, "_debugTask", {
181
182
  configurable: !1,
182
183
  enumerable: !1,
183
184
  writable: !0,
184
- value: f
185
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
185
+ value: o
186
+ }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
186
187
  }
187
- function k(e, u, w, O, Y, M, Q, f) {
188
- var y = u.children;
188
+ function q(l, j, B, J, oe, c, f, o) {
189
+ var y = j.children;
189
190
  if (y !== void 0)
190
- if (O)
191
- if (H(y)) {
192
- for (O = 0; O < y.length; O++)
193
- N(y[O]);
191
+ if (J)
192
+ if (te(y)) {
193
+ for (J = 0; J < y.length; J++)
194
+ n(y[J]);
194
195
  Object.freeze && Object.freeze(y);
195
196
  } else
196
197
  console.error(
197
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."
198
199
  );
199
- else N(y);
200
- if (B.call(u, "key")) {
201
- y = n(e);
202
- var W = Object.keys(u).filter(function(fe) {
203
- return fe !== "key";
200
+ else n(y);
201
+ if (Y.call(j, "key")) {
202
+ y = t(l);
203
+ var b = Object.keys(j).filter(function(R) {
204
+ return R !== "key";
204
205
  });
205
- O = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", J[y + O] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ J = 0 < b.length ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}", le[y + J] || (b = 0 < b.length ? "{" + b.join(": ..., ") + ": ...}" : "{}", console.error(
206
207
  `A props object containing a "key" prop is being spread into JSX:
207
208
  let props = %s;
208
209
  <%s {...props} />
209
210
  React keys must be passed directly to JSX without using spread:
210
211
  let props = %s;
211
212
  <%s key={someKey} {...props} />`,
212
- O,
213
+ J,
213
214
  y,
214
- W,
215
+ b,
215
216
  y
216
- ), J[y + O] = !0);
217
+ ), le[y + J] = !0);
217
218
  }
218
- if (y = null, w !== void 0 && (i(w), y = "" + w), E(u) && (i(u.key), y = "" + u.key), "key" in u) {
219
- w = {};
220
- for (var K in u)
221
- K !== "key" && (w[K] = u[K]);
222
- } else w = u;
223
- return y && m(
224
- w,
225
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
226
- ), _(
227
- e,
219
+ if (y = null, B !== void 0 && (u(B), y = "" + B), C(j) && (u(j.key), y = "" + j.key), "key" in j) {
220
+ B = {};
221
+ for (var E in j)
222
+ E !== "key" && (B[E] = j[E]);
223
+ } else B = j;
224
+ return y && h(
225
+ B,
226
+ typeof l == "function" ? l.displayName || l.name || "Unknown" : l
227
+ ), r(
228
+ l,
228
229
  y,
229
- M,
230
- Y,
231
- o(),
232
- w,
233
- Q,
234
- f
230
+ c,
231
+ oe,
232
+ i(),
233
+ B,
234
+ f,
235
+ o
235
236
  );
236
237
  }
237
- function N(e) {
238
- typeof e == "object" && e !== null && e.$$typeof === h && e._store && (e._store.validated = 1);
238
+ function n(l) {
239
+ typeof l == "object" && l !== null && l.$$typeof === a && l._store && (l._store.validated = 1);
239
240
  }
240
- var I = me, h = Symbol.for("react.transitional.element"), P = Symbol.for("react.portal"), V = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), T = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), x = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), q = I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, H = Array.isArray, t = console.createTask ? console.createTask : function() {
241
+ var S = $e, a = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), N = Symbol.for("react.consumer"), v = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), V = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), M = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, te = Array.isArray, w = console.createTask ? console.createTask : function() {
241
242
  return null;
242
243
  };
243
- I = {
244
- react_stack_bottom_frame: function(e) {
245
- return e();
244
+ S = {
245
+ react_stack_bottom_frame: function(l) {
246
+ return l();
246
247
  }
247
248
  };
248
- var c, R = {}, C = I.react_stack_bottom_frame.bind(
249
- I,
250
- d
251
- )(), G = t(l(d)), J = {};
252
- ee.Fragment = V, ee.jsx = function(e, u, w, O, Y) {
253
- var M = 1e4 > q.recentlyCreatedOwnerStacks++;
254
- return k(
255
- e,
256
- u,
257
- w,
249
+ var _, W = {}, U = S.react_stack_bottom_frame.bind(
250
+ S,
251
+ m
252
+ )(), se = w(s(m)), le = {};
253
+ fe.Fragment = T, fe.jsx = function(l, j, B, J, oe) {
254
+ var c = 1e4 > M.recentlyCreatedOwnerStacks++;
255
+ return q(
256
+ l,
257
+ j,
258
+ B,
258
259
  !1,
259
- O,
260
- Y,
261
- M ? Error("react-stack-top-frame") : C,
262
- M ? t(l(e)) : G
260
+ J,
261
+ oe,
262
+ c ? Error("react-stack-top-frame") : U,
263
+ c ? w(s(l)) : se
263
264
  );
264
- }, ee.jsxs = function(e, u, w, O, Y) {
265
- var M = 1e4 > q.recentlyCreatedOwnerStacks++;
266
- return k(
267
- e,
268
- u,
269
- w,
265
+ }, fe.jsxs = function(l, j, B, J, oe) {
266
+ var c = 1e4 > M.recentlyCreatedOwnerStacks++;
267
+ return q(
268
+ l,
269
+ j,
270
+ B,
270
271
  !0,
271
- O,
272
- Y,
273
- M ? Error("react-stack-top-frame") : C,
274
- M ? t(l(e)) : G
272
+ J,
273
+ oe,
274
+ c ? Error("react-stack-top-frame") : U,
275
+ c ? w(s(l)) : se
275
276
  );
276
277
  };
277
- }()), ee;
278
+ }()), fe;
278
279
  }
279
- var se;
280
- function _e() {
281
- return se || (se = 1, process.env.NODE_ENV === "production" ? ne.exports = je() : ne.exports = Ee()), ne.exports;
280
+ var Te;
281
+ function Ke() {
282
+ return Te || (Te = 1, process.env.NODE_ENV === "production" ? ye.exports = We() : ye.exports = Xe()), ye.exports;
282
283
  }
283
- var r = _e();
284
- const ke = ({
285
- variant: n = "primary",
286
- loading: s = !1,
287
- children: i,
288
- ...l
284
+ var d = Ke();
285
+ const Ye = ({
286
+ variant: t = "primary",
287
+ loading: p = !1,
288
+ children: u,
289
+ ...s
289
290
  }) => {
290
- const o = (d) => {
291
- switch (d) {
291
+ const i = (m) => {
292
+ switch (m) {
292
293
  case "primary":
293
294
  return "primary";
294
295
  case "ghost":
@@ -303,18 +304,18 @@ const ke = ({
303
304
  return "primary";
304
305
  }
305
306
  };
306
- return /* @__PURE__ */ r.jsx(
307
- X,
307
+ return /* @__PURE__ */ d.jsx(
308
+ de,
308
309
  {
309
- ...l,
310
- type: o(n),
311
- loading: s,
312
- ghost: n === "ghost",
313
- children: i
310
+ ...s,
311
+ type: i(t),
312
+ loading: p,
313
+ ghost: t === "ghost",
314
+ children: u
314
315
  }
315
316
  );
316
317
  };
317
- ke.__docgenInfo = {
318
+ Ye.__docgenInfo = {
318
319
  displayName: "Button",
319
320
  description: "基础按钮,用于触发操作",
320
321
  props: {
@@ -358,25 +359,25 @@ ke.__docgenInfo = {
358
359
  }
359
360
  }
360
361
  };
361
- const Ne = ({
362
- title: n,
363
- children: s,
364
- bordered: i = !0,
365
- hoverable: l = !1,
366
- size: o = "default",
367
- ...d
368
- }) => /* @__PURE__ */ r.jsx(
369
- te,
362
+ const Ue = ({
363
+ title: t,
364
+ children: p,
365
+ bordered: u = !0,
366
+ hoverable: s = !1,
367
+ size: i = "default",
368
+ ...m
369
+ }) => /* @__PURE__ */ d.jsx(
370
+ ve,
370
371
  {
371
- ...d,
372
- title: n,
373
- bordered: i,
374
- hoverable: l,
375
- size: o,
376
- children: s
372
+ ...m,
373
+ title: t,
374
+ bordered: u,
375
+ hoverable: s,
376
+ size: i,
377
+ children: p
377
378
  }
378
379
  );
379
- Ne.__docgenInfo = {
380
+ Ue.__docgenInfo = {
380
381
  displayName: "Card",
381
382
  description: "卡片容器,用于分组内容",
382
383
  props: {
@@ -427,23 +428,23 @@ Ne.__docgenInfo = {
427
428
  }
428
429
  }
429
430
  };
430
- const Ie = ({
431
- showDefaultFooter: n = !0,
432
- ...s
431
+ const Je = ({
432
+ showDefaultFooter: t = !0,
433
+ ...p
433
434
  }) => {
434
- const i = s.footer !== void 0 ? s.footer : n ? (l, { OkBtn: o, CancelBtn: d }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
435
- /* @__PURE__ */ r.jsx(o, {}),
436
- /* @__PURE__ */ r.jsx(d, {})
435
+ const u = p.footer !== void 0 ? p.footer : t ? (s, { OkBtn: i, CancelBtn: m }) => /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
436
+ /* @__PURE__ */ d.jsx(i, {}),
437
+ /* @__PURE__ */ d.jsx(m, {})
437
438
  ] }) : null;
438
- return /* @__PURE__ */ r.jsx(
439
- ye,
439
+ return /* @__PURE__ */ d.jsx(
440
+ Ae,
440
441
  {
441
- ...s,
442
- footer: i
442
+ ...p,
443
+ footer: u
443
444
  }
444
445
  );
445
446
  };
446
- Ie.__docgenInfo = {
447
+ Je.__docgenInfo = {
447
448
  displayName: "AppModal",
448
449
  description: "应用级模态框组件,基于 Ant Design Modal 封装",
449
450
  props: {
@@ -504,29 +505,29 @@ Ie.__docgenInfo = {
504
505
  }
505
506
  }
506
507
  };
507
- const Pe = ({
508
- scrollX: n,
509
- showPagination: s = !0,
510
- defaultPageSize: i = 10,
511
- ...l
512
- }) => /* @__PURE__ */ r.jsx(
513
- le,
508
+ const Qe = ({
509
+ scrollX: t,
510
+ showPagination: p = !0,
511
+ defaultPageSize: u = 10,
512
+ ...s
513
+ }) => /* @__PURE__ */ d.jsx(
514
+ Ne,
514
515
  {
515
- ...l,
516
+ ...s,
516
517
  scroll: {
517
- x: n || "max-content",
518
+ x: t || "max-content",
518
519
  y: "50vh"
519
520
  },
520
- pagination: s ? {
521
+ pagination: p ? {
521
522
  hideOnSinglePage: !0,
522
523
  showSizeChanger: !0,
523
524
  showQuickJumper: !0,
524
- defaultPageSize: i,
525
- ...l.pagination
525
+ defaultPageSize: u,
526
+ ...s.pagination
526
527
  } : !1
527
528
  }
528
529
  );
529
- Pe.__docgenInfo = {
530
+ Qe.__docgenInfo = {
530
531
  displayName: "PageTable",
531
532
  description: "页面级表格组件,高度铺满容器,自动滚动",
532
533
  props: {
@@ -576,30 +577,30 @@ Pe.__docgenInfo = {
576
577
  }
577
578
  }
578
579
  };
579
- const Ve = ve({
580
+ const Ze = Me({
580
581
  scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
581
- }), Ae = ({
582
- name: n,
583
- size: s,
584
- color: i,
585
- style: l,
586
- ...o
582
+ }), et = ({
583
+ name: t,
584
+ size: p,
585
+ color: u,
586
+ style: s,
587
+ ...i
587
588
  }) => {
588
- const d = {
589
- fontSize: s,
590
- color: i,
591
- ...l
589
+ const m = {
590
+ fontSize: p,
591
+ color: u,
592
+ ...s
592
593
  };
593
- return /* @__PURE__ */ r.jsx(
594
- Ve,
594
+ return /* @__PURE__ */ d.jsx(
595
+ Ze,
595
596
  {
596
- ...o,
597
- type: n,
598
- style: d
597
+ ...i,
598
+ type: t,
599
+ style: m
599
600
  }
600
601
  );
601
602
  };
602
- Ae.__docgenInfo = {
603
+ et.__docgenInfo = {
603
604
  displayName: "XcIcon",
604
605
  description: "自定义图标组件,基于 iconfont",
605
606
  props: {
@@ -635,43 +636,43 @@ Ae.__docgenInfo = {
635
636
  }
636
637
  }
637
638
  };
638
- const Oe = ({
639
- loading: n,
640
- description: s = "暂无数据",
641
- className: i,
642
- emptyChildren: l,
643
- loadingText: o,
644
- emptyImage: d
645
- }) => n ? /* @__PURE__ */ r.jsxs(
646
- ae,
639
+ const tt = ({
640
+ loading: t,
641
+ description: p = "暂无数据",
642
+ className: u,
643
+ emptyChildren: s,
644
+ loadingText: i,
645
+ emptyImage: m
646
+ }) => t ? /* @__PURE__ */ d.jsxs(
647
+ we,
647
648
  {
648
- className: `pt-10 w-full ${i || ""}`,
649
+ className: `pt-10 w-full ${u || ""}`,
649
650
  align: "center",
650
651
  justify: "center",
651
652
  vertical: !0,
652
653
  children: [
653
- /* @__PURE__ */ r.jsx(ge, { size: "large" }),
654
- o && /* @__PURE__ */ r.jsx("div", { className: "mt-4 text-gray-500", children: o })
654
+ /* @__PURE__ */ d.jsx(Ie, { size: "large" }),
655
+ i && /* @__PURE__ */ d.jsx("div", { className: "mt-4 text-gray-500", children: i })
655
656
  ]
656
657
  }
657
- ) : /* @__PURE__ */ r.jsx(
658
- ae,
658
+ ) : /* @__PURE__ */ d.jsx(
659
+ we,
659
660
  {
660
- className: `pt-10 w-full ${i || ""}`,
661
+ className: `pt-10 w-full ${u || ""}`,
661
662
  align: "center",
662
663
  justify: "center",
663
- children: /* @__PURE__ */ r.jsx(
664
- he,
664
+ children: /* @__PURE__ */ d.jsx(
665
+ _e,
665
666
  {
666
- image: d,
667
- description: s,
667
+ image: m,
668
+ description: p,
668
669
  imageStyle: { height: 180 },
669
- children: l
670
+ children: s
670
671
  }
671
672
  )
672
673
  }
673
674
  );
674
- Oe.__docgenInfo = {
675
+ tt.__docgenInfo = {
675
676
  displayName: "EmptyAndSpin",
676
677
  description: "空状态和加载状态组合组件",
677
678
  props: {
@@ -714,24 +715,24 @@ Oe.__docgenInfo = {
714
715
  }
715
716
  }
716
717
  };
717
- const ze = ({
718
- onClick: n,
719
- showText: s = !1,
720
- className: i,
721
- size: l = "small",
722
- type: o = "default"
723
- }) => /* @__PURE__ */ r.jsx(
724
- X,
718
+ const nt = ({
719
+ onClick: t,
720
+ showText: p = !1,
721
+ className: u,
722
+ size: s = "small",
723
+ type: i = "default"
724
+ }) => /* @__PURE__ */ d.jsx(
725
+ de,
725
726
  {
726
- size: l,
727
- type: o,
728
- icon: /* @__PURE__ */ r.jsx(xe, {}),
729
- className: `cursor-pointer ${i || ""}`,
730
- onClick: n,
731
- children: s && "返回"
727
+ size: s,
728
+ type: i,
729
+ icon: /* @__PURE__ */ d.jsx(Pe, {}),
730
+ className: `cursor-pointer ${u || ""}`,
731
+ onClick: t,
732
+ children: p && "返回"
732
733
  }
733
734
  );
734
- ze.__docgenInfo = {
735
+ nt.__docgenInfo = {
735
736
  displayName: "BackButton",
736
737
  description: "返回按钮组件",
737
738
  props: {
@@ -770,23 +771,23 @@ ze.__docgenInfo = {
770
771
  }
771
772
  }
772
773
  };
773
- const Fe = ({
774
- removePadding: n = !0,
775
- className: s,
776
- ...i
774
+ const rt = ({
775
+ removePadding: t = !0,
776
+ className: p,
777
+ ...u
777
778
  }) => {
778
- const l = n ? `px-0 h-auto ${s || ""}` : s;
779
- return /* @__PURE__ */ r.jsx(
780
- X,
779
+ const s = t ? `px-0 h-auto ${p || ""}` : p;
780
+ return /* @__PURE__ */ d.jsx(
781
+ de,
781
782
  {
782
783
  type: "link",
783
- ...i,
784
- className: l,
785
- children: i.children
784
+ ...u,
785
+ className: s,
786
+ children: u.children
786
787
  }
787
788
  );
788
789
  };
789
- Fe.__docgenInfo = {
790
+ rt.__docgenInfo = {
790
791
  displayName: "LinkButton",
791
792
  description: "链接样式按钮组件,适用于表格操作列",
792
793
  props: {
@@ -823,129 +824,129 @@ Fe.__docgenInfo = {
823
824
  }
824
825
  }
825
826
  };
826
- const { Option: Le } = ce, Be = ({
827
- columns: n,
828
- request: s,
829
- searchFields: i = [],
830
- showSearch: l = !0,
831
- showRefresh: o = !0,
832
- defaultPageSize: d = 10,
833
- pageSizeOptions: E = ["10", "20", "50", "100"],
834
- autoLoad: m = !0,
835
- externalParams: S = {},
836
- ..._
827
+ const { Option: at } = Ce, ot = ({
828
+ columns: t,
829
+ request: p,
830
+ searchFields: u = [],
831
+ showSearch: s = !0,
832
+ showRefresh: i = !0,
833
+ defaultPageSize: m = 10,
834
+ pageSizeOptions: C = ["10", "20", "50", "100"],
835
+ autoLoad: h = !0,
836
+ externalParams: e = {},
837
+ ...r
837
838
  }) => {
838
- const [k, N] = j([]), [I, h] = j(!1), [P, V] = j({
839
+ const [q, n] = z([]), [S, a] = z(!1), [A, T] = z({
839
840
  current: 1,
840
- pageSize: d,
841
+ pageSize: m,
841
842
  total: 0
842
- }), [a, p] = j({}), [b, T] = j({}), [g] = re.useForm(), $ = z(P);
843
- $.current = P;
844
- const D = z(S);
845
- D.current = S;
846
- const A = z(!1), F = pe(() => n.map((t) => {
847
- const { sortable: c, render: R, ...C } = t;
843
+ }), [g, x] = z({}), [N, v] = z({}), [k] = me.useForm(), $ = K(A);
844
+ $.current = A;
845
+ const L = K(e);
846
+ L.current = e;
847
+ const V = K(!1), P = Re(() => t.map((w) => {
848
+ const { sortable: _, render: W, ...U } = w;
848
849
  return {
849
- ...C,
850
- sorter: c ? !0 : void 0,
851
- render: R || ((G) => G)
850
+ ...U,
851
+ sorter: _ ? !0 : void 0,
852
+ render: W || ((se) => se)
852
853
  };
853
- }), [n]), x = v(async (t = {}) => {
854
- if (s) {
855
- h(!0);
854
+ }), [t]), O = F(async (w = {}) => {
855
+ if (p) {
856
+ a(!0);
856
857
  try {
857
- const c = {
858
+ const _ = {
858
859
  page: $.current.current,
859
860
  pageSize: $.current.pageSize,
860
- sortField: b.field,
861
- sortOrder: b.order,
862
- searchParams: { ...a, ...D.current },
863
- ...t
864
- }, R = await s(c);
865
- R.success && (N(R.data), V((C) => ({
866
- ...C,
867
- total: R.total,
868
- current: c.page || C.current
861
+ sortField: N.field,
862
+ sortOrder: N.order,
863
+ searchParams: { ...g, ...L.current },
864
+ ...w
865
+ }, W = await p(_);
866
+ W.success && (n(W.data), T((U) => ({
867
+ ...U,
868
+ total: W.total,
869
+ current: _.page || U.current
869
870
  })));
870
- } catch (c) {
871
- console.error("加载数据失败:", c);
871
+ } catch (_) {
872
+ console.error("加载数据失败:", _);
872
873
  } finally {
873
- h(!1);
874
+ a(!1);
874
875
  }
875
876
  }
876
- }, [s, b, a]), L = v((t) => {
877
- p(t), V((c) => ({ ...c, current: 1 }));
878
- }, []), q = v(() => {
879
- g.resetFields(), p({}), V((t) => ({ ...t, current: 1 }));
880
- }, [g]), B = v(() => {
881
- x();
882
- }, [x]), H = v((t, c, R) => {
883
- const C = {
884
- current: t.current || 1,
885
- pageSize: t.pageSize || d,
886
- total: t.total || 0
887
- }, G = {
888
- field: R?.field,
889
- order: R?.order
877
+ }, [p, N, g]), G = F((w) => {
878
+ x(w), T((_) => ({ ..._, current: 1 }));
879
+ }, []), M = F(() => {
880
+ k.resetFields(), x({}), T((w) => ({ ...w, current: 1 }));
881
+ }, [k]), Y = F(() => {
882
+ O();
883
+ }, [O]), te = F((w, _, W) => {
884
+ const U = {
885
+ current: w.current || 1,
886
+ pageSize: w.pageSize || m,
887
+ total: w.total || 0
888
+ }, se = {
889
+ field: W?.field,
890
+ order: W?.order
890
891
  };
891
- V(C), T(G);
892
- }, [d]);
893
- return U(() => {
894
- const t = Object.keys(S).length > 0;
895
- (m && !A.current || t) && (x(), A.current = !0);
896
- }, [m, S, x]), /* @__PURE__ */ r.jsxs("div", { children: [
897
- l && i.length > 0 && /* @__PURE__ */ r.jsx(te, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ r.jsxs(
898
- re,
892
+ T(U), v(se);
893
+ }, [m]);
894
+ return Z(() => {
895
+ const w = Object.keys(e).length > 0;
896
+ (h && !V.current || w) && (O(), V.current = !0);
897
+ }, [h, e, O]), /* @__PURE__ */ d.jsxs("div", { children: [
898
+ s && u.length > 0 && /* @__PURE__ */ d.jsx(ve, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ d.jsxs(
899
+ me,
899
900
  {
900
- form: g,
901
+ form: k,
901
902
  layout: "inline",
902
- onFinish: L,
903
- initialValues: i.reduce((t, c) => (c.defaultValue !== void 0 && (t[c.key] = c.defaultValue), t), {}),
903
+ onFinish: G,
904
+ initialValues: u.reduce((w, _) => (_.defaultValue !== void 0 && (w[_.key] = _.defaultValue), w), {}),
904
905
  children: [
905
- i.map((t) => /* @__PURE__ */ r.jsx(re.Item, { name: t.key, label: t.label, children: t.type === "input" ? /* @__PURE__ */ r.jsx(
906
- ue,
906
+ u.map((w) => /* @__PURE__ */ d.jsx(me.Item, { name: w.key, label: w.label, children: w.type === "input" ? /* @__PURE__ */ d.jsx(
907
+ qe,
907
908
  {
908
- placeholder: t.placeholder || `请输入${t.label}`,
909
+ placeholder: w.placeholder || `请输入${w.label}`,
909
910
  style: { width: 200 }
910
911
  }
911
- ) : /* @__PURE__ */ r.jsx(
912
- ce,
912
+ ) : /* @__PURE__ */ d.jsx(
913
+ Ce,
913
914
  {
914
- placeholder: t.placeholder || `请选择${t.label}`,
915
+ placeholder: w.placeholder || `请选择${w.label}`,
915
916
  style: { width: 200 },
916
917
  allowClear: !0,
917
- children: t.options?.map((c) => /* @__PURE__ */ r.jsx(Le, { value: c.value, children: c.label }, c.value))
918
+ children: w.options?.map((_) => /* @__PURE__ */ d.jsx(at, { value: _.value, children: _.label }, _.value))
918
919
  }
919
- ) }, t.key)),
920
- /* @__PURE__ */ r.jsx(re.Item, { children: /* @__PURE__ */ r.jsxs(be, { children: [
921
- /* @__PURE__ */ r.jsx(X, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ r.jsx(Re, {}), children: "查询" }),
922
- /* @__PURE__ */ r.jsx(X, { onClick: q, children: "重置" }),
923
- o && /* @__PURE__ */ r.jsx(X, { icon: /* @__PURE__ */ r.jsx(Te, {}), onClick: B, children: "刷新" })
920
+ ) }, w.key)),
921
+ /* @__PURE__ */ d.jsx(me.Item, { children: /* @__PURE__ */ d.jsxs(je, { children: [
922
+ /* @__PURE__ */ d.jsx(de, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ d.jsx(De, {}), children: "查询" }),
923
+ /* @__PURE__ */ d.jsx(de, { onClick: M, children: "重置" }),
924
+ i && /* @__PURE__ */ d.jsx(de, { icon: /* @__PURE__ */ d.jsx(Be, {}), onClick: Y, children: "刷新" })
924
925
  ] }) })
925
926
  ]
926
927
  }
927
928
  ) }),
928
- /* @__PURE__ */ r.jsx(
929
- le,
929
+ /* @__PURE__ */ d.jsx(
930
+ Ne,
930
931
  {
931
- ..._,
932
- columns: F,
933
- dataSource: k,
934
- loading: I,
932
+ ...r,
933
+ columns: P,
934
+ dataSource: q,
935
+ loading: S,
935
936
  pagination: {
936
- ...P,
937
+ ...A,
937
938
  showSizeChanger: !0,
938
939
  showQuickJumper: !0,
939
- showTotal: (t, c) => `第 ${c[0]}-${c[1]} 条/共 ${t} 条`,
940
- pageSizeOptions: E
940
+ showTotal: (w, _) => `第 ${_[0]}-${_[1]} 条/共 ${w} 条`,
941
+ pageSizeOptions: C
941
942
  },
942
- onChange: H,
943
+ onChange: te,
943
944
  scroll: { x: "max-content", y: "50vh" }
944
945
  }
945
946
  )
946
947
  ] });
947
948
  };
948
- Be.__docgenInfo = {
949
+ ot.__docgenInfo = {
949
950
  displayName: "AdvancedTable",
950
951
  description: "高阶表格组件,支持异步请求、搜索、排序等功能",
951
952
  props: {
@@ -1012,79 +1013,1132 @@ Be.__docgenInfo = {
1012
1013
  }
1013
1014
  }
1014
1015
  };
1015
- const Me = ({
1016
- texts: n = [],
1017
- placeholder: s = "请输入内容",
1018
- animationSpeed: i = 100,
1019
- autoPlay: l = !0,
1020
- value: o,
1021
- onChange: d,
1022
- ...E
1023
- }) => {
1024
- const [m, S] = j(""), [_, k] = j(0), [N, I] = j(!1), [h, P] = j(!1), [V, a] = j(!1), p = z(void 0), b = z(void 0), T = z(n), g = z(_), $ = z(h), D = z(m);
1025
- U(() => {
1026
- T.current = n, g.current = _, $.current = h, D.current = m;
1016
+ function be(t, p, u) {
1017
+ if (!t.current) return;
1018
+ const s = /* @__PURE__ */ new Set(), i = {};
1019
+ for (const n of p)
1020
+ n.exclusionGroup && n.exclusionGroup !== "separator" && (s.add(n.exclusionGroup), i[n.exclusionGroup] || (i[n.exclusionGroup] = []), i[n.exclusionGroup].push({
1021
+ type: n.type,
1022
+ key: n.key,
1023
+ exclusionGroup: n.exclusionGroup
1024
+ }));
1025
+ const m = {};
1026
+ for (const n of s) {
1027
+ m[n] = !1;
1028
+ for (const S of i[n])
1029
+ if (S.type === "upload" && S.key) {
1030
+ if (u[S.key] !== null && u[S.key] !== void 0) {
1031
+ m[n] = !0;
1032
+ break;
1033
+ }
1034
+ } else if (S.type === "variable" && S.key) {
1035
+ const a = t.current.querySelector(
1036
+ `[data-type="variable"][data-key="${S.key}"]`
1037
+ );
1038
+ if (a && a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1039
+ m[n] = !0;
1040
+ break;
1041
+ }
1042
+ }
1043
+ }
1044
+ const C = p.some((n) => n.exclusionGroup === "separator"), e = Object.keys(m).filter(
1045
+ (n) => m[n]
1046
+ ).length > 0;
1047
+ let r = null;
1048
+ if (e && C) {
1049
+ for (const n of p)
1050
+ if (n.exclusionGroup && n.exclusionGroup !== "separator" && m[n.exclusionGroup]) {
1051
+ r = n.exclusionGroup;
1052
+ break;
1053
+ }
1054
+ }
1055
+ for (const n of s) {
1056
+ const S = t.current.querySelectorAll(
1057
+ `[data-group="${n}"]`
1058
+ );
1059
+ C && e && r ? n === r ? S.forEach((a) => {
1060
+ a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
1061
+ }) : S.forEach((a) => {
1062
+ a.style.display = "none", a.style.setProperty("display", "none", "important");
1063
+ }) : S.forEach((a) => {
1064
+ a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
1065
+ });
1066
+ }
1067
+ t.current.querySelectorAll(
1068
+ '[data-group="separator"]'
1069
+ ).forEach((n) => {
1070
+ n.style.display = e ? "none" : "inline";
1027
1071
  });
1028
- const A = v((t, c) => {
1029
- let R = 0;
1030
- a(!0);
1072
+ }
1073
+ function xe(t, p, u, s) {
1074
+ if (!t.current) {
1075
+ s(!1);
1076
+ return;
1077
+ }
1078
+ const i = [];
1079
+ for (let e = 0; e < p.length; e++) {
1080
+ const r = p[e];
1081
+ if ((r.type === "variable" || r.type === "upload" || r.type === "multi-variable") && r.required && r.key) {
1082
+ i.push({
1083
+ exclusionGroup: r.exclusionGroup || "",
1084
+ key: r.key,
1085
+ type: r.type === "multi-variable" ? "variable" : r.type,
1086
+ isMultiVariable: r.type === "multi-variable"
1087
+ });
1088
+ continue;
1089
+ }
1090
+ if (r.type === "text" && r.className?.includes("rte-text-required") && r.exclusionGroup)
1091
+ for (let q = e + 1; q < p.length; q++) {
1092
+ const n = p[q];
1093
+ if (n.exclusionGroup === r.exclusionGroup && (n.type === "variable" || n.type === "upload") && n.key) {
1094
+ i.push({
1095
+ exclusionGroup: r.exclusionGroup,
1096
+ key: n.key,
1097
+ type: n.type
1098
+ });
1099
+ break;
1100
+ }
1101
+ }
1102
+ }
1103
+ const m = p.some((e) => e.exclusionGroup === "separator");
1104
+ let C = !1;
1105
+ if (m && i.length > 1) {
1106
+ const e = p.findIndex((n) => n.exclusionGroup === "separator"), r = i.filter((n) => p.findIndex(
1107
+ (a) => (a.type === "variable" || a.type === "upload") && a.key === n.key && a.exclusionGroup === n.exclusionGroup
1108
+ ) < e), q = i.filter((n) => p.findIndex(
1109
+ (a) => (a.type === "variable" || a.type === "upload") && a.key === n.key && a.exclusionGroup === n.exclusionGroup
1110
+ ) > e);
1111
+ C = r.length > 0 && q.length > 0;
1112
+ }
1113
+ if (i.length === 0) {
1114
+ s(!0);
1115
+ return;
1116
+ }
1117
+ const h = i.filter((e) => {
1118
+ if (!t.current) return !1;
1119
+ const r = t.current.querySelectorAll(
1120
+ `[data-group="${e.exclusionGroup}"]`
1121
+ );
1122
+ return r.length === 0 ? !1 : r[0].style.display !== "none";
1123
+ });
1124
+ if (h.length === 0) {
1125
+ s(!0);
1126
+ return;
1127
+ }
1128
+ if (C) {
1129
+ let e = !1;
1130
+ for (const r of h)
1131
+ if (r.type === "upload" && r.key) {
1132
+ if (u[r.key] !== null && u[r.key] !== void 0) {
1133
+ e = !0;
1134
+ break;
1135
+ }
1136
+ } else if (r.type === "variable" && r.key)
1137
+ if (r.isMultiVariable) {
1138
+ const q = t.current.querySelectorAll(
1139
+ `[data-type="variable"][data-multi-key="${r.key}"]`
1140
+ );
1141
+ let n = !1;
1142
+ for (const S of Array.from(q))
1143
+ if (S.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1144
+ n = !0;
1145
+ break;
1146
+ }
1147
+ if (n) {
1148
+ e = !0;
1149
+ break;
1150
+ }
1151
+ } else {
1152
+ const q = t.current.querySelector(
1153
+ `[data-type="variable"][data-key="${r.key}"]`
1154
+ );
1155
+ if (q && q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1156
+ e = !0;
1157
+ break;
1158
+ }
1159
+ }
1160
+ s(e);
1161
+ } else {
1162
+ let e = !0;
1163
+ for (const r of h)
1164
+ if (r.type === "upload" && r.key) {
1165
+ if (u[r.key] === null || u[r.key] === void 0) {
1166
+ e = !1;
1167
+ break;
1168
+ }
1169
+ } else if (r.type === "variable" && r.key)
1170
+ if (r.isMultiVariable) {
1171
+ const q = t.current.querySelectorAll(
1172
+ `[data-type="variable"][data-multi-key="${r.key}"]`
1173
+ );
1174
+ let n = !1;
1175
+ for (const S of Array.from(q))
1176
+ if (S.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1177
+ n = !0;
1178
+ break;
1179
+ }
1180
+ if (!n) {
1181
+ e = !1;
1182
+ break;
1183
+ }
1184
+ } else {
1185
+ const q = t.current.querySelector(
1186
+ `[data-type="variable"][data-key="${r.key}"]`
1187
+ );
1188
+ if (!q) {
1189
+ e = !1;
1190
+ break;
1191
+ }
1192
+ if (q.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
1193
+ e = !1;
1194
+ break;
1195
+ }
1196
+ }
1197
+ s(e);
1198
+ }
1199
+ }
1200
+ function ge(t, p) {
1201
+ if (!t.current) return;
1202
+ t.current.querySelectorAll('[data-type="variable"]').forEach((s) => {
1203
+ const i = s.innerText.replace(/\n/g, "");
1204
+ i.replace(/\u200B/g, "") ? s.classList.remove("show-placeholder") : (i !== "​" && (s.innerText = "​"), s.classList.add("show-placeholder"));
1205
+ });
1206
+ }
1207
+ function st(t, p, u, s, i, m = {}) {
1208
+ if (!t.current) return;
1209
+ let C = "", h = 0;
1210
+ for (; h < p.length; ) {
1211
+ const e = p[h], r = h + 1 < p.length ? p[h + 1] : null;
1212
+ if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && r) {
1213
+ const T = 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;
1214
+ if (T) {
1215
+ const N = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, v = "</span>";
1216
+ let k = "";
1217
+ e.className ? k = `<span class="${e.className}">${e.text ?? ""}</span>` : k = e.text ?? "";
1218
+ const $ = r, L = u[$.key] !== null && u[$.key] !== void 0, V = L ? u[$.key]?.name : $.text, P = L ? "" : "hidden", O = $.tooltip && !L ? "" : "hidden", G = L ? "has-file" : "", M = L && V ? ` data-file-name="${V.replace(/"/g, "&quot;")}"` : "", Y = `<span contenteditable="false" data-type="upload" data-key="${$.key}" class="upload-chip"><span class="upload-inner-wrapper ${G}"><span class="upload-icon">${L ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${M}>${V || $.text}</span>${$.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${O}" data-upload-key="${$.key}" data-tooltip="${$.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${P}" title="移除文件">×</span></span></span>`;
1219
+ C += N + k + Y + v, h += 2;
1220
+ continue;
1221
+ }
1222
+ if (g) {
1223
+ const N = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, v = "</span>";
1224
+ let k = "";
1225
+ e.className ? k = `<span class="${e.className}">${e.text ?? ""}</span>` : k = e.text ?? "";
1226
+ const $ = r, V = ($.key ? i[$.key] : void 0) || $.text || "", P = !V, O = P ? "​" : V, G = P ? "show-placeholder" : "", M = $.exclusionGroup ? ` data-group="${$.exclusionGroup}"` : "", Y = $.tooltip ? ` data-tooltip="${$.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${$.key || ""}"` : "", te = $.tooltip && P ? "" : "hidden", w = `<span contenteditable="true" data-type="variable" data-key="${$.key}" data-placeholder="${$.placeholder || ""}"${M}${Y} class="variable-chip ${G}">${O}${$.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${te}" data-variable-key="${$.key}" data-tooltip="${$.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1227
+ C += N + k + w + v, h += 2;
1228
+ continue;
1229
+ }
1230
+ }
1231
+ const n = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", S = e.exclusionGroup ? `<span ${n} class="exclusion-wrapper">` : "", a = e.exclusionGroup ? "</span>" : "";
1232
+ let A = "";
1233
+ if (e.type === "tag") {
1234
+ const T = 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"' : "", x = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1235
+ A = `<span contenteditable="false" class="tag-node group"${g}${x}><span class="tag-label">${e.text}</span>${T}</span>`;
1236
+ } else if (e.type === "text") {
1237
+ const T = s ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
1238
+ e.className ? A = `<span class="${e.className}"${T}>${e.text ?? ""}</span>` : A = s ? `<span${T}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
1239
+ } else if (e.type === "variable" && e.key) {
1240
+ const g = i[e.key] || e.text || "", x = !g, N = x ? "​" : g, v = x ? "show-placeholder" : "", k = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", $ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", L = e.tooltip && x ? "" : "hidden", V = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${k}${$} class="variable-chip ${v}">${N}${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>`;
1241
+ e.required ? A = `<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>` : A = V;
1242
+ } else if (e.type === "upload" && e.key) {
1243
+ const T = u[e.key] !== null && u[e.key] !== void 0, g = T ? u[e.key]?.name : e.text, x = T ? "" : "hidden", N = e.tooltip && !T ? "" : "hidden", v = T ? "has-file" : "", k = T && g ? ` data-file-name="${g.replace(/"/g, "&quot;")}"` : "", $ = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${v}"><span class="upload-icon">${T ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${k}>${g || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${N}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${x}" title="移除文件">×</span></span></span>`;
1244
+ e.required ? A = `<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>` : A = $;
1245
+ } else if (e.type === "multi-variable" && e.key) {
1246
+ const T = e.maxCount || 9, g = m[e.key] || 1, x = Math.min(g, T);
1247
+ let N = "";
1248
+ for (let v = 0; v < x; v++) {
1249
+ const k = `${e.key}_${v}`, $ = i[k] || "", L = !$, V = L ? "​" : $, P = L ? "show-placeholder" : "", O = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", G = e.tooltip && L ? "" : "hidden", M = `<span contenteditable="true" data-type="variable" data-key="${k}" data-multi-key="${e.key}" data-index="${v}" data-placeholder="${e.placeholder || ""}"${O} class="variable-chip ${P}">${V}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${G}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1250
+ N += M;
1251
+ }
1252
+ e.required ? A = `<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>${N}</span>` : A = N;
1253
+ }
1254
+ C += S + A + a, h++;
1255
+ }
1256
+ t.current && (t.current.innerHTML = C, setTimeout(() => {
1257
+ if (!t.current) return;
1258
+ t.current.querySelectorAll('[data-type="variable"]').forEach((r) => {
1259
+ const q = r.innerText.replace(/\n/g, "");
1260
+ q.replace(/\u200B/g, "") ? r.classList.remove("show-placeholder") : (q !== "​" && (r.innerText = "​"), r.classList.add("show-placeholder"));
1261
+ });
1262
+ }, 0));
1263
+ }
1264
+ function lt(t, p, u, s, i = {}, m, C) {
1265
+ const h = F(() => {
1266
+ if (!t.current) return;
1267
+ if (p.length === 0) {
1268
+ t.current.innerHTML = "";
1269
+ return;
1270
+ }
1271
+ let e = {};
1272
+ const r = t.current, q = r.__tempVariableValues;
1273
+ if (q ? (e = q, delete r.__tempVariableValues) : t.current.querySelectorAll(
1274
+ '[data-type="variable"]'
1275
+ ).forEach((S) => {
1276
+ const a = S.dataset.key;
1277
+ if (a) {
1278
+ const A = S.innerText.replace(/[\u200B\n]/g, "").trim();
1279
+ A && (e[a] = A);
1280
+ }
1281
+ }), st(t, p, u, s, e, i), m?.current) {
1282
+ const { key: n, offset: S } = m.current;
1283
+ setTimeout(() => {
1284
+ if (!t.current) return;
1285
+ const a = t.current.querySelector(
1286
+ `[data-type="variable"][data-key="${n}"]`
1287
+ );
1288
+ if (a) {
1289
+ try {
1290
+ const A = document.createRange(), T = document.createTreeWalker(
1291
+ a,
1292
+ NodeFilter.SHOW_TEXT,
1293
+ null
1294
+ );
1295
+ let g = 0, x = null, N = 0;
1296
+ for (; T.nextNode(); ) {
1297
+ const v = T.currentNode, k = v.textContent?.length || 0;
1298
+ if (g + k >= S) {
1299
+ x = v, N = S - g;
1300
+ break;
1301
+ }
1302
+ g += k;
1303
+ }
1304
+ if (x) {
1305
+ A.setStart(x, Math.min(N, x.textContent?.length || 0)), A.collapse(!0);
1306
+ const v = window.getSelection();
1307
+ v && (v.removeAllRanges(), v.addRange(A), a.focus());
1308
+ } else {
1309
+ A.selectNodeContents(a), A.collapse(!1);
1310
+ const v = window.getSelection();
1311
+ v && (v.removeAllRanges(), v.addRange(A), a.focus());
1312
+ }
1313
+ } catch {
1314
+ const A = document.createRange();
1315
+ A.selectNodeContents(a), A.collapse(!1);
1316
+ const T = window.getSelection();
1317
+ T && (T.removeAllRanges(), T.addRange(A), a.focus());
1318
+ }
1319
+ m.current = null;
1320
+ }
1321
+ }, 0);
1322
+ }
1323
+ }, [p, u, s, t, i, m, C]);
1324
+ Z(() => {
1325
+ h();
1326
+ }, [h]);
1327
+ }
1328
+ function it(t, p, u, s) {
1329
+ Z(() => {
1330
+ const i = t.current;
1331
+ if (!i) return;
1332
+ const m = (h) => {
1333
+ const e = h.target?.closest(".upload-info-icon");
1334
+ if (e && e.classList.contains("upload-info-icon")) {
1335
+ const r = e.dataset.uploadKey;
1336
+ r && s({ key: r, anchorEl: e, type: "upload" });
1337
+ }
1338
+ }, C = (h) => {
1339
+ const e = h.target?.closest(".upload-info-icon"), r = h.relatedTarget;
1340
+ e && e.classList.contains("upload-info-icon") && (!r || !i.contains(r) ? s(null) : r.closest(".upload-info-icon") || s(null));
1341
+ };
1342
+ return i.addEventListener("mouseover", m, !0), i.addEventListener("mouseout", C, !0), () => {
1343
+ i.removeEventListener("mouseover", m, !0), i.removeEventListener("mouseout", C, !0);
1344
+ };
1345
+ }, [p, u, t, s]);
1346
+ }
1347
+ function ct(t, p, u) {
1348
+ Z(() => {
1349
+ if (!t.current) return;
1350
+ const s = (h) => {
1351
+ const e = h.currentTarget, r = e.dataset.tooltip, q = e.dataset.tagKey || "";
1352
+ r && u({ key: q, anchorEl: e, type: "tag" });
1353
+ }, i = () => {
1354
+ u(null);
1355
+ };
1356
+ let m;
1031
1357
  const C = () => {
1032
- R < t.length ? (S(t.slice(0, R + 1)), R++, b.current = window.setTimeout(C, i)) : (a(!1), c?.());
1358
+ if (!t.current) return;
1359
+ t.current.querySelectorAll(
1360
+ ".tag-node[data-tooltip]"
1361
+ ).forEach((e) => {
1362
+ e.addEventListener("mouseenter", s), e.addEventListener("mouseleave", i);
1363
+ });
1364
+ };
1365
+ return m = requestAnimationFrame(() => {
1366
+ m = requestAnimationFrame(C);
1367
+ }), () => {
1368
+ cancelAnimationFrame(m), t.current && t.current.querySelectorAll(
1369
+ ".tag-node[data-tooltip]"
1370
+ ).forEach((e) => {
1371
+ e.removeEventListener("mouseenter", s), e.removeEventListener("mouseleave", i);
1372
+ });
1373
+ };
1374
+ }, [p, t, u]);
1375
+ }
1376
+ function ut(t, p, u) {
1377
+ Z(() => {
1378
+ const s = t.current;
1379
+ if (!s) return;
1380
+ const i = (C) => {
1381
+ const h = C.target?.closest(".variable-info-icon");
1382
+ if (h && h.classList.contains("variable-info-icon")) {
1383
+ const e = h.dataset.variableKey;
1384
+ e && u({ key: e, anchorEl: h, type: "variable" });
1385
+ }
1386
+ }, m = (C) => {
1387
+ const h = C.target?.closest(".variable-info-icon"), e = C.relatedTarget;
1388
+ h && h.classList.contains("variable-info-icon") && (!e || !s.contains(e) ? u(null) : e.closest(".variable-info-icon") || u(null));
1389
+ };
1390
+ return s.addEventListener("mouseover", i, !0), s.addEventListener("mouseout", m, !0), () => {
1391
+ s.removeEventListener("mouseover", i, !0), s.removeEventListener("mouseout", m, !0);
1033
1392
  };
1034
- C();
1035
- }, [i]), F = v((t) => {
1036
- let c = D.current.length;
1037
- const R = () => {
1038
- c > 0 ? (S(D.current.slice(0, c - 1)), c--, b.current = window.setTimeout(R, i / 2)) : t?.();
1393
+ }, [p, t, u]);
1394
+ }
1395
+ function dt(t, p, u, s) {
1396
+ Z(() => {
1397
+ if (!t.current) return;
1398
+ const i = (e) => {
1399
+ const r = e.currentTarget;
1400
+ r.dataset.fileName && s({ key: "", anchorEl: r, type: "upload-label" });
1401
+ }, m = () => {
1402
+ s(null);
1403
+ };
1404
+ let C;
1405
+ const h = () => {
1406
+ if (!t.current) return;
1407
+ t.current.querySelectorAll(
1408
+ ".upload-label[data-file-name]"
1409
+ ).forEach((r) => {
1410
+ r.addEventListener("mouseenter", i), r.addEventListener("mouseleave", m);
1411
+ });
1412
+ };
1413
+ return C = requestAnimationFrame(() => {
1414
+ C = requestAnimationFrame(h);
1415
+ }), () => {
1416
+ cancelAnimationFrame(C), t.current && t.current.querySelectorAll(
1417
+ ".upload-label[data-file-name]"
1418
+ ).forEach((r) => {
1419
+ r.removeEventListener("mouseenter", i), r.removeEventListener("mouseleave", m);
1420
+ });
1421
+ };
1422
+ }, [p, u, t, s]);
1423
+ }
1424
+ function pt(t, p, u, s) {
1425
+ Z(() => {
1426
+ be(t, p, u), xe(t, p, u, s);
1427
+ }, [u, p, t, s]);
1428
+ }
1429
+ function ft(t, p) {
1430
+ Z(() => {
1431
+ if (!t.current) return;
1432
+ let u = !1, s = 0;
1433
+ const i = () => {
1434
+ u = !0;
1435
+ }, m = () => {
1436
+ u = !1, s = Date.now();
1039
1437
  };
1040
- R();
1041
- }, [i]), x = v(() => {
1042
- if (T.current.length === 0 || $.current) return;
1043
- I(!0);
1044
- const t = T.current[g.current];
1045
- D.current ? F(() => {
1046
- A(t, () => {
1047
- p.current = window.setTimeout(() => {
1048
- k((c) => (c + 1) % T.current.length), I(!1);
1438
+ let C = !1, h = 0;
1439
+ const e = () => {
1440
+ C = !0;
1441
+ }, r = () => {
1442
+ C = !1, h = Date.now();
1443
+ }, q = () => {
1444
+ h = Date.now();
1445
+ }, n = () => {
1446
+ if (!t.current) return;
1447
+ const a = window.getSelection();
1448
+ if (!a || a.rangeCount === 0 || p.current || u || C || Date.now() - h < 500)
1449
+ return;
1450
+ const A = a.getRangeAt(0);
1451
+ if (!A.collapsed) {
1452
+ t.current.contains(A.commonAncestorContainer) || a.removeAllRanges();
1453
+ return;
1454
+ }
1455
+ const T = a.anchorNode;
1456
+ if (!T) return;
1457
+ if (!t.current.contains(T)) {
1458
+ a.removeAllRanges();
1459
+ return;
1460
+ }
1461
+ let g = null;
1462
+ if (T.nodeType === Node.ELEMENT_NODE ? g = T.closest('[data-type="variable"]') : T.nodeType === Node.TEXT_NODE && T.parentElement && (g = T.parentElement.closest('[data-type="variable"]')), !g) {
1463
+ if (Date.now() - s > 500)
1464
+ return;
1465
+ const x = t.current.querySelectorAll('[data-type="variable"]');
1466
+ if (x.length > 0) {
1467
+ let N = null;
1468
+ for (const v of Array.from(x))
1469
+ if (v.style.display !== "none") {
1470
+ N = v;
1471
+ break;
1472
+ }
1473
+ if (!N && x.length > 0 && (N = x[0]), N) {
1474
+ const v = document.createRange();
1475
+ v.selectNodeContents(N), v.collapse(!1), a.removeAllRanges(), a.addRange(v), N.focus();
1476
+ } else
1477
+ a.removeAllRanges();
1478
+ } else
1479
+ a.removeAllRanges();
1480
+ }
1481
+ }, S = t.current;
1482
+ return S && (S.addEventListener("compositionstart", e), S.addEventListener("compositionend", r), S.addEventListener("input", q)), document.addEventListener("mousedown", i), document.addEventListener("mouseup", m), document.addEventListener("selectionchange", n), () => {
1483
+ const a = t.current;
1484
+ a && (a.removeEventListener("compositionstart", e), a.removeEventListener("compositionend", r), a.removeEventListener("input", q)), document.removeEventListener("mousedown", i), document.removeEventListener("mouseup", m), document.removeEventListener("selectionchange", n);
1485
+ };
1486
+ }, [t, p]);
1487
+ }
1488
+ const mt = ({
1489
+ config: t,
1490
+ onSend: p,
1491
+ isProcessing: u = !1,
1492
+ disabled: s = !1,
1493
+ width: i,
1494
+ lockStructure: m = !1,
1495
+ agentOptions: C = [],
1496
+ onAgentSelect: h,
1497
+ onAgentExit: e,
1498
+ loading: r = !1,
1499
+ placeholder: q
1500
+ }) => {
1501
+ const n = K(null), S = K(null), [a, A] = z({}), [T, g] = z(null), [x, N] = z(null), v = K(!1), k = K(null), [$, L] = z(!1), V = K(null), [P, O] = z(!0), [G, M] = z(() => {
1502
+ const c = {};
1503
+ return t.forEach((f) => {
1504
+ f.type === "multi-variable" && f.key && (c[f.key] = 1);
1505
+ }), c;
1506
+ });
1507
+ Z(() => {
1508
+ M((c) => {
1509
+ const f = {};
1510
+ return t.forEach((o) => {
1511
+ o.type === "multi-variable" && o.key && (f[o.key] = c[o.key] || 1);
1512
+ }), f;
1513
+ });
1514
+ }, [t]), lt(n, t, a, m, G, V), it(n, t, a, N), ct(n, t, N), dt(n, t, a, N), ut(n, t, N), pt(n, t, a, L), ft(n, v), Z(() => {
1515
+ if (t.length > 0) {
1516
+ O(!1);
1517
+ return;
1518
+ }
1519
+ const c = () => {
1520
+ if (!n.current) {
1521
+ O(!0);
1522
+ return;
1523
+ }
1524
+ const o = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", y = n.current.querySelectorAll('[data-type="variable"]'), b = n.current.querySelectorAll('[data-type="upload"]');
1525
+ let E = !1;
1526
+ y.forEach((I) => {
1527
+ (I.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (E = !0);
1528
+ }), b.forEach((I) => {
1529
+ I.querySelector(".upload-inner-wrapper.has-file") && (E = !0);
1530
+ });
1531
+ const R = !o && !E;
1532
+ O(R), t.length === 0 && L(!R);
1533
+ };
1534
+ c();
1535
+ const f = new MutationObserver(c);
1536
+ return n.current && f.observe(n.current, {
1537
+ childList: !0,
1538
+ subtree: !0,
1539
+ characterData: !0
1540
+ }), () => {
1541
+ f.disconnect();
1542
+ };
1543
+ }, [t]);
1544
+ const Y = (c) => {
1545
+ if (s) {
1546
+ c.preventDefault();
1547
+ return;
1548
+ }
1549
+ c.preventDefault();
1550
+ const f = c.clipboardData.getData("text/plain"), o = window.getSelection();
1551
+ if (o && o.rangeCount > 0) {
1552
+ const y = o.anchorNode;
1553
+ if (y) {
1554
+ let b = null;
1555
+ if (y.nodeType === Node.ELEMENT_NODE ? b = y.closest('[data-type="variable"]') : y.nodeType === Node.TEXT_NODE && y.parentElement && (b = y.parentElement.closest('[data-type="variable"]')), b) {
1556
+ const E = b.dataset.multiKey;
1557
+ if (E) {
1558
+ const R = f.split(/[,\n\r\t]+/).map((I) => I.trim()).filter((I) => I.length > 0);
1559
+ if (R.length > 1) {
1560
+ const I = parseInt(b.dataset.index || "0", 10), D = t.find((ne) => ne.type === "multi-variable" && ne.key === E)?.maxCount || 9, X = G[E] || 1, ee = Math.min(I + R.length, D);
1561
+ ee > X && M((Q) => ({
1562
+ ...Q,
1563
+ [E]: ee
1564
+ })), setTimeout(() => {
1565
+ n.current && (R.forEach((Q, ne) => {
1566
+ const ae = I + ne;
1567
+ if (ae >= D) return;
1568
+ const H = `${E}_${ae}`, re = n.current.querySelector(
1569
+ `[data-type="variable"][data-key="${H}"]`
1570
+ );
1571
+ re && (re.innerText = Q, re.classList.remove("show-placeholder"));
1572
+ }), l());
1573
+ }, 0);
1574
+ return;
1575
+ }
1576
+ }
1577
+ }
1578
+ }
1579
+ }
1580
+ document.execCommand("insertText", !1, f), l();
1581
+ }, te = (c) => {
1582
+ if (c.target.files && c.target.files[0] && T) {
1583
+ const f = c.target.files[0], o = T;
1584
+ A((y) => ({ ...y, [o]: f }));
1585
+ }
1586
+ c.target && (c.target.value = ""), g(null);
1587
+ }, w = (c) => {
1588
+ A((f) => {
1589
+ const o = { ...f };
1590
+ return delete o[c], o;
1591
+ });
1592
+ }, _ = (c) => {
1593
+ const f = c.target;
1594
+ if (f.closest(".tag-close-btn")) {
1595
+ if (c.preventDefault(), c.stopPropagation(), m)
1596
+ return;
1597
+ N(null), e ? e() : n.current && (n.current.innerHTML = "", n.current.focus());
1598
+ return;
1599
+ }
1600
+ if (m) {
1601
+ const b = f.closest(".tag-node"), E = f.closest('[data-type="text"]');
1602
+ if (b || E) {
1603
+ c.preventDefault(), c.stopPropagation();
1604
+ const R = window.getSelection();
1605
+ R && R.removeAllRanges();
1606
+ return;
1607
+ }
1608
+ }
1609
+ f.closest('[data-type="variable"]') || (k.current = { x: c.clientX, y: c.clientY }, v.current = !1, f.closest(".file-remove-btn") && (c.preventDefault(), c.stopPropagation()));
1610
+ }, W = (c) => {
1611
+ if (!c.target.closest('[data-type="variable"]') && k.current) {
1612
+ const y = Math.abs(c.clientX - k.current.x), b = Math.abs(c.clientY - k.current.y);
1613
+ (y > 3 || b > 3) && (v.current = !0);
1614
+ }
1615
+ }, U = (c) => {
1616
+ if (c.target.closest('[data-type="variable"]')) {
1617
+ k.current = null, v.current = !1;
1618
+ return;
1619
+ }
1620
+ k.current = null, v.current = !1;
1621
+ }, se = (c) => {
1622
+ if (s)
1623
+ return;
1624
+ const f = c.target;
1625
+ if (f.closest(".tag-close-btn")) {
1626
+ c.preventDefault(), c.stopPropagation();
1627
+ return;
1628
+ }
1629
+ if (t.length === 0)
1630
+ return;
1631
+ if (f.closest('[data-type="text"]')) {
1632
+ c.preventDefault(), c.stopPropagation();
1633
+ const I = window.getSelection();
1634
+ I && I.removeAllRanges();
1635
+ return;
1636
+ }
1637
+ if (m && f.closest(".tag-node")) {
1638
+ c.preventDefault(), c.stopPropagation();
1639
+ const D = window.getSelection();
1640
+ D && D.removeAllRanges();
1641
+ return;
1642
+ }
1643
+ if (f.closest('[data-type="variable"]')) {
1644
+ if (v.current)
1645
+ return;
1646
+ setTimeout(() => {
1647
+ const I = window.getSelection();
1648
+ I && !I.isCollapsed || ge(n);
1649
+ }, 10);
1650
+ return;
1651
+ }
1652
+ const E = f.closest(".file-remove-btn");
1653
+ if (E) {
1654
+ c.preventDefault(), c.stopPropagation();
1655
+ const D = E.closest('[data-type="upload"]')?.dataset.key;
1656
+ D && w(D);
1657
+ return;
1658
+ }
1659
+ const R = f.closest('[data-type="upload"]');
1660
+ if (R) {
1661
+ const I = R.dataset.key;
1662
+ I && (g(I), S.current?.click());
1663
+ return;
1664
+ }
1665
+ }, le = (c) => {
1666
+ const o = c.target.closest('[data-type="variable"]');
1667
+ if (o) {
1668
+ const y = window.getSelection();
1669
+ if (y) {
1670
+ const b = document.createRange(), E = o.textContent || "";
1671
+ if (E.replace(/\u200B/g, "")) {
1672
+ let I = 0, D = E.length;
1673
+ E.startsWith("​") && (I = 1), E.endsWith("​") && E.length > 1 && (D = E.length - 1);
1674
+ const X = o.firstChild;
1675
+ X && X.nodeType === Node.TEXT_NODE ? (b.setStart(X, I), b.setEnd(X, D)) : b.selectNodeContents(o);
1676
+ } else
1677
+ b.selectNodeContents(o), b.collapse(!0);
1678
+ y.removeAllRanges(), y.addRange(b);
1679
+ }
1680
+ }
1681
+ }, l = () => {
1682
+ if (t.length === 0) {
1683
+ if (n.current) {
1684
+ const o = !(n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
1685
+ O(o), L(!o);
1686
+ }
1687
+ return;
1688
+ }
1689
+ if (ge(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((o) => {
1690
+ const y = o.querySelector(".variable-info-icon");
1691
+ if (y) {
1692
+ let b = !1;
1693
+ const E = document.createTreeWalker(
1694
+ o,
1695
+ NodeFilter.SHOW_TEXT,
1696
+ {
1697
+ acceptNode: (R) => y.contains(R) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1698
+ }
1699
+ );
1700
+ for (; E.nextNode(); )
1701
+ if (E.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1702
+ b = !0;
1703
+ break;
1704
+ }
1705
+ b ? y.classList.add("hidden") : y.classList.remove("hidden");
1706
+ }
1707
+ }), be(n, t, a), xe(n, t, a, L), !n.current) return;
1708
+ t.filter((f) => f.type === "multi-variable" && f.key).forEach((f) => {
1709
+ if (!f.key) return;
1710
+ const o = f.maxCount || 9, y = G[f.key] || 1, b = [];
1711
+ for (let X = 0; X < y; X++) {
1712
+ const ee = `${f.key}_${X}`, Q = n.current.querySelector(
1713
+ `[data-type="variable"][data-key="${ee}"][data-multi-key="${f.key}"]`
1714
+ );
1715
+ if (Q) {
1716
+ const ne = Q.innerText.replace(/[\u200B\n]/g, "").trim();
1717
+ b.push(ne);
1718
+ }
1719
+ }
1720
+ const R = (b[b.length - 1] || "") === "";
1721
+ let I = !1, D = -1;
1722
+ for (let X = 0; X < b.length - 1; X++)
1723
+ if (b[X] === "") {
1724
+ I = !0, D = X;
1725
+ break;
1726
+ }
1727
+ if (I && D >= 0) {
1728
+ const X = window.getSelection();
1729
+ if (X && X.rangeCount > 0) {
1730
+ const H = X.getRangeAt(0), re = H.startContainer, ie = re.nodeType === Node.ELEMENT_NODE ? re.closest('[data-type="variable"][data-multi-key]') : re.parentElement?.closest('[data-type="variable"][data-multi-key]');
1731
+ if (ie) {
1732
+ const ce = ie.dataset.key;
1733
+ if (ce) {
1734
+ const ue = document.createRange();
1735
+ ue.setStartBefore(ie), ue.setEnd(H.startContainer, H.startOffset);
1736
+ const he = ue.toString().length;
1737
+ V.current = { key: ce, offset: he };
1738
+ }
1739
+ }
1740
+ }
1741
+ const ee = [...b];
1742
+ for (let H = D; H < ee.length - 1; H++)
1743
+ ee[H] = ee[H + 1];
1744
+ ee.pop();
1745
+ const Q = {};
1746
+ ee.forEach((H, re) => {
1747
+ H && (Q[`${f.key}_${re}`] = H);
1748
+ });
1749
+ const ne = Math.max(R ? ee.length : ee.length + 1, 1);
1750
+ n.current.querySelectorAll(
1751
+ '[data-type="variable"]'
1752
+ ).forEach((H) => {
1753
+ const re = H.dataset.key, ie = H.dataset.multiKey;
1754
+ if (re && ie !== f.key) {
1755
+ const ce = H.innerText.replace(/[\u200B\n]/g, "").trim();
1756
+ ce && (Q[re] = ce);
1757
+ }
1758
+ }), n.current.__tempVariableValues = Q, M((H) => ({
1759
+ ...H,
1760
+ [f.key]: ne
1761
+ }));
1762
+ return;
1763
+ }
1764
+ if (!R) {
1765
+ const X = y - 1, ee = `${f.key}_${X}`, Q = n.current.querySelector(
1766
+ `[data-type="variable"][data-key="${ee}"][data-multi-key="${f.key}"]`
1767
+ );
1768
+ if (Q && Q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && y < o) {
1769
+ const ae = window.getSelection();
1770
+ if (ae && ae.rangeCount > 0) {
1771
+ const H = ae.getRangeAt(0), re = H.startContainer, ie = re.nodeType === Node.ELEMENT_NODE ? re.closest('[data-type="variable"][data-multi-key]') : re.parentElement?.closest('[data-type="variable"][data-multi-key]');
1772
+ if (ie) {
1773
+ const ce = ie.dataset.key;
1774
+ if (ce) {
1775
+ const ue = document.createRange();
1776
+ ue.setStartBefore(ie), ue.setEnd(H.startContainer, H.startOffset);
1777
+ const he = ue.toString().length;
1778
+ V.current = { key: ce, offset: he };
1779
+ }
1780
+ }
1781
+ }
1782
+ M((H) => ({
1783
+ ...H,
1784
+ [f.key]: y + 1
1785
+ }));
1786
+ }
1787
+ }
1788
+ });
1789
+ }, j = () => {
1790
+ n.current && (ge(n), be(n, t, a), xe(n, t, a, L));
1791
+ }, B = (c) => {
1792
+ if (s) {
1793
+ c.preventDefault();
1794
+ return;
1795
+ }
1796
+ const f = window.getSelection();
1797
+ if (f && f.rangeCount > 0) {
1798
+ const o = f.anchorNode;
1799
+ let y = null;
1800
+ if (o && (o.nodeType === Node.ELEMENT_NODE ? y = o.closest('[data-type="text"]') : o.nodeType === Node.TEXT_NODE && o.parentElement && (y = o.parentElement.closest('[data-type="text"]'))), y) {
1801
+ if (c.preventDefault(), c.stopPropagation(), n.current) {
1802
+ const b = n.current.querySelector(
1803
+ '[data-type="variable"], [data-type="upload"]'
1804
+ );
1805
+ b && b.focus();
1806
+ }
1807
+ return;
1808
+ }
1809
+ }
1810
+ if (m && f && f.rangeCount > 0) {
1811
+ const o = f.anchorNode;
1812
+ let y = null;
1813
+ if (o && (o.nodeType === Node.ELEMENT_NODE ? y = o.closest(".tag-node") : o.nodeType === Node.TEXT_NODE && o.parentElement && (y = o.parentElement.closest(".tag-node"))), y) {
1814
+ if (c.preventDefault(), c.stopPropagation(), n.current) {
1815
+ const b = n.current.querySelector(
1816
+ '[data-type="variable"], [data-type="upload"]'
1817
+ );
1818
+ b && b.focus();
1819
+ }
1820
+ return;
1821
+ }
1822
+ }
1823
+ if (c.key === "Enter" && !c.shiftKey && (c.preventDefault(), J()), c.key === "Escape" && n.current) {
1824
+ if (m) {
1825
+ c.preventDefault();
1826
+ return;
1827
+ }
1828
+ n.current.innerHTML = "", n.current.focus();
1829
+ }
1830
+ if (c.key === "Backspace") {
1831
+ const o = window.getSelection();
1832
+ if (o && o.rangeCount > 0) {
1833
+ const y = o.getRangeAt(0), b = o.anchorNode;
1834
+ if (m) {
1835
+ let R = null, I = null;
1836
+ if (b && (b.nodeType === Node.ELEMENT_NODE ? (R = b.closest(".tag-node"), I = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (R = b.parentElement.closest(".tag-node"), I = b.parentElement.closest('[data-type="text"]'))), (R || I) && y.collapsed && y.startOffset === 0) {
1837
+ c.preventDefault();
1838
+ return;
1839
+ }
1840
+ }
1841
+ let E = null;
1842
+ if (b && (b.nodeType === Node.ELEMENT_NODE ? E = b.closest(
1843
+ '[data-type="variable"]'
1844
+ ) : b.nodeType === Node.TEXT_NODE && b.parentElement && (E = b.parentElement.closest(
1845
+ '[data-type="variable"]'
1846
+ ))), E) {
1847
+ if (!y.collapsed)
1848
+ return;
1849
+ const R = E.innerText;
1850
+ if (R === "​" || R === "") {
1851
+ c.preventDefault();
1852
+ return;
1853
+ }
1854
+ if (y.startOffset === 0) {
1855
+ c.preventDefault();
1856
+ return;
1857
+ }
1858
+ if (R.startsWith("​") && y.startOffset === 1) {
1859
+ c.preventDefault();
1860
+ return;
1861
+ }
1862
+ }
1863
+ }
1864
+ }
1865
+ }, J = () => {
1866
+ if (u || s || r || !$ || !n.current) return;
1867
+ if (t.length === 0) {
1868
+ const E = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
1869
+ if (!E) return;
1870
+ p(E, E);
1871
+ return;
1872
+ }
1873
+ const c = n.current;
1874
+ let f = "";
1875
+ const o = {}, y = (E) => {
1876
+ if (!(E.nodeType === Node.ELEMENT_NODE && E.style.display === "none")) {
1877
+ if (E.nodeType === Node.TEXT_NODE)
1878
+ f += (E.textContent || "").replace(/\u200B/g, "");
1879
+ else if (E.nodeType === Node.ELEMENT_NODE) {
1880
+ const R = E, I = R.dataset.type, D = R.dataset.key;
1881
+ if (I === "variable" && D) {
1882
+ let X = "";
1883
+ const ee = document.createTreeWalker(
1884
+ R,
1885
+ NodeFilter.SHOW_TEXT,
1886
+ {
1887
+ acceptNode: (ne) => {
1888
+ const ae = R.querySelector(".variable-info-icon");
1889
+ return ae && ae.contains(ne) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
1890
+ }
1891
+ }
1892
+ );
1893
+ for (; ee.nextNode(); )
1894
+ X += ee.currentNode.textContent || "";
1895
+ const Q = X.replace(/[\u200B\n]/g, "").trim();
1896
+ if (Q) {
1897
+ const ne = R.dataset.multiKey;
1898
+ if (ne) {
1899
+ o[ne] || (o[ne] = []);
1900
+ const ae = o[ne];
1901
+ ae.push(Q), ae.length > 1 && (f += " "), f += Q;
1902
+ } else
1903
+ o[D] = Q, f += Q;
1904
+ }
1905
+ } else if (I === "upload" && D)
1906
+ o[D] = a[D] ?? null, a[D] && (f += ` [附带文件: ${a[D]?.name}] `);
1907
+ else {
1908
+ if (R.classList.contains("tag-close-btn") || R.classList.contains("file-remove-btn")) return;
1909
+ R.getAttribute("contenteditable") === "false" && !I && R.classList.contains("tag-node") ? f += R.innerText : R.childNodes.forEach(y);
1910
+ }
1911
+ }
1912
+ }
1913
+ };
1914
+ if (c.childNodes.forEach(y), f = f.trim(), !f) return;
1915
+ const b = new FormData();
1916
+ b.append("fullPrompt", f), Object.keys(o).forEach((E) => {
1917
+ const R = o[E];
1918
+ R != null && (R instanceof File ? b.append(E, R) : Array.isArray(R) ? R.forEach((I, D) => {
1919
+ I != null && (I instanceof File ? b.append(`${E}[${D}]`, I) : typeof I == "string" ? b.append(`${E}[${D}]`, I) : b.append(`${E}[${D}]`, String(I)));
1920
+ }) : typeof R == "string" ? b.append(E, R) : b.append(E, String(R)));
1921
+ }), p(b, f);
1922
+ }, oe = i ? { width: typeof i == "number" ? `${i}px` : i } : {};
1923
+ return /* @__PURE__ */ d.jsxs(
1924
+ "div",
1925
+ {
1926
+ className: "rich-text-editor",
1927
+ style: oe,
1928
+ "data-disabled": s,
1929
+ children: [
1930
+ /* @__PURE__ */ d.jsx(
1931
+ "div",
1932
+ {
1933
+ ref: n,
1934
+ className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${P && q ? "rte-editor-empty" : ""}`,
1935
+ contentEditable: t.length === 0,
1936
+ suppressContentEditableWarning: !0,
1937
+ "data-placeholder": q,
1938
+ onMouseDown: _,
1939
+ onMouseMove: W,
1940
+ onMouseUp: U,
1941
+ onClick: se,
1942
+ onDoubleClick: le,
1943
+ onInput: l,
1944
+ onKeyDown: B,
1945
+ onPaste: Y,
1946
+ onBlur: j
1947
+ }
1948
+ ),
1949
+ /* @__PURE__ */ d.jsx(
1950
+ "input",
1951
+ {
1952
+ type: "file",
1953
+ ref: S,
1954
+ className: "rte-file-input",
1955
+ accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
1956
+ onChange: te
1957
+ }
1958
+ ),
1959
+ /* @__PURE__ */ d.jsxs("div", { className: "rich-text-editor-footer", children: [
1960
+ /* @__PURE__ */ d.jsx("div", { className: "rich-text-editor-footer-left", children: /* @__PURE__ */ d.jsxs("div", { className: "rich-text-editor-brand", children: [
1961
+ /* @__PURE__ */ d.jsxs("div", { className: "rte-brand-badge", children: [
1962
+ /* @__PURE__ */ d.jsx("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
1963
+ /* @__PURE__ */ d.jsx("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
1964
+ ] }),
1965
+ /* @__PURE__ */ d.jsx(
1966
+ Le,
1967
+ {
1968
+ placement: "top",
1969
+ menu: {
1970
+ items: C.map((c) => ({
1971
+ key: c.key,
1972
+ label: /* @__PURE__ */ d.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
1973
+ c.icon && /* @__PURE__ */ d.jsx("i", { className: c.icon }),
1974
+ /* @__PURE__ */ d.jsx("span", { children: c.label })
1975
+ ] }),
1976
+ onClick: () => {
1977
+ h?.(c);
1978
+ }
1979
+ }))
1980
+ },
1981
+ trigger: ["click"],
1982
+ disabled: s || u,
1983
+ children: /* @__PURE__ */ d.jsxs("div", { className: "rte-agent-badge", style: { cursor: C.length > 0 ? "pointer" : "default" }, children: [
1984
+ /* @__PURE__ */ d.jsx("i", { className: "iconfont icon-zhinengti" }),
1985
+ /* @__PURE__ */ d.jsx("span", { className: "rte-agent-text", children: "智能体" })
1986
+ ] })
1987
+ }
1988
+ )
1989
+ ] }) }),
1990
+ /* @__PURE__ */ d.jsx(
1991
+ "button",
1992
+ {
1993
+ type: "button",
1994
+ onClick: J,
1995
+ disabled: u || s || r || !$,
1996
+ className: "rich-text-editor-send-button",
1997
+ children: u || r ? /* @__PURE__ */ d.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ d.jsx("i", { className: "iconfont icon-fasong" })
1998
+ }
1999
+ )
2000
+ ] }),
2001
+ x?.anchorEl && (() => {
2002
+ if (!document.body.contains(x.anchorEl))
2003
+ return null;
2004
+ let c = "";
2005
+ return x.type === "upload" ? c = t.find(
2006
+ (o) => o.type === "upload" && o.key === x.key
2007
+ )?.tooltip || "" : x.type === "tag" ? c = x.anchorEl.dataset.tooltip || "" : x.type === "upload-label" ? c = x.anchorEl.dataset.fileName || "" : x.type === "variable" && (c = x.anchorEl.dataset.tooltip || ""), He(
2008
+ /* @__PURE__ */ d.jsx(
2009
+ Ve,
2010
+ {
2011
+ arrow: !1,
2012
+ title: /* @__PURE__ */ d.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children: c }),
2013
+ open: !0,
2014
+ placement: "top",
2015
+ getPopupContainer: () => document.body,
2016
+ overlayInnerStyle: {
2017
+ background: "var(--neutral-800, #262626)"
2018
+ },
2019
+ children: /* @__PURE__ */ d.jsx(
2020
+ "div",
2021
+ {
2022
+ style: {
2023
+ position: "fixed",
2024
+ left: `${x.anchorEl.getBoundingClientRect().left}px`,
2025
+ top: `${x.anchorEl.getBoundingClientRect().top}px`,
2026
+ width: `${x.anchorEl.offsetWidth}px`,
2027
+ height: `${x.anchorEl.offsetHeight}px`,
2028
+ pointerEvents: "none"
2029
+ }
2030
+ }
2031
+ )
2032
+ }
2033
+ ),
2034
+ document.body
2035
+ );
2036
+ })()
2037
+ ]
2038
+ }
2039
+ );
2040
+ };
2041
+ mt.__docgenInfo = {
2042
+ displayName: "RichTextEditor",
2043
+ description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
2044
+ props: {
2045
+ config: {
2046
+ name: "config",
2047
+ required: !0,
2048
+ description: "结构化输入配置节点数组",
2049
+ type: { name: "InputNode[]", raw: "InputNode[]" }
2050
+ },
2051
+ onSend: {
2052
+ name: "onSend",
2053
+ required: !0,
2054
+ description: "点击发送按钮时的回调,返回数据与拼接后的 Prompt",
2055
+ type: {
2056
+ name: "function",
2057
+ raw: "(data: Record<string, any>, fullPrompt: string) => void"
2058
+ }
2059
+ },
2060
+ isProcessing: {
2061
+ name: "isProcessing",
2062
+ required: !1,
2063
+ description: "是否处于处理状态(禁用输入与发送)",
2064
+ type: { name: "boolean", raw: "boolean" },
2065
+ defaultValue: { value: "false" }
2066
+ }
2067
+ }
2068
+ };
2069
+ const yt = ({
2070
+ texts: t = [],
2071
+ placeholder: p = "请输入内容",
2072
+ animationSpeed: u = 100,
2073
+ autoPlay: s = !0,
2074
+ value: i,
2075
+ onChange: m,
2076
+ ...C
2077
+ }) => {
2078
+ const [h, e] = z(""), [r, q] = z(0), [n, S] = z(!1), [a, A] = z(!1), [T, g] = z(!1), x = K(void 0), N = K(void 0), v = K(t), k = K(r), $ = K(a), L = K(h);
2079
+ Z(() => {
2080
+ v.current = t, k.current = r, $.current = a, L.current = h;
2081
+ });
2082
+ const V = F((w, _) => {
2083
+ let W = 0;
2084
+ g(!0);
2085
+ const U = () => {
2086
+ W < w.length ? (e(w.slice(0, W + 1)), W++, N.current = window.setTimeout(U, u)) : (g(!1), _?.());
2087
+ };
2088
+ U();
2089
+ }, [u]), P = F((w) => {
2090
+ let _ = L.current.length;
2091
+ const W = () => {
2092
+ _ > 0 ? (e(L.current.slice(0, _ - 1)), _--, N.current = window.setTimeout(W, u / 2)) : w?.();
2093
+ };
2094
+ W();
2095
+ }, [u]), O = F(() => {
2096
+ if (v.current.length === 0 || $.current) return;
2097
+ S(!0);
2098
+ const w = v.current[k.current];
2099
+ L.current ? P(() => {
2100
+ V(w, () => {
2101
+ x.current = window.setTimeout(() => {
2102
+ q((_) => (_ + 1) % v.current.length), S(!1);
1049
2103
  }, 2e3);
1050
2104
  });
1051
- }) : A(t, () => {
1052
- p.current = window.setTimeout(() => {
1053
- k((c) => (c + 1) % T.current.length), I(!1);
2105
+ }) : V(w, () => {
2106
+ x.current = window.setTimeout(() => {
2107
+ q((_) => (_ + 1) % v.current.length), S(!1);
1054
2108
  }, 2e3);
1055
2109
  });
1056
- }, [F, A]);
1057
- U(() => (l && n.length > 0 && !h && x(), () => {
1058
- p.current && window.clearTimeout(p.current), b.current && window.clearTimeout(b.current);
1059
- }), [_, h, l, n.length, x]), U(() => {
1060
- !N && l && n.length > 0 && !h && x();
1061
- }, [_, N, l, n.length, h, x]);
1062
- const L = (t) => {
1063
- P(!0), p.current && window.clearTimeout(p.current), b.current && window.clearTimeout(b.current), I(!1), a(!1), E.onFocus?.(t);
1064
- }, q = (t) => {
1065
- P(!1), !o && n.length > 0 && (S(""), k(0)), E.onBlur?.(t);
1066
- }, B = (t) => {
1067
- d?.(t.target.value), E.onChange?.(t);
1068
- }, H = () => h || o ? s : m || s;
1069
- return /* @__PURE__ */ r.jsxs("div", { style: { position: "relative" }, children: [
1070
- /* @__PURE__ */ r.jsx(
1071
- ue,
2110
+ }, [P, V]);
2111
+ Z(() => (s && t.length > 0 && !a && O(), () => {
2112
+ x.current && window.clearTimeout(x.current), N.current && window.clearTimeout(N.current);
2113
+ }), [r, a, s, t.length, O]), Z(() => {
2114
+ !n && s && t.length > 0 && !a && O();
2115
+ }, [r, n, s, t.length, a, O]);
2116
+ const G = (w) => {
2117
+ A(!0), x.current && window.clearTimeout(x.current), N.current && window.clearTimeout(N.current), S(!1), g(!1), C.onFocus?.(w);
2118
+ }, M = (w) => {
2119
+ A(!1), !i && t.length > 0 && (e(""), q(0)), C.onBlur?.(w);
2120
+ }, Y = (w) => {
2121
+ m?.(w.target.value), C.onChange?.(w);
2122
+ }, te = () => a || i ? p : h || p;
2123
+ return /* @__PURE__ */ d.jsxs("div", { style: { position: "relative" }, children: [
2124
+ /* @__PURE__ */ d.jsx(
2125
+ qe,
1072
2126
  {
1073
- ...E,
1074
- value: o,
1075
- onChange: B,
1076
- onFocus: L,
1077
- onBlur: q,
1078
- placeholder: H(),
2127
+ ...C,
2128
+ value: i,
2129
+ onChange: Y,
2130
+ onFocus: G,
2131
+ onBlur: M,
2132
+ placeholder: te(),
1079
2133
  style: {
1080
2134
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1081
- ...E.style,
2135
+ ...C.style,
1082
2136
  position: "relative",
1083
2137
  zIndex: 1
1084
2138
  }
1085
2139
  }
1086
2140
  ),
1087
- !h && !o && m && /* @__PURE__ */ r.jsxs(
2141
+ !a && !i && h && /* @__PURE__ */ d.jsxs(
1088
2142
  "div",
1089
2143
  {
1090
2144
  style: {
@@ -1104,8 +2158,8 @@ const Me = ({
1104
2158
  fontFamily: "inherit"
1105
2159
  },
1106
2160
  children: [
1107
- /* @__PURE__ */ r.jsx("span", { children: m }),
1108
- V && /* @__PURE__ */ r.jsx(
2161
+ /* @__PURE__ */ d.jsx("span", { children: h }),
2162
+ T && /* @__PURE__ */ d.jsx(
1109
2163
  "span",
1110
2164
  {
1111
2165
  style: {
@@ -1121,7 +2175,7 @@ const Me = ({
1121
2175
  ]
1122
2176
  }
1123
2177
  ),
1124
- /* @__PURE__ */ r.jsx("style", { children: `
2178
+ /* @__PURE__ */ d.jsx("style", { children: `
1125
2179
  @keyframes blink {
1126
2180
  0%, 50% { opacity: 1; }
1127
2181
  51%, 100% { opacity: 0; }
@@ -1129,7 +2183,7 @@ const Me = ({
1129
2183
  ` })
1130
2184
  ] });
1131
2185
  };
1132
- Me.__docgenInfo = {
2186
+ yt.__docgenInfo = {
1133
2187
  displayName: "DynamicInput",
1134
2188
  description: "动态文案输入框组件,支持流式文字动画效果",
1135
2189
  props: {
@@ -1174,109 +2228,109 @@ Me.__docgenInfo = {
1174
2228
  }
1175
2229
  }
1176
2230
  };
1177
- const $e = ({
1178
- texts: n = [],
2231
+ const ht = ({
2232
+ texts: t = [],
1179
2233
  // 动态文案数组,默认为空数组
1180
- placeholder: s = "请输入内容",
2234
+ placeholder: p = "请输入内容",
1181
2235
  // 占位符文本
1182
- animationSpeed: i = 100,
2236
+ animationSpeed: u = 100,
1183
2237
  // 打字机动画速度,毫秒
1184
- autoPlay: l = !0,
2238
+ autoPlay: s = !0,
1185
2239
  // 是否自动播放动画
1186
- value: o = "",
2240
+ value: i = "",
1187
2241
  // 受控模式的值
1188
- onChange: d,
2242
+ onChange: m,
1189
2243
  // 受控模式的变化回调
1190
- onSubmit: E,
2244
+ onSubmit: C,
1191
2245
  // 提交回调
1192
- maxLength: m = 500,
2246
+ maxLength: h = 500,
1193
2247
  // 最大字符数限制
1194
- showCount: S = !0,
2248
+ showCount: e = !0,
1195
2249
  // 是否显示字数统计
1196
- submitText: _ = "发送",
2250
+ submitText: r = "发送",
1197
2251
  // 提交按钮文本
1198
- disabled: k = !1,
2252
+ disabled: q = !1,
1199
2253
  // 是否禁用组件
1200
- rows: N = 4,
2254
+ rows: n = 4,
1201
2255
  // 文本域行数
1202
- style: I,
2256
+ style: S,
1203
2257
  // 自定义样式
1204
- ...h
2258
+ ...a
1205
2259
  // 其他原生属性
1206
2260
  }) => {
1207
- const [P, V] = j(""), [a, p] = j(0), [b, T] = j(!1), [g, $] = j(!1), [D, A] = j(!1), [F, x] = j(o || ""), L = z(void 0), q = z(void 0), B = z(n), H = z(a), t = z(g), c = z(P), R = z(null);
1208
- U(() => {
1209
- B.current = n, H.current = a, t.current = g, c.current = P;
2261
+ const [A, T] = z(""), [g, x] = z(0), [N, v] = z(!1), [k, $] = z(!1), [L, V] = z(!1), [P, O] = z(i || ""), G = K(void 0), M = K(void 0), Y = K(t), te = K(g), w = K(k), _ = K(A), W = K(null);
2262
+ Z(() => {
2263
+ Y.current = t, te.current = g, w.current = k, _.current = A;
1210
2264
  });
1211
- const C = v((f, y) => {
1212
- let W = 0;
1213
- A(!0);
1214
- const K = () => {
1215
- W < f.length ? (V(f.slice(0, W + 1)), W++, q.current = window.setTimeout(K, i)) : (A(!1), y?.());
2265
+ const U = F((o, y) => {
2266
+ let b = 0;
2267
+ V(!0);
2268
+ const E = () => {
2269
+ b < o.length ? (T(o.slice(0, b + 1)), b++, M.current = window.setTimeout(E, u)) : (V(!1), y?.());
1216
2270
  };
1217
- K();
1218
- }, [i]), G = v((f) => {
1219
- let y = c.current.length;
1220
- const W = () => {
1221
- y > 0 ? (V(c.current.slice(0, y - 1)), y--, q.current = window.setTimeout(W, i / 2)) : f?.();
2271
+ E();
2272
+ }, [u]), se = F((o) => {
2273
+ let y = _.current.length;
2274
+ const b = () => {
2275
+ y > 0 ? (T(_.current.slice(0, y - 1)), y--, M.current = window.setTimeout(b, u / 2)) : o?.();
1222
2276
  };
1223
- W();
1224
- }, [i]), J = v(() => {
1225
- if (B.current.length === 0 || t.current) return;
1226
- T(!0);
1227
- const f = B.current[H.current];
1228
- c.current ? G(() => {
1229
- C(f, () => {
1230
- L.current = window.setTimeout(() => {
1231
- p((y) => (y + 1) % B.current.length), T(!1);
2277
+ b();
2278
+ }, [u]), le = F(() => {
2279
+ if (Y.current.length === 0 || w.current) return;
2280
+ v(!0);
2281
+ const o = Y.current[te.current];
2282
+ _.current ? se(() => {
2283
+ U(o, () => {
2284
+ G.current = window.setTimeout(() => {
2285
+ x((y) => (y + 1) % Y.current.length), v(!1);
1232
2286
  }, 2e3);
1233
2287
  });
1234
- }) : C(f, () => {
1235
- L.current = window.setTimeout(() => {
1236
- p((y) => (y + 1) % B.current.length), T(!1);
2288
+ }) : U(o, () => {
2289
+ G.current = window.setTimeout(() => {
2290
+ x((y) => (y + 1) % Y.current.length), v(!1);
1237
2291
  }, 2e3);
1238
2292
  });
1239
- }, [G, C]);
1240
- U(() => (l && n.length > 0 && !g && J(), () => {
1241
- L.current && window.clearTimeout(L.current), q.current && window.clearTimeout(q.current);
1242
- }), [a, g, l, n.length, J]), U(() => {
1243
- !b && l && n.length > 0 && !g && J();
1244
- }, [a, b, l, n.length, g, J]);
1245
- const e = (f) => {
1246
- $(!0), L.current && window.clearTimeout(L.current), q.current && window.clearTimeout(q.current), T(!1), A(!1), h.onFocus?.(f);
1247
- }, u = (f) => {
1248
- $(!1), !o && n.length > 0 && (V(""), p(0)), h.onBlur?.(f);
1249
- }, w = (f) => {
1250
- const y = f.target.value;
1251
- m && y.length > m || (d ? d(y) : x(y), h.onChange?.(f));
1252
- }, O = () => {
1253
- const f = d ? o : F;
1254
- f.trim() && !k && (E?.(f), d || x(""));
1255
- }, Y = (f) => {
1256
- (f.ctrlKey || f.metaKey) && f.key === "Enter" && (f.preventDefault(), O()), h.onKeyDown?.(f);
1257
- }, M = d ? o : F, Q = k || !M.trim() || (m ? M.length > m : !1);
1258
- return /* @__PURE__ */ r.jsxs("div", { style: { position: "relative", ...I }, children: [
1259
- /* @__PURE__ */ r.jsxs("div", { style: { position: "relative" }, children: [
1260
- /* @__PURE__ */ r.jsx(
2293
+ }, [se, U]);
2294
+ Z(() => (s && t.length > 0 && !k && le(), () => {
2295
+ G.current && window.clearTimeout(G.current), M.current && window.clearTimeout(M.current);
2296
+ }), [g, k, s, t.length, le]), Z(() => {
2297
+ !N && s && t.length > 0 && !k && le();
2298
+ }, [g, N, s, t.length, k, le]);
2299
+ const l = (o) => {
2300
+ $(!0), G.current && window.clearTimeout(G.current), M.current && window.clearTimeout(M.current), v(!1), V(!1), a.onFocus?.(o);
2301
+ }, j = (o) => {
2302
+ $(!1), !i && t.length > 0 && (T(""), x(0)), a.onBlur?.(o);
2303
+ }, B = (o) => {
2304
+ const y = o.target.value;
2305
+ h && y.length > h || (m ? m(y) : O(y), a.onChange?.(o));
2306
+ }, J = () => {
2307
+ const o = m ? i : P;
2308
+ o.trim() && !q && (C?.(o), m || O(""));
2309
+ }, oe = (o) => {
2310
+ (o.ctrlKey || o.metaKey) && o.key === "Enter" && (o.preventDefault(), J()), a.onKeyDown?.(o);
2311
+ }, c = m ? i : P, f = q || !c.trim() || (h ? c.length > h : !1);
2312
+ return /* @__PURE__ */ d.jsxs("div", { style: { position: "relative", ...S }, children: [
2313
+ /* @__PURE__ */ d.jsxs("div", { style: { position: "relative" }, children: [
2314
+ /* @__PURE__ */ d.jsx(
1261
2315
  "textarea",
1262
2316
  {
1263
- ref: R,
1264
- value: d ? o : F,
1265
- onChange: w,
1266
- onFocus: (f) => {
1267
- f.target.style.borderColor = "#1890ff", f.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", e(f);
2317
+ ref: W,
2318
+ value: m ? i : P,
2319
+ onChange: B,
2320
+ onFocus: (o) => {
2321
+ o.target.style.borderColor = "#1890ff", o.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", l(o);
1268
2322
  },
1269
- onBlur: (f) => {
1270
- f.target.style.borderColor = "#d9d9d9", f.target.style.boxShadow = "none", u(f);
2323
+ onBlur: (o) => {
2324
+ o.target.style.borderColor = "#d9d9d9", o.target.style.boxShadow = "none", j(o);
1271
2325
  },
1272
- onKeyDown: Y,
1273
- placeholder: g || M ? s : "",
1274
- maxLength: m,
1275
- rows: N,
1276
- disabled: k,
2326
+ onKeyDown: oe,
2327
+ placeholder: k || c ? p : "",
2328
+ maxLength: h,
2329
+ rows: n,
2330
+ disabled: q,
1277
2331
  style: {
1278
2332
  width: "100%",
1279
- minHeight: `${N * 24 + 16}px`,
2333
+ minHeight: `${n * 24 + 16}px`,
1280
2334
  padding: "8px 60px 8px 12px",
1281
2335
  // 右侧留出按钮空间
1282
2336
  border: "1px solid #d9d9d9",
@@ -1289,12 +2343,12 @@ const $e = ({
1289
2343
  transition: "border-color 0.3s, box-shadow 0.3s",
1290
2344
  backgroundColor: "#fff",
1291
2345
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1292
- ...h.style
2346
+ ...a.style
1293
2347
  },
1294
- ...h
2348
+ ...a
1295
2349
  }
1296
2350
  ),
1297
- !g && !M && P && /* @__PURE__ */ r.jsxs(
2351
+ !k && !c && A && /* @__PURE__ */ d.jsxs(
1298
2352
  "div",
1299
2353
  {
1300
2354
  style: {
@@ -1316,8 +2370,8 @@ const $e = ({
1316
2370
  lineHeight: "1.5"
1317
2371
  },
1318
2372
  children: [
1319
- /* @__PURE__ */ r.jsx("span", { children: P }),
1320
- D && /* @__PURE__ */ r.jsx(
2373
+ /* @__PURE__ */ d.jsx("span", { children: A }),
2374
+ L && /* @__PURE__ */ d.jsx(
1321
2375
  "span",
1322
2376
  {
1323
2377
  style: {
@@ -1333,7 +2387,7 @@ const $e = ({
1333
2387
  ]
1334
2388
  }
1335
2389
  ),
1336
- /* @__PURE__ */ r.jsx(
2390
+ /* @__PURE__ */ d.jsx(
1337
2391
  "div",
1338
2392
  {
1339
2393
  style: {
@@ -1342,14 +2396,14 @@ const $e = ({
1342
2396
  right: 8,
1343
2397
  zIndex: 3
1344
2398
  },
1345
- children: /* @__PURE__ */ r.jsx(
1346
- X,
2399
+ children: /* @__PURE__ */ d.jsx(
2400
+ de,
1347
2401
  {
1348
2402
  type: "primary",
1349
2403
  size: "small",
1350
- icon: /* @__PURE__ */ r.jsx(Se, {}),
1351
- onClick: O,
1352
- disabled: Q,
2404
+ icon: /* @__PURE__ */ d.jsx(Ge, {}),
2405
+ onClick: J,
2406
+ disabled: f,
1353
2407
  style: {
1354
2408
  borderRadius: 6,
1355
2409
  minWidth: 32,
@@ -1358,13 +2412,13 @@ const $e = ({
1358
2412
  alignItems: "center",
1359
2413
  justifyContent: "center"
1360
2414
  },
1361
- children: _
2415
+ children: r
1362
2416
  }
1363
2417
  )
1364
2418
  }
1365
2419
  )
1366
2420
  ] }),
1367
- S && /* @__PURE__ */ r.jsxs(
2421
+ e && /* @__PURE__ */ d.jsxs(
1368
2422
  "div",
1369
2423
  {
1370
2424
  style: {
@@ -1374,13 +2428,13 @@ const $e = ({
1374
2428
  color: "#999"
1375
2429
  },
1376
2430
  children: [
1377
- M.length,
2431
+ c.length,
1378
2432
  "/",
1379
- m
2433
+ h
1380
2434
  ]
1381
2435
  }
1382
2436
  ),
1383
- /* @__PURE__ */ r.jsx("style", { children: `
2437
+ /* @__PURE__ */ d.jsx("style", { children: `
1384
2438
  @keyframes blink {
1385
2439
  0%, 50% { opacity: 1; }
1386
2440
  51%, 100% { opacity: 0; }
@@ -1388,7 +2442,7 @@ const $e = ({
1388
2442
  ` })
1389
2443
  ] });
1390
2444
  };
1391
- $e.__docgenInfo = {
2445
+ ht.__docgenInfo = {
1392
2446
  displayName: "DynamicTextArea",
1393
2447
  description: "动态文案文本域组件,支持流式文字动画效果",
1394
2448
  props: {
@@ -1474,96 +2528,96 @@ $e.__docgenInfo = {
1474
2528
  }
1475
2529
  }
1476
2530
  };
1477
- const de = ({
1478
- src: n,
1479
- poster: s,
1480
- width: i = 300,
1481
- height: l,
1482
- videoWidth: o,
2531
+ const Se = ({
2532
+ src: t,
2533
+ poster: p,
2534
+ width: u = 300,
2535
+ height: s,
2536
+ videoWidth: i,
1483
2537
  // 参数保留但不使用,由CSS控制
1484
- videoHeight: d,
2538
+ videoHeight: m,
1485
2539
  // 参数保留但不使用,由CSS控制
1486
- showPlayButton: E = !0,
1487
- autoPlayOnHover: m = !0,
1488
- onClick: S,
1489
- onVideoLoaded: _,
1490
- onVideoPlay: k,
1491
- onVideoPause: N,
1492
- onVideoEnded: I,
1493
- className: h,
1494
- style: P,
1495
- ...V
2540
+ showPlayButton: C = !0,
2541
+ autoPlayOnHover: h = !0,
2542
+ onClick: e,
2543
+ onVideoLoaded: r,
2544
+ onVideoPlay: q,
2545
+ onVideoPause: n,
2546
+ onVideoEnded: S,
2547
+ className: a,
2548
+ style: A,
2549
+ ...T
1496
2550
  }) => {
1497
- const a = z(null), [p, b] = j(!1), [T, g] = j(!1), [$, D] = j(!1), A = v(() => {
1498
- a.current && (a.current.play(), b(!0), k?.());
1499
- }, [k]), F = v(() => {
1500
- a.current && (a.current.pause(), b(!1), N?.());
1501
- }, [N]), x = v((C) => {
1502
- C.stopPropagation(), p ? F() : A();
1503
- }, [p, A, F]), L = v(() => {
1504
- g(!0), m && !p && A();
1505
- }, [m, p, A]), q = v(() => {
1506
- g(!1), m && p && F();
1507
- }, [m, p, F]), B = v(() => {
1508
- D(!0), _?.();
1509
- }, [_]), H = v(() => {
1510
- b(!0), k?.();
1511
- }, [k]), t = v(() => {
1512
- b(!1), N?.();
1513
- }, [N]), c = v(() => {
1514
- b(!1), I?.();
1515
- }, [I]), R = v((C) => {
1516
- S?.(C);
1517
- }, [S]);
1518
- return /* @__PURE__ */ r.jsx(
1519
- te,
2551
+ const g = K(null), [x, N] = z(!1), [v, k] = z(!1), [$, L] = z(!1), V = F(() => {
2552
+ g.current && (g.current.play(), N(!0), q?.());
2553
+ }, [q]), P = F(() => {
2554
+ g.current && (g.current.pause(), N(!1), n?.());
2555
+ }, [n]), O = F((U) => {
2556
+ U.stopPropagation(), x ? P() : V();
2557
+ }, [x, V, P]), G = F(() => {
2558
+ k(!0), h && !x && V();
2559
+ }, [h, x, V]), M = F(() => {
2560
+ k(!1), h && x && P();
2561
+ }, [h, x, P]), Y = F(() => {
2562
+ L(!0), r?.();
2563
+ }, [r]), te = F(() => {
2564
+ N(!0), q?.();
2565
+ }, [q]), w = F(() => {
2566
+ N(!1), n?.();
2567
+ }, [n]), _ = F(() => {
2568
+ N(!1), S?.();
2569
+ }, [S]), W = F((U) => {
2570
+ e?.(U);
2571
+ }, [e]);
2572
+ return /* @__PURE__ */ d.jsx(
2573
+ ve,
1520
2574
  {
1521
- ...V,
1522
- className: `video-card ${h || ""}`,
2575
+ ...T,
2576
+ className: `video-card ${a || ""}`,
1523
2577
  style: {
1524
- width: i,
1525
- height: l,
2578
+ width: u,
2579
+ height: s,
1526
2580
  padding: 0,
1527
2581
  overflow: "hidden",
1528
- cursor: S ? "pointer" : "default",
2582
+ cursor: e ? "pointer" : "default",
1529
2583
  border: "none",
1530
2584
  borderRadius: 0,
1531
- ...P
2585
+ ...A
1532
2586
  },
1533
2587
  bordered: !1,
1534
- onMouseEnter: L,
1535
- onMouseLeave: q,
1536
- onClick: R,
1537
- children: /* @__PURE__ */ r.jsxs("div", { className: "video-card-container", children: [
1538
- /* @__PURE__ */ r.jsx(
2588
+ onMouseEnter: G,
2589
+ onMouseLeave: M,
2590
+ onClick: W,
2591
+ children: /* @__PURE__ */ d.jsxs("div", { className: "video-card-container", children: [
2592
+ /* @__PURE__ */ d.jsx(
1539
2593
  "video",
1540
2594
  {
1541
- ref: a,
1542
- src: n,
1543
- poster: s,
2595
+ ref: g,
2596
+ src: t,
2597
+ poster: p,
1544
2598
  preload: "metadata",
1545
- onLoadedData: B,
1546
- onPlay: H,
1547
- onPause: t,
1548
- onEnded: c,
2599
+ onLoadedData: Y,
2600
+ onPlay: te,
2601
+ onPause: w,
2602
+ onEnded: _,
1549
2603
  muted: !0,
1550
2604
  loop: !0
1551
2605
  }
1552
2606
  ),
1553
- E && /* @__PURE__ */ r.jsx(
2607
+ C && /* @__PURE__ */ d.jsx(
1554
2608
  "div",
1555
2609
  {
1556
- className: `video-play-button ${T ? "hovered" : ""}`,
1557
- onClick: x,
1558
- children: p ? /* @__PURE__ */ r.jsx(qe, { className: "play-icon" }) : /* @__PURE__ */ r.jsx(Ce, { className: "play-icon" })
2610
+ className: `video-play-button ${v ? "hovered" : ""}`,
2611
+ onClick: O,
2612
+ children: x ? /* @__PURE__ */ d.jsx(Fe, { className: "play-icon" }) : /* @__PURE__ */ d.jsx(ze, { className: "play-icon" })
1559
2613
  }
1560
2614
  ),
1561
- !$ && /* @__PURE__ */ r.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ r.jsx("div", { className: "loading-spinner" }) })
2615
+ !$ && /* @__PURE__ */ d.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ d.jsx("div", { className: "loading-spinner" }) })
1562
2616
  ] })
1563
2617
  }
1564
2618
  );
1565
2619
  };
1566
- de.__docgenInfo = {
2620
+ Se.__docgenInfo = {
1567
2621
  displayName: "VideoCard",
1568
2622
  description: "视频卡片组件,支持鼠标悬浮播放控制",
1569
2623
  props: {
@@ -1664,12 +2718,12 @@ de.__docgenInfo = {
1664
2718
  }
1665
2719
  }
1666
2720
  };
1667
- const De = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((i) => n.toLowerCase().includes(i)), We = (n) => n.type ? n.type : De(n.url) ? "video" : "image", He = ({
1668
- items: n,
1669
- columns: s,
1670
- gap: i = 0,
1671
- responsive: l = !0,
1672
- breakpoints: o = {
2721
+ const gt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((u) => t.toLowerCase().includes(u)), bt = (t) => t.type ? t.type : gt(t.url) ? "video" : "image", xt = ({
2722
+ items: t,
2723
+ columns: p,
2724
+ gap: u = 0,
2725
+ responsive: s = !0,
2726
+ breakpoints: i = {
1673
2727
  xs: 1,
1674
2728
  sm: 2,
1675
2729
  md: 3,
@@ -1677,108 +2731,108 @@ const De = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
1677
2731
  xl: 5,
1678
2732
  xxl: 6
1679
2733
  },
1680
- className: d,
1681
- style: E,
1682
- onClick: m
2734
+ className: m,
2735
+ style: C,
2736
+ onClick: h
1683
2737
  }) => {
1684
- const S = z(null), [_, k] = j(s || o.md || 3), N = z(/* @__PURE__ */ new Map()), I = v(() => {
1685
- if (!l || s)
1686
- return s || o.md || 3;
1687
- const a = window.innerWidth;
1688
- return a < 576 ? o.xs || 1 : a < 768 ? o.sm || 2 : a < 992 ? o.md || 3 : a < 1200 ? o.lg || 4 : a < 1600 ? o.xl || 5 : o.xxl || 6;
1689
- }, [l, s, o]), h = v(() => {
1690
- if (!S.current) return;
1691
- const a = _, p = S.current, T = (p.offsetWidth - i * (a - 1)) / a, g = new Array(a).fill(0);
1692
- n.forEach((D, A) => {
1693
- const F = D.id || A, x = N.current.get(F);
1694
- if (!x) return;
1695
- const L = Math.min(...g), q = g.indexOf(L), B = q * (T + i), H = g[q];
1696
- x.style.position = "absolute", x.style.left = `${B}px`, x.style.top = `${H}px`, x.style.width = `${T}px`, g[q] += x.offsetHeight + i;
2738
+ const e = K(null), [r, q] = z(p || i.md || 3), n = K(/* @__PURE__ */ new Map()), S = F(() => {
2739
+ if (!s || p)
2740
+ return p || i.md || 3;
2741
+ const g = window.innerWidth;
2742
+ return g < 576 ? i.xs || 1 : g < 768 ? i.sm || 2 : g < 992 ? i.md || 3 : g < 1200 ? i.lg || 4 : g < 1600 ? i.xl || 5 : i.xxl || 6;
2743
+ }, [s, p, i]), a = F(() => {
2744
+ if (!e.current) return;
2745
+ const g = r, x = e.current, v = (x.offsetWidth - u * (g - 1)) / g, k = new Array(g).fill(0);
2746
+ t.forEach((L, V) => {
2747
+ const P = L.id || V, O = n.current.get(P);
2748
+ if (!O) return;
2749
+ const G = Math.min(...k), M = k.indexOf(G), Y = M * (v + u), te = k[M];
2750
+ O.style.position = "absolute", O.style.left = `${Y}px`, O.style.top = `${te}px`, O.style.width = `${v}px`, k[M] += O.offsetHeight + u;
1697
2751
  });
1698
- const $ = Math.max(...g);
1699
- p.style.height = `${$}px`;
1700
- }, [n, _, i]);
1701
- U(() => {
1702
- const a = () => {
1703
- const p = I();
1704
- p !== _ && k(p);
2752
+ const $ = Math.max(...k);
2753
+ x.style.height = `${$}px`;
2754
+ }, [t, r, u]);
2755
+ Z(() => {
2756
+ const g = () => {
2757
+ const x = S();
2758
+ x !== r && q(x);
1705
2759
  };
1706
- if (l)
1707
- return window.addEventListener("resize", a), a(), () => window.removeEventListener("resize", a);
1708
- }, [l, I, _]), U(() => {
1709
- const a = setTimeout(() => {
1710
- h();
2760
+ if (s)
2761
+ return window.addEventListener("resize", g), g(), () => window.removeEventListener("resize", g);
2762
+ }, [s, S, r]), Z(() => {
2763
+ const g = setTimeout(() => {
2764
+ a();
1711
2765
  }, 100);
1712
- return () => clearTimeout(a);
1713
- }, [n, _, h]);
1714
- const P = v(() => {
1715
- h();
1716
- }, [h]), V = v((a) => {
1717
- m && m(a), a.onClick?.(a);
1718
- }, [m]);
1719
- return /* @__PURE__ */ r.jsx(
2766
+ return () => clearTimeout(g);
2767
+ }, [t, r, a]);
2768
+ const A = F(() => {
2769
+ a();
2770
+ }, [a]), T = F((g) => {
2771
+ h && h(g), g.onClick?.(g);
2772
+ }, [h]);
2773
+ return /* @__PURE__ */ d.jsx(
1720
2774
  "div",
1721
2775
  {
1722
- ref: S,
1723
- className: `waterfall-container ${d || ""}`,
2776
+ ref: e,
2777
+ className: `waterfall-container ${m || ""}`,
1724
2778
  style: {
1725
2779
  position: "relative",
1726
2780
  width: "100%",
1727
- ...E
2781
+ ...C
1728
2782
  },
1729
- children: n.map((a, p) => {
1730
- const b = a.id || p, T = We(a);
1731
- return /* @__PURE__ */ r.jsx(
2783
+ children: t.map((g, x) => {
2784
+ const N = g.id || x, v = bt(g);
2785
+ return /* @__PURE__ */ d.jsx(
1732
2786
  "div",
1733
2787
  {
1734
- ref: (g) => {
1735
- g ? N.current.set(b, g) : N.current.delete(b);
2788
+ ref: (k) => {
2789
+ k ? n.current.set(N, k) : n.current.delete(N);
1736
2790
  },
1737
2791
  className: "waterfall-item",
1738
- children: T === "video" ? /* @__PURE__ */ r.jsx("div", { style: {
2792
+ children: v === "video" ? /* @__PURE__ */ d.jsx("div", { style: {
1739
2793
  width: "100%",
1740
2794
  position: "relative",
1741
2795
  paddingBottom: "56.25%",
1742
- cursor: m || a.onClick ? "pointer" : "default"
1743
- }, children: /* @__PURE__ */ r.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ r.jsx(
1744
- de,
2796
+ cursor: h || g.onClick ? "pointer" : "default"
2797
+ }, children: /* @__PURE__ */ d.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ d.jsx(
2798
+ Se,
1745
2799
  {
1746
- src: a.url,
1747
- poster: a.poster,
2800
+ src: g.url,
2801
+ poster: g.poster,
1748
2802
  width: "100%",
1749
2803
  height: "100%",
1750
- onClick: () => V(a),
1751
- onVideoLoaded: P,
2804
+ onClick: () => T(g),
2805
+ onVideoLoaded: A,
1752
2806
  autoPlayOnHover: !0,
1753
2807
  showPlayButton: !1
1754
2808
  }
1755
- ) }) }) : /* @__PURE__ */ r.jsx(
2809
+ ) }) }) : /* @__PURE__ */ d.jsx(
1756
2810
  "div",
1757
2811
  {
1758
2812
  className: "waterfall-image-wrapper",
1759
- onClick: () => V(a),
1760
- style: { cursor: m || a.onClick ? "pointer" : "default" },
1761
- children: /* @__PURE__ */ r.jsx(
2813
+ onClick: () => T(g),
2814
+ style: { cursor: h || g.onClick ? "pointer" : "default" },
2815
+ children: /* @__PURE__ */ d.jsx(
1762
2816
  "img",
1763
2817
  {
1764
- src: a.url,
1765
- alt: `瀑布流图片 ${p + 1}`,
2818
+ src: g.url,
2819
+ alt: `瀑布流图片 ${x + 1}`,
1766
2820
  className: "waterfall-image",
1767
- onLoad: P,
1768
- onError: P,
2821
+ onLoad: A,
2822
+ onError: A,
1769
2823
  style: { display: "block", width: "100%", height: "auto" }
1770
2824
  }
1771
2825
  )
1772
2826
  }
1773
2827
  )
1774
2828
  },
1775
- b
2829
+ N
1776
2830
  );
1777
2831
  })
1778
2832
  }
1779
2833
  );
1780
2834
  };
1781
- He.__docgenInfo = {
2835
+ xt.__docgenInfo = {
1782
2836
  displayName: "Waterfall",
1783
2837
  description: "瀑布流布局组件,支持图片和视频混合展示",
1784
2838
  props: {
@@ -1834,8 +2888,8 @@ He.__docgenInfo = {
1834
2888
  }
1835
2889
  }
1836
2890
  };
1837
- const Je = {
1838
- algorithm: we.defaultAlgorithm,
2891
+ const Tt = {
2892
+ algorithm: Oe.defaultAlgorithm,
1839
2893
  token: {
1840
2894
  // 主色
1841
2895
  colorPrimary: "#3b82f6",
@@ -1901,19 +2955,20 @@ const Je = {
1901
2955
  }
1902
2956
  };
1903
2957
  export {
1904
- Be as AdvancedTable,
1905
- Ie as AppModal,
1906
- ze as BackButton,
1907
- ke as Button,
1908
- Ne as Card,
1909
- Me as DynamicInput,
1910
- $e as DynamicTextArea,
1911
- Oe as EmptyAndSpin,
1912
- Fe as LinkButton,
1913
- Pe as PageTable,
1914
- de as VideoCard,
1915
- He as Waterfall,
1916
- Ae as XcIcon,
1917
- Je as lightTheme
2958
+ ot as AdvancedTable,
2959
+ Je as AppModal,
2960
+ nt as BackButton,
2961
+ Ye as Button,
2962
+ Ue as Card,
2963
+ yt as DynamicInput,
2964
+ ht as DynamicTextArea,
2965
+ tt as EmptyAndSpin,
2966
+ rt as LinkButton,
2967
+ Qe as PageTable,
2968
+ mt as RichTextEditor,
2969
+ Se as VideoCard,
2970
+ xt as Waterfall,
2971
+ et as XcIcon,
2972
+ Tt as lightTheme
1918
2973
  };
1919
2974
  //# sourceMappingURL=index.es.js.map